donut-decomp/asm/TRK_Hollywood_Revolution/nubevent.s

146 lines
6.3 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global TRKInitializeEventQueue
TRKInitializeEventQueue:
/* 80016160 00011FA0 3C 60 80 49 */ lis r3, gTRKEventQueue@ha
/* 80016164 00011FA4 38 A0 00 00 */ li r5, 0x0
/* 80016168 00011FA8 38 83 71 20 */ addi r4, r3, gTRKEventQueue@l
/* 8001616C 00011FAC 38 00 01 00 */ li r0, 0x100
/* 80016170 00011FB0 90 A3 71 20 */ stw r5, 0x7120(r3)
/* 80016174 00011FB4 38 60 00 00 */ li r3, 0x0
/* 80016178 00011FB8 90 A4 00 04 */ stw r5, 0x4(r4)
/* 8001617C 00011FBC 90 04 00 20 */ stw r0, 0x20(r4)
/* 80016180 00011FC0 4E 80 00 20 */ blr
.global TRKGetNextEvent
TRKGetNextEvent:
/* 80016184 00011FC4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80016188 00011FC8 7C 08 02 A6 */ mflr r0
/* 8001618C 00011FCC 38 80 00 00 */ li r4, 0x0
/* 80016190 00011FD0 90 01 00 14 */ stw r0, 0x14(r1)
/* 80016194 00011FD4 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80016198 00011FD8 93 C1 00 08 */ stw r30, 0x8(r1)
/* 8001619C 00011FDC 3F C0 80 49 */ lis r30, gTRKEventQueue@ha
/* 800161A0 00011FE0 80 1E 71 20 */ lwz r0, gTRKEventQueue@l(r30)
/* 800161A4 00011FE4 2C 00 00 00 */ cmpwi r0, 0x0
/* 800161A8 00011FE8 40 81 00 4C */ ble lbl_800161F4
/* 800161AC 00011FEC 3B FE 71 20 */ addi r31, r30, 0x7120
/* 800161B0 00011FF0 38 A0 00 0C */ li r5, 0xc
/* 800161B4 00011FF4 80 1F 00 04 */ lwz r0, 0x4(r31)
/* 800161B8 00011FF8 1C 00 00 0C */ mulli r0, r0, 0xc
/* 800161BC 00011FFC 7C 9F 02 14 */ add r4, r31, r0
/* 800161C0 00012000 38 84 00 08 */ addi r4, r4, 0x8
/* 800161C4 00012004 4B FF F4 CD */ bl TRK_memcpy
/* 800161C8 00012008 80 7F 00 04 */ lwz r3, 0x4(r31)
/* 800161CC 0001200C 80 9E 71 20 */ lwz r4, 0x7120(r30)
/* 800161D0 00012010 38 03 00 01 */ addi r0, r3, 0x1
/* 800161D4 00012014 90 1F 00 04 */ stw r0, 0x4(r31)
/* 800161D8 00012018 2C 00 00 02 */ cmpwi r0, 0x2
/* 800161DC 0001201C 38 04 FF FF */ addi r0, r4, -0x1
/* 800161E0 00012020 90 1E 71 20 */ stw r0, 0x7120(r30)
/* 800161E4 00012024 40 82 00 0C */ bne lbl_800161F0
/* 800161E8 00012028 38 00 00 00 */ li r0, 0x0
/* 800161EC 0001202C 90 1F 00 04 */ stw r0, 0x4(r31)
.global lbl_800161F0
lbl_800161F0:
/* 800161F0 00012030 38 80 00 01 */ li r4, 0x1
.global lbl_800161F4
lbl_800161F4:
/* 800161F4 00012034 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 800161F8 00012038 7C 83 23 78 */ mr r3, r4
/* 800161FC 0001203C 83 C1 00 08 */ lwz r30, 0x8(r1)
/* 80016200 00012040 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80016204 00012044 7C 08 03 A6 */ mtlr r0
/* 80016208 00012048 38 21 00 10 */ addi r1, r1, 0x10
/* 8001620C 0001204C 4E 80 00 20 */ blr
.global TRKPostEvent
TRKPostEvent:
/* 80016210 00012050 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80016214 00012054 7C 08 02 A6 */ mflr r0
/* 80016218 00012058 3C 80 80 49 */ lis r4, gTRKEventQueue@ha
/* 8001621C 0001205C 90 01 00 24 */ stw r0, 0x24(r1)
/* 80016220 00012060 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 80016224 00012064 3B E0 00 00 */ li r31, 0x0
/* 80016228 00012068 93 C1 00 18 */ stw r30, 0x18(r1)
/* 8001622C 0001206C 93 A1 00 14 */ stw r29, 0x14(r1)
/* 80016230 00012070 80 C4 71 20 */ lwz r6, gTRKEventQueue@l(r4)
/* 80016234 00012074 2C 06 00 02 */ cmpwi r6, 0x2
/* 80016238 00012078 40 82 00 18 */ bne lbl_80016250
/* 8001623C 0001207C 3C 60 80 42 */ lis r3, "@stringBase0_80421C50"@ha
/* 80016240 00012080 3B E0 01 00 */ li r31, 0x100
/* 80016244 00012084 38 63 1C 50 */ addi r3, r3, "@stringBase0_80421C50"@l
/* 80016248 00012088 48 00 77 49 */ bl OSReport
/* 8001624C 0001208C 48 00 00 70 */ b lbl_800162BC
.global lbl_80016250
lbl_80016250:
/* 80016250 00012090 3B C4 71 20 */ addi r30, r4, 0x7120
/* 80016254 00012094 7C 64 1B 78 */ mr r4, r3
/* 80016258 00012098 80 1E 00 04 */ lwz r0, 0x4(r30)
/* 8001625C 0001209C 38 A0 00 0C */ li r5, 0xc
/* 80016260 000120A0 7C 00 32 14 */ add r0, r0, r6
/* 80016264 000120A4 54 03 0F FE */ srwi r3, r0, 31
/* 80016268 000120A8 54 00 07 FE */ clrlwi r0, r0, 31
/* 8001626C 000120AC 7C 00 1A 78 */ xor r0, r0, r3
/* 80016270 000120B0 7C 03 00 50 */ subf r0, r3, r0
/* 80016274 000120B4 1F A0 00 0C */ mulli r29, r0, 0xc
/* 80016278 000120B8 7C 7E EA 14 */ add r3, r30, r29
/* 8001627C 000120BC 38 63 00 08 */ addi r3, r3, 0x8
/* 80016280 000120C0 4B FF F4 11 */ bl TRK_memcpy
/* 80016284 000120C4 7C 7E EA 14 */ add r3, r30, r29
/* 80016288 000120C8 80 1E 00 20 */ lwz r0, 0x20(r30)
/* 8001628C 000120CC 90 03 00 0C */ stw r0, 0xc(r3)
/* 80016290 000120D0 80 7E 00 20 */ lwz r3, 0x20(r30)
/* 80016294 000120D4 38 03 00 01 */ addi r0, r3, 0x1
/* 80016298 000120D8 90 1E 00 20 */ stw r0, 0x20(r30)
/* 8001629C 000120DC 28 00 01 00 */ cmplwi r0, 0x100
/* 800162A0 000120E0 40 80 00 0C */ bge lbl_800162AC
/* 800162A4 000120E4 38 00 01 00 */ li r0, 0x100
/* 800162A8 000120E8 90 1E 00 20 */ stw r0, 0x20(r30)
.global lbl_800162AC
lbl_800162AC:
/* 800162AC 000120EC 3C 80 80 49 */ lis r4, gTRKEventQueue@ha
/* 800162B0 000120F0 80 64 71 20 */ lwz r3, gTRKEventQueue@l(r4)
/* 800162B4 000120F4 38 03 00 01 */ addi r0, r3, 0x1
/* 800162B8 000120F8 90 04 71 20 */ stw r0, 0x7120(r4)
.global lbl_800162BC
lbl_800162BC:
/* 800162BC 000120FC 7F E3 FB 78 */ mr r3, r31
/* 800162C0 00012100 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 800162C4 00012104 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 800162C8 00012108 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 800162CC 0001210C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 800162D0 00012110 7C 08 03 A6 */ mtlr r0
/* 800162D4 00012114 38 21 00 20 */ addi r1, r1, 0x20
/* 800162D8 00012118 4E 80 00 20 */ blr
.global TRKConstructEvent
TRKConstructEvent:
/* 800162DC 0001211C 38 A0 00 00 */ li r5, 0x0
/* 800162E0 00012120 38 00 FF FF */ li r0, -0x1
/* 800162E4 00012124 90 83 00 00 */ stw r4, 0x0(r3)
/* 800162E8 00012128 90 A3 00 04 */ stw r5, 0x4(r3)
/* 800162EC 0001212C 90 03 00 08 */ stw r0, 0x8(r3)
/* 800162F0 00012130 4E 80 00 20 */ blr
.global TRKDestructEvent
TRKDestructEvent:
/* 800162F4 00012134 80 63 00 08 */ lwz r3, 0x8(r3)
/* 800162F8 00012138 48 00 0D 50 */ b TRK_ReleaseBuffer
.include "macros.inc"
.section .data, "wa" # 0x80421040 - 0x80496700 ; 0x000756C0
.global "@stringBase0_80421C50"
"@stringBase0_80421C50":
.4byte 0x4D657472
.4byte 0x6F54524B
.4byte 0x202D2045
.4byte 0x76656E74
.4byte 0x20517565
.4byte 0x75652066
.4byte 0x756C6C0A
.4byte 0
.include "macros.inc"
.section .bss, "", @nobits # 0x80496700 - 0x80556420 ; 0x000BFD20
.global gTRKEventQueue
gTRKEventQueue:
.skip 0x28