1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 14:20:11 +00:00

Decompile z_kanfont (#443)

* Decompile z_kanfont.c

* Cleanups

* off -> offset

* Kanfont -> Font , Keep so-far unused Font fields as padding, Remove MessageData sub-struct
This commit is contained in:
Tharo 2020-10-12 22:42:17 +01:00 committed by GitHub
parent ed719f3da0
commit fff616d2be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 109 additions and 228 deletions

View file

@ -98,7 +98,7 @@ void EnMag_Init(Actor* thisx, GlobalContext* globalCtx) {
gSaveContext.unk_1419 = 255;
}
func_8006EF10(&this->unk_150);
Font_LoadOrderedFont(&this->font);
this->unk_E316 = 0;
this->unk_E318 = 0;
@ -394,7 +394,7 @@ void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
0x06020000, 0x06020800, 0x06021000, 0x06021800, 0x06022000, 0x06022800, 0x06023000, 0x06023800, 0x06024000,
};
EnMag* this = THIS;
u8* buf = this->unk_150;
Font* font = &this->font;
s32 pad;
Gfx* gfx = *gfxp;
u16 i, j, k;
@ -496,7 +496,8 @@ void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
rectLeft = VREG(19) + 1;
for (i = 0; i < ARRAY_COUNT(noControllerFontIndexes); i++) {
EnMag_DrawCharTexture(&gfx, buf + 0x3C88 + (noControllerFontIndexes[i] * 0x80), rectLeft, YREG(10) + 172);
EnMag_DrawCharTexture(&gfx, font->fontBuf + noControllerFontIndexes[i] * FONT_CHAR_TEX_SIZE, rectLeft,
YREG(10) + 172);
rectLeft += VREG(21);
if (i == 1) {
rectLeft += VREG(23);
@ -509,7 +510,8 @@ void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
rectLeft = VREG(19);
for (i = 0; i < ARRAY_COUNT(noControllerFontIndexes); i++) {
EnMag_DrawCharTexture(&gfx, buf + 0x3C88 + (noControllerFontIndexes[i] * 0x80), rectLeft, YREG(10) + 171);
EnMag_DrawCharTexture(&gfx, font->fontBuf + noControllerFontIndexes[i] * FONT_CHAR_TEX_SIZE, rectLeft,
YREG(10) + 171);
rectLeft += VREG(21);
if (i == 1) {
rectLeft += VREG(23);
@ -530,7 +532,8 @@ void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
rectLeft = YREG(7) + 1;
for (i = 0; i < ARRAY_COUNT(pressStartFontIndexes); i++) {
EnMag_DrawCharTexture(&gfx, buf + 0x3C88 + (pressStartFontIndexes[i] * 0x80), rectLeft, YREG(10) + 172);
EnMag_DrawCharTexture(&gfx, font->fontBuf + pressStartFontIndexes[i] * FONT_CHAR_TEX_SIZE, rectLeft,
YREG(10) + 172);
rectLeft += YREG(8);
if (i == 4) {
rectLeft += YREG(9);
@ -543,7 +546,8 @@ void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
rectLeft = YREG(7);
for (i = 0; i < ARRAY_COUNT(pressStartFontIndexes); i++) {
EnMag_DrawCharTexture(&gfx, buf + 0x3C88 + (pressStartFontIndexes[i] * 0x80), rectLeft, YREG(10) + 171);
EnMag_DrawCharTexture(&gfx, font->fontBuf + pressStartFontIndexes[i] * FONT_CHAR_TEX_SIZE, rectLeft,
YREG(10) + 171);
rectLeft += YREG(8);
if (i == 4) {
rectLeft += YREG(9);

View file

@ -9,7 +9,7 @@ struct EnMag;
typedef struct EnMag {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x0004];
/* 0x0150 */ u8 unk_150[0xE188]; // kanfont struct/buffer
/* 0x0150 */ Font font;
/* 0xE2D8 */ s16 effectFadeInState;
/* 0xE2DA */ s16 effectFadeInTimer;
/* 0xE2DC */ s16 globalState;