I am using the AppleWin emulator, setup as an Apple IIe, Apple DOS 3.3 with Applesoft. My goal is to make a simple game.
This simple GET program works fine at the ] prompt (I am not sure, but I think it's called the monitor).
10 GET V$
20 PRINT V$
It prints the pressed key as expected
Then I start Applesoft using LOAD APPLESOFT. I tried writing the same simple program than at the ] prompt. But this time when I type the first line 10 GET V$ I get as output *** SYNTAX ERR.
I think it's not a supported feature, but in the ApplesoftII Basic Programming Reference Manual they list get a reserved keyword.
I could update to a higher version of Applesoft, then which version of Applebasic would support it? I can also use another method of getting a key press without the user needing to press enter afterwards.
After continuing to research my issue, I have found the location of memory for the keyboard buffer.
The keyboard buffer is
-16384and the way to reset that value of that address is to access-16368.If the value in
-16384is larger than 128 then a key has been pressed. So, I can usePEEK -16384to read the value. To get an ASCII code you need to subtract 128 to that value. Example code:To tell the system you dealt with the key press and reset the value, you need to access the value in
-16368. By usingPEEK or POKE. Example code: