View Single Post
Old 12 March 2021, 19:53   #248
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
TODs are cleared at reset. I used "Double Dragon II" RESET Action Replay protection hack to confirm it. This hack allows to execute RESET from chip RAM and continue code execution normally when using 68000.

Test program executed RESET, then it copied CIA registers to RAM.
Waited few scanlines, copied CIA registers again
Waited 1000 scanlines, copied CIA registers again.

Result was always:

00000000 FF000000 FFFFFFFF 0003FFFC (CIA-A in reversed order)
00000000 FF000000 FFFFFFFF 0000FFFF (CIA-B in reversed order)

1000 scanline wait had 76 keycode in CIASDR and SP flag set in interrupt register. All other register contents were identical.

CIA-A 03/FC is due to need to switch off overlay after reset. Normally it would have been 00/FF too.

CIA register copy was done in reversed order to prevent latch related side-effects. I also did it in non-reserved and results were same.

I didn't test ALARM, perhaps later but I assume it is cleared too.

btw, I forgot that ALARM does affect reads, if ALARM is set, TOD LO read does not enable latch.
Toni Wilen is online now  
 
Page generated in 0.04585 seconds with 11 queries