Skip to content

Conversation

@arekkusu42
Copy link
Contributor

This commit fixes the FLASH timing for IIe, IIc, IIgs.

apple2 uses a 555 timer @ ~2.182 Hz (Sather UTA2 8.6, 8.7) which alternates every ~15 frames.
apple2e and later do not have this 555 timer on the motherboard. Sather postulates that they instead use IOU video counter overflow (UTA2E fig 3.8), which alternates exactly every 16 frames (regardless of NTSC/PAL.)

Testing:
New FLASHHZ unit test, which shows a (possibly seizure-inducing) pattern of columns blinking at decreasing rates, to align with real FLASH text:
FLASHHZ_apple2p
FLASHHZ_251119.zip

The test is beam-racing the flashing columns via vaporlock (or VBL on the IIgs) and is NTSC/PAL compatible. The (D) key delays the blinking one frame, so you can manually align the phase of column G (or column F on the ][+).

After this PR, MAME now matches the behavior of a real Apple IIe:
(blinky video, photosensitive epilepsy warning)
https://github.com/user-attachments/assets/74eda815-0188-4730-a140-55bed6d2bb2b

A real IIgs also matches this. The IIgs can dynamically toggle between 60/50Hz, where we can see that the 50Hz display also flashes exactly every 16 frames:
(even more blinky video)
https://github.com/user-attachments/assets/1e2791b0-69bd-4abc-b3c8-d7a88af3733b

TODO:
After #14495, apple2gs now has stable beam-racing in this test, however LANGSEL doesn't implement 50Hz in MAME yet. I have that working in another WIP PR, but there are entanglements with C02E and floating bus readback which need more testing.

The 555 timer in the original Apple II is replaced in the
IIe and later, by IOU video counter overflow bits.

This slightly slows the FLASH blinking rate from every ~15
frames to exactly every 16 frames.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant