From bda5f784333e8fc08e8e113fbf33513fcf64764b Mon Sep 17 00:00:00 2001 From: LMFinish Date: Wed, 7 May 2025 22:59:14 -0300 Subject: [PATCH 1/2] Some hx_wiper --- include/GC2D/hx_wiper.h | 29 +++++++++++ src/GC2D/hx_wiper.c | 112 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 include/GC2D/hx_wiper.h diff --git a/include/GC2D/hx_wiper.h b/include/GC2D/hx_wiper.h new file mode 100644 index 00000000..ee726d9c --- /dev/null +++ b/include/GC2D/hx_wiper.h @@ -0,0 +1,29 @@ +typedef struct { + + unsigned int _0x0; + unsigned int _0x4; + int _0x8; + int _0xC; + unsigned char _0x10; + unsigned char _0x11; + short _0x12; + int _0x14; + int _0x18; + int _0x1C; + int _0x20; + int _0x24; + int _0x28; + int _0x2C; + int _0x30; + int _0x34; + unsigned int _0x38; + unsigned int Timer; + +} hx_wiper; + +hx_wiper hx; + +unsigned int handle_type; + +int hxs_logo_resetflag; +int hxs_logodraw_resetflag; \ No newline at end of file diff --git a/src/GC2D/hx_wiper.c b/src/GC2D/hx_wiper.c index e69de29b..7c80814c 100644 --- a/src/GC2D/hx_wiper.c +++ b/src/GC2D/hx_wiper.c @@ -0,0 +1,112 @@ +#include +#include + +int Hx_MovieStartSyncEx() { + + if (hx._0x11 != 0xC) return 0; + if (hx._0x38 >= 2 && hx._0x38 <= 5) { + + if (hxs_logodraw_resetflag == 0) return 0; + else { + + hxs_logodraw_resetflag = 0; + return 1; + } + + } else if (hx._0x38 >= 6) { + + if (hxs_logo_resetflag == 0) return 0; + else { + + if (hx._0x38 == 6 && hx.Timer > 192) return 0; + else { + + hxs_logo_resetflag = 0; + return 2; + } + } + + } else return 0; +} + +float Hx_MotionUpdate(Mtx Matrix) { + + if (Matrix[0][0] > Matrix[1][3]) Matrix[1][2] += Matrix[0][3]; + else if (Matrix[0][1] <= Matrix[1][3]) Matrix[1][2] += Matrix[1][1]; + + Matrix[1][3] += 1.0f; + Matrix[2][0] += Matrix[1][2]; + return Matrix[2][0]; +} + +void Hx_MotionSet(float Param_1, float Param_2, float Param_3, float Param_4, Mtx Matrix) { + + float Param_5 = Param_2 + Param_3; + + Matrix[0][0] = Param_2; + Matrix[0][1] = Matrix[0][0] + Param_3; + Matrix[0][2] = Matrix[0][1] + Param_4; + + Param_1 = (2.0f * Param_1) / (Param_4 + (Param_3 + Param_5)); + + if (Param_2 != 10.0f) Matrix[0][3] = Param_1 / Param_2; + if (Param_4 != 10.0f) Matrix[1][1] = -Param_1 / Param_4; + + Matrix[1][0] = 10.0f; + Matrix[1][2] = 10.0f; + Matrix[2][0] = 10.0f; + Matrix[1][3] = 10.0f; + + return; +} + +unsigned int Hx_TimerCountDown() { + + if (hx.Timer != 0) hx.Timer--; + return hx.Timer; +} + +void dummy_handler() { + +} + +void Hx_RemoveResource() { + + if (hx._0x10 == 2) Hx_Warning(1); + if (hx._0x24 == 0) Hx_Warning(2); + hx._0x24 = 0; + hx._0x28 = 0; +} + +void Hx_ProvideResourceEx(int Param_1) { + + if (hx._0x10 == 2) Hx_Warning(1); + hx._0x28 = 1; + hx._0x30 = Param_1; +} + +void Hx_ProvideResource(int Param_1, int Param_2) { + + if (hx._0x10 == 2) Hx_Warning(1); + if (hx._0x24 != 0) Hx_Warning(3); + hx._0x24 = 1; + hx._0x2C = Param_1; + hx._0x34 = Param_2; +} + +void Hx_ResetWipe(int Param_1, int Param_2) { + + hx._0x10 = 0; + hx._0x0 = Param_1; + hx._0x4 = Param_2; + hx._0x8 = hx._0x0 / 2; + hx._0xC = hx._0x4 / 2; + hx._0x24 = 0; + hx._0x28 = 0; +} + +int HxWarning(int Param_1) { + + return Param_1; + +} \ No newline at end of file From 6b2ce900f004339b7dbae87222e44debf8591824 Mon Sep 17 00:00:00 2001 From: LMFinish Date: Tue, 13 May 2025 03:49:05 -0300 Subject: [PATCH 2/2] Start and do some hx_wiper --- include/GC2D/hx_wiper.h | 36 ++++---- src/GC2D/hx_wiper.c | 178 ++++++++++++++++++++++++---------------- 2 files changed, 126 insertions(+), 88 deletions(-) diff --git a/include/GC2D/hx_wiper.h b/include/GC2D/hx_wiper.h index ee726d9c..132c0586 100644 --- a/include/GC2D/hx_wiper.h +++ b/include/GC2D/hx_wiper.h @@ -1,22 +1,22 @@ typedef struct { - unsigned int _0x0; - unsigned int _0x4; - int _0x8; - int _0xC; - unsigned char _0x10; - unsigned char _0x11; - short _0x12; - int _0x14; - int _0x18; - int _0x1C; - int _0x20; - int _0x24; - int _0x28; - int _0x2C; - int _0x30; - int _0x34; - unsigned int _0x38; + unsigned int m_0x0; + unsigned int m_0x4; + int m_0x8; + int m_0xC; + unsigned char m_0x10; + unsigned char m_0x11; + short m_0x12; + int m_0x14; + int m_0x18; + int m_0x1C; + int m_0x20; + int m_0x24; + int m_0x28; + int m_0x2C; + int m_0x30; + int m_0x34; + unsigned int m_0x38; unsigned int Timer; } hx_wiper; @@ -26,4 +26,4 @@ hx_wiper hx; unsigned int handle_type; int hxs_logo_resetflag; -int hxs_logodraw_resetflag; \ No newline at end of file +int hxs_logodraw_resetflag; diff --git a/src/GC2D/hx_wiper.c b/src/GC2D/hx_wiper.c index 7c80814c..9843d452 100644 --- a/src/GC2D/hx_wiper.c +++ b/src/GC2D/hx_wiper.c @@ -1,112 +1,150 @@ #include #include -int Hx_MovieStartSyncEx() { +void Hx_CameraInit() {} +void Hx_GxInit() {} +void Hgx_init_tobj_resource() {} +void Hgx_ReadTexture() {} +void Hx_GetFrBuffer() {} +void Hx_SetVFilter() {} - if (hx._0x11 != 0xC) return 0; - if (hx._0x38 >= 2 && hx._0x38 <= 5) { +void __Hx_FrBufferMorf(int Param_1, int Param_2) {} - if (hxs_logodraw_resetflag == 0) return 0; - else { - - hxs_logodraw_resetflag = 0; - return 1; - } - - } else if (hx._0x38 >= 6) { +void Hx_FrBufferMorf() { - if (hxs_logo_resetflag == 0) return 0; - else { - - if (hx._0x38 == 6 && hx.Timer > 192) return 0; - else { - - hxs_logo_resetflag = 0; - return 2; - } - } - - } else return 0; + Hx_SetVFilter(); + __Hx_FrBufferMorf(hx.m_0x8 - 0x18, hx.m_0xC - 0x18); } -float Hx_MotionUpdate(Mtx Matrix) { +void Frb2_InitGx() {} +void Frb2_InitBlackBox() {} +void Frb2_RendBox() {} - if (Matrix[0][0] > Matrix[1][3]) Matrix[1][2] += Matrix[0][3]; - else if (Matrix[0][1] <= Matrix[1][3]) Matrix[1][2] += Matrix[1][1]; +int HxWarning(int Param_1) { - Matrix[1][3] += 1.0f; - Matrix[2][0] += Matrix[1][2]; - return Matrix[2][0]; + return Param_1; +} + +void Hx_ResetWipe(int Param_1, int Param_2) { + hx.m_0x10 = 0; + hx.m_0x0 = Param_1; + hx.m_0x4 = Param_2; + hx.m_0x8 = hx.m_0x0 / 2; + hx.m_0xC = hx.m_0x4 / 2; + hx.m_0x24 = 0; + hx.m_0x28 = 0; +} + +void Hx_ProvideResource(int Param_1, int Param_2) { + + if (hx.m_0x10 == 2) Hx_Warning(1); + if (hx.m_0x24 != 0) Hx_Warning(3); + hx.m_0x24 = 1; + hx.m_0x2C = Param_1; + hx.m_0x34 = Param_2; +} + +void Hx_ProvideResourceEx(int Param_1) { + + if (hx.m_0x10 == 2) Hx_Warning(1); + hx.m_0x28 = 1; + hx.m_0x30 = Param_1; +} + +void Hx_RemoveResource() { + + if (hx.m_0x10 == 2) Hx_Warning(1); + if (hx.m_0x24 == 0) Hx_Warning(2); + hx.m_0x24 = 0; + hx.m_0x28 = 0; +} + +void dummy_handler() {} + +unsigned int Hx_TimerCountDown() { + + if (hx.Timer != 0) hx.Timer--; + return hx.Timer; } void Hx_MotionSet(float Param_1, float Param_2, float Param_3, float Param_4, Mtx Matrix) { float Param_5 = Param_2 + Param_3; - + Matrix[0][0] = Param_2; Matrix[0][1] = Matrix[0][0] + Param_3; Matrix[0][2] = Matrix[0][1] + Param_4; - + Param_1 = (2.0f * Param_1) / (Param_4 + (Param_3 + Param_5)); - + if (Param_2 != 10.0f) Matrix[0][3] = Param_1 / Param_2; if (Param_4 != 10.0f) Matrix[1][1] = -Param_1 / Param_4; - + Matrix[1][0] = 10.0f; Matrix[1][2] = 10.0f; Matrix[2][0] = 10.0f; Matrix[1][3] = 10.0f; - return; } -unsigned int Hx_TimerCountDown() { - - if (hx.Timer != 0) hx.Timer--; - return hx.Timer; -} +float Hx_MotionUpdate(Mtx Matrix) { -void dummy_handler() { + if (Matrix[0][0] > Matrix[1][3]) Matrix[1][2] += Matrix[0][3]; + else if (Matrix[0][1] <= Matrix[1][3]) Matrix[1][2] += Matrix[1][1]; + Matrix[1][3] += 1.0f; + Matrix[2][0] += Matrix[1][2]; + return Matrix[2][0]; } -void Hx_RemoveResource() { +void Hx_Circle() {} +void Hxs1_Circle() {} +void Hxs2_Circle() {} +void Hxs_FrBufferMorf2() {} +void Hxs_FrBufferMorf2B() {} +void Hx_Door() {} +void Hxs_GameOver() {} +void Hx_GameOver() {} +void Hxs_Logo_ExtraDraw() {} +void Hxs_Logo_TexSetup() {} +void Hxs_Logo_TexDraw() {} +void Hxs_Logo_MagDraw() {} +void Hxs_PenDraw() {} +void Hx_Logo() {} - if (hx._0x10 == 2) Hx_Warning(1); - if (hx._0x24 == 0) Hx_Warning(2); - hx._0x24 = 0; - hx._0x28 = 0; -} +int Hx_MovieStartSyncEx() { -void Hx_ProvideResourceEx(int Param_1) { + if (hx.m_0x11 != 0xC) return 0; - if (hx._0x10 == 2) Hx_Warning(1); - hx._0x28 = 1; - hx._0x30 = Param_1; -} + if (hx.m_0x38 >= 2 && hx.m_0x38 <= 5) { -void Hx_ProvideResource(int Param_1, int Param_2) { + if (hxs_logodraw_resetflag == 0) return 0; + else { - if (hx._0x10 == 2) Hx_Warning(1); - if (hx._0x24 != 0) Hx_Warning(3); - hx._0x24 = 1; - hx._0x2C = Param_1; - hx._0x34 = Param_2; -} + hxs_logodraw_resetflag = 0; + return 1; + } -void Hx_ResetWipe(int Param_1, int Param_2) { + } else if (hx.m_0x38 >= 6) { - hx._0x10 = 0; - hx._0x0 = Param_1; - hx._0x4 = Param_2; - hx._0x8 = hx._0x0 / 2; - hx._0xC = hx._0x4 / 2; - hx._0x24 = 0; - hx._0x28 = 0; -} + if (hxs_logo_resetflag == 0) return 0; + else { -int HxWarning(int Param_1) { + if (hx.m_0x38 == 6 && hx.Timer > 192) return 0; + else { - return Param_1; + hxs_logo_resetflag = 0; + return 2; + } + } + + } else return 0; +} -} \ No newline at end of file +void Hx_Test1() {} +void Hxs1_Test1() {} +void Hx_Test2() {} +void Hx_Test2R() {} +void Hxs1_Test2() {} +void Hx_Test4() {} +void Hx_Test5() {}