mirror of
https://github.com/zeldaret/ss
synced 2026-05-26 07:38:54 -04:00
some d_message additions
This commit is contained in:
@@ -10932,22 +10932,22 @@ getMsbtIndexForLabel__10dMessage_cFPCc = .text:0x801B2A70; // type:function size
|
||||
getMsbtIndexForLabelInternal__10dMessage_cFPCc = .text:0x801B2A80; // type:function size:0xA4
|
||||
getMsbtInfoForIndex__10dMessage_cFl = .text:0x801B2B30; // type:function size:0xC
|
||||
getMsbtInfoForIndexInternal__10dMessage_cFl = .text:0x801B2B40; // type:function size:0x38
|
||||
getMsbfInfoForIndex = .text:0x801B2B80; // type:function size:0xC
|
||||
fn_801B2B90 = .text:0x801B2B90; // type:function size:0x38
|
||||
getMsbfInfoForIndex__10dMessage_cFl = .text:0x801B2B80; // type:function size:0xC
|
||||
getMsbfInfoForIndexInternal__10dMessage_cFl = .text:0x801B2B90; // type:function size:0x38
|
||||
fn_801B2BD0 = .text:0x801B2BD0; // type:function size:0x10
|
||||
fn_801B2BE0 = .text:0x801B2BE0; // type:function size:0x40
|
||||
fn_801B2C20 = .text:0x801B2C20; // type:function size:0x30
|
||||
fn_801B2C50 = .text:0x801B2C50; // type:function size:0xC0
|
||||
executeMinigame__10dMessage_cFv = .text:0x801B2C50; // type:function size:0xC0
|
||||
fn_801B2D10 = .text:0x801B2D10; // type:function size:0x4C
|
||||
reset__10dMessage_cFv = .text:0x801B2D60; // type:function size:0x44
|
||||
getLanguageIdentifier__10dMessage_cFv = .text:0x801B2DB0; // type:function size:0x1B0
|
||||
getArcNameByIndex__10dMessage_cFlb = .text:0x801B2F60; // type:function size:0x4
|
||||
getEventFlowFileNameByIndex2 = .text:0x801B2F70; // type:function size:0x14
|
||||
getArcNameByIndexInternal__10dMessage_cFlb = .text:0x801B2F70; // type:function size:0x14
|
||||
getDataFromMsbArc__10dMessage_cFlPCcb = .text:0x801B2F90; // type:function size:0x70
|
||||
setZevFromMsbArc__10dMessage_cFv = .text:0x801B3000; // type:function size:0x68
|
||||
fn_801B3070 = .text:0x801B3070; // type:function size:0x104
|
||||
fn_801B3180 = .text:0x801B3180; // type:function size:0x24
|
||||
fn_801B31B0 = .text:0x801B31B0; // type:function size:0x24
|
||||
setStageZevFromMsbArc__10dMessage_cFv = .text:0x801B3070; // type:function size:0x104
|
||||
getZev0Internal__10dMessage_cFv = .text:0x801B3180; // type:function size:0x24
|
||||
getZevStageInternal__10dMessage_cFv = .text:0x801B31B0; // type:function size:0x24
|
||||
getArcIndexForFile__10dMessage_cFPCc = .text:0x801B31E0; // type:function size:0x34
|
||||
__dt__10dMessage_cFv = .text:0x801B3220; // type:function size:0x64
|
||||
__sinit_\d_message_cpp = .text:0x801B3290; // type:function size:0xC scope:local
|
||||
@@ -40234,8 +40234,8 @@ sTagProcessor__10dMessage_c = .sbss:0x80575744; // type:object size:0x4 data:4by
|
||||
lbl_80575748 = .sbss:0x80575748; // type:object size:0x1 data:byte
|
||||
lbl_80575749 = .sbss:0x80575749; // type:object size:0x7 data:byte
|
||||
CURRENT_LANGUAGE_STRING = .sbss:0x80575750; // type:object size:0x8 data:byte
|
||||
lbl_80575758 = .sbss:0x80575758; // type:object size:0x4 data:4byte
|
||||
lbl_8057575C = .sbss:0x8057575C; // type:object size:0x4 data:4byte
|
||||
sZev0__10dMessage_c = .sbss:0x80575758; // type:object size:0x4 data:4byte
|
||||
sZevStage__10dMessage_c = .sbss:0x8057575C; // type:object size:0x4 data:4byte
|
||||
sInstance__8dStage_c = .sbss:0x80575760; // type:object size:0x4 data:4byte
|
||||
lbl_80575764 = .sbss:0x80575764; // type:object size:0x1 data:byte
|
||||
lbl_80575768 = .sbss:0x80575768; // type:object size:0x8 data:byte
|
||||
|
||||
@@ -57,6 +57,14 @@ public:
|
||||
static const wchar_t *formatText(const wchar_t *text);
|
||||
|
||||
private:
|
||||
static void *sZev0;
|
||||
static void *sZevStage;
|
||||
|
||||
static void *getZev0Internal();
|
||||
static void *getZevStageInternal();
|
||||
|
||||
void executeMinigame();
|
||||
|
||||
const wchar_t *formatTextInternal(const wchar_t *text);
|
||||
const wchar_t *getTextMessageByLabelInternal(
|
||||
const char *label, dTagProcessor_c *pTagProcessor, bool global, wchar_t *dstBuf, u32 maxLen
|
||||
@@ -68,6 +76,7 @@ private:
|
||||
bool checkIsValidTextLabel(const char *name);
|
||||
|
||||
static void setZevFromMsbArc();
|
||||
static void setStageZevFromMsbArc();
|
||||
static s32 getMsbtNumberByIndex(s32 index);
|
||||
static const char *getMsbfFileName(s32 index);
|
||||
static s32 getMsbfNumberByIndex(s32 index);
|
||||
@@ -78,6 +87,11 @@ private:
|
||||
static MsbtInfo *getMsbtInfoForIndex(s32 index);
|
||||
MsbtInfo *getMsbtInfoForIndexInternal(s32 index);
|
||||
|
||||
static MsbfInfo *getMsbfInfoForIndex(s32 index);
|
||||
MsbfInfo *getMsbfInfoForIndexInternal(s32 index);
|
||||
|
||||
static const char *getArcNameByIndexInternal(s32 idx, bool global);
|
||||
|
||||
static dMessage_c *sInstance;
|
||||
static dTagProcessor_c *sTagProcessor;
|
||||
|
||||
@@ -93,8 +107,11 @@ private:
|
||||
/* 0x329 */ bool field_0x329;
|
||||
/* 0x32A */ bool field_0x32A;
|
||||
|
||||
/* 0x32B */ u8 _0x32B[0x334 - 0x32B];
|
||||
|
||||
/* 0x334 */ u32 mMinigameResultPoints;
|
||||
/* 0x338 */ u32 mMinigameTime;
|
||||
/* 0x33C */ u8 _0x33C[0x344 - 0x33C];
|
||||
/* 0x344 */ s32 field_0x344;
|
||||
};
|
||||
|
||||
|
||||
+19
-2
@@ -133,10 +133,26 @@ public:
|
||||
return field_0x7B4;
|
||||
}
|
||||
|
||||
void *getField_0x74C() const {
|
||||
return field_0x74C;
|
||||
}
|
||||
|
||||
void *getField_0x750() const {
|
||||
return field_0x750;
|
||||
}
|
||||
|
||||
bool getField_0x7B6() const {
|
||||
return field_0x7B6;
|
||||
}
|
||||
|
||||
MsbtInfo *getMsbtInfo(s32 index) const {
|
||||
return field_buf2[index];
|
||||
}
|
||||
|
||||
MsbfInfo *getMsbfInfo(s32 index) const {
|
||||
return field_buf3[index];
|
||||
}
|
||||
|
||||
const char *getStr1() const {
|
||||
return field_0x004;
|
||||
}
|
||||
@@ -161,11 +177,12 @@ public:
|
||||
field_0x104 = s;
|
||||
}
|
||||
|
||||
void *allocUnk(size_t size, int align);
|
||||
void destroyUnk(void *thing);
|
||||
|
||||
private:
|
||||
static UnkTextThing *sInstance;
|
||||
|
||||
void *allocUnk(size_t size, int align);
|
||||
void destroyUnk(void *thing);
|
||||
void destroyFlow(MsbfInfo *flow);
|
||||
void destroyMsg(MsbtInfo *msg);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ struct MsbfInfo;
|
||||
struct MsbFlowInfo {
|
||||
/* 0x00 */ char type;
|
||||
/* 0x01 */ char subType;
|
||||
/* 0x04 */ short params1n2;
|
||||
/* 0x04 */ int params1n2;
|
||||
/* 0x08 */ short next;
|
||||
/* 0x0A */ short param3;
|
||||
/* 0x0C */ short param4;
|
||||
|
||||
+112
-2
@@ -1,16 +1,21 @@
|
||||
#include "d/d_message.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/d_tag_processor.h"
|
||||
#include "d/d_textunk.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "f/f_base.h"
|
||||
#include "f/f_profile.h"
|
||||
#include "f/f_profile_name.h"
|
||||
#include "libms/libms.h"
|
||||
#include "libms/msgfile.h"
|
||||
#include "sized_string.h"
|
||||
#include "toBeSorted/arc_managers/oarc_manager.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/global_fi_context.h"
|
||||
|
||||
|
||||
SPECIAL_BASE_PROFILE(MESSAGE, dMessage_c, fProfile::MESSAGE, 0x2A8, 0);
|
||||
|
||||
static const char *sMsbtFileNames[82] = {
|
||||
@@ -181,12 +186,28 @@ static char *sMsbfFileNames[80] = {
|
||||
"599-Demo.msbf",
|
||||
};
|
||||
|
||||
static char *sArcNames[] = {
|
||||
"0-Common", "1-Town", "2-Forest", "3-Mountain", "4-Desert", "5-CenterField",
|
||||
};
|
||||
|
||||
dMessage_c *dMessage_c::sInstance;
|
||||
dTagProcessor_c *dMessage_c::sTagProcessor;
|
||||
|
||||
static void *msbAlloc(size_t size) {}
|
||||
static void *msbAlloc(size_t size) {
|
||||
if (UnkTextThing::getInstance()->getField_0x7B6() == false) {
|
||||
return EGG::Heap::alloc(size, 0x20, nullptr);
|
||||
} else {
|
||||
return UnkTextThing::getInstance()->allocUnk(size, 0x20);
|
||||
}
|
||||
}
|
||||
|
||||
static void msbFree(void *ptr) {}
|
||||
static void msbFree(void *ptr) {
|
||||
if (UnkTextThing::getInstance()->getField_0x7B6() == false) {
|
||||
EGG::Heap::free(ptr, nullptr);
|
||||
} else {
|
||||
UnkTextThing::getInstance()->destroyUnk(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
dMessage_c::dMessage_c() {
|
||||
sInstance = this;
|
||||
@@ -251,6 +272,16 @@ int dMessage_c::doDelete() {
|
||||
}
|
||||
|
||||
int dMessage_c::execute() {
|
||||
if (field_0x2FC != 0 && !EventManager::isInEvent()) {
|
||||
field_0x2FC = 0;
|
||||
}
|
||||
|
||||
if (field_0x2FC > 0) {
|
||||
field_0x2FC--;
|
||||
}
|
||||
executeMinigame();
|
||||
sTagProcessor->execute();
|
||||
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
@@ -394,6 +425,10 @@ s32 dMessage_c::getTextIndexForLabel(const char *label) {
|
||||
return LMS_GetTextIndexByLabel(info, label);
|
||||
}
|
||||
|
||||
s32 dMessage_c::getMsbtIndexForLabel(const char *label) {
|
||||
return sInstance->getMsbtIndexForLabelInternal(label);
|
||||
}
|
||||
|
||||
s32 dMessage_c::getMsbtIndexForLabelInternal(const char *label) {
|
||||
if (mCurrentTextFileNumber <= 81) {
|
||||
MsbtInfo *info = getMsbtInfoForIndex(mCurrentTextFileNumber);
|
||||
@@ -426,6 +461,19 @@ MsbtInfo *dMessage_c::getMsbtInfoForIndexInternal(s32 index) {
|
||||
return mpMsgs[index];
|
||||
}
|
||||
|
||||
MsbfInfo *dMessage_c::getMsbfInfoForIndex(s32 index) {
|
||||
return sInstance->getMsbfInfoForIndexInternal(index);
|
||||
}
|
||||
|
||||
MsbfInfo *dMessage_c::getMsbfInfoForIndexInternal(s32 index) {
|
||||
UnkTextThing *thing = UnkTextThing::getInstance();
|
||||
MsbfInfo *overrideMsbf = thing->getMsbfInfo(index);
|
||||
if (overrideMsbf != nullptr && thing->getField_0x7B4() == true) {
|
||||
return overrideMsbf;
|
||||
}
|
||||
return mpFlows[index];
|
||||
}
|
||||
|
||||
extern "C" u8 fn_80054F30();
|
||||
|
||||
static SizedString<8> sCurrentLanguage;
|
||||
@@ -441,6 +489,68 @@ const char *dMessage_c::getLanguageIdentifier() {
|
||||
return sCurrentLanguage;
|
||||
}
|
||||
|
||||
const char *dMessage_c::getArcNameByIndex(s32 idx, bool global) {
|
||||
return getArcNameByIndexInternal(idx, global);
|
||||
}
|
||||
|
||||
const char *dMessage_c::getArcNameByIndexInternal(s32 idx, bool global) {
|
||||
return sArcNames[idx];
|
||||
}
|
||||
|
||||
void *dMessage_c::getDataFromMsbArc(s32 number, const char *fileName, bool global) {
|
||||
SizedString<128> path;
|
||||
path.sprintf("%s/%s", getLanguageIdentifier(), getArcNameByIndex(number, global));
|
||||
return OarcManager::GetInstance()->getData(path, fileName);
|
||||
}
|
||||
|
||||
void dMessage_c::setZevFromMsbArc() {
|
||||
SizedString<128> path;
|
||||
path.sprintf("%s/dat/zev.dat", getArcNameByIndex(0, false));
|
||||
sZev0 = getDataFromMsbArc(0, path, false);
|
||||
sZevStage = nullptr;
|
||||
}
|
||||
|
||||
void dMessage_c::setStageZevFromMsbArc() {
|
||||
SizedString<32> stage = dScGame_c::currentSpawnInfo.stageName;
|
||||
char buf[2];
|
||||
buf[0] = stage[1];
|
||||
buf[1] = '\0';
|
||||
|
||||
SizedString<128> path;
|
||||
|
||||
int i = atoi(buf) + 1;
|
||||
|
||||
// TODO figure out what this is
|
||||
if (stage == "t_tkm24" || stage == "t_tkm26") {
|
||||
i = 2;
|
||||
} else if (i < 1 || 6 <= i) {
|
||||
i = 0;
|
||||
}
|
||||
path.sprintf("%s/dat/zev.dat", getArcNameByIndex(i, false));
|
||||
sZevStage = getDataFromMsbArc(i, path, false);
|
||||
}
|
||||
|
||||
void *dMessage_c::sZev0;
|
||||
void *dMessage_c::sZevStage;
|
||||
|
||||
void *dMessage_c::getZev0Internal() {
|
||||
UnkTextThing *thing = UnkTextThing::getInstance();
|
||||
void *overrideZev = thing->getField_0x74C();
|
||||
if (overrideZev != nullptr && thing->getField_0x7B4() == true) {
|
||||
return overrideZev;
|
||||
}
|
||||
return sZev0;
|
||||
}
|
||||
|
||||
void *dMessage_c::getZevStageInternal() {
|
||||
UnkTextThing *thing = UnkTextThing::getInstance();
|
||||
void *overrideZev = thing->getField_0x750();
|
||||
if (overrideZev != nullptr && thing->getField_0x7B4() == true) {
|
||||
return overrideZev;
|
||||
}
|
||||
return sZevStage;
|
||||
}
|
||||
|
||||
s32 dMessage_c::getArcIndexForFile(const char *fileName) {
|
||||
char buf[2];
|
||||
buf[0] = fileName[0];
|
||||
|
||||
Reference in New Issue
Block a user