[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VGA for Carte Blanche operational
<alex.freed.007@gmail.com> wrote:
>However we can use a trick: watch the bus till a read of $C000 returns "1"
>in the high bit. That's a keyboard press.
Yes and here is a standard piece of code I have used since the '80's in my C
programs for the Apple II with applicable additions for mouse etc.
getch()
{
char *KEYPRESS = (char*)0xC000; /* return the last key press */
char *KEYCLEAR = (char*)0xC010; /* clear the last key press */
char c;
/* clear stragglers from the keyboard buffer */
while((c=KEYPRESS[0]) > 127)KEYCLEAR[0]=0;
/* read the keyboard buffer */
/* and return the character */
do{
c = KEYPRESS[0];
}while(c < 128);
c-=128;
KEYCLEAR[0]=0;
return (int )c;
}
>Unfortunately Apple will also see it. So if a program says: "insert disk 2
>and press
any key" we won't be able to use this mechanism.
Not a practical option from my point of view...
Bill