MEGA65 / mega65-rom-public

MEGA65 ROM public issue reporting
4 stars 0 forks source link

SPEED command should not flip hot registers #128

Closed dansanderson closed 1 month ago

dansanderson commented 4 months ago

The BASIC command SPEED updates the FAST register, which is a bit in $D031. $D031 is a VIC-IV hot register and the ROM runs with hot registers enabled, so the SPEED command triggers hot register propagation.

As a courtesy to BASIC coders experimenting with VIC-IV registers, the SPEED command should do the extra steps required to avoid hot register propagation: disable HOTREG, update FAST, write another 0 to HOTREG, then re-enable HOTREG. This is already how the system.src:change_speed_mode routine does it. I had left a TODO comment in b65.src suggesting that we add change_speed_mode (or something like it) to the KERNAL jump table, so b65.src can just call it. Alternatively, b65.src:speed can do the HOTREG trick itself.