From 9d9839f16c2e5ae5cdfca89ad46f05806ea24028 Mon Sep 17 00:00:00 2001 From: Lingo Date: Sun, 8 Mar 2026 14:40:05 -0700 Subject: [PATCH 01/11] startAppearTank, startAppearCoin, startDisappearCoin --- include/GC2D/ExPane.hpp | 11 ++++ include/GC2D/GCConsole2.hpp | 4 +- include/JSystem/JParticle/JPAEmitter.hpp | 3 ++ src/GC2D/GCConsole2.cpp | 68 ++++++++++++++++++++++-- 4 files changed, 81 insertions(+), 5 deletions(-) diff --git a/include/GC2D/ExPane.hpp b/include/GC2D/ExPane.hpp index fcb4a538..5fa0655f 100644 --- a/include/GC2D/ExPane.hpp +++ b/include/GC2D/ExPane.hpp @@ -101,6 +101,11 @@ class TExPane { J2DPane* getPane() const { return mPane; } const JUTRect& getInitialBounds() const { return mInitialBounds; } + // fabricated and likely fake, these only exist to avoid storing + // &mInitialBounds in one of the registers + int getInitialY1() const { return mInitialBounds.y1; } + int getInitialY2() const { return mInitialBounds.y2; } + bool isBoundsAnimationCompleted() const { bool result = false; @@ -117,6 +122,12 @@ class TExPane { return result; } + bool isInterpolatorAtZero() const + { + return mOffsetInterpolator.getCurrentX() == 0 + && mOffsetInterpolator.getCurrentY() == 0; + } + public: /* 0x0 */ J2DPane* mPane; /* 0x4 */ JUTRect mInitialBounds; diff --git a/include/GC2D/GCConsole2.hpp b/include/GC2D/GCConsole2.hpp index a3aa60ca..69fe0279 100644 --- a/include/GC2D/GCConsole2.hpp +++ b/include/GC2D/GCConsole2.hpp @@ -124,7 +124,7 @@ class TGCConsole2 : public JDrama::TViewObj { /* 0x8C */ int unk8C; /* 0x90 */ THelpActor** unk90; /* 0x94 */ TConsoleStr* unk94; - /* 0x98 */ u16 unk98; + /* 0x98 */ s16 unk98; /* 0x9A */ u8 unk9A[20]; /* 0xB0 */ J2DSetScreen* unkB0; /* 0xB4 */ u8 unkB4; @@ -168,7 +168,7 @@ class TGCConsole2 : public JDrama::TViewObj { /* 0x264 */ u16 unk264; /* 0x266 */ u8 unk266; /* 0x268 */ u16 unk268; - /* 0x26A */ u16 unk26A; + /* 0x26A */ s16 unk26A; /* 0x26C */ TBoundPane* unk26C; /* 0x270 */ TBoundPane* unk270; /* 0x274 */ TBoundPane* unk274; diff --git a/include/JSystem/JParticle/JPAEmitter.hpp b/include/JSystem/JParticle/JPAEmitter.hpp index 05fceda1..45884caa 100644 --- a/include/JSystem/JParticle/JPAEmitter.hpp +++ b/include/JSystem/JParticle/JPAEmitter.hpp @@ -161,6 +161,9 @@ class JPABaseEmitter { } bool checkUnk11C(u32 flag) const { return unk11C & flag ? true : false; } + void clearUnk11CFlag(u32 flag) { unk11C &= ~flag; } + void setUnk11CFlag(u32 flag) { unk11C |= flag; } + bool isThing() const { if (checkUnk11C(0x8) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 8900c862..6bff9561 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -7,12 +7,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -319,13 +321,73 @@ void TGCConsole2::resetMoveTank() { } void TGCConsole2::endCameraDemo() { } -void TGCConsole2::startAppearTank() { } +void TGCConsole2::startAppearTank() +{ + if (unk34[17] || TFlagManager::smInstance->getBool(0x30002)) { + return; + } + + // TODO: needs register swapping + unk34[17] = 1; + unk59 = 1; + unk7C = 0; + + unk2F8->getPane()->show(); + unk2F8->setPaneOffset(unk98, 0, 0, 0, 465 - unk2F8->getInitialY1()); + + unk26C->setPanePosition(50, JUTPoint(0, 100), JUTPoint(0, -30), + JUTPoint(0, -30)); + + unk274->getPane()->show(); + unk29C->getPane()->show(); +} +// Probably inlined somewhere in the final product? void TGCConsole2::startDisappearTank() { } -void TGCConsole2::startAppearCoin() { } +void TGCConsole2::startAppearCoin() +{ + if (unk108->getPane()->isVisible()) { + return; + } + + unk34[27] = 1; + unk59 = 1; + unk88 = 0; + + unk108->getPane()->show(); + unk108->setPaneOffset(unk98, 0, unk26A, 0, -(unk108->getInitialY2() + 1)); -void TGCConsole2::startDisappearCoin() { } + unkC8->setPanePosition(50, cDownTopPoint, cDownMidPoint, cDownMidPoint); + + unkCC->getPane()->hide(); + unkD0->getPane()->hide(); + for (int i = 0; i < 3; i++) { + unkD4[i]->getPane()->hide(); + } + + unk124->clearUnk11CFlag(1 << 0); +} + +void TGCConsole2::startDisappearCoin() +{ + unk34[25] = true; + unk5A = true; + + if (unk140->isInterpolatorAtZero()) { + J2DPane* pane = unk128->getPane(); + unk140->updatePaneOffset( + 40, 0, -(unk140->getInitialY2() + 1 + pane->mBounds.getHeight())); + } + + J2DPane* pane = unkC8->getPane(); + // TODO: The last argument needs some massaging to get the instructions in + // the right order, but this is still equivalent + unk108->updatePaneOffset( + 40, 0, -(pane->mBounds.getHeight() + unk108->getInitialY2() + 1)); + + unk124->setUnk11CFlag(1 << 0); +} void TGCConsole2::startInsertLife(int) { } From 7a2eeec89d80113dcde6dc12c2293c57a5e910d8 Mon Sep 17 00:00:00 2001 From: Lingo Date: Sun, 8 Mar 2026 15:31:31 -0700 Subject: [PATCH 02/11] resetLife --- src/GC2D/GCConsole2.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 6bff9561..020f0fff 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -391,7 +391,24 @@ void TGCConsole2::startDisappearCoin() void TGCConsole2::startInsertLife(int) { } -void TGCConsole2::resetLife(int) { } +void TGCConsole2::resetLife(int param_1) +{ + for (int i = 1; i < 9; i++) { + if (i < param_1 + 1) { + unk17C[2 * i]->show(); + } else { + unk17C[2 * i]->hide(); + } + + // TODO: This feels like a fakematch, is setBounds correct? + + JUTRect local_38(unk1D0[i].x1, unk1D0[i].y1, unk1D0[i].x2, unk1D0[i].y2); + unk17C[2 * i]->setBounds(local_38); + + JUTRect local_48(unk1D0[i].x1, unk1D0[i].y1, unk1D0[i].x2, unk1D0[i].y2); + unk17C[2 * i + 1]->setBounds(local_48); + } +} void TGCConsole2::startAppearLife(int) { } From 6210eb7c5b717f0b971e9fe56f01a36c44663cc3 Mon Sep 17 00:00:00 2001 From: Lingo Date: Sun, 8 Mar 2026 21:39:53 -0700 Subject: [PATCH 03/11] remove unneeded comment --- src/GC2D/GCConsole2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 020f0fff..8bf7b83f 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -342,7 +342,6 @@ void TGCConsole2::startAppearTank() unk29C->getPane()->show(); } -// Probably inlined somewhere in the final product? void TGCConsole2::startDisappearTank() { } void TGCConsole2::startAppearCoin() From 07a3d2e60140a238b6d366434d8a6192f3e08b54 Mon Sep 17 00:00:00 2001 From: Lingo Date: Sun, 8 Mar 2026 21:58:20 -0700 Subject: [PATCH 04/11] startDownLeftBot --- include/GC2D/ExPane.hpp | 2 +- src/GC2D/GCConsole2.cpp | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/include/GC2D/ExPane.hpp b/include/GC2D/ExPane.hpp index 5fa0655f..70231f83 100644 --- a/include/GC2D/ExPane.hpp +++ b/include/GC2D/ExPane.hpp @@ -103,7 +103,7 @@ class TExPane { // fabricated and likely fake, these only exist to avoid storing // &mInitialBounds in one of the registers - int getInitialY1() const { return mInitialBounds.y1; } + int get465MinusInitialY1() const { return 465 - mInitialBounds.y1; } int getInitialY2() const { return mInitialBounds.y2; } bool isBoundsAnimationCompleted() const diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 8bf7b83f..c17817ba 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -331,9 +331,9 @@ void TGCConsole2::startAppearTank() unk34[17] = 1; unk59 = 1; unk7C = 0; - + unk2F8->getPane()->show(); - unk2F8->setPaneOffset(unk98, 0, 0, 0, 465 - unk2F8->getInitialY1()); + unk2F8->setPaneOffset(unk98, 0, 0, 0, unk2F8->get465MinusInitialY1()); unk26C->setPanePosition(50, JUTPoint(0, 100), JUTPoint(0, -30), JUTPoint(0, -30)); @@ -401,10 +401,12 @@ void TGCConsole2::resetLife(int param_1) // TODO: This feels like a fakematch, is setBounds correct? - JUTRect local_38(unk1D0[i].x1, unk1D0[i].y1, unk1D0[i].x2, unk1D0[i].y2); + JUTRect local_38(unk1D0[i].x1, unk1D0[i].y1, unk1D0[i].x2, + unk1D0[i].y2); unk17C[2 * i]->setBounds(local_38); - JUTRect local_48(unk1D0[i].x1, unk1D0[i].y1, unk1D0[i].x2, unk1D0[i].y2); + JUTRect local_48(unk1D0[i].x1, unk1D0[i].y1, unk1D0[i].x2, + unk1D0[i].y2); unk17C[2 * i + 1]->setBounds(local_48); } } @@ -413,7 +415,31 @@ void TGCConsole2::startAppearLife(int) { } void TGCConsole2::startDisappearLife(int) { } -void TGCConsole2::startDownLeftBot() { } +void TGCConsole2::startDownLeftBot() +{ + if (unk34[13]) { + return; + } + + unk34[13] = 1; + unk34[12] = 0; + unk5A = 1; + + if (unk44C->getPane()->isVisible() && unk44C->isInterpolatorAtZero()) { + unk44C->updatePaneOffset(20, 0, unk44C->get465MinusInitialY1() + 60); + unk51C = 1; + } + + if (unk428->getPane()->isVisible()) { + unk428->updatePaneOffset(20, 0, unk428->get465MinusInitialY1() + 60); + unk448 = 1; + } + + if (unk3FC->getPane()->isVisible()) { + unk3FC->updatePaneOffset(20, 0, unk3FC->get465MinusInitialY1() + 60); + unk426 = 1; + } +} void TGCConsole2::startUpLeftBot() { } From cd6f4504ae3550d8346b0d531b0a7cee8fc8c4fb Mon Sep 17 00:00:00 2001 From: Lingo Date: Sun, 8 Mar 2026 22:04:11 -0700 Subject: [PATCH 05/11] getInitialY2 -> getNegativeInitialY2Plus1 --- include/GC2D/ExPane.hpp | 5 ++--- src/GC2D/GCConsole2.cpp | 15 ++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/GC2D/ExPane.hpp b/include/GC2D/ExPane.hpp index 70231f83..c892ca51 100644 --- a/include/GC2D/ExPane.hpp +++ b/include/GC2D/ExPane.hpp @@ -101,10 +101,9 @@ class TExPane { J2DPane* getPane() const { return mPane; } const JUTRect& getInitialBounds() const { return mInitialBounds; } - // fabricated and likely fake, these only exist to avoid storing - // &mInitialBounds in one of the registers + // fabricated, but they make a lot of things in GCConsole2 work int get465MinusInitialY1() const { return 465 - mInitialBounds.y1; } - int getInitialY2() const { return mInitialBounds.y2; } + int getNegativeInitialY2Plus1() const { return -(mInitialBounds.y2 + 1); } bool isBoundsAnimationCompleted() const { diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index c17817ba..5e5d3e82 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -355,7 +355,8 @@ void TGCConsole2::startAppearCoin() unk88 = 0; unk108->getPane()->show(); - unk108->setPaneOffset(unk98, 0, unk26A, 0, -(unk108->getInitialY2() + 1)); + unk108->setPaneOffset(unk98, 0, unk26A, 0, + unk108->getNegativeInitialY2Plus1()); unkC8->setPanePosition(50, cDownTopPoint, cDownMidPoint, cDownMidPoint); @@ -375,15 +376,15 @@ void TGCConsole2::startDisappearCoin() if (unk140->isInterpolatorAtZero()) { J2DPane* pane = unk128->getPane(); - unk140->updatePaneOffset( - 40, 0, -(unk140->getInitialY2() + 1 + pane->mBounds.getHeight())); + unk140->updatePaneOffset(40, 0, + -pane->mBounds.getHeight() + + unk140->getNegativeInitialY2Plus1()); } J2DPane* pane = unkC8->getPane(); - // TODO: The last argument needs some massaging to get the instructions in - // the right order, but this is still equivalent - unk108->updatePaneOffset( - 40, 0, -(pane->mBounds.getHeight() + unk108->getInitialY2() + 1)); + unk108->updatePaneOffset(40, 0, + -(pane->mBounds.getHeight()) + + unk108->getNegativeInitialY2Plus1()); unk124->setUnk11CFlag(1 << 0); } From 330488f1b6fa4560480743ccb86b210e26f28d9e Mon Sep 17 00:00:00 2001 From: Lingo Date: Mon, 9 Mar 2026 01:07:33 -0700 Subject: [PATCH 06/11] Formatting --- src/GC2D/GCConsole2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 5e5d3e82..dc0fe71e 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -424,7 +424,7 @@ void TGCConsole2::startDownLeftBot() unk34[13] = 1; unk34[12] = 0; - unk5A = 1; + unk5A = 1; if (unk44C->getPane()->isVisible() && unk44C->isInterpolatorAtZero()) { unk44C->updatePaneOffset(20, 0, unk44C->get465MinusInitialY1() + 60); From 16c1ba27fb35b02366afb4bf7cbc12b1099097dd Mon Sep 17 00:00:00 2001 From: Lingo Date: Mon, 9 Mar 2026 01:07:59 -0700 Subject: [PATCH 07/11] startAppearTelop --- include/GC2D/GCConsole2.hpp | 4 ++-- src/GC2D/GCConsole2.cpp | 45 ++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/include/GC2D/GCConsole2.hpp b/include/GC2D/GCConsole2.hpp index 69fe0279..dbfb187b 100644 --- a/include/GC2D/GCConsole2.hpp +++ b/include/GC2D/GCConsole2.hpp @@ -255,7 +255,7 @@ class TGCConsole2 : public JDrama::TViewObj { /* 0x530 */ TMessageLoader* unk530; /* 0x534 */ JUTRect unk534; /* 0x544 */ JUTRect unk544; - /* 0x554 */ u32 unk554; + /* 0x554 */ s32 mTelopTextWidth; /* 0x558 */ u8 unk558; /* 0x55C */ u32 unk55C; /* 0x560 */ u16 unk560; @@ -264,7 +264,7 @@ class TGCConsole2 : public JDrama::TViewObj { /* 0x568 */ f32 unk568; /* 0x56C */ u8 unk56C; /* 0x56D */ u8 unk56D; - /* 0x570 */ u32 unk570; + /* 0x570 */ u32* unk570; // Some sort of Dolphic News struct? }; #endif diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index dc0fe71e..56de288e 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -13,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -111,7 +113,7 @@ TGCConsole2::TGCConsole2(const char* name) , unk444(0) , unk448(0) , unk530(nullptr) - , unk554(0) + , mTelopTextWidth(0) , unk558(0) , unk55C(0) , unk560(60) @@ -120,7 +122,7 @@ TGCConsole2::TGCConsole2(const char* name) , unk568(0.0f) , unk56C(1) , unk56D(1) - , unk570(0) + , unk570(nullptr) { for (int i = 0; i < 2; ++i) unkE0[i] = 0; @@ -444,7 +446,44 @@ void TGCConsole2::startDownLeftBot() void TGCConsole2::startUpLeftBot() { } -void TGCConsole2::startAppearTelop(bool) { } +void TGCConsole2::startAppearTelop(bool param_1) +{ + if (unk34[28]) { + return; + } + if (unk530->unk4 == nullptr) { + return; + } + if (unk570 == 0 || unk44C->getPane()->isVisible()) { + return; + } + if (!(param_1 || unk34[16])) { + return; + } + + unk34[14] = 1; + unk59 = 1; + unk56D = 1; + unk520->getPane()->show(); + + unk520->setPaneOffset(80, 0, 0, 0, unk520->get465MinusInitialY1()); + + if (param_1) { + // TODO: needs regswapping + const u8* messageText + = &unk530->getMessageData()[unk530->unk8[unk570[unk558] & 0xffff].unk0]; + + snprintf(unk528->getStringPtr(), 0x3ff, "%s", messageText); + snprintf(unk52C->getStringPtr(), 0x3ff, "%s", messageText); + + J2DPrint print(gpSystemFont, 0); + mTelopTextWidth = print.getWidth(unk528->getStringPtr()); + + if (gpMSound->gateCheck(0x4812)) { + MSoundSESystem::MSoundSE::startSoundSystemSE(0x4812, 0, nullptr, 0); + } + } +} void TGCConsole2::startDisappearTelop() { } From 65698e6615b27fc81aa80de00cc8582c044e054a Mon Sep 17 00:00:00 2001 From: Lingo Date: Mon, 9 Mar 2026 01:15:23 -0700 Subject: [PATCH 08/11] startDisappearTelop --- src/GC2D/GCConsole2.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 56de288e..9655ac53 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -485,7 +485,17 @@ void TGCConsole2::startAppearTelop(bool param_1) } } -void TGCConsole2::startDisappearTelop() { } +void TGCConsole2::startDisappearTelop() +{ + if (unk34[15] || !unk520->getPane()->isVisible()) { + return; + } + + unk34[15] = 1; + unk5A = 1; + + unk520->updatePaneOffset(80, 0, unk520->get465MinusInitialY1()); +} void TGCConsole2::startDisappearTimer() { } From b085237249ef6a6a79352933fd28aabda6d7cfca Mon Sep 17 00:00:00 2001 From: Lingo Date: Wed, 11 Mar 2026 23:32:08 -0700 Subject: [PATCH 09/11] clang format --- src/GC2D/GCConsole2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 9655ac53..4b481812 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -471,7 +471,8 @@ void TGCConsole2::startAppearTelop(bool param_1) if (param_1) { // TODO: needs regswapping const u8* messageText - = &unk530->getMessageData()[unk530->unk8[unk570[unk558] & 0xffff].unk0]; + = &unk530->getMessageData()[unk530->unk8[unk570[unk558] & 0xffff] +.unk0]; snprintf(unk528->getStringPtr(), 0x3ff, "%s", messageText); snprintf(unk52C->getStringPtr(), 0x3ff, "%s", messageText); @@ -492,7 +493,7 @@ void TGCConsole2::startDisappearTelop() } unk34[15] = 1; - unk5A = 1; + unk5A = 1; unk520->updatePaneOffset(80, 0, unk520->get465MinusInitialY1()); } From 0892af1f71b3025d161f5331554e555b36a1203e Mon Sep 17 00:00:00 2001 From: Lingo Date: Wed, 11 Mar 2026 23:32:57 -0700 Subject: [PATCH 10/11] Timer stuff --- include/GC2D/GCConsole2.hpp | 3 +- src/GC2D/GCConsole2.cpp | 139 ++++++++++++++++++++++++++++++++++-- 2 files changed, 136 insertions(+), 6 deletions(-) diff --git a/include/GC2D/GCConsole2.hpp b/include/GC2D/GCConsole2.hpp index dbfb187b..37d94cf5 100644 --- a/include/GC2D/GCConsole2.hpp +++ b/include/GC2D/GCConsole2.hpp @@ -245,7 +245,8 @@ class TGCConsole2 : public JDrama::TViewObj { /* 0x500 */ J2DPane* unk500[2]; /* 0x508 */ int unk508; /* 0x50C */ int unk50C; - /* 0x510 */ char unk510[0x8]; + /* 0x510 */ bool unk510; + /* 0x514 */ s32 unk514; /* 0x518 */ int unk518; /* 0x51C */ u8 unk51C; /* 0x520 */ TExPane* unk520; diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 4b481812..6bca4096 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -472,7 +473,7 @@ void TGCConsole2::startAppearTelop(bool param_1) // TODO: needs regswapping const u8* messageText = &unk530->getMessageData()[unk530->unk8[unk570[unk558] & 0xffff] -.unk0]; + .unk0]; snprintf(unk528->getStringPtr(), 0x3ff, "%s", messageText); snprintf(unk52C->getStringPtr(), 0x3ff, "%s", messageText); @@ -498,11 +499,69 @@ void TGCConsole2::startDisappearTelop() unk520->updatePaneOffset(80, 0, unk520->get465MinusInitialY1()); } -void TGCConsole2::startDisappearTimer() { } +void TGCConsole2::startDisappearTimer() +{ + unk44C->updatePaneOffset(40, 0, unk44C->get465MinusInitialY1() + 60); + unk34[11] = 1; + unk5A = 1; +} + +void TGCConsole2::startAppearTimer(int param_1, s32 param_2) +{ + startDisappearTelop(); + + if (param_1 == 0) { + unk510 = true; + unk514 = 0; + } else { + unk510 = false; + unk514 = param_2 * 100; + } + + if (unk510 || param_2 >= 0x3C) { + unk500[0]->show(); + unk500[1]->hide(); + } else { + unk500[0]->hide(); + unk500[1]->show(); + } + + if (param_2 > 0) { + setTimer(unk514); + } + + for (int i = 6; i <= 9; i++) { + ((J2DPicture*)unk458[i]->getPane())->mWhite = unk50C; + } + ((J2DPicture*)unk480[2]->getPane())->mWhite = unk50C; + + startInsertTimer(); +} + +void TGCConsole2::startInsertTimer() +{ + unk34[10] = 1; + + for (int i = 0; i < 10; i++) { + unk458[i]->getPane()->hide(); + } + + for (int i = 0; i < 3; i++) { + unk480[i]->getPane()->hide(); + } + + unk59 = 1; -void TGCConsole2::startAppearTimer(int, s32) { } + unk44C->getPane()->show(); + unk44C->setPaneOffset(40, 0, 0, 0, unk44C->get465MinusInitialY1()); -void TGCConsole2::startInsertTimer() { } + unk450->getPane()->show(); + unk450->setPanePosition(50, cUpTopPoint, cUpMidPoint, cUpMidPoint); + + unk454->getPane()->hide(); + unk518 = 0; + unk70[6] = 0; +} void TGCConsole2::startAppearJetBalloon(int, int) { } @@ -541,7 +600,77 @@ void TGCConsole2::processMoveNozzle() { } void TGCConsole2::changeNum(TBlendPane*, int, int) { } -void TGCConsole2::setTimer(long) { } +void TGCConsole2::setTimer(s32 param_1) +{ + // TODO: Needs regswaps but should otherwise be equivalent + + u32 timerValue; + + if (param_1 == -1) { + s64 uVar3 = gpMarDirector->unkC8; + s64 uVar5 = OSCheckStopwatch(&gpMarDirector->unkE8); + s64 uVar9 = OSTicksToMilliseconds(uVar3); + s64 uVar8 = OSTicksToMilliseconds(uVar5); + + timerValue = (uVar8 - uVar9) * 0.1f; + + if (!unk510) { + if (unk514 < timerValue) { + timerValue = 0; + } else { + timerValue = unk514 - timerValue; + } + } + } + + // Cap at 5999.99 seconds (99:59.99) + if (timerValue > 599999) { + timerValue = 599999; + } + + u16 minutes = (timerValue - timerValue % 100) / 6000; + u32 timeMinusMinutes = timerValue - minutes * 6000; + u16 seconds = timeMinusMinutes * 0.01; + u16 centis = timeMinusMinutes - 100 * seconds; + + if (unk500[0]->isVisible()) { + ((J2DPicture*)unk458[0]->getPane()) + ->changeTexture(unkE0[minutes / 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[1]->getPane()) + ->changeTexture(unkE0[minutes % 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[2]->getPane()) + ->changeTexture(unkE0[seconds / 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[3]->getPane()) + ->changeTexture(unkE0[seconds % 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[4]->getPane()) + ->changeTexture(unkE0[centis / 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[5]->getPane()) + ->changeTexture(unkE0[centis % 10]->getTexInfo(), 0); + } else { + if (timerValue < 1000 + && ((J2DPicture*)unk458[9]->getPane())->mWhite != unk508) { + for (int i = 6; i <= 9; i++) { + ((J2DPicture*)unk458[i]->getPane())->mWhite = unk508; + } + ((J2DPicture*)unk480[2]->getPane())->mWhite = unk508; + } + ((J2DPicture*)unk458[6]->getPane()) + ->changeTexture(unkE0[seconds / 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[7]->getPane()) + ->changeTexture(unkE0[seconds % 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[8]->getPane()) + ->changeTexture(unkE0[centis / 10]->getTexInfo(), 0); + ((J2DPicture*)unk458[9]->getPane()) + ->changeTexture(unkE0[centis % 10]->getTexInfo(), 0); + } + + if (timerValue != 0 && timerValue < unk518 + && gpMarDirector->mState != TMarDirector::STATE_UNK5) { + gpMSound->playTimer(timerValue * 10); + } + + unk4FC = param_1; +} void TGCConsole2::startMoveTimer(int param_1) { From 4f71898c46df37a7e248ae5beac1dcfe326c80b9 Mon Sep 17 00:00:00 2001 From: Lingo Date: Sun, 15 Mar 2026 16:27:47 -0700 Subject: [PATCH 11/11] clang-format --- src/GC2D/GCConsole2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GC2D/GCConsole2.cpp b/src/GC2D/GCConsole2.cpp index 6bca4096..204479cc 100644 --- a/src/GC2D/GCConsole2.cpp +++ b/src/GC2D/GCConsole2.cpp @@ -559,7 +559,7 @@ void TGCConsole2::startInsertTimer() unk450->setPanePosition(50, cUpTopPoint, cUpMidPoint, cUpMidPoint); unk454->getPane()->hide(); - unk518 = 0; + unk518 = 0; unk70[6] = 0; }