Force Expert Staff Ghosts to Load on Specific Track [Diamond]
#1
Force Expert Staff Ghosts to Load on Specific Track [Diamond]

Forces the expert staff ghosts to load on the tracks designated by their filename, negating the need to have to manually change this in hex. This code is required to bypass any checksum error that may occur: https://mkwii.com/showthread.php?tid=1600.
Changing the source could allow you to change the track order, as well as the types of ghosts that get their track ids overwritten.

NTSC-U
C200B510 0000000D
907F0050 A19F001C
2C0C7432 40A20054
48000025 08010204
00050607 090F030B
0A0E0C0D 1F19181E
1B1A1D1C 10111213
14151617 A19F0024
518CE036 718C00FF
559FE13E 1FFF0006
7D9F6050 7FE802A6
7FFF6214 8BFF0000
57FF103A 9BE30007
60000000 00000000


PAL
C200B5B0 0000000D
907F0050 A19F001C
2C0C7432 40A20054
48000025 08010204
00050607 090F030B
0A0E0C0D 1F19181E
1B1A1D1C 10111213
14151617 A19F0024
518CE036 718C00FF
559FE13E 1FFF0006
7D9F6050 7FE802A6
7FFF6214 8BFF0000
57FF103A 9BE30007
60000000 00000000


NTSC-J
C200B4D4 0000000D
907F0050 A19F001C
2C0C7432 40A20054
48000025 08010204
00050607 090F030B
0A0E0C0D 1F19181E
1B1A1D1C 10111213
14151617 A19F0024
518CE036 718C00FF
559FE13E 1FFF0006
7D9F6050 7FE802A6
7FFF6214 8BFF0000
57FF103A 9BE30007
60000000 00000000


NTSC-K
C200B65C 0000000D
907F0050 A19F001C
2C0C7432 40A20054
48000025 08010204
00050607 090F030B
0A0E0C0D 1F19181E
1B1A1D1C 10111213
14151617 A19F0024
518CE036 718C00FF
559FE13E 1FFF0006
7D9F6050 7FE802A6
7FFF6214 8BFF0000
57FF103A 9BE30007
60000000 00000000


Source

Code:
#ntscu 8000b510
#pal 8000b5b0
#ntscj 8000b4d4
#ntsck 8000b65c

stw r3,0x50(r31) #default instruction
lhz r12,0x1c(r31)
cmpwi r12,0x7432 #check if loadtoram string reads "t2" in ascii
bne+ default
bl track_ids #track id order in correspondence to ghost file names
.long 0x08010204
.long 0x00050607
.long 0x090f030b
.long 0x0a0e0c0d
.long 0x1f19181e
.long 0x1b1a1d1c
.long 0x10111213
.long 0x14151617
track_ids:
#resolve pointer to new id from track id list
lhz r12,0x24(r31)
rlwimi r12,r12,28,0xfffffff0
andi. r12,r12,0xff
#convert offset to hex
srwi r31,r12,4
mulli r31,r31,6
sub r12,r12,r31
mflr r31
add r31,r31,r12
lbz r31,0(r31)
slwi r31,r31,2 #shift for padding
stb r31,7(r3)

default:


Code creator: Diamond
Reply
#2
I'm really impressed with your recent work. Keep it up!
Reply
#3
So how does this work. Will this allow staff ghosts on LE Code or CT Code custom tracks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)