The Apple II MouseCard IRQ Is Synced To Vertical Blanking After All

The Apple II MouseCard (Credit: AppleLogic.org)

Recently [Colin Leroy-Mira] found himself slipping into a bit of a rabbit hole while investigating why only under Apple II MAME emulation there was a lot of flickering when using the (emulated) Apple II MouseCard. This issue could not be reproduced on real (PAL or NTSC) hardware. The answer all comes down to how the card synchronizes with the system’s vertical blanking (VBL) while drawing to the screen.

The Apple II MouseCard is one of the many peripheral cards produced for the system, originally bundled with a version of MacPaint for the Apple II. While not a super popular card at the time, it nevertheless got used by other software despite this Apple system still being based around a command line interface.

According to the card’s documentation the interrupt call (IRQ) can be set to 50 or 60 Hz to match the local standard. Confusingly, certain knowledgeable people told him that the card could not be synced to the VBL as it had no knowledge of this. As covered in the article and associated MAME issue ticket, it turns out that the card is very much synced with the VBL exactly as described in The Friendly Manual, with the card’s firmware being run by the system’s CPU, which informs the card of synchronization events.

5 thoughts on “The Apple II MouseCard IRQ Is Synced To Vertical Blanking After All

  1. This is interesting, because I worked on a CRT terminal with a capacitive keyboard (back when dinosaurs roamed the earth and timesharing was a thing). People would place the keyboard on top of the terminal to save space, and the capacitive keyboard would pick up the CRT flyback pulses and generate garbage characters. This was widely seen as a Bad Thing.

    Luckily for me, the whole thing was designed around a MC6802 processor with a 6845 CRT control chip, and the HSYNC pulses were available. I modified the keyboard scan routine to scan only after it had seen a flyback pulse. There was time to scan two keyboard rows during the horizontal scan, then a pause to accomodate the flyback pulse, then two more keyboard scans…etc.

    Worked like a charm.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.