Submission #6907: MrWint, Alyosha, CasualPokePlayer's GB Pokémon: Red Version "save glitch" in 01:15.62

Console Game Boy Emulator Bizhawk 2.5.1
Game Version USA/Europe Frame Count 4520
ROM Filename pokered.gbc Frame Rate 59.7733373887515
Branch save glitch Rerecord Count 818
Unknown Authors MrWint, Alyosha, CasualPokePlayer
Game Pokémon: Red/Green/Blue/Yellow Version
Submitted by CasualPokePlayer on 10/11/2020 10:20:04 AM

Submission Comments
So after making my Silver collision movie, I ended up thinking of an idea I had some time ago: can the Red Any% TAS be improved with checksum collision?
Turns out, yes it can. By 4 frames.
There are some technical points I need to clarify with this though. For one, there's quite a bit of data I need to save so the game doesn't end up softlocking when the the save file is loaded. And past that, there's other data I would want to save, like the Pokedex flag (so 4 frames isn't lost due to having the Pokedex), and surprisingly, sprite data. It so happens the game will save sprite data around the end of the save routine, and one of the IDs for the sprites happens to cause around 7 frames of lag (when all are FF anyways). Once all that is accounted for, I then have to figure out how to collide the checksums. Turns out Gen 1's checksum system is even worse than Gen 2's. While Gen 2 was just the sum of all the bytes stored in 2 bytes, Gen 1 instead just uses the complement of the sum of all the bytes... stored in 1 byte. And since all of SRAM is filled with FFs and most of the data being written in there is 00s, it really just becomes a simple game of math to figure out which byte you want to reset in.
Also, I ended up using 0x64C2 instead of 0x64C1 for the TID in this TAS, as the higher byte lets me reset 1 byte/52 cycles earlier. To note, manipulating for 0x64C6 takes 740 more cycles, and it would only save on 4 bytes being written/208 cycles, so it isn't worth it to manipulate that TID.
Unrelated to collision, another minor improvement I found was that taking the 1 step down before the save/quit happens to be 55 cycles faster. Who knew?
EDIT: Ok the 1 step down was actually somewhat relevant to collision, although it happens that collision with the old 1 step down after s/q would lose an additional 64906 cycles, past the inherit cycle loss anyways.

ThunderAxe31: Judging.
ThunderAxe31: Accepting as improvement over the current publication.
Spikestuff: 🎃 Publishing.

Last Edited by admin@tasvideos.org on 1/1/2022 6:13 PM
Page History Latest diff List Referrers