Show Kart Statuses on Minimap [Ro]
#1
Show Kart Statuses on Minimap [Ro]

This code will show kart statuses on minimap like the recent Mario Kart titles. The statuses that are included are: Star, Mega, Bullet, Shocked, Inked and Crushed.

How each status show on the minimap:
Star: Character icon will have a blinking red/blue outline (similar to Need for Speed cop icon blinking colors)
Mega: Character icon will be bigger
Bullet: Character icon will have a black outline
Shocked: Character icon will be smaller
Inked: Character icon will be black
Crushed: Character icon will be squished

Source code will be included for modification and because it's a huge code. If you want to remove a specific status and don't want to modify source, instructions for modifying compiled ASM code are at the end of this post.

NTSC-U
C27E2018 00000025
3D40809C 818AD110
818C0020 2804000B
4081000C 808A8F68
88840B84 1D640004
7D8C5A14 818C0000
818C0000 818C0004
48000009 3E19999A
7D2802A6 815C01B8
C00A0044 C0290000
811C01BC 813C01C0
C0490044 80EC000C
70E08000 4182000C
EC00082A EC42082A
70E00080 4182000C
EC000828 EC420828
74E01000 41820008
EC000028 D00A0044
D0480044 D0490044
74E00001 41820014
EC000828 EC420828
EC000828 EC420828
D00A0048 D0480048
D0490048 816C0008
75608000 40820014
74E01800 40820034
80030B90 48000058
89430050 394A0001
2C0A000A 41800008
39400000 99430050
2C0A0005 3BE00002
41800008 3BE00001
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 3D80807E
618C2114 7D8903A6
4E800420 00000000

PAL
C27EB8C4 00000025
3D40809C 818A18F8
818C0020 2804000B
4081000C 808AD728
88840B84 1D640004
7D8C5A14 818C0000
818C0000 818C0004
48000009 3E19999A
7D2802A6 815C01B8
C00A0044 C0290000
811C01BC 813C01C0
C0490044 80EC000C
70E08000 4182000C
EC00082A EC42082A
70E00080 4182000C
EC000828 EC420828
74E01000 41820008
EC000028 D00A0044
D0480044 D0490044
74E00001 41820014
EC000828 EC420828
EC000828 EC420828
D00A0048 D0480048
D0490048 816C0008
75608000 40820014
74E01800 40820034
80030B90 48000058
89430050 394A0001
2C0A000A 41800008
39400000 99430050
2C0A0005 3BE00002
41800008 3BE00001
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 3D80807E
618CB9C0 7D8903A6
4E800420 00000000

NTSC-J
C27EAF30 00000025
3D40809C 818A0958
818C0020 2804000B
4081000C 808AC788
88840B84 1D640004
7D8C5A14 818C0000
818C0000 818C0004
48000009 3E19999A
7D2802A6 815C01B8
C00A0044 C0290000
811C01BC 813C01C0
C0490044 80EC000C
70E08000 4182000C
EC00082A EC42082A
70E00080 4182000C
EC000828 EC420828
74E01000 41820008
EC000028 D00A0044
D0480044 D0490044
74E00001 41820014
EC000828 EC420828
EC000828 EC420828
D00A0048 D0480048
D0490048 816C0008
75608000 40820014
74E01800 40820034
80030B90 48000058
89430050 394A0001
2C0A000A 41800008
39400000 99430050
2C0A0005 3BE00002
41800008 3BE00001
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 3D80807E
618CB02C 7D8903A6
4E800420 00000000

NTSC-K
C27D9C84 00000025
3D40809B 818AFF38
818C0020 2804000B
4081000C 808ABD68
88840B84 1D640004
7D8C5A14 818C0000
818C0000 818C0004
48000009 3E19999A
7D2802A6 815C01B8
C00A0044 C0290000
811C01BC 813C01C0
C0490044 80EC000C
70E08000 4182000C
EC00082A EC42082A
70E00080 4182000C
EC000828 EC420828
74E01000 41820008
EC000028 D00A0044
D0480044 D0490044
74E00001 41820014
EC000828 EC420828
EC000828 EC420828
D00A0048 D0480048
D0490048 816C0008
75608000 40820014
74E01800 40820034
80030B90 48000058
89430050 394A0001
2C0A000A 41800008
39400000 99430050
2C0A0005 3BE00002
41800008 3BE00001
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 3D80807D
618C9D80 7D8903A6
4E800420 00000000

If you want to remove specific statuses from the compiled ASM code, replace these lines:
Star: 75608000 40820014 to 75608000 60000000
Mega: 70E08000 4182000C to 70E08000 4800000C
Bullet:  74E01800 40820034 to  74E01000 40820034
Shocked: 70E00080 4182000C to 70E00080 4800000C
Inked: 74E01000 41820008 to 74E01000 48000008 (No black icon but keep outline) AND ALSO 74E01800 40820034 to 74E00800 40820034 (No outline) - Be aware that this second line is also where the Bullet is handled, so if you don't want neither of them, change 40820034 to 60000000
Crushed: 74E00001 41820014 to 74E00001 48000014


Code:
.set region, '' #Plug in e,p,j,k for compilation region
.if (region == 'E' || region == 'e')
        .set ptr_raceData, 0x809B8F68
        .set ptr_playerBase, 0x809BD110
        .set addr_pastBattleOutlineCode, 0x807E2114
.elseif (region == 'P' || region == 'p')
        .set ptr_raceData, 0x809BD728
        .set ptr_playerBase, 0x809C18F8
        .set addr_pastBattleOutlineCode, 0x807EB9C0
.elseif (region == 'J' || region == 'j')
       .set ptr_raceData, 0x809BC788
       .set ptr_playerBase, 0x809C18F8
       .set addr_pastBattleOutlineCode, 0x807EB02C
.elseif (region == 'K' || region == 'k')
       .set ptr_raceData, 0x809ABD68
       .set ptr_playerBase, 0x809AFF38
       .set addr_pastBattleOutlineCode, 0x807D9D80
.else
        .err
.endif


getPointers:
lis r10, ptr_playerBase@ha
lwz r12, ptr_playerBase@l (r10)
lwz r12, 0x20 (r12)
cmplwi r4, 0xB
ble skipGetMasterSlot
lwz r4, ptr_raceData@l (r10)
lbz r4, 0xB84 (r4)
skipGetMasterSlot:
mulli r11, r4, 4
add r12, r12, r11
lwz r12, 0 (r12)
lwz r12, 0 (r12)
lwz r12, 4 (r12)

calcMinimapIconSizes:
bl iconSizeDifference
.long 0x3E19999A

iconSizeDifference:
mflr r9
lwz r10, 0x1B8 (r28)
lfs f0, 0x44 (r10)
lfs f1, 0 (r9)
lwz r8, 0x1BC (r28)
lwz r9, 0x1C0 (r28)
lfs f2, 0x44 (r9)

isBigKinoko:
lwz r7, 0xC (r12)
andi. r0, r7, 0x8000
beq isThunder
fadds f0, f0, f1
fadds f2, f2, f1

isThunder:
andi. r0, r7, 0x80
beq isGesso
fsubs f0, f0, f1
fsubs f2, f2, f1

isGesso:
andis. r0, r7, 0x1000
beq storeMinimapIconXSizes
fsubs f0, f0, f0

storeMinimapIconXSizes:
stfs f0, 0x44 (r10)
stfs f2, 0x44 (r8)
stfs f2, 0x44 (r9)

isPressed:
andis. r0, r7, 0x1
beq storeMinimapIconYSizes
fsubs f0, f0, f1
fsubs f2, f2, f1
fsubs f0, f0, f1
fsubs f2, f2, f1

storeMinimapIconYSizes:
stfs f0, 0x48 (r10)
stfs f2, 0x48 (r8)
stfs f2, 0x48 (r9)

isOutlineStatus:
lwz r11, 0x8 (r12)
andis. r0, r11, 0x8000
bne outlineStarAnimation
andis. r0, r7, 0x1800
bne applyOutlines

originalInstruction:
lwz r0, 0xB90 (r3)
b end

outlineStarAnimation:
lbz r10, 0x50 (r3)
addi r10, r10, 1
cmpwi r10, 10
blt storeTimer
li r10, 0
storeTimer:
stb r10, 0x50 (r3)
cmpwi r10, 5
li r31, 2
blt applyOutlines
li r31, 1

applyOutlines:
li r0, 2
lwz r12, 0x1BC (r28)
li r11, 1
stb r11, 0xBB (r12)
lwz r12, 0x1C0 (r28)
li r11, 5
stb r11, 0xBB (r12)

branchPastBattleOutlineCodeForStarAnim:
lis r12, addr_pastBattleOutlineCode@ha
ori r12, r12, addr_pastBattleOutlineCode@l
mtctr r12
bctr

end:

Code creator: Ro
mtctr r0 ~ bctrl / BLX R0
Reply
#2
Please report me if it doesn't work properly or crashes
mtctr r0 ~ bctrl / BLX R0
Reply
#3
lmfao I'm fucking dead reading my previous message, obviously I meant to report to me issues etc, and not to report me (bad English moment)
mtctr r0 ~ bctrl / BLX R0
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)