lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
201 stars 31 forks source link

MEGA65: check and fix hotreg behaviour #382

Closed lgblgblgb closed 1 year ago

lgblgblgb commented 1 year ago

It seems current Xemu implementation is wrong: indeed, trigger being set in disabled mode as well and 'played back' when enabled again. However new change in the core, that you can clear possible pending trigger with re-write zero to hotreg enable bit ($D05D bit 7) when it was zero again, so the 0->0 case.

Also the $D031 behaviour must be checked in Xemu as well. The $D018 (recent change in Xemu) behaviour should be-checked again now: #381

UPDATE

Actually the behaviour of hotregs is much more easy than I thought. No previous value or transition need to be changed.

Setting hotregs to disabled always disable hotregs and clear possible pending triggers. Enabling hotregs always take trigger (if it's not clear of course). No need to check any "transition" or things like that.