Originally posted by Marrocio
How do i make the HUD have 2 digits like in the picture
As Jacob indicated, the assembly (and string data) determine how the HUD text is formatted. The HUD printing code for lives, stars, and coins reside in different functions:
Each of them make use of the same PrintStr (802D6554/091554) and PrintInt (802D62D8/0912D8) functions. PrintInt takes four parameters: A0=X screen, A1=Y screen, A2=pointer to format, A3=number. For example, the one for Lives looks like:
LUI $a2, 0x8034
LUI $a3, 0x8034
LH $a3, 0xB260($a3)
ADDIU $a2, $a2, 0x8388 <== this line
ADDIU $a0, $zero, 0x36
JAL PrintInt # 802D62D8
ADDIU $a1, $zero, 0xd1
or converted to C style:
PrintInt(54, 209, "%d", *0x8033b260);
The A2 format parameter accepts % style formatting, so if you want to make sure two numbers always get printed, you can use "%02d". Unfortunately, if you inserted this over the existing string, it wouldn't fit in the allocated space. However, something else has "%02d" nearby in the ROM, so you can just change the A2 pointer to use address 0x803383B4 instead of 0x80338388. To do this, at 802E3780/09E780 change the "ADDIU A2, A2, 0x8388" (24C68388) to "ADDIU A2, A2, 0x83B4" (24C683B4) indicated by "this line" above.
The same can be done with the coins and stars functions.
Originally posted by darkspire17
you can do it via gameshark or C++.
I know you're trying to be helpful, but comments like this aren't useful. Gameshark codes can clue you into how it is done, but aren't a permanent solution. And C++ has nothing to do with it.