diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 360813ba3d..80219663b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,28 +103,27 @@ jobs: mode='${{matrix.mode}}' config_args='--compilers /compilers --max-errors 0 --verbose --version ${{matrix.version}}' - case "$mode" in - 'link') - config_args="--map --require-protos $config_args" - ;; - 'diff') ;; - *) exit 1 ;; - esac - echo "$config_args" | xargs python configure.py + + function run_configure { + echo "$config_args" | xargs python configure.py + } case "$mode" in 'link') + config_args="--map --require-protos $config_args" + run_configure ninja || ninja diff ;; 'diff') root='build/${{matrix.version}}' expected="$root/expected-report.json" - actual="$root/report.json" + current="$root/report.json" changes="$root/changes-report.json" - head=$(git rev-parse HEAD) + head="$(git rev-parse HEAD)" - ninja all_source - objdiff-cli report generate -o "$actual" + function run_ninja { + ninja all_source "$current" + } case '${{github.event_name}}' in 'pull_request') @@ -137,11 +136,14 @@ jobs: *) exit 1 ;; esac - ninja all_source - objdiff-cli report generate -o "$expected" + run_configure + run_ninja + cp "$current" "$expected" git checkout "$head" - objdiff-cli report changes -o "$changes" "$expected" "$actual" + run_ninja + + build/tools/objdiff-cli report changes -o "$changes" "$expected" "$current" python tools/diff_changes.py "$changes" status="$?" exit "$status" diff --git a/.gitignore b/.gitignore index e0822b75c9..3fb3213eda 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ build/ *.map *.dol *.pdb +/result # Temporary files *.swp diff --git a/.nix/decomp-toolkit.nix b/.nix/decomp-toolkit.nix index c2bb598525..cb52fef06e 100644 --- a/.nix/decomp-toolkit.nix +++ b/.nix/decomp-toolkit.nix @@ -7,13 +7,13 @@ rustPlatform.buildRustPackage rec { pname = "decomp-toolkit"; - version = "0.9.3"; + version = "0.9.6"; src = fetchFromGitHub { owner = "encounter"; repo = "decomp-toolkit"; rev = "v${version}"; - hash = "sha256-5EWZwAQNso58WIWKtXNiDDBjMUYYArdRREtyD0bXurY="; + hash = "sha256-mgdohsZ0ZkTSg/UsGVBPmtlJFa1rKMG6aa4XG1S9F4Y="; }; nativeBuildInputs = [ @@ -22,7 +22,6 @@ rustPlatform.buildRustPackage rec { cargoLock.lockFile = "${src}/Cargo.lock"; cargoLock.outputHashes."ar-0.8.0" = "sha256-OLyo+cRRWMsI1i8NsgsBKRJH1XsKW1CculQnJ/wcya0="; - cargoLock.outputHashes."nod-1.2.0" = "sha256-M7jSBo1Dqrhy/F0osoUtTMNm2BkFnRy2MOmkTs1pvdM="; cargoLock.outputHashes."objdiff-core-2.0.0-alpha.3" = "sha256-E597zRlSpxrTGino7jqoQmyxWkLYXT1P6U2PRolm0Ek="; cargoLock.outputHashes."ppc750cl-0.3.0" = "sha256-nMJk+rgu7Ydi2VZfodJk0kBz9xLLVBVz0vEZPee8Q6M="; diff --git a/asm/melee/it/items/itcoin.s b/asm/melee/it/items/itcoin.s deleted file mode 100644 index cda56cfa8f..0000000000 --- a/asm/melee/it/items/itcoin.s +++ /dev/null @@ -1,1264 +0,0 @@ -.include "macros.inc" - -.section .text - -.global it_802F13B4 -it_802F13B4: -/* 802F13B4 002EDF94 7C 08 02 A6 */ mflr r0 -/* 802F13B8 002EDF98 90 01 00 04 */ stw r0, 4(r1) -/* 802F13BC 002EDF9C 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 802F13C0 002EDFA0 BF 61 00 1C */ stmw r27, 0x1c(r1) -/* 802F13C4 002EDFA4 7C 7B 1B 78 */ mr r27, r3 -/* 802F13C8 002EDFA8 7C 9C 23 78 */ mr r28, r4 -/* 802F13CC 002EDFAC 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802F13D0 002EDFB0 80 63 00 28 */ lwz r3, 0x28(r3) -/* 802F13D4 002EDFB4 80 1F 0D D8 */ lwz r0, 0xdd8(r31) -/* 802F13D8 002EDFB8 80 9F 00 C4 */ lwz r4, 0xc4(r31) -/* 802F13DC 002EDFBC 2C 00 00 00 */ cmpwi r0, 0 -/* 802F13E0 002EDFC0 83 A3 00 10 */ lwz r29, 0x10(r3) -/* 802F13E4 002EDFC4 83 C4 00 04 */ lwz r30, 4(r4) -/* 802F13E8 002EDFC8 41 82 00 7C */ beq .L_802F1464 -/* 802F13EC 002EDFCC 38 60 00 01 */ li r3, 1 -/* 802F13F0 002EDFD0 4B EB 31 F9 */ bl gm_801A45E8 -/* 802F13F4 002EDFD4 2C 03 00 00 */ cmpwi r3, 0 -/* 802F13F8 002EDFD8 41 82 00 14 */ beq .L_802F140C -/* 802F13FC 002EDFDC 80 7F 0D E8 */ lwz r3, 0xde8(r31) -/* 802F1400 002EDFE0 4B F2 88 51 */ bl grFigureGet_80219C50 -/* 802F1404 002EDFE4 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1408 002EDFE8 41 82 00 24 */ beq .L_802F142C -.L_802F140C: -/* 802F140C 002EDFEC 4B D3 FD 39 */ bl Camera_80031144 -/* 802F1410 002EDFF0 C0 1E 00 48 */ lfs f0, 0x48(r30) -/* 802F1414 002EDFF4 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F1418 002EDFF8 40 80 00 30 */ bge .L_802F1448 -/* 802F141C 002EDFFC 80 7F 0D E8 */ lwz r3, 0xde8(r31) -/* 802F1420 002EE000 4B F2 88 31 */ bl grFigureGet_80219C50 -/* 802F1424 002EE004 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1428 002EE008 40 82 00 20 */ bne .L_802F1448 -.L_802F142C: -/* 802F142C 002EE00C 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1430 002EE010 38 80 00 10 */ li r4, 0x10 -/* 802F1434 002EE014 48 08 09 69 */ bl HSD_JObjSetFlagsAll -/* 802F1438 002EE018 80 7D 00 08 */ lwz r3, 8(r29) -/* 802F143C 002EE01C 38 80 00 10 */ li r4, 0x10 -/* 802F1440 002EE020 48 08 0B 5D */ bl HSD_JObjClearFlagsAll -/* 802F1444 002EE024 48 00 00 80 */ b .L_802F14C4 -.L_802F1448: -/* 802F1448 002EE028 80 7D 00 08 */ lwz r3, 8(r29) -/* 802F144C 002EE02C 38 80 00 10 */ li r4, 0x10 -/* 802F1450 002EE030 48 08 09 4D */ bl HSD_JObjSetFlagsAll -/* 802F1454 002EE034 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1458 002EE038 38 80 00 10 */ li r4, 0x10 -/* 802F145C 002EE03C 48 08 0B 41 */ bl HSD_JObjClearFlagsAll -/* 802F1460 002EE040 48 00 00 64 */ b .L_802F14C4 -.L_802F1464: -/* 802F1464 002EE044 38 60 00 01 */ li r3, 1 -/* 802F1468 002EE048 4B EB 31 81 */ bl gm_801A45E8 -/* 802F146C 002EE04C 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1470 002EE050 41 82 00 10 */ beq .L_802F1480 -/* 802F1474 002EE054 4B ED 09 11 */ bl Ground_801C1D84 -/* 802F1478 002EE058 28 03 00 00 */ cmplwi r3, 0 -/* 802F147C 002EE05C 41 82 00 14 */ beq .L_802F1490 -.L_802F1480: -/* 802F1480 002EE060 4B D3 FC C5 */ bl Camera_80031144 -/* 802F1484 002EE064 C0 1E 00 48 */ lfs f0, 0x48(r30) -/* 802F1488 002EE068 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F148C 002EE06C 40 80 00 20 */ bge .L_802F14AC -.L_802F1490: -/* 802F1490 002EE070 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1494 002EE074 38 80 00 10 */ li r4, 0x10 -/* 802F1498 002EE078 48 08 09 05 */ bl HSD_JObjSetFlagsAll -/* 802F149C 002EE07C 80 7D 00 08 */ lwz r3, 8(r29) -/* 802F14A0 002EE080 38 80 00 10 */ li r4, 0x10 -/* 802F14A4 002EE084 48 08 0A F9 */ bl HSD_JObjClearFlagsAll -/* 802F14A8 002EE088 48 00 00 1C */ b .L_802F14C4 -.L_802F14AC: -/* 802F14AC 002EE08C 80 7D 00 08 */ lwz r3, 8(r29) -/* 802F14B0 002EE090 38 80 00 10 */ li r4, 0x10 -/* 802F14B4 002EE094 48 08 08 E9 */ bl HSD_JObjSetFlagsAll -/* 802F14B8 002EE098 38 7D 00 00 */ addi r3, r29, 0 -/* 802F14BC 002EE09C 38 80 00 10 */ li r4, 0x10 -/* 802F14C0 002EE0A0 48 08 0A DD */ bl HSD_JObjClearFlagsAll -.L_802F14C4: -/* 802F14C4 002EE0A4 38 7B 00 00 */ addi r3, r27, 0 -/* 802F14C8 002EE0A8 38 9C 00 00 */ addi r4, r28, 0 -/* 802F14CC 002EE0AC 4B F7 DA 01 */ bl it_8026EECC -/* 802F14D0 002EE0B0 BB 61 00 1C */ lmw r27, 0x1c(r1) -/* 802F14D4 002EE0B4 80 01 00 34 */ lwz r0, 0x34(r1) -/* 802F14D8 002EE0B8 38 21 00 30 */ addi r1, r1, 0x30 -/* 802F14DC 002EE0BC 7C 08 03 A6 */ mtlr r0 -/* 802F14E0 002EE0C0 4E 80 00 20 */ blr - -.global it_802F14E4 -it_802F14E4: -/* 802F14E4 002EE0C4 7C 08 02 A6 */ mflr r0 -/* 802F14E8 002EE0C8 90 01 00 04 */ stw r0, 4(r1) -/* 802F14EC 002EE0CC 38 00 00 00 */ li r0, 0 -/* 802F14F0 002EE0D0 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F14F4 002EE0D4 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 802F14F8 002EE0D8 90 04 0D D8 */ stw r0, 0xdd8(r4) -/* 802F14FC 002EE0DC 90 04 0D D4 */ stw r0, 0xdd4(r4) -/* 802F1500 002EE0E0 90 04 0D E4 */ stw r0, 0xde4(r4) -/* 802F1504 002EE0E4 48 00 00 85 */ bl it_802F1588 -/* 802F1508 002EE0E8 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F150C 002EE0EC 38 21 00 08 */ addi r1, r1, 8 -/* 802F1510 002EE0F0 7C 08 03 A6 */ mtlr r0 -/* 802F1514 002EE0F4 4E 80 00 20 */ blr - -.global it_802F1518 -it_802F1518: -/* 802F1518 002EE0F8 7C 08 02 A6 */ mflr r0 -/* 802F151C 002EE0FC 90 01 00 04 */ stw r0, 4(r1) -/* 802F1520 002EE100 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 802F1524 002EE104 93 E1 00 14 */ stw r31, 0x14(r1) -/* 802F1528 002EE108 7C 7F 1B 78 */ mr r31, r3 -/* 802F152C 002EE10C 80 63 00 2C */ lwz r3, 0x2c(r3) -/* 802F1530 002EE110 80 03 0D D8 */ lwz r0, 0xdd8(r3) -/* 802F1534 002EE114 2C 00 00 00 */ cmpwi r0, 0 -/* 802F1538 002EE118 41 82 00 10 */ beq .L_802F1548 -/* 802F153C 002EE11C 80 63 0D E8 */ lwz r3, 0xde8(r3) -/* 802F1540 002EE120 4B F2 86 F5 */ bl grFigureGet_80219C34 -/* 802F1544 002EE124 48 00 00 28 */ b .L_802F156C -.L_802F1548: -/* 802F1548 002EE128 88 03 0D CA */ lbz r0, 0xdca(r3) -/* 802F154C 002EE12C 54 00 E7 FF */ rlwinm. r0, r0, 0x1c, 0x1f, 0x1f -/* 802F1550 002EE130 41 82 00 1C */ beq .L_802F156C -/* 802F1554 002EE134 80 03 0D D4 */ lwz r0, 0xdd4(r3) -/* 802F1558 002EE138 38 80 00 01 */ li r4, 1 -/* 802F155C 002EE13C 54 03 04 3E */ clrlwi r3, r0, 0x10 -/* 802F1560 002EE140 4B E8 CD 21 */ bl gm_8017E280 -/* 802F1564 002EE144 7F E3 FB 78 */ mr r3, r31 -/* 802F1568 002EE148 4B F8 B8 DD */ bl it_8027CE44 -.L_802F156C: -/* 802F156C 002EE14C 7F E3 FB 78 */ mr r3, r31 -/* 802F1570 002EE150 4B F8 B3 41 */ bl it_8027C8B0 -/* 802F1574 002EE154 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 802F1578 002EE158 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 802F157C 002EE15C 38 21 00 18 */ addi r1, r1, 0x18 -/* 802F1580 002EE160 7C 08 03 A6 */ mtlr r0 -/* 802F1584 002EE164 4E 80 00 20 */ blr - -.global it_802F1588 -it_802F1588: -/* 802F1588 002EE168 7C 08 02 A6 */ mflr r0 -/* 802F158C 002EE16C 38 80 00 00 */ li r4, 0 -/* 802F1590 002EE170 90 01 00 04 */ stw r0, 4(r1) -/* 802F1594 002EE174 38 A0 00 01 */ li r5, 1 -/* 802F1598 002EE178 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F159C 002EE17C 4B F7 78 C1 */ bl Item_80268E5C -/* 802F15A0 002EE180 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F15A4 002EE184 38 21 00 08 */ addi r1, r1, 8 -/* 802F15A8 002EE188 7C 08 03 A6 */ mtlr r0 -/* 802F15AC 002EE18C 4E 80 00 20 */ blr - -.global it_802F15B0 -it_802F15B0: -/* 802F15B0 002EE190 38 60 00 00 */ li r3, 0 -/* 802F15B4 002EE194 4E 80 00 20 */ blr - -.global it_802F15B8 -it_802F15B8: -/* 802F15B8 002EE198 7C 08 02 A6 */ mflr r0 -/* 802F15BC 002EE19C 90 01 00 04 */ stw r0, 4(r1) -/* 802F15C0 002EE1A0 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F15C4 002EE1A4 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 802F15C8 002EE1A8 80 04 0D D8 */ lwz r0, 0xdd8(r4) -/* 802F15CC 002EE1AC 2C 00 00 00 */ cmpwi r0, 0 -/* 802F15D0 002EE1B0 40 82 00 18 */ bne .L_802F15E8 -/* 802F15D4 002EE1B4 80 84 00 CC */ lwz r4, 0xcc(r4) -/* 802F15D8 002EE1B8 C0 24 00 10 */ lfs f1, 0x10(r4) -/* 802F15DC 002EE1BC C0 44 00 14 */ lfs f2, 0x14(r4) -/* 802F15E0 002EE1C0 4B F8 12 81 */ bl it_80272860 -/* 802F15E4 002EE1C4 48 00 00 10 */ b .L_802F15F4 -.L_802F15E8: -/* 802F15E8 002EE1C8 C0 24 0D DC */ lfs f1, 0xddc(r4) -/* 802F15EC 002EE1CC C0 44 0D E0 */ lfs f2, 0xde0(r4) -/* 802F15F0 002EE1D0 4B F8 12 71 */ bl it_80272860 -.L_802F15F4: -/* 802F15F4 002EE1D4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F15F8 002EE1D8 38 21 00 08 */ addi r1, r1, 8 -/* 802F15FC 002EE1DC 7C 08 03 A6 */ mtlr r0 -/* 802F1600 002EE1E0 4E 80 00 20 */ blr - -.global it_802F1604 -it_802F1604: -/* 802F1604 002EE1E4 7C 08 02 A6 */ mflr r0 -/* 802F1608 002EE1E8 3C 80 80 2F */ lis r4, it_802F1630@ha -/* 802F160C 002EE1EC 90 01 00 04 */ stw r0, 4(r1) -/* 802F1610 002EE1F0 38 84 16 30 */ addi r4, r4, it_802F1630@l -/* 802F1614 002EE1F4 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1618 002EE1F8 4B F7 CD FD */ bl it_8026E414 -/* 802F161C 002EE1FC 38 60 00 00 */ li r3, 0 -/* 802F1620 002EE200 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F1624 002EE204 38 21 00 08 */ addi r1, r1, 8 -/* 802F1628 002EE208 7C 08 03 A6 */ mtlr r0 -/* 802F162C 002EE20C 4E 80 00 20 */ blr - -.global it_802F1630 -it_802F1630: -/* 802F1630 002EE210 7C 08 02 A6 */ mflr r0 -/* 802F1634 002EE214 90 01 00 04 */ stw r0, 4(r1) -/* 802F1638 002EE218 94 21 FF C8 */ stwu r1, -0x38(r1) -/* 802F163C 002EE21C 93 E1 00 34 */ stw r31, 0x34(r1) -/* 802F1640 002EE220 93 C1 00 30 */ stw r30, 0x30(r1) -/* 802F1644 002EE224 93 A1 00 2C */ stw r29, 0x2c(r1) -/* 802F1648 002EE228 7C 7D 1B 78 */ mr r29, r3 -/* 802F164C 002EE22C 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 802F1650 002EE230 3C 60 80 40 */ lis r3, it_803F93C8@ha -/* 802F1654 002EE234 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1658 002EE238 3B E3 93 C8 */ addi r31, r3, it_803F93C8@l -/* 802F165C 002EE23C D0 04 00 48 */ stfs f0, 0x48(r4) -/* 802F1660 002EE240 D0 04 00 44 */ stfs f0, 0x44(r4) -/* 802F1664 002EE244 D0 04 00 40 */ stfs f0, 0x40(r4) -/* 802F1668 002EE248 83 DD 00 28 */ lwz r30, 0x28(r29) -/* 802F166C 002EE24C 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1670 002EE250 40 82 00 14 */ bne .L_802F1684 -/* 802F1674 002EE254 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1678 002EE258 38 80 02 7F */ li r4, 0x27f -/* 802F167C 002EE25C 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1680 002EE260 48 09 6B A1 */ bl __assert -.L_802F1684: -/* 802F1684 002EE264 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1688 002EE268 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802F168C 002EE26C 41 82 00 14 */ beq .L_802F16A0 -/* 802F1690 002EE270 38 BF 00 60 */ addi r5, r31, 0x60 -/* 802F1694 002EE274 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1698 002EE278 38 80 02 80 */ li r4, 0x280 -/* 802F169C 002EE27C 48 09 6B 85 */ bl __assert -.L_802F16A0: -/* 802F16A0 002EE280 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F16A4 002EE284 D0 1E 00 1C */ stfs f0, 0x1c(r30) -/* 802F16A8 002EE288 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F16AC 002EE28C 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F16B0 002EE290 40 82 00 4C */ bne .L_802F16FC -/* 802F16B4 002EE294 28 1E 00 00 */ cmplwi r30, 0 -/* 802F16B8 002EE298 41 82 00 44 */ beq .L_802F16FC -/* 802F16BC 002EE29C 40 82 00 14 */ bne .L_802F16D0 -/* 802F16C0 002EE2A0 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F16C4 002EE2A4 38 80 02 34 */ li r4, 0x234 -/* 802F16C8 002EE2A8 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F16CC 002EE2AC 48 09 6B 55 */ bl __assert -.L_802F16D0: -/* 802F16D0 002EE2B0 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802F16D4 002EE2B4 38 60 00 00 */ li r3, 0 -/* 802F16D8 002EE2B8 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F16DC 002EE2BC 40 82 00 10 */ bne .L_802F16EC -/* 802F16E0 002EE2C0 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F16E4 002EE2C4 41 82 00 08 */ beq .L_802F16EC -/* 802F16E8 002EE2C8 38 60 00 01 */ li r3, 1 -.L_802F16EC: -/* 802F16EC 002EE2CC 2C 03 00 00 */ cmpwi r3, 0 -/* 802F16F0 002EE2D0 40 82 00 0C */ bne .L_802F16FC -/* 802F16F4 002EE2D4 7F C3 F3 78 */ mr r3, r30 -/* 802F16F8 002EE2D8 48 08 1B F1 */ bl HSD_JObjSetMtxDirtySub -.L_802F16FC: -/* 802F16FC 002EE2DC 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1700 002EE2E0 40 82 00 14 */ bne .L_802F1714 -/* 802F1704 002EE2E4 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1708 002EE2E8 38 80 02 94 */ li r4, 0x294 -/* 802F170C 002EE2EC 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1710 002EE2F0 48 09 6B 11 */ bl __assert -.L_802F1714: -/* 802F1714 002EE2F4 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1718 002EE2F8 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802F171C 002EE2FC 41 82 00 14 */ beq .L_802F1730 -/* 802F1720 002EE300 38 BF 00 60 */ addi r5, r31, 0x60 -/* 802F1724 002EE304 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1728 002EE308 38 80 02 95 */ li r4, 0x295 -/* 802F172C 002EE30C 48 09 6A F5 */ bl __assert -.L_802F1730: -/* 802F1730 002EE310 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1734 002EE314 D0 1E 00 20 */ stfs f0, 0x20(r30) -/* 802F1738 002EE318 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F173C 002EE31C 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F1740 002EE320 40 82 00 4C */ bne .L_802F178C -/* 802F1744 002EE324 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1748 002EE328 41 82 00 44 */ beq .L_802F178C -/* 802F174C 002EE32C 40 82 00 14 */ bne .L_802F1760 -/* 802F1750 002EE330 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1754 002EE334 38 80 02 34 */ li r4, 0x234 -/* 802F1758 002EE338 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F175C 002EE33C 48 09 6A C5 */ bl __assert -.L_802F1760: -/* 802F1760 002EE340 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802F1764 002EE344 38 60 00 00 */ li r3, 0 -/* 802F1768 002EE348 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F176C 002EE34C 40 82 00 10 */ bne .L_802F177C -/* 802F1770 002EE350 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F1774 002EE354 41 82 00 08 */ beq .L_802F177C -/* 802F1778 002EE358 38 60 00 01 */ li r3, 1 -.L_802F177C: -/* 802F177C 002EE35C 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1780 002EE360 40 82 00 0C */ bne .L_802F178C -/* 802F1784 002EE364 7F C3 F3 78 */ mr r3, r30 -/* 802F1788 002EE368 48 08 1B 61 */ bl HSD_JObjSetMtxDirtySub -.L_802F178C: -/* 802F178C 002EE36C 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1790 002EE370 40 82 00 14 */ bne .L_802F17A4 -/* 802F1794 002EE374 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1798 002EE378 38 80 02 A9 */ li r4, 0x2a9 -/* 802F179C 002EE37C 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F17A0 002EE380 48 09 6A 81 */ bl __assert -.L_802F17A4: -/* 802F17A4 002EE384 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F17A8 002EE388 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802F17AC 002EE38C 41 82 00 14 */ beq .L_802F17C0 -/* 802F17B0 002EE390 38 BF 00 60 */ addi r5, r31, 0x60 -/* 802F17B4 002EE394 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F17B8 002EE398 38 80 02 AA */ li r4, 0x2aa -/* 802F17BC 002EE39C 48 09 6A 65 */ bl __assert -.L_802F17C0: -/* 802F17C0 002EE3A0 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F17C4 002EE3A4 D0 1E 00 24 */ stfs f0, 0x24(r30) -/* 802F17C8 002EE3A8 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F17CC 002EE3AC 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F17D0 002EE3B0 40 82 00 4C */ bne .L_802F181C -/* 802F17D4 002EE3B4 28 1E 00 00 */ cmplwi r30, 0 -/* 802F17D8 002EE3B8 41 82 00 44 */ beq .L_802F181C -/* 802F17DC 002EE3BC 40 82 00 14 */ bne .L_802F17F0 -/* 802F17E0 002EE3C0 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F17E4 002EE3C4 38 80 02 34 */ li r4, 0x234 -/* 802F17E8 002EE3C8 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F17EC 002EE3CC 48 09 6A 35 */ bl __assert -.L_802F17F0: -/* 802F17F0 002EE3D0 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802F17F4 002EE3D4 38 60 00 00 */ li r3, 0 -/* 802F17F8 002EE3D8 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F17FC 002EE3DC 40 82 00 10 */ bne .L_802F180C -/* 802F1800 002EE3E0 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F1804 002EE3E4 41 82 00 08 */ beq .L_802F180C -/* 802F1808 002EE3E8 38 60 00 01 */ li r3, 1 -.L_802F180C: -/* 802F180C 002EE3EC 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1810 002EE3F0 40 82 00 0C */ bne .L_802F181C -/* 802F1814 002EE3F4 7F C3 F3 78 */ mr r3, r30 -/* 802F1818 002EE3F8 48 08 1A D1 */ bl HSD_JObjSetMtxDirtySub -.L_802F181C: -/* 802F181C 002EE3FC 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1820 002EE400 38 80 00 01 */ li r4, 1 -/* 802F1824 002EE404 38 A0 00 01 */ li r5, 1 -/* 802F1828 002EE408 4B F7 76 35 */ bl Item_80268E5C -/* 802F182C 002EE40C 7F A3 EB 78 */ mr r3, r29 -/* 802F1830 002EE410 4B F8 3E A1 */ bl it_802756D0 -/* 802F1834 002EE414 80 01 00 3C */ lwz r0, 0x3c(r1) -/* 802F1838 002EE418 83 E1 00 34 */ lwz r31, 0x34(r1) -/* 802F183C 002EE41C 83 C1 00 30 */ lwz r30, 0x30(r1) -/* 802F1840 002EE420 83 A1 00 2C */ lwz r29, 0x2c(r1) -/* 802F1844 002EE424 38 21 00 38 */ addi r1, r1, 0x38 -/* 802F1848 002EE428 7C 08 03 A6 */ mtlr r0 -/* 802F184C 002EE42C 4E 80 00 20 */ blr - -.global it_802F1850 -it_802F1850: -/* 802F1850 002EE430 38 60 00 00 */ li r3, 0 -/* 802F1854 002EE434 4E 80 00 20 */ blr - -.global it_802F1858 -it_802F1858: -/* 802F1858 002EE438 4E 80 00 20 */ blr - -.global it_802F185C -it_802F185C: -/* 802F185C 002EE43C 7C 08 02 A6 */ mflr r0 -/* 802F1860 002EE440 3C 80 80 2F */ lis r4, it_802F1588@ha -/* 802F1864 002EE444 90 01 00 04 */ stw r0, 4(r1) -/* 802F1868 002EE448 38 84 15 88 */ addi r4, r4, it_802F1588@l -/* 802F186C 002EE44C 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1870 002EE450 4B F7 BD BD */ bl it_8026D62C -/* 802F1874 002EE454 38 60 00 00 */ li r3, 0 -/* 802F1878 002EE458 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F187C 002EE45C 38 21 00 08 */ addi r1, r1, 8 -/* 802F1880 002EE460 7C 08 03 A6 */ mtlr r0 -/* 802F1884 002EE464 4E 80 00 20 */ blr - -.global it_802F1888 -it_802F1888: -/* 802F1888 002EE468 7C 08 02 A6 */ mflr r0 -/* 802F188C 002EE46C 90 01 00 04 */ stw r0, 4(r1) -/* 802F1890 002EE470 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 802F1894 002EE474 93 E1 00 14 */ stw r31, 0x14(r1) -/* 802F1898 002EE478 7C 7F 1B 78 */ mr r31, r3 -/* 802F189C 002EE47C 80 63 00 28 */ lwz r3, 0x28(r3) -/* 802F18A0 002EE480 28 03 00 00 */ cmplwi r3, 0 -/* 802F18A4 002EE484 40 82 00 0C */ bne .L_802F18B0 -/* 802F18A8 002EE488 38 00 00 00 */ li r0, 0 -/* 802F18AC 002EE48C 48 00 00 08 */ b .L_802F18B4 -.L_802F18B0: -/* 802F18B0 002EE490 80 03 00 10 */ lwz r0, 0x10(r3) -.L_802F18B4: -/* 802F18B4 002EE494 7C 03 03 78 */ mr r3, r0 -/* 802F18B8 002EE498 38 80 00 10 */ li r4, 0x10 -/* 802F18BC 002EE49C 48 08 06 E1 */ bl HSD_JObjClearFlagsAll -/* 802F18C0 002EE4A0 38 7F 00 00 */ addi r3, r31, 0 -/* 802F18C4 002EE4A4 38 80 00 02 */ li r4, 2 -/* 802F18C8 002EE4A8 38 A0 00 01 */ li r5, 1 -/* 802F18CC 002EE4AC 4B F7 75 91 */ bl Item_80268E5C -/* 802F18D0 002EE4B0 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 802F18D4 002EE4B4 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 802F18D8 002EE4B8 38 21 00 18 */ addi r1, r1, 0x18 -/* 802F18DC 002EE4BC 7C 08 03 A6 */ mtlr r0 -/* 802F18E0 002EE4C0 4E 80 00 20 */ blr - -.global it_802F18E4 -it_802F18E4: -/* 802F18E4 002EE4C4 38 60 00 00 */ li r3, 0 -/* 802F18E8 002EE4C8 4E 80 00 20 */ blr - -.global it_802F18EC -it_802F18EC: -/* 802F18EC 002EE4CC 4E 80 00 20 */ blr - -.global it_802F18F0 -it_802F18F0: -/* 802F18F0 002EE4D0 7C 08 02 A6 */ mflr r0 -/* 802F18F4 002EE4D4 90 01 00 04 */ stw r0, 4(r1) -/* 802F18F8 002EE4D8 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F18FC 002EE4DC 4B F7 9F 99 */ bl it_8026B894 -/* 802F1900 002EE4E0 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F1904 002EE4E4 38 21 00 08 */ addi r1, r1, 8 -/* 802F1908 002EE4E8 7C 08 03 A6 */ mtlr r0 -/* 802F190C 002EE4EC 4E 80 00 20 */ blr - -.global it_802F1910 -it_802F1910: -/* 802F1910 002EE4F0 7C 08 02 A6 */ mflr r0 -/* 802F1914 002EE4F4 90 01 00 04 */ stw r0, 4(r1) -/* 802F1918 002EE4F8 94 21 FF B8 */ stwu r1, -0x48(r1) -/* 802F191C 002EE4FC 93 E1 00 44 */ stw r31, 0x44(r1) -/* 802F1920 002EE500 93 C1 00 40 */ stw r30, 0x40(r1) -/* 802F1924 002EE504 93 A1 00 3C */ stw r29, 0x3c(r1) -/* 802F1928 002EE508 7C 7D 1B 78 */ mr r29, r3 -/* 802F192C 002EE50C 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802F1930 002EE510 80 9F 00 C4 */ lwz r4, 0xc4(r31) -/* 802F1934 002EE514 7F E3 FB 78 */ mr r3, r31 -/* 802F1938 002EE518 83 C4 00 04 */ lwz r30, 4(r4) -/* 802F193C 002EE51C 4B F8 49 81 */ bl it_802762BC -/* 802F1940 002EE520 7F A3 EB 78 */ mr r3, r29 -/* 802F1944 002EE524 4B F8 B2 B9 */ bl it_8027CBFC -/* 802F1948 002EE528 80 9F 0C 9C */ lwz r4, 0xc9c(r31) -/* 802F194C 002EE52C 3C 00 43 30 */ lis r0, 0x4330 -/* 802F1950 002EE530 C8 42 DF E8 */ lfd f2, it_804DD9C8@sda21(r2) -/* 802F1954 002EE534 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1958 002EE538 6C 84 80 00 */ xoris r4, r4, 0x8000 -/* 802F195C 002EE53C 90 81 00 34 */ stw r4, 0x34(r1) -/* 802F1960 002EE540 38 9F 00 40 */ addi r4, r31, 0x40 -/* 802F1964 002EE544 90 01 00 30 */ stw r0, 0x30(r1) -/* 802F1968 002EE548 C8 01 00 30 */ lfd f0, 0x30(r1) -/* 802F196C 002EE54C EC 00 10 28 */ fsubs f0, f0, f2 -/* 802F1970 002EE550 EC 00 08 2A */ fadds f0, f0, f1 -/* 802F1974 002EE554 FC 00 00 1E */ fctiwz f0, f0 -/* 802F1978 002EE558 D8 01 00 28 */ stfd f0, 0x28(r1) -/* 802F197C 002EE55C 80 01 00 2C */ lwz r0, 0x2c(r1) -/* 802F1980 002EE560 90 1F 0C 9C */ stw r0, 0xc9c(r31) -/* 802F1984 002EE564 4B F8 9E 15 */ bl it_8027B798 -/* 802F1988 002EE568 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 802F198C 002EE56C C0 22 DF D8 */ lfs f1, it_804DD9B8@sda21(r2) -/* 802F1990 002EE570 FC 00 08 00 */ fcmpu cr0, f0, f1 -/* 802F1994 002EE574 40 82 00 28 */ bne .L_802F19BC -/* 802F1998 002EE578 C0 1F 00 44 */ lfs f0, 0x44(r31) -/* 802F199C 002EE57C FC 00 08 00 */ fcmpu cr0, f0, f1 -/* 802F19A0 002EE580 40 82 00 1C */ bne .L_802F19BC -/* 802F19A4 002EE584 C0 1F 0C CC */ lfs f0, 0xccc(r31) -/* 802F19A8 002EE588 C0 22 DF DC */ lfs f1, it_804DD9BC@sda21(r2) -/* 802F19AC 002EE58C FC 00 00 50 */ fneg f0, f0 -/* 802F19B0 002EE590 EC 01 00 32 */ fmuls f0, f1, f0 -/* 802F19B4 002EE594 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 802F19B8 002EE598 D0 3F 00 44 */ stfs f1, 0x44(r31) -.L_802F19BC: -/* 802F19BC 002EE59C 38 7F 00 40 */ addi r3, r31, 0x40 -/* 802F19C0 002EE5A0 4B D1 B9 2D */ bl lbVector_Normalize -/* 802F19C4 002EE5A4 C0 3F 00 4C */ lfs f1, 0x4c(r31) -/* 802F19C8 002EE5A8 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F19CC 002EE5AC FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F19D0 002EE5B0 40 81 00 20 */ ble .L_802F19F0 -/* 802F19D4 002EE5B4 C0 22 DF E0 */ lfs f1, it_804DD9C0@sda21(r2) -/* 802F19D8 002EE5B8 C0 1F 0C CC */ lfs f0, 0xccc(r31) -/* 802F19DC 002EE5BC FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 802F19E0 002EE5C0 40 82 00 10 */ bne .L_802F19F0 -/* 802F19E4 002EE5C4 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 802F19E8 002EE5C8 EC 00 00 72 */ fmuls f0, f0, f1 -/* 802F19EC 002EE5CC D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_802F19F0: -/* 802F19F0 002EE5D0 C0 3F 00 4C */ lfs f1, 0x4c(r31) -/* 802F19F4 002EE5D4 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F19F8 002EE5D8 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F19FC 002EE5DC 40 80 00 24 */ bge .L_802F1A20 -/* 802F1A00 002EE5E0 C0 22 DF E4 */ lfs f1, it_804DD9C4@sda21(r2) -/* 802F1A04 002EE5E4 C0 1F 0C CC */ lfs f0, 0xccc(r31) -/* 802F1A08 002EE5E8 FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 802F1A0C 002EE5EC 40 82 00 14 */ bne .L_802F1A20 -/* 802F1A10 002EE5F0 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 802F1A14 002EE5F4 C0 02 DF E0 */ lfs f0, it_804DD9C0@sda21(r2) -/* 802F1A18 002EE5F8 EC 01 00 32 */ fmuls f0, f1, f0 -/* 802F1A1C 002EE5FC D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_802F1A20: -/* 802F1A20 002EE600 C0 3F 00 4C */ lfs f1, 0x4c(r31) -/* 802F1A24 002EE604 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1A28 002EE608 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F1A2C 002EE60C 40 81 00 B0 */ ble .L_802F1ADC -/* 802F1A30 002EE610 C0 22 DF E0 */ lfs f1, it_804DD9C0@sda21(r2) -/* 802F1A34 002EE614 C0 1F 0C CC */ lfs f0, 0xccc(r31) -/* 802F1A38 002EE618 FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 802F1A3C 002EE61C 40 82 00 44 */ bne .L_802F1A80 -/* 802F1A40 002EE620 80 7F 0C 9C */ lwz r3, 0xc9c(r31) -/* 802F1A44 002EE624 3C 00 43 30 */ lis r0, 0x4330 -/* 802F1A48 002EE628 C8 22 DF E8 */ lfd f1, it_804DD9C8@sda21(r2) -/* 802F1A4C 002EE62C 6C 63 80 00 */ xoris r3, r3, 0x8000 -/* 802F1A50 002EE630 C0 5E 00 24 */ lfs f2, 0x24(r30) -/* 802F1A54 002EE634 90 61 00 2C */ stw r3, 0x2c(r1) -/* 802F1A58 002EE638 C0 7E 00 30 */ lfs f3, 0x30(r30) -/* 802F1A5C 002EE63C 90 01 00 28 */ stw r0, 0x28(r1) -/* 802F1A60 002EE640 C0 9F 00 40 */ lfs f4, 0x40(r31) -/* 802F1A64 002EE644 C8 01 00 28 */ lfd f0, 0x28(r1) -/* 802F1A68 002EE648 EC 00 08 28 */ fsubs f0, f0, f1 -/* 802F1A6C 002EE64C EC 02 00 2A */ fadds f0, f2, f0 -/* 802F1A70 002EE650 EC 03 00 32 */ fmuls f0, f3, f0 -/* 802F1A74 002EE654 EC 04 00 32 */ fmuls f0, f4, f0 -/* 802F1A78 002EE658 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 802F1A7C 002EE65C 48 00 00 40 */ b .L_802F1ABC -.L_802F1A80: -/* 802F1A80 002EE660 80 7F 0C 9C */ lwz r3, 0xc9c(r31) -/* 802F1A84 002EE664 3C 00 43 30 */ lis r0, 0x4330 -/* 802F1A88 002EE668 C8 22 DF E8 */ lfd f1, it_804DD9C8@sda21(r2) -/* 802F1A8C 002EE66C 6C 63 80 00 */ xoris r3, r3, 0x8000 -/* 802F1A90 002EE670 C0 5E 00 24 */ lfs f2, 0x24(r30) -/* 802F1A94 002EE674 90 61 00 2C */ stw r3, 0x2c(r1) -/* 802F1A98 002EE678 C0 7E 00 2C */ lfs f3, 0x2c(r30) -/* 802F1A9C 002EE67C 90 01 00 28 */ stw r0, 0x28(r1) -/* 802F1AA0 002EE680 C0 9F 00 40 */ lfs f4, 0x40(r31) -/* 802F1AA4 002EE684 C8 01 00 28 */ lfd f0, 0x28(r1) -/* 802F1AA8 002EE688 EC 00 08 28 */ fsubs f0, f0, f1 -/* 802F1AAC 002EE68C EC 02 00 2A */ fadds f0, f2, f0 -/* 802F1AB0 002EE690 EC 03 00 32 */ fmuls f0, f3, f0 -/* 802F1AB4 002EE694 EC 04 00 32 */ fmuls f0, f4, f0 -/* 802F1AB8 002EE698 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_802F1ABC: -/* 802F1ABC 002EE69C C0 1E 00 3C */ lfs f0, 0x3c(r30) -/* 802F1AC0 002EE6A0 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 802F1AC4 002EE6A4 FC 00 00 50 */ fneg f0, f0 -/* 802F1AC8 002EE6A8 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F1ACC 002EE6AC 4C 40 13 82 */ cror 2, 0, 2 -/* 802F1AD0 002EE6B0 40 82 00 B0 */ bne .L_802F1B80 -/* 802F1AD4 002EE6B4 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 802F1AD8 002EE6B8 48 00 00 A8 */ b .L_802F1B80 -.L_802F1ADC: -/* 802F1ADC 002EE6BC C0 22 DF E0 */ lfs f1, it_804DD9C0@sda21(r2) -/* 802F1AE0 002EE6C0 C0 1F 0C CC */ lfs f0, 0xccc(r31) -/* 802F1AE4 002EE6C4 FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 802F1AE8 002EE6C8 40 82 00 44 */ bne .L_802F1B2C -/* 802F1AEC 002EE6CC 80 7F 0C 9C */ lwz r3, 0xc9c(r31) -/* 802F1AF0 002EE6D0 3C 00 43 30 */ lis r0, 0x4330 -/* 802F1AF4 002EE6D4 C8 22 DF E8 */ lfd f1, it_804DD9C8@sda21(r2) -/* 802F1AF8 002EE6D8 6C 63 80 00 */ xoris r3, r3, 0x8000 -/* 802F1AFC 002EE6DC C0 5E 00 24 */ lfs f2, 0x24(r30) -/* 802F1B00 002EE6E0 90 61 00 2C */ stw r3, 0x2c(r1) -/* 802F1B04 002EE6E4 C0 7E 00 2C */ lfs f3, 0x2c(r30) -/* 802F1B08 002EE6E8 90 01 00 28 */ stw r0, 0x28(r1) -/* 802F1B0C 002EE6EC C0 9F 00 40 */ lfs f4, 0x40(r31) -/* 802F1B10 002EE6F0 C8 01 00 28 */ lfd f0, 0x28(r1) -/* 802F1B14 002EE6F4 EC 00 08 28 */ fsubs f0, f0, f1 -/* 802F1B18 002EE6F8 EC 02 00 2A */ fadds f0, f2, f0 -/* 802F1B1C 002EE6FC EC 03 00 32 */ fmuls f0, f3, f0 -/* 802F1B20 002EE700 EC 04 00 32 */ fmuls f0, f4, f0 -/* 802F1B24 002EE704 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 802F1B28 002EE708 48 00 00 40 */ b .L_802F1B68 -.L_802F1B2C: -/* 802F1B2C 002EE70C 80 7F 0C 9C */ lwz r3, 0xc9c(r31) -/* 802F1B30 002EE710 3C 00 43 30 */ lis r0, 0x4330 -/* 802F1B34 002EE714 C8 22 DF E8 */ lfd f1, it_804DD9C8@sda21(r2) -/* 802F1B38 002EE718 6C 63 80 00 */ xoris r3, r3, 0x8000 -/* 802F1B3C 002EE71C C0 5E 00 24 */ lfs f2, 0x24(r30) -/* 802F1B40 002EE720 90 61 00 2C */ stw r3, 0x2c(r1) -/* 802F1B44 002EE724 C0 7E 00 30 */ lfs f3, 0x30(r30) -/* 802F1B48 002EE728 90 01 00 28 */ stw r0, 0x28(r1) -/* 802F1B4C 002EE72C C0 9F 00 40 */ lfs f4, 0x40(r31) -/* 802F1B50 002EE730 C8 01 00 28 */ lfd f0, 0x28(r1) -/* 802F1B54 002EE734 EC 00 08 28 */ fsubs f0, f0, f1 -/* 802F1B58 002EE738 EC 02 00 2A */ fadds f0, f2, f0 -/* 802F1B5C 002EE73C EC 03 00 32 */ fmuls f0, f3, f0 -/* 802F1B60 002EE740 EC 04 00 32 */ fmuls f0, f4, f0 -/* 802F1B64 002EE744 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_802F1B68: -/* 802F1B68 002EE748 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 802F1B6C 002EE74C C0 3E 00 3C */ lfs f1, 0x3c(r30) -/* 802F1B70 002EE750 FC 00 08 40 */ fcmpo cr0, f0, f1 -/* 802F1B74 002EE754 4C 41 13 82 */ cror 2, 1, 2 -/* 802F1B78 002EE758 40 82 00 08 */ bne .L_802F1B80 -/* 802F1B7C 002EE75C D0 3F 00 40 */ stfs f1, 0x40(r31) -.L_802F1B80: -/* 802F1B80 002EE760 80 7F 0C 9C */ lwz r3, 0xc9c(r31) -/* 802F1B84 002EE764 3C 00 43 30 */ lis r0, 0x4330 -/* 802F1B88 002EE768 C8 22 DF E8 */ lfd f1, it_804DD9C8@sda21(r2) -/* 802F1B8C 002EE76C 6C 63 80 00 */ xoris r3, r3, 0x8000 -/* 802F1B90 002EE770 C0 5E 00 28 */ lfs f2, 0x28(r30) -/* 802F1B94 002EE774 90 61 00 2C */ stw r3, 0x2c(r1) -/* 802F1B98 002EE778 C0 7E 00 38 */ lfs f3, 0x38(r30) -/* 802F1B9C 002EE77C 90 01 00 28 */ stw r0, 0x28(r1) -/* 802F1BA0 002EE780 C0 9F 00 44 */ lfs f4, 0x44(r31) -/* 802F1BA4 002EE784 C8 01 00 28 */ lfd f0, 0x28(r1) -/* 802F1BA8 002EE788 EC 00 08 28 */ fsubs f0, f0, f1 -/* 802F1BAC 002EE78C EC 02 00 2A */ fadds f0, f2, f0 -/* 802F1BB0 002EE790 EC 03 00 32 */ fmuls f0, f3, f0 -/* 802F1BB4 002EE794 EC 04 00 32 */ fmuls f0, f4, f0 -/* 802F1BB8 002EE798 D0 1F 00 44 */ stfs f0, 0x44(r31) -/* 802F1BBC 002EE79C C0 1F 00 44 */ lfs f0, 0x44(r31) -/* 802F1BC0 002EE7A0 C0 3E 00 40 */ lfs f1, 0x40(r30) -/* 802F1BC4 002EE7A4 FC 00 08 40 */ fcmpo cr0, f0, f1 -/* 802F1BC8 002EE7A8 4C 41 13 82 */ cror 2, 1, 2 -/* 802F1BCC 002EE7AC 40 82 00 08 */ bne .L_802F1BD4 -/* 802F1BD0 002EE7B0 D0 3F 00 44 */ stfs f1, 0x44(r31) -.L_802F1BD4: -/* 802F1BD4 002EE7B4 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1BD8 002EE7B8 38 00 00 00 */ li r0, 0 -/* 802F1BDC 002EE7BC D0 1F 00 48 */ stfs f0, 0x48(r31) -/* 802F1BE0 002EE7C0 90 1F 0C 9C */ stw r0, 0xc9c(r31) -/* 802F1BE4 002EE7C4 80 1F 0D D8 */ lwz r0, 0xdd8(r31) -/* 802F1BE8 002EE7C8 2C 00 00 03 */ cmpwi r0, 3 -/* 802F1BEC 002EE7CC 41 82 00 28 */ beq .L_802F1C14 -/* 802F1BF0 002EE7D0 40 80 00 38 */ bge .L_802F1C28 -/* 802F1BF4 002EE7D4 2C 00 00 02 */ cmpwi r0, 2 -/* 802F1BF8 002EE7D8 40 80 00 08 */ bge .L_802F1C00 -/* 802F1BFC 002EE7DC 48 00 00 2C */ b .L_802F1C28 -.L_802F1C00: -/* 802F1C00 002EE7E0 C0 3F 0D DC */ lfs f1, 0xddc(r31) -/* 802F1C04 002EE7E4 C0 1E 00 14 */ lfs f0, 0x14(r30) -/* 802F1C08 002EE7E8 EC 01 00 2A */ fadds f0, f1, f0 -/* 802F1C0C 002EE7EC D0 1F 0D DC */ stfs f0, 0xddc(r31) -/* 802F1C10 002EE7F0 48 00 00 28 */ b .L_802F1C38 -.L_802F1C14: -/* 802F1C14 002EE7F4 C0 3F 0D DC */ lfs f1, 0xddc(r31) -/* 802F1C18 002EE7F8 C0 1E 00 20 */ lfs f0, 0x20(r30) -/* 802F1C1C 002EE7FC EC 01 00 2A */ fadds f0, f1, f0 -/* 802F1C20 002EE800 D0 1F 0D DC */ stfs f0, 0xddc(r31) -/* 802F1C24 002EE804 48 00 00 14 */ b .L_802F1C38 -.L_802F1C28: -/* 802F1C28 002EE808 C0 3F 0D DC */ lfs f1, 0xddc(r31) -/* 802F1C2C 002EE80C C0 1E 00 08 */ lfs f0, 8(r30) -/* 802F1C30 002EE810 EC 01 00 2A */ fadds f0, f1, f0 -/* 802F1C34 002EE814 D0 1F 0D DC */ stfs f0, 0xddc(r31) -.L_802F1C38: -/* 802F1C38 002EE818 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1C3C 002EE81C 38 80 00 03 */ li r4, 3 -/* 802F1C40 002EE820 38 A0 00 01 */ li r5, 1 -/* 802F1C44 002EE824 4B F7 72 19 */ bl Item_80268E5C -/* 802F1C48 002EE828 80 01 00 4C */ lwz r0, 0x4c(r1) -/* 802F1C4C 002EE82C 38 60 00 00 */ li r3, 0 -/* 802F1C50 002EE830 83 E1 00 44 */ lwz r31, 0x44(r1) -/* 802F1C54 002EE834 83 C1 00 40 */ lwz r30, 0x40(r1) -/* 802F1C58 002EE838 83 A1 00 3C */ lwz r29, 0x3c(r1) -/* 802F1C5C 002EE83C 38 21 00 48 */ addi r1, r1, 0x48 -/* 802F1C60 002EE840 7C 08 03 A6 */ mtlr r0 -/* 802F1C64 002EE844 4E 80 00 20 */ blr - -.global it_802F1C68 -it_802F1C68: -/* 802F1C68 002EE848 38 60 00 00 */ li r3, 0 -/* 802F1C6C 002EE84C 4E 80 00 20 */ blr - -.global it_802F1C70 -it_802F1C70: -/* 802F1C70 002EE850 7C 08 02 A6 */ mflr r0 -/* 802F1C74 002EE854 90 01 00 04 */ stw r0, 4(r1) -/* 802F1C78 002EE858 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1C7C 002EE85C 80 A3 00 2C */ lwz r5, 0x2c(r3) -/* 802F1C80 002EE860 80 85 00 C4 */ lwz r4, 0xc4(r5) -/* 802F1C84 002EE864 C0 25 00 40 */ lfs f1, 0x40(r5) -/* 802F1C88 002EE868 80 84 00 04 */ lwz r4, 4(r4) -/* 802F1C8C 002EE86C C0 04 00 34 */ lfs f0, 0x34(r4) -/* 802F1C90 002EE870 EC 01 00 32 */ fmuls f0, f1, f0 -/* 802F1C94 002EE874 D0 05 00 40 */ stfs f0, 0x40(r5) -/* 802F1C98 002EE878 C0 25 0D DC */ lfs f1, 0xddc(r5) -/* 802F1C9C 002EE87C C0 45 0D E0 */ lfs f2, 0xde0(r5) -/* 802F1CA0 002EE880 4B F8 0B C1 */ bl it_80272860 -/* 802F1CA4 002EE884 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F1CA8 002EE888 38 21 00 08 */ addi r1, r1, 8 -/* 802F1CAC 002EE88C 7C 08 03 A6 */ mtlr r0 -/* 802F1CB0 002EE890 4E 80 00 20 */ blr - -.global it_802F1CB4 -it_802F1CB4: -/* 802F1CB4 002EE894 7C 08 02 A6 */ mflr r0 -/* 802F1CB8 002EE898 3C 80 80 2F */ lis r4, it_802F1630@ha -/* 802F1CBC 002EE89C 90 01 00 04 */ stw r0, 4(r1) -/* 802F1CC0 002EE8A0 38 84 16 30 */ addi r4, r4, it_802F1630@l -/* 802F1CC4 002EE8A4 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1CC8 002EE8A8 4B F7 C4 95 */ bl it_8026E15C -/* 802F1CCC 002EE8AC 38 60 00 00 */ li r3, 0 -/* 802F1CD0 002EE8B0 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F1CD4 002EE8B4 38 21 00 08 */ addi r1, r1, 8 -/* 802F1CD8 002EE8B8 7C 08 03 A6 */ mtlr r0 -/* 802F1CDC 002EE8BC 4E 80 00 20 */ blr - -.global it_802F1CE0 -it_802F1CE0: -/* 802F1CE0 002EE8C0 7C 08 02 A6 */ mflr r0 -/* 802F1CE4 002EE8C4 90 01 00 04 */ stw r0, 4(r1) -/* 802F1CE8 002EE8C8 94 21 FF C8 */ stwu r1, -0x38(r1) -/* 802F1CEC 002EE8CC 93 E1 00 34 */ stw r31, 0x34(r1) -/* 802F1CF0 002EE8D0 93 C1 00 30 */ stw r30, 0x30(r1) -/* 802F1CF4 002EE8D4 93 A1 00 2C */ stw r29, 0x2c(r1) -/* 802F1CF8 002EE8D8 7C 7D 1B 78 */ mr r29, r3 -/* 802F1CFC 002EE8DC 83 C3 00 28 */ lwz r30, 0x28(r3) -/* 802F1D00 002EE8E0 3C 60 80 40 */ lis r3, it_803F93C8@ha -/* 802F1D04 002EE8E4 3B E3 93 C8 */ addi r31, r3, it_803F93C8@l -/* 802F1D08 002EE8E8 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1D0C 002EE8EC 40 82 00 14 */ bne .L_802F1D20 -/* 802F1D10 002EE8F0 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1D14 002EE8F4 38 80 02 7F */ li r4, 0x27f -/* 802F1D18 002EE8F8 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1D1C 002EE8FC 48 09 65 05 */ bl __assert -.L_802F1D20: -/* 802F1D20 002EE900 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1D24 002EE904 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802F1D28 002EE908 41 82 00 14 */ beq .L_802F1D3C -/* 802F1D2C 002EE90C 38 BF 00 60 */ addi r5, r31, 0x60 -/* 802F1D30 002EE910 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1D34 002EE914 38 80 02 80 */ li r4, 0x280 -/* 802F1D38 002EE918 48 09 64 E9 */ bl __assert -.L_802F1D3C: -/* 802F1D3C 002EE91C C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1D40 002EE920 D0 1E 00 1C */ stfs f0, 0x1c(r30) -/* 802F1D44 002EE924 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1D48 002EE928 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F1D4C 002EE92C 40 82 00 4C */ bne .L_802F1D98 -/* 802F1D50 002EE930 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1D54 002EE934 41 82 00 44 */ beq .L_802F1D98 -/* 802F1D58 002EE938 40 82 00 14 */ bne .L_802F1D6C -/* 802F1D5C 002EE93C 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1D60 002EE940 38 80 02 34 */ li r4, 0x234 -/* 802F1D64 002EE944 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1D68 002EE948 48 09 64 B9 */ bl __assert -.L_802F1D6C: -/* 802F1D6C 002EE94C 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802F1D70 002EE950 38 60 00 00 */ li r3, 0 -/* 802F1D74 002EE954 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F1D78 002EE958 40 82 00 10 */ bne .L_802F1D88 -/* 802F1D7C 002EE95C 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F1D80 002EE960 41 82 00 08 */ beq .L_802F1D88 -/* 802F1D84 002EE964 38 60 00 01 */ li r3, 1 -.L_802F1D88: -/* 802F1D88 002EE968 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1D8C 002EE96C 40 82 00 0C */ bne .L_802F1D98 -/* 802F1D90 002EE970 7F C3 F3 78 */ mr r3, r30 -/* 802F1D94 002EE974 48 08 15 55 */ bl HSD_JObjSetMtxDirtySub -.L_802F1D98: -/* 802F1D98 002EE978 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1D9C 002EE97C 40 82 00 14 */ bne .L_802F1DB0 -/* 802F1DA0 002EE980 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1DA4 002EE984 38 80 02 94 */ li r4, 0x294 -/* 802F1DA8 002EE988 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1DAC 002EE98C 48 09 64 75 */ bl __assert -.L_802F1DB0: -/* 802F1DB0 002EE990 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1DB4 002EE994 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802F1DB8 002EE998 41 82 00 14 */ beq .L_802F1DCC -/* 802F1DBC 002EE99C 38 BF 00 60 */ addi r5, r31, 0x60 -/* 802F1DC0 002EE9A0 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1DC4 002EE9A4 38 80 02 95 */ li r4, 0x295 -/* 802F1DC8 002EE9A8 48 09 64 59 */ bl __assert -.L_802F1DCC: -/* 802F1DCC 002EE9AC C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1DD0 002EE9B0 D0 1E 00 20 */ stfs f0, 0x20(r30) -/* 802F1DD4 002EE9B4 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1DD8 002EE9B8 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F1DDC 002EE9BC 40 82 00 4C */ bne .L_802F1E28 -/* 802F1DE0 002EE9C0 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1DE4 002EE9C4 41 82 00 44 */ beq .L_802F1E28 -/* 802F1DE8 002EE9C8 40 82 00 14 */ bne .L_802F1DFC -/* 802F1DEC 002EE9CC 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1DF0 002EE9D0 38 80 02 34 */ li r4, 0x234 -/* 802F1DF4 002EE9D4 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1DF8 002EE9D8 48 09 64 29 */ bl __assert -.L_802F1DFC: -/* 802F1DFC 002EE9DC 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802F1E00 002EE9E0 38 60 00 00 */ li r3, 0 -/* 802F1E04 002EE9E4 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F1E08 002EE9E8 40 82 00 10 */ bne .L_802F1E18 -/* 802F1E0C 002EE9EC 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F1E10 002EE9F0 41 82 00 08 */ beq .L_802F1E18 -/* 802F1E14 002EE9F4 38 60 00 01 */ li r3, 1 -.L_802F1E18: -/* 802F1E18 002EE9F8 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1E1C 002EE9FC 40 82 00 0C */ bne .L_802F1E28 -/* 802F1E20 002EEA00 7F C3 F3 78 */ mr r3, r30 -/* 802F1E24 002EEA04 48 08 14 C5 */ bl HSD_JObjSetMtxDirtySub -.L_802F1E28: -/* 802F1E28 002EEA08 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1E2C 002EEA0C 40 82 00 14 */ bne .L_802F1E40 -/* 802F1E30 002EEA10 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1E34 002EEA14 38 80 02 A9 */ li r4, 0x2a9 -/* 802F1E38 002EEA18 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1E3C 002EEA1C 48 09 63 E5 */ bl __assert -.L_802F1E40: -/* 802F1E40 002EEA20 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1E44 002EEA24 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802F1E48 002EEA28 41 82 00 14 */ beq .L_802F1E5C -/* 802F1E4C 002EEA2C 38 BF 00 60 */ addi r5, r31, 0x60 -/* 802F1E50 002EEA30 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1E54 002EEA34 38 80 02 AA */ li r4, 0x2aa -/* 802F1E58 002EEA38 48 09 63 C9 */ bl __assert -.L_802F1E5C: -/* 802F1E5C 002EEA3C C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1E60 002EEA40 D0 1E 00 24 */ stfs f0, 0x24(r30) -/* 802F1E64 002EEA44 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802F1E68 002EEA48 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F1E6C 002EEA4C 40 82 00 4C */ bne .L_802F1EB8 -/* 802F1E70 002EEA50 28 1E 00 00 */ cmplwi r30, 0 -/* 802F1E74 002EEA54 41 82 00 44 */ beq .L_802F1EB8 -/* 802F1E78 002EEA58 40 82 00 14 */ bne .L_802F1E8C -/* 802F1E7C 002EEA5C 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F1E80 002EEA60 38 80 02 34 */ li r4, 0x234 -/* 802F1E84 002EEA64 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F1E88 002EEA68 48 09 63 99 */ bl __assert -.L_802F1E8C: -/* 802F1E8C 002EEA6C 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802F1E90 002EEA70 38 60 00 00 */ li r3, 0 -/* 802F1E94 002EEA74 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F1E98 002EEA78 40 82 00 10 */ bne .L_802F1EA8 -/* 802F1E9C 002EEA7C 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F1EA0 002EEA80 41 82 00 08 */ beq .L_802F1EA8 -/* 802F1EA4 002EEA84 38 60 00 01 */ li r3, 1 -.L_802F1EA8: -/* 802F1EA8 002EEA88 2C 03 00 00 */ cmpwi r3, 0 -/* 802F1EAC 002EEA8C 40 82 00 0C */ bne .L_802F1EB8 -/* 802F1EB0 002EEA90 7F C3 F3 78 */ mr r3, r30 -/* 802F1EB4 002EEA94 48 08 14 35 */ bl HSD_JObjSetMtxDirtySub -.L_802F1EB8: -/* 802F1EB8 002EEA98 38 7D 00 00 */ addi r3, r29, 0 -/* 802F1EBC 002EEA9C 38 80 00 04 */ li r4, 4 -/* 802F1EC0 002EEAA0 38 A0 00 01 */ li r5, 1 -/* 802F1EC4 002EEAA4 4B F7 6F 99 */ bl Item_80268E5C -/* 802F1EC8 002EEAA8 80 01 00 3C */ lwz r0, 0x3c(r1) -/* 802F1ECC 002EEAAC 83 E1 00 34 */ lwz r31, 0x34(r1) -/* 802F1ED0 002EEAB0 83 C1 00 30 */ lwz r30, 0x30(r1) -/* 802F1ED4 002EEAB4 83 A1 00 2C */ lwz r29, 0x2c(r1) -/* 802F1ED8 002EEAB8 38 21 00 38 */ addi r1, r1, 0x38 -/* 802F1EDC 002EEABC 7C 08 03 A6 */ mtlr r0 -/* 802F1EE0 002EEAC0 4E 80 00 20 */ blr - -.global it_802F1EE4 -it_802F1EE4: -/* 802F1EE4 002EEAC4 38 60 00 00 */ li r3, 0 -/* 802F1EE8 002EEAC8 4E 80 00 20 */ blr - -.global it_802F1EEC -it_802F1EEC: -/* 802F1EEC 002EEACC 7C 08 02 A6 */ mflr r0 -/* 802F1EF0 002EEAD0 90 01 00 04 */ stw r0, 4(r1) -/* 802F1EF4 002EEAD4 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1EF8 002EEAD8 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 802F1EFC 002EEADC 80 84 00 CC */ lwz r4, 0xcc(r4) -/* 802F1F00 002EEAE0 C0 24 00 10 */ lfs f1, 0x10(r4) -/* 802F1F04 002EEAE4 C0 44 00 14 */ lfs f2, 0x14(r4) -/* 802F1F08 002EEAE8 4B F8 09 59 */ bl it_80272860 -/* 802F1F0C 002EEAEC 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F1F10 002EEAF0 38 21 00 08 */ addi r1, r1, 8 -/* 802F1F14 002EEAF4 7C 08 03 A6 */ mtlr r0 -/* 802F1F18 002EEAF8 4E 80 00 20 */ blr - -.global it_802F1F1C -it_802F1F1C: -/* 802F1F1C 002EEAFC 7C 08 02 A6 */ mflr r0 -/* 802F1F20 002EEB00 3C 80 80 2F */ lis r4, it_802F1630@ha -/* 802F1F24 002EEB04 90 01 00 04 */ stw r0, 4(r1) -/* 802F1F28 002EEB08 38 84 16 30 */ addi r4, r4, it_802F1630@l -/* 802F1F2C 002EEB0C 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1F30 002EEB10 4B F7 C4 E5 */ bl it_8026E414 -/* 802F1F34 002EEB14 38 60 00 00 */ li r3, 0 -/* 802F1F38 002EEB18 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F1F3C 002EEB1C 38 21 00 08 */ addi r1, r1, 8 -/* 802F1F40 002EEB20 7C 08 03 A6 */ mtlr r0 -/* 802F1F44 002EEB24 4E 80 00 20 */ blr - -.global it_802F1F48 -it_802F1F48: -/* 802F1F48 002EEB28 7C 08 02 A6 */ mflr r0 -/* 802F1F4C 002EEB2C 38 80 00 05 */ li r4, 5 -/* 802F1F50 002EEB30 90 01 00 04 */ stw r0, 4(r1) -/* 802F1F54 002EEB34 38 A0 00 02 */ li r5, 2 -/* 802F1F58 002EEB38 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 802F1F5C 002EEB3C 93 E1 00 14 */ stw r31, 0x14(r1) -/* 802F1F60 002EEB40 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802F1F64 002EEB44 4B F7 6E F9 */ bl Item_80268E5C -/* 802F1F68 002EEB48 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 802F1F6C 002EEB4C C0 1F 00 7C */ lfs f0, 0x7c(r31) -/* 802F1F70 002EEB50 C0 5F 00 88 */ lfs f2, 0x88(r31) -/* 802F1F74 002EEB54 EC 21 00 2A */ fadds f1, f1, f0 -/* 802F1F78 002EEB58 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F1F7C 002EEB5C EC 22 08 2A */ fadds f1, f2, f1 -/* 802F1F80 002EEB60 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F1F84 002EEB64 4C 41 13 82 */ cror 2, 1, 2 -/* 802F1F88 002EEB68 40 82 00 0C */ bne .L_802F1F94 -/* 802F1F8C 002EEB6C C0 02 DF E4 */ lfs f0, it_804DD9C4@sda21(r2) -/* 802F1F90 002EEB70 48 00 00 08 */ b .L_802F1F98 -.L_802F1F94: -/* 802F1F94 002EEB74 C0 02 DF E0 */ lfs f0, it_804DD9C0@sda21(r2) -.L_802F1F98: -/* 802F1F98 002EEB78 D0 1F 00 2C */ stfs f0, 0x2c(r31) -/* 802F1F9C 002EEB7C C0 22 DF E0 */ lfs f1, it_804DD9C0@sda21(r2) -/* 802F1FA0 002EEB80 C0 1F 00 2C */ lfs f0, 0x2c(r31) -/* 802F1FA4 002EEB84 FC 01 00 00 */ fcmpu cr0, f1, f0 -/* 802F1FA8 002EEB88 40 82 00 0C */ bne .L_802F1FB4 -/* 802F1FAC 002EEB8C 38 80 FF FF */ li r4, -1 -/* 802F1FB0 002EEB90 48 00 00 08 */ b .L_802F1FB8 -.L_802F1FB4: -/* 802F1FB4 002EEB94 38 80 00 01 */ li r4, 1 -.L_802F1FB8: -/* 802F1FB8 002EEB98 38 7F 03 78 */ addi r3, r31, 0x378 -/* 802F1FBC 002EEB9C 4B D5 17 1D */ bl mpColl_800436D8 -/* 802F1FC0 002EEBA0 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 802F1FC4 002EEBA4 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 802F1FC8 002EEBA8 38 21 00 18 */ addi r1, r1, 0x18 -/* 802F1FCC 002EEBAC 7C 08 03 A6 */ mtlr r0 -/* 802F1FD0 002EEBB0 4E 80 00 20 */ blr - -.global it_802F1FD4 -it_802F1FD4: -/* 802F1FD4 002EEBB4 38 60 00 00 */ li r3, 0 -/* 802F1FD8 002EEBB8 4E 80 00 20 */ blr - -.global it_802F1FDC -it_802F1FDC: -/* 802F1FDC 002EEBBC 4E 80 00 20 */ blr - -.global it_802F1FE0 -it_802F1FE0: -/* 802F1FE0 002EEBC0 7C 08 02 A6 */ mflr r0 -/* 802F1FE4 002EEBC4 3C 80 80 2F */ lis r4, it_802F1630@ha -/* 802F1FE8 002EEBC8 90 01 00 04 */ stw r0, 4(r1) -/* 802F1FEC 002EEBCC 3C A0 80 2F */ lis r5, it_802F1588@ha -/* 802F1FF0 002EEBD0 38 84 16 30 */ addi r4, r4, it_802F1630@l -/* 802F1FF4 002EEBD4 94 21 FF F8 */ stwu r1, -8(r1) -/* 802F1FF8 002EEBD8 38 A5 15 88 */ addi r5, r5, it_802F1588@l -/* 802F1FFC 002EEBDC 4B F7 C8 C9 */ bl it_8026E8C4 -/* 802F2000 002EEBE0 38 60 00 00 */ li r3, 0 -/* 802F2004 002EEBE4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802F2008 002EEBE8 38 21 00 08 */ addi r1, r1, 8 -/* 802F200C 002EEBEC 7C 08 03 A6 */ mtlr r0 -/* 802F2010 002EEBF0 4E 80 00 20 */ blr - -.global it_802F2014 -it_802F2014: -/* 802F2014 002EEBF4 80 63 00 2C */ lwz r3, 0x2c(r3) -/* 802F2018 002EEBF8 90 83 03 C4 */ stw r4, 0x3c4(r3) -/* 802F201C 002EEBFC 4E 80 00 20 */ blr - -.global it_802F2020 -it_802F2020: -/* 802F2020 002EEC00 80 63 00 2C */ lwz r3, 0x2c(r3) -/* 802F2024 002EEC04 80 63 0D D4 */ lwz r3, 0xdd4(r3) -/* 802F2028 002EEC08 4E 80 00 20 */ blr - -.global it_802F202C -it_802F202C: -/* 802F202C 002EEC0C 7C 08 02 A6 */ mflr r0 -/* 802F2030 002EEC10 38 80 00 7F */ li r4, 0x7f -/* 802F2034 002EEC14 90 01 00 04 */ stw r0, 4(r1) -/* 802F2038 002EEC18 38 A0 00 40 */ li r5, 0x40 -/* 802F203C 002EEC1C 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 802F2040 002EEC20 93 E1 00 14 */ stw r31, 0x14(r1) -/* 802F2044 002EEC24 93 C1 00 10 */ stw r30, 0x10(r1) -/* 802F2048 002EEC28 7C 7E 1B 78 */ mr r30, r3 -/* 802F204C 002EEC2C 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802F2050 002EEC30 38 60 00 AA */ li r3, 0xaa -/* 802F2054 002EEC34 4B D3 17 55 */ bl lbAudioAx_800237A8 -/* 802F2058 002EEC38 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F205C 002EEC3C D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 802F2060 002EEC40 C0 3F 00 44 */ lfs f1, 0x44(r31) -/* 802F2064 002EEC44 C0 02 DF F0 */ lfs f0, it_804DD9D0@sda21(r2) -/* 802F2068 002EEC48 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802F206C 002EEC4C 40 80 00 08 */ bge .L_802F2074 -/* 802F2070 002EEC50 D0 1F 00 44 */ stfs f0, 0x44(r31) -.L_802F2074: -/* 802F2074 002EEC54 7F C3 F3 78 */ mr r3, r30 -/* 802F2078 002EEC58 4B F8 36 59 */ bl it_802756D0 -/* 802F207C 002EEC5C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 802F2080 002EEC60 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 802F2084 002EEC64 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 802F2088 002EEC68 38 21 00 18 */ addi r1, r1, 0x18 -/* 802F208C 002EEC6C 7C 08 03 A6 */ mtlr r0 -/* 802F2090 002EEC70 4E 80 00 20 */ blr - -.global it_802F2094 -it_802F2094: -/* 802F2094 002EEC74 7C 08 02 A6 */ mflr r0 -/* 802F2098 002EEC78 38 E0 00 01 */ li r7, 1 -/* 802F209C 002EEC7C 90 01 00 04 */ stw r0, 4(r1) -/* 802F20A0 002EEC80 38 00 00 9F */ li r0, 0x9f -/* 802F20A4 002EEC84 94 21 FF 70 */ stwu r1, -0x90(r1) -/* 802F20A8 002EEC88 DB E1 00 88 */ stfd f31, 0x88(r1) -/* 802F20AC 002EEC8C BF 21 00 6C */ stmw r25, 0x6c(r1) -/* 802F20B0 002EEC90 3B 23 00 00 */ addi r25, r3, 0 -/* 802F20B4 002EEC94 3B A0 00 00 */ li r29, 0 -/* 802F20B8 002EEC98 3B 45 00 00 */ addi r26, r5, 0 -/* 802F20BC 002EEC9C 3B 66 00 00 */ addi r27, r6, 0 -/* 802F20C0 002EECA0 90 01 00 24 */ stw r0, 0x24(r1) -/* 802F20C4 002EECA4 80 64 00 00 */ lwz r3, 0(r4) -/* 802F20C8 002EECA8 80 04 00 04 */ lwz r0, 4(r4) -/* 802F20CC 002EECAC 90 61 00 3C */ stw r3, 0x3c(r1) -/* 802F20D0 002EECB0 38 61 00 1C */ addi r3, r1, 0x1c -/* 802F20D4 002EECB4 90 01 00 40 */ stw r0, 0x40(r1) -/* 802F20D8 002EECB8 80 04 00 08 */ lwz r0, 8(r4) -/* 802F20DC 002EECBC 90 01 00 44 */ stw r0, 0x44(r1) -/* 802F20E0 002EECC0 80 81 00 3C */ lwz r4, 0x3c(r1) -/* 802F20E4 002EECC4 80 01 00 40 */ lwz r0, 0x40(r1) -/* 802F20E8 002EECC8 C0 02 DF D8 */ lfs f0, it_804DD9B8@sda21(r2) -/* 802F20EC 002EECCC 90 81 00 30 */ stw r4, 0x30(r1) -/* 802F20F0 002EECD0 90 01 00 34 */ stw r0, 0x34(r1) -/* 802F20F4 002EECD4 80 01 00 44 */ lwz r0, 0x44(r1) -/* 802F20F8 002EECD8 90 01 00 38 */ stw r0, 0x38(r1) -/* 802F20FC 002EECDC D0 01 00 54 */ stfs f0, 0x54(r1) -/* 802F2100 002EECE0 D0 01 00 50 */ stfs f0, 0x50(r1) -/* 802F2104 002EECE4 D0 01 00 4C */ stfs f0, 0x4c(r1) -/* 802F2108 002EECE8 D0 01 00 48 */ stfs f0, 0x48(r1) -/* 802F210C 002EECEC B3 A1 00 58 */ sth r29, 0x58(r1) -/* 802F2110 002EECF0 93 A1 00 1C */ stw r29, 0x1c(r1) -/* 802F2114 002EECF4 93 A1 00 20 */ stw r29, 0x20(r1) -/* 802F2118 002EECF8 88 01 00 60 */ lbz r0, 0x60(r1) -/* 802F211C 002EECFC 50 E0 3E 30 */ rlwimi r0, r7, 7, 0x18, 0x18 -/* 802F2120 002EED00 98 01 00 60 */ stb r0, 0x60(r1) -/* 802F2124 002EED04 93 A1 00 5C */ stw r29, 0x5c(r1) -/* 802F2128 002EED08 4B F7 69 F1 */ bl Item_80268B18 -/* 802F212C 002EED0C 7C 7F 1B 79 */ or. r31, r3, r3 -/* 802F2130 002EED10 41 82 02 60 */ beq .L_802F2390 -/* 802F2134 002EED14 83 DF 00 2C */ lwz r30, 0x2c(r31) -/* 802F2138 002EED18 80 7E 00 C4 */ lwz r3, 0xc4(r30) -/* 802F213C 002EED1C 83 83 00 04 */ lwz r28, 4(r3) -/* 802F2140 002EED20 93 5E 0D D4 */ stw r26, 0xdd4(r30) -/* 802F2144 002EED24 93 7E 0D D8 */ stw r27, 0xdd8(r30) -/* 802F2148 002EED28 93 3E 0D E8 */ stw r25, 0xde8(r30) -/* 802F214C 002EED2C 80 1E 0D D8 */ lwz r0, 0xdd8(r30) -/* 802F2150 002EED30 2C 00 00 00 */ cmpwi r0, 0 -/* 802F2154 002EED34 41 82 00 74 */ beq .L_802F21C8 -/* 802F2158 002EED38 7F E3 FB 78 */ mr r3, r31 -/* 802F215C 002EED3C 4B F8 35 85 */ bl it_802756E0 -/* 802F2160 002EED40 7F E3 FB 78 */ mr r3, r31 -/* 802F2164 002EED44 4B F7 92 45 */ bl it_8026B3A8 -/* 802F2168 002EED48 2C 1B 00 03 */ cmpwi r27, 3 -/* 802F216C 002EED4C 41 82 00 28 */ beq .L_802F2194 -/* 802F2170 002EED50 40 80 00 38 */ bge .L_802F21A8 -/* 802F2174 002EED54 2C 1B 00 02 */ cmpwi r27, 2 -/* 802F2178 002EED58 40 80 00 08 */ bge .L_802F2180 -/* 802F217C 002EED5C 48 00 00 2C */ b .L_802F21A8 -.L_802F2180: -/* 802F2180 002EED60 C0 1C 00 0C */ lfs f0, 0xc(r28) -/* 802F2184 002EED64 D0 1E 0D DC */ stfs f0, 0xddc(r30) -/* 802F2188 002EED68 C0 1C 00 10 */ lfs f0, 0x10(r28) -/* 802F218C 002EED6C D0 1E 0D E0 */ stfs f0, 0xde0(r30) -/* 802F2190 002EED70 48 00 00 28 */ b .L_802F21B8 -.L_802F2194: -/* 802F2194 002EED74 C0 1C 00 18 */ lfs f0, 0x18(r28) -/* 802F2198 002EED78 D0 1E 0D DC */ stfs f0, 0xddc(r30) -/* 802F219C 002EED7C C0 1C 00 1C */ lfs f0, 0x1c(r28) -/* 802F21A0 002EED80 D0 1E 0D E0 */ stfs f0, 0xde0(r30) -/* 802F21A4 002EED84 48 00 00 14 */ b .L_802F21B8 -.L_802F21A8: -/* 802F21A8 002EED88 C0 1C 00 00 */ lfs f0, 0(r28) -/* 802F21AC 002EED8C D0 1E 0D DC */ stfs f0, 0xddc(r30) -/* 802F21B0 002EED90 C0 1C 00 04 */ lfs f0, 4(r28) -/* 802F21B4 002EED94 D0 1E 0D E0 */ stfs f0, 0xde0(r30) -.L_802F21B8: -/* 802F21B8 002EED98 7F 43 D3 78 */ mr r3, r26 -/* 802F21BC 002EED9C 48 02 A4 29 */ bl un_8031C5E4 -/* 802F21C0 002EEDA0 7C 7D 1B 78 */ mr r29, r3 -/* 802F21C4 002EEDA4 48 00 00 2C */ b .L_802F21F0 -.L_802F21C8: -/* 802F21C8 002EEDA8 7F E3 FB 78 */ mr r3, r31 -/* 802F21CC 002EEDAC 4B F7 52 89 */ bl Item_80267454 -/* 802F21D0 002EEDB0 7F E3 FB 78 */ mr r3, r31 -/* 802F21D4 002EEDB4 4B F8 34 FD */ bl it_802756D0 -/* 802F21D8 002EEDB8 7F E3 FB 78 */ mr r3, r31 -/* 802F21DC 002EEDBC 4B F7 91 B5 */ bl it_8026B390 -/* 802F21E0 002EEDC0 93 BE 0D 5C */ stw r29, 0xd5c(r30) -/* 802F21E4 002EEDC4 7F 43 D3 78 */ mr r3, r26 -/* 802F21E8 002EEDC8 48 02 A3 FD */ bl un_8031C5E4 -/* 802F21EC 002EEDCC 7C 7D 1B 78 */ mr r29, r3 -.L_802F21F0: -/* 802F21F0 002EEDD0 7F E3 FB 78 */ mr r3, r31 -/* 802F21F4 002EEDD4 48 09 E9 19 */ bl HSD_GObjObject_80390B0C -/* 802F21F8 002EEDD8 88 8D C1 A9 */ lbz r4, HSD_GObj_804D7849@sda21(r13) -/* 802F21FC 002EEDDC 38 7F 00 00 */ addi r3, r31, 0 -/* 802F2200 002EEDE0 38 BD 00 00 */ addi r5, r29, 0 -/* 802F2204 002EEDE4 48 09 E8 6D */ bl HSD_GObjObject_80390A70 -/* 802F2208 002EEDE8 7F E3 FB 78 */ mr r3, r31 -/* 802F220C 002EEDEC 4B F7 F4 31 */ bl it_8027163C -/* 802F2210 002EEDF0 4B EC E2 89 */ bl Ground_801C0498 -/* 802F2214 002EEDF4 D0 3E 00 38 */ stfs f1, 0x38(r30) -/* 802F2218 002EEDF8 C0 3E 00 38 */ lfs f1, 0x38(r30) -/* 802F221C 002EEDFC C0 1C 00 44 */ lfs f0, 0x44(r28) -/* 802F2220 002EEE00 EC 01 00 32 */ fmuls f0, f1, f0 -/* 802F2224 002EEE04 D0 1E 00 38 */ stfs f0, 0x38(r30) -/* 802F2228 002EEE08 83 BF 00 28 */ lwz r29, 0x28(r31) -/* 802F222C 002EEE0C C3 FE 00 38 */ lfs f31, 0x38(r30) -/* 802F2230 002EEE10 28 1D 00 00 */ cmplwi r29, 0 -/* 802F2234 002EEE14 40 82 00 14 */ bne .L_802F2248 -/* 802F2238 002EEE18 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F223C 002EEE1C 38 80 03 08 */ li r4, 0x308 -/* 802F2240 002EEE20 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F2244 002EEE24 48 09 5F DD */ bl __assert -.L_802F2248: -/* 802F2248 002EEE28 D3 FD 00 2C */ stfs f31, 0x2c(r29) -/* 802F224C 002EEE2C 80 1D 00 14 */ lwz r0, 0x14(r29) -/* 802F2250 002EEE30 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F2254 002EEE34 40 82 00 4C */ bne .L_802F22A0 -/* 802F2258 002EEE38 28 1D 00 00 */ cmplwi r29, 0 -/* 802F225C 002EEE3C 41 82 00 44 */ beq .L_802F22A0 -/* 802F2260 002EEE40 40 82 00 14 */ bne .L_802F2274 -/* 802F2264 002EEE44 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F2268 002EEE48 38 80 02 34 */ li r4, 0x234 -/* 802F226C 002EEE4C 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F2270 002EEE50 48 09 5F B1 */ bl __assert -.L_802F2274: -/* 802F2274 002EEE54 80 9D 00 14 */ lwz r4, 0x14(r29) -/* 802F2278 002EEE58 38 60 00 00 */ li r3, 0 -/* 802F227C 002EEE5C 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F2280 002EEE60 40 82 00 10 */ bne .L_802F2290 -/* 802F2284 002EEE64 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F2288 002EEE68 41 82 00 08 */ beq .L_802F2290 -/* 802F228C 002EEE6C 38 60 00 01 */ li r3, 1 -.L_802F2290: -/* 802F2290 002EEE70 2C 03 00 00 */ cmpwi r3, 0 -/* 802F2294 002EEE74 40 82 00 0C */ bne .L_802F22A0 -/* 802F2298 002EEE78 7F A3 EB 78 */ mr r3, r29 -/* 802F229C 002EEE7C 48 08 10 4D */ bl HSD_JObjSetMtxDirtySub -.L_802F22A0: -/* 802F22A0 002EEE80 83 BF 00 28 */ lwz r29, 0x28(r31) -/* 802F22A4 002EEE84 C3 FE 00 38 */ lfs f31, 0x38(r30) -/* 802F22A8 002EEE88 28 1D 00 00 */ cmplwi r29, 0 -/* 802F22AC 002EEE8C 40 82 00 14 */ bne .L_802F22C0 -/* 802F22B0 002EEE90 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F22B4 002EEE94 38 80 03 17 */ li r4, 0x317 -/* 802F22B8 002EEE98 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F22BC 002EEE9C 48 09 5F 65 */ bl __assert -.L_802F22C0: -/* 802F22C0 002EEEA0 D3 FD 00 30 */ stfs f31, 0x30(r29) -/* 802F22C4 002EEEA4 80 1D 00 14 */ lwz r0, 0x14(r29) -/* 802F22C8 002EEEA8 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F22CC 002EEEAC 40 82 00 4C */ bne .L_802F2318 -/* 802F22D0 002EEEB0 28 1D 00 00 */ cmplwi r29, 0 -/* 802F22D4 002EEEB4 41 82 00 44 */ beq .L_802F2318 -/* 802F22D8 002EEEB8 40 82 00 14 */ bne .L_802F22EC -/* 802F22DC 002EEEBC 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F22E0 002EEEC0 38 80 02 34 */ li r4, 0x234 -/* 802F22E4 002EEEC4 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F22E8 002EEEC8 48 09 5F 39 */ bl __assert -.L_802F22EC: -/* 802F22EC 002EEECC 80 9D 00 14 */ lwz r4, 0x14(r29) -/* 802F22F0 002EEED0 38 60 00 00 */ li r3, 0 -/* 802F22F4 002EEED4 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F22F8 002EEED8 40 82 00 10 */ bne .L_802F2308 -/* 802F22FC 002EEEDC 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F2300 002EEEE0 41 82 00 08 */ beq .L_802F2308 -/* 802F2304 002EEEE4 38 60 00 01 */ li r3, 1 -.L_802F2308: -/* 802F2308 002EEEE8 2C 03 00 00 */ cmpwi r3, 0 -/* 802F230C 002EEEEC 40 82 00 0C */ bne .L_802F2318 -/* 802F2310 002EEEF0 7F A3 EB 78 */ mr r3, r29 -/* 802F2314 002EEEF4 48 08 0F D5 */ bl HSD_JObjSetMtxDirtySub -.L_802F2318: -/* 802F2318 002EEEF8 83 BF 00 28 */ lwz r29, 0x28(r31) -/* 802F231C 002EEEFC C3 FE 00 38 */ lfs f31, 0x38(r30) -/* 802F2320 002EEF00 28 1D 00 00 */ cmplwi r29, 0 -/* 802F2324 002EEF04 40 82 00 14 */ bne .L_802F2338 -/* 802F2328 002EEF08 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F232C 002EEF0C 38 80 03 26 */ li r4, 0x326 -/* 802F2330 002EEF10 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F2334 002EEF14 48 09 5E ED */ bl __assert -.L_802F2338: -/* 802F2338 002EEF18 D3 FD 00 34 */ stfs f31, 0x34(r29) -/* 802F233C 002EEF1C 80 1D 00 14 */ lwz r0, 0x14(r29) -/* 802F2340 002EEF20 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802F2344 002EEF24 40 82 00 4C */ bne .L_802F2390 -/* 802F2348 002EEF28 28 1D 00 00 */ cmplwi r29, 0 -/* 802F234C 002EEF2C 41 82 00 44 */ beq .L_802F2390 -/* 802F2350 002EEF30 40 82 00 14 */ bne .L_802F2364 -/* 802F2354 002EEF34 38 6D A0 B8 */ addi r3, r13, it_804D5758@sda21 -/* 802F2358 002EEF38 38 80 02 34 */ li r4, 0x234 -/* 802F235C 002EEF3C 38 AD A0 C0 */ addi r5, r13, it_804D5760@sda21 -/* 802F2360 002EEF40 48 09 5E C1 */ bl __assert -.L_802F2364: -/* 802F2364 002EEF44 80 9D 00 14 */ lwz r4, 0x14(r29) -/* 802F2368 002EEF48 38 60 00 00 */ li r3, 0 -/* 802F236C 002EEF4C 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802F2370 002EEF50 40 82 00 10 */ bne .L_802F2380 -/* 802F2374 002EEF54 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802F2378 002EEF58 41 82 00 08 */ beq .L_802F2380 -/* 802F237C 002EEF5C 38 60 00 01 */ li r3, 1 -.L_802F2380: -/* 802F2380 002EEF60 2C 03 00 00 */ cmpwi r3, 0 -/* 802F2384 002EEF64 40 82 00 0C */ bne .L_802F2390 -/* 802F2388 002EEF68 7F A3 EB 78 */ mr r3, r29 -/* 802F238C 002EEF6C 48 08 0F 5D */ bl HSD_JObjSetMtxDirtySub -.L_802F2390: -/* 802F2390 002EEF70 7F E3 FB 78 */ mr r3, r31 -/* 802F2394 002EEF74 BB 21 00 6C */ lmw r25, 0x6c(r1) -/* 802F2398 002EEF78 80 01 00 94 */ lwz r0, 0x94(r1) -/* 802F239C 002EEF7C CB E1 00 88 */ lfd f31, 0x88(r1) -/* 802F23A0 002EEF80 38 21 00 90 */ addi r1, r1, 0x90 -/* 802F23A4 002EEF84 7C 08 03 A6 */ mtlr r0 -/* 802F23A8 002EEF88 4E 80 00 20 */ blr - - -.section .data - .balign 8 -.global it_803F93C8 -it_803F93C8: - .4byte -1 - .4byte it_802F15B0 - .4byte it_802F15B8 - .4byte it_802F1604 - .4byte -1 - .4byte it_802F1850 - .4byte it_802F1858 - .4byte it_802F185C - .4byte -1 - .4byte it_802F18E4 - .4byte it_802F18EC - .4byte NULL - .4byte -1 - .4byte it_802F1C68 - .4byte it_802F1C70 - .4byte it_802F1CB4 - .4byte -1 - .4byte it_802F1EE4 - .4byte it_802F1EEC - .4byte it_802F1F1C - .4byte -1 - .4byte it_802F1FD4 - .4byte it_802F1FDC - .4byte it_802F1FE0 - .asciz "!(jobj->flags & JOBJ_USE_QUATERNION)" - - -.section .sdata - .balign 8 -.global it_804D5758 -it_804D5758: - .asciz "jobj.h" - .balign 4 -.global it_804D5760 -it_804D5760: - .asciz "jobj" - - -.section .sdata2 - .balign 8 -.global it_804DD9B8 -it_804DD9B8: - .4byte 0x00000000 -.global it_804DD9BC -it_804DD9BC: - .4byte 0x3DCCCCCD -.global it_804DD9C0 -it_804DD9C0: - .4byte 0xBF800000 -.global it_804DD9C4 -it_804DD9C4: - .4byte 0x3F800000 -.global it_804DD9C8 -it_804DD9C8: - .4byte 0x43300000 - .4byte 0x80000000 -.global it_804DD9D0 -it_804DD9D0: - .4byte 0xBFC00000 diff --git a/asm/melee/it/items/itdkinoko.s b/asm/melee/it/items/itdkinoko.s deleted file mode 100644 index 8aa16e7dba..0000000000 --- a/asm/melee/it/items/itdkinoko.s +++ /dev/null @@ -1,305 +0,0 @@ -.include "macros.inc" - -.section .text - -.global it_80293A08 -it_80293A08: -/* 80293A08 002905E8 7C 08 02 A6 */ mflr r0 -/* 80293A0C 002905EC 90 01 00 04 */ stw r0, 4(r1) -/* 80293A10 002905F0 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293A14 002905F4 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 80293A18 002905F8 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293A1C 002905FC C0 24 00 4C */ lfs f1, 0x4c(r4) -/* 80293A20 00290600 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293A24 00290604 40 81 00 10 */ ble .L_80293A34 -/* 80293A28 00290608 C0 02 D1 44 */ lfs f0, it_804DCB24@sda21(r2) -/* 80293A2C 0029060C D0 04 00 2C */ stfs f0, 0x2c(r4) -/* 80293A30 00290610 48 00 00 0C */ b .L_80293A3C -.L_80293A34: -/* 80293A34 00290614 C0 02 D1 48 */ lfs f0, it_804DCB28@sda21(r2) -/* 80293A38 00290618 D0 04 00 2C */ stfs f0, 0x2c(r4) -.L_80293A3C: -/* 80293A3C 0029061C 38 00 00 00 */ li r0, 0 -/* 80293A40 00290620 90 04 0D 5C */ stw r0, 0xd5c(r4) -/* 80293A44 00290624 C0 22 D1 40 */ lfs f1, it_804DCB20@sda21(r2) -/* 80293A48 00290628 D0 24 0D D4 */ stfs f1, 0xdd4(r4) -/* 80293A4C 0029062C D0 24 0D D8 */ stfs f1, 0xdd8(r4) -/* 80293A50 00290630 C0 02 D1 48 */ lfs f0, it_804DCB28@sda21(r2) -/* 80293A54 00290634 D0 04 0D DC */ stfs f0, 0xddc(r4) -/* 80293A58 00290638 D0 24 0D E0 */ stfs f1, 0xde0(r4) -/* 80293A5C 0029063C 48 00 01 8D */ bl it_80293BE8 -/* 80293A60 00290640 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293A64 00290644 38 21 00 08 */ addi r1, r1, 8 -/* 80293A68 00290648 7C 08 03 A6 */ mtlr r0 -/* 80293A6C 0029064C 4E 80 00 20 */ blr - -.global it_80293A70 -it_80293A70: -/* 80293A70 00290650 7C 08 02 A6 */ mflr r0 -/* 80293A74 00290654 90 01 00 04 */ stw r0, 4(r1) -/* 80293A78 00290658 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80293A7C 0029065C 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80293A80 00290660 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80293A84 00290664 7C 7E 1B 78 */ mr r30, r3 -/* 80293A88 00290668 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293A8C 0029066C C0 1F 0D D4 */ lfs f0, 0xdd4(r31) -/* 80293A90 00290670 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 80293A94 00290674 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293A98 00290678 D0 1F 00 48 */ stfs f0, 0x48(r31) -/* 80293A9C 0029067C D0 1F 00 44 */ stfs f0, 0x44(r31) -/* 80293AA0 00290680 4B FD 78 F1 */ bl it_8026B390 -/* 80293AA4 00290684 38 7F 00 00 */ addi r3, r31, 0 -/* 80293AA8 00290688 38 80 01 07 */ li r4, 0x107 -/* 80293AAC 0029068C 38 A0 00 7F */ li r5, 0x7f -/* 80293AB0 00290690 38 C0 00 40 */ li r6, 0x40 -/* 80293AB4 00290694 4B FD 73 D1 */ bl Item_8026AE84 -/* 80293AB8 00290698 38 7E 00 00 */ addi r3, r30, 0 -/* 80293ABC 0029069C 38 80 00 00 */ li r4, 0 -/* 80293AC0 002906A0 38 A0 00 11 */ li r5, 0x11 -/* 80293AC4 002906A4 4B FD 53 99 */ bl Item_80268E5C -/* 80293AC8 002906A8 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80293ACC 002906AC 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80293AD0 002906B0 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80293AD4 002906B4 38 21 00 20 */ addi r1, r1, 0x20 -/* 80293AD8 002906B8 7C 08 03 A6 */ mtlr r0 -/* 80293ADC 002906BC 4E 80 00 20 */ blr - -.global it_80293AE0 -it_80293AE0: -/* 80293AE0 002906C0 38 60 00 00 */ li r3, 0 -/* 80293AE4 002906C4 4E 80 00 20 */ blr - -.global it_80293AE8 -it_80293AE8: -/* 80293AE8 002906C8 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 80293AEC 002906CC 80 04 00 C0 */ lwz r0, 0xc0(r4) -/* 80293AF0 002906D0 80 64 00 C4 */ lwz r3, 0xc4(r4) -/* 80293AF4 002906D4 2C 00 00 01 */ cmpwi r0, 1 -/* 80293AF8 002906D8 80 63 00 04 */ lwz r3, 4(r3) -/* 80293AFC 002906DC 4D 82 00 20 */ beqlr -/* 80293B00 002906E0 C0 23 00 00 */ lfs f1, 0(r3) -/* 80293B04 002906E4 C0 04 00 2C */ lfs f0, 0x2c(r4) -/* 80293B08 002906E8 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293B0C 002906EC D0 04 0D D4 */ stfs f0, 0xdd4(r4) -/* 80293B10 002906F0 C0 24 0D D4 */ lfs f1, 0xdd4(r4) -/* 80293B14 002906F4 C0 04 0D DC */ lfs f0, 0xddc(r4) -/* 80293B18 002906F8 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293B1C 002906FC D0 04 00 40 */ stfs f0, 0x40(r4) -/* 80293B20 00290700 4E 80 00 20 */ blr - -.global it_80293B24 -it_80293B24: -/* 80293B24 00290704 7C 08 02 A6 */ mflr r0 -/* 80293B28 00290708 90 01 00 04 */ stw r0, 4(r1) -/* 80293B2C 0029070C 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 80293B30 00290710 93 E1 00 2C */ stw r31, 0x2c(r1) -/* 80293B34 00290714 93 C1 00 28 */ stw r30, 0x28(r1) -/* 80293B38 00290718 93 A1 00 24 */ stw r29, 0x24(r1) -/* 80293B3C 0029071C 7C 7D 1B 78 */ mr r29, r3 -/* 80293B40 00290720 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293B44 00290724 3C 60 80 29 */ lis r3, it_80293C10@ha -/* 80293B48 00290728 38 83 3C 10 */ addi r4, r3, it_80293C10@l -/* 80293B4C 0029072C 38 7D 00 00 */ addi r3, r29, 0 -/* 80293B50 00290730 3B DF 03 78 */ addi r30, r31, 0x378 -/* 80293B54 00290734 4B FD 9C 39 */ bl it_8026D78C -/* 80293B58 00290738 80 1F 00 C0 */ lwz r0, 0xc0(r31) -/* 80293B5C 0029073C 2C 00 00 01 */ cmpwi r0, 1 -/* 80293B60 00290740 41 82 00 68 */ beq .L_80293BC8 -/* 80293B64 00290744 80 1E 01 34 */ lwz r0, 0x134(r30) -/* 80293B68 00290748 54 00 03 E1 */ rlwinm. r0, r0, 0, 0xf, 0x10 -/* 80293B6C 0029074C 41 82 00 18 */ beq .L_80293B84 -/* 80293B70 00290750 38 7D 00 00 */ addi r3, r29, 0 -/* 80293B74 00290754 38 9E 00 00 */ addi r4, r30, 0 -/* 80293B78 00290758 38 BF 0D D8 */ addi r5, r31, 0xdd8 -/* 80293B7C 0029075C 4B FE 28 8D */ bl it_80276408 -/* 80293B80 00290760 48 00 00 0C */ b .L_80293B8C -.L_80293B84: -/* 80293B84 00290764 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293B88 00290768 D0 1F 0D D8 */ stfs f0, 0xdd8(r31) -.L_80293B8C: -/* 80293B8C 0029076C 80 7E 01 34 */ lwz r3, 0x134(r30) -/* 80293B90 00290770 54 60 06 BF */ clrlwi. r0, r3, 0x1a -/* 80293B94 00290774 40 82 00 0C */ bne .L_80293BA0 -/* 80293B98 00290778 54 60 05 33 */ rlwinm. r0, r3, 0, 0x14, 0x19 -/* 80293B9C 0029077C 41 82 00 2C */ beq .L_80293BC8 -.L_80293BA0: -/* 80293BA0 00290780 C0 1F 00 2C */ lfs f0, 0x2c(r31) -/* 80293BA4 00290784 FC 00 00 50 */ fneg f0, f0 -/* 80293BA8 00290788 D0 1F 00 2C */ stfs f0, 0x2c(r31) -/* 80293BAC 0029078C C0 1F 0D D4 */ lfs f0, 0xdd4(r31) -/* 80293BB0 00290790 FC 00 00 50 */ fneg f0, f0 -/* 80293BB4 00290794 D0 1F 0D D4 */ stfs f0, 0xdd4(r31) -/* 80293BB8 00290798 C0 3F 0D D4 */ lfs f1, 0xdd4(r31) -/* 80293BBC 0029079C C0 1F 0D DC */ lfs f0, 0xddc(r31) -/* 80293BC0 002907A0 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293BC4 002907A4 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293BC8: -/* 80293BC8 002907A8 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80293BCC 002907AC 38 60 00 00 */ li r3, 0 -/* 80293BD0 002907B0 83 E1 00 2C */ lwz r31, 0x2c(r1) -/* 80293BD4 002907B4 83 C1 00 28 */ lwz r30, 0x28(r1) -/* 80293BD8 002907B8 83 A1 00 24 */ lwz r29, 0x24(r1) -/* 80293BDC 002907BC 38 21 00 30 */ addi r1, r1, 0x30 -/* 80293BE0 002907C0 7C 08 03 A6 */ mtlr r0 -/* 80293BE4 002907C4 4E 80 00 20 */ blr - -.global it_80293BE8 -it_80293BE8: -/* 80293BE8 002907C8 7C 08 02 A6 */ mflr r0 -/* 80293BEC 002907CC 38 80 00 01 */ li r4, 1 -/* 80293BF0 002907D0 90 01 00 04 */ stw r0, 4(r1) -/* 80293BF4 002907D4 38 A0 00 02 */ li r5, 2 -/* 80293BF8 002907D8 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293BFC 002907DC 4B FD 52 61 */ bl Item_80268E5C -/* 80293C00 002907E0 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293C04 002907E4 38 21 00 08 */ addi r1, r1, 8 -/* 80293C08 002907E8 7C 08 03 A6 */ mtlr r0 -/* 80293C0C 002907EC 4E 80 00 20 */ blr - -.global it_80293C10 -it_80293C10: -/* 80293C10 002907F0 7C 08 02 A6 */ mflr r0 -/* 80293C14 002907F4 38 80 00 01 */ li r4, 1 -/* 80293C18 002907F8 90 01 00 04 */ stw r0, 4(r1) -/* 80293C1C 002907FC 38 A0 00 11 */ li r5, 0x11 -/* 80293C20 00290800 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293C24 00290804 4B FD 52 39 */ bl Item_80268E5C -/* 80293C28 00290808 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293C2C 0029080C 38 21 00 08 */ addi r1, r1, 8 -/* 80293C30 00290810 7C 08 03 A6 */ mtlr r0 -/* 80293C34 00290814 4E 80 00 20 */ blr - -.global it_80293C38 -it_80293C38: -/* 80293C38 00290818 38 60 00 00 */ li r3, 0 -/* 80293C3C 0029081C 4E 80 00 20 */ blr - -.global it_80293C40 -it_80293C40: -/* 80293C40 00290820 7C 08 02 A6 */ mflr r0 -/* 80293C44 00290824 90 01 00 04 */ stw r0, 4(r1) -/* 80293C48 00290828 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 80293C4C 0029082C 93 E1 00 14 */ stw r31, 0x14(r1) -/* 80293C50 00290830 93 C1 00 10 */ stw r30, 0x10(r1) -/* 80293C54 00290834 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293C58 00290838 80 BF 00 CC */ lwz r5, 0xcc(r31) -/* 80293C5C 0029083C 80 9F 00 C4 */ lwz r4, 0xc4(r31) -/* 80293C60 00290840 C0 25 00 10 */ lfs f1, 0x10(r5) -/* 80293C64 00290844 83 C4 00 04 */ lwz r30, 4(r4) -/* 80293C68 00290848 C0 45 00 14 */ lfs f2, 0x14(r5) -/* 80293C6C 0029084C 4B FD EB F5 */ bl it_80272860 -/* 80293C70 00290850 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80293C74 00290854 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293C78 00290858 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293C7C 0029085C 40 80 00 0C */ bge .L_80293C88 -/* 80293C80 00290860 FC 00 08 50 */ fneg f0, f1 -/* 80293C84 00290864 48 00 00 08 */ b .L_80293C8C -.L_80293C88: -/* 80293C88 00290868 FC 00 08 90 */ fmr f0, f1 -.L_80293C8C: -/* 80293C8C 0029086C C0 5E 00 04 */ lfs f2, 4(r30) -/* 80293C90 00290870 FC 00 10 40 */ fcmpo cr0, f0, f2 -/* 80293C94 00290874 40 80 00 10 */ bge .L_80293CA4 -/* 80293C98 00290878 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293C9C 0029087C D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 80293CA0 00290880 48 00 00 38 */ b .L_80293CD8 -.L_80293CA4: -/* 80293CA4 00290884 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293CA8 00290888 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293CAC 0029088C 40 81 00 10 */ ble .L_80293CBC -/* 80293CB0 00290890 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 80293CB4 00290894 EC 00 10 28 */ fsubs f0, f0, f2 -/* 80293CB8 00290898 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293CBC: -/* 80293CBC 0029089C C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80293CC0 002908A0 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293CC4 002908A4 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293CC8 002908A8 40 80 00 10 */ bge .L_80293CD8 -/* 80293CCC 002908AC C0 1E 00 04 */ lfs f0, 4(r30) -/* 80293CD0 002908B0 EC 01 00 2A */ fadds f0, f1, f0 -/* 80293CD4 002908B4 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293CD8: -/* 80293CD8 002908B8 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 80293CDC 002908BC 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 80293CE0 002908C0 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 80293CE4 002908C4 38 21 00 18 */ addi r1, r1, 0x18 -/* 80293CE8 002908C8 7C 08 03 A6 */ mtlr r0 -/* 80293CEC 002908CC 4E 80 00 20 */ blr - -.global it_80293CF0 -it_80293CF0: -/* 80293CF0 002908D0 7C 08 02 A6 */ mflr r0 -/* 80293CF4 002908D4 90 01 00 04 */ stw r0, 4(r1) -/* 80293CF8 002908D8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80293CFC 002908DC 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80293D00 002908E0 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80293D04 002908E4 93 A1 00 14 */ stw r29, 0x14(r1) -/* 80293D08 002908E8 7C 7D 1B 78 */ mr r29, r3 -/* 80293D0C 002908EC 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293D10 002908F0 3C 60 80 29 */ lis r3, it_80293A70@ha -/* 80293D14 002908F4 38 83 3A 70 */ addi r4, r3, it_80293A70@l -/* 80293D18 002908F8 38 7D 00 00 */ addi r3, r29, 0 -/* 80293D1C 002908FC 3B DF 03 78 */ addi r30, r31, 0x378 -/* 80293D20 00290900 4B FD A6 F5 */ bl it_8026E414 -/* 80293D24 00290904 80 1F 00 C0 */ lwz r0, 0xc0(r31) -/* 80293D28 00290908 2C 00 00 01 */ cmpwi r0, 1 -/* 80293D2C 0029090C 41 82 00 20 */ beq .L_80293D4C -/* 80293D30 00290910 80 1E 01 34 */ lwz r0, 0x134(r30) -/* 80293D34 00290914 54 00 03 E1 */ rlwinm. r0, r0, 0, 0xf, 0x10 -/* 80293D38 00290918 41 82 00 14 */ beq .L_80293D4C -/* 80293D3C 0029091C 38 7D 00 00 */ addi r3, r29, 0 -/* 80293D40 00290920 38 9E 00 00 */ addi r4, r30, 0 -/* 80293D44 00290924 38 BF 0D D8 */ addi r5, r31, 0xdd8 -/* 80293D48 00290928 4B FE 26 C1 */ bl it_80276408 -.L_80293D4C: -/* 80293D4C 0029092C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80293D50 00290930 38 60 00 00 */ li r3, 0 -/* 80293D54 00290934 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80293D58 00290938 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80293D5C 0029093C 83 A1 00 14 */ lwz r29, 0x14(r1) -/* 80293D60 00290940 38 21 00 20 */ addi r1, r1, 0x20 -/* 80293D64 00290944 7C 08 03 A6 */ mtlr r0 -/* 80293D68 00290948 4E 80 00 20 */ blr - -.global it_80293D6C -it_80293D6C: -/* 80293D6C 0029094C 38 60 00 01 */ li r3, 1 -/* 80293D70 00290950 4E 80 00 20 */ blr - -.global it_80293D74 -it_80293D74: -/* 80293D74 00290954 7C 08 02 A6 */ mflr r0 -/* 80293D78 00290958 90 01 00 04 */ stw r0, 4(r1) -/* 80293D7C 0029095C 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293D80 00290960 4B FD 7B 15 */ bl it_8026B894 -/* 80293D84 00290964 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293D88 00290968 38 21 00 08 */ addi r1, r1, 8 -/* 80293D8C 0029096C 7C 08 03 A6 */ mtlr r0 -/* 80293D90 00290970 4E 80 00 20 */ blr - - -.section .data - .balign 8 -.global it_803F6130 -it_803F6130: - .4byte 0 - .4byte it_80293AE0 - .4byte it_80293AE8 - .4byte it_80293B24 - .4byte 0 - .4byte it_80293C38 - .4byte it_80293C40 - .4byte it_80293CF0 - - -.section .sdata2 - .balign 8 -.global it_804DCB20 -it_804DCB20: - .4byte 0x00000000 -.global it_804DCB24 -it_804DCB24: - .4byte 0xBF800000 -.global it_804DCB28 -it_804DCB28: - .4byte 0x3F800000 diff --git a/asm/melee/it/items/itkinoko.s b/asm/melee/it/items/itkinoko.s deleted file mode 100644 index ebda6cee22..0000000000 --- a/asm/melee/it/items/itkinoko.s +++ /dev/null @@ -1,313 +0,0 @@ -.include "macros.inc" - -.section .text - -.global it_80293660 -it_80293660: -/* 80293660 00290240 80 8D B6 84 */ lwz r4, it_804D6D24@sda21(r13) -/* 80293664 00290244 54 60 10 3A */ slwi r0, r3, 2 -/* 80293668 00290248 80 64 00 68 */ lwz r3, 0x68(r4) -/* 8029366C 0029024C 80 63 00 04 */ lwz r3, 4(r3) -/* 80293670 00290250 7C 63 02 14 */ add r3, r3, r0 -/* 80293674 00290254 80 63 00 08 */ lwz r3, 8(r3) -/* 80293678 00290258 4E 80 00 20 */ blr - -.global it_8029367C -it_8029367C: -/* 8029367C 0029025C 7C 08 02 A6 */ mflr r0 -/* 80293680 00290260 90 01 00 04 */ stw r0, 4(r1) -/* 80293684 00290264 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293688 00290268 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 8029368C 0029026C C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 80293690 00290270 C0 24 00 4C */ lfs f1, 0x4c(r4) -/* 80293694 00290274 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293698 00290278 40 81 00 10 */ ble .L_802936A8 -/* 8029369C 0029027C C0 02 D1 34 */ lfs f0, it_804DCB14@sda21(r2) -/* 802936A0 00290280 D0 04 00 2C */ stfs f0, 0x2c(r4) -/* 802936A4 00290284 48 00 00 0C */ b .L_802936B0 -.L_802936A8: -/* 802936A8 00290288 C0 02 D1 38 */ lfs f0, it_804DCB18@sda21(r2) -/* 802936AC 0029028C D0 04 00 2C */ stfs f0, 0x2c(r4) -.L_802936B0: -/* 802936B0 00290290 38 00 00 00 */ li r0, 0 -/* 802936B4 00290294 90 04 0D 5C */ stw r0, 0xd5c(r4) -/* 802936B8 00290298 C0 22 D1 30 */ lfs f1, it_804DCB10@sda21(r2) -/* 802936BC 0029029C D0 24 0D D4 */ stfs f1, 0xdd4(r4) -/* 802936C0 002902A0 D0 24 0D D8 */ stfs f1, 0xdd8(r4) -/* 802936C4 002902A4 C0 02 D1 38 */ lfs f0, it_804DCB18@sda21(r2) -/* 802936C8 002902A8 D0 04 0D DC */ stfs f0, 0xddc(r4) -/* 802936CC 002902AC D0 24 0D E0 */ stfs f1, 0xde0(r4) -/* 802936D0 002902B0 48 00 01 8D */ bl it_8029385C -/* 802936D4 002902B4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802936D8 002902B8 38 21 00 08 */ addi r1, r1, 8 -/* 802936DC 002902BC 7C 08 03 A6 */ mtlr r0 -/* 802936E0 002902C0 4E 80 00 20 */ blr - -.global it_802936E4 -it_802936E4: -/* 802936E4 002902C4 7C 08 02 A6 */ mflr r0 -/* 802936E8 002902C8 90 01 00 04 */ stw r0, 4(r1) -/* 802936EC 002902CC 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 802936F0 002902D0 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 802936F4 002902D4 93 C1 00 18 */ stw r30, 0x18(r1) -/* 802936F8 002902D8 7C 7E 1B 78 */ mr r30, r3 -/* 802936FC 002902DC 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293700 002902E0 C0 1F 0D D4 */ lfs f0, 0xdd4(r31) -/* 80293704 002902E4 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 80293708 002902E8 C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 8029370C 002902EC D0 1F 00 48 */ stfs f0, 0x48(r31) -/* 80293710 002902F0 D0 1F 00 44 */ stfs f0, 0x44(r31) -/* 80293714 002902F4 4B FD 7C 7D */ bl it_8026B390 -/* 80293718 002902F8 38 7F 00 00 */ addi r3, r31, 0 -/* 8029371C 002902FC 38 80 01 07 */ li r4, 0x107 -/* 80293720 00290300 38 A0 00 7F */ li r5, 0x7f -/* 80293724 00290304 38 C0 00 40 */ li r6, 0x40 -/* 80293728 00290308 4B FD 77 5D */ bl Item_8026AE84 -/* 8029372C 0029030C 38 7E 00 00 */ addi r3, r30, 0 -/* 80293730 00290310 38 80 00 00 */ li r4, 0 -/* 80293734 00290314 38 A0 00 11 */ li r5, 0x11 -/* 80293738 00290318 4B FD 57 25 */ bl Item_80268E5C -/* 8029373C 0029031C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80293740 00290320 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80293744 00290324 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80293748 00290328 38 21 00 20 */ addi r1, r1, 0x20 -/* 8029374C 0029032C 7C 08 03 A6 */ mtlr r0 -/* 80293750 00290330 4E 80 00 20 */ blr - -.global it_80293754 -it_80293754: -/* 80293754 00290334 38 60 00 00 */ li r3, 0 -/* 80293758 00290338 4E 80 00 20 */ blr - -.global it_8029375C -it_8029375C: -/* 8029375C 0029033C 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 80293760 00290340 80 04 00 C0 */ lwz r0, 0xc0(r4) -/* 80293764 00290344 80 64 00 C4 */ lwz r3, 0xc4(r4) -/* 80293768 00290348 2C 00 00 01 */ cmpwi r0, 1 -/* 8029376C 0029034C 80 63 00 04 */ lwz r3, 4(r3) -/* 80293770 00290350 4D 82 00 20 */ beqlr -/* 80293774 00290354 C0 23 00 00 */ lfs f1, 0(r3) -/* 80293778 00290358 C0 04 00 2C */ lfs f0, 0x2c(r4) -/* 8029377C 0029035C EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293780 00290360 D0 04 0D D4 */ stfs f0, 0xdd4(r4) -/* 80293784 00290364 C0 24 0D D4 */ lfs f1, 0xdd4(r4) -/* 80293788 00290368 C0 04 0D DC */ lfs f0, 0xddc(r4) -/* 8029378C 0029036C EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293790 00290370 D0 04 00 40 */ stfs f0, 0x40(r4) -/* 80293794 00290374 4E 80 00 20 */ blr - -.global it_80293798 -it_80293798: -/* 80293798 00290378 7C 08 02 A6 */ mflr r0 -/* 8029379C 0029037C 90 01 00 04 */ stw r0, 4(r1) -/* 802937A0 00290380 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 802937A4 00290384 93 E1 00 2C */ stw r31, 0x2c(r1) -/* 802937A8 00290388 93 C1 00 28 */ stw r30, 0x28(r1) -/* 802937AC 0029038C 93 A1 00 24 */ stw r29, 0x24(r1) -/* 802937B0 00290390 7C 7D 1B 78 */ mr r29, r3 -/* 802937B4 00290394 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802937B8 00290398 3C 60 80 29 */ lis r3, .L_80293884@ha -/* 802937BC 0029039C 38 83 38 84 */ addi r4, r3, .L_80293884@l -/* 802937C0 002903A0 38 7D 00 00 */ addi r3, r29, 0 -/* 802937C4 002903A4 3B DF 03 78 */ addi r30, r31, 0x378 -/* 802937C8 002903A8 4B FD 9F C5 */ bl it_8026D78C -/* 802937CC 002903AC 80 1F 00 C0 */ lwz r0, 0xc0(r31) -/* 802937D0 002903B0 2C 00 00 01 */ cmpwi r0, 1 -/* 802937D4 002903B4 41 82 00 68 */ beq .L_8029383C -/* 802937D8 002903B8 80 1E 01 34 */ lwz r0, 0x134(r30) -/* 802937DC 002903BC 54 00 03 E1 */ rlwinm. r0, r0, 0, 0xf, 0x10 -/* 802937E0 002903C0 41 82 00 18 */ beq .L_802937F8 -/* 802937E4 002903C4 38 7D 00 00 */ addi r3, r29, 0 -/* 802937E8 002903C8 38 9E 00 00 */ addi r4, r30, 0 -/* 802937EC 002903CC 38 BF 0D D8 */ addi r5, r31, 0xdd8 -/* 802937F0 002903D0 4B FE 2C 19 */ bl it_80276408 -/* 802937F4 002903D4 48 00 00 0C */ b .L_80293800 -.L_802937F8: -/* 802937F8 002903D8 C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 802937FC 002903DC D0 1F 0D D8 */ stfs f0, 0xdd8(r31) -.L_80293800: -/* 80293800 002903E0 80 7E 01 34 */ lwz r3, 0x134(r30) -/* 80293804 002903E4 54 60 06 BF */ clrlwi. r0, r3, 0x1a -/* 80293808 002903E8 40 82 00 0C */ bne .L_80293814 -/* 8029380C 002903EC 54 60 05 33 */ rlwinm. r0, r3, 0, 0x14, 0x19 -/* 80293810 002903F0 41 82 00 2C */ beq .L_8029383C -.L_80293814: -/* 80293814 002903F4 C0 1F 00 2C */ lfs f0, 0x2c(r31) -/* 80293818 002903F8 FC 00 00 50 */ fneg f0, f0 -/* 8029381C 002903FC D0 1F 00 2C */ stfs f0, 0x2c(r31) -/* 80293820 00290400 C0 1F 0D D4 */ lfs f0, 0xdd4(r31) -/* 80293824 00290404 FC 00 00 50 */ fneg f0, f0 -/* 80293828 00290408 D0 1F 0D D4 */ stfs f0, 0xdd4(r31) -/* 8029382C 0029040C C0 3F 0D D4 */ lfs f1, 0xdd4(r31) -/* 80293830 00290410 C0 1F 0D DC */ lfs f0, 0xddc(r31) -/* 80293834 00290414 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293838 00290418 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_8029383C: -/* 8029383C 0029041C 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80293840 00290420 38 60 00 00 */ li r3, 0 -/* 80293844 00290424 83 E1 00 2C */ lwz r31, 0x2c(r1) -/* 80293848 00290428 83 C1 00 28 */ lwz r30, 0x28(r1) -/* 8029384C 0029042C 83 A1 00 24 */ lwz r29, 0x24(r1) -/* 80293850 00290430 38 21 00 30 */ addi r1, r1, 0x30 -/* 80293854 00290434 7C 08 03 A6 */ mtlr r0 -/* 80293858 00290438 4E 80 00 20 */ blr - -.global it_8029385C -it_8029385C: -/* 8029385C 0029043C 7C 08 02 A6 */ mflr r0 -/* 80293860 00290440 38 80 00 01 */ li r4, 1 -/* 80293864 00290444 90 01 00 04 */ stw r0, 4(r1) -/* 80293868 00290448 38 A0 00 02 */ li r5, 2 -/* 8029386C 0029044C 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293870 00290450 4B FD 55 ED */ bl Item_80268E5C -/* 80293874 00290454 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293878 00290458 38 21 00 08 */ addi r1, r1, 8 -/* 8029387C 0029045C 7C 08 03 A6 */ mtlr r0 -/* 80293880 00290460 4E 80 00 20 */ blr -.L_80293884: -/* 80293884 00290464 7C 08 02 A6 */ mflr r0 -/* 80293888 00290468 38 80 00 01 */ li r4, 1 -/* 8029388C 0029046C 90 01 00 04 */ stw r0, 4(r1) -/* 80293890 00290470 38 A0 00 11 */ li r5, 0x11 -/* 80293894 00290474 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293898 00290478 4B FD 55 C5 */ bl Item_80268E5C -/* 8029389C 0029047C 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802938A0 00290480 38 21 00 08 */ addi r1, r1, 8 -/* 802938A4 00290484 7C 08 03 A6 */ mtlr r0 -/* 802938A8 00290488 4E 80 00 20 */ blr - -.global it_802938AC -it_802938AC: -/* 802938AC 0029048C 38 60 00 00 */ li r3, 0 -/* 802938B0 00290490 4E 80 00 20 */ blr - -.global it_802938B4 -it_802938B4: -/* 802938B4 00290494 7C 08 02 A6 */ mflr r0 -/* 802938B8 00290498 90 01 00 04 */ stw r0, 4(r1) -/* 802938BC 0029049C 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 802938C0 002904A0 93 E1 00 14 */ stw r31, 0x14(r1) -/* 802938C4 002904A4 93 C1 00 10 */ stw r30, 0x10(r1) -/* 802938C8 002904A8 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802938CC 002904AC 80 BF 00 CC */ lwz r5, 0xcc(r31) -/* 802938D0 002904B0 80 9F 00 C4 */ lwz r4, 0xc4(r31) -/* 802938D4 002904B4 C0 25 00 10 */ lfs f1, 0x10(r5) -/* 802938D8 002904B8 83 C4 00 04 */ lwz r30, 4(r4) -/* 802938DC 002904BC C0 45 00 14 */ lfs f2, 0x14(r5) -/* 802938E0 002904C0 4B FD EF 81 */ bl it_80272860 -/* 802938E4 002904C4 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 802938E8 002904C8 C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 802938EC 002904CC FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 802938F0 002904D0 40 80 00 0C */ bge .L_802938FC -/* 802938F4 002904D4 FC 00 08 50 */ fneg f0, f1 -/* 802938F8 002904D8 48 00 00 08 */ b .L_80293900 -.L_802938FC: -/* 802938FC 002904DC FC 00 08 90 */ fmr f0, f1 -.L_80293900: -/* 80293900 002904E0 C0 5E 00 04 */ lfs f2, 4(r30) -/* 80293904 002904E4 FC 00 10 40 */ fcmpo cr0, f0, f2 -/* 80293908 002904E8 40 80 00 10 */ bge .L_80293918 -/* 8029390C 002904EC C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 80293910 002904F0 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 80293914 002904F4 48 00 00 38 */ b .L_8029394C -.L_80293918: -/* 80293918 002904F8 C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 8029391C 002904FC FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293920 00290500 40 81 00 10 */ ble .L_80293930 -/* 80293924 00290504 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 80293928 00290508 EC 00 10 28 */ fsubs f0, f0, f2 -/* 8029392C 0029050C D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293930: -/* 80293930 00290510 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80293934 00290514 C0 02 D1 30 */ lfs f0, it_804DCB10@sda21(r2) -/* 80293938 00290518 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8029393C 0029051C 40 80 00 10 */ bge .L_8029394C -/* 80293940 00290520 C0 1E 00 04 */ lfs f0, 4(r30) -/* 80293944 00290524 EC 01 00 2A */ fadds f0, f1, f0 -/* 80293948 00290528 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_8029394C: -/* 8029394C 0029052C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 80293950 00290530 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 80293954 00290534 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 80293958 00290538 38 21 00 18 */ addi r1, r1, 0x18 -/* 8029395C 0029053C 7C 08 03 A6 */ mtlr r0 -/* 80293960 00290540 4E 80 00 20 */ blr - -.global it_80293964 -it_80293964: -/* 80293964 00290544 7C 08 02 A6 */ mflr r0 -/* 80293968 00290548 90 01 00 04 */ stw r0, 4(r1) -/* 8029396C 0029054C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80293970 00290550 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80293974 00290554 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80293978 00290558 93 A1 00 14 */ stw r29, 0x14(r1) -/* 8029397C 0029055C 7C 7D 1B 78 */ mr r29, r3 -/* 80293980 00290560 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293984 00290564 3C 60 80 29 */ lis r3, it_802936E4@ha -/* 80293988 00290568 38 83 36 E4 */ addi r4, r3, it_802936E4@l -/* 8029398C 0029056C 38 7D 00 00 */ addi r3, r29, 0 -/* 80293990 00290570 3B DF 03 78 */ addi r30, r31, 0x378 -/* 80293994 00290574 4B FD AE 4D */ bl it_8026E7E0 -/* 80293998 00290578 80 1F 00 C0 */ lwz r0, 0xc0(r31) -/* 8029399C 0029057C 2C 00 00 01 */ cmpwi r0, 1 -/* 802939A0 00290580 41 82 00 20 */ beq .L_802939C0 -/* 802939A4 00290584 80 1E 01 34 */ lwz r0, 0x134(r30) -/* 802939A8 00290588 54 00 03 E1 */ rlwinm. r0, r0, 0, 0xf, 0x10 -/* 802939AC 0029058C 41 82 00 14 */ beq .L_802939C0 -/* 802939B0 00290590 38 7D 00 00 */ addi r3, r29, 0 -/* 802939B4 00290594 38 9E 00 00 */ addi r4, r30, 0 -/* 802939B8 00290598 38 BF 0D D8 */ addi r5, r31, 0xdd8 -/* 802939BC 0029059C 4B FE 2A 4D */ bl it_80276408 -.L_802939C0: -/* 802939C0 002905A0 80 01 00 24 */ lwz r0, 0x24(r1) -/* 802939C4 002905A4 38 60 00 00 */ li r3, 0 -/* 802939C8 002905A8 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 802939CC 002905AC 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 802939D0 002905B0 83 A1 00 14 */ lwz r29, 0x14(r1) -/* 802939D4 002905B4 38 21 00 20 */ addi r1, r1, 0x20 -/* 802939D8 002905B8 7C 08 03 A6 */ mtlr r0 -/* 802939DC 002905BC 4E 80 00 20 */ blr - -.global it_802939E0 -it_802939E0: -/* 802939E0 002905C0 38 60 00 01 */ li r3, 1 -/* 802939E4 002905C4 4E 80 00 20 */ blr - -.global it_802939E8 -it_802939E8: -/* 802939E8 002905C8 7C 08 02 A6 */ mflr r0 -/* 802939EC 002905CC 90 01 00 04 */ stw r0, 4(r1) -/* 802939F0 002905D0 94 21 FF F8 */ stwu r1, -8(r1) -/* 802939F4 002905D4 4B FD 7E A1 */ bl it_8026B894 -/* 802939F8 002905D8 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802939FC 002905DC 38 21 00 08 */ addi r1, r1, 8 -/* 80293A00 002905E0 7C 08 03 A6 */ mtlr r0 -/* 80293A04 002905E4 4E 80 00 20 */ blr - - -.section .data - .balign 8 -.global it_803F6110 -it_803F6110: - .4byte 0 - .4byte it_80293754 - .4byte it_8029375C - .4byte it_80293798 - .4byte 0 - .4byte it_802938AC - .4byte it_802938B4 - .4byte it_80293964 - - -.section .sdata2 - .balign 8 -.global it_804DCB10 -it_804DCB10: - .4byte 0x00000000 -.global it_804DCB14 -it_804DCB14: - .4byte 0xBF800000 -.global it_804DCB18 -it_804DCB18: - .4byte 0x3F800000 diff --git a/asm/melee/lb/lbcardgame.s b/asm/melee/lb/lbcardgame.s index 63da7a7516..03997a7092 100644 --- a/asm/melee/lb/lbcardgame.s +++ b/asm/melee/lb/lbcardgame.s @@ -117,7 +117,7 @@ /* 800199FC 000165DC 48 00 00 35 */ bl lb_80019A30 /* 80019A00 000165E0 2C 03 00 00 */ cmpwi r3, 0x0 /* 80019A04 000165E4 41 82 00 08 */ beq .L_80019A0C -/* 80019A08 000165E8 48 35 E1 4D */ bl HSD_PadZeroQueue +/* 80019A08 000165E8 48 35 E1 4D */ bl HSD_PadRenewGameStatus .L_80019A0C: /* 80019A0C 000165EC 38 60 00 00 */ li r3, 0x0 /* 80019A10 000165F0 48 00 00 21 */ bl lb_80019A30 diff --git a/asm/sysdolphin/baselib/controller.s b/asm/sysdolphin/baselib/controller.s index 9125208799..cc9a73b937 100644 --- a/asm/sysdolphin/baselib/controller.s +++ b/asm/sysdolphin/baselib/controller.s @@ -1235,7 +1235,7 @@ /* 000011B4 000011F4 4E 80 00 20 */ blr .endfn HSD_PadRenewCopyStatus -.fn HSD_PadZeroQueue, global +.fn HSD_PadRenewGameStatus, global /* 000011B8 000011F8 3C 60 00 00 */ lis r3, HSD_PadLibData@ha /* 000011BC 000011FC C0 00 00 00 */ lfs f0, HSD_Controller_804DE5B0@sda21(r0) /* 000011C0 00001200 38 63 00 00 */ addi r3, r3, HSD_PadLibData@l @@ -1343,7 +1343,7 @@ /* 00001340 00001380 38 A5 00 44 */ addi r5, r5, 0x44 /* 00001344 00001384 42 00 FE 90 */ bdnz .L_000011D4 /* 00001348 00001388 4E 80 00 20 */ blr -.endfn HSD_PadZeroQueue +.endfn HSD_PadRenewGameStatus .fn HSD_PadRenewStatus, global /* 0000134C 0000138C 7C 08 02 A6 */ mflr r0 @@ -1353,7 +1353,7 @@ /* 0000135C 0000139C 48 00 00 01 */ bl HSD_PadRenewRawStatus /* 00001360 000013A0 48 00 00 01 */ bl HSD_PadRenewMasterStatus /* 00001364 000013A4 48 00 00 01 */ bl HSD_PadRenewCopyStatus -/* 00001368 000013A8 48 00 00 01 */ bl HSD_PadZeroQueue +/* 00001368 000013A8 48 00 00 01 */ bl HSD_PadRenewGameStatus /* 0000136C 000013AC 80 01 00 0C */ lwz r0, 0xc(r1) /* 00001370 000013B0 38 21 00 08 */ addi r1, r1, 0x8 /* 00001374 000013B4 7C 08 03 A6 */ mtlr r0 @@ -1669,9 +1669,13 @@ .skip 0x110 .endobj HSD_PadCopyStatus -.obj HSD_PadRumbleData, global - .skip 0x114 -.endobj HSD_PadRumbleData +.obj HSD_PadGameStatus, global + .skip 0x110 +.endobj HSD_PadGameStatus + +.obj pad, local + .skip 0x4 +.endobj pad # 0x00000000 - 0x00000070 .section .sdata2, "a" diff --git a/config/GALE01/symbols.txt b/config/GALE01/symbols.txt index 2c418c1db1..bdd845d177 100644 --- a/config/GALE01/symbols.txt +++ b/config/GALE01/symbols.txt @@ -12949,7 +12949,7 @@ fn_802545C4 = .text:0x802545C4; // type:function size:0x37B8 fn_80257D7C = .text:0x80257D7C; // type:function size:0x1A8 mnSnap_80257F24 = .text:0x80257F24; // type:function size:0xA1C scope:global mnGallery_80258940 = .text:0x80258940; // type:function size:0x2C scope:global -fn_8025896C = .text:0x8025896C; // type:function size:0x9C +mnGallery_8025896C = .text:0x8025896C; // type:function size:0x9C mnGallery_80258A08 = .text:0x80258A08; // type:function size:0x1BC scope:global mnGallery_80258BC4 = .text:0x80258BC4; // type:function size:0x18C scope:global mnGallery_80258D50 = .text:0x80258D50; // type:function size:0x6C scope:global @@ -14322,7 +14322,7 @@ it_80293754 = .text:0x80293754; // type:function size:0x8 scope:global it_8029375C = .text:0x8029375C; // type:function size:0x3C scope:global it_80293798 = .text:0x80293798; // type:function size:0xC4 scope:global it_8029385C = .text:0x8029385C; // type:function size:0x28 scope:global -fn_80293884 = .text:0x80293884; // type:function size:0x28 +it_80293884 = .text:0x80293884; // type:function size:0x28 it_802938AC = .text:0x802938AC; // type:function size:0x8 scope:global it_802938B4 = .text:0x802938B4; // type:function size:0xB0 scope:global it_80293964 = .text:0x80293964; // type:function size:0x7C scope:global @@ -19453,7 +19453,7 @@ HSD_PadADConvertCheck1 = .text:0x803771D4; // type:function size:0x27C scope:glo HSD_PadCrossDir = .text:0x80377450; // type:function size:0xBC scope:global HSD_PadRenewMasterStatus = .text:0x8037750C; // type:function size:0x4B4 scope:global HSD_PadRenewCopyStatus = .text:0x803779C0; // type:function size:0x194 scope:global -HSD_PadZeroQueue = .text:0x80377B54; // type:function size:0x194 scope:global +HSD_PadRenewGameStatus = .text:0x80377B54; // type:function size:0x194 scope:global HSD_PadRenewStatus = .text:0x80377CE8; // type:function size:0x30 scope:global HSD_PadReset = .text:0x80377D18; // type:function size:0x80 scope:global HSD_PadInit = .text:0x80377D98; // type:function size:0x2F8 scope:global @@ -25163,7 +25163,7 @@ HSD_VIData = .bss:0x804C1D80; // type:object size:0x1F4 scope:global data:4byte HSD_PadLibData = .bss:0x804C1F78; // type:object size:0x34 scope:global data:byte HSD_PadMasterStatus = .bss:0x804C1FAC; // type:object size:0x110 scope:global data:4byte HSD_PadCopyStatus = .bss:0x804C20BC; // type:object size:0x110 scope:global data:4byte -HSD_PadRumbleData = .bss:0x804C21CC; // type:object size:0x114 scope:global data:4byte +HSD_PadGameStatus = .bss:0x804C21CC; // type:object size:0x110 scope:global data:4byte HSD_Rumble_804C22E0 = .bss:0x804C22E0; // type:object size:0x30 scope:global data:4byte ...bss.0 = .bss:0x804C22E0; // type:label scope:local HSD_Mtx_804C2310 = .bss:0x804C2310; // type:object size:0x2C scope:global diff --git a/configure.py b/configure.py index f3089cf66d..b257ab15c9 100755 --- a/configure.py +++ b/configure.py @@ -18,8 +18,9 @@ from typing import Iterator, List, Optional from tools.project import ( - LibDict, + Library, Object, + ProgressCategory, ProjectConfig, calculate_progress, generate_build, @@ -70,12 +71,6 @@ action="store_true", help="generate map file(s)", ) -parser.add_argument( - "--use-asm", - dest="no_asm", - action="store_false", - help="incorporate .s files from asm directory", -) parser.add_argument( "--debug", action="store_true", @@ -94,6 +89,12 @@ type=Path, help="path to decomp-toolkit binary or source (optional)", ) +parser.add_argument( + "--objdiff", + metavar="BINARY | DIR", + type=Path, + help="path to objdiff-cli binary or source (optional)", +) parser.add_argument( "--sjiswrap", metavar="EXE", @@ -150,21 +151,23 @@ # Apply arguments config.build_dir = args.build_dir config.dtk_path = args.dtk +config.objdiff_path = args.objdiff config.binutils_path = args.binutils config.compilers_path = args.compilers -config.debug = args.debug config.generate_map = args.map config.non_matching = args.non_matching config.sjiswrap_path = args.sjiswrap if not is_windows(): config.wrapper = args.wrapper -if args.no_asm: +# Don't build asm unless we're --non-matching +if not config.non_matching: config.asm_dir = None # Tool versions config.binutils_tag = "2.42-1" -config.compilers_tag = "20231018" -config.dtk_tag = "v0.9.3" +config.compilers_tag = "20240706" +config.dtk_tag = "v0.9.6" +config.objdiff_tag = "v2.0.0-beta.6" config.sjiswrap_tag = "v1.1.1" config.wibo_tag = "0.6.11" @@ -183,6 +186,12 @@ "-nodefaults", "-warn off", ] +if args.debug: + config.ldflags.append("-g") # Or -gdwarf-2 for Wii linkers +if args.map: + config.ldflags.append("-mapunused") + # config.ldflags.append("-listclosure") # For Wii linkers + # Use for any additional files that should cause a re-configure when modified config.reconfig_deps = [] @@ -214,7 +223,9 @@ f"-DVERSION={version_num}", ] -if config.debug: +# Debug flags +if args.debug: + # Or -sym dwarf-2 for Wii compilers cflags_base.extend(["-sym on", "-DDEBUG=1"]) else: cflags_base.append("-DNDEBUG=1") @@ -268,7 +279,8 @@ def Lib( includes: List[str] = includes_base, system_includes: List[str] = system_includes_base, src_dir: Optional[str] = None, -) -> LibDict: + category: Optional[str] = None, +) -> Library: def make_includes(includes: List[str]) -> Iterator[str]: return map(lambda s: f"-i {s}", includes) @@ -282,6 +294,7 @@ def make_includes(includes: List[str]) -> Iterator[str]: *make_includes(system_includes), ], "host": False, + "progress_category": category, "objects": objects, } @@ -293,7 +306,7 @@ def make_includes(includes: List[str]) -> Iterator[str]: def DolphinLib( lib_name: str, objects: Objects, fix_epilogue=False, extern=False -) -> LibDict: +) -> Library: if extern: cflags = [ "-c", @@ -332,10 +345,11 @@ def DolphinLib( cflags=cflags, includes=includes, system_includes=system_includes, + category="sdk", ) -def SysdolphinLib(lib_name: str, objects: Objects) -> LibDict: +def SysdolphinLib(lib_name: str, objects: Objects) -> Library: return Lib( lib_name, objects, @@ -347,10 +361,11 @@ def SysdolphinLib(lib_name: str, objects: Objects) -> LibDict: *system_includes_base, "src/dolphin", ], + category="hsd", ) -def MeleeLib(lib_name: str, objects: Objects) -> LibDict: +def MeleeLib(lib_name: str, objects: Objects) -> Library: return Lib( lib_name, objects, @@ -364,15 +379,17 @@ def MeleeLib(lib_name: str, objects: Objects) -> LibDict: "src/dolphin", "src/sysdolphin", ], + category="game", ) -def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: +def RuntimeLib(lib_name: str, objects: Objects) -> Library: return Lib( lib_name, objects, cflags=cflags_runtime, fix_epilogue=False, + category="runtime", ) @@ -962,8 +979,8 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: Object(NonMatching, "melee/it/items/itstarrod.c"), Object(NonMatching, "melee/it/items/itharisen.c"), Object(Matching, "melee/it/items/itfflower.c"), - Object(NonMatching, "melee/it/items/itkinoko.c"), - Object(NonMatching, "melee/it/items/itdkinoko.c"), + Object(Matching, "melee/it/items/itkinoko.c"), + Object(Matching, "melee/it/items/itdkinoko.c"), Object(Matching, "melee/it/items/ithammer.c"), Object(NonMatching, "melee/it/items/itwstar.c"), Object(Matching, "melee/it/items/itscball.c"), @@ -1103,7 +1120,7 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: Object(NonMatching, "melee/it/items/itmasterhandlaser.c"), Object(NonMatching, "melee/it/items/itmasterhandbullet.c"), Object(NonMatching, "melee/it/items/itcrazyhandbomb.c"), - Object(NonMatching, "melee/it/items/itcoin.c"), + Object(Matching, "melee/it/items/itcoin.c"), Object(NonMatching, "melee/it/items/itkirby_2F23.c"), Object(NonMatching, "melee/it/items/it_2F28.c"), Object(Matching, "melee/it/items/it_2F2B.c"), @@ -1472,13 +1489,22 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: ), ] +# Optional extra categories for progress tracking +# Adjust as desired for your project +config.progress_categories = [ + ProgressCategory("game", "Game Code"), + ProgressCategory("hsd", "HSD Code"), + ProgressCategory("sdk", "Dolphin SDK Code"), + ProgressCategory("runtime", "Gekko Runtime Code"), +] +config.progress_all = False +config.progress_each_module = args.verbose + if args.mode == "configure": # Write build.ninja and objdiff.json generate_build(config) elif args.mode == "progress": # Print progress and write progress.json - config.progress_each_module = args.verbose - config.progress_all = False calculate_progress(config) else: sys.exit("Unknown mode: " + args.mode) diff --git a/obj_files.mk b/obj_files.mk index 576136190c..d065224b3e 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -585,8 +585,8 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/asm/melee/it/items/itstarrod.s.o\ $(BUILD_DIR)/asm/melee/it/items/itharisen.s.o\ $(BUILD_DIR)/src/melee/it/items/itfflower.c.o\ - $(BUILD_DIR)/asm/melee/it/items/itkinoko.s.o\ - $(BUILD_DIR)/asm/melee/it/items/itdkinoko.s.o\ + $(BUILD_DIR)/src/melee/it/items/itkinoko.c.o\ + $(BUILD_DIR)/src/melee/it/items/itdkinoko.c.o\ $(BUILD_DIR)/src/melee/it/items/ithammer.c.o\ $(BUILD_DIR)/asm/melee/it/items/itwstar.s.o\ $(BUILD_DIR)/src/melee/it/items/itscball.c.o\ @@ -730,7 +730,7 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/asm/melee/it/items/itmasterhandlaser.s.o\ $(BUILD_DIR)/asm/melee/it/items/itmasterhandbullet.s.o\ $(BUILD_DIR)/asm/melee/it/items/itcrazyhandbomb.s.o\ - $(BUILD_DIR)/asm/melee/it/items/itcoin.s.o\ + $(BUILD_DIR)/src/melee/it/items/itcoin.c.o\ $(BUILD_DIR)/asm/melee/it/items/itkirby_2F23.s.o\ $(BUILD_DIR)/asm/melee/it/items/it_2F28.s.o\ $(BUILD_DIR)/src/melee/it/items/it_2F2B.c.o\ diff --git a/src/MSL/math.h b/src/MSL/math.h index 4da5e43249..f68ca7f1f2 100644 --- a/src/MSL/math.h +++ b/src/MSL/math.h @@ -84,6 +84,11 @@ static inline f32 fabs_inline(f32 x) } } +static inline double fabs(double f) +{ + return __fabs(f); +} + double frexp(double x, int* exponent); float fabsf__Ff(float); float tanf(float x); diff --git a/src/common_structs.h b/src/common_structs.h index 0e5e8b395a..e4af241ac4 100644 --- a/src/common_structs.h +++ b/src/common_structs.h @@ -55,6 +55,7 @@ typedef u32 HSD_Pad; #define MPCOLL_FLAGS_B11 (1 << 11) #define MPCOLL_CEIL 0x6000 ///< Bits 13-14 #define MPCOLL_FLAGS_B14 (1 << 14) +#define MPCOLL_UNK 0x18000 #define MPCOLL_GRPUSH (1 << 15) #define MPCOLL_FLAGS_B16 (1 << 16) #define MPCOLL_FLAGS_B23 (1 << 23) diff --git a/src/dolphin/pad/pad.h b/src/dolphin/pad/pad.h index 4424d1700b..210d1d4274 100644 --- a/src/dolphin/pad/pad.h +++ b/src/dolphin/pad/pad.h @@ -42,7 +42,7 @@ void PADControlMotor(int chan, u32 command); void VISetBlack(bool); u32 VIGetRetraceCount(void); void PADClamp(PADStatus*); -void PADRead(u8*); +void PADRead(PADStatus*); void PADReset(u32); void PADTypeAndStatusCallback(s32 chan, u32 type); void PADSetSpec(s32); diff --git a/src/melee/ft/fighter.c b/src/melee/ft/fighter.c index e28ce9c54d..b897aa4c2b 100644 --- a/src/melee/ft/fighter.c +++ b/src/melee/ft/fighter.c @@ -98,8 +98,6 @@ extern ftData* gFtDataList[FTKIND_MAX]; extern MotionState ftData_MotionStateList[ftCo_MS_Count]; extern MotionState* ftData_CharacterStateTables[FTKIND_MAX]; -extern HSD_PadStatus HSD_PadRumbleData[4]; - extern StageInfo stage_info; // from asm/melee/gm_1A36.s // ==== fighter.c variables ==== @@ -1816,20 +1814,20 @@ void Fighter_Spaghetti_8006AD10(Fighter_GObj* gobj) } else { SET_STICKS(fp->input.lstick.x, fp->input.lstick.y, - HSD_PadRumbleData[fp->x618_player_id].nml_stickX, - HSD_PadRumbleData[fp->x618_player_id].nml_stickY); + HSD_PadGameStatus[fp->x618_player_id].nml_stickX, + HSD_PadGameStatus[fp->x618_player_id].nml_stickY); if (g_debugLevel < 3 && gm_8016B41C() == 0) { SET_STICKS( fp->input.cstick.x, fp->input.cstick.y, - HSD_PadRumbleData[fp->x618_player_id].nml_subStickX, - HSD_PadRumbleData[fp->x618_player_id].nml_subStickY); + HSD_PadGameStatus[fp->x618_player_id].nml_subStickX, + HSD_PadGameStatus[fp->x618_player_id].nml_subStickY); } else { fp->input.cstick.x = 0; fp->input.cstick.y = 0; } - tempf1 = HSD_PadRumbleData[fp->x618_player_id].nml_analogR; - tempf0 = HSD_PadRumbleData[fp->x618_player_id].nml_analogL; + tempf1 = HSD_PadGameStatus[fp->x618_player_id].nml_analogR; + tempf0 = HSD_PadGameStatus[fp->x618_player_id].nml_analogL; fp->input.x650 = (tempf0 > tempf1) ? tempf0 : tempf1; } @@ -1858,7 +1856,7 @@ void Fighter_Spaghetti_8006AD10(Fighter_GObj* gobj) fp->input.held_inputs = ftCo_800A198C(fp); } else { fp->input.held_inputs = - HSD_PadRumbleData[fp->x618_player_id].button; + HSD_PadGameStatus[fp->x618_player_id].button; } if (gm_8016B0FC()) { diff --git a/src/melee/gm/gmmain.c b/src/melee/gm/gmmain.c index 741a705ca0..91c0f61938 100644 --- a/src/melee/gm/gmmain.c +++ b/src/melee/gm/gmmain.c @@ -60,7 +60,7 @@ enum { static u32 arena_size; static bool gmMain_804D6594; -static u8 gmMain_8046B108[0xF0]; +static HSD_PadData gmMain_8046B108[5]; static HSD_PadRumbleListData gmMain_8046B1F8[12]; static void gmMain_8015FD24(void) diff --git a/src/melee/gr/grdisplay.c b/src/melee/gr/grdisplay.c index f78b6fb7ff..f2e1e5d32f 100644 --- a/src/melee/gr/grdisplay.c +++ b/src/melee/gr/grdisplay.c @@ -71,3 +71,14 @@ void grDisplay_801C5B90(HSD_JObj* jobj, void* arg1, u32 arg2, int arg3) } } } + +void grDisplay_801C5F60(HSD_GObj* gobj, int code) +{ + HSD_CObj* cobj = GET_COBJ(gobj); + if (HSD_CObjSetCurrent(cobj)) { + gobj->gxlink_prios = 8; + Camera_800310A0(0); + HSD_GObj_80390ED0(gobj, 7); + HSD_CObjEndCurrent(); + } +} diff --git a/src/melee/gr/grmaterial.c b/src/melee/gr/grmaterial.c index bd64c38864..51d6442ce1 100644 --- a/src/melee/gr/grmaterial.c +++ b/src/melee/gr/grmaterial.c @@ -187,6 +187,11 @@ void grMaterial_801C8E08(HSD_GObj* gobj) it_802756E0(gobj); } +void grMaterial_801C8E28(HSD_GObj* gobj) +{ + it_802756D0(gobj); +} + bool grMaterial_801C8E48(HSD_GObj* gobj) { Item* it = gobj->user_data; diff --git a/src/melee/gr/grmaterial.h b/src/melee/gr/grmaterial.h index e657c0a191..fa47fa028d 100644 --- a/src/melee/gr/grmaterial.h +++ b/src/melee/gr/grmaterial.h @@ -14,6 +14,7 @@ /* 1C8CFC */ int grMaterial_801C8CFC(int, int, Ground*, HSD_JObj*, int, HSD_GObjEvent, int); /* 1C8E08 */ void grMaterial_801C8E08(int); +/* 1C8E28 */ void grMaterial_801C8E28(HSD_GObj*); /* 1C94D8 */ void grMaterial_801C94D8(UNK_T hsd_obj); /* 1C95C4 */ void grMaterial_801C95C4(HSD_GObj*); /* 1C9604 */ void grMaterial_801C9604(HSD_GObj* bg, int, bool); diff --git a/src/melee/it/itCommonItems.h b/src/melee/it/itCommonItems.h index a80f90b0ce..d24d06322b 100644 --- a/src/melee/it/itCommonItems.h +++ b/src/melee/it/itCommonItems.h @@ -299,4 +299,11 @@ typedef struct HassamVars { f32 x68; } HassamVars; +typedef struct KinokoVars { + f32 x0; + f32 x4; + f32 x8; + f32 xC; +} KinokoVars; + #endif diff --git a/src/melee/it/it_266F.h b/src/melee/it/it_266F.h index aa38003f02..a901a3b48f 100644 --- a/src/melee/it/it_266F.h +++ b/src/melee/it/it_266F.h @@ -59,6 +59,7 @@ typedef void (*ItCallback)(HSD_GObj*); /* 26E248 */ void it_8026E248(Item_GObj*, HSD_GObjEvent); /* 26E414 */ void it_8026E414(Item_GObj*, HSD_GObjEvent); /* 26E71C */ void it_8026E71C(Item_GObj*, HSD_GObjEvent); +/* 26E7E0 */ void it_8026E7E0(Item_GObj*, ItCallback); /* 26E8C4 */ void it_8026E8C4(Item_GObj*, HSD_GObjEvent, HSD_GObjEvent); /* 26E9A4 */ s32 it_8026E9A4(Item_GObj*, Vec3*, Vec3*, Vec3*); /* 26EA20 */ s32 it_8026EA20(Item_GObj*, Vec3*, Vec3*, Vec3*, s32*, Vec3*); diff --git a/src/melee/it/it_2725.h b/src/melee/it/it_2725.h index ae833079e4..7f7129fbc4 100644 --- a/src/melee/it/it_2725.h +++ b/src/melee/it/it_2725.h @@ -7,6 +7,7 @@ #include #include "it/items/types.h" +#include "lb/types.h" #include @@ -31,6 +32,7 @@ /* 275DFC */ void it_80275DFC(HSD_GObj*); /* 276214 */ bool it_80276214(Item_GObj*); /* 2762D8 */ bool it_802762D8(HSD_GObj*); +/* 276408 */ void it_80276408(Item_GObj*, CollData*, f32*); /* 276CB8 */ void it_80276CB8(Item_GObj* gobj); /* 276CEC */ void it_80276CEC(HSD_GObj*); /* 276FC4 */ void it_80276FC4(HSD_GObj*); diff --git a/src/melee/it/items/itdkinoko.c b/src/melee/it/items/itdkinoko.c index 8b13789179..2826c4c69e 100644 --- a/src/melee/it/items/itdkinoko.c +++ b/src/melee/it/items/itdkinoko.c @@ -1 +1,148 @@ +#include "itdkinoko.h" +#include "it/inlines.h" +#include "it/it_266F.h" +#include "it/it_26B1.h" +#include "it/it_2725.h" +#include "it/item.h" +#include "it/items/itkinoko.h" + +ItemStateTable it_803F6130[] = { + { 0, it_80293AE0, it_80293AE8, it_80293B24 }, + { 0, it_80293C38, it_80293C40, it_80293CF0 }, +}; + +void it_80293A08(Item_GObj* gobj) +{ + Item* it; + + it = GET_ITEM(gobj); + if (it->pos.x > 0.0f) { + it->facing_dir = -1.0f; + } else { + it->facing_dir = 1.0f; + } + it->xD5C = 0; + it->xDD4_itemVar.kinoko.x0 = 0.0f; + it->xDD4_itemVar.kinoko.x4 = 0.0f; + it->xDD4_itemVar.kinoko.x8 = 1.0f; + it->xDD4_itemVar.kinoko.xC = 0.0f; + it_80293BE8(gobj); +} + +void it_80293A70(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + PAD_STACK(8); + + it->x40_vel.x = it->xDD4_itemVar.kinoko.x0; + it->x40_vel.y = it->x40_vel.z = 0.0f; + + it_8026B390(gobj); + Item_8026AE84(it, 0x107, 0x7F, 0x40); + Item_80268E5C(gobj, 0, ITEM_UNK_0x1 | ITEM_HIT_PRESERVE); +} + +bool it_80293AE0(Item_GObj* gobj) +{ + return false; +} + +void it_80293AE8(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + KinokoAttrs* attrs = it->xC4_article_data->x4_specialAttributes; + if (it->ground_or_air != GA_Air) { + it->xDD4_itemVar.kinoko.x0 = attrs->x0 * it->facing_dir; + it->x40_vel.x = + it->xDD4_itemVar.kinoko.x0 * it->xDD4_itemVar.kinoko.x8; + } +} + +bool it_80293B24(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + CollData* cd = &it->x378_itemColl; + PAD_STACK(16); + + it_8026D78C(gobj, it_80293C10); + if (it->ground_or_air != GA_Air) { + if ((cd->env_flags & MPCOLL_UNK)) { + it_80276408(gobj, cd, &it->xDD4_itemVar.kinoko.x4); + } else { + it->xDD4_itemVar.kinoko.x4 = 0.0f; + } + if ((cd->env_flags & MPCOLL_RIGHTWALL) || + (cd->env_flags & MPCOLL_LEFTWALL)) + { + it->facing_dir = -it->facing_dir; + it->xDD4_itemVar.kinoko.x0 = -it->xDD4_itemVar.kinoko.x0; + it->x40_vel.x = + it->xDD4_itemVar.kinoko.x0 * it->xDD4_itemVar.kinoko.x8; + } + } + return 0; +} + +void it_80293BE8(Item_GObj* gobj) +{ + Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE); +} + +void it_80293C10(Item_GObj* gobj) +{ + Item_80268E5C(gobj, 1, ITEM_UNK_0x1 | ITEM_HIT_PRESERVE); +} + +bool it_80293C38(Item_GObj* gobj) +{ + return false; +} + +void it_80293C40(Item_GObj* gobj) +{ + f32 vel; + Item* it = GET_ITEM(gobj); + ItemAttr* attr = it->xCC_item_attr; + KinokoAttrs* sa = it->xC4_article_data->x4_specialAttributes; + + it_80272860(gobj, attr->x10_fall_speed, attr->x14_fall_speed_max); + + if (it->x40_vel.x < 0.0f) { + vel = -it->x40_vel.x; + } else { + vel = it->x40_vel.x; + } + + if (vel < sa->x4) { + it->x40_vel.x = 0.0f; + return; + } else if (it->x40_vel.x > 0.0f) { + it->x40_vel.x -= sa->x4; + } + if (it->x40_vel.x < 0.0f) { + it->x40_vel.x += sa->x4; + } +} + +bool it_80293CF0(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + CollData* cd = &it->x378_itemColl; + + it_8026E414(gobj, it_80293A70); + if (it->ground_or_air != GA_Air && (cd->env_flags & MPCOLL_UNK)) { + it_80276408(gobj, cd, &it->xDD4_itemVar.kinoko.x4); + } + return false; +} + +bool it_80293D6C(Item_GObj* gobj) +{ + return true; +} + +void it_80293D74(Item_GObj* gobj, HSD_GObj* gobj_2) +{ + it_8026B894(gobj, gobj_2); +} diff --git a/src/melee/it/items/itdkinoko.h b/src/melee/it/items/itdkinoko.h index 9837e43842..0905e04da3 100644 --- a/src/melee/it/items/itdkinoko.h +++ b/src/melee/it/items/itdkinoko.h @@ -6,9 +6,18 @@ #include "it/items/types.h" -/* 293A08 */ void it_80293A08(Item_GObj*); -/* 293D6C */ bool it_80293D6C(Item_GObj*); -/* 293D74 */ void it_80293D74(Item_GObj*, Item_GObj*); -/* 3F6130 */ extern ItemStateTable it_803F6130[]; +void it_80293A08(Item_GObj*); +void it_80293A70(Item_GObj*); +bool it_80293AE0(Item_GObj*); +void it_80293AE8(Item_GObj*); +bool it_80293B24(Item_GObj*); +void it_80293BE8(Item_GObj*); +void it_80293C10(Item_GObj*); +bool it_80293C38(Item_GObj*); +void it_80293C40(Item_GObj*); +bool it_80293CF0(Item_GObj*); +bool it_80293D6C(Item_GObj*); +void it_80293D74(Item_GObj*, Item_GObj*); +extern ItemStateTable it_803F6130[]; #endif diff --git a/src/melee/it/items/itkinoko.c b/src/melee/it/items/itkinoko.c index 8b13789179..a577f02d73 100644 --- a/src/melee/it/items/itkinoko.c +++ b/src/melee/it/items/itkinoko.c @@ -1 +1,153 @@ +#include "itkinoko.h" +#include "it/inlines.h" +#include "it/it_266F.h" +#include "it/it_26B1.h" +#include "it/it_2725.h" +#include "it/item.h" + +ItemStateTable it_803F6110[] = { + { 0, it_80293754, it_8029375C, it_80293798 }, + { 0, it_802938AC, it_802938B4, it_80293964 }, +}; + +HSD_AnimJoint* it_80293660(int idx) +{ + KinokoAnim* attrs = it_804D6D24[It_Kind_Kinoko]->x4_specialAttributes; + return attrs[idx + 2].joint; +} + +void it_8029367C(Item_GObj* gobj) +{ + Item* it; + + it = GET_ITEM(gobj); + if (it->pos.x > 0.0f) { + it->facing_dir = -1.0f; + } else { + it->facing_dir = 1.0f; + } + it->xD5C = 0; + it->xDD4_itemVar.kinoko.x0 = 0.0f; + it->xDD4_itemVar.kinoko.x4 = 0.0f; + it->xDD4_itemVar.kinoko.x8 = 1.0f; + it->xDD4_itemVar.kinoko.xC = 0.0f; + it_8029385C(gobj); +} + +void it_802936E4(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + PAD_STACK(8); + + it->x40_vel.x = it->xDD4_itemVar.kinoko.x0; + it->x40_vel.y = it->x40_vel.z = 0.0f; + + it_8026B390(gobj); + Item_8026AE84(it, 0x107, 0x7F, 0x40); + Item_80268E5C(gobj, 0, ITEM_UNK_0x1 | ITEM_HIT_PRESERVE); +} + +bool it_80293754(Item_GObj* gobj) +{ + return false; +} + +void it_8029375C(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + KinokoAttrs* attrs = it->xC4_article_data->x4_specialAttributes; + if (it->ground_or_air != GA_Air) { + it->xDD4_itemVar.kinoko.x0 = attrs->x0 * it->facing_dir; + it->x40_vel.x = + it->xDD4_itemVar.kinoko.x0 * it->xDD4_itemVar.kinoko.x8; + } +} + +bool it_80293798(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + CollData* cd = &it->x378_itemColl; + PAD_STACK(16); + + it_8026D78C(gobj, it_80293884); + if (it->ground_or_air != GA_Air) { + if ((cd->env_flags & MPCOLL_UNK)) { + it_80276408(gobj, cd, &it->xDD4_itemVar.kinoko.x4); + } else { + it->xDD4_itemVar.kinoko.x4 = 0.0f; + } + if ((cd->env_flags & MPCOLL_RIGHTWALL) || + (cd->env_flags & MPCOLL_LEFTWALL)) + { + it->facing_dir = -it->facing_dir; + it->xDD4_itemVar.kinoko.x0 = -it->xDD4_itemVar.kinoko.x0; + it->x40_vel.x = + it->xDD4_itemVar.kinoko.x0 * it->xDD4_itemVar.kinoko.x8; + } + } + return 0; +} + +void it_8029385C(Item_GObj* gobj) +{ + Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE); +} + +void it_80293884(Item_GObj* gobj) +{ + Item_80268E5C(gobj, 1, ITEM_UNK_0x1 | ITEM_HIT_PRESERVE); +} + +bool it_802938AC(Item_GObj* gobj) +{ + return false; +} + +void it_802938B4(Item_GObj* gobj) +{ + f32 vel; + Item* it = GET_ITEM(gobj); + ItemAttr* attr = it->xCC_item_attr; + KinokoAttrs* sa = it->xC4_article_data->x4_specialAttributes; + + it_80272860(gobj, attr->x10_fall_speed, attr->x14_fall_speed_max); + + if (it->x40_vel.x < 0.0f) { + vel = -it->x40_vel.x; + } else { + vel = it->x40_vel.x; + } + + if (vel < sa->x4) { + it->x40_vel.x = 0.0f; + return; + } else if (it->x40_vel.x > 0.0f) { + it->x40_vel.x -= sa->x4; + } + if (it->x40_vel.x < 0.0f) { + it->x40_vel.x += sa->x4; + } +} + +bool it_80293964(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + CollData* cd = &it->x378_itemColl; + + it_8026E7E0(gobj, it_802936E4); + if (it->ground_or_air != GA_Air && (cd->env_flags & MPCOLL_UNK)) { + it_80276408(gobj, cd, &it->xDD4_itemVar.kinoko.x4); + } + return false; +} + +bool it_802939E0(Item_GObj* gobj) +{ + return true; +} + +void it_802939E8(Item_GObj* gobj, HSD_GObj* gobj_2) +{ + it_8026B894(gobj, gobj_2); +} diff --git a/src/melee/it/items/itkinoko.h b/src/melee/it/items/itkinoko.h index cb3612a40f..a3bebe6eec 100644 --- a/src/melee/it/items/itkinoko.h +++ b/src/melee/it/items/itkinoko.h @@ -6,9 +6,30 @@ #include "it/items/types.h" -/* 29367C */ void it_8029367C(Item_GObj*); -/* 2939E0 */ bool it_802939E0(Item_GObj*); -/* 2939E8 */ void it_802939E8(Item_GObj*, Item_GObj*); -/* 3F6110 */ extern ItemStateTable it_803F6110[]; +typedef struct KinokoAnim { + HSD_AnimJoint* joint; +} KinokoAnim; + +typedef struct KinokoAttrs { + f32 x0; + f32 x4; + s32 x8; +} KinokoAttrs; + +HSD_AnimJoint* it_80293660(int idx); +void it_8029367C(Item_GObj*); +void it_802936E4(Item_GObj*); +bool it_80293754(Item_GObj*); +void it_8029375C(Item_GObj*); +bool it_80293798(Item_GObj*); +void it_8029385C(Item_GObj*); +void it_80293884(Item_GObj*); +bool it_802938AC(Item_GObj*); +void it_802938B4(Item_GObj*); +bool it_80293964(Item_GObj*); +bool it_802939E0(Item_GObj*); +void it_802939E8(Item_GObj*, HSD_GObj*); + +extern ItemStateTable it_803F6110[]; #endif diff --git a/src/melee/it/types.h b/src/melee/it/types.h index cba6f6c298..b49ff9da34 100644 --- a/src/melee/it/types.h +++ b/src/melee/it/types.h @@ -573,6 +573,7 @@ struct Item { FFlowerVars fflower; FFlowerFlameVars fflowerflame; HassamVars hassam; + KinokoVars kinoko; itUnkVars unk; u8 padding[0xFCC - 0xDD4]; } xDD4_itemVar; diff --git a/src/melee/mn/mngallery.c b/src/melee/mn/mngallery.c index 8b13789179..b2c77d969c 100644 --- a/src/melee/mn/mngallery.c +++ b/src/melee/mn/mngallery.c @@ -1 +1,11 @@ +#include "mngallery.h" +#include +#include + +extern void* mnGallery_804D6C8C; + +void mnGallery_80258940(void) +{ + mnGallery_804D6C8C = HSD_MemAlloc(0x271000); +} diff --git a/src/melee/mn/mngallery.h b/src/melee/mn/mngallery.h index 8b13789179..1cca646fc1 100644 --- a/src/melee/mn/mngallery.h +++ b/src/melee/mn/mngallery.h @@ -1 +1,10 @@ +#ifndef _mngallery_h_ +#define _mngallery_h_ +#include + +#include + +void mnGallery_80258940(void); + +#endif diff --git a/src/sysdolphin/baselib/cobj.c b/src/sysdolphin/baselib/cobj.c index ff775c1cd0..9ddfd89ddc 100644 --- a/src/sysdolphin/baselib/cobj.c +++ b/src/sysdolphin/baselib/cobj.c @@ -8,6 +8,7 @@ #include "displayfunc.h" #include "initialize.h" #include "mtx.h" +#include "util.h" #include "video.h" #include "wobj.h" @@ -34,6 +35,8 @@ static void CObjUpdateFunc(void* obj, int type, HSD_ObjData* val); static void CObjRelease(HSD_Class* o); static void CObjAmnesia(HSD_ClassInfo* info); +HSD_CObjInfo hsdCObj = { CObjInfoInit }; + void HSD_CObjEraseScreen(HSD_CObj* cobj, s32 enable_color, s32 enable_alpha, s32 enable_depth) { @@ -118,14 +121,6 @@ void HSD_CObjAddAnim(HSD_CObj* cobj, HSD_CameraAnim* canim) HSD_WObjAddAnim(HSD_CObjGetInterestWObj(cobj), canim->interest_anim); } -HSD_CObjInfo hsdCObj = { CObjInfoInit }; - -typedef struct _HSD_FObjData { - float fv; - s32 iv; - Vec3 p; -} FObjData; - static void CObjUpdateFunc(void* obj, int type, HSD_ObjData* val) { HSD_CObj* cobj = obj; @@ -388,12 +383,13 @@ static bool setupTopHalfCamera(HSD_CObj* cobj) static bool setupBottomHalfCamera(HSD_CObj* cobj) { int unused[4]; - GXProjectionType projection_type; Mtx p; - f32 top, abs_top, margin, bottom, left, right, width, height, h_scale, t, - b, w, h; + f32 top, bottom; + f32 left, right; + f32 width, height, hscale; + f32 t, b, w, h; u32 screen_top; GXRenderModeObj* rmode = HSD_VIGetRenderMode(); @@ -404,6 +400,7 @@ static bool setupBottomHalfCamera(HSD_CObj* cobj) return 0; } + top = cobj->scissor.top; left = cobj->scissor.left; right = cobj->scissor.right; top = (cobj->scissor.top > screen_top ? cobj->scissor.top : screen_top) - @@ -413,24 +410,23 @@ static bool setupBottomHalfCamera(HSD_CObj* cobj) height = bottom - top; GXSetScissor((u32) left, (u32) top, (u32) width, (u32) height); - top = cobj->viewport.ymin; - left = cobj->viewport.xmin; - right = cobj->viewport.xmax; + top = cobj->viewport.ymin; // lfs f4,0x14(r30) + left = cobj->viewport.xmin; // lfs f1,0xc(r30) + right = cobj->viewport.xmax; // lfs f3,0x10(r30) + top = (top > screen_top ? top : screen_top); // fcmpo cr0, f4, f0 + bottom = cobj->viewport.ymax; // lfs f10, 0x18(r30) + width = right - left; // fsubs f3, f3, f1 + height = bottom - cobj->viewport.ymin; // fsubs f0, f10, f4 - if (top > screen_top) { - abs_top = top; - } else { - abs_top = screen_top; - } - bottom = cobj->viewport.ymax; - width = right - left; - height = bottom - top; + { + int unused; + t = top - screen_top; + h = (bottom - screen_top) - t; - margin = abs_top - screen_top; - h = bottom - screen_top - abs_top; - h_scale = h / (height - margin); + hscale = h / height; // fdivs r29, f4, f0 - GXSetViewport(left, abs_top, width, h, 0.0f, 1.0f); + GXSetViewport(left, t, width, h, 0.0f, 1.0f); + } { switch (cobj->projection_type) { @@ -439,25 +435,24 @@ static bool setupBottomHalfCamera(HSD_CObj* cobj) b = cobj->near * tanf(DegToRad(0.5 * cobj->projection_param.perspective.fov)); w = b * cobj->projection_param.perspective.aspect; - t = b * (2.0f * h_scale + 1.0f); + t = b * (2.0f * hscale + -1.0f); C_MTXFrustum(p, t, -b, -w, w, cobj->near, cobj->far); break; case PROJ_FRUSTUM: projection_type = GX_PERSPECTIVE; - C_MTXFrustum( - p, - (h_scale * (cobj->projection_param.perspective.fov - - cobj->projection_param.perspective.aspect) + - cobj->projection_param.perspective.aspect), - cobj->projection_param.perspective.aspect, - cobj->projection_param.frustum.left, - cobj->projection_param.frustum.right, cobj->near, cobj->far); + h = (hscale * (cobj->projection_param.perspective.fov - + cobj->projection_param.perspective.aspect) + + cobj->projection_param.perspective.aspect); + C_MTXFrustum(p, h, cobj->projection_param.perspective.aspect, + cobj->projection_param.frustum.left, + cobj->projection_param.frustum.right, cobj->near, + cobj->far); break; case PROJ_ORTHO: projection_type = GX_ORTHOGRAPHIC; C_MTXOrtho(p, - (h_scale * (cobj->projection_param.perspective.fov - - cobj->projection_param.perspective.aspect) + + (hscale * (cobj->projection_param.perspective.fov - + cobj->projection_param.perspective.aspect) + cobj->projection_param.perspective.aspect), cobj->projection_param.perspective.aspect, cobj->projection_param.frustum.left, @@ -472,11 +467,6 @@ static bool setupBottomHalfCamera(HSD_CObj* cobj) return true; } -inline void HSD_WObjClearFlags(HSD_WObj* wobj, u32 flags) -{ - wobj->flags &= ~flags; -} - void HSD_CObjSetupViewingMtx(HSD_CObj* cobj) { Vec3 eyepos; @@ -525,7 +515,7 @@ bool HSD_CObjSetCurrent(HSD_CObj* cobj) result = setupBottomHalfCamera(cobj); break; default: - HSD_Panic("cobj.c", 0x270, "unkown type of render pass.\n"); + HSD_Panic(__FILE__, 624, "unkown type of render pass.\n"); return false; } if (!result) { @@ -544,80 +534,68 @@ void HSD_CObjEndCurrent(void) HSD_WObj* HSD_CObjGetInterestWObj(HSD_CObj* cobj) { - HSD_ASSERT(0x295, cobj); + HSD_ASSERT(661, cobj); return cobj->interest; } +void HSD_CObjSetInterestWObj(HSD_CObj* cobj, HSD_WObj* interest) +{ + HSD_ASSERT(672, cobj); + cobj->interest = interest; +} + HSD_WObj* HSD_CObjGetEyePositionWObj(HSD_CObj* cobj) { - HSD_ASSERT(0x2AD, cobj); + HSD_ASSERT(685, cobj); return cobj->eyepos; } +void HSD_CObjSetEyePositionWObj(HSD_CObj* cobj, HSD_WObj* eyepos) +{ + HSD_ASSERT(696, cobj); + cobj->eyepos = eyepos; +} + void HSD_CObjGetInterest(HSD_CObj* cobj, Vec3* interest) { - HSD_ASSERT(0x2C5, cobj); + HSD_ASSERT(709, cobj); HSD_WObjGetPosition(HSD_CObjGetInterestWObj(cobj), interest); } void HSD_CObjSetInterest(HSD_CObj* cobj, Vec3* interest) { - HSD_ASSERT(0x2D1, cobj); + HSD_ASSERT(721, cobj); HSD_WObjSetPosition(HSD_CObjGetInterestWObj(cobj), interest); } void HSD_CObjGetEyePosition(HSD_CObj* cobj, Vec3* position) { - HSD_ASSERT(0x2DD, cobj); + HSD_ASSERT(733, cobj); HSD_WObjGetPosition(HSD_CObjGetEyePositionWObj(cobj), position); } void HSD_CObjSetEyePosition(HSD_CObj* cobj, Vec3* position) { - HSD_ASSERT(0x2E9, cobj); + HSD_ASSERT(745, cobj); HSD_WObjSetPosition(HSD_CObjGetEyePositionWObj(cobj), position); } -static inline float fabsf(float x) -{ - *(u32*) &x &= 0x7FFFFFFF; - return x; -} - -#define FLT_MIN 1.17549435e-38f - -static inline int _vec_normalize_check(Vec3* src, Vec3* dst) -{ - if (src == NULL || dst == NULL) { - return -1; - } - if (fabsf(src->x) <= FLT_MIN && fabsf(src->y) <= FLT_MIN && - fabsf(src->z) <= FLT_MIN) - { - return -1; - } else { - PSVECNormalize(src, dst); - return 0; - } -} - int HSD_CObjGetEyeVector(HSD_CObj* cobj, Vec3* eye) { - Vec3 sp48; - Vec3 sp3C; + Vec3 eyepos; + Vec3 interest; - if (cobj != NULL && cobj->eyepos != NULL && cobj->interest != NULL && - eye != NULL) - { - HSD_CObjGetEyePosition(cobj, &sp48); - HSD_CObjGetInterest(cobj, &sp3C); - PSVECSubtract(&sp3C, &sp48, eye); - if (_vec_normalize_check(eye, eye) == 0) { + if (cobj && cobj->eyepos && cobj->interest && eye) { + HSD_CObjGetEyePosition(cobj, &eyepos); + HSD_CObjGetInterest(cobj, &interest); + VECSubtract(&interest, &eyepos, eye); + if (vec_normalize_check(eye, eye) == 0) { return 0; } } - if (eye != NULL) { - eye->y = eye->x = 0.0f; + if (eye) { + eye->x = 0.0f; + eye->y = 0.0f; eye->z = -1.0f; } return -1; @@ -632,38 +610,50 @@ float HSD_CObjGetEyeDistance(HSD_CObj* cobj) if (cobj == NULL) { return 0.0f; } - HSD_ASSERT(0x327, cobj->eyepos); - HSD_ASSERT(0x328, cobj->interest); + HSD_ASSERT(807, cobj->eyepos); + HSD_ASSERT(808, cobj->interest); HSD_CObjGetEyePosition(cobj, &position); HSD_CObjGetInterest(cobj, &interest); - PSVECSubtract(&interest, &position, &look_vector); - return PSVECMag(&look_vector); + VECSubtract(&interest, &position, &look_vector); + return VECMag(&look_vector); } -#ifndef BUGFIX -#pragma push -#pragma force_active on -static float unused1[] = { - 0.0F, 0.0F, 0.0F, +static Vec3 orig = { 0.0F, 0.0F, 0.0F }; +static Vec3 uy = { 0.0F, 1.0F, 0.0F }; +static Vec3 uy2 = { 0.0F, 1.0F, 0.0F }; - 0.0F, 1.0F, 0.0F, - - 0.0F, 1.0F, 0.0F, -}; +static float upvec2roll(HSD_CObj* cobj, Vec3* up) +{ + Vec3 v; + Vec3 eye; + Mtx vmtx; + f32 dot; -static char unused2[] = "hsdIsDescendantOf(info, &hsdCObj)"; -#pragma pop -#endif + if (HSD_CObjGetEyeVector(cobj, &eye) != 0) { + dot = 0.0f; + } else { + dot = __fabsf(VECDotProduct(up, &eye)); + dot = 1.0f - dot; + if (dot < FLT_MIN) { + dot = 0.0f; + } else { + C_MTXLookAt(vmtx, &orig, &uy, &eye); + PSMTXMultVecSR(vmtx, up, &v); + if (fabsf_bitwise(v.y) == 0.0f) { + dot = -v.x >= 0.0f ? 1.5707963267948966 : -1.5707963267948966; + } else { + dot = atan2f(-v.x, v.y); + } + } + } + return dot; +} -static int vec_normalize_check(Vec3* src, Vec3* dst) +static inline f64 fabsf_p(f32* v) { - return _vec_normalize_check(src, dst); + return __fabsf(*v); } -extern const f64 HSD_CObj_804DE4B0; -extern const f64 HSD_CObj_804DE4B8; -extern const f64 HSD_CObj_804DE4C0; - static int roll2upvec(HSD_CObj* cobj, Vec3* up, float roll) { Vec3 eye; @@ -671,11 +661,11 @@ static int roll2upvec(HSD_CObj* cobj, Vec3* up, float roll) Vec3 v1; Mtx m; - if (HSD_CObjGetEyeVector(cobj, &eye) != 0) { - return 1; + int res = HSD_CObjGetEyeVector(cobj, &eye); + if (res != 0) { + return res; } - - if (1.0 - __fabs(eye.y) < 0.0001) { + if (1.0 - fabsf_p(&eye.y) < 0.0001) { v0.x = sqrtf(eye.y * eye.y + eye.z * eye.z); v0.y = eye.y * (-eye.x / v0.x); v0.z = eye.z * (-eye.x / v0.x); @@ -684,25 +674,94 @@ static int roll2upvec(HSD_CObj* cobj, Vec3* up, float roll) v0.x = eye.x * (-eye.y / v0.y); v0.z = eye.z * (-eye.y / v0.y); } - PSMTXRotAxisRad(m, &eye, -roll); + MTXRotAxisRad(m, &eye, -roll); PSMTXMultVecSR(m, &v0, &v1); - PSVECNormalize(&v1, up); + VECNormalize(&v1, up); return 0; } -void HSD_CObjGetUpVector(HSD_CObj* cobj, Vec3* up) +int HSD_CObjGetUpVector(HSD_CObj* cobj, Vec3* up) { - NOT_IMPLEMENTED; + if (cobj && up) { + if ((cobj->flags & 1) != 0) { + *up = cobj->u.up; + return 0; + } + if (roll2upvec(cobj, up, cobj->u.roll) == 0) { + return 0; + } + } + if (up) { + up->x = 0.0f; + up->y = 1.0f; + up->z = 0.0f; + } + return -1; } void HSD_CObjSetUpVector(HSD_CObj* cobj, Vec3* up) { - NOT_IMPLEMENTED; + Vec3 v; + + if (!cobj || !up) { + return; + } + if ((cobj->flags & 1) != 0) { + if (vec_normalize_check(up, &v)) { + up = &uy2; + } else { + up = &v; + } + + if (cobj->u.up.x != up->x || cobj->u.up.y != up->y || + cobj->u.up.z != up->z) + { + HSD_CObjSetMtxDirty(cobj); + } + cobj->u.up = *up; + } else { + HSD_CObjSetRoll(cobj, upvec2roll(cobj, up)); + } } -void HSD_CObjGetLeftVector(UNK_PARAMS) +int HSD_CObjGetLeftVector(HSD_CObj* cobj, Vec3* left) { - NOT_IMPLEMENTED; + Vec3 eye; + Vec3 up; + int res; + + if (cobj != NULL && left != NULL) { + if (HSD_CObjGetEyeVector(cobj, &eye) == 0) { + if (cobj != NULL && &up != NULL) { + if ((cobj->flags & 1) != 0) { + res = 0; + up = cobj->u.up; + } else if (roll2upvec(cobj, &up, cobj->u.roll) == 0) { + res = 0; + } else { + goto set_up; + } + } else { + set_up: + res = -1; + up.x = 0.0f; + up.y = 1.0f; + up.z = 0.0f; + } + if (res == 0) { + PSVECCrossProduct(&up, &eye, left); + if (!vec_normalize_check(left, left)) { + return 0; + } + } + } + } + + if (left != NULL) { + left->x = 1.0f; + left->z = left->y = 0.0f; + } + return -1; } void HSD_CObjSetMtxDirty(HSD_CObj* cobj) @@ -734,62 +793,35 @@ MtxPtr HSD_CObjGetInvViewingMtxPtrDirect(HSD_CObj* cobj) return *cobj->proj_mtx; } -#define SOLUTION 1 MtxPtr HSD_CObjGetViewingMtxPtr(HSD_CObj* cobj) { -#if SOLUTION == 0 - HSD_CObjSetupViewingMtx(cobj); -#elif SOLUTION == 1 - Vec3 interest; - Vec3 up_vec; - Vec3 eyepos; - u32 unused[6]; - - if (!(cobj->flags & 2) && HSD_CObjMtxIsDirty(cobj)) { - HSD_CObjGetEyePosition(cobj, &eyepos); - HSD_CObjGetUpVector(cobj, &up_vec); - HSD_CObjGetInterest(cobj, &interest); - C_MTXLookAt(cobj->view_mtx, &eyepos, &up_vec, &interest); - HSD_WObjClearFlags(cobj->eyepos, 2); - HSD_WObjClearFlags(cobj->interest, 2); - HSD_CObjClearFlags(cobj, 0x40000000); - HSD_CObjSetFlags(cobj, 0x80000000); - } -#endif HSD_CObjSetupViewingMtx(cobj); return HSD_CObjGetViewingMtxPtrDirect(cobj); } -#undef SOLUTION -#define SOLUTION 1 MtxPtr HSD_CObjGetInvViewingMtxPtr(HSD_CObj* cobj) { -#if SOLUTION == 0 - HSD_CObjGetViewingMtxPtr(cobj); -#elif SOLUTION == 1 - Vec3 interest; - Vec3 up_vec; - Vec3 eyepos; - u32 unused[6]; - - if (!(cobj->flags & 2) && HSD_CObjMtxIsDirty(cobj)) { - HSD_CObjGetEyePosition(cobj, &eyepos); - HSD_CObjGetUpVector(cobj, &up_vec); - HSD_CObjGetInterest(cobj, &interest); - C_MTXLookAt(cobj->view_mtx, &eyepos, &up_vec, &interest); - HSD_WObjClearFlags(cobj->eyepos, 2); - HSD_WObjClearFlags(cobj->interest, 2); - HSD_CObjClearFlags(cobj, 0x40000000); - HSD_CObjSetFlags(cobj, 0x80000000); - } + HSD_CObjSetupViewingMtx(cobj); return HSD_CObjGetInvViewingMtxPtrDirect(cobj); -#endif } -#undef SOLUTION -void HSD_CObjSetRoll(HSD_CObj* cobj, float arg1) +void HSD_CObjSetRoll(HSD_CObj* cobj, float roll) { - NOT_IMPLEMENTED; + Vec3 up; + + if (!cobj) { + return; + } + + if ((cobj->flags & 1) != 0) { + roll2upvec(cobj, &up, roll); + HSD_CObjSetUpVector(cobj, &up); + } else { + if (cobj->u.roll != roll) { + cobj->flags |= 0xC0000000; + } + cobj->u.roll = roll; + } } float HSD_CObjGetFov(HSD_CObj* cobj) @@ -1184,6 +1216,16 @@ HSD_CObj* HSD_CObjGetCurrent(void) return current; } +void HSD_CObjSetDefaultClass(HSD_ClassInfo* info) +{ + if (info) { + // Line number is made up to satisfy the + // fact we don't actually have this function + HSD_ASSERT(1946, hsdIsDescendantOf(info, &hsdCObj)); + } + default_class = info; +} + HSD_CObj* HSD_CObjAlloc(void) { HSD_CObj* cobj = (HSD_CObj*) hsdNew( @@ -1200,10 +1242,9 @@ inline static void CObjResetFlags(HSD_CObj* cobj, u32 flags) cobj->flags = (cobj->flags & 0xC0000000) | flags; } -static Vec3 HSD_CObj_8040631C = { 0, 1, 0 }; - static int CObjLoad(HSD_CObj* cobj, HSD_CObjDesc* desc) { + static Vec3 up = { 0.0f, 1.0f, 0.0f }; cobj->flags = desc->common.flags; CObjResetFlags(cobj, desc->common.flags); HSD_CObjSetViewport(cobj, &desc->common.viewport); @@ -1216,7 +1257,7 @@ static int CObjLoad(HSD_CObj* cobj, HSD_CObjDesc* desc) if (desc->common.up_vector != NULL) { HSD_CObjSetUpVector(cobj, desc->common.up_vector); } else { - HSD_CObjSetUpVector(cobj, &HSD_CObj_8040631C); + HSD_CObjSetUpVector(cobj, &up); } } else { HSD_CObjSetRoll(cobj, desc->common.roll); diff --git a/src/sysdolphin/baselib/cobj.h b/src/sysdolphin/baselib/cobj.h index 1ae7e564e3..d6546f7920 100644 --- a/src/sysdolphin/baselib/cobj.h +++ b/src/sysdolphin/baselib/cobj.h @@ -150,8 +150,10 @@ typedef struct _cobj_Unk1 cobj_Unk1; void HSD_CObjEraseScreen(HSD_CObj* cobj, s32 enable_color, s32 enable_alpha, s32 enable_depth); void HSD_CObjRemoveAnim(HSD_CObj* cobj); -HSD_WObj* HSD_CObjGetEyePositionWObj(HSD_CObj* cobj); HSD_WObj* HSD_CObjGetInterestWObj(HSD_CObj* cobj); +void HSD_CObjSetInterestWObj(HSD_CObj* cobj, HSD_WObj* interest); +HSD_WObj* HSD_CObjGetEyePositionWObj(HSD_CObj* cobj); +void HSD_CObjSetEyePositionWObj(HSD_CObj* cobj, HSD_WObj* eyepos); void HSD_CObjSetInterest(HSD_CObj* cobj, Vec3*); void HSD_CObjSetEyePosition(HSD_CObj* cobj, Vec3*); bool HSD_CObjSetCurrent(HSD_CObj*); @@ -159,7 +161,7 @@ void HSD_CObjEndCurrent(void); void HSD_CObjSetViewportfx4(HSD_CObj*, f32, f32, f32, f32); void HSD_CObjGetEyePosition(HSD_CObj* cobj, Vec3* cam_pos); int HSD_CObjGetEyeVector(HSD_CObj* cobj, Vec3* eye); -void HSD_CObjGetUpVector(HSD_CObj* cobj, Vec3* up); +int HSD_CObjGetUpVector(HSD_CObj* cobj, Vec3* up); void HSD_CObjGetInterest(HSD_CObj* cobj, Vec3* interest); HSD_CObj* HSD_CObjAlloc(void); @@ -171,7 +173,7 @@ GXProjectionType makeProjectionMtx(HSD_CObj* cobj, Mtx mtx); void HSD_CObjSetupViewingMtx(HSD_CObj* cobj); f32 HSD_CObjGetEyeDistance(HSD_CObj* cobj); void HSD_CObjSetUpVector(HSD_CObj* cobj, Vec3* up); -void HSD_CObjGetLeftVector(UNK_PARAMS); +int HSD_CObjGetLeftVector(HSD_CObj* cobj, Vec3* left); void HSD_CObjSetMtxDirty(HSD_CObj* cobj); bool HSD_CObjMtxIsDirty(HSD_CObj*); void HSD_CObjGetViewingMtx(HSD_CObj* cobj, Mtx mtx); @@ -214,6 +216,7 @@ void HSD_CObjClearFlags(HSD_CObj*, u32); HSD_CObj* HSD_CObjGetCurrent(void); void HSD_CObjInit(HSD_CObj* cobj, HSD_CObjDesc* desc); HSD_CObj* HSD_CObjLoadDesc(HSD_CObjDesc* desc); +void HSD_CObjSetDefaultClass(HSD_ClassInfo* info); static inline MtxPtr HSD_CObjGetViewingMtxPtrDirect(HSD_CObj* cobj) { diff --git a/src/sysdolphin/baselib/controller.c b/src/sysdolphin/baselib/controller.c index b6343eb87d..748d659f29 100644 --- a/src/sysdolphin/baselib/controller.c +++ b/src/sysdolphin/baselib/controller.c @@ -3,13 +3,24 @@ #include "placeholder.h" #include "baselib/rumble.h" +#include "baselib/util.h" #include #include +#include +#include +HSD_PadStatus default_status_data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; +PadLibData default_libinfo_data = { 0, 0, 0, 0, 0, 0, 0x2D, 8, + 0, 0x1E, 0, 0, 0, 0x7F, 0, 0, + 0xFF, 0, 0, 0xFF, 0, 0x7F, 0xFF, 0xFF }; PadLibData HSD_PadLibData; HSD_PadStatus HSD_PadMasterStatus[4]; HSD_PadStatus HSD_PadCopyStatus[4]; +HSD_PadStatus HSD_PadGameStatus[4]; +u32 pad_bit[4] = { PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, + PAD_CHAN3_BIT }; u8 HSD_PadGetRawQueueCount(void) { @@ -32,20 +43,121 @@ s32 HSD_PadGetResetSwitch(void) return (p->reset_switch != 0) ? true : false; } -static void HSD_PadRawQueueShift(u32 qnum, u8* qpos) +static void HSD_PadRawQueueShift(u8 qnum, u8* qptr) { - *qpos = (*qpos + 1) - ((*qpos + 1) / qnum) * qnum; + *qptr = (*qptr + 1) % qnum; } static void HSD_PadRawMerge(PADStatus* src1, PADStatus* src2, PADStatus* dst) { - dst[0].button = src1[0].button | src2[0].button; - dst[1].button = src1[1].button | src2[1].button; - dst[2].button = src1[2].button | src2[2].button; - dst[3].button = src1[3].button | src2[3].button; + int i; + for (i = 0; i < 4; i++) { + dst[i].button = src1[i].button | src2[i].button; + } } -void HSD_PadClampCheck1(u8* val, u8 shift, u8 min, u8 max) +void HSD_PadRenewRawStatus(bool err_check) +{ + int i; + u32 mask; + PadLibData* p = &HSD_PadLibData; + PADStatus* qwrite; + PADStatus* qread; + PADStatus now[4]; + + HSD_PadRumbleInterpret(); + PADRead(now); + if (err_check) { + for (i = 0; i < 4; i++) { + if (!now[i].err) { + break; + } + } + if (i == 4) { + return; + } + } + + qwrite = p->queue[p->qwrite].stat; + if (p->qcount == p->qnum) { + switch (p->qtype) { + case 0: + HSD_PadRawQueueShift(p->qnum, &p->qread); + qread = p->queue[p->qread].stat; + if (p->qnum != 1) { + HSD_PadRawMerge(qwrite, qread, qread); + } else { + HSD_PadRawMerge(now, qread, now); + } + break; + case 1: + HSD_PadRawQueueShift(p->qnum, &p->qread); + break; + case 2: + goto skip; + } + } else { + p->qcount += 1; + } + + for (i = 0; i < 4; i++, qwrite++) { + *qwrite = now[i]; + } + HSD_PadRawQueueShift(p->qnum, &p->qwrite); + +skip: + mask = 0; + for (i = 0; i < 4; i++) { + if (now[i].err == -1) { + mask |= pad_bit[i]; + } + } + if (mask != 0) { + PADReset(mask); + } + if (OSGetResetSwitchState()) { + p->reset_switch_status = 1; + } else { + if (p->reset_switch_status != 0) { + p->reset_switch = 1; + p->reset_switch_status = 0; + } + } +} + +void HSD_PadFlushQueue(HSD_FlushType ftype) +{ + PadLibData* p; + PADStatus* qdst; + PADStatus* qread; + bool intr; + + p = &HSD_PadLibData; + intr = OSDisableInterrupts(); + switch (ftype) { + case HSD_PAD_FLUSH_QUEUE_MERGE: + for (; p->qcount > 1; p->qcount -= 1) { + qread = &p->queue->stat[p->qread * 4]; + HSD_PadRawQueueShift(p->qnum, &p->qread); + qdst = &p->queue->stat[p->qread * 4]; + HSD_PadRawMerge(qread, qdst, qdst); + } + break; + case HSD_PAD_FLUSH_QUEUE_THROWAWAY: + p->qread = p->qwrite; + p->qcount = 0; + break; + case HSD_PAD_FLUSH_QUEUE_LEAVE1: + if (p->qcount > 1) { + p->qread = p->qwrite != 0 ? p->qwrite - 1 : p->qnum - 1; + p->qcount = 1; + } + break; + } + OSRestoreInterrupts(intr); +} + +static void HSD_PadClampCheck1(u8* val, u8 shift, u8 min, u8 max) { if (*val < min) { *val = 0; @@ -60,6 +172,112 @@ void HSD_PadClampCheck1(u8* val, u8 shift, u8 min, u8 max) *val = *val - min; } +static void HSD_PadClampCheck3(s8* x, s8* y, u8 shift, s8 min, s8 max) +{ + f32 r; + + r = sqrtf(((f32) *x * (f32) *x) + ((f32) *y * (f32) *y)); + + if (r < min) { + *y = 0; + *x = 0; + return; + } + if (r > max) { + *x = ((f32) *x * (f32) max) / r; + *y = ((f32) *y * (f32) max) / r; + r = sqrtf(((f32) *x * (f32) *x) + ((f32) *y * (f32) *y)); + } + + if (shift == 1 && r > 1.000000013351432e-10f) { + *x = (f32) *x - (((f32) *x * (f32) min) / r); + *y = (f32) *y - (((f32) *y * (f32) min) / r); + } +} + +static void HSD_PadClamp(HSD_PadStatus* mp) +{ + PadLibData* p = &HSD_PadLibData; + + switch (p->clamp_stickType) { + case 0: + HSD_PadClampCheck3(&mp->stickX, &mp->stickY, p->clamp_stickShift, + p->clamp_stickMin, p->clamp_stickMax); + HSD_PadClampCheck3(&mp->subStickX, &mp->subStickY, p->clamp_stickShift, + p->clamp_stickMin, p->clamp_stickMax); + break; + default: + break; + } + HSD_PadClampCheck1(&mp->analogL, HSD_PadLibData.clamp_analogLRShift, + p->clamp_analogLRMin, p->clamp_analogLRMax); + HSD_PadClampCheck1(&mp->analogR, p->clamp_analogLRShift, + p->clamp_analogLRMin, p->clamp_analogLRMax); + HSD_PadClampCheck1(&mp->analogA, p->clamp_analogABShift, + p->clamp_analogABMin, p->clamp_analogABMax); + HSD_PadClampCheck1(&mp->analogB, p->clamp_analogABShift, + p->clamp_analogABMin, p->clamp_analogABMax); +} + +static void HSD_PadADConvertCheck1(HSD_PadStatus* mp, s8 x, s8 y, u32 up, + u32 down, u32 left, u32 right) +{ + PadLibData* p = &HSD_PadLibData; + f32 r, a, ha; + PAD_STACK(8); + + r = sqrtf(((f32) x * (f32) x) + ((f32) y * (f32) y)); + a = atan2f_check(y, x); + ha = 0.5F * p->adc_angle; + if (!(r < p->adc_th)) { + if (a < -2.356194490192345 + ha) { + mp->button |= left; + } + if (a >= -2.356194490192345 - ha && a <= -0.7853981633974483 + ha) { + mp->button |= down; + } + if (a > -0.7853981633974483 - ha && a < 0.7853981633974483 + ha) { + mp->button |= right; + } + if (a >= 0.7853981633974483 - ha && a <= 2.356194490192345 + ha) { + mp->button |= up; + } + if (a > 2.356194490192345 - ha) { + mp->button |= left; + } + } +} + +static void HSD_PadADConvert(HSD_PadStatus* mp) +{ + PadLibData* p = &HSD_PadLibData; + + switch (p->adc_type) { + case 0: + HSD_PadADConvertCheck1(mp, mp->stickX, mp->stickY, 0x10000, 0x20000, + 0x40000, 0x80000); + HSD_PadADConvertCheck1(mp, mp->subStickX, mp->subStickY, 0x100000, + 0x200000, 0x400000, 0x800000); + break; + default: + return; + } +} + +static void HSD_PadScale(HSD_PadStatus* mp) +{ + PadLibData* p = &HSD_PadLibData; + + mp->nml_stickX = (f32) mp->stickX / (f32) p->scale_stick; + mp->nml_stickY = (f32) mp->stickY / (f32) p->scale_stick; + mp->nml_subStickX = (f32) mp->subStickX / (f32) p->scale_stick; + mp->nml_subStickY = (f32) mp->subStickY / (f32) p->scale_stick; + mp->nml_analogL = (f32) mp->analogL / (f32) p->scale_analogLR; + mp->nml_analogR = (f32) mp->analogR / (f32) p->scale_analogLR; + mp->nml_analogA = (f32) mp->analogA / (f32) p->scale_analogAB; + mp->nml_analogB = (f32) mp->analogB / (f32) p->scale_analogAB; +} + static void HSD_PadCrossDir(HSD_PadStatus* mp) { switch (HSD_PadLibData.cross_dir) { @@ -103,17 +321,221 @@ static void HSD_PadCrossDir(HSD_PadStatus* mp) void HSD_PadRenewMasterStatus(void) { - NOT_IMPLEMENTED; + int iVar1; + PadLibData* p; + HSD_PadStatus* mp; + PADStatus* qread; + int i; + + bool intr; + + p = &HSD_PadLibData; + mp = &HSD_PadMasterStatus[0]; + intr = OSDisableInterrupts(); + if (p->qcount != 0) { + qread = &p->queue->stat[p->qread * 4]; + HSD_PadRawQueueShift(p->qnum, &p->qread); + p->qcount -= 1; + + for (i = 0; i < 4; i++, mp += 1, qread += 1) { + mp->last_button = mp->button; + mp->err = qread->err; + if (mp->err == 0) { + mp->button = qread->button; + mp->stickX = qread->stickX; + mp->stickY = qread->stickY; + mp->subStickX = qread->substickX; + mp->subStickY = qread->substickY; + mp->analogL = qread->triggerLeft; + mp->analogR = qread->triggerRight; + mp->analogA = qread->analogA; + mp->analogB = qread->analogB; + HSD_PadClamp(mp); + HSD_PadADConvert(mp); + HSD_PadScale(mp); + HSD_PadCrossDir(mp); + } else if (mp->err == -3) { + mp->err = 0; + } else { + mp->button = 0; + mp->subStickY = 0; + mp->subStickX = 0; + mp->stickY = 0; + mp->stickX = 0; + mp->analogB = 0; + mp->analogA = 0; + mp->analogR = 0; + mp->analogL = 0; + mp->nml_subStickY = 0.0; + mp->nml_subStickX = 0.0; + mp->nml_stickY = 0.0; + mp->nml_stickX = 0.0; + mp->nml_analogB = 0.0; + mp->nml_analogA = 0.0; + mp->nml_analogR = 0.0; + mp->nml_analogL = 0.0; + } + mp->trigger = mp->button & (mp->last_button ^ mp->button); + mp->release = mp->last_button & (mp->last_button ^ mp->button); + if (mp->last_button ^ mp->button) { + mp->repeat = mp->trigger; + mp->repeat_count = p->repeat_start; + } else { + iVar1 = mp->repeat_count - 1; + mp->repeat_count = iVar1; + if (iVar1 != 0) { + mp->repeat = 0; + } else { + mp->repeat = mp->button; + mp->repeat_count = p->repeat_interval; + } + } + } + } + OSRestoreInterrupts(intr); } void HSD_PadRenewCopyStatus(void) { - NOT_IMPLEMENTED; + int iVar1; + HSD_PadStatus* mp; + HSD_PadStatus* cp; + PadLibData* p; + + int i; + + p = &HSD_PadLibData; + for (i = 0; i < 4; i++) { + mp = &HSD_PadMasterStatus[i]; + cp = &HSD_PadCopyStatus[i]; + + cp->last_button = cp->button; + cp->err = mp->err; + if (cp->err == 0) { + cp->button = mp->button; + cp->stickX = mp->stickX; + cp->stickY = mp->stickY; + cp->subStickX = mp->subStickX; + cp->subStickY = mp->subStickY; + cp->analogL = mp->analogL; + cp->analogR = mp->analogR; + cp->analogA = mp->analogA; + cp->analogB = mp->analogB; + cp->nml_stickX = mp->nml_stickX; + cp->nml_stickY = mp->nml_stickY; + cp->nml_subStickX = mp->nml_subStickX; + cp->nml_subStickY = mp->nml_subStickY; + cp->nml_analogL = mp->nml_analogL; + cp->nml_analogR = mp->nml_analogR; + cp->nml_analogA = mp->nml_analogA; + cp->nml_analogB = mp->nml_analogB; + } else { + cp->button = 0; + cp->subStickY = 0; + cp->subStickX = 0; + cp->stickY = 0; + cp->stickX = 0; + cp->analogB = 0; + cp->analogA = 0; + cp->analogR = 0; + cp->analogL = 0; + cp->nml_subStickY = 0.0; + cp->nml_subStickX = 0.0; + cp->nml_stickY = 0.0; + cp->nml_stickX = 0.0; + cp->nml_analogB = 0.0; + cp->nml_analogA = 0.0; + cp->nml_analogR = 0.0; + cp->nml_analogL = 0.0; + } + cp->trigger = cp->button & (cp->last_button ^ cp->button); + cp->release = cp->last_button & (cp->last_button ^ cp->button); + if (cp->last_button ^ cp->button) { + cp->repeat = cp->trigger; + cp->repeat_count = p->repeat_start; + } else { + iVar1 = cp->repeat_count - 1; + cp->repeat_count = iVar1; + if (iVar1 != 0) { + cp->repeat = 0; + } else { + cp->repeat = cp->button; + cp->repeat_count = p->repeat_interval; + } + } + } } -void HSD_PadZeroQueue(void) +void HSD_PadRenewGameStatus(void) { - NOT_IMPLEMENTED; + int iVar1; + HSD_PadStatus* mp; + HSD_PadStatus* gs; + PadLibData* p; + + int i; + + p = &HSD_PadLibData; + for (i = 0; i < 4; i++) { + mp = &HSD_PadMasterStatus[i]; + gs = &HSD_PadGameStatus[i]; + + gs->last_button = gs->button; + gs->err = mp->err; + if (gs->err == 0) { + gs->button = mp->button; + gs->stickX = mp->stickX; + gs->stickY = mp->stickY; + gs->subStickX = mp->subStickX; + gs->subStickY = mp->subStickY; + gs->analogL = mp->analogL; + gs->analogR = mp->analogR; + gs->analogA = mp->analogA; + gs->analogB = mp->analogB; + gs->nml_stickX = mp->nml_stickX; + gs->nml_stickY = mp->nml_stickY; + gs->nml_subStickX = mp->nml_subStickX; + gs->nml_subStickY = mp->nml_subStickY; + gs->nml_analogL = mp->nml_analogL; + gs->nml_analogR = mp->nml_analogR; + gs->nml_analogA = mp->nml_analogA; + gs->nml_analogB = mp->nml_analogB; + } else { + gs->button = 0; + gs->subStickY = 0; + gs->subStickX = 0; + gs->stickY = 0; + gs->stickX = 0; + gs->analogB = 0; + gs->analogA = 0; + gs->analogR = 0; + gs->analogL = 0; + gs->nml_subStickY = 0.0; + gs->nml_subStickX = 0.0; + gs->nml_stickY = 0.0; + gs->nml_stickX = 0.0; + gs->nml_analogB = 0.0; + gs->nml_analogA = 0.0; + gs->nml_analogR = 0.0; + gs->nml_analogL = 0.0; + } + gs->trigger = gs->button & (gs->last_button ^ gs->button); + gs->release = gs->last_button & (gs->last_button ^ gs->button); + if (gs->last_button ^ gs->button) { + gs->repeat = gs->trigger; + gs->repeat_count = p->repeat_start; + } else { + iVar1 = gs->repeat_count - 1; + gs->repeat_count = iVar1; + if (iVar1 != 0) { + gs->repeat = 0; + } else { + gs->repeat = gs->button; + gs->repeat_count = p->repeat_interval; + } + } + }; + return; } void HSD_PadRenewStatus(void) @@ -121,7 +543,7 @@ void HSD_PadRenewStatus(void) HSD_PadRenewRawStatus(0); HSD_PadRenewMasterStatus(); HSD_PadRenewCopyStatus(); - HSD_PadZeroQueue(); + HSD_PadRenewGameStatus(); } void HSD_PadReset(void) @@ -145,3 +567,21 @@ void HSD_PadReset(void) OSRestoreInterrupts(intr); } + +void HSD_PadInit(u8 qnum, HSD_PadData* queue, u16 nb_list, + HSD_PadRumbleListData* listdatap) +{ + int i; + PadLibData* p = &HSD_PadLibData; + + *p = default_libinfo_data; + p->qnum = qnum; + p->queue = queue; + HSD_PadRumbleInit(nb_list, listdatap); + for (i = 0; i < 4; i++) { + HSD_PadMasterStatus[i] = default_status_data; + HSD_PadCopyStatus[i] = default_status_data; + HSD_PadGameStatus[i] = default_status_data; + } + PADInit(); +} diff --git a/src/sysdolphin/baselib/controller.h b/src/sysdolphin/baselib/controller.h index 03debed06a..d672c41652 100644 --- a/src/sysdolphin/baselib/controller.h +++ b/src/sysdolphin/baselib/controller.h @@ -21,7 +21,6 @@ typedef enum _HSD_FlushType { struct HSD_PadData { PADStatus stat[4]; - u32 rumble_mask; }; struct HSD_PadStatus { @@ -48,7 +47,6 @@ struct HSD_PadStatus { f32 nml_analogA; f32 nml_analogB; u8 cross_dir; - u8 support_rumble; s8 err; }; @@ -61,7 +59,7 @@ struct PadLibData { /*0x08*/ HSD_PadData* queue; /*0x0C*/ s32 repeat_start; /*0x10*/ s32 repeat_interval; - /*0x14*/ u8 adc_type; + /*0x14*/ s8 adc_type; /*0x15*/ s8 adc_th; /*0x18*/ f32 adc_angle; /*0x1C*/ u8 clamp_stickType; @@ -84,15 +82,16 @@ struct PadLibData { }; extern HSD_PadStatus HSD_PadMasterStatus[4]; +extern HSD_PadStatus HSD_PadGameStatus[4]; void HSD_PadFlushQueue(HSD_FlushType); u8 HSD_PadGetRawQueueCount(void); s32 HSD_PadGetResetSwitch(void); -void HSD_PadRenewRawStatus(int); +void HSD_PadRenewRawStatus(bool); void HSD_PadRenewMasterStatus(void); -void HSD_PadZeroQueue(void); +void HSD_PadRenewGameStatus(void); void HSD_PadRenewStatus(void); void HSD_PadReset(void); -void HSD_PadInit(s32, u8*, s32, HSD_PadRumbleListData*); +void HSD_PadInit(u8, HSD_PadData*, u16, HSD_PadRumbleListData*); #endif diff --git a/src/sysdolphin/baselib/jobj.h b/src/sysdolphin/baselib/jobj.h index 722d11ceef..ba89986600 100644 --- a/src/sysdolphin/baselib/jobj.h +++ b/src/sysdolphin/baselib/jobj.h @@ -236,7 +236,7 @@ static inline bool HSD_JObjMtxIsDirty(HSD_JObj* jobj) inline void HSD_JObjSetupMatrix(HSD_JObj* jobj) { - if (jobj == NULL || !HSD_JObjMtxIsDirty(jobj)) { + if (!jobj || !HSD_JObjMtxIsDirty(jobj)) { return; } HSD_JObjSetupMatrixSub(jobj); diff --git a/src/sysdolphin/baselib/util.h b/src/sysdolphin/baselib/util.h index 816f2cb0c6..e83e02d8f9 100644 --- a/src/sysdolphin/baselib/util.h +++ b/src/sysdolphin/baselib/util.h @@ -4,6 +4,11 @@ #include #include +#include "mtx.h" + +#include +#include + // functions void HSD_MulColor(GXColor* arg0, GXColor* arg1, GXColor* dest); u32 HSD_GetNbBits(u32 arg0); @@ -12,4 +17,29 @@ s32 HSD_Index2PosNrmMtx(u32 arg0); // variables extern float HSD_identityMtx[]; +#define FLT_MIN 1.17549435e-38f + +static inline int vec_normalize_check(Vec3* src, Vec3* dst) +{ + if (!src || !dst) { + return -1; + } + if (fabsf_bitwise(src->x) <= FLT_MIN && fabsf_bitwise(src->y) <= FLT_MIN && + fabsf_bitwise(src->z) <= FLT_MIN) + { + return -1; + } + PSVECNormalize(src, dst); + return 0; +} + +static inline f32 atan2f_check(s8 y, s8 x) +{ + if (fabs(x) == 0.0) { + return y >= 0 ? 1.5707963267948966 : -1.5707963267948966; + } else { + return atan2f(y, x); + } +} + #endif // _UTIL_H_ diff --git a/src/sysdolphin/baselib/wobj.h b/src/sysdolphin/baselib/wobj.h index 4ce64e06ee..b730f44daa 100644 --- a/src/sysdolphin/baselib/wobj.h +++ b/src/sysdolphin/baselib/wobj.h @@ -52,6 +52,11 @@ static inline void HSD_WObjUnref(HSD_WObj* wobj) } } +static inline void HSD_WObjClearFlags(HSD_WObj* wobj, u32 flags) +{ + wobj->flags &= ~flags; +} + void HSD_WObjRemoveAnim(HSD_WObj* wobj); void HSD_WObjReqAnim(HSD_WObj* wobj, f32 frame); void HSD_WObjAddAnim(HSD_WObj* wobj, HSD_WObjAnim* anim); diff --git a/tools/decompctx.py b/tools/decompctx.py index e86d5ef343..290946f18f 100644 --- a/tools/decompctx.py +++ b/tools/decompctx.py @@ -23,8 +23,8 @@ # Add additional include directories here ] -include_pattern = re.compile(r'^#include\s*[<"](.+?)[>"]$') -guard_pattern = re.compile(r"^#ifndef\s+(.*)$") +include_pattern = re.compile(r'^#\s*include\s*[<"](.+?)[>"]$') +guard_pattern = re.compile(r"^#\s*ifndef\s+(.*)$") defines = set() diff --git a/tools/download_tool.py b/tools/download_tool.py index 7b386a4baa..f4512d01ea 100644 --- a/tools/download_tool.py +++ b/tools/download_tool.py @@ -56,6 +56,22 @@ def dtk_url(tag: str) -> str: return f"{repo}/releases/download/{tag}/dtk-{system}-{arch}{suffix}" +def objdiff_cli_url(tag: str) -> str: + uname = platform.uname() + suffix = "" + system = uname.system.lower() + if system == "darwin": + system = "macos" + elif system == "windows": + suffix = ".exe" + arch = uname.machine.lower() + if arch == "amd64": + arch = "x86_64" + + repo = "https://github.com/encounter/objdiff" + return f"{repo}/releases/download/{tag}/objdiff-cli-{system}-{arch}{suffix}" + + def sjiswrap_url(tag: str) -> str: repo = "https://github.com/encounter/sjiswrap" return f"{repo}/releases/download/{tag}/sjiswrap-windows-x86.exe" @@ -70,6 +86,7 @@ def wibo_url(tag: str) -> str: "binutils": binutils_url, "compilers": compilers_url, "dtk": dtk_url, + "objdiff-cli": objdiff_cli_url, "sjiswrap": sjiswrap_url, "wibo": wibo_url, } diff --git a/tools/project.py b/tools/project.py index d716a8f79c..f2690224b7 100644 --- a/tools/project.py +++ b/tools/project.py @@ -17,7 +17,7 @@ import platform import sys from pathlib import Path -from typing import Any, Dict, List, Optional, Set, Tuple, Union +from typing import Any, Dict, List, Optional, Set, Tuple, Union, cast from . import ninja_syntax from .ninja_syntax import serialize_path @@ -29,26 +29,78 @@ f"\n(Current path: {sys.executable})" ) -LibDict = Dict[str, Any] +Library = Dict[str, Any] class Object: def __init__(self, completed: bool, name: str, **options: Any) -> None: self.name = name - self.base_name = Path(name).with_suffix("") self.completed = completed self.options: Dict[str, Any] = { - "add_to_all": True, + "add_to_all": None, "asflags": None, - "extra_asflags": None, + "asm_dir": None, "cflags": None, + "extra_asflags": None, "extra_cflags": None, + "host": None, + "lib": None, "mw_version": None, + "progress_category": None, "shift_jis": None, "source": name, + "src_dir": None, } self.options.update(options) + # Internal + self.src_path: Optional[Path] = None + self.asm_path: Optional[Path] = None + self.src_obj_path: Optional[Path] = None + self.asm_obj_path: Optional[Path] = None + self.host_obj_path: Optional[Path] = None + self.ctx_path: Optional[Path] = None + + def resolve(self, config: "ProjectConfig", lib: Library) -> "Object": + # Use object options, then library options + obj = Object(self.completed, self.name, **lib) + for key, value in self.options.items(): + if value is not None or key not in obj.options: + obj.options[key] = value + + # Use default options from config + def set_default(key: str, value: Any) -> None: + if obj.options[key] is None: + obj.options[key] = value + + set_default("add_to_all", True) + set_default("asflags", config.asflags) + set_default("asm_dir", config.asm_dir) + set_default("host", False) + set_default("mw_version", config.linker_version) + set_default("shift_jis", config.shift_jis) + set_default("src_dir", config.src_dir) + + # Resolve paths + build_dir = config.out_path() + obj.src_path = Path(obj.options["src_dir"]) / obj.options["source"] + if obj.options["asm_dir"] is not None: + obj.asm_path = ( + Path(obj.options["asm_dir"]) / obj.options["source"] + ).with_suffix(".s") + base_name = Path(self.name).with_suffix("") + obj.src_obj_path = build_dir / "src" / f"{base_name}.o" + obj.asm_obj_path = build_dir / "mod" / f"{base_name}.o" + obj.host_obj_path = build_dir / "host" / f"{base_name}.o" + obj.ctx_path = build_dir / "src" / f"{base_name}.ctx" + return obj + + +class ProgressCategory: + def __init__(self, id: str, name: str) -> None: + self.id = id + self.name = name + class ProjectConfig: def __init__(self) -> None: @@ -71,17 +123,18 @@ def __init__(self) -> None: self.wrapper: Optional[Path] = None # If None, download wibo on Linux self.sjiswrap_tag: Optional[str] = None # Git tag self.sjiswrap_path: Optional[Path] = None # If None, download + self.objdiff_tag: Optional[str] = None # Git tag + self.objdiff_path: Optional[Path] = None # If None, download # Project config self.non_matching: bool = False self.build_rels: bool = True # Build REL files self.check_sha_path: Optional[Path] = None # Path to version.sha1 self.config_path: Optional[Path] = None # Path to config.yml - self.debug: bool = False # Build with debug info self.generate_map: bool = False # Generate map file(s) self.asflags: Optional[List[str]] = None # Assembler flags self.ldflags: Optional[List[str]] = None # Linker flags - self.libs: Optional[List[Dict[str, Any]]] = None # List of libraries + self.libs: Optional[List[Library]] = None # List of libraries self.linker_version: Optional[str] = None # mwld version self.version: Optional[str] = None # Version name self.warn_missing_config: bool = False # Warn on missing unit configuration @@ -103,12 +156,13 @@ def __init__(self) -> None: None # Custom build steps, types are ["pre-compile", "post-compile", "post-link", "post-build"] ) - # Progress output and progress.json config + # Progress output, progress.json and report.json config self.progress_all: bool = True # Include combined "all" category self.progress_modules: bool = True # Include combined "modules" category self.progress_each_module: bool = ( - True # Include individual modules, disable for large numbers of modules + False # Include individual modules, disable for large numbers of modules ) + self.progress_categories: List[ProgressCategory] = [] # Additional categories # Progress fancy printing self.progress_use_fancy: bool = False @@ -133,12 +187,17 @@ def validate(self) -> None: if getattr(self, attr) is None: sys.exit(f"ProjectConfig.{attr} missing") - def find_object(self, name: str) -> Optional[Tuple[Dict[str, Any], Object]]: + # Creates a map of object names to Object instances + # Options are fully resolved from the library and object + def objects(self) -> Dict[str, Object]: + out = {} for lib in self.libs or {}: - for obj in lib["objects"]: - if obj.name == name: - return lib, obj - return None + objects: List[Object] = lib["objects"] + for obj in objects: + if obj.name in out: + sys.exit(f"Duplicate object name {obj.name}") + out[obj.name] = obj.resolve(self, lib) + return out def out_path(self) -> Path: return self.build_dir / str(self.version) @@ -174,7 +233,7 @@ def versiontuple(v: str) -> Tuple[int, ...]: f = open(build_config_path, "r", encoding="utf-8") build_config: Dict[str, Any] = json.load(f) config_version = build_config.get("version") - if not config_version: + if config_version is None: # Invalid config.json f.close() os.remove(build_config_path) @@ -193,17 +252,19 @@ def versiontuple(v: str) -> Tuple[int, ...]: # Generate build.ninja and objdiff.json def generate_build(config: ProjectConfig) -> None: + config.validate() + objects = config.objects() build_config = load_build_config(config, config.out_path() / "config.json") - generate_build_ninja(config, build_config) - generate_objdiff_config(config, build_config) + generate_build_ninja(config, objects, build_config) + generate_objdiff_config(config, objects, build_config) # Generate build.ninja def generate_build_ninja( - config: ProjectConfig, build_config: Optional[Dict[str, Any]] + config: ProjectConfig, + objects: Dict[str, Object], + build_config: Optional[Dict[str, Any]], ) -> None: - config.validate() - out = io.StringIO() n = ninja_syntax.Writer(out) n.variable("ninja_required_version", "1.3") @@ -221,13 +282,8 @@ def generate_build_ninja( # Variables ### n.comment("Variables") - ldflags = " ".join(config.ldflags or []) - if config.generate_map: - ldflags += " -mapunused" - if config.debug: - ldflags += " -g" - n.variable("ldflags", ldflags) - if not config.linker_version: + n.variable("ldflags", " ".join(config.ldflags or [])) + if config.linker_version is None: sys.exit("ProjectConfig.linker_version missing") n.variable("mw_version", Path(config.linker_version)) n.newline() @@ -239,6 +295,7 @@ def generate_build_ninja( build_path = config.out_path() progress_path = build_path / "progress.json" + report_path = build_path / "report.json" build_tools_path = config.build_dir / "tools" download_tool = config.tools_dir / "download_tool.py" n.rule( @@ -256,17 +313,27 @@ def generate_build_ninja( deps="gcc", ) + cargo_rule_written = False + + def write_cargo_rule(): + nonlocal cargo_rule_written + if not cargo_rule_written: + n.pool("cargo", 1) + n.rule( + name="cargo", + command="cargo build --release --manifest-path $in --bin $bin --target-dir $target", + description="CARGO $bin", + pool="cargo", + depfile=Path("$target") / "release" / "$bin.d", + deps="gcc", + ) + cargo_rule_written = True + if config.dtk_path is not None and config.dtk_path.is_file(): dtk = config.dtk_path elif config.dtk_path is not None: dtk = build_tools_path / "release" / f"dtk{EXE}" - n.rule( - name="cargo", - command="cargo build --release --manifest-path $in --bin $bin --target-dir $target", - description="CARGO $bin", - depfile=Path("$target") / "release" / "$bin.d", - deps="gcc", - ) + write_cargo_rule() n.build( outputs=dtk, rule="cargo", @@ -291,6 +358,35 @@ def generate_build_ninja( else: sys.exit("ProjectConfig.dtk_tag missing") + if config.objdiff_path is not None and config.objdiff_path.is_file(): + objdiff = config.objdiff_path + elif config.objdiff_path is not None: + objdiff = build_tools_path / "release" / f"objdiff-cli{EXE}" + write_cargo_rule() + n.build( + outputs=objdiff, + rule="cargo", + inputs=config.objdiff_path / "Cargo.toml", + implicit=config.objdiff_path / "Cargo.lock", + variables={ + "bin": "objdiff-cli", + "target": build_tools_path, + }, + ) + elif config.objdiff_tag: + objdiff = build_tools_path / f"objdiff-cli{EXE}" + n.build( + outputs=objdiff, + rule="download_tool", + implicit=download_tool, + variables={ + "tool": "objdiff-cli", + "tag": config.objdiff_tag, + }, + ) + else: + sys.exit("ProjectConfig.objdiff_tag missing") + if config.sjiswrap_path: sjiswrap = config.sjiswrap_path elif config.sjiswrap_tag: @@ -369,6 +465,17 @@ def generate_build_ninja( n.newline() + ### + # Helper rule for downloading all tools + ### + n.comment("Download all tools") + n.build( + outputs="tools", + rule="phony", + inputs=[dtk, sjiswrap, wrapper, compilers, binutils, objdiff], + ) + n.newline() + ### # Build rules ### @@ -451,11 +558,12 @@ def generate_build_ninja( ) n.newline() - n.comment("Custom project build rules (pre/post-processing)") + if len(config.custom_build_rules or {}) > 0: + n.comment("Custom project build rules (pre/post-processing)") for rule in config.custom_build_rules or {}: n.rule( - name=rule.get("name"), - command=rule.get("command"), + name=cast(str, rule.get("name")), + command=cast(str, rule.get("command")), description=rule.get("description", None), depfile=rule.get("depfile", None), generator=rule.get("generator", False), @@ -467,12 +575,12 @@ def generate_build_ninja( ) n.newline() - def write_custom_step(step: str) -> List[str]: - implicit = [] + def write_custom_step(step: str) -> List[str | Path]: + implicit: List[str | Path] = [] if config.custom_build_steps and step in config.custom_build_steps: n.comment(f"Custom build steps ({step})") for custom_step in config.custom_build_steps[step]: - outputs = custom_step.get("outputs") + outputs = cast(List[str | Path], custom_step.get("outputs")) if isinstance(outputs, list): implicit.extend(outputs) @@ -481,7 +589,7 @@ def write_custom_step(step: str) -> List[str]: n.build( outputs=outputs, - rule=custom_step.get("rule"), + rule=cast(str, custom_step.get("rule")), inputs=custom_step.get("inputs", None), implicit=custom_step.get("implicit", None), order_only=custom_step.get("order_only", None), @@ -518,10 +626,6 @@ def write_custom_step(step: str) -> List[str]: # Source files ### n.comment("Source files") - build_asm_path = build_path / "mod" - build_src_path = build_path / "src" - build_host_path = build_path / "host" - build_config_path = build_path / "config.json" def map_path(path: Path) -> Path: return path.parent / (path.name + ".MAP") @@ -617,95 +721,85 @@ def write(self, n: ninja_syntax.Writer) -> None: host_source_inputs: List[Path] = [] source_added: Set[Path] = set() - def c_build( - obj: Object, options: Dict[str, Any], lib_name: str, src_path: Path - ) -> Optional[Path]: - cflags_str = make_flags_str(options["cflags"]) - if options["extra_cflags"] is not None: - extra_cflags_str = make_flags_str(options["extra_cflags"]) + def c_build(obj: Object, src_path: Path) -> Optional[Path]: + cflags_str = make_flags_str(obj.options["cflags"]) + if obj.options["extra_cflags"] is not None: + extra_cflags_str = make_flags_str(obj.options["extra_cflags"]) cflags_str += " " + extra_cflags_str - used_compiler_versions.add(options["mw_version"]) - - src_obj_path = build_src_path / f"{obj.base_name}.o" - src_base_path = build_src_path / obj.base_name + used_compiler_versions.add(obj.options["mw_version"]) # Avoid creating duplicate build rules - if src_obj_path in source_added: - return src_obj_path - source_added.add(src_obj_path) - - shift_jis = options["shift_jis"] - if shift_jis is None: - shift_jis = config.shift_jis + if obj.src_obj_path is None or obj.src_obj_path in source_added: + return obj.src_obj_path + source_added.add(obj.src_obj_path) # Add MWCC build rule + lib_name = obj.options["lib"] n.comment(f"{obj.name}: {lib_name} (linked {obj.completed})") n.build( - outputs=src_obj_path, - rule="mwcc_sjis" if shift_jis else "mwcc", + outputs=obj.src_obj_path, + rule="mwcc_sjis" if obj.options["shift_jis"] else "mwcc", inputs=src_path, variables={ - "mw_version": Path(options["mw_version"]), + "mw_version": Path(obj.options["mw_version"]), "cflags": cflags_str, - "basedir": os.path.dirname(src_base_path), - "basefile": src_base_path, + "basedir": os.path.dirname(obj.src_obj_path), + "basefile": obj.src_obj_path.with_suffix(""), }, - implicit=mwcc_sjis_implicit if shift_jis else mwcc_implicit, + implicit=( + mwcc_sjis_implicit if obj.options["shift_jis"] else mwcc_implicit + ), ) # Add ctx build rule - ctx_path = build_src_path / f"{obj.base_name}.ctx" - n.build( - outputs=ctx_path, - rule="decompctx", - inputs=src_path, - implicit=decompctx, - ) + if obj.ctx_path is not None: + n.build( + outputs=obj.ctx_path, + rule="decompctx", + inputs=src_path, + implicit=decompctx, + ) # Add host build rule - if options.get("host", False): - host_obj_path = build_host_path / f"{obj.base_name}.o" - host_base_path = build_host_path / obj.base_name + if obj.options["host"] and obj.host_obj_path is not None: n.build( - outputs=host_obj_path, + outputs=obj.host_obj_path, rule="host_cc" if src_path.suffix == ".c" else "host_cpp", inputs=src_path, variables={ - "basedir": os.path.dirname(host_base_path), - "basefile": host_base_path, + "basedir": os.path.dirname(obj.host_obj_path), + "basefile": obj.host_obj_path.with_suffix(""), }, ) - if options["add_to_all"]: - host_source_inputs.append(host_obj_path) + if obj.options["add_to_all"]: + host_source_inputs.append(obj.host_obj_path) n.newline() - if options["add_to_all"]: - source_inputs.append(src_obj_path) + if obj.options["add_to_all"]: + source_inputs.append(obj.src_obj_path) - return src_obj_path + return obj.src_obj_path def asm_build( - obj: Object, options: Dict[str, Any], lib_name: str, src_path: Path + obj: Object, src_path: Path, obj_path: Optional[Path] ) -> Optional[Path]: - asflags = options["asflags"] or config.asflags - if asflags is None: + if obj.options["asflags"] is None: sys.exit("ProjectConfig.asflags missing") - asflags_str = make_flags_str(asflags) - if options["extra_asflags"] is not None: - extra_asflags_str = make_flags_str(options["extra_asflags"]) + asflags_str = make_flags_str(obj.options["asflags"]) + if obj.options["extra_asflags"] is not None: + extra_asflags_str = make_flags_str(obj.options["extra_asflags"]) asflags_str += " " + extra_asflags_str - asm_obj_path = build_asm_path / f"{obj.base_name}.o" - # Avoid creating duplicate build rules - if asm_obj_path in source_added: - return asm_obj_path - source_added.add(asm_obj_path) + if obj_path is None or obj_path in source_added: + return obj_path + source_added.add(obj_path) # Add assembler build rule + lib_name = obj.options["lib"] n.comment(f"{obj.name}: {lib_name} (linked {obj.completed})") n.build( - outputs=asm_obj_path, + outputs=obj_path, rule="as", inputs=src_path, variables={"asflags": asflags_str}, @@ -713,57 +807,40 @@ def asm_build( ) n.newline() - if options["add_to_all"]: - source_inputs.append(asm_obj_path) + if obj.options["add_to_all"]: + source_inputs.append(obj_path) - return asm_obj_path + return obj_path def add_unit(build_obj, link_step: LinkStep): obj_path, obj_name = build_obj["object"], build_obj["name"] - result = config.find_object(obj_name) - if not result: + obj = objects.get(obj_name) + if obj is None: if config.warn_missing_config and not build_obj["autogenerated"]: print(f"Missing configuration for {obj_name}") link_step.add(obj_path) return - lib, obj = result - lib_name = lib["lib"] - - # Use object options, then library options - options = lib.copy() - for key, value in obj.options.items(): - if value is not None or key not in options: - options[key] = value - - unit_src_path = Path(lib.get("src_dir", config.src_dir)) / options["source"] - - unit_asm_path: Optional[Path] = None - if config.asm_dir is not None: - unit_asm_path = ( - Path(lib.get("asm_dir", config.asm_dir)) / options["source"] - ).with_suffix(".s") - link_built_obj = obj.completed built_obj_path: Optional[Path] = None - if unit_src_path.exists(): - if unit_src_path.suffix in (".c", ".cp", ".cpp"): + if obj.src_path is not None and obj.src_path.exists(): + if obj.src_path.suffix in (".c", ".cp", ".cpp"): # Add MWCC & host build rules - built_obj_path = c_build(obj, options, lib_name, unit_src_path) - elif unit_src_path.suffix == ".s": + built_obj_path = c_build(obj, obj.src_path) + elif obj.src_path.suffix == ".s": # Add assembler build rule - built_obj_path = asm_build(obj, options, lib_name, unit_src_path) + built_obj_path = asm_build(obj, obj.src_path, obj.src_obj_path) else: - sys.exit(f"Unknown source file type {unit_src_path}") + sys.exit(f"Unknown source file type {obj.src_path}") else: if config.warn_missing_source or obj.completed: - print(f"Missing source file {unit_src_path}") + print(f"Missing source file {obj.src_path}") link_built_obj = False # Assembly overrides - if unit_asm_path is not None and unit_asm_path.exists(): + if obj.asm_path is not None and obj.asm_path.exists(): link_built_obj = True - built_obj_path = asm_build(obj, options, lib_name, unit_asm_path) + built_obj_path = asm_build(obj, obj.asm_path, obj.asm_obj_path) if link_built_obj and built_obj_path is not None: # Use the source-built object @@ -772,7 +849,10 @@ def add_unit(build_obj, link_step: LinkStep): # Use the original (extracted) object link_step.add(obj_path) else: - sys.exit(f"Missing object for {obj_name}: {unit_src_path} {lib} {obj}") + lib_name = obj.options["lib"] + sys.exit( + f"Missing object for {obj_name}: {obj.src_path} {lib_name} {obj}" + ) # Add DOL link step link_step = LinkStep(build_config) @@ -788,7 +868,7 @@ def add_unit(build_obj, link_step: LinkStep): add_unit(unit, module_link_step) # Add empty object to empty RELs if len(module_link_step.inputs) == 0: - if not config.rel_empty_file: + if config.rel_empty_file is None: sys.exit("ProjectConfig.rel_empty_file missing") add_unit( { @@ -850,7 +930,7 @@ def add_unit(build_obj, link_step: LinkStep): rspfile="$rspfile", rspfile_content="$in_newline", ) - generated_rels = [] + generated_rels: List[str] = [] for idx, link in enumerate(build_config["links"]): # Map module names to link steps link_steps_local = list( @@ -957,6 +1037,22 @@ def add_unit(build_obj, link_step: LinkStep): implicit=[ok_path, configure_script, python_lib, config.config_path], ) + ### + # Generate progress report + ### + n.comment("Generate progress report") + n.rule( + name="report", + command=f"{objdiff} report generate -o $out", + description="REPORT", + ) + report_implicit: List[str | Path] = [objdiff, "all_source"] + n.build( + outputs=report_path, + rule="report", + implicit=report_implicit, + ) + ### # Helper tools ### @@ -1003,6 +1099,7 @@ def add_unit(build_obj, link_step: LinkStep): ### # Split DOL ### + build_config_path = build_path / "config.json" n.comment("Split DOL into relocatable objects") n.rule( name="split", @@ -1063,13 +1160,15 @@ def add_unit(build_obj, link_step: LinkStep): # Generate objdiff.json def generate_objdiff_config( - config: ProjectConfig, build_config: Optional[Dict[str, Any]] + config: ProjectConfig, + objects: Dict[str, Object], + build_config: Optional[Dict[str, Any]], ) -> None: - if not build_config: + if build_config is None: return objdiff_config: Dict[str, Any] = { - "min_version": "1.0.0", + "min_version": "2.0.0-beta.5", "custom_make": "ninja", "build_target": False, "watch_patterns": [ @@ -1085,6 +1184,7 @@ def generate_objdiff_config( "*.json", ], "units": [], + "progress_categories": [], } # decomp.me compiler name mapping @@ -1095,6 +1195,7 @@ def generate_objdiff_config( "GC/1.2.5": "mwcc_233_163", "GC/1.2.5e": "mwcc_233_163e", "GC/1.2.5n": "mwcc_233_163n", + "GC/1.3": "mwcc_242_53", "GC/1.3.2": "mwcc_242_81", "GC/1.3.2r": "mwcc_242_81r", "GC/2.0": "mwcc_247_92", @@ -1119,44 +1220,30 @@ def generate_objdiff_config( "Wii/1.7": "mwcc_43_213", } - build_path = config.out_path() - - def add_unit(build_obj: Dict[str, Any], module_name: str) -> None: - if build_obj["autogenerated"]: - # Skip autogenerated objects - return - + def add_unit( + build_obj: Dict[str, Any], module_name: str, progress_categories: List[str] + ) -> None: obj_path, obj_name = build_obj["object"], build_obj["name"] base_object = Path(obj_name).with_suffix("") unit_config: Dict[str, Any] = { "name": Path(module_name) / base_object, "target_path": obj_path, + "metadata": { + "auto_generated": build_obj["autogenerated"], + "progress_categories": progress_categories, + }, } - result = config.find_object(obj_name) - if not result: - objdiff_config["units"].append(unit_config) - return - - lib, obj = result - src_dir = Path(lib.get("src_dir", config.src_dir)) - - # Use object options, then library options - options = lib.copy() - for key, value in obj.options.items(): - if value is not None or key not in options: - options[key] = value - - unit_src_path = src_dir / str(options["source"]) - - if not unit_src_path.exists(): + obj = objects.get(obj_name) + if obj is None: objdiff_config["units"].append(unit_config) return - cflags = options["cflags"] - src_obj_path = build_path / "src" / f"{obj.base_name}.o" - src_ctx_path = build_path / "src" / f"{obj.base_name}.ctx" + src_exists = obj.src_path is not None and obj.src_path.exists() + if src_exists: + unit_config["base_path"] = obj.src_obj_path + cflags = obj.options["cflags"] reverse_fn_order = False if type(cflags) is list: for flag in cflags: @@ -1175,39 +1262,86 @@ def keep_flag(flag): cflags = list(filter(keep_flag, cflags)) # Add appropriate lang flag - if unit_src_path.suffix in (".cp", ".cpp"): - cflags.insert(0, "-lang=c++") - else: - cflags.insert(0, "-lang=c") + if obj.src_path is not None and not any( + flag.startswith("-lang") for flag in cflags + ): + if obj.src_path.suffix in (".cp", ".cpp"): + cflags.insert(0, "-lang=c++") + else: + cflags.insert(0, "-lang=c") - unit_config["base_path"] = src_obj_path - unit_config["reverse_fn_order"] = reverse_fn_order - unit_config["complete"] = obj.completed - compiler_version = COMPILER_MAP.get(options["mw_version"]) + compiler_version = COMPILER_MAP.get(obj.options["mw_version"]) if compiler_version is None: - print(f"Missing scratch compiler mapping for {options['mw_version']}") + print(f"Missing scratch compiler mapping for {obj.options['mw_version']}") else: cflags_str = make_flags_str(cflags) - if options["extra_cflags"] is not None: - extra_cflags_str = make_flags_str(options["extra_cflags"]) + if obj.options["extra_cflags"] is not None: + extra_cflags_str = make_flags_str(obj.options["extra_cflags"]) cflags_str += " " + extra_cflags_str unit_config["scratch"] = { "platform": "gc_wii", "compiler": compiler_version, "c_flags": cflags_str, - "ctx_path": src_ctx_path, - "build_ctx": True, } + if src_exists: + unit_config["scratch"].update( + { + "ctx_path": obj.ctx_path, + "build_ctx": True, + } + ) + category_opt: List[str] | str = obj.options["progress_category"] + if isinstance(category_opt, list): + progress_categories.extend(category_opt) + elif category_opt is not None: + progress_categories.append(category_opt) + unit_config["metadata"].update( + { + "complete": obj.completed, + "reverse_fn_order": reverse_fn_order, + "source_path": obj.src_path, + "progress_categories": progress_categories, + } + ) objdiff_config["units"].append(unit_config) # Add DOL units for unit in build_config["units"]: - add_unit(unit, build_config["name"]) + progress_categories = [] + # Only include a "dol" category if there are any modules + # Otherwise it's redundant with the global report measures + if len(build_config["modules"]) > 0: + progress_categories.append("dol") + add_unit(unit, build_config["name"], progress_categories) # Add REL units for module in build_config["modules"]: for unit in module["units"]: - add_unit(unit, module["name"]) + progress_categories = [] + if config.progress_modules: + progress_categories.append("modules") + if config.progress_each_module: + progress_categories.append(module["name"]) + add_unit(unit, module["name"], progress_categories) + + # Add progress categories + def add_category(id: str, name: str): + objdiff_config["progress_categories"].append( + { + "id": id, + "name": name, + } + ) + + if len(build_config["modules"]) > 0: + add_category("dol", "DOL") + if config.progress_modules: + add_category("modules", "Modules") + if config.progress_each_module: + for module in build_config["modules"]: + add_category(module["name"], module["name"]) + for category in config.progress_categories: + add_category(category.id, category.name) # Write objdiff.json with open("objdiff.json", "w", encoding="utf-8") as w: @@ -1220,9 +1354,11 @@ def unix_path(input: Any) -> str: # Calculate, print and write progress to progress.json def calculate_progress(config: ProjectConfig) -> None: + config.validate() + objects = config.objects() out_path = config.out_path() build_config = load_build_config(config, out_path / "config.json") - if not build_config: + if build_config is None: return class ProgressUnit: @@ -1254,12 +1390,8 @@ def add(self, build_obj: Dict[str, Any]) -> None: # Skip autogenerated objects return - result = config.find_object(build_obj["name"]) - if not result: - return - - _, obj = result - if not obj.completed: + obj = objects.get(build_obj["name"]) + if obj is None or not obj.completed: return self.code_progress += build_obj["code_size"] @@ -1268,38 +1400,68 @@ def add(self, build_obj: Dict[str, Any]) -> None: self.objects_progress += 1 def code_frac(self) -> float: + if self.code_total == 0: + return 1.0 return self.code_progress / self.code_total def data_frac(self) -> float: + if self.data_total == 0: + return 1.0 return self.data_progress / self.data_total + progress_units: Dict[str, ProgressUnit] = {} + if config.progress_all: + progress_units["all"] = ProgressUnit("All") + progress_units["dol"] = ProgressUnit("DOL") + if len(build_config["modules"]) > 0: + if config.progress_modules: + progress_units["modules"] = ProgressUnit("Modules") + if len(config.progress_categories) > 0: + for category in config.progress_categories: + progress_units[category.id] = ProgressUnit(category.name) + if config.progress_each_module: + for module in build_config["modules"]: + progress_units[module["name"]] = ProgressUnit(module["name"]) + + def add_unit(id: str, unit: Dict[str, Any]) -> None: + progress = progress_units.get(id) + if progress is not None: + progress.add(unit) + # Add DOL units - all_progress = ProgressUnit("All") if config.progress_all else None - dol_progress = ProgressUnit("DOL") for unit in build_config["units"]: - if all_progress: - all_progress.add(unit) - dol_progress.add(unit) + add_unit("all", unit) + add_unit("dol", unit) + obj = objects.get(unit["name"]) + if obj is not None: + category_opt = obj.options["progress_category"] + if isinstance(category_opt, list): + for id in category_opt: + add_unit(id, unit) + elif category_opt is not None: + add_unit(category_opt, unit) # Add REL units - rels_progress = ProgressUnit("Modules") if config.progress_modules else None - modules_progress: List[ProgressUnit] = [] for module in build_config["modules"]: - progress = ProgressUnit(module["name"]) - modules_progress.append(progress) for unit in module["units"]: - if all_progress: - all_progress.add(unit) - if rels_progress: - rels_progress.add(unit) - progress.add(unit) + add_unit("all", unit) + add_unit("modules", unit) + add_unit(module["name"], unit) + obj = objects.get(unit["name"]) + if obj is not None: + category_opt = obj.options["progress_category"] + if isinstance(category_opt, list): + for id in category_opt: + add_unit(id, unit) + elif category_opt is not None: + add_unit(category_opt, unit) # Print human-readable progress print("Progress:") - def print_category(unit: Optional[ProgressUnit]) -> None: - if unit is None: - return + for unit in progress_units.values(): + if unit.objects_total == 0: + continue code_frac = unit.code_frac() data_frac = unit.data_frac() @@ -1321,41 +1483,17 @@ def print_category(unit: Optional[ProgressUnit]) -> None: ) ) - bytes_per_frac = unit.code_total / unit.code_fancy_frac - bytes_next = math.ceil((code_items + 1) * bytes_per_frac) - bytes_to_go = bytes_next - unit.code_progress - - print(f"Code bytes to go for next trophy: {bytes_to_go}") - - if all_progress: - print_category(all_progress) - print_category(dol_progress) - module_count = len(build_config["modules"]) - if module_count > 0: - print_category(rels_progress) - if config.progress_each_module: - for progress in modules_progress: - print_category(progress) - # Generate and write progress.json progress_json: Dict[str, Any] = {} - - def add_category(category: str, unit: ProgressUnit) -> None: - progress_json[category] = { + for id, unit in progress_units.items(): + if unit.objects_total == 0: + continue + progress_json[id] = { "code": unit.code_progress, "code/total": unit.code_total, "data": unit.data_progress, "data/total": unit.data_total, } - if all_progress: - add_category("all", all_progress) - add_category("dol", dol_progress) - if len(build_config["modules"]) > 0: - if rels_progress: - add_category("modules", rels_progress) - if config.progress_each_module: - for progress in modules_progress: - add_category(progress.name, progress) with open(out_path / "progress.json", "w", encoding="utf-8") as w: json.dump(progress_json, w, indent=4)