mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-09 02:15:44 -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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user