• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Hot Potato Mr. Saturn mode

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
Originally made by the creator of the Crazy Mod, wParam, this mode played with Mr. Saturns dropped as a normal item with the new special condition: If the seconds in the game are at :x0 or x5 (like 50 seconds, or 45, or 40 etc.) and you hold a Mr. Saturn in your hands, you die instantly. In addition, if you throw a Mr. Saturn to a person and they doesn't hold an item, they'll catch it and go into sleep (with no duration, so wake up animation starts).

Documentation will arrive later.

Gecko and DOL available

DOL
@0x28059C (starting function, branch from then a Saturn hits something)
4bd81254

@x1C10
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
83C50CF4 2C1E0000
41820034 83BE002C
811D1974 2C080000
40820024 7FE4FB78
7FC3F378 4808FC5D
7FC3F378 38800001
480be535 3C804170
909D1A4C 7FE3FB78
BBA10008 8001001C
38210018 7C0803A6
7C0802A6 4827ED44

@0x66f40 (for checking every frame)
4bf9a920

0x1C80
80C3002C 80E61974
2C070000 4182003C
8107002C 81080010
2C080007 4082002C
3CC08047 80C6B6C8
2C060000 4182001C
38E00005 7D063BD6
7D2839D6 7C093000
40820008 480cef04
7C0802A6 48065698
Gecko (fixed by Achilles)
C22839BC 00000011
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
83C50CF4 2C1E0000
4182004C 83BE002C
811D1974 2C080000
4082003C 3C808009
608448A8 7C8803A6
7FE4FB78 7FC3F378
4E800021 3C80800C
6084318C 7C8803A6
7FC3F378 38800001
4E800021 3C804170
909D1A4C 7FE3FB78
BBA10008 8001001C
38210018 7C0803A6
7C0802A6 00000000
C206A360 0000000C
80C3002C 80E61974
2C070000 41820048
8107002C 81080010
2C080007 40820038
3CC08047 80C6B6C8
2C060000 41820028
38E00005 7D063BD6
7D2839D6 7C093000
40820014 3D20800D
612940B8 7D2903A6
4E800420 7C0802A6
60000000 00000000

Documentation
#Branch from 802839BC, when a Mr. Saturn hits a target by being thrown.
#Start
mflr r0

# Maybe it loads the player
stw r0,4(r1)
stwu r1,-24(r1)
stmw r29,8(r1)

#r31 is the item passed in
mr r31,r3

#r5 is the item-type
lwz r5,44(r3)

#r30 is the target of the thrown item
lwz r30,3316(r5)

#detects if the target exists (if it isn't an item)
cmpwi r30,0
#If doesn't exist, branch out and do nothing else
beq- 0x34

#Loads the character of the player
lwz r29,44(r30)

#Check if the character have an item
lwz r8,6516(r29)
cmpwi r8,0
#If they have no item, continue.
bne- 0x24

#Give them the item and branch to the function to give a character an item.
mr r4,r31
mr r3,r30
bl 0x8FC5C

#Then branch to the function to put a character to sleep
mr r3,r30
li r4,1
bl 0xBE534

#Also, set the sleep duration
lis r4,16752
stw r4,6732(r29)

#When it branches out, go through these. I'm not sure why it goes through that. Branches back to the initial function to go as normally.
mr r3,r31
lmw r29,8(r1)
lwz r0,28(r1)
addi r1,r1,24
mtlr r0
mflr r0
b 0x27ED44

2ND PART, FUNCTION TWO:
#Branches from 8006a360, a function executed every frame.
#Start of function. Loads the character of the player, then check if the player has an item.
lwz r6,44(r3)
lwz r7,6516(r6)

#If there is no item, abort
cmpwi r7,0
beq- 0x3C

#Check the item-type
lwz r8,44(r7)
lwz r8,16(r8)

#If it'S not Mr. Saturn, abort
cmpwi r8,7
bne- 0x2C

#Loads the seconds remaining in r6
lis r6,-32697
lwz r6,-18744(r6)

#If the seconds are at 0 (like if there is no time, or the match is over), branch out.
cmpwi r6,0
beq- 0x1C

#"Period of happening" = interval of checking if a player is dead?
li r7,5

#((int)(seconds / period) * period == seconds).In other words, if seconds are a modulo of 5 (the seconds divided by 5 is equal to 0)
divw r8,r6,r7
mullw r9,r8,r7

If the answer of the equation above is different from 0, branch out.
cmpw r9,r6
bne- 0x08

#Not out? Load death for the character, the function Ground Death
b 0xCEF04

#When the function is branched out, go here to resume the function ran at every frame.
mflr r0
b 0x65698
 
Last edited:

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
Finished! Accessible in the OP. You can ask some questions or wanted variants of the mod (like only at :x0 seconds instead of :x0/:x5).
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Nice. You don't need those 04 overwrites in the Gecko code, though. Just make those RAM addresses your injection point instead of at 80004c80 or whatever. Gecko codes automatically do branches for you.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Sorry, last post was a bit rushed. What I meant was:

Instead of this:
042839BC 4bd81254

C2004c10 0000000F
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
etc.

Do this:
C22839BC 0000000F
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
etc.


Another thing, the Gecko code may work for you right now, but it will not work if you use another Gecko code that is placed on the Gecko code list before the Hot Saturn code. E.g. if you enable Code X and it is higher on the list (or comes before) than Hot Saturn.

So the placement of the actual Gecko code in the RAM can change depending on how many codes you have enabled and in what order.

The code won't work because you are using "hard" branch links.
Capture.PNG


These branches are not saying to go to a specific code line, they are telling the game to go ahead X amount of bytes. So if your Gecko code changes location on the code list, and therefore changing location in the RAM, then when you branch ahead X amount of bytes, it will branch to a location you didn't mean for it to. The game will then more than likely freeze.


Dan Salvato sent me this last year when I first started coding:
Code:
By the way, there's a very easy way to branch to game functions using ASM codes.

Since you don't know where the ASM code is stored, you can't use a static branch value.

lis r3,0x8038
ori r3,r3,0xCFF4
mtctr r3
bctrl

Where r3 is the function address you want to branch to.
r3 is an arbitrary register in that example. Using this method, the branch (and link) will take you to a specific code line no matter where the code is placed in the RAM.

Static branches within the custom code itself is fine, but you do not want to static branch out somewhere else.

This does not need to apply to DOL mods because those are always in the same place in the RAM. But you still can if you want, and it will be easier on yourself if you ever want to move the code to a new place in the DOL because you won't need to recalculate the branch link byte value.

Code:
Similar ASM instructions:

mtlr
blrl

mtctr
bctr 
(no link back)
 
Last edited:

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
Sorry, last post was a bit rushed. What I meant was:

Instead of this:
042839BC 4bd81254

C2004c10 0000000F
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
etc.

Do this:
C22839BC 0000000F
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
etc.[/code]
How will Gecko knows the rest of the code goes to the address 80004c10? It's a single line to the existing function that branch out to the custom function at the beginning.

These branches are not saying to go to a specific code line, they are telling the game to go ahead X amount of bytes. So if your Gecko code changes location on the code list, and therefore changing location in the RAM, then when you branch ahead X amount of bytes, it will branch to a location you didn't mean for it to. The game will then more than likely freeze.
I didn't know I could make branches like that, but I knew it would branch to the wrong place if it moved places in the RAM. I took the original code and modified it, this is why it's a simple addition to branch, and I also wanted to finish it and make it work the fastest possible, then juste pasting it here. I'll surely improve it later
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
How will Gecko knows the rest of the code goes to the address 80004c10? It's a single line to the existing function that branch out to the custom function at the beginning.



I didn't know I could make branches like that, but I knew it would branch to the wrong place if it moved places in the RAM. I took the original code and modified it, this is why it's a simple addition to branch, and I also wanted to finish it and make it work the fastest possible, then juste pasting it here. I'll surely improve it later
The code doesn't need to be at 80004c10. That's where wParam put it because that is a location of free space in the RAM. When you enable a Gecko code, it automatically puts your custom code in free space in the RAM, so you don't have to do this yourself.
(Gecko code list starts at 0x800028c8 in the RAM, btw).
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Game Mode - Hot Mr. Saturn Potato (1.02) [wParam, w/ a hint of Achilles]
"If you are holding a Mr. Saturn when the seconds remaining in the match is a multiple of 5, you die. If you are hit with a Mr. Saturn while not holding another item, you are forced to catch it and are stunned for a second or so."
Code:
C22839BC 00000011
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
83C50CF4 2C1E0000
4182004C 83BE002C
811D1974 2C080000
4082003C 3C808009
608448A8 7C8803A6
7FE4FB78 7FC3F378
4E800021 3C80800C
6084318C 7C8803A6
7FC3F378 38800001
4E800021 3C804170
909D1A4C 7FE3FB78
BBA10008 8001001C
38210018 7C0803A6
7C0802A6 00000000
C206A360 0000000C
80C3002C 80E61974
2C070000 41820048
8107002C 81080010
2C080007 40820038
3CC08047 80C6B6C8
2C060000 41820028
38E00005 7D063BD6
7D2839D6 7C093000
40820014 3D20800D
612940B8 7D2903A6
4E800420 7C0802A6
60000000 00000000
[COLLAPSE="ASM Notes"]
Code:
*************************
* Hot Mr. Saturn Potato *
*************************

Code originally by wParam for the Crazy Mod. Converted to Gecko format by Achilles. I also changed the death mode to DeadUpStar instead of DeadDown.

In this mode, the rule is "If you are holding a mr. saturn when the seconds remaining in the match is a multiple of 5, you die. If you are hit with a mr. saturn while not holding another item, you are forced to catch it and stunned for a second or so."


Part 1:
inject @ 802839BC - mflr r0
802839BC   Item_MrSaturn_OnHitPlayer


HOT_SATURN_ENABLED:
#note:  r3 _MUST_ be preserved!
mflr r0
stw r0,4(r1)
stwu r1,-24(r1)
stmw r29,8(r1)

#8  is r29, subplayer_t of r30
#12 is r30, player_t
#16 is r31, item_t passed in
#20 is temp space for lfs

#r31 is the item passed in
mr r31,r3

lwz r5,44(r3) #r5 has sub_item_t
lwz r30, 0xCF4(r5) #r30 has target player
cmpwi r30, 0
beq- END_SATURN_HOOK  #if target == NULL, do nothing

lwz r29, 44(r30) #r29 has sub_player_t

#check if they already have an item
lwz r8, 0x1974(r29)
cmpwi r8, 0
bne- END_SATURN_HOOK

#ok.  They exist, and they don't have an item.
#Give them this one

#load GiveItemToPlayer and bl
lis r4,0x8009
ori r4,r4,0x48a8
mtlr r4
mr r4, r31
mr r3, r30
blrl

#load AS_129_DamageSong and bl
lis r4,0x800c
ori r4,r4,0x318c
mtlr r4
mr r3, r30
li r4, 1
blrl

lis r4, 0x4170  #15.. frames, I think
stw r4, 0x1A4C(r29)


END_SATURN_HOOK:
mr r3,r31
lmw r29,8(r1)
lwz r0,28(r1)
addi r1,r1,24
mtlr r0


END_SATURN_NOTHING:
mflr r0


C22839BC 00000011
7C0802A6 90010004
9421FFE8 BFA10008
7C7F1B78 80A3002C
83C50CF4 2C1E0000
4182004C 83BE002C
811D1974 2C080000
4082003C 3C808009
608448A8 7C8803A6
7FE4FB78 7FC3F378
4E800021 3C80800C
6084318C 7C8803A6
7FC3F378 38800001
4E800021 3C804170
909D1A4C 7FE3FB78
BBA10008 8001001C
38210018 7C0803A6
7C0802A6 00000000

--------------------

Part 2 (frame chain)
inject @ 8006a360 - mflr r0


SATURN_CHAIN_GO:

lwz r6, 44(r3) #sub player t
lwz r7, 0x1974(r6) #item held
cmpwi r7, 0
beq FRAME_CHAIN_DONE #if they don't have an item, abort

lwz r8, 44(r7) #subitem
lwz r8, 0x10(r8)
cmpwi r8, 7
bne FRAME_CHAIN_DONE  #if it isn't "mr. saturn", abort

#ok, now.  They're holding mr. saturn.
#first load the seconds.
#the item doesn't matter anymore.
#If seconds % 5 = 0, we kill them, otherwise, act normally.

#lis r6, 0x8046
#    #ori r6, r6, 0xB6A0
#    #lwz r6, 0x28(r6) #r6 has seconds remaining.
#    #these next two instructions are equivalent to
# the previous 3.

lis r6, 0x8047
lwz r6, -0x4938(r6)
cmpwi r6, 0
beq FRAME_CHAIN_DONE
#seconds = 0 means either end of match or no time limit

li r7, 5 #period of happening.

#if ((int)(seconds / period) * period == seconds, then
#seconds must have been a multiple of period.
divw r8, r6, r7
mullw r9, r8, r7

cmpw r9, r6
bne FRAME_CHAIN_DONE
#not equal, not a multiple of period, do nothing.

#ok.  So, they die.
#branch to AS_004_DeadUpStar
lis r9,0x800d
ori r9,r9,0x40b8
mtctr r9
bctr


FRAME_CHAIN_DONE:
mflr r0

C206A360 0000000C
80C3002C 80E61974
2C070000 41820048
8107002C 81080010
2C080007 40820038
3CC08047 80C6B6C8
2C060000 41820028
38E00005 7D063BD6
7D2839D6 7C093000
40820014 3D20800D
612940B8 7D2903A6
4E800420 7C0802A6
60000000 00000000
[/COLLAPSE]
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
I just realized that the DOL mod version has the same problem pointed out by achilles (below) as the original Gecko code, using hard branches within the function (besides just to/from the custom code). So the custom code can't be placed anywhere.

Sorry, last post was a bit rushed. What I meant was:
Another thing, the Gecko code may work for you right now, but it will not work if you use another Gecko code that is placed on the Gecko code list before the Hot Saturn code. E.g. if you enable Code X and it is higher on the list (or comes before) than Hot Saturn.

So the placement of the actual Gecko code in the RAM can change depending on how many codes you have enabled and in what order.

The code won't work because you are using "hard" branch links.
View attachment 48880

These branches are not saying to go to a specific code line, they are telling the game to go ahead X amount of bytes. So if your Gecko code changes location on the code list, and therefore changing location in the RAM, then when you branch ahead X amount of bytes, it will branch to a location you didn't mean for it to. The game will then more than likely freeze.


Dan Salvato sent me this last year when I first started coding:
Code:
By the way, there's a very easy way to branch to game functions using ASM codes.

Since you don't know where the ASM code is stored, you can't use a static branch value.

lis r3,0x8038
ori r3,r3,0xCFF4
mtctr r3
bctrl

Where r3 is the function address you want to branch to.
r3 is an arbitrary register in that example. Using this method, the branch (and link) will take you to a specific code line no matter where the code is placed in the RAM.

Static branches within the custom code itself is fine, but you do not want to static branch out somewhere else.

This does not need to apply to DOL mods because those are always in the same place in the RAM. But you still can if you want, and it will be easier on yourself if you ever want to move the code to a new place in the DOL because you won't need to recalculate the branch link byte value.

Code:
Similar ASM instructions:

mtlr
blrl

mtctr
bctr
(no link back)
I tried fixing it by replacing the hard branches with the method achilles suggested, and I tried to change the beq- and bne- commands to accommodate the extra lines, but I'm not having any luck getting it to work.

If anyone is interested in this, here's what I have for the new code:

Code:
# First function:

#Branch from 802839BC, when a Mr. Saturn hits a target by being thrown.
#Start
mflr r0

# Maybe it loads the player
stw r0,4(r1)
stwu r1,-24(r1)
stmw r29,8(r1)

#r31 is the item passed in
mr r31,r3

#r5 is the item-type
lwz r5,44(r3)

#r30 is the target of the thrown item
lwz r30,3316(r5)

#detects if the target exists (if it isn't an item)
cmpwi r30,0
#If doesn't exist, branch out and do nothing else
beq- 0x4C

#Loads the character of the player
lwz r29,44(r30)

#Check if the character have an item
lwz r8,6516(r29)
cmpwi r8,0
#If they have no item, continue.
bne- 0x3C

#Give them the item and branch to the function to give a character an item.
mr r4,r31
mr r3,r30
lis r3,0x8031
ori r3,r3,0x3618
mtctr r3
bctrl

#Then branch to the function to put a character to sleep
mr r3,r30
li r4,1
lis r3,0x8034
ori r3,r3,0x1EF0
mtctr r3
bctrl

#Also, set the sleep duration
lis r4,16752
stw r4,6732(r29)

#When it branches out, go through these. I'm not sure why it goes through that. 
#Branches back to the initial function to go as normally.
mr r3,r31
lmw r29,8(r1)
lwz r0,28(r1)
addi r1,r1,24
mtlr r0
mflr r0
b 0x27ED44




# Second function:

# Branches from 8006a360, a function executed every frame.
# Start of function. Loads the character of the player, then 
# check if the player has an item.
lwz r6,44(r3)
lwz r7,6516(r6)

#If there is no item, abort
cmpwi r7,0
beq- 0x4C

#Check the item-type
lwz r8,44(r7)
lwz r8,16(r8)

#If it'S not Mr. Saturn, abort
cmpwi r8,7
bne- 0x3C

#Loads the seconds remaining in r6
lis r6,-32697
lwz r6,-18744(r6)

# If the seconds are at 0 (like if there is no time, or the match is over), 
# branch out.
cmpwi r6,0
beq- 0x2C

#"Period of happening" = interval of checking if a player is dead?
li r7,5

#((int)(seconds / period) * period == seconds). In other words, if 
# seconds are a modulo of 5 (the seconds divided by 5 is equal to 0)
divw r8,r6,r7
mullw r9,r8,r7

# If the answer of the equation above is different from 0, branch out.
cmpw r9,r6
bne- 0x18

#Not out? Load death for the character, the function Ground Death
lis r3,0x8013
ori r3,r3,0x9264
mtctr r3
bctrl

#When the function is branched out, go here to resume the function 
# ran at every frame.
mflr r0
b 0x65698


And based on the original code, the game's functions that the code uses are these:

First function:
802839BC + 0x8FC5C = 80313618 (giveItem)
802839BC + 0xBE534 = 80341EF0 (putCharToSleep)

Second function:
8006a360 + 0xCEF04 = 80139264 (groundDeath)
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
I just realized that the DOL mod version has the same problem pointed out by achilles (below) as the original Gecko code, using hard branches within the function (besides just to/from the custom code). So the custom code can't be placed anywhere.



I tried fixing it by replacing the hard branches with the method achilles suggested, and I tried to change the beq- and bne- commands to accommodate the extra lines, but I'm not having any luck getting it to work.

If anyone is interested in this, here's what I have for the new code:

Code:
# First function:

#Branch from 802839BC, when a Mr. Saturn hits a target by being thrown.
#Start
mflr r0

# Maybe it loads the player
stw r0,4(r1)
stwu r1,-24(r1)
stmw r29,8(r1)

#r31 is the item passed in
mr r31,r3

#r5 is the item-type
lwz r5,44(r3)

#r30 is the target of the thrown item
lwz r30,3316(r5)

#detects if the target exists (if it isn't an item)
cmpwi r30,0
#If doesn't exist, branch out and do nothing else
beq- 0x4C

#Loads the character of the player
lwz r29,44(r30)

#Check if the character have an item
lwz r8,6516(r29)
cmpwi r8,0
#If they have no item, continue.
bne- 0x3C

#Give them the item and branch to the function to give a character an item.
mr r4,r31
mr r3,r30
lis r3,0x8031
ori r3,r3,0x3618
mtctr r3
bctrl

#Then branch to the function to put a character to sleep
mr r3,r30
li r4,1
lis r3,0x8034
ori r3,r3,0x1EF0
mtctr r3
bctrl

#Also, set the sleep duration
lis r4,16752
stw r4,6732(r29)

#When it branches out, go through these. I'm not sure why it goes through that.
#Branches back to the initial function to go as normally.
mr r3,r31
lmw r29,8(r1)
lwz r0,28(r1)
addi r1,r1,24
mtlr r0
mflr r0
b 0x27ED44




# Second function:

# Branches from 8006a360, a function executed every frame.
# Start of function. Loads the character of the player, then
# check if the player has an item.
lwz r6,44(r3)
lwz r7,6516(r6)

#If there is no item, abort
cmpwi r7,0
beq- 0x4C

#Check the item-type
lwz r8,44(r7)
lwz r8,16(r8)

#If it'S not Mr. Saturn, abort
cmpwi r8,7
bne- 0x3C

#Loads the seconds remaining in r6
lis r6,-32697
lwz r6,-18744(r6)

# If the seconds are at 0 (like if there is no time, or the match is over),
# branch out.
cmpwi r6,0
beq- 0x2C

#"Period of happening" = interval of checking if a player is dead?
li r7,5

#((int)(seconds / period) * period == seconds). In other words, if
# seconds are a modulo of 5 (the seconds divided by 5 is equal to 0)
divw r8,r6,r7
mullw r9,r8,r7

# If the answer of the equation above is different from 0, branch out.
cmpw r9,r6
bne- 0x18

#Not out? Load death for the character, the function Ground Death
lis r3,0x8013
ori r3,r3,0x9264
mtctr r3
bctrl

#When the function is branched out, go here to resume the function
# ran at every frame.
mflr r0
b 0x65698


And based on the original code, the game's functions that the code uses are these:

First function:
802839BC + 0x8FC5C = 80313618 (giveItem)
802839BC + 0xBE534 = 80341EF0 (putCharToSleep)

Second function:
8006a360 + 0xCEF04 = 80139264 (groundDeath)
I already fixed the code a few posts ago. You're functions are not correct. I forget where wParam placed his custom code in the RAM but let's say it was in the 80002000 area. So he would be branching from 802839bc back to 80002000. Then from 800020XX to the GiveItem function, etc.

Just look at wParams notes on his website where he lists the start of each of those vanilla functions.
 
Last edited:

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
I already fixed the code a few posts ago. You're functions are not correct. I forget where wParam placed his custom code in the RAM but let's say it was in the 80002000 area. So he would be branching from 802839bc back to 80002000. Then from 800020XX to the GiveItem function, etc.

Just look at wParams notes on his website where he lists the start of each of those vanilla functions.
His functions were placed just below the memory card buffer overflow, if I remember correctly. Then at the same region I use for functions is where he had a string lookup table, I think.

I don't have a dazzle, but I'll try to make one using a camera to show it.
Dolphin. OBS.

I've got an El Gato HD, but I'd need to move my Wii back from my living room to where my desktop is and that'd be a PITA right now.
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
I already fixed the code a few posts ago. You're functions are not correct. I forget where wParam placed his custom code in the RAM but let's say it was in the 80002000 area. So he would be branching from 802839bc back to 80002000. Then from 800020XX to the GiveItem function, etc.

Just look at wParams notes on his website where he lists the start of each of those vanilla functions.
Sorry, I only saw where you fixed the Gecko code; I was trying to do basically the same thing to the DOL mod version. I looked at his notes here, in the first two links, but I didn't see the functions. Maybe I overlooked them.

For a minute I was thinking that what I did wrong was I didn't include the offset of the branches (relative to the start of the function) when I added the branching distance to the start of the custom function.

If that were included, they would be:
(Function address + branch offset + branching distance)
802839BC + 0x48 + 0x8FC5C = 80313660 (giveItem)
802839BC + 0x60 + 0xBE534 = 80341F50 (putCharToSleep)
8006a360 + 0x50 + 0xCEF04 = 801392B4 (groundDeath)

But I see that that those addresses aren't right either. But why didn't that method work?

I don't have a dazzle, but I'll try to make one using a camera to show it.
I've got an El Gato HD, but I'd need to move my Wii back from my living room to where my desktop is and that'd be a PITA right now.
What about Dolphin's record feature?
 
Top Bottom