d_event_debug equivalent & modifications to dEvLib_callback_c (#2359)

* WIP d_event_debug
* Implemented most functions close to matching
* Removed erroneous comment in d_com_inf_game.h
* Implemented getEventP in dEvDtBase_c
* Retyped dEvLib_callback_c function returns from BOOL to bool
* Implemented getHeader, getEventList, and setDbgData in dEvent_manager_c
* Moved relevant dEvDb_* classes from d_event.h to d_event_debug.h and changed to structs
* Extended JORFile mFilename character array from 8 to 256 characters
* Implemented combo boxes and update slider functionalities in JORMContext
* Named field_0xC of JORProperyEvent as id, based on use of field in d_event_debug.cpp
* Corrected debug event tables and created missing table
* Debug tables explicitly pasted in d_event_debug.cpp to circumvent ShiftJIS not properly encoding tables via #include directive

* Change return types for implemented virtual functions of actors that inherit from dEvLib_callback_c

* Add const modifier to several d_com_inf_game functions called in d_event_debug, and change respective fields in dEvDb_bit & reg_c to be const

* d_event_debug Equivalent
* Changed configure.py entry to equivalent instead of matching
* Preliminary documentation

* Remove debug tables from d_event.cpp
This commit is contained in:
Huitzi
2025-03-30 23:11:50 -04:00
committed by GitHub
parent 559d389e3d
commit 4ccca6b893
43 changed files with 9956 additions and 162 deletions
+3 -3
View File
@@ -90,19 +90,19 @@ void JORReflexible::listenPropertyEvent(const JORPropertyEvent* pEvent) {
case 'CMBX':
if (pEvent->field_0x14 >= 4) {
JORPropertyEvent* event = (JORPropertyEvent*)pEvent;
JORServer::defSetVal(event->field_0xc, event->kind, event->field_0x18.U32);
JORServer::defSetVal(event->id, event->kind, event->field_0x18.U32);
}
break;
case 'CHBX':
if (pEvent->field_0x14 >= 4) {
JORPropertyEvent* event = (JORPropertyEvent*)pEvent;
JORServer::defSetBitVal(event->field_0xc, event->kind, (u16)event->field_0x18.U16[0], (u16)event->field_0x18.U16[1]);
JORServer::defSetBitVal(event->id, event->kind, (u16)event->field_0x18.U16[0], (u16)event->field_0x18.U16[1]);
}
break;
case 'EDBX':
JORPropertyEvent* event = (JORPropertyEvent*)pEvent;
JSUMemoryInputStream stream(&event->field_0x18, event->field_0x14);
stream >> event->field_0xc;
stream >> event->id;
break;
}
return;
+2 -2
View File
@@ -266,9 +266,9 @@ void daTurara_c::modeWait() {
}
/* 80B9D998-80B9D9BC 000EF8 0024+00 2/1 0/0 0/0 .text eventStart__10daTurara_cFv */
BOOL daTurara_c::eventStart() {
bool daTurara_c::eventStart() {
init_modeDropInit();
return TRUE;
return true;
}
/* 80B9D9BC-80B9DA00 000F1C 0044+00 1/1 0/0 0/0 .text init_modeDropInit__10daTurara_cFv
+2 -2
View File
@@ -332,9 +332,9 @@ void daObjYtaihou_c::shotCheck() {
}
/* 80BA0964-80BA0974 000F64 0010+00 2/1 0/0 0/0 .text eventStart__14daObjYtaihou_cFv */
BOOL daObjYtaihou_c::eventStart() {
bool daObjYtaihou_c::eventStart() {
mStartBomb = 0x5a;
return 1;
return true;
}
/* 80BA0974-80BA09E4 000F74 0070+00 1/0 0/0 0/0 .text CreateHeap__14daObjYtaihou_cFv */
+2 -2
View File
@@ -193,9 +193,9 @@ void daAmiShutter_c::modeWaitEvent() {
}
/* 80BA1C90-80BA1CB4 0008B0 0024+00 2/1 0/0 0/0 .text eventStart__14daAmiShutter_cFv */
BOOL daAmiShutter_c::eventStart() {
bool daAmiShutter_c::eventStart() {
init_modeCloseEvent();
return TRUE;
return true;
}
/* ############################################################################################## */
+2 -2
View File
@@ -348,7 +348,7 @@ int daObjKWheel00_c::Delete() {
}
/* 80C4E298-80C4E2C0 000C18 0028+00 2/1 0/0 0/0 .text eventStart__15daObjKWheel00_cFv */
BOOL daObjKWheel00_c::eventStart() {
bool daObjKWheel00_c::eventStart() {
#if DEBUG
if(getArg0())
mZAngularVelocity = l_HIO.mZAngularAcceleration;
@@ -361,7 +361,7 @@ BOOL daObjKWheel00_c::eventStart() {
mZAngularVelocity = -2;
#endif
return TRUE;
return true;
}
/* ############################################################################################## */
+2 -2
View File
@@ -325,7 +325,7 @@ int daObjKWheel01_c::Delete() {
}
/* 80C4F498-80C4F4C0 000A98 0028+00 2/2 0/0 0/0 .text eventStart__15daObjKWheel01_cFv */
BOOL daObjKWheel01_c::eventStart() {
bool daObjKWheel01_c::eventStart() {
#ifdef DEBUG
if(getArg0())
mYAngularVelocity = l_HIO.mYAngularAcceleration;
@@ -338,7 +338,7 @@ BOOL daObjKWheel01_c::eventStart() {
mYAngularVelocity = -2;
#endif
return TRUE;
return true;
}
/* ############################################################################################## */
+2 -2
View File
@@ -385,7 +385,7 @@ int daLv3Water_c::Delete() {
}
/* 80C59AE0-80C59BA8 001400 00C8+00 2/1 0/0 0/0 .text eventStart__12daLv3Water_cFv */
BOOL daLv3Water_c::eventStart() {
bool daLv3Water_c::eventStart() {
field_0x601 = fpcM_GetParam(this) >> 0x18;
mSwitch1 = mSwitch2;
@@ -402,7 +402,7 @@ BOOL daLv3Water_c::eventStart() {
mode_init_levelCtrl();
}
return 1;
return true;
}
/* 80C59BA8-80C59BD4 0014C8 002C+00 1/0 0/0 0/0 .text daLv3Water_Draw__FP12daLv3Water_c
+2 -2
View File
@@ -257,7 +257,7 @@ int daLv3Water2_c::Delete() {
}
/* 80C5AF3C-80C5B0C0 000C1C 0184+00 2/1 0/0 0/0 .text eventStart__13daLv3Water2_cFv */
BOOL daLv3Water2_c::eventStart() {
bool daLv3Water2_c::eventStart() {
if(mEastSwInitialStatus != mEastSwCurrentStatus) {
mWaterLv = getParamLevel1() * 5.0f;
mWaterLvFrame = static_cast<u8>(getParamFrame1());
@@ -279,7 +279,7 @@ BOOL daLv3Water2_c::eventStart() {
mode_init_levelCtrl();
return TRUE;
return true;
}
/* 80C5B0C0-80C5B0EC 000DA0 002C+00 1/0 0/0 0/0 .text daLv3Water2_Draw__FP13daLv3Water2_c
+2 -2
View File
@@ -349,9 +349,9 @@ void dalv4CandleDemoTag_c::modeEnd() {
}
/* 80C5CF78-80C5CF9C 000678 0024+00 2/1 0/0 0/0 .text eventStart__20dalv4CandleDemoTag_cFv */
BOOL dalv4CandleDemoTag_c::eventStart() {
bool dalv4CandleDemoTag_c::eventStart() {
init_modeEnemyCreate();
return 1;
return true;
}
/* 80C5CF9C-80C5CFEC 00069C 0050+00 1/1 0/0 0/0 .text
+2 -2
View File
@@ -475,9 +475,9 @@ void daObjSwHang_c::modeOnWait() {
}
/* 80CFCCE0-80CFCD04 001420 0024+00 2/1 0/0 0/0 .text eventStart__13daObjSwHang_cFv */
BOOL daObjSwHang_c::eventStart() {
bool daObjSwHang_c::eventStart() {
changeOnStatus();
return TRUE;
return true;
}
/* 80CFCD04-80CFCD98 001444 0094+00 1/0 0/0 0/0 .text Draw__13daObjSwHang_cFv */
+2 -2
View File
@@ -250,12 +250,12 @@ void daSyRock_c::modeWait() {
}
/* 80D02F88-80D02FB8 000DC8 0030+00 2/1 0/0 0/0 .text eventStart__10daSyRock_cFv */
BOOL daSyRock_c::eventStart() {
bool daSyRock_c::eventStart() {
// field_0x779 is always 0 when eventStart() is called (see modeWait())
if(!field_0x779)
init_modeDropInit();
return TRUE;
return true;
}
/* 80D02FB8-80D03070 000DF8 00B8+00 1/1 0/0 0/0 .text init_modeDropInit__10daSyRock_cFv
+2 -2
View File
@@ -390,13 +390,13 @@ void daObjVolcBall_c::actionEnd() {
}
/* 80D22DDC-80D22E24 00133C 0048+00 2/1 0/0 0/0 .text eventStart__15daObjVolcBall_cFv */
BOOL daObjVolcBall_c::eventStart() {
bool daObjVolcBall_c::eventStart() {
daObjVolcBom_c* bom_p = (daObjVolcBom_c*)fopAcM_SearchByID(mBigVolcActorID);
if (bom_p != NULL) {
bom_p->startFall();
}
return TRUE;
return true;
}
/* 80D22E24-80D22ED4 001384 00B0+00 1/1 0/0 0/0 .text setEruptEffect__15daObjVolcBall_cFi
+1 -1
View File
@@ -341,7 +341,7 @@ void daWtPillar_c::actionSwWait() {
}
/* 80D2D488-80D2D4AC 000EA8 0024+00 2/1 0/0 0/0 .text eventStart__12daWtPillar_cFv */
BOOL daWtPillar_c::eventStart() {
bool daWtPillar_c::eventStart() {
actionUpFirstInit();
return TRUE;
}
+7 -7
View File
@@ -27,8 +27,8 @@ public:
/* 805A3038 */ int _delete();
/* 805A3118 */ ~daTagAtkItem_c();
/* 805A2D10 */ BOOL eventStart();
/* 805A2D34 */ BOOL eventEnd();
/* 805A2D10 */ bool eventStart();
/* 805A2D34 */ bool eventEnd();
u8 getEvId() { return fopAcM_GetParamBit(this, 0x18, 8); }
u8 getNum() { return fopAcM_GetParamBit(this, 8, 8); }
@@ -268,15 +268,15 @@ void daTagAtkItem_c::action() {
/* 805A2D10-805A2D34 000430 0024+00 2/1 0/0 0/0 .text eventStart__14daTagAtkItem_cFv */
BOOL daTagAtkItem_c::eventStart() {
bool daTagAtkItem_c::eventStart() {
createItem();
return TRUE;
return true;
}
/* 805A2D34-805A2D58 000454 0024+00 2/1 0/0 0/0 .text eventEnd__14daTagAtkItem_cFv */
BOOL daTagAtkItem_c::eventEnd() {
bool daTagAtkItem_c::eventEnd() {
fopAcM_delete(this);
return TRUE;
return true;
}
/* 805A2D58-805A2F54 000478 01FC+00 1/1 0/0 0/0 .text checkHit__14daTagAtkItem_cFv */
@@ -404,4 +404,4 @@ daTagAtkItem_c::~daTagAtkItem_c() {
// cCcD_GStts::~cCcD_GStts() {
extern "C" void __dt__10cCcD_GSttsFv() {
// NONMATCHING
}
}
+1 -37
View File
@@ -12,43 +12,7 @@
#include "d/actor/d_a_midna.h"
#include "d/actor/d_a_tag_mhint.h"
#include "d/actor/d_a_tag_mstop.h"
// This probably will need to be moved once actual debug rom decomp begins
#ifdef DEBUG
static dEvDb_bit_c dEvDb_bit_table[799] = {
#include "src/d/d_event_debug_bit_table.inc"
};
static dEvDb_reg_c dEvDb_reg_table[21] = {
#include "src/d/d_event_debug_reg_table.inc"
};
static dEvDb_bit_c dEvDb_bit_table_tmp[169] = {
#include "src/d/d_event_debug_bit_table_tmp.inc"
};
static dEvDb_reg_c dEvDb_reg_table_tmp[14] = {
#include "src/d/d_event_debug_reg_table_tmp.inc"
};
static dEvDb_flag_base_c dEvDb_flag_base_table = {
dEvDb_bit_table, // mBitTable
dEvDb_reg_table, // mRegTable
799, // mBitNum
21, // mRegNum
22, // field_0x10
4 // field_0x1
};
static dEvDb_flag_base_c dEvDb_flag_base_table_tmp = {
dEvDb_bit_table_tmp, // mBitTable
dEvDb_reg_table_tmp, // mRegTable
169, // mBitNum
14, // mRegNum
43, // field_0x10
6 // field_0x14
};
#endif
#include "d/d_event_debug.h"
/* 80041480-80041488 03BDC0 0008+00 1/1 0/0 0/0 .text event_debug_evnt__21@unnamed@d_event_cpp@Fv
*/
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -117,7 +117,7 @@
},
{
"F_0808",
"808 初日のと話した", // Talked to Beth on the first day
"808 初日のベスと話した", // Talked to Beth on the first day
"京極", // Kyogoku
0x6240,
"F_SP103:トアル村", // Ordon Village
@@ -765,7 +765,7 @@
},
{
"F_0729",
"729 ポストマン「おォい!」直後", // Right after postman's "Hey!"
"729 ポストマン「おォい!」直後", // Right after postman's "Hey!"
"一角", // Ikkaku
0x5940,
"環状フィールド", // Ring field
@@ -1908,7 +1908,7 @@
},
{
"F_0596",
"596 F0003:2日目コリン剣チュー後馬拒絶までに会話", // 2nd Day - Conversation with Colin after sword tutorial, before horse rejection
"596 F0003:2日目コリン剣チュー後馬拒絶までに会話", // 2nd Day - Conversation with Colin after sword tutorial, before horse rejection
"京極", // Kyogoku
0x4920,
"F_SP103:トアル村", // Ordon Village
@@ -2610,7 +2610,7 @@
},
{
"F_0518",
"518 コリン誘拐寝込み中のウーリからコリンに手紙出した話聞いた", // Colin kidnapped ~ Heard about giving letter to Colin from sleeping Uli
"518 コリン誘拐寝込み中のウーリからコリンに手紙出した話聞いた", // Colin kidnapped ~ Heard about giving letter to Colin from sleeping Uli
"京極", // Kyogoku
0x3f08,
"F_SP103:トアル村", // Ordon Village
@@ -7188,4 +7188,4 @@
"F_SP108:フィローネの森", // Faron Woods
0xf,
0x10,
},
},
+3 -3
View File
@@ -98,7 +98,7 @@
0x16,
},
{
"Hanch_CLIMBOUT_POND",
"HANJO_CLIMBOUT_POND",
"172 飛び込んだハンジョ−、池から出た", // Hanch gets out of lake after jumping in
"住吉", // Sumiyoshi
0x1304,
@@ -1377,7 +1377,7 @@
},
{
"T_0020",
"21 牛追い/時間切れ後再開の間までON", // cow herding - ON from `time's up` until `restart`
"21 牛追い/時間切れ後再開の間までON", // cow herding - ON from `time's up` until `restart`
"京極", // Kyogoku
0x101,
"F_SP103:トアル村", // Ordon Village
@@ -1518,4 +1518,4 @@
"F_SP103:トアル村", // Ordon Village
0x6,
0x7,
},
},
+126
View File
@@ -0,0 +1,126 @@
{
"SHA_DBG",
"184 占い師デバッグ", // Fortune teller debugging
"住吉", // Sumiyoshi
0xF2FF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"PACHITUTORIAL_INF",
"115 パチチュ−、ヒット情報", // Slingshot tutorial, hit information
"住吉", // Sumiyoshi
0xF3FF,
"F_SP103:トアル村", // Ordon Village
0x1,
0x7,
},
{
"PACHITUTORIAL_CNT",
"114 パチチュ−、壊した的の数", // Slingshot tutorial, number of targets broken
"住吉", // Sumiyoshi
0xF4FF,
"F_SP103:トアル村", // Ordon Village
0x1,
0x7,
},
{
"SHA_LOVEFORTUNE_05",
"106 恋愛運シ−ン切り替え先記憶用", // Love fortune scene change destination
"住吉", // Sumiyoshi
0xF5FF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"SHA_LOVEFORTUNE_04",
"105 恋愛運シ−ン切り替え先記憶用", // Love fortune scene change destination
"住吉", // Sumiyoshi
0xF6FF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"SHA_LOVEFORTUNE_03",
"104 恋愛運シ−ン切り替え先記憶用", // Love fortune scene change destination
"住吉", // Sumiyoshi
0xF7FF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"SHA_LOVEFORTUNE_02",
"103 恋愛運シ−ン切り替え先記憶用", // Love fortune scene change destination
"住吉", // Sumiyoshi
0xF8FF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"SHA_LOVEFORTUNE_01",
"102 恋愛運シ−ン切り替え先記憶用", // Love fortune scene change destination
"住吉", // Sumiyoshi
0xF9FF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"SHA_LOVEFORTUNE_00",
"101 恋愛運シ−ン切り替え先記憶用", // Love fortune scene change destination
"住吉", // Sumiyoshi
0xFAFF,
"F_SP116:城下街", // Castle town
0x2,
0xE,
},
{
"TREG_000",
"34 キュリ−の会話で使います", // Used in Pergie's conversation
"住吉", // Sumiyoshi
0xFBFF,
"F_SP103:トアル村", // Ordon Village
0x1,
0x7,
},
{
"T_0006",
"6 戻り先のレイヤ−番号", // Destination layer number
"住吉", // Sumiyoshi
0xFCFF,
"仮デモ", // Temporary demo
0x3,
0x14,
},
{
"T_0005",
"5 実行デモNo受け渡し", // Executing demo No. receipt
"住吉", // Sumiyoshi
0xFDFF,
"仮デモ", // Temporary demo
0x3,
0x14,
},
{
"T_0003",
"3 剣チュ−トリアル・斬った回数", // Sword tutorial・number of slashes
"住吉", // Sumiyoshi
0xFEFF,
"F_SP103:トアル村", // Ordon Village
0x1,
0x7,
},
{
"T_0002",
"2 剣チュ−トリアル・ステップ", // Sword tutorial・step
"住吉", // Sumiyoshi
0xFF0F,
"F_SP103:トアル村", // Ordon Village
0x1,
0x7,
},
+13 -12
View File
@@ -5,6 +5,7 @@
#include "d/d_event_lib.h"
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor.h"
/* 803A82B8-803A82C4 0053D8 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
static u8 cNullVec__6Z2Calc[12] = {
@@ -12,7 +13,7 @@ static u8 cNullVec__6Z2Calc[12] = {
};
/* 8004886C-800488A4 0431AC 0038+00 0/0 0/0 23/23 .text eventUpdate__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::eventUpdate() {
bool dEvLib_callback_c::eventUpdate() {
if (mAction == NULL) {
return FALSE;
} else {
@@ -31,13 +32,13 @@ static action_class<dEvLib_callback_c> l_runAction(&dEvLib_callback_c::initRun,
/* 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) {
bool dEvLib_callback_c::setEvent(int mapToolId, int eventIdx, int param_2) {
if (mAction != NULL) {
return FALSE;
} else {
mActor->eventInfo.setMapToolId(mapToolId);
if (mapToolId != 0xFF && eventIdx == 0xFF) {
eventIdx = dComIfGp_getEventManager().getEventIdx(mActor, mapToolId);
eventIdx = dComIfGp_getEventManager().getEventIdx(mActor, static_cast<u16>(mapToolId));
}
mActor->eventInfo.setEventId(eventIdx);
_C = param_2;
@@ -52,10 +53,10 @@ void dEvLib_callback_c::orderEvent(int param_0, int param_1, int param_2) {
/* 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) {
bool dEvLib_callback_c::setAction(action_class<dEvLib_callback_c>* action) {
mAction = action;
if (mAction == NULL) {
return FALSE;
return false;
} else {
return initAction();
}
@@ -63,7 +64,7 @@ BOOL dEvLib_callback_c::setAction(action_class<dEvLib_callback_c>* action) {
/* 800489A8-800489F8 0432E8 0050+00 1/1 0/0 0/0 .text initAction__17dEvLib_callback_cFv
*/
BOOL dEvLib_callback_c::initAction() {
bool dEvLib_callback_c::initAction() {
if (!mAction->getInit()) {
return TRUE;
} else {
@@ -72,7 +73,7 @@ BOOL dEvLib_callback_c::initAction() {
}
/* 800489F8-80048A50 043338 0058+00 1/1 0/0 0/0 .text executeAction__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::executeAction() {
bool dEvLib_callback_c::executeAction() {
if (!mAction->getExecute()) {
return TRUE;
} else {
@@ -81,13 +82,13 @@ BOOL dEvLib_callback_c::executeAction() {
}
/* 80048A50-80048A70 043390 0020+00 1/0 0/0 0/0 .text initStart__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::initStart() {
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() {
bool dEvLib_callback_c::executeStart() {
if (!mActor->eventInfo.checkCommandDemoAccrpt()) {
if (mActor->eventInfo.getMapToolId() != 0xFF) {
fopAcM_orderMapToolEvent(mActor, mActor->eventInfo.getMapToolId(),
@@ -104,14 +105,14 @@ BOOL dEvLib_callback_c::executeStart() {
}
/* 80048B1C-80048B48 04345C 002C+00 1/0 0/0 0/0 .text initRun__17dEvLib_callback_cFv */
BOOL dEvLib_callback_c::initRun() {
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->eventInfo.getEventId())) {
bool dEvLib_callback_c::executeRun() {
if (!dComIfGp_evmng_endCheck(mActor->eventInfo.getEventId())) {
return eventRun();
} else {
dComIfGp_getEvent().reset();
+7
View File
@@ -97,6 +97,13 @@ void* dEvent_manager_c::getSubstance(dEvDtData_c* p_data, int type) {
}
}
void dEvent_manager_c::setDbgData(const char* buffer) {
if(buffer) {
char* writableBuffer = const_cast<char*>(buffer);
mEventList[11].init(writableBuffer, -1);
}
}
dEvent_manager_c::dEvent_manager_c() {
mDataLoaded = false;
}