From 57a1d21be8f010f995afd5c60a57841e5dbedb67 Mon Sep 17 00:00:00 2001 From: Caroline Madsen <69010899+randomsalience@users.noreply.github.com> Date: Sun, 30 Jun 2024 08:28:55 -0400 Subject: [PATCH] d_a_npc_zrz mostly done (#2168) Co-authored-by: hatal175 --- Progress.md | 4 +- .../d_a_npc/hitChk2__8daNpcF_cFP8dCcD_Cylii.s | 61 - ...dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf.s | 18 - .../d_a_npc_zrz/Delete__11daNpc_zrZ_cFv.s | 14 - .../d_a_npc_zrz/Execute__11daNpc_zrZ_cFv.s | 9 - ...__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s | 12 - ...eapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c.s | 9 - ...JointCallBack__11daNpc_zrZ_cFP8J3DJointi.s | 21 - .../d_a_npc_zrz/daNpc_zrZ_Create__FPv.s | 9 - .../d_a_npc_zrz/daNpc_zrZ_Delete__FPv.s | 9 - .../d_a_npc_zrz/daNpc_zrZ_Draw__FPv.s | 9 - .../d_a_npc_zrz/daNpc_zrZ_Execute__FPv.s | 9 - .../doNormalAction__11daNpc_zrZ_cFi.s | 76 - .../getTypeFromParam__11daNpc_zrZ_cFv.s | 18 - .../d_a_npc_zrz/isDelete__11daNpc_zrZ_cFv.s | 51 - .../d_a_npc_zrz/s_subCloth__FPvPv.s | 22 - .../d_a_npc_zrz/s_subRock__FPvPv.s | 22 - .../d_a_npc_zrz/d_a_npc_zrz/s_sub__FPvPv.s | 22 - ...__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s | 45 - .../setExpression__11daNpc_zrZ_cFif.s | 12 - .../setLookMode__11daNpc_zrZ_cFi.s | 10 - .../setMotion__11daNpc_zrZ_cFifi.s | 19 - .../d_a_npc_zrz/setMtx__11daNpc_zrZ_cFv.s | 48 - .../d_a_npc_zrz/setParam__11daNpc_zrZ_cFv.s | 105 - .../setSkipZev__11daNpc_zrZ_cFii.s | 38 - include/d/a/d_a_npc.h | 16 +- include/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.h | 18 +- include/rel/d/a/npc/d_a_npc_the/d_a_npc_the.h | 2 +- include/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.h | 2 +- include/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.h | 217 +- .../d_a_obj_grave_stone/d_a_obj_grave_stone.h | 2 + .../a/obj/d_a_obj_zra_rock/d_a_obj_zra_rock.h | 2 + rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.cpp | 39 +- rel/d/a/npc/d_a_npc_the/d_a_npc_the.cpp | 19 +- rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.cpp | 137 +- rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.cpp | 2721 +++++++++++++++-- src/d/a/d_a_npc.cpp | 116 +- 37 files changed, 2836 insertions(+), 1127 deletions(-) delete mode 100644 asm/d/a/d_a_npc/hitChk2__8daNpcF_cFP8dCcD_Cylii.s delete mode 100644 asm/d/a/d_a_npc/tgHitCallBack__8daNpcF_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Delete__11daNpc_zrZ_cFv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Execute__11daNpc_zrZ_cFv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/chkAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/createHeapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlJointCallBack__11daNpc_zrZ_cFP8J3DJointi.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Create__FPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Delete__FPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Draw__FPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Execute__FPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/doNormalAction__11daNpc_zrZ_cFi.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/getTypeFromParam__11daNpc_zrZ_cFv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/isDelete__11daNpc_zrZ_cFv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subCloth__FPvPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subRock__FPvPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_sub__FPvPv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpression__11daNpc_zrZ_cFif.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setLookMode__11daNpc_zrZ_cFi.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMotion__11daNpc_zrZ_cFifi.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMtx__11daNpc_zrZ_cFv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setParam__11daNpc_zrZ_cFv.s delete mode 100644 asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setSkipZev__11daNpc_zrZ_cFii.s diff --git a/Progress.md b/Progress.md index 4b6359599ef..e46ef30f847 100644 --- a/Progress.md +++ b/Progress.md @@ -338,7 +338,7 @@ d_a_npc_zelRo | 37.784656% | 6836 | 18092 d_a_npc_zelda | 37.603569% | 7080 | 18828 d_a_npc_zra | 27.520869% | 29804 | 108296 d_a_npc_zrc | 32.120762% | 10384 | 32328 -d_a_npc_zrz | 31.977232% | 13708 | 42868 +d_a_npc_zrz | 36.950639% | 15840 | 42868 d_a_obj_Lv5Key | 37.172105% | 2324 | 6252 d_a_obj_Turara | 38.494412% | 4684 | 12168 d_a_obj_TvCdlst | 43.547170% | 2308 | 5300 @@ -785,4 +785,4 @@ d_a_vrbox2 | 44.907111% | 2804 | 6244 d_a_warp_bug | 100.000000% | 2024 | 2024 d_a_ykgr | 44.400631% | 2252 | 5072 f_pc_profile_lst | 100.000000% | 28156 | 28156 -Total | 38.860853% | 4469124 | 11500324 +Total | 38.879392% | 4471256 | 11500324 diff --git a/asm/d/a/d_a_npc/hitChk2__8daNpcF_cFP8dCcD_Cylii.s b/asm/d/a/d_a_npc/hitChk2__8daNpcF_cFP8dCcD_Cylii.s deleted file mode 100644 index 3794eb25739..00000000000 --- a/asm/d/a/d_a_npc/hitChk2__8daNpcF_cFP8dCcD_Cylii.s +++ /dev/null @@ -1,61 +0,0 @@ -lbl_80153578: -/* 80153578 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8015357C 7C 08 02 A6 */ mflr r0 -/* 80153580 90 01 00 24 */ stw r0, 0x24(r1) -/* 80153584 39 61 00 20 */ addi r11, r1, 0x20 -/* 80153588 48 20 EC 4D */ bl _savegpr_27 -/* 8015358C 7C 7B 1B 78 */ mr r27, r3 -/* 80153590 7C 9C 23 78 */ mr r28, r4 -/* 80153594 7C BD 2B 78 */ mr r29, r5 -/* 80153598 7C DE 33 78 */ mr r30, r6 -/* 8015359C 80 64 00 44 */ lwz r3, 0x44(r4) -/* 801535A0 38 63 00 1C */ addi r3, r3, 0x1c -/* 801535A4 4B F3 02 8D */ bl Move__10dCcD_GSttsFv -/* 801535A8 80 1B 09 54 */ lwz r0, 0x954(r27) -/* 801535AC 2C 00 00 00 */ cmpwi r0, 0 -/* 801535B0 40 82 00 78 */ bne lbl_80153628 -/* 801535B4 7F 83 E3 78 */ mr r3, r28 -/* 801535B8 4B F3 0E A9 */ bl ChkTgHit__12dCcD_GObjInfFv -/* 801535BC 28 03 00 00 */ cmplwi r3, 0 -/* 801535C0 41 82 00 68 */ beq lbl_80153628 -/* 801535C4 38 7C 00 9C */ addi r3, r28, 0x9c -/* 801535C8 4B F3 00 C1 */ bl GetAc__22dCcD_GAtTgCoCommonBaseFv -/* 801535CC 7C 7F 1B 79 */ or. r31, r3, r3 -/* 801535D0 41 82 00 58 */ beq lbl_80153628 -/* 801535D4 7F 63 DB 78 */ mr r3, r27 -/* 801535D8 7F E4 FB 78 */ mr r4, r31 -/* 801535DC 4B EC 71 35 */ bl fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c -/* 801535E0 A8 1B 08 F2 */ lha r0, 0x8f2(r27) -/* 801535E4 7C 00 18 50 */ subf r0, r0, r3 -/* 801535E8 B0 1B 09 90 */ sth r0, 0x990(r27) -/* 801535EC A8 1F 00 08 */ lha r0, 8(r31) -/* 801535F0 2C 00 01 00 */ cmpwi r0, 0x100 -/* 801535F4 40 82 00 28 */ bne lbl_8015361C -/* 801535F8 2C 1D 00 00 */ cmpwi r29, 0 -/* 801535FC 41 82 00 18 */ beq lbl_80153614 -/* 80153600 A0 1F 06 BE */ lhz r0, 0x6be(r31) -/* 80153604 60 00 00 04 */ ori r0, r0, 4 -/* 80153608 B0 1F 06 BE */ sth r0, 0x6be(r31) -/* 8015360C 38 60 00 01 */ li r3, 1 -/* 80153610 48 00 00 30 */ b lbl_80153640 -lbl_80153614: -/* 80153614 38 60 00 00 */ li r3, 0 -/* 80153618 48 00 00 28 */ b lbl_80153640 -lbl_8015361C: -/* 8015361C 30 1E FF FF */ addic r0, r30, -1 -/* 80153620 7C 60 F1 10 */ subfe r3, r0, r30 -/* 80153624 48 00 00 1C */ b lbl_80153640 -lbl_80153628: -/* 80153628 7F 83 E3 78 */ mr r3, r28 -/* 8015362C 81 9C 00 3C */ lwz r12, 0x3c(r28) -/* 80153630 81 8C 00 24 */ lwz r12, 0x24(r12) -/* 80153634 7D 89 03 A6 */ mtctr r12 -/* 80153638 4E 80 04 21 */ bctrl -/* 8015363C 38 60 00 00 */ li r3, 0 -lbl_80153640: -/* 80153640 39 61 00 20 */ addi r11, r1, 0x20 -/* 80153644 48 20 EB DD */ bl _restgpr_27 -/* 80153648 80 01 00 24 */ lwz r0, 0x24(r1) -/* 8015364C 7C 08 03 A6 */ mtlr r0 -/* 80153650 38 21 00 20 */ addi r1, r1, 0x20 -/* 80153654 4E 80 00 20 */ blr diff --git a/asm/d/a/d_a_npc/tgHitCallBack__8daNpcF_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf.s b/asm/d/a/d_a_npc/tgHitCallBack__8daNpcF_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf.s deleted file mode 100644 index e111aacfd36..00000000000 --- a/asm/d/a/d_a_npc/tgHitCallBack__8daNpcF_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf.s +++ /dev/null @@ -1,18 +0,0 @@ -lbl_80152614: -/* 80152614 28 05 00 00 */ cmplwi r5, 0 -/* 80152618 4D 82 00 20 */ beqlr -/* 8015261C A8 05 00 0E */ lha r0, 0xe(r5) -/* 80152620 2C 00 00 FD */ cmpwi r0, 0xfd -/* 80152624 4C 82 00 20 */ bnelr -/* 80152628 3C 80 80 40 */ lis r4, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 8015262C 38 84 61 C0 */ addi r4, r4, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80152630 80 04 5D AC */ lwz r0, 0x5dac(r4) -/* 80152634 7C 00 28 40 */ cmplw r0, r5 -/* 80152638 40 82 00 10 */ bne lbl_80152648 -/* 8015263C 88 05 05 68 */ lbz r0, 0x568(r5) -/* 80152640 90 03 09 30 */ stw r0, 0x930(r3) -/* 80152644 4E 80 00 20 */ blr -lbl_80152648: -/* 80152648 38 00 00 01 */ li r0, 1 -/* 8015264C 90 03 09 30 */ stw r0, 0x930(r3) -/* 80152650 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Delete__11daNpc_zrZ_cFv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Delete__11daNpc_zrZ_cFv.s deleted file mode 100644 index 81b1e748859..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Delete__11daNpc_zrZ_cFv.s +++ /dev/null @@ -1,14 +0,0 @@ -lbl_80B949F4: -/* 80B949F4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B949F8 7C 08 02 A6 */ mflr r0 -/* 80B949FC 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B94A00 38 80 FF FF */ li r4, -1 -/* 80B94A04 81 83 0B 44 */ lwz r12, 0xb44(r3) -/* 80B94A08 81 8C 00 08 */ lwz r12, 8(r12) -/* 80B94A0C 7D 89 03 A6 */ mtctr r12 -/* 80B94A10 4E 80 04 21 */ bctrl -/* 80B94A14 38 60 00 01 */ li r3, 1 -/* 80B94A18 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B94A1C 7C 08 03 A6 */ mtlr r0 -/* 80B94A20 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B94A24 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Execute__11daNpc_zrZ_cFv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Execute__11daNpc_zrZ_cFv.s deleted file mode 100644 index 51c1dd187dd..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Execute__11daNpc_zrZ_cFv.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80B94A28: -/* 80B94A28 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B94A2C 7C 08 02 A6 */ mflr r0 -/* 80B94A30 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B94A34 4B 5B D5 E1 */ bl execute__8daNpcF_cFv -/* 80B94A38 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B94A3C 7C 08 03 A6 */ mtlr r0 -/* 80B94A40 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B94A44 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/chkAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/chkAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s deleted file mode 100644 index ce7bad7c4da..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/chkAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s +++ /dev/null @@ -1,12 +0,0 @@ -lbl_80B96740: -/* 80B96740 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B96744 7C 08 02 A6 */ mflr r0 -/* 80B96748 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B9674C 38 63 14 0C */ addi r3, r3, 0x140c -/* 80B96750 4B 7C B8 F9 */ bl __ptmf_cmpr -/* 80B96754 7C 60 00 34 */ cntlzw r0, r3 -/* 80B96758 54 03 D9 7E */ srwi r3, r0, 5 -/* 80B9675C 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B96760 7C 08 03 A6 */ mtlr r0 -/* 80B96764 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B96768 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/createHeapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/createHeapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c.s deleted file mode 100644 index 192f50befc3..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/createHeapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80B950F4: -/* 80B950F4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B950F8 7C 08 02 A6 */ mflr r0 -/* 80B950FC 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B95100 4B FF F4 3D */ bl CreateHeap__11daNpc_zrZ_cFv -/* 80B95104 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B95108 7C 08 03 A6 */ mtlr r0 -/* 80B9510C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B95110 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlJointCallBack__11daNpc_zrZ_cFP8J3DJointi.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlJointCallBack__11daNpc_zrZ_cFP8J3DJointi.s deleted file mode 100644 index 2d5085be09b..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlJointCallBack__11daNpc_zrZ_cFP8J3DJointi.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_80B95114: -/* 80B95114 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B95118 7C 08 02 A6 */ mflr r0 -/* 80B9511C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B95120 7C 60 1B 78 */ mr r0, r3 -/* 80B95124 2C 04 00 00 */ cmpwi r4, 0 -/* 80B95128 40 82 00 24 */ bne lbl_80B9514C -/* 80B9512C 3C 60 80 43 */ lis r3, j3dSys@ha /* 0x80434AC8@ha */ -/* 80B95130 38 63 4A C8 */ addi r3, r3, j3dSys@l /* 0x80434AC8@l */ -/* 80B95134 80 A3 00 38 */ lwz r5, 0x38(r3) -/* 80B95138 80 65 00 14 */ lwz r3, 0x14(r5) -/* 80B9513C 28 03 00 00 */ cmplwi r3, 0 -/* 80B95140 41 82 00 0C */ beq lbl_80B9514C -/* 80B95144 7C 04 03 78 */ mr r4, r0 -/* 80B95148 4B FF FC D1 */ bl ctrlJoint__11daNpc_zrZ_cFP8J3DJointP8J3DModel -lbl_80B9514C: -/* 80B9514C 38 60 00 01 */ li r3, 1 -/* 80B95150 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B95154 7C 08 03 A6 */ mtlr r0 -/* 80B95158 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B9515C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Create__FPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Create__FPv.s deleted file mode 100644 index 815f8256d35..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Create__FPv.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80B9A504: -/* 80B9A504 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B9A508 7C 08 02 A6 */ mflr r0 -/* 80B9A50C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B9A510 4B FF 9D 2D */ bl create__11daNpc_zrZ_cFv -/* 80B9A514 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B9A518 7C 08 03 A6 */ mtlr r0 -/* 80B9A51C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B9A520 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Delete__FPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Delete__FPv.s deleted file mode 100644 index 241bf8645ea..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Delete__FPv.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80B9A524: -/* 80B9A524 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B9A528 7C 08 02 A6 */ mflr r0 -/* 80B9A52C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B9A530 4B FF A4 C5 */ bl Delete__11daNpc_zrZ_cFv -/* 80B9A534 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B9A538 7C 08 03 A6 */ mtlr r0 -/* 80B9A53C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B9A540 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Draw__FPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Draw__FPv.s deleted file mode 100644 index 761fb02d445..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Draw__FPv.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80B9A564: -/* 80B9A564 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B9A568 7C 08 02 A6 */ mflr r0 -/* 80B9A56C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B9A570 4B FF A4 D9 */ bl Draw__11daNpc_zrZ_cFv -/* 80B9A574 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B9A578 7C 08 03 A6 */ mtlr r0 -/* 80B9A57C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B9A580 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Execute__FPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Execute__FPv.s deleted file mode 100644 index c42e1feb709..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Execute__FPv.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80B9A544: -/* 80B9A544 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B9A548 7C 08 02 A6 */ mflr r0 -/* 80B9A54C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B9A550 4B FF A4 D9 */ bl Execute__11daNpc_zrZ_cFv -/* 80B9A554 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B9A558 7C 08 03 A6 */ mtlr r0 -/* 80B9A55C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B9A560 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/doNormalAction__11daNpc_zrZ_cFi.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/doNormalAction__11daNpc_zrZ_cFi.s deleted file mode 100644 index ffda6d01981..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/doNormalAction__11daNpc_zrZ_cFi.s +++ /dev/null @@ -1,76 +0,0 @@ -lbl_80B968E0: -/* 80B968E0 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80B968E4 7C 08 02 A6 */ mflr r0 -/* 80B968E8 90 01 00 24 */ stw r0, 0x24(r1) -/* 80B968EC 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80B968F0 7C 7F 1B 78 */ mr r31, r3 -/* 80B968F4 2C 04 00 00 */ cmpwi r4, 0 -/* 80B968F8 41 82 00 5C */ beq lbl_80B96954 -/* 80B968FC 38 9F 12 C4 */ addi r4, r31, 0x12c4 -/* 80B96900 38 A0 00 01 */ li r5, 1 -/* 80B96904 38 C0 00 00 */ li r6, 0 -/* 80B96908 4B 5B CC 71 */ bl hitChk2__8daNpcF_cFP8dCcD_Cylii -/* 80B9690C 2C 03 00 00 */ cmpwi r3, 0 -/* 80B96910 41 82 00 44 */ beq lbl_80B96954 -/* 80B96914 7F E3 FB 78 */ mr r3, r31 -/* 80B96918 80 1F 09 30 */ lwz r0, 0x930(r31) -/* 80B9691C 2C 00 00 08 */ cmpwi r0, 8 -/* 80B96920 40 82 00 0C */ bne lbl_80B9692C -/* 80B96924 38 80 00 14 */ li r4, 0x14 -/* 80B96928 48 00 00 10 */ b lbl_80B96938 -lbl_80B9692C: -/* 80B9692C 3C 80 80 BA */ lis r4, m__17daNpc_zrZ_Param_c@ha /* 0x80B9AFEC@ha */ -/* 80B96930 38 84 AF EC */ addi r4, r4, m__17daNpc_zrZ_Param_c@l /* 0x80B9AFEC@l */ -/* 80B96934 A8 84 00 62 */ lha r4, 0x62(r4) -lbl_80B96938: -/* 80B96938 38 A0 00 01 */ li r5, 1 -/* 80B9693C 38 C0 00 00 */ li r6, 0 -/* 80B96940 4B 5B CD 19 */ bl setDamage__8daNpcF_cFiii -/* 80B96944 7F E3 FB 78 */ mr r3, r31 -/* 80B96948 38 80 00 01 */ li r4, 1 -/* 80B9694C 48 00 05 31 */ bl setLookMode__11daNpc_zrZ_cFi -/* 80B96950 48 00 00 28 */ b lbl_80B96978 -lbl_80B96954: -/* 80B96954 88 1F 09 F0 */ lbz r0, 0x9f0(r31) -/* 80B96958 28 00 00 00 */ cmplwi r0, 0 -/* 80B9695C 41 82 00 1C */ beq lbl_80B96978 -/* 80B96960 80 1F 09 54 */ lwz r0, 0x954(r31) -/* 80B96964 2C 00 00 00 */ cmpwi r0, 0 -/* 80B96968 40 82 00 10 */ bne lbl_80B96978 -/* 80B9696C 38 00 00 00 */ li r0, 0 -/* 80B96970 B0 1F 14 4A */ sth r0, 0x144a(r31) -/* 80B96974 98 1F 09 F0 */ stb r0, 0x9f0(r31) -lbl_80B96978: -/* 80B96978 38 00 00 00 */ li r0, 0 -/* 80B9697C B0 1F 09 E6 */ sth r0, 0x9e6(r31) -/* 80B96980 38 7F 14 00 */ addi r3, r31, 0x1400 -/* 80B96984 4B 7C B6 95 */ bl __ptmf_test -/* 80B96988 2C 03 00 00 */ cmpwi r3, 0 -/* 80B9698C 41 82 00 54 */ beq lbl_80B969E0 -/* 80B96990 38 7F 14 0C */ addi r3, r31, 0x140c -/* 80B96994 38 9F 14 00 */ addi r4, r31, 0x1400 -/* 80B96998 4B 7C B6 B1 */ bl __ptmf_cmpr -/* 80B9699C 2C 03 00 00 */ cmpwi r3, 0 -/* 80B969A0 40 82 00 1C */ bne lbl_80B969BC -/* 80B969A4 7F E3 FB 78 */ mr r3, r31 -/* 80B969A8 38 80 00 00 */ li r4, 0 -/* 80B969AC 39 9F 14 0C */ addi r12, r31, 0x140c -/* 80B969B0 4B 7C B6 D5 */ bl __ptmf_scall -/* 80B969B4 60 00 00 00 */ nop -/* 80B969B8 48 00 00 28 */ b lbl_80B969E0 -lbl_80B969BC: -/* 80B969BC 80 7F 14 00 */ lwz r3, 0x1400(r31) -/* 80B969C0 80 1F 14 04 */ lwz r0, 0x1404(r31) -/* 80B969C4 90 61 00 08 */ stw r3, 8(r1) -/* 80B969C8 90 01 00 0C */ stw r0, 0xc(r1) -/* 80B969CC 80 1F 14 08 */ lwz r0, 0x1408(r31) -/* 80B969D0 90 01 00 10 */ stw r0, 0x10(r1) -/* 80B969D4 7F E3 FB 78 */ mr r3, r31 -/* 80B969D8 38 81 00 08 */ addi r4, r1, 8 -/* 80B969DC 4B FF FD 91 */ bl setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i -lbl_80B969E0: -/* 80B969E0 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80B969E4 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80B969E8 7C 08 03 A6 */ mtlr r0 -/* 80B969EC 38 21 00 20 */ addi r1, r1, 0x20 -/* 80B969F0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/getTypeFromParam__11daNpc_zrZ_cFv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/getTypeFromParam__11daNpc_zrZ_cFv.s deleted file mode 100644 index 4b807097d53..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/getTypeFromParam__11daNpc_zrZ_cFv.s +++ /dev/null @@ -1,18 +0,0 @@ -lbl_80B9617C: -/* 80B9617C 80 03 00 B0 */ lwz r0, 0xb0(r3) -/* 80B96180 54 00 06 3E */ clrlwi r0, r0, 0x18 -/* 80B96184 2C 00 00 01 */ cmpwi r0, 1 -/* 80B96188 41 82 00 1C */ beq lbl_80B961A4 -/* 80B9618C 40 80 00 20 */ bge lbl_80B961AC -/* 80B96190 2C 00 00 00 */ cmpwi r0, 0 -/* 80B96194 40 80 00 08 */ bge lbl_80B9619C -/* 80B96198 48 00 00 14 */ b lbl_80B961AC -lbl_80B9619C: -/* 80B9619C 38 60 00 01 */ li r3, 1 -/* 80B961A0 4E 80 00 20 */ blr -lbl_80B961A4: -/* 80B961A4 38 60 00 00 */ li r3, 0 -/* 80B961A8 4E 80 00 20 */ blr -lbl_80B961AC: -/* 80B961AC 38 60 00 01 */ li r3, 1 -/* 80B961B0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/isDelete__11daNpc_zrZ_cFv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/isDelete__11daNpc_zrZ_cFv.s deleted file mode 100644 index a46ea94beb4..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/isDelete__11daNpc_zrZ_cFv.s +++ /dev/null @@ -1,51 +0,0 @@ -lbl_80B961B4: -/* 80B961B4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B961B8 7C 08 02 A6 */ mflr r0 -/* 80B961BC 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B961C0 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80B961C4 7C 7F 1B 78 */ mr r31, r3 -/* 80B961C8 88 03 14 4E */ lbz r0, 0x144e(r3) -/* 80B961CC 28 00 00 02 */ cmplwi r0, 2 -/* 80B961D0 41 82 00 0C */ beq lbl_80B961DC -/* 80B961D4 28 00 00 01 */ cmplwi r0, 1 -/* 80B961D8 40 82 00 24 */ bne lbl_80B961FC -lbl_80B961DC: -/* 80B961DC 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80B961E0 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80B961E4 88 9F 14 54 */ lbz r4, 0x1454(r31) -/* 80B961E8 88 1F 04 E2 */ lbz r0, 0x4e2(r31) -/* 80B961EC 7C 05 07 74 */ extsb r5, r0 -/* 80B961F0 4B 49 F1 71 */ bl isSwitch__10dSv_info_cCFii -/* 80B961F4 2C 03 00 00 */ cmpwi r3, 0 -/* 80B961F8 40 82 00 50 */ bne lbl_80B96248 -lbl_80B961FC: -/* 80B961FC 88 1F 14 4E */ lbz r0, 0x144e(r31) -/* 80B96200 28 00 00 03 */ cmplwi r0, 3 -/* 80B96204 40 82 00 4C */ bne lbl_80B96250 -/* 80B96208 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80B9620C 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80B96210 88 9F 14 54 */ lbz r4, 0x1454(r31) -/* 80B96214 88 1F 04 E2 */ lbz r0, 0x4e2(r31) -/* 80B96218 7C 05 07 74 */ extsb r5, r0 -/* 80B9621C 4B 49 F1 45 */ bl isSwitch__10dSv_info_cCFii -/* 80B96220 2C 03 00 00 */ cmpwi r3, 0 -/* 80B96224 41 82 00 24 */ beq lbl_80B96248 -/* 80B96228 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80B9622C 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80B96230 88 9F 14 55 */ lbz r4, 0x1455(r31) -/* 80B96234 88 1F 04 E2 */ lbz r0, 0x4e2(r31) -/* 80B96238 7C 05 07 74 */ extsb r5, r0 -/* 80B9623C 4B 49 F1 25 */ bl isSwitch__10dSv_info_cCFii -/* 80B96240 2C 03 00 00 */ cmpwi r3, 0 -/* 80B96244 41 82 00 0C */ beq lbl_80B96250 -lbl_80B96248: -/* 80B96248 38 60 00 01 */ li r3, 1 -/* 80B9624C 48 00 00 08 */ b lbl_80B96254 -lbl_80B96250: -/* 80B96250 38 60 00 00 */ li r3, 0 -lbl_80B96254: -/* 80B96254 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80B96258 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B9625C 7C 08 03 A6 */ mtlr r0 -/* 80B96260 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B96264 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subCloth__FPvPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subCloth__FPvPv.s deleted file mode 100644 index 81a2be9dc2a..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subCloth__FPvPv.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_80B951AC: -/* 80B951AC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B951B0 7C 08 02 A6 */ mflr r0 -/* 80B951B4 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B951B8 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80B951BC 7C 7F 1B 78 */ mr r31, r3 -/* 80B951C0 4B 48 3B 21 */ bl fopAc_IsActor__FPv -/* 80B951C4 2C 03 00 00 */ cmpwi r3, 0 -/* 80B951C8 41 82 00 18 */ beq lbl_80B951E0 -/* 80B951CC A8 1F 00 08 */ lha r0, 8(r31) -/* 80B951D0 2C 00 01 78 */ cmpwi r0, 0x178 -/* 80B951D4 40 82 00 0C */ bne lbl_80B951E0 -/* 80B951D8 7F E3 FB 78 */ mr r3, r31 -/* 80B951DC 48 00 00 08 */ b lbl_80B951E4 -lbl_80B951E0: -/* 80B951E0 38 60 00 00 */ li r3, 0 -lbl_80B951E4: -/* 80B951E4 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80B951E8 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B951EC 7C 08 03 A6 */ mtlr r0 -/* 80B951F0 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B951F4 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subRock__FPvPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subRock__FPvPv.s deleted file mode 100644 index 6d8b5333a13..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subRock__FPvPv.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_80B951F8: -/* 80B951F8 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B951FC 7C 08 02 A6 */ mflr r0 -/* 80B95200 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B95204 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80B95208 7C 7F 1B 78 */ mr r31, r3 -/* 80B9520C 4B 48 3A D5 */ bl fopAc_IsActor__FPv -/* 80B95210 2C 03 00 00 */ cmpwi r3, 0 -/* 80B95214 41 82 00 18 */ beq lbl_80B9522C -/* 80B95218 A8 1F 00 08 */ lha r0, 8(r31) -/* 80B9521C 2C 00 00 88 */ cmpwi r0, 0x88 -/* 80B95220 40 82 00 0C */ bne lbl_80B9522C -/* 80B95224 7F E3 FB 78 */ mr r3, r31 -/* 80B95228 48 00 00 08 */ b lbl_80B95230 -lbl_80B9522C: -/* 80B9522C 38 60 00 00 */ li r3, 0 -lbl_80B95230: -/* 80B95230 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80B95234 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B95238 7C 08 03 A6 */ mtlr r0 -/* 80B9523C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B95240 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_sub__FPvPv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_sub__FPvPv.s deleted file mode 100644 index 3437cb13dfd..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_sub__FPvPv.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_80B95160: -/* 80B95160 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B95164 7C 08 02 A6 */ mflr r0 -/* 80B95168 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B9516C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80B95170 7C 7F 1B 78 */ mr r31, r3 -/* 80B95174 4B 48 3B 6D */ bl fopAc_IsActor__FPv -/* 80B95178 2C 03 00 00 */ cmpwi r3, 0 -/* 80B9517C 41 82 00 18 */ beq lbl_80B95194 -/* 80B95180 A8 1F 00 08 */ lha r0, 8(r31) -/* 80B95184 2C 00 00 87 */ cmpwi r0, 0x87 -/* 80B95188 40 82 00 0C */ bne lbl_80B95194 -/* 80B9518C 7F E3 FB 78 */ mr r3, r31 -/* 80B95190 48 00 00 08 */ b lbl_80B95198 -lbl_80B95194: -/* 80B95194 38 60 00 00 */ li r3, 0 -lbl_80B95198: -/* 80B95198 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80B9519C 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B951A0 7C 08 03 A6 */ mtlr r0 -/* 80B951A4 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B951A8 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s deleted file mode 100644 index e77cbc6761d..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s +++ /dev/null @@ -1,45 +0,0 @@ -lbl_80B9676C: -/* 80B9676C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80B96770 7C 08 02 A6 */ mflr r0 -/* 80B96774 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B96778 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80B9677C 93 C1 00 08 */ stw r30, 8(r1) -/* 80B96780 7C 7E 1B 78 */ mr r30, r3 -/* 80B96784 7C 9F 23 78 */ mr r31, r4 -/* 80B96788 38 00 00 03 */ li r0, 3 -/* 80B9678C B0 03 14 4A */ sth r0, 0x144a(r3) -/* 80B96790 38 7E 14 0C */ addi r3, r30, 0x140c -/* 80B96794 4B 7C B8 85 */ bl __ptmf_test -/* 80B96798 2C 03 00 00 */ cmpwi r3, 0 -/* 80B9679C 41 82 00 18 */ beq lbl_80B967B4 -/* 80B967A0 7F C3 F3 78 */ mr r3, r30 -/* 80B967A4 38 80 00 00 */ li r4, 0 -/* 80B967A8 39 9E 14 0C */ addi r12, r30, 0x140c -/* 80B967AC 4B 7C B8 D9 */ bl __ptmf_scall -/* 80B967B0 60 00 00 00 */ nop -lbl_80B967B4: -/* 80B967B4 38 00 00 00 */ li r0, 0 -/* 80B967B8 B0 1E 14 4A */ sth r0, 0x144a(r30) -/* 80B967BC 80 7F 00 00 */ lwz r3, 0(r31) -/* 80B967C0 80 1F 00 04 */ lwz r0, 4(r31) -/* 80B967C4 90 7E 14 0C */ stw r3, 0x140c(r30) -/* 80B967C8 90 1E 14 10 */ stw r0, 0x1410(r30) -/* 80B967CC 80 1F 00 08 */ lwz r0, 8(r31) -/* 80B967D0 90 1E 14 14 */ stw r0, 0x1414(r30) -/* 80B967D4 38 7E 14 0C */ addi r3, r30, 0x140c -/* 80B967D8 4B 7C B8 41 */ bl __ptmf_test -/* 80B967DC 2C 03 00 00 */ cmpwi r3, 0 -/* 80B967E0 41 82 00 18 */ beq lbl_80B967F8 -/* 80B967E4 7F C3 F3 78 */ mr r3, r30 -/* 80B967E8 38 80 00 00 */ li r4, 0 -/* 80B967EC 39 9E 14 0C */ addi r12, r30, 0x140c -/* 80B967F0 4B 7C B8 95 */ bl __ptmf_scall -/* 80B967F4 60 00 00 00 */ nop -lbl_80B967F8: -/* 80B967F8 38 60 00 01 */ li r3, 1 -/* 80B967FC 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80B96800 83 C1 00 08 */ lwz r30, 8(r1) -/* 80B96804 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80B96808 7C 08 03 A6 */ mtlr r0 -/* 80B9680C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80B96810 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpression__11daNpc_zrZ_cFif.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpression__11daNpc_zrZ_cFif.s deleted file mode 100644 index 9e280a6a5a5..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpression__11daNpc_zrZ_cFif.s +++ /dev/null @@ -1,12 +0,0 @@ -lbl_80B95F10: -/* 80B95F10 2C 04 00 00 */ cmpwi r4, 0 -/* 80B95F14 4D 80 00 20 */ bltlr -/* 80B95F18 2C 04 00 02 */ cmpwi r4, 2 -/* 80B95F1C 4C 80 00 20 */ bgelr -/* 80B95F20 B0 83 09 DE */ sth r4, 0x9de(r3) -/* 80B95F24 D0 23 09 74 */ stfs f1, 0x974(r3) -/* 80B95F28 38 00 FF FF */ li r0, -1 -/* 80B95F2C B0 03 09 D8 */ sth r0, 0x9d8(r3) -/* 80B95F30 38 00 00 00 */ li r0, 0 -/* 80B95F34 B0 03 09 D6 */ sth r0, 0x9d6(r3) -/* 80B95F38 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setLookMode__11daNpc_zrZ_cFi.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setLookMode__11daNpc_zrZ_cFi.s deleted file mode 100644 index 87ae4a86923..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setLookMode__11daNpc_zrZ_cFi.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_80B96E7C: -/* 80B96E7C 2C 04 00 00 */ cmpwi r4, 0 -/* 80B96E80 4D 80 00 20 */ bltlr -/* 80B96E84 2C 04 00 05 */ cmpwi r4, 5 -/* 80B96E88 4C 80 00 20 */ bgelr -/* 80B96E8C A8 03 14 48 */ lha r0, 0x1448(r3) -/* 80B96E90 7C 04 00 00 */ cmpw r4, r0 -/* 80B96E94 4D 82 00 20 */ beqlr -/* 80B96E98 B0 83 14 48 */ sth r4, 0x1448(r3) -/* 80B96E9C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMotion__11daNpc_zrZ_cFifi.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMotion__11daNpc_zrZ_cFifi.s deleted file mode 100644 index 9d4a3a54010..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMotion__11daNpc_zrZ_cFifi.s +++ /dev/null @@ -1,19 +0,0 @@ -lbl_80B9612C: -/* 80B9612C 7C 86 07 34 */ extsh r6, r4 -/* 80B96130 2C 05 00 00 */ cmpwi r5, 0 -/* 80B96134 40 82 00 10 */ bne lbl_80B96144 -/* 80B96138 A8 03 09 E0 */ lha r0, 0x9e0(r3) -/* 80B9613C 7C 00 30 00 */ cmpw r0, r6 -/* 80B96140 4D 82 00 20 */ beqlr -lbl_80B96144: -/* 80B96144 2C 04 00 00 */ cmpwi r4, 0 -/* 80B96148 4D 80 00 20 */ bltlr -/* 80B9614C 2C 04 00 03 */ cmpwi r4, 3 -/* 80B96150 4C 80 00 20 */ bgelr -/* 80B96154 B0 C3 09 E0 */ sth r6, 0x9e0(r3) -/* 80B96158 D0 23 09 7C */ stfs f1, 0x97c(r3) -/* 80B9615C 38 00 FF FF */ li r0, -1 -/* 80B96160 B0 03 09 DC */ sth r0, 0x9dc(r3) -/* 80B96164 38 00 00 00 */ li r0, 0 -/* 80B96168 B0 03 09 DA */ sth r0, 0x9da(r3) -/* 80B9616C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMtx__11daNpc_zrZ_cFv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMtx__11daNpc_zrZ_cFv.s deleted file mode 100644 index 419f2710ae8..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMtx__11daNpc_zrZ_cFv.s +++ /dev/null @@ -1,48 +0,0 @@ -lbl_80B95BB8: -/* 80B95BB8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80B95BBC 7C 08 02 A6 */ mflr r0 -/* 80B95BC0 90 01 00 24 */ stw r0, 0x24(r1) -/* 80B95BC4 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80B95BC8 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80B95BCC 7C 7E 1B 78 */ mr r30, r3 -/* 80B95BD0 80 63 05 68 */ lwz r3, 0x568(r3) -/* 80B95BD4 83 E3 00 04 */ lwz r31, 4(r3) -/* 80B95BD8 C0 1E 04 D0 */ lfs f0, 0x4d0(r30) -/* 80B95BDC D0 01 00 08 */ stfs f0, 8(r1) -/* 80B95BE0 C0 3E 04 D4 */ lfs f1, 0x4d4(r30) -/* 80B95BE4 D0 21 00 0C */ stfs f1, 0xc(r1) -/* 80B95BE8 C0 1E 04 D8 */ lfs f0, 0x4d8(r30) -/* 80B95BEC D0 01 00 10 */ stfs f0, 0x10(r1) -/* 80B95BF0 C0 1E 14 64 */ lfs f0, 0x1464(r30) -/* 80B95BF4 EC 01 00 2A */ fadds f0, f1, f0 -/* 80B95BF8 D0 01 00 0C */ stfs f0, 0xc(r1) -/* 80B95BFC 38 61 00 08 */ addi r3, r1, 8 -/* 80B95C00 4B 47 71 65 */ bl transS__14mDoMtx_stack_cFRC4cXyz -/* 80B95C04 38 7E 08 F0 */ addi r3, r30, 0x8f0 -/* 80B95C08 4B 47 73 3D */ bl ZXYrotM__14mDoMtx_stack_cFRC5csXyz -/* 80B95C0C 38 7E 04 EC */ addi r3, r30, 0x4ec -/* 80B95C10 4B 47 72 61 */ bl scaleM__14mDoMtx_stack_cFRC4cXyz -/* 80B95C14 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80B95C18 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80B95C1C 38 9F 00 24 */ addi r4, r31, 0x24 -/* 80B95C20 4B 7B 08 91 */ bl PSMTXCopy -/* 80B95C24 93 DF 00 14 */ stw r30, 0x14(r31) -/* 80B95C28 80 1E 09 9C */ lwz r0, 0x99c(r30) -/* 80B95C2C 54 00 05 EF */ rlwinm. r0, r0, 0, 0x17, 0x17 -/* 80B95C30 41 82 00 1C */ beq lbl_80B95C4C -/* 80B95C34 C0 1E 05 7C */ lfs f0, 0x57c(r30) -/* 80B95C38 80 7E 05 80 */ lwz r3, 0x580(r30) -/* 80B95C3C D0 03 00 08 */ stfs f0, 8(r3) -/* 80B95C40 80 7E 05 68 */ lwz r3, 0x568(r30) -/* 80B95C44 4B 47 B5 A9 */ bl modelCalc__16mDoExt_McaMorfSOFv -/* 80B95C48 48 00 00 0C */ b lbl_80B95C54 -lbl_80B95C4C: -/* 80B95C4C 80 7E 05 68 */ lwz r3, 0x568(r30) -/* 80B95C50 4B 47 B5 9D */ bl modelCalc__16mDoExt_McaMorfSOFv -lbl_80B95C54: -/* 80B95C54 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80B95C58 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80B95C5C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80B95C60 7C 08 03 A6 */ mtlr r0 -/* 80B95C64 38 21 00 20 */ addi r1, r1, 0x20 -/* 80B95C68 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setParam__11daNpc_zrZ_cFv.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setParam__11daNpc_zrZ_cFv.s deleted file mode 100644 index afb92f08396..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setParam__11daNpc_zrZ_cFv.s +++ /dev/null @@ -1,105 +0,0 @@ -lbl_80B95244: -/* 80B95244 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 80B95248 7C 08 02 A6 */ mflr r0 -/* 80B9524C 90 01 00 34 */ stw r0, 0x34(r1) -/* 80B95250 39 61 00 30 */ addi r11, r1, 0x30 -/* 80B95254 4B 7C CF 85 */ bl _savegpr_28 -/* 80B95258 7C 7F 1B 78 */ mr r31, r3 -/* 80B9525C 80 83 14 00 */ lwz r4, 0x1400(r3) -/* 80B95260 80 03 14 04 */ lwz r0, 0x1404(r3) -/* 80B95264 90 81 00 0C */ stw r4, 0xc(r1) -/* 80B95268 90 01 00 10 */ stw r0, 0x10(r1) -/* 80B9526C 80 03 14 08 */ lwz r0, 0x1408(r3) -/* 80B95270 90 01 00 14 */ stw r0, 0x14(r1) -/* 80B95274 3B A0 00 0A */ li r29, 0xa -/* 80B95278 48 00 15 9D */ bl selectAction__11daNpc_zrZ_cFv -/* 80B9527C 88 1F 09 F4 */ lbz r0, 0x9f4(r31) -/* 80B95280 28 00 00 00 */ cmplwi r0, 0 -/* 80B95284 40 82 00 20 */ bne lbl_80B952A4 -/* 80B95288 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80B9528C 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80B95290 80 63 5D B4 */ lwz r3, 0x5db4(r3) -/* 80B95294 80 03 05 74 */ lwz r0, 0x574(r3) -/* 80B95298 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 80B9529C 41 82 00 08 */ beq lbl_80B952A4 -/* 80B952A0 3B A0 00 00 */ li r29, 0 -lbl_80B952A4: -/* 80B952A4 38 7F 14 00 */ addi r3, r31, 0x1400 -/* 80B952A8 38 81 00 0C */ addi r4, r1, 0xc -/* 80B952AC 4B 7C CD 9D */ bl __ptmf_cmpr -/* 80B952B0 2C 03 00 00 */ cmpwi r3, 0 -/* 80B952B4 41 82 00 2C */ beq lbl_80B952E0 -/* 80B952B8 3B 80 00 02 */ li r28, 2 -/* 80B952BC 3B C0 00 10 */ li r30, 0x10 -/* 80B952C0 48 00 00 18 */ b lbl_80B952D8 -lbl_80B952C4: -/* 80B952C4 38 7E 0C 80 */ addi r3, r30, 0xc80 -/* 80B952C8 7C 7F 1A 14 */ add r3, r31, r3 -/* 80B952CC 4B 5B B3 E5 */ bl initialize__18daNpcF_ActorMngr_cFv -/* 80B952D0 3B 9C 00 01 */ addi r28, r28, 1 -/* 80B952D4 3B DE 00 08 */ addi r30, r30, 8 -lbl_80B952D8: -/* 80B952D8 2C 1C 00 02 */ cmpwi r28, 2 -/* 80B952DC 41 80 FF E8 */ blt lbl_80B952C4 -lbl_80B952E0: -/* 80B952E0 38 00 00 00 */ li r0, 0 -/* 80B952E4 90 1F 14 34 */ stw r0, 0x1434(r31) -/* 80B952E8 90 1F 14 38 */ stw r0, 0x1438(r31) -/* 80B952EC 7F E3 FB 78 */ mr r3, r31 -/* 80B952F0 38 80 00 05 */ li r4, 5 -/* 80B952F4 38 A0 00 06 */ li r5, 6 -/* 80B952F8 4B 5B EF 81 */ bl getDistTableIdx__8daNpcF_cFii -/* 80B952FC 98 7F 05 44 */ stb r3, 0x544(r31) -/* 80B95300 88 1F 05 44 */ lbz r0, 0x544(r31) -/* 80B95304 98 1F 05 45 */ stb r0, 0x545(r31) -/* 80B95308 7F E3 FB 78 */ mr r3, r31 -/* 80B9530C 38 80 00 03 */ li r4, 3 -/* 80B95310 38 A0 00 06 */ li r5, 6 -/* 80B95314 4B 5B EF 65 */ bl getDistTableIdx__8daNpcF_cFii -/* 80B95318 98 7F 05 47 */ stb r3, 0x547(r31) -/* 80B9531C 93 BF 05 5C */ stw r29, 0x55c(r31) -/* 80B95320 3C 60 80 BA */ lis r3, m__17daNpc_zrZ_Param_c@ha /* 0x80B9AFEC@ha */ -/* 80B95324 38 83 AF EC */ addi r4, r3, m__17daNpc_zrZ_Param_c@l /* 0x80B9AFEC@l */ -/* 80B95328 C0 04 00 08 */ lfs f0, 8(r4) -/* 80B9532C D0 1F 04 EC */ stfs f0, 0x4ec(r31) -/* 80B95330 D0 1F 04 F0 */ stfs f0, 0x4f0(r31) -/* 80B95334 D0 1F 04 F4 */ stfs f0, 0x4f4(r31) -/* 80B95338 38 7F 07 E4 */ addi r3, r31, 0x7e4 -/* 80B9533C C0 24 00 1C */ lfs f1, 0x1c(r4) -/* 80B95340 4B 4E 0C 01 */ bl SetWallR__12dBgS_AcchCirFf -/* 80B95344 3C 60 80 BA */ lis r3, m__17daNpc_zrZ_Param_c@ha /* 0x80B9AFEC@ha */ -/* 80B95348 38 63 AF EC */ addi r3, r3, m__17daNpc_zrZ_Param_c@l /* 0x80B9AFEC@l */ -/* 80B9534C C0 03 00 18 */ lfs f0, 0x18(r3) -/* 80B95350 D0 1F 08 14 */ stfs f0, 0x814(r31) -/* 80B95354 C0 03 00 04 */ lfs f0, 4(r3) -/* 80B95358 D0 1F 05 30 */ stfs f0, 0x530(r31) -/* 80B9535C A8 1F 04 6A */ lha r0, 0x46a(r31) -/* 80B95360 1C 60 00 64 */ mulli r3, r0, 0x64 -/* 80B95364 38 00 00 FF */ li r0, 0xff -/* 80B95368 7C 03 03 D6 */ divw r0, r3, r0 -/* 80B9536C 28 00 00 01 */ cmplwi r0, 1 -/* 80B95370 40 80 00 0C */ bge lbl_80B9537C -/* 80B95374 38 A0 00 01 */ li r5, 1 -/* 80B95378 48 00 00 14 */ b lbl_80B9538C -lbl_80B9537C: -/* 80B9537C 28 00 00 64 */ cmplwi r0, 0x64 -/* 80B95380 38 A0 00 64 */ li r5, 0x64 -/* 80B95384 41 81 00 08 */ bgt lbl_80B9538C -/* 80B95388 7C 05 03 78 */ mr r5, r0 -lbl_80B9538C: -/* 80B9538C 3C 60 00 06 */ lis r3, 0x0006 /* 0x00060098@ha */ -/* 80B95390 38 03 00 98 */ addi r0, r3, 0x0098 /* 0x00060098@l */ -/* 80B95394 90 01 00 08 */ stw r0, 8(r1) -/* 80B95398 38 7F 0B 48 */ addi r3, r31, 0xb48 -/* 80B9539C 38 81 00 08 */ addi r4, r1, 8 -/* 80B953A0 38 C0 FF FF */ li r6, -1 -/* 80B953A4 81 9F 0B 48 */ lwz r12, 0xb48(r31) -/* 80B953A8 81 8C 00 18 */ lwz r12, 0x18(r12) -/* 80B953AC 7D 89 03 A6 */ mtctr r12 -/* 80B953B0 4E 80 04 21 */ bctrl -/* 80B953B4 39 61 00 30 */ addi r11, r1, 0x30 -/* 80B953B8 4B 7C CE 6D */ bl _restgpr_28 -/* 80B953BC 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80B953C0 7C 08 03 A6 */ mtlr r0 -/* 80B953C4 38 21 00 30 */ addi r1, r1, 0x30 -/* 80B953C8 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setSkipZev__11daNpc_zrZ_cFii.s b/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setSkipZev__11daNpc_zrZ_cFii.s deleted file mode 100644 index d8805b119ed..00000000000 --- a/asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setSkipZev__11daNpc_zrZ_cFii.s +++ /dev/null @@ -1,38 +0,0 @@ -lbl_80B96DF0: -/* 80B96DF0 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80B96DF4 7C 08 02 A6 */ mflr r0 -/* 80B96DF8 90 01 00 24 */ stw r0, 0x24(r1) -/* 80B96DFC 39 61 00 20 */ addi r11, r1, 0x20 -/* 80B96E00 4B 7C B3 D9 */ bl _savegpr_28 -/* 80B96E04 7C 7C 1B 78 */ mr r28, r3 -/* 80B96E08 7C 9D 23 78 */ mr r29, r4 -/* 80B96E0C 7C BE 2B 78 */ mr r30, r5 -/* 80B96E10 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80B96E14 3B E3 61 C0 */ addi r31, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80B96E18 38 7F 4F F8 */ addi r3, r31, 0x4ff8 -/* 80B96E1C 4B 4B 15 CD */ bl getRunEventName__16dEvent_manager_cFv -/* 80B96E20 57 A0 10 3A */ slwi r0, r29, 2 -/* 80B96E24 3C 80 80 BA */ lis r4, l_evtNames@ha /* 0x80B9B39C@ha */ -/* 80B96E28 38 84 B3 9C */ addi r4, r4, l_evtNames@l /* 0x80B9B39C@l */ -/* 80B96E2C 7C 84 00 2E */ lwzx r4, r4, r0 -/* 80B96E30 4B 7D 1B 65 */ bl strcmp -/* 80B96E34 2C 03 00 00 */ cmpwi r3, 0 -/* 80B96E38 40 82 00 28 */ bne lbl_80B96E60 -/* 80B96E3C 38 7F 4E C8 */ addi r3, r31, 0x4ec8 -/* 80B96E40 7F 84 E3 78 */ mr r4, r28 -/* 80B96E44 57 C0 10 3A */ slwi r0, r30, 2 -/* 80B96E48 3C A0 80 BA */ lis r5, l_evtNames@ha /* 0x80B9B39C@ha */ -/* 80B96E4C 38 A5 B3 9C */ addi r5, r5, l_evtNames@l /* 0x80B9B39C@l */ -/* 80B96E50 7C A5 00 2E */ lwzx r5, r5, r0 -/* 80B96E54 4B 4A BB 05 */ bl setSkipZev__14dEvt_control_cFPvPc -/* 80B96E58 38 60 00 01 */ li r3, 1 -/* 80B96E5C 48 00 00 08 */ b lbl_80B96E64 -lbl_80B96E60: -/* 80B96E60 38 60 00 00 */ li r3, 0 -lbl_80B96E64: -/* 80B96E64 39 61 00 20 */ addi r11, r1, 0x20 -/* 80B96E68 4B 7C B3 BD */ bl _restgpr_28 -/* 80B96E6C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80B96E70 7C 08 03 A6 */ mtlr r0 -/* 80B96E74 38 21 00 20 */ addi r1, r1, 0x20 -/* 80B96E78 4E 80 00 20 */ blr diff --git a/include/d/a/d_a_npc.h b/include/d/a/d_a_npc.h index 48d39aa28d5..e14b518db76 100644 --- a/include/d/a/d_a_npc.h +++ b/include/d/a/d_a_npc.h @@ -635,14 +635,14 @@ protected: /* 0x902 */ csXyz mHeadAngle; /* 0x908 */ csXyz field_0x908[3]; /* 0x91A */ csXyz mLookatAngle[3]; - /* 0x92C */ int mCutIndex; - /* 0x930 */ u32 field_0x930; + /* 0x92C */ int mStaffID; + /* 0x930 */ int mCutType; /* 0x934 */ int mAttnIdx; /* 0x938 */ int mAttnChangeTimer; /* 0x93C */ int mAttnActorTimer[5]; /* 0x950 */ int mMsgTimer; - /* 0x954 */ int field_0x954; - /* 0x958 */ int field_0x958; + /* 0x954 */ int mDamageTimer; + /* 0x958 */ int mTotalDamageTimer; /* 0x95C */ int field_0x95c; /* 0x960 */ int mEventTimer; /* 0x964 */ int mBtpTimer; @@ -687,7 +687,7 @@ protected: /* 0x9ED */ bool mOrderNewEvt; /* 0x9EE */ bool field_0x9ee; /* 0x9EF */ u8 field_0x9ef; - /* 0x9F0 */ u8 field_0x9f0; + /* 0x9F0 */ bool mIsDamaged; /* 0x9F1 */ u8 field_0x9f1; /* 0x9F2 */ bool mHide; /* 0x9f3 */ u8 field_0x9f3; @@ -740,7 +740,7 @@ public: }; /* 80152014 */ BOOL execute(); - /* 801522AC */ BOOL draw(BOOL, BOOL, f32, _GXColorS10*, BOOL); + /* 801522AC */ int draw(BOOL, BOOL, f32, _GXColorS10*, BOOL); /* 80152614 */ static void tgHitCallBack(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*); /* 80152654 */ static void* srchAttnActor1(void*, void*); @@ -769,7 +769,7 @@ public: /* 80153150 */ void playExpressionAnm(daNpcF_c::daNpcF_anmPlayData***); /* 80153264 */ void playMotionAnm(daNpcF_c::daNpcF_anmPlayData***); /* 8015337C */ void setLookatMtx(int, int*, f32); - /* 80153578 */ void hitChk2(dCcD_Cyl*, int, int); + /* 80153578 */ BOOL hitChk2(dCcD_Cyl*, BOOL, BOOL); /* 80153658 */ void setDamage(int, int, int); /* 80153718 */ int ctrlMsgAnm(int&, int&, fopAc_ac_c*, BOOL); /* 8015387C */ void orderEvent(int, char*, u16, u16, u8, u16); @@ -825,6 +825,7 @@ public: BOOL checkHide() { return mHide || (mTwilight && !dComIfGs_wolfeye_effect_check()); } void setIntDemander(fopAc_ac_c* i_actor) { field_0x824.entry(i_actor); } void setIntFlowNodeNo(int i_flowNodeNo) { mFlowNodeNo = i_flowNodeNo; } + void setCutType(int i_cutType) { mCutType = i_cutType; } void onInterrupt(u8 param_0) { field_0x9ef = param_0; } static u8 const mCcDObjInfo[48]; @@ -922,6 +923,7 @@ public: int getIdx() { return mIdx; }; void setIdx(int i_idx) { mIdx = i_idx; } + int getArg0() { return mpRoomPath->m_points[mIdx].mArg0; } u8 getArg0(int i_idx) { return mpRoomPath->m_points[i_idx].mArg0; } Vec getPntPos(int i_idx) { return mpRoomPath->m_points[i_idx].m_position; } BOOL chkClose() { return dPath_ChkClose(mpRoomPath); } diff --git a/include/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.h b/include/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.h index 51ded262ea9..c9a9f8a6c36 100644 --- a/include/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.h +++ b/include/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.h @@ -117,10 +117,10 @@ public: /* 8095A8EC */ bool talk(void*); /* 8095AD28 */ bool demo(void*); /* 8095B164 */ bool leave(void*); - /* 8095B48C */ BOOL EvCut_Introduction(int i_cutIndex); - /* 8095B58C */ BOOL EvCut_Meeting(int i_cutIndex); - /* 8095B83C */ BOOL EvCut_WiretapSponsor(int i_cutIndex); - /* 8095BA80 */ BOOL EvCut_WiretapEntrant(int i_cutIndex); + /* 8095B48C */ BOOL EvCut_Introduction(int i_staffID); + /* 8095B58C */ BOOL EvCut_Meeting(int i_staffID); + /* 8095B83C */ BOOL EvCut_WiretapSponsor(int i_staffID); + /* 8095BA80 */ BOOL EvCut_WiretapEntrant(int i_staffID); /* 8095BCF0 */ void setParam(); /* 8095BF6C */ BOOL main(); #ifdef NONMATCHING @@ -182,11 +182,11 @@ public: /* 0x54 */ f32 mAttnRadius; /* 0x58 */ f32 mAttnUpperY; /* 0x5C */ f32 mAttnLowerY; - /* 0x60 */ u16 field_0x60; - /* 0x62 */ u16 field_0x62; - /* 0x64 */ u16 mTestExpression; - /* 0x66 */ u16 mTestMotion; - /* 0x68 */ u16 mTestLookMode; + /* 0x60 */ s16 field_0x60; + /* 0x62 */ s16 mDamageTimer; + /* 0x64 */ s16 mTestExpression; + /* 0x66 */ s16 mTestMotion; + /* 0x68 */ s16 mTestLookMode; /* 0x6A */ bool mTest; }; diff --git a/include/rel/d/a/npc/d_a_npc_the/d_a_npc_the.h b/include/rel/d/a/npc/d_a_npc_the/d_a_npc_the.h index bf24596a53c..ade709f5f6e 100644 --- a/include/rel/d/a/npc/d_a_npc_the/d_a_npc_the.h +++ b/include/rel/d/a/npc/d_a_npc_the/d_a_npc_the.h @@ -242,7 +242,7 @@ public: /* 0x58 */ f32 mAttnUpperY; /* 0x5C */ f32 mAttnLowerY; /* 0x60 */ s16 field_0x60; - /* 0x62 */ s16 field_0x62; + /* 0x62 */ s16 mDamageTimer; /* 0x64 */ s16 mTestExpression; /* 0x66 */ s16 mTestMotion; /* 0x68 */ s16 mTestLookMode; diff --git a/include/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.h b/include/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.h index 21071c2e90b..4ad04a637cc 100644 --- a/include/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.h +++ b/include/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.h @@ -433,7 +433,7 @@ public: /* 0x58 */ f32 mAttnUpperY; /* 0x5C */ f32 mAttnLowerY; /* 0x60 */ s16 field_0x60; - /* 0x62 */ s16 field_0x62; + /* 0x62 */ s16 mDamageTimer; /* 0x64 */ s16 mTestExpression; /* 0x66 */ s16 mTestMotion; /* 0x68 */ s16 mTestLookMode; diff --git a/include/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.h b/include/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.h index 7bc590be3d4..85385a25c63 100644 --- a/include/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.h +++ b/include/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.h @@ -3,50 +3,58 @@ #include "d/a/d_a_npc.h" +class daGraveStone_c; +class daObjZraRock_c; + /** * @ingroup actors-npcs * @class daNpc_zrZ_c * @brief Rutela * - * @details + * @details The ghost of the Zora queen. * */ -class daNpc_zrZ_c : public fopAc_ac_c { +class daNpc_zrZ_c : public daNpcF_c { public: + typedef BOOL (daNpc_zrZ_c::*ActionFn)(void*); + typedef BOOL (daNpc_zrZ_c::*EventFn)(int); + /* 80B93DCC */ daNpc_zrZ_c(); /* 80B94014 */ ~daNpc_zrZ_c(); - /* 80B9423C */ void create(); - /* 80B9453C */ void CreateHeap(); - /* 80B949F4 */ void Delete(); - /* 80B94A28 */ void Execute(); - /* 80B94A48 */ void Draw(); - /* 80B94B34 */ void draw(int, int, f32, _GXColorS10*, int); - /* 80B94E18 */ void ctrlJoint(J3DJoint*, J3DModel*); - /* 80B950F4 */ void createHeapCallBack(fopAc_ac_c*); - /* 80B95114 */ void ctrlJointCallBack(J3DJoint*, int); + /* 80B9423C */ cPhs__Step create(); + /* 80B9453C */ int CreateHeap(); + /* 80B949F4 */ int Delete(); + /* 80B94A28 */ int Execute(); + /* 80B94A48 */ int Draw(); + /* 80B94B34 */ int draw(BOOL, BOOL, f32, _GXColorS10*, BOOL); + /* 80B94E18 */ int ctrlJoint(J3DJoint*, J3DModel*); + /* 80B950F4 */ static int createHeapCallBack(fopAc_ac_c*); + /* 80B95114 */ static int ctrlJointCallBack(J3DJoint*, int); /* 80B95244 */ void setParam(); - /* 80B953CC */ void main(); - /* 80B95598 */ void ctrlBtk(); + /* 80B953CC */ BOOL main(); + /* 80B95598 */ BOOL ctrlBtk(); /* 80B956B4 */ void setAttnPos(); /* 80B95BB8 */ void setMtx(); - /* 80B95C6C */ void setExpressionAnm(int, bool); - /* 80B95DD0 */ void setExpressionBtp(int); + /* 80B95C6C */ bool setExpressionAnm(int, bool); + /* 80B95DD0 */ bool setExpressionBtp(int); /* 80B95F10 */ void setExpression(int, f32); /* 80B95F3C */ void setMotionAnm(int, f32); /* 80B9612C */ void setMotion(int, f32, int); - /* 80B96170 */ bool drawDbgInfo(); + /* 80B96170 */ BOOL drawDbgInfo(); /* 80B96178 */ void drawOtherMdls(); - /* 80B9617C */ void getTypeFromParam(); - /* 80B961B4 */ void isDelete(); + /* 80B9617C */ u8 getTypeFromParam(); + /* inline */ u8 getPathNoFromParam() { return (fopAcM_GetParam(this) >> 8) & 0xff; } + /* inline */ u8 getDemoMode() { return (fopAcM_GetParam(this) >> 0x10) & 0xf; } + /* 80B961B4 */ BOOL isDelete(); /* 80B96268 */ void reset(); /* 80B9652C */ void playExpression(); /* 80B96618 */ void playMotion(); - /* 80B96740 */ void chkAction(int (daNpc_zrZ_c::*)(void*)); - /* 80B9676C */ void setAction(int (daNpc_zrZ_c::*)(void*)); - /* 80B96814 */ void selectAction(); - /* 80B968E0 */ void doNormalAction(int); - /* 80B969F4 */ void doEvent(); - /* 80B96DF0 */ void setSkipZev(int, int); + /* 80B96740 */ BOOL chkAction(ActionFn); + /* 80B9676C */ BOOL setAction(ActionFn); + /* 80B96814 */ BOOL selectAction(); + /* 80B968E0 */ void doNormalAction(BOOL); + /* 80B969F4 */ BOOL doEvent(); + /* 80B96DF0 */ BOOL setSkipZev(int, int); /* 80B96E7C */ void setLookMode(int); /* 80B96EA0 */ void lookat(); /* 80B97128 */ void setExpressionTalkAfter(); @@ -54,37 +62,162 @@ public: /* 80B971BC */ void setLightPos(); /* 80B9723C */ void lightPowerCalc(int); /* 80B972EC */ void lightColorProc(); - /* 80B974BC */ void ECut_helpPrince(int); - /* 80B97B78 */ void ECut_comeHere(int); - /* 80B97D7C */ void ECut_restoreLink(int); - /* 80B97EB4 */ void ECut_clothesGet(int); - /* 80B98540 */ void ECut_getAfter(int); - /* 80B9877C */ void ECut_sealRelease(int); - /* 80B98ACC */ void ECut_srSkip(int); + /* 80B974BC */ BOOL ECut_helpPrince(int); + /* 80B97B78 */ BOOL ECut_comeHere(int); + /* 80B97D7C */ BOOL ECut_restoreLink(int); + /* 80B97EB4 */ BOOL ECut_clothesGet(int); + /* 80B98540 */ BOOL ECut_getAfter(int); + /* 80B9877C */ BOOL ECut_sealRelease(int); + /* 80B98ACC */ BOOL ECut_srSkip(int); /* 80B98C34 */ void pullbackPlayer(f32); - /* 80B98D04 */ void wait(void*); - /* 80B98F84 */ void comeHere(void*); - /* 80B998BC */ void comeHere2(void*); - /* 80B9A0EC */ void talk(void*); - /* 80B9A29C */ void test(void*); + /* 80B98D04 */ BOOL wait(void*); + /* 80B98F84 */ BOOL comeHere(void*); + /* 80B998BC */ BOOL comeHere2(void*); + /* 80B9A0EC */ BOOL talk(void*); + /* 80B9A29C */ BOOL test(void*); /* 80B9A380 */ void himoCalc(); /* 80B9AF7C */ void adjustShapeAngle(); - static void* mEvtCutNameList[8]; - static u8 mEvtCutList[96]; - private: - /* 0x568 */ u8 field_0x568[0x14c8 - 0x568]; + /* 0x0B48 */ Z2Creature mCreatureSound; + /* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm; + /* 0x0BDC */ mDoExt_invisibleModel mInvisibleModel; + /* 0x0BE4 */ daNpcF_Lookat_c mLookat; + /* 0x0C80 */ daNpcF_ActorMngr_c mActorMngr[2]; + /* 0x0C90 */ daNpcF_Path_c mPath; + /* 0x12C0 */ u8 field_0x12c0[4]; + /* 0x12C4 */ dCcD_Cyl mCcCyl; + /* 0x1400 */ ActionFn mpNextActionFn; + /* 0x140C */ ActionFn mpActionFn; + /* 0x1418 */ request_of_phase_process_class mPhase[2]; + /* 0x1428 */ u8 field_0x1428[8]; + /* 0x1430 */ u32 mItemID; + /* 0x1434 */ int field_0x1434; + /* 0x1438 */ int field_0x1438; + /* 0x143C */ int field_0x143c; + /* 0x1440 */ int field_0x1440; + /* 0x1444 */ int mFlowID; + /* 0x1448 */ s16 mLookMode; + /* 0x144A */ u16 mMode; + /* 0x144C */ u8 mType; + /* 0x144D */ bool mIsLeading; + /* 0x144E */ u8 mDemoMode; + /* 0x144F */ bool mIsMoving; + /* 0x1450 */ f32 mSpeed; + /* 0x1454 */ u8 mSwitch1; + /* 0x1455 */ u8 mSwitch2; + /* 0x1456 */ u8 mSwitch3; + /* 0x1458 */ csXyz mMoveAngle; + /* 0x1460 */ int mModulationParam; + /* 0x1464 */ f32 mModulationOffset; + /* 0x1468 */ LIGHT_INFLUENCE mLight; + /* 0x1488 */ f32 mAllcolRatio; + /* 0x148C */ int mLightEffectFrame; + /* 0x1490 */ bool mUseLightEffect; + /* 0x1491 */ bool mClothesObtained; + /* 0x1494 */ daGraveStone_c* mpGravestoneActor; + /* 0x1498 */ fopAc_ac_c* mpClothActor; + /* 0x149C */ daObjZraRock_c* mpRockActor; + /* 0x14A0 */ cXyz mLimbCalcPos; + /* 0x14AC */ cXyz mLimbCalcRelPos; + /* 0x14B8 */ csXyz mLimbAngle; + /* 0x14C0 */ BOOL mMusicSet; + /* 0x14C4 */ bool mSealReleased; + + static char* mEvtCutNameList[8]; +#ifdef NONMATCHING + static EventFn mEvtCutList[8]; +#else + static u8 mEvtCutList[96]; +#endif + + enum Animation { + /* 0x0 */ ANM_NONE, + /* 0x1 */ ANM_F_TALK_A, + /* 0x2 */ ANM_WAIT_GT_A, + /* 0x3 */ ANM_LEAD, + /* 0x4 */ ANM_COMEON, + }; + + enum Expression { + /* 0x0 */ EXPR_TALK_A, + /* 0x1 */ EXPR_NONE, + }; + + enum Motion { + /* 0x0 */ MOT_WAIT_GT_A, + /* 0x1 */ MOT_COMEON, + /* 0x2 */ MOT_LEAD, + }; + + enum DemoMode { + /* 0x1 */ DEMO_WAIT = 1, + /* 0x2 */ DEMO_COME_HERE, + /* 0x3 */ DEMO_COME_HERE_2, + }; + + enum Event { + /* 0x0 */ EVT_NONE, + /* 0x1 */ EVT_HELP_PRINCE, + /* 0x2 */ EVT_COME_HERE, + /* 0x3 */ EVT_RESTORE_LINK, + /* 0x4 */ EVT_CLOTHES_GET, + /* 0x5 */ EVT_GET_AFTER, + /* 0x6 */ EVT_SEAL_RELEASE, + /* 0x7 */ EVT_SR_SKIP, + }; }; STATIC_ASSERT(sizeof(daNpc_zrZ_c) == 0x14c8); class daNpc_zrZ_Param_c { public: - /* 80B9AF80 */ ~daNpc_zrZ_Param_c(); + struct param { + /* 0x00 */ f32 mAttnOffsetY; + /* 0x04 */ f32 mGravity; + /* 0x08 */ f32 mScale; + /* 0x0C */ f32 mShadowDepth; + /* 0x10 */ f32 mCcWeight; + /* 0x14 */ f32 mCylH; + /* 0x18 */ f32 mWallH; + /* 0x1C */ f32 mWallR; + /* 0x20 */ f32 mBodyUpAngle; + /* 0x24 */ f32 mBodyDownAngle; + /* 0x28 */ f32 mBodyLeftAngle; + /* 0x2C */ f32 mBodyRightAngle; + /* 0x30 */ f32 mHeadUpAngle; + /* 0x34 */ f32 mHeadDownAngle; + /* 0x38 */ f32 mHeadLeftAngle; + /* 0x3C */ f32 mHeadRightAngle; + /* 0x40 */ f32 mNeckAngleScl; + /* 0x44 */ f32 mMorfFrames; + /* 0x48 */ s16 mSpeakDistIdx; + /* 0x4A */ s16 mSpeakAngleIdx; + /* 0x4C */ s16 mTalkDistIdx; + /* 0x4E */ s16 mTalkAngleIdx; + /* 0x50 */ f32 mAttnFovY; + /* 0x54 */ f32 mAttnRadius; + /* 0x58 */ f32 mAttnUpperY; + /* 0x5C */ f32 mAttnLowerY; + /* 0x60 */ s16 field_0x60; + /* 0x62 */ s16 mDamageTimer; + /* 0x64 */ s16 mTestExpression; + /* 0x66 */ s16 mTestMotion; + /* 0x68 */ s16 mTestLookMode; + /* 0x6A */ bool mTest; + /* 0x6C */ f32 field_0x6c; + /* 0x70 */ f32 mFollowDst; + /* 0x74 */ f32 mRestoreDst; + /* 0x78 */ f32 mMaxSpeed; + /* 0x7C */ f32 mClothesGetDst; + /* 0x80 */ f32 field_0x80; + }; - static u8 const m[132]; + /* 80B9AF80 */ virtual ~daNpc_zrZ_Param_c() {} + + static param const m; }; +STATIC_ASSERT(sizeof(daNpc_zrZ_Param_c::param) == 0x84); #endif /* D_A_NPC_ZRZ_H */ diff --git a/include/rel/d/a/obj/d_a_obj_grave_stone/d_a_obj_grave_stone.h b/include/rel/d/a/obj/d_a_obj_grave_stone/d_a_obj_grave_stone.h index 167b332937e..d9e17c9fe87 100644 --- a/include/rel/d/a/obj/d_a_obj_grave_stone/d_a_obj_grave_stone.h +++ b/include/rel/d/a/obj/d_a_obj_grave_stone/d_a_obj_grave_stone.h @@ -40,6 +40,8 @@ public: /* 80C1311C */ int Delete(); private: + friend class daNpc_zrZ_c; + /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dBgS_ObjAcch mAcch; diff --git a/include/rel/d/a/obj/d_a_obj_zra_rock/d_a_obj_zra_rock.h b/include/rel/d/a/obj/d_a_obj_zra_rock/d_a_obj_zra_rock.h index f6669e0981a..7a00e339bca 100644 --- a/include/rel/d/a/obj/d_a_obj_zra_rock/d_a_obj_zra_rock.h +++ b/include/rel/d/a/obj/d_a_obj_zra_rock/d_a_obj_zra_rock.h @@ -29,6 +29,8 @@ public: void setDemoStart() { mDemoStart = 1; } private: + friend class daNpc_zrZ_c; + /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModelXlu; /* 0x5AC */ J3DModel* mpModelOpa; diff --git a/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.cpp b/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.cpp index 5f49a16f8e0..d8a438072ef 100644 --- a/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.cpp +++ b/rel/d/a/npc/d_a_npc_ash/d_a_npc_ash.cpp @@ -858,7 +858,7 @@ SECTION_RODATA daNpcAsh_Param_c::param const daNpcAsh_Param_c::m = { 300.0f, // mAttnUpperY -300.0f, // mAttnLowerY 60, - 8, + 8, // mDamageTimer 0, // mTestExpression 0, // mTestMotion 0, // mTestLookMode @@ -2066,15 +2066,16 @@ bool daNpcAsh_c::demo(void* param_0) { case 2: if (dComIfGp_event_runCheck() && !eventInfo.checkCommandTalk()) { - s32 cutIndex = dComIfGp_getEventManager().getMyStaffId(l_myName, NULL, 0); - if (cutIndex != -1) { - mCutIndex = cutIndex; - s32 eventIdx = dComIfGp_getEventManager().getMyActIdx(cutIndex, l_evtNames, 6, 0, 0); + s32 staff_id = dComIfGp_getEventManager().getMyStaffId(l_myName, NULL, 0); + if (staff_id != -1) { + mStaffID = staff_id; + s32 eventIdx = dComIfGp_getEventManager().getMyActIdx(staff_id, l_evtNames, + ARRAY_SIZE(l_evtNames), 0, 0); if (eventIdx >= 1 && eventIdx < 6) { mOrderEvtNo = eventIdx; } - if ((this->*(mEvtSeqList[mOrderEvtNo]))(cutIndex)) { - dComIfGp_getEventManager().cutEnd(cutIndex); + if ((this->*(mEvtSeqList[mOrderEvtNo]))(staff_id)) { + dComIfGp_getEventManager().cutEnd(staff_id); } } @@ -2211,13 +2212,13 @@ SECTION_DEAD static char const* const stringBase_8095D98B = "prm"; /* 8095B48C-8095B58C 00328C 0100+00 1/0 0/0 0/0 .text EvCut_Introduction__10daNpcAsh_cFi */ -BOOL daNpcAsh_c::EvCut_Introduction(int i_cutIndex) { - int* prm = dComIfGp_evmng_getMyIntegerP(i_cutIndex, ((char*)&d_a_npc_ash__stringBase0) + 0x7B); +BOOL daNpcAsh_c::EvCut_Introduction(int i_staffID) { + int* prm = dComIfGp_evmng_getMyIntegerP(i_staffID, ((char*)&d_a_npc_ash__stringBase0) + 0x7B); if (prm == NULL) { return false; } - if (dComIfGp_getEventManager().getIsAddvance(i_cutIndex)) { + if (dComIfGp_getEventManager().getIsAddvance(i_staffID)) { switch (*prm) { case 0: case 2: @@ -2243,7 +2244,7 @@ COMPILER_STRIP_GATE(0x8095D8C0, &lit_5254); /* 8095B58C-8095B83C 00338C 02B0+00 1/0 0/0 0/0 .text EvCut_Meeting__10daNpcAsh_cFi */ #ifdef NONMATCHING // literals -BOOL daNpcAsh_c::EvCut_Meeting(int i_cutIndex) { +BOOL daNpcAsh_c::EvCut_Meeting(int i_staffID) { dEvent_manager_c& evtMgr = dComIfGp_getEventManager(); fopAc_ac_c* actors[4] = { mActorMngr[2].getActorP(), @@ -2252,8 +2253,8 @@ BOOL daNpcAsh_c::EvCut_Meeting(int i_cutIndex) { mActorMngr[3].getActorP(), }; - int* cutName = (int*)evtMgr.getMyNowCutName(i_cutIndex); - if (evtMgr.getIsAddvance(i_cutIndex)) { + int* cutName = (int*)evtMgr.getMyNowCutName(i_staffID); + if (evtMgr.getIsAddvance(i_staffID)) { switch (*cutName) { case '0001': case '0002': @@ -2318,7 +2319,7 @@ COMPILER_STRIP_GATE(0x8095D8D0, &lit_5295); /* 8095B83C-8095BA80 00363C 0244+00 1/0 0/0 0/0 .text EvCut_WiretapSponsor__10daNpcAsh_cFi */ #ifdef NONMATCHING // literals -BOOL daNpcAsh_c::EvCut_WiretapSponsor(int i_cutIndex) { +BOOL daNpcAsh_c::EvCut_WiretapSponsor(int i_staffID) { dEvent_manager_c& evtMgr = dComIfGp_getEventManager(); fopAc_ac_c* actors[4] = { mActorMngr[2].getActorP(), @@ -2327,8 +2328,8 @@ BOOL daNpcAsh_c::EvCut_WiretapSponsor(int i_cutIndex) { mActorMngr[3].getActorP(), }; - int* cutName = (int*)evtMgr.getMyNowCutName(i_cutIndex); - if (evtMgr.getIsAddvance(i_cutIndex)) { + int* cutName = (int*)evtMgr.getMyNowCutName(i_staffID); + if (evtMgr.getIsAddvance(i_staffID)) { switch (*cutName) { case '0001': dComIfGp_setMesgCameraInfoActor(actors[0], actors[1], actors[2], actors[3], @@ -2378,13 +2379,13 @@ asm BOOL daNpcAsh_c::EvCut_WiretapSponsor(int param_0) { /* 8095BA80-8095BC38 003880 01B8+00 2/0 0/0 0/0 .text EvCut_WiretapEntrant__10daNpcAsh_cFi */ #ifdef NONMATCHING -BOOL daNpcAsh_c::EvCut_WiretapEntrant(int i_cutIndex) { - int* prm = dComIfGp_evmng_getMyIntegerP(i_cutIndex, "prm"); +BOOL daNpcAsh_c::EvCut_WiretapEntrant(int i_staffID) { + int* prm = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm == NULL) { return false; } - if (dComIfGp_getEventManager().getIsAddvance(i_cutIndex)) { + if (dComIfGp_getEventManager().getIsAddvance(i_staffID)) { switch (*prm) { case 0: setExpression(EXPR_NONE, -1.0f); diff --git a/rel/d/a/npc/d_a_npc_the/d_a_npc_the.cpp b/rel/d/a/npc/d_a_npc_the/d_a_npc_the.cpp index dd5c0f0feba..381c1541c3a 100644 --- a/rel/d/a/npc/d_a_npc_the/d_a_npc_the.cpp +++ b/rel/d/a/npc/d_a_npc_the/d_a_npc_the.cpp @@ -794,7 +794,7 @@ daNpcThe_Param_c::param const daNpcThe_Param_c::m = { 300.0f, // mAttnUpperY -300.0f, // mAttnLowerY 60, - 8, + 8, // mDamageTimer 0, // mTestExpression 0, // mTestMotion 0, // mTestLookMode @@ -2192,16 +2192,16 @@ asm BOOL daNpcThe_c::test(void* param_0) { /* 80AF923C-80AF9244 001C5C 0008+00 2/0 0/0 0/0 .text EvCut_TwResistance__10daNpcThe_cFi */ -BOOL daNpcThe_c::EvCut_TwResistance(int i_cutIdx) { +BOOL daNpcThe_c::EvCut_TwResistance(int i_staffID) { return true; } /* 80AF9244-80AF9338 001C64 00F4+00 1/0 0/0 0/0 .text EvCut_Introduction__10daNpcThe_cFi */ -BOOL daNpcThe_c::EvCut_Introduction(int i_cutIdx) { +BOOL daNpcThe_c::EvCut_Introduction(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); - int* cut_name = (int*)event_manager.getMyNowCutName(i_cutIdx); - if (event_manager.getIsAddvance(i_cutIdx)) { + int* cut_name = (int*)event_manager.getMyNowCutName(i_staffID); + if (event_manager.getIsAddvance(i_staffID)) { switch (*cut_name) { case '0001': case '0002': @@ -2737,8 +2737,9 @@ BOOL daNpcThe_c::doEvent() { } else { int staff_id = event_manager.getMyStaffId(l_myName, this, -1); if (staff_id != -1) { - mCutIndex = staff_id; - int act_idx = event_manager.getMyActIdx(staff_id, mEvtCutNameList, 4, 0, 0); + mStaffID = staff_id; + int act_idx = event_manager.getMyActIdx(staff_id, mEvtCutNameList, + ARRAY_SIZE(mEvtCutNameList), 0, 0); if (act_idx > 0 && act_idx < 4) { if ((this->*mEvtCutList[act_idx])(staff_id)) { event_manager.cutEnd(staff_id); @@ -2771,9 +2772,9 @@ BOOL daNpcThe_c::doEvent() { } } else { mMsgTimer = 0; - if (mCutIndex != -1) { + if (mStaffID != -1) { mMode = 1; - mCutIndex = -1; + mStaffID = -1; } } return ret; diff --git a/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.cpp b/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.cpp index a32468c9f74..3d326187f41 100644 --- a/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.cpp +++ b/rel/d/a/npc/d_a_npc_zra/d_a_npc_zra.cpp @@ -457,7 +457,7 @@ daNpc_zrA_Param_c::param const daNpc_zrA_Param_c::m = { 300.0f, // mAttnUpperY -300.0f, // mAttnLowerY 60, - 8, + 8, // mDamageTimer 0, // mTestExpression 0, // mTestMotion 0, // mTestLookMode @@ -3159,8 +3159,8 @@ void daNpc_zrA_c::setAttnPos() { mEyeAngle.x = mEyeAngle.y = 0; } - f32 height = 0.0f; - f32 radius = 0.0f; + f32 extra_height = 0.0f; + f32 extra_radius = 0.0f; vec2.set(0.0f, 0.0f, 0.0f); if ((mType == TYPE_WAIT || mType == TYPE_SPA) && mActionType != ACT_TYPE_0) { if (mType == TYPE_SPA || (mType == TYPE_WAIT @@ -3171,7 +3171,7 @@ void daNpc_zrA_c::setAttnPos() { mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(29)); mDoMtx_stack_c::multVecZero(¢er); center.y = current.pos.y; - radius = 70.0f; + extra_radius = 70.0f; } else { center = current.pos; } @@ -3181,10 +3181,10 @@ void daNpc_zrA_c::setAttnPos() { attention_info.position.set(vec5.x, vec5.y + 40.0f, vec5.z); } else { if (mType == TYPE_TOBIKOMI) { - height = 700.0f; - radius = 800.0f; + extra_height = 700.0f; + extra_radius = 800.0f; } else if (mType == TYPE_SWIM && mPath.getPathInfo() != NULL) { - height = -150.0f; + extra_height = -150.0f; } center = current.pos; @@ -3192,7 +3192,7 @@ void daNpc_zrA_c::setAttnPos() { } if (!mHide) { - if (field_0x954 == 0) { + if (mDamageTimer == 0) { if (mType == TYPE_TOBIKOMI) { mCcCyl.SetTgType(0x2020); mCcCyl.SetTgSPrm(0x3f); @@ -3222,8 +3222,8 @@ void daNpc_zrA_c::setAttnPos() { } mCcCyl.SetC(center); - mCcCyl.SetH(daNpc_zrA_Param_c::m.mCylH + height); - mCcCyl.SetR(daNpc_zrA_Param_c::m.mWallR + radius); + mCcCyl.SetH(daNpc_zrA_Param_c::m.mCylH + extra_height); + mCcCyl.SetR(daNpc_zrA_Param_c::m.mWallR + extra_radius); dComIfG_Ccsp()->Set(&mCcCyl); } @@ -3279,7 +3279,7 @@ asm void daNpc_zrA_c::setMtx() { // matches with literals bool daNpc_zrA_c::setExpressionAnm(int i_idx, bool i_modify) { J3DAnmTransform* bck_anm = NULL; - int attr = 0; + int attr = J3DFrameCtrl::LOOP_ONCE_e; mAnmFlags &= ~ANM_EXPRESSION_FLAGS; if (l_bckGetParamList[i_idx].fileIdx >= 0) { @@ -3306,41 +3306,41 @@ bool daNpc_zrA_c::setExpressionAnm(int i_idx, bool i_modify) { break; case ANM_FH_TALK_NOMAL: res = setExpressionBtp(0); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_FH_SADSIT_A: res = setExpressionBtp(1); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_FH_SADSIT_B: res = setExpressionBtp(2); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_FH_SADSIT_C: res = setExpressionBtp(3); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_FH_SADSIT_D: res = setExpressionBtp(4); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_FH_SADSIT_E: res = setExpressionBtp(5); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_F_LOOKING_SP: res = setExpressionBtp(0); break; case ANM_FH_LOOKING_SP: res = setExpressionBtp(0); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_F_LOOKUP: res = setExpressionBtp(0); break; case ANM_FH_LOOKUP: res = setExpressionBtp(0); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_F_TALK_SWIM_SP: res = setExpressionBtp(0); @@ -3353,14 +3353,14 @@ bool daNpc_zrA_c::setExpressionAnm(int i_idx, bool i_modify) { break; case ANM_FH_SPA_WAIT_A: res = setExpressionBtp(0); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case ANM_F_SPA_TALK_B: res = setExpressionBtp(6); break; case ANM_FH_SPA_WAIT_B: res = setExpressionBtp(7); - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; default: bck_anm = NULL; @@ -3400,7 +3400,7 @@ asm bool daNpc_zrA_c::setExpressionAnm(int param_0, bool param_1) { // matches with literals bool daNpc_zrA_c::setExpressionBtp(int i_idx) { J3DAnmTexPattern* btp_anm = NULL; - int attr = 0; + int attr = J3DFrameCtrl::LOOP_ONCE_e; mAnmFlags &= ~(ANM_PLAY_BTP | ANM_PAUSE_BTP | ANM_FLAG_800); if (l_btpGetParamList[i_idx].fileIdx >= 0) { @@ -3416,7 +3416,7 @@ bool daNpc_zrA_c::setExpressionBtp(int i_idx) { case 4: case 5: case 7: - attr = 2; + attr = J3DFrameCtrl::LOOP_REPEAT_e; break; case 6: break; @@ -3467,7 +3467,7 @@ void daNpc_zrA_c::setMotionAnm(int i_idx, f32 i_morf) { J3DAnmTransformKey* bck_anm = NULL; J3DAnmTextureSRTKey* btk_anm = NULL; int btk_idx = 0; - int attr = 2; + int attr = J3DFrameCtrl::LOOP_REPEAT_e; mBaseMotionAnm = i_idx; if (mAcch.ChkWaterIn()) { @@ -3505,7 +3505,7 @@ void daNpc_zrA_c::setMotionAnm(int i_idx, f32 i_morf) { case ANM_FLOAT_SP: case ANM_FLOAT_B_SP: case ANM_STEP_SP: - attr = 0; + attr = J3DFrameCtrl::LOOP_ONCE_e; break; case ANM_FALLSWIM: case ANM_SADSIT_A: @@ -5663,11 +5663,11 @@ SECTION_DEAD static char const* const stringBase_80B8CE7F = "NO_RESPONSE"; /* 80B7DF40-80B7E668 005B20 0728+00 1/1 0/0 0/0 .text doEvent__11daNpc_zrA_cFv */ #ifdef NONMATCHING -// issues with loading g_dComIfG_gameInfo.play.mEvent +// regalloc BOOL daNpc_zrA_c::doEvent() { BOOL ret = false; - if (dComIfGp_event_runCheck()) { + if (dComIfGp_event_runCheck() != false) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); if (eventInfo.checkCommandTalk() || eventInfo.i_checkCommandDemoAccrpt()) { mOrderNewEvt = false; @@ -5682,7 +5682,7 @@ BOOL daNpc_zrA_c::doEvent() { } else if (mType == TYPE_WATERFALL) { if (chkAction(&talkSwim)) { (this->*mpActionFn)(NULL); - } else if (!dComIfGp_event_chkTalkXY() || dComIfGp_evmng_ChkPresentEnd()) { + } else if (dComIfGp_event_chkTalkXY() == false || dComIfGp_evmng_ChkPresentEnd()) { setAction(&talkSwim); } } else if (mType == TYPE_SEARCH) { @@ -5734,8 +5734,9 @@ BOOL daNpc_zrA_c::doEvent() { int staff_id = event_manager.getMyStaffId(mStaffName, this, 0); if (staff_id != -1) { - mCutIndex = staff_id; - int act_idx = event_manager.getMyActIdx(staff_id, mEvtCutNameList, 11, 0, 0); + mStaffID = staff_id; + int act_idx = event_manager.getMyActIdx(staff_id, mEvtCutNameList, + ARRAY_SIZE(mEvtCutNameList), 0, 0); if ((this->*mEvtCutList[act_idx])(staff_id)) { event_manager.cutEnd(staff_id); } @@ -5804,9 +5805,9 @@ BOOL daNpc_zrA_c::doEvent() { } if (!ret) { - if (mCutIndex != -1) { + if (mStaffID != -1) { mpActionFn = NULL; - mCutIndex = -1; + mStaffID = -1; } mMsgTimer = 0; } @@ -6561,7 +6562,7 @@ BOOL daNpc_zrA_c::wait(void* param_0) { waitCalc(); } - if (field_0x954 == 0 && !mTwilight) { + if (mDamageTimer == 0 && !mTwilight) { BOOL player_attn = mActorMngr[0].getActorP() != NULL; if (chkFindPlayer2(player_attn, shape_angle.y)) { if (!player_attn) { @@ -6763,7 +6764,7 @@ BOOL daNpc_zrA_c::waitLake(void* param_0) { // fallthrough case 2: - if (field_0x954 == 0 && !mTwilight) { + if (mDamageTimer == 0 && !mTwilight) { if (mActorMngr[0].getActorP() != NULL) { if (!chkFindPlayer()) { mTurnMode = 0; @@ -6817,7 +6818,7 @@ BOOL daNpc_zrA_c::talk(void* param_0) { switch (mMode) { case 0: - if (field_0x954 != 0) { + if (mDamageTimer != 0) { break; } @@ -6908,7 +6909,7 @@ SECTION_DEAD static char const* const stringBase_80B8CE8B = "prm"; /* 80B806FC-80B80860 0082DC 0164+00 1/0 0/0 0/0 .text ECut_talkMulti__11daNpc_zrA_cFi */ #ifdef NONMATCHING // matches with literals -BOOL daNpc_zrA_c::ECut_talkMulti(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_talkMulti(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; @@ -6917,12 +6918,12 @@ BOOL daNpc_zrA_c::ECut_talkMulti(int i_cutIdx) { actors[0] = this; actors[1] = mActorMngr[2].getActorP(); - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: mActorMngr[2].remove(); @@ -7299,7 +7300,7 @@ asm BOOL daNpc_zrA_c::railSwim() { BOOL daNpc_zrA_c::waitSwim() { calcModulation(); - if (field_0x954 == 0) { + if (mDamageTimer == 0) { BOOL player_attn = mActorMngr[0].getActorP() != NULL; if (chkFindPlayer2(player_attn, shape_angle.y)) { if (!player_attn) { @@ -7764,16 +7765,16 @@ asm void daNpc_zrA_c::calcWaitSwim(BOOL param_0) { /* 80B826F0-80B82C54 00A2D0 0564+00 1/0 0/0 0/0 .text ECut_talkSwim__11daNpc_zrA_cFi */ #ifdef NONMATCHING // matches with literals -BOOL daNpc_zrA_c::ECut_talkSwim(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_talkSwim(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: mAcch.ClrGrndNone(); @@ -7930,7 +7931,7 @@ BOOL daNpc_zrA_c::waitWaterfall(void* param_0) { mSwimMode = SWIM_WAIT; } - if (field_0x954 == 0 && !mTwilight) { + if (mDamageTimer == 0 && !mTwilight) { BOOL player_attn = mActorMngr[0].getActorP() != NULL; if (chkFindPlayer2(player_attn, shape_angle.y)) { if (!player_attn) { @@ -8160,7 +8161,7 @@ BOOL daNpc_zrA_c::talkSwim(void* param_0) { switch (mMode) { case 0: - if (field_0x954 != 0) { + if (mDamageTimer != 0) { break; } setExpression(EXPR_NONE, -1.0f); @@ -8236,16 +8237,16 @@ asm BOOL daNpc_zrA_c::talkSwim(void* param_0) { /* 80B837E8-80B83D08 00B3C8 0520+00 1/0 0/0 0/0 .text ECut_carryWaterfall__11daNpc_zrA_cFi */ #ifdef NONMATCHING // matches with literals and generics -BOOL daNpc_zrA_c::ECut_carryWaterfall(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_carryWaterfall(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: dComIfGp_getEvent().setSkipProc(this, dEv_defaultSkipProc, 0); @@ -8382,16 +8383,16 @@ asm BOOL daNpc_zrA_c::ECut_carryWaterfall(int param_0) { /* 80B83D08-80B83FA4 00B8E8 029C+00 1/0 0/0 0/0 .text ECut_carryWaterfallSkip__11daNpc_zrA_cFi */ #ifdef NONMATCHING // matches with literals and generics -BOOL daNpc_zrA_c::ECut_carryWaterfallSkip(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_carryWaterfallSkip(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: Z2GetAudioMgr()->subBgmStop(); @@ -9603,19 +9604,19 @@ COMPILER_STRIP_GATE(0x80B8CCB4, &lit_9935); /* 80B86FAC-80B872F0 00EB8C 0344+00 3/0 0/0 0/0 .text ECut_beforeBlastzrR__11daNpc_zrA_cFi */ #ifdef NONMATCHING // matches with literals -BOOL daNpc_zrA_c::ECut_beforeBlastzrR(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_beforeBlastzrR(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; cXyz player_pos = daPy_getPlayerActorClass()->current.pos; cXyz canoe_pos(41744.92f, -6498.715f, -18601.64f); daCanoe_c* canoe; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: daNpcF_offTmpBit(0xb); @@ -9756,19 +9757,19 @@ COMPILER_STRIP_GATE(0x80B8CCD0, &lit_9991); */ #ifdef NONMATCHING // matches with literals -BOOL daNpc_zrA_c::ECut_afterBlastzrR(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_afterBlastzrR(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; cXyz player_pos = daPy_getPlayerActorClass()->current.pos; cXyz canoe_pos(40944.92f, -6498.715f, -18601.64f); daCanoe_c* canoe; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: { cXyz target_pos(32651.5f, -5900.219f, -22464.53f); @@ -9901,7 +9902,7 @@ COMPILER_STRIP_GATE(0x80B8CCF8, &lit_10585); */ #ifdef NONMATCHING // matches with literals and generics -BOOL daNpc_zrA_c::ECut_thanksBlast(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_thanksBlast(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; @@ -9909,12 +9910,12 @@ BOOL daNpc_zrA_c::ECut_thanksBlast(int i_cutIdx) { f32 water_height = mAcch.m_wtr.GetHeight(); daPy_py_c* player = daPy_getPlayerActorClass(); cXyz player_pos = player->current.pos; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: daNpcF_offTmpBit(0xb); @@ -10247,7 +10248,7 @@ asm BOOL daNpc_zrA_c::ECut_thanksBlast(int param_0) { /* 80B88B04-80B8A064 0106E4 1560+00 1/0 0/0 0/0 .text ECut_resultAnnounce__11daNpc_zrA_cFi */ #ifdef NONMATCHING // matches with literals and generics -BOOL daNpc_zrA_c::ECut_resultAnnounce(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_resultAnnounce(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; @@ -10255,12 +10256,12 @@ BOOL daNpc_zrA_c::ECut_resultAnnounce(int i_cutIdx) { f32 water_height = mAcch.m_wtr.GetHeight(); daPy_py_c* player = daPy_getPlayerActorClass(); cXyz player_pos = player->current.pos; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: daNpcF_offTmpBit(0xb); @@ -11191,18 +11192,18 @@ COMPILER_STRIP_GATE(0x80B8CD2C, &lit_11937); */ #ifdef NONMATCHING // matches with literals -BOOL daNpc_zrA_c::ECut_searchPrince1(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_searchPrince1(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; fopAc_ac_c* talk_actors[2] = {this, mActorMngr[2].getActorP()}; f32 water_y; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: dComIfGs_onSwitch(mSwitch1, fopAcM_GetRoomNo(this)); @@ -11347,17 +11348,17 @@ asm BOOL daNpc_zrA_c::ECut_searchPrince1(int param_0) { */ #ifdef NONMATCHING // matches with literals -BOOL daNpc_zrA_c::ECut_searchPrince2(int i_cutIdx) { +BOOL daNpc_zrA_c::ECut_searchPrince2(int i_staffID) { dEvent_manager_c& event_manager = dComIfGp_getEventManager(); BOOL ret = false; int prm = -1; f32 water_y; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_cutIdx, "prm"); + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); if (prm_p != NULL) { prm = *prm_p; } - if (event_manager.getIsAddvance(i_cutIdx)) { + if (event_manager.getIsAddvance(i_staffID)) { switch (prm) { case 0: setLookMode(LOOK_ACTOR); diff --git a/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.cpp b/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.cpp index eca44ac4085..0f69b43ed98 100644 --- a/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.cpp +++ b/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.cpp @@ -1,9 +1,13 @@ /** * @file d_a_npc_zrz.cpp - * + * NPC - Rutela */ #include "rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz.h" +#include "SSystem/SComponent/c_math.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "rel/d/a/obj/d_a_obj_grave_stone/d_a_obj_grave_stone.h" +#include "rel/d/a/obj/d_a_obj_zra_rock/d_a_obj_zra_rock.h" #include "dol2asm.h" // @@ -358,140 +362,142 @@ SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { /* 80B9B2A4-80B9B2AC 000020 0008+00 0/1 0/0 0/0 .data l_bmdGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_bmdGetParamList[8] = { - 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, +static daNpc_GetParam1 l_bmdGetParamList[1] = { + {9, 0}, }; #pragma pop /* 80B9B2AC-80B9B2B4 000028 0008+00 0/1 0/0 0/0 .data l_bmdGTGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_bmdGTGetParamList[8] = { - 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x01, +static daNpc_GetParam1 l_bmdGTGetParamList[1] = { + {13, 1}, // gt }; #pragma pop /* 80B9B2B4-80B9B2DC 000030 0028+00 0/2 0/0 0/0 .data l_bckGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_bckGetParamList[40] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +static daNpc_GetParam1 l_bckGetParamList[5] = { + {-1, 0}, + {-1, 0}, + {6, 0}, + {0, 0}, + {0, 0}, }; #pragma pop /* 80B9B2DC-80B9B304 000058 0028+00 0/2 0/0 0/0 .data l_bckGTGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_bckGTGetParamList[40] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, +static daNpc_GetParam1 l_bckGTGetParamList[5] = { + {-1, 1}, + {8, 1}, // f_talk_a + {10, 1}, // wait_gt_a + {9, 1}, // lead + {7, 1}, // comeon }; #pragma pop /* 80B9B304-80B9B30C 000080 0008+00 0/1 0/0 0/0 .data l_btpGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_btpGetParamList[8] = { - 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, +static daNpc_GetParam1 l_btpGetParamList[1] = { + {15, 0}, }; #pragma pop /* 80B9B30C-80B9B314 000088 0008+00 0/1 0/0 0/0 .data l_btpGTGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_btpGTGetParamList[8] = { - 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, +static daNpc_GetParam1 l_btpGTGetParamList[1] = { + {19, 1}, // gt }; #pragma pop /* 80B9B314-80B9B31C 000090 0008+00 0/2 0/0 0/0 .data l_btkGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_btkGetParamList[8] = { - 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, +static daNpc_GetParam1 l_btkGetParamList[1] = { + {12, 0}, }; #pragma pop /* 80B9B31C-80B9B324 000098 0008+00 0/2 0/0 0/0 .data l_btkGTGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_btkGTGetParamList[8] = { - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, +static daNpc_GetParam1 l_btkGTGetParamList[1] = { + {16, 1}, // gt }; #pragma pop /* 80B9B324-80B9B364 0000A0 0040+00 0/1 0/0 0/0 .data l_evtGetParamList */ #pragma push #pragma force_active on -SECTION_DATA static u8 l_evtGetParamList[64] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, +static daNpc_GetParam1 l_evtGetParamList[8] = { + {0, 0}, + {1, 1}, + {2, 1}, + {3, 1}, + {4, 1}, + {5, 1}, + {6, 1}, + {7, 1}, }; #pragma pop /* 80B9B364-80B9B370 0000E0 000C+00 1/0 0/0 0/0 .data l_loadRes_ZRZa */ -SECTION_DATA static u8 l_loadRes_ZRZa[12] = { - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; +static int l_loadRes_ZRZa[3] = {0, -1, -1}; /* 80B9B370-80B9B37C 0000EC 000C+00 1/0 0/0 0/0 .data l_loadRes_ZRZ_GT */ -SECTION_DATA static u8 l_loadRes_ZRZ_GT[12] = { - 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; +static int l_loadRes_ZRZ_GT[3] = {1, -1, -1}; /* 80B9B37C-80B9B388 0000F8 000C+00 1/0 0/0 0/0 .data l_loadRes_ZRZ0 */ -SECTION_DATA static u8 l_loadRes_ZRZ0[12] = { - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; +static int l_loadRes_ZRZ0[3] = {0, -1, -1}; /* 80B9B388-80B9B394 -00001 000C+00 2/2 0/0 0/0 .data l_loadRes_list */ -SECTION_DATA static void* l_loadRes_list[3] = { - (void*)&l_loadRes_ZRZa, - (void*)&l_loadRes_ZRZ_GT, - (void*)&l_loadRes_ZRZ0, +static int* l_loadRes_list[3] = { + l_loadRes_ZRZa, + l_loadRes_ZRZ_GT, + l_loadRes_ZRZ0, }; /* 80B9B394-80B9B39C -00001 0008+00 2/8 0/0 0/0 .data l_resNames */ -SECTION_DATA static void* l_resNames[2] = { - (void*)&d_a_npc_zrz__stringBase0, - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x4), +static char* l_resNames[2] = { + "zrZ", + "zrZ_GT", }; /* 80B9B39C-80B9B3BC -00001 0020+00 1/2 0/0 0/0 .data l_evtNames */ -SECTION_DATA static void* l_evtNames[8] = { - (void*)NULL, - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0xB), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x17), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x21), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x2E), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x3A), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x44), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x51), +static char* l_evtNames[8] = { + NULL, + "HELP_PRINCE", + "COME_HERE", + "RESTORE_LINK", + "CLOTHES_GET", + "GET_AFTER", + "SEAL_RELEASE", + "SR_SKIP", }; /* 80B9B3BC-80B9B3C0 -00001 0004+00 0/1 0/0 0/0 .data l_myName */ #pragma push #pragma force_active on -SECTION_DATA static void* l_myName = (void*)&d_a_npc_zrz__stringBase0; +static char* l_myName = "zrZ"; #pragma pop /* 80B9B3C0-80B9B3E0 -00001 0020+00 0/1 0/0 0/0 .data mEvtCutNameList__11daNpc_zrZ_c */ #pragma push #pragma force_active on -SECTION_DATA void* daNpc_zrZ_c::mEvtCutNameList[8] = { - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x59), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0xB), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x17), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x21), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x2E), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x3A), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x44), - (void*)(((char*)&d_a_npc_zrz__stringBase0) + 0x51), +char* daNpc_zrZ_c::mEvtCutNameList[8] = { + "", + "HELP_PRINCE", + "COME_HERE", + "RESTORE_LINK", + "CLOTHES_GET", + "GET_AFTER", + "SEAL_RELEASE", + "SR_SKIP", }; #pragma pop @@ -566,6 +572,18 @@ SECTION_DATA static void* lit_4028[3] = { #pragma pop /* 80B9B434-80B9B494 0001B0 0060+00 0/2 0/0 0/0 .data mEvtCutList__11daNpc_zrZ_c */ +#ifdef NONMATCHING +daNpc_zrZ_c::EventFn daNpc_zrZ_c::mEvtCutList[8] = { + NULL, + &ECut_helpPrince, + &ECut_comeHere, + &ECut_restoreLink, + &ECut_clothesGet, + &ECut_getAfter, + &ECut_sealRelease, + &ECut_srSkip, +}; +#else #pragma push #pragma force_active on SECTION_DATA u8 daNpc_zrZ_c::mEvtCutList[96] = { @@ -577,6 +595,7 @@ SECTION_DATA u8 daNpc_zrZ_c::mEvtCutList[96] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #pragma pop +#endif /* 80B9B494-80B9B4A0 -00001 000C+00 1/1 0/0 0/0 .data @4555 */ SECTION_DATA static void* lit_4555[3] = { @@ -940,6 +959,12 @@ SECTION_DATA extern void* __vt__15daNpcF_Lookat_c[3] = { }; /* 80B93DCC-80B93F84 0000EC 01B8+00 1/1 0/0 0/0 .text __ct__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// inlining +daNpc_zrZ_c::daNpc_zrZ_c() { + /* empty function */ +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -948,6 +973,7 @@ asm daNpc_zrZ_c::daNpc_zrZ_c() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/__ct__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B93F84-80B93FCC 0002A4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ #pragma push @@ -972,29 +998,71 @@ extern "C" asm void __dt__8cM3dGAabFv() { #pragma pop /* 80B94014-80B9423C 000334 0228+00 1/0 0/0 0/0 .text __dt__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// data loading +daNpc_zrZ_c::~daNpc_zrZ_c() { + for (int i = 0; l_loadRes_list[mType][i] >= 0; i++) { + dComIfG_resDelete(&mPhase[i], l_resNames[l_loadRes_list[mType][i]]); + } + + if (heap != NULL) { + mpMorf->stopZelAnime(); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm daNpc_zrZ_c::~daNpc_zrZ_c() { +// asm daNpc_zrZ_c::~daNpc_zrZ_c() { +extern "C" asm void __dt__11daNpc_zrZ_cFv() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/__dt__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9AFEC-80B9B070 000000 0084+00 22/22 0/0 0/0 .rodata m__17daNpc_zrZ_Param_c */ -SECTION_RODATA u8 const daNpc_zrZ_Param_c::m[132] = { - 0x44, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x44, 0xAF, 0x00, - 0x00, 0x43, 0x7F, 0x00, 0x00, 0x44, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x20, 0x00, 0x00, 0xC1, - 0x20, 0x00, 0x00, 0x41, 0xF0, 0x00, 0x00, 0xC1, 0x20, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00, - 0xC2, 0x34, 0x00, 0x00, 0x3F, 0x19, 0x99, 0x9A, 0x41, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, - 0x06, 0x00, 0x05, 0x00, 0x06, 0x42, 0xA0, 0x00, 0x00, 0x43, 0xFA, 0x00, 0x00, 0x43, 0x96, - 0x00, 0x00, 0xC3, 0x96, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x44, 0x96, 0x00, 0x00, 0x44, 0x7A, 0x00, 0x00, 0x45, 0x3B, 0x80, 0x00, - 0x41, 0xC8, 0x00, 0x00, 0x43, 0xC8, 0x00, 0x00, 0x43, 0x48, 0x00, 0x00, +daNpc_zrZ_Param_c::param const daNpc_zrZ_Param_c::m = { + 700.0f, // mAttnOffsetY + 0.0f, // mGravity + 1.0f, // mScale + 1400.0f, // mShadowDepth + 255.0f, // mCcWeight + 700.0f, // mCylH + 0.0f, // mWallH + 30.0f, // mWallR + 0.0f, // mBodyUpAngle + 0.0f, // mBodyDownAngle + 10.0f, // mBodyLeftAngle + -10.0f, // mBodyRightAngle + 30.0f, // mHeadUpAngle + -10.0f, // mHeadDownAngle + 45.0f, // mHeadLeftAngle + -45.0f, // mHeadRightAngle + 0.6f, // mNeckAngleScl + 12.0f, // mMorfFrames + 3, // mSpeakDistIdx + 6, // mSpeakAngleIdx + 5, // mTalkDistIdx + 6, // mTalkAngleIdx + 80.0f, // mAttnFovY + 500.0f, // mAttnRadius + 300.0f, // mAttnUpperY + -300.0f, // mAttnLowerY + 60, + 8, // mDamageTimer + 0, // mTestExpression + 0, // mTestMotion + 0, // mTestLookMode + false, // mTest + 1200.0f, + 1000.0f, + 3000.0f, + 25.0f, + 400.0f, + 200.0f, }; -COMPILER_STRIP_GATE(0x80B9AFEC, &daNpc_zrZ_Param_c::m); /* 80B9B070-80B9B074 000084 0004+00 0/1 0/0 0/0 .rodata @4449 */ #pragma push @@ -1025,14 +1093,78 @@ COMPILER_STRIP_GATE(0x80B9B07C, &lit_4452); #pragma pop /* 80B9423C-80B9453C 00055C 0300+00 1/1 0/0 0/0 .text create__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +cPhs__Step daNpc_zrZ_c::create() { + fopAcM_SetupActor(this, daNpc_zrZ_c); + + mType = getTypeFromParam(); + mDemoMode = getDemoMode(); + mSwitch1 = home.angle.z & 0xff; + mSwitch2 = (home.angle.z >> 8) & 0xff; + mSwitch3 = fopAcM_GetParam(this) >> 0x18; + if (home.angle.x != 0xffff) { + mFlowID = home.angle.x; + } else { + mFlowID = -1; + } + + if (isDelete()) { + return cPhs_ERROR_e; + } + + int res_count = 0; + int i; + for (i = 0; l_loadRes_list[mType][i] >= 0; i++) { + cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase[i], + l_resNames[l_loadRes_list[mType][i]]); + if (step == cPhs_ERROR_e || step == cPhs_UNK3_e) { + return cPhs_ERROR_e; + } + if (step == cPhs_COMPLEATE_e) { + res_count++; + } + } + + if (res_count == i) { + if (!fopAcM_entrySolidHeap(this, createHeapCallBack, 0x5230)) { + return cPhs_ERROR_e; + } + + fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); + fopAcM_setCullSizeBox(this, -300.0f, -50.0f, -300.0f, 300.0f, 800.0f, 300.0f); + mCreatureSound.init(¤t.pos, &eyePos, 3, 1); + mAcchCir.SetWall(daNpc_zrZ_Param_c::m.mWallR, daNpc_zrZ_Param_c::m.mWallH); + mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, + fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this)); + mCcStts.Init(daNpc_zrZ_Param_c::m.mCcWeight, 0, this); + mCcCyl.Set(mCcDCyl); + mCcCyl.SetStts(&mCcStts); + mCcCyl.SetTgHitCallback(tgHitCallBack); + mAcch.CrrPos(dComIfG_Bgsp()); + mGndChk = mAcch.m_gnd; + mGroundH = mAcch.GetGroundH(); + + setEnvTevColor(); + setRoomNo(); + reset(); + Execute(); + + return cPhs_COMPLEATE_e; + } else { + return cPhs_INIT_e; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::create() { +asm cPhs__Step daNpc_zrZ_c::create() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/create__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B080-80B9B084 000094 0004+00 5/10 0/0 0/0 .rodata @4521 */ @@ -1049,14 +1181,66 @@ SECTION_RODATA static u8 const lit_4522[4] = { COMPILER_STRIP_GATE(0x80B9B084, &lit_4522); /* 80B9453C-80B94838 00085C 02FC+00 1/1 0/0 0/0 .text CreateHeap__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +int daNpc_zrZ_c::CreateHeap() { + J3DModelData* model_data = NULL; + if (mType == 1) { + if (l_bmdGTGetParamList[0].fileIdx >= 0) { + model_data = static_cast( + dComIfG_getObjectRes(l_resNames[l_bmdGTGetParamList[0].arcIdx], + l_bmdGTGetParamList[0].fileIdx)); + } + } else { + if (l_bmdGetParamList[0].fileIdx >= 0) { + model_data = static_cast( + dComIfG_getObjectRes(l_resNames[l_bmdGetParamList[0].arcIdx], + l_bmdGetParamList[0].fileIdx)); + } + } + + mpMorf = new mDoExt_McaMorfSO(model_data, NULL, NULL, NULL, -1, 1.0f, 0, -1, + &mCreatureSound, 0x80000, 0x11020284); + if (mpMorf != NULL && mpMorf->getModel() == NULL) { + mpMorf->stopZelAnime(); + mpMorf = NULL; + } + if (mpMorf == NULL) { + return 0; + } + + if (!mInvisibleModel.create(mpMorf->getModel(), 1)) { + return 0; + } + + J3DModel* model = mpMorf->getModel(); + for (u16 i = 0; i < model_data->getJointNum(); i++) { + model_data->getJointNodePointer(i)->setCallBack(ctrlJointCallBack); + } + model->setUserArea((u32)this); + + mpMatAnm = new daNpcF_MatAnm_c(); + if (mpMatAnm == NULL) { + return 0; + } + + if (!setExpressionAnm(ANM_F_TALK_A, false)) { + return 0; + } + setMotionAnm(ANM_WAIT_GT_A, 0.0f); + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::CreateHeap() { +asm int daNpc_zrZ_c::CreateHeap() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/CreateHeap__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B94838-80B94874 000B58 003C+00 1/1 0/0 0/0 .text __dt__15J3DTevKColorAnmFv */ #pragma push @@ -1169,34 +1353,38 @@ extern "C" asm void __ct__14J3DMatColorAnmFv() { #pragma pop /* 80B949F4-80B94A28 000D14 0034+00 1/1 0/0 0/0 .text Delete__11daNpc_zrZ_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::Delete() { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Delete__11daNpc_zrZ_cFv.s" +int daNpc_zrZ_c::Delete() { + this->~daNpc_zrZ_c(); + return 1; } -#pragma pop /* 80B94A28-80B94A48 000D48 0020+00 2/2 0/0 0/0 .text Execute__11daNpc_zrZ_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::Execute() { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Execute__11daNpc_zrZ_cFv.s" +int daNpc_zrZ_c::Execute() { + return execute(); } -#pragma pop /* 80B94A48-80B94B34 000D68 00EC+00 1/1 0/0 0/0 .text Draw__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +int daNpc_zrZ_c::Draw() { + mpMorf->getModel()->getModelData()->getMaterialNodePointer(1)->setMaterialAnm(mpMatAnm); + if (mType == 1) { + return draw(chkAction(&test), false, daNpc_zrZ_Param_c::m.mShadowDepth, NULL, false); + } else { + return daNpcF_c::draw(chkAction(&test), false, daNpc_zrZ_Param_c::m.mShadowDepth, + NULL, false); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::Draw() { +asm int daNpc_zrZ_c::Draw() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/Draw__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B088-80B9B08C 00009C 0004+00 1/1 0/0 0/0 .rodata @4675 */ @@ -1210,15 +1398,96 @@ SECTION_RODATA static u8 const lit_4677[8] = { COMPILER_STRIP_GATE(0x80B9B08C, &lit_4677); /* 80B94B34-80B94E18 000E54 02E4+00 1/1 0/0 0/0 .text draw__11daNpc_zrZ_cFiifP11_GXColorS10i */ +#ifdef NONMATCHING +// matches with literals +int daNpc_zrZ_c::draw(int i_isTest, int param_1, f32 i_shadowDepth, _GXColorS10* i_fogColor, + int i_hideDamage) { + f32 damage_ratio, frame; + J3DModel* model = mpMorf->getModel(); + J3DModelData* modelData = model->getModelData(); + field_0x9f3 = 1; + + if (!mHide) { + if (!i_hideDamage && mDamageTimer != 0 && mTotalDamageTimer != 0) { + damage_ratio = (f32)mDamageTimer / (f32)mTotalDamageTimer; + } else { + damage_ratio = 0.0f; + } + + if (cM3d_IsZero_inverted(damage_ratio)) { + tevStr.mFogColor.r = (s16)(damage_ratio * 20.0f); + tevStr.mFogColor.g = 0; + } else if (i_isTest) { + tevStr.mFogColor.g = 20; + tevStr.mFogColor.r = 0; + } else if (i_fogColor != NULL) { + tevStr.mFogColor.r = i_fogColor->r; + tevStr.mFogColor.g = i_fogColor->g; + tevStr.mFogColor.b = i_fogColor->b; + tevStr.mFogColor.a = i_fogColor->a; + } else { + tevStr.mFogColor.g = 0; + tevStr.mFogColor.r = 0; + } + + if (tevStr.mFogColor.a == 0) { + return 1; + } + + g_env_light.settingTevStruct(7, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(model->getModelData(), &tevStr); + + if (!drawDbgInfo()) { + if (mAnmFlags & ANM_PLAY_BTP) { + mBtpAnm.entry(&modelData->getMaterialTable(), (s16)mBtpAnm.getFrame()); + } + if (mAnmFlags & ANM_PLAY_BTK) { + frame = mBtkAnm.getFrame(); + mBtkAnm.entry(&modelData->getMaterialTable(), frame); + } + if (mAnmFlags & ANM_PLAY_BRK) { + frame = mBrkAnm.getFrame(); + mBrkAnm.entry(&modelData->getMaterialTable(), frame); + } + + if (param_1) { + fopAcM_setEffectMtx(this, modelData); + } + + if (dKy_darkworld_check()) { + dComIfGd_setListDark(); + mInvisibleModel.entryDL(NULL); + dComIfGd_setList(); + } else { + mInvisibleModel.entryDL(NULL); + } + + if (mAnmFlags & ANM_PLAY_BTP) { + mBtpAnm.remove(modelData); + } + if (mAnmFlags & ANM_PLAY_BTK) { + mBtkAnm.remove(modelData); + } + if (mAnmFlags & ANM_PLAY_BRK) { + mBrkAnm.remove(modelData); + } + + drawOtherMdls(); + } + } + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::draw(int param_0, int param_1, f32 param_2, _GXColorS10* param_3, +asm int daNpc_zrZ_c::draw(int param_0, int param_1, f32 param_2, _GXColorS10* param_3, int param_4) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/draw__11daNpc_zrZ_cFiifP11_GXColorS10i.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B094-80B9B0A0 0000A8 000C+00 0/1 0/0 0/0 .rodata @4682 */ @@ -1232,76 +1501,162 @@ COMPILER_STRIP_GATE(0x80B9B094, &lit_4682); /* 80B94E18-80B950F4 001138 02DC+00 2/1 0/0 0/0 .text * ctrlJoint__11daNpc_zrZ_cFP8J3DJointP8J3DModel */ +#ifdef NONMATCHING +// matches with literals +int daNpc_zrZ_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) { + int jnt_no = i_joint->getJntNo(); + int lookat_joints[3] = {1, 3, 4}; + Mtx base_mtx, inv_rot; + cXyz pos; + + if (jnt_no == 0) { + mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(1)); + mDoMtx_stack_c::multVecZero(&mLookatPos[0]); + mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(3)); + mDoMtx_stack_c::multVecZero(&mLookatPos[1]); + mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(4)); + mDoMtx_stack_c::multVecZero(&mLookatPos[2]); + } + + mDoMtx_stack_c::copy(i_model->getAnmMtx(jnt_no)); + + switch (jnt_no) { + case 1: // backbone1 + case 3: // neck + case 4: // head + setLookatMtx(jnt_no, lookat_joints, daNpc_zrZ_Param_c::m.mNeckAngleScl); + break; + + case 14: // armL1 + case 22: // armR1 + case 29: // waist + if (jnt_no == 29) { + himoCalc(); + } + + MTXCopy(mDoMtx_stack_c::get(), base_mtx); + pos.set(base_mtx[0][3], base_mtx[1][3], base_mtx[2][3]); + base_mtx[0][3] = base_mtx[1][3] = base_mtx[2][3] = 0.0f; + + mDoMtx_stack_c::ZXYrotS(mCurAngle); + mDoMtx_stack_c::inverse(); + MTXCopy(mDoMtx_stack_c::get(), inv_rot); + + mDoMtx_stack_c::transS(pos); + mDoMtx_stack_c::ZXYrotM(mCurAngle); + mDoMtx_stack_c::ZXYrotM(mLimbAngle); + mDoMtx_stack_c::concat(inv_rot); + mDoMtx_stack_c::concat(base_mtx); + break; + } + + if (jnt_no == 1) { + mDoMtx_stack_c::YrotM(field_0x908[0].z); + mDoMtx_stack_c::ZrotM(-field_0x908[0].x); + } else if (jnt_no == 4) { + mDoMtx_stack_c::YrotM(field_0x908[2].z); + mDoMtx_stack_c::ZrotM(field_0x908[2].x); + } + + i_model->setAnmMtx(jnt_no, mDoMtx_stack_c::get()); + MTXCopy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx); + + if ((jnt_no == 4 || jnt_no == 12) && (mAnmFlags & ANM_PLAY_BCK)) { + J3DAnmTransform* bck_anm = mBckAnm.getBckAnm(); + mBckAnm.changeBckOnly(mpMorf->getAnm()); + mpMorf->changeAnm(bck_anm); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ctrlJoint(J3DJoint* param_0, J3DModel* param_1) { +asm int daNpc_zrZ_c::ctrlJoint(J3DJoint* param_0, J3DModel* param_1) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlJoint__11daNpc_zrZ_cFP8J3DJointP8J3DModel.s" } #pragma pop +#endif /* 80B950F4-80B95114 001414 0020+00 1/1 0/0 0/0 .text * createHeapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::createHeapCallBack(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/createHeapCallBack__11daNpc_zrZ_cFP10fopAc_ac_c.s" +int daNpc_zrZ_c::createHeapCallBack(fopAc_ac_c* i_this) { + return static_cast(i_this)->CreateHeap(); } -#pragma pop /* 80B95114-80B95160 001434 004C+00 1/1 0/0 0/0 .text ctrlJointCallBack__11daNpc_zrZ_cFP8J3DJointi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::ctrlJointCallBack(J3DJoint* param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlJointCallBack__11daNpc_zrZ_cFP8J3DJointi.s" +int daNpc_zrZ_c::ctrlJointCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + daNpc_zrZ_c* _this = (daNpc_zrZ_c*)j3dSys.getModel()->getUserArea(); + if (_this != NULL) { + _this->ctrlJoint(i_joint, j3dSys.getModel()); + } + } + return 1; } -#pragma pop /* 80B95160-80B951AC 001480 004C+00 3/3 0/0 0/0 .text s_sub__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_sub(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_sub__FPvPv.s" +static void* s_sub(void* i_proc, void* i_this) { + if (fopAc_IsActor(i_proc) && fopAcM_GetName(i_proc) == PROC_Obj_GraveStone) { + return i_proc; + } + return NULL; } -#pragma pop /* 80B951AC-80B951F8 0014CC 004C+00 1/1 0/0 0/0 .text s_subCloth__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_subCloth(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subCloth__FPvPv.s" +static void* s_subCloth(void* i_proc, void* i_this) { + if (fopAc_IsActor(i_proc) && fopAcM_GetName(i_proc) == PROC_Obj_ZoraCloth) { + return i_proc; + } + return NULL; } -#pragma pop /* 80B951F8-80B95244 001518 004C+00 1/1 0/0 0/0 .text s_subRock__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_subRock(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/s_subRock__FPvPv.s" +static void* s_subRock(void* i_proc, void* i_this) { + if (fopAc_IsActor(i_proc) && fopAcM_GetName(i_proc) == PROC_Obj_ZraRock) { + return i_proc; + } + return NULL; } -#pragma pop /* 80B95244-80B953CC 001564 0188+00 1/0 0/0 0/0 .text setParam__11daNpc_zrZ_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setParam() { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setParam__11daNpc_zrZ_cFv.s" +void daNpc_zrZ_c::setParam() { + ActionFn action = mpNextActionFn; + u32 attn_flags = 10; + selectAction(); + + if (!mTwilight && daPy_py_c::i_checkNowWolf()) { + attn_flags = 0; + } + + if (mpNextActionFn != action) { + for (int i = 2; i < 2; i++) { + mActorMngr[i].initialize(); + } + } + + field_0x1434 = 0; + field_0x1438 = 0; + + attention_info.distances[0] = getDistTableIdx(5, 6); + attention_info.distances[1] = attention_info.distances[0]; + attention_info.distances[3] = getDistTableIdx(3, 6); + attention_info.flags = attn_flags; + + scale.set(daNpc_zrZ_Param_c::m.mScale, + daNpc_zrZ_Param_c::m.mScale, + daNpc_zrZ_Param_c::m.mScale); + + mAcchCir.SetWallR(daNpc_zrZ_Param_c::m.mWallR); + mAcchCir.SetWallH(daNpc_zrZ_Param_c::m.mWallH); + gravity = daNpc_zrZ_Param_c::m.mGravity; + + u32 uvar4 = cLib_minMaxLimit(tevStr.mFogColor.a * 100 / 0xff, 1, 100); + mCreatureSound.startCreatureSoundLevel(Z2SE_ZRZ_MV, uvar4, -1); } -#pragma pop /* ############################################################################################## */ /* 80B9B0A0-80B9B0A4 0000B4 0004+00 0/1 0/0 0/0 .rodata @4945 */ @@ -1312,14 +1667,59 @@ COMPILER_STRIP_GATE(0x80B9B0A0, &lit_4945); #pragma pop /* 80B953CC-80B95598 0016EC 01CC+00 1/0 0/0 0/0 .text main__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// data load order +BOOL daNpc_zrZ_c::main() { + if (!doEvent()) { + doNormalAction(1); + } + + attention_info.flags = 0; + + if (!daNpc_zrZ_Param_c::m.mTest + && (!dComIfGp_event_runCheck() || (mOrderNewEvt && dComIfGp_getEvent().isOrderOK()))) + { + if (mOrderEvtNo != EVT_NONE) { + eventInfo.setArchiveName(l_resNames[l_evtGetParamList[mOrderEvtNo].arcIdx]); + } + orderEvent(mOrderSpeakEvt, l_evtNames[l_evtGetParamList[mOrderEvtNo].fileIdx], + 0xffff, 4, 0xff, 1); + } + + if (field_0x9ee) { + mExpressionMorfOverride = 0.0f; + mMotionMorfOverride = 0.0f; + field_0x9ee = false; + } + + playExpression(); + playMotion(); + + mAcch.SetGrndNone(); + mAcch.SetWallNone(); + gravity = 0.0f; + speed.setall(0.0f); + speedF = 0.0f; + + mModulationOffset = 8.5f - cM_scos(mModulationParam * 0x10000 / 90) * 8.5f; + mModulationParam--; + if (mModulationParam <= 0) { + mModulationParam = 90; + mModulationOffset = 0.0f; + } + + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::main() { +asm BOOL daNpc_zrZ_c::main() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/main__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B0A4-80B9B0A8 0000B8 0004+00 5/9 0/0 0/0 .rodata @4991 */ @@ -1331,14 +1731,44 @@ SECTION_RODATA static f32 const lit_4992 = 1.0f / 5.0f; COMPILER_STRIP_GATE(0x80B9B0A8, &lit_4992); /* 80B95598-80B956B4 0018B8 011C+00 1/1 0/0 0/0 .text ctrlBtk__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ctrlBtk() { + if (mpMatAnm != NULL) { + J3DAnmTextureSRTKey* btk_anm = NULL; + if (mType == 1) { + if (l_btkGTGetParamList[0].fileIdx >= 0) { + btk_anm = getTexSRTKeyAnmP(l_resNames[l_btkGTGetParamList[0].arcIdx], + l_btkGTGetParamList[0].fileIdx); + } + } else { + if (l_btkGetParamList[0].fileIdx >= 0) { + btk_anm = getTexSRTKeyAnmP(l_resNames[l_btkGetParamList[0].arcIdx], + l_btkGetParamList[0].fileIdx); + } + } + + if (btk_anm == mBtkAnm.getBtkAnm()) { + mpMatAnm->setNowOffsetX(cM_ssin(mEyeAngle.y) * 0.2f * -1.0f); + mpMatAnm->setNowOffsetY(cM_ssin(mEyeAngle.x) * 0.2f); + mpMatAnm->onEyeMoveFlag(); + return true; + } + mpMatAnm->offEyeMoveFlag(); + } + + return false; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ctrlBtk() { +asm BOOL daNpc_zrZ_c::ctrlBtk() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ctrlBtk__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B0AC-80B9B0B0 0000C0 0004+00 0/1 0/0 0/0 .rodata @5127 */ @@ -1508,6 +1938,83 @@ static u8 eyeOffset[12]; #pragma pop /* 80B956B4-80B95BB8 0019D4 0504+00 1/0 0/0 0/0 .text setAttnPos__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::setAttnPos() { + static cXyz eyeOffset(-20.0f, 10.0f, 0.0f); + f32 offset = daNpc_zrZ_Param_c::m.mAttnOffsetY; + cXyz center, vec2, vec3, vec4; + + mDoMtx_stack_c::YrotS(field_0x990); + + cLib_addCalc2(&field_0x984[0], 0.0f, 0.1f, 125.0f); + cLib_addCalc2(&field_0x984[2], 0.0f, 0.1f, 125.0f); + + for (int i = 0; i < 3; i++) { + vec3.set(0.0f, 0.0f, field_0x984[i] * cM_ssin(field_0x992)); + mDoMtx_stack_c::multVec(&vec3, &vec4); + field_0x908[i].x = -vec4.z; + field_0x908[i].z = -vec4.x; + } + + cLib_chaseS(&field_0x992, 0, 0x555); + + if (mLookMode == LOOK_RESET) { + for (int i = 0; i < 3; i++) { + mLookatAngle[i].setall(0); + } + } + + J3DModelData* model_data = mpMorf->getModel()->getModelData(); + + setMtx(); + lookat(); + + mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(4)); + mDoMtx_stack_c::multVecZero(&mHeadPos); + mDoMtx_stack_c::multVec(&eyeOffset, &eyePos); + eyeOffset.y = 0.0f; + mDoMtx_stack_c::multVec(&eyeOffset, &vec3); + mHeadAngle.x = cLib_targetAngleX(&mHeadPos, &vec3); + mHeadAngle.y = cLib_targetAngleY(&mHeadPos, &vec3); + + cXyz* attn_pos = mLookat.getAttnPos(); + if (attn_pos != NULL) { + vec2 = *attn_pos - eyePos; + mEyeAngle.y = -(mLookatAngle[2].y + mCurAngle.y); + mEyeAngle.y += cM_atan2s(vec2.x, vec2.z); + mEyeAngle.x = -cM_atan2s(vec2.y, vec2.absXZ()); + mEyeAngle.x += mHeadAngle.x; + } else { + mEyeAngle.x = mEyeAngle.y = 0; + } + + f32 extra_height = 0.0f; + f32 extra_radius = 0.0f; + vec2.set(0.0f, 0.0f, 0.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::ZXYrotM(mCurAngle.x, mCurAngle.y, mCurAngle.z); + mDoMtx_stack_c::multVec(&vec2, ¢er); + attention_info.position.set(center.x, center.y + offset, center.z); + + if (!mHide && !mTwilight) { + if (!mIsDamaged) { + mCcCyl.SetTgType(0xd8fbfdff); + mCcCyl.SetTgSPrm(0x1f); + mCcCyl.OnTgNoHitMark(); + } else { + mCcCyl.SetTgType(0); + mCcCyl.SetTgSPrm(0); + } + + mCcCyl.SetC(center); + mCcCyl.SetH(daNpc_zrZ_Param_c::m.mCylH + extra_height); + mCcCyl.SetR(daNpc_zrZ_Param_c::m.mWallR + extra_radius); + dComIfG_Ccsp()->Set(&mCcCyl); + mCcCyl.SetCoSPrm(0x69); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1516,50 +2023,206 @@ asm void daNpc_zrZ_c::setAttnPos() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setAttnPos__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B95BB8-80B95C6C 001ED8 00B4+00 1/0 0/0 0/0 .text setMtx__11daNpc_zrZ_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setMtx() { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMtx__11daNpc_zrZ_cFv.s" +void daNpc_zrZ_c::setMtx() { + J3DModel* model = mpMorf->getModel(); + cXyz pos = current.pos; + pos.y += mModulationOffset; + mDoMtx_stack_c::transS(pos); + mDoMtx_stack_c::ZXYrotM(mCurAngle); + mDoMtx_stack_c::scaleM(scale); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + model->setUserArea((u32)this); + + if (mAnmFlags & ANM_PLAY_BCK) { + mBckAnm.getBckAnm()->setFrame(mBckAnm.getFrame()); + mpMorf->modelCalc(); + } else { + mpMorf->modelCalc(); + } } -#pragma pop /* 80B95C6C-80B95DD0 001F8C 0164+00 1/0 0/0 0/0 .text setExpressionAnm__11daNpc_zrZ_cFib */ +#ifdef NONMATCHING +// matches with literals +bool daNpc_zrZ_c::setExpressionAnm(int i_idx, bool i_modify) { + J3DAnmTransform* bck_anm = NULL; + mAnmFlags &= ~ANM_EXPRESSION_FLAGS; + + if (mType == 1) { + if (l_bckGTGetParamList[i_idx].fileIdx >= 0) { + bck_anm = getTrnsfrmKeyAnmP(l_resNames[l_bckGTGetParamList[i_idx].arcIdx], + l_bckGTGetParamList[i_idx].fileIdx); + } + } else { + if (l_bckGetParamList[i_idx].fileIdx >= 0) { + bck_anm = getTrnsfrmKeyAnmP(l_resNames[l_bckGetParamList[i_idx].arcIdx], + l_bckGetParamList[i_idx].fileIdx); + } + } + + bool res = false; + switch (i_idx) { + case 0: + case 1: + res = setExpressionBtp(0); + break; + default: + bck_anm = NULL; + break; + } + + if (!res) { + return false; + } + + if (bck_anm == NULL) { + return true; + } + + if (setBckAnm(bck_anm, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 0, -1, i_modify)) { + mAnmFlags |= ANM_PLAY_BCK | ANM_PAUSE_BCK; + mExpressionLoops = 0; + return true; + } + + return false; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::setExpressionAnm(int param_0, bool param_1) { +asm bool daNpc_zrZ_c::setExpressionAnm(int param_0, bool param_1) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpressionAnm__11daNpc_zrZ_cFib.s" } #pragma pop +#endif /* 80B95DD0-80B95F10 0020F0 0140+00 1/0 0/0 0/0 .text setExpressionBtp__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +bool daNpc_zrZ_c::setExpressionBtp(int i_idx) { + J3DAnmTexPattern* btp_anm = NULL; + int attr = J3DFrameCtrl::LOOP_ONCE_e; + mAnmFlags &= ~(ANM_PLAY_BTP | ANM_PAUSE_BTP | ANM_FLAG_800); + + if (mType == 1) { + if (l_btpGTGetParamList[i_idx].fileIdx >= 0) { + btp_anm = getTexPtrnAnmP(l_resNames[l_btpGTGetParamList[i_idx].arcIdx], + l_btpGTGetParamList[i_idx].fileIdx); + } + } else { + if (l_btpGetParamList[i_idx].fileIdx >= 0) { + btp_anm = getTexPtrnAnmP(l_resNames[l_btpGetParamList[i_idx].arcIdx], + l_btpGetParamList[i_idx].fileIdx); + } + } + + switch (i_idx) { + case 0: + attr = J3DFrameCtrl::LOOP_REPEAT_e; + break; + default: + btp_anm = NULL; + break; + } + + if (btp_anm == NULL) { + return true; + } + + if (setBtpAnm(btp_anm, mpMorf->getModel()->getModelData(), 1.0f, attr)) { + mAnmFlags |= ANM_PLAY_BTP | ANM_PAUSE_BTP; + if (i_idx == 0) { + mAnmFlags |= ANM_FLAG_800; + } + return true; + } + + return false; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::setExpressionBtp(int param_0) { +asm bool daNpc_zrZ_c::setExpressionBtp(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpressionBtp__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* 80B95F10-80B95F3C 002230 002C+00 1/0 0/0 0/0 .text setExpression__11daNpc_zrZ_cFif */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setExpression(int param_0, f32 param_1) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpression__11daNpc_zrZ_cFif.s" +void daNpc_zrZ_c::setExpression(int i_expression, f32 i_morf) { + if (i_expression >= 0 && i_expression < 2) { + mExpression = i_expression; + mExpressionMorfOverride = i_morf; + mExpressionPrevPhase = -1; + mExpressionPhase = 0; + } } -#pragma pop /* 80B95F3C-80B9612C 00225C 01F0+00 1/0 0/0 0/0 .text setMotionAnm__11daNpc_zrZ_cFif */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::setMotionAnm(int i_idx, f32 i_morf) { + J3DAnmTransformKey* bck_anm = NULL; + J3DAnmTextureSRTKey* btk_anm = NULL; + int attr = J3DFrameCtrl::LOOP_REPEAT_e; + mAnmFlags &= ~ANM_MOTION_FLAGS; + + if (mType == 1) { + if (l_bckGTGetParamList[i_idx].fileIdx >= 0) { + bck_anm = getTrnsfrmKeyAnmP(l_resNames[l_bckGTGetParamList[i_idx].arcIdx], + l_bckGTGetParamList[i_idx].fileIdx); + } + } else { + if (l_bckGetParamList[i_idx].fileIdx >= 0) { + bck_anm = getTrnsfrmKeyAnmP(l_resNames[l_bckGetParamList[i_idx].arcIdx], + l_bckGetParamList[i_idx].fileIdx); + } + } + + switch (i_idx) { + case 2: + case 3: + break; + case 4: + attr = J3DFrameCtrl::LOOP_ONCE_e; + break; + default: + bck_anm = NULL; + btk_anm = NULL; + break; + } + + if (mType == 1) { + if (l_btkGetParamList[0].fileIdx >= 0) { + btk_anm = getTexSRTKeyAnmP(l_resNames[l_btkGetParamList[0].arcIdx], + l_btkGetParamList[0].fileIdx); + } + } else { + if (l_btkGetParamList[0].fileIdx >= 0) { + btk_anm = getTexSRTKeyAnmP(l_resNames[l_btkGetParamList[0].arcIdx], + l_btkGetParamList[0].fileIdx); + } + } + + if (btk_anm != NULL && setBtkAnm(btk_anm, mpMorf->getModel()->getModelData(), 1.0f, 2)) { + mAnmFlags |= ANM_PLAY_BTK | ANM_PAUSE_BTK; + } + + if (bck_anm != NULL && setMcaMorfAnm(bck_anm, 1.0f, i_morf, attr, 0, -1)) { + mAnmFlags |= ANM_PLAY_MORF | ANM_PAUSE_MORF; + mMotionLoops = 0; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1568,19 +2231,23 @@ asm void daNpc_zrZ_c::setMotionAnm(int param_0, f32 param_1) { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMotionAnm__11daNpc_zrZ_cFif.s" } #pragma pop +#endif /* 80B9612C-80B96170 00244C 0044+00 1/0 0/0 0/0 .text setMotion__11daNpc_zrZ_cFifi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setMotion(int param_0, f32 param_1, int param_2) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setMotion__11daNpc_zrZ_cFifi.s" +void daNpc_zrZ_c::setMotion(int i_motion, f32 i_morf, BOOL i_restart) { + s16 motion = i_motion; + if (i_restart || mMotion != motion) { + if (i_motion >= 0 && i_motion < 3) { + mMotion = motion; + mMotionMorfOverride = i_morf; + mMotionPrevPhase = -1; + mMotionPhase = 0; + } + } } -#pragma pop /* 80B96170-80B96178 002490 0008+00 1/0 0/0 0/0 .text drawDbgInfo__11daNpc_zrZ_cFv */ -bool daNpc_zrZ_c::drawDbgInfo() { +BOOL daNpc_zrZ_c::drawDbgInfo() { return false; } @@ -1591,24 +2258,29 @@ void daNpc_zrZ_c::drawOtherMdls() { /* 80B9617C-80B961B4 00249C 0038+00 1/1 0/0 0/0 .text getTypeFromParam__11daNpc_zrZ_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::getTypeFromParam() { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/getTypeFromParam__11daNpc_zrZ_cFv.s" +u8 daNpc_zrZ_c::getTypeFromParam() { + switch (fopAcM_GetParam(this) & 0xff) { + case 0: + return 1; + case 1: + return 0; + default: + return 1; + } } -#pragma pop /* 80B961B4-80B96268 0024D4 00B4+00 1/1 0/0 0/0 .text isDelete__11daNpc_zrZ_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::isDelete() { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/isDelete__11daNpc_zrZ_cFv.s" +BOOL daNpc_zrZ_c::isDelete() { + if (((mDemoMode == DEMO_COME_HERE || mDemoMode == DEMO_WAIT) + && dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this))) + || (mDemoMode == DEMO_COME_HERE_2 && (!dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this)) + || dComIfGs_isSwitch(mSwitch2, fopAcM_GetRoomNo(this))))) + { + return true; + } else { + return false; + } } -#pragma pop /* ############################################################################################## */ /* 80B9B0D4-80B9B0D8 0000E8 0004+00 0/1 0/0 0/0 .rodata @5371 */ @@ -1619,6 +2291,72 @@ COMPILER_STRIP_GATE(0x80B9B0D4, &lit_5371); #pragma pop /* 80B96268-80B9652C 002588 02C4+00 1/1 0/0 0/0 .text reset__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::reset() { + initialize(); + mpMatAnm->initialize(); + mPath.initialize(); + if (mPath.setPathInfo(getPathNoFromParam(), fopAcM_GetRoomNo(this), 0)) { + mPath.setRange(100.0f); + } + mLookat.initialize(); + for (int i = 0; i < 2; i++) { + mActorMngr[i].initialize(); + } + + mpNextActionFn = NULL; + mpActionFn = NULL; + field_0x1434 = 0; + field_0x1438 = 0; + field_0x143c = 0; + field_0x1440 = 0; + mLookMode = -1; + mMode = 0; + mHide = false; + + if (mDemoMode == DEMO_WAIT) { + mIsLeading = false; + tevStr.mFogColor.a = 0; + mpNextActionFn = &wait; + } else if (mDemoMode == DEMO_COME_HERE || mDemoMode == DEMO_COME_HERE_2) { + mIsLeading = false; + tevStr.mFogColor.a = 0xff; + } else { + mIsLeading = true; + tevStr.mFogColor.a = 0xff; + } + + setLookMode(LOOK_NONE); + current.pos = home.pos; + old.pos = current.pos; + current.angle.set(0, home.angle.y, 0); + old.angle = current.angle; + shape_angle = current.angle; + mCurAngle = current.angle; + mOldAngle = mCurAngle; + speedF = 0.0f; + speed.setall(0.0f); + mItemID = -1; + mModulationParam = 90; + mModulationOffset = 0.0f; + mIsMoving = false; + mSpeed = 0.0f; + mMoveAngle.x = current.angle.x; + mMoveAngle.y = current.angle.y + 0x8000; + mMoveAngle.z = current.angle.z; + mpGravestoneActor = NULL; + mpClothActor = NULL; + mpRockActor = NULL; + mLimbCalcPos = current.pos; + mLimbCalcPos.y -= daNpc_zrZ_Param_c::m.field_0x80; + mLimbAngle.set(0, 0, 0); + mClothesObtained = false; + mMusicSet = false; + mSealReleased = false; + field_0x9ee = true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1627,6 +2365,7 @@ asm void daNpc_zrZ_c::reset() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/reset__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B0D8-80B9B0E4 0000EC 000C+00 0/1 0/0 0/0 .rodata @5375 */ @@ -1687,6 +2426,22 @@ COMPILER_STRIP_GATE(0x80B9B108, &lit_5380); #pragma pop /* 80B9652C-80B96618 00284C 00EC+00 1/1 0/0 0/0 .text playExpression__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::playExpression() { + daNpcF_anmPlayData dat0a = {ANM_F_TALK_A, daNpc_zrZ_Param_c::m.mMorfFrames, 1}; + daNpcF_anmPlayData dat0b = {ANM_NONE, daNpc_zrZ_Param_c::m.mMorfFrames, 0}; + daNpcF_anmPlayData* pDat0[2] = {&dat0a, &dat0b}; + daNpcF_anmPlayData dat1 = {ANM_NONE, daNpc_zrZ_Param_c::m.mMorfFrames, 0}; + daNpcF_anmPlayData* pDat1[1] = {&dat1}; + daNpcF_anmPlayData** ppDat[2] = { + pDat0, pDat1, + }; + if (mExpression >= 0 && mExpression < 2) { + playExpressionAnm(ppDat); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1695,6 +2450,7 @@ asm void daNpc_zrZ_c::playExpression() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/playExpression__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B110-80B9B11C 000124 000C+00 0/1 0/0 0/0 .rodata @5393 */ @@ -1776,6 +2532,24 @@ COMPILER_STRIP_GATE(0x80B9B150, &lit_5400); #pragma pop /* 80B96618-80B96740 002938 0128+00 1/1 0/0 0/0 .text playMotion__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::playMotion() { + daNpcF_anmPlayData dat0 = {ANM_WAIT_GT_A, daNpc_zrZ_Param_c::m.mMorfFrames, 0}; + daNpcF_anmPlayData* pDat0[1] = {&dat0}; + daNpcF_anmPlayData dat1a = {ANM_COMEON, daNpc_zrZ_Param_c::m.mMorfFrames, 1}; + daNpcF_anmPlayData dat1b = {ANM_WAIT_GT_A, daNpc_zrZ_Param_c::m.mMorfFrames, 0}; + daNpcF_anmPlayData* pDat1[2] = {&dat1a, &dat1b}; + daNpcF_anmPlayData dat2 = {ANM_LEAD, daNpc_zrZ_Param_c::m.mMorfFrames, 0}; + daNpcF_anmPlayData* pDat2[1] = {&dat2}; + daNpcF_anmPlayData** ppDat[3] = { + pDat0, pDat1, pDat2, + }; + if (mMotion >= 0 && mMotion < 3) { + playMotionAnm(ppDat); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1784,78 +2558,226 @@ asm void daNpc_zrZ_c::playMotion() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/playMotion__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B96740-80B9676C 002A60 002C+00 2/2 0/0 0/0 .text * chkAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::chkAction(int (daNpc_zrZ_c::*param_0)(void*)) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/chkAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s" +BOOL daNpc_zrZ_c::chkAction(ActionFn i_action) { + return mpActionFn == i_action; } -#pragma pop /* 80B9676C-80B96814 002A8C 00A8+00 2/2 0/0 0/0 .text * setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setAction(int (daNpc_zrZ_c::*param_0)(void*)) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setAction__11daNpc_zrZ_cFM11daNpc_zrZ_cFPCvPvPv_i.s" +BOOL daNpc_zrZ_c::setAction(ActionFn i_action) { + mMode = 3; + if (mpActionFn != NULL) { + (this->*mpActionFn)(NULL); + } + mMode = 0; + mpActionFn = i_action; + if (mpActionFn != NULL) { + (this->*mpActionFn)(NULL); + } + return true; } -#pragma pop /* 80B96814-80B968E0 002B34 00CC+00 1/1 0/0 0/0 .text selectAction__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with data +BOOL daNpc_zrZ_c::selectAction() { + mpNextActionFn = NULL; + if (daNpc_zrZ_Param_c::m.mTest) { + mpNextActionFn = &test; + } else { + switch (mDemoMode) { + case DEMO_COME_HERE: + mpNextActionFn = &comeHere; + break; + case DEMO_COME_HERE_2: + mpNextActionFn = &comeHere2; + break; + default: + mpNextActionFn = &wait; + break; + } + } + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::selectAction() { +asm BOOL daNpc_zrZ_c::selectAction() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/selectAction__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B968E0-80B969F4 002C00 0114+00 1/1 0/0 0/0 .text doNormalAction__11daNpc_zrZ_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::doNormalAction(int param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/doNormalAction__11daNpc_zrZ_cFi.s" +void daNpc_zrZ_c::doNormalAction(BOOL param_0) { + if (param_0 && hitChk2(&mCcCyl, true, false)) { + int timer; + if (mCutType == daPy_py_c::CUT_TYPE_TURN_RIGHT) { + timer = 20; + } else { + timer = daNpc_zrZ_Param_c::m.mDamageTimer; + } + setDamage(timer, EXPR_NONE, MOT_WAIT_GT_A); + setLookMode(LOOK_RESET); + } else { + if (mIsDamaged && mDamageTimer == 0) { + mMode = 0; + mIsDamaged = false; + } + } + + mOrderEvtNo = EVT_NONE; + if (mpNextActionFn != NULL) { + if (mpActionFn == mpNextActionFn) { + (this->*mpActionFn)(NULL); + } else { + setAction(mpNextActionFn); + } + } } -#pragma pop /* 80B969F4-80B96DF0 002D14 03FC+00 1/1 0/0 0/0 .text doEvent__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals / data +BOOL daNpc_zrZ_c::doEvent() { + BOOL ret = false; + + if (dComIfGp_event_runCheck() != false) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + + if (eventInfo.checkCommandTalk() || eventInfo.i_checkCommandDemoAccrpt()) { + mOrderNewEvt = false; + } + + if (eventInfo.checkCommandTalk()) { + if (chkAction(&talk)) { + (this->*mpActionFn)(NULL); + } else if (dComIfGp_event_chkTalkXY() == false || dComIfGp_evmng_ChkPresentEnd()) { + setAction(&talk); + } + ret = true; + } else { + if (mItemID != -1) { + dComIfGp_event_setItemPartnerId(mItemID); + mItemID = -1; + } + + int staff_id = event_manager.getMyStaffId(l_myName, NULL, 0); + if (staff_id != -1) { + mStaffID = staff_id; + int act_idx = event_manager.getMyActIdx(staff_id, mEvtCutNameList, + ARRAY_SIZE(mEvtCutNameList), 0, 0); + if ((this->*mEvtCutList[act_idx])(staff_id)) { + event_manager.cutEnd(staff_id); + } + ret = true; + } + + if (eventInfo.i_checkCommandDemoAccrpt()) { + if (mEventIdx != -1 && event_manager.endCheck(mEventIdx)) { + switch (mOrderEvtNo) { + case EVT_GET_AFTER: + dComIfGp_event_reset(); + mOrderEvtNo = EVT_NONE; + mEventIdx = -1; + dComIfGs_onSwitch(mSwitch2, fopAcM_GetRoomNo(this)); + fopAcM_delete(this); + break; + + case EVT_CLOTHES_GET: + dComIfGp_event_reset(); + mClothesObtained = true; + mOrderEvtNo = EVT_CLOTHES_GET; + mEventIdx = -1; + dComIfGs_onSwitch(mSwitch2, fopAcM_GetRoomNo(this)); + fopAcM_delete(this); + break; + + case EVT_HELP_PRINCE: + dComIfGp_event_reset(); + mOrderEvtNo = EVT_NONE; + mEventIdx = -1; + fopAcM_delete(this); + break; + + case EVT_SEAL_RELEASE: + dComIfGp_event_reset(); + mOrderEvtNo = EVT_NONE; + mEventIdx = -1; + if (mpRockActor != NULL) { + fopAcM_delete(mpRockActor); + } + break; + + default: + dComIfGp_event_reset(); + mOrderEvtNo = EVT_NONE; + mEventIdx = -1; + break; + } + } else { + switch (mOrderEvtNo) { + case EVT_SEAL_RELEASE: + setSkipZev(EVT_SEAL_RELEASE, EVT_SR_SKIP); + dComIfGp_getEvent().onSkipFade(); + break; + } + } + } + } + + int expression, motion; + int prev_msg_timer = mMsgTimer; + if (ctrlMsgAnm(expression, motion, this, false) != 0) { + if (!field_0x9eb) { + setExpression(expression, -1.0f); + setMotion(motion, -1.0f, false); + } + } else if (prev_msg_timer != 0 && !field_0x9eb) { + setExpressionTalkAfter(); + } + } else { + mMsgTimer = 0; + if (mStaffID != -1) { + mpActionFn = NULL; + mStaffID = -1; + } + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::doEvent() { +asm BOOL daNpc_zrZ_c::doEvent() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/doEvent__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B96DF0-80B96E7C 003110 008C+00 1/1 0/0 0/0 .text setSkipZev__11daNpc_zrZ_cFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setSkipZev(int param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setSkipZev__11daNpc_zrZ_cFii.s" +BOOL daNpc_zrZ_c::setSkipZev(int i_idx1, int i_idx2) { + if (!strcmp(dComIfGp_getEventManager().getRunEventName(), l_evtNames[i_idx1])) { + dComIfGp_getEvent().setSkipZev(this, l_evtNames[i_idx2]); + return true; + } + return false; } -#pragma pop /* 80B96E7C-80B96EA0 00319C 0024+00 11/11 0/0 0/0 .text setLookMode__11daNpc_zrZ_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpc_zrZ_c::setLookMode(int param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setLookMode__11daNpc_zrZ_cFi.s" +void daNpc_zrZ_c::setLookMode(int i_lookMode) { + if (i_lookMode >= 0 && i_lookMode < 5 && i_lookMode != mLookMode) { + mLookMode = i_lookMode; + } } -#pragma pop /* ############################################################################################## */ /* 80B9B15C-80B9B168 000170 000C+00 0/1 0/0 0/0 .rodata @5576 */ @@ -1889,6 +2811,60 @@ COMPILER_STRIP_GATE(0x80B9B170, &lit_5631); #pragma pop /* 80B96EA0-80B97128 0031C0 0288+00 1/1 0/0 0/0 .text lookat__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::lookat() { + fopAc_ac_c* attn_actor = NULL; + J3DModel* model = mpMorf->getModel(); + BOOL snap = false; + f32 body_down_angle = daNpc_zrZ_Param_c::m.mBodyDownAngle; + f32 body_up_angle = daNpc_zrZ_Param_c::m.mBodyUpAngle; + f32 body_right_angle = daNpc_zrZ_Param_c::m.mBodyRightAngle; + f32 body_left_angle = daNpc_zrZ_Param_c::m.mBodyLeftAngle; + f32 head_down_angle = daNpc_zrZ_Param_c::m.mHeadDownAngle; + f32 head_up_angle = daNpc_zrZ_Param_c::m.mHeadUpAngle; + f32 head_right_angle = daNpc_zrZ_Param_c::m.mHeadRightAngle; + f32 head_left_angle = daNpc_zrZ_Param_c::m.mHeadLeftAngle; + s16 angle_delta = mCurAngle.y - mOldAngle.y; + cXyz lookat_pos[3] = {mLookatPos[0], mLookatPos[1], mLookatPos[2]}; + csXyz* lookat_angle[3] = {&mLookatAngle[0], &mLookatAngle[1], &mLookatAngle[2]}; + + switch (mLookMode) { + case LOOK_NONE: + break; + case LOOK_RESET: + snap = true; + break; + case LOOK_PLAYER: + case LOOK_PLAYER_TALK: + attn_actor = daPy_getPlayerActorClass(); + if (mLookMode == LOOK_PLAYER_TALK) { + head_right_angle = -80.0f; + head_left_angle = 80.0f; + } + break; + case LOOK_ACTOR: + attn_actor = mActorMngr[1].getActorP(); + break; + } + + if (attn_actor != NULL) { + mLookPos = attn_actor->attention_info.position; + if (mLookMode != LOOK_PLAYER && mLookMode != LOOK_PLAYER_TALK && mLookMode != LOOK_ACTOR) { + mLookPos.y -= 40.0f; + } + mLookat.setAttnPos(&mLookPos); + } else { + mLookat.setAttnPos(NULL); + } + + mLookat.setParam(body_down_angle, body_up_angle, body_right_angle, body_left_angle, + 0.0f, 0.0f, 0.0f, 0.0f, + head_down_angle, head_up_angle, head_right_angle, head_left_angle, + mCurAngle.y, lookat_pos); + mLookat.calc(this, model->getBaseTRMtx(), lookat_angle, snap, angle_delta, false); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1897,8 +2873,15 @@ asm void daNpc_zrZ_c::lookat() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/lookat__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B97128-80B97160 003448 0038+00 1/1 0/0 0/0 .text setExpressionTalkAfter__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::setExpressionTalkAfter() { + setExpression(EXPR_NONE, -1.0f); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1907,8 +2890,22 @@ asm void daNpc_zrZ_c::setExpressionTalkAfter() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setExpressionTalkAfter__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B97160-80B971BC 003480 005C+00 1/1 0/0 0/0 .text lightReady__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::lightReady() { + setLightPos(); + mLight.mColor.r = 0; + mLight.mColor.g = 0; + mLight.mColor.b = 0; + mLight.mPow = 0.0f; + mLight.mFluctuation = 0.0f; + mAllcolRatio = 1.0f; + mUseLightEffect = false; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1917,8 +2914,21 @@ asm void daNpc_zrZ_c::lightReady() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/lightReady__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B971BC-80B9723C 0034DC 0080+00 1/1 0/0 0/0 .text setLightPos__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::setLightPos() { + fopAc_ac_c* gravestone = (fopAc_ac_c*)fpcM_Search(s_sub, this); + if (gravestone != NULL) { + cXyz offset(0.0f, 0.0f, 0.0f); + cXyz pos; + cLib_offsetPos(&pos, &gravestone->current.pos, gravestone->current.angle.y, &offset); + mLight.mPosition.set(pos.x, pos.y, pos.z); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1927,6 +2937,7 @@ asm void daNpc_zrZ_c::setLightPos() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/setLightPos__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B174-80B9B178 000188 0004+00 0/1 0/0 0/0 .rodata @5697 */ @@ -1965,6 +2976,18 @@ COMPILER_STRIP_GATE(0x80B9B184, &lit_5701); #pragma pop /* 80B9723C-80B972EC 00355C 00B0+00 1/1 0/0 0/0 .text lightPowerCalc__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::lightPowerCalc(int param_0) { + if (param_0 == 30) { + mLight.mPow = (50 - mEventTimer) * 70.0f / 50.0f; + } else if (mLightEffectFrame > 200) { + cLib_addCalc0(&mLight.mPow, 0.05f, 5.0f); + } else { + mLight.mPow = cM_ssin(mLightEffectFrame * 3500) * 14.0f + 70.0f; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1973,22 +2996,60 @@ asm void daNpc_zrZ_c::lightPowerCalc(int param_0) { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/lightPowerCalc__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B188-80B9B198 00019C 0010+00 1/1 0/0 0/0 .rodata key_frame$5706 */ -SECTION_RODATA static u8 const key_frame[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, 0xDC, +static int const key_frame[4] = { + 0, 50, 190, 220, }; -COMPILER_STRIP_GATE(0x80B9B188, &key_frame); /* 80B9B198-80B9B1B8 0001AC 0020+00 1/1 0/0 0/0 .rodata key_color$5707 */ -SECTION_RODATA static u8 const key_color[32] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xC3, 0x00, 0x8A, 0x00, 0xFF, - 0x00, 0xFF, 0x00, 0xC3, 0x00, 0x8A, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, +static GXColorS10 const key_color[4] = { + {0x00, 0x00, 0x00, 0xFF}, + {0xFF, 0xC3, 0x8A, 0xFF}, + {0xFF, 0xC3, 0x8A, 0xFF}, + {0x00, 0x00, 0x00, 0xFF}, }; -COMPILER_STRIP_GATE(0x80B9B198, &key_color); /* 80B972EC-80B974BC 00360C 01D0+00 1/1 0/0 0/0 .text lightColorProc__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// regalloc +void daNpc_zrZ_c::lightColorProc() { + static int const key_frame[4] = { + 0, 50, 190, 220, + }; + + static GXColorS10 const key_color[4] = { + {0x00, 0x00, 0x00, 0xFF}, + {0xFF, 0xC3, 0x8A, 0xFF}, + {0xFF, 0xC3, 0x8A, 0xFF}, + {0x00, 0x00, 0x00, 0xFF}, + }; + + if (mLightEffectFrame >= 220) { + return; + } + + int prev_key_frame, next_key_frame, next, i; + for (i = 0; i < 4; i++) { + if (key_frame[i] <= mLightEffectFrame && key_frame[i + 1] > mLightEffectFrame) { + prev_key_frame = key_frame[i]; + next_key_frame = key_frame[i + 1]; + next = i + 1; + break; + } + } + + int frames = next_key_frame - prev_key_frame; + s16 step_r = fabs(key_color[i + 1].r - key_color[i].r) / frames; + s16 step_g = fabs(key_color[i + 1].g - key_color[i].g) / frames; + s16 step_b = fabs(key_color[i + 1].b - key_color[i].b) / frames; + cLib_chaseS(&mLight.mColor.r, key_color[next].r, ++step_r); + cLib_chaseS(&mLight.mColor.g, key_color[next].g, ++step_g); + cLib_chaseS(&mLight.mColor.b, key_color[next].b, ++step_b); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1997,6 +3058,7 @@ asm void daNpc_zrZ_c::lightColorProc() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/lightColorProc__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B1B8-80B9B1C0 0001CC 0008+00 0/0 0/0 0/0 .rodata @5782 */ @@ -2068,25 +3130,342 @@ SECTION_DEAD static char const* const stringBase_80B9B27E = "timer"; #pragma pop /* 80B974BC-80B97B78 0037DC 06BC+00 2/0 0/0 0/0 .text ECut_helpPrince__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_helpPrince(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + daPy_py_c* player = daPy_getPlayerActorClass(); + BOOL ret = false; + int prm = -1; + int timer = 0; + csXyz angle; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + int* timer_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "timer"); + if (timer_p != NULL) { + timer = *timer_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 11: + initTalk(0x3e9, NULL); + setLookMode(LOOK_NONE); + Z2GetAudioMgr()->i_muteSceneBgm(90, 0.0f); + mIsLeading = true; + daNpcF_offTmpBit(0xb); + daNpcF_offTmpBit(0xc); + daNpcF_offTmpBit(0xd); + daNpcF_offTmpBit(0xe); + daNpcF_offTmpBit(0xf); + daNpcF_offTmpBit(0x33); + daNpcF_offTmpBit(0x34); + break; + + case 20: + mEventTimer = timer; + break; + + case 40: + mEventTimer = timer; + break; + + case 50: { + initTalk(0x3e9, NULL); + angle = player->current.angle; + angle.y = fopAcM_searchPlayerAngleY(this) + 0x8000; + cXyz pos(-898.02f, 14.565f, -1002.517f); + player->setPlayerPosAndAngle(&pos, &angle); + break; + } + + case 51: + break; + + case 60: + initTalk(0x3e9, NULL); + setAngle(fopAcM_searchPlayerAngleY(this)); + setLookMode(LOOK_PLAYER); + break; + + case 70: + break; + + case 71: + initTalk(0x3e9, NULL); + break; + + case 80: + initTalk(0x3e9, NULL); + break; + + case 81: + break; + + case 82: + break; + + case 83: + break; + + case 90: + initTalk(0x3e9, NULL); + break; + + case 91: + break; + + case 92: + break; + + case 93: + break; + + case 100: + initTalk(0x3e9, NULL); + break; + + case 101: + break; + + case 102: + break; + + case 103: + mEventTimer = timer; + Z2GetAudioMgr()->subBgmStop(); + Z2GetAudioMgr()->i_unMuteSceneBgm(90); + break; + + case 110: + initTalk(0x3e9, NULL); + break; + + case 111: + break; + + case 112: + break; + + case 113: + break; + } + } + + switch (prm) { + case 11: + if (talkProc(NULL, true, NULL)) { + ret = true; + if (!mMusicSet) { + mMusicSet = true; + Z2GetAudioMgr()->subBgmStart(Z2BGM_LUTERA1); + } + } + setAngle(fopAcM_searchPlayerAngleY(this)); + break; + + case 50: + ret = true; + break; + + case 51: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 60: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 71: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 80: + ret = true; + break; + + case 81: + ret = true; + break; + + case 82: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 90: + ret = true; + break; + + case 91: + ret = true; + break; + + case 92: + ret = true; + break; + + case 93: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 100: + ret = true; + break; + + case 101: + ret = true; + break; + + case 102: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 110: + ret = true; + break; + + case 111: + ret = true; + break; + + case 112: + ret = true; + break; + + case 113: + if (talkProc(NULL, true, NULL)) { + if (!dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this))) { + dComIfGs_onSwitch(mSwitch1, fopAcM_GetRoomNo(this)); + } + ret = true; + } + break; + + case 20: + case 70: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } + break; + + case 40: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + tevStr.mFogColor.a = 0xff; + } else { + tevStr.mFogColor.a = (u8)((60 - mEventTimer) / 60.0f * 255.0f); + } + break; + + case 103: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + tevStr.mFogColor.a = 0; + } else if (mEventTimer > 30) { + tevStr.mFogColor.a = (u8)((mEventTimer - 30) / 30.0f * 255.0f); + } else { + tevStr.mFogColor.a = 0; + } + break; + + default: + ret = true; + break; + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_helpPrince(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_helpPrince(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_helpPrince__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* 80B97B78-80B97D7C 003E98 0204+00 1/0 0/0 0/0 .text ECut_comeHere__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_comeHere(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + daPy_py_c* player = daPy_getPlayerActorClass(); + BOOL ret = false; + int prm = -1; + csXyz angle; + bool facing_player; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 1: + mActorMngr[0].entry(daPy_getPlayerActorClass()); + setLookMode(LOOK_PLAYER); + angle = player->current.angle; + angle.y = fopAcM_searchPlayerAngleY(this) + 0x8000; + player->setPlayerPosAndAngle(&player->current.pos, &angle); + dComIfGp_getEvent().setPtT(this); + initTalk(8, NULL); + mIsLeading = true; + break; + } + } + + switch (prm) { + case 1: + facing_player = false; + if (mCurAngle.y == fopAcM_searchPlayerAngleY(this)) { + facing_player = true; + } else { + if (step(fopAcM_searchPlayerAngleY(this), -1, -1, 15)) { + setExpression(EXPR_NONE, -1.0f); + setMotion(MOT_WAIT_GT_A, -1.0f, false); + mTurnMode = 0; + } + } + + if (facing_player && talkProc(NULL, true, NULL)) { + setLookMode(LOOK_NONE); + ret = true; + } + break; + + default: + ret = true; + break; + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_comeHere(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_comeHere(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_comeHere__11daNpc_zrZ_cFi.s" } #pragma pop - +#endif /* ############################################################################################## */ /* 80B9B1E4-80B9B1E8 0001F8 0004+00 1/1 0/0 0/0 .rodata @5984 */ SECTION_RODATA static f32 const lit_5984 = 500.0f; @@ -2094,14 +3473,58 @@ COMPILER_STRIP_GATE(0x80B9B1E4, &lit_5984); /* 80B97D7C-80B97EB4 00409C 0138+00 1/0 0/0 0/0 .text ECut_restoreLink__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_restoreLink(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + BOOL ret = false; + int prm = -1; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 0: + pullbackPlayer(daNpc_zrZ_Param_c::m.mRestoreDst - 500.0f); + setAngle(fopAcM_searchPlayerAngleY(this)); + break; + + case 1: + initTalk(0xd, NULL); + break; + } + } + + switch (prm) { + case 0: + ret = true; + break; + + case 1: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + default: + ret = true; + break; + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_restoreLink(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_restoreLink(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_restoreLink__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B1E8-80B9B1EC 0001FC 0004+00 0/0 0/0 0/0 .rodata @6066 */ @@ -2119,14 +3542,223 @@ COMPILER_STRIP_GATE(0x80B9B1EC, &lit_6098); #pragma pop /* 80B97EB4-80B98540 0041D4 068C+00 1/0 0/0 0/0 .text ECut_clothesGet__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_clothesGet(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + BOOL ret = false; + int prm = -1; + int item_no; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 0: + daNpcF_offTmpBit(0xe); + daNpcF_offTmpBit(0xf); + setLookMode(LOOK_NONE); + lightReady(); + break; + + case 1: + break; + + case 10: + initTalk(9, NULL); + if (mpGravestoneActor != NULL) { + dComIfGp_getEvent().setPtT(mpGravestoneActor); + dComIfGp_getEvent().setPt2(mpGravestoneActor); + } + break; + + case 11: + break; + + case 20: + initTalk(9, NULL); + break; + + case 30: + mEventTimer = 50; + if (mpGravestoneActor != NULL) { + mpGravestoneActor->speedF = -2.0f; + mpGravestoneActor->mTimer = 50; + } + mAllcolRatio = 1.0f; + mUseLightEffect = true; + break; + + case 40: + mEventTimer = 0; + break; + + case 50: + if (mpClothActor != NULL) { + dComIfGp_getEvent().setPtT(mpClothActor); + } + mEventTimer = 20; + break; + + case 60: + if (mpClothActor != NULL) { + fopAcM_delete(mpClothActor); + } + item_no = 0; + if (mFlow.getEventId(&item_no) == 1) { + mItemID = fopAcM_createItemForPresentDemo(¤t.pos, item_no, + 0, -1, -1, NULL, NULL); + } + break; + + case 61: + mEventTimer = 30; + break; + + case 70: + dComIfGp_getEvent().setPtT(this); + break; + + case 71: + mEventTimer = 30; + setLookMode(LOOK_NONE); + break; + + case 80: + initTalk(9, NULL); + if (mpGravestoneActor != NULL) { + mpGravestoneActor->current.pos = mpGravestoneActor->home.pos; + } + break; + + case 90: + mEventTimer = 0x78; + Z2GetAudioMgr()->bgmStop(90, 0); + break; + } + } + + switch (prm) { + case 0: + ret = true; + break; + + case 10: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 11: + ret = true; + break; + + case 20: + if (mCurAngle.y != fopAcM_searchPlayerAngleY(this)) { + if (step(fopAcM_searchPlayerAngleY(this), -1, -1, 15)) { + mTurnMode = 0; + } + } else { + if (talkProc(NULL, true, NULL)) { + ret = true; + } + } + break; + + case 30: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } else { + mAllcolRatio = mEventTimer * 0.45f / 50.0f + 0.55f; + dKy_set_allcol_ratio(mAllcolRatio); + } + break; + + case 40: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } + break; + + case 50: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } + break; + + case 60: + ret = true; + break; + + case 61: + mAllcolRatio = (30 - mEventTimer) * 0.45f / 30.0f + 0.55f; + if (cLib_calcTimer(&mEventTimer) == 0) { + mUseLightEffect = false; + dKy_efplight_cut(&mLight); + } + ret = true; + break; + + case 70: + ret = true; + break; + + case 71: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } + break; + + case 80: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 90: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + tevStr.mFogColor.a = 0; + } else if (mEventTimer > 0) { + tevStr.mFogColor.a = (u8)(mEventTimer / 120.0f * 255.0f); + } else { + tevStr.mFogColor.a = 0; + } + break; + + default: + ret = true; + break; + } + + if (mUseLightEffect) { + dKy_efplight_set(&mLight); + lightPowerCalc(prm); + lightColorProc(); + mLightEffectFrame++; + } + + if (mAllcolRatio < 1.0f) { + dKy_set_allcol_ratio(mAllcolRatio); + cXyz pos(21105.0f, 750.0f, -50.0f); + GXColor color = {0xff, 0xc3, 0x8a, 0xff}; + dKy_BossLight_set(&pos, &color, (1.0f - mAllcolRatio) * 1.5f, 0); + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_clothesGet(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_clothesGet(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_clothesGet__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B1F0-80B9B1F4 000204 0004+00 0/0 0/0 0/0 .rodata @6099 */ @@ -2148,15 +3780,88 @@ SECTION_RODATA static f32 const lit_6101 = 120.0f; COMPILER_STRIP_GATE(0x80B9B1F8, &lit_6101); /* 80B98540-80B9877C 004860 023C+00 1/0 0/0 0/0 .text ECut_getAfter__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_getAfter(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + BOOL ret = false; + int prm = -1; + fopAc_ac_c* gravestone; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 0: + break; + + case 70: + mEventTimer = 30; + setLookMode(LOOK_NONE); + break; + + case 80: + initTalk(9, NULL); + gravestone = (fopAc_ac_c*)fpcM_Search(s_sub, this); + if (gravestone != NULL) { + gravestone->current.pos = gravestone->home.pos; + } + break; + + case 90: + mEventTimer = 120; + break; + } + } + + switch (prm) { + case 0: + daPy_getPlayerActorClass()->changeDemoMoveAngle(fopAcM_searchPlayerAngleY(this) + 0x8000); + ret = true; + break; + + case 70: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } + break; + + case 80: + if (talkProc(NULL, true, NULL)) { + ret = true; + } + break; + + case 90: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + tevStr.mFogColor.a = 0; + } else if (mEventTimer > 0) { + tevStr.mFogColor.a = (u8)(mEventTimer / 120.0f * 255.0f); + } else { + tevStr.mFogColor.a = 0; + } + break; + + default: + ret = true; + break; + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_getAfter(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_getAfter(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_getAfter__11daNpc_zrZ_cFi.s" } #pragma pop - +#endif /* ############################################################################################## */ /* 80B9B1FC-80B9B200 000210 0004+00 0/0 0/0 0/0 .rodata @6102 */ #pragma push @@ -2188,24 +3893,143 @@ COMPILER_STRIP_GATE(0x80B9B208, &lit_6231); /* 80B9877C-80B98ACC 004A9C 0350+00 1/0 0/0 0/0 .text ECut_sealRelease__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_sealRelease(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + BOOL ret = false; + int prm = -1; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 0: + mEventTimer = 20; + mSealReleased = true; + dComIfGp_getEvent().setSkipProc(this, dEv_defaultSkipProc, 0); + mpRockActor->setDemoStart(); + break; + + case 10: + break; + + case 20: + if (mpRockActor != NULL) { + mpRockActor->mBrkAnm.setPlaySpeed(1.0f); + Z2GetAudioMgr()->seStart(Z2SE_OBJ_ZORA_STN_VANISH, &mpRockActor->current.pos, + 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + } + break; + } + } + + switch (prm) { + case 0: + if (cLib_calcTimer(&mEventTimer) == 0) { + ret = true; + } + break; + + case 10: + if (tevStr.mFogColor.a <= 0x1e) { + ret = true; + } + break; + + case 20: + if (mpRockActor->mBrkAnm.isStop()) { + ret = true; + } + break; + + default: + ret = true; + break; + } + + if (prm >= 10) { + cXyz pos = mPath.getPntPos(mPath.getIdx()); + if (!mPath.chkPassedDst(current.pos)) { + cLib_chaseS(&tevStr.mFogColor.a, 8, 8); + cLib_addCalc2(&mSpeed, daNpc_zrZ_Param_c::m.mMaxSpeed, 0.1f, 1.0f); + s16 ang_y = cLib_targetAngleY(¤t.pos, &pos); + s16 ang_x = cLib_targetAngleX(&pos, ¤t.pos); + cLib_addCalcAngleS2(&mMoveAngle.y, ang_y, 2, 0x800); + cLib_addCalcAngleS2(&mMoveAngle.x, ang_x, 2, 0x800); + } else { + mSpeed = 0.0f; + cLib_chaseS(&tevStr.mFogColor.a, 0xff, 8); + mIsMoving = false; + } + } else { + cLib_chaseF(&mSpeed, 0.0f, 3.0f); + mIsMoving = false; + } + + cXyz move_speed(0.0f, 0.0f, mSpeed); + mDoMtx_stack_c::ZXYrotS(mMoveAngle); + mDoMtx_stack_c::multVec(&move_speed, &move_speed); + current.pos += move_speed; + cLib_addCalcAngleS2(&mCurAngle.y, -0x4000, 2, 0x800); + setAngle(mCurAngle.y); + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_sealRelease(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_sealRelease(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_sealRelease__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* 80B98ACC-80B98C34 004DEC 0168+00 1/0 0/0 0/0 .text ECut_srSkip__11daNpc_zrZ_cFi */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::ECut_srSkip(int i_staffID) { + dEvent_manager_c& event_manager = dComIfGp_getEventManager(); + int prm = -1; + int* prm_p = dComIfGp_evmng_getMyIntegerP(i_staffID, "prm"); + if (prm_p != NULL) { + prm = *prm_p; + } + + if (event_manager.getIsAddvance(i_staffID)) { + switch (prm) { + case 10: + mSpeed = 0.0f; + current.pos = mPath.getPntPos(mPath.getIdx()); + old.pos = current.pos; + setAngle(fopAcM_searchPlayerAngleY(this)); + tevStr.mFogColor.a = 0xff; + mIsMoving = false; + if (mpRockActor != NULL) { + fopAcM_delete(mpRockActor); + mpRockActor = NULL; + } + Z2GetAudioMgr()->seStop(Z2SE_OBJ_ZORA_STN_VANISH, 0); + mSealReleased = true; + break; + } + } + + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::ECut_srSkip(int param_0) { +asm BOOL daNpc_zrZ_c::ECut_srSkip(int param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/ECut_srSkip__11daNpc_zrZ_cFi.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B20C-80B9B210 000220 0004+00 1/1 0/0 0/0 .rodata @6287 */ @@ -2213,6 +4037,18 @@ SECTION_RODATA static f32 const lit_6287 = 1000.0f; COMPILER_STRIP_GATE(0x80B9B20C, &lit_6287); /* 80B98C34-80B98D04 004F54 00D0+00 1/1 0/0 0/0 .text pullbackPlayer__11daNpc_zrZ_cFf */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::pullbackPlayer(f32 param_0) { + cXyz pos = mPath.getPntPos(mPath.getBeforeIdx()); + pos.y += 1000.0f; + if (fopAcM_gc_c::gndCheck(&pos)) { + pos.y = fopAcM_gc_c::getGroundY(); + } + s16 angle_y = cLib_targetAngleY(&pos, ¤t.pos); + daPy_getPlayerActorClass()->setPlayerPosAndAngle(&pos, angle_y, 0); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2221,6 +4057,7 @@ asm void daNpc_zrZ_c::pullbackPlayer(f32 param_0) { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/pullbackPlayer__11daNpc_zrZ_cFf.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B210-80B9B214 000224 0004+00 0/1 0/0 0/0 .rodata @6342 */ @@ -2231,24 +4068,193 @@ COMPILER_STRIP_GATE(0x80B9B210, &lit_6342); #pragma pop /* 80B98D04-80B98F84 005024 0280+00 2/0 0/0 0/0 .text wait__11daNpc_zrZ_cFPv */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::wait(void* param_0) { + switch (mMode) { + case 0: + setExpression(EXPR_NONE, -1.0f); + setMotion(MOT_WAIT_GT_A, -1.0f, false); + setLookMode(LOOK_NONE); + mTurnMode = 0; + mMode = 2; + // fallthrough + + case 2: + if (!mIsLeading && daPy_getPlayerActorClass()->current.pos.z >= -120.0f + && daPy_getPlayerActorClass()->checkSwimUp()) { + mOrderEvtNo = EVT_HELP_PRINCE; + mActorMngr[0].entry(daPy_getPlayerActorClass()); + setLookMode(LOOK_PLAYER); + s16 angle_y = fopAcM_searchPlayerAngleY(this); + shape_angle.y = angle_y; + mCurAngle.y = angle_y; + current.angle.y = angle_y; + mOrderNewEvt = true; + } else if (!mIsDamaged) { + BOOL player_attn = mActorMngr[0].getActorP() != NULL; + if (chkFindPlayer2(player_attn, shape_angle.y)) { + if (!player_attn) { + mActorMngr[0].entry(daPy_getPlayerActorClass()); + mTurnMode = 0; + } + } else { + if (player_attn) { + mActorMngr[0].remove(); + mTurnMode = 0; + } + } + + if (mActorMngr[0].getActorP() != NULL) { + setLookMode(LOOK_PLAYER); + } else { + setLookMode(LOOK_NONE); + if (home.angle.y != mCurAngle.y && step(home.angle.y, -1, -1, 15)) { + mMode = 0; + } + } + + if (home.angle.y == mCurAngle.y) { + BOOL player_attn = mActorMngr[0].getActorP() != NULL; + fopAc_ac_c* attn_actor = getAttnActorP( + player_attn, srchAttnActor1, daNpc_zrZ_Param_c::m.mAttnRadius, + daNpc_zrZ_Param_c::m.mAttnUpperY, daNpc_zrZ_Param_c::m.mAttnLowerY, + daNpc_zrZ_Param_c::m.mAttnFovY, shape_angle.y, 120, true + ); + if (attn_actor != NULL) { + mActorMngr[1].entry(attn_actor); + setLookMode(LOOK_ACTOR); + } + } else { + mAttnChangeTimer = 0; + } + } + break; + + case 3: + break; + } + + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::wait(void* param_0) { +asm BOOL daNpc_zrZ_c::wait(void* param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/wait__11daNpc_zrZ_cFPv.s" } #pragma pop +#endif /* 80B98F84-80B998BC 0052A4 0938+00 1/0 0/0 0/0 .text comeHere__11daNpc_zrZ_cFPv */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::comeHere(void* param_0) { + cXyz player_pos = daPy_getPlayerActorClass()->current.pos; + cXyz pnt_pos = mPath.getPntPos(mPath.getIdx()); + + switch (mMode) { + case 0: + if (mIsLeading) { + setExpression(EXPR_NONE, -1.0f); + setMotion(MOT_LEAD, -1.0f, false); + } else { + setExpression(EXPR_NONE, -1.0f); + setMotion(MOT_WAIT_GT_A, -1.0f, false); + } + + setLookMode(LOOK_NONE); + mTurnMode = 0; + mMode = 2; + + if (mPath.getIdx() == mPath.getBeforeIdx()) { + mPath.setNextIdxDst(current.pos); + } + // fallthrough + + case 2: + cLib_addCalcAngleS2(&mCurAngle.y, fopAcM_searchPlayerAngleY(this), 2, 0x800); + setAngle(mCurAngle.y); + + if (!mIsLeading) { + if ((pnt_pos - player_pos).absXZ() < daNpc_zrZ_Param_c::m.mFollowDst) { + mActorMngr[0].entry(daPy_getPlayerActorClass()); + setLookMode(LOOK_PLAYER); + setAngle(fopAcM_searchPlayerAngleY(this)); + setMotion(MOT_LEAD, -1.0f, false); + mIsLeading = true; + } else if (!dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this)) + && (current.pos - player_pos).absXZ() > daNpc_zrZ_Param_c::m.mRestoreDst) + { + mOrderEvtNo = EVT_RESTORE_LINK; + setAngle(fopAcM_searchPlayerAngleY(this)); + } + } else { + if (mPath.chkPassedDst(current.pos)) { + if ((pnt_pos - player_pos).absXZ() < daNpc_zrZ_Param_c::m.mFollowDst) { + mPath.setNextIdxDst(current.pos); + pnt_pos = mPath.getPntPos(mPath.getIdx()); + mIsMoving = true; + } else { + mIsMoving = false; + } + } else { + mIsMoving = true; + } + + if (mPath.getIdx() == mPath.getNextIdx()) { + if (!dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this))) { + dComIfGs_onSwitch(mSwitch1, fopAcM_GetRoomNo(this)); + } + cLib_chaseS(&tevStr.mFogColor.a, 0, 4); + if (tevStr.mFogColor.a == 0) { + fopAcM_delete(this); + } + } + + if (mIsMoving) { + cLib_addCalc2(&mSpeed, daNpc_zrZ_Param_c::m.mMaxSpeed, 0.1f, 1.0f); + s16 angle_y = cLib_targetAngleY(¤t.pos, &pnt_pos); + s16 angle_x = cLib_targetAngleX(&pnt_pos, ¤t.pos); + cLib_addCalcAngleS2(&mMoveAngle.y, angle_y, 2, 0x800); + cLib_addCalcAngleS2(&mMoveAngle.x, angle_x, 2, 0x800); + } else { + cLib_chaseF(&mSpeed, 0.0f, 3.0f); + } + + cXyz move_speed(0.0f, 0.0f, mSpeed); + mDoMtx_stack_c::ZXYrotS(mMoveAngle); + mDoMtx_stack_c::multVec(&move_speed, &move_speed); + current.pos += move_speed; + + if (!dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this)) + && (current.pos - player_pos).absXZ() > daNpc_zrZ_Param_c::m.mRestoreDst) + { + mOrderEvtNo = EVT_RESTORE_LINK; + setAngle(fopAcM_searchPlayerAngleY(this)); + } + } + break; + + case 3: + mSpeed = 0.0f; + break; + } + + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::comeHere(void* param_0) { +asm BOOL daNpc_zrZ_c::comeHere(void* param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/comeHere__11daNpc_zrZ_cFPv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B214-80B9B218 000228 0004+00 0/1 0/0 0/0 .rodata @6785 */ @@ -2259,34 +4265,218 @@ COMPILER_STRIP_GATE(0x80B9B214, &lit_6785); #pragma pop /* 80B998BC-80B9A0EC 005BDC 0830+00 1/0 0/0 0/0 .text comeHere2__11daNpc_zrZ_cFPv */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::comeHere2(void* param_0) { + switch (mMode) { + case 0: { + setExpression(EXPR_NONE, -1.0f); + setMotion(MOT_LEAD, -1.0f, false); + mTurnMode = 0; + mMode = 2; + cXyz pnt_pos = mPath.getPntPos(mPath.getIdx()); + current.angle.y = cLib_targetAngleY(¤t.pos, &pnt_pos); + // fallthrough + } + + case 2: + if (mpGravestoneActor == NULL) { + mpGravestoneActor = (daGraveStone_c*)fpcM_Search(s_sub, this); + } + if (mpClothActor == NULL) { + mpClothActor = (fopAc_ac_c*)fpcM_Search(s_subCloth, this); + } + if (mpRockActor == NULL) { + mpRockActor = (daObjZraRock_c*)fpcM_Search(s_subRock, this); + } + + cLib_addCalcAngleS2(&mCurAngle.y, fopAcM_searchPlayerAngleY(this), 2, 0x800); + setAngle(mCurAngle.y); + + if (!mMusicSet && dComIfGs_isSwitch(mSwitch3, fopAcM_GetRoomNo(this))) { + mMusicSet = true; + Z2GetAudioMgr()->changeBgmStatus(1); + } + + if (!mIsLeading) { + setLookMode(LOOK_PLAYER); + cXyz player_pos = daPy_getPlayerActorClass()->current.pos; + cXyz pnt_pos = mPath.getPntPos(mPath.getIdx()); + + if (mPath.chkPassedDst(current.pos)) { + if (mPath.getIdx() == mPath.getNextIdx()) { + mIsMoving = false; + setMotion(MOT_WAIT_GT_A, -1.0f, false); + if ((current.pos - player_pos).absXZ() < daNpc_zrZ_Param_c::m.mClothesGetDst + && player_pos.y > 450.0f) + { + mClothesObtained = true; + mOrderEvtNo = EVT_CLOTHES_GET; + } + } else if ((pnt_pos - player_pos).absXZ() < daNpc_zrZ_Param_c::m.mFollowDst) { + mPath.setNextIdxDst(current.pos); + pnt_pos = mPath.getPntPos(mPath.getIdx()); + mIsMoving = true; + } else { + mIsMoving = false; + } + } else { + mIsMoving = true; + } + + if (mIsMoving) { + if (mPath.getArg0() == 0) { + if (!mSealReleased) { + mOrderEvtNo = EVT_SEAL_RELEASE; + break; + } else { + cLib_chaseS(&tevStr.mFogColor.a, 0x14, 8); + } + } else { + cLib_chaseS(&tevStr.mFogColor.a, 0xff, 8); + } + + cLib_addCalc2(&mSpeed, daNpc_zrZ_Param_c::m.mMaxSpeed, 0.1f, 1.0f); + s16 angle_y = cLib_targetAngleY(¤t.pos, &pnt_pos); + s16 angle_x = cLib_targetAngleX(&pnt_pos, ¤t.pos); + cLib_addCalcAngleS2(&mMoveAngle.y, angle_y, 2, 0x800); + cLib_addCalcAngleS2(&mMoveAngle.x, angle_x, 2, 0x800); + } else { + cLib_chaseF(&mSpeed, 0.0f, 3.0f); + cLib_chaseS(&tevStr.mFogColor.a, 0xff, 8); + } + + cXyz move_speed(0.0f, 0.0f, mSpeed); + mDoMtx_stack_c::ZXYrotS(mMoveAngle); + mDoMtx_stack_c::multVec(&move_speed, &move_speed); + current.pos += move_speed; + + if ((current.pos - player_pos).absXZ() > daNpc_zrZ_Param_c::m.mRestoreDst) { + mOrderEvtNo = EVT_RESTORE_LINK; + setAngle(fopAcM_searchPlayerAngleY(this)); + } + } + + break; + + case 3: + mSpeed = 0.0f; + break; + } + + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::comeHere2(void* param_0) { +asm BOOL daNpc_zrZ_c::comeHere2(void* param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/comeHere2__11daNpc_zrZ_cFPv.s" } #pragma pop +#endif /* 80B9A0EC-80B9A29C 00640C 01B0+00 2/0 0/0 0/0 .text talk__11daNpc_zrZ_cFPv */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::talk(void* param_0) { + BOOL ret = false; + BOOL talk = false; + + switch (mMode) { + case 0: + if (mIsDamaged) { + break; + } + initTalk(mFlowID, NULL); + mTurnMode = 0; + mMode = 2; + // fallthrough + + case 2: + if (field_0x9ea) { + talk = true; + } else { + setLookMode(LOOK_PLAYER_TALK); + mActorMngr[0].entry(daPy_getPlayerActorClass()); + if (mCurAngle.y == fopAcM_searchPlayerAngleY(this)) { + talk = true; + } else if (step(fopAcM_searchPlayerAngleY(this), -1, -1, 15)) { + setExpression(EXPR_NONE, -1.0f); + setMotion(MOT_WAIT_GT_A, -1.0f, false); + mTurnMode = 0; + } + } + + if (talk && talkProc(NULL, true, NULL)) { + ret = true; + } + + if (ret) { + mMode = 3; + if (!field_0x9ec) { + dComIfGp_event_reset(); + } + field_0x9ec = false; + } + + break; + + case 3: + break; + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::talk(void* param_0) { +asm BOOL daNpc_zrZ_c::talk(void* param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/talk__11daNpc_zrZ_cFPv.s" } #pragma pop +#endif /* 80B9A29C-80B9A380 0065BC 00E4+00 3/0 0/0 0/0 .text test__11daNpc_zrZ_cFPv */ +#ifdef NONMATCHING +// matches with literals +BOOL daNpc_zrZ_c::test(void* param_0) { + switch (mMode) { + case 0: + speedF = 0.0f; + speed.setall(0.0f); + mMode = 2; + // fallthrough + + case 2: + if (daNpc_zrZ_Param_c::m.mTestExpression != mExpression) { + setExpression(daNpc_zrZ_Param_c::m.mTestExpression, daNpc_zrZ_Param_c::m.mMorfFrames); + } + setMotion(daNpc_zrZ_Param_c::m.mTestMotion, daNpc_zrZ_Param_c::m.mMorfFrames, false); + setLookMode(daNpc_zrZ_Param_c::m.mTestLookMode); + mOrderEvtNo = EVT_NONE; + attention_info.flags = 0; + break; + + case 3: + break; + } + + return true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daNpc_zrZ_c::test(void* param_0) { +asm BOOL daNpc_zrZ_c::test(void* param_0) { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/test__11daNpc_zrZ_cFPv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80B9B218-80B9B21C 00022C 0004+00 0/1 0/0 0/0 .rodata @6891 */ @@ -2304,6 +4494,29 @@ COMPILER_STRIP_GATE(0x80B9B21C, &lit_6892); #pragma pop /* 80B9A380-80B9A504 0066A0 0184+00 1/1 0/0 0/0 .text himoCalc__11daNpc_zrZ_cFv */ +#ifdef NONMATCHING +// matches with literals +void daNpc_zrZ_c::himoCalc() { + cXyz vec1 = current.pos; + vec1.y += 470.0f; + cXyz vec2 = mLimbCalcPos - vec1; + vec2.normalize(); + vec2 = vec2 * daNpc_zrZ_Param_c::m.field_0x80; + cXyz vec3(0.0f, -daNpc_zrZ_Param_c::m.field_0x80, 0.0f); + cLib_addCalcPos2(&vec2, vec3, 0.2f, 25.0f); + mLimbCalcPos = vec2 + vec1; + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(29)); + mDoMtx_stack_c::inverse(); + mDoMtx_stack_c::multVec(&mLimbCalcPos, &mLimbCalcRelPos); + mDoMtx_stack_c::pop(); + + mLimbAngle.x = cM_atan2s(mLimbCalcRelPos.y, mLimbCalcRelPos.x); + mLimbAngle.y = 0; + mLimbAngle.z = cM_atan2s(mLimbCalcRelPos.z, mLimbCalcRelPos.x); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2312,50 +4525,31 @@ asm void daNpc_zrZ_c::himoCalc() { #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/himoCalc__11daNpc_zrZ_cFv.s" } #pragma pop +#endif /* 80B9A504-80B9A524 006824 0020+00 1/0 0/0 0/0 .text daNpc_zrZ_Create__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daNpc_zrZ_Create(void* param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Create__FPv.s" +static cPhs__Step daNpc_zrZ_Create(void* i_this) { + return static_cast(i_this)->create(); } -#pragma pop /* 80B9A524-80B9A544 006844 0020+00 1/0 0/0 0/0 .text daNpc_zrZ_Delete__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daNpc_zrZ_Delete(void* param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Delete__FPv.s" +static int daNpc_zrZ_Delete(void* i_this) { + return static_cast(i_this)->Delete(); } -#pragma pop /* 80B9A544-80B9A564 006864 0020+00 1/0 0/0 0/0 .text daNpc_zrZ_Execute__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daNpc_zrZ_Execute(void* param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Execute__FPv.s" +static int daNpc_zrZ_Execute(void* i_this) { + return static_cast(i_this)->Execute(); } -#pragma pop /* 80B9A564-80B9A584 006884 0020+00 1/0 0/0 0/0 .text daNpc_zrZ_Draw__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daNpc_zrZ_Draw(void* param_0) { - nofralloc -#include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/daNpc_zrZ_Draw__FPv.s" +static int daNpc_zrZ_Draw(void* i_this) { + return static_cast(i_this)->Draw(); } -#pragma pop /* 80B9A584-80B9A58C 0068A4 0008+00 1/0 0/0 0/0 .text daNpc_zrZ_IsDelete__FPv */ -static bool daNpc_zrZ_IsDelete(void* param_0) { - return true; +static int daNpc_zrZ_IsDelete(void* i_this) { + return 1; } /* 80B9A58C-80B9A5BC 0068AC 0030+00 1/0 0/0 0/0 .text calc__11J3DTexNoAnmCFPUs */ @@ -2584,7 +4778,8 @@ void daNpc_zrZ_c::adjustShapeAngle() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm daNpc_zrZ_Param_c::~daNpc_zrZ_Param_c() { +// asm daNpc_zrZ_Param_c::~daNpc_zrZ_Param_c() { +extern "C" asm void __dt__17daNpc_zrZ_Param_cFv() { nofralloc #include "asm/rel/d/a/npc/d_a_npc_zrz/d_a_npc_zrz/__dt__17daNpc_zrZ_Param_cFv.s" } diff --git a/src/d/a/d_a_npc.cpp b/src/d/a/d_a_npc.cpp index c5e8978c623..86af0d6a8ff 100644 --- a/src/d/a/d_a_npc.cpp +++ b/src/d/a/d_a_npc.cpp @@ -4635,7 +4635,7 @@ BOOL daNpcF_c::execute() { setHitodamaPrtcl(); } mOldAngle = mCurAngle; - field_0x930 = 0; + mCutType = 0; mOrderSpeakEvt = false; mOrderNewEvt = false; field_0x9eb = false; @@ -4648,8 +4648,8 @@ BOOL daNpcF_c::execute() { mAttnActor[i].remove(); } } - if (field_0x954 != 0) { - cLib_calcTimer(&field_0x954); + if (mDamageTimer != 0) { + cLib_calcTimer(&mDamageTimer); } return true; } @@ -4667,30 +4667,31 @@ asm BOOL daNpcF_c::execute() { /* 801522AC-80152614 14CBEC 0368+00 0/0 0/0 33/33 .text draw__8daNpcF_cFiifP11_GXColorS10i */ #ifdef NONMATCHING // literals -BOOL daNpcF_c::draw(BOOL param_0, BOOL param_1, f32 i_shadowDepth, _GXColorS10* param_3, - BOOL param_4) { - f32 fVar1, frame; +int daNpcF_c::draw(BOOL i_isTest, BOOL param_1, f32 i_shadowDepth, _GXColorS10* i_fogColor, + BOOL i_hideDamage) { + f32 damage_ratio, frame; J3DModel* model = mpMorf->getModel(); J3DModelData* modelData = model->getModelData(); field_0x9f3 = 1; if (!checkHide()) { - if (!param_4 && field_0x954 != 0 && field_0x958 != 0) { - fVar1 = (f32)field_0x954 / (f32)field_0x958; + if (!i_hideDamage && mDamageTimer != 0 && mTotalDamageTimer != 0) { + damage_ratio = (f32)mDamageTimer / (f32)mTotalDamageTimer; } else { - fVar1 = 0.0f; + damage_ratio = 0.0f; } - if (cM3d_IsZero_inverted(fVar1)) { - tevStr.mFogColor.r = (s16)(fVar1 * 20.0f); + + if (cM3d_IsZero_inverted(damage_ratio)) { + tevStr.mFogColor.r = (s16)(damage_ratio * 20.0f); tevStr.mFogColor.g = 0; - } else if (param_0) { + } else if (i_isTest) { tevStr.mFogColor.g = 20; tevStr.mFogColor.r = 0; - } else if (param_3 != NULL) { - tevStr.mFogColor.r = param_3->r; - tevStr.mFogColor.g = param_3->g; - tevStr.mFogColor.b = param_3->b; - tevStr.mFogColor.a = param_3->a; + } else if (i_fogColor != NULL) { + tevStr.mFogColor.r = i_fogColor->r; + tevStr.mFogColor.g = i_fogColor->g; + tevStr.mFogColor.b = i_fogColor->b; + tevStr.mFogColor.a = i_fogColor->a; } else { tevStr.mFogColor.g = 0; tevStr.mFogColor.r = 0; @@ -4745,7 +4746,7 @@ BOOL daNpcF_c::draw(BOOL param_0, BOOL param_1, f32 i_shadowDepth, _GXColorS10* drawOtherMdls(); } } - return true; + return 1; } #else #pragma push @@ -4761,15 +4762,17 @@ asm BOOL daNpcF_c::draw(BOOL param_0, BOOL param_1, f32 param_2, _GXColorS10* pa /* 80152614-80152654 14CF54 0040+00 0/0 0/0 13/13 .text * tgHitCallBack__8daNpcF_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpcF_c::tgHitCallBack(fopAc_ac_c* param_0, dCcD_GObjInf* param_1, fopAc_ac_c* param_2, - dCcD_GObjInf* param_3) { - nofralloc -#include "asm/d/a/d_a_npc/tgHitCallBack__8daNpcF_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf.s" +void daNpcF_c::tgHitCallBack(fopAc_ac_c* i_this, dCcD_GObjInf* param_1, fopAc_ac_c* i_actor, + dCcD_GObjInf* param_3) { + if (i_actor != NULL && fopAcM_GetProfName(i_actor) == PROC_ALINK) { + if (daPy_getPlayerActorClass() == i_actor) { + u8 cut_type = static_cast(i_actor)->getCutType(); + static_cast(i_this)->setCutType(cut_type); + } else { + static_cast(i_this)->setCutType(daPy_py_c::CUT_TYPE_NM_VERTICAL); + } + } } -#pragma pop /* ############################################################################################## */ /* 804257E8-80425978 052508 0190+00 4/4 0/0 0/0 .bss mFindActorPList__8daNpcF_c */ @@ -4872,7 +4875,7 @@ void daNpcF_c::initialize() { field_0x908[i].setall(0); mLookatAngle[i].setall(0); } - mCutIndex = -1; + mStaffID = -1; field_0x930 = 0; mAttnIdx = 0; mAttnChangeTimer = 0; @@ -4880,8 +4883,8 @@ void daNpcF_c::initialize() { mAttnActorTimer[i] = 0; } mMsgTimer = 0; - field_0x954 = 0; - field_0x958 = 0; + mDamageTimer = 0; + mTotalDamageTimer = 0; field_0x95c = 0; mEventTimer = 0; mBtpTimer = 0; @@ -4921,7 +4924,7 @@ void daNpcF_c::initialize() { mOrderNewEvt = false; field_0x9ee = false; field_0x9ef = 0; - field_0x9f0 = 0; + mIsDamaged = false; field_0x9f1 = 0; mHide = false; field_0x9f3 = 0; @@ -5317,14 +5320,31 @@ asm void daNpcF_c::setLookatMtx(int param_0, int* param_1, f32 param_2) { /* 80153578-80153658 14DEB8 00E0+00 0/0 0/0 13/13 .text hitChk2__8daNpcF_cFP8dCcD_Cylii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daNpcF_c::hitChk2(dCcD_Cyl* param_0, int param_1, int param_2) { - nofralloc -#include "asm/d/a/d_a_npc/hitChk2__8daNpcF_cFP8dCcD_Cylii.s" +BOOL daNpcF_c::hitChk2(dCcD_Cyl* i_ccCyl, BOOL param_1, BOOL param_2) { + static_cast(i_ccCyl->GetStts())->Move(); + if (mDamageTimer == 0 && i_ccCyl->ChkTgHit()) { + fopAc_ac_c* hit_actor = i_ccCyl->GetTgHitAc(); + if (hit_actor != NULL) { + field_0x990 = fopAcM_searchActorAngleY(this, hit_actor) - mCurAngle.y; + if (fopAcM_GetName(hit_actor) == PROC_NPC_TK) { + if (param_1) { + static_cast(hit_actor)->setBump(); + return true; + } else { + return false; + } + } else { + if (param_2) { + return true; + } else { + return false; + } + } + } + } + i_ccCyl->ClrTgHit(); + return false; } -#pragma pop /* ############################################################################################## */ /* 804534A4-804534A8 001AA4 0004+00 1/1 0/0 0/0 .sdata2 @11061 */ @@ -5334,6 +5354,25 @@ SECTION_SDATA2 static f32 lit_11061 = 8192.0f; SECTION_SDATA2 static f32 lit_11062 = 12743.0f; /* 80153658-80153718 14DF98 00C0+00 0/0 0/0 12/12 .text setDamage__8daNpcF_cFiii */ +#ifdef NONMATCHING +// matches with literals +void daNpcF_c::setDamage(int i_timer, int i_expression, int i_motion) { + if (i_expression >= 0) { + setExpression(i_expression, 0.0f); + } + if (i_motion >= 0) { + setMotion(i_motion, 0.0f, true); + } + field_0x984[0] = 8192.0f; + field_0x984[2] = 12743.0f; + field_0x992 = 0x4000; + mTotalDamageTimer = i_timer; + mDamageTimer = mTotalDamageTimer; + speed.setall(0.0f); + speedF = 0.0f; + mIsDamaged = true; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -5342,6 +5381,7 @@ asm void daNpcF_c::setDamage(int param_0, int param_1, int param_2) { #include "asm/d/a/d_a_npc/setDamage__8daNpcF_cFiii.s" } #pragma pop +#endif /* 80153718-8015387C 14E058 0164+00 0/0 0/0 81/81 .text ctrlMsgAnm__8daNpcF_cFRiRiP10fopAc_ac_ci */ @@ -5350,7 +5390,7 @@ asm void daNpcF_c::setDamage(int param_0, int param_1, int param_2) { int daNpcF_c::ctrlMsgAnm(int& o_expression, int& o_motion, fopAc_ac_c* param_2, BOOL param_3) { o_expression = -1; o_motion = -1; - if (param_3 || eventInfo.checkCommandTalk() || mCutIndex != -1) { + if (param_3 || eventInfo.checkCommandTalk() || mStaffID != -1) { fopAc_ac_c* talkPartner = dComIfGp_event_getTalkPartner(); if (talkPartner == param_2) { fopAc_ac_c* actor = dMsgObject_c::getActor();