#define VideoBase 0x4000 #define UsableVideo 0x4040 #define VideoTopLeft 0x43c0 /*UsableVideo+UsableWidth*UsableHeight*/ #define VideoEnd 0x4400 #define ColorBase 0x4400 #define ColorEnd 0x4800 #define UsableWidth 28 #define UsableHeight 32 #define InterruptEnable 0x5000 #define SoundOn 0x5001 #define Flip 0x5003 #define CoinCounter 0x5007 #define WR0 0x5040 #define WR1 0x5050 #define WR2 0x5060 #define WR3 0x5070 #define WatchdogReset 0x50c0 #define ResetWatchdog() *(WatchdogReset) = 1; #define IN0 0x5000 # define CREDIT 0x80 # define COIN2 0x40 # define COIN1 0x20 # define DIP6 0x10 # define DOWN 0x08 # define RIGHT 0x04 # define LEFT 0x02 # define UP 0x01 #define IN1 0x5040 # define TABLE 0x80 # define START2 0x40 # define START1 0x20 # define TEST 0x10 # define DOWN2 0x08 # define RIGHT2 0x04 # define LEFT2 0x02 # define UP2 0x01 #define Dipswitch 0x5080 # define SOLDER1 0x80 # define SOLDER2 0x40 # define DIP5 0x20 # define DIP4 0x10 # define DIP3 0x08 # define DIP2 0x04 # define DIP1 0x02 # define DIP0 0x01 #define WaitForOff(x) {while (x) ResetWatchdog();} #define WaitForOn(x) {while(!(x)) ResetWatchdog();} #define WaitForOnOff(x) {WaitForOn(x); WaitForOff(x);} #define color(c) gColor = c; /* global stuff for printing */ char *gScreenPtr; char *gColorPtr; char gColor; #define MenuItems 7 main() { int item; int i; cls(); item = 0; while(1) { ResetWatchdog(); print(6,9,0xAF,"DAVIDS@COOL@TEST"); tab(6,10); for(i=0;i<16;i++) printc(0xdc); PrintMenu(item); if (Up()) item--; if (Down()) item++; if (item < 0) item = MenuItems - 1; if (item >= MenuItems) item = 0; if (Player1() || Player2()) switch(item) { case 0: ColorTest(); break; case 5: TestScreen(); break; case 6: DisplayCharSet(); break; default: break; } } } TestScreen() { FillVideo(); WaitForOn(Player1()); cls(); } ColorTest() { char c; CharSet(); c=0; FillColor(c); while(1) { ResetWatchdog(); print(5,5,0xAF,"COLOR:"); printc((c>>4)&0x0F); printc(c&0x0F); if(Player1()) { if (Player2()) break; c += 0x10; FillColor(c); } if(Player2()) { c += 0x01; FillColor(c); } } cls(); } /* Fill up the screen with an incrementing pattern */ FillColor(inC) char inC; { char *c; for (c=ColorBase;c