home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_22_1988_Transactor_Publishing.d64
/
doodle.c
< prev
next >
Wrap
Text File
|
2023-02-26
|
2KB
|
81 lines
Char PlotType;
main ()
{SHIFT-+}
char *Pointer, Key, Store1, Store2, Store3;
unsigned int Loop, X, Y;
highmem (0xCC00);
Pointer = 0xDD00;
*Pointer = (Store1 = *Pointer) & 252;
Pointer = 0xD011; /* Turn on Graphics */
*Pointer = (Store2 = *Pointer) {CBM-*} 32;
Pointer = 0xD018;
Store3 = *Pointer;
*Pointer = 0x38;
Pointer = 0x028a; /* Turn on key repeat */
*Pointer = 128;
FastKeys ();
Clear (0xCC00, 1000, 93); /* Clear color screen */
Clear (0xE000, 8000, 0); /* Clear bitmap */
PlotType = 1;
X = 160;
Y = 100;
Plot (X,Y);
while ((Key = waitkey()) != 3)
{SHIFT-+}
switch (Key)
{SHIFT-+}
case 'i':
case 'I': Plot (X,--Y); /* Allow user to draw lines */
break; /* by using the I, J, K, M */
case 'm': /* diamond. -, +, and / set */
case 'M': Plot (X,++Y); /* clear, set, or flip mode */
break; /* respectively. STOP exits */
case 'j':
case 'J': Plot (--X,Y);
break;
case 'k':
case 'K': Plot (++X,Y);
break;
case '-': PlotType = 0;
Plot (X, Y);
break;
case '+': PlotType = 1;
Plot (X, Y);
break;
case '/': PlotType = 2;
Plot (X, Y);
{SHIFT--}
{SHIFT--}
SlowKeys ();
Pointer = 0xDD00;
*Pointer = Store1;
Pointer = 0xD011; /* Restore Text mode */
*Pointer = Store2;
Pointer = 0xD018;
*Pointer = Store3;
{SHIFT--}
#define GETIN 0xFFE4
char a, x, y,
*numkeys = 198;
/* Waits for user to press a key */
int waitkey ()
{SHIFT-+}
while (*numkeys == 0)
;
sys (GETIN, &a, &x, &y);
return a;
{SHIFT--}