Use Pow Anytime [1superchip]
#1
Use Pow Anytime [1superchip]

This code allows you to use a pow in a race whenever you want. Press the Activator and the Pow will be used. This code is server-sided. When using this code you will lose items in your item slot (3 mushrooms -> 2 mushrooms -> 1 mushroom).
This resets the ItemSlotData pow timer making pows unable to be pulled from item boxes for 20 seconds after use.

X = player slot using pow
XXXX = Controller Address
ZZZZ = Button Value

NTSC-U
C0000000 0000000D
3C608034 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A2004C 3C60809C
8063EE20 2C030000
4182003C 9421FF80
7D8802A6 BC610008
80630014 3880000X
1C840248 7C632214
3C80807D 60849580
7C8803A6 4E800021
B8610008 7D8803A6
38210080 4E800020

PAL
C0000000 0000000D
3C608034 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A2004C 3C60809C
80633618 2C030000
4182003C 9421FF80
7D8802A6 BC610008
80630014 3880000X
1C840248 7C632214
3C80807B 60841B2C
7C8803A6 4E800021
B8610008 7D8803A6
38210080 4E800020

NTSC-J
C0000000 0000000D
3C608034 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A2004C 3C60809C
80632678 2C030000
4182003C 9421FF80
7D8802A6 BC610008
80630014 3880000X
1C840248 7C632214
3C80807B 60841198
7C8803A6 4E800021
B8610008 7D8803A6
38210080 4E800020

NTSC-K
C0000000 0000000D
3C608033 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A2004C 3C60809B
80631C58 2C030000
4182003C 9421FF80
7D8802A6 BC610008
80630014 3880000X
1C840248 7C632214
3C808079 6084FEEC
7C8803A6 4E800021
B8610008 7D8803A6
38210080 4E800020

Source:

.set region, ''
.set UsePlayerID, X #this is the player id that uses the pow

.if (region == 'E' || region == 'e') # RMCE
    .set Pow_use, 0x807d9580
    .set ItemHolder, 0x809bee20
    lis r3, 0x8034
.elseif (region == 'P' || region == 'p') # RMCP
    .set Pow_use, 0x807b1b2c
    .set ItemHolder, 0x809C3618
    lis r3, 0x8034
.elseif (region == 'J' || region == 'j') # RMCJ
    .set Pow_use, 0x807b1198
    .set ItemHolder, 0x809C2678
    lis r3, 0x8034
.elseif (region == 'K' || region == 'k') # RMCK
    .set Pow_use, 0x8079feec
    .set ItemHolder, 0x809B1C58
    lis r3, 0x8033
.else # Invalid Region
    .err
.endif

ori r3, r3, 0xXXXX
lhz r3, 0 (r3)
li r11, 0xZZZZ
and r0, r11, r3
cmpw r0, r11
bne+ end

lis r3, ItemHolder@ha
lwz r3, ItemHolder@l (r3)

cmpwi r3, 0
beq- end

stwu sp, -0x0080 (sp) #Make stack frame
mflr r12 #Backup LR because C0
stmw r3, 0x8 (sp)

lwz r3, 0x14 (r3)
li r4, UsePlayerID
mulli r4, r4, 0x248
add r3, r3, r4

lis r4, Pow_use@h
ori r4, r4, Pow_use@l
mtlr r4
blrl

lmw r3, 0x8 (sp) #Pop stack frame
mtlr r12 #Recover LR because c0
addi sp, sp, 0x0080

end:
blr



Code Creator: 1superchip
Code Contributor: Vega (ASM for pressing multiple buttons)
Reply
#2
Thanks for posting this! As my version is "hacky".

Btw here's a snippet of source to allow the user to hold/press their other buttons.

Code:
.if (region == 'E' || region == 'e') # RMCE
    lis r12, 0x8034
.elseif (region == 'P' || region == 'p') # RMCP
    lis r12, 0x8034
.elseif (region == 'J' || region == 'j') # RMCJ
    lis r12, 0x8034
.elseif (region == 'K' || region == 'k') # RMCK
    lis r12, 0x8033
.else # Invalid Region
    .err
.endif

ori r12, r12, 0xXXXX
lhz r12, 0 (r12)
li r11, 0xZZZZ
and r0, r11, r12
cmpw r0, r11
bne+ end
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)