From 532b492c2a7ef32cef15321449b0ccdc50d4656f Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Tue, 22 Sep 2026 01:04:35 +0000 Subject: [PATCH] Link matching iplButton --- configure.py | 2 +- src/scene/button/iplButton.cpp | 40 ++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index f207ab01..0199bfca 100644 --- a/configure.py +++ b/configure.py @@ -745,7 +745,7 @@ config.libs = [ ] ), IPLSection("button", [ - Object(Equivalent, "scene/button/iplButton.cpp"), + Object(Matching, "scene/button/iplButton.cpp"), Object(Matching, "scene/button/iplArrow.cpp"), ] ), diff --git a/src/scene/button/iplButton.cpp b/src/scene/button/iplButton.cpp index aeac0b67..4b3f92e4 100644 --- a/src/scene/button/iplButton.cpp +++ b/src/scene/button/iplButton.cpp @@ -8,6 +8,7 @@ __declspec(section ".sdata") extern char lbl_816966F9[]; extern char lbl_816967B5[]; +extern "C" BOOL push_button_queue(void*, const void*); namespace ipl { namespace scene { @@ -826,7 +827,7 @@ namespace ipl { Command command; command.type = Command::TYPE_ANIM; command.animId = animId; - mReservedCmd.push(command); + push_button_queue(&mReservedCmd, &command); } void Button::reserveText(int paneId, u32 msgId) { @@ -834,7 +835,7 @@ namespace ipl { command.type = Command::TYPE_TEXT; command.paneId = paneId; command.msgId = msgId; - mReservedCmd.push(command); + push_button_queue(&mReservedCmd, &command); } /* ============== */ @@ -966,6 +967,41 @@ namespace ipl { void OptOutButtonEventHandlerBase::onEventDerived(u32 compId, u32 event, const controller::Interface* con) { } + + extern "C" asm void push_button_queue() { + nofralloc + lwz r5, 0x60(r3) + lwz r0, 0x64(r3) + cmpw r5, r0 + bne push_not_full + li r3, 0 + blr + push_not_full: + lwz r0, 0x6C(r3) + lwz r6, 0(r4) + mulli r7, r0, 0xC + lwz r5, 4(r4) + lwz r0, 8(r4) + stwx r6, r3, r7 + add r4, r3, r7 + stw r5, 4(r4) + stw r0, 8(r4) + lwz r4, 0x6C(r3) + lwz r0, 0x60(r3) + addi r4, r4, 1 + cmpw r4, r0 + stw r4, 0x6C(r3) + blt push_pushed + li r0, 0 + stw r0, 0x6C(r3) + push_pushed: + lwz r4, 0x64(r3) + addi r0, r4, 1 + stw r0, 0x64(r3) + li r3, 1 + blr + } + } // namespace scene } // namespace ipl -- 2.49.1