mrehkopf / sd2snes

SD card based multi-purpose cartridge for the SNES
http://sd2snes.de
GNU General Public License v2.0
579 stars 114 forks source link

Added CCNT_RDYB (wait bit) implementation. #207

Closed redacted173 closed 1 year ago

redacted173 commented 1 year ago

This is a simple change to halt SA-1 instruction execute when someone writes bit $40 of the CCNT register. The SA-1 resumes where it left off instead of taking the reset vector such as when bit $20 is used. Since no commercial game uses this bit, it was tested by putting the SA-1 in a spin loop that increments a BW-RAM variable while the S-CPU writes either halted (CCNT=$40) or active (CCNT=$00) to CCNT. Other state machines may still be active in the SA-1 and it is expected that the user makes sure they are in a legal state, e.g. IDLE, when using this bit.