diff --git a/apple/mouse.cpp b/apple/mouse.cpp index ad0ad25..7d56609 100644 --- a/apple/mouse.cpp +++ b/apple/mouse.cpp @@ -55,6 +55,15 @@ void Mouse::Reset() } uint8_t Mouse::readSwitches(uint8_t s) +{ + switch (s) { + default: + printf("mouse: unknown switch read 0x%X\n", s); + }; + return 0xFF; +} + +void Mouse::writeSwitches(uint8_t s, uint8_t v) { switch (s) { case SW_R_HOMEMOUSE: @@ -115,15 +124,6 @@ uint8_t Mouse::readSwitches(uint8_t s) g_ram.writeByte(0x6B8+4, interruptsTriggered); // hack to appease ROM interruptsTriggered = 0; break; - default: - printf("mouse: unknown switch read 0x%X\n", s); - }; - return 0xFF; -} - -void Mouse::writeSwitches(uint8_t s, uint8_t v) -{ - switch (s) { case SW_W_INIT: v &= 0x03; // just the low 3 bits apparently? printf("Simple init: value is 0x%X\n", v); @@ -379,20 +379,20 @@ Patch: from EA A9 06 D0 F1 => AD C9 C0 18 60 CLAMPMOUSE -C48A- 8D CD C0 STA $C0CD ; use write to soft switch 0x0D to trigger clamp +C48A- 8D CD C0 STA $C04D ; use write to soft switch 0x0D to trigger clamp 60 RTS Patch: from 99 83 C0 60 => 8D CD C0 60 HOMEMOUSE -C4A9- AD C8 C0 LDA $c0C8 ; soft switch 0x08 for homemouse (read) +C4A9- AD C8 C0 LDA $c048 ; soft switch 0x08 for homemouse (read) 18 CLC 60 RTS Patch: from EA A9 07 D0 EC => AD C8 C0 18 60 INITMOUSE -C498- AD CC C0 LDA $C0CC ; soft switch 0x0C read for initmouse +C498- AD CC C0 LDA $C04C ; soft switch 0x0C read for initmouse 18 CLC 60 RTS @@ -400,33 +400,33 @@ Patch: from A9 02 99 83 C0 => AD CC C0 18 60 */ uint8_t rom[256] = { 0x2c, 0x58, 0xff, 0x70, 0x1B, 0x38, 0x90, 0x18, // C400 - 0xb8, 0x50, 0x15, 0x01, 0x20, 0xae, 0xae, 0xae, - 0xae, 0x00, 0x6d, 0x75, 0x8e, 0x9f, 0xa4, 0x86, // C410 - 0xa9, 0x97, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, + 0xb8, 0x50, 0x15, 0x01, 0x20, 0x8d, 0x8d, 0x8d, + 0x8d, 0x00, 0x60, 0x68, 0x76, 0x7b, 0x80, 0x85, // C410 + 0x8f, 0x94, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x48, 0x98, 0x48, 0x8a, 0x48, 0x08, 0x78, 0x20, // C420 0x58, 0xFF, 0xBA, 0xBD, 0x00, 0x01, 0xAA, 0x0A, 0x0A, 0x0A, 0x0A, 0xA8, 0x28, 0x50, 0x0F, 0xA5, // C430 0x38, 0xd0, 0x0d, 0x8a, 0x45, 0x39, 0xd0, 0x08, 0xa9, 0x05, 0x85, 0x38, 0xd0, 0x0b, 0xb0, 0x09, // C440 0x68, 0xaa, 0x68, 0xea, 0x68, 0xea, 0xea, 0xea, - 0x60, 0x99, 0x81, 0xc0, 0x68, 0xbd, 0x38, 0x06, // C450 + 0x60, 0xea, 0xea, 0xea, 0x68, 0xbd, 0x38, 0x06, // C450 0xaa, 0x68, 0xa8, 0x68, 0xbd, 0x00, 0x02, 0x60, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // C460 - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x10, 0xb0, - 0x3f, 0x8D, 0xCF, 0xc0, 0x60, 0x48, 0x18, 0x90, // C470 - 0x39, 0x99, 0x83, 0xc0, 0xbd, 0xb8, 0x06, 0x29, + 0xc9, 0x10, 0xb0, 0x29, 0x8d, 0xcf, 0xc0, 0x60, // C460 + 0x48, 0x18, 0x90, 0x2d, 0xbd, 0xb8, 0x06, 0x29, + 0x0e, 0xd0, 0x01, 0x38, 0x68, 0x60, 0x8d, 0xcb, // C470 + 0xc0, 0x18, 0x60, 0x8d, 0xca, 0xc0, 0x18, 0x60, - 0x0E, 0xD0, 0x01, 0x38, 0x68, 0x60, 0xc9, 0x02, // C480 - 0xb0, 0x26, 0x8D, 0xCD, 0xc0, 0x60, 0xAD, 0xCB, - 0xC0, 0x18, 0x60, 0x18, 0xea, 0xea, 0x60, 0xea, // C490 - 0xAD, 0xCC, 0xC0, 0x18, 0x60, 0x18, 0x60, 0xAD, - 0xCA, 0xC0, 0x18, 0x60, 0xAD, 0xC9, 0xc0, 0x18, // C4A0 - 0x60, 0xAD, 0xC8, 0xC0, 0x18, 0x60, 0xa2, 0x03, - 0x38, 0x60, 0x78, 0xad, 0xce, 0xc0, 0xa2, 0x04, // C4B0 - 0x18, 0x90, 0xc1, 0x20, 0x00, 0x00, 0xba, 0x68, - 0x85, 0x00, 0xbd, 0x00, 0x01, 0x28, 0xaa, 0x0a, // C4C0 - 0x0a, 0x0a, 0x0a, 0xa8, 0xa9, 0x03, 0x18, 0x90, - 0xa8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // C4D0 + 0x8d, 0xc9, 0xc0, 0x18, 0x60, 0xc9, 0x02, 0xb0, // C480 + 0x04, 0x8d, 0xcd, 0xc0, 0x60, 0x38, 0x60, 0x8d, + 0xc8, 0xc0, 0x18, 0x60, 0x8d, 0xcc, 0xc0, 0x18, // C490 + 0x60, 0x78, 0x8d, 0xce, 0xc0, 0xa2, 0x04, 0x18, + 0x90, 0xCA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // C4A0 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // C4B0 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // C4C0 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // C4D0 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // C4E0 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,