Read apple key now in C, compiles to same instructions

This commit is contained in:
Zane Kaminski 2020-05-21 19:09:11 -04:00
parent 1b18fa1c67
commit d5c4fcc209

10
ram2e.c
View File

@ -8,13 +8,9 @@
#define true 1 #define true 1
#define false 0 #define false 0
static char read_applekey(void) { #define PB0 ((char*)0xC061)
/*__asm__("lda $C061"); #define PB1 ((char*)0xC062)
__asm__("ora $C062"); static char read_applekey(void) { return (*PB0 | *PB1) & 0x80; }
__asm__("and #$80");
__asm__("ldx #0");*/
return (*((char*)0xC061) | *((char*)0xC062)) & 0x80;
}
static void ram2e_cmd(char operation, char data) { static void ram2e_cmd(char operation, char data) {
// Load operation and data bytes into X and Y registers // Load operation and data bytes into X and Y registers