Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The tunic/boots byte in save context is 8015E6D0 on debug.
- The value written here in hundo is 0xFC.
- That is, tunic value of 0xF (15) and tunic 0xC (12)
- Link levitates with F boots because gravity is 0.
- Links gravity is written to by func_8083D6EC
- the whole function is decomped on romans player branch:
- https://github.com/Roman971/oot/blob/player/src/overlays/actors/ovl_player_actor/z_player.c#L4772
- the important line is:
- this->actor.gravity = REG(68) / 100.0f;
- REG(68) is gGameInfo+0x9C or 80210AAC in ram
- with kokiri boots, REG(68) is 0xFF9C or -100
- -100 / 100 = gravity of -1.0
- with iron boots, REG(68) is 0xFF60 or -160
- -160 / 100 = gravity of -1.6
- hover boots is the same as kokiri
- with F boots, REG(68) is 0
- 0 / 100 = gravity of 0
- --------
- So, where does REG(68)'s value come from?
- It gets set in a function in z_player_lib: func_8008E750
- At a glance it seems like there is an array that contains various parameters related to the current boots.
- This function updated game info regs with the correct values based on "currentBoots".
- currentBoots is an instance variable at link+0x14F (802246FF)
- interesting things to note:
- currentBoots = player->currentBoots;
- if ((currentBoots == 0) && (LINK_IS_CHILD)) {
- currentBoots = 5;
- }
- If link is child and wearing kokiri boots, the index into the "boot params" array is 5 instead of 0.
- My bet is that different values are used related to links walking animation, so they didnt want to use the
- same set of parameters as adult.
- another:
- } else if (currentBoots == 1) {
- if ((s32)(player->stateFlags1 * 0x10) < 0) {
- currentBoots = 4;
- }
- If link is wearing iron boots and some state flag is set, use index 4 for boot params
- I dont know what that state flag is (it also needs to be rewritten as a bit mask..)
- My guess is a different set of params for iron boots when underwater?
- Anyway,
- This array that im calling "boot params" is at 80125B78 on mq debug.
- It is an array of s16, and has a size of 0xCC bytes.
- Each boot type has 17 params, 0x22 bytes of data per boot index.
- Given that, this array has a set of params for boot index 0 - 5.
- When we have F boots on, currentBoots is 0xE or 14.
- currentBoots is always equipped boot value - 1, because the save context variable is not 0 indexed.
- 14 is wayyyy out of bounds of this array.
- BootParams is an array of entries that are 0x22 bytes large. 0xE * 0x22 = an offset of 0x1DC
- The boot params entry for F boots starts at 80125B78+0x1DC = 80125D54.
- This means that the boot params entry for F boots starts in the data symbol D_80125D28 and bleeds into D_80125D68.
- D_80125D28 and D_80125D68 both seem to be an array of segment addresses that get indexed by age.
- A good guess is animation related or textures or something. Will look into it later when player is decomped.
- the value used for gravity is assigned as follows:
- REG(68) = params[10];
- REG(68) is assigned the short at params entry + 0x14.
- 80125D54 + 0x14 = 80125D68
- in other words, gravity gets assigned to the short at D_80125D68[0]
- below is an excerpt of the data around this region. its mostly segment addresses with some entries being NULL.
- put in brackets [] is the 0 value that gets assigned to REG(68), which gets divided by 100 and set to gravity:
- 06 02 7F 00 06 01 73 60 06 02 31 60 06 01 4D 68 06 02 7F 00 06 01 6E E8
- 06 02 0A 78 06 01 48 A8 06 02 5F B8 06 01 6A 98 06 02 11 B8 06 01 52 48
- 06 02 64 F0 06 01 73 60 [00 00] 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 06 02 26 88 00 00 00 00 06 02 26 88 06 02 49 D8 06 01 54 08
- 06 02 81 50 06 01 75 00 06 02 49 D8 06 01 50 10 06 02 81 50 06 01 71 50
- So basically, when using F boots a bunch of values in the static context are going to be assigned shorts from this array of segment addresses. Some of them are conveniently null, which allows us to have 0 gravity.
- To finish off this doc i am going to list each assignment from the boot params array for kokiri boots and F boots
- Kokiri Boots:
- REG(19) = 0x00C8
- REG(30) = 0x03E8
- REG(32) = 0x012C
- REG(34) = 0x0320
- REG(35) = 0x01F4
- REG(36) = 0x0190
- REG(37) = 0x0320
- REG(38) = 0x0190
- REG(43) = 0x0320
- REG(45) = 0x0226
- REG(68) = 0xFF9C // gravity factor -100
- REG(69) = 0x0258
- IREG(66) = 0x021C
- IREG(67) = 0x02EE
- IREG(68) = 0x007D
- IREG(69) = 0x0190
- MREG(95) = 0x00C8
- F Boots:
- REG(19) = 0x0601
- REG(30) = 0x6A98
- REG(32) = 0x0602
- REG(34) = 0x11B8
- REG(35) = 0x0601
- REG(36) = 0x5248
- REG(37) = 0x0602
- REG(38) = 0x64F0
- REG(43) = 0x0601
- REG(45) = 0x7360
- REG(68) = 0x0000 // gravity factor 0 (also the first null entry in this area lol)
- REG(69) = 0x0000
- IREG(66) = 0x0000
- IREG(67) = 0x0000
- IREG(68) = 0x0000
- IREG(69) = 0x0000
- MREG(95) = 0x0000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement