mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 13:08:33 -04:00
JMessage work (#296)
* daalink / z2linkmgr wip * first cleanup of JASGlobalInstance data * fix sInstance stuff part 2 * more d_a_alink_swim work * remove asm * JMessage work * remove asm
This commit is contained in:
@@ -30,10 +30,10 @@ template <int T>
|
||||
struct TParseData_aligned : public TParseData {
|
||||
TParseData_aligned(const void* pContent) : TParseData(pContent) {}
|
||||
void setRaw(const void* p) {
|
||||
if ((u32)p % T != 0) {
|
||||
/* if ((u32)p % T != 0) {
|
||||
JUTWarn w;
|
||||
w << "misaligned : " << (u32)p;
|
||||
}
|
||||
} */
|
||||
static_cast<TParseData*>(this)->setRaw(p);
|
||||
}
|
||||
};
|
||||
@@ -52,6 +52,29 @@ struct TParse_header_block {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TParseValue_raw_ {
|
||||
static T parse(const void* data) { return *(T*)data; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TParseValue_endian_big_ : public TParseValue_raw_<T> {
|
||||
static T parse(const void* data) { return TParseValue_raw_::parse(data); }
|
||||
};
|
||||
|
||||
template <typename T, template <class> class Parser>
|
||||
struct TParseValue : public Parser<T> {
|
||||
static T parse(const void* data) { return Parser<T>::parse(data); }
|
||||
|
||||
static T parse(const void* data, s32 advanceNum) {
|
||||
return Parser<T>::parse(advance(data, advanceNum));
|
||||
}
|
||||
|
||||
static const void* advance(const void* data, s32 advanceNum) {
|
||||
return (char*)data + (advanceNum * sizeof(T));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace binary
|
||||
} // namespace JGadget
|
||||
|
||||
|
||||
@@ -22,7 +22,15 @@ struct TNodeLinkList {
|
||||
TLinkListNode* node;
|
||||
};
|
||||
|
||||
struct const_iterator {
|
||||
const_iterator(TLinkListNode* pNode) { node = pNode; }
|
||||
const_iterator(const const_iterator& iter) { *this = iter; }
|
||||
|
||||
TLinkListNode* node;
|
||||
};
|
||||
|
||||
TNodeLinkList() : ocObject_() { Initialize_(); }
|
||||
|
||||
void Initialize_() {
|
||||
count = 0;
|
||||
ocObject_.mNext = &ocObject_;
|
||||
@@ -34,6 +42,11 @@ struct TNodeLinkList {
|
||||
return iter;
|
||||
}
|
||||
|
||||
iterator begin() {
|
||||
iterator iter(ocObject_.mNext);
|
||||
return iter;
|
||||
}
|
||||
|
||||
/* 802DCA1C */ ~TNodeLinkList();
|
||||
/* 802DCAA0 */ iterator erase(JGadget::TNodeLinkList::iterator, JGadget::TNodeLinkList::iterator);
|
||||
/* 802DCA58 */ iterator erase(JGadget::TNodeLinkList::iterator);
|
||||
@@ -73,12 +86,34 @@ struct TLinkList : public TNodeLinkList {
|
||||
return iter;
|
||||
}
|
||||
|
||||
TLinkList::iterator begin() {
|
||||
TNodeLinkList::iterator node_iter = TNodeLinkList::begin();
|
||||
TLinkList::iterator iter(node_iter);
|
||||
return iter;
|
||||
}
|
||||
|
||||
void Push_back(T* element) {
|
||||
TLinkList::iterator iter(TLinkList::end());
|
||||
this->Insert(iter, element);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, int I>
|
||||
struct TLinkList_factory : public TLinkList<T, I> {
|
||||
virtual ~TLinkList_factory() {}
|
||||
virtual T* Do_create() = 0;
|
||||
virtual void Do_destroy(T*) = 0;
|
||||
};
|
||||
|
||||
template <typename T, int I>
|
||||
struct TEnumerator {
|
||||
TLinkList<T, I> field_0x0;
|
||||
TLinkList<T, I> field_0x4;
|
||||
};
|
||||
|
||||
template <typename T, int I>
|
||||
struct TContainerEnumerator_const : public TEnumerator<T, I> {};
|
||||
|
||||
}; // namespace JGadget
|
||||
|
||||
#endif /* LINKLIST_H */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef JMESSAGE_CONTROL_H
|
||||
#define JMESSAGE_CONTROL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JMessage/processor.h"
|
||||
#include "JSystem/JMessage/resource.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JMessage {
|
||||
struct TControl {
|
||||
@@ -11,21 +11,45 @@ struct TControl {
|
||||
/* 802A758C */ virtual ~TControl();
|
||||
|
||||
/* 802A75D4 */ void reset();
|
||||
/* 802A7634 */ void update();
|
||||
/* 802A7634 */ int update();
|
||||
/* 802A76BC */ void render();
|
||||
/* 802A77E8 */ void setMessageCode(u16, u16);
|
||||
/* 802A78F4 */ void setMessageID(u32, u32, bool*);
|
||||
/* 802A7A20 */ void setMessageCode_inSequence_(JMessage::TProcessor const*, u16, u16);
|
||||
/* 802A77E8 */ int setMessageCode(u16, u16);
|
||||
/* 802A78F4 */ int setMessageID(u32, u32, bool*);
|
||||
/* 802A7A20 */ bool setMessageCode_inSequence_(JMessage::TProcessor const*, u16, u16);
|
||||
|
||||
bool isReady_update_() const { return pMessageText_begin_ != 0 && pSequenceProcessor_ != NULL; }
|
||||
bool isReady_render_() const { return field_0x20 != 0 && pRenderingProcessor_ != NULL; }
|
||||
|
||||
TProcessor* getProcessor() const {
|
||||
return pSequenceProcessor_ != NULL ? (TProcessor*)pSequenceProcessor_ :
|
||||
(TProcessor*)pRenderingProcessor_;
|
||||
}
|
||||
|
||||
int setMessageCode_inReset_(TProcessor* pProcessor, u16 param_1, u16 param_2) {
|
||||
if (!setMessageCode_inSequence_(pProcessor, param_1, param_2)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (isReady_update_()) {
|
||||
pSequenceProcessor_->setBegin_messageEntryText(pResourceCache_, pEntry_,
|
||||
pMessageText_begin_);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char* getMessageText_begin() const { return pMessageText_begin_; }
|
||||
void* getMessageEntry() const { return pEntry_; }
|
||||
|
||||
/* 0x04 */ TSequenceProcessor* pSequenceProcessor_;
|
||||
/* 0x08 */ TRenderingProcessor* pRenderingProcessor_;
|
||||
/* 0x0C */ u16 messageCode_;
|
||||
/* 0x0E */ u16 field_0xe;
|
||||
/* 0x10 */ TResource* pResourceCache_;
|
||||
/* 0x10 */ const TResource* pResourceCache_;
|
||||
/* 0x14 */ void* pEntry_;
|
||||
/* 0x18 */ u32 pMessageText_begin_;
|
||||
/* 0x1C */ char* pszText_update_current_;
|
||||
/* 0x20 */ u32 field_0x20;
|
||||
/* 0x18 */ const char* pMessageText_begin_;
|
||||
/* 0x1C */ const char* pszText_update_current_;
|
||||
/* 0x20 */ const char* field_0x20;
|
||||
/* 0x24 */ TProcessor::TStack_ oStack_renderingProcessor_;
|
||||
};
|
||||
}; // namespace JMessage
|
||||
|
||||
@@ -1,11 +1,54 @@
|
||||
#ifndef JMESSAGE_DATA_H
|
||||
#define JMESSAGE_DATA_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JGadget/binary.h"
|
||||
|
||||
namespace JMessage {
|
||||
struct data {
|
||||
static f32 ga4cSignature[1 + 1 /* padding */];
|
||||
struct TParse_THeader : public JGadget::binary::TParseData_aligned<4> {
|
||||
TParse_THeader(const void* data) : TParseData_aligned(data) {}
|
||||
|
||||
const void* getContent() const { return (char*)getRaw() + 0x20; }
|
||||
char* get() const { return (char*)getRaw(); }
|
||||
|
||||
u32* get_signature() const { return (u32*)(get() + 0x0); }
|
||||
u32 get_type() const { return *(u32*)(get() + 0x4); }
|
||||
u32 get_blockNumber() const { return *(u32*)(get() + 0xC); }
|
||||
u8 get_encoding() const { return *(u8*)(get() + 0x10); }
|
||||
};
|
||||
|
||||
struct TParse_TBlock : public JGadget::binary::TParseData_aligned<4> {
|
||||
TParse_TBlock(const void* data) : TParseData_aligned(data) {}
|
||||
};
|
||||
|
||||
struct TParse_TBlock_info : public TParse_TBlock {
|
||||
TParse_TBlock_info(const void* data) : TParse_TBlock(data) {}
|
||||
|
||||
char* get() const { return (char*)getRaw(); }
|
||||
|
||||
char* getContent() const { return (char*)getRaw() + 0x10; }
|
||||
|
||||
u16 get_messageEntrySize() const { return *(u16*)(get() + 0xA); }
|
||||
|
||||
u16 get_messageEntryNumber() const { return *(u16*)(get() + 0x8); }
|
||||
|
||||
u16 get_groupID() const { return *(u16*)(get() + 0xC); }
|
||||
};
|
||||
|
||||
struct TParse_TBlock_messageID : public TParse_TBlock {
|
||||
TParse_TBlock_messageID(const void* data) : TParse_TBlock(data) {}
|
||||
};
|
||||
|
||||
struct TParse_TBlock_color : public TParse_TBlock {
|
||||
TParse_TBlock_color(const void* data) : TParse_TBlock(data) {}
|
||||
};
|
||||
|
||||
static u16 getTagCode(u32 tag) { return tag & 0xFFFF; }
|
||||
static u8 getTagGroup(u32 tag) { return (tag >> 0x10) & 0xFF; }
|
||||
|
||||
static u32 ga4cSignature;
|
||||
|
||||
static const int gcTagBegin = '\x1A';
|
||||
};
|
||||
}; // namespace JMessage
|
||||
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
|
||||
namespace JMessage {
|
||||
struct locale {
|
||||
/* 802A9490 */ void parseCharacter_1Byte(char const**);
|
||||
/* 802A94A8 */ void parseCharacter_2Byte(char const**);
|
||||
/* 802A9528 */ void parseCharacter_ShiftJIS(char const**);
|
||||
/* 802A958C */ void parseCharacter_UTF8(char const**);
|
||||
typedef int (*parseCharacter_function)(const char**);
|
||||
|
||||
static bool isLeadByte_ShiftJIS(int c) {
|
||||
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**);
|
||||
};
|
||||
}; // namespace JMessage
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#ifndef JMESSAGE_PROCESSOR_H
|
||||
#define JMESSAGE_PROCESSOR_H
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JMessage/resource.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "init.h"
|
||||
|
||||
namespace JMessage {
|
||||
struct TResource;
|
||||
@@ -11,23 +12,62 @@ struct TResourceContainer;
|
||||
|
||||
struct TReference {
|
||||
/* 802A7AF8 */ virtual ~TReference();
|
||||
/* 802A7B40 */ virtual bool do_word(u32) const;
|
||||
/* 802A7B40 */ virtual const char* do_word(u32) const;
|
||||
|
||||
TResourceContainer* pcResource_;
|
||||
int on_parseCharacter(const char** string) const { return pcResource_->parseCharacter(string); }
|
||||
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);
|
||||
}
|
||||
|
||||
/* 0x4 */ TResourceContainer* pcResource_;
|
||||
};
|
||||
|
||||
struct TProcessor {
|
||||
TProcessor(const TReference* reference)
|
||||
: pReference_(reference), pResourceCache_(NULL), pszCurrent_(NULL) {}
|
||||
|
||||
typedef bool (*pfnProcess_func)(TProcessor*);
|
||||
|
||||
struct TStack_ {
|
||||
/* 0x0 */ int upsz_; // size
|
||||
TStack_() { clear(); }
|
||||
|
||||
bool empty() const { return upsz_ == 0; }
|
||||
bool IsPushable() const { return size() < max_size(); }
|
||||
|
||||
void clear() { upsz_ = 0; }
|
||||
u32 max_size() const { return 4; }
|
||||
u32 size() const { return upsz_; }
|
||||
|
||||
const char* top() const { return stack[upsz_ - 1]; }
|
||||
|
||||
void push(const char* string) {
|
||||
stack[upsz_] = string;
|
||||
upsz_++;
|
||||
}
|
||||
|
||||
void pop() { upsz_--; }
|
||||
|
||||
/* 0x0 */ u32 upsz_; // stack size
|
||||
/* 0x4 */ const char* stack[4];
|
||||
}; // Size: 0x14
|
||||
|
||||
struct TProcess_ {
|
||||
/* 0x0 */ void* pfnProcess_CharacterEnd;
|
||||
TProcess_() { reset_normal(); }
|
||||
|
||||
void reset_normal() { pfnProcess_CharacterEnd = process_onCharacterEnd_normal_; }
|
||||
void reset_select() { pfnProcess_CharacterEnd = process_onCharacterEnd_select_; }
|
||||
|
||||
/* 0x0 */ pfnProcess_func pfnProcess_CharacterEnd;
|
||||
struct {
|
||||
/* 0x0 */ void* pfn;
|
||||
/* 0x4 */ u32 pcBase;
|
||||
/* 0x8 */ u32 pOffset;
|
||||
/* 0x0 */ const char* (*pfn)(TProcessor*);
|
||||
/* 0x4 */ const char* pcBase;
|
||||
/* 0x8 */ const void* pOffset;
|
||||
/* 0xC */ u32 uRest;
|
||||
}
|
||||
/* 0x4 */ rData;
|
||||
@@ -36,21 +76,21 @@ struct TProcessor {
|
||||
/* 802A7B90 */ void reset();
|
||||
/* 802A7BF8 */ void stack_pushCurrent(char const*);
|
||||
/* 802A7C30 */ void stack_popCurrent();
|
||||
/* 802A7C54 */ void getResource_groupID(u16) const;
|
||||
/* 802A7CD4 */ void toMessageCode_messageID(u32, u32, bool*) const;
|
||||
/* 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);
|
||||
/* 802A7EDC */ void on_select_end();
|
||||
/* 802A7F34 */ void on_select_separate();
|
||||
/* 802A7FE4 */ void on_tag_();
|
||||
/* 802A8090 */ void do_tag_(u32, void const*, u32);
|
||||
/* 802A81EC */ void process_character_();
|
||||
/* 802A828C */ void process_onCharacterEnd_normal_(JMessage::TProcessor*);
|
||||
/* 802A82F4 */ void process_onCharacterEnd_select_(JMessage::TProcessor*);
|
||||
/* 802A833C */ void process_onSelect_limited_(JMessage::TProcessor*);
|
||||
/* 802A8358 */ void process_onSelect_(JMessage::TProcessor*);
|
||||
/* 802A8C24 */ void on_message(u32) const;
|
||||
/* 802A8C44 */ void getMessageText_messageCode(u32) const;
|
||||
/* 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) const;
|
||||
/* 802A8C44 */ const char* getMessageText_messageCode(u32) const;
|
||||
|
||||
/* 802A7B48 */ virtual ~TProcessor();
|
||||
/* 802A7FC0 */ virtual void do_reset();
|
||||
@@ -63,9 +103,97 @@ struct TProcessor {
|
||||
/* 802A7FE0 */ virtual void do_select_separate();
|
||||
/* 802A8084 */ virtual void do_resetStatus_(char const*);
|
||||
/* 802A8088 */ virtual bool do_setBegin_isReady_() const;
|
||||
virtual void do_begin_(void const*, char const*) = 0;
|
||||
virtual void do_end_() = 0;
|
||||
virtual void do_tag_(u32, void const*, u32) = 0;
|
||||
|
||||
/* 0x04 */ TReference* pReference_;
|
||||
/* 0x08 */ TResource* pResourceCache_;
|
||||
void on_resetStatus_(const char* param_0) {
|
||||
pszCurrent_ = param_0;
|
||||
oStack_.clear();
|
||||
oProcess_.reset_normal();
|
||||
do_resetStatus_(param_0);
|
||||
}
|
||||
|
||||
void on_begin(const void* entry, const char* param_1) {
|
||||
do_begin_(entry, param_1);
|
||||
do_begin(entry, param_1);
|
||||
}
|
||||
|
||||
void on_end() {
|
||||
do_end_();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
void on_character(int character) { do_character(character); }
|
||||
|
||||
const char* on_message_limited(u16 messageIndex) const {
|
||||
return pResourceCache_->getMessageText_messageIndex(messageIndex);
|
||||
}
|
||||
|
||||
int setBegin_messageEntryText(const TResource* resource, const void* entry,
|
||||
const char* param_2) {
|
||||
pResourceCache_ = resource;
|
||||
on_resetStatus_(param_2);
|
||||
on_begin(entry, param_2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void* getMessageEntry_messageCode(u16 messageCode, u16 messageIndex) const {
|
||||
const TResource* pResource = getResource_groupID(messageCode);
|
||||
|
||||
if (pResource == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pResource->getMessageEntry_messageIndex(messageIndex);
|
||||
}
|
||||
|
||||
const char* getMessageText_messageCode(u16 messageCode, u16 messageIndex) const {
|
||||
void* pEntry = getMessageEntry_messageCode(messageCode, messageIndex);
|
||||
|
||||
if (pEntry == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pResourceCache_->getMessageText_messageEntry(pEntry);
|
||||
}
|
||||
|
||||
void stack_pushCurrent_(const char* string) {
|
||||
oStack_.push(getCurrent());
|
||||
pszCurrent_ = string;
|
||||
}
|
||||
|
||||
void stack_popCurrent_() {
|
||||
pszCurrent_ = oStack_.top();
|
||||
oStack_.pop();
|
||||
}
|
||||
|
||||
bool stack_isPushable() const { return oStack_.IsPushable(); }
|
||||
|
||||
const TResource* getResourceCache() const { return pResourceCache_; }
|
||||
const char* getCurrent() const { return pszCurrent_; }
|
||||
|
||||
const TResource* getResource_groupID_uncached(u16 groupID) const {
|
||||
return pReference_->getResource_groupID(groupID);
|
||||
}
|
||||
|
||||
bool isResourceCache_groupID(u16 groupID) const {
|
||||
return pResourceCache_ != NULL && groupID == pResourceCache_->getGroupID();
|
||||
}
|
||||
|
||||
/* 0x04 */ const TReference* pReference_;
|
||||
/* 0x08 */ const TResource* pResourceCache_;
|
||||
/* 0x0C */ const char* pszCurrent_;
|
||||
/* 0x10 */ TStack_ oStack_;
|
||||
/* 0x24 */ TProcess_ oProcess_;
|
||||
@@ -74,33 +202,59 @@ struct TProcessor {
|
||||
struct TControl;
|
||||
|
||||
struct TSequenceProcessor : public TProcessor {
|
||||
typedef const void* (*branchPfn)(const TSequenceProcessor*, u32);
|
||||
typedef const void* (*jumpPfn)(const TSequenceProcessor*);
|
||||
|
||||
struct TProcess_ {
|
||||
TProcess_() { reset(); }
|
||||
|
||||
void reset() {}
|
||||
|
||||
union {
|
||||
struct {
|
||||
/* 0x0 */ branchPfn branchFn;
|
||||
/* 0x4 */ const void* pTarget;
|
||||
/* 0x8 */ u32 uTarget;
|
||||
} branch_process;
|
||||
struct {
|
||||
/* 0x0 */ jumpPfn jumpFn;
|
||||
/* 0x4 */ u32 u32Target;
|
||||
} jump_process;
|
||||
}
|
||||
/* 0x0 */ process;
|
||||
};
|
||||
|
||||
enum SeqStatus {
|
||||
STATUS_NORMAL = 2,
|
||||
STATUS_READY,
|
||||
STATUS_ONE,
|
||||
STATUS_NORMAL,
|
||||
STATUS_JUMP,
|
||||
STATUS_BRANCH,
|
||||
};
|
||||
|
||||
/* 802A8374 */ TSequenceProcessor(JMessage::TReference const*, JMessage::TControl*);
|
||||
/* 802A8418 */ void process(char const*);
|
||||
/* 802A85A4 */ void on_isReady();
|
||||
/* 802A8418 */ const char* process(char const*);
|
||||
/* 802A85A4 */ bool on_isReady();
|
||||
/* 802A85D0 */ void on_jump_register(void const* (*)(JMessage::TSequenceProcessor const*), u32);
|
||||
/* 802A85E4 */ void on_jump_isReady();
|
||||
/* 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);
|
||||
/* 802A86D4 */ void on_branch_queryResult();
|
||||
/* 802A86D4 */ u32 on_branch_queryResult();
|
||||
/* 802A8700 */ void on_branch(void const*, char const*);
|
||||
/* 802A892C */ void process_setMessageIndex_reserved_(u16);
|
||||
/* 802A8944 */ void process_setMessageCode_(JMessage::TSequenceProcessor const*, u16, u16);
|
||||
/* 802A89B8 */ void process_onJump_limited_(JMessage::TSequenceProcessor const*);
|
||||
/* 802A89EC */ void process_onJump_(JMessage::TSequenceProcessor const*);
|
||||
/* 802A8A18 */ void process_onBranch_limited_(JMessage::TSequenceProcessor const*, u32);
|
||||
/* 802A8A50 */ void process_onBranch_(JMessage::TSequenceProcessor const*, u32);
|
||||
/* 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);
|
||||
|
||||
/* 802A83B8 */ virtual ~TSequenceProcessor();
|
||||
/* 802A87A4 */ virtual void do_resetStatus_(char const*);
|
||||
/* 802A87C0 */ virtual void do_setBegin_isReady_() const;
|
||||
/* 802A87C0 */ virtual bool do_setBegin_isReady_() const;
|
||||
/* 802A87D0 */ virtual void do_begin_(void const*, char const*);
|
||||
/* 802A87D4 */ virtual void do_end_();
|
||||
/* 802A87E0 */ virtual void do_tag_(u32, void const*, u32);
|
||||
@@ -111,6 +265,16 @@ struct TSequenceProcessor : public TProcessor {
|
||||
/* 802A8798 */ virtual s32 do_branch_queryResult();
|
||||
/* 802A87A0 */ virtual void do_branch(void const*, char const*);
|
||||
|
||||
TControl* getControl() const { return pControl_; }
|
||||
|
||||
static const void* process_setMessageIndex_(const TSequenceProcessor* pProcessor, u16 param_1) {
|
||||
return process_setMessageCode_(pProcessor, pProcessor->getResourceCache()->getGroupID(), param_1);
|
||||
}
|
||||
|
||||
static const void* process_setMessageCode_(const TSequenceProcessor* pProcessor, u32 param_1) {
|
||||
return process_setMessageCode_(pProcessor, param_1 >> 0x10, param_1 & 0xFFFF);
|
||||
}
|
||||
|
||||
/* 0x38 */ TControl* pControl_;
|
||||
/* 0x3C */ SeqStatus eStatus_;
|
||||
/* 0x40 */ TProcess_ oProcess2_;
|
||||
@@ -118,7 +282,7 @@ struct TSequenceProcessor : public TProcessor {
|
||||
|
||||
struct TRenderingProcessor : public TProcessor {
|
||||
/* 802A8A84 */ TRenderingProcessor(JMessage::TReference const*);
|
||||
/* 802A8B20 */ void process(char const*);
|
||||
/* 802A8B20 */ int process(char const*);
|
||||
|
||||
/* 802A8AC0 */ virtual ~TRenderingProcessor();
|
||||
/* 802A8BA4 */ virtual void do_begin_(void const*, char const*);
|
||||
@@ -159,9 +323,7 @@ struct jmessage_tReference : public JMessage::TReference {
|
||||
/* 802299AC */ void decideOutFontRupeeColor(int);
|
||||
/* 80232A20 */ void getActorPos();
|
||||
|
||||
/* 80238C78 */ void setActorPos(cXyz pos) {
|
||||
mActorPos = pos;
|
||||
}
|
||||
/* 80238C78 */ void setActorPos(cXyz pos) { mActorPos = pos; }
|
||||
|
||||
/* 80228CB4 */ virtual ~jmessage_tReference();
|
||||
|
||||
@@ -263,8 +425,8 @@ struct jmessage_tSequenceProcessor : public JMessage::TSequenceProcessor {
|
||||
/* 8022B658 */ virtual void do_begin(void const*, char const*);
|
||||
/* 8022BA3C */ virtual void do_end();
|
||||
/* 8022BFE0 */ virtual void do_character(int);
|
||||
/* 8022C1A0 */ virtual void do_tag(u32, void const*, u32);
|
||||
/* 8022BB7C */ virtual void do_isReady();
|
||||
/* 8022C1A0 */ virtual bool do_tag(u32, void const*, u32);
|
||||
/* 8022BB7C */ virtual bool do_isReady();
|
||||
/* 8022C8FC */ virtual bool do_jump_isReady();
|
||||
/* 8022CBE4 */ virtual void do_jump(void const*, char const*);
|
||||
};
|
||||
|
||||
@@ -1,36 +1,105 @@
|
||||
#ifndef JMESSAGE_RESOURCE_H
|
||||
#define JMESSAGE_RESOURCE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JMessage/data.h"
|
||||
#include "JSystem/JMessage/locale.h"
|
||||
#include "JSystem/JStudio/JStudio/fvb-data.h"
|
||||
|
||||
namespace JMessage {
|
||||
struct TResource : public JGadget::TLinkListNode {
|
||||
TResource()
|
||||
: field_0x8(NULL), field_0xc(NULL), field_0x10(NULL), field_0x14(0), field_0x18(NULL) {}
|
||||
|
||||
/* 802A8CDC */ void toMessageIndex_messageID(u32, u32, bool*) const;
|
||||
|
||||
bool isContained_messageIndex(u16 messageIndex) const {
|
||||
return messageIndex < getMessageEntryNumber();
|
||||
}
|
||||
|
||||
u16 getMessageEntrySize() const { return field_0xc.get_messageEntrySize(); }
|
||||
u16 getMessageEntryNumber() const { return field_0xc.get_messageEntryNumber(); }
|
||||
|
||||
u16 getGroupID() const { return field_0xc.get_groupID(); }
|
||||
|
||||
void* getMessageEntry_messageIndex(u16 messageIndex) const {
|
||||
if (!isContained_messageIndex(messageIndex)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return field_0xc.getContent() + (messageIndex * getMessageEntrySize());
|
||||
}
|
||||
|
||||
char* getMessageText_messageEntry(const void* pEntry) const {
|
||||
return field_0x10 + *(int*)pEntry;
|
||||
}
|
||||
|
||||
const char* getMessageText_messageIndex(u16 messageIndex) const {
|
||||
void* pEntry = getMessageEntry_messageIndex(messageIndex);
|
||||
if (pEntry == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return getMessageText_messageEntry(pEntry);
|
||||
}
|
||||
|
||||
void setData_header(const void* pData) {
|
||||
field_0x8.setRaw(pData);
|
||||
}
|
||||
|
||||
/* 0x08 */ data::TParse_THeader field_0x8;
|
||||
/* 0x0C */ data::TParse_TBlock_info field_0xc;
|
||||
/* 0x10 */ char* field_0x10;
|
||||
/* 0x14 */ int field_0x14;
|
||||
/* 0x18 */ data::TParse_TBlock_messageID field_0x18;
|
||||
};
|
||||
|
||||
struct TResource_color {
|
||||
TResource_color() : field_0x0(NULL), field_0x4(NULL) {}
|
||||
|
||||
/* 0x0 */ data::TParse_THeader field_0x0;
|
||||
/* 0x4 */ data::TParse_TBlock_color field_0x4;
|
||||
}; // Size: 0x8
|
||||
|
||||
struct TResourceContainer {
|
||||
struct TCResource {
|
||||
struct TCResource : public JGadget::TLinkList_factory<TResource, 0> {
|
||||
/* 802A8EC0 */ TCResource();
|
||||
/* 802A8EF8 */ ~TCResource();
|
||||
/* 802A8F6C */ void Get_groupID(u16);
|
||||
/* 802A8FFC */ void Do_create();
|
||||
/* 802A9048 */ void Do_destroy(JMessage::TResource*);
|
||||
/* 802A8F6C */ TResource* Get_groupID(u16);
|
||||
|
||||
/* 802A8EF8 */ virtual ~TCResource();
|
||||
/* 802A8FFC */ virtual JMessage::TResource* Do_create();
|
||||
/* 802A9048 */ virtual void Do_destroy(JMessage::TResource*);
|
||||
|
||||
// u8 field_0x0[0x10];
|
||||
};
|
||||
|
||||
/* 802A906C */ TResourceContainer();
|
||||
/* 802A90B8 */ void setEncoding(u8);
|
||||
/* 802A90F0 */ void setEncoding_(u8);
|
||||
|
||||
static void* sapfnParseCharacter_[5];
|
||||
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); }
|
||||
|
||||
bool isEncodingSettable(u8 e) const { return mEncodingType == e || e == 0; }
|
||||
|
||||
static JMessage::locale::parseCharacter_function sapfnParseCharacter_[5];
|
||||
|
||||
/* 0x00 */ u8 mEncodingType;
|
||||
/* 0x04 */ int (*pfnParseCharacter_)(const char** string) const;
|
||||
/* 0x08 */ TCResource resContainer_;
|
||||
/* 0x18 */ TResource_color resColor_;
|
||||
};
|
||||
|
||||
struct TParse {
|
||||
struct TParse : public JGadget::binary::TParse_header_block {
|
||||
/* 802A9130 */ TParse(JMessage::TResourceContainer*);
|
||||
/* 802A9158 */ ~TParse();
|
||||
/* 802A91B8 */ void parseHeader_next(void const**, u32*, u32);
|
||||
/* 802A92F4 */ void parseBlock_next(void const**, u32*, u32);
|
||||
|
||||
/* 802A9158 */ virtual ~TParse();
|
||||
/* 802A91B8 */ virtual bool parseHeader_next(void const**, u32*, u32);
|
||||
/* 802A92F4 */ virtual bool parseBlock_next(void const**, u32*, u32);
|
||||
|
||||
/* 0x4 */ TResourceContainer* pContainer_;
|
||||
/* 0x8 */ TResource* pResource_;
|
||||
};
|
||||
}; // namespace JMessage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user