# GC6J01 - ポケモンコロシアム

[OnFrame]
# This game has extra memory card checks compared to most games,
# presumably to prevent Pokémon duping. These can interfere with
# saving your game when using savestates.
#
# 0x801cb5b8:
# Originally a branch that checks if the save counter in memory
# matches the one on the memory card. We patch this to instead
# overwrite the counter in memory with the one from the memory
# card. We need to do this because each memory card file actually
# contains three save slots the game rotates when saving, and
# when loading it loads the save with the biggest save counter.
# So we need to make sure the newly written save (which uses
# the value from memory + 1) is higher than any save currently
# on the card.
#
# 0x801cb608:
# Another branch. Not entirely sure what this one checks, but
# not patching this one sometimes still makes it recognize the
# memory card as 'not the same Memory Card as the one used to
# load the saved data', so nop it out.
#
$Allow Memory Card saving with Savestates
0x801cb5b8:dword:0x9005002c
0x801cb608:dword:0x60000000

[OnFrame_Enabled]
$Allow Memory Card saving with Savestates

[ActionReplay]
$16:9 Widescreen
04261AC0 000034E0
04261AC4 000034E4
F6000001 80008180
FFA01090 93E10024
D2000000 00000003
3DC03FAA 61CEAAAB
91C20000 C2620000
EFB300B2 00000000
E0000000 80008000
F6000001 80008180
FF601090 7C7F1B78
D2000000 00000004
3DC03FAA 61CEAAAB
91C20004 C2220004
EF7100B2 39C00000
60000000 00000000
E0000000 80008000

[Patches_RetroAchievements_Verified]
$Allow Memory Card saving with Savestates

[AR_RetroAchievements_Verified]
$16:9 Widescreen
