work on daalink, fop actor, mDo machine, msg_scrn, + various (#201)

* work on fop actor / actor mng, daalink, d_a_obj_item

* d_a_title mostly decompiled

* daalink / d_event / JMessage / dmsg_out_font work

* msg_scrn_base / msg_scrn_boss

* some work on mDo machine, d_menu_save, d_tresure, and various

* remove asm

* progress
This commit is contained in:
TakaRikka
2022-06-29 13:19:09 -07:00
committed by GitHub
parent cd5b02450c
commit 046d178003
412 changed files with 12030 additions and 16833 deletions
+73
View File
@@ -2,5 +2,78 @@
#define JUTCACHEFONT_H
#include "dolphin/types.h"
#include "JSystem/JUtility/JUTResFont.h"
#include "JSystem/JKernel/JKRAram.h"
class JUTCacheFont : public JUTResFont {
public:
struct TGlyphCacheInfo {
/* 0x0 */ TGlyphCacheInfo* field_0x0;
/* 0x4 */ TGlyphCacheInfo** field_0x4;
};
struct TCachePage {
/* 0x00 */ u8 field_0x0[8];
/* 0x08 */ s16 field_0x8;
/* 0x0A */ u16 field_0xa;
/* 0x0C */ u8 field_0xc[4];
/* 0x10 */ u8* field_0x10;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 field_0x16;
/* 0x18 */ u16 field_0x18;
/* 0x1A */ u16 field_0x1a;
/* 0x1C */ u16 field_0x1c;
/* 0x1E */ u16 field_0x1e;
}; // Size: 0x20
enum EPagingType {
PAGE_TYPE_0,
PAGE_TYPE_1,
};
/* 802DD188 */ JUTCacheFont(ResFONT const*, u32, JKRHeap*);
/* 802DD29C */ void deleteMemBlocks_CacheFont();
/* 802DD320 */ void initialize_state();
/* 802DD35C */ int getMemorySize(ResFONT const*, u16*, u32*, u16*, u32*, u16*, u32*, u32*);
/* 802DD4EC */ int initiate(ResFONT const*, void*, u32, JKRHeap*);
/* 802DD54C */ bool internal_initiate(ResFONT const*, void*, u32, JKRHeap*);
/* 802DD650 */ bool allocArea(void*, u32, JKRHeap*);
/* 802DD804 */ bool allocArray(JKRHeap*);
/* 802DDB0C */ void determineBlankPage();
/* 802DDBBC */ void getGlyphFromAram(JUTCacheFont::TGlyphCacheInfo*, JUTCacheFont::TCachePage*,
int*, int*);
/* 802DDD98 */ void loadCache_char_subroutine(int*, bool);
/* 802DDEE0 */ void invalidiateAllCache();
/* 802DDF68 */ void unlink(JUTCacheFont::TGlyphCacheInfo*);
/* 802DDFAC */ void prepend(JUTCacheFont::TGlyphCacheInfo*);
/* 802DD208 */ virtual ~JUTCacheFont();
/* 802DDCE4 */ virtual void loadImage(int, _GXTexMapID);
/* 802DD8EC */ virtual void setBlock();
void setPagingType(EPagingType type) { mPagingType = type; }
static u32 calcCacheSize(u32 param_0, int param_1) { return (ALIGN_NEXT(param_0, 0x20) + 0x40) * param_1; }
private:
/* 0x70 */ u32 mTotalWidSize;
/* 0x74 */ u32 mTotalGlySize;
/* 0x78 */ u32 mTotalMapSize;
/* 0x7C */ void* field_0x7c;
/* 0x80 */ void* field_0x80;
/* 0x84 */ void* field_0x84;
/* 0x88 */ u32 mMaxSheetSize;
/* 0x8C */ EPagingType mPagingType;
/* 0x90 */ void** mCacheBuffer;
/* 0x94 */ int field_0x94;
/* 0x98 */ u32 mCachePage;
/* 0x9C */ TGlyphCacheInfo* field_0x9c;
/* 0xA0 */ TGlyphCacheInfo* field_0xa0;
/* 0xA4 */ void* field_0xa4;
/* 0xA8 */ u32 field_0xa8;
/* 0xAC */ JKRAramBlock* field_0xac;
/* 0xB0 */ u8 field_0xb0;
/* 0xB4 */ int field_0xb4;
}; // Size: 0xB8
#endif /* JUTCACHEFONT_H */
+20 -7
View File
@@ -11,7 +11,9 @@
class JUTConsole : public JKRDisposer {
public:
enum EConsoleType {
UNK_TYPE2 = 2,
CONSOLE_TYPE_0 = 0,
CONSOLE_TYPE_1 = 1,
CONSOLE_TYPE_2 = 2,
};
enum OutputFlag {
@@ -47,8 +49,8 @@ public:
}
void setHeight(u32 height) {
mHeight = height;
if (mHeight > field_0x24) {
mHeight = field_0x24;
if (mHeight > mMaxLines) {
mHeight = mMaxLines;
}
}
@@ -72,18 +74,27 @@ public:
if (diff >= 0) {
return diff;
}
return diff += field_0x24;
return diff += mMaxLines;
}
void scrollToLastLine() { scroll(field_0x24); }
void scrollToFirstLine() { scroll(-field_0x24); }
int nextIndex(int param_0) const {
int index = param_0 + 1;
if (mMaxLines <= index) {
index = 0;
}
return index;
}
void scrollToLastLine() { scroll(mMaxLines); }
void scrollToFirstLine() { scroll(-mMaxLines); }
private:
/* 0x18 */ JGadget::TLinkListNode mListNode;
private:
/* 0x20 */ u32 field_0x20;
/* 0x24 */ u32 field_0x24;
/* 0x24 */ u32 mMaxLines;
/* 0x28 */ u8* mBuf;
/* 0x2C */ bool field_0x2c;
/* 0x30 */ int field_0x30;
@@ -116,6 +127,8 @@ public:
/* 802E8450 */ void drawDirect(bool) const;
/* 802E84C4 */ void setDirectConsole(JUTConsole*);
JUTConsole* getDirectConsole() const { return mDirectConsole; }
static JUTConsoleManager* getManager() { return sManager; }
static JUTConsoleManager* sManager;
+1
View File
@@ -88,6 +88,7 @@ public:
/* 802E3980 */ static void waitTime(s32);
static JUTException* getManager() { return sErrorManager; }
static JUTConsole* getConsole() { return sConsole; }
JUTExternalFB* getFrameMemory() const { return mFrameMemory; }
+1 -1
View File
@@ -24,7 +24,7 @@ public:
s32 getStatus() const { return mStatus; }
void setColor(JUtility::TColor color) { mColor.set(color); }
private:
//private:
/* 0x04 */ s32 mStatus;
/* 0x08 */ u16 field_0x8;
/* 0x0A */ u16 field_0xa;
+20 -6
View File
@@ -74,7 +74,7 @@ public:
/* 0x24 */ virtual s32 getHeight() const = 0;
/* 0x28 */ virtual s32 getWidth() const = 0;
/* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const;
/* 0x30 */ virtual u16 getCellWidth() const;
/* 0x30 */ virtual int getCellWidth() const;
/* 0x34 */ virtual u16 getCellHeight() const;
/* 0x38 */ virtual u16 getFontType() const = 0;
/* 0x3C */ virtual ResFONT* getResFont() const = 0;
@@ -87,16 +87,30 @@ public:
void initialize_state();
void setCharColor(JUtility::TColor col1);
void setGradColor(JUtility::TColor col1, JUtility::TColor col2);
f32 drawString_size_scale(f32 a1, f32 a2, f32 a3, f32 a4, const char* a5, u32 usz, bool a7);
f32 drawString_size_scale(f32 posX, f32 posY, f32 width, f32 height, const char* str, u32 usz,
bool visible);
void drawString(int param_0, int param_1, const char* str, bool param_3) {
drawString_size(param_0, param_1, str, strlen(str), param_3);
void drawString(int posX, int posY, const char* str, bool visible) {
drawString_size(posX, posY, str, strlen(str), visible);
}
void drawString_size(int param_0, int param_1, const char* str, u32 len, bool param_4) {
drawString_size_scale(param_0, param_1, getWidth(), getHeight(), str, len, param_4);
void drawString_size(int posX, int posY, const char* str, u32 len, bool visible) {
drawString_size_scale(posX, posY, getWidth(), getHeight(), str, len, visible);
}
void drawString_scale(f32 posX, f32 posY, f32 width, f32 height, const char* str,
bool visible) {
drawString_size_scale(posX, posY, width, height, str, strlen(str), visible);
}
int getWidth(int i_no) const {
TWidth width;
getWidthEntry(i_no, &width);
return width.field_0x1;
}
bool isValid() const { return mValid; }
/* 0x04 */ bool mValid;
/* 0x05 */ bool mFixed;
/* 0x08 */ int mFixedWidth;
+1 -1
View File
@@ -17,7 +17,7 @@ public:
/* 802DE01C */ virtual s32 getHeight() const;
/* 802DDFF8 */ virtual s32 getWidth() const;
/* 802DFC64 */ virtual void getWidthEntry(int, JUTFont::TWidth*) const;
/* 802DFD0C */ virtual u16 getCellWidth() const;
/* 802DFD0C */ virtual int getCellWidth() const;
/* 802DFD58 */ virtual u16 getCellHeight() const;
/* 802DDFE0 */ virtual u16 getFontType() const;
/* 802DDFD8 */ virtual ResFONT* getResFont() const;
+1
View File
@@ -9,6 +9,7 @@ struct TColor : public GXColor {
TColor(u8 r, u8 g, u8 b, u8 a) { set(r, g, b, a); }
TColor() { set(0xffffffff); }
TColor(u32 u32Color) { set(u32Color); }
TColor(GXColor color) { set(color); }
// TColor(const TColor& other) { set(other.toUInt32()); }
TColor& operator=(const TColor& other) {