event lib

This commit is contained in:
lepelog 2022-06-27 01:37:35 +02:00
parent d0e349630e
commit 0b060164da
14 changed files with 155 additions and 505 deletions

View File

@ -1,32 +0,0 @@
lbl_80048BD8:
/* 80048BD8 3C 60 80 3B */ lis r3, cNullVec__6Z2Calc@ha /* 0x803A82B8@ha */
/* 80048BDC 38 A3 82 B8 */ addi r5, r3, cNullVec__6Z2Calc@l /* 0x803A82B8@l */
/* 80048BE0 3C 60 80 42 */ lis r3, l_startAction@ha /* 0x804246E0@ha */
/* 80048BE4 38 83 46 E0 */ addi r4, r3, l_startAction@l /* 0x804246E0@l */
/* 80048BE8 80 65 00 0C */ lwz r3, 0xc(r5)
/* 80048BEC 80 05 00 10 */ lwz r0, 0x10(r5)
/* 80048BF0 90 64 00 00 */ stw r3, 0(r4)
/* 80048BF4 90 04 00 04 */ stw r0, 4(r4)
/* 80048BF8 80 05 00 14 */ lwz r0, 0x14(r5)
/* 80048BFC 90 04 00 08 */ stw r0, 8(r4)
/* 80048C00 80 65 00 18 */ lwz r3, 0x18(r5)
/* 80048C04 80 05 00 1C */ lwz r0, 0x1c(r5)
/* 80048C08 90 64 00 0C */ stw r3, 0xc(r4)
/* 80048C0C 90 04 00 10 */ stw r0, 0x10(r4)
/* 80048C10 80 05 00 20 */ lwz r0, 0x20(r5)
/* 80048C14 90 04 00 14 */ stw r0, 0x14(r4)
/* 80048C18 3C 60 80 42 */ lis r3, l_runAction@ha /* 0x804246F8@ha */
/* 80048C1C 38 83 46 F8 */ addi r4, r3, l_runAction@l /* 0x804246F8@l */
/* 80048C20 80 65 00 24 */ lwz r3, 0x24(r5)
/* 80048C24 80 05 00 28 */ lwz r0, 0x28(r5)
/* 80048C28 90 64 00 00 */ stw r3, 0(r4)
/* 80048C2C 90 04 00 04 */ stw r0, 4(r4)
/* 80048C30 80 05 00 2C */ lwz r0, 0x2c(r5)
/* 80048C34 90 04 00 08 */ stw r0, 8(r4)
/* 80048C38 80 65 00 30 */ lwz r3, 0x30(r5)
/* 80048C3C 80 05 00 34 */ lwz r0, 0x34(r5)
/* 80048C40 90 64 00 0C */ stw r3, 0xc(r4)
/* 80048C44 90 04 00 10 */ stw r0, 0x10(r4)
/* 80048C48 80 05 00 38 */ lwz r0, 0x38(r5)
/* 80048C4C 90 04 00 14 */ stw r0, 0x14(r4)
/* 80048C50 4E 80 00 20 */ blr

View File

@ -1,17 +0,0 @@
lbl_8004886C:
/* 8004886C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048870 7C 08 02 A6 */ mflr r0
/* 80048874 90 01 00 14 */ stw r0, 0x14(r1)
/* 80048878 80 03 00 08 */ lwz r0, 8(r3)
/* 8004887C 28 00 00 00 */ cmplwi r0, 0
/* 80048880 40 82 00 0C */ bne lbl_8004888C
/* 80048884 38 60 00 00 */ li r3, 0
/* 80048888 48 00 00 0C */ b lbl_80048894
lbl_8004888C:
/* 8004888C 48 00 01 6D */ bl executeAction__17dEvLib_callback_cFv
/* 80048890 38 60 00 01 */ li r3, 1
lbl_80048894:
/* 80048894 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048898 7C 08 03 A6 */ mtlr r0
/* 8004889C 38 21 00 10 */ addi r1, r1, 0x10
/* 800488A0 4E 80 00 20 */ blr

View File

@ -1,25 +0,0 @@
lbl_800489F8:
/* 800489F8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 800489FC 7C 08 02 A6 */ mflr r0
/* 80048A00 90 01 00 14 */ stw r0, 0x14(r1)
/* 80048A04 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80048A08 7C 7F 1B 78 */ mr r31, r3
/* 80048A0C 80 63 00 08 */ lwz r3, 8(r3)
/* 80048A10 38 63 00 0C */ addi r3, r3, 0xc
/* 80048A14 48 31 96 05 */ bl __ptmf_test
/* 80048A18 2C 03 00 00 */ cmpwi r3, 0
/* 80048A1C 40 82 00 0C */ bne lbl_80048A28
/* 80048A20 38 60 00 01 */ li r3, 1
/* 80048A24 48 00 00 18 */ b lbl_80048A3C
lbl_80048A28:
/* 80048A28 80 7F 00 08 */ lwz r3, 8(r31)
/* 80048A2C 39 83 00 0C */ addi r12, r3, 0xc
/* 80048A30 7F E3 FB 78 */ mr r3, r31
/* 80048A34 48 31 96 51 */ bl __ptmf_scall
/* 80048A38 60 00 00 00 */ nop
lbl_80048A3C:
/* 80048A3C 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80048A40 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048A44 7C 08 03 A6 */ mtlr r0
/* 80048A48 38 21 00 10 */ addi r1, r1, 0x10
/* 80048A4C 4E 80 00 20 */ blr

View File

@ -1,39 +0,0 @@
lbl_80048B48:
/* 80048B48 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048B4C 7C 08 02 A6 */ mflr r0
/* 80048B50 90 01 00 14 */ stw r0, 0x14(r1)
/* 80048B54 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80048B58 93 C1 00 08 */ stw r30, 8(r1)
/* 80048B5C 7C 7E 1B 78 */ mr r30, r3
/* 80048B60 80 63 00 04 */ lwz r3, 4(r3)
/* 80048B64 A8 83 00 FC */ lha r4, 0xfc(r3)
/* 80048B68 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */
/* 80048B6C 3B E3 61 C0 */ addi r31, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */
/* 80048B70 38 7F 4F F8 */ addi r3, r31, 0x4ff8
/* 80048B74 4B FF EF 05 */ bl endCheck__16dEvent_manager_cFs
/* 80048B78 2C 03 00 00 */ cmpwi r3, 0
/* 80048B7C 40 82 00 1C */ bne lbl_80048B98
/* 80048B80 7F C3 F3 78 */ mr r3, r30
/* 80048B84 81 9E 00 00 */ lwz r12, 0(r30)
/* 80048B88 81 8C 00 10 */ lwz r12, 0x10(r12)
/* 80048B8C 7D 89 03 A6 */ mtctr r12
/* 80048B90 4E 80 04 21 */ bctrl
/* 80048B94 48 00 00 2C */ b lbl_80048BC0
lbl_80048B98:
/* 80048B98 38 7F 4E C8 */ addi r3, r31, 0x4ec8
/* 80048B9C 4B FF 98 CD */ bl reset__14dEvt_control_cFv
/* 80048BA0 7F C3 F3 78 */ mr r3, r30
/* 80048BA4 38 80 00 00 */ li r4, 0
/* 80048BA8 4B FF FD C9 */ bl func_80048970
/* 80048BAC 7F C3 F3 78 */ mr r3, r30
/* 80048BB0 81 9E 00 00 */ lwz r12, 0(r30)
/* 80048BB4 81 8C 00 14 */ lwz r12, 0x14(r12)
/* 80048BB8 7D 89 03 A6 */ mtctr r12
/* 80048BBC 4E 80 04 21 */ bctrl
lbl_80048BC0:
/* 80048BC0 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80048BC4 83 C1 00 08 */ lwz r30, 8(r1)
/* 80048BC8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048BCC 7C 08 03 A6 */ mtlr r0
/* 80048BD0 38 21 00 10 */ addi r1, r1, 0x10
/* 80048BD4 4E 80 00 20 */ blr

View File

@ -1,48 +0,0 @@
lbl_80048A70:
/* 80048A70 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048A74 7C 08 02 A6 */ mflr r0
/* 80048A78 90 01 00 14 */ stw r0, 0x14(r1)
/* 80048A7C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80048A80 7C 7F 1B 78 */ mr r31, r3
/* 80048A84 80 C3 00 04 */ lwz r6, 4(r3)
/* 80048A88 A0 06 00 F8 */ lhz r0, 0xf8(r6)
/* 80048A8C 28 00 00 02 */ cmplwi r0, 2
/* 80048A90 41 82 00 6C */ beq lbl_80048AFC
/* 80048A94 88 06 00 FE */ lbz r0, 0xfe(r6)
/* 80048A98 28 00 00 FF */ cmplwi r0, 0xff
/* 80048A9C 41 82 00 28 */ beq lbl_80048AC4
/* 80048AA0 A8 A6 00 FC */ lha r5, 0xfc(r6)
/* 80048AA4 7C C3 33 78 */ mr r3, r6
/* 80048AA8 7C 04 03 78 */ mr r4, r0
/* 80048AAC 3C C0 00 01 */ lis r6, 0x0001 /* 0x0000FFFF@ha */
/* 80048AB0 38 C6 FF FF */ addi r6, r6, 0xFFFF /* 0x0000FFFF@l */
/* 80048AB4 A0 FF 00 0C */ lhz r7, 0xc(r31)
/* 80048AB8 39 00 00 00 */ li r8, 0
/* 80048ABC 4B FD 2C F9 */ bl fopAcM_orderMapToolEvent__FP10fopAc_ac_cUcsUsUsUs
/* 80048AC0 48 00 00 24 */ b lbl_80048AE4
lbl_80048AC4:
/* 80048AC4 A8 86 00 FC */ lha r4, 0xfc(r6)
/* 80048AC8 7C C3 33 78 */ mr r3, r6
/* 80048ACC 7C 05 03 78 */ mr r5, r0
/* 80048AD0 3C C0 00 01 */ lis r6, 0x0001 /* 0x0000FFFF@ha */
/* 80048AD4 38 C6 FF FF */ addi r6, r6, 0xFFFF /* 0x0000FFFF@l */
/* 80048AD8 38 E0 00 00 */ li r7, 0
/* 80048ADC A1 1F 00 0C */ lhz r8, 0xc(r31)
/* 80048AE0 4B FD 2B 9D */ bl fopAcM_orderOtherEventId__FP10fopAc_ac_csUcUsUsUs
lbl_80048AE4:
/* 80048AE4 80 7F 00 04 */ lwz r3, 4(r31)
/* 80048AE8 A0 03 00 FA */ lhz r0, 0xfa(r3)
/* 80048AEC 60 00 00 02 */ ori r0, r0, 2
/* 80048AF0 B0 03 00 FA */ sth r0, 0xfa(r3)
/* 80048AF4 38 60 00 01 */ li r3, 1
/* 80048AF8 48 00 00 10 */ b lbl_80048B08
lbl_80048AFC:
/* 80048AFC 3C 80 80 42 */ lis r4, l_runAction@ha /* 0x804246F8@ha */
/* 80048B00 38 84 46 F8 */ addi r4, r4, l_runAction@l /* 0x804246F8@l */
/* 80048B04 4B FF FE 6D */ bl func_80048970
lbl_80048B08:
/* 80048B08 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80048B0C 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048B10 7C 08 03 A6 */ mtlr r0
/* 80048B14 38 21 00 10 */ addi r1, r1, 0x10
/* 80048B18 4E 80 00 20 */ blr

View File

@ -1,17 +0,0 @@
lbl_80048970:
/* 80048970 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048974 7C 08 02 A6 */ mflr r0
/* 80048978 90 01 00 14 */ stw r0, 0x14(r1)
/* 8004897C 90 83 00 08 */ stw r4, 8(r3)
/* 80048980 80 03 00 08 */ lwz r0, 8(r3)
/* 80048984 28 00 00 00 */ cmplwi r0, 0
/* 80048988 40 82 00 0C */ bne lbl_80048994
/* 8004898C 38 60 00 00 */ li r3, 0
/* 80048990 48 00 00 08 */ b lbl_80048998
lbl_80048994:
/* 80048994 48 00 00 15 */ bl initAction__17dEvLib_callback_cFv
lbl_80048998:
/* 80048998 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8004899C 7C 08 03 A6 */ mtlr r0
/* 800489A0 38 21 00 10 */ addi r1, r1, 0x10
/* 800489A4 4E 80 00 20 */ blr

View File

@ -1,23 +0,0 @@
lbl_800489A8:
/* 800489A8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 800489AC 7C 08 02 A6 */ mflr r0
/* 800489B0 90 01 00 14 */ stw r0, 0x14(r1)
/* 800489B4 93 E1 00 0C */ stw r31, 0xc(r1)
/* 800489B8 7C 7F 1B 78 */ mr r31, r3
/* 800489BC 80 63 00 08 */ lwz r3, 8(r3)
/* 800489C0 48 31 96 59 */ bl __ptmf_test
/* 800489C4 2C 03 00 00 */ cmpwi r3, 0
/* 800489C8 40 82 00 0C */ bne lbl_800489D4
/* 800489CC 38 60 00 01 */ li r3, 1
/* 800489D0 48 00 00 14 */ b lbl_800489E4
lbl_800489D4:
/* 800489D4 81 9F 00 08 */ lwz r12, 8(r31)
/* 800489D8 7F E3 FB 78 */ mr r3, r31
/* 800489DC 48 31 96 A9 */ bl __ptmf_scall
/* 800489E0 60 00 00 00 */ nop
lbl_800489E4:
/* 800489E4 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 800489E8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 800489EC 7C 08 03 A6 */ mtlr r0
/* 800489F0 38 21 00 10 */ addi r1, r1, 0x10
/* 800489F4 4E 80 00 20 */ blr

View File

@ -1,12 +0,0 @@
lbl_80048B1C:
/* 80048B1C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048B20 7C 08 02 A6 */ mflr r0
/* 80048B24 90 01 00 14 */ stw r0, 0x14(r1)
/* 80048B28 81 83 00 00 */ lwz r12, 0(r3)
/* 80048B2C 81 8C 00 0C */ lwz r12, 0xc(r12)
/* 80048B30 7D 89 03 A6 */ mtctr r12
/* 80048B34 4E 80 04 21 */ bctrl
/* 80048B38 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048B3C 7C 08 03 A6 */ mtlr r0
/* 80048B40 38 21 00 10 */ addi r1, r1, 0x10
/* 80048B44 4E 80 00 20 */ blr

View File

@ -1,9 +0,0 @@
lbl_80048A50:
/* 80048A50 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048A54 7C 08 02 A6 */ mflr r0
/* 80048A58 90 01 00 14 */ stw r0, 0x14(r1)
/* 80048A5C 48 00 00 15 */ bl executeStart__17dEvLib_callback_cFv
/* 80048A60 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048A64 7C 08 03 A6 */ mtlr r0
/* 80048A68 38 21 00 10 */ addi r1, r1, 0x10
/* 80048A6C 4E 80 00 20 */ blr

View File

@ -1,14 +0,0 @@
lbl_80048940:
/* 80048940 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80048944 7C 08 02 A6 */ mflr r0
/* 80048948 90 01 00 14 */ stw r0, 0x14(r1)
/* 8004894C 2C 06 00 00 */ cmpwi r6, 0
/* 80048950 38 C0 00 01 */ li r6, 1
/* 80048954 41 82 00 08 */ beq lbl_8004895C
/* 80048958 38 C0 01 01 */ li r6, 0x101
lbl_8004895C:
/* 8004895C 4B FF FF 49 */ bl setEvent__17dEvLib_callback_cFiii
/* 80048960 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048964 7C 08 03 A6 */ mtlr r0
/* 80048968 38 21 00 10 */ addi r1, r1, 0x10
/* 8004896C 4E 80 00 20 */ blr

View File

@ -1,43 +0,0 @@
lbl_800488A4:
/* 800488A4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 800488A8 7C 08 02 A6 */ mflr r0
/* 800488AC 90 01 00 14 */ stw r0, 0x14(r1)
/* 800488B0 93 E1 00 0C */ stw r31, 0xc(r1)
/* 800488B4 93 C1 00 08 */ stw r30, 8(r1)
/* 800488B8 7C 7E 1B 78 */ mr r30, r3
/* 800488BC 7C DF 33 78 */ mr r31, r6
/* 800488C0 80 03 00 08 */ lwz r0, 8(r3)
/* 800488C4 28 00 00 00 */ cmplwi r0, 0
/* 800488C8 41 82 00 0C */ beq lbl_800488D4
/* 800488CC 38 60 00 00 */ li r3, 0
/* 800488D0 48 00 00 58 */ b lbl_80048928
lbl_800488D4:
/* 800488D4 54 80 06 3E */ clrlwi r0, r4, 0x18
/* 800488D8 80 7E 00 04 */ lwz r3, 4(r30)
/* 800488DC 98 83 00 FE */ stb r4, 0xfe(r3)
/* 800488E0 2C 04 00 FF */ cmpwi r4, 0xff
/* 800488E4 41 82 00 28 */ beq lbl_8004890C
/* 800488E8 2C 05 00 FF */ cmpwi r5, 0xff
/* 800488EC 40 82 00 20 */ bne lbl_8004890C
/* 800488F0 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */
/* 800488F4 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */
/* 800488F8 38 63 4F F8 */ addi r3, r3, 0x4ff8
/* 800488FC 80 9E 00 04 */ lwz r4, 4(r30)
/* 80048900 7C 05 03 78 */ mr r5, r0
/* 80048904 4B FF ED 95 */ bl getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc
/* 80048908 7C 65 07 34 */ extsh r5, r3
lbl_8004890C:
/* 8004890C 80 7E 00 04 */ lwz r3, 4(r30)
/* 80048910 B0 A3 00 FC */ sth r5, 0xfc(r3)
/* 80048914 B3 FE 00 0C */ sth r31, 0xc(r30)
/* 80048918 7F C3 F3 78 */ mr r3, r30
/* 8004891C 3C 80 80 42 */ lis r4, l_startAction@ha /* 0x804246E0@ha */
/* 80048920 38 84 46 E0 */ addi r4, r4, l_startAction@l /* 0x804246E0@l */
/* 80048924 48 00 00 4D */ bl func_80048970
lbl_80048928:
/* 80048928 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8004892C 83 C1 00 08 */ lwz r30, 8(r1)
/* 80048930 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80048934 7C 08 03 A6 */ mtlr r0
/* 80048938 38 21 00 10 */ addi r1, r1, 0x10
/* 8004893C 4E 80 00 20 */ blr

View File

@ -2,5 +2,44 @@
#define D_EVENT_D_EVENT_LIB_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
template <typename A0>
struct action_class {
typedef BOOL (A0::*fptr)();
fptr init;
fptr execute;
action_class(fptr pInit, fptr pExecute) {
init = pInit;
execute = pExecute;
}
fptr& getInit() { return init; }
fptr& getExecute() { return execute; }
};
struct dEvLib_callback_c {
/* 8004886C */ BOOL eventUpdate();
/* 800488A4 */ BOOL setEvent(int, int, int);
/* 80048940 */ void orderEvent(int, int, int);
/* 80048970 */ BOOL setAction(action_class<dEvLib_callback_c>*);
/* 800489A8 */ BOOL initAction();
/* 800489F8 */ BOOL executeAction();
/* 80048A50 */ BOOL initStart();
/* 80048A70 */ BOOL executeStart();
/* 80048B1C */ BOOL initRun();
/* 80048B48 */ BOOL executeRun();
virtual ~dEvLib_callback_c() {}
virtual BOOL eventStart() { return TRUE; }
virtual BOOL eventRun() { return TRUE; }
virtual BOOL eventEnd() { return TRUE; }
fopAc_ac_c* mActor;
action_class<dEvLib_callback_c>* mAction;
u16 _C;
};
#endif /* D_EVENT_D_EVENT_LIB_H */

View File

@ -17,10 +17,12 @@ public:
char* getEventName();
void beforeProc();
void onCondition(u16);
void i_onCondition(u16 cond) { mCondition |= cond; }
void offCondition(u16);
void i_offCondition(u16 cond) { mCondition &= ~cond; }
bool checkCommandCatch();
BOOL checkCommandDoor();
bool checkCommandDemoAccrpt();
BOOL checkCommandDemoAccrpt() { return mCommand == 2; }
void setCommand(u16 command) { mCommand = command; }
void setMapToolId(u8 id) { mMapToolId = id; }

View File

@ -4,187 +4,23 @@
//
#include "d/event/d_event_lib.h"
#include "d/com/d_com_inf_game.h"
#include "d/event/d_event_manager.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct fopAc_ac_c {};
struct dEvt_control_c {
/* 80042468 */ void reset();
};
struct dEvent_manager_c {
/* 80047698 */ void getEventIdx(fopAc_ac_c*, u8);
/* 80047A78 */ void endCheck(s16);
};
template <typename A0>
struct action_class {};
/* action_class<dEvLib_callback_c> */
struct action_class__template0 {};
struct dEvLib_callback_c {
/* 8004886C */ void eventUpdate();
/* 800488A4 */ void setEvent(int, int, int);
/* 80048940 */ void orderEvent(int, int, int);
/* 80048970 */ void setAction(action_class<dEvLib_callback_c>*);
/* 800489A8 */ void initAction();
/* 800489F8 */ void executeAction();
/* 80048A50 */ void initStart();
/* 80048A70 */ void executeStart();
/* 80048B1C */ void initRun();
/* 80048B48 */ void executeRun();
};
//
// Forward References:
//
extern "C" void eventUpdate__17dEvLib_callback_cFv();
extern "C" void setEvent__17dEvLib_callback_cFiii();
extern "C" void orderEvent__17dEvLib_callback_cFiii();
extern "C" void func_80048970();
extern "C" void initAction__17dEvLib_callback_cFv();
extern "C" void executeAction__17dEvLib_callback_cFv();
extern "C" void initStart__17dEvLib_callback_cFv();
extern "C" void executeStart__17dEvLib_callback_cFv();
extern "C" void initRun__17dEvLib_callback_cFv();
extern "C" void executeRun__17dEvLib_callback_cFv();
extern "C" void __sinit_d_event_lib_cpp();
//
// External References:
//
extern "C" void fopAcM_orderOtherEventId__FP10fopAc_ac_csUcUsUsUs();
extern "C" void fopAcM_orderMapToolEvent__FP10fopAc_ac_cUcsUsUsUs();
extern "C" void reset__14dEvt_control_cFv();
extern "C" void getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc();
extern "C" void endCheck__16dEvent_manager_cFs();
extern "C" void __ptmf_test();
extern "C" void __ptmf_scall();
extern "C" extern u8 g_dComIfG_gameInfo[122384];
#include "f_op/f_op_actor_mng.h"
//
// Declarations:
//
/* 8004886C-800488A4 0431AC 0038+00 0/0 0/0 23/23 .text eventUpdate__17dEvLib_callback_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::eventUpdate() {
nofralloc
#include "asm/d/event/d_event_lib/eventUpdate__17dEvLib_callback_cFv.s"
inline dEvent_manager_c& dComIfGp_getEventManager() {
return g_dComIfG_gameInfo.play.getEvtManager();
}
#pragma pop
/* ############################################################################################## */
/* 804246E0-804246F8 051400 0018+00 2/2 0/0 0/0 .bss l_startAction */
static u8 l_startAction[24];
/* 800488A4-80048940 0431E4 009C+00 1/1 0/0 1/1 .text setEvent__17dEvLib_callback_cFiii
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::setEvent(int param_0, int param_1, int param_2) {
nofralloc
#include "asm/d/event/d_event_lib/setEvent__17dEvLib_callback_cFiii.s"
inline dEvt_control_c& dComIfGp_getEvent() {
return g_dComIfG_gameInfo.play.getEvent();
}
#pragma pop
/* 80048940-80048970 043280 0030+00 0/0 0/0 21/21 .text orderEvent__17dEvLib_callback_cFiii */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::orderEvent(int param_0, int param_1, int param_2) {
nofralloc
#include "asm/d/event/d_event_lib/orderEvent__17dEvLib_callback_cFiii.s"
}
#pragma pop
/* 80048970-800489A8 0432B0 0038+00 3/3 0/0 0/0 .text
* setAction__17dEvLib_callback_cFP33action_class<17dEvLib_callback_c> */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::setAction(action_class<dEvLib_callback_c>* param_0) {
nofralloc
#include "asm/d/event/d_event_lib/func_80048970.s"
}
#pragma pop
/* 800489A8-800489F8 0432E8 0050+00 1/1 0/0 0/0 .text initAction__17dEvLib_callback_cFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::initAction() {
nofralloc
#include "asm/d/event/d_event_lib/initAction__17dEvLib_callback_cFv.s"
}
#pragma pop
/* 800489F8-80048A50 043338 0058+00 1/1 0/0 0/0 .text executeAction__17dEvLib_callback_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::executeAction() {
nofralloc
#include "asm/d/event/d_event_lib/executeAction__17dEvLib_callback_cFv.s"
}
#pragma pop
/* 80048A50-80048A70 043390 0020+00 1/0 0/0 0/0 .text initStart__17dEvLib_callback_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::initStart() {
nofralloc
#include "asm/d/event/d_event_lib/initStart__17dEvLib_callback_cFv.s"
}
#pragma pop
/* ############################################################################################## */
/* 804246F8-80424710 051418 0018+00 2/2 0/0 0/0 .bss l_runAction */
static u8 l_runAction[24];
/* 80048A70-80048B1C 0433B0 00AC+00 2/1 0/0 0/0 .text executeStart__17dEvLib_callback_cFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::executeStart() {
nofralloc
#include "asm/d/event/d_event_lib/executeStart__17dEvLib_callback_cFv.s"
}
#pragma pop
/* 80048B1C-80048B48 04345C 002C+00 1/0 0/0 0/0 .text initRun__17dEvLib_callback_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::initRun() {
nofralloc
#include "asm/d/event/d_event_lib/initRun__17dEvLib_callback_cFv.s"
}
#pragma pop
/* 80048B48-80048BD8 043488 0090+00 1/0 0/0 0/0 .text executeRun__17dEvLib_callback_cFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dEvLib_callback_c::executeRun() {
nofralloc
#include "asm/d/event/d_event_lib/executeRun__17dEvLib_callback_cFv.s"
}
#pragma pop
/* ############################################################################################## */
/* 803A82B8-803A82C4 0053D8 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
@ -192,59 +28,111 @@ SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 803A82C4-803A82D0 -00001 000C+00 0/1 0/0 0/0 .data @3617 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3617[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)initStart__17dEvLib_callback_cFv,
};
#pragma pop
/* 803A82D0-803A82DC -00001 000C+00 0/1 0/0 0/0 .data @3618 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3618[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)executeStart__17dEvLib_callback_cFv,
};
#pragma pop
/* 803A82DC-803A82E8 -00001 000C+00 0/1 0/0 0/0 .data @3621 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3621[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)initRun__17dEvLib_callback_cFv,
};
#pragma pop
/* 803A82E8-803A82F8 -00001 000C+04 0/1 0/0 0/0 .data @3622 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3622[3 + 1 /* padding */] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)executeRun__17dEvLib_callback_cFv,
/* padding */
NULL,
};
#pragma pop
/* 80048BD8-80048C54 043518 007C+00 0/0 1/0 0/0 .text __sinit_d_event_lib_cpp */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void __sinit_d_event_lib_cpp() {
nofralloc
#include "asm/d/event/d_event_lib/__sinit_d_event_lib_cpp.s"
/* 8004886C-800488A4 0431AC 0038+00 0/0 0/0 23/23 .text eventUpdate__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::eventUpdate() {
if (mAction == NULL) {
return FALSE;
} else {
executeAction();
return TRUE;
}
}
#pragma pop
#pragma push
#pragma force_active on
REGISTER_CTORS(0x80048BD8, __sinit_d_event_lib_cpp);
#pragma pop
/* ############################################################################################## */
/* 804246E0-804246F8 051400 0018+00 2/2 0/0 0/0 .bss l_startAction */
static action_class<dEvLib_callback_c> l_startAction(&dEvLib_callback_c::initStart,
&dEvLib_callback_c::executeStart);
/* 804246F8-80424710 051418 0018+00 2/2 0/0 0/0 .bss l_runAction */
static action_class<dEvLib_callback_c> l_runAction(&dEvLib_callback_c::initRun,
&dEvLib_callback_c::executeRun);
/* 800488A4-80048940 0431E4 009C+00 1/1 0/0 1/1 .text setEvent__17dEvLib_callback_cFiii
*/
BOOL dEvLib_callback_c::setEvent(int mapToolId, int eventIdx, int param_2) {
if (mAction != NULL) {
return FALSE;
} else {
mActor->mEvtInfo.setMapToolId(mapToolId);
if (mapToolId != 0xFF && eventIdx == 0xFF) {
eventIdx = dComIfGp_getEventManager().getEventIdx(mActor, mapToolId);
}
mActor->mEvtInfo.setEventId(eventIdx);
_C = param_2;
return setAction(&l_startAction);
}
}
/* 80048940-80048970 043280 0030+00 0/0 0/0 21/21 .text orderEvent__17dEvLib_callback_cFiii */
void dEvLib_callback_c::orderEvent(int param_0, int param_1, int param_2) {
setEvent(param_0, param_1, param_2 != 0 ? 0x101 : 1);
}
/* 80048970-800489A8 0432B0 0038+00 3/3 0/0 0/0 .text
* setAction__17dEvLib_callback_cFP33action_class<17dEvLib_callback_c> */
BOOL dEvLib_callback_c::setAction(action_class<dEvLib_callback_c>* action) {
mAction = action;
if (mAction == NULL) {
return FALSE;
} else {
return initAction();
}
}
/* 800489A8-800489F8 0432E8 0050+00 1/1 0/0 0/0 .text initAction__17dEvLib_callback_cFv
*/
BOOL dEvLib_callback_c::initAction() {
if (!mAction->getInit()) {
return TRUE;
} else {
return (this->*(mAction->getInit()))();
}
}
/* 800489F8-80048A50 043338 0058+00 1/1 0/0 0/0 .text executeAction__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::executeAction() {
if (!mAction->getExecute()) {
return TRUE;
} else {
return (this->*(mAction->getExecute()))();
}
}
/* 80048A50-80048A70 043390 0020+00 1/0 0/0 0/0 .text initStart__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::initStart() {
return executeStart();
}
/* 80048A70-80048B1C 0433B0 00AC+00 2/1 0/0 0/0 .text executeStart__17dEvLib_callback_cFv
*/
BOOL dEvLib_callback_c::executeStart() {
if (!mActor->mEvtInfo.checkCommandDemoAccrpt()) {
if (mActor->mEvtInfo.getMapToolId() != 0xFF) {
fopAcM_orderMapToolEvent(mActor, mActor->mEvtInfo.getMapToolId(),
mActor->mEvtInfo.getEventId(), 0xFFFF, _C, 0);
} else {
fopAcM_orderOtherEventId(mActor, mActor->mEvtInfo.getEventId(),
mActor->mEvtInfo.getMapToolId(), 0xFFFF, 0, _C);
}
mActor->mEvtInfo.i_onCondition(2);
return TRUE;
} else {
return setAction(&l_runAction);
}
}
/* 80048B1C-80048B48 04345C 002C+00 1/0 0/0 0/0 .text initRun__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::initRun() {
return eventStart();
}
/* 80048B48-80048BD8 043488 0090+00 1/0 0/0 0/0 .text executeRun__17dEvLib_callback_cFv
*/
BOOL dEvLib_callback_c::executeRun() {
if (!dComIfGp_getEventManager().endCheck(mActor->mEvtInfo.getEventId())) {
return eventRun();
} else {
dComIfGp_getEvent().reset();
setAction(NULL);
return eventEnd();
}
}