Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [5:28 PM] Dabomstew: i think IGT has to overflow on the frame that the game starts loading a map
- [5:28 PM] Dabomstew: which in this case is the first map off load
- [5:32 PM] entrpntr: that would explain why it starts failing on random floors
- [5:33 PM] gifvex: and always fails on same random floors with same save
- [5:33 PM] Dabomstew: the game disables the lcd every time it loads a map, which throws off the interrupt timing cycle
- [5:38 PM] Dabomstew: here's my theory
- 1) delayframes x20 are called before LoadMap is started (this number might be different for loading maps after the first, but it's also irrelevant)
- 2) after the 20th vblank interrupt is done, it returns to the function and starts with LoadMap
- 3) LoadMap calls DisableLCD soon enough that it's still on the same vblank, so cycles are still offset by the IGT overflow code
- 4) Because of the cycle offset, we exit DisableLCD's wait loop 4 cycles later [or earlier or w/e it is]
- 5) One last vblank interrupt is triggered IMMEDIATELY when the game re-enables vblank interrupt at the end of DIsableLCD, despite lcd being off. This is also offset by 4 cycles
- 6) GG
- [5:41 PM] Dabomstew: state 2 enters DisableLCD at 2388CF2, exits waitloop at 023906CE and triggers vblank at 023906F4
- state 1 enters DisableLCD at 02388D16 (+24h), exits waitloop at 023906D2 (+04h) and triggers vblank at 023906F8 (+04h)
- [5:42 PM] Dabomstew: i havent investigated whether we get fucked if the phantom vblank is the one to overflow the IGT
- [5:42 PM] Dabomstew: going to check that now
- [5:44 PM] Dabomstew: state2 enablelcd 023CA7E2 nextvblank 023D2840
- state2 modified to overflow in the phantom vblank: enablelcd 023CA806 (+24h) vblank 023D2864 (+24h)
- [5:44 PM] Dabomstew: so yeah 1/30 to get fucked
- [6:00 PM] Dabomstew: there are 2 "frames" where the overflow fucks you
- 1st frame overflow (IGT0 = 37f):
- > overflow frames only - 4 cycle offset
- > overflow frames and seconds - 8 cycle offset
- 2nd frame overflow (IGT0 = 36f):
- > overflow frames only - 24 cycle offset
- > overflow frames and seconds - 48? cycle offset
- [6:00 PM] Dabomstew: not actual ingame frames necessarily, but calls to vblank and subsequently the IGT incrementer
- [6:01 PM] Dabomstew: the second is far more drastic than the first, one would think
- [6:01 PM] Dabomstew: but either has the potential to be devastating
- [6:03 PM] Dabomstew: none of that is guaranteed at all, but I would imagine the first one is more likely to have a more similar outcome to the "non-fucked" situation, yes
- [6:03 PM] Dabomstew: the only part I know for certain is the number of cycles things are offset by
- [6:03 PM] Dabomstew: and why it happens
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement