pokemon-speedrunning / gambatte-speedrun

Fork of https://github.com/sinamas/gambatte with Pokemon speedrunning-related changes.
GNU General Public License v2.0
94 stars 27 forks source link

RTC testrom fails #61

Closed CasualPokePlayer closed 3 years ago

CasualPokePlayer commented 4 years ago

I talked a bit about this in the PSR server, but essentially an RTC test rom fails under Gambatte-Speedrun. RTC register writes fail, cycle based RTC appears to be broken in DMG/SGB2 mode (RTC goes at half the speed it's supposed to, note this is specific to cycle based RTC, real time based RTC is not broken), among other things

test rom can be found here https://github.com/aaaaaa123456789/rtc3test/releases

entrpntr commented 3 years ago

There was previously this preliminary MBC3 RTC testrom which we had failures on, not sure if the two test different things.

Reason for going half speed in DMG/SGB can be traced to this change in time.cpp. The initstate code sets the relevant bit in initial DMG ioamhram, hence why and'ing with CGB was necessary. The "best" solution would be to refactor double speed out to be its own thing to avoid checks like that throughout the code; alternatively we could just wire an isCgb() check into time.cpp.

CasualPokePlayer commented 3 years ago

There was previously this preliminary MBC3 RTC testrom which we had failures on, not sure if the two test different things.

Oh yeah I remember that, looking at the failures on the prelim ROM, they appear to be TestRegisterOverflows (one subtest failed, not sure which), TestWrittenValueIsNotReadableUntilLatched, TestOutOfBoundsWriteAndIncrement, and TestRegisterSizes. Some of the fails seem to be tests within the ROM I linked (TestOutOfBoundsWriteAndIncrement and TestRegisterSizes have equivalent tests), but the ROM I linked just doesn't do the tests anyways due to other tests failing with it (in particular, all register write tests just fail... which seems horribly wrong as it supposedly means GSR is treating all RTC registers as read-only). Somewhat odd as the prelim test ROM has some indication GSR should be treating them as R/W?