home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD2.img
/
d4xx
/
d496
/
memmometer
/
mminit.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-06
|
28KB
|
799 lines
/* : ai=0 bk=0 ts=8 */
#include "mm.h"
#define PROJMAX 3 /* number of project menu items */
#define SETUPMAX 2 /* number of setup menu items */
#define MODEMAX 2
#define FREQMAX 4 /* number of frequency menu items */
#define PRIOMAX 16 /* number of priority menu items */
#define CHIPMAX 5 /* number of chip mem size menu items */
#define CHIPAMAX 6 /* number of chip mem base addr menu items */
#define SFMAX 11 /* number of sf mem size menu items */
#define SFAMAX 16 /* number of sf mem base addr menu items */
#define FASTMAX 16 /* number of fast mem size menu items */
#define FASTAMAX 16 /* number of fast mem base addr menu items */
#define MAXMENU 9 /* total number of top level menus */
extern BOOL p_mode; /* preset frags mode = 0, warps mode = 1 */
extern long p_rate; /* preset sample interval, secs see menu */
extern long p_priority; /* preset priority, range -100 to +100 */
extern long p_chip; /* preset chip mem size, kbytes see menu */
extern long p_chipa; /* preset chip mem address, kb see menu */
extern long p_sf; /* preset slowfast mem size, kb see menu */
extern long p_sfa; /* preset slowfast mem addr, kb see menu */
extern long p_fast; /* preset fast mem size, mbytes see menu */
extern long p_fasta; /* preset fast mem addr, mbytes see menu */
/******************************************************/
/* Structure declarations for the menu sections */
/******************************************************/
struct MenuItem ProjItem[PROJMAX];
struct IntuiText ProjText[PROJMAX];
struct MenuItem SetupItem[SETUPMAX];
struct IntuiText SetupText[SETUPMAX];
struct MenuItem ModeItem[MODEMAX];
struct IntuiText ModeText[MODEMAX];
struct MenuItem FreqItem[FREQMAX];
struct IntuiText FreqText[FREQMAX];
struct MenuItem PrioItem[PRIOMAX];
struct IntuiText PrioText[PRIOMAX];
struct MenuItem ChipItem[CHIPMAX];
struct IntuiText ChipText[CHIPMAX];
struct MenuItem ChipAItem[CHIPAMAX];
struct IntuiText ChipAText[CHIPAMAX];
struct MenuItem SFItem[SFMAX];
struct IntuiText SFText[SFMAX];
struct MenuItem SFAItem[SFAMAX];
struct IntuiText SFAText[SFAMAX];
struct MenuItem FastItem[FASTMAX];
struct IntuiText FastText[FASTMAX];
struct MenuItem FastAItem[FASTAMAX];
struct IntuiText FastAText[FASTAMAX];
struct Menu menu[MAXMENU];
/*****************************************************************/
/* The following function initializes the structure arrays */
/* needed to provide the Project menu topic. */
/* this was left retro-compatible with Manx 3.4a (nplus1) */
/*****************************************************************/
void InitProjItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<PROJMAX; n++ )
{
nplus1 = n + 1;
ProjItem[n].NextItem = &ProjItem[nplus1];
ProjItem[n].LeftEdge = 0;
ProjItem[n].TopEdge = 9 * n;
ProjItem[n].Width = 64;
ProjItem[n].Height = 9;
ProjItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP;
ProjItem[n].MutualExclude = 0;
ProjItem[n].ItemFill = (APTR)&ProjText[n];
ProjItem[n].SelectFill = NULL;
ProjItem[n].Command = 0;
ProjItem[n].SubItem = NULL;
ProjItem[n].NextSelect = 0;
ProjText[n].FrontPen = BLUP;
ProjText[n].BackPen = WHTP;
ProjText[n].DrawMode = JAM2;/* render in fore and background */
ProjText[n].LeftEdge = 0;
ProjText[n].TopEdge = 1;
ProjText[n].ITextFont = NULL;
ProjText[n].NextText = NULL;
}
ProjItem[PROJMAX-1].NextItem = NULL;
/* initialize text for specific menu items */
ProjText[0].IText = (UBYTE *)"Front";
ProjText[1].IText = (UBYTE *)"Back";
ProjText[2].IText = (UBYTE *)"Quit";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Setup menu topic. */
/*****************************************************************/
void InitSetupItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<SETUPMAX; n++ )
{
nplus1 = n + 1;
SetupItem[n].NextItem = &SetupItem[nplus1];
SetupItem[n].LeftEdge = 0;
SetupItem[n].TopEdge = 9 * n;
SetupItem[n].Width = 44;
SetupItem[n].Height = 9;
SetupItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP ;
SetupItem[n].MutualExclude = 0;
SetupItem[n].ItemFill = (APTR)&SetupText[n];
SetupItem[n].SelectFill = NULL;
SetupItem[n].Command = 0;
SetupItem[n].NextSelect = 0;
SetupText[n].FrontPen = BLUP;
SetupText[n].BackPen = WHTP;
SetupText[n].DrawMode = JAM2;
SetupText[n].LeftEdge = 0;
SetupText[n].TopEdge = 1;
SetupText[n].ITextFont = NULL;
SetupText[n].NextText = NULL;
}
SetupItem[SETUPMAX-1].NextItem = NULL;
SetupText[0].IText = (UBYTE *)"Mode";
SetupItem[0].SubItem = ModeItem;
SetupText[1].IText = (UBYTE *)"Freq";
SetupItem[1].SubItem = FreqItem;
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Mode submenu topic. */
/*****************************************************************/
for( n=0; n<MODEMAX; n++ )
{
nplus1 = n + 1;
ModeItem[n].NextItem = &ModeItem[nplus1];
ModeItem[n].LeftEdge = 38;
ModeItem[n].TopEdge = 9 * n;
ModeItem[n].Width = 72;
ModeItem[n].Height = 9;
ModeItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
ModeItem[n].MutualExclude = (~(1 << n));
ModeItem[n].ItemFill = (APTR)&ModeText[n];
ModeItem[n].SelectFill = NULL;
ModeItem[n].Command = 0;
ModeItem[n].SubItem = NULL;
ModeItem[n].NextSelect = 0;
ModeText[n].FrontPen = BLUP;
ModeText[n].BackPen = WHTP;
ModeText[n].DrawMode = JAM2; /* render in fore and background */
ModeText[n].LeftEdge = 0;
ModeText[n].TopEdge = 1;
ModeText[n].ITextFont = NULL;
ModeText[n].NextText = NULL;
}
ModeItem[MODEMAX-1].NextItem = NULL;
/* select mode subitem checked */
switch (p_mode) {
case 0: n = 0; break;
case 1: n = 1; break;
default: n = 1; p_mode = FALSE;
}
ModeItem[n].Flags |= CHECKED;
/* initialize text for specific submenu items */
ModeText[0].IText = (UBYTE *)" Frags";
ModeText[1].IText = (UBYTE *)" Warps";
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Freq submenu topic. */
/*****************************************************************/
for( n=0; n<FREQMAX; n++ )
{
nplus1 = n + 1;
FreqItem[n].NextItem = &FreqItem[nplus1];
FreqItem[n].LeftEdge = 38;
FreqItem[n].TopEdge = 9 * n;
FreqItem[n].Width = 88;
FreqItem[n].Height = 9;
FreqItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
FreqItem[n].MutualExclude = (~(1 << n));
FreqItem[n].ItemFill = (APTR)&FreqText[n];
FreqItem[n].SelectFill = NULL;
FreqItem[n].Command = 0;
FreqItem[n].SubItem = NULL;
FreqItem[n].NextSelect = 0;
FreqText[n].FrontPen = BLUP;
FreqText[n].BackPen = WHTP;
FreqText[n].DrawMode = JAM2; /* render in fore and background */
FreqText[n].LeftEdge = 0;
FreqText[n].TopEdge = 1;
FreqText[n].ITextFont = NULL;
FreqText[n].NextText = NULL;
}
FreqItem[FREQMAX-1].NextItem = NULL;
/* select frequency item checked */
switch (p_rate) {
case 1: n = 0; break;
case 2: n = 1; break;
case 5: n = 2; break;
case 10: n = 3; break;
default: n = 1; p_rate = 2;
}
FreqItem[n].Flags |= CHECKED;
/* initialize text for specific menu items */
FreqText[0].IText = (UBYTE *)" 1 Sec ";
FreqText[1].IText = (UBYTE *)" 2 Secs";
FreqText[2].IText = (UBYTE *)" 5 Secs";
FreqText[3].IText = (UBYTE *)" 10 Secs";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Priority menu topic. */
/*****************************************************************/
void InitPrioItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<PRIOMAX; n++ )
{
nplus1 = n + 1;
PrioItem[n].NextItem = &PrioItem[nplus1];
PrioItem[n].LeftEdge = 0;
PrioItem[n].TopEdge = 9 * n;
PrioItem[n].Width = 80;
PrioItem[n].Height = 9;
PrioItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
PrioItem[n].MutualExclude = (~(1 << n));
if (n < 3) PrioItem[n].MutualExclude &= 0x0007;
if (n < 1) PrioItem[n].MutualExclude |= 0x0007;
PrioItem[n].ItemFill = (APTR)&PrioText[n];
PrioItem[n].SelectFill = NULL;
PrioItem[n].Command = 0;
PrioItem[n].NextSelect = 0;
PrioText[n].FrontPen = BLUP;
PrioText[n].BackPen = WHTP;
if (n > 11) {
PrioText[n].FrontPen = ORNP;
PrioText[n].BackPen = REDP;
}
PrioText[n].DrawMode = JAM2;
PrioText[n].LeftEdge = 0;
PrioText[n].TopEdge = 1;
PrioText[n].ITextFont = NULL;
PrioText[n].NextText = NULL;
}
PrioItem[PRIOMAX-1].NextItem = NULL;
/* select priority item checked */
switch (p_priority) {
case -99: n = 3; break;
case -75: n = 4; break;
case -50: n = 5; break;
case -25: n = 6; break;
case -20: n = 7; break;
case -15: n = 8; break;
case -10: n = 9; break;
case -5: n = 10; break;
case 0: n = 11; break;
case 5: n = 12; break;
case 10: n = 13; break;
case 15: n = 14; break;
case 20: n = 15; break;
default: n = 11; p_priority = 0;
}
PrioItem[n].Flags |= CHECKED;
PrioText[ 0].IText = (UBYTE *)" NORM ";
PrioText[ 1].IText = (UBYTE *)" DECR ";
PrioText[ 2].IText = (UBYTE *)" INCR ";
PrioText[ 3].IText = (UBYTE *)" -99 ";
PrioText[ 4].IText = (UBYTE *)" -75 ";
PrioText[ 5].IText = (UBYTE *)" -50 ";
PrioText[ 6].IText = (UBYTE *)" -25 ";
PrioText[ 7].IText = (UBYTE *)" -20 ";
PrioText[ 8].IText = (UBYTE *)" -15 ";
PrioText[ 9].IText = (UBYTE *)" -10 ";
PrioText[10].IText = (UBYTE *)" -5 ";
PrioText[11].IText = (UBYTE *)" 0 ";
PrioText[12].IText = (UBYTE *)" 5 ";
PrioText[13].IText = (UBYTE *)" 10 ";
PrioText[14].IText = (UBYTE *)" 15 ";
PrioText[15].IText = (UBYTE *)" 20 ";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Chip Mem Size menu topic. */
/*****************************************************************/
void InitChipItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<CHIPMAX; n++ )
{
nplus1 = n + 1;
ChipItem[n].NextItem = &ChipItem[nplus1];
ChipItem[n].LeftEdge = 0;
ChipItem[n].TopEdge = 9 * n;
ChipItem[n].Width = 80;
ChipItem[n].Height = 9;
ChipItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
ChipItem[n].MutualExclude = (~(1 << n));
ChipItem[n].ItemFill = (APTR)&ChipText[n];
ChipItem[n].SelectFill = NULL;
ChipItem[n].Command = 0;
ChipItem[n].NextSelect = 0;
ChipText[n].FrontPen = BLUP;
ChipText[n].BackPen = WHTP;
ChipText[n].DrawMode = JAM2;
ChipText[n].LeftEdge = 0;
ChipText[n].TopEdge = 1;
ChipText[n].ITextFont = NULL;
ChipText[n].NextText = NULL;
}
ChipItem[CHIPMAX-1].NextItem = NULL;
/* select chip mem size item checked */
switch (p_chip) {
case 0: n = 0; break;
case 256: n = 1; break;
case 512: n = 2; break;
case 1024: n = 3; break;
case 2048: n = 4; break;
default: n = 2; p_chip = 512;
}
ChipItem[n].Flags |= CHECKED;
ChipText[0].IText = (UBYTE *)" NONE";
ChipText[1].IText = (UBYTE *)" 256K";
ChipText[2].IText = (UBYTE *)" 512K";
ChipText[3].IText = (UBYTE *)" 1 MB";
ChipText[4].IText = (UBYTE *)" 2 MB";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Chip Base Addr menu topic. */
/*****************************************************************/
void InitChipAItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<CHIPAMAX; n++ )
{
nplus1 = n + 1;
ChipAItem[n].NextItem = &ChipAItem[nplus1];
ChipAItem[n].LeftEdge = 0;
ChipAItem[n].TopEdge = 9 * n;
ChipAItem[n].Width = 80;
ChipAItem[n].Height = 9;
ChipAItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
ChipAItem[n].MutualExclude = (~(1 << n));
ChipAItem[n].ItemFill = (APTR)&ChipAText[n];
ChipAItem[n].SelectFill = NULL;
ChipAItem[n].Command = 0;
ChipAItem[n].NextSelect = 0;
ChipAText[n].FrontPen = BLUP;
ChipAText[n].BackPen = WHTP;
ChipAText[n].DrawMode = JAM2;
ChipAText[n].LeftEdge = 0;
ChipAText[n].TopEdge = 1;
ChipAText[n].ITextFont = NULL;
ChipAText[n].NextText = NULL;
}
ChipAItem[CHIPAMAX-1].NextItem = NULL;
/* select chip base address item checked */
switch (p_chipa) {
case 0: n = 0; break;
case 256: n = 1; break;
case 512: n = 2; break;
case 768: n = 3; break;
case 1024: n = 4; break;
case 1536: n = 5; break;
default: n = 0; p_chipa = 0;
}
ChipAItem[n].Flags |= CHECKED;
ChipAText[0].IText = (UBYTE *)" @ 0K";
ChipAText[1].IText = (UBYTE *)" @ 256K";
ChipAText[2].IText = (UBYTE *)" @ 512K";
ChipAText[3].IText = (UBYTE *)" @ 768K";
ChipAText[4].IText = (UBYTE *)" @ 1.0M";
ChipAText[5].IText = (UBYTE *)" @ 1.5M";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Slow Fast Mem Size menu topic. */
/*****************************************************************/
void InitSFItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<SFMAX; n++ )
{
nplus1 = n + 1;
SFItem[n].NextItem = &SFItem[nplus1];
SFItem[n].LeftEdge = 0;
SFItem[n].TopEdge = 9 * n;
SFItem[n].Width = 80;
SFItem[n].Height = 9;
SFItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
SFItem[n].MutualExclude = (~(1 << n));
SFItem[n].ItemFill = (APTR)&SFText[n];
SFItem[n].SelectFill = NULL;
SFItem[n].Command = 0;
SFItem[n].NextSelect = 0;
SFText[n].FrontPen = BLUP;
SFText[n].BackPen = WHTP;
SFText[n].DrawMode = JAM2;
SFText[n].LeftEdge = 0;
SFText[n].TopEdge = 1;
SFText[n].ITextFont = NULL;
SFText[n].NextText = NULL;
}
SFItem[SFMAX-1].NextItem = NULL;
/* select slow fast mem size item checked */
switch (p_sf) {
case 0: n = 0; break;
case 256: n = 1; break;
case 512: n = 2; break;
case 768: n = 3; break;
case 1024: n = 4; break;
case 1536: n = 5; break;
case 2048: n = 6; break;
case 3072: n = 7; break;
case 4096: n = 8; break;
case 6144: n = 9; break;
case 8192: n = 10; break;
default: n = 0; p_sf = 0;
}
SFItem[n].Flags |= CHECKED;
SFText[ 0].IText = (UBYTE *)" NONE ";
SFText[ 1].IText = (UBYTE *)" .25 MB";
SFText[ 2].IText = (UBYTE *)" .5 MB";
SFText[ 3].IText = (UBYTE *)" .75 MB";
SFText[ 4].IText = (UBYTE *)" 1.0 MB";
SFText[ 5].IText = (UBYTE *)" 1.5 MB";
SFText[ 6].IText = (UBYTE *)" 2.0 MB";
SFText[ 7].IText = (UBYTE *)" 3.0 MB";
SFText[ 8].IText = (UBYTE *)" 4.0 MB";
SFText[ 9].IText = (UBYTE *)" 6.0 MB";
SFText[10].IText = (UBYTE *)" 8.0 MB";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Slow Fast Mem Base Addr menu topic. */
/*****************************************************************/
void InitSFAItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<SFAMAX; n++ )
{
nplus1 = n + 1;
SFAItem[n].NextItem = &SFAItem[nplus1];
SFAItem[n].LeftEdge = 0;
SFAItem[n].TopEdge = 9 * n;
SFAItem[n].Width = 104;
SFAItem[n].Height = 9;
SFAItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
SFAItem[n].MutualExclude = (~(1 << n));
SFAItem[n].ItemFill = (APTR)&SFAText[n];
SFAItem[n].SelectFill = NULL;
SFAItem[n].Command = 0;
SFAItem[n].NextSelect = 0;
SFAText[n].FrontPen = BLUP;
SFAText[n].BackPen = WHTP;
SFAText[n].DrawMode = JAM2;
SFAText[n].LeftEdge = 0;
SFAText[n].TopEdge = 1;
SFAText[n].ITextFont = NULL;
SFAText[n].NextText = NULL;
}
SFAItem[SFAMAX-1].NextItem = NULL;
/* select slow fast mem base address item checked */
switch (p_sfa) {
case 2048: n = 0; break; /* 0x0800 kb = 2 mb */
case 2304: n = 1; break; /* 0x0900 kb = 2.25 mb */
case 2560: n = 2; break; /* 0x0A00 kb = 2.5 mb */
case 2816: n = 3; break; /* 0x0B00 kb = 2.75 mb */
case 3072: n = 4; break; /* 0x0C00 kb = 3 mb */
case 4096: n = 5; break; /* 0x1000 kb = 4 mb */
case 5120: n = 6; break; /* 0x1400 kb = 5 mb */
case 6144: n = 7; break; /* 0x1800 kb = 6 mb */
case 7168: n = 8; break; /* 0x1C00 kb = 7 mb */
case 8192: n = 9; break; /* 0x2000 kb = 8 mb */
case 9216: n = 10; break; /* 0x2400 kb = 9 mb */
case 12288: n = 11; break; /* 0x3000 kb = 12 mb */
case 12544: n = 12; break; /* 0x3100 kb = 12.25 mb */
case 12800: n = 13; break; /* 0x3200 kb = 12.5 mb */
case 13056: n = 14; break; /* 0x3300 kb = 12.75 mb */
case 13312: n = 15; break; /* 0x3400 kb = 13 mb */
default: n = 0; p_sfa = 2048;
}
SFAItem[n].Flags |= CHECKED;
SFAText[ 0].IText = (UBYTE *)" @ 2.0 Meg";
SFAText[ 1].IText = (UBYTE *)" @ 2.4 Meg";
SFAText[ 2].IText = (UBYTE *)" @ 2.8 Meg";
SFAText[ 3].IText = (UBYTE *)" @ 2.C Meg";
SFAText[ 4].IText = (UBYTE *)" @ 3.0 Meg";
SFAText[ 5].IText = (UBYTE *)" @ 4.0 Meg";
SFAText[ 6].IText = (UBYTE *)" @ 5.0 Meg";
SFAText[ 7].IText = (UBYTE *)" @ 6.0 Meg";
SFAText[ 8].IText = (UBYTE *)" @ 7.0 Meg";
SFAText[ 9].IText = (UBYTE *)" @ 8.0 Meg";
SFAText[10].IText = (UBYTE *)" @ 9.0 Meg";
SFAText[11].IText = (UBYTE *)" @ C.0 Meg";
SFAText[12].IText = (UBYTE *)" @ C.4 Meg";
SFAText[13].IText = (UBYTE *)" @ C.8 Meg";
SFAText[14].IText = (UBYTE *)" @ C.C Meg";
SFAText[15].IText = (UBYTE *)" @ D.0 Meg";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Fast Mem Size menu topic. */
/*****************************************************************/
void InitFastItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<FASTMAX; n++ )
{
nplus1 = n + 1;
FastItem[n].NextItem = &FastItem[nplus1];
FastItem[n].LeftEdge = 0;
FastItem[n].TopEdge = 9 * n;
FastItem[n].Width = 80;
FastItem[n].Height = 9;
FastItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
FastItem[n].MutualExclude = (~(1 << n));
FastItem[n].ItemFill = (APTR)&FastText[n];
FastItem[n].SelectFill = NULL;
FastItem[n].Command = 0;
FastItem[n].NextSelect = 0;
FastText[n].FrontPen = BLUP;
FastText[n].BackPen = WHTP;
FastText[n].DrawMode = JAM2;
FastText[n].LeftEdge = 0;
FastText[n].TopEdge = 1;
FastText[n].ITextFont = NULL;
FastText[n].NextText = NULL;
}
FastItem[FASTMAX-1].NextItem = NULL;
/* select fast mem size item checked */
switch (p_fast) {
case 0: n = 0; break;
case 256: n = 1; break;
case 512: n = 2; break;
case 756: n = 3; break;
case 1: n = 4; break;
case 2: n = 5; break;
case 3: n = 6; break;
case 4: n = 7; break;
case 6: n = 8; break;
case 8: n = 9; break;
case 10: n = 10; break;
case 12: n = 11; break;
case 13: n = 12; break;
case 14: n = 13; break;
case 15: n = 14; break;
case 16: n = 15; break;
default: n = 0; p_fast = 0;
}
FastItem[n].Flags |= CHECKED;
FastText[ 0].IText = (UBYTE *)" NONE";
FastText[ 1].IText = (UBYTE *)" 256K";
FastText[ 2].IText = (UBYTE *)" 512K";
FastText[ 3].IText = (UBYTE *)" 756K";
FastText[ 4].IText = (UBYTE *)" 1 MB";
FastText[ 5].IText = (UBYTE *)" 2 MB";
FastText[ 6].IText = (UBYTE *)" 3 MB";
FastText[ 7].IText = (UBYTE *)" 4 MB";
FastText[ 8].IText = (UBYTE *)" 6 MB";
FastText[ 9].IText = (UBYTE *)" 8 MB";
FastText[10].IText = (UBYTE *)" 10 MB";
FastText[11].IText = (UBYTE *)" 12 MB";
FastText[12].IText = (UBYTE *)" 13 MB";
FastText[13].IText = (UBYTE *)" 14 MB";
FastText[14].IText = (UBYTE *)" 15 MB";
FastText[15].IText = (UBYTE *)" 16 MB";
}
/*****************************************************************/
/* The following initializes the structure arrays */
/* needed to provide the Fast Mem Base Addr menu topic. */
/*****************************************************************/
void InitFastAItems()
{
int n,nplus1;
/* initialize each menu item and IntuiText with loop */
for( n=0; n<FASTAMAX; n++ )
{
nplus1 = n + 1;
FastAItem[n].NextItem = &FastAItem[nplus1];
FastAItem[n].LeftEdge = 0;
FastAItem[n].TopEdge = 9 * n;
FastAItem[n].Width = 80;
FastAItem[n].Height = 9;
FastAItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
FastAItem[n].MutualExclude = (~(1 << n));
FastAItem[n].ItemFill = (APTR)&FastAText[n];
FastAItem[n].SelectFill = NULL;
FastAItem[n].Command = 0;
FastAItem[n].NextSelect = 0;
FastAText[n].FrontPen = BLUP;
FastAText[n].BackPen = WHTP;
FastAText[n].DrawMode = JAM2;
FastAText[n].LeftEdge = 0;
FastAText[n].TopEdge = 1;
FastAText[n].ITextFont = NULL;
FastAText[n].NextText = NULL;
}
FastAItem[FASTAMAX-1].NextItem = NULL;
/* select fast base address item checked */
switch (p_fasta) {
case 2: n = 0; break; /* Offset in megs above 0x0000000 */
case 3: n = 1; break;
case 4: n = 2; break;
case 5: n = 3; break;
case 6: n = 4; break;
case 8: n = 5; break;
case -1: n = 6; break;
case -2: n = 7; break;
case -3: n = 8; break; /* Offset in megs below 0x8000000 */
case -4: n = 9; break;
case -6: n = 10; break;
case -8: n = 11; break;
case -10: n = 12; break;
case -12: n = 13; break;
case -14: n = 14; break;
case -16: n = 15; break;
default: n = 6; p_fasta = -1;
}
FastAItem[n].Flags |= CHECKED;
FastAText[ 0].IText = (UBYTE *)" @ 2 M";
FastAText[ 1].IText = (UBYTE *)" @ 3 M";
FastAText[ 2].IText = (UBYTE *)" @ 4 M";
FastAText[ 3].IText = (UBYTE *)" @ 5 M";
FastAText[ 4].IText = (UBYTE *)" @ 6 M";
FastAText[ 5].IText = (UBYTE *)" @ 8 M";
FastAText[ 6].IText = (UBYTE *)" @7f M";
FastAText[ 7].IText = (UBYTE *)" @7e M";
FastAText[ 8].IText = (UBYTE *)" @7d M";
FastAText[ 9].IText = (UBYTE *)" @7c M";
FastAText[10].IText = (UBYTE *)" @7a M";
FastAText[11].IText = (UBYTE *)" @78 M";
FastAText[12].IText = (UBYTE *)" @76 M";
FastAText[13].IText = (UBYTE *)" @74 M";
FastAText[14].IText = (UBYTE *)" @72 M";
FastAText[15].IText = (UBYTE *)" @70 M";
}
/****************************************************************/
/* The following function inits the Menu structure array with */
/* appropriate values for our simple menu. Review the manual */
/* if you need to know what each value means. */
/****************************************************************/
void InitMenu()
{
menu[0].NextMenu = &menu[1];
menu[0].LeftEdge = 0;
menu[0].TopEdge = 0;
menu[0].Width = 64;
menu[0].Height = 10;
menu[0].Flags = MENUENABLED;
menu[0].MenuName = "Project"; /* text for menu-bar display */
menu[0].FirstItem = &ProjItem[0]; /* pointer to first item in list */
menu[1].NextMenu = &menu[2];
menu[1].LeftEdge = 64;
menu[1].TopEdge = 0;
menu[1].Width = 48;
menu[1].Height = 10;
menu[1].Flags = MENUENABLED;
menu[1].MenuName = "Setup"; /* text for menu-bar display */
menu[1].FirstItem = &SetupItem[0]; /* pointer to first item in list */
menu[2].NextMenu = &menu[3];
menu[2].LeftEdge = 112;
menu[2].TopEdge = 0;
menu[2].Width = 72;
menu[2].Height = 10;
menu[2].Flags = MENUENABLED;
menu[2].MenuName = "Priority"; /* text for menu-bar display */
menu[2].FirstItem = &PrioItem[0]; /* pointer to first item in list */
menu[3].NextMenu = &menu[4];
menu[3].LeftEdge = 184;
menu[3].TopEdge = 0;
menu[3].Width = 80;
menu[3].Height = 10;
menu[3].Flags = MENUENABLED;
menu[3].MenuName = "Chip Size"; /* text for menu-bar display */
menu[3].FirstItem = &ChipItem[0]; /* pointer to first item in list */
menu[4].NextMenu = &menu[5];
menu[4].LeftEdge = 264;
menu[4].TopEdge = 0;
menu[4].Width = 80;
menu[4].Height = 10;
menu[4].Flags = MENUENABLED;
menu[4].MenuName = "Chip Addr"; /* text for menu-bar display */
menu[4].FirstItem = &ChipAItem[0]; /* pointer to first item in list */
menu[5].NextMenu = &menu[6];
menu[5].LeftEdge = 344;
menu[5].TopEdge = 0;
menu[5].Width = 64;
menu[5].Height = 10;
menu[5].Flags = MENUENABLED;
menu[5].MenuName = "SF Size"; /* text for menu-bar display */
menu[5].FirstItem = &SFItem[0]; /* pointer to first item in list */
menu[6].NextMenu = &menu[7];
menu[6].LeftEdge = 408;
menu[6].TopEdge = 0;
menu[6].Width = 64;
menu[6].Height = 10;
menu[6].Flags = MENUENABLED;
menu[6].MenuName = "SF Addr"; /* text for menu-bar display */
menu[6].FirstItem = &SFAItem[0]; /* pointer to first item in list */
menu[7].NextMenu = &menu[8];
menu[7].LeftEdge = 472;
menu[7].TopEdge = 0;
menu[7].Width = 80;
menu[7].Height = 10;
menu[7].Flags = MENUENABLED;
menu[7].MenuName = "Fast Size"; /* text for menu-bar display */
menu[7].FirstItem = &FastItem[0]; /* pointer to first item in list */
menu[8].NextMenu = NULL;
menu[8].LeftEdge = 552;
menu[8].TopEdge = 0;
menu[8].Width = 80;
menu[8].Height = 10;
menu[8].Flags = MENUENABLED;
menu[8].MenuName = "Fast Addr"; /* text for menu-bar display */
menu[8].FirstItem = &FastAItem[0]; /* pointer to first item in list */
}
void StartMenus()
{
SetMenuStrip(window,&menu[0]);
}