From 75f08901d8ca0b0a6eb01490d085936ea41d8c09 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 22 Aug 2022 23:54:30 -0400 Subject: [PATCH] KOR buildable Former-commit-id: e50328cd890d9ed751b133ecb04239b1f44e122d --- .github/workflows/build.yml | 2 +- Makefile | 11 +- README.md | 1 + asm/Dolphin/dvd/dvderror.s | 3 + asm/Dolphin/dvd/dvdfatal.s | 20 +- asm/Dolphin/os/OSRtc.s | 4 + asm/Kyoto/Basics/RAssertDolphin.s | 2 +- asm/Kyoto/DolphinCDvdFile.s | 2 +- asm/Kyoto/Graphics/CCubeMaterial.s | 8 +- asm/Kyoto/Graphics/CCubeMoviePlayer.s | 2 +- asm/Kyoto/Text/CTextRenderBuffer.s | 3 +- asm/MetaRender/CCubeRenderer.s | 300 +++++++------- asm/MetroidPrime/CCredits.s | 9 + asm/MetroidPrime/CFluidPlaneCPU.s | 2 +- asm/MetroidPrime/CFrontEndUI.s | 8 +- asm/MetroidPrime/CGBASupport.s | 513 ++++++++++++++++++++++-- asm/MetroidPrime/Enemies/COmegaPirate.s | 2 +- asm/MetroidPrime/main.s | 6 +- tools/asmdiff.sh | 5 +- 19 files changed, 685 insertions(+), 218 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a2af4ee..653d3f4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - version: [0, 1] + version: [0, 1, kor] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/Makefile b/Makefile index 025c60be..0e89a8f5 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,11 @@ endif NAME := mp1 VERSION ?= 0 +VERSION_NUM := $(VERSION) +ifeq ($(VERSION),kor) + VERSION_NUM := 2 +endif + BUILD_DIR := build/$(NAME).$(VERSION) # Inputs @@ -93,7 +98,7 @@ FRANK := tools/franklite.py INCLUDES := -i include/ ASM_INCLUDES := -I include/ -ASFLAGS := -mgekko $(ASM_INCLUDES) --defsym version=$(VERSION) +ASFLAGS := -mgekko $(ASM_INCLUDES) --defsym version=$(VERSION_NUM) ifeq ($(VERBOSE),1) # this set of LDFLAGS outputs warnings. LDFLAGS := $(MAPGEN) -fp fmadd -nodefaults @@ -104,8 +109,8 @@ LDFLAGS := $(MAPGEN) -fp fmadd -nodefaults -w off endif CFLAGS_1.2 = -proc gekko -nodefaults -Cpp_exceptions off -RTTI off -fp fmadd -fp_contract on -O4,p -maxerrors 1 -enum int -inline auto -MMD $(INCLUDES) CFLAGS_MUSYX = -proc gekko -nodefaults -Cpp_exceptions off -RTTI off -fp fmadd -str reuse,pool,readonly -O4,p -maxerrors 1 -enum int -inline auto -MMD $(INCLUDES) -CFLAGS = $(CFLAGS_1.2) -use_lmw_stmw on -str reuse,pool,readonly -gccinc -inline deferred,noauto -common on -CFLAGS_ZLIB = $(CFLAGS_1.2) -use_lmw_stmw on -str reuse,pool,readonly -gccinc -inline deferred,auto +CFLAGS = $(CFLAGS_1.2) -use_lmw_stmw on -str reuse,pool,readonly -gccinc -nosyspath -inline deferred,noauto -common on +CFLAGS_ZLIB = $(CFLAGS_1.2) -use_lmw_stmw on -str reuse,pool,readonly -gccinc -nosyspath -inline deferred,auto CFLAGS_1.2 += -str reuse ifeq ($(VERBOSE),0) diff --git a/README.md b/README.md index 8bbe8f89..9ecf8e39 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ This repository builds the following DOLs: ``` 949c5ed7368aef547e0b0db1c3678f466e2afbff build/mp1.0/main.dol (USA 0-00) 860141f9671fc141ce8f55448643f713bc64b349 build/mp1.1/main.dol (USA 0-01) +52316d2a71c0d18c84f054fd6f1e58bdd7bf0ded build/mp1.kor/main.dol (KOR) ``` Dependencies diff --git a/asm/Dolphin/dvd/dvderror.s b/asm/Dolphin/dvd/dvderror.s index 4695ad94..64018111 100644 --- a/asm/Dolphin/dvd/dvderror.s +++ b/asm/Dolphin/dvd/dvderror.s @@ -24,6 +24,8 @@ lbl_803F0100: .4byte 0x00100007 .4byte 0 +.if version < 2 + .global lbl_803F0148 lbl_803F0148: @@ -173,6 +175,7 @@ lbl_803F04EC: .asciz "\n\n\nEr is een fout opgetreden.\nZet de NINTENDO GAMECUBE uit en\nraadpleeg de handleiding van de\nNintendo GameCube voor nadere\ninstructies." .balign 4 +.endif .section .text, "ax" diff --git a/asm/Dolphin/dvd/dvdfatal.s b/asm/Dolphin/dvd/dvdfatal.s index badd818b..837d3873 100644 --- a/asm/Dolphin/dvd/dvdfatal.s +++ b/asm/Dolphin/dvd/dvdfatal.s @@ -1,5 +1,7 @@ .include "macros.inc" +.if version < 2 + .section .sdata .balign 8 .global lbl_805A8AB0 @@ -12,13 +14,6 @@ lbl_805A8AB4: # ROM: 0x3F6454 .4byte lbl_803F01B8 - -.section .sbss -.balign 8 -.global lbl_805A9820 -lbl_805A9820: - .skip 0x8 - .section .sdata2 .balign 8 .global lbl_805AEB20 @@ -43,9 +38,18 @@ lbl_803D8570: .4byte lbl_803F046C .4byte lbl_803F04EC +.endif + +.section .sbss +.balign 8 +.global lbl_805A9820 +lbl_805A9820: + .skip 0x8 .section .text, "ax" +.if version < 2 + .global ShowMessage ShowMessage: /* 80374D40 00371CA0 7C 08 02 A6 */ mflr r0 @@ -122,6 +126,8 @@ lbl_80374E18: /* 80374E34 00371D94 7C 08 03 A6 */ mtlr r0 /* 80374E38 00371D98 4E 80 00 20 */ blr +.endif + .global __DVDPrintFatalMessage __DVDPrintFatalMessage: /* 80374E3C 00371D9C 7C 08 02 A6 */ mflr r0 diff --git a/asm/Dolphin/os/OSRtc.s b/asm/Dolphin/os/OSRtc.s index 7b02f6a4..89c5a220 100644 --- a/asm/Dolphin/os/OSRtc.s +++ b/asm/Dolphin/os/OSRtc.s @@ -735,6 +735,8 @@ lbl_80384230: /* 80384240 003811A0 7C 08 03 A6 */ mtlr r0 /* 80384244 003811A4 4E 80 00 20 */ blr +.if version < 2 + .global OSGetLanguage OSGetLanguage: /* 80384248 003811A8 7C 08 02 A6 */ mflr r0 @@ -767,6 +769,8 @@ lbl_8038428C: /* 803842AC 0038120C 7C 08 03 A6 */ mtlr r0 /* 803842B0 00381210 4E 80 00 20 */ blr +.endif + .global OSGetWirelessID OSGetWirelessID: /* 803842B4 00381214 7C 08 02 A6 */ mflr r0 diff --git a/asm/Kyoto/Basics/RAssertDolphin.s b/asm/Kyoto/Basics/RAssertDolphin.s index 29066e8d..39061b4f 100644 --- a/asm/Kyoto/Basics/RAssertDolphin.s +++ b/asm/Kyoto/Basics/RAssertDolphin.s @@ -99,7 +99,7 @@ SetErrorHandlers: /* 802D6950 002D38B0 38 21 00 10 */ addi r1, r1, 0x10 /* 802D6954 002D38B4 4E 80 00 20 */ blr -.if version == 1 +.if version >= 1 .global ErrorHandler ErrorHandler: diff --git a/asm/Kyoto/DolphinCDvdFile.s b/asm/Kyoto/DolphinCDvdFile.s index aa37adce..45505591 100644 --- a/asm/Kyoto/DolphinCDvdFile.s +++ b/asm/Kyoto/DolphinCDvdFile.s @@ -68,7 +68,7 @@ lbl_8034F938: /* 8034F940 0034C8A0 90 03 00 10 */ stw r0, 0x10(r3) /* 8034F944 0034C8A4 4E 80 00 20 */ blr -.if version == 1 +.if version >= 1 .global internalCallback__8CDvdFileFlP11DVDFileInfo internalCallback__8CDvdFileFlP11DVDFileInfo: diff --git a/asm/Kyoto/Graphics/CCubeMaterial.s b/asm/Kyoto/Graphics/CCubeMaterial.s index 7d9a9262..4b2629c3 100644 --- a/asm/Kyoto/Graphics/CCubeMaterial.s +++ b/asm/Kyoto/Graphics/CCubeMaterial.s @@ -374,7 +374,7 @@ lbl_80345AAC: /* 80345B00 00342A60 D0 81 00 74 */ stfs f4, 0x74(r1) /* 80345B04 00342A64 D0 41 00 78 */ stfs f2, 0x78(r1) lbl_80345B08: -/* 80345B08 00342A68 80 AD A5 F0 */ lwz r5, lbl_805A91B0@sda21(r13) +/* 80345B08 00342A68 80 AD A5 F0 */ lwz r5, sRenderer__13CCubeRenderer@sda21(r13) /* 80345B0C 00342A6C 88 85 03 18 */ lbz r4, 0x318(r5) /* 80345B10 00342A70 54 80 CF FF */ rlwinm. r0, r4, 0x19, 0x1f, 0x1f /* 80345B14 00342A74 41 82 00 A4 */ beq lbl_80345BB8 @@ -750,7 +750,7 @@ lbl_80346064: /* 8034607C 00342FDC 7C 03 02 14 */ add r0, r3, r0 /* 80346080 00342FE0 90 01 00 3C */ stw r0, 0x3c(r1) lbl_80346084: -/* 80346084 00342FE4 80 6D A5 F0 */ lwz r3, lbl_805A91B0@sda21(r13) +/* 80346084 00342FE4 80 6D A5 F0 */ lwz r3, sRenderer__13CCubeRenderer@sda21(r13) /* 80346088 00342FE8 80 81 00 3C */ lwz r4, 0x3c(r1) /* 8034608C 00342FEC 88 03 03 18 */ lbz r0, 0x318(r3) /* 80346090 00342FF0 83 64 00 00 */ lwz r27, 0(r4) @@ -806,7 +806,7 @@ lbl_80346108: lbl_8034614C: /* 8034614C 003430AC 80 81 00 3C */ lwz r4, 0x3c(r1) /* 80346150 003430B0 38 A0 00 00 */ li r5, 0 -/* 80346154 003430B4 80 6D A5 F0 */ lwz r3, lbl_805A91B0@sda21(r13) +/* 80346154 003430B4 80 6D A5 F0 */ lwz r3, sRenderer__13CCubeRenderer@sda21(r13) /* 80346158 003430B8 3A E0 00 00 */ li r23, 0 /* 8034615C 003430BC 82 64 00 00 */ lwz r19, 0(r4) /* 80346160 003430C0 38 C4 00 04 */ addi r6, r4, 4 @@ -1809,7 +1809,7 @@ lbl_80346F48: /* 80346F70 00343ED0 7F A3 EB 78 */ mr r3, r29 /* 80346F74 00343ED4 48 03 47 E5 */ bl GXSetTevKColorSel lbl_80346F78: -/* 80346F78 00343ED8 80 6D A5 F0 */ lwz r3, lbl_805A91B0@sda21(r13) +/* 80346F78 00343ED8 80 6D A5 F0 */ lwz r3, sRenderer__13CCubeRenderer@sda21(r13) /* 80346F7C 00343EDC 7F BD FA 14 */ add r29, r29, r31 /* 80346F80 00343EE0 4B F7 55 C1 */ bl GetRealReflection__13CCubeRendererFv /* 80346F84 00343EE4 7F 84 E3 78 */ mr r4, r28 diff --git a/asm/Kyoto/Graphics/CCubeMoviePlayer.s b/asm/Kyoto/Graphics/CCubeMoviePlayer.s index 05cce62f..4cf61b58 100644 --- a/asm/Kyoto/Graphics/CCubeMoviePlayer.s +++ b/asm/Kyoto/Graphics/CCubeMoviePlayer.s @@ -624,7 +624,7 @@ lbl_8035BD4C: /* 8035BD58 00358CB8 38 21 00 30 */ addi r1, r1, 0x30 /* 8035BD5C 00358CBC 4E 80 00 20 */ blr -.if version == 1 +.if version >= 1 .global Update__12CMoviePlayerFf Update__12CMoviePlayerFf: diff --git a/asm/Kyoto/Text/CTextRenderBuffer.s b/asm/Kyoto/Text/CTextRenderBuffer.s index 4ad8a16f..35219931 100644 --- a/asm/Kyoto/Text/CTextRenderBuffer.s +++ b/asm/Kyoto/Text/CTextRenderBuffer.s @@ -1923,8 +1923,9 @@ lbl_803D8368: # ROM: 0x3D5368 .asciz "??(??)" .balign 4 +.if version < 2 .4byte 0 .4byte 0 .4byte 0 .4byte 0 - +.endif diff --git a/asm/MetaRender/CCubeRenderer.s b/asm/MetaRender/CCubeRenderer.s index 234c4b9f..f60bed01 100644 --- a/asm/MetaRender/CCubeRenderer.s +++ b/asm/MetaRender/CCubeRenderer.s @@ -7,57 +7,61 @@ lbl_ctor: .section .sbss, "wa" .balign 8 -.global lbl_805A91B0 -lbl_805A91B0: +.global sRenderer__13CCubeRenderer +sRenderer__13CCubeRenderer: .skip 0x4 -.global lbl_805A91B4 -lbl_805A91B4: +.global skNormalFlag +skNormalFlag: .skip 0x8 -.global lbl_805A91BC -lbl_805A91BC: +.global skNormalFlagNoUpdate +skNormalFlagNoUpdate: .skip 0x8 -.global lbl_805A91C4 -lbl_805A91C4: +.global skWorstMinMaxDistance__7Buckets +skWorstMinMaxDistance__7Buckets: .skip 0x8 -.global lbl_805A91CC -lbl_805A91CC: +.global sData__7Buckets +sData__7Buckets: .skip 0x4 -.global lbl_805A91D0 -lbl_805A91D0: +.global sBuckets__7Buckets +sBuckets__7Buckets: .skip 0x4 -.global lbl_805A91D4 -lbl_805A91D4: +.global sMinMaxDistance__7Buckets +sMinMaxDistance__7Buckets: .skip 0x8 -.global lbl_805A91DC -lbl_805A91DC: +.global sPlaneObjectData__7Buckets +sPlaneObjectData__7Buckets: .skip 0x4 -.global lbl_805A91E0 -lbl_805A91E0: +.global sPlaneObjectBucket__7Buckets +sPlaneObjectBucket__7Buckets: .skip 0x4 -.global lbl_805A91E4 -lbl_805A91E4: - .skip 0x4 -.global lbl_805A91E8 -lbl_805A91E8: +.global "@4756" +"@4756": .skip 0x1 -.global lbl_805A91E9 -lbl_805A91E9: - .skip 0x3 -.global lbl_805A91EC -lbl_805A91EC: - .skip 0x4 -.global lbl_805A91F0 -lbl_805A91F0: - .skip 0x4 -.global lbl_805A91F4 -lbl_805A91F4: +.balign 4 +.global "@4808" +"@4808": + .skip 0x1 +.global "init$6480" +"init$6480": + .skip 0x1 +.balign 4 +.global "@8522" +"@8522": + .skip 0x1 +.balign 4 +.global "sReferenceCount$9005" +"sReferenceCount$9005": .skip 0x4 +.global "init$9006" +"init$9006": + .skip 0x1 +.balign 4 .section .data .balign 8 -.global lbl_803EC5D8 -lbl_803EC5D8: +.global __vt__13CCubeRenderer +__vt__13CCubeRenderer: # ROM: 0x3E95D8 .4byte 0 .4byte 0 @@ -262,14 +266,14 @@ lbl_805AF498: .section .bss .balign 8 -.lcomm lbl_8046E200, 0xC, 4 -.lcomm lbl_8046E20C, 0x68, 4 -.lcomm lbl_8046E274, 0x4808, 4 -.lcomm lbl_80472A7C, 0x64D0, 4 -.lcomm lbl_80478F4C, 0x208, 4 -.lcomm lbl_80479154, 0x18, 4 -.lcomm lbl_8047916C, 0xC, 4 -.lcomm lbl_80479178, 0x320, 4 +.lcomm "@4370", 0xC, 4 +.lcomm sBucketIndex__7Buckets, 0x68, 4 +.lcomm "sDataHolder$4374", 0x4808, 4 +.lcomm "sBucketsHolder$4375", 0x64D0, 4 +.lcomm "sPlaneObjectDataHolder$4376", 0x208, 4 +.lcomm "sPlaneObjectBucketHolder$4377", 0x18, 4 +.lcomm "sOptimalPlane$6479", 0xC, 4 +.lcomm "sAllocSpace$9000", 0x320, 4 .section .text, "ax" @@ -2583,7 +2587,7 @@ lbl_802B7E9C: lbl_802B7EE4: /* 802B7EE4 002B4E44 7F C3 F3 78 */ mr r3, r30 /* 802B7EE8 002B4E48 38 81 00 0C */ addi r4, r1, 0xc -/* 802B7EEC 002B4E4C 38 AD A5 F4 */ addi r5, r13, lbl_805A91B4@sda21 +/* 802B7EEC 002B4E4C 38 AD A5 F4 */ addi r5, r13, skNormalFlag@sda21 /* 802B7EF0 002B4E50 48 04 F5 55 */ bl DrawSurface__10CCubeModelCFRC12CCubeSurfaceRC11CModelFlags /* 802B7EF4 002B4E54 80 61 00 0C */ lwz r3, 0xc(r1) /* 802B7EF8 002B4E58 80 03 00 18 */ lwz r0, 0x18(r3) @@ -2598,7 +2602,7 @@ lbl_802B7F00: lbl_802B7F18: /* 802B7F18 002B4E78 7F C3 F3 78 */ mr r3, r30 /* 802B7F1C 002B4E7C 38 81 00 08 */ addi r4, r1, 8 -/* 802B7F20 002B4E80 38 AD A5 F4 */ addi r5, r13, lbl_805A91B4@sda21 +/* 802B7F20 002B4E80 38 AD A5 F4 */ addi r5, r13, skNormalFlag@sda21 /* 802B7F24 002B4E84 48 04 F5 21 */ bl DrawSurface__10CCubeModelCFRC12CCubeSurfaceRC11CModelFlags /* 802B7F28 002B4E88 80 61 00 08 */ lwz r3, 8(r1) /* 802B7F2C 002B4E8C 80 03 00 18 */ lwz r0, 0x18(r3) @@ -3309,7 +3313,7 @@ lbl_802B8984: lbl_802B8990: /* 802B8990 002B58F0 7C 04 F0 40 */ cmplw r4, r30 /* 802B8994 002B58F4 40 82 FF F0 */ bne lbl_802B8984 -/* 802B8998 002B58F8 88 0D A6 2C */ lbz r0, lbl_805A91EC@sda21(r13) +/* 802B8998 002B58F8 88 0D A6 2C */ lbz r0, "@8522"@sda21(r13) /* 802B899C 002B58FC 38 7D 02 AC */ addi r3, r29, 0x2ac /* 802B89A0 002B5900 38 81 00 08 */ addi r4, r1, 8 /* 802B89A4 002B5904 98 01 00 08 */ stb r0, 8(r1) @@ -8553,7 +8557,7 @@ lbl_802BD488: lbl_802BD4F8: /* 802BD4F8 002BA458 7F C3 F3 78 */ mr r3, r30 /* 802BD4FC 002BA45C 38 81 00 08 */ addi r4, r1, 8 -/* 802BD500 002BA460 38 AD A5 F4 */ addi r5, r13, lbl_805A91B4@sda21 +/* 802BD500 002BA460 38 AD A5 F4 */ addi r5, r13, skNormalFlag@sda21 /* 802BD504 002BA464 48 04 9F 41 */ bl DrawSurface__10CCubeModelCFRC12CCubeSurfaceRC11CModelFlags /* 802BD508 002BA468 80 61 00 08 */ lwz r3, 8(r1) /* 802BD50C 002BA46C 80 03 00 18 */ lwz r0, 0x18(r3) @@ -8574,16 +8578,16 @@ lbl_802BD51C: "RenderBucketItems__13CCubeRendererFRCQ24rstl42vector<6CLight,Q24rstl17rmemory_allocator>": /* 802BD53C 002BA49C 94 21 FF C0 */ stwu r1, -0x40(r1) /* 802BD540 002BA4A0 7C 08 02 A6 */ mflr r0 -/* 802BD544 002BA4A4 3C A0 80 47 */ lis r5, lbl_8046E20C@ha +/* 802BD544 002BA4A4 3C A0 80 47 */ lis r5, sBucketIndex__7Buckets@ha /* 802BD548 002BA4A8 90 01 00 44 */ stw r0, 0x44(r1) /* 802BD54C 002BA4AC BE C1 00 18 */ stmw r22, 0x18(r1) -/* 802BD550 002BA4B0 3B E5 E2 0C */ addi r31, r5, lbl_8046E20C@l +/* 802BD550 002BA4B0 3B E5 E2 0C */ addi r31, r5, sBucketIndex__7Buckets@l /* 802BD554 002BA4B4 7C 9B 23 78 */ mr r27, r4 /* 802BD558 002BA4B8 7C 7A 1B 78 */ mr r26, r3 /* 802BD55C 002BA4BC 38 80 FF FF */ li r4, -1 /* 802BD560 002BA4C0 3B 9F 00 04 */ addi r28, r31, 4 /* 802BD564 002BA4C4 3B A0 00 00 */ li r29, 0 -/* 802BD568 002BA4C8 83 CD A6 10 */ lwz r30, lbl_805A91D0@sda21(r13) +/* 802BD568 002BA4C8 83 CD A6 10 */ lwz r30, sBuckets__7Buckets@sda21(r13) /* 802BD56C 002BA4CC 48 00 01 14 */ b lbl_802BD680 lbl_802BD570: /* 802BD570 002BA4D0 A0 1C 00 00 */ lhz r0, 0(r28) @@ -8636,7 +8640,7 @@ lbl_802BD5E8: lbl_802BD618: /* 802BD618 002BA578 7E E3 BB 78 */ mr r3, r23 /* 802BD61C 002BA57C 38 81 00 08 */ addi r4, r1, 8 -/* 802BD620 002BA580 38 AD A5 FC */ addi r5, r13, lbl_805A91BC@sda21 +/* 802BD620 002BA580 38 AD A5 FC */ addi r5, r13, skNormalFlagNoUpdate@sda21 /* 802BD624 002BA584 48 04 9E 21 */ bl DrawSurface__10CCubeModelCFRC12CCubeSurfaceRC11CModelFlags /* 802BD628 002BA588 48 00 00 34 */ b lbl_802BD65C lbl_802BD62C: @@ -8857,7 +8861,7 @@ AddPlaneObject__13CCubeRendererFPCvRC6CAABoxRC6CPlanei: /* 802BD91C 002BA87C DB E1 00 50 */ stfd f31, 0x50(r1) /* 802BD920 002BA880 F3 E1 00 58 */ psq_st f31, 88(r1), 0, qr0 /* 802BD924 002BA884 BF 61 00 3C */ stmw r27, 0x3c(r1) -/* 802BD928 002BA888 88 0D A6 29 */ lbz r0, lbl_805A91E9@sda21(r13) +/* 802BD928 002BA888 88 0D A6 29 */ lbz r0, "init$6480"@sda21(r13) /* 802BD92C 002BA88C 7C 7B 1B 78 */ mr r27, r3 /* 802BD930 002BA890 7C 9C 23 78 */ mr r28, r4 /* 802BD934 002BA894 7C BD 2B 78 */ mr r29, r5 @@ -8866,13 +8870,13 @@ AddPlaneObject__13CCubeRendererFPCvRC6CAABoxRC6CPlanei: /* 802BD940 002BA8A0 7C FF 3B 78 */ mr r31, r7 /* 802BD944 002BA8A4 40 82 00 24 */ bne lbl_802BD968 /* 802BD948 002BA8A8 C0 22 C2 74 */ lfs f1, lbl_805ADF94@sda21(r2) -/* 802BD94C 002BA8AC 3C 60 80 48 */ lis r3, lbl_8047916C@ha +/* 802BD94C 002BA8AC 3C 60 80 48 */ lis r3, "sOptimalPlane$6479"@ha /* 802BD950 002BA8B0 38 00 00 01 */ li r0, 1 /* 802BD954 002BA8B4 C0 02 C2 70 */ lfs f0, lbl_805ADF90@sda21(r2) -/* 802BD958 002BA8B8 D4 23 91 6C */ stfsu f1, lbl_8047916C@l(r3) +/* 802BD958 002BA8B8 D4 23 91 6C */ stfsu f1, "sOptimalPlane$6479"@l(r3) /* 802BD95C 002BA8BC D0 23 00 04 */ stfs f1, 4(r3) /* 802BD960 002BA8C0 D0 03 00 08 */ stfs f0, 8(r3) -/* 802BD964 002BA8C4 98 0D A6 29 */ stb r0, lbl_805A91E9@sda21(r13) +/* 802BD964 002BA8C4 98 0D A6 29 */ stb r0, "init$6480"@sda21(r13) lbl_802BD968: /* 802BD968 002BA8C8 7F A4 EB 78 */ mr r4, r29 /* 802BD96C 002BA8CC 38 61 00 20 */ addi r3, r1, 0x20 @@ -8910,9 +8914,9 @@ lbl_802BD968: /* 802BD9EC 002BA94C FC 02 00 40 */ fcmpo cr0, f2, f0 /* 802BD9F0 002BA950 41 80 00 F8 */ blt lbl_802BDAE8 lbl_802BD9F4: -/* 802BD9F4 002BA954 3C 60 80 48 */ lis r3, lbl_8047916C@ha +/* 802BD9F4 002BA954 3C 60 80 48 */ lis r3, "sOptimalPlane$6479"@ha /* 802BD9F8 002BA958 C0 FE 00 00 */ lfs f7, 0(r30) -/* 802BD9FC 002BA95C C4 03 91 6C */ lfsu f0, lbl_8047916C@l(r3) +/* 802BD9FC 002BA95C C4 03 91 6C */ lfsu f0, "sOptimalPlane$6479"@l(r3) /* 802BDA00 002BA960 38 00 00 00 */ li r0, 0 /* 802BDA04 002BA964 FC 07 00 00 */ fcmpu cr0, f7, f0 /* 802BDA08 002BA968 40 82 00 28 */ bne lbl_802BDA30 @@ -9838,13 +9842,13 @@ __dt__13CCubeRendererFv: /* 802BE6AC 002BB60C 93 C1 00 28 */ stw r30, 0x28(r1) /* 802BE6B0 002BB610 7C 7E 1B 79 */ or. r30, r3, r3 /* 802BE6B4 002BB614 41 82 02 38 */ beq lbl_802BE8EC -/* 802BE6B8 002BB618 3C 60 80 3F */ lis r3, lbl_803EC5D8@ha +/* 802BE6B8 002BB618 3C 60 80 3F */ lis r3, __vt__13CCubeRenderer@ha /* 802BE6BC 002BB61C 38 00 00 00 */ li r0, 0 -/* 802BE6C0 002BB620 38 63 C5 D8 */ addi r3, r3, lbl_803EC5D8@l +/* 802BE6C0 002BB620 38 63 C5 D8 */ addi r3, r3, __vt__13CCubeRenderer@l /* 802BE6C4 002BB624 90 7E 00 00 */ stw r3, 0(r30) /* 802BE6C8 002BB628 38 63 01 0C */ addi r3, r3, 0x10c /* 802BE6CC 002BB62C 90 7E 00 04 */ stw r3, 4(r30) -/* 802BE6D0 002BB630 90 0D A5 F0 */ stw r0, lbl_805A91B0@sda21(r13) +/* 802BE6D0 002BB630 90 0D A5 F0 */ stw r0, sRenderer__13CCubeRenderer@sda21(r13) /* 802BE6D4 002BB634 48 00 17 89 */ bl Shutdown__7BucketsFv /* 802BE6D8 002BB638 48 09 40 49 */ bl sub_80352720 /* 802BE6DC 002BB63C 80 7E 03 14 */ lwz r3, 0x314(r30) @@ -10514,9 +10518,9 @@ __ct__13CCubeRendererFR12IObjectStoreR10COsContextR10CMemorySysR11CResFactory: /* 802BF080 002BBFE0 3C 60 80 3F */ lis r3, __vt__15IWeaponRenderer@ha /* 802BF084 002BBFE4 90 1F 00 00 */ stw r0, 0(r31) /* 802BF088 002BBFE8 38 03 C5 38 */ addi r0, r3, __vt__15IWeaponRenderer@l -/* 802BF08C 002BBFEC 3C 60 80 3F */ lis r3, lbl_803EC5D8@ha +/* 802BF08C 002BBFEC 3C 60 80 3F */ lis r3, __vt__13CCubeRenderer@ha /* 802BF090 002BBFF0 90 1F 00 04 */ stw r0, 4(r31) -/* 802BF094 002BBFF4 38 A3 C5 D8 */ addi r5, r3, lbl_803EC5D8@l +/* 802BF094 002BBFF4 38 A3 C5 D8 */ addi r5, r3, __vt__13CCubeRenderer@l /* 802BF098 002BBFF8 38 05 01 0C */ addi r0, r5, 0x10c /* 802BF09C 002BBFFC 38 7F 00 10 */ addi r3, r31, 0x10 /* 802BF0A0 002BC000 90 BF 00 00 */ stw r5, 0(r31) @@ -10687,7 +10691,7 @@ __ct__13CCubeRendererFR12IObjectStoreR10COsContextR10CMemorySysR11CResFactory: /* 802BF334 002BC294 4B FF F7 A5 */ bl sub_802bead8 /* 802BF338 002BC298 7F E3 FB 78 */ mr r3, r31 /* 802BF33C 002BC29C 4B FF F5 CD */ bl sub_802be908 -/* 802BF340 002BC2A0 93 ED A5 F0 */ stw r31, lbl_805A91B0@sda21(r13) +/* 802BF340 002BC2A0 93 ED A5 F0 */ stw r31, sRenderer__13CCubeRenderer@sda21(r13) /* 802BF344 002BC2A4 48 00 0B 31 */ bl Init__7BucketsFv /* 802BF348 002BC2A8 48 09 33 F9 */ bl sub_80352740 /* 802BF34C 002BC2AC 80 01 00 24 */ lwz r0, 0x24(r1) @@ -10720,7 +10724,7 @@ __ct__Q213CCubeRenderer13CAreaListItem: .global Clear__7BucketsFv Clear__7BucketsFv: -/* 802BF3AC 002BC30C 80 CD A6 0C */ lwz r6, lbl_805A91CC@sda21(r13) +/* 802BF3AC 002BC30C 80 CD A6 0C */ lwz r6, sData__7Buckets@sda21(r13) /* 802BF3B0 002BC310 38 60 00 00 */ li r3, 0 /* 802BF3B4 002BC314 80 A6 00 00 */ lwz r5, 0(r6) /* 802BF3B8 002BC318 2C 05 00 00 */ cmpwi r5, 0 @@ -10745,9 +10749,9 @@ lbl_802BF3F8: /* 802BF3F8 002BC358 42 00 00 00 */ bdnz lbl_802BF3F8 lbl_802BF3FC: /* 802BF3FC 002BC35C 38 80 00 00 */ li r4, 0 -/* 802BF400 002BC360 3C 60 80 47 */ lis r3, lbl_8046E20C@ha +/* 802BF400 002BC360 3C 60 80 47 */ lis r3, sBucketIndex__7Buckets@ha /* 802BF404 002BC364 90 86 00 00 */ stw r4, 0(r6) -/* 802BF408 002BC368 80 A3 E2 0C */ lwz r5, lbl_8046E20C@l(r3) +/* 802BF408 002BC368 80 A3 E2 0C */ lwz r5, sBucketIndex__7Buckets@l(r3) /* 802BF40C 002BC36C 2C 05 00 00 */ cmpwi r5, 0 /* 802BF410 002BC370 40 81 00 40 */ ble lbl_802BF450 /* 802BF414 002BC374 2C 05 00 08 */ cmpwi r5, 8 @@ -10769,10 +10773,10 @@ lbl_802BF43C: lbl_802BF44C: /* 802BF44C 002BC3AC 42 00 00 00 */ bdnz lbl_802BF44C lbl_802BF450: -/* 802BF450 002BC3B0 3C 60 80 47 */ lis r3, lbl_8046E20C@ha +/* 802BF450 002BC3B0 3C 60 80 47 */ lis r3, sBucketIndex__7Buckets@ha /* 802BF454 002BC3B4 38 80 00 00 */ li r4, 0 -/* 802BF458 002BC3B8 80 CD A6 1C */ lwz r6, lbl_805A91DC@sda21(r13) -/* 802BF45C 002BC3BC 90 83 E2 0C */ stw r4, lbl_8046E20C@l(r3) +/* 802BF458 002BC3B8 80 CD A6 1C */ lwz r6, sPlaneObjectData__7Buckets@sda21(r13) +/* 802BF45C 002BC3BC 90 83 E2 0C */ stw r4, sBucketIndex__7Buckets@l(r3) /* 802BF460 002BC3C0 80 A6 00 00 */ lwz r5, 0(r6) /* 802BF464 002BC3C4 2C 05 00 00 */ cmpwi r5, 0 /* 802BF468 002BC3C8 40 81 00 40 */ ble lbl_802BF4A8 @@ -10797,7 +10801,7 @@ lbl_802BF4A4: lbl_802BF4A8: /* 802BF4A8 002BC408 38 60 00 00 */ li r3, 0 /* 802BF4AC 002BC40C 90 66 00 00 */ stw r3, 0(r6) -/* 802BF4B0 002BC410 80 CD A6 20 */ lwz r6, lbl_805A91E0@sda21(r13) +/* 802BF4B0 002BC410 80 CD A6 20 */ lwz r6, sPlaneObjectBucket__7Buckets@sda21(r13) /* 802BF4B4 002BC414 80 A6 00 00 */ lwz r5, 0(r6) /* 802BF4B8 002BC418 2C 05 00 00 */ cmpwi r5, 0 /* 802BF4BC 002BC41C 40 81 00 40 */ ble lbl_802BF4FC @@ -10822,7 +10826,7 @@ lbl_802BF4F8: lbl_802BF4FC: /* 802BF4FC 002BC45C 38 00 00 00 */ li r0, 0 /* 802BF500 002BC460 90 06 00 00 */ stw r0, 0(r6) -/* 802BF504 002BC464 80 6D A6 10 */ lwz r3, lbl_805A91D0@sda21(r13) +/* 802BF504 002BC464 80 6D A6 10 */ lwz r3, sBuckets__7Buckets@sda21(r13) /* 802BF508 002BC468 38 C3 00 04 */ addi r6, r3, 4 /* 802BF50C 002BC46C 48 00 00 60 */ b lbl_802BF56C lbl_802BF510: @@ -10854,18 +10858,18 @@ lbl_802BF560: /* 802BF564 002BC4C4 90 06 00 00 */ stw r0, 0(r6) /* 802BF568 002BC4C8 38 C6 02 04 */ addi r6, r6, 0x204 lbl_802BF56C: -/* 802BF56C 002BC4CC 80 6D A6 10 */ lwz r3, lbl_805A91D0@sda21(r13) +/* 802BF56C 002BC4CC 80 6D A6 10 */ lwz r3, sBuckets__7Buckets@sda21(r13) /* 802BF570 002BC4D0 80 03 00 00 */ lwz r0, 0(r3) /* 802BF574 002BC4D4 1C 00 02 04 */ mulli r0, r0, 0x204 /* 802BF578 002BC4D8 7C 63 02 14 */ add r3, r3, r0 /* 802BF57C 002BC4DC 38 63 00 04 */ addi r3, r3, 4 /* 802BF580 002BC4E0 7C 06 18 40 */ cmplw r6, r3 /* 802BF584 002BC4E4 40 82 FF 8C */ bne lbl_802BF510 -/* 802BF588 002BC4E8 38 6D A6 04 */ addi r3, r13, lbl_805A91C4@sda21 -/* 802BF58C 002BC4EC C0 2D A6 04 */ lfs f1, lbl_805A91C4@sda21(r13) +/* 802BF588 002BC4E8 38 6D A6 04 */ addi r3, r13, skWorstMinMaxDistance__7Buckets@sda21 +/* 802BF58C 002BC4EC C0 2D A6 04 */ lfs f1, skWorstMinMaxDistance__7Buckets@sda21(r13) /* 802BF590 002BC4F0 C0 03 00 04 */ lfs f0, 4(r3) -/* 802BF594 002BC4F4 38 6D A6 14 */ addi r3, r13, lbl_805A91D4@sda21 -/* 802BF598 002BC4F8 D0 2D A6 14 */ stfs f1, lbl_805A91D4@sda21(r13) +/* 802BF594 002BC4F4 38 6D A6 14 */ addi r3, r13, sMinMaxDistance__7Buckets@sda21 +/* 802BF598 002BC4F8 D0 2D A6 14 */ stfs f1, sMinMaxDistance__7Buckets@sda21(r13) /* 802BF59C 002BC4FC D0 03 00 04 */ stfs f0, 4(r3) /* 802BF5A0 002BC500 4E 80 00 20 */ blr @@ -10881,8 +10885,8 @@ Sort__7BucketsFv: /* 802BF5C0 002BC520 DB A1 00 60 */ stfd f29, 0x60(r1) /* 802BF5C4 002BC524 F3 A1 00 68 */ psq_st f29, 104(r1), 0, qr0 /* 802BF5C8 002BC528 BF 01 00 40 */ stmw r24, 0x40(r1) -/* 802BF5CC 002BC52C 38 6D A6 14 */ addi r3, r13, lbl_805A91D4@sda21 -/* 802BF5D0 002BC530 C0 4D A6 14 */ lfs f2, lbl_805A91D4@sda21(r13) +/* 802BF5CC 002BC52C 38 6D A6 14 */ addi r3, r13, sMinMaxDistance__7Buckets@sda21 +/* 802BF5D0 002BC530 C0 4D A6 14 */ lfs f2, sMinMaxDistance__7Buckets@sda21(r13) /* 802BF5D4 002BC534 C0 23 00 04 */ lfs f1, 4(r3) /* 802BF5D8 002BC538 C0 0D 9A A0 */ lfs f0, lbl_805A8660@sda21(r13) /* 802BF5DC 002BC53C FF E0 10 50 */ fneg f31, f2 @@ -10898,14 +10902,14 @@ lbl_802BF5FC: /* 802BF5FC 002BC55C C3 A3 00 00 */ lfs f29, 0(r3) /* 802BF600 002BC560 38 C0 00 00 */ li r6, 0 /* 802BF604 002BC564 C0 02 C3 58 */ lfs f0, lbl_805AE078@sda21(r2) -/* 802BF608 002BC568 80 6D A6 1C */ lwz r3, lbl_805A91DC@sda21(r13) +/* 802BF608 002BC568 80 6D A6 1C */ lwz r3, sPlaneObjectData__7Buckets@sda21(r13) /* 802BF60C 002BC56C EC 00 07 72 */ fmuls f0, f0, f29 /* 802BF610 002BC570 C0 22 C2 70 */ lfs f1, lbl_805ADF90@sda21(r2) /* 802BF614 002BC574 38 E3 00 04 */ addi r7, r3, 4 /* 802BF618 002BC578 EF C1 00 24 */ fdivs f30, f1, f0 /* 802BF61C 002BC57C 48 00 00 40 */ b lbl_802BF65C lbl_802BF620: -/* 802BF620 002BC580 80 AD A6 20 */ lwz r5, lbl_805A91E0@sda21(r13) +/* 802BF620 002BC580 80 AD A6 20 */ lwz r5, sPlaneObjectBucket__7Buckets@sda21(r13) /* 802BF624 002BC584 80 05 00 00 */ lwz r0, 0(r5) /* 802BF628 002BC588 2C 00 00 08 */ cmpwi r0, 8 /* 802BF62C 002BC58C 40 80 00 28 */ bge lbl_802BF654 @@ -10923,19 +10927,19 @@ lbl_802BF654: /* 802BF654 002BC5B4 38 E7 00 40 */ addi r7, r7, 0x40 /* 802BF658 002BC5B8 38 C6 00 01 */ addi r6, r6, 1 lbl_802BF65C: -/* 802BF65C 002BC5BC 80 6D A6 1C */ lwz r3, lbl_805A91DC@sda21(r13) +/* 802BF65C 002BC5BC 80 6D A6 1C */ lwz r3, sPlaneObjectData__7Buckets@sda21(r13) /* 802BF660 002BC5C0 80 03 00 00 */ lwz r0, 0(r3) /* 802BF664 002BC5C4 54 00 30 32 */ slwi r0, r0, 6 /* 802BF668 002BC5C8 7C 63 02 14 */ add r3, r3, r0 /* 802BF66C 002BC5CC 38 63 00 04 */ addi r3, r3, 4 /* 802BF670 002BC5D0 7C 07 18 40 */ cmplw r7, r3 /* 802BF674 002BC5D4 40 82 FF AC */ bne lbl_802BF620 -/* 802BF678 002BC5D8 83 CD A6 20 */ lwz r30, lbl_805A91E0@sda21(r13) +/* 802BF678 002BC5D8 83 CD A6 20 */ lwz r30, sPlaneObjectBucket__7Buckets@sda21(r13) /* 802BF67C 002BC5DC 3B E0 00 32 */ li r31, 0x32 /* 802BF680 002BC5E0 80 1E 00 00 */ lwz r0, 0(r30) /* 802BF684 002BC5E4 2C 00 00 00 */ cmpwi r0, 0 /* 802BF688 002BC5E8 41 82 00 B0 */ beq lbl_802BF738 -/* 802BF68C 002BC5EC 88 0D A6 24 */ lbz r0, lbl_805A91E4@sda21(r13) +/* 802BF68C 002BC5EC 88 0D A6 24 */ lbz r0, "@4756"@sda21(r13) /* 802BF690 002BC5F0 38 7E 00 04 */ addi r3, r30, 4 /* 802BF694 002BC5F4 38 A1 00 0C */ addi r5, r1, 0xc /* 802BF698 002BC5F8 98 01 00 0C */ stb r0, 0xc(r1) @@ -10967,7 +10971,7 @@ lbl_802BF6FC: /* 802BF6FC 002BC65C 38 65 00 01 */ addi r3, r5, 1 /* 802BF700 002BC660 A0 06 00 00 */ lhz r0, 0(r6) /* 802BF704 002BC664 7C 9F 19 D6 */ mullw r4, r31, r3 -/* 802BF708 002BC668 80 6D A6 1C */ lwz r3, lbl_805A91DC@sda21(r13) +/* 802BF708 002BC668 80 6D A6 1C */ lwz r3, sPlaneObjectData__7Buckets@sda21(r13) /* 802BF70C 002BC66C 54 00 30 32 */ slwi r0, r0, 6 /* 802BF710 002BC670 38 C6 00 02 */ addi r6, r6, 2 /* 802BF714 002BC674 7C 63 02 14 */ add r3, r3, r0 @@ -10981,9 +10985,9 @@ lbl_802BF720: /* 802BF730 002BC690 7C 06 00 40 */ cmplw r6, r0 /* 802BF734 002BC694 40 82 FF C8 */ bne lbl_802BF6FC lbl_802BF738: -/* 802BF738 002BC698 80 6D A6 0C */ lwz r3, lbl_805A91CC@sda21(r13) -/* 802BF73C 002BC69C 83 AD A6 20 */ lwz r29, lbl_805A91E0@sda21(r13) -/* 802BF740 002BC6A0 83 8D A6 1C */ lwz r28, lbl_805A91DC@sda21(r13) +/* 802BF738 002BC698 80 6D A6 0C */ lwz r3, sData__7Buckets@sda21(r13) +/* 802BF73C 002BC69C 83 AD A6 20 */ lwz r29, sPlaneObjectBucket__7Buckets@sda21(r13) +/* 802BF740 002BC6A0 83 8D A6 1C */ lwz r28, sPlaneObjectData__7Buckets@sda21(r13) /* 802BF744 002BC6A4 3B C3 00 04 */ addi r30, r3, 4 /* 802BF748 002BC6A8 48 00 02 8C */ b lbl_802BF9D4 lbl_802BF74C: @@ -11160,7 +11164,7 @@ lbl_802BF98C: /* 802BF994 002BC8F4 3B 60 00 31 */ li r27, 0x31 lbl_802BF998: /* 802BF998 002BC8F8 1C 1B 02 04 */ mulli r0, r27, 0x204 -/* 802BF99C 002BC8FC 80 6D A6 10 */ lwz r3, lbl_805A91D0@sda21(r13) +/* 802BF99C 002BC8FC 80 6D A6 10 */ lwz r3, sBuckets__7Buckets@sda21(r13) /* 802BF9A0 002BC900 7C 83 02 14 */ add r4, r3, r0 /* 802BF9A4 002BC904 84 04 00 04 */ lwzu r0, 4(r4) /* 802BF9A8 002BC908 2C 00 00 80 */ cmpwi r0, 0x80 @@ -11177,16 +11181,16 @@ lbl_802BF9C4: lbl_802BF9D0: /* 802BF9D0 002BC930 3B DE 00 24 */ addi r30, r30, 0x24 lbl_802BF9D4: -/* 802BF9D4 002BC934 80 6D A6 0C */ lwz r3, lbl_805A91CC@sda21(r13) +/* 802BF9D4 002BC934 80 6D A6 0C */ lwz r3, sData__7Buckets@sda21(r13) /* 802BF9D8 002BC938 80 03 00 00 */ lwz r0, 0(r3) /* 802BF9DC 002BC93C 1C 00 00 24 */ mulli r0, r0, 0x24 /* 802BF9E0 002BC940 7C 63 02 14 */ add r3, r3, r0 /* 802BF9E4 002BC944 38 63 00 04 */ addi r3, r3, 4 /* 802BF9E8 002BC948 7C 1E 18 40 */ cmplw r30, r3 /* 802BF9EC 002BC94C 40 82 FD 60 */ bne lbl_802BF74C -/* 802BF9F0 002BC950 80 8D A6 10 */ lwz r4, lbl_805A91D0@sda21(r13) -/* 802BF9F4 002BC954 3C 60 80 47 */ lis r3, lbl_8046E20C@ha -/* 802BF9F8 002BC958 3B 63 E2 0C */ addi r27, r3, lbl_8046E20C@l +/* 802BF9F0 002BC950 80 8D A6 10 */ lwz r4, sBuckets__7Buckets@sda21(r13) +/* 802BF9F4 002BC954 3C 60 80 47 */ lis r3, sBucketIndex__7Buckets@ha +/* 802BF9F8 002BC958 3B 63 E2 0C */ addi r27, r3, sBucketIndex__7Buckets@l /* 802BF9FC 002BC95C 80 64 00 00 */ lwz r3, 0(r4) /* 802BFA00 002BC960 3B DB 00 04 */ addi r30, r27, 4 /* 802BFA04 002BC964 3B 43 FF FF */ addi r26, r3, -1 @@ -11195,7 +11199,7 @@ lbl_802BF9D4: lbl_802BFA10: /* 802BFA10 002BC970 80 1B 00 00 */ lwz r0, 0(r27) /* 802BFA14 002BC974 57 44 04 3E */ clrlwi r4, r26, 0x10 -/* 802BFA18 002BC978 80 6D A6 10 */ lwz r3, lbl_805A91D0@sda21(r13) +/* 802BFA18 002BC978 80 6D A6 10 */ lwz r3, sBuckets__7Buckets@sda21(r13) /* 802BFA1C 002BC97C 54 00 08 3C */ slwi r0, r0, 1 /* 802BFA20 002BC980 7C BE 02 15 */ add. r5, r30, r0 /* 802BFA24 002BC984 7C C3 FA 14 */ add r6, r3, r31 @@ -11209,7 +11213,7 @@ lbl_802BFA34: /* 802BFA40 002BC9A0 80 06 00 00 */ lwz r0, 0(r6) /* 802BFA44 002BC9A4 2C 00 00 00 */ cmpwi r0, 0 /* 802BFA48 002BC9A8 41 82 00 28 */ beq lbl_802BFA70 -/* 802BFA4C 002BC9AC 88 0D A6 28 */ lbz r0, lbl_805A91E8@sda21(r13) +/* 802BFA4C 002BC9AC 88 0D A6 28 */ lbz r0, "@4808"@sda21(r13) /* 802BFA50 002BC9B0 38 66 00 04 */ addi r3, r6, 4 /* 802BFA54 002BC9B4 38 A1 00 08 */ addi r5, r1, 8 /* 802BFA58 002BC9B8 98 01 00 08 */ stb r0, 8(r1) @@ -11232,7 +11236,7 @@ lbl_802BFA78: /* 802BFA94 002BC9F4 48 00 00 54 */ b lbl_802BFAE8 lbl_802BFA98: /* 802BFA98 002BC9F8 A0 07 00 00 */ lhz r0, 0(r7) -/* 802BFA9C 002BC9FC 80 6D A6 10 */ lwz r3, lbl_805A91D0@sda21(r13) +/* 802BFA9C 002BC9FC 80 6D A6 10 */ lwz r3, sBuckets__7Buckets@sda21(r13) /* 802BFAA0 002BCA00 54 00 30 32 */ slwi r0, r0, 6 /* 802BFAA4 002BCA04 7C 9C 02 14 */ add r4, r28, r0 /* 802BFAA8 002BCA08 A0 04 00 28 */ lhz r0, 0x28(r4) @@ -11279,7 +11283,7 @@ InsertPlaneObject__7BucketsFffRC6CAABoxbRC6CPlaneb13EDrawableTypePCv: /* 802BFB34 002BCA94 93 E1 00 4C */ stw r31, 0x4c(r1) /* 802BFB38 002BCA98 93 C1 00 48 */ stw r30, 0x48(r1) /* 802BFB3C 002BCA9C 7C 9E 23 78 */ mr r30, r4 -/* 802BFB40 002BCAA0 81 4D A6 1C */ lwz r10, lbl_805A91DC@sda21(r13) +/* 802BFB40 002BCAA0 81 4D A6 1C */ lwz r10, sPlaneObjectData__7Buckets@sda21(r13) /* 802BFB44 002BCAA4 80 0A 00 00 */ lwz r0, 0(r10) /* 802BFB48 002BCAA8 7D 5F 53 78 */ mr r31, r10 /* 802BFB4C 002BCAAC 2C 00 00 08 */ cmpwi r0, 8 @@ -11415,7 +11419,7 @@ __ct__20CDrawablePlaneObjectF13EDrawableTypeffRC6CAABoxbRC6CPlanebPCv: .global Insert__7BucketsFRC9CVector3fRC6CAABox13EDrawableTypePCvRC6CPlaneUs Insert__7BucketsFRC9CVector3fRC6CAABox13EDrawableTypePCvRC6CPlaneUs: /* 802BFD18 002BCC78 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 802BFD1C 002BCC7C 81 4D A6 0C */ lwz r10, lbl_805A91CC@sda21(r13) +/* 802BFD1C 002BCC7C 81 4D A6 0C */ lwz r10, sData__7Buckets@sda21(r13) /* 802BFD20 002BCC80 80 0A 00 00 */ lwz r0, 0(r10) /* 802BFD24 002BCC84 2C 00 02 00 */ cmpwi r0, 0x200 /* 802BFD28 002BCC88 41 82 01 2C */ beq lbl_802BFE54 @@ -11467,20 +11471,20 @@ lbl_802BFDDC: /* 802BFDDC 002BCD3C 80 6A 00 00 */ lwz r3, 0(r10) /* 802BFDE0 002BCD40 38 03 00 01 */ addi r0, r3, 1 /* 802BFDE4 002BCD44 90 0A 00 00 */ stw r0, 0(r10) -/* 802BFDE8 002BCD48 C0 2D A6 14 */ lfs f1, lbl_805A91D4@sda21(r13) +/* 802BFDE8 002BCD48 C0 2D A6 14 */ lfs f1, sMinMaxDistance__7Buckets@sda21(r13) /* 802BFDEC 002BCD4C C0 01 00 08 */ lfs f0, 8(r1) /* 802BFDF0 002BCD50 FC 01 00 40 */ fcmpo cr0, f1, f0 /* 802BFDF4 002BCD54 40 80 00 0C */ bge lbl_802BFE00 -/* 802BFDF8 002BCD58 38 8D A6 14 */ addi r4, r13, lbl_805A91D4@sda21 +/* 802BFDF8 002BCD58 38 8D A6 14 */ addi r4, r13, sMinMaxDistance__7Buckets@sda21 /* 802BFDFC 002BCD5C 48 00 00 08 */ b lbl_802BFE04 lbl_802BFE00: /* 802BFE00 002BCD60 38 81 00 08 */ addi r4, r1, 8 lbl_802BFE04: -/* 802BFE04 002BCD64 38 6D A6 14 */ addi r3, r13, lbl_805A91D4@sda21 +/* 802BFE04 002BCD64 38 6D A6 14 */ addi r3, r13, sMinMaxDistance__7Buckets@sda21 /* 802BFE08 002BCD68 C0 44 00 00 */ lfs f2, 0(r4) /* 802BFE0C 002BCD6C C0 21 00 08 */ lfs f1, 8(r1) /* 802BFE10 002BCD70 C0 03 00 04 */ lfs f0, 4(r3) -/* 802BFE14 002BCD74 D0 4D A6 14 */ stfs f2, lbl_805A91D4@sda21(r13) +/* 802BFE14 002BCD74 D0 4D A6 14 */ stfs f2, sMinMaxDistance__7Buckets@sda21(r13) /* 802BFE18 002BCD78 FC 01 00 40 */ fcmpo cr0, f1, f0 /* 802BFE1C 002BCD7C 40 80 00 0C */ bge lbl_802BFE28 /* 802BFE20 002BCD80 38 63 00 04 */ addi r3, r3, 4 @@ -11489,7 +11493,7 @@ lbl_802BFE28: /* 802BFE28 002BCD88 38 61 00 08 */ addi r3, r1, 8 lbl_802BFE2C: /* 802BFE2C 002BCD8C C0 03 00 00 */ lfs f0, 0(r3) -/* 802BFE30 002BCD90 38 6D A6 14 */ addi r3, r13, lbl_805A91D4@sda21 +/* 802BFE30 002BCD90 38 6D A6 14 */ addi r3, r13, sMinMaxDistance__7Buckets@sda21 /* 802BFE34 002BCD94 38 8A 00 04 */ addi r4, r10, 4 /* 802BFE38 002BCD98 D0 03 00 04 */ stfs f0, 4(r3) /* 802BFE3C 002BCD9C 80 6A 00 00 */ lwz r3, 0(r10) @@ -11505,45 +11509,45 @@ lbl_802BFE54: .global Shutdown__7BucketsFv Shutdown__7BucketsFv: /* 802BFE5C 002BCDBC 38 00 00 00 */ li r0, 0 -/* 802BFE60 002BCDC0 90 0D A6 0C */ stw r0, lbl_805A91CC@sda21(r13) -/* 802BFE64 002BCDC4 90 0D A6 10 */ stw r0, lbl_805A91D0@sda21(r13) -/* 802BFE68 002BCDC8 90 0D A6 1C */ stw r0, lbl_805A91DC@sda21(r13) -/* 802BFE6C 002BCDCC 90 0D A6 20 */ stw r0, lbl_805A91E0@sda21(r13) +/* 802BFE60 002BCDC0 90 0D A6 0C */ stw r0, sData__7Buckets@sda21(r13) +/* 802BFE64 002BCDC4 90 0D A6 10 */ stw r0, sBuckets__7Buckets@sda21(r13) +/* 802BFE68 002BCDC8 90 0D A6 1C */ stw r0, sPlaneObjectData__7Buckets@sda21(r13) +/* 802BFE6C 002BCDCC 90 0D A6 20 */ stw r0, sPlaneObjectBucket__7Buckets@sda21(r13) /* 802BFE70 002BCDD0 4E 80 00 20 */ blr .global Init__7BucketsFv Init__7BucketsFv: -/* 802BFE74 002BCDD4 3C 60 80 47 */ lis r3, lbl_8046E274@ha +/* 802BFE74 002BCDD4 3C 60 80 47 */ lis r3, "sDataHolder$4374"@ha /* 802BFE78 002BCDD8 94 21 FD F0 */ stwu r1, -0x210(r1) -/* 802BFE7C 002BCDDC 34 83 E2 74 */ addic. r4, r3, lbl_8046E274@l +/* 802BFE7C 002BCDDC 34 83 E2 74 */ addic. r4, r3, "sDataHolder$4374"@l /* 802BFE80 002BCDE0 41 82 00 0C */ beq lbl_802BFE8C /* 802BFE84 002BCDE4 38 00 00 00 */ li r0, 0 /* 802BFE88 002BCDE8 90 04 00 00 */ stw r0, 0(r4) lbl_802BFE8C: -/* 802BFE8C 002BCDEC 3C 60 80 47 */ lis r3, lbl_80472A7C@ha -/* 802BFE90 002BCDF0 90 8D A6 0C */ stw r4, lbl_805A91CC@sda21(r13) -/* 802BFE94 002BCDF4 34 83 2A 7C */ addic. r4, r3, lbl_80472A7C@l +/* 802BFE8C 002BCDEC 3C 60 80 47 */ lis r3, "sBucketsHolder$4375"@ha +/* 802BFE90 002BCDF0 90 8D A6 0C */ stw r4, sData__7Buckets@sda21(r13) +/* 802BFE94 002BCDF4 34 83 2A 7C */ addic. r4, r3, "sBucketsHolder$4375"@l /* 802BFE98 002BCDF8 41 82 00 0C */ beq lbl_802BFEA4 /* 802BFE9C 002BCDFC 38 00 00 00 */ li r0, 0 /* 802BFEA0 002BCE00 90 04 00 00 */ stw r0, 0(r4) lbl_802BFEA4: -/* 802BFEA4 002BCE04 3C 60 80 48 */ lis r3, lbl_80478F4C@ha -/* 802BFEA8 002BCE08 90 8D A6 10 */ stw r4, lbl_805A91D0@sda21(r13) -/* 802BFEAC 002BCE0C 34 83 8F 4C */ addic. r4, r3, lbl_80478F4C@l +/* 802BFEA4 002BCE04 3C 60 80 48 */ lis r3, "sPlaneObjectDataHolder$4376"@ha +/* 802BFEA8 002BCE08 90 8D A6 10 */ stw r4, sBuckets__7Buckets@sda21(r13) +/* 802BFEAC 002BCE0C 34 83 8F 4C */ addic. r4, r3, "sPlaneObjectDataHolder$4376"@l /* 802BFEB0 002BCE10 41 82 00 0C */ beq lbl_802BFEBC /* 802BFEB4 002BCE14 38 00 00 00 */ li r0, 0 /* 802BFEB8 002BCE18 90 04 00 00 */ stw r0, 0(r4) lbl_802BFEBC: -/* 802BFEBC 002BCE1C 3C 60 80 48 */ lis r3, lbl_80479154@ha -/* 802BFEC0 002BCE20 90 8D A6 1C */ stw r4, lbl_805A91DC@sda21(r13) -/* 802BFEC4 002BCE24 34 63 91 54 */ addic. r3, r3, lbl_80479154@l +/* 802BFEBC 002BCE1C 3C 60 80 48 */ lis r3, "sPlaneObjectBucketHolder$4377"@ha +/* 802BFEC0 002BCE20 90 8D A6 1C */ stw r4, sPlaneObjectData__7Buckets@sda21(r13) +/* 802BFEC4 002BCE24 34 63 91 54 */ addic. r3, r3, "sPlaneObjectBucketHolder$4377"@l /* 802BFEC8 002BCE28 41 82 00 0C */ beq lbl_802BFED4 /* 802BFECC 002BCE2C 38 00 00 00 */ li r0, 0 /* 802BFED0 002BCE30 90 03 00 00 */ stw r0, 0(r3) lbl_802BFED4: -/* 802BFED4 002BCE34 90 6D A6 20 */ stw r3, lbl_805A91E0@sda21(r13) +/* 802BFED4 002BCE34 90 6D A6 20 */ stw r3, sPlaneObjectBucket__7Buckets@sda21(r13) /* 802BFED8 002BCE38 38 80 00 00 */ li r4, 0 -/* 802BFEDC 002BCE3C 81 4D A6 10 */ lwz r10, lbl_805A91D0@sda21(r13) +/* 802BFEDC 002BCE3C 81 4D A6 10 */ lwz r10, sBuckets__7Buckets@sda21(r13) /* 802BFEE0 002BCE40 90 81 00 08 */ stw r4, 8(r1) /* 802BFEE4 002BCE44 80 6A 00 00 */ lwz r3, 0(r10) /* 802BFEE8 002BCE48 2C 03 00 32 */ cmpwi r3, 0x32 @@ -11606,13 +11610,13 @@ lbl_802BFF9C: lbl_802BFFAC: /* 802BFFAC 002BCF0C 42 00 00 00 */ bdnz lbl_802BFFAC lbl_802BFFB0: -/* 802BFFB0 002BCF10 38 6D A6 04 */ addi r3, r13, lbl_805A91C4@sda21 -/* 802BFFB4 002BCF14 C0 2D A6 04 */ lfs f1, lbl_805A91C4@sda21(r13) +/* 802BFFB0 002BCF10 38 6D A6 04 */ addi r3, r13, skWorstMinMaxDistance__7Buckets@sda21 +/* 802BFFB4 002BCF14 C0 2D A6 04 */ lfs f1, skWorstMinMaxDistance__7Buckets@sda21(r13) /* 802BFFB8 002BCF18 C0 03 00 04 */ lfs f0, 4(r3) /* 802BFFBC 002BCF1C 38 00 00 00 */ li r0, 0 -/* 802BFFC0 002BCF20 38 6D A6 14 */ addi r3, r13, lbl_805A91D4@sda21 +/* 802BFFC0 002BCF20 38 6D A6 14 */ addi r3, r13, sMinMaxDistance__7Buckets@sda21 /* 802BFFC4 002BCF24 90 01 00 08 */ stw r0, 8(r1) -/* 802BFFC8 002BCF28 D0 2D A6 14 */ stfs f1, lbl_805A91D4@sda21(r13) +/* 802BFFC8 002BCF28 D0 2D A6 14 */ stfs f1, sMinMaxDistance__7Buckets@sda21(r13) /* 802BFFCC 002BCF2C D0 03 00 04 */ stfs f0, 4(r3) /* 802BFFD0 002BCF30 38 21 02 10 */ addi r1, r1, 0x210 /* 802BFFD4 002BCF34 4E 80 00 20 */ blr @@ -11648,21 +11652,21 @@ sub_802c0008: .global sub_802c0034 sub_802c0034: -/* 802C0034 002BCF94 3C 60 80 48 */ lis r3, lbl_80479178@ha -/* 802C0038 002BCF98 38 63 91 78 */ addi r3, r3, lbl_80479178@l +/* 802C0034 002BCF94 3C 60 80 48 */ lis r3, "sAllocSpace$9000"@ha +/* 802C0038 002BCF98 38 63 91 78 */ addi r3, r3, "sAllocSpace$9000"@l /* 802C003C 002BCF9C 4E 80 00 20 */ blr .global sub_802c0040 sub_802c0040: -/* 802C0040 002BCFA0 88 0D A6 34 */ lbz r0, lbl_805A91F4@sda21(r13) +/* 802C0040 002BCFA0 88 0D A6 34 */ lbz r0, "init$9006"@sda21(r13) /* 802C0044 002BCFA4 7C 00 07 75 */ extsb. r0, r0 /* 802C0048 002BCFA8 40 82 00 14 */ bne lbl_802C005C /* 802C004C 002BCFAC 38 60 00 00 */ li r3, 0 /* 802C0050 002BCFB0 38 00 00 01 */ li r0, 1 -/* 802C0054 002BCFB4 90 6D A6 30 */ stw r3, lbl_805A91F0@sda21(r13) -/* 802C0058 002BCFB8 98 0D A6 34 */ stb r0, lbl_805A91F4@sda21(r13) +/* 802C0054 002BCFB4 90 6D A6 30 */ stw r3, "sReferenceCount$9005"@sda21(r13) +/* 802C0058 002BCFB8 98 0D A6 34 */ stb r0, "init$9006"@sda21(r13) lbl_802C005C: -/* 802C005C 002BCFBC 38 6D A6 30 */ addi r3, r13, lbl_805A91F0@sda21 +/* 802C005C 002BCFBC 38 6D A6 30 */ addi r3, r13, "sReferenceCount$9005"@sda21 /* 802C0060 002BCFC0 4E 80 00 20 */ blr .global sub_802c0064 @@ -11705,7 +11709,7 @@ lbl_802C00B4: /* 802C00EC 002BD04C 3B FF FF FE */ addi r31, r31, -2 /* 802C00F0 002BD050 54 04 32 B2 */ rlwinm r4, r0, 6, 0xa, 0x19 lbl_802C00F4: -/* 802C00F4 002BD054 80 6D A6 1C */ lwz r3, lbl_805A91DC@sda21(r13) +/* 802C00F4 002BD054 80 6D A6 1C */ lwz r3, sPlaneObjectData__7Buckets@sda21(r13) /* 802C00F8 002BD058 38 A3 00 04 */ addi r5, r3, 4 /* 802C00FC 002BD05C 7C C5 22 14 */ add r6, r5, r4 /* 802C0100 002BD060 48 00 00 08 */ b lbl_802C0108 @@ -12230,7 +12234,7 @@ lbl_802C07E0: lbl_802C07EC: /* 802C07EC 002BD74C 7C 03 58 40 */ cmplw r3, r11 /* 802C07F0 002BD750 40 80 00 2C */ bge lbl_802C081C -/* 802C07F4 002BD754 80 8D A6 1C */ lwz r4, lbl_805A91DC@sda21(r13) +/* 802C07F4 002BD754 80 8D A6 1C */ lwz r4, sPlaneObjectData__7Buckets@sda21(r13) /* 802C07F8 002BD758 A0 EA 00 00 */ lhz r7, 0(r10) /* 802C07FC 002BD75C 38 A4 00 04 */ addi r5, r4, 4 /* 802C0800 002BD760 54 E0 32 B2 */ rlwinm r0, r7, 6, 0xa, 0x19 @@ -12364,7 +12368,7 @@ lbl_802C098C: .global sub_802c0994 sub_802c0994: -/* 802C0994 002BD8F4 80 CD A6 1C */ lwz r6, lbl_805A91DC@sda21(r13) +/* 802C0994 002BD8F4 80 CD A6 1C */ lwz r6, sPlaneObjectData__7Buckets@sda21(r13) /* 802C0998 002BD8F8 A1 24 00 00 */ lhz r9, 0(r4) /* 802C099C 002BD8FC A1 03 00 00 */ lhz r8, 0(r3) /* 802C09A0 002BD900 38 E6 00 04 */ addi r7, r6, 4 @@ -12379,7 +12383,7 @@ sub_802c0994: /* 802C09C4 002BD924 B1 23 00 00 */ sth r9, 0(r3) /* 802C09C8 002BD928 B1 04 00 00 */ sth r8, 0(r4) lbl_802C09CC: -/* 802C09CC 002BD92C 80 CD A6 1C */ lwz r6, lbl_805A91DC@sda21(r13) +/* 802C09CC 002BD92C 80 CD A6 1C */ lwz r6, sPlaneObjectData__7Buckets@sda21(r13) /* 802C09D0 002BD930 A1 25 00 00 */ lhz r9, 0(r5) /* 802C09D4 002BD934 A1 44 00 00 */ lhz r10, 0(r4) /* 802C09D8 002BD938 39 06 00 04 */ addi r8, r6, 4 @@ -12392,7 +12396,7 @@ lbl_802C09CC: /* 802C09F4 002BD954 FC 01 00 40 */ fcmpo cr0, f1, f0 /* 802C09F8 002BD958 4C 80 00 20 */ bgelr /* 802C09FC 002BD95C B1 45 00 00 */ sth r10, 0(r5) -/* 802C0A00 002BD960 80 AD A6 1C */ lwz r5, lbl_805A91DC@sda21(r13) +/* 802C0A00 002BD960 80 AD A6 1C */ lwz r5, sPlaneObjectData__7Buckets@sda21(r13) /* 802C0A04 002BD964 A1 03 00 00 */ lhz r8, 0(r3) /* 802C0A08 002BD968 38 E5 00 04 */ addi r7, r5, 4 /* 802C0A0C 002BD96C 55 00 32 B2 */ rlwinm r0, r8, 6, 0xa, 0x19 @@ -12431,13 +12435,13 @@ __sinit_CCubeRenderer_cpp: /* 802C0A80 002BD9E0 89 21 00 10 */ lbz r9, 0x10(r1) /* 802C0A84 002BD9E4 38 00 00 03 */ li r0, 3 /* 802C0A88 002BD9E8 89 01 00 11 */ lbz r8, 0x11(r1) -/* 802C0A8C 002BD9EC 38 ED A5 F4 */ addi r7, r13, lbl_805A91B4@sda21 +/* 802C0A8C 002BD9EC 38 ED A5 F4 */ addi r7, r13, skNormalFlag@sda21 /* 802C0A90 002BD9F0 A0 C1 00 12 */ lhz r6, 0x12(r1) /* 802C0A94 002BD9F4 FC 40 08 90 */ fmr f2, f1 /* 802C0A98 002BD9F8 80 A1 00 14 */ lwz r5, 0x14(r1) /* 802C0A9C 002BD9FC FC 60 08 90 */ fmr f3, f1 /* 802C0AA0 002BDA00 FC 80 08 90 */ fmr f4, f1 -/* 802C0AA4 002BDA04 99 2D A5 F4 */ stb r9, lbl_805A91B4@sda21(r13) +/* 802C0AA4 002BDA04 99 2D A5 F4 */ stb r9, skNormalFlag@sda21(r13) /* 802C0AA8 002BDA08 38 61 00 0C */ addi r3, r1, 0xc /* 802C0AAC 002BDA0C 99 07 00 01 */ stb r8, 1(r7) /* 802C0AB0 002BDA10 B0 C7 00 02 */ sth r6, 2(r7) @@ -12449,31 +12453,31 @@ __sinit_CCubeRenderer_cpp: /* 802C0AC8 002BDA28 A0 01 00 0A */ lhz r0, 0xa(r1) /* 802C0ACC 002BDA2C 3C 80 80 2C */ lis r4, sub_802c0b50@ha /* 802C0AD0 002BDA30 89 41 00 08 */ lbz r10, 8(r1) -/* 802C0AD4 002BDA34 3C A0 80 47 */ lis r5, lbl_8046E200@ha +/* 802C0AD4 002BDA34 3C A0 80 47 */ lis r5, "@4370"@ha /* 802C0AD8 002BDA38 54 00 00 3A */ rlwinm r0, r0, 0, 0, 0x1d /* 802C0ADC 002BDA3C C0 2D 9A 98 */ lfs f1, lbl_805A8658@sda21(r13) /* 802C0AE0 002BDA40 60 07 00 01 */ ori r7, r0, 1 -/* 802C0AE4 002BDA44 39 0D A5 FC */ addi r8, r13, lbl_805A91BC@sda21 +/* 802C0AE4 002BDA44 39 0D A5 FC */ addi r8, r13, skNormalFlagNoUpdate@sda21 /* 802C0AE8 002BDA48 89 21 00 09 */ lbz r9, 9(r1) /* 802C0AEC 002BDA4C 38 00 00 00 */ li r0, 0 /* 802C0AF0 002BDA50 80 C1 00 0C */ lwz r6, 0xc(r1) -/* 802C0AF4 002BDA54 3C 60 80 47 */ lis r3, lbl_8046E20C@ha +/* 802C0AF4 002BDA54 3C 60 80 47 */ lis r3, sBucketIndex__7Buckets@ha /* 802C0AF8 002BDA58 C0 0D 9A 9C */ lfs f0, lbl_805A865C@sda21(r13) -/* 802C0AFC 002BDA5C 3B ED A6 04 */ addi r31, r13, lbl_805A91C4@sda21 -/* 802C0B00 002BDA60 99 4D A5 FC */ stb r10, lbl_805A91BC@sda21(r13) +/* 802C0AFC 002BDA5C 3B ED A6 04 */ addi r31, r13, skWorstMinMaxDistance__7Buckets@sda21 +/* 802C0B00 002BDA60 99 4D A5 FC */ stb r10, skNormalFlagNoUpdate@sda21(r13) /* 802C0B04 002BDA64 38 84 0B 50 */ addi r4, r4, sub_802c0b50@l -/* 802C0B08 002BDA68 38 A5 E2 00 */ addi r5, r5, lbl_8046E200@l +/* 802C0B08 002BDA68 38 A5 E2 00 */ addi r5, r5, "@4370"@l /* 802C0B0C 002BDA6C 99 28 00 01 */ stb r9, 1(r8) /* 802C0B10 002BDA70 B0 E8 00 02 */ sth r7, 2(r8) /* 802C0B14 002BDA74 90 C8 00 04 */ stw r6, 4(r8) -/* 802C0B18 002BDA78 D0 2D A6 04 */ stfs f1, lbl_805A91C4@sda21(r13) +/* 802C0B18 002BDA78 D0 2D A6 04 */ stfs f1, skWorstMinMaxDistance__7Buckets@sda21(r13) /* 802C0B1C 002BDA7C D0 1F 00 04 */ stfs f0, 4(r31) -/* 802C0B20 002BDA80 94 03 E2 0C */ stwu r0, lbl_8046E20C@l(r3) +/* 802C0B20 002BDA80 94 03 E2 0C */ stwu r0, sBucketIndex__7Buckets@l(r3) /* 802C0B24 002BDA84 48 0C 8B 69 */ bl __register_global_object -/* 802C0B28 002BDA88 C0 2D A6 04 */ lfs f1, lbl_805A91C4@sda21(r13) -/* 802C0B2C 002BDA8C 38 6D A6 14 */ addi r3, r13, lbl_805A91D4@sda21 +/* 802C0B28 002BDA88 C0 2D A6 04 */ lfs f1, skWorstMinMaxDistance__7Buckets@sda21(r13) +/* 802C0B2C 002BDA8C 38 6D A6 14 */ addi r3, r13, sMinMaxDistance__7Buckets@sda21 /* 802C0B30 002BDA90 C0 1F 00 04 */ lfs f0, 4(r31) -/* 802C0B34 002BDA94 D0 2D A6 14 */ stfs f1, lbl_805A91D4@sda21(r13) +/* 802C0B34 002BDA94 D0 2D A6 14 */ stfs f1, sMinMaxDistance__7Buckets@sda21(r13) /* 802C0B38 002BDA98 D0 03 00 04 */ stfs f0, 4(r3) /* 802C0B3C 002BDA9C 83 E1 00 1C */ lwz r31, 0x1c(r1) /* 802C0B40 002BDAA0 80 01 00 24 */ lwz r0, 0x24(r1) diff --git a/asm/MetroidPrime/CCredits.s b/asm/MetroidPrime/CCredits.s index 697b800d..4b3a89c2 100644 --- a/asm/MetroidPrime/CCredits.s +++ b/asm/MetroidPrime/CCredits.s @@ -3107,12 +3107,21 @@ lbl_8002797C: /* 80027A3C 0002499C 48 31 93 49 */ bl Lock__6CTokenFv /* 80027A40 000249A0 80 1F 00 18 */ lwz r0, 0x18(r31) /* 80027A44 000249A4 38 E0 00 00 */ li r7, 0 +.if version >= 2 +/* 80027ABC 00024A1C 2C 00 00 00 */ cmpwi r0, 0 +/* 80027AC0 00024A20 41 82 00 14 */ beq lbl_80027A60 +/* 80027AC4 00024A24 41 80 00 1C */ blt lbl_80027A6C +/* 80027AC8 00024A28 2C 00 00 03 */ cmpwi r0, 3 +/* 80027A58 000249B8 40 80 00 08 */ bge lbl_80027A6C +/* 80027A5C 000249BC 48 00 00 10 */ b lbl_80027A68 +.else /* 80027A48 000249A8 2C 00 00 02 */ cmpwi r0, 2 /* 80027A4C 000249AC 41 82 00 1C */ beq lbl_80027A68 /* 80027A50 000249B0 40 80 00 1C */ bge lbl_80027A6C /* 80027A54 000249B4 2C 00 00 00 */ cmpwi r0, 0 /* 80027A58 000249B8 40 80 00 08 */ bge lbl_80027A60 /* 80027A5C 000249BC 48 00 00 10 */ b lbl_80027A6C +.endif lbl_80027A60: /* 80027A60 000249C0 38 E0 00 00 */ li r7, 0 /* 80027A64 000249C4 48 00 00 08 */ b lbl_80027A6C diff --git a/asm/MetroidPrime/CFluidPlaneCPU.s b/asm/MetroidPrime/CFluidPlaneCPU.s index 96c16b23..dd1cc047 100644 --- a/asm/MetroidPrime/CFluidPlaneCPU.s +++ b/asm/MetroidPrime/CFluidPlaneCPU.s @@ -1016,7 +1016,7 @@ lbl_8019A64C: lbl_8019A684: /* 8019A684 001975E4 88 12 00 1C */ lbz r0, 0x1c(r18) /* 8019A688 001975E8 3B 20 00 00 */ li r25, 0 -/* 8019A68C 001975EC 80 6D A5 F0 */ lwz r3, lbl_805A91B0@sda21(r13) +/* 8019A68C 001975EC 80 6D A5 F0 */ lwz r3, sRenderer__13CCubeRenderer@sda21(r13) /* 8019A690 001975F0 3B 00 00 00 */ li r24, 0 /* 8019A694 001975F4 28 00 00 00 */ cmplwi r0, 0 /* 8019A698 001975F8 39 C3 00 E4 */ addi r14, r3, 0xe4 diff --git a/asm/MetroidPrime/CFrontEndUI.s b/asm/MetroidPrime/CFrontEndUI.s index 028f9960..062b3049 100644 --- a/asm/MetroidPrime/CFrontEndUI.s +++ b/asm/MetroidPrime/CFrontEndUI.s @@ -127,12 +127,16 @@ MetroidBuildInfo: .ascii "!#$MetroidBuildInfo!#$" .global BuildString BuildString: -.if version == 1 +.if version == 2 + .asciz "Build v1.097 12/19/2002 16:03:43" + .asciz "AD" +.elseif version == 1 .asciz "Build v1.093 11/5/2002 19:50:01" + .asciz "PAD" .else .asciz "Build v1.088 10/29/2002 2:21:25" -.endif .asciz "PAD" +.endif .balign 4 .global lbl_803CC5C4 diff --git a/asm/MetroidPrime/CGBASupport.s b/asm/MetroidPrime/CGBASupport.s index 7ea31151..62dfbd7e 100644 --- a/asm/MetroidPrime/CGBASupport.s +++ b/asm/MetroidPrime/CGBASupport.s @@ -3,18 +3,17 @@ .section .data .balign 8 -.global lbl_803E8C18 -lbl_803E8C18: +Update_jumptable: # ROM: 0x3E5C18 - .4byte lbl_80248960 - .4byte lbl_80248B54 - .4byte lbl_802489EC - .4byte lbl_802489FC - .4byte lbl_80248A80 - .4byte lbl_80248AB0 - .4byte lbl_80248AF8 - .4byte lbl_80248B54 - .4byte lbl_80248B54 + .4byte Update_case0 + .4byte Update_default + .4byte Update_case2 + .4byte Update_case3 + .4byte Update_case4 + .4byte Update_case5 + .4byte Update_case6 + .4byte Update_default + .4byte Update_default .4byte 0 .section .sdata @@ -39,6 +38,266 @@ lbl_805A9110: .section .text, "ax" +.if version == 2 + +.global PollResponse__11CGBASupportFv +PollResponse__11CGBASupportFv: +/* 80248648 002455A8 94 21 FF D0 */ stwu r1, -0x30(r1) +/* 8024864C 002455AC 7C 08 02 A6 */ mflr r0 +/* 80248650 002455B0 90 01 00 34 */ stw r0, 0x34(r1) +/* 80248654 002455B4 38 81 00 08 */ addi r4, r1, 0x8 +/* 80248658 002455B8 93 E1 00 2C */ stw r31, 0x2c(r1) +/* 8024865C 002455BC 7C 7F 1B 78 */ mr r31, r3 +/* 80248660 002455C0 93 C1 00 28 */ stw r30, 0x28(r1) +/* 80248664 002455C4 93 A1 00 24 */ stw r29, 0x24(r1) +/* 80248668 002455C8 93 81 00 20 */ stw r28, 0x20(r1) +/* 8024866C 002455CC 80 63 00 40 */ lwz r3, 0x40(r3) +/* 80248670 002455D0 48 18 12 DD */ bl GBAReset +/* 80248674 002455D4 2C 03 00 01 */ cmpwi r3, 0x1 +/* 80248678 002455D8 40 82 00 20 */ bne lbl_80248698 +/* 8024867C 002455DC 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 80248680 002455E0 38 81 00 08 */ addi r4, r1, 0x8 +/* 80248684 002455E4 48 18 12 C9 */ bl GBAReset +/* 80248688 002455E8 2C 03 00 01 */ cmpwi r3, 0x1 +/* 8024868C 002455EC 40 82 00 0C */ bne lbl_80248698 +/* 80248690 002455F0 38 60 00 00 */ li r3, 0x0 +/* 80248694 002455F4 48 00 03 00 */ b lbl_80248994 +lbl_80248698: +/* 80248698 002455F8 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 8024869C 002455FC 38 81 00 08 */ addi r4, r1, 0x8 +/* 802486A0 00245600 48 18 11 B9 */ bl GBAGetStatus +/* 802486A4 00245604 2C 03 00 01 */ cmpwi r3, 0x1 +/* 802486A8 00245608 40 82 00 0C */ bne lbl_802486B4 +/* 802486AC 0024560C 38 60 00 00 */ li r3, 0x0 +/* 802486B0 00245610 48 00 02 E4 */ b lbl_80248994 +lbl_802486B4: +/* 802486B4 00245614 88 01 00 08 */ lbz r0, 0x8(r1) +/* 802486B8 00245618 28 00 00 28 */ cmplwi r0, 0x28 +/* 802486BC 0024561C 41 82 00 0C */ beq lbl_802486C8 +/* 802486C0 00245620 38 60 00 00 */ li r3, 0x0 +/* 802486C4 00245624 48 00 02 D0 */ b lbl_80248994 +lbl_802486C8: +/* 802486C8 00245628 48 13 89 ED */ bl OSGetFontEncode +/* 802486CC 0024562C 54 60 04 3E */ clrlwi r0, r3, 16 +/* 802486D0 00245630 3C 60 41 4D */ lis r3, 0x414d +/* 802486D4 00245634 20 00 00 01 */ subfic r0, r0, 0x1 +/* 802486D8 00245638 7C 00 00 34 */ cntlzw r0, r0 +/* 802486DC 0024563C 38 83 54 45 */ addi r4, r3, 0x5445 +/* 802486E0 00245640 54 00 DE 3F */ rlwinm. r0, r0, 27, 24, 31 +/* 802486E4 00245644 41 82 00 08 */ beq lbl_802486EC +/* 802486E8 00245648 38 83 54 4A */ addi r4, r3, 0x544a +lbl_802486EC: +/* 802486EC 0024564C 90 81 00 18 */ stw r4, 0x18(r1) +/* 802486F0 00245650 38 81 00 14 */ addi r4, r1, 0x14 +/* 802486F4 00245654 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 802486F8 00245658 38 A1 00 08 */ addi r5, r1, 0x8 +/* 802486FC 0024565C 48 18 23 F5 */ bl GBARead +/* 80248700 00245660 2C 03 00 01 */ cmpwi r3, 0x1 +/* 80248704 00245664 40 82 00 0C */ bne lbl_80248710 +/* 80248708 00245668 38 60 00 00 */ li r3, 0x0 +/* 8024870C 0024566C 48 00 02 88 */ b lbl_80248994 +lbl_80248710: +/* 80248710 00245670 80 61 00 14 */ lwz r3, 0x14(r1) +/* 80248714 00245674 80 01 00 18 */ lwz r0, 0x18(r1) +/* 80248718 00245678 7C 03 00 40 */ cmplw r3, r0 +/* 8024871C 0024567C 41 82 00 0C */ beq lbl_80248728 +/* 80248720 00245680 38 60 00 00 */ li r3, 0x0 +/* 80248724 00245684 48 00 02 70 */ b lbl_80248994 +lbl_80248728: +/* 80248728 00245688 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 8024872C 0024568C 38 81 00 08 */ addi r4, r1, 0x8 +/* 80248730 00245690 48 18 11 29 */ bl GBAGetStatus +/* 80248734 00245694 2C 03 00 01 */ cmpwi r3, 0x1 +/* 80248738 00245698 40 82 00 0C */ bne lbl_80248744 +/* 8024873C 0024569C 38 60 00 00 */ li r3, 0x0 +/* 80248740 002456A0 48 00 02 54 */ b lbl_80248994 +lbl_80248744: +/* 80248744 002456A4 88 01 00 08 */ lbz r0, 0x8(r1) +/* 80248748 002456A8 28 00 00 20 */ cmplwi r0, 0x20 +/* 8024874C 002456AC 41 82 00 0C */ beq lbl_80248758 +/* 80248750 002456B0 38 60 00 00 */ li r3, 0x0 +/* 80248754 002456B4 48 00 02 40 */ b lbl_80248994 +lbl_80248758: +/* 80248758 002456B8 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 8024875C 002456BC 38 81 00 18 */ addi r4, r1, 0x18 +/* 80248760 002456C0 38 A1 00 08 */ addi r5, r1, 0x8 +/* 80248764 002456C4 48 18 24 E5 */ bl GBAWrite +/* 80248768 002456C8 2C 03 00 01 */ cmpwi r3, 0x1 +/* 8024876C 002456CC 40 82 00 0C */ bne lbl_80248778 +/* 80248770 002456D0 38 60 00 00 */ li r3, 0x0 +/* 80248774 002456D4 48 00 02 20 */ b lbl_80248994 +lbl_80248778: +/* 80248778 002456D8 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 8024877C 002456DC 38 81 00 08 */ addi r4, r1, 0x8 +/* 80248780 002456E0 48 18 10 D9 */ bl GBAGetStatus +/* 80248784 002456E4 2C 03 00 01 */ cmpwi r3, 0x1 +/* 80248788 002456E8 40 82 00 0C */ bne lbl_80248794 +/* 8024878C 002456EC 38 60 00 00 */ li r3, 0x0 +/* 80248790 002456F0 48 00 02 04 */ b lbl_80248994 +lbl_80248794: +/* 80248794 002456F4 88 01 00 08 */ lbz r0, 0x8(r1) +/* 80248798 002456F8 54 00 06 B6 */ rlwinm r0, r0, 0, 26, 27 +/* 8024879C 002456FC 2C 00 00 30 */ cmpwi r0, 0x30 +/* 802487A0 00245700 41 82 00 0C */ beq lbl_802487AC +/* 802487A4 00245704 38 60 00 00 */ li r3, 0x0 +/* 802487A8 00245708 48 00 01 EC */ b lbl_80248994 +lbl_802487AC: +/* 802487AC 0024570C 48 13 CD 19 */ bl OSGetTick +/* 802487B0 00245710 3C 80 43 1C */ lis r4, 0x431c +/* 802487B4 00245714 7C 7C 1B 78 */ mr r28, r3 +/* 802487B8 00245718 3B A4 DE 83 */ addi r29, r4, -0x217d +/* 802487BC 0024571C 3F C0 80 00 */ lis r30, 0x800000F8@ha +lbl_802487C0: +/* 802487C0 00245720 48 13 CD 05 */ bl OSGetTick +/* 802487C4 00245724 80 1E 00 F8 */ lwz r0, 0x800000F8@l(r30) +/* 802487C8 00245728 7C 7C 18 50 */ subf r3, r28, r3 +/* 802487CC 0024572C 54 63 18 38 */ slwi r3, r3, 3 +/* 802487D0 00245730 54 00 F0 BE */ srwi r0, r0, 2 +/* 802487D4 00245734 7C 1D 00 16 */ mulhwu r0, r29, r0 +/* 802487D8 00245738 54 00 8B FE */ srwi r0, r0, 15 +/* 802487DC 0024573C 7C 03 03 96 */ divwu r0, r3, r0 +/* 802487E0 00245740 28 00 01 F4 */ cmplwi r0, 0x1f4 +/* 802487E4 00245744 41 81 01 AC */ bgt lbl_80248990 +/* 802487E8 00245748 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 802487EC 0024574C 38 81 00 08 */ addi r4, r1, 0x8 +/* 802487F0 00245750 48 18 10 69 */ bl GBAGetStatus +/* 802487F4 00245754 2C 03 00 01 */ cmpwi r3, 0x1 +/* 802487F8 00245758 41 82 FF C8 */ beq lbl_802487C0 +/* 802487FC 0024575C 88 01 00 08 */ lbz r0, 0x8(r1) +/* 80248800 00245760 54 00 07 39 */ rlwinm. r0, r0, 0, 28, 28 +/* 80248804 00245764 41 82 FF BC */ beq lbl_802487C0 +/* 80248808 00245768 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 8024880C 0024576C 38 81 00 08 */ addi r4, r1, 0x8 +/* 80248810 00245770 48 18 10 49 */ bl GBAGetStatus +/* 80248814 00245774 2C 03 00 00 */ cmpwi r3, 0x0 +/* 80248818 00245778 40 82 FF A8 */ bne lbl_802487C0 +/* 8024881C 0024577C 88 01 00 08 */ lbz r0, 0x8(r1) +/* 80248820 00245780 28 00 00 38 */ cmplwi r0, 0x38 +/* 80248824 00245784 40 82 FF 9C */ bne lbl_802487C0 +/* 80248828 00245788 80 7F 00 40 */ lwz r3, 0x40(r31) +/* 8024882C 0024578C 38 81 00 10 */ addi r4, r1, 0x10 +/* 80248830 00245790 38 A1 00 08 */ addi r5, r1, 0x8 +/* 80248834 00245794 48 18 22 BD */ bl GBARead +/* 80248838 00245798 2C 03 00 00 */ cmpwi r3, 0x0 +/* 8024883C 0024579C 41 82 00 0C */ beq lbl_80248848 +/* 80248840 002457A0 38 60 00 00 */ li r3, 0x0 +/* 80248844 002457A4 48 00 01 50 */ b lbl_80248994 +lbl_80248848: +/* 80248848 002457A8 81 01 00 10 */ lwz r8, 0x10(r1) +/* 8024884C 002457AC 38 C1 00 0C */ addi r6, r1, 0xc +/* 80248850 002457B0 38 E0 00 03 */ li r7, 0x3 +/* 80248854 002457B4 38 A0 FF FF */ li r5, -0x1 +/* 80248858 002457B8 55 04 46 3E */ srwi r4, r8, 24 +/* 8024885C 002457BC 55 03 86 3E */ rlwinm r3, r8, 16, 24, 31 +/* 80248860 002457C0 55 00 C6 3E */ rlwinm r0, r8, 24, 24, 31 +/* 80248864 002457C4 98 81 00 0C */ stb r4, 0xc(r1) +/* 80248868 002457C8 98 61 00 0D */ stb r3, 0xd(r1) +/* 8024886C 002457CC 98 01 00 0E */ stb r0, 0xe(r1) +/* 80248870 002457D0 99 01 00 0F */ stb r8, 0xf(r1) +lbl_80248874: +/* 80248874 002457D4 88 06 00 00 */ lbz r0, 0x0(r6) +/* 80248878 002457D8 38 C6 00 01 */ addi r6, r6, 0x1 +/* 8024887C 002457DC 7C A5 02 78 */ xor r5, r5, r0 +/* 80248880 002457E0 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 80248884 002457E4 41 82 00 10 */ beq lbl_80248894 +/* 80248888 002457E8 54 A5 F8 7E */ srwi r5, r5, 1 +/* 8024888C 002457EC 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 80248890 002457F0 48 00 00 08 */ b lbl_80248898 +lbl_80248894: +/* 80248894 002457F4 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_80248898: +/* 80248898 002457F8 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 8024889C 002457FC 41 82 00 10 */ beq lbl_802488AC +/* 802488A0 00245800 54 A5 F8 7E */ srwi r5, r5, 1 +/* 802488A4 00245804 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 802488A8 00245808 48 00 00 08 */ b lbl_802488B0 +lbl_802488AC: +/* 802488AC 0024580C 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_802488B0: +/* 802488B0 00245810 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 802488B4 00245814 41 82 00 10 */ beq lbl_802488C4 +/* 802488B8 00245818 54 A5 F8 7E */ srwi r5, r5, 1 +/* 802488BC 0024581C 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 802488C0 00245820 48 00 00 08 */ b lbl_802488C8 +lbl_802488C4: +/* 802488C4 00245824 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_802488C8: +/* 802488C8 00245828 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 802488CC 0024582C 41 82 00 10 */ beq lbl_802488DC +/* 802488D0 00245830 54 A5 F8 7E */ srwi r5, r5, 1 +/* 802488D4 00245834 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 802488D8 00245838 48 00 00 08 */ b lbl_802488E0 +lbl_802488DC: +/* 802488DC 0024583C 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_802488E0: +/* 802488E0 00245840 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 802488E4 00245844 41 82 00 10 */ beq lbl_802488F4 +/* 802488E8 00245848 54 A5 F8 7E */ srwi r5, r5, 1 +/* 802488EC 0024584C 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 802488F0 00245850 48 00 00 08 */ b lbl_802488F8 +lbl_802488F4: +/* 802488F4 00245854 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_802488F8: +/* 802488F8 00245858 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 802488FC 0024585C 41 82 00 10 */ beq lbl_8024890C +/* 80248900 00245860 54 A5 F8 7E */ srwi r5, r5, 1 +/* 80248904 00245864 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 80248908 00245868 48 00 00 08 */ b lbl_80248910 +lbl_8024890C: +/* 8024890C 0024586C 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_80248910: +/* 80248910 00245870 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 80248914 00245874 41 82 00 10 */ beq lbl_80248924 +/* 80248918 00245878 54 A5 F8 7E */ srwi r5, r5, 1 +/* 8024891C 0024587C 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 80248920 00245880 48 00 00 08 */ b lbl_80248928 +lbl_80248924: +/* 80248924 00245884 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_80248928: +/* 80248928 00245888 54 A0 07 FF */ clrlwi. r0, r5, 31 +/* 8024892C 0024588C 41 82 00 10 */ beq lbl_8024893C +/* 80248930 00245890 54 A5 F8 7E */ srwi r5, r5, 1 +/* 80248934 00245894 68 A5 B0 10 */ xori r5, r5, 0xb010 +/* 80248938 00245898 48 00 00 08 */ b lbl_80248940 +lbl_8024893C: +/* 8024893C 0024589C 54 A5 F8 7E */ srwi r5, r5, 1 +lbl_80248940: +/* 80248940 002458A0 34 E7 FF FF */ addic. r7, r7, -0x1 +/* 80248944 002458A4 40 82 FF 30 */ bne lbl_80248874 +/* 80248948 002458A8 88 61 00 0F */ lbz r3, 0xf(r1) +/* 8024894C 002458AC 54 A0 06 3E */ clrlwi r0, r5, 24 +/* 80248950 002458B0 7C 03 00 40 */ cmplw r3, r0 +/* 80248954 002458B4 41 82 00 0C */ beq lbl_80248960_ +/* 80248958 002458B8 38 60 00 00 */ li r3, 0x0 +/* 8024895C 002458BC 48 00 00 38 */ b lbl_80248994 +lbl_80248960_: +/* 80248960 002458C0 88 81 00 0E */ lbz r4, 0xe(r1) +/* 80248964 002458C4 38 60 00 00 */ li r3, 0x0 +/* 80248968 002458C8 54 80 FF FE */ rlwinm r0, r4, 31, 31, 31 +/* 8024896C 002458CC 68 00 00 01 */ xori r0, r0, 0x1 +/* 80248970 002458D0 98 1F 00 44 */ stb r0, 0x44(r31) +/* 80248974 002458D4 88 1F 00 44 */ lbz r0, 0x44(r31) +/* 80248978 002458D8 28 00 00 00 */ cmplwi r0, 0x0 +/* 8024897C 002458DC 41 82 00 10 */ beq lbl_8024898C +/* 80248980 002458E0 54 80 07 FF */ clrlwi. r0, r4, 31 +/* 80248984 002458E4 40 81 00 08 */ ble lbl_8024898C +/* 80248988 002458E8 38 60 00 01 */ li r3, 0x1 +lbl_8024898C: +/* 8024898C 002458EC 98 7F 00 45 */ stb r3, 0x45(r31) +lbl_80248990: +/* 80248990 002458F0 38 60 00 01 */ li r3, 0x1 +lbl_80248994: +/* 80248994 002458F4 80 01 00 34 */ lwz r0, 0x34(r1) +/* 80248998 002458F8 83 E1 00 2C */ lwz r31, 0x2c(r1) +/* 8024899C 002458FC 83 C1 00 28 */ lwz r30, 0x28(r1) +/* 802489A0 00245900 83 A1 00 24 */ lwz r29, 0x24(r1) +/* 802489A4 00245904 83 81 00 20 */ lwz r28, 0x20(r1) +/* 802489A8 00245908 7C 08 03 A6 */ mtlr r0 +/* 802489AC 0024590C 38 21 00 30 */ addi r1, r1, 0x30 +/* 802489B0 00245910 4E 80 00 20 */ blr + +.else + .global PollResponse__11CGBASupportFv PollResponse__11CGBASupportFv: /* 802485D4 00245534 94 21 FF D0 */ stwu r1, -0x30(r1) @@ -284,6 +543,8 @@ lbl_802488F8: /* 80248910 00245870 38 21 00 30 */ addi r1, r1, 0x30 /* 80248914 00245874 4E 80 00 20 */ blr +.endif + .global Update__11CGBASupportFv Update__11CGBASupportFv: /* 80248918 00245878 94 21 FF D0 */ stwu r1, -0x30(r1) @@ -297,24 +558,23 @@ Update__11CGBASupportFv: /* 80248938 00245898 FF E0 08 90 */ fmr f31, f1 /* 8024893C 0024589C 80 A3 00 34 */ lwz r5, 0x34(r3) /* 80248940 002458A0 28 05 00 08 */ cmplwi r5, 8 -/* 80248944 002458A4 41 81 02 10 */ bgt lbl_80248B54 -/* 80248948 002458A8 3C 80 80 3F */ lis r4, lbl_803E8C18@ha +/* 80248944 002458A4 41 81 02 10 */ bgt Update_default +/* 80248948 002458A8 3C 80 80 3F */ lis r4, Update_jumptable@ha /* 8024894C 002458AC 54 A0 10 3A */ slwi r0, r5, 2 -/* 80248950 002458B0 38 84 8C 18 */ addi r4, r4, lbl_803E8C18@l +/* 80248950 002458B0 38 84 8C 18 */ addi r4, r4, Update_jumptable@l /* 80248954 002458B4 7C 04 00 2E */ lwzx r0, r4, r0 /* 80248958 002458B8 7C 09 03 A6 */ mtctr r0 /* 8024895C 002458BC 4E 80 04 20 */ bctr -.global lbl_80248960 -lbl_80248960: +Update_case0: /* 80248960 002458C0 2C 05 00 00 */ cmpwi r5, 0 -/* 80248964 002458C4 40 82 01 F0 */ bne lbl_80248B54 +/* 80248964 002458C4 40 82 01 F0 */ bne Update_default /* 80248968 002458C8 80 7F 00 30 */ lwz r3, 0x30(r31) /* 8024896C 002458CC 81 83 00 00 */ lwz r12, 0(r3) /* 80248970 002458D0 81 8C 00 10 */ lwz r12, 0x10(r12) /* 80248974 002458D4 7D 89 03 A6 */ mtctr r12 /* 80248978 002458D8 4E 80 04 21 */ bctrl /* 8024897C 002458DC 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 80248980 002458E0 41 82 01 D4 */ beq lbl_80248B54 +/* 80248980 002458E0 41 82 01 D4 */ beq Update_default /* 80248984 002458E4 80 7F 00 30 */ lwz r3, 0x30(r31) /* 80248988 002458E8 28 03 00 00 */ cmplwi r3, 0 /* 8024898C 002458EC 41 82 00 18 */ beq lbl_802489A4 @@ -331,6 +591,29 @@ lbl_802489A4: /* 802489B4 00245914 83 FF 00 2C */ lwz r31, 0x2c(r31) /* 802489B8 00245918 48 13 CA 09 */ bl OSGetTick /* 802489BC 0024591C 98 7F 00 C8 */ stb r3, 0xc8(r31) +.if version >= 2 +/* 80248A5C 002459BC 54 65 C6 3E */ rlwinm r5, r3, 24, 24, 31 +/* 80248A60 002459C0 54 64 86 3E */ rlwinm r4, r3, 16, 24, 31 +/* 80248A64 002459C4 54 60 46 3E */ srwi r0, r3, 24 +/* 80248A68 002459C8 98 BF 00 C9 */ stb r5, 0xc9(r31) +/* 80248A6C 002459CC 98 9F 00 CA */ stb r4, 0xca(r31) +/* 80248A70 002459D0 98 1F 00 CB */ stb r0, 0xcb(r31) +/* 80248A74 002459D4 48 13 86 41 */ bl OSGetFontEncode +/* 80248A78 002459D8 54 60 04 3E */ clrlwi r0, r3, 16 +/* 80248A7C 002459DC 28 00 00 01 */ cmplwi r0, 0x1 +/* 80248A80 002459E0 40 82 00 18 */ bne lbl_80248A98 +/* 80248A84 002459E4 38 60 00 4A */ li r3, 0x4a +/* 80248A88 002459E8 38 00 00 C4 */ li r0, 0xc4 +/* 80248A8C 002459EC 98 7F 00 AF */ stb r3, 0xaf(r31) +/* 80248A90 002459F0 98 1F 00 BD */ stb r0, 0xbd(r31) +/* 80248A94 002459F4 48 00 01 80 */ b Update_default +lbl_80248A98: +/* 80248A98 002459F8 38 60 00 45 */ li r3, 0x45 +/* 80248A9C 002459FC 38 00 00 C9 */ li r0, 0xc9 +/* 80248AA0 00245A00 98 7F 00 AF */ stb r3, 0xaf(r31) +/* 80248AA4 00245A04 98 1F 00 BD */ stb r0, 0xbd(r31) +/* 80248AA8 00245A08 48 00 01 6C */ b Update_default +.else /* 802489C0 00245920 54 60 C6 3E */ rlwinm r0, r3, 0x18, 0x18, 0x1f /* 802489C4 00245924 54 65 86 3E */ rlwinm r5, r3, 0x10, 0x18, 0x1f /* 802489C8 00245928 54 64 46 3E */ srwi r4, r3, 0x18 @@ -341,15 +624,14 @@ lbl_802489A4: /* 802489DC 0024593C 98 9F 00 CB */ stb r4, 0xcb(r31) /* 802489E0 00245940 98 7F 00 AF */ stb r3, 0xaf(r31) /* 802489E4 00245944 98 1F 00 BD */ stb r0, 0xbd(r31) -/* 802489E8 00245948 48 00 01 6C */ b lbl_80248B54 -.global lbl_802489EC -lbl_802489EC: +/* 802489E8 00245948 48 00 01 6C */ b Update_default +.endif +Update_case2: /* 802489EC 0024594C C0 02 B8 7C */ lfs f0, lbl_805AD59C@sda21(r2) /* 802489F0 00245950 38 00 00 03 */ li r0, 3 /* 802489F4 00245954 D0 1F 00 38 */ stfs f0, 0x38(r31) /* 802489F8 00245958 90 1F 00 34 */ stw r0, 0x34(r31) -.global lbl_802489FC -lbl_802489FC: +Update_case3: /* 802489FC 0024595C 3B C0 00 01 */ li r30, 1 lbl_80248A00: /* 80248A00 00245960 7F C3 F3 78 */ mr r3, r30 @@ -362,7 +644,7 @@ lbl_80248A00: /* 80248A1C 0024597C C0 02 B8 7C */ lfs f0, lbl_805AD59C@sda21(r2) /* 80248A20 00245980 90 1F 00 34 */ stw r0, 0x34(r31) /* 80248A24 00245984 D0 1F 00 38 */ stfs f0, 0x38(r31) -/* 80248A28 00245988 48 00 01 2C */ b lbl_80248B54 +/* 80248A28 00245988 48 00 01 2C */ b Update_default lbl_80248A2C: /* 80248A2C 0024598C 3B DE 00 01 */ addi r30, r30, 1 /* 80248A30 00245990 2C 1E 00 04 */ cmpwi r30, 4 @@ -383,12 +665,11 @@ lbl_80248A5C: /* 80248A64 002459C4 D0 1F 00 38 */ stfs f0, 0x38(r31) /* 80248A68 002459C8 C0 1F 00 38 */ lfs f0, 0x38(r31) /* 80248A6C 002459CC FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 80248A70 002459D0 40 82 00 E4 */ bne lbl_80248B54 +/* 80248A70 002459D0 40 82 00 E4 */ bne Update_default /* 80248A74 002459D4 38 00 00 08 */ li r0, 8 /* 80248A78 002459D8 90 1F 00 34 */ stw r0, 0x34(r31) -/* 80248A7C 002459DC 48 00 00 D8 */ b lbl_80248B54 -.global lbl_80248A80 -lbl_80248A80: +/* 80248A7C 002459DC 48 00 00 D8 */ b Update_default +Update_case4: /* 80248A80 002459E0 38 00 00 05 */ li r0, 5 /* 80248A84 002459E4 3C 60 80 25 */ lis r3, nullsub_130@ha /* 80248A88 002459E8 90 1F 00 34 */ stw r0, 0x34(r31) @@ -400,14 +681,13 @@ lbl_80248A80: /* 80248AA0 00245A00 80 FF 00 14 */ lwz r7, 0x14(r31) /* 80248AA4 00245A04 54 64 08 3C */ slwi r4, r3, 1 /* 80248AA8 00245A08 48 18 0F B5 */ bl GBAJoyBootAsync -/* 80248AAC 00245A0C 48 00 00 A8 */ b lbl_80248B54 -.global lbl_80248AB0 -lbl_80248AB0: +/* 80248AAC 00245A0C 48 00 00 A8 */ b Update_default +Update_case5: /* 80248AB0 00245A10 80 7F 00 40 */ lwz r3, 0x40(r31) /* 80248AB4 00245A14 38 9F 00 3C */ addi r4, r31, 0x3c /* 80248AB8 00245A18 48 18 0E 31 */ bl GBAGetProcessStatus /* 80248ABC 00245A1C 2C 03 00 02 */ cmpwi r3, 2 -/* 80248AC0 00245A20 41 82 00 94 */ beq lbl_80248B54 +/* 80248AC0 00245A20 41 82 00 94 */ beq Update_default /* 80248AC4 00245A24 80 7F 00 40 */ lwz r3, 0x40(r31) /* 80248AC8 00245A28 38 9F 00 3C */ addi r4, r31, 0x3c /* 80248ACC 00245A2C 48 18 0C 89 */ bl GBAGetStatus @@ -415,21 +695,20 @@ lbl_80248AB0: /* 80248AD4 00245A34 40 82 00 10 */ bne lbl_80248AE4 /* 80248AD8 00245A38 38 00 00 08 */ li r0, 8 /* 80248ADC 00245A3C 90 1F 00 34 */ stw r0, 0x34(r31) -/* 80248AE0 00245A40 48 00 00 74 */ b lbl_80248B54 +/* 80248AE0 00245A40 48 00 00 74 */ b Update_default lbl_80248AE4: /* 80248AE4 00245A44 C0 02 B8 7C */ lfs f0, lbl_805AD59C@sda21(r2) /* 80248AE8 00245A48 38 00 00 06 */ li r0, 6 /* 80248AEC 00245A4C D0 1F 00 38 */ stfs f0, 0x38(r31) /* 80248AF0 00245A50 90 1F 00 34 */ stw r0, 0x34(r31) -/* 80248AF4 00245A54 48 00 00 60 */ b lbl_80248B54 -.global lbl_80248AF8 -lbl_80248AF8: +/* 80248AF4 00245A54 48 00 00 60 */ b Update_default +Update_case6: /* 80248AF8 00245A58 4B FF FA DD */ bl PollResponse__11CGBASupportFv /* 80248AFC 00245A5C 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 80248B00 00245A60 41 82 00 10 */ beq lbl_80248B10 /* 80248B04 00245A64 38 00 00 07 */ li r0, 7 /* 80248B08 00245A68 90 1F 00 34 */ stw r0, 0x34(r31) -/* 80248B0C 00245A6C 48 00 00 48 */ b lbl_80248B54 +/* 80248B0C 00245A6C 48 00 00 48 */ b Update_default lbl_80248B10: /* 80248B10 00245A70 C0 3F 00 38 */ lfs f1, 0x38(r31) /* 80248B14 00245A74 C0 0D 96 FC */ lfs f0, lbl_805A82BC@sda21(r13) @@ -447,11 +726,10 @@ lbl_80248B34: /* 80248B3C 00245A9C D0 1F 00 38 */ stfs f0, 0x38(r31) /* 80248B40 00245AA0 C0 1F 00 38 */ lfs f0, 0x38(r31) /* 80248B44 00245AA4 FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 80248B48 00245AA8 40 82 00 0C */ bne lbl_80248B54 +/* 80248B48 00245AA8 40 82 00 0C */ bne Update_default /* 80248B4C 00245AAC 38 00 00 08 */ li r0, 8 /* 80248B50 00245AB0 90 1F 00 34 */ stw r0, 0x34(r31) -.global lbl_80248B54 -lbl_80248B54: +Update_default: /* 80248B54 00245AB4 E3 E1 00 28 */ psq_l f31, 40(r1), 0, qr0 /* 80248B58 00245AB8 80 01 00 34 */ lwz r0, 0x34(r1) /* 80248B5C 00245ABC CB E1 00 20 */ lfd f31, 0x20(r1) @@ -461,6 +739,78 @@ lbl_80248B54: /* 80248B6C 00245ACC 38 21 00 30 */ addi r1, r1, 0x30 /* 80248B70 00245AD0 4E 80 00 20 */ blr +.if version >= 2 + +.global IsReady__11CGBASupportFv +IsReady__11CGBASupportFv: +/* 80248C34 00245B94 94 21 FF F0 */ stwu r1, -0x10(r1) +/* 80248C38 00245B98 7C 08 02 A6 */ mflr r0 +/* 80248C3C 00245B9C 90 01 00 14 */ stw r0, 0x14(r1) +/* 80248C40 00245BA0 93 E1 00 0C */ stw r31, 0xc(r1) +/* 80248C44 00245BA4 7C 7F 1B 78 */ mr r31, r3 +/* 80248C48 00245BA8 80 03 00 34 */ lwz r0, 0x34(r3) +/* 80248C4C 00245BAC 2C 00 00 00 */ cmpwi r0, 0x0 +/* 80248C50 00245BB0 41 82 00 0C */ beq lbl_80248C5C +/* 80248C54 00245BB4 38 60 00 01 */ li r3, 0x1 +/* 80248C58 00245BB8 48 00 00 B4 */ b lbl_80248D0C +lbl_80248C5C: +/* 80248C5C 00245BBC 80 7F 00 30 */ lwz r3, 0x30(r31) +/* 80248C60 00245BC0 81 83 00 00 */ lwz r12, 0x0(r3) +/* 80248C64 00245BC4 81 8C 00 10 */ lwz r12, 0x10(r12) +/* 80248C68 00245BC8 7D 89 03 A6 */ mtctr r12 +/* 80248C6C 00245BCC 4E 80 04 21 */ bctrl +/* 80248C70 00245BD0 54 60 06 3F */ clrlwi. r0, r3, 24 +/* 80248C74 00245BD4 41 82 00 94 */ beq lbl_80248D08 +/* 80248C78 00245BD8 80 7F 00 30 */ lwz r3, 0x30(r31) +/* 80248C7C 00245BDC 28 03 00 00 */ cmplwi r3, 0x0 +/* 80248C80 00245BE0 41 82 00 18 */ beq lbl_80248C98 +/* 80248C84 00245BE4 81 83 00 00 */ lwz r12, 0x0(r3) +/* 80248C88 00245BE8 38 80 00 01 */ li r4, 0x1 +/* 80248C8C 00245BEC 81 8C 00 08 */ lwz r12, 0x8(r12) +/* 80248C90 00245BF0 7D 89 03 A6 */ mtctr r12 +/* 80248C94 00245BF4 4E 80 04 21 */ bctrl +lbl_80248C98: +/* 80248C98 00245BF8 38 60 00 00 */ li r3, 0x0 +/* 80248C9C 00245BFC 38 00 00 01 */ li r0, 0x1 +/* 80248CA0 00245C00 90 7F 00 30 */ stw r3, 0x30(r31) +/* 80248CA4 00245C04 90 1F 00 34 */ stw r0, 0x34(r31) +/* 80248CA8 00245C08 83 FF 00 2C */ lwz r31, 0x2c(r31) +/* 80248CAC 00245C0C 48 13 C8 19 */ bl OSGetTick +/* 80248CB0 00245C10 98 7F 00 C8 */ stb r3, 0xc8(r31) +/* 80248CB4 00245C14 54 65 C6 3E */ rlwinm r5, r3, 24, 24, 31 +/* 80248CB8 00245C18 54 64 86 3E */ rlwinm r4, r3, 16, 24, 31 +/* 80248CBC 00245C1C 54 60 46 3E */ srwi r0, r3, 24 +/* 80248CC0 00245C20 98 BF 00 C9 */ stb r5, 0xc9(r31) +/* 80248CC4 00245C24 98 9F 00 CA */ stb r4, 0xca(r31) +/* 80248CC8 00245C28 98 1F 00 CB */ stb r0, 0xcb(r31) +/* 80248CCC 00245C2C 48 13 83 E9 */ bl OSGetFontEncode +/* 80248CD0 00245C30 54 60 04 3E */ clrlwi r0, r3, 16 +/* 80248CD4 00245C34 28 00 00 01 */ cmplwi r0, 0x1 +/* 80248CD8 00245C38 40 82 00 18 */ bne lbl_80248CF0 +/* 80248CDC 00245C3C 38 60 00 4A */ li r3, 0x4a +/* 80248CE0 00245C40 38 00 00 C4 */ li r0, 0xc4 +/* 80248CE4 00245C44 98 7F 00 AF */ stb r3, 0xaf(r31) +/* 80248CE8 00245C48 98 1F 00 BD */ stb r0, 0xbd(r31) +/* 80248CEC 00245C4C 48 00 00 14 */ b lbl_80248D00 +lbl_80248CF0: +/* 80248CF0 00245C50 38 60 00 45 */ li r3, 0x45 +/* 80248CF4 00245C54 38 00 00 C9 */ li r0, 0xc9 +/* 80248CF8 00245C58 98 7F 00 AF */ stb r3, 0xaf(r31) +/* 80248CFC 00245C5C 98 1F 00 BD */ stb r0, 0xbd(r31) +lbl_80248D00: +/* 80248D00 00245C60 38 60 00 01 */ li r3, 0x1 +/* 80248D04 00245C64 48 00 00 08 */ b lbl_80248D0C +lbl_80248D08: +/* 80248D08 00245C68 38 60 00 00 */ li r3, 0x0 +lbl_80248D0C: +/* 80248D0C 00245C6C 80 01 00 14 */ lwz r0, 0x14(r1) +/* 80248D10 00245C70 83 E1 00 0C */ lwz r31, 0xc(r1) +/* 80248D14 00245C74 7C 08 03 A6 */ mtlr r0 +/* 80248D18 00245C78 38 21 00 10 */ addi r1, r1, 0x10 +/* 80248D1C 00245C7C 4E 80 00 20 */ blr + +.else + .global IsReady__11CGBASupportFv IsReady__11CGBASupportFv: /* 80248B74 00245AD4 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -518,6 +868,8 @@ lbl_80248C28: /* 80248C34 00245B94 38 21 00 10 */ addi r1, r1, 0x10 /* 80248C38 00245B98 4E 80 00 20 */ blr +.endif + .global StartLink__11CGBASupportFv StartLink__11CGBASupportFv: /* 80248C3C 00245B9C 38 80 00 02 */ li r4, 2 @@ -584,6 +936,73 @@ lbl_80248CF8: /* 80248D0C 00245C6C 38 21 00 10 */ addi r1, r1, 0x10 /* 80248D10 00245C70 4E 80 00 20 */ blr +.if version >= 2 + +.global __ct__11CGBASupportFv +__ct__11CGBASupportFv: +/* 80248DF8 00245D58 94 21 FF E0 */ stwu r1, -0x20(r1) +/* 80248DFC 00245D5C 7C 08 02 A6 */ mflr r0 +/* 80248E00 00245D60 90 01 00 24 */ stw r0, 0x24(r1) +/* 80248E04 00245D64 93 E1 00 1C */ stw r31, 0x1c(r1) +/* 80248E08 00245D68 7C 7F 1B 78 */ mr r31, r3 +/* 80248E0C 00245D6C 48 13 82 A9 */ bl OSGetFontEncode +/* 80248E10 00245D70 54 60 04 3E */ clrlwi r0, r3, 16 +/* 80248E14 00245D74 3C 80 80 3D */ lis r4, lbl_803D4768@ha +/* 80248E18 00245D78 20 00 00 01 */ subfic r0, r0, 0x1 +/* 80248E1C 00245D7C 7F E3 FB 78 */ mr r3, r31 +/* 80248E20 00245D80 7C 00 00 34 */ cntlzw r0, r0 +/* 80248E24 00245D84 38 A4 48 68 */ addi r5, r4, lbl_803D4768@l +/* 80248E28 00245D88 54 00 DE 3F */ rlwinm. r0, r0, 27, 24, 31 +/* 80248E2C 00245D8C 38 85 00 0F */ addi r4, r5, 0xf +/* 80248E30 00245D90 41 82 00 08 */ beq lbl_80248E38 +/* 80248E34 00245D94 7C A4 2B 78 */ mr r4, r5 +lbl_80248E38: +/* 80248E38 00245D98 48 10 70 2D */ bl __ct__8CDvdFileFPCc +/* 80248E3C 00245D9C 80 DF 00 14 */ lwz r6, 0x14(r31) +/* 80248E40 00245DA0 3C A0 80 3D */ lis r5, lbl_803D4768@ha +/* 80248E44 00245DA4 38 A5 48 68 */ addi r5, r5, lbl_803D4768@l +/* 80248E48 00245DA8 3C 80 80 3D */ lis r4, lbl_803D6AA8@ha +/* 80248E4C 00245DAC 38 06 00 1F */ addi r0, r6, 0x1f +/* 80248E50 00245DB0 38 61 00 08 */ addi r3, r1, 0x8 +/* 80248E54 00245DB4 54 00 00 34 */ rlwinm r0, r0, 0, 0, 26 +/* 80248E58 00245DB8 38 C4 6B B8 */ addi r6, r4, lbl_803D6AA8@l +/* 80248E5C 00245DBC 90 1F 00 28 */ stw r0, 0x28(r31) +/* 80248E60 00245DC0 38 A5 00 1E */ addi r5, r5, 0x1e +/* 80248E64 00245DC4 38 80 FF FF */ li r4, -0x1 +/* 80248E68 00245DC8 48 08 D6 A9 */ bl __ct__10CCallStackFUiPCcPCc +/* 80248E6C 00245DCC 7C 67 1B 78 */ mr r7, r3 +/* 80248E70 00245DD0 80 7F 00 28 */ lwz r3, 0x28(r31) +/* 80248E74 00245DD4 38 80 00 02 */ li r4, 0x2 +/* 80248E78 00245DD8 38 A0 00 01 */ li r5, 0x1 +/* 80248E7C 00245DDC 38 C0 00 00 */ li r6, 0x0 +/* 80248E80 00245DE0 48 0C CC 85 */ bl Alloc__7CMemoryFUlQ210IAllocator5EHintQ210IAllocator6EScopeQ210IAllocator5ETypeRC10CCallStack +/* 80248E84 00245DE4 90 7F 00 2C */ stw r3, 0x2c(r31) +/* 80248E88 00245DE8 7F E3 FB 78 */ mr r3, r31 +/* 80248E8C 00245DEC 80 9F 00 2C */ lwz r4, 0x2c(r31) +/* 80248E90 00245DF0 80 BF 00 28 */ lwz r5, 0x28(r31) +/* 80248E94 00245DF4 48 10 6E E9 */ bl SyncRead__8CDvdFileFPvUi +/* 80248E98 00245DF8 90 7F 00 30 */ stw r3, 0x30(r31) +/* 80248E9C 00245DFC 38 60 00 00 */ li r3, 0x0 +/* 80248EA0 00245E00 C0 02 B8 7C */ lfs f0, lbl_805AD5A0@sda21(r2) +/* 80248EA4 00245E04 38 00 FF FF */ li r0, -0x1 +/* 80248EA8 00245E08 90 7F 00 34 */ stw r3, 0x34(r31) +/* 80248EAC 00245E0C D0 1F 00 38 */ stfs f0, 0x38(r31) +/* 80248EB0 00245E10 98 7F 00 3C */ stb r3, 0x3c(r31) +/* 80248EB4 00245E14 90 1F 00 40 */ stw r0, 0x40(r31) +/* 80248EB8 00245E18 98 7F 00 44 */ stb r3, 0x44(r31) +/* 80248EBC 00245E1C 98 7F 00 45 */ stb r3, 0x45(r31) +/* 80248EC0 00245E20 48 18 08 91 */ bl GBAInit +/* 80248EC4 00245E24 93 ED A5 50 */ stw r31, lbl_805A9110@sda21(r13) +/* 80248EC8 00245E28 48 13 81 ED */ bl OSGetFontEncode +/* 80248ECC 00245E2C 80 01 00 24 */ lwz r0, 0x24(r1) +/* 80248ED0 00245E30 7F E3 FB 78 */ mr r3, r31 +/* 80248ED4 00245E34 83 E1 00 1C */ lwz r31, 0x1c(r1) +/* 80248ED8 00245E38 7C 08 03 A6 */ mtlr r0 +/* 80248EDC 00245E3C 38 21 00 20 */ addi r1, r1, 0x20 +/* 80248EE0 00245E40 4E 80 00 20 */ blr + +.else + .global __ct__11CGBASupportFv __ct__11CGBASupportFv: /* 80248D14 00245C74 94 21 FF E0 */ stwu r1, -0x20(r1) @@ -636,17 +1055,24 @@ __ct__11CGBASupportFv: /* 80248DD0 00245D30 38 21 00 20 */ addi r1, r1, 0x20 /* 80248DD4 00245D34 4E 80 00 20 */ blr +.endif + .global nullsub_130 nullsub_130: /* 80248DD8 00245D38 4E 80 00 20 */ blr .section .sdata2, "a" .balign 8 + +.if version < 2 + .global lbl_805AD598 lbl_805AD598: # ROM: 0x3F9E38 .4byte 0x414D5445 +.endif + .global lbl_805AD59C lbl_805AD59C: # ROM: 0x3F9E3C @@ -656,16 +1082,17 @@ lbl_805AD59C: lbl_805AD5A0: # ROM: 0x3F9E40 .4byte 0 - .4byte 0 .section .rodata .balign 8 .global lbl_803D4768 lbl_803D4768: +.if version >= 2 + .asciz "client_jap.bin" +.endif # ROM: 0x3D1768 .asciz "client_pad.bin" - .byte 0x3F - .asciz "?(??)" + .asciz "??(??)" .balign 4 diff --git a/asm/MetroidPrime/Enemies/COmegaPirate.s b/asm/MetroidPrime/Enemies/COmegaPirate.s index ed7f9d36..e9f0e921 100644 --- a/asm/MetroidPrime/Enemies/COmegaPirate.s +++ b/asm/MetroidPrime/Enemies/COmegaPirate.s @@ -6404,7 +6404,7 @@ lbl_80290894: /* 802908A8 0028D808 38 21 00 20 */ addi r1, r1, 0x20 /* 802908AC 0028D80C 4E 80 00 20 */ blr -.if version == 1 +.if version >= 1 .global AcceptScriptMsg__12COmegaPirateF20EScriptObjectMessage9TUniqueIdR13CStateManager AcceptScriptMsg__12COmegaPirateF20EScriptObjectMessage9TUniqueIdR13CStateManager: diff --git a/asm/MetroidPrime/main.s b/asm/MetroidPrime/main.s index ce2ec824..2668665e 100644 --- a/asm/MetroidPrime/main.s +++ b/asm/MetroidPrime/main.s @@ -3803,7 +3803,7 @@ lbl_80005CE0: /* 80005CF4 00002C54 38 21 00 10 */ addi r1, r1, 0x10 /* 80005CF8 00002C58 4E 80 00 20 */ blr -.if version == 1 +.if version >= 1 .global CheckReset__5CMainFv CheckReset__5CMainFv: @@ -4310,7 +4310,7 @@ GetResourceIdByName__11CResFactoryCFPCc: /* 800060AC 0000300C 38 21 00 10 */ addi r1, r1, 0x10 /* 800060B0 00003010 4E 80 00 20 */ blr -.if version == 1 +.if version >= 1 .global AddPaksAndFactories__18CGameGlobalObjectsFv AddPaksAndFactories__18CGameGlobalObjectsFv: @@ -7247,8 +7247,10 @@ main: /* 80008518 00005478 7C 9E 23 78 */ mr r30, r4 /* 8000851C 0000547C 93 A1 00 14 */ stw r29, 0x14(r1) /* 80008520 00005480 7C 7D 1B 78 */ mr r29, r3 +.if version < 2 /* 80008524 00005484 38 60 00 01 */ li r3, 1 /* 80008528 00005488 48 36 C8 A5 */ bl DVDSetAutoFatalMessaging +.endif /* 8000852C 0000548C 48 2C E3 D1 */ bl SetErrorHandlers /* 80008530 00005490 3C 60 80 45 */ lis r3, sMainSpace@ha /* 80008534 00005494 37 E3 75 60 */ addic. r31, r3, sMainSpace@l diff --git a/tools/asmdiff.sh b/tools/asmdiff.sh index 950d4406..7d7d8d46 100755 --- a/tools/asmdiff.sh +++ b/tools/asmdiff.sh @@ -1,8 +1,9 @@ #!/bin/bash -e +VERSION="${VERSION:=0}" OBJDUMP="$DEVKITPPC/bin/powerpc-eabi-objdump -D -bbinary -EB -mpowerpc -M gekko" if [ ! -z "$1" ]; then OPTIONS="--start-address=$(($1)) --stop-address=$(($2))" fi -$OBJDUMP $OPTIONS baserom.dol > baserom.dump -$OBJDUMP $OPTIONS build/mp1.0/main.dol > main.dump +$OBJDUMP $OPTIONS versions/$VERSION/baserom.dol > baserom.dump +$OBJDUMP $OPTIONS build/mp1.$VERSION/main.dol > main.dump diff -u --color=always baserom.dump main.dump