Jump to content

OoT / MM Interface Documentation


SanguinettiMods
 Share

Recommended Posts

Some of these things have been written down in the form of gameshark codes, but didn't always work correctly. I re documented some things in the form of ASM Blocks.
 
OoT - Incomplete, won't be for a while.
 

 

A Button
-------
80110F04 ADDIU A0, R0, 0x00BA ; A Button / A Button Text X Coordinate
80110F30 SH A0, 0x0AB6(T4)
80110F38 SH, A0, 0x0ABC(T5)

801116FC ADDIU T7, R0, 0x0009 ; A Button / A Button Text Y Coordinate
80111714 SH T7, 0x0AB4(T8)
80111728 SH T7, 0x0ABA(T8)

80111708 ADDIU, T9, R0, 0xFE84 ; A Button Scale
8011171C SH T9, 0xAB8(T6)

80111724 ADDIU T9, R0, 0x0030 ; A Button Text X Scale
80111730 SH T9, 0x0ABE(T6)

801110B4 ADDIU A1, R0, 0x0010 ; A Button Text Y Scale
80111754 SH A1, 0x0ACC(T6)

80110F08 ADDIU T7, R0, 0x00C8 ; A Button Green Value
80110F1C ADDIU T9, R0, 0x0032 ; A Button Blue Value
80110F40 SH R0, 0x0AC0(T6) ; Store A Button Red Value as 0x00000000
80110F48 SH T7, 0x0AC2(T8) ; Store A Button Green Value as 0x000000C8
80110F50 SH T9, 0x0AC4(T1) ; Store A Button Blue Value as 0x00000032
-------

B Button
-------
80110EE4 ADDIU V0, R0, 0x00A0 ; B Button / B Button Icon X Coordinate
80110EEC SH V0, 0x0820(T5)
80110F20 SH V0, 0x0838(T1)

80111584 ADDIU T6, R0, 0x0011 ; B Button Y Coordinate
80111594 SH T6, 0x0828(T7)

801115FC ADDIU T6, R0, 0x0011 ; B Button Icon Y Coordinate
8011160C SH T6, 0x840(T7)

801115A4 ADDIU T8, R0, 0x023F ; B Button Scale
801115BC SH T8, 0x0830(T9)

80110EE8 ADDIU T6, R0, 0x00FF ; B Button Red Value
80110EF4 ADDIU V1, R0, 0x001E ; B Button Green Value / B Button Blue Value
80110EFC SH T6, 0x07EA(T7) ; Store B button Red Value as 0x000000FF
80110F0C SH V1, 0x07EC (T8) ; Store B Button Green Value as 0x0000001E
80110F14 SH V1, 0x07EE (T9) ; Store B Button Blue Value as 0x0000001E

80110EF8 ADDIU T2, R0, 0x00A2 ; B Button Ammo X Coordinate
80110F28 SH T2, 0x0F94(T3)

80111DF8 ADDIU A0, R0, 0x0023 ; B Button Ammo Y Coordinate
80111FB0 A0, 0x0F9C(T7)

; B Button Text X Coordinate
; B Button Text Y Coordinate
; B Button Text X Scale
; B Button Text Y Scale

-------

C Buttons
--------
801110E8 ADDIU T5, R0, 0x00FF ; C Button Red Value
80111494 ADDIU T8, R0, 0x00A0 ; C Button Green Value
801114A8 SH T5, 0x07E2(T7) ; Store C Button Red Value as 0x000000FF
801114B0 SH T8, 0x07E4(T9) ; Store C Button Green Value as 0x000000A0
801114B8 SH R0, 0x07E6(T6) ; Store C Button Blue Value as 0x00000000

80111F6C ADDIU T6, R0, 0x00E4 ; C-Left Ammo X Coordinate
80111F8C SH T6, 0x0F96(T7)
--------

Magic Meter
----------

; Fill X Coordinate
; Fill Y Coordinate
; Fill Y Coordinate (Two rows of Hearts)
8011181C ADDIU T6, R0, 0x001A ; Border X Coordinate
; Border Y Coordinate
; Border Y Coordinate (Two rows of Hearts)

----------


Rupee Counter
------------
8008AFC4 ADDIU T5, R0, 0x00CE ; Rupee Amount Y Coordinate
8008AFE0 SW T5, 0x0014(SP)

8008ADDC ADDIU S2, T0, 0x002A ; Rupee Amount X Coordinate
8008AFEC SW S2, 0x0010(SP)

8008AB50 ADDIU T7, R0, 0x00CE ; Rupee Y Coordinate
8008AB64 SW T7, 0x0014(SP)

8008AB54 ADDIU T6, R0, 0x001A ; Rupee X Coordinate
8008AB60 SW T6, 0x0010(SP)

8008AAF8 LUI AT, 0xC8FF
8008AB0C ORI AT, AT, 0x6400 ; Rupee Color
8008AB14 ANDI T9, T8, 0x00FF
8008AB18 OR T2, T9, AT
8008AB1C SW T2, 0x0004 (A3)
------------

Key Counter
----------
8008AD8C ADDIU T3, R0, 0x00BE ; Key Amount Y Coordinate
8008ADB0 SW T3, 0x0014(SP)

8008AD34 ADDIU S2, R0, 0x002A ; Key Amount X Coordinate


8008AC14 ADDIU T4, R0, 0x00BE ; Key Y Coordinate
8008AC60 SW T4, 0x0014(SP)

8008AC18 ADDIU T3, R0, 0x001A ; Key X Coordinate
8008AC64 SW T3, 0x0010(SP)

8008ABBC LUI AT, 0xC8E6
8008ABCC ORI AT, AT, 0xFF00 ; Key Color
8008AC1C ANDI T6, T5, 0x00FF
8008AC20 OR T7, T6, AT
8008AC24 SW T7, 0x0004(A3)
----------

Hearts
------
V0 = 80222510
80078BA0 ADDIU T4, V1, 0x00FF ; Beating Normal Heart Red Value
80078BC8 ADDIU T7, A0, 0x0046 ; Beating Normal Heart Green Value
80078BE0 ADDIU T3, A1, 0x0032 ; Beating Normal Heart Blue Value
80078BA4 ANDI T5, T4, 0x00FF
80078BA8 SH T5, 0x0202(V0) ; Store [BN Heart] Red Value as 0x000000FF
80078BCC ANDI T8, T7, 0x00FF
80078BD4 SH T8, 0x0204(V0) ; Store [BN Heart] Green Value as 0x00000046
80078BE4 ANDI T4, T3, 0x00FF
80078BE8 SH T4, 0x0206(V0) ; Store [BN Heart] Blue Value as 0x0000003C
-
80078C3C ADDIU T5, V1, 0x0032 ; Beating Normal Heart Outline Red Value
80078C68 ADDIU T8, A0, 0x0028 ; Beating Normal Heart Outline Green Value
80078C84 ADDIU T4, A1, 0x003C ; Beating Normal Heart Outline Blue Value
80078C40 ANDI T6, T5, 0x00FF
80078C44 SH T6, 0x0208(V0) ; Store [BN Heart Outline] Red Value as 0x00000032
80078C6C ANDI T9, T8, 0x00FF
80078C74 SH T9, 0x020A(V0) ; Store [BN Heart Outline] Green Value as 0x00000028
80078C88 ANDI T5, T4, 0x00FF
80078C8C SH T5, 0x020C(V0) ; Store [BN Heart Outline] Blue Value as 0x0000003C
-
80078A64 ADDIU A0, R0, 0x0032 ; Normal Heart Blue Value / Normal Heart Outline Red Value
80078A68 ADDIU A2, R0, 0x00FF ; Normal Heart Red Value
80078A8C ADDIU T9, R0, 0x0046 ; Normal Heart Green Value
80078ABC ADDIU T9, R0, 0x0046 ; Normal Heart Green Value
80078AC8 ADDIU T9, R0, 0x0046 ; Normal Heart Green Value
80078ACC ADDIU T3, R0, 0x0028 ; Normal Heart Outline Green Value
80078AD0 ADDIU T4, R0, 0x003C ; Normal Heart Outline Blue Value
-
80078AD4 SH A2, 0x020E(V0) ; Store Normal Heart Red Value as 0x000000FF
80078AD8 SH T9, 0x0212(V0) ; Store Normal Heart Green Value as 0x00000046
80078ADC SH A0, 0x0216(V0) ; Store Normal Heart Blue Value as 0x00000032
80078AE0 SH A0, 0x021A(V0) ; Store Normal Heart Outline Red Value as 0x00000032
80078AE4 SH T3, 0x021E(V0) ; Store Normal Heart Outline Green Value as 0x00000028
80078AE8 SH T4, 0x0222(V0) ; Store Normal Heart Outline Blue Value as 0x0000003C

T2 = 8015FDC8
80078DCC ADDIU T7, V1, 0x00C8 ; Beating Double Defense Red Value
80078DD0 ANDI T8, T7, 0x00FF
80078DD4 SH T8, 0x0000(T2) ; Store [BDD Heart] Red Value as 0x000000C8
80078DF4 ANDI T3, T9, 0x00FF
80078DF8 SH T3, 0x0002(T2) ; Store [BDD Heart] Green Value as 0x00000000
80078E0C ANDI T5, T4, 0x00FF
80078E14 SH T5, 0x0004(T2) ; Store [BDD Heart] Blue Value as 0x00000000

T1 = 8015FDC0
80078D30 ADDIU T6, V1, 0x00FF ; Beating Double Defense Outline Red Value
80078D70 ADDIU T9, A0, 0x00FF ; Beating Double Defense Outline Green Value
80078D74 ADDIU T5, A1, 0x00FF ; Beating Double Defense Outline Blue Value
80078D3C ANDI T7, T6, 0x00FF
80078D44 SH T7, 0x0000(T1) ; Store [BDD Heart Outline] Red Value as 0x000000FF
80078D78 ANDI T3, T9, 0x00FF
80078D80 SH T3, 0x0002(T1) ; Store [BDD Heart Outline] Green Value as 0x000000FF
80078D7C ANDI T6, T5, 0x00FF
80078D84 SH T6, 0x0004(T1) ; Store [BDD Heart Outline] Blue Value as 0x000000FF

T0 = 8015FDE0
80078C50 ADDIU T6, R0, 0x00C8 ; Normal Double Defense Red Value
80078C90 SH T6, 0x0000(T0) ; Store [NDD Heart] Red Value as 0x000000C8
80078CA0 SH R0, 0x0002(T0) ; Store [NDD Heart] Green Value as 0x00000000
80078CA4 SH R0, 0x0004(T0) ; Store [NDD Heart] Blue Value as 0x00000000

A3 = 8015FDD0
80078C94 SH A2, 0x0000(A3) ; Store [NDD Heart Outline] Red Value as 0x000000FF
80078C98 SH A2, 0x0002(A3) ; Store [NDD Heart Outline] Red Value as 0x000000FF
80078C9C SH A2, 0x0004(A3) ; Store [NDD Heart Outline] Red Value as 0x000000FF

 


 
Why is this useful? For the longest time, I couldn't find some attributes like the small key counter by sifting through RAM dumps. I also couldn't color the hearts outline independently from the hearts themselves, but with this small hack I made, you can.
 
 

.ORG 0x80078A64
J 0x801A0000
NOP
 
.ORG 0x80078BA8
ADDIU R0, R0, 0x0000
 
.ORG 0x80078BD4
ADDIU R0, R0, 0x0000
 
.ORG 0x80078BE8
ADDIU R0, R0, 0x0000
 
.ORG 0x80078C44
ADDIU R0, R0, 0x0000
 
.ORG 0x80078C74
ADDIU R0, R0, 0x0000
 
.ORG 0x80078C8C
ADDIU R0, R0, 0x0000
 
.ORG 0x80078AD4
ADDIU R0, R0, 0x0000
ADDIU R0, R0, 0x0000
ADDIU R0, R0, 0x0000
ADDIU R0, R0, 0x0000
ADDIU R0, R0, 0x0000
ADDIU R0, R0, 0x0000
 
.ORG 0x801A0000
LUI A0, 0x8022
ADDIU A0, A0, 0x2510
ADDIU T0, R0, 0x00FF ; Beating Heart Red Value
ANDI T1, T0, 0x00FF
SH T1, 0x0202(A0) ; Store Beating Heart Red Value
ADDIU T0, R0, 0x0046 ; Beating Heart Green Value
ANDI T1, T0, 0x00FF
SH T1, 0x0204(A0) ; Store Beating Heart Green Value
ADDIU T0, R0, 0x0032 ; Beating Heart Blue Value
ANDI T1, T0, 0x00FF
SH T1, 0x0206(A0) ; Store Beating Heart Blue Value
ADDIU T0, R0, 0x0032 ; Beating Heart Outline Red Value
ANDI T1, T0, 0x00FF
SH T1, 0x0208(A0) ; Store Beating Heart Outline Red Value
ADDIU T0, R0, 0x0028 ; Beating Heart Outline Green Value
ANDI T1, T0, 0x00FF
SH T1, 0x020A(A0) ; Store Beating Heart Outline Green Value
ADDIU T0, R0, 0x003C ; Beating Heart Outline Blue Value
ANDI T1, T0, 0x00FF
SH T1, 0x020C(A0) ; Store Beating Heart Outline Blue Value
ADDIU T0, R0, 0x00FF ; Heart Red Value
SH T0, 0x020E(A0) ; Store Heart Red Value
ADDIU T2, R0, 0x0046 ; Heart Green Value
SH T2, 0x0212(A0) ; Store Heart Green Value
ADDIU T0, R0, 0x0032 ; Heart Blue Value
SH T0, 0x0216(A0) ; Store Heart Blue Value
ADDIU T0, R0, 0x0032 ; Heart Outline Red Value
SH T0, 0x021A(A0) ; Store Heart Outline Red Value
ADDIU T0, R0, 0x0028 ; Heart Outline Green Value
SH T0, 0x021E(A0) ; Store Heart Outline Green Value
ADDIU T0, R0, 0x003C ; Heart Outline Blue Value
SH T0, 0x0222(A0) ; Store Heart Outline Blue Value
NOP
 
J 0x80078A68
NOP

MM - Incomplete, won't be for a while

 

A Button
--------
80118DE0 LUI AT, 0x64C8 ; A Button Red / Green Value
80118DF4 ORI AT, AT, 0xFF00 ; A Button Blue Value
--------

B Button
--------
801171A8 ADDIU T7, R0, 0x0064 ; B Button Red Value
801171AC ADDIU T6, R0, 0x00FF ; B Button Green Value
801171A0 ADDIU T8, R0, 0x0078 ; B Button Blue Value
801171B4 SW T7, 0x0028(SP)
801171B0 SW T6, 0x002C(SP)
801171B8 SW T8, 0x0030(SP)
--------

C Button
--------
C-Left
------
8011722C ADDIU, T6, R0, 0x00FF ; C-Left Red Value
80117230 ADDIU T8, R0, 0x00F0 ; C-Left Green Value
80117238 SW T6, 0x001C(SP)
80117234 SW T8, 0x0020(SP)
80117244 SW R0, 0x0024(SP)
------

C-Down
-------
80117284 ADDIU T7, R0, 0x00FF ; C-Down Red Value
80117288 ADDIU T6, R0, 0x00F0 ; C-Down Green Value
80117290 SW T7, 0x001C(SP)
8011728C SW T6, 0x0020(SP)
8011729C SW R0, 0x0024(SP)
-------

C-Right
-------
801172E4 ADDIU T9, R0, 0x00FF ; C-Right Red Value
801172E8 ADDIU T7, R0, 0x00F0 ; C-Right Green Value
801172F0 SW T9, 0x001C(SP)
801172EC SW T7, 0x0020(SP)
801172FC SW R0, 0x0024(SP)
-------

  • Like 3
Link to comment
Share on other sites

Since I wrote this just the other day, I may just as well contribute with it:

http://pastebin.com/qGDVSxda

That is a very, very small ASM hack that allows you to set the red green and blue of all the interface buttons individually.

 

Also, here's the RAM addresses for the Start Button Colors:

S Button Red & Green: 0x80089180

S Button Blue: 0x80089184

It doesn't use the same format as the other buttons. each color is a byte rather than a halfword.

 

I think all other things I have are there already? My documentation is such a big mess, I can't even find things myself. (it's a 900 rows text document filled with random stuff for the title screen, file select, pause menues and interface... Unorganized, etc.)

 

Edit:

A bunch of things for MM NSTC-U 1.0

80117390 Start Button Green

80117394 Start Button Blue

8011739C Start Button Red

Clock stuff:

80119914 Hour Lines Red & Green

80119918 Hour Lines Blue

801199D8 Halfcircle Blue

8011A110 Diamond Red & Green

8011A114 Diamond Blue

8011A1A4 Day Number Blue

8011A39C Star Red & Green

8011A3A0 Star Blue

8011A738 Sun Red & Green

8011A73C Sun Blue

8011A888 Moon Red & Green

8011A88C Moon Blue

8011AB84 Sun Text Blue

8011AD20 Moon Text Blue

 

I haven't doublechecked if these things actually are 100% correct, but it's what I have in my document.

That's about everything I have on MM (that isn't already in the main post) since I lost all my documentation last year when my computer had a rollback after it crashed.

  • Like 1
Link to comment
Share on other sites

I will locate all addresses of OoT Interface in ROM.

Thanks Sanguinetti & CloudMax for sharing this!.

That's some very simple math.

Take the addresses and subtract by 0x0001CE60. That gives you their offset in the code.zasm file.

If you want the offset withen the whole ROM directly, just add 0xA771A0.

Link to comment
Share on other sites

Yeah. First I looked up which file the code was located in. (took a small sample surrounding one of the addresses mentioned in the thread, searched for that in the ROM, checked which file that address belonged too)

It were located in the code.zasm, so we know that all the addresses are in there.

Then I just looked up where the code.zasm started in the RAM by taking a sample of the beginning of the code.zasm file and searching for it in the RAM, and it was at 0x0001CE60. So I know that by subtracting that value, we'll convert the addresses to their addresses relative to the code.zasm file.

Then I looked up where the code.zasm is located in the ROM, which is 0x00A94000.

And 0x00A94000-0x0001CE60=0x00A771A0

 

This is how I convert big bunches of RAM addresses to ROM addresses. A lot more useful than looking up all of them manually.

  • Like 2
Link to comment
Share on other sites

I'm working on the code.zasm file right now and so far have the A and B buttons done. I can release for download if anyone is interested once I'm completed.

 

@CloudMax: Are you sure the B button is completely correct? It seems a bit brighter green than it is in MM which is a duller green. Also, the start menu button color has not changed, it's still grayish black, not red. There were no changes in the coding for it.

 

Edit: I have finished the code.zasm and while it works on my actual hack in progress, applying it to a clean debug ROM makes it fail to boot so I'm not quite sure why it is doing this at the moment. CRC is okay so I'm going to look into why it is doing this. If anyone else has any ideas, that would be great to hear.

Edited by !Tommy
Link to comment
Share on other sites

Ops. The Start Button is still gray because the pastebin I linked to set it to the default color (gray).

the color should be FF823C not 787878 for it to be the MM color.

 

And I'm not sure why it doesn't work for you with a clean ROM, I'll test it myself and see what happens.

 

Edit:

I tried it myself, and it works just fine.

Edited by CloudMax
Link to comment
Share on other sites

Ops. The Start Button is still gray because the pastebin I linked to set it to the default color (gray).

the color should be FF823C not 787878 for it to be the MM color.

 

And I'm not sure why it doesn't work for you with a clean ROM, I'll test it myself and see what happens.

 

Edit:

I tried it myself, and it works just fine.

I'm guessing because I extracted the entire code.zasm file from another debug ROM and plugged it into a clean one. Maybe it's not so much the button colors that changed but maybe I have another code change in my hack that the clean ROM isn't liking much. I can always upload the file and you can take a look at it if you so desire.

 

Here's the file, complete with all MM HUD style and colors: http://wikisend.com/download/127854/code.zasm

 

If anyone wants to try it out, feel free to but be warned that it might cause your game not to load properly.

Edited by !Tommy
Link to comment
Share on other sites

I hope you're aware that the code.zasm file you linked is not actually a code.zasm file. I opened it in a hex viewer and this is the first thing I see "%PDF-1.4.%âãÃÓ.3 0 obj.<</Subtype/Link/Rect[247.18 662.52 345.26 673.62]/A<</S/URI/URI(http://BitManual.com)>>/Border[0 0 0]/C[0 0 1]>>.endobj.4 0 obj.<</Subtype/Link/Rect[294.68 194.52 426.02 205.62]/A<</S/URI/URI(http://BitManual.com)>>/Border[0 0 0]/C[0 0 1]>>.endobj.5 0 obj.<</Length 1960/Filter/FlateDecode>>stream"

Could it be that you messed up and renamed some file to code.zasm? Because I am very confused right now, lol.

Link to comment
Share on other sites

  • 8 months later...

I know this has been a long time, but I am having a really hard time finding the A and B buttons ROM addresses for colour. I've done what was said above and once I modified the values and nothing happened, the second time on a copy of the same clean rom crashed the game. I'm thinking I obviously had the wrong addresses. 

Link to comment
Share on other sites

I thought they were textures and not controlled by the ROM but it appears I am wrong according to the Wiki:

 

http://wiki.spinout182.com/w/Interface_Hacking

 

I think these are gameshark codes so some adjusting may be in order. I am assuming the three values are RGB

Button Colours/Hue

Details         Code        Default Value
A-Button

            801C7951 00??    005A
            801C7953 00??    005A
            801C7955 00??    00FF

B-Button

            801C767B 00??    0000
            801C767D 00??    0096
            801C767F 00??    0000


C-Buttons

            801C7673 00??    00FF
            801C7675 00??    00A0
            801C7677 00??    0000

Map

            801C7DC9 00??    0000
            801C7DCB 00??    00FF
            801C7DCD 00??    00FF

Link to comment
Share on other sites

http://cloudmodding.com/applications/z64editor/resources/data/documentation.txt old documentation of mine from when I worked on the z64editor. (which originally was developed for MM, but then moved over to OoT debug ROM because people didn't give a shit about MM :P)

Go down to the "MAJORA'S MASK NTSC-U" section. everything below that is for majora's mask. it contains a whole lot of information about the MM interface, some of which may not be documented elsewhere.

It's all RAM though, but it should be easy to convert.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.