From 5aa5edd0c69fe40a80e2eaefb596ec21ce125a89 Mon Sep 17 00:00:00 2001 From: Cuyler36 Date: Tue, 17 Jun 2025 11:09:46 -0400 Subject: [PATCH] emu64: more improvements --- include/libforest/gbi_extensions.h | 8 ++++++++ src/static/libforest/emu64/emu64.c | 6 +++--- src/static/libforest/emu64/emu64_print.cpp | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/libforest/gbi_extensions.h b/include/libforest/gbi_extensions.h index 1368456d..3fef00af 100644 --- a/include/libforest/gbi_extensions.h +++ b/include/libforest/gbi_extensions.h @@ -594,6 +594,14 @@ typedef struct Gspecial1 { unsigned int param1; } Gspecial1; +typedef struct { + int cmd:8; + int pad0:8; + u32 sft:8; + u32 len:8; + unsigned int data:32; +} Gsetothermode_dolphin; + typedef struct { unsigned char col[3]; unsigned char kc; diff --git a/src/static/libforest/emu64/emu64.c b/src/static/libforest/emu64/emu64.c index 1408b18e..a3424272 100644 --- a/src/static/libforest/emu64/emu64.c +++ b/src/static/libforest/emu64/emu64.c @@ -3663,7 +3663,7 @@ static const OthermodeParameterInfo h_tbl[] = { }; void emu64::dl_G_SETOTHERMODE_H() { - GsetothermodeH* othermodeH = &this->gfx.setothermodeH; + Gsetothermode_dolphin* othermodeH = (Gsetothermode_dolphin*)&this->gfx.setothermodeH; u32 sft; u32 len; u32 data; @@ -3729,8 +3729,8 @@ void emu64::dl_G_SETOTHERMODE_L() { u32 len; u32 data; - len = this->gfx.setothermodeL.len + 1; - sft = (32 - this->gfx.setothermodeL.sft) - len; + len = ((Gsetothermode_dolphin*)&this->gfx)->len + 1; + sft = (32 - ((Gsetothermode_dolphin*)&this->gfx)->sft) - len; data = this->gfx.setothermodeL.data; if ((this->print_commands & EMU64_PRINTF2_FLAG) != 0) { diff --git a/src/static/libforest/emu64/emu64_print.cpp b/src/static/libforest/emu64/emu64_print.cpp index a434e7f9..9260410f 100644 --- a/src/static/libforest/emu64/emu64_print.cpp +++ b/src/static/libforest/emu64/emu64_print.cpp @@ -259,6 +259,7 @@ const char* emu64::combine_tev_color_name(u32 color_param) { break; #endif } + return ret; } const char* emu64::combine_tev_alpha_name(u32 alpha_param) {