Start with Items [CLF78, Fynn935083]
#1
This is a Gecko Code Create by me and CLF78. It was made for Fynn935083's in-progress custom Gamemode "Catch". This gives you the Item you set after the Countdown

PAL:
C2535C7C 0000000F
901D0048 2C030000
40A2006C 3C60809C
886338B9 2C030001
4082002C 3C60809C
806320D8 38830038
8063291C 1C630058
7C641A14 88830021
88A30022 7C042800
40A20034 3C60809C
8063D728 88630B84
1C630248 3C80809C
80843618 80840014
7C632214 388000XX
9083008C 38800001
90830090 00000000

NTSC-U:
C2531134 0000000F
901D0048 2C030000
40A2006C 3C60809C
8863F0B1 2C030001
4082002C 3C60809C
8063D918 38830038
8063291C 1C630058
7C641A14 88830021
88A30022 7C042800
40A20034 3C60809C
80638F68 88630B84
1C630248 3C80809C
8084EE20 80840014
7C632214 388000XX
9083008C 38800001
90830090 00000000

NTSC-K:
C2523CD4 0000000F
901D0048 2C030000
40A2006C 3C60809B
886313F9 2C030001
4082002C 3C60809B
80630718 38830038
8063291C 1C630058
7C641A14 88830021
88A30022 7C042800
40A20034 3C60809B
8063BD68 88630B84
1C630248 3C80809B
80841C58 80840014
7C632214 388000XX
9083008C 38800001
90830090 00000000

NTSC-J:
C25355FC 0000000F
901D0048 2C030000
40A2006C 3C60809C
88632919 2C030001
4082002C 3C60809C
80631138 38830038
8063291C 1C630058
7C641A14 88830021
88A30022 7C042800
40A20034 3C60809C
8063C788 88630B84
1C630248 3C80809C
80842678 80840014
7C632214 388000XX
9083008C 38800001
90830090 00000000

XX Values:
Green Shell = 00
Red Shell = 01
Banana = 02
Fake Item Box = 03
Mushroom = 04
Triple Mushroom = 05
Bob-omb = 06
Blue Shell = 07
Shock = 08
Star = 09
Golden Mushroom = 0A
Mega Mushroom = 0B
Blooper = 0C
POW = 0D
Thunder Cloud = 0E
Bullet Bill = 0F
Triple Green Shell = 10
Triple Red Shell = 11
Triple Banana = 12

Code:
Source Code:

# Inject at 80535C7C



.set Racedata, 0x809BD728

.set ItemHolder, 0x809C3618

.set RKNetController, 0x809C20D8

.set isOnlineRace, 0x809C38B9



# Original instruction

stw r0, 0x48(r29)



# Check if timer is 0

cmpwi r3, 0

bne+ end



# Check if it's an online race

lis r3, isOnlineRace@ha

lbz r3, isOnlineRace@l(r3)

cmpwi r3, 1

bne offline



# Check if i'm the host

lis r3, RKNetController@ha

lwz r3, RKNetController@l(r3)



# Get offset of first sub

addi r4, r3, 0x38



# Get current sub

lwz r3, 0x291C(r3)

mulli r3, r3, 0x58

add r3, r4, r3



# Check if i'm the host

lbz r4, 0x21(r3)

lbz r5, 0x22(r3)

cmpw r4, r5

bne+ end



# Get my player id

offline:

lis r3, Racedata@ha

lwz r3, Racedata@l(r3)

lbz r3, 0xB84(r3)

mulli r3, r3, 0x248



# Get my ItemController

lis r4, ItemHolder@ha

lwz r4, ItemHolder@l(r4)

lwz r4, 0x14(r4)

add r3, r3, r4



# Store Item

li r4, 0xC*

stw r4, 0x8C(r3)

li r4, 1

stw r4, 0x90(r3)



# Return

end:
Reply
#2
This just took a while to be approved (sorry), no need to post it again :p
Needs ports for all regions before it can be posted out of the incomplete code section
Reply
#3
Yeah I'm porting it later today
Reply
#4
Nice code.
Reply
#5
Finally remembered to get around to testing the ports

NTSC-U = You get your desired item to start with, but then it acts as an infinite item cheat for the rest of the race; so not working
NTSC-J = Blackscreens right before race is loaded
NTSC-K = Freezes once countdown hits zero
Reply
#6
The ported addresses for 3*NTCS are wrong:
Code:
wstrt port -0 .C2535C7C

#───────────────────────────────────────────────────────────────────────
#  PAL      USA      JAP      KOR    where  status
#───────────────────────────────────────────────────────────────────────
c2535c7c c2531134 c25355fc c2523cd4  REL1  0: verified
#───────────────────────────────────────────────────────────────────────
Reply
#7
Thank you. NTSC-U now works, but J and K are freezing at countdown. So only thing left is the in-source addresses for J and K have bad ports which will be slightly tedious to port. I would port these myself but I'm very lazy and got to go out of town due to work yet again on Monday

EDIT:

Had some free time and finished all the in-source address porting. Port command on wstrt is awesome!

For anyone who cares here's compile-able source:

Code:
#Code created by CLF78 & Fynn935083

#address ports
#80531134 = NTSC-U
#80535C7C = PAL
#805355FC = NTSC-J
#80523CD4 = NTSC-K

.set region, 'e' #fill in e p j or k

.if (region == 'E' || region == 'e') # RMCE
.set addr1, 0x809BF0B1
.set addr2, 0x809BD918
.set addr3, 0x809B8F68
.set addr4, 0x809BEE20
.elseif (region == 'P' || region == 'p') # RMCP
.set addr1, 0x809C38B9
.set addr2, 0x809C20D8
.set addr3, 0x809BD728
.set addr4, 0x809C3618
.elseif (region == 'J' || region == 'j') # RMCJ
.set addr1, 0x809C2919
.set addr2, 0x809C1138
.set addr3, 0x809BC788
.set addr4, 0x809C2678
.elseif (region == 'K' || region == 'k') # RMCK
.set addr1, 0x809B13F9
.set addr2, 0x809B0718
.set addr3, 0x809ABD68
.set addr4, 0x809B1C58
.else # Invalid Region
.err
.endif

stw r0,72(r29)
cmpwi r3,0
bne+ 0x006C
lis r3, addr1@ha
lbz r3, addr1@l (r3)
cmpwi r3,1
bne- 0x002C
lis r3, addr2@ha
lwz r3, addr2@l (r3)
addi r4,r3,56
lwz r3,0x291C(r3)
mulli r3,r3,88
add r3,r4,r3
lbz r4,33(r3)
lbz r5,34(r3)
cmpw r4,r5
bne+ 0x0034
lis r3, addr3@ha
lwz r3, addr3@l (r3)
lbz r3,0x0B84(r3)
mulli r3,r3,584
lis r4, addr4@ha
lwz r4, addr4@l (r4)
lwz r4,20(r4)
add r3,r3,r4
li r4, 6 #Set to bob-omb just for compilation purposes
stw r4,140(r3)
li r4,1
stw r4,144(r3)
Reply
#8
(05-15-2021, 12:55 PM)Vega Wrote: Thank you. NTSC-U now works, but J and K are freezing at countdown. So only thing left is the in-source addresses for J and K have bad ports which will be slightly tedious to port. I would port these myself but I'm very lazy and got to go out of town due to work yet again on Monday

EDIT:

Had some free time and finished all the in-source address porting. Port command on wstrt is awesome!

For anyone who cares here's compile-able source:

Code:
#Code created by CLF78 & Fynn935083

#address ports
#80531134 = NTSC-U
#80535C7C = PAL
#805355FC = NTSC-J
#80523CD4 = NTSC-K

.set region, 'e' #fill in e p j or k

.if (region == 'E' || region == 'e') # RMCE
.set addr1, 0x809BF0B1
.set addr2, 0x809BD918
.set addr3, 0x809B8F68
.set addr4, 0x809BEE20
.elseif (region == 'P' || region == 'p') # RMCP
.set addr1, 0x809C38B9
.set addr2, 0x809C20D8
.set addr3, 0x809BD728
.set addr4, 0x809C3618
.elseif (region == 'J' || region == 'j') # RMCJ
.set addr1, 0x809C2919
.set addr2, 0x809C1138
.set addr3, 0x809BC788
.set addr4, 0x809C2678
.elseif (region == 'K' || region == 'k') # RMCK
.set addr1, 0x809B13F9
.set addr2, 0x809B0718
.set addr3, 0x809ABD68
.set addr4, 0x809B1C58
.else # Invalid Region
.err
.endif

stw r0,72(r29)
cmpwi r3,0
bne+ 0x006C
lis r3, addr1@ha
lbz r3, addr1@l (r3)
cmpwi r3,1
bne- 0x002C
lis r3, addr2@ha
lwz r3, addr2@l (r3)
addi r4,r3,56
lwz r3,0x291C(r3)
mulli r3,r3,88
add r3,r4,r3
lbz r4,33(r3)
lbz r5,34(r3)
cmpw r4,r5
bne+ 0x0034
lis r3, addr3@ha
lwz r3, addr3@l (r3)
lbz r3,0x0B84(r3)
mulli r3,r3,584
lis r4, addr4@ha
lwz r4, addr4@l (r4)
lwz r4,20(r4)
add r3,r3,r4
li r4, 6 #Set to bob-omb just for compilation purposes
stw r4,140(r3)
li r4,1
stw r4,144(r3)
New to all this,  but this makes me curious. Do people make these codes off of this source and in this sort of language? or do they edit it in Hexadecimal?
Reply
#9
(05-17-2021, 07:34 PM)Fear Wrote:
(05-15-2021, 12:55 PM)Vega Wrote: Thank you. NTSC-U now works, but J and K are freezing at countdown. So only thing left is the in-source addresses for J and K have bad ports which will be slightly tedious to port. I would port these myself but I'm very lazy and got to go out of town due to work yet again on Monday

EDIT:

Had some free time and finished all the in-source address porting. Port command on wstrt is awesome!

For anyone who cares here's compile-able source:

Code:
#Code created by CLF78 & Fynn935083

#address ports
#80531134 = NTSC-U
#80535C7C = PAL
#805355FC = NTSC-J
#80523CD4 = NTSC-K

.set region, 'e' #fill in e p j or k

.if (region == 'E' || region == 'e') # RMCE
.set addr1, 0x809BF0B1
.set addr2, 0x809BD918
.set addr3, 0x809B8F68
.set addr4, 0x809BEE20
.elseif (region == 'P' || region == 'p') # RMCP
.set addr1, 0x809C38B9
.set addr2, 0x809C20D8
.set addr3, 0x809BD728
.set addr4, 0x809C3618
.elseif (region == 'J' || region == 'j') # RMCJ
.set addr1, 0x809C2919
.set addr2, 0x809C1138
.set addr3, 0x809BC788
.set addr4, 0x809C2678
.elseif (region == 'K' || region == 'k') # RMCK
.set addr1, 0x809B13F9
.set addr2, 0x809B0718
.set addr3, 0x809ABD68
.set addr4, 0x809B1C58
.else # Invalid Region
.err
.endif

stw r0,72(r29)
cmpwi r3,0
bne+ 0x006C
lis r3, addr1@ha
lbz r3, addr1@l (r3)
cmpwi r3,1
bne- 0x002C
lis r3, addr2@ha
lwz r3, addr2@l (r3)
addi r4,r3,56
lwz r3,0x291C(r3)
mulli r3,r3,88
add r3,r4,r3
lbz r4,33(r3)
lbz r5,34(r3)
cmpw r4,r5
bne+ 0x0034
lis r3, addr3@ha
lwz r3, addr3@l (r3)
lbz r3,0x0B84(r3)
mulli r3,r3,584
lis r4, addr4@ha
lwz r4, addr4@l (r4)
lwz r4,20(r4)
add r3,r3,r4
li r4, 6 #Set to bob-omb just for compilation purposes
stw r4,140(r3)
li r4,1
stw r4,144(r3)
New to all this,  but this makes me curious. Do people make these codes off of this source and in this sort of language? or do they edit it in Hexadecimal?
ASM, its mainly ASM.
~MarioKartWii.com #1~
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)