From 3d2f1324403885c61454d38dfa4e5e7d902e136c Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Mon, 28 Sep 2026 04:38:31 +0000 Subject: [PATCH] feat: match tiToolBar unit Fix the cancelStateFocusIn case label, declare the toolbar Sample class with its inline constructors so the LayoutByNW4R thunks are emitted in the original order, relabel the unit's data, and point the two one-past-the-end csPaneToAnimation entries at csAninationFile+0x1DC. --- config/43U/config.yml | 15 +++++++++++++++ config/43U/symbols.txt | 36 ++++++++++++++++++------------------ configure.py | 2 +- include/keyboard/tiToolBar.h | 19 +++++++++++++++++++ src/keyboard/tiToolBar.cpp | 4 +++- 5 files changed, 56 insertions(+), 20 deletions(-) diff --git a/config/43U/config.yml b/config/43U/config.yml index 8b30cbc8..260803ef 100644 --- a/config/43U/config.yml +++ b/config/43U/config.yml @@ -21,6 +21,21 @@ force_active: - lbl_81695063 - lbl_81695067 +# textinput::toolbar::csPaneToAnimation points one past the end of csAninationFile. +block_relocations: + - source: .data:0x8165E15C + - source: .data:0x8165E19C + +add_relocations: + - source: .data:0x8165E15C + type: abs + target: csAninationFile__Q29textinput7toolbar + addend: 0x1DC + - source: .data:0x8165E19C + type: abs + target: csAninationFile__Q29textinput7toolbar + addend: 0x1DC + quick_analysis: true fill_gaps: false diff --git a/config/43U/symbols.txt b/config/43U/symbols.txt index a27790b1..ac01ccae 100644 --- a/config/43U/symbols.txt +++ b/config/43U/symbols.txt @@ -13938,7 +13938,7 @@ pppURLCheck = .rodata:0x816152A8; // type:object size:0x28 scope:local lbl_816152D0 = .rodata:0x816152D0; // type:object size:0x10 scope:local data:4byte csAninationFile__Q29textinput12candidatebox = .rodata:0x816152E0; // type:object size:0x378 scope:local lbl_81615658 = .rodata:0x81615658; // type:object size:0xA0 scope:local data:4byte -csAninationFile__Q29textinput7toolbar = .rodata:0x816156F8; // type:object size:0x1E0 scope:local data:4byte +csAninationFile__Q29textinput7toolbar = .rodata:0x816156F8; // type:object size:0x1DC scope:local data:4byte csAninationFile__Q29textinput11predictlang = .rodata:0x816158D8; // type:object size:0x268 scope:local csAninationFileForSign__Q39textinput8keyboard10signwindow = .rodata:0x81615B40; // type:object size:0x268 scope:local csPaneNameToControlKey__Q39textinput8keyboard10signwindow = .rodata:0x81615DA8; // type:object size:0x48 scope:local @@ -17535,20 +17535,20 @@ __vt__Q39textinput12candidatebox4Base = .data:0x8165DFA8; // type:object size:0x __vt__Q39textinput12candidatebox18CandidateBoxCaller = .data:0x8165DFFC; // type:object size:0x1C __vt__Q39textinput11nw4rmanager11AnmObserver = .data:0x8165E018; // type:object size:0x4C __vt__Q39textinput4util12AnimObserver = .data:0x8165E064; // type:object size:0xC -lbl_8165E070 = .data:0x8165E070; // type:object size:0xC data:string -lbl_8165E080 = .data:0x8165E080; // type:object size:0x10 data:string -lbl_8165E090 = .data:0x8165E090; // type:object size:0xD data:string -lbl_8165E0A0 = .data:0x8165E0A0; // type:object size:0xC data:string +@6142 = .data:0x8165E070; // type:object size:0xC scope:local data:string +@6143 = .data:0x8165E080; // type:object size:0x10 scope:local data:string +@6144 = .data:0x8165E090; // type:object size:0xD scope:local data:string +@6145 = .data:0x8165E0A0; // type:object size:0xC scope:local data:string csPaneToAnimation__Q29textinput7toolbar = .data:0x8165E0B0; // type:object size:0x100 -lbl_8165E1B0 = .data:0x8165E1B0; // type:object size:0xD data:string -lbl_8165E1C0 = .data:0x8165E1C0; // type:object size:0xC data:string -lbl_8165E1CC = .data:0x8165E1CC; // type:object size:0xD data:string -lbl_8165E1DC = .data:0x8165E1DC; // type:object size:0xC data:string -lbl_8165E1E8 = .data:0x8165E1E8; // type:object size:0xC data:string -lbl_8165E1F8 = .data:0x8165E1F8; // type:object size:0x10 data:string -jumptable_8165E208 = .data:0x8165E208; // type:object size:0x30 scope:local -lbl_8165E238 = .data:0x8165E238; // type:object size:0xC data:string -jumptable_8165E244 = .data:0x8165E244; // type:object size:0x1C scope:local +@6802 = .data:0x8165E1B0; // type:object size:0xD scope:local data:string +@6805 = .data:0x8165E1C0; // type:object size:0xC scope:local data:string +@6808 = .data:0x8165E1CC; // type:object size:0xD scope:local data:string +@6812 = .data:0x8165E1DC; // type:object size:0xC scope:local data:string +@6816 = .data:0x8165E1E8; // type:object size:0xC scope:local data:string +@6817 = .data:0x8165E1F8; // type:object size:0x10 scope:local data:string +@6837 = .data:0x8165E208; // type:object size:0x30 scope:local +@6894 = .data:0x8165E238; // type:object size:0xC scope:local data:string +@6937 = .data:0x8165E244; // type:object size:0x1C scope:local __vt__Q39textinput7toolbar19ToggleButtonAnmPane = .data:0x8165E260; // type:object size:0x2C __vt__Q39textinput7toolbar19NormalButtonAnmPane = .data:0x8165E28C; // type:object size:0x2C __vt__Q39textinput7toolbar7AnmPane = .data:0x8165E2B8; // type:object size:0x2C @@ -22266,10 +22266,10 @@ lbl_816973C4 = .sdata:0x816973C4; // type:object size:0x4 data:4byte lbl_816973C8 = .sdata:0x816973C8; // type:object size:0x8 lbl_816973D0 = .sdata:0x816973D0; // type:object size:0x8 data:string lbl_816973D8 = .sdata:0x816973D8; // type:object size:0x8 data:string -lbl_816973E0 = .sdata:0x816973E0; // type:object size:0x4 data:4byte -lbl_816973E4 = .sdata:0x816973E4; // type:object size:0x4 data:4byte -lbl_816973E8 = .sdata:0x816973E8; // type:object size:0x5 data:string -lbl_816973F0 = .sdata:0x816973F0; // type:object size:0x7 data:string +COMMON_BUTTON_ANIM__Q29textinput7toolbar = .sdata:0x816973E0; // type:object size:0x4 scope:local data:4byte +COMMON_CHG_ANIM__Q29textinput7toolbar = .sdata:0x816973E4; // type:object size:0x4 scope:local data:4byte +@6901 = .sdata:0x816973E8; // type:object size:0x5 scope:local data:string +@6908 = .sdata:0x816973F0; // type:object size:0x7 scope:local data:string lbl_816973F8 = .sdata:0x816973F8; // type:object size:0x4 data:4byte lbl_81697400 = .sdata:0x81697400; // type:object size:0x4 data:4byte lbl_81697404 = .sdata:0x81697404; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index 9edc02a3..76442a2a 100644 --- a/configure.py +++ b/configure.py @@ -911,7 +911,7 @@ config.libs = [ Object(NonMatching, "keyboard/tiCellPhone.cpp", extra_cflags=["-O4,p"]), Object(NonMatching, "keyboard/tiInputForm.cpp", extra_cflags=["-O4,p"]), Object(NonMatching, "keyboard/tiCandidateBox.cpp", extra_cflags=["-O4,p"]), - Object(NonMatching, "keyboard/tiToolBar.cpp", extra_cflags=["-O4,p"]), + Object(Matching, "keyboard/tiToolBar.cpp", extra_cflags=["-O4,p"]), Object(NonMatching, "keyboard/tiPredictLang.cpp", extra_cflags=["-O4,p"]), Object(NonMatching, "keyboard/tiSignWindow.cpp", extra_cflags=["-O4,p"]), Object(NonMatching, "keyboard/tiString.cpp", extra_cflags=["-O4,p"]), diff --git a/include/keyboard/tiToolBar.h b/include/keyboard/tiToolBar.h index a02d284a..874d3828 100644 --- a/include/keyboard/tiToolBar.h +++ b/include/keyboard/tiToolBar.h @@ -10,6 +10,10 @@ namespace textinput { namespace toolbar { class Base { public: +#ifdef TI_TOOLBAR_SAMPLE_CLASS + Base(Manager* manager) : mQwerty(true), meLanguage(USA), mpAllocator(NULL), mpManager(manager) {} +#endif + virtual void create(MEMAllocator* allocator) { mpAllocator = allocator; } virtual void init() {} virtual bool isQwerty() const { return mQwerty; } @@ -31,6 +35,12 @@ namespace textinput { class LayoutByNW4R : public Base, public nw4rmanager::Layout { public: +#ifdef TI_TOOLBAR_SAMPLE_CLASS + LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer) + : Base(manager), nw4rmanager::Layout(resAccessor, "fs_VK_toolbar_a.brlyt", observer), mpEventHandler(NULL), + mbIsEnableQwertyChg(false) {} +#endif + virtual ~LayoutByNW4R(); virtual void create(MEMAllocator* allocator) override; virtual void init() override; @@ -107,7 +117,16 @@ namespace textinput { KeyType meKeyType; // 0x30 }; +#ifdef TI_TOOLBAR_SAMPLE_CLASS + class Sample : public LayoutByNW4R { + public: + Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer) + : LayoutByNW4R(manager, resAccessor, observer) {} + virtual ~Sample() {} + }; +#else class Sample {}; +#endif class NormalButtonAnmPane : public AnmPane { public: diff --git a/src/keyboard/tiToolBar.cpp b/src/keyboard/tiToolBar.cpp index ab940c06..38db6e65 100644 --- a/src/keyboard/tiToolBar.cpp +++ b/src/keyboard/tiToolBar.cpp @@ -1,4 +1,6 @@ +#define TI_TOOLBAR_SAMPLE_CLASS #include "keyboard/tiToolBar.h" +#undef TI_TOOLBAR_SAMPLE_CLASS #include "keyboard/tiHKBManager.h" #include "keyboard/tiLanguageIndependentData.h" @@ -182,7 +184,7 @@ namespace textinput { } break; } - case ANM_07: + case ANM_08: case ANM_11: { pane->changeAnimation(ANM_09); break; -- 2.49.1