Punkline
Dr. Frankenstack
- Joined
- May 15, 2015
- Messages
- 423
This code maxes out the trophy collection in a savegame, and then scraps the memory mechanic used to keep track of how many trophies are collected.
In return, the code provides developers with 0x240 bytes of space on the memory card that can be used to define custom variables that can be recovered after the game powers off. This contiguous region can be accessed from from a buffer starting at static address 8045C394 without any special setup:
UnclePunch T tauKhan DRGN SinsOfApathy
---
A couple of important things to note before using this code:
INSTALLING THIS WILL DESTROY YOUR TROPHY COLLECTION DATA.
This code deliberately corrupts and repurposes a small memory region that is responsible for copying information about the number of trophies you have collected to/from the memory card, and any records you have will be destroyed!
UNINSTALLING THIS WILL DESTROY THE STATE OF CUSTOM VARIABLES.
Though this code affects data on the memory card; it is itself installed in the DOL.
---
Memory Card Variables:
---
Examples:
(coming soon)
In return, the code provides developers with 0x240 bytes of space on the memory card that can be used to define custom variables that can be recovered after the game powers off. This contiguous region can be accessed from from a buffer starting at static address 8045C394 without any special setup:
UnclePunch T tauKhan DRGN SinsOfApathy
---
A couple of important things to note before using this code:
INSTALLING THIS WILL DESTROY YOUR TROPHY COLLECTION DATA.
This code deliberately corrupts and repurposes a small memory region that is responsible for copying information about the number of trophies you have collected to/from the memory card, and any records you have will be destroyed!
- If you care about this, then back up your memory card before installing!
UNINSTALLING THIS WILL DESTROY THE STATE OF CUSTOM VARIABLES.
Though this code affects data on the memory card; it is itself installed in the DOL.
- This may unexpectedly cause issues if used on a memory card that is shared between multiple Melee setups.
- If the code is uninstalled, or a version of Melee without the code loads a modified save file -- then normal trophy spawning/collection behavior will overwrite any variables being saved in the region.
- This should allow for vanilla trophy collection behavior to resume without issue when uninstalling the code.
- Any residual data in the region however will still provide lasting artifacts in the gallery index, so it’s recommended to also erase your trophy data from the options menu if you decide to stop using the code with a save file.
---
Memory Card Variables:
Code:
-==-
Memory Card Variables
Repurpose the trophy collection array normally stored in the memory card.
Enables 0x240 contiguous bytes for savable variabls, starting at 8045C394.
- Trophy collection in gallery appears complete by default when code is installed.
- Installing code destroys record of existing trophy counts.
- Uninstalling code after memorycard has initialized destroys state of custom variables.
[Punkline]
NTSC 1.02 --- 0x80304908 ---- 7C03022E -> 38007fff
------------- 0x80304a3c ---- 7C03022E -> 38007fff
------------- 0x8030496c ---- 7C03022E -> 38007fff
------------- 0x80304ad8 ---- 7C03222E -> 38007fff
------------- 0x803049dc ---- B0030000 -> 60000000
------------- 0x80304de4 ---- 7C03CA2E -> 38007fff
------------- 0x80305128 ---- 7C03E22E -> 38007fff
------------- 0x8030519c ---- 7C03E22E -> 38007fff
------------- 0x8030522c ---- 7C03E22E -> 38007fff
------------- 0x8030526c ---- 7C03E22E -> 38007fff
------------- 0x803052a4 ---- 7C03E22E -> 38007fff
------------- 0x80311990 ---- 38BF0000 -> 38BE019C
------------- 0x803123a8 ---- B0050000 -> 60000000
------------- 0x803123c4 ---- B0050000 -> 60000000
------------- 0x80312448 ---- B01A0000 -> 60000000
------------- 0x803125e8 ---- B01D0000 -> 60000000
------------- 0x80312748 ---- B01C0000 -> 60000000
------------- 0x803054a4 ---- 7C03EA2E -> 38007fff
------------- 0x80305500 ---- B0030000 -> 60000000
------------- 0x803055fc ---- B0030000 -> 60000000
------------- 0x8030567c ---- 7C03EA2E -> 38007fff
------------- 0x803056bc ---- B0030000 -> 60000000
------------- 0x803057cc ---- B0030000 -> 60000000
------------- 0x8030580c ---- B0040000 -> 60000000
------------- 0x80305a24 ---- 7C03DA2E -> 38007fff
------------- 0x80305a3c ---- B0030000 -> 60000000
------------- 0x80305a74 ---- 7C03DB2E -> 60000000
------------- 0x80306690 ---- 7C03F22E -> 38007fff
------------- 0x8030b2a0 ---- 7C03022E -> 38007fff
------------- 0x8030b2f4 ---- B0030000 -> 60000000
------------- 0x80310550 ---- 7C03022E -> 38007fff
------------- 0x803105a8 ---- B0030000 -> 60000000
------------- 0x80310704 ---- 7C03022E -> 38007fff
------------- 0x80310758 ---- B0030000 -> 60000000
------------- 0x80311710 ---- B01D0000 -> 60000000
------------- 0x80311744 ---- B01D0000 -> 60000000
------------- 0x8015cc94 ---- 38631cd0 -> 38631f18
------------- 0x8015cc80 ---- 4e800020 -> Branch
A003FFFC 2C000000 40820010 80030246 2C007FFF 41A20034 38000124 38A3FFFE 7C0903A6 38000000 B4050002 4200FFFC 38007FFF 38C00000 B0030248 38E00125 B0C3FFFC B0E30244 4E800020 60000000
#
Code:
-==-
!
ASM - Memory Card Variables
Repurpose the trophy collection array normally stored in the memory card.
Enables 0x240 contiguous bytes for savable variabls, starting at 8045C394.
- Trophy collection in gallery appears complete by default when code is installed.
- Installing code destroys record of existing trophy counts.
- Uninstalling code after memorycard has initialized destroys state of custom variables.
[Punkline]
NTSC 1.02 --- 0x80304908 ---- 7C03022E -> 38007fff
------------- 0x80304a3c ---- 7C03022E -> 38007fff
------------- 0x8030496c ---- 7C03022E -> 38007fff
------------- 0x80304ad8 ---- 7C03222E -> 38007fff
------------- 0x803049dc ---- B0030000 -> 60000000
------------- 0x80304de4 ---- 7C03CA2E -> 38007fff
------------- 0x80305128 ---- 7C03E22E -> 38007fff
------------- 0x8030519c ---- 7C03E22E -> 38007fff
------------- 0x8030522c ---- 7C03E22E -> 38007fff
------------- 0x8030526c ---- 7C03E22E -> 38007fff
------------- 0x803052a4 ---- 7C03E22E -> 38007fff
------------- 0x80311990 ---- 38BF0000 -> 38BE019C
------------- 0x803123a8 ---- B0050000 -> 60000000
------------- 0x803123c4 ---- B0050000 -> 60000000
------------- 0x80312448 ---- B01A0000 -> 60000000
------------- 0x803125e8 ---- B01D0000 -> 60000000
------------- 0x80312748 ---- B01C0000 -> 60000000
------------- 0x803054a4 ---- 7C03EA2E -> 38007fff
------------- 0x80305500 ---- B0030000 -> 60000000
------------- 0x803055fc ---- B0030000 -> 60000000
------------- 0x8030567c ---- 7C03EA2E -> 38007fff
------------- 0x803056bc ---- B0030000 -> 60000000
------------- 0x803057cc ---- B0030000 -> 60000000
------------- 0x8030580c ---- B0040000 -> 60000000
------------- 0x80305a24 ---- 7C03DA2E -> 38007fff
------------- 0x80305a3c ---- B0030000 -> 60000000
------------- 0x80305a74 ---- 7C03DB2E -> 60000000
------------- 0x80306690 ---- 7C03F22E -> 38007fff
------------- 0x8030b2a0 ---- 7C03022E -> 38007fff
------------- 0x8030b2f4 ---- B0030000 -> 60000000
------------- 0x80310550 ---- 7C03022E -> 38007fff
------------- 0x803105a8 ---- B0030000 -> 60000000
------------- 0x80310704 ---- 7C03022E -> 38007fff
------------- 0x80310758 ---- B0030000 -> 60000000
------------- 0x80311710 ---- B01D0000 -> 60000000
------------- 0x80311744 ---- B01D0000 -> 60000000
------------- 0x8015cc94 ---- 38631cd0 -> 38631f18
------------- 0x8015cc80 ---- 4e800020 -> Branch
lhz r0, -0x4(r3) # r0 = total unique trophies
cmpwi r0, 0 # == minimum?
bne- _clear
# if total collection is not 0, then we haven't initialized yet
# else, confirm initialization conditions:
lwz r0, 291<<1(r3)
cmpwi r0, 0x7FFF
beq+ _return
# if collection is 0 naturally, then the value 0x00007FFF here will be impossible
# -- if comparison is successful, then we know that card is currently storing custom variables
# -- else, we need to initialize memory for first use:
_clear:
li r0, 292
subi r5, r3, 2
mtctr r0
li r0, 0
# setup for loop
_for_each_hword:
sthu r0, 0x2(r5)
bdnz+ _for_each_hword
# clear all but last hword in trophy array
li r0, 0x7FFF
li r6, 0
sth r0, 292<<1(r3)
li r7, 293
sth r6, -0x4(r3)
sth r7, 290<<1(r3)
# update conditional values so that newly initialized space isn't cleared next time
_return:
blr
nop
---
Examples:
(coming soon)
Last edited: