cleanup/doc JMessage / d_msg_class (#2484)

* jmessage cleanup pass

* more JMessage cleanup

* d_msg_class cleanup
This commit is contained in:
TakaRikka
2025-06-13 15:33:33 +03:00
committed by GitHub
parent 4cf11063f6
commit 288a08b798
24 changed files with 3660 additions and 3302 deletions
+21 -13
View File
@@ -5,6 +5,9 @@
#include "__va_arg.h"
class JUTFont;
class J2DPrint;
extern "C" f32 J2DPrint_print_alpha_va(J2DPrint*, u8, const char*, va_list);
/**
* @ingroup jsystem-j2d
@@ -17,12 +20,15 @@ public:
/* 0x4 */ f32 field_0x4;
};
/* 802F4394 */ J2DPrint(JUTFont*, f32, f32, JUtility::TColor, JUtility::TColor,
JUtility::TColor, JUtility::TColor);
J2DPrint(JUTFont*, JUtility::TColor, JUtility::TColor);
void initiate();
/* 802F4394 */ J2DPrint(JUTFont*, f32, f32, JUtility::TColor, JUtility::TColor, JUtility::TColor, JUtility::TColor);
/* 802F4658 */ static u8* setBuffer(size_t);
/* 802F46C4 */ void setFontSize();
/* 802F475C */ void locate(f32, f32);
/* 802F4778 */ void print(f32, f32, u8, char const*, ...);
/* 802F4778 */ f32 print(f32, f32, u8, char const*, ...);
/* 802F4828 */ void printReturn(char const*, f32, f32, J2DTextBoxHBinding, J2DTextBoxVBinding,
f32, f32, u8);
/* 802F4B4C */ f32 parse(u8 const*, int, int, u16*, J2DPrint::TSize&, u8, bool);
@@ -34,6 +40,10 @@ public:
/* 802F4420 */ virtual ~J2DPrint();
f32 print_va(u8 alpha, const char* fmt, va_list args) {
return J2DPrint_print_alpha_va(this, alpha, fmt, args);
}
void setFontSize(f32 sizeX, f32 sizeY) {
f32 x;
if (sizeX > 0.0f) {
@@ -52,7 +62,7 @@ public:
mFontSizeY = y;
}
static const u8* mStrBuff;
static char* mStrBuff;
static size_t mStrBuffSize;
private:
@@ -64,27 +74,25 @@ private:
/* 0x0C */ JUtility::TColor field_0xc;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
/* 0x18 */ f32 field_0x18;
/* 0x1C */ f32 field_0x1c;
/* 0x18 */ f32 mScaleX;
/* 0x1C */ f32 mScaleY;
/* 0x20 */ s16 field_0x20;
/* 0x22 */ bool field_0x22;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2C */ f32 field_0x2c;
/* 0x2C */ f32 mCursorH;
/* 0x30 */ f32 mCursorV;
/* 0x34 */ f32 field_0x34;
/* 0x38 */ JUtility::TColor field_0x38;
/* 0x3C */ JUtility::TColor field_0x3c;
/* 0x38 */ JUtility::TColor mBlackColor;
/* 0x3C */ JUtility::TColor mWhiteColor;
/* 0x40 */ JUtility::TColor mCharColor;
/* 0x44 */ JUtility::TColor mGradColor;
/* 0x48 */ f32 field_0x48;
/* 0x4C */ f32 field_0x4c;
/* 0x48 */ f32 mCharSpacing;
/* 0x4C */ f32 mLineSpacing;
/* 0x50 */ f32 mFontSizeX;
/* 0x54 */ f32 mFontSizeY;
/* 0x58 */ s16 field_0x58;
/* 0x5A */ bool field_0x5a;
}; // Size: 0x5C
f32 J2DPrint_print_alpha_va(J2DPrint*, u8, const char*, va_list);
#endif /* J2DPRINT_H */
+27 -3
View File
@@ -18,9 +18,9 @@ public:
JGadget_outMessage& operator<<(int param_1) { return *this << (s32)param_1; }
JGadget_outMessage& operator<<(u16);
JGadget_outMessage& operator<<(unsigned int);
JGadget_outMessage& operator<<(u8);
JGadget_outMessage& operator<<(u8 param_1) { return *this << (char)param_1; }
JGadget_outMessage& operator<<(const char* str);
JGadget_outMessage& operator<<(s8);
JGadget_outMessage& operator<<(char);
JGadget_outMessage& operator<<(s32);
JGadget_outMessage& operator<<(u32);
JGadget_outMessage& operator<<(const void*);
@@ -33,13 +33,37 @@ private:
int mLine;
};
#define JGADGET_ASSERTWARN(cond) ((cond) || (false))
#ifdef DEBUG
// these macros are probably wrong, needs work
#define JGADGET_ASSERTWARN(line, COND) \
if (!(COND)) { \
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, line); \
out << #COND; \
}
#define JGADGET_WARNMSG(line, msg) \
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, line); \
out << msg;
#define JGADGET_WARNMSG1(line, msg, arg) \
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, line); \
out << msg << (arg);
#define JGADGET_WARNMSG4(line, msg, arg1, arg2, arg3, arg4) \
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, line); \
out << msg << (arg1) << (arg2) << (arg3) << (arg4);
#define JGADGET_EXITWARN(cond) \
if (!(cond)) { \
false; \
return false; \
}
#else
#define JGADGET_ASSERTWARN(line, COND) (void)0
#define JGADGET_WARNMSG(line, msg) (void)0
#define JGADGET_WARNMSG1(line, msg, arg) (void)0
#define JGADGET_WARNMSG4(line, msg, arg1, arg2, arg3, arg4) (void)0
#endif
}
#endif
+6 -3
View File
@@ -2,6 +2,7 @@
#define LINKLIST_H
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JGadget/define.h"
#include <iterator.h>
namespace JGadget {
@@ -75,8 +76,8 @@ struct TNodeLinkList {
const_iterator begin() const { return const_iterator(ocObject_.getNext()); }
iterator end() { return iterator(&ocObject_); }
const_iterator end() const { return const_iterator((TLinkListNode*)(&ocObject_)); }
u32 size() { return count; }
bool empty() { return size() == 0; }
u32 size() const { return count; }
bool empty() const { return size() == 0; }
iterator pop_front() { return erase(begin()); }
iterator erase(JGadget::TNodeLinkList::iterator, JGadget::TNodeLinkList::iterator);
@@ -248,7 +249,9 @@ struct TLinkList_factory : public TLinkList<T, I> {
};
template <typename T, int I>
TLinkList_factory<T, I>::~TLinkList_factory() {}
TLinkList_factory<T, I>::~TLinkList_factory() {
JGADGET_ASSERTWARN(934, empty());
}
template <typename T>
struct TEnumerator {
+26 -28
View File
@@ -16,30 +16,36 @@ struct TControl {
/* 802A75D4 */ void reset();
/* 802A7634 */ int update();
/* 802A76BC */ void render();
/* 802A77E8 */ int setMessageCode(u16, u16);
/* 802A78F4 */ int setMessageID(u32, u32, bool*);
/* 802A7A20 */ bool setMessageCode_inSequence_(JMessage::TProcessor const*, u16, u16);
/* 802A77E8 */ int setMessageCode(u16 u16GroupID, u16 u16Index);
/* 802A78F4 */ int setMessageID(u32 uMsgID, u32 param_1, bool* pbValid);
/* 802A7A20 */ bool setMessageCode_inSequence_(const TProcessor* pProcessor, u16 u16GroupID, u16 u16Index);
bool isReady_update_() const { return pMessageText_begin_ != 0 && pSequenceProcessor_ != NULL; }
bool isReady_render_() const { return field_0x20 != 0 && pRenderingProcessor_ != NULL; }
bool isReady_render_() const { return pMessageText_current_ != 0 && pRenderingProcessor_ != NULL; }
TProcessor* getProcessor() const {
return pSequenceProcessor_ != NULL ? (TProcessor*)pSequenceProcessor_ :
(TProcessor*)pRenderingProcessor_;
if (pSequenceProcessor_ != NULL) {
return (TProcessor*)pSequenceProcessor_;
} else {
return (TProcessor*)pRenderingProcessor_;
}
}
int setMessageCode(u32 code) {
return setMessageCode(code >> 16, code);
int setMessageCode(u32 uCode) {
return setMessageCode(uCode >> 16, uCode);
}
int setMessageCode_inReset_(TProcessor* pProcessor, u16 param_1, u16 param_2) {
if (!setMessageCode_inSequence_(pProcessor, param_1, param_2)) {
int setMessageCode_inReset_(const TProcessor* pProcessor, u16 u16GroupID, u16 u16Index) {
JUT_ASSERT(138, pEntry_==0);
JUT_ASSERT(139, pszText_update_current_==0);
JUT_ASSERT(140, oStack_renderingProcessor_.empty());
if (!setMessageCode_inSequence_(pProcessor, u16GroupID, u16Index)) {
return 0;
}
if (isReady_update_()) {
pSequenceProcessor_->setBegin_messageEntryText(pResourceCache_, pEntry_,
pMessageText_begin_);
pSequenceProcessor_->setBegin_messageEntryText(pResourceCache_, pEntry_, pMessageText_begin_);
}
return 1;
@@ -47,8 +53,10 @@ struct TControl {
const char* getMessageText_begin() const { return pMessageText_begin_; }
void* getMessageEntry() const { return pEntry_; }
void setSequenceProcessor(TSequenceProcessor* processor) { pSequenceProcessor_ = processor; }
void setRenderingProcessor(TRenderingProcessor* processor) { pRenderingProcessor_ = processor; }
u32 getMessageCode() const { return (uMessageGroupID_ << 16) | uMessageID_; }
void setSequenceProcessor(TSequenceProcessor* pProcessor) { pSequenceProcessor_ = pProcessor; }
void setRenderingProcessor(TRenderingProcessor* pProcessor) { pRenderingProcessor_ = pProcessor; }
void resetResourceCache() {
if (pSequenceProcessor_ != NULL) {
pSequenceProcessor_->resetResourceCache();
@@ -63,32 +71,22 @@ struct TControl {
void render_synchronize() {
if (isReady_render_()) {
field_0x20 = pszText_update_current_;
pMessageText_current_ = pszText_update_current_;
oStack_renderingProcessor_ = pRenderingProcessor_->oStack_;
}
}
/* 0x04 */ TSequenceProcessor* pSequenceProcessor_;
/* 0x08 */ TRenderingProcessor* pRenderingProcessor_;
/* 0x0C */ u16 messageCode_;
/* 0x0E */ u16 field_0xe;
/* 0x0C */ u16 uMessageGroupID_;
/* 0x0E */ u16 uMessageID_;
/* 0x10 */ const TResource* pResourceCache_;
/* 0x14 */ void* pEntry_;
/* 0x18 */ const char* pMessageText_begin_;
/* 0x1C */ const char* pszText_update_current_;
/* 0x20 */ const char* field_0x20;
/* 0x20 */ const char* pMessageText_current_;
/* 0x24 */ TProcessor::TStack_ oStack_renderingProcessor_;
};
}; // namespace JMessage
/**
* @ingroup jsystem-jmessage
*
*/
struct jmessage_tControl : public JMessage::TControl {
/* 802299EC */ jmessage_tControl();
/* 80039B0C */ virtual ~jmessage_tControl();
};
#endif /* JMESSAGE_CONTROL_H */
+32 -14
View File
@@ -10,8 +10,9 @@ namespace JMessage {
*
*/
struct data {
// TParse_THeader handles parsing the BMG file header data
struct TParse_THeader : public JGadget::binary::TParseData_aligned<4> {
TParse_THeader(const void* data) : TParseData_aligned(data) {}
TParse_THeader(const void* pData) : TParseData_aligned(pData) {}
const void* getContent() const { return (char*)getRaw() + 0x20; }
char* get() const { return (char*)getRaw(); }
@@ -22,8 +23,9 @@ struct data {
u8 get_encoding() const { return *(u8*)(get() + 0x10); }
};
// TParse_TBlock handles parsing the generic section header data
struct TParse_TBlock : public JGadget::binary::TParseData_aligned<4> {
TParse_TBlock(const void* data) : TParseData_aligned(data) {}
TParse_TBlock(const void* pData) : TParseData_aligned(pData) {}
const char* get() const { return (char*)getRaw(); }
u32 get_size() const { return *(u32*)(get() + 0x4); }
@@ -31,53 +33,69 @@ struct data {
u32 get_type() const { return *(u32*)(get() + 0x0); }
};
// TParse_TBlock_info handles parsing INF1 section data
struct TParse_TBlock_info : public TParse_TBlock {
TParse_TBlock_info(const void* data) : TParse_TBlock(data) {}
TParse_TBlock_info(const void* pData) : TParse_TBlock(pData) {}
char* get() const { return (char*)getRaw(); }
char* getContent() const { return (char*)getRaw() + 0x10; }
u16 get_messageEntrySize() const { return *(u16*)(get() + 0xA); }
u32 get_messageEntrySize() const { return *(u16*)(get() + 0xA); }
u16 get_messageEntryNumber() const { return *(u16*)(get() + 0x8); }
u32 get_messageEntryNumber() const { return *(u16*)(get() + 0x8); }
u16 get_groupID() const { return *(u16*)(get() + 0xC); }
};
// TParse_TBlock_messageID handles parsing MID1 section data
struct TParse_TBlock_messageID : public TParse_TBlock {
TParse_TBlock_messageID(const void* data) : TParse_TBlock(data) {}
TParse_TBlock_messageID(const void* pData) : TParse_TBlock(pData) {}
char* get() const { return (char*)getRaw(); }
u8 get_formSupplement() const { return *(u8*)(get() + 0xB); }
int get_number() const { return *(u16*)(get() + 0x8); }
u32* getContent() const { return (u32*)((u32)getRaw() + 0x10); }
u8 get_form() const { return *(u8*)(get() + 0xA) & 0xF; }
u32 get_form() const { return *(u8*)(get() + 0xA) & 0xF; }
bool get_isOrdered() const { return *(u8*)(get() + 0xA) & 0xF0; }
};
struct TParse_TBlock_color : public TParse_TBlock {
TParse_TBlock_color(const void* data) : TParse_TBlock(data) {}
TParse_TBlock_color(const void* pData) : TParse_TBlock(pData) {}
};
// TParse_TBlock_messageText handles parsing DAT1 section data
struct TParse_TBlock_messageText : public TParse_TBlock {
TParse_TBlock_messageText(const void* data) : TParse_TBlock(data) {}
TParse_TBlock_messageText(const void* pData) : TParse_TBlock(pData) {}
char* getContent() const { return (char*)getRaw() + 0x8; }
};
// TParse_TBlock_stringAttribute handles parsing STR1 section data
struct TParse_TBlock_stringAttribute : public TParse_TBlock {
TParse_TBlock_stringAttribute(const void* data) : TParse_TBlock(data) {}
TParse_TBlock_stringAttribute(const void* pData) : TParse_TBlock(pData) {}
char* getContent() const { return (char*)getRaw() + 0x8; }
};
static u32 getTagCode(u32 tag) { return tag & 0xFFFF; }
static u32 getTagGroup(u32 tag) { return (tag >> 0x10) & 0xFF; }
static unsigned int getTagCode(u32 tag) { return tag & 0xFFFF; }
static u8 getTagGroup(u32 tag) { return tag >> 0x10; }
static u32 ga4cSignature;
static const u32 ga4cSignature;
static const u32 ga4cSignature_color;
static const int gcTagBegin = '\x1A';
static const int gcTagBegin = '\x1A'; // All text Control Tags will begin with this character
enum {
MESSAGEINDEX_USER_ENUM_MIN = 0x0000,
MESSAGEINDEX_USER_ENUM_MAX = 0xFEFF,
MESSAGEINDEX_RESERVED_ENUM_MIN = 0xFF00,
MESSAGEINDEX_RESERVED_ENUM_MAX = 0xFFFF,
MESSAGEGROUPID_USER_ENUM_MIN = 0x0000,
MESSAGEGROUPID_USER_ENUM_MAX = 0xFFFF,
};
};
}; // namespace JMessage
+5 -4
View File
@@ -1,6 +1,7 @@
#ifndef JMESSAGE_LOCALE_H
#define JMESSAGE_LOCALE_H
#include <dolphin.h>
namespace JMessage {
@@ -15,10 +16,10 @@ struct locale {
return c >= 0x81 && (c <= 0x9F || (c >= 0xE0 && c <= 0xFC));
}
/* 802A9490 */ static int parseCharacter_1Byte(char const**);
/* 802A94A8 */ static int parseCharacter_2Byte(char const**);
/* 802A9528 */ static int parseCharacter_ShiftJIS(char const**);
/* 802A958C */ static int parseCharacter_UTF8(char const**);
/* 802A9490 */ static int parseCharacter_1Byte(const char** ppszText);
/* 802A94A8 */ static int parseCharacter_2Byte(const char** ppszText);
/* 802A9528 */ static int parseCharacter_ShiftJIS(const char** ppszText);
/* 802A958C */ static int parseCharacter_UTF8(const char** ppszText);
};
}; // namespace JMessage
+129 -116
View File
@@ -2,7 +2,8 @@
#define JMESSAGE_PROCESSOR_H
#include "JSystem/JMessage/resource.h"
#include "algorithm.h"
#include <algorithm.h>
#include "global.h"
namespace JMessage {
struct TResource;
@@ -18,15 +19,15 @@ struct TReference {
/* 802A7AF8 */ virtual ~TReference();
/* 802A7B40 */ virtual const char* do_word(u32) const;
int on_parseCharacter(const char** string) const { return pcResource_->parseCharacter(string); }
int on_parseCharacter(const char** ppszText) const {
JUT_ASSERT(97, pcResource_!=0);
return pcResource_->parseCharacter(ppszText);
}
const char* on_word(u32 param_0) const { return do_word(param_0); }
TResource* getResource_groupID(u16 groupID) const {
if (pcResource_ == NULL) {
return NULL;
}
return pcResource_->getResource_groupID(groupID);
TResource* getResource_groupID(u16 u16GroupID) const {
return pcResource_ == NULL ? NULL : pcResource_->getResource_groupID(u16GroupID);
}
TResourceContainer* getResourceContainer() const { return pcResource_; }
@@ -40,8 +41,13 @@ struct TReference {
*
*/
struct TProcessor {
TProcessor(const TReference* reference)
: pReference_(reference), pResourceCache_(NULL), pszCurrent_(NULL) {}
TProcessor(const TReference* pReference)
: pReference_(pReference),
pResourceCache_(NULL),
pszCurrent_(NULL)
{
JUT_ASSERT(584, pReference_!=0);
}
typedef bool (*pfnProcess_func)(TProcessor*);
@@ -55,14 +61,25 @@ struct TProcessor {
u32 max_size() const { return 4; }
u32 size() const { return upsz_; }
const char* top() const { return stack[upsz_ - 1]; }
const char* top() const {
JUT_ASSERT(181, upsz_>0);
return stack[upsz_ - 1];
}
void push(const char* string) {
stack[upsz_] = string;
void push(const char* pszText) {
JUT_ASSERT(186, IsPushable());
stack[upsz_] = pszText;
upsz_++;
}
void pop() { upsz_--; }
void pop() {
JUT_ASSERT(192, upsz_>0);
upsz_--;
#if PLATFORM_SHIELD
stack[upsz_] = NULL;
#endif
}
TStack_& operator=(const TStack_& other) {
upsz_ = other.upsz_;
@@ -79,11 +96,11 @@ struct TProcessor {
struct TProcess_ {
TProcess_() { reset_normal(); }
void reset_normal() { pfnProcess_CharacterEnd = process_onCharacterEnd_normal_; }
void reset_select() { pfnProcess_CharacterEnd = process_onCharacterEnd_select_; }
void reset_normal() { pfnProcess_onCharacterEnd = process_onCharacterEnd_normal_; }
void reset_select() { pfnProcess_onCharacterEnd = process_onCharacterEnd_select_; }
/* 0x0 */ pfnProcess_func pfnProcess_CharacterEnd;
struct {
/* 0x0 */ pfnProcess_func pfnProcess_onCharacterEnd;
struct rdata {
/* 0x0 */ const char* (*pfn)(TProcessor*);
/* 0x4 */ const char* pcBase;
/* 0x8 */ const void* pOffset;
@@ -93,51 +110,50 @@ struct TProcessor {
}; // Size: 0x14
/* 802A7B90 */ void reset();
/* 802A7BF8 */ void stack_pushCurrent(char const*);
/* 802A7BF8 */ void stack_pushCurrent(char const* pszText);
/* 802A7C30 */ void stack_popCurrent();
/* 802A7C54 */ const TResource* getResource_groupID(u16) const;
/* 802A7CD4 */ u32 toMessageCode_messageID(u32, u32, bool*) const;
/* 802A7E38 */ void on_select_begin(char const* (*)(JMessage::TProcessor*), void const*,
char const*, u32);
/* 802A7C54 */ const TResource* getResource_groupID(u16 u16GroupID) const;
/* 802A7CD4 */ u32 toMessageCode_messageID(u32 uMsgID, u32, bool* pbValid) const;
/* 802A7E38 */ void on_select_begin(char const* (*pfn)(JMessage::TProcessor*), void const* pOffset,
char const* pcBase, u32 uNumber);
/* 802A7EDC */ void on_select_end();
/* 802A7F34 */ void on_select_separate();
/* 802A7FE4 */ void on_tag_();
/* 802A8090 */ // void do_tag_(u32, void const*, u32);
/* 802A81EC */ bool process_character_();
/* 802A828C */ static bool process_onCharacterEnd_normal_(JMessage::TProcessor*);
/* 802A82F4 */ static bool process_onCharacterEnd_select_(JMessage::TProcessor*);
/* 802A833C */ static const char* process_onSelect_limited_(JMessage::TProcessor*);
/* 802A8358 */ static const char* process_onSelect_(JMessage::TProcessor*);
/* 802A8C24 */ const char* on_message(u32 param_0) const { return getMessageText_messageCode(param_0); }
/* 802A8C44 */ const char* getMessageText_messageCode(u32 param_0) const {
return getMessageText_messageCode(param_0 >> 0x10, param_0 & 0xFFFF);
/* 802A828C */ static bool process_onCharacterEnd_normal_(JMessage::TProcessor* pThis);
/* 802A82F4 */ static bool process_onCharacterEnd_select_(JMessage::TProcessor* pThis);
/* 802A833C */ static const char* process_onSelect_limited_(JMessage::TProcessor* pThis);
/* 802A8358 */ static const char* process_onSelect_(JMessage::TProcessor* pThis);
/* 802A8C24 */ const char* on_message(u32 uCode) const { return getMessageText_messageCode(uCode); }
/* 802A8C44 */ const char* getMessageText_messageCode(u32 uCode) const {
return getMessageText_messageCode(uCode >> 16, uCode & 0xFFFF);
}
/* 802A7B48 */ virtual ~TProcessor();
/* 802A7FC0 */ virtual void do_reset();
/* 802A7FC4 */ virtual void do_begin(void const*, char const*);
/* 802A7FC4 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 802A7FC8 */ virtual void do_end();
/* 802A7FCC */ virtual void do_character(int);
/* 802A7FD0 */ virtual bool do_tag(u32, void const*, u32);
/* 802A7FD8 */ virtual void do_select_begin(u32);
/* 802A7FCC */ virtual void do_character(int iCharacter);
/* 802A7FD0 */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
/* 802A7FD8 */ virtual void do_select_begin(u32 uNumber);
/* 802A7FDC */ virtual void do_select_end();
/* 802A7FE0 */ virtual void do_select_separate();
/* 802A8084 */ virtual void do_resetStatus_(char const*);
/* 802A8084 */ virtual void do_resetStatus_(char const* pszText);
/* 802A8088 */ virtual bool do_setBegin_isReady_() const;
virtual void do_begin_(void const*, char const*) = 0;
virtual void do_begin_(void const* pEntry, char const* pszText) = 0;
virtual void do_end_() = 0;
virtual void do_tag_(u32, void const*, u32) = 0;
virtual void do_tag_(u32 uTag, void const* pData, u32 uSize) = 0;
void on_resetStatus_(const char* param_0) {
pszCurrent_ = param_0;
void on_resetStatus_(const char* pszText) {
pszCurrent_ = pszText;
oStack_.clear();
oProcess_.reset_normal();
do_resetStatus_(param_0);
do_resetStatus_(pszText);
}
void on_begin(const void* entry, const char* param_1) {
do_begin_(entry, param_1);
do_begin(entry, param_1);
void on_begin(const void* pEntry, const char* pszText) {
do_begin_(pEntry, pszText);
do_begin(pEntry, pszText);
}
void on_end() {
@@ -145,49 +161,52 @@ struct TProcessor {
do_end();
}
void on_tag(u32 param_0, const void* param_1, u32 param_2) {
if (!do_tag(param_0, param_1, param_2)) {
do_tag_(param_0, param_1, param_2);
void on_tag(u32 uTag, const void* pData, u32 uSize) {
if (!do_tag(uTag, pData, uSize)) {
do_tag_(uTag, pData, uSize);
}
}
const char* on_word(u32 param_0) const { return pReference_->on_word(param_0); }
int on_parseCharacter(const char** string) const {
return pReference_->on_parseCharacter(string);
int on_parseCharacter(const char** ppszText) const {
return pReference_->on_parseCharacter(ppszText);
}
void on_character(int character) { do_character(character); }
void on_character(int iCharacter) { do_character(iCharacter); }
const char* on_message_limited(u16 messageIndex) const {
return pResourceCache_->getMessageText_messageIndex(messageIndex);
const char* on_message_limited(u16 u16Index) const {
JUT_ASSERT(482, pResourceCache_!=0);
return pResourceCache_->getMessageText_messageIndex(u16Index);
}
int setBegin_messageEntryText(const TResource* resource, const void* entry,
const char* param_2) {
pResourceCache_ = resource;
on_resetStatus_(param_2);
on_begin(entry, param_2);
bool on_setBegin_isReady_() const { return do_setBegin_isReady_(); }
int setBegin_messageEntryText(const TResource* pResource, const void* pEntry, const char* pszText) {
JUT_ASSERT(297, on_setBegin_isReady_());
pResourceCache_ = pResource;
on_resetStatus_(pszText);
on_begin(pEntry, pszText);
return 1;
}
int setBegin_messageEntryText(const TProcessor* processor, const void* entry,
const char* param_2) {
setBegin_messageEntryText(processor->getResourceCache(), entry, param_2);
int setBegin_messageEntryText(const TProcessor* pProcessor, const void* pEntry, const char* pszText) {
JUT_ASSERT(306, pProcessor!=0);
setBegin_messageEntryText(pProcessor->getResourceCache(), pEntry, pszText);
return 1;
}
void* getMessageEntry_messageCode(u16 messageCode, u16 messageIndex) const {
const TResource* pResource = getResource_groupID(messageCode);
void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const {
const TResource* pResource = getResource_groupID(u16Code);
if (pResource == NULL) {
return NULL;
}
return pResource->getMessageEntry_messageIndex(messageIndex);
return pResource->getMessageEntry_messageIndex(u16Index);
}
const char* getMessageText_messageCode(u16 messageCode, u16 messageIndex) const {
void* pEntry = getMessageEntry_messageCode(messageCode, messageIndex);
const char* getMessageText_messageCode(u16 u16Code, u16 u16Index) const {
void* pEntry = getMessageEntry_messageCode(u16Code, u16Index);
if (pEntry == NULL) {
return NULL;
@@ -196,9 +215,9 @@ struct TProcessor {
return pResourceCache_->getMessageText_messageEntry(pEntry);
}
void stack_pushCurrent_(const char* string) {
void stack_pushCurrent_(const char* pszText) {
oStack_.push(getCurrent());
pszCurrent_ = string;
pszCurrent_ = pszText;
}
void stack_popCurrent_() {
@@ -212,27 +231,23 @@ struct TProcessor {
const char* getCurrent() const { return pszCurrent_; }
const TReference* getReference() const { return pReference_; }
const TResource* getResource_groupID_uncached(u16 groupID) const {
return pReference_->getResource_groupID(groupID);
const TResource* getResource_groupID_uncached(u16 u16GroupID) const {
return pReference_->getResource_groupID(u16GroupID);
}
bool isResourceCache_groupID(u16 groupID) const {
return pResourceCache_ != NULL && groupID == pResourceCache_->getGroupID();
bool isResourceCache_groupID(u16 u16GroupID) const {
return pResourceCache_ != NULL && u16GroupID == pResourceCache_->getGroupID();
}
TResourceContainer* getResourceContainer() const {
if (pReference_ == NULL) {
return NULL;
}
return pReference_->getResourceContainer();
return pReference_ == NULL ? NULL : pReference_->getResourceContainer();
}
void setResourceCache(TResource* cache) { pResourceCache_ = cache; }
void setResourceCache(TResource* pResource) { pResourceCache_ = pResource; }
void resetResourceCache() { setResourceCache(NULL); }
/* 0x04 */ const TReference* pReference_;
/* 0x08 */ const TResource* pResourceCache_;
/* 0x08 */ const mutable TResource* pResourceCache_;
/* 0x0C */ const char* pszCurrent_;
/* 0x10 */ TStack_ oStack_;
/* 0x24 */ TProcess_ oProcess_;
@@ -253,13 +268,13 @@ struct TSequenceProcessor : public TProcessor {
void reset() {}
union {
struct {
union processData {
struct branchData {
/* 0x0 */ branchPfn branchFn;
/* 0x4 */ const void* pTarget;
/* 0x8 */ u32 uTarget;
} branch_process;
struct {
struct jumpData {
/* 0x0 */ jumpPfn jumpFn;
/* 0x4 */ u32 u32Target;
} jump_process;
@@ -275,48 +290,45 @@ struct TSequenceProcessor : public TProcessor {
STATUS_BRANCH,
};
/* 802A8374 */ TSequenceProcessor(JMessage::TReference const*, JMessage::TControl*);
/* 802A8418 */ const char* process(char const*);
/* 802A8374 */ TSequenceProcessor(JMessage::TReference const* pReference, JMessage::TControl* pControl);
/* 802A8418 */ const char* process(char const* pszText);
/* 802A85A4 */ bool on_isReady();
/* 802A85D0 */ void on_jump_register(void const* (*)(JMessage::TSequenceProcessor const*), u32);
/* 802A85D0 */ void on_jump_register(jumpPfn pfn, u32 u32Target);
/* 802A85E4 */ bool on_jump_isReady();
/* 802A8610 */ void on_jump(void const*, char const*);
/* 802A8690 */ void
on_branch_register(void const* (*)(JMessage::TSequenceProcessor const*, u32), void const*, u32);
/* 802A86A0 */ void on_branch_query(u32);
/* 802A8610 */ void on_jump(void const* pEntry, char const* pszText);
/* 802A8690 */ void on_branch_register(branchPfn pfn, void const* pTarget, u32 uTarget);
/* 802A86A0 */ void on_branch_query(u32 uCode);
/* 802A86D4 */ u32 on_branch_queryResult();
/* 802A8700 */ void on_branch(void const*, char const*);
/* 802A892C */ static void process_setMessageIndex_reserved_(u16);
/* 802A8944 */ static void* process_setMessageCode_(JMessage::TSequenceProcessor const*, u16,
u16);
/* 802A89B8 */ static const void* process_onJump_limited_(JMessage::TSequenceProcessor const*);
/* 802A89EC */ static const void* process_onJump_(JMessage::TSequenceProcessor const*);
/* 802A8A18 */ static const void* process_onBranch_limited_(JMessage::TSequenceProcessor const*,
u32);
/* 802A8A50 */ static const void* process_onBranch_(JMessage::TSequenceProcessor const*, u32);
/* 802A8700 */ void on_branch(void const* pEntry, char const* pszText);
/* 802A892C */ static void process_setMessageIndex_reserved_(u16 u16Index);
/* 802A8944 */ static void* process_setMessageCode_(TSequenceProcessor const* pProcessor, u16 u16GroupID, u16 u16Index);
/* 802A89B8 */ static const void* process_onJump_limited_(TSequenceProcessor const* pProcessor);
/* 802A89EC */ static const void* process_onJump_(TSequenceProcessor const* pProcessor);
/* 802A8A18 */ static const void* process_onBranch_limited_(TSequenceProcessor const* pProcessor, u32 uTargetIndex);
/* 802A8A50 */ static const void* process_onBranch_(TSequenceProcessor const* pProcessor, u32 uTargetIndex);
/* 802A83B8 */ virtual ~TSequenceProcessor();
/* 802A87A4 */ virtual void do_resetStatus_(char const*);
/* 802A87A4 */ virtual void do_resetStatus_(char const* pszText);
/* 802A87C0 */ virtual bool do_setBegin_isReady_() const;
/* 802A87D0 */ virtual void do_begin_(void const*, char const*);
/* 802A87D0 */ virtual void do_begin_(void const* pEntry, char const* pszText);
/* 802A87D4 */ virtual void do_end_();
/* 802A87E0 */ virtual void do_tag_(u32, void const*, u32);
/* 802A87E0 */ virtual void do_tag_(u32 uTag, void const* pData, u32 uSize);
/* 802A8780 */ virtual bool do_isReady();
/* 802A8788 */ virtual bool do_jump_isReady();
/* 802A8790 */ virtual void do_jump(void const*, char const*);
/* 802A8794 */ virtual void do_branch_query(u32);
/* 802A8790 */ virtual void do_jump(void const* pEntry, char const* pszText);
/* 802A8794 */ virtual void do_branch_query(u32 uCode);
/* 802A8798 */ virtual s32 do_branch_queryResult();
/* 802A87A0 */ virtual void do_branch(void const*, char const*);
/* 802A87A0 */ virtual void do_branch(void const* pEntry, char const* pszText);
TControl* getControl() const { return pControl_; }
static const void* process_setMessageIndex_(const TSequenceProcessor* pProcessor, u16 param_1) {
static const void* process_setMessageIndex_(const TSequenceProcessor* pProcessor, u16 u16Index) {
return process_setMessageCode_(pProcessor, pProcessor->getResourceCache()->getGroupID(),
param_1);
u16Index);
}
static const void* process_setMessageCode_(const TSequenceProcessor* pProcessor, u32 param_1) {
return process_setMessageCode_(pProcessor, param_1 >> 0x10, param_1 & 0xFFFF);
static const void* process_setMessageCode_(const TSequenceProcessor* pProcessor, u32 uCode) {
return process_setMessageCode_(pProcessor, uCode >> 16, uCode & 0xFFFF);
}
/* 0x38 */ TControl* pControl_;
@@ -329,20 +341,21 @@ struct TSequenceProcessor : public TProcessor {
*
*/
struct TRenderingProcessor : public TProcessor {
/* 802A8A84 */ TRenderingProcessor(JMessage::TReference const*);
/* 802A8B20 */ int process(char const*);
/* 802A8A84 */ TRenderingProcessor(JMessage::TReference const* pReference);
/* 802A8B20 */ int process(char const* pszText);
/* 802A8AC0 */ virtual ~TRenderingProcessor();
/* 802A8BA4 */ virtual void do_begin_(void const*, char const*);
/* 802A8BA4 */ virtual void do_begin_(void const* pEntry, char const* pszText);
/* 802A8BA8 */ virtual void do_end_();
/* 802A8BAC */ virtual void do_tag_(u32, void const*, u32);
/* 802A8BAC */ virtual void do_tag_(u32 uTag, void const* pData, u32 uSize);
bool process_messageEntryText(TProcessor *param_0,void const*param_1,const char *param_2) {
int rv = TProcessor::setBegin_messageEntryText(param_0, param_1, param_2);
if (rv != 0) {
process(NULL);
bool process_messageEntryText(const TProcessor* pProcessor, void const* pEntry, const char* pszText) {
if (!TProcessor::setBegin_messageEntryText(pProcessor, pEntry, pszText)) {
return false;
}
return rv != 0;
process(NULL);
return true;
}
};
}; // namespace JMessage
+59 -42
View File
@@ -13,33 +13,40 @@ namespace JMessage {
*/
struct TResource {
TResource()
: field_0x8(NULL), field_0xc(NULL), field_0x10(NULL), field_0x14(NULL), mMessageID(NULL) {}
: oParse_THeader_(NULL),
oParse_TBlock_info_(NULL),
pMessageText_(NULL),
pStringAttribute_(NULL),
oParse_TBlock_messageID_(NULL)
{}
/* 802A8CDC */ u16 toMessageIndex_messageID(u32, u32, bool*) const;
/* 802A8CDC */ u16 toMessageIndex_messageID(u32 uMsgID, u32, bool* pbValid) const;
bool isContained_messageIndex(u16 messageIndex) const {
return messageIndex < getMessageEntryNumber();
bool isContained_messageIndex(u16 uMessageIndex) const {
return uMessageIndex < getMessageEntryNumber();
}
u16 getMessageEntrySize() const { return field_0xc.get_messageEntrySize(); }
u16 getMessageEntryNumber() const { return field_0xc.get_messageEntryNumber(); }
u32 getMessageEntrySize() const { return oParse_TBlock_info_.get_messageEntrySize(); }
u32 getMessageEntryNumber() const { return oParse_TBlock_info_.get_messageEntryNumber(); }
u16 getGroupID() const { return field_0xc.get_groupID(); }
u16 getGroupID() const { return oParse_TBlock_info_.get_groupID(); }
void* getMessageEntry_messageIndex(u16 messageIndex) const {
if (!isContained_messageIndex(messageIndex)) {
void* getMessageEntry_messageIndex(u16 uMessageIndex) const {
if (!isContained_messageIndex(uMessageIndex)) {
return NULL;
}
return field_0xc.getContent() + (messageIndex * getMessageEntrySize());
void* pEntry = oParse_TBlock_info_.getContent() + (uMessageIndex * getMessageEntrySize());
return pEntry;
}
char* getMessageText_messageEntry(const void* pEntry) const {
return field_0x10 + *(int*)pEntry;
JUT_ASSERT(141, pEntry!=0);
return pMessageText_ + *(int*)pEntry;
}
const char* getMessageText_messageIndex(u16 messageIndex) const {
void* pEntry = getMessageEntry_messageIndex(messageIndex);
const char* getMessageText_messageIndex(u16 uMessageIndex) const {
void* pEntry = getMessageEntry_messageIndex(uMessageIndex);
if (pEntry == NULL) {
return NULL;
}
@@ -48,31 +55,35 @@ struct TResource {
}
void setData_header(const void* pData) {
field_0x8.setRaw(pData);
oParse_THeader_.setRaw(pData);
}
void setData_block_info(const void* pData) {
field_0xc.setRaw(pData);
oParse_TBlock_info_.setRaw(pData);
JGADGET_ASSERTWARN(75, oParse_TBlock_info_.get_groupID()<= data::MESSAGEGROUPID_USER_ENUM_MAX);
JGADGET_ASSERTWARN(77, oParse_TBlock_info_.get_messageEntryNumber()<= data::MESSAGEINDEX_USER_ENUM_MAX);
}
void setData_block_messageText(const void* pData) {
field_0x10 = data::TParse_TBlock_messageText(pData).getContent();
pMessageText_ = data::TParse_TBlock_messageText(pData).getContent();
}
void setData_block_stringAttribute(const void* pData) {
field_0x14 = data::TParse_TBlock_stringAttribute(pData).getContent();
pStringAttribute_ = data::TParse_TBlock_stringAttribute(pData).getContent();
}
void setData_block_messageID(const void* pData) {
mMessageID.setRaw(pData);
oParse_TBlock_messageID_.setRaw(pData);
}
JGadget::TLinkListNode ocObject_;
/* 0x08 */ data::TParse_THeader field_0x8;
/* 0x0C */ data::TParse_TBlock_info field_0xc;
/* 0x10 */ char* field_0x10;
/* 0x14 */ char* field_0x14;
/* 0x18 */ data::TParse_TBlock_messageID mMessageID;
/* 0x08 */ data::TParse_THeader oParse_THeader_;
/* 0x0C */ data::TParse_TBlock_info oParse_TBlock_info_;
/* 0x10 */ char* pMessageText_;
/* 0x14 */ char* pStringAttribute_;
/* 0x18 */ data::TParse_TBlock_messageID oParse_TBlock_messageID_;
};
/**
@@ -80,14 +91,18 @@ struct TResource {
*
*/
struct TResource_color {
TResource_color() : field_0x0(NULL), field_0x4(NULL) {}
TResource_color()
: oParse_THeader_(NULL),
oParse_TBlock_color_(NULL)
{}
void reset() {
field_0x0.setRaw(NULL);
field_0x4.setRaw(NULL);
oParse_THeader_.setRaw(NULL);
oParse_TBlock_color_.setRaw(NULL);
}
/* 0x0 */ data::TParse_THeader field_0x0;
/* 0x4 */ data::TParse_TBlock_color field_0x4;
/* 0x0 */ data::TParse_THeader oParse_THeader_;
/* 0x4 */ data::TParse_TBlock_color oParse_TBlock_color_;
}; // Size: 0x8
/**
@@ -97,24 +112,26 @@ struct TResource_color {
struct TResourceContainer {
struct TCResource : public JGadget::TLinkList_factory<TResource, 0> {
/* 802A8EC0 */ TCResource();
/* 802A8F6C */ TResource* Get_groupID(u16);
/* 802A8F6C */ TResource* Get_groupID(u16 u16GroupID);
/* 802A8EF8 */ virtual ~TCResource();
/* 802A8FFC */ virtual JMessage::TResource* Do_create();
/* 802A9048 */ virtual void Do_destroy(JMessage::TResource*);
// u8 field_0x0[0x10];
/* 802A9048 */ virtual void Do_destroy(JMessage::TResource* pResource);
};
/* 802A906C */ TResourceContainer();
/* 802A90B8 */ void setEncoding(u8);
/* 802A90F0 */ void setEncoding_(u8);
/* 802A90B8 */ void setEncoding(u8 e);
/* 802A90F0 */ void setEncoding_(u8 e);
int parseCharacter(const char** string) const { return pfnParseCharacter_(string); }
TResource* getResource_groupID(u16 groupID) { return resContainer_.Get_groupID(groupID); }
TResource* getResource_groupID(u16 groupID) const { return getResource_groupID(groupID); }
int parseCharacter(const char** ppszText) const {
JUT_ASSERT(330, pfnParseCharacter_!=0);
return pfnParseCharacter_(ppszText);
}
bool isEncodingSettable(u8 e) const { return mEncodingType == e || mEncodingType == 0; }
TResource* getResource_groupID(u16 u16GroupID) { return resContainer_.Get_groupID(u16GroupID); }
TResource* getResource_groupID(u16 u16GroupID) const { return getResource_groupID(u16GroupID); }
bool isEncodingSettable(u8 e) const { return encodingType_ == e || encodingType_ == 0; }
const TCResource* getResourceContainer() const { return &resContainer_; }
void destroyResource() {
resContainer_.Clear_destroy();
@@ -129,7 +146,7 @@ struct TResourceContainer {
static JMessage::locale::parseCharacter_function sapfnParseCharacter_[5];
/* 0x00 */ u8 mEncodingType;
/* 0x00 */ u8 encodingType_;
/* 0x04 */ JMessage::locale::parseCharacter_function pfnParseCharacter_;
/* 0x08 */ TCResource resContainer_;
/* 0x18 */ TResource_color resColor_;
@@ -140,11 +157,11 @@ struct TResourceContainer {
*
*/
struct TParse : public JGadget::binary::TParse_header_block {
/* 802A9130 */ TParse(JMessage::TResourceContainer*);
/* 802A9130 */ TParse(JMessage::TResourceContainer* pContainer);
/* 802A9158 */ virtual ~TParse();
/* 802A91B8 */ virtual bool parseHeader_next(void const**, u32*, u32);
/* 802A92F4 */ virtual bool parseBlock_next(void const**, u32*, u32);
/* 802A91B8 */ virtual bool parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32);
/* 802A92F4 */ virtual bool parseBlock_next(const void** ppData_inout, u32* puData_out, u32);
/* 0x4 */ TResourceContainer* pContainer_;
/* 0x8 */ TResource* pResource_;
+1 -1
View File
@@ -3061,7 +3061,7 @@ inline void dComIfGp_setMesgBgmOff() {
g_dComIfG_gameInfo.play.setMesgBgm(0);
}
inline bool dComIfGp_checkMesgBgm() {
inline u8 dComIfGp_checkMesgBgm() {
return g_dComIfG_gameInfo.play.checkMesgBgm();
}
+194 -45
View File
@@ -11,16 +11,18 @@ public:
// Attributes
/* 0x04 */ u16 message_id;
/* 0x06 */ u16 unk_0x6;
/* 0x08 */ u8 unk_0x8;
/* 0x09 */ u8 display_style;
/* 0x0A */ u8 print_style;
/* 0x0B */ u8 position;
/* 0x06 */ u16 event_label_id;
/* 0x08 */ u8 se_speaker;
/* 0x09 */ u8 fuki_kind;
/* 0x0A */ u8 output_type;
/* 0x0B */ u8 fuki_pos_type;
/* 0x0C */ u8 unk_0xc;
/* 0x0D */ u8 unk_0xd;
/* 0x0E */ u8 unk_0xe;
/* 0x0E */ u8 se_mood;
/* 0x0F */ u8 camera_id;
/* 0x10 */ u32 unk_0x10;
/* 0x10 */ u8 base_anm_id;
/* 0x11 */ u8 face_anm_id;
/* 0x12 */ u16 unk_0x12;
};
class JMSMesgInfo_c {
@@ -48,7 +50,7 @@ struct jmessage_tReference : public JMessage::TReference {
/* 80228F08 */ bool isSaveSeq();
/* 80228F3C */ bool isBook();
/* 80228F70 */ bool isStaffRoll();
/* 80228FA4 */ u8 isHowl();
/* 80228FA4 */ bool isHowl();
/* 80228FD8 */ bool isMidona();
/* 8022900C */ void resetReference();
/* 80229034 */ void pageSend();
@@ -70,7 +72,10 @@ struct jmessage_tReference : public JMessage::TReference {
/* 80238C78 */ void setActorPos(cXyz pos) { mActorPos = pos; }
bool isSelectSetCancelFlag() { return mSelectSetCancelFlag != 0; }
bool isSelectSetCancelFlag() {
return mSelectSetCancelFlag ? true : false;
}
BOOL isSelectRubyFlag(int i_flag) {
BOOL var_r31;
if (mSelectRubyFlag & (u8)(1 << i_flag)) {
@@ -80,8 +85,9 @@ struct jmessage_tReference : public JMessage::TReference {
}
return var_r31;
}
bool isBatchFlag() { return mBatchFlag; }
bool isLightBatchFlag() { return mLightBatchFlag; }
bool isBatchFlag() { return mBatchFlag ? true : false; }
bool isLightBatchFlag() { return mLightBatchFlag ? true : false; }
void setAddCharAllAlphaRate(f32 i_alphaRate) { mAddCharAllAlphaRate = i_alphaRate; }
void setCharAllAlphaRate(f32 i_alphaRate) { mCharAllAlphaRate = i_alphaRate; }
@@ -220,7 +226,7 @@ struct jmessage_tReference : public JMessage::TReference {
f32 getSelTBoxWidth() { return mSelTBoxWidth; }
u8 getSelectPos() { return mSelectPos; }
u16 getMsgID() { return mMsgID; }
bool isButtonTagStopFlag() { return mButtonTagStopFlag; }
bool isButtonTagStopFlag() { return mButtonTagStopFlag ? true : false; }
u8 getStopFlag() { return mStopFlag; }
u8 getSendFlag() { return mSendFlag; }
u8 getFukiPosType() { return mFukiPosType; }
@@ -230,7 +236,7 @@ struct jmessage_tReference : public JMessage::TReference {
f32 getSelFontSize() { return mSelFontSize; }
f32 getSelCharSpace() { return mSelCharSpace; }
u16 getLineScale(int i_no) { return mLineScale[i_no]; }
bool isBombNameUseFlag() { return mBombNameUseFlag; }
bool isBombNameUseFlag() { return mBombNameUseFlag ? true : false; }
f32 getSelLength(int idx) { return mSelLength[idx]; }
void setAddCharAlpha(f32 alpha) { mAddCharAlpha = alpha; }
s8 getNowPageLineMax() { return mPageLineMax[field_0x5d2]; }
@@ -344,7 +350,7 @@ struct jmessage_tReference : public JMessage::TReference {
}; // Size: 0x1278
struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor {
/* 80229A28 */ jmessage_tMeasureProcessor(jmessage_tReference const*);
/* 80229A28 */ jmessage_tMeasureProcessor(jmessage_tReference const* pReference);
/* 8022B0B0 */ void do_scale(f32);
/* 8022B18C */ void do_space(u32);
/* 8022B3EC */ void do_pageType(int);
@@ -353,16 +359,16 @@ struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor {
/* 8022B4E0 */ void push_word(char*);
/* 8022B5F4 */ virtual ~jmessage_tMeasureProcessor() {}
/* 80229AC4 */ virtual void do_begin(void const*, char const*);
/* 80229AC4 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 80229CB4 */ virtual void do_end();
/* 80229E3C */ virtual void do_character(int);
/* 8022A268 */ virtual bool do_tag(u32, void const*, u32);
/* 80229E3C */ virtual void do_character(int iCharacter);
/* 8022A268 */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
/* 0x38 */ f32 field_0x38;
/* 0x3C */ s16 mTotalLineCnt;
/* 0x3E */ s16 field_0x3e;
/* 0x40 */ s16 field_0x40;
/* 0x42 */ u16 field_0x42;
/* 0x42 */ u16 mSeMood;
/* 0x44 */ u8 field_0x44;
/* 0x45 */ u8 mSelectType;
/* 0x46 */ u8 field_0x46;
@@ -371,13 +377,18 @@ struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor {
/* 0x49 */ s8 field_0x49;
/* 0x4A */ s8 mPageLineMax;
/* 0x4B */ s8 field_0x4b;
/* 0x4C */ u8 field_0x4c;
/* 0x4C */ u8 mSeSpeaker;
/* 0x4D */ u8 field_0x4d;
}; // Size: 0x50
struct jmessage_tControl;
struct jmessage_tControl : public JMessage::TControl {
/* 802299EC */ jmessage_tControl();
/* 80039B0C */ virtual ~jmessage_tControl();
};
struct jmessage_tSequenceProcessor : public JMessage::TSequenceProcessor {
/* 8022B558 */ jmessage_tSequenceProcessor(jmessage_tReference const*, jmessage_tControl*);
/* 8022B558 */ jmessage_tSequenceProcessor(jmessage_tReference const* pReference, jmessage_tControl* pControl);
/* 8022C904 */ void do_name1();
/* 8022C908 */ void do_space(u32);
/* 8022CA24 */ void do_rubyset(void const*, u32);
@@ -387,20 +398,20 @@ struct jmessage_tSequenceProcessor : public JMessage::TSequenceProcessor {
/* 8023299C */ virtual ~jmessage_tSequenceProcessor() {}
/* 8022B654 */ virtual void do_reset();
/* 8022B658 */ virtual void do_begin(void const*, char const*);
/* 8022B658 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 8022BA3C */ virtual void do_end();
/* 8022BFE0 */ virtual void do_character(int);
/* 8022C1A0 */ virtual bool do_tag(u32, void const*, u32);
/* 8022BFE0 */ virtual void do_character(int iCharacter);
/* 8022C1A0 */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
/* 8022BB7C */ virtual bool do_isReady();
/* 8022C8FC */ virtual bool do_jump_isReady();
/* 8022CBE4 */ virtual void do_jump(void const*, char const*);
/* 8022CBE4 */ virtual void do_jump(void const* pEntry, char const* pszText);
u8 getMouthCheck() { return mMouthCheck; }
void setForceForm(u8 forceForm) { mForceForm = forceForm; }
/* 0x4C */ jmessage_tMeasureProcessor mMeasureProcessor;
/* 0x9C */ const void* field_0x9c;
/* 0xA0 */ const char* field_0xa0;
/* 0x9C */ const void* mpEntry;
/* 0xA0 */ const char* mpText;
/* 0xA4 */ s16 field_0xa4;
/* 0xA6 */ s16 field_0xa6;
/* 0xA8 */ s16 field_0xa8;
@@ -429,7 +440,7 @@ struct CharInfo_c {
};
struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
/* 8022CCB0 */ jmessage_tRenderingProcessor(jmessage_tReference const*);
/* 8022CCB0 */ jmessage_tRenderingProcessor(jmessage_tReference const* pReference);
/* 8022E12C */ void resetRendering();
/* 8022E17C */ void do_widthcenter();
/* 8022E260 */ void do_selwidthcenter(int);
@@ -451,10 +462,10 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
/* 8023293C */ virtual ~jmessage_tRenderingProcessor() {}
/* 8022CDC8 */ virtual void do_reset();
/* 8022CDCC */ virtual void do_begin(void const*, char const*);
/* 8022CDCC */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 8022CFD8 */ virtual void do_end();
/* 8022D0A0 */ virtual void do_character(int);
/* 8022D74C */ virtual bool do_tag(u32, void const*, u32);
/* 8022D0A0 */ virtual void do_character(int iCharacter);
/* 8022D74C */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
void setTextInitPos(float x, float y) {
mTextInitPosX = x;
@@ -578,38 +589,38 @@ struct jmessage_string_tReference : public JMessage::TReference {
};
struct jmessage_string_tMeasureProcessor : public JMessage::TRenderingProcessor {
/* 8022FB98 */ jmessage_string_tMeasureProcessor(jmessage_string_tReference const*);
/* 8022FB98 */ jmessage_string_tMeasureProcessor(jmessage_string_tReference const* pReference);
/* 8023098C */ void do_rubyset(void const*, u32);
/* 80230A5C */ virtual ~jmessage_string_tMeasureProcessor() {}
/* 8022FBE4 */ virtual void do_begin(void const*, char const*);
/* 8022FBE4 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 8022FC14 */ virtual void do_end();
/* 8022FC28 */ virtual void do_character(int);
/* 8022FDF0 */ virtual bool do_tag(u32, void const*, u32);
/* 8022FC28 */ virtual void do_character(int iCharacter);
/* 8022FDF0 */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
/* 0x38 */ jmessage_string_tReference* mpReference;
};
struct jmessage_string_tSequenceProcessor : public JMessage::TSequenceProcessor {
/* 80230A08 */ jmessage_string_tSequenceProcessor(jmessage_string_tReference const*,
jmessage_string_tControl*);
/* 80230A08 */ jmessage_string_tSequenceProcessor(jmessage_string_tReference const* pReference,
jmessage_string_tControl* pControl);
/* 80232858 */ virtual ~jmessage_string_tSequenceProcessor() {}
/* 80230ABC */ virtual void do_reset();
/* 80230AC0 */ virtual void do_begin(void const*, char const*);
/* 80230AC0 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 80230B7C */ virtual void do_end();
/* 80230B88 */ virtual void do_character(int);
/* 80230B8C */ virtual bool do_tag(u32, void const*, u32);
/* 80230B88 */ virtual void do_character(int iCharacter);
/* 80230B8C */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
/* 80230B80 */ virtual bool do_isReady();
/* 80230BBC */ virtual bool do_jump_isReady();
/* 80230BC4 */ virtual void do_jump(void const*, char const*);
/* 80230BC4 */ virtual void do_jump(void const* pEntry, char const* pszText);
/* 0x4C */ jmessage_string_tMeasureProcessor mMeasureProcessor;
/* 0x88 */ jmessage_string_tReference* mpSeqReference;
};
struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcessor {
/* 80230BC8 */ jmessage_string_tRenderingProcessor(jmessage_string_tReference const*);
/* 80230BC8 */ jmessage_string_tRenderingProcessor(jmessage_string_tReference const* pReference);
/* 80230C20 */ s16 getLineCountNowPage();
/* 80231D70 */ void do_widthcenter();
/* 80231EF0 */ void do_heightcenter();
@@ -625,10 +636,10 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
/* 802327F8 */ virtual ~jmessage_string_tRenderingProcessor() {}
/* 80230C5C */ virtual void do_reset();
/* 80230CA0 */ virtual void do_begin(void const*, char const*);
/* 80230CA0 */ virtual void do_begin(void const* pEntry, char const* pszText);
/* 80230CE8 */ virtual void do_end();
/* 80230D48 */ virtual void do_character(int);
/* 80231110 */ virtual bool do_tag(u32, void const*, u32);
/* 80230D48 */ virtual void do_character(int iCharacter);
/* 80231110 */ virtual bool do_tag(u32 uTag, void const* pData, u32 uSize);
char* getString() { return field_0x54; }
@@ -650,4 +661,142 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
/* 0x554 */ u8 field_0x554;
};
#define MSGTAG_GROUP(g) (g << 16)
// Group 0
#define MSGTAG_PLAYER_NAME 0
#define MSGTAG_INSTANT 1
#define MSGTAG_TYPE 2
#define MSGTAG_UNK_3 3 // appears the same as autobox
#define MSGTAG_AUTOBOX 4
#define MSGTAG_BOXATMOST 5
#define MSGTAG_UNK_6 6
#define MSGTAG_PAUSE 7
#define MSGTAG_SELECT_2WAY 8
#define MSGTAG_SELECT_3WAY 9
#define MSGTAG_ABTN 10
#define MSGTAG_BBTN 11
#define MSGTAG_CSTICK 12
#define MSGTAG_LBTN 13
#define MSGTAG_RBTN 14
#define MSGTAG_XBTN 15
#define MSGTAG_YBTN 16
#define MSGTAG_ZBTN 17
#define MSGTAG_DPAD 18
#define MSGTAG_STICK_CROSS 19
#define MSGTAG_LEFT_ARROW 20
#define MSGTAG_RIGHT_ARROW 21
#define MSGTAG_UP_ARROW 22
#define MSGTAG_DOWN_ARROW 23
#define MSGTAG_STICK_UP 24
#define MSGTAG_STICK_DOWN 25
#define MSGTAG_STICK_LEFT 26
#define MSGTAG_STICK_RIGHT 27
#define MSGTAG_STICK_VERTICAL 28
#define MSGTAG_STICK_HORIZONTAL 29
#define MSGTAG_INLINE_2_NEXT 30
#define MSGTAG_INLINE_2_FIRST 31
#define MSGTAG_AWAIT_CHOICE 32
#define MSGTAG_UNK_33 33 // calls "do_name1" but the function does nothing
#define MSGTAG_HORSE_NAME 34
#define MSGTAG_RED_TARGET 35
#define MSGTAG_YELLOW_TARGET 36
#define MSGTAG_INPUT_VALUE 37
#define MSGTAG_ACKNOWLEDGE 38
#define MSGTAG_ABTN_STAR 39
#define MSGTAG_DEMOBOX 40
#define MSGTAG_SCENT_NAME 41
#define MSGTAG_WHITE_TARGET 42
#define MSGTAG_PORTAL_NAME 43
#define MSGTAG_WARP_ICON 44
#define MSGTAG_BOMB_NAME 45
#define MSGTAG_XYBTN 46
#define MSGTAG_YXBTN 47
#define MSGTAG_BOMB_BAG_ICON 48
#define MSGTAG_BOMB_NUM 49
#define MSGTAG_BOMB_PRICE 50
#define MSGTAG_INLINE_3_NEXT 51
#define MSGTAG_INLINE_3_FIRST 52
#define MSGTAG_UNK_53 53
#define MSGTAG_BOXATLEAST 54
#define MSGTAG_BOMB_MAX 55
#define MSGTAG_ARROW_MAX 56
#define MSGTAG_HEART 57
#define MSGTAG_QUAVER 58
#define MSGTAG_INSECT_NAME 59
#define MSGTAG_LETTER_NAME 60
#define MSGTAG_LINE_DOWN 61
#define MSGTAG_CURRENT_LETTER_PAGE 62
#define MSGTAG_MAX_LETTER_PAGE 63
// Group 3
#define MSGTAG_WII_MSGID_OVERRIDE 0
#define MSGTAG_WII_ABTN 1
#define MSGTAG_WII_BBTN 2
#define MSGTAG_WII_HOMEBTN 3
#define MSGTAG_WII_MINUSBTN 4
#define MSGTAG_WII_PLUSBTN 5
#define MSGTAG_WII_1BTN 6
#define MSGTAG_WII_2BTN 7
#define MSGTAG_WII_DPAD_ITEM 8
#define MSGTAG_WII_DPAD_UP 9
#define MSGTAG_WII_DPAD_DOWN 10
#define MSGTAG_WII_DPAD_HORIZONTAL 11
#define MSGTAG_WII_DPAD_RIGHT 12
#define MSGTAG_WII_DPAD_LEFT 13
#define MSGTAG_WII_WIIMOTE 14
#define MSGTAG_WII_RETICULE 15
#define MSGTAG_WII_NUNCHUK 16
#define MSGTAG_WII_WIIMOTE2 17
#define MSGTAG_WII_FAIRY 18
#define MSGTAG_WII_CBTN 19
#define MSGTAG_WII_ZBTN 20
// Group 4
#define MSGTAG_GLYPH_DOLLARSIGN 0
#define MSGTAG_GLYPH_BACKSLASH 1
#define MSGTAG_GLYPH_ATMARK 2
#define MSGTAG_GLYPH_SHARP 3
#define MSGTAG_GLYPH_FLAT 4
#define MSGTAG_GLYPH_SQRT 5
#define MSGTAG_GLYPH_PERCENT 6
#define MSGTAG_GLYPH_HECTARE 7
#define MSGTAG_GLYPH_ARE 8
#define MSGTAG_GLYPH_LITRE 9
#define MSGTAG_GLYPH_WATT 10
#define MSGTAG_GLYPH_CALORIE 11
#define MSGTAG_GLYPH_DOLLAR 12
#define MSGTAG_GLYPH_CENT 13
// Group 5
#define MSGTAG_TIME_INFO 0
#define MSGTAG_INSECT_INFO 3
#define MSGTAG_RIVER_POINTS 7
#define MSGTAG_FISH_LENGTH 8
#define MSGTAG_FUNDRAISE_REMAIN 9
#define MSGTAG_NEW_LETTER_NUM 10
#define MSGTAG_POE_NUM 11
#define MSGTAG_BALLOON_SCORE 12
#define MSGTAG_FISH_COUNT 13
#define MSGTAG_ROLLGOAL_LV 14
// Group 6
#define MSGTAG_PLAYER_GENITIV 0
#define MSGTAG_HORSE_GENITIV 1
#define MSGTAG_MALE_ICON 2
#define MSGTAG_FEMALE_ICON 3
#define MSGTAG_STAR_ICON 4
#define MSGTAG_REFMARK 5
#define MSGTAG_THIN_LEFT_ARROW 6
#define MSGTAG_THIN_RIGHT_ARROW 7
#define MSGTAG_THIN_UP_ARROW 8
#define MSGTAG_THIN_DOWN_ARROW 9
#define MSGTAG_BULLET 10
#define MSGTAG_BULLET_SPACE 11
// Group 255
#define MSGTAG_COLOR (MSGTAG_GROUP(255) | 0)
#define MSGTAG_SCALE (MSGTAG_GROUP(255) | 1)
#define MSGTAG_RUBY (MSGTAG_GROUP(255) | 2)
#endif /* D_MSG_D_MSG_CLASS_H */
+2 -1
View File
@@ -13,6 +13,7 @@ class dMsgString_c;
struct jmessage_tReference;
struct jmessage_tRenderingProcessor;
struct jmessage_tSequenceProcessor;
struct jmessage_tControl;
class dMsgObject_c : public msg_class {
public:
@@ -55,7 +56,7 @@ public:
char*, char*, s16*);
/* 802370A8 */ u8 isGetItemMessage();
/* 802370BC */ bool isKanbanMessage();
/* 802370E8 */ u8 isHowlMessage();
/* 802370E8 */ bool isHowlMessage();
/* 802370FC */ bool isMidonaMessage();
/* 80237138 */ bool isMidonaNormalTalkWait();
/* 802371B0 */ bool isMidonaTalkWait();
File diff suppressed because it is too large Load Diff
+30 -20
View File
@@ -7,9 +7,16 @@
/* 802A7548-802A758C 2A1E88 0044+00 0/0 2/2 0/0 .text __ct__Q28JMessage8TControlFv */
JMessage::TControl::TControl()
: pSequenceProcessor_(NULL), pRenderingProcessor_(NULL), messageCode_(0xFFFF),
field_0xe(0xFFFF), pResourceCache_(NULL), pEntry_(NULL), pMessageText_begin_(0),
pszText_update_current_(NULL), field_0x20(0) {}
: pSequenceProcessor_(NULL),
pRenderingProcessor_(NULL),
uMessageGroupID_(0xFFFF),
uMessageID_(0xFFFF),
pResourceCache_(NULL),
pEntry_(NULL),
pMessageText_begin_(NULL),
pszText_update_current_(NULL),
pMessageText_current_(NULL)
{}
/* 802A758C-802A75D4 2A1ECC 0048+00 1/0 2/2 0/0 .text __dt__Q28JMessage8TControlFv */
JMessage::TControl::~TControl() {}
@@ -17,9 +24,9 @@ JMessage::TControl::~TControl() {}
/* 802A75D4-802A7634 2A1F14 0060+00 0/0 9/9 0/0 .text reset__Q28JMessage8TControlFv */
void JMessage::TControl::reset() {
pEntry_ = NULL;
pMessageText_begin_ = 0;
pMessageText_begin_ = NULL;
pszText_update_current_ = NULL;
field_0x20 = 0;
pMessageText_current_ = NULL;
oStack_renderingProcessor_.clear();
if (pSequenceProcessor_ != NULL) {
@@ -38,7 +45,6 @@ int JMessage::TControl::update() {
}
pszText_update_current_ = pSequenceProcessor_->process(NULL);
if (pszText_update_current_ == NULL) {
pMessageText_begin_ = 0;
return 0;
@@ -50,44 +56,48 @@ int JMessage::TControl::update() {
/* 802A76BC-802A77E8 2A1FFC 012C+00 0/0 5/5 0/0 .text render__Q28JMessage8TControlFv */
void JMessage::TControl::render() {
if (isReady_render_()) {
pRenderingProcessor_->setBegin_messageEntryText(pResourceCache_, pEntry_, field_0x20);
pRenderingProcessor_->setBegin_messageEntryText(pResourceCache_, pEntry_, pMessageText_current_);
pRenderingProcessor_->oStack_ = oStack_renderingProcessor_;
pRenderingProcessor_->process(pszText_update_current_);
}
}
/* 802A77E8-802A78F4 2A2128 010C+00 0/0 1/1 0/0 .text setMessageCode__Q28JMessage8TControlFUsUs */
int JMessage::TControl::setMessageCode(u16 param_0, u16 param_1) {
return setMessageCode_inReset_(getProcessor(), param_0, param_1);
int JMessage::TControl::setMessageCode(u16 u16GroupID, u16 u16Index) {
TProcessor* pProcessor = getProcessor();
JUT_ASSERT(120, pProcessor!=0);
return setMessageCode_inReset_(pProcessor, u16GroupID, u16Index);
}
/* 802A78F4-802A7A20 2A2234 012C+00 0/0 6/6 0/0 .text setMessageID__Q28JMessage8TControlFUlUlPb */
int JMessage::TControl::setMessageID(u32 param_0, u32 param_1, bool* param_2) {
int JMessage::TControl::setMessageID(u32 uMsgID, u32 param_1, bool* pbValid) {
TProcessor* pProcessor = getProcessor();
JUT_ASSERT(132, pProcessor!=0);
u32 code = pProcessor->toMessageCode_messageID(param_0, param_1, param_2);
if (code == -1) {
u32 uCode = pProcessor->toMessageCode_messageID(uMsgID, param_1, pbValid);
if (uCode == 0xFFFFFFFF) {
return 0;
}
return setMessageCode_inReset_(pProcessor, code >> 0x10, code & 0xFFFF);
return setMessageCode_inReset_(pProcessor, uCode >> 16, uCode & 0xFFFF);
}
/* 802A7A20-802A7AF8 2A2360 00D8+00 2/2 1/1 0/0 .text
* setMessageCode_inSequence___Q28JMessage8TControlFPCQ28JMessage10TProcessorUsUs */
bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* pProcessor,
u16 messageCode, u16 messageIndex) {
pEntry_ = pProcessor->getMessageEntry_messageCode(messageCode, messageIndex);
bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* pProcessor, u16 u16GroupID, u16 u16Index) {
pEntry_ = pProcessor->getMessageEntry_messageCode(u16GroupID, u16Index);
if (pEntry_ == NULL) {
return false;
}
messageCode_ = messageCode;
field_0xe = messageIndex;
uMessageGroupID_ = u16GroupID;
uMessageID_ = u16Index;
pResourceCache_ = pProcessor->getResourceCache();
JUT_ASSERT(155, pResourceCache_!=0);
pMessageText_begin_ = pResourceCache_->getMessageText_messageEntry(pEntry_);
field_0x20 = pMessageText_begin_;
pMessageText_current_ = pMessageText_begin_;
oStack_renderingProcessor_.clear();
return true;
}
+3 -7
View File
@@ -1,10 +1,6 @@
//
// Generated By: dol2asm
// Translation Unit: data
//
#include "JSystem/JMessage/data.h"
#include "dol2asm.h"
/* 80455818-80455820 003E18 0004+04 0/0 1/1 0/0 .sdata2 ga4cSignature__Q28JMessage4data */
SECTION_SDATA2 u32 JMessage::data::ga4cSignature = 'MESG';
const u32 JMessage::data::ga4cSignature = 'MESG';
const u32 JMessage::data::ga4cSignature_color = 'MGCL';
+39 -41
View File
@@ -1,60 +1,58 @@
//
// Generated By: dol2asm
// Translation Unit: locale
//
#include "JSystem/JMessage/locale.h"
#include <dolphin.h>
/* 802A9528-802A958C 2A3E68 0064+00 0/0 1/0 0/0 .text
* parseCharacter_ShiftJIS__Q28JMessage6localeFPPCc */
int JMessage::locale::parseCharacter_ShiftJIS(char const** str) {
u8 c = **str;
int ret = c;
*str = *str + 1;
int JMessage::locale::parseCharacter_ShiftJIS(const char** ppszText) {
int c = *(u8*)*ppszText & 0xFF;
(*ppszText)++;
if (isLeadByte_ShiftJIS(c)) {
ret <<= 8;
ret |= *(u8*)*str;
*str = *str + 1;
c <<= 8;
c |= *(u8*)*ppszText & 0xFF;
(*ppszText)++;
}
return ret;
return c;
}
/* 802A958C-802A968C 2A3ECC 0100+00 0/0 1/0 0/0 .text parseCharacter_UTF8__Q28JMessage6localeFPPCc
*/
int JMessage::locale::parseCharacter_UTF8(char const** str) {
int c = *(u8*)*str;
int ret = c;
*str = *str + 1;
int JMessage::locale::parseCharacter_UTF8(const char** ppszText) {
int c = *(u8*)*ppszText & 0xFF;
(*ppszText)++;
if (c & 0x80) {
if ((c & 0xe0) == 0xc0) {
ret = (ret & 0x1f) << 6;
ret |= **str & 0x3f;
*str = *str + 1;
} else if ((c & 0xf0) == 0xe0) {
ret = (ret & 0xf) << 6;
ret |= **str & 0x3f;
*str = *str + 1;
ret <<= 6;
ret |= **str & 0x3f;
*str = *str + 1;
} else if ((c & 0xf8) == 0xf0) {
ret = (ret & 0x7) << 6;
ret |= **str & 0x3f;
*str = *str + 1;
ret <<= 6;
ret |= **str & 0x3f;
*str = *str + 1;
ret <<= 6;
ret |= **str & 0x3f;
*str = *str + 1;
if ((c & 0xE0) == 0xC0) {
c &= 0x1F;
c <<= 6;
c |= (*(u8*)*ppszText & 0xFF) & 0x3F;
(*ppszText)++;
} else if ((c & 0xF0) == 0xE0) {
c &= 0xF;
c <<= 6;
c |= (*(u8*)*ppszText & 0xFF) & 0x3F;
(*ppszText)++;
c <<= 6;
c |= (*(u8*)*ppszText & 0xFF) & 0x3F;
(*ppszText)++;
} else if ((c & 0xF8) == 0xF0) {
c &= 0x7;
c <<= 6;
c |= (*(u8*)*ppszText & 0xFF) & 0x3F;
(*ppszText)++;
c <<= 6;
c |= (*(u8*)*ppszText & 0xFF) & 0x3F;
(*ppszText)++;
c <<= 6;
c |= (*(u8*)*ppszText & 0xFF) & 0x3F;
(*ppszText)++;
} else {
ret = -1;
c = -1;
}
}
return ret;
return c;
}
File diff suppressed because it is too large Load Diff
+127 -105
View File
@@ -1,87 +1,90 @@
//
// Generated By: dol2asm
// Translation Unit: resource
//
#include "JSystem/JMessage/resource.h"
#include "JSystem/JGadget/search.h"
#include "JSystem/JGadget/define.h"
#include <algorithm.h>
#include "string.h"
#include <string.h>
/* 802A8CDC-802A8EC0 2A361C 01E4+00 0/0 1/1 0/0 .text
* toMessageIndex_messageID__Q28JMessage9TResourceCFUlUlPb */
u16 JMessage::TResource::toMessageIndex_messageID(u32 lowerHalf, u32 upperHalf,
bool* isMsgValid) const {
if (!mMessageID.getRaw()) {
u16 JMessage::TResource::toMessageIndex_messageID(u32 uMsgID, u32 upperHalf, bool* pbValid) const {
if (!oParse_TBlock_messageID_.getRaw()) {
return 0xFFFF;
}
u32 val = -1;
bool check = true;
JUT_ASSERT(87, oParse_TBlock_messageID_.get_form()==0);
u8 sp0A = mMessageID.get_formSupplement();
switch (sp0A) {
u32 uMsgValue = 0xFFFFFFFF;
bool valid = true;
u8 uFormSupplement = oParse_TBlock_messageID_.get_formSupplement();
switch (uFormSupplement) {
case 0:
if (upperHalf) {
check = false;
if (upperHalf != 0) {
valid = false;
}
val = lowerHalf;
uMsgValue = uMsgID;
break;
case 1:
if (lowerHalf > 0xFFFFFF || upperHalf > 0xFF) {
check = false;
if (uMsgID > 0xFFFFFF || upperHalf > 0xFF) {
valid = false;
}
val = ((lowerHalf << 8) & 0xFFFFFF00) | (upperHalf & 0xFF);
uMsgValue = ((uMsgID << 8) & 0xFFFFFF00) | (upperHalf & 0xFF);
break;
case 2:
if (lowerHalf > 0xFFFF || upperHalf > 0xFFFF) {
check = false;
if (uMsgID > 0xFFFF || upperHalf > 0xFFFF) {
valid = false;
}
val = ((lowerHalf << 16) & 0xFFFF0000) | (upperHalf & 0xFFFF);
uMsgValue = ((uMsgID << 16) & 0xFFFF0000) | (upperHalf & 0xFFFF);
break;
case 3:
if (lowerHalf > 0xFF || upperHalf > 0xFFFFFF) {
check = false;
if (uMsgID > 0xFF || upperHalf > 0xFFFFFF) {
valid = false;
}
val = ((lowerHalf << 24) & 0xFF000000) | (upperHalf & 0x00FFFFFF);
uMsgValue = ((uMsgID << 24) & 0xFF000000) | (upperHalf & 0x00FFFFFF);
break;
case 4:
if (lowerHalf) {
check = false;
if (uMsgID != 0) {
valid = false;
}
val = upperHalf;
uMsgValue = upperHalf;
break;
default:
JGADGET_WARNMSG1(122, "form-supplement unknown", uFormSupplement);
return 0xFFFF;
}
if (isMsgValid) {
*isMsgValid = check;
if (pbValid) {
*pbValid = valid;
}
if (val == 0xFFFFFFFF) {
if (uMsgValue == 0xFFFFFFFF) {
return 0xFFFF;
}
int number = mMessageID.get_number();
const u32* first = mMessageID.getContent();
const u32* last = first + number;
int nMsgNumber = oParse_TBlock_messageID_.get_number();
const u32* lower;
if (mMessageID.get_isOrdered()) {
lower = std::lower_bound(first, last, val);
const u32* pContent = oParse_TBlock_messageID_.getContent();
JUT_ASSERT(131, pContent!=0);
if (lower == last || *lower != val) {
const u32* pFirst = pContent;
const u32* pLast = pFirst + nMsgNumber;
const u32* pEntry;
if (oParse_TBlock_messageID_.get_isOrdered()) {
pEntry = std::lower_bound(pFirst, pLast, uMsgValue);
if (pEntry == pLast || *pEntry != uMsgValue) {
return 0xFFFF;
}
} else {
lower = std::find(first, last, val);
if (lower == last) {
pEntry = std::find(pFirst, pLast, uMsgValue);
if (pEntry == pLast) {
return 0xFFFF;
}
}
return (lower - first);
int nIndex = pEntry - pFirst;
JUT_ASSERT(154, (data::MESSAGEINDEX_USER_ENUM_MIN<=nIndex)&& (nIndex<=data::MESSAGEINDEX_USER_ENUM_MAX));
return nIndex;
}
/* 803C9C80-803C9C94 -00001 0014+00 1/1 0/0 0/0 .data
@@ -100,45 +103,48 @@ JMessage::TResourceContainer::TCResource::TCResource() {}
/* 802A8EF8-802A8F6C 2A3838 0074+00 1/0 2/2 0/0 .text
* __dt__Q38JMessage18TResourceContainer10TCResourceFv */
JMessage::TResourceContainer::TCResource::~TCResource() {}
JMessage::TResourceContainer::TCResource::~TCResource() {
JGADGET_ASSERTWARN(173, empty());
}
/* 802A8F6C-802A8FFC 2A38AC 0090+00 0/0 1/1 0/0 .text
* Get_groupID__Q38JMessage18TResourceContainer10TCResourceFUs */
// NONMATCHING
JMessage::TResource* JMessage::TResourceContainer::TCResource::Get_groupID(u16 groupID) {
// NONMATCHING - likely due to incorrect enumerator setup compared to debug
JMessage::TResource* JMessage::TResourceContainer::TCResource::Get_groupID(u16 u16GroupID) {
JGadget::TContainerEnumerator<TResource, 0> enumerator(this);
while (enumerator) {
const TResource* res = &(*enumerator);
if (res->field_0xc.get_groupID() == groupID)
if (res->getGroupID() == u16GroupID)
return (TResource*)res;
}
return NULL;
}
/* 802A8FFC-802A9048 2A393C 004C+00 1/0 0/0 0/0 .text
* Do_create__Q38JMessage18TResourceContainer10TCResourceFv */
JMessage::TResource* JMessage::TResourceContainer::TCResource::Do_create() {
TResource* new_res = new TResource();
return new_res;
return new TResource();
}
/* 802A9048-802A906C 2A3988 0024+00 1/0 0/0 0/0 .text
* Do_destroy__Q38JMessage18TResourceContainer10TCResourceFPQ28JMessage9TResource */
// NONMATCHING extra null comparison
void JMessage::TResourceContainer::TCResource::Do_destroy(JMessage::TResource* param_0) {
delete param_0;
void JMessage::TResourceContainer::TCResource::Do_destroy(JMessage::TResource* pResource) {
delete pResource;
}
/* 802A906C-802A90B8 2A39AC 004C+00 0/0 2/2 0/0 .text __ct__Q28JMessage18TResourceContainerFv */
JMessage::TResourceContainer::TResourceContainer() : mEncodingType(0), pfnParseCharacter_(NULL) {}
JMessage::TResourceContainer::TResourceContainer() : encodingType_(0), pfnParseCharacter_(NULL) {}
/* 802A90B8-802A90F0 2A39F8 0038+00 1/1 0/0 0/0 .text
* setEncoding__Q28JMessage18TResourceContainerFUc */
void JMessage::TResourceContainer::setEncoding(u8 e) {
if (e == 0) {
mEncodingType = e;
encodingType_ = e;
pfnParseCharacter_ = NULL;
} else {
JGADGET_ASSERTWARN(285, isEncodingSettable(e));
setEncoding_(e);
}
}
@@ -146,14 +152,15 @@ void JMessage::TResourceContainer::setEncoding(u8 e) {
/* 802A90F0-802A9130 2A3A30 0040+00 1/1 0/0 0/0 .text
* setEncoding___Q28JMessage18TResourceContainerFUc */
void JMessage::TResourceContainer::setEncoding_(u8 e) {
mEncodingType = e;
pfnParseCharacter_ = JGadget::toValueFromIndex<JMessage::locale::parseCharacter_function>(
e, sapfnParseCharacter_, 5, NULL);
encodingType_ = e;
pfnParseCharacter_ = JGadget::toValueFromIndex<JMessage::locale::parseCharacter_function>(e, sapfnParseCharacter_, 5, NULL);
JUT_ASSERT(299, pfnParseCharacter_!=0);
}
/* 802A9130-802A9158 2A3A70 0028+00 0/0 2/2 0/0 .text
* __ct__Q28JMessage6TParseFPQ28JMessage18TResourceContainer */
JMessage::TParse::TParse(JMessage::TResourceContainer* pContainer) {
JUT_ASSERT(324, pContainer!=0);
pContainer_ = pContainer;
pResource_ = NULL;
}
@@ -164,108 +171,121 @@ JMessage::TParse::~TParse() {}
/* 802A91B8-802A92F4 2A3AF8 013C+00 1/0 0/0 0/0 .text
* parseHeader_next__Q28JMessage6TParseFPPCvPUlUl */
// NONMATCHING regalloc, missing clrlwi
bool JMessage::TParse::parseHeader_next(void const** ppData_inout, u32* puBlock_out, u32 param_2) {
bool JMessage::TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 param_2) {
JUT_ASSERT(343, ppData_inout!=0);
JUT_ASSERT(344, puBlock_out!=0);
const void* pData = *ppData_inout;
JUT_ASSERT(346, pData!=0);
data::TParse_THeader header(pData);
*ppData_inout = header.getContent();
*puBlock_out = header.get_blockNumber();
data::TParse_THeader oHeader(pData);
*ppData_inout = oHeader.getContent();
*puBlock_out = oHeader.get_blockNumber();
if (memcmp(header.get_signature(), &data::ga4cSignature, sizeof(data::ga4cSignature))) {
JUT_ASSERT(350, pContainer_!=0);
if (memcmp(oHeader.get_signature(), &data::ga4cSignature, sizeof(data::ga4cSignature)) != 0) {
JGADGET_WARNMSG(355, "unknown signature");
return 0;
}
if (header.get_type() != 'bmg1') {
if (oHeader.get_type() != 'bmg1') {
JGADGET_WARNMSG(360, "unknown type");
return 0;
}
u8 encoding = header.get_encoding();
if (encoding != 0) {
if (!pContainer_->isEncodingSettable(encoding)) {
u8 uEncoding = oHeader.get_encoding();
if (uEncoding != 0) {
if (!pContainer_->isEncodingSettable(uEncoding)) {
JGADGET_WARNMSG(369, "encoding not acceptable");
return 0;
}
pContainer_->setEncoding(encoding);
pContainer_->setEncoding(uEncoding);
}
if (param_2 & 0x10) {
return 1;
}
TResourceContainer::TCResource* resContainer = &pContainer_->resContainer_;
pResource_ = resContainer->Do_create();
TResourceContainer::TCResource* pResContainer = &pContainer_->resContainer_;
pResource_ = pResContainer->Do_create();
if (pResource_ == NULL) {
return param_2 & 0x20;
JGADGET_WARNMSG(384, "can't create resource");
if (param_2 & 0x20) {
return 1;
} else {
return 0;
}
} else {
resContainer->Push_back(pResource_);
pResource_->setData_header(header.getRaw());
pResContainer->Push_back(pResource_);
pResource_->setData_header(oHeader.getRaw());
return 1;
}
}
/* 802A92F4-802A9490 2A3C34 019C+00 1/0 0/0 0/0 .text
* parseBlock_next__Q28JMessage6TParseFPPCvPUlUl */
bool JMessage::TParse::parseBlock_next(void const** ppData_inout, u32* puData_out, u32 param_2) {
bool JMessage::TParse::parseBlock_next(const void** ppData_inout, u32* puData_out, u32 param_2) {
JUT_ASSERT(401, ppData_inout!=0);
JUT_ASSERT(402, puData_out!=0);
const void* pData = *ppData_inout;
JUT_ASSERT(404, pData!=0);
data::TParse_TBlock sp34(pData);
data::TParse_TBlock oBlock(pData);
*ppData_inout = sp34.getNext();
*puData_out = sp34.get_size();
*ppData_inout = oBlock.getNext();
*puData_out = oBlock.get_size();
TResourceContainer::TCResource& rcResource = pContainer_->resContainer_;
JUT_ASSERT(412, pResource_==&*--(rcResource.end()));
u32 sp30 = sp34.get_type();
switch (sp30) {
case 'INF1':
u32 uType = oBlock.get_type();
switch (uType) {
case 'INF1': {
pResource_->setData_block_info(pData);
break;
}
case 'FLI1':
break;
case 'FLW1':
break;
case 'DAT1':
case 'DAT1': {
pResource_->setData_block_messageText(pData);
u16 temp_r26 = pResource_->getGroupID();
u16 u16GroupID = pResource_->getGroupID();
if (param_2 & 0x80) {
JGadget::TLinkList<JMessage::TResource, 0>::iterator sp2C(rcResource.begin());
JMessage::TResource* sp28;
while ((sp28 = &*sp2C) != pResource_) {
if ((u16)temp_r26 != sp28->getGroupID()) {
++sp2C;
JGadget::TLinkList<JMessage::TResource, 0>::iterator iResource(rcResource.begin());
JMessage::TResource* pResource;
while ((pResource = &*iResource) != pResource_) {
if ((u16)u16GroupID != pResource->getGroupID()) {
++iResource;
} else {
sp2C = rcResource.Erase_destroy(sp28);
iResource = rcResource.Erase_destroy(pResource);
}
}
} else {
#ifdef DEBUG
JMessage::TResource* sp24 = rcResource.Get_groupID(temp_r26);
if (sp24 != pResource_) {
JGadget_outMessage sp148(JGadget_outMessage::warning, __FILE__, 444);
sp148 << "group-ID already exist : " << temp_r26;
JMessage::TResource* pResource = rcResource.Get_groupID(u16GroupID);
if (pResource != pResource_) {
JGADGET_WARNMSG1(444, "group-ID already exist : ", u16GroupID);
}
#endif
}
break;
case 'STR1':
}
case 'STR1': {
pResource_->setData_block_stringAttribute(pData);
break;
case 'MID1':
}
case 'MID1': {
pResource_->setData_block_messageID(pData);
break;
}
default:
#ifdef DEBUG
JGadget_outMessage sp148(JGadget_outMessage::warning, __FILE__, 463);
sp148 << "unknown block : " << sp30;
#endif
JGADGET_WARNMSG1(463, "unknown block : ", uType);
if (!(param_2 & 0x40)) {
return 0;
}
@@ -277,24 +297,26 @@ bool JMessage::TParse::parseBlock_next(void const** ppData_inout, u32* puData_ou
/* 802A9490-802A94A8 2A3DD0 0018+00 1/0 0/0 0/0 .text
* parseCharacter_1Byte__Q28JMessage6localeFPPCc */
int JMessage::locale::parseCharacter_1Byte(char const** string) {
u8 parse_char = **string;
int JMessage::locale::parseCharacter_1Byte(char const** ppszText) {
u8** ppuText = (u8**)ppszText;
int parse_char = **ppuText & 0xFF;
*string = *string + 1;
(*ppuText)++;
return parse_char;
}
/* 802A94A8-802A94D4 2A3DE8 002C+00 1/0 0/0 0/0 .text
* parseCharacter_2Byte__Q28JMessage6localeFPPCc */
int JMessage::locale::parseCharacter_2Byte(char const** string) {
u8** tmp_str = (u8**)string;
int JMessage::locale::parseCharacter_2Byte(char const** ppszText) {
u8** ppuText = (u8**)ppszText;
u8 hi = **tmp_str;
*tmp_str = *tmp_str + 1;
int parse_char = **ppuText & 0xFF;
(*ppuText)++;
u8 lo = **tmp_str;
int parse_char = (hi << 8) | lo;
*tmp_str = *tmp_str + 1;
parse_char <<= 8;
parse_char |= **ppuText & 0xFF;
(*ppuText)++;
return parse_char;
}
@@ -84,8 +84,9 @@ InputIt find_if(InputIt first, InputIt last, UnaryPredicate p) {
// fakematch: val should be a const reference, but that breaks JMessage::TResource::toMessageIndex_messageID
template<class ForwardIterator, class T>
inline ForwardIterator find(ForwardIterator first, ForwardIterator last, T& val) {
for (; first != last && *first != val; ++first) {
}
while (first != last && !(*first == val)) {
++first;
}
return first;
}
@@ -0,0 +1,28 @@
#ifndef MSL_CSTDINT_H_
#define MSL_CSTDINT_H_
#ifdef __cplusplus
namespace std {
extern "C" {
#endif
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef signed char int8_t;
typedef short int16_t;
typedef long int32_t;
typedef unsigned long long uint64_t;
typedef long long int64_t;
typedef uint32_t uintptr_t;
typedef int32_t intptr_t;
#ifdef __cplusplus
};
}
#endif
#endif
+1
View File
@@ -1,4 +1,5 @@
#include "d/d_demo.h"
#include "d/d_msg_class.h"
#include "d/d_msg_object.h"
#include "m_Do/m_Do_graphic.h"
#include "d/actor/d_a_movie_player.h"

Some files were not shown because too many files have changed in this diff Show More