Skip to content

Commit 4ccca6b

Browse files
authored
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
1 parent 559d389 commit 4ccca6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+9956
-162
lines changed

configure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ def MatchingFor(*versions):
518518
Object(MatchingFor("GZ2E01"), "d/d_event_data.cpp"),
519519
Object(MatchingFor("GZ2E01"), "d/d_event_manager.cpp", extra_cflags=['-pragma "nosyminline on"']),
520520
Object(MatchingFor("GZ2E01"), "d/d_event_lib.cpp"),
521+
Object(Equivalent, "d/d_event_debug.cpp"), # RTTI & vtable padding
521522
Object(MatchingFor("GZ2E01"), "d/d_simple_model.cpp"),
522523
Object(NonMatching, "d/d_particle.cpp"),
523524
Object(MatchingFor("GZ2E01"), "d/d_particle_name.cpp"),

include/JSystem/JHostIO/JORFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class JORFile {
8888
/* 0x16 */ u16 mFlags;
8989
/* 0x18 */ int field_0x18;
9090
/* 0x1C */ JSUMemoryOutputStream mDataStream;
91-
/* 0x30 */ char mFilename[8];
91+
/* 0x30 */ char mFilename[256];
9292
};
9393

9494
#endif /* JORFILE_H */

include/JSystem/JHostIO/JORMContext.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,30 @@
5454
width, height); \
5555
}
5656

57+
#define DEFINE_START_COMBO_BOX(T, kind) \
58+
void startComboBox(const char* label, T* pSrc, u32 style, \
59+
JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height) { \
60+
startSelectorSub('CMBX', kind, label, (u32)pSrc, style, *pSrc, pListener, posX, \
61+
posY, width, height); \
62+
}
63+
64+
#define DEFINE_START_COMBO_BOX_ID(T, kind) \
65+
void startComboBoxID(const char* label, u32 id, T data, u32 style, \
66+
JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height) { \
67+
startSelectorSub('CMBX', kind, label, id, style, data, pListener, posX, \
68+
posY, width, height); \
69+
}
70+
71+
#define DEFINE_UPDATE_SLIDER(T) \
72+
void updateSlider(u32 mode, T* pSrc, T rangeMin, T rangeMax, u32 param_5) { \
73+
updateSliderSub(mode, (u32) pSrc, *pSrc, rangeMin, rangeMax, param_5); \
74+
}
75+
76+
#define DEFINE_UPDATE_SLIDER_ID(T) \
77+
void updateSliderID(u32 mode, u32 id, T value, T rangeMin, T rangeMax, u32 param_5) { \
78+
updateSliderSub(mode, id, value, rangeMin, rangeMax, param_5); \
79+
}
80+
5781
namespace jhostio {
5882
enum EKind {
5983
EKind_8B = 0x08,
@@ -127,6 +151,10 @@ class JORMContext {
127151
genNodeSub(label, obj, param_2, param_3);
128152
}
129153

154+
void startUpdateNode(JORReflexible* obj) {
155+
putNode(obj);
156+
}
157+
130158
void genNodeSub(const char* label, JORReflexible* i_node, u32, u32);
131159
void putNode(JORReflexible* obj);
132160
void invalidNode(JORReflexible* i_node, u32);
@@ -180,6 +208,27 @@ class JORMContext {
180208
DEFINE_GEN_SLIDER_ID(f64, JORPropertyEvent::EKind_ValueID | JORPropertyEvent::EKind_FloatValue)
181209
DEFINE_GEN_SLIDER_ID(int, JORPropertyEvent::EKind_ValueID)
182210

211+
DEFINE_UPDATE_SLIDER(u8)
212+
DEFINE_UPDATE_SLIDER(s16)
213+
DEFINE_UPDATE_SLIDER(f32)
214+
DEFINE_UPDATE_SLIDER(s32)
215+
216+
DEFINE_UPDATE_SLIDER_ID(f64)
217+
DEFINE_UPDATE_SLIDER_ID(int)
218+
219+
/**
220+
* === COMBO BOX ===
221+
*/
222+
DEFINE_START_COMBO_BOX(u8, 0x100 | jhostio::EKind_8B)
223+
DEFINE_START_COMBO_BOX(s16, jhostio::EKind_16B)
224+
DEFINE_START_COMBO_BOX(s32, jhostio::EKind_32B)
225+
226+
DEFINE_START_COMBO_BOX_ID(int, JORPropertyEvent::EKind_ValueID)
227+
228+
void endComboBox() {
229+
endSelectorSub();
230+
}
231+
183232
void genComboBoxItem(const char* label, s32 itemNo) {
184233
genSelectorItemSub(label, itemNo, 0, 0, 0, 0, 0);
185234
}
@@ -196,6 +245,15 @@ class JORMContext {
196245
void updateCheckBoxSub(u32 mode, u32 id, u16 value, u16 mask, u32 param_4);
197246
void updateSelectorSub(u32 mode, u32 id, s32 value, u32 param_3);
198247
void updateEditBoxID(u32 mode, u32 id, const char* string, u32 param_3, u16 length);
248+
249+
void updateCheckBox(u32 mode, u8* pSrc, u8 mask, u32 param_4) {
250+
updateCheckBoxSub(mode, (u32) pSrc, *pSrc, mask, param_4);
251+
}
252+
253+
void updateCheckBoxID(u32 mode, u32 id, u8 value, u8 mask, u32 param_4) {
254+
updateCheckBoxSub(mode, id, value, mask, param_4);
255+
}
256+
199257
void editComboBoxItem(u32 param_0, u32 param_1, const char* param_2, s32 param_3, u32 param_4);
200258

201259
void openMessageBox(void* param_0, u32 style, const char* message, const char* title);

include/JSystem/JHostIO/JORReflexible.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct JORPropertyEvent : JOREvent {
1717
/* 0x00 */ u8 field_0x0[0x4 - 0x0];
1818
/* 0x04 */ u32 type;
1919
/* 0x08 */ u32 kind;
20-
/* 0x0C */ char* field_0xc;
20+
/* 0x0C */ char* id; // id?
2121
/* 0x10 */ JORReflexible* field_0x10; // ?
2222
/* 0x14 */ u32 field_0x14;
2323
union {

include/d/actor/d_a_obj_Turara.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class daTurara_c : public dBgS_MoveBgActor, public fakeTuraraPadding, public dEv
3131
/* 80B9D548 */ void move();
3232
/* 80B9D72C */ void init_modeWait();
3333
/* 80B9D738 */ void modeWait();
34-
/* 80B9D998 */ BOOL eventStart();
34+
/* 80B9D998 */ bool eventStart();
3535
/* 80B9D9BC */ void init_modeDropInit();
3636
/* 80B9DA00 */ void modeDropInit();
3737
/* 80B9DA44 */ void init_modeDrop();

include/d/actor/d_a_obj_Y_taihou.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class daObjYtaihou_c : public dBgS_MoveBgActor, public request_of_phase_process_
2525
/* 80BA0084 */ void setMtx();
2626
/* 80BA0208 */ void rotateCheck();
2727
/* 80BA045C */ void shotCheck();
28-
/* 80BA0964 */ virtual BOOL eventStart();
28+
/* 80BA0964 */ virtual bool eventStart();
2929
/* 80BA0974 */ int CreateHeap();
3030
/* 80BA09E4 */ int Create();
3131
/* 80BA0A94 */ int Execute(Mtx** i_mtx);

include/d/actor/d_a_obj_amiShutter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class daAmiShutter_c : public dBgS_MoveBgActor, public fakeAmiShutterPadding, pu
4444
/* 80BA1B58 */ void modeWait();
4545
/* 80BA1BCC */ void init_modeWaitEvent();
4646
/* 80BA1BD8 */ void modeWaitEvent();
47-
/* 80BA1C90 */ BOOL eventStart();
47+
/* 80BA1C90 */ bool eventStart();
4848
/* 80BA1CB4 */ void init_modeClose();
4949
/* 80BA1D48 */ void modeClose();
5050
/* 80BA1DCC */ void init_modeCloseEvent();

include/d/actor/d_a_obj_kwheel00.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class daObjKWheel00_c : public dBgS_MoveBgActor, public request_of_phase_process
2929
/* 80C4DBBC */ int Execute(Mtx**);
3030
/* 80C4E1B0 */ int Draw();
3131
/* 80C4E254 */ int Delete();
32-
/* 80C4E298 */ BOOL eventStart();
32+
/* 80C4E298 */ bool eventStart();
3333

3434
int getSwNo() {
3535
return fopAcM_GetParamBit(this, 0, 8);

include/d/actor/d_a_obj_kwheel01.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class daObjKWheel01_c : public dBgS_MoveBgActor, public request_of_phase_process
2525
/* 80C4F048 */ int Execute(Mtx**);
2626
/* 80C4F344 */ int Draw();
2727
/* 80C4F3E8 */ int Delete();
28-
/* 80C4F498 */ BOOL eventStart();
28+
/* 80C4F498 */ bool eventStart();
2929

3030
private:
3131
/* 0x5B8 */ Mtx mNewBgMtx;

include/d/actor/d_a_obj_lv3Water.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class daLv3Water_c : public dBgS_MoveBgActor,
3838
/* 80C59AA0 */ virtual int Delete();
3939

4040
/* 80C59D80 */ virtual ~daLv3Water_c();
41-
/* 80C59AE0 */ virtual BOOL eventStart();
41+
/* 80C59AE0 */ virtual bool eventStart();
4242

4343
int getParam() { return fpcM_GetParam(this) >> 0xC & 0x0FFF; }
4444
int getParamSw() { return fpcM_GetParam(this) & 0xFF; }

0 commit comments

Comments
 (0)