donut-decomp/asm/bte/ptim.s
2022-10-17 09:41:13 +01:00

145 lines
6.6 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global ptim_init
ptim_init:
/* 800784A0 000742E0 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 800784A4 000742E4 7C 08 02 A6 */ mflr r0
/* 800784A8 000742E8 90 01 00 24 */ stw r0, 0x24(r1)
/* 800784AC 000742EC 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 800784B0 000742F0 7C BF 2B 78 */ mr r31, r5
/* 800784B4 000742F4 93 C1 00 18 */ stw r30, 0x18(r1)
/* 800784B8 000742F8 7C 9E 23 78 */ mr r30, r4
/* 800784BC 000742FC 93 A1 00 14 */ stw r29, 0x14(r1)
/* 800784C0 00074300 7C 7D 1B 78 */ mr r29, r3
/* 800784C4 00074304 4B FF DA 2D */ bl GKI_init_timer_list
/* 800784C8 00074308 93 DD 00 0C */ stw r30, 0xc(r29)
/* 800784CC 0007430C 9B FD 00 10 */ stb r31, 0x10(r29)
/* 800784D0 00074310 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 800784D4 00074314 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 800784D8 00074318 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 800784DC 0007431C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 800784E0 00074320 7C 08 03 A6 */ mtlr r0
/* 800784E4 00074324 38 21 00 20 */ addi r1, r1, 0x20
/* 800784E8 00074328 4E 80 00 20 */ blr
.global ptim_timer_update
ptim_timer_update:
/* 800784EC 0007432C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 800784F0 00074330 7C 08 02 A6 */ mflr r0
/* 800784F4 00074334 90 01 00 14 */ stw r0, 0x14(r1)
/* 800784F8 00074338 93 E1 00 0C */ stw r31, 0xc(r1)
/* 800784FC 0007433C 93 C1 00 08 */ stw r30, 0x8(r1)
/* 80078500 00074340 7C 7E 1B 78 */ mr r30, r3
/* 80078504 00074344 80 83 00 0C */ lwz r4, 0xc(r3)
/* 80078508 00074348 4B FF DA 09 */ bl GKI_update_timer_list
/* 8007850C 0007434C 48 00 00 54 */ b lbl_80078560
.global lbl_80078510
lbl_80078510:
/* 80078510 00074350 7F C3 F3 78 */ mr r3, r30
/* 80078514 00074354 7F E4 FB 78 */ mr r4, r31
/* 80078518 00074358 4B FF DB 79 */ bl GKI_remove_from_timer_list
/* 8007851C 0007435C 81 9F 00 08 */ lwz r12, 0x8(r31)
/* 80078520 00074360 2C 0C 00 00 */ cmpwi r12, 0x0
/* 80078524 00074364 41 82 00 14 */ beq lbl_80078538
/* 80078528 00074368 7F E3 FB 78 */ mr r3, r31
/* 8007852C 0007436C 7D 89 03 A6 */ mtctr r12
/* 80078530 00074370 4E 80 04 21 */ bctrl
/* 80078534 00074374 48 00 00 2C */ b lbl_80078560
.global lbl_80078538
lbl_80078538:
/* 80078538 00074378 A0 1F 00 14 */ lhz r0, 0x14(r31)
/* 8007853C 0007437C 2C 00 00 00 */ cmpwi r0, 0x0
/* 80078540 00074380 41 82 00 20 */ beq lbl_80078560
/* 80078544 00074384 38 60 00 08 */ li r3, 0x8
/* 80078548 00074388 4B FF C7 39 */ bl GKI_getbuf
/* 8007854C 0007438C 2C 03 00 00 */ cmpwi r3, 0x0
/* 80078550 00074390 41 82 00 10 */ beq lbl_80078560
/* 80078554 00074394 A0 1F 00 14 */ lhz r0, 0x14(r31)
/* 80078558 00074398 B0 03 00 00 */ sth r0, 0x0(r3)
/* 8007855C 0007439C 4B FF FE 85 */ bl bta_sys_sendmsg
.global lbl_80078560
lbl_80078560:
/* 80078560 000743A0 83 FE 00 00 */ lwz r31, 0x0(r30)
/* 80078564 000743A4 2C 1F 00 00 */ cmpwi r31, 0x0
/* 80078568 000743A8 41 82 00 10 */ beq lbl_80078578
/* 8007856C 000743AC 80 1F 00 0C */ lwz r0, 0xc(r31)
/* 80078570 000743B0 2C 00 00 00 */ cmpwi r0, 0x0
/* 80078574 000743B4 40 81 FF 9C */ ble lbl_80078510
.global lbl_80078578
lbl_80078578:
/* 80078578 000743B8 2C 1F 00 00 */ cmpwi r31, 0x0
/* 8007857C 000743BC 40 82 00 0C */ bne lbl_80078588
/* 80078580 000743C0 88 7E 00 10 */ lbz r3, 0x10(r30)
/* 80078584 000743C4 4B FF D8 DD */ bl GKI_stop_timer
.global lbl_80078588
lbl_80078588:
/* 80078588 000743C8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8007858C 000743CC 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80078590 000743D0 83 C1 00 08 */ lwz r30, 0x8(r1)
/* 80078594 000743D4 7C 08 03 A6 */ mtlr r0
/* 80078598 000743D8 38 21 00 10 */ addi r1, r1, 0x10
/* 8007859C 000743DC 4E 80 00 20 */ blr
.global ptim_start_timer
ptim_start_timer:
/* 800785A0 000743E0 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 800785A4 000743E4 7C 08 02 A6 */ mflr r0
/* 800785A8 000743E8 90 01 00 24 */ stw r0, 0x24(r1)
/* 800785AC 000743EC 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 800785B0 000743F0 7C DF 33 78 */ mr r31, r6
/* 800785B4 000743F4 93 C1 00 18 */ stw r30, 0x18(r1)
/* 800785B8 000743F8 7C BE 2B 78 */ mr r30, r5
/* 800785BC 000743FC 93 A1 00 14 */ stw r29, 0x14(r1)
/* 800785C0 00074400 7C 9D 23 78 */ mr r29, r4
/* 800785C4 00074404 93 81 00 10 */ stw r28, 0x10(r1)
/* 800785C8 00074408 7C 7C 1B 78 */ mr r28, r3
/* 800785CC 0007440C 80 03 00 00 */ lwz r0, 0x0(r3)
/* 800785D0 00074410 2C 00 00 00 */ cmpwi r0, 0x0
/* 800785D4 00074414 40 82 00 2C */ bne lbl_80078600
/* 800785D8 00074418 3C 80 66 66 */ lis r4, 0x6666
/* 800785DC 0007441C 80 1C 00 0C */ lwz r0, 0xc(r28)
/* 800785E0 00074420 38 84 66 67 */ addi r4, r4, 0x6667
/* 800785E4 00074424 88 63 00 10 */ lbz r3, 0x10(r3)
/* 800785E8 00074428 7C 04 00 96 */ mulhw r0, r4, r0
/* 800785EC 0007442C 38 A0 00 01 */ li r5, 0x1
/* 800785F0 00074430 7C 00 16 70 */ srawi r0, r0, 2
/* 800785F4 00074434 54 04 0F FE */ srwi r4, r0, 31
/* 800785F8 00074438 7C 80 22 14 */ add r4, r0, r4
/* 800785FC 0007443C 4B FF D7 15 */ bl GKI_start_timer
.global lbl_80078600
lbl_80078600:
/* 80078600 00074440 7F 83 E3 78 */ mr r3, r28
/* 80078604 00074444 7F A4 EB 78 */ mr r4, r29
/* 80078608 00074448 4B FF DA 89 */ bl GKI_remove_from_timer_list
/* 8007860C 0007444C B3 DD 00 14 */ sth r30, 0x14(r29)
/* 80078610 00074450 7F 83 E3 78 */ mr r3, r28
/* 80078614 00074454 7F A4 EB 78 */ mr r4, r29
/* 80078618 00074458 93 FD 00 0C */ stw r31, 0xc(r29)
/* 8007861C 0007445C 4B FF D9 85 */ bl GKI_add_to_timer_list
/* 80078620 00074460 80 01 00 24 */ lwz r0, 0x24(r1)
/* 80078624 00074464 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 80078628 00074468 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8007862C 0007446C 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 80078630 00074470 83 81 00 10 */ lwz r28, 0x10(r1)
/* 80078634 00074474 7C 08 03 A6 */ mtlr r0
/* 80078638 00074478 38 21 00 20 */ addi r1, r1, 0x20
/* 8007863C 0007447C 4E 80 00 20 */ blr
.global ptim_stop_timer
ptim_stop_timer:
/* 80078640 00074480 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80078644 00074484 7C 08 02 A6 */ mflr r0
/* 80078648 00074488 90 01 00 14 */ stw r0, 0x14(r1)
/* 8007864C 0007448C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80078650 00074490 7C 7F 1B 78 */ mr r31, r3
/* 80078654 00074494 4B FF DA 3D */ bl GKI_remove_from_timer_list
/* 80078658 00074498 80 1F 00 00 */ lwz r0, 0x0(r31)
/* 8007865C 0007449C 2C 00 00 00 */ cmpwi r0, 0x0
/* 80078660 000744A0 40 82 00 0C */ bne lbl_8007866C
/* 80078664 000744A4 88 7F 00 10 */ lbz r3, 0x10(r31)
/* 80078668 000744A8 4B FF D7 F9 */ bl GKI_stop_timer
.global lbl_8007866C
lbl_8007866C:
/* 8007866C 000744AC 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80078670 000744B0 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80078674 000744B4 7C 08 03 A6 */ mtlr r0
/* 80078678 000744B8 38 21 00 10 */ addi r1, r1, 0x10
/* 8007867C 000744BC 4E 80 00 20 */ blr