.include "macros.inc" .section .text, "ax" .global AllocFromArena__10COsContextFUi AllocFromArena__10COsContextFUi: /* 802D63E0 002D3340 94 21 FF F0 */ stwu r1, -0x10(r1) /* 802D63E4 002D3344 7C 08 02 A6 */ mflr r0 /* 802D63E8 002D3348 90 01 00 14 */ stw r0, 0x14(r1) /* 802D63EC 002D334C 93 E1 00 0C */ stw r31, 0xc(r1) /* 802D63F0 002D3350 93 C1 00 08 */ stw r30, 8(r1) /* 802D63F4 002D3354 7C 7E 1B 78 */ mr r30, r3 /* 802D63F8 002D3358 7C 83 23 78 */ mr r3, r4 /* 802D63FC 002D335C 38 80 00 20 */ li r4, 0x20 /* 802D6400 002D3360 48 0A 83 B1 */ bl OSAllocFromArenaLo /* 802D6404 002D3364 7C 7F 1B 78 */ mr r31, r3 /* 802D6408 002D3368 48 0A 83 91 */ bl OSGetArenaLo /* 802D640C 002D336C 90 7E 00 20 */ stw r3, 0x20(r30) /* 802D6410 002D3370 48 0A 83 89 */ bl OSGetArenaLo /* 802D6414 002D3374 90 7E 00 18 */ stw r3, 0x18(r30) /* 802D6418 002D3378 48 0A 83 79 */ bl OSGetArenaHi /* 802D641C 002D337C 90 7E 00 1C */ stw r3, 0x1c(r30) /* 802D6420 002D3380 7F E3 FB 78 */ mr r3, r31 /* 802D6424 002D3384 80 01 00 14 */ lwz r0, 0x14(r1) /* 802D6428 002D3388 83 E1 00 0C */ lwz r31, 0xc(r1) /* 802D642C 002D338C 83 C1 00 08 */ lwz r30, 8(r1) /* 802D6430 002D3390 7C 08 03 A6 */ mtlr r0 /* 802D6434 002D3394 38 21 00 10 */ addi r1, r1, 0x10 /* 802D6438 002D3398 4E 80 00 20 */ blr .global OpenWindow__10COsContextFPCciiiib OpenWindow__10COsContextFPCciiiib: /* 802D643C 002D339C 94 21 FF E0 */ stwu r1, -0x20(r1) /* 802D6440 002D33A0 7C 08 02 A6 */ mflr r0 /* 802D6444 002D33A4 90 01 00 24 */ stw r0, 0x24(r1) /* 802D6448 002D33A8 93 E1 00 1C */ stw r31, 0x1c(r1) /* 802D644C 002D33AC 7C 7F 1B 78 */ mr r31, r3 /* 802D6450 002D33B0 93 C1 00 18 */ stw r30, 0x18(r1) /* 802D6454 002D33B4 93 A1 00 14 */ stw r29, 0x14(r1) /* 802D6458 002D33B8 7D 1D 43 78 */ mr r29, r8 /* 802D645C 002D33BC 93 81 00 10 */ stw r28, 0x10(r1) /* 802D6460 002D33C0 7C FC 3B 78 */ mr r28, r7 /* 802D6464 002D33C4 48 0B 17 79 */ bl VIInit /* 802D6468 002D33C8 48 0B 30 71 */ bl VIGetTvFormat /* 802D646C 002D33CC 2C 03 00 01 */ cmpwi r3, 1 /* 802D6470 002D33D0 41 82 00 38 */ beq lbl_802D64A8 /* 802D6474 002D33D4 40 80 00 10 */ bge lbl_802D6484 /* 802D6478 002D33D8 2C 03 00 00 */ cmpwi r3, 0 /* 802D647C 002D33DC 40 80 00 14 */ bge lbl_802D6490 /* 802D6480 002D33E0 48 00 00 54 */ b lbl_802D64D4 lbl_802D6484: /* 802D6484 002D33E4 2C 03 00 03 */ cmpwi r3, 3 /* 802D6488 002D33E8 40 80 00 4C */ bge lbl_802D64D4 /* 802D648C 002D33EC 48 00 00 34 */ b lbl_802D64C0 lbl_802D6490: /* 802D6490 002D33F0 3C 60 80 3F */ lis r3, lbl_803F08E0@ha /* 802D6494 002D33F4 38 00 00 01 */ li r0, 1 /* 802D6498 002D33F8 38 63 08 E0 */ addi r3, r3, lbl_803F08E0@l /* 802D649C 002D33FC 90 1F 00 10 */ stw r0, 0x10(r31) /* 802D64A0 002D3400 7C 7E 1B 78 */ mr r30, r3 /* 802D64A4 002D3404 48 00 00 30 */ b lbl_802D64D4 lbl_802D64A8: /* 802D64A8 002D3408 3C 60 80 3F */ lis r3, lbl_803F0958@ha /* 802D64AC 002D340C 38 00 00 02 */ li r0, 2 /* 802D64B0 002D3410 38 63 09 58 */ addi r3, r3, lbl_803F0958@l /* 802D64B4 002D3414 90 1F 00 10 */ stw r0, 0x10(r31) /* 802D64B8 002D3418 7C 7E 1B 78 */ mr r30, r3 /* 802D64BC 002D341C 48 00 00 18 */ b lbl_802D64D4 lbl_802D64C0: /* 802D64C0 002D3420 3C 60 80 3F */ lis r3, lbl_803F091C@ha /* 802D64C4 002D3424 38 00 00 03 */ li r0, 3 /* 802D64C8 002D3428 38 63 09 1C */ addi r3, r3, lbl_803F091C@l /* 802D64CC 002D342C 90 1F 00 10 */ stw r0, 0x10(r31) /* 802D64D0 002D3430 7C 7E 1B 78 */ mr r30, r3 lbl_802D64D4: /* 802D64D4 002D3434 2C 1C 00 00 */ cmpwi r28, 0 /* 802D64D8 002D3438 40 81 00 08 */ ble lbl_802D64E0 /* 802D64DC 002D343C B3 9F 00 3E */ sth r28, 0x3e(r31) lbl_802D64E0: /* 802D64E0 002D3440 2C 1D 00 00 */ cmpwi r29, 0 /* 802D64E4 002D3444 40 81 00 08 */ ble lbl_802D64EC /* 802D64E8 002D3448 B3 BF 00 40 */ sth r29, 0x40(r31) lbl_802D64EC: /* 802D64EC 002D344C 7F C3 F3 78 */ mr r3, r30 /* 802D64F0 002D3450 38 9F 00 30 */ addi r4, r31, 0x30 /* 802D64F4 002D3454 38 A0 00 00 */ li r5, 0 /* 802D64F8 002D3458 38 C0 00 10 */ li r6, 0x10 /* 802D64FC 002D345C 48 0A 27 09 */ bl GXAdjustForOverscan /* 802D6500 002D3460 A0 1F 00 3A */ lhz r0, 0x3a(r31) /* 802D6504 002D3464 38 80 00 20 */ li r4, 0x20 /* 802D6508 002D3468 90 1F 00 08 */ stw r0, 8(r31) /* 802D650C 002D346C A0 1F 00 3C */ lhz r0, 0x3c(r31) /* 802D6510 002D3470 90 1F 00 0C */ stw r0, 0xc(r31) /* 802D6514 002D3474 A0 1F 00 3E */ lhz r0, 0x3e(r31) /* 802D6518 002D3478 90 1F 00 00 */ stw r0, 0(r31) /* 802D651C 002D347C A0 1F 00 40 */ lhz r0, 0x40(r31) /* 802D6520 002D3480 90 1F 00 04 */ stw r0, 4(r31) /* 802D6524 002D3484 A0 7F 00 34 */ lhz r3, 0x34(r31) /* 802D6528 002D3488 A0 1F 00 38 */ lhz r0, 0x38(r31) /* 802D652C 002D348C 38 63 00 0F */ addi r3, r3, 0xf /* 802D6530 002D3490 54 63 04 36 */ rlwinm r3, r3, 0, 0x10, 0x1b /* 802D6534 002D3494 7C 03 01 D6 */ mullw r0, r3, r0 /* 802D6538 002D3498 54 00 08 3C */ slwi r0, r0, 1 /* 802D653C 002D349C 90 1F 00 2C */ stw r0, 0x2c(r31) /* 802D6540 002D34A0 80 7F 00 2C */ lwz r3, 0x2c(r31) /* 802D6544 002D34A4 48 0A 82 6D */ bl OSAllocFromArenaLo /* 802D6548 002D34A8 90 7F 00 24 */ stw r3, 0x24(r31) /* 802D654C 002D34AC 38 80 00 20 */ li r4, 0x20 /* 802D6550 002D34B0 80 7F 00 2C */ lwz r3, 0x2c(r31) /* 802D6554 002D34B4 48 0A 82 5D */ bl OSAllocFromArenaLo /* 802D6558 002D34B8 90 7F 00 28 */ stw r3, 0x28(r31) /* 802D655C 002D34BC 48 0A 82 3D */ bl OSGetArenaLo /* 802D6560 002D34C0 90 7F 00 20 */ stw r3, 0x20(r31) /* 802D6564 002D34C4 48 0A 82 35 */ bl OSGetArenaLo /* 802D6568 002D34C8 90 7F 00 18 */ stw r3, 0x18(r31) /* 802D656C 002D34CC 48 0A 82 25 */ bl OSGetArenaHi /* 802D6570 002D34D0 90 7F 00 1C */ stw r3, 0x1c(r31) /* 802D6574 002D34D4 A0 7F 00 3E */ lhz r3, 0x3e(r31) /* 802D6578 002D34D8 38 03 00 14 */ addi r0, r3, 0x14 /* 802D657C 002D34DC B0 1F 00 3E */ sth r0, 0x3e(r31) /* 802D6580 002D34E0 A0 7F 00 3A */ lhz r3, 0x3a(r31) /* 802D6584 002D34E4 38 03 FF F6 */ addi r0, r3, -10 /* 802D6588 002D34E8 B0 1F 00 3A */ sth r0, 0x3a(r31) /* 802D658C 002D34EC 88 0D A0 98 */ lbz r0, lbl_805A8C58@sda21(r13) /* 802D6590 002D34F0 28 00 00 00 */ cmplwi r0, 0 /* 802D6594 002D34F4 41 82 00 3C */ beq lbl_802D65D0 /* 802D6598 002D34F8 38 60 00 02 */ li r3, 2 /* 802D659C 002D34FC 38 00 00 00 */ li r0, 0 /* 802D65A0 002D3500 90 7F 00 30 */ stw r3, 0x30(r31) /* 802D65A4 002D3504 38 7F 00 62 */ addi r3, r31, 0x62 /* 802D65A8 002D3508 38 81 00 08 */ addi r4, r1, 8 /* 802D65AC 002D350C 38 A0 00 07 */ li r5, 7 /* 802D65B0 002D3510 90 1F 00 44 */ stw r0, 0x44(r31) /* 802D65B4 002D3514 80 E2 C5 68 */ lwz r7, lbl_805AE288@sda21(r2) /* 802D65B8 002D3518 A0 C2 C5 6C */ lhz r6, lbl_805AE28C@sda21(r2) /* 802D65BC 002D351C 88 02 C5 6E */ lbz r0, lbl_805AE28E@sda21(r2) /* 802D65C0 002D3520 90 E1 00 08 */ stw r7, 8(r1) /* 802D65C4 002D3524 B0 C1 00 0C */ sth r6, 0xc(r1) /* 802D65C8 002D3528 98 01 00 0E */ stb r0, 0xe(r1) /* 802D65CC 002D352C 4B D2 CE C5 */ bl memcpy lbl_802D65D0: /* 802D65D0 002D3530 38 7F 00 30 */ addi r3, r31, 0x30 /* 802D65D4 002D3534 48 0B 1F 81 */ bl VIConfigure /* 802D65D8 002D3538 48 0B 2B 39 */ bl VIFlush /* 802D65DC 002D353C 80 01 00 24 */ lwz r0, 0x24(r1) /* 802D65E0 002D3540 38 60 FF FF */ li r3, -1 /* 802D65E4 002D3544 83 E1 00 1C */ lwz r31, 0x1c(r1) /* 802D65E8 002D3548 83 C1 00 18 */ lwz r30, 0x18(r1) /* 802D65EC 002D354C 83 A1 00 14 */ lwz r29, 0x14(r1) /* 802D65F0 002D3550 83 81 00 10 */ lwz r28, 0x10(r1) /* 802D65F4 002D3554 7C 08 03 A6 */ mtlr r0 /* 802D65F8 002D3558 38 21 00 20 */ addi r1, r1, 0x20 /* 802D65FC 002D355C 4E 80 00 20 */ blr .global GetOsKeyState__10COsContextCFi GetOsKeyState__10COsContextCFi: /* 802D6600 002D3560 90 A3 00 00 */ stw r5, 0(r3) /* 802D6604 002D3564 38 80 00 00 */ li r4, 0 /* 802D6608 002D3568 A8 03 00 04 */ lha r0, 4(r3) /* 802D660C 002D356C 50 80 7C 20 */ rlwimi r0, r4, 0xf, 0x10, 0x10 /* 802D6610 002D3570 B0 03 00 04 */ sth r0, 4(r3) /* 802D6614 002D3574 A8 03 00 04 */ lha r0, 4(r3) /* 802D6618 002D3578 50 80 74 62 */ rlwimi r0, r4, 0xe, 0x11, 0x11 /* 802D661C 002D357C B0 03 00 04 */ sth r0, 4(r3) /* 802D6620 002D3580 A8 03 00 04 */ lha r0, 4(r3) /* 802D6624 002D3584 50 80 6C A4 */ rlwimi r0, r4, 0xd, 0x12, 0x12 /* 802D6628 002D3588 B0 03 00 04 */ sth r0, 4(r3) /* 802D662C 002D358C A8 03 00 04 */ lha r0, 4(r3) /* 802D6630 002D3590 50 80 64 E6 */ rlwimi r0, r4, 0xc, 0x13, 0x13 /* 802D6634 002D3594 B0 03 00 04 */ sth r0, 4(r3) /* 802D6638 002D3598 4E 80 00 20 */ blr .global Update__10COsContextFv Update__10COsContextFv: /* 802D663C 002D359C 38 60 00 01 */ li r3, 1 /* 802D6640 002D35A0 4E 80 00 20 */ blr .global __dt__10COsContextFv __dt__10COsContextFv: /* 802D6644 002D35A4 94 21 FF F0 */ stwu r1, -0x10(r1) /* 802D6648 002D35A8 7C 08 02 A6 */ mflr r0 /* 802D664C 002D35AC 90 01 00 14 */ stw r0, 0x14(r1) /* 802D6650 002D35B0 93 E1 00 0C */ stw r31, 0xc(r1) /* 802D6654 002D35B4 7C 7F 1B 79 */ or. r31, r3, r3 /* 802D6658 002D35B8 41 82 00 10 */ beq lbl_802D6668 /* 802D665C 002D35BC 7C 80 07 35 */ extsh. r0, r4 /* 802D6660 002D35C0 40 81 00 08 */ ble lbl_802D6668 /* 802D6664 002D35C4 48 03 F2 CD */ bl Free__7CMemoryFPCv lbl_802D6668: /* 802D6668 002D35C8 80 01 00 14 */ lwz r0, 0x14(r1) /* 802D666C 002D35CC 7F E3 FB 78 */ mr r3, r31 /* 802D6670 002D35D0 83 E1 00 0C */ lwz r31, 0xc(r1) /* 802D6674 002D35D4 7C 08 03 A6 */ mtlr r0 /* 802D6678 002D35D8 38 21 00 10 */ addi r1, r1, 0x10 /* 802D667C 002D35DC 4E 80 00 20 */ blr .global __ct__10COsContextFbb __ct__10COsContextFbb: /* 802D6680 002D35E0 94 21 FF F0 */ stwu r1, -0x10(r1) /* 802D6684 002D35E4 7C 08 02 A6 */ mflr r0 /* 802D6688 002D35E8 90 01 00 14 */ stw r0, 0x14(r1) /* 802D668C 002D35EC 93 E1 00 0C */ stw r31, 0xc(r1) /* 802D6690 002D35F0 7C 7F 1B 78 */ mr r31, r3 /* 802D6694 002D35F4 4B FF FC C1 */ bl Init__7CBasicsFv /* 802D6698 002D35F8 48 0A 70 85 */ bl OSGetConsoleType /* 802D669C 002D35FC 3C 80 10 00 */ lis r4, 0x1000 /* 802D66A0 002D3600 7C 03 20 00 */ cmpw r3, r4 /* 802D66A4 002D3604 41 82 00 58 */ beq lbl_802D66FC /* 802D66A8 002D3608 40 80 00 10 */ bge lbl_802D66B8 /* 802D66AC 002D360C 2C 03 00 01 */ cmpwi r3, 1 /* 802D66B0 002D3610 41 82 00 28 */ beq lbl_802D66D8 /* 802D66B4 002D3614 48 00 00 50 */ b lbl_802D6704 lbl_802D66B8: /* 802D66B8 002D3618 38 04 00 04 */ addi r0, r4, 4 /* 802D66BC 002D361C 7C 03 00 00 */ cmpw r3, r0 /* 802D66C0 002D3620 41 82 00 24 */ beq lbl_802D66E4 /* 802D66C4 002D3624 41 80 00 40 */ blt lbl_802D6704 /* 802D66C8 002D3628 38 04 00 07 */ addi r0, r4, 7 /* 802D66CC 002D362C 7C 03 00 00 */ cmpw r3, r0 /* 802D66D0 002D3630 40 80 00 34 */ bge lbl_802D6704 /* 802D66D4 002D3634 48 00 00 1C */ b lbl_802D66F0 lbl_802D66D8: /* 802D66D8 002D3638 38 00 00 03 */ li r0, 3 /* 802D66DC 002D363C 90 1F 00 14 */ stw r0, 0x14(r31) /* 802D66E0 002D3640 48 00 00 24 */ b lbl_802D6704 lbl_802D66E4: /* 802D66E4 002D3644 38 00 00 01 */ li r0, 1 /* 802D66E8 002D3648 90 1F 00 14 */ stw r0, 0x14(r31) /* 802D66EC 002D364C 48 00 00 18 */ b lbl_802D6704 lbl_802D66F0: /* 802D66F0 002D3650 38 00 00 02 */ li r0, 2 /* 802D66F4 002D3654 90 1F 00 14 */ stw r0, 0x14(r31) /* 802D66F8 002D3658 48 00 00 0C */ b lbl_802D6704 lbl_802D66FC: /* 802D66FC 002D365C 38 00 00 00 */ li r0, 0 /* 802D6700 002D3660 90 1F 00 14 */ stw r0, 0x14(r31) lbl_802D6704: /* 802D6704 002D3664 80 01 00 14 */ lwz r0, 0x14(r1) /* 802D6708 002D3668 7F E3 FB 78 */ mr r3, r31 /* 802D670C 002D366C 83 E1 00 0C */ lwz r31, 0xc(r1) /* 802D6710 002D3670 7C 08 03 A6 */ mtlr r0 /* 802D6714 002D3674 38 21 00 10 */ addi r1, r1, 0x10 /* 802D6718 002D3678 4E 80 00 20 */ blr .section .sdata2, "a" .balign 8 .global lbl_805AE288 lbl_805AE288: # ROM: 0x3FAB28 .4byte 0x04041010 .global lbl_805AE28C lbl_805AE28C: # ROM: 0x3FAB2C .2byte 0x00001004 .global lbl_805AE28E lbl_805AE28E: # ROM: 0x3FAB2E .2byte 0x00000400