From 16615e60b183e015246baa5e31df0c36edb60e7f Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Thu, 13 Jul 2017 20:29:50 -0400 Subject: [PATCH] fake vertical blank refresh period --- apple/applemmu.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apple/applemmu.cpp b/apple/applemmu.cpp index bc58386..bafa40b 100644 --- a/apple/applemmu.cpp +++ b/apple/applemmu.cpp @@ -352,7 +352,15 @@ uint8_t AppleMMU::readSwitches(uint16_t address) case 0xC018: // RD80COL return (switches & S_80STORE) ? 0x80 : 0x00; - // 0xC019: RDVBLBAR -- is the vertical blanking low? + case 0xC019: // RDVBLBAR -- vertical blanking, for 4550 cycles of every 17030 + // Should return 0 for 4550 of 17030 cycles. Since we're not really + // running full speed video, instead, I'm returning 0 for 4096 (2^12) + // of every 16384 (2^14) cycles; the math is easier. + if ((g_cpu->cycles & 0x3000) == 0x3000) { + return 0x00; + } else { + return 0xFF; // FIXME: is 0xFF correct? Or 0x80? + } case 0xC01A: // RDTEXT return ( (switches & S_TEXT) ? 0x80 : 0x00 ); case 0xC01B: // RDMIXED