summaryrefslogtreecommitdiff
path: root/src/d/d_msg_unit.cpp
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2025-05-28 04:04:30 -0700
committerGitHub <noreply@github.com>2025-05-28 14:04:30 +0300
commite8e36445ba150456fc590c5e1a727e6c4dabc280 (patch)
tree8ab207655d0673ffd2aca94ef92c5b78f07aa29a /src/d/d_msg_unit.cpp
parent9a98863aff1abdfb4cd48a26a8dc0a2819b1fe47 (diff)
cleanup d_meter2_info / little JMessage work (#2460)
* d_meter2_info cleanup * parseBlock_next matching
Diffstat (limited to 'src/d/d_msg_unit.cpp')
-rw-r--r--src/d/d_msg_unit.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/d/d_msg_unit.cpp b/src/d/d_msg_unit.cpp
index b429956f20..26383285bc 100644
--- a/src/d/d_msg_unit.cpp
+++ b/src/d/d_msg_unit.cpp
@@ -9,6 +9,22 @@
#include "d/d_kankyo.h"
#include "d/d_meter2_info.h"
+// temporary until a better solution is found
+typedef struct dMsgUnit_inf1_entry {
+ u32 dat1EntryOffset;
+ u16 startFrame;
+ u16 endFrame;
+} dMsgUnit_inf1_entry;
+
+typedef struct dMsgUnit_inf1_section_t {
+ /* 0x00 */ u32 msgType; // sectionType
+ /* 0x04 */ u32 size; // total size of the section
+ /* 0x08 */ u16 entryCount;
+ /* 0x0A */ u16 entryLength;
+ /* 0x0C */ u16 msgArchiveId;
+ /* 0x0E */ dMsgUnit_inf1_entry entries[0];
+} dMsgUnit_inf1_section_t;
+
/* 80238C94-80238CA4 2335D4 0010+00 1/1 0/0 0/0 .text __ct__10dMsgUnit_cFv */
dMsgUnit_c::dMsgUnit_c() {}
@@ -57,20 +73,20 @@ void dMsgUnit_c::setTag(int param_1, int param_2, char* param_3, bool param_4) {
if (!stack9) {
bmg_header_t* iVar9 = (bmg_header_t*)dMeter2Info_getMsgUnitResource();
- inf1_section_t* inf1 = NULL;
+ dMsgUnit_inf1_section_t* inf1 = NULL;
const void* dat1 = NULL;
str1_section_t* str1 = NULL;
int local_114 = sizeof(bmg_header_t);
u32 size = iVar9->size;
bmg_section_t* piVar12 = (bmg_section_t*)(((u8*)iVar9) + local_114);
for (; local_114 < size; local_114 += piVar12->size) {
- switch(piVar12->msgType) {
+ switch(piVar12->magic) {
case 'FLW1':
break;
case 'FLI1':
break;
case 'INF1':
- inf1 = (inf1_section_t*)piVar12;
+ inf1 = (dMsgUnit_inf1_section_t*)piVar12;
break;
case 'DAT1':
dat1 = piVar12;
@@ -86,7 +102,7 @@ void dMsgUnit_c::setTag(int param_1, int param_2, char* param_3, bool param_4) {
// but the normal build doesn't really work with that. Same for inf1->entries.
#ifdef DEBUG
- inf1_entry_t* entry = &inf1->entries[param_1];
+ dMsgUnit_inf1_entry* entry = &inf1->entries[param_1];
u32 dat1EntryOffset = entry->dat1EntryOffset;
u16 startFrame = entry->startFrame;
u16 endFrame = entry->endFrame;