Coding Questions and other Quandaries
That's what I was working on last night. It works... to an extent.
There are two addresses involved in modding characters. One in MEM1 and the other in MEM2.
The character values aren't a straight up simple 0x0 -> 0x11 for both of these addresses:

MEM1/MEM2

Mario 0x0/0x0
Luigi 0x1/0x1
Peach 0x2/0x2
Daisy 0x3/0x3
Wario 0x5/0x4
Waluigi 0x6/0x5
Yoshi 0x4/0x6
Koopa Troopa 0xB/0x7
Donkey Kong 0x7/0x8
Diddy Kong 0x9/0x9
Boo 0xC/0xA
Shy Guy 0xA/0xB
Bowzer 0x8/0xC
Bowzer Jr. 0xD/0xD
Fly Guy 0xE/0XE
Paratroopa 0xF/0xF
Wiggler 0x10/0x10
Petey Piranha 0x11/0x11

I used the character value rotator (minus the Mii value) used in Mario Sports Mix. (See Above)
Added another C0 code to pick up on the value from that address which is constantly cycling 0x0 -> 0x11
and correct as necessary to store in the MEM1 address:

loc_0x0:
lis r11, 0x8000
lhz r12, 976(r11) #ASM This is loading the 0x0 -> 0x11 character value rotator from EVA; this value to be stored in MEM2
cmpwi r12, 0x4 #ASM Comparing that value with ones that have different values in MEM1
addi r5, r12, 0x1 #ASM Make the proper adjustment needed and hold in r5
beq- change_it #ASM If it is one of the odd ball values, branch to change_it
cmpwi r12, 0x5
addi r5, r12, 0x1
beq- change_it
cmpwi r12, 0x6
subi r5, r12, 0x2
beq- change_it
cmpwi r12, 0x7
addi r5, r12, 0x4
beq- change_it
cmpwi r12, 0x8
subi r5, r12, 0x1
beq- change_it
cmpwi r12, 0xA
addi r5, r12, 0x2
beq- change_it
cmpwi r12, 0xB
subi r5, r12, 0x1
beq- change_it
cmpwi r12, 0xC
subi r5, r12, 0x4
bne- store_it

change_it:
mr r12, r5

store_it:
stw r12, 980(r11)
blr

This works fine as it is, although I want to add it to the first C0 code and hopefully lessen the length.

Made a simple button activator. Press C + Z after selecting a player. The character name changes as the character values change (no transformation though).
Release the buttons when the one you want is displayed then move on tho the next Player/Com.

Works great until you decide to quit a match and return to the main screen. The next time you enter the character selection screen, the pointer for the MEM2 address
does not update, (MEM1 is correct). Could be the module moved (?????)

Neat challenge.
Reply


Messages In This Thread
RE: Coding Questions and other Quandaries - by Hackwiz - 05-09-2023, 01:58 PM

Forum Jump:


Users browsing this thread: 10 Guest(s)