Page 1 of 1

Detecting if in FAST mode?

Posted: Thu Sep 28, 2023 7:36 pm
by stefano
I'm wondering what's the right way to check if we're in FAST mode.
I'm concerned in trusting the system variables because the ZX81 ROM can be running as a retrofit in a ZX80, which obviously is never in FAST mode.
I haven't fully understood how the SLOW/FAST subroutine works in rom

Re: Detecting if in FAST mode?

Posted: Thu Sep 28, 2023 9:18 pm
by olofsen
The NMI routine increments the alternative A register. The SLOW/FAST routine starts the NMI generator, and tests within a time frame if this register is incremented. With the ZX81 ROM in the ZX80, this does not happen. If bit 6 of CDFLAG indicates a change to SLOW, this test will indicate if SLOW is actually possible, and if not, bit 7 of CDFLAG will not be set.

Re: Detecting if in FAST mode?

Posted: Fri Sep 29, 2023 12:17 pm
by stefano
It is a bit of fun having the code repeatedly checking the hardware status!
You might even add a switch on the 50/60hz diode and the raster frequency would change at runtime :)

Thankyou for the information, at the end I chose a different approach and totally replaced the fgetc() code to reduce flickering a little as I did on the ZX80.