diff --git a/Progress.md b/Progress.md index 56431cde096..f2a201c9728 100644 --- a/Progress.md +++ b/Progress.md @@ -7,22 +7,22 @@ Section | Percentage | Decompiled (bytes) | Total (bytes) .init | 97.972973% | 9280 | 9472 .extab | 100.000000% | 96 | 96 .extabindex | 100.000000% | 96 | 96 -.text | 26.599313% | 956656 | 3596544 +.text | 26.641576% | 958176 | 3596544 .ctors | 100.000000% | 448 | 448 .dtors | 100.000000% | 32 | 32 .rodata | 100.000000% | 193856 | 193856 .data | 100.000000% | 197632 | 197632 .sdata | 100.000000% | 1408 | 1408 .sdata2 | 100.000000% | 20832 | 20832 -Total | 34.337345% | 1380592 | 4020672 +Total | 34.375149% | 1382112 | 4020672 ## Total Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- -main.dol | 34.337345% | 1380592 | 4020672 -RELs | 33.542325% | 3857476 | 11500324 -Total | 33.748272% | 5238068 | 15520996 +main.dol | 34.375149% | 1382112 | 4020672 +RELs | 33.562950% | 3859848 | 11500324 +Total | 33.773348% | 5241960 | 15520996 ## RELs @@ -193,7 +193,7 @@ d_a_izumi_gate | 57.729941% | 1180 | 2044 d_a_kago | 24.588671% | 15124 | 61508 d_a_kytag00 | 33.522084% | 2368 | 7064 d_a_kytag01 | 35.156250% | 1260 | 3584 -d_a_kytag02 | 54.888889% | 988 | 1800 +d_a_kytag02 | 100.000000% | 1800 | 1800 d_a_kytag03 | 23.399898% | 1828 | 7812 d_a_kytag04 | 36.357481% | 2148 | 5908 d_a_kytag05 | 100.000000% | 816 | 816 @@ -395,7 +395,7 @@ d_a_obj_digsnow | 44.813278% | 2160 | 4820 d_a_obj_dmelevator | 35.600390% | 4376 | 12292 d_a_obj_drop | 30.227416% | 3828 | 12664 d_a_obj_dust | 40.406977% | 2224 | 5504 -d_a_obj_eff | 73.504274% | 688 | 936 +d_a_obj_eff | 100.000000% | 936 | 936 d_a_obj_enemy_create | 100.000000% | 2828 | 2828 d_a_obj_fallobj | 31.929604% | 2032 | 6364 d_a_obj_fan | 39.173554% | 2844 | 7260 @@ -697,7 +697,7 @@ d_a_skip_2D | 100.000000% | 1332 | 1332 d_a_spinner | 27.874187% | 5140 | 18440 d_a_sq | 35.488722% | 3776 | 10640 d_a_startAndGoal | 41.918528% | 1276 | 3044 -d_a_suspend | 77.678571% | 696 | 896 +d_a_suspend | 100.000000% | 896 | 896 d_a_swBall | 33.297414% | 1236 | 3712 d_a_swLBall | 33.651805% | 1268 | 3768 d_a_swTime | 100.000000% | 1040 | 1040 @@ -780,9 +780,9 @@ d_a_tbox | 30.165503% | 9332 | 30936 d_a_tbox2 | 42.486445% | 4388 | 10328 d_a_tboxSw | 100.000000% | 1016 | 1016 d_a_title | 39.558574% | 2796 | 7068 -d_a_vrbox | 48.327138% | 1040 | 2152 +d_a_vrbox | 100.000000% | 2152 | 2152 d_a_vrbox2 | 34.977578% | 2184 | 6244 d_a_warp_bug | 54.940711% | 1112 | 2024 d_a_ykgr | 44.400631% | 2252 | 5072 f_pc_profile_lst | 100.000000% | 28156 | 28156 -Total | 33.542325% | 3857476 | 11500324 +Total | 33.562950% | 3859848 | 11500324 diff --git a/asm/d/shop/d_shop_system/dShopSystem_searchCameraActor__FPvPv.s b/asm/d/shop/d_shop_system/dShopSystem_searchCameraActor__FPvPv.s deleted file mode 100644 index 55c3430449c..00000000000 --- a/asm/d/shop/d_shop_system/dShopSystem_searchCameraActor__FPvPv.s +++ /dev/null @@ -1,54 +0,0 @@ -lbl_80197270: -/* 80197270 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80197274 7C 08 02 A6 */ mflr r0 -/* 80197278 90 01 00 14 */ stw r0, 0x14(r1) -/* 8019727C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80197280 93 C1 00 08 */ stw r30, 8(r1) -/* 80197284 7C 7E 1B 78 */ mr r30, r3 -/* 80197288 7C 9F 23 78 */ mr r31, r4 -/* 8019728C 4B E8 1A 55 */ bl fopAc_IsActor__FPv -/* 80197290 2C 03 00 00 */ cmpwi r3, 0 -/* 80197294 41 82 00 88 */ beq lbl_8019731C -/* 80197298 A8 1E 00 08 */ lha r0, 8(r30) -/* 8019729C 2C 00 01 26 */ cmpwi r0, 0x126 -/* 801972A0 40 82 00 7C */ bne lbl_8019731C -/* 801972A4 80 1F 00 B0 */ lwz r0, 0xb0(r31) -/* 801972A8 54 03 00 06 */ rlwinm r3, r0, 0, 0, 3 -/* 801972AC 80 9E 00 B0 */ lwz r4, 0xb0(r30) -/* 801972B0 54 80 00 06 */ rlwinm r0, r4, 0, 0, 3 -/* 801972B4 7C 03 00 40 */ cmplw r3, r0 -/* 801972B8 40 82 00 64 */ bne lbl_8019731C -/* 801972BC 80 6D 8A E4 */ lwz r3, dShopSystem_camera_count(r13) -/* 801972C0 2C 03 00 02 */ cmpwi r3, 2 -/* 801972C4 40 80 00 58 */ bge lbl_8019731C -/* 801972C8 54 80 07 3E */ clrlwi r0, r4, 0x1c -/* 801972CC 2C 00 00 01 */ cmpwi r0, 1 -/* 801972D0 41 82 00 30 */ beq lbl_80197300 -/* 801972D4 40 80 00 48 */ bge lbl_8019731C -/* 801972D8 2C 00 00 00 */ cmpwi r0, 0 -/* 801972DC 40 80 00 08 */ bge lbl_801972E4 -/* 801972E0 48 00 00 3C */ b lbl_8019731C -lbl_801972E4: -/* 801972E4 80 0D 81 70 */ lwz r0, dShopSystem_cameraActor(r13) -/* 801972E8 28 00 00 00 */ cmplwi r0, 0 -/* 801972EC 40 82 00 30 */ bne lbl_8019731C -/* 801972F0 93 CD 81 70 */ stw r30, dShopSystem_cameraActor(r13) -/* 801972F4 38 03 00 01 */ addi r0, r3, 1 -/* 801972F8 90 0D 8A E4 */ stw r0, dShopSystem_camera_count(r13) -/* 801972FC 48 00 00 20 */ b lbl_8019731C -lbl_80197300: -/* 80197300 38 8D 81 70 */ la r4, dShopSystem_cameraActor(r13) /* 804506F0-_SDA_BASE_ */ -/* 80197304 80 04 00 04 */ lwz r0, 4(r4) -/* 80197308 28 00 00 00 */ cmplwi r0, 0 -/* 8019730C 40 82 00 10 */ bne lbl_8019731C -/* 80197310 93 C4 00 04 */ stw r30, 4(r4) -/* 80197314 38 03 00 01 */ addi r0, r3, 1 -/* 80197318 90 0D 8A E4 */ stw r0, dShopSystem_camera_count(r13) -lbl_8019731C: -/* 8019731C 38 60 00 00 */ li r3, 0 -/* 80197320 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80197324 83 C1 00 08 */ lwz r30, 8(r1) -/* 80197328 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8019732C 7C 08 03 A6 */ mtlr r0 -/* 80197330 38 21 00 10 */ addi r1, r1, 0x10 -/* 80197334 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_actor_mng/fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci.s b/asm/f_op/f_op_actor_mng/fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci.s deleted file mode 100644 index e72efc85fe3..00000000000 --- a/asm/f_op/f_op_actor_mng/fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci.s +++ /dev/null @@ -1,61 +0,0 @@ -lbl_8001D020: -/* 8001D020 94 21 FF A0 */ stwu r1, -0x60(r1) -/* 8001D024 7C 08 02 A6 */ mflr r0 -/* 8001D028 90 01 00 64 */ stw r0, 0x64(r1) -/* 8001D02C DB E1 00 50 */ stfd f31, 0x50(r1) -/* 8001D030 F3 E1 00 58 */ psq_st f31, 88(r1), 0, 0 /* qr0 */ -/* 8001D034 39 61 00 50 */ addi r11, r1, 0x50 -/* 8001D038 48 34 51 9D */ bl _savegpr_27 -/* 8001D03C 7C 7B 1B 78 */ mr r27, r3 -/* 8001D040 7C 9C 23 78 */ mr r28, r4 -/* 8001D044 7C DD 33 78 */ mr r29, r6 -/* 8001D048 FF E0 08 90 */ fmr f31, f1 -/* 8001D04C 7C FE 3B 78 */ mr r30, r7 -/* 8001D050 7D 1F 43 78 */ mr r31, r8 -/* 8001D054 C0 45 00 08 */ lfs f2, 8(r5) -/* 8001D058 C0 22 82 48 */ lfs f1, lit_6035(r2) -/* 8001D05C C0 05 00 04 */ lfs f0, 4(r5) -/* 8001D060 EC 21 00 2A */ fadds f1, f1, f0 -/* 8001D064 C0 05 00 00 */ lfs f0, 0(r5) -/* 8001D068 D0 01 00 24 */ stfs f0, 0x24(r1) -/* 8001D06C D0 21 00 28 */ stfs f1, 0x28(r1) -/* 8001D070 D0 41 00 2C */ stfs f2, 0x2c(r1) -/* 8001D074 38 61 00 24 */ addi r3, r1, 0x24 -/* 8001D078 48 00 0C 45 */ bl gndCheck__11fopAcM_gc_cFPC4cXyz -/* 8001D07C 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 8001D080 41 82 00 6C */ beq lbl_8001D0EC -/* 8001D084 C0 0D 87 50 */ lfs f0, mGroundY__11fopAcM_gc_c(r13) -/* 8001D088 D0 01 00 28 */ stfs f0, 0x28(r1) -/* 8001D08C D3 E1 00 18 */ stfs f31, 0x18(r1) -/* 8001D090 D3 E1 00 1C */ stfs f31, 0x1c(r1) -/* 8001D094 D3 E1 00 20 */ stfs f31, 0x20(r1) -/* 8001D098 38 01 00 18 */ addi r0, r1, 0x18 -/* 8001D09C 90 01 00 08 */ stw r0, 8(r1) -/* 8001D0A0 38 60 00 00 */ li r3, 0 -/* 8001D0A4 90 61 00 0C */ stw r3, 0xc(r1) -/* 8001D0A8 38 00 FF FF */ li r0, -1 -/* 8001D0AC 90 01 00 10 */ stw r0, 0x10(r1) -/* 8001D0B0 90 61 00 14 */ stw r3, 0x14(r1) -/* 8001D0B4 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001D0B8 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001D0BC 80 63 5D 3C */ lwz r3, 0x5d3c(r3) -/* 8001D0C0 80 9B 00 00 */ lwz r4, 0(r27) -/* 8001D0C4 7F 85 E3 78 */ mr r5, r28 -/* 8001D0C8 3C C0 80 3F */ lis r6, mGndCheck__11fopAcM_gc_c@ha /* 0x803F1CC4@ha */ -/* 8001D0CC 38 C6 1C C4 */ addi r6, r6, mGndCheck__11fopAcM_gc_c@l /* 0x803F1CC4@l */ -/* 8001D0D0 38 C6 00 14 */ addi r6, r6, 0x14 -/* 8001D0D4 38 E1 00 24 */ addi r7, r1, 0x24 -/* 8001D0D8 7F C8 F3 78 */ mr r8, r30 -/* 8001D0DC 7F E9 FB 78 */ mr r9, r31 -/* 8001D0E0 7F AA EB 78 */ mr r10, r29 -/* 8001D0E4 48 03 06 E1 */ bl setSimpleFoot__13dPa_control_cFUlPUlR13cBgS_PolyInfoPC4cXyzPC12dKy_tevstr_ciPC5csXyzPC4cXyzP18dPa_levelEcallBackScPC4cXyz -/* 8001D0E8 90 7B 00 00 */ stw r3, 0(r27) -lbl_8001D0EC: -/* 8001D0EC E3 E1 00 58 */ psq_l f31, 88(r1), 0, 0 /* qr0 */ -/* 8001D0F0 CB E1 00 50 */ lfd f31, 0x50(r1) -/* 8001D0F4 39 61 00 50 */ addi r11, r1, 0x50 -/* 8001D0F8 48 34 51 29 */ bl _restgpr_27 -/* 8001D0FC 80 01 00 64 */ lwz r0, 0x64(r1) -/* 8001D100 7C 08 03 A6 */ mtlr r0 -/* 8001D104 38 21 00 60 */ addi r1, r1, 0x60 -/* 8001D108 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_actor_mng/fopAcM_getWaterStream__FPC4cXyzRC13cBgS_PolyInfoP4cXyzPii.s b/asm/f_op/f_op_actor_mng/fopAcM_getWaterStream__FPC4cXyzRC13cBgS_PolyInfoP4cXyzPii.s deleted file mode 100644 index 38df74c63fa..00000000000 --- a/asm/f_op/f_op_actor_mng/fopAcM_getWaterStream__FPC4cXyzRC13cBgS_PolyInfoP4cXyzPii.s +++ /dev/null @@ -1,89 +0,0 @@ -lbl_8001D9A8: -/* 8001D9A8 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 8001D9AC 7C 08 02 A6 */ mflr r0 -/* 8001D9B0 90 01 00 34 */ stw r0, 0x34(r1) -/* 8001D9B4 39 61 00 30 */ addi r11, r1, 0x30 -/* 8001D9B8 48 34 48 19 */ bl _savegpr_26 -/* 8001D9BC 7C 7A 1B 78 */ mr r26, r3 -/* 8001D9C0 7C 9B 23 78 */ mr r27, r4 -/* 8001D9C4 7C BC 2B 78 */ mr r28, r5 -/* 8001D9C8 7C DD 33 78 */ mr r29, r6 -/* 8001D9CC 7C FE 3B 78 */ mr r30, r7 -/* 8001D9D0 80 0D 88 24 */ lwz r0, m_top__13daTagStream_c(r13) -/* 8001D9D4 28 00 00 00 */ cmplwi r0, 0 -/* 8001D9D8 41 82 00 74 */ beq lbl_8001DA4C -/* 8001D9DC 7C 1F 03 78 */ mr r31, r0 -/* 8001D9E0 48 00 00 64 */ b lbl_8001DA44 -lbl_8001D9E4: -/* 8001D9E4 88 1F 05 69 */ lbz r0, 0x569(r31) -/* 8001D9E8 28 00 00 00 */ cmplwi r0, 0 -/* 8001D9EC 41 82 00 54 */ beq lbl_8001DA40 -/* 8001D9F0 2C 1E 00 00 */ cmpwi r30, 0 -/* 8001D9F4 41 82 00 10 */ beq lbl_8001DA04 -/* 8001D9F8 80 1F 05 6C */ lwz r0, 0x56c(r31) -/* 8001D9FC 2C 00 00 00 */ cmpwi r0, 0 -/* 8001DA00 41 82 00 40 */ beq lbl_8001DA40 -lbl_8001DA04: -/* 8001DA04 7F E3 FB 78 */ mr r3, r31 -/* 8001DA08 7F 44 D3 78 */ mr r4, r26 -/* 8001DA0C 48 01 3E A9 */ bl checkArea__13daTagStream_cFPC4cXyz -/* 8001DA10 2C 03 00 00 */ cmpwi r3, 0 -/* 8001DA14 41 82 00 2C */ beq lbl_8001DA40 -/* 8001DA18 C0 1F 04 F8 */ lfs f0, 0x4f8(r31) -/* 8001DA1C D0 1C 00 00 */ stfs f0, 0(r28) -/* 8001DA20 C0 1F 04 FC */ lfs f0, 0x4fc(r31) -/* 8001DA24 D0 1C 00 04 */ stfs f0, 4(r28) -/* 8001DA28 C0 1F 05 00 */ lfs f0, 0x500(r31) -/* 8001DA2C D0 1C 00 08 */ stfs f0, 8(r28) -/* 8001DA30 88 1F 05 6A */ lbz r0, 0x56a(r31) -/* 8001DA34 90 1D 00 00 */ stw r0, 0(r29) -/* 8001DA38 38 60 00 01 */ li r3, 1 -/* 8001DA3C 48 00 00 90 */ b lbl_8001DACC -lbl_8001DA40: -/* 8001DA40 83 FF 05 74 */ lwz r31, 0x574(r31) -lbl_8001DA44: -/* 8001DA44 28 1F 00 00 */ cmplwi r31, 0 -/* 8001DA48 40 82 FF 9C */ bne lbl_8001D9E4 -lbl_8001DA4C: -/* 8001DA4C 2C 1E 00 00 */ cmpwi r30, 0 -/* 8001DA50 41 82 00 0C */ beq lbl_8001DA5C -/* 8001DA54 38 60 00 00 */ li r3, 0 -/* 8001DA58 48 00 00 74 */ b lbl_8001DACC -lbl_8001DA5C: -/* 8001DA5C 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001DA60 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001DA64 38 63 0F 38 */ addi r3, r3, 0xf38 -/* 8001DA68 7F 64 DB 78 */ mr r4, r27 -/* 8001DA6C 48 05 6B F5 */ bl ChkPolySafe__4cBgSFRC13cBgS_PolyInfo -/* 8001DA70 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 8001DA74 41 82 00 30 */ beq lbl_8001DAA4 -/* 8001DA78 7F 63 DB 78 */ mr r3, r27 -/* 8001DA7C 7F 84 E3 78 */ mr r4, r28 -/* 8001DA80 7F A5 EB 78 */ mr r5, r29 -/* 8001DA84 48 03 3E D9 */ bl dPath_GetPolyRoomPathVec__FRC13cBgS_PolyInfoP4cXyzPi -/* 8001DA88 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 8001DA8C 41 82 00 3C */ beq lbl_8001DAC8 -/* 8001DA90 38 61 00 08 */ addi r3, r1, 8 -/* 8001DA94 7F 84 E3 78 */ mr r4, r28 -/* 8001DA98 48 24 94 B1 */ bl normalizeZP__4cXyzFv -/* 8001DA9C 38 60 00 01 */ li r3, 1 -/* 8001DAA0 48 00 00 2C */ b lbl_8001DACC -lbl_8001DAA4: -/* 8001DAA4 3C 60 80 43 */ lis r3, Zero__4cXyz@ha /* 0x80430CF4@ha */ -/* 8001DAA8 C4 03 0C F4 */ lfsu f0, Zero__4cXyz@l(r3) /* 0x80430CF4@l */ -/* 8001DAAC D0 1C 00 00 */ stfs f0, 0(r28) -/* 8001DAB0 C0 03 00 04 */ lfs f0, 4(r3) -/* 8001DAB4 D0 1C 00 04 */ stfs f0, 4(r28) -/* 8001DAB8 C0 03 00 08 */ lfs f0, 8(r3) -/* 8001DABC D0 1C 00 08 */ stfs f0, 8(r28) -/* 8001DAC0 38 00 00 00 */ li r0, 0 -/* 8001DAC4 90 1D 00 00 */ stw r0, 0(r29) -lbl_8001DAC8: -/* 8001DAC8 38 60 00 00 */ li r3, 0 -lbl_8001DACC: -/* 8001DACC 39 61 00 30 */ addi r11, r1, 0x30 -/* 8001DAD0 48 34 47 4D */ bl _restgpr_26 -/* 8001DAD4 80 01 00 34 */ lwz r0, 0x34(r1) -/* 8001DAD8 7C 08 03 A6 */ mtlr r0 -/* 8001DADC 38 21 00 30 */ addi r1, r1, 0x30 -/* 8001DAE0 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_actor_mng/fopAcM_myRoomSearchEnemy__FSc.s b/asm/f_op/f_op_actor_mng/fopAcM_myRoomSearchEnemy__FSc.s deleted file mode 100644 index a4e44277bc5..00000000000 --- a/asm/f_op/f_op_actor_mng/fopAcM_myRoomSearchEnemy__FSc.s +++ /dev/null @@ -1,52 +0,0 @@ -lbl_8001CA1C: -/* 8001CA1C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8001CA20 7C 08 02 A6 */ mflr r0 -/* 8001CA24 90 01 00 24 */ stw r0, 0x24(r1) -/* 8001CA28 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 8001CA2C 3C 80 80 3F */ lis r4, mStatus__20dStage_roomControl_c@ha /* 0x803F6094@ha */ -/* 8001CA30 38 84 60 94 */ addi r4, r4, mStatus__20dStage_roomControl_c@l /* 0x803F6094@l */ -/* 8001CA34 7C 60 07 74 */ extsb r0, r3 -/* 8001CA38 1C 00 04 04 */ mulli r0, r0, 0x404 -/* 8001CA3C 7C 64 02 14 */ add r3, r4, r0 -/* 8001CA40 80 63 03 FC */ lwz r3, 0x3fc(r3) -/* 8001CA44 48 00 22 6D */ bl fopScnM_SearchByID__FUi -/* 8001CA48 7C 7F 1B 78 */ mr r31, r3 -/* 8001CA4C 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001CA50 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001CA54 80 63 5D AC */ lwz r3, 0x5dac(r3) -/* 8001CA58 81 83 06 28 */ lwz r12, 0x628(r3) -/* 8001CA5C 81 8C 00 FC */ lwz r12, 0xfc(r12) -/* 8001CA60 7D 89 03 A6 */ mtctr r12 -/* 8001CA64 4E 80 04 21 */ bctrl -/* 8001CA68 90 61 00 08 */ stw r3, 8(r1) -/* 8001CA6C 3C 60 80 02 */ lis r3, fpcSch_JudgeByID__FPvPv@ha /* 0x80023590@ha */ -/* 8001CA70 38 63 35 90 */ addi r3, r3, fpcSch_JudgeByID__FPvPv@l /* 0x80023590@l */ -/* 8001CA74 38 81 00 08 */ addi r4, r1, 8 -/* 8001CA78 4B FF CD 81 */ bl fopAcIt_Judge__FPFPvPv_PvPv -/* 8001CA7C 28 03 00 00 */ cmplwi r3, 0 -/* 8001CA80 41 82 00 14 */ beq lbl_8001CA94 -/* 8001CA84 88 03 04 96 */ lbz r0, 0x496(r3) -/* 8001CA88 28 00 00 02 */ cmplwi r0, 2 -/* 8001CA8C 40 82 00 08 */ bne lbl_8001CA94 -/* 8001CA90 48 00 00 34 */ b lbl_8001CAC4 -lbl_8001CA94: -/* 8001CA94 80 6D 87 C0 */ lwz r3, g_fpcNd_type(r13) -/* 8001CA98 80 9F 00 B4 */ lwz r4, 0xb4(r31) -/* 8001CA9C 48 00 3B B1 */ bl fpcBs_Is_JustOfType__Fii -/* 8001CAA0 2C 03 00 00 */ cmpwi r3, 0 -/* 8001CAA4 41 82 00 0C */ beq lbl_8001CAB0 -/* 8001CAA8 80 7F 00 C8 */ lwz r3, 0xc8(r31) -/* 8001CAAC 48 00 00 08 */ b lbl_8001CAB4 -lbl_8001CAB0: -/* 8001CAB0 38 60 FF FF */ li r3, -1 -lbl_8001CAB4: -/* 8001CAB4 3C 80 80 02 */ lis r4, enemySearchJugge__FPvPv@ha /* 0x8001C9CC@ha */ -/* 8001CAB8 38 84 C9 CC */ addi r4, r4, enemySearchJugge__FPvPv@l /* 0x8001C9CC@l */ -/* 8001CABC 38 A0 00 00 */ li r5, 0 -/* 8001CAC0 48 00 58 F5 */ bl fpcM_JudgeInLayer__FUiPFPvPv_PvPv -lbl_8001CAC4: -/* 8001CAC4 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 8001CAC8 80 01 00 24 */ lwz r0, 0x24(r1) -/* 8001CACC 7C 08 03 A6 */ mtlr r0 -/* 8001CAD0 38 21 00 20 */ addi r1, r1, 0x20 -/* 8001CAD4 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_actor_mng/fopAcM_orderItemEvent__FP10fopAc_ac_cUsUs.s b/asm/f_op/f_op_actor_mng/fopAcM_orderItemEvent__FP10fopAc_ac_cUsUs.s deleted file mode 100644 index d454d260cee..00000000000 --- a/asm/f_op/f_op_actor_mng/fopAcM_orderItemEvent__FP10fopAc_ac_cUsUs.s +++ /dev/null @@ -1,50 +0,0 @@ -lbl_8001B9D0: -/* 8001B9D0 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8001B9D4 7C 08 02 A6 */ mflr r0 -/* 8001B9D8 90 01 00 14 */ stw r0, 0x14(r1) -/* 8001B9DC 7C 69 1B 78 */ mr r9, r3 -/* 8001B9E0 7C 87 23 78 */ mr r7, r4 -/* 8001B9E4 7C A6 2B 78 */ mr r6, r5 -/* 8001B9E8 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001B9EC 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001B9F0 38 63 4E C8 */ addi r3, r3, 0x4ec8 -/* 8001B9F4 38 00 00 00 */ li r0, 0 -/* 8001B9F8 88 83 00 E5 */ lbz r4, 0xe5(r3) -/* 8001B9FC 28 04 00 00 */ cmplwi r4, 0 -/* 8001BA00 41 82 00 0C */ beq lbl_8001BA0C -/* 8001BA04 28 04 00 02 */ cmplwi r4, 2 -/* 8001BA08 40 82 00 08 */ bne lbl_8001BA10 -lbl_8001BA0C: -/* 8001BA0C 38 00 00 01 */ li r0, 1 -lbl_8001BA10: -/* 8001BA10 54 00 06 3F */ clrlwi. r0, r0, 0x18 -/* 8001BA14 40 82 00 20 */ bne lbl_8001BA34 -/* 8001BA18 54 C0 05 6B */ rlwinm. r0, r6, 0, 0x15, 0x15 -/* 8001BA1C 41 82 00 10 */ beq lbl_8001BA2C -/* 8001BA20 80 03 00 F8 */ lwz r0, 0xf8(r3) -/* 8001BA24 7C 00 48 40 */ cmplw r0, r9 -/* 8001BA28 41 82 00 0C */ beq lbl_8001BA34 -lbl_8001BA2C: -/* 8001BA2C 38 60 00 00 */ li r3, 0 -/* 8001BA30 48 00 00 3C */ b lbl_8001BA6C -lbl_8001BA34: -/* 8001BA34 54 E0 04 3F */ clrlwi. r0, r7, 0x10 -/* 8001BA38 40 82 00 08 */ bne lbl_8001BA40 -/* 8001BA3C 38 E0 00 FF */ li r7, 0xff -lbl_8001BA40: -/* 8001BA40 38 00 00 FF */ li r0, 0xff -/* 8001BA44 90 01 00 08 */ stw r0, 8(r1) -/* 8001BA48 38 80 00 05 */ li r4, 5 -/* 8001BA4C 7C E5 3B 78 */ mr r5, r7 -/* 8001BA50 3C E0 00 01 */ lis r7, 0x0001 /* 0x0000FFFF@ha */ -/* 8001BA54 38 E7 FF FF */ addi r7, r7, 0xFFFF /* 0x0000FFFF@l */ -/* 8001BA58 3D 00 80 40 */ lis r8, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001BA5C 39 08 61 C0 */ addi r8, r8, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001BA60 81 08 5D AC */ lwz r8, 0x5dac(r8) -/* 8001BA64 39 40 FF FF */ li r10, -1 -/* 8001BA68 48 02 5C 01 */ bl order__14dEvt_control_cFUsUsUsUsPvPvsUc -lbl_8001BA6C: -/* 8001BA6C 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8001BA70 7C 08 03 A6 */ mtlr r0 -/* 8001BA74 38 21 00 10 */ addi r1, r1, 0x10 -/* 8001BA78 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_actor_mng/fopAcM_orderSpeakEvent__FP10fopAc_ac_cUsUs.s b/asm/f_op/f_op_actor_mng/fopAcM_orderSpeakEvent__FP10fopAc_ac_cUsUs.s deleted file mode 100644 index 6ee508e2cc7..00000000000 --- a/asm/f_op/f_op_actor_mng/fopAcM_orderSpeakEvent__FP10fopAc_ac_cUsUs.s +++ /dev/null @@ -1,49 +0,0 @@ -lbl_8001B19C: -/* 8001B19C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8001B1A0 7C 08 02 A6 */ mflr r0 -/* 8001B1A4 90 01 00 14 */ stw r0, 0x14(r1) -/* 8001B1A8 7C 69 1B 78 */ mr r9, r3 -/* 8001B1AC 7C 87 23 78 */ mr r7, r4 -/* 8001B1B0 7C A6 2B 78 */ mr r6, r5 -/* 8001B1B4 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001B1B8 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001B1BC 38 63 4E C8 */ addi r3, r3, 0x4ec8 -/* 8001B1C0 38 00 00 00 */ li r0, 0 -/* 8001B1C4 88 83 00 E5 */ lbz r4, 0xe5(r3) -/* 8001B1C8 28 04 00 00 */ cmplwi r4, 0 -/* 8001B1CC 41 82 00 0C */ beq lbl_8001B1D8 -/* 8001B1D0 28 04 00 02 */ cmplwi r4, 2 -/* 8001B1D4 40 82 00 08 */ bne lbl_8001B1DC -lbl_8001B1D8: -/* 8001B1D8 38 00 00 01 */ li r0, 1 -lbl_8001B1DC: -/* 8001B1DC 54 00 06 3F */ clrlwi. r0, r0, 0x18 -/* 8001B1E0 40 82 00 20 */ bne lbl_8001B200 -/* 8001B1E4 54 C0 05 6B */ rlwinm. r0, r6, 0, 0x15, 0x15 -/* 8001B1E8 41 82 00 10 */ beq lbl_8001B1F8 -/* 8001B1EC 80 03 00 F8 */ lwz r0, 0xf8(r3) -/* 8001B1F0 7C 00 48 40 */ cmplw r0, r9 -/* 8001B1F4 41 82 00 0C */ beq lbl_8001B200 -lbl_8001B1F8: -/* 8001B1F8 38 60 00 00 */ li r3, 0 -/* 8001B1FC 48 00 00 38 */ b lbl_8001B234 -lbl_8001B200: -/* 8001B200 54 E0 04 3F */ clrlwi. r0, r7, 0x10 -/* 8001B204 40 82 00 08 */ bne lbl_8001B20C -/* 8001B208 38 E0 01 EA */ li r7, 0x1ea -lbl_8001B20C: -/* 8001B20C 38 00 00 FF */ li r0, 0xff -/* 8001B210 90 01 00 08 */ stw r0, 8(r1) -/* 8001B214 38 80 00 00 */ li r4, 0 -/* 8001B218 7C E5 3B 78 */ mr r5, r7 -/* 8001B21C 38 E0 01 4F */ li r7, 0x14f -/* 8001B220 3D 00 80 40 */ lis r8, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8001B224 39 08 61 C0 */ addi r8, r8, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 8001B228 81 08 5D AC */ lwz r8, 0x5dac(r8) -/* 8001B22C 39 40 FF FF */ li r10, -1 -/* 8001B230 48 02 64 39 */ bl order__14dEvt_control_cFUsUsUsUsPvPvsUc -lbl_8001B234: -/* 8001B234 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8001B238 7C 08 03 A6 */ mtlr r0 -/* 8001B23C 38 21 00 10 */ addi r1, r1, 0x10 -/* 8001B240 4E 80 00 20 */ blr diff --git a/asm/f_op/f_op_actor_mng/fopAcM_searchFromName4Event__FPCcs.s b/asm/f_op/f_op_actor_mng/fopAcM_searchFromName4Event__FPCcs.s deleted file mode 100644 index e8dec71258d..00000000000 --- a/asm/f_op/f_op_actor_mng/fopAcM_searchFromName4Event__FPCcs.s +++ /dev/null @@ -1,68 +0,0 @@ -lbl_8001D7A0: -/* 8001D7A0 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 8001D7A4 7C 08 02 A6 */ mflr r0 -/* 8001D7A8 90 01 00 34 */ stw r0, 0x34(r1) -/* 8001D7AC 7C 65 1B 78 */ mr r5, r3 -/* 8001D7B0 38 60 00 00 */ li r3, 0 -/* 8001D7B4 98 61 00 08 */ stb r3, 8(r1) -/* 8001D7B8 38 00 FF FF */ li r0, -1 -/* 8001D7BC B0 01 00 26 */ sth r0, 0x26(r1) -/* 8001D7C0 38 00 00 0B */ li r0, 0xb -/* 8001D7C4 B0 01 00 28 */ sth r0, 0x28(r1) -/* 8001D7C8 98 61 00 2A */ stb r3, 0x2a(r1) -/* 8001D7CC B0 81 00 26 */ sth r4, 0x26(r1) -/* 8001D7D0 38 61 00 08 */ addi r3, r1, 8 -/* 8001D7D4 7C A4 2B 78 */ mr r4, r5 -/* 8001D7D8 48 34 B3 55 */ bl strcpy -/* 8001D7DC 38 61 00 08 */ addi r3, r1, 8 -/* 8001D7E0 38 80 00 3A */ li r4, 0x3a -/* 8001D7E4 48 34 B1 41 */ bl strchr -/* 8001D7E8 28 03 00 00 */ cmplwi r3, 0 -/* 8001D7EC 41 82 00 5C */ beq lbl_8001D848 -/* 8001D7F0 38 00 00 00 */ li r0, 0 -/* 8001D7F4 98 03 00 00 */ stb r0, 0(r3) -/* 8001D7F8 B0 01 00 26 */ sth r0, 0x26(r1) -/* 8001D7FC 38 83 00 01 */ addi r4, r3, 1 -/* 8001D800 48 00 00 3C */ b lbl_8001D83C -lbl_8001D804: -/* 8001D804 7C 63 07 74 */ extsb r3, r3 -/* 8001D808 2C 03 00 30 */ cmpwi r3, 0x30 -/* 8001D80C 41 80 00 0C */ blt lbl_8001D818 -/* 8001D810 2C 03 00 39 */ cmpwi r3, 0x39 -/* 8001D814 40 81 00 10 */ ble lbl_8001D824 -lbl_8001D818: -/* 8001D818 38 00 FF FF */ li r0, -1 -/* 8001D81C B0 01 00 26 */ sth r0, 0x26(r1) -/* 8001D820 48 00 00 28 */ b lbl_8001D848 -lbl_8001D824: -/* 8001D824 A8 01 00 26 */ lha r0, 0x26(r1) -/* 8001D828 1C 00 00 0A */ mulli r0, r0, 0xa -/* 8001D82C 7C 63 02 14 */ add r3, r3, r0 -/* 8001D830 38 03 FF D0 */ addi r0, r3, -48 -/* 8001D834 B0 01 00 26 */ sth r0, 0x26(r1) -/* 8001D838 38 84 00 01 */ addi r4, r4, 1 -lbl_8001D83C: -/* 8001D83C 88 64 00 00 */ lbz r3, 0(r4) -/* 8001D840 7C 60 07 75 */ extsb. r0, r3 -/* 8001D844 40 82 FF C0 */ bne lbl_8001D804 -lbl_8001D848: -/* 8001D848 38 61 00 08 */ addi r3, r1, 8 -/* 8001D84C 48 00 75 75 */ bl dStage_searchName__FPCc -/* 8001D850 28 03 00 00 */ cmplwi r3, 0 -/* 8001D854 40 82 00 0C */ bne lbl_8001D860 -/* 8001D858 38 60 00 00 */ li r3, 0 -/* 8001D85C 48 00 00 24 */ b lbl_8001D880 -lbl_8001D860: -/* 8001D860 A8 03 00 08 */ lha r0, 8(r3) -/* 8001D864 B0 01 00 28 */ sth r0, 0x28(r1) -/* 8001D868 88 03 00 0A */ lbz r0, 0xa(r3) -/* 8001D86C 98 01 00 2A */ stb r0, 0x2a(r1) -/* 8001D870 3C 60 80 02 */ lis r3, fopAcM_findObject4EventCB__FP10fopAc_ac_cPv@ha /* 0x8001D6F0@ha */ -/* 8001D874 38 63 D6 F0 */ addi r3, r3, fopAcM_findObject4EventCB__FP10fopAc_ac_cPv@l /* 0x8001D6F0@l */ -/* 8001D878 38 81 00 08 */ addi r4, r1, 8 -/* 8001D87C 4B FF BF 7D */ bl fopAcIt_Judge__FPFPvPv_PvPv -lbl_8001D880: -/* 8001D880 80 01 00 34 */ lwz r0, 0x34(r1) -/* 8001D884 7C 08 03 A6 */ mtlr r0 -/* 8001D888 38 21 00 30 */ addi r1, r1, 0x30 -/* 8001D88C 4E 80 00 20 */ blr diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index 39fcfece230..3988dcf5bf3 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -63,6 +63,7 @@ public: u32 getTexNo(u32 idx) const { return mTevBlock->getTexNo(idx); } GXColor* getTevKColor(u32 param_0) { return mTevBlock->getTevKColor(param_0); } J3DFog* getFog() { return mPEBlock->getFog(); } + J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); } void setTevColor(u32 i, const J3DGXColorS10* i_color) { mTevBlock->setTevColor(i, i_color); } void setTevKColor(u32 i, const J3DGXColor* i_color) { mTevBlock->setTevKColor(i, i_color); } diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index 8a8158b7bac..95580afa910 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -36,12 +36,13 @@ struct J3DTextureSRTInfo { struct J3DTexMtxInfo { /* 80325718 */ void operator=(J3DTexMtxInfo const&); + /* 80325794 */ void setEffectMtx(Mtx); /* 0x00 */ u8 mProjection; - /* 0x01 */ u8 mInfo; + /* 0x01 */ s8 mInfo; /* 0x04 */ Vec mCenter; /* 0x10 */ J3DTextureSRTInfo mSRT; - /* 0x24 */ Mtx44 mEffectMtx; + /* 0x24 */ Mtx44 mEffectMtx; }; // Size: 0x64 class J3DTexMtx { @@ -55,6 +56,7 @@ public: J3DTexMtxInfo& getTexMtxInfo() { return mTexMtxInfo; } Mtx& getMtx() { return mMtx; } + void setEffectMtx(Mtx effectMtx) { mTexMtxInfo.setEffectMtx(effectMtx); } private: /* 0x00 */ J3DTexMtxInfo mTexMtxInfo; diff --git a/include/JSystem/J3DU/J3DUClipper.h b/include/JSystem/J3DU/J3DUClipper.h index d622fbde44e..3f8645a23b2 100644 --- a/include/JSystem/J3DU/J3DUClipper.h +++ b/include/JSystem/J3DU/J3DUClipper.h @@ -19,6 +19,8 @@ public: void setNear(f32 near) { mNear = near; } void setFar(f32 far) { mFar = far; } + f32 getFar() { return mFar; } + private: Vec _04; Vec _10; diff --git a/include/d/a/d_a_npc.h b/include/d/a/d_a_npc.h index b9b4e5e7191..a904b9e7b73 100644 --- a/include/d/a/d_a_npc.h +++ b/include/d/a/d_a_npc.h @@ -164,7 +164,7 @@ public: /* 80146188 */ int chkPassed1(cXyz, int); /* 801464D8 */ int chkPassed2(cXyz, cXyz*, int, int); - inline cXyz& getPntPos(u16 i_idx) { + inline cXyz& getPntPos(int i_idx) { return mpRoomPath->m_points[i_idx].m_position; } diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index b492ca3877c..88e1846ab2d 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -3205,6 +3205,15 @@ inline JPABaseEmitter* dComIfGp_particle_getEmitter(u32 param_0) { return g_dComIfG_gameInfo.play.getParticle()->getEmitter(param_0); } +inline u32 dComIfGp_particle_setSimpleFoot(u32 param_0, u32* param_1, cBgS_PolyInfo& param_2, + cXyz const* param_3, dKy_tevstr_c const* param_4, int param_5, + csXyz const* param_6, cXyz const* param_7, + dPa_levelEcallBack* param_8, s8 param_9, + cXyz const* param_10) { + return g_dComIfG_gameInfo.play.getParticle()->setSimpleFoot(param_0, param_1, param_2, param_3, param_4, param_5, + param_6, param_7, param_8, param_9, param_10); +} + inline u32 dComIfGp_particle_setPolyColor(u32 param_0, u16 param_1, cBgS_PolyInfo& param_2, const cXyz* param_3, const dKy_tevstr_c* param_4, const csXyz* param_5, const cXyz* param_6, int param_7, diff --git a/include/d/d_camera.h b/include/d/d_camera.h index f4e909853af..08c4fe73963 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -368,7 +368,10 @@ public: /* 0x0A8 */ int field_0xa8; /* 0x0AC */ u32 field_0xac; /* 0x0B0 */ dCamInfo_c field_0xb0; - /* 0x0D0 */ dCamInfo_c field_0xd0[2]; + /* 0x0D0 */ u8 field_0xd0[0x8]; + /* 0x0D8 */ cXyz field_0xd8; + /* 0x0E4 */ u8 field_0xe4[0xc]; + /* 0x0F0 */ dCamInfo_c field_0xf0; class { public: /* 0x00 */ int field_0x0; diff --git a/include/d/d_path.h b/include/d/d_path.h index 7385af7afab..e7f58a88cd6 100644 --- a/include/d/d_path.h +++ b/include/d/d_path.h @@ -18,5 +18,6 @@ inline int dPath_ChkClose(dPath* i_path) { return (i_path->m_closed & 1); } dPath* dPath_GetRoomPath(int path_index, int room_no); dStage_dPnt_c* dPath_GetPnt(dPath const* path, int pnt_index); +u8 dPath_GetPolyRoomPathVec(cBgS_PolyInfo const& poly, cXyz* p_pathVec, int* param_2); #endif /* D_D_PATH_H */ diff --git a/include/d/particle/d_particle.h b/include/d/particle/d_particle.h index 8a7737559c2..94fd475066f 100644 --- a/include/d/particle/d_particle.h +++ b/include/d/particle/d_particle.h @@ -319,7 +319,7 @@ public: _GXColor const&, int, f32); /* 8004D23C */ void getSimple(u16); /* 8004D770 */ void setStopContinue(u32); - /* 8004D7C4 */ void setSimpleFoot(u32, u32*, cBgS_PolyInfo&, cXyz const*, dKy_tevstr_c const*, + /* 8004D7C4 */ u32 setSimpleFoot(u32, u32*, cBgS_PolyInfo&, cXyz const*, dKy_tevstr_c const*, int, csXyz const*, cXyz const*, dPa_levelEcallBack*, s8, cXyz const*); /* 8004D988 */ void setCommonPoly(u32*, cBgS_PolyInfo*, cXyz const*, cXyz const*, diff --git a/include/d/save/d_save_temp_bit_labels.inc b/include/d/save/d_save_temp_bit_labels.inc index 021b8218bd1..13aeaba7b30 100644 --- a/include/d/save/d_save_temp_bit_labels.inc +++ b/include/d/save/d_save_temp_bit_labels.inc @@ -98,7 +98,7 @@ T_0029 = 0x0380, // Ordon Village - Succeed at T_0030 = 0x0340, // Ordon Village - Rusl, Press button to "take" T_0031 = 0x0320, // Ordon Village - Borrow Rusl's sword T_0032 = 0x0310, // Ordon Village - Return Rusl's sword -T_0033 = 0x0308, // Ordon Village - Press A and ↑ during rampaging goat game +T_0033 = 0x0308, // Ordon Village - Press A and up during rampaging goat game T_0034 = 0x0304, // Ordon Village - Rusl sword failure count 1 T_0035 = 0x0302, // Ordon Village - Rusl sword failure count 2 T_0036 = 0x0301, // Ordon Village - Rusl sword failure count 3 diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index c092479b163..cc38fa72db8 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -117,7 +117,7 @@ public: /* 0x10C */ dKy_tevstr_c mTevStr; /* 0x494 */ u16 mSetID; /* 0x496 */ u8 mGroup; - /* 0x497 */ u8 mCullType; + /* 0x497 */ s8 mCullType; /* 0x498 */ u8 mDemoActorId; /* 0x499 */ s8 mSubtype; /* 0x49A */ u8 mCarryType; diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index d1636034f2d..239d8e737a2 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -537,7 +537,7 @@ s32 fopAcM_otoCheck(const fopAc_ac_c*, f32); s32 fopAcM_otherBgCheck(const fopAc_ac_c*, const fopAc_ac_c*); s32 fopAcM_wayBgCheck(const fopAc_ac_c*, f32, f32); s32 fopAcM_plAngleCheck(const fopAc_ac_c*, s16); -s32 fopAcM_effSmokeSet1(u32*, u32*, const cXyz*, const csXyz*, f32, const dKy_tevstr_c*, int); +void fopAcM_effSmokeSet1(u32*, u32*, const cXyz*, const csXyz*, f32, const dKy_tevstr_c*, int); void fopAcM_effHamonSet(u32*, const cXyz*, f32, f32); s32 fopAcM_riverStream(cXyz*, s16*, f32*, f32); s32 fopAcM_carryOffRevise(fopAc_ac_c*); diff --git a/include/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.h b/include/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.h index d2c259e40ac..88c3bf2b143 100644 --- a/include/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.h +++ b/include/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.h @@ -11,17 +11,38 @@ public: return mPriority; } + static daTagStream_c* getTop() { + return m_top; + } + + daTagStream_c* getNext() { + return mNext; + } + + u8 checkStreamOn() { + return mStreamOn; + } + + s32 checkCanoeOn() { + return mParameters; + } + + u8 getPower() { + return mPower; + } + /* 80D638F8 */ int create(); /* 80D63A98 */ ~daTagStream_c(); /* 80D63B58 */ int execute(); + int checkArea(cXyz const*); /* 0x568 */ u8 mPriority; - /* 0x569 */ u8 field_0x569; - /* 0x56A */ u8 field_0x56a; + /* 0x569 */ u8 mStreamOn; + /* 0x56A */ u8 mPower; /* 0x56B */ u8 field_0x56b; - /* 0x56C */ u32 mParameters; + /* 0x56C */ s32 mParameters; /* 0x570 */ daTagStream_c* field_0x570; - /* 0x574 */ daTagStream_c* field_0x574; + /* 0x574 */ daTagStream_c* mNext; static daTagStream_c* m_top; }; diff --git a/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.cpp b/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.cpp index e52d5343222..995b4ecf029 100644 --- a/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.cpp +++ b/rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.cpp @@ -14,7 +14,7 @@ int daTagStream_c::create() { } mPriority = fopAcM_GetParam(this) >> 8; - field_0x56a = fopAcM_GetParam(this); + mPower = fopAcM_GetParam(this); field_0x56b = fopAcM_GetParam(this) >> 16; fopAcM_GetParam(this) >> 24 != 0 ? mParameters = 0 : mParameters = 1; @@ -27,7 +27,7 @@ int daTagStream_c::create() { daTagStream_c* top = m_top; daTagStream_c* top_loop = m_top; - for (; top; top = top->field_0x574) { + for (; top; top = top->mNext) { if (top->getPriority() > this->getPriority()) { break; } @@ -35,16 +35,16 @@ int daTagStream_c::create() { } if (top_loop == top) { - field_0x574 = m_top; + mNext = m_top; m_top->field_0x570 = this; m_top = this; } else { - top_loop->field_0x574 = this; + top_loop->mNext = this; field_0x570 = top_loop; if (top) { top->field_0x570 = this; - field_0x574 = top; + mNext = top; } } } else { @@ -69,15 +69,15 @@ static int daTagStream_Create(fopAc_ac_c* i_this) { /* 80D63A98-80D63B30 000218 0098+00 1/1 0/0 0/0 .text __dt__13daTagStream_cFv */ daTagStream_c::~daTagStream_c() { if (field_0x570) { - field_0x570->field_0x574 = field_0x574; + field_0x570->mNext = mNext; } - if (field_0x574) { - field_0x574->field_0x570 = field_0x570; + if (mNext) { + mNext->field_0x570 = field_0x570; } if (m_top == this) { - m_top = field_0x574; + m_top = mNext; } }; @@ -90,9 +90,9 @@ static int daTagStream_Delete(daTagStream_c* i_this) { /* 80D63B58-80D63BC0 0002D8 0068+00 1/1 0/0 0/0 .text execute__13daTagStream_cFv */ int daTagStream_c::execute() { if (field_0x56b == 0xFF || i_fopAcM_isSwitch(this,field_0x56b)) { - field_0x569 = 1; + mStreamOn = 1; } else { - field_0x569 = 0; + mStreamOn = 0; } return 1; diff --git a/src/d/d_path.cpp b/src/d/d_path.cpp index 49693106a3b..86170139434 100644 --- a/src/d/d_path.cpp +++ b/src/d/d_path.cpp @@ -67,7 +67,7 @@ dPath* dPath_GetNextRoomPath(dPath const* p_path, int room_no) { /* 8005195C-80051AC0 04C29C 0164+00 0/0 1/1 4/4 .text * dPath_GetPolyRoomPathVec__FRC13cBgS_PolyInfoP4cXyzPi */ -int dPath_GetPolyRoomPathVec(cBgS_PolyInfo const& poly, cXyz* p_pathVec, int* param_2) { +u8 dPath_GetPolyRoomPathVec(cBgS_PolyInfo const& poly, cXyz* p_pathVec, int* param_2) { int roomId = dComIfG_Bgsp().GetRoomId(poly); int roomPathId = dComIfG_Bgsp().GetRoomPathId(poly); diff --git a/src/d/particle/d_particle.cpp b/src/d/particle/d_particle.cpp index 349f823e042..377212c2fec 100644 --- a/src/d/particle/d_particle.cpp +++ b/src/d/particle/d_particle.cpp @@ -1970,7 +1970,7 @@ asm void dPa_control_c::setStopContinue(u32 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dPa_control_c::setSimpleFoot(u32 param_0, u32* param_1, cBgS_PolyInfo& param_2, +asm u32 dPa_control_c::setSimpleFoot(u32 param_0, u32* param_1, cBgS_PolyInfo& param_2, cXyz const* param_3, dKy_tevstr_c const* param_4, int param_5, csXyz const* param_6, cXyz const* param_7, dPa_levelEcallBack* param_8, s8 param_9, diff --git a/src/d/shop/d_shop_system.cpp b/src/d/shop/d_shop_system.cpp index a67363b9cd9..a1ed67aae8b 100644 --- a/src/d/shop/d_shop_system.cpp +++ b/src/d/shop/d_shop_system.cpp @@ -267,14 +267,29 @@ SECTION_SDATA static fopAc_ac_c* dShopSystem_cameraActor[2] = {NULL, NULL}; static int dShopSystem_camera_count; /* 80197270-80197338 191BB0 00C8+00 1/1 0/0 0/0 .text dShopSystem_searchCameraActor__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dShopSystem_searchCameraActor(void* param_0, void* param_1) { - nofralloc -#include "asm/d/shop/d_shop_system/dShopSystem_searchCameraActor__FPvPv.s" +static int dShopSystem_searchCameraActor(void* param_0, void* param_1) { + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_TAG_SHOPCAM) { + if ((fopAcM_GetParam(param_1) & 0xf0000000) == (fopAcM_GetParam(param_0) & 0xf0000000) && dShopSystem_camera_count < 2) { + switch (fopAcM_GetParam(param_0) & 0xf) { + case 0: + if (dShopSystem_cameraActor[0] == NULL) { + dShopSystem_cameraActor[0] = (fopAc_ac_c*)param_0; + dShopSystem_camera_count++; + } + break; + case 1: + if (dShopSystem_cameraActor[1] == NULL) { + dShopSystem_cameraActor[1] = (fopAc_ac_c*)param_0; + dShopSystem_camera_count++; + } + break; + default: + break; + } + } + } + return 0; } -#pragma pop /* ############################################################################################## */ /* 80453B00-80453B04 002100 0004+00 1/1 0/0 0/0 .sdata2 @4097 */ diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index b3b9d309eb6..81347de663d 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -11,16 +11,20 @@ #include "MSL_C/math.h" #include "SSystem/SComponent/c_lib.h" #include "SSystem/SComponent/c_malloc.h" -#include "SSystem/SComponent/c_math.h" +#include "dol2asm.h" +#include "global.h" #include "d/com/d_com_inf_game.h" +#include "JSystem/JMath/JMath.h" +#include "SSystem/SComponent/c_math.h" #include "d/d_procname.h" #include "d/d_stage.h" -#include "dol2asm.h" #include "f_op/f_op_actor.h" #include "global.h" #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_lib.h" #include "m_Do/m_Do_mtx.h" +#include "rel/d/a/tag/d_a_tag_stream/d_a_tag_stream.h" +#include "d/d_path.h" // // Types: @@ -30,12 +34,6 @@ struct l_HIO { /* 8001E098 */ ~l_HIO(); }; -struct daTagStream_c { - /* 800318B4 */ void checkArea(cXyz const*); - - static u8 m_top[4]; -}; - class dEnemyItem_c { public: static u8* mData; @@ -797,31 +795,25 @@ SECTION_SDATA2 static u8 lit_4645[4] = { 0x00, }; -inline f32 JMAFastSqrt__Ff(f32 f) { - if (f > /* 0.0f */ FLOAT_LABEL(lit_4645)) { - f *= __frsqrte(f); // generates a useless frsp - } - return f; -} - inline f32 square(f32 f) { return f * f; } /* 8001A738-8001A79C 015078 0064+00 0/0 0/0 13/13 .text * fopAcM_searchActorAngleX__FPC10fopAc_ac_cPC10fopAc_ac_c */ +// matches with literals #ifdef NONMATCHING s16 fopAcM_searchActorAngleX(const fopAc_ac_c* i_actorA, const fopAc_ac_c* i_actorB) { const cXyz& posA = fopAcM_GetPosition_p(i_actorA); const cXyz& posB = fopAcM_GetPosition_p(i_actorB); return cM_atan2s(posB.y - posA.y, - JMAFastSqrt__Ff(square(posB.x - posA.x) + square(posB.z - posA.z))); + JMAFastSqrt(square(posB.x - posA.x) + square(posB.z - posA.z))); } #else #pragma push #pragma optimization_level 0 -#pragma optimizewithasm off -asm s16 fopAcM_searchActorAngleX(const fopAc_ac_c* i_actorA, const fopAc_ac_c* i_actorB) { +#pragma optimizewithasm off +asm s16 fopAcM_searchActorAngleX(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB) { nofralloc #include "asm/f_op/f_op_actor_mng/fopAcM_searchActorAngleX__FPC10fopAc_ac_cPC10fopAc_ac_c.s" } @@ -1187,8 +1179,6 @@ s32 fopAcM_orderTalkItemBtnEvent(u16 eventType, fopAc_ac_c* actorA, fopAc_ac_c* /* 8001B19C-8001B244 015ADC 00A8+00 0/0 3/3 16/16 .text fopAcM_orderSpeakEvent__FP10fopAc_ac_cUsUs */ -// wrong load order -#ifdef NONMATCHING s32 fopAcM_orderSpeakEvent(fopAc_ac_c* actor, u16 priority, u16 flag) { if (!i_dComIfGp_getEvent().i_isOrderOK() && (!(flag & 0x400) || !i_dComIfGp_getEvent().isChangeOK(actor))) @@ -1203,16 +1193,6 @@ s32 fopAcM_orderSpeakEvent(fopAc_ac_c* actor, u16 priority, u16 flag) { return dComIfGp_event_order(EVT_TYPE_TALK, priority, flag, 0x14F, dComIfGp_getPlayer(0), actor, -1, -1); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm s32 fopAcM_orderSpeakEvent(fopAc_ac_c* param_0, u16 param_1, u16 param_2) { - nofralloc -#include "asm/f_op/f_op_actor_mng/fopAcM_orderSpeakEvent__FP10fopAc_ac_cUsUs.s" -} -#pragma pop -#endif /* 8001B244-8001B334 015B84 00F0+00 0/0 2/2 0/0 .text * fopAcM_orderDoorEvent__FP10fopAc_ac_cP10fopAc_ac_cUsUs */ @@ -1420,8 +1400,6 @@ s32 fopAcM_orderPotentialEvent(fopAc_ac_c* actor, u16 flag, u16 param_2, u16 pri /* 8001B9D0-8001BA7C 016310 00AC+00 0/0 3/3 12/12 .text fopAcM_orderItemEvent__FP10fopAc_ac_cUsUs */ -// load order -#ifdef NONMATCHING s32 fopAcM_orderItemEvent(fopAc_ac_c* actor, u16 priority, u16 flag) { if (!i_dComIfGp_getEvent().i_isOrderOK() && (!(flag & 0x400) || !i_dComIfGp_getEvent().isChangeOK(actor))) @@ -1436,16 +1414,6 @@ s32 fopAcM_orderItemEvent(fopAc_ac_c* actor, u16 priority, u16 flag) { return dComIfGp_event_order(EVT_TYPE_ITEM, priority, flag, -1, dComIfGp_getPlayer(0), actor, -1, -1); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm s32 fopAcM_orderItemEvent(fopAc_ac_c* param_0, u16 param_1, u16 param_2) { - nofralloc -#include "asm/f_op/f_op_actor_mng/fopAcM_orderItemEvent__FP10fopAc_ac_cUsUs.s" -} -#pragma pop -#endif /* 8001BA7C-8001BB14 0163BC 0098+00 0/0 1/1 0/0 .text * fopAcM_orderTreasureEvent__FP10fopAc_ac_cP10fopAc_ac_cUsUs */ @@ -1951,7 +1919,6 @@ void* enemySearchJugge(void* i_actor, void* i_data) { } /* 8001CA1C-8001CAD8 01735C 00BC+00 0/0 0/0 6/6 .text fopAcM_myRoomSearchEnemy__FSc */ -#ifdef NONMATCHING fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 i_roomNo) { int procID = dStage_roomControl_c::getStatusProcID(i_roomNo); scene_class* roomProc = fopScnM_SearchByID(procID); @@ -1959,22 +1926,12 @@ fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 i_roomNo) { u32 actorID = ((daPy_py_c*)dComIfGp_getPlayer(0))->getGrabActorID(); fopAc_ac_c* actor = fopAcM_SearchByID(actorID); - if (actor != NULL && fopAcM_GetGroup(actor) != 2) { - return; + if (actor != NULL && fopAcM_GetGroup(actor) == 2) { + return actor; } - fpcM_JudgeInLayer(fpcM_LayerID(roomProc), enemySearchJugge, NULL); + return (fopAc_ac_c*) fpcM_JudgeInLayer(fpcM_LayerID(roomProc), enemySearchJugge, NULL); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 param_0) { - nofralloc -#include "asm/f_op/f_op_actor_mng/fopAcM_myRoomSearchEnemy__FSc.s" -} -#pragma pop -#endif /* 8001CAD8-8001CB48 017418 0070+00 0/0 0/0 81/81 .text * fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc */ @@ -2166,15 +2123,23 @@ f32 fopAcM_gc_c::mGroundY; /* 8001D020-8001D10C 017960 00EC+00 0/0 0/0 96/96 .text * fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm s32 fopAcM_effSmokeSet1(u32* param_0, u32* param_1, cXyz const* param_2, csXyz const* param_3, - f32 param_4, dKy_tevstr_c const* param_5, int param_6) { - nofralloc -#include "asm/f_op/f_op_actor_mng/fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci.s" +void fopAcM_effSmokeSet1(u32* param_0, u32* param_1, cXyz const* param_2, csXyz const* param_3, + f32 param_4, dKy_tevstr_c const* param_5, int param_6) { + cXyz p2; + float z = param_2->z; + float y = FLOAT_LABEL(lit_6035) + param_2->y; + p2.x = param_2->x; + p2.y = y; + p2.z = z; + if (fopAcM_gc_c::gndCheck(&p2)) { + p2.y = fopAcM_gc_c::getGroundY(); + cXyz stack_18; + stack_18.x = param_4; + stack_18.y = param_4; + stack_18.z = param_4; + *param_0 = dComIfGp_particle_setSimpleFoot(*param_0, param_1, *fopAcM_gc_c::getGroundCheck(), &p2, param_5, param_6, param_3, &stack_18, NULL, 0xff, NULL); + } } -#pragma pop /* ############################################################################################## */ /* 80451C50-80451C54 000250 0004+00 1/1 0/0 0/0 .sdata2 hamon_name$6107 */ @@ -2284,6 +2249,43 @@ COMPILER_STRIP_GATE(0x80378898, &mtx_adj); /* 8001D42C-8001D5A4 017D6C 0178+00 0/0 3/3 40/40 .text * fopAcM_setEffectMtx__FPC10fopAc_ac_cPC12J3DModelData */ +// matches with literals +#ifdef NONMATCHING +void fopAcM_setEffectMtx(const fopAc_ac_c* i_actor, const J3DModelData* modelData) { + const cXyz* pEyePos = &i_actor->mEyePos; + dCamera_c* camera = dCam_getCamera(); + cXyz v1 = *pEyePos - camera->field_0xd8; + cXyz v2; + get_vectle_calc(&i_actor->mTevStr.field_0x32c, pEyePos, &v2); + Vec half; + C_VECHalfAngle(&v1, &v2, &half); + Mtx mtx; + C_MTXLookAt(mtx, &cXyz::Zero, &cXyz::BaseY, &half); + mDoMtx_stack_c::scaleS(1.0, 1.0, 1.0); + mDoMtx_stack_c::concat(mtx_adj); + mDoMtx_stack_c::concat(mtx); + MtxP currentMtx = mDoMtx_stack_c::get(); + currentMtx[0][3] = 0.0; + currentMtx[1][3] = 0.0; + currentMtx[2][3] = 0.0; + + Mtx mtx2; + mDoMtx_copy(currentMtx, mtx2); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { + J3DMaterial* material = modelData->getMaterialNodePointer(i); + for (u32 j = 0; j < 8; j++) { + J3DTexMtx* texMtx = material->getTexMtx(j); + if (texMtx != NULL) { + switch (texMtx->getTexMtxInfo().mInfo) { + case 6: + texMtx->setEffectMtx(mtx2); + break; + } + } + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2292,6 +2294,7 @@ asm void fopAcM_setEffectMtx(fopAc_ac_c const* param_0, J3DModelData const* para #include "asm/f_op/f_op_actor_mng/fopAcM_setEffectMtx__FPC10fopAc_ac_cPC12J3DModelData.s" } #pragma pop +#endif /* 8001D5A4-8001D5EC 017EE4 0048+00 1/1 0/0 0/0 .text fopAcM_getProcNameString__FPC10fopAc_ac_c */ static const char* fopAcM_getProcNameString(const fopAc_ac_c* i_actor) { @@ -2352,7 +2355,6 @@ fopAc_ac_c* fopAcM_findObject4EventCB(fopAc_ac_c* i_actor, void* i_data) { /* 8001D7A0-8001D890 0180E0 00F0+00 0/0 7/7 0/0 .text fopAcM_searchFromName4Event__FPCcs */ -#ifdef NONMATCHING fopAc_ac_c* fopAcM_searchFromName4Event(char const* name, s16 eventID) { fopAcM_search4ev_prm prm; prm.mEventID = eventID; @@ -2369,7 +2371,7 @@ fopAc_ac_c* fopAcM_searchFromName4Event(char const* name, s16 eventID) { prm.mEventID = 0xFFFF; break; } - prm.mEventID += chr[0] - 0x30; // ? + prm.mEventID = prm.mEventID * 10 + (chr[0] - 0x30); } } @@ -2382,16 +2384,6 @@ fopAc_ac_c* fopAcM_searchFromName4Event(char const* name, s16 eventID) { prm.mSubType = objInf->mSubtype; return fopAcM_Search((fopAcIt_JudgeFunc)fopAcM_findObject4EventCB, &prm); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm fopAc_ac_c* fopAcM_searchFromName4Event(char const* name, s16 eventID) { - nofralloc -#include "asm/f_op/f_op_actor_mng/fopAcM_searchFromName4Event__FPCcs.s" -} -#pragma pop -#endif /* ############################################################################################## */ /* 803F1D18-803F1D24 01EA38 000C+00 0/1 0/0 0/0 .bss @6509 */ @@ -2444,15 +2436,37 @@ void fpoAcM_relativePos(fopAc_ac_c const* actor, cXyz const* p_inPos, cXyz* p_ou /* 8001D9A8-8001DAE4 0182E8 013C+00 0/0 1/1 9/9 .text * fopAcM_getWaterStream__FPC4cXyzRC13cBgS_PolyInfoP4cXyzPii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm s32 fopAcM_getWaterStream(cXyz const* param_0, cBgS_PolyInfo const& param_1, cXyz* param_2, - int* param_3, int param_4) { - nofralloc -#include "asm/f_op/f_op_actor_mng/fopAcM_getWaterStream__FPC4cXyzRC13cBgS_PolyInfoP4cXyzPii.s" +s32 fopAcM_getWaterStream(cXyz const* param_0, cBgS_PolyInfo const& param_1, cXyz* speed, + int* param_3, int param_4) { + daTagStream_c* stream = daTagStream_c::getTop(); + if (stream != NULL) { + for (stream = daTagStream_c::getTop(); stream != NULL; stream = stream->getNext()) { + if (stream->checkStreamOn() && + (param_4 == 0 || stream->checkCanoeOn()) && + stream->checkArea(param_0)) { + *speed = stream->speed; + *param_3 = stream->getPower() & 0xff; + return 1; + } + } + } + + if (param_4) { + return 0; + } + + if (dComIfG_Bgsp().ChkPolySafe(param_1)) { + if (dPath_GetPolyRoomPathVec(param_1, speed, param_3)) { + speed->normalizeZP(); + return 1; + } + } else { + *speed = cXyz::Zero; + *param_3 = 0; + } + + return 0; } -#pragma pop /* ############################################################################################## */ /* 803A37C0-803A37CC 0008E0 000C+00 2/2 93/93 0/0 .data __vt__8cM3dGPla */ @@ -2500,7 +2514,7 @@ extern "C" asm void __dt__8cM3dGPlaFv() { #pragma pop /* 8001DBD8-8001DC68 018518 0090+00 1/1 5/5 18/18 .text fopAcM_getPolygonAngle__FPC8cM3dGPlas */ -// sqrt issues +// matches with literals #ifdef NONMATCHING s16 fopAcM_getPolygonAngle(cM3dGPla const* p_plane, s16 param_1) { if (p_plane == NULL) { @@ -2509,7 +2523,9 @@ s16 fopAcM_getPolygonAngle(cM3dGPla const* p_plane, s16 param_1) { s16 atan = p_plane->mNormal.atan2sX_Z() - param_1; f32 cos = cM_scos(atan); - f32 sqrt = JMAFastSqrt__Ff(square(p_plane->mNormal.x) + square(p_plane->mNormal.z)); + f32 x2 = square(p_plane->mNormal.x); + f32 z2 = square(p_plane->mNormal.z); + f32 sqrt = JMAFastSqrt(x2 + z2); return cM_atan2s(sqrt * cos, p_plane->mNormal.y); } #else diff --git a/tools/decompctx.py b/tools/decompctx.py index ba22ef47961..2e2aa3b8c1d 100755 --- a/tools/decompctx.py +++ b/tools/decompctx.py @@ -14,7 +14,7 @@ guard_pattern = re.compile(r'^#ifndef\s+(.*)$') defines = set() -def import_h_file(in_file, r_path) -> str: +def import_h_file(in_file: str, r_path: str) -> str: rel_path = os.path.join(root_dir, r_path, in_file) inc_path = os.path.join(include_dir, in_file) if os.path.exists(rel_path): @@ -29,22 +29,31 @@ def import_c_file(in_file) -> str: in_file = os.path.relpath(in_file, root_dir) out_text = '' - with open(in_file, encoding="shift-jis") as file: - for idx, line in enumerate(file): - guard_match = guard_pattern.match(line.strip()) - if idx == 0: - if guard_match: - if guard_match[1] in defines: - break - defines.add(guard_match[1]) - print("Processing file", in_file) - include_match = include_pattern.match(line.strip()) - if include_match and not include_match[1].endswith(".s"): - out_text += f"/* \"{in_file}\" line {idx} \"{include_match[1]}\" */\n" - out_text += import_h_file(include_match[1], os.path.dirname(in_file)) - out_text += f"/* end \"{include_match[1]}\" */\n" - else: - out_text += line + try: + with open(in_file, encoding="shift-jis") as file: + out_text += process_file(in_file, list(file)) + except Exception: + with open(in_file) as file: + out_text += process_file(in_file, list(file)) + return out_text + +def process_file(in_file: str, lines) -> str: + out_text = '' + for idx, line in enumerate(lines): + guard_match = guard_pattern.match(line.strip()) + if idx == 0: + if guard_match: + if guard_match[1] in defines: + break + defines.add(guard_match[1]) + print("Processing file", in_file) + include_match = include_pattern.match(line.strip()) + if include_match and not include_match[1].endswith(".s"): + out_text += f"/* \"{in_file}\" line {idx} \"{include_match[1]}\" */\n" + out_text += import_h_file(include_match[1], os.path.dirname(in_file)) + out_text += f"/* end \"{include_match[1]}\" */\n" + else: + out_text += line return out_text @@ -60,7 +69,7 @@ def main(): output = import_c_file(args.c_file) - with open(os.path.join(root_dir, "ctx.c"), "w", encoding="shift-jis") as f: + with open(os.path.join(root_dir, "ctx.c"), "w", encoding="utf-8") as f: f.write(output)