Force Shock Damage [1superchip]
#1
Force Shock Damage [1superchip]

This code will allow you to shock all other players in a race when you push the activator to shock all players. The Player ID that uses the shock can be changed, valid values for P are (0 - 11) setting the Player ID to 0 will give yourself invincibility. It is recommended to use No Lightning Flash by Anarion.

When used offline, CPUs are affected. If used in Time Trials ghosts set by humans will be effected and will get desynced.

YYYY is the controller address and ZZZZ is your button activator, do not press/hold any other buttons.

This code uses memory addresses 0x81430004 - 0x81430007. Make sure no other codes in your GCT/Cheat-Manager are using those addresses.

NTSC-U
C0000000 0000000B
3C608143 80630004
2C030000 41820044
3C608034 6063YYYY
A0630000 2C03ZZZZ
40820030 9421FF80
7D8802A6 BC610008
3860000P 3D80807A
618C91C0 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000
C27AE8F4 00000002
90050008 3C808143
90040004 00000000

PAL
C0000000 0000000B
3C608143 80630004
2C030000 41820044
3C608034 6063YYYY
A0630000 2C03ZZZZ
40820030 9421FF80
7D8802A6 BC610008
3860000P 3D80807B
618C7C20 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000
C27BD354 00000002
90050008 3C808143
90040004 00000000

NTSC-J
C0000000 0000000B
3C608143 80630004
2C030000 41820044
3C608034 6063YYYY
A0630000 2C03ZZZZ
40820030 9421FF80
7D8802A6 BC610008
3860000P 3D80807B
618C728C 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000
C27BC9C4 00000002
90050008 3C808143
90040004 00000000

NTSC-K
C0000000 0000000B
3C608143 80630004
2C030000 41820044
3C608033 6063YYYY
A0630000 2C03ZZZZ
40820030 9421FF80
7D8802A6 BC610008
3860000P 3D80807A
618C5FE0 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000
C27AB714 00000002
90050008 3C808143
90040004 00000000

Code creator: 1superchip
Code credits: Vega

Sources:

Code:
#C0 ASM

.set region, '' #Plug in e,p,j,k for compilation region

lis r3, 0x8143
lwz r3, 0x4 (r3)
cmpwi r3, 0
beq- the_end

.if (region == 'E' || region == 'e')
lis r3, 0x8034
.elseif (region == 'P' || region == 'p')
lis r3, 0x8034
.elseif (region == 'J' || region == 'j')
lis r3, 0x8034
.elseif (region == 'K' || region == 'k')
lis r3, 0x8033
.else # Invalid Region
.err
.endif

ori r3, r3, 0x8000 #PAL GCN value used just for compilation only
lhz r3, 0 (r3)

cmpwi r3, 0x0880 #GCN Y value used just for compilation only
bne- the_end

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

li r3, 1 #P value, 1 used just for compilation only

.if (region == 'E' || region == 'e')
lis r12, 0x807A
ori r12, r12, 0x91C0
.elseif (region == 'P' || region == 'p')
lis r12, 0x807B
ori r12, r12, 0x7C20
.elseif (region == 'J' || region == 'j')
lis r12, 0x807B
ori r12, r12, 0x728C
.elseif (region == 'K' || region == 'k')
lis r12, 0x807A
ori r12, r12, 0x5FE0
.else # Invalid Region
.err
.endif

mtlr r12
blrl #Call function and return

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

the_end:

#blr #uncomment if NOT compiling with pyiiasmh

#############

#C2 ASM

#Address Ports
#807AE8F4 NTSC-U
#807BD354 PAL
#807BC9C4 NTSC-J
#807AB714 NTSC-K

stw r0,8(r5) #Default instruction
lis r4, 0x8143
stw r0, 0x4 (r4)
Reply
#2
lmao !
Reply
#3
Small thing I noticed: some PAL controller addresses won't work with this code because their lower half is above 0x8000 and the offset of a lhz is signed
Reply
#4
All fixed and updated.

Ye, for GCN PAL the 3C608034 needs to be changed to 3C608035. Can be solved by writing the second half of the address with an ori and then doing a lhz with a null offset. I also noticed the code (1st ASM) is ending in a nop even though its a C0 ASM.

Here's a quick fix
#decompilation using yyyy value of 0x8000, zzzz value of 0x0880 and p value of 1

lis r3,-32445
lwz r3,4(r3)
cmpwi r3,0
beq+ 0x0040
lis r3,-32716
#Plug in instruction here of ori r3, r3, 0xYYYY
lhz r3,-32768(r3) #Change the offset amount on the lhz to null (lhz r3, 0 (r3))
cmpwi r3,2176
bne+ 0x0030
stwu r1,-128(r1)
mflr r12
stmw r3,8(r1)
li r3,1
lis r12,-32645
ori r12,r12,31776
mtlr r12
blrl
lmw r3,8(r1)
mtlr r12
addi r1,r1,128
blr #dont need this if you are compiling with pyiiasmh w/ c0 option

Here's the code compiled after the fixes were implemented
C0000000 0000000B
3C608143 80630004
2C030000 41A20040
3C608034 6063YYYY
A0630000 2C03ZZZZ
40A20030 9421FF80
7D8802A6 BC610008
3860000P 3D80807B
618C7C20 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)