_glook
Got a Passion for Smashin'
I'm pretty sure I've got the ability to change the max number of tags you can have and the storage location in memory that the nametags are written to and read from. I'm doing this so that I can keep basic name tag functionality in SD Remix lite while still keeping the patch data in memory as well.
Changing the memory location to store tags (1.02)
Every time a tag is read from memory, sub_8015CC9C is called with r3 which is the tag number (0 indexed). It then returns the memory location for the tag data. You can either overwrite this function entirely to do whatever you want, or you could do what I do and simply move the whole thing over by doing something like this:
Hook into 8015CCDC and branch to a custom function below:
addi r3, r3, 0x2FF8 # This is the old code
# We know what the old code says it is
addi r3, r3, 0x5000 # Shifts every name tag over in memory by 0x5000 bytes
b 8015CCE0
You'll also need to hook into these places similarly:
8015EFE0, r31 is being set to the location of the name tag slot in memory
803A9A8C, r3 is being set to the location of the name tag slot in memory
Changing the maximum number of tags (1.02)
There is some funkiness with creating new tags with this hack. If you change it to MORE than the default of 120 tags, you won't be able to add any more with the "New" button. I only need to shrink the maximum, so this doesn't particularly concern me, but you should know that there's more room at the end of the memory card to store more tags, though you may want to be careful in that that space might be used for other things (though I'm starting to doubt it).
The other weird thing is that if you do shrink the maximum and you hit your new maximum, it will still let you add new items. This can be mitigated.
In addition, when you start a match and a player doesn't have a tag selected, their name tag box will simply show nothing instead of the character's name. There's been some loud complaining about how you can't tell if you're playing a mod so I'm okay with this, as it is different from normal Melee. It doesn't really break anything. It does show **** under the character name in the tag selection menu (to select no tag), but again, I'm not super concerned about that.
As I said, though, you can still input tags after you hit the maximum. I think this is fine, as long as it does something. In many other programs I've used, if you hit the max and you try to add another thing to whatever list, it will overwrite the last item with your new item, so that's what this next code does:
Preventing New Names from entering if you're at the max (1.02) [flieskiller]
flieskiller figured out how to get the new button stuff not to work so the issues with my code can be resolved. This means you can also increase the name tags limit as well:
http://smashboards.com/threads/shri...nd-tag-storage-location.405120/#post-19340087
My Raw Notes I Took while REing this
Changing the memory location to store tags (1.02)
Every time a tag is read from memory, sub_8015CC9C is called with r3 which is the tag number (0 indexed). It then returns the memory location for the tag data. You can either overwrite this function entirely to do whatever you want, or you could do what I do and simply move the whole thing over by doing something like this:
Hook into 8015CCDC and branch to a custom function below:
addi r3, r3, 0x2FF8 # This is the old code
# We know what the old code says it is
addi r3, r3, 0x5000 # Shifts every name tag over in memory by 0x5000 bytes
b 8015CCE0
You'll also need to hook into these places similarly:
8015EFE0, r31 is being set to the location of the name tag slot in memory
803A9A8C, r3 is being set to the location of the name tag slot in memory
Changing the maximum number of tags (1.02)
There is some funkiness with creating new tags with this hack. If you change it to MORE than the default of 120 tags, you won't be able to add any more with the "New" button. I only need to shrink the maximum, so this doesn't particularly concern me, but you should know that there's more room at the end of the memory card to store more tags, though you may want to be careful in that that space might be used for other things (though I'm starting to doubt it).
The other weird thing is that if you do shrink the maximum and you hit your new maximum, it will still let you add new items. This can be mitigated.
In addition, when you start a match and a player doesn't have a tag selected, their name tag box will simply show nothing instead of the character's name. There's been some loud complaining about how you can't tell if you're playing a mod so I'm okay with this, as it is different from normal Melee. It doesn't really break anything. It does show **** under the character name in the tag selection menu (to select no tag), but again, I'm not super concerned about that.
Code:
Shrink max number of tags (1.02) [_glook]
042375C8 2C1F00XX
04239E94 2C1A00XX
0423862C 2C1E00XX
04237D68 2c1900XX
04237D74 2c1a00XX
042386F0 2C1E00XX
04237994 2c1d00XX
042379A0 2c1e00XX
042378AC 2c1b00XX
04237870 2c0500XX
0423786C 200500XX
042382DC 2c1f00XX
04237810 2c1f00XX
042668F4 280300XX
042653F8 2c1100XX
04237620 2c1e00XX
04265530 280000XX
04237884 2c0500YY
04263A28 2c1900ZZ
C2238400 00000006
2C0300XX 40800020 <-- remember this XX
3D808015 618CCC9C
7D8903A6 4E800421
88630198 880D954C
48000008 7C601B78
60000000 00000000
04238404 60000000
04238408 60000000
XX is new maximum number of tags
ZZ is XX + 1
YY is XX - 1
Code:
If above Max number of tags, overwrite last item (1.02) [_glook]
C223CAA4 00000003
887C0059 2C0300XX
4180000C 386000YY
987C0059 00000000
XX = Max number of tags
YY = XX - 1
Preventing New Names from entering if you're at the max (1.02) [flieskiller]
flieskiller figured out how to get the new button stuff not to work so the issues with my code can be resolved. This means you can also increase the name tags limit as well:
http://smashboards.com/threads/shri...nd-tag-storage-location.405120/#post-19340087
My Raw Notes I Took while REing this
Code:
Name tags function is probably the function of the memory card return location, which is 80239E9C
Or we can attempt when it tries to read from the memory card location.
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 80239d70 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
CHK 802379d0 ( --- ) Read8 00 at 8045d850 ( --- )
sub 8015CC9C takes the name tag slot and returns an address of some sort
They're all separated by 1A4, total of C4E0
input output
0 8045d6b8
1 8045d85c
2 8045da00
3 8045dba4
We want the new names storage start location to be 8046A900.
So at 8015CCDC, instead of adding 0x2FF8 to r3, add 10240.
This will require a branch to a sub function to do three separate addi calls.
Hook 8015CCDC:
addi r3, r3, 0x7FFF
addi r3, r3, 0x7FFF
addi r3, r3, 0x242
Now to limit the number of names to 4, trace back from the rumble function to figure out what is making it loop
802375b4 - Jackpot
802379BC
802379cc
8015CC9C - Get address function
At 802375C8: cmpwi r31, 0x78
This checks r31 against 120, which is the names limit
We can just overwrite this to be 0x5, like so:
802375C8: cmpwi r31, 0x5 or 2C1F0004
We also need to limit it at the name entry screen
80239ddc
8015CC9C
Maybe 80239E94: cmpwi r26, 0x18
We can try and change that to 0x5 (2C1A0004), which kinda works
We have to breakpoint on this function and make sure every place that calls this we reset the cmpwi to 0x5
----------------------------------------------------------------------------------------------------------
802379cc ++ Common return function
At startup:
802375b4 *
80239ddc *
80239d6c-
80239da0-
On List:
802385f4 (8023862C needs to go from 2C1E0078 to 2C1E0004)
80237c0c (80237D68 needs to go from 2c190078 to 2c190004)
80237c58 same as above
80237c9c (80237D74 needs to go from 2c1a0078 to 2c1a0004)
On Delete Press Button:
Nothing new at first
After load:
802386b8 (802386F0 needts to go from 2C1E0078 to 2C1E0004)
On Delete miss:
80238400 (80238424 needs to check if we're above max names or not, see below section for 80238400)
On Delete actually delete:
80238078 and 80238088 - Gets current and next item. Uses stuff from other functions, so should be fine.
80237854 - There are a ton of references to 0x78 and 0x77. Replace them all, mentioned in 80237854 below
802378c8, 802378d8, 802378e8, 80237920, 8023792c, 80237960 - Same function as above
On New Press Button:
802382a4 (802382DC needs to go from 2c1f0078 to 2c1f0004)
On New Confirm:
802377c8 (80237810 needs to go from 2c1f0078 to 2c1f0004)
802377e0 - Same function as above
80237a2c & 80237A3C => 8023caa8 ??? Don't really know, there's no reference to 0x78 or anything
8023c000 ??? Don't really know, there's no reference to 0x78 or anything
For 80238400:
At 80238400:
cmpwi r3, 0x4
bge OVER_LIMIT
lis r12, 0x8015
ori r12, r12, 0xCC9C
mtctr r12
bctrl
lbz r3, 0x198(r3)
lbz r0, -0x6AB4(r13)
b RETURN
OVER_LIMIT:
mr r0, r3
RETURN:
Then, make 80238404 and 80238408 nops
For 80237854:
80237994: 2c1d0078 -> 2c1d0004
802379A0: 2c1e0078 -> 2c1e0004
802378AC: 2c1b0078 -> 2c1b0004
80237884: 2c050077 -> 2c050003
80237870: 2c050078 -> 2c050004
8023786C: 20050078 -> 20050004
At the CSS
----------
On CSS Load:
80237560 => 802668d8 (802668F4 should go from 28030078 to 28030004)
802653e8 (802653F8 should go from 2c110078 to 2c110004)
While Name Tag select is open Open:
80263938 (80263A28 should go from 2c190009 to 2c190005)
On Name Tag Select:
80263d04 - Doesn't loop
On Name Tag Name Entry Press:
8023760c (80237620 should go from 2c1e0078 to 2c1e0004)
On Name Tag Name Entry Confirm:
8023caa8 - Doesn't loop
80265548 (80265530 should go from 28000078 to 28000004)
There's still an issue where we're trying to get the 4th item on write. Stack trace when this happens:
80390dfc - Oh god not this again
80238584 - Runs every frame while in Name Entry screen
8023caa8 - Only runs when Confirm is pressed (once)
80237a2c - Runs once as well
8015CC9C
We notice we get the slot to write to here:
8023CAA4 lbz r3, 0x59(r28)
Therefore, we can make it run the following to overwrite the last name instead of not doing anything.
At 8023CAA4:
lbz r3, 0x59(r28)
cmpwi r3, 0x4
blt RETURN
li r3, 3
stb r3, 0x59(r28)
RETURN:
Total codes
-----------
042375C8 2C1F0004
04239E94 2C1A0004
0423862C 2C1E0004
04237D68 2c190004
04237D74 2c1a0004
042386F0 2C1E0004
04237994 2c1d0004
042379A0 2c1e0004
042378AC 2c1b0004
04237884 2c050003
04237870 2c050004
0423786C 20050004
042382DC 2c1f0004
04237810 2c1f0004
042668F4 28030004
042653F8 2c110004
04263A28 2c190005
04237620 2c1e0004
04265530 28000004
C2238400 00000006
2C030004 40800020
3D808015 618CCC9C
7D8903A6 4E800421
88630198 880D954C
48000008 7C601B78
60000000 00000000
04238404 60000000
04238408 60000000
Last edited: