stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
112 stars 56 forks source link

1Mhz clock stretching does not happen correctly for some instructions. #184

Open SteveFosdick opened 1 year ago

SteveFosdick commented 1 year ago

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.