Navigation

Stars spawned from Bosses (Work in Progress)


Koopa-the-Quick spawned star positions are stored in the checksum area as X,Y,Z 16-bit integers (check Misc Offsets).

Most other positions are floats loaded directly into registers using load immediate instructions.

You can easily get the Z and X position for any spawned star by placing a breakpoint at 0x802F2614 before defeating a boss.

This function calculates the distance between the Boss and the star coordinates and is responsible for the animation that gradually moves the star to its final position.

# Function:

802F2614: ADDIU SP, SP, 0xFFE8
802F2618: SW RA, 0x0014 (SP)
802F261C: LUI T6, 0x8036
802F2620: LW T6, 0x1160 (T6) # *T6 = Pointer for RAM object
802F2624: LWC1 F4, 0x016C (T6) # F4 = zzzzzzzz / Z star position [32-bit float]
802F2628: LWC1 F6, 0x00A8 (T6)
802F262C: LWC1 F8, 0x0164 (T6) # F8 = xxxxxxxx / X star position [32-bit float]
802F2630: LWC1 F10, 0x00A0 (T6)


King Bob-omb Star:
------------------

F4 = 0xC58CA000 (Z)   # I got these floats from the 802f2614 function
F8 = 0x44FA0000 (X)

To get the Y position, you can look at 0xA4 in the spawned star RAM object.

Now we search the checksum area disassembly to find the code that load these values:

802A7AD4: LUI AT, 0x44FA 
802A7AD8: MTC1 AT, F12  # z position. F12 = 0x44FA0000
802A7ADC: LUI AT, 0x8033
802A7AE0: LUI A2, 0xC58C
802A7AE4: ORI A2, A2, 0xA000 # x position
802A7AE8: LWC1 F14, 0x7900 (AT) # reads y position from 0x80337900
802A7AEC: JAL 0x802A5588
802A7AF0: LUI A3, 0x4348 # not sure what it does (probably not a float)
802A7AF4: LUI T7, 0x8036
802A7AF8: LW T7, 0x1160 (T7)
802A7AFC: ADDIU T6, R0, 0x0008
802A7B00: SW T6, 0x014C (T7)
802A7B04: BEQ R0, R0, 0x802A7B0C <-- Useless (possible optimization)
802A7B08: NOP

Here is a replacement code to make it easier to change the coordinates:

802A7A84: BEQ V0, R0, 0x802A7B0C # (important!)
802A7AD4: LUI AT, 0x44FA   # z
802A7AD8: ORI AT, AT, 0X0000 # z
802A7ADC: MTC1 AT, F12
802A7AE0: LUI A2, 0xC58C # x
802A7AE4: ORI A2, A2, 0XA000 # x
802A7AE8: LUI AT, 0x458C # y
802A7AEC: ORI AT, AT, 0XA000 # y
802A7AF0: MTCI AT, F14
802A7AF4: JAL 0x802A5588
802A7AF8: LUI A3, 0x4348
802A7AFC: LUI T7, 0x8036
802A7B00: LW T7, 0x1160 (T7)
802A7B04: ADDIU T6, R0, 0x0008
802A7B08: SW T6, 0x014C (T7)

You can find a a gameshark code that patches these changes and sets the star on the Floating Island here.

King Twhomp Star:
-----------------

43AA0000 // Z

43340000  // X

802C78EC: LUI AT, 0x42C8
802C78F0: MTC1 AT, F6 
802C78F4: LWC1 F4, 0x00A4 (T8)
802C78F8: ADD.S F8, F4, F6
802C78FC: SWC1 F8, 0x00A4 (T8)
# y = y + 100
802C7900: LUI AT, 0x4334 # x position
802C7904: MTC1 AT, F12
802C7908: LUI AT, 0x8033
802C790C: LWC1 F14, 0x7DD0 (AT) # ?
802C7910: JAL 0x802F2B88
802C7914: LUI A2, 0x43AA  # z position
802C7918: LUI A0, 0x5147
802C791C: JAL 0x802CA1E0
802C7920: ORI A0, A0, 0xC081

Princess Slide Star:
--------------------

Check out Collision command 0x34 disassembly.

Comments