apple2gs: fix inconsistent clocks #14495
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes apple2gs to stop using two slightly different 1 MHz clocks:
1022727used in update_speed() and IWM()1021800used when toggling the ZipGS, and expected by the 262-line video @ 60HzMaking the clocks consistent fixes the out-of-sync flickering/slowing rolling drift visible in some beam-racing demos, such as French Touch CC65C02 or deater's double (first part, the second part syncs to C019 instead) or fancy lores.
More complicated intra-scanline beam racing (as used in the first two of those demos) still doesn't work (the 16 MHz screen timing has no HBL and 14 MHz cliprects are scaled weird and also not honored) but this is enough to make simple whole-scanline timing stable.
This change undoes part of 623e248 which changed the IWM() Q3 clock. That change made it consistent with the old A2GS_1M; now it becomes consistent with the rest of the apple2 1021800 clocks.
Due to the ongoing disk corruption #14474, I ran a bunch of before/after testing on the IWM, with and without the ZipGS enabled:
Note that all of the typical user-facing tasks appear to succeed before this PR, including the long-running Disk Port Test! So whatever the timing problem is that causes corruption in XPS, it is subtle and intermittent. Making the IWM Q3 clock consistent with the ZipGS 1 MHz temporary delay clock appears to fix (or at least, avoid) the problem.