Navigation

Behavior 0x3C7C: Produces a sound when near it (Castle Grounds)


Used in the Castle Grounds: As me-me pointed out, it produces bird-related background sounds:

802F0898: ADDIU SP, SP, 0xFFD8
802F089C: SW RA, 0x001C (SP)
802F08A0: SW S0, 0x0018 (SP)
802F08A4: LUI T6, 0x8034
802F08A8: LW T6, 0xCBD0 (T6)
802F08AC: ADDIU AT, R0, 0x0003
802F08B0: LBU T7, 0x0000 (T6)
802F08B4: BNE T7, AT, 0x802F08C4  ; if (0x8034CBD0 == 3) skip entire function.
802F08B8: NOP
802F08BC: BEQ R0, R0, 0x802F093C
802F08C0: NOP

802F08C4: LUI T8, 0x8036
802F08C8: LW T8, 0x1160 (T8)      ; T8 = Ram Pointer
802F08CC: LW S0, 0x0144 (T8)      ; 0x144 = argument from 0x24 level command (Param 2)

802F08D0: BEQ S0, R0, 0x802F08F8  ; if (Param2 == 0)
802F08D4: NOP

802F08D8: ADDIU AT, R0, 0x0001    ; if (Param2 == 1)
802F08DC: BEQ S0, AT, 0x802F090C
802F08E0: NOP

802F08E4: ADDIU AT, R0, 0x0002    ; if (Param2 == 2)
802F08E8: BEQ S0, AT, 0x802F0920
802F08EC: NOP

802F08F0: BEQ R0, R0, 0x802F0934
802F08F4: NOP

(if Arg = 0)
802F08F8: LUI A0, 0x9052          ; Sound
802F08FC: JAL 0x802CA190          ; PlaySound function
802F0900: ORI A0, A0, 0x4001      ; Not sure what this arg means.
802F0904: BEQ R0, R0, 0x802F0934  ; break;
802F0908: NOP

(if Arg = 1)
802F090C: LUI A0, 0x8050
802F0910: JAL 0x802CA190                    ; PlaySound function
802F0914: ORI A0, A0, 0x4001
802F0918: BEQ R0, R0, 0x802F0934
802F091C: NOP

(if Arg = 2)
802F0920: LUI A0, 0x5051
802F0924: JAL 0x802CA190          ; PlaySound function
802F0928: ORI A0, A0, 0x4001
802F092C: BEQ R0, R0, 0x802F0934
802F0930: NOP

802F0934: BEQ R0, R0, 0x802F093C
802F0938: NOP
802F093C: LW RA, 0x001C (SP)
802F0940: LW S0, 0x0018 (SP)
802F0944: ADDIU SP, SP, 0x0028
802F0948: JR RA
802F094C: NOP

Comments