b-em
b-em copied to clipboard
1Mhz clock stretching does not happen correctly for some instructions.
See: https://stardot.org.uk/forums/viewtopic.php?p=379891#p379891 and https://github.com/dp111/6502Timing
The clock stretching to 1Mhz sometimes doesn't happen because the phase of the 2Mhz clock is out of step with what would happen on real hardware because of the point at which polltime() is called.
The solution is to distribute calls to polltime() within the execution of the instruction, possibly by including the call in readmem/writemem.