diff --git a/configure.py b/configure.py index bbd94f9da6b..17425120edc 100755 --- a/configure.py +++ b/configure.py @@ -825,7 +825,7 @@ config.libs = [ Object(MatchingFor(ALL_GCN), "d/d_msg_out_font.cpp"), Object(MatchingFor(ALL_GCN), "d/d_msg_class.cpp"), Object(Equivalent, "d/d_msg_object.cpp"), # weak func order - Object(MatchingFor("GZ2P01", "GZ2J01"), "d/d_msg_unit.cpp"), + Object(MatchingFor(ALL_GCN), "d/d_msg_unit.cpp"), Object(MatchingFor(ALL_GCN), "d/d_msg_scrn_3select.cpp"), Object(MatchingFor(ALL_GCN), "d/d_msg_scrn_arrow.cpp"), Object(MatchingFor(ALL_GCN), "d/d_msg_scrn_base.cpp"), diff --git a/src/d/d_msg_unit.cpp b/src/d/d_msg_unit.cpp index bebfec7a0c6..9e641220c84 100644 --- a/src/d/d_msg_unit.cpp +++ b/src/d/d_msg_unit.cpp @@ -33,14 +33,13 @@ typedef struct dMsgUnit_inf1_section_t { /* 0x08 */ u16 entryCount; /* 0x0A */ u16 entryLength; /* 0x0C */ u16 msgArchiveId; - /* 0x0E */ dMsgUnit_inf1_entry entries[0]; + /* 0x10 */ dMsgUnit_inf1_entry entries[0]; } dMsgUnit_inf1_section_t; dMsgUnit_c::dMsgUnit_c() {} dMsgUnit_c::~dMsgUnit_c() {} -// NONMATCHING - regalloc #if REGION_JPN void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { *o_buffer = 0; @@ -245,7 +244,6 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { } if (i_type == 3 && param_4 == true) { - (void)seconds; // dummy use to force into register instead of stack f32 iVar8b; f32 dayTime = g_env_light.getDaytime(); f32 hour = dayTime / 15.0f; @@ -265,21 +263,21 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { if (!stack9) { bmg_header_t* pHeader = (bmg_header_t*)dMeter2Info_getMsgUnitResource(); - dMsgUnit_inf1_section_t* pInfoBlock = NULL; + bmg_section_t* pInfoBlock = NULL; const void* pMsgDataBlock = NULL; str1_section_t* pStrAttributeBlock = NULL; int filepos = sizeof(bmg_header_t); u32 filesize = pHeader->size; - bmg_section_t* pSection = (bmg_section_t*)(((u8*)pHeader) + filepos); + u8* pSection = ((u8*)pHeader) + filepos; - for (; filepos < filesize; filepos += pSection->size) { - switch (pSection->magic) { + for (; filepos < filesize; filepos += ((bmg_section_t*)pSection)->size) { + switch (((bmg_section_t*)pSection)->magic) { case 'FLW1': break; case 'FLI1': break; case 'INF1': - pInfoBlock = (dMsgUnit_inf1_section_t*)pSection; + pInfoBlock = (bmg_section_t*)pSection; break; case 'DAT1': pMsgDataBlock = pSection; @@ -288,27 +286,26 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { pStrAttributeBlock = (str1_section_t*)pSection; break; } - pSection = (bmg_section_t*)((u8*)pSection + pSection->size); + pSection += ((bmg_section_t*)pSection)->size; } // This section is weird. The debug seems like entriesStr is outside the condition // but the normal build doesn't really work with that. Same for pInfoBlock->entries. #if DEBUG - dMsgUnit_inf1_entry* entriesInf = &pInfoBlock->entries[i_type]; + dMsgUnit_inf1_entry* entriesInf = &((dMsgUnit_inf1_section_t*)pInfoBlock)->entries[i_type]; u32 dat1EntryOffset = entriesInf->dat1EntryOffset; const char* uVar5; u16 vals[14]; vals[0] = entriesInf->startFrame; vals[1] = entriesInf->endFrame; - (void)entriesInf; // dummy use to force into register instead of stack str1_entry_t* entriesStr = pStrAttributeBlock->entries; #else - u32 dat1EntryOffset = pInfoBlock->entries[i_type].dat1EntryOffset; + u32 dat1EntryOffset = ((dMsgUnit_inf1_section_t*)pInfoBlock)->entries[i_type].dat1EntryOffset; const char* uVar5; u16 vals[14]; - vals[0] = pInfoBlock->entries[i_type].startFrame; - vals[1] = pInfoBlock->entries[i_type].endFrame; + vals[0] = ((dMsgUnit_inf1_section_t*)pInfoBlock)->entries[i_type].startFrame; + vals[1] = ((dMsgUnit_inf1_section_t*)pInfoBlock)->entries[i_type].endFrame; #endif #if REGION_PAL