Compare commits

..

48 Commits

Author SHA1 Message Date
Devin AI
73e4ac93c7 keyboard: rename lbl_/jumptable_ decls to plausible names
Owner rule: no address-suffixed identifiers, no volatile use-site
casts, no score-only objects. Renamed all lbl_*/jumptable_* decls and
refs in tiInputForm, tiCandidateBox, tiHwKeyboard, MyTiInputForm to
semantic names (emission-neutral; orig symtabs show dtk-anonymized
objects). Includes prior load-bearing header/impl edits.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 21:28:08 +00:00
Devin AI
1a1641d4d8 tiCellPhone: Base decl order + sdata const fixes (.sdata/.sdata2/.rodata now exact)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 20:36:07 +00:00
Devin AI
1e63e2d6a3 tiString inputChar: u16 count + input[i++] reg-aligned tail
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 16:42:46 +00:00
Devin AI
f2176b0824 keyboard: MyTiManager pures -> trivial inline virtuals — Manager must be concrete (iplKeyboard instantiates MemoManager); restores full build
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 14:35:55 +00:00
Devin AI
48ccec19ea keyboard: tiHKBManager SetModifierState tmp-CSE form (12->10 diffs), GetModifierState/AttachCB/DetachCB/KeyEventCB verified; tiTextDrawer const-first fmuls order
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 14:33:10 +00:00
Devin AI
37c7ed66c9 keyboard: MyTiManager EditMemoState::updateInput — hoisted bool ret; decl binds r30 (0 diffs)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 10:22:32 +00:00
Devin AI
0d43428526 MyTiInputForm: drop out-of-line GUIManager::changeEventHandler def (header back to in-class after DOL regression fix)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 10:15:39 +00:00
Devin AI
9adb3e9996 keyboard: fix DOL regression — revert EventHandler decl-only (in-class is base model); decl-only InputForm setters + Manager::start/end with out-of-line defs in iplLetterWriter.cpp matching base GLOBAL emission
- tiGUIManager.h: restore in-class onEvent/setLatestEventCtrlNo/getLatestEventCtrlNo/changeEventHandler (base emits weak copies in linked TUs; decl-only refs resolved via base tiPcKeyboard.o broke -ipa codegen globally)
- MyTiInputForm.h: setNigaoeEventObserver declared-only (base: GLOBAL only in iplLetterWriter.o @0x50c)
- tiManager.h: start/end declared-only (base: GLOBAL only in iplLetterWriter.o @0x524/@0xc38)
- iplLetterWriter.cpp: out-of-line defs for memo::InputForm::setNigaoeEventObserver, letter::InputForm::setPhotoDraw/setType, Manager::start/end at base's exact emission positions; base .text identical through 0xf50
- tiPcKeyboard.cpp: drop EventHandler out-of-line defs (in-class model)
- DOL sha1 26116613 verified

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 10:14:27 +00:00
Devin AI
82c2972066 keyboard: EventHandler method TU-placement, HWKeyboard::csAninationFile shared table, inputChar/tiHKBManager variants; remove ifdef pure-virtual trick
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 09:45:42 +00:00
Devin AI
42beb56024 MyTiInputForm: move scroll-visible bools to base class, fix AnimPaneGroup List_Init, direct startAnm overload
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 09:32:28 +00:00
Devin AI
43f6f77c15 tiHwKeyboard: match 9/10 fns via named-reference getInstance binding
- init, updateShift, updateInput, updateRepeatKey_, updateTappingShift_,
  convertWCCode, setLanguage, __ct__ now identical (previously updateTriggerKey_
  alone was near; restoring 'LayoutGather &gather = getInstance()' local
  fixes the whole unit's instruction streams)
- scKeyRepeatData/scTriggerData already in .sdata2 like base
- Residuals: updateTriggerKey_ 405/405-insn callee-reg permutation
  (base binds this->r27/hkb->r28/mods->r29 + 3 loop locals r24-26);
  .bss node 12v16B (local-static chain); weak @GUARD/@LOCAL emission
  vs base UND-in-this-TU/GLOBAL-in-tiPcKeyboard

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 01:29:28 +00:00
Devin AI
3c4d73e4d1 tiCellPhone: bool mbLineFeed member + read-back idiom
setLineFeedButton/setPredictLanguageButton/updatePredictLanguage identical
via storing bool member then passing it to setVisible (MWCC emits
lbz+rlwinm canonicalize mask). onActive remains 4 stack-slot diffs.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 01:04:00 +00:00
Devin AI
b0fc50b103 tiTextDrawer: shrink DrawInfo to 24 bytes (matches base frame)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 00:57:17 +00:00
Devin AI
6ec9f39ae7 keyboard tiHKBManager: head-first decl order for listener walks
- AttachCB/DetachCB/KeyEventCB: declare head before listener so MWCC
  binds listener to the lower callee reg (8->3 diffs, prologue-schedule
  tie remains)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 00:33:04 +00:00
Devin AI
4865afc664 keyboard tiString: !=0 bool conversions + s32 mTranslateMode
- isDakuten/isHandaku/isSmall: explicit !=0 on util fn results emits
  neg/or/rlwinm idiom - all 3 identical
- mTranslateMode u32->s32: signed cmpw vs cmplw - setTranslateMode and
  inputString(PCw,mode) identical
- inputChar residual: base keeps live-index sthx stores in mode==3 arm
  (count not constant-foldable - tie-break)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 00:28:13 +00:00
Devin AI
40856d3a48 keyboard: MyTiManager decl-only accessor virtuals + non-static state objects
- memo::Manager accessor virtuals setSaveData/getSaveData/getState/getConfigType
  decl-only in header (out-of-line defs live in consumer TUs like base) ->
  kills 4 weak-copy extras and fixes .data to 100%
- state objects sDisp/sEdit/sAppear/sDisappear non-static -> GLOBAL binds
  matching base symtab (.sbss/.bss placement identical)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 00:18:37 +00:00
Devin AI
3d11c10ef1 keyboard: align ported headers with remote model; fix DOL regression
- tiGUIManager.{h,cpp}: use remote tip's consistent model (decl-only
  ~GUIComponent/getFlightDuration/setFlightDuration defined in cpp);
  main's inline-only variant + remote cpps moved weak-method emission
  out of base-expected TUs (wrong DOL hash)
- MyTiLetterForm.cpp: trigger -> field_0x0C (remote header naming)
- port headers for MyTiInputForm/MyTiLetterForm/tiInputForm/tiNw4rManager/
  tiSignWindow/tiString/tiTextDrawer into my ported units
Verified: full build, sha1 26116613f624061ba99c8d1a299aaa6efa85670d

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-30 22:39:58 +00:00
Devin AI
98574fffcc Merge remote leaf line: verified keyboard work (DOL-identical) onto latest main
Remote tip carries the authoritative leaf state (17 commits incl. tiHwKeyboard
scaffolding, vt-slot fixes, Sample dtor thunk order, tiManager->tiKeyboard
rename). Resolved 26 add/add+content conflicts taking the remote line; my
session edits kept as attempts-doc notes.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-30 22:04:53 +00:00
Devin AI
9e56f9f587 keyboard: tiPcKeyboard setTranslateMode exact + tie-break documentation
setTranslateMode: uninitialized keyMode + 3-case switch (no default) preserves
the original UB register state — 105/105 diffs 0. updateInput/getControlKey/
onPressedShift documented as lazy-width/reg tie-breaks; tiString inputChar,
tiZiString clearCandidates/update, tiCandidateBox create loop strength-
reduction, MyTiInputForm vtable-order via IMPL guards.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-30 21:59:01 +00:00
devin-ai-integration[bot]
787aa9d334 Link fa/driver nand_drv + msc_drv (#400)
Co-authored-by: devin <devin@cognition.ai>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-30 18:41:06 +00:00
coah
30809a5b05 BS2Mach: BS2Tick 77 -> 98% (worker 86b254ad) (#399) 2026-09-30 13:34:56 -05:00
coah
c21ae517d5 fix: replace lbl_ string pin in FAInit with a literal (#398) 2026-09-30 13:19:03 -05:00
coah
5c7d7ca74a zi8match 8/10 (data 100%) (worker 5d91f712) (#397) 2026-09-30 13:17:06 -05:00
github-actions[bot]
7a94e90a6e docs: update progress [skip ci] 2026-09-30 18:11:32 +00:00
devin-ai-integration[bot]
cec99e3cf8 Link vi/i2c + vi3in1 (#396)
Co-authored-by: devin <devin@cognition.ai>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-30 18:10:55 +00:00
github-actions[bot]
6172b57647 docs: update progress [skip ci] 2026-09-30 18:10:40 +00:00
devin-ai-integration[bot]
bed8e32e57 Link 18 fa/api units (#395)
Co-authored-by: devin <devin@cognition.ai>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-30 18:10:01 +00:00
coah
930e8f4ecf CHANSVm 208/233 (worker 662bd0e0) (#394) 2026-09-30 12:45:06 -05:00
coah
c835bedbc1 zikorean 3/3; zkokeyp 98.6, zprepare 96 (worker 58c15bd8) (#393) 2026-09-30 12:35:36 -05:00
coah
5981234728 scene units: small fuzzy gains (worker 0eaf4057) (#392) 2026-09-30 12:13:13 -05:00
github-actions[bot]
3b2304bd75 docs: update progress [skip ci] 2026-09-30 17:12:29 +00:00
Devin AI
960e1306cb keyboard: fix vt slot targets — drop spurious Base overrides, add LbNW onKey/sign-page/close overrides
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 15:34:00 +00:00
Devin AI
b4a59ad689 tiHwKeyboard: guard-goto for mods&8, compound OR range check, updateTriggerKey_ ~99.5
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 14:52:20 +00:00
Devin AI
830ddafdcc keyboard: Sample dtor inline decls fix @N@ thunk order; DOL byte-identical
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
9eb648ea69 keyboard phase-2: tiCellPhone impl + tiPcKeyboard/tiHKBManager/tiHwKeyboard iteration
- tiCellPhone: full unit implementation (Base/L/EventHandler), 69/86 fns at 100
- tiPcKeyboard: remaining-iteration, string pool identical 204/204
- tiHKBManager: GetModifierState unrolled state-mask merge
- tiHwKeyboard: updateTriggerKey_ residual tie-break
- MyTiManager: bg::Base defs placement, memo::Manager vtable verified (all virtuals present in orig)
- Remaining diffs are count-equal register/scheduling tie-breaks

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
94e9a06c27 keyboard: tiHKBManager decomp iteration + header fixes
SetModifierState: evaluate LED-change as (old-new)|(new-old) value
GetVCode: compute state pointer inside switch cases, fold +0x14 into field offsets
SetLedCB: bit kept in callee reg, stack-layout residual tie
GetWChar: wchar_t local (u16 re-masking regressed)
Remaining diffs are count-equal register/scheduling ties

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
3abff608be keyboard headers: layout fixes
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
5f000e6f7d tiHKBManager/tiPcKeyboard: GetModifierState loop, SetLedCB arg local, init _VEC3 statics
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
fb938ba39d keyboard: tiPcKeyboard decode — setABCFlag/isFocused/updateFromReceiver/setLineFeedButton fixes
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
83f4b45d20 tiPcKeyboard: emitted-copy defs + Base field layout fix
- Remove spurious pctype::Base::mLanguage (orig uses inherited
  KeyboardBase::meLanguage @0x10) — fixes @68/@236 thunk offsets
- Add non-inline defs orig emits here: Manager getters, CommandSender::
  sendCommand, KeyboardBase::update/getLanguage, Layout/AnmPane helpers,
  candidatebox isActive, inputform canConvert, pctype::Base virtuals
  (getType/getState/inputCharCode/setLanguage/setLangKeyActive/onlyQwerty/
  updateFixMode/getABCInputMode/getAIUInputMode/~Base), EventHandler dtor,
  AnmPane::onAnmEvent base
- Rename KeyState::setABCFlag_/refreshText_ to orig names setABCFlag/
  refreshText
- Declare inputform::Base::getCurrentString(bool)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
c6909021b7 WIP: keyboard phase-2 headers + tiKeyboard/tiHKBManager/tiHwKeyboard progress
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
78dbea9228 tiInputForm: type lbl_81698D1C as f32 per symbols.txt
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
0b993824b3 tiInputForm: emit pooled literals + missing sbss object
- Replace extern-C string globals with emitPooledLiterals(): the original
  call sites (EventObserver::onOutOfLength, TextBox::GetTextColor's
  NW4R_ASSERT) live in asm transcriptions, so MWCC never pooled their
  literals; a real C++ call emits them at the correct .data position.
- Define lbl_81698D1C to restore the missing 4-byte .sbss object.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
a2f7638917 tiCandidateBox: reproduce .sdata layout (explicit_zero_data keeps zero wchar in .sdata)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
b0767c5338 tiCandidateBox: fix pane-name blob stride (20-byte entries); drop onEvent decl-only
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
f5a3ae1469 revert shared-header decl-only conversions that break the link; keep owned-unit edits
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
82ad173f9a keyboard: match tiInputForm .text/.sdata/.sdata2/.rodata; decl-only shared accessor headers
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
Devin AI
e1b6078625 tiCandidateBox: fix string pool/sdata layout, Draw scissor + Vec init order
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 12:50:17 +00:00
79 changed files with 30856 additions and 11562 deletions

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 98.06% | 84.71% | 58.20% | 90.34% |
| 98.27% | 85.37% | 59.71% | 90.53% |
units 778/1027 complete, functions 12070/12563 matched.
units 805/1027 complete, functions 12090/12563 matched.
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
<!-- progress:end -->

View File

@@ -1054,7 +1054,7 @@ src/keyboard/tiNw4rManager.cpp:
.data start:0x8165F818 end:0x8165F8F0
.sdata2 start:0x81694E10 end:0x81694E28
src/keyboard/tiManager.cpp:
src/keyboard/tiKeyboard.cpp:
.text start:0x81437558 end:0x81439608
.ctors start:0x8160D208 end:0x8160D20C
.data start:0x8165F8F0 end:0x81660378

View File

@@ -920,7 +920,7 @@ config.libs = [
Object(NonMatching, "keyboard/tiZiString.cpp", extra_cflags=["-O4,p"]), # for 4.3U and 4.3E
Object(NonMatching, "keyboard/tiTextDrawer.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiNw4rManager.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/tiManager.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/tiKeyboard.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiUtil.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiCpData.cpp", extra_cflags=["-O4,p"], shift_jis=False),
Object(Matching, "keyboard/tiSwData.cpp", extra_cflags=["-O4,p"], shift_jis=False),
@@ -1389,8 +1389,8 @@ config.libs = [
),
RVLSDKLib("vi", [
Object(NonMatching, "vi/vi.c"),
Object(NonMatching, "vi/i2c.c"),
Object(NonMatching, "vi/vi3in1.c"),
Object(Matching, "vi/i2c.c"),
Object(Matching, "vi/vi3in1.c"),
]
),
RVLSDKLib("mtx", [
@@ -1853,10 +1853,10 @@ config.libs = [
Object(NonMatching, "fa/kernel/pfk_api.c"),
Object(NonMatching, "fa/driver/nand_drv.c"),
Object(Matching, "fa/driver/nand_drv.c"),
Object(NonMatching, "fa/driver/sd_drv.c"),
Object(NonMatching, "fa/driver/pfd_cmn.c"),
Object(NonMatching, "fa/driver/msc_drv.c"),
Object(Matching, "fa/driver/msc_drv.c"),
Object(NonMatching, "fa/msc/puh_msc.c"),
Object(NonMatching, "fa/msc/puh_msc_cmd.c"),

View File

@@ -14,17 +14,11 @@ namespace textinput {
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
public:
#ifdef MYTIMANAGER_IMPLEMENTATION
LayoutByNW4R(nw4r::lyt::MultiArcResourceAccessor* multiArc, const char* layoutName, EventObserver* event)
: nw4rmanager::Layout(multiArc, layoutName, event) {}
#endif
#if defined(MYTIMANAGER_MATCHING)
LayoutByNW4R(nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* layoutBinName,
EventObserver* event)
: nw4rmanager::Layout(resAccessor, layoutBinName, event) {}
virtual ~LayoutByNW4R() {}
#elif defined(MYTIMANAGER_IMPLEMENTATION)
virtual ~LayoutByNW4R();
#else
virtual ~LayoutByNW4R() {}
#endif
virtual void create(MEMAllocator* allocator);
virtual void init();

View File

@@ -3,6 +3,7 @@
#include "tiInputForm.h"
#include "tiString.h"
#include "tiUtil.h"
#include <nw4r/lyt/pane.h>
@@ -20,9 +21,7 @@ namespace textinput {
virtual void moveNigaoeButton() {}
};
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
class ScrollButton;
#endif
class InputForm : public textinput::InputForm {
public:
@@ -34,51 +33,24 @@ namespace textinput {
EM_Last
} EditMode;
#ifdef MYTIMANAGER_IMPLEMENTATION
InputForm(textinput::Manager* manager, nw4r::lyt::MultiArcResourceAccessor* multiArc,
const char* layoutName, EventObserver* event, const char* fontName)
: textinput::InputForm(manager, multiArc, layoutName, event, fontName),
unk_0x308(NULL), unk_0x30C(NULL), unk_0x310(NULL), unk_0x314(NULL),
InputForm(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName,
EventObserver* observer, const char* subName)
: textinput::InputForm(manager, resAccessor, arcName, observer, subName),
mpMemoPane(NULL), mpMemoRootPane(NULL), mpBoundPane(NULL), mpDrawPane(NULL),
mfScroll(0.0f), mfScrollFrom(0.0f), mfScrollTo(0.0f), mnLine(0),
mDrawRect(), mDefaultDrawSize(), mDefaultBoundSize(), mExScrollAnm(),
mDrawRect(0.0f, 0.0f, 0.0f, 0.0f), mDefaultDrawSize(0.0f, 0.0f), mDefaultBoundSize(0.0f, 0.0f),
mpNigaoeObserver(NULL), mpDefaultNigaoe(NULL), mpSendString(NULL),
mbEdited(false), mbGoodBye(false), mbEditScrollUp(false), mbEditScrollDown(false),
mbCloseWithSend(false), mpScrollButton(NULL), mbScrollUp(false), mbScrollDown(false),
meEditMode(EM_Disp) {}
#endif
mbEdited(false), mbGoodBye(false), mbEditScrollUp(false), mbEditScrollDown(false), mbCloseWithSend(false),
mpScrollButton(NULL), mbScrollUp(false), mbScrollDown(false), meEditMode(EM_Disp) {}
~InputForm();
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
virtual void moveCursorUp();
virtual void moveCursorDown();
virtual void onCommand(INPUT_COMMAND command, void* data);
virtual void create(MEMAllocator* allocator, inputform::EditBuffer* editBuffer);
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
virtual bool updateInput(input::HKBManager& hkbManager);
virtual void init();
virtual void draw();
virtual void calc();
virtual void doScroll(Scroll* scroll);
virtual u32 calcCursorPos(f32 x, f32 y);
virtual void drawCursor(f32 x, f32 y);
virtual nw4r::math::VEC2 getScale() const;
virtual void preDraw(u32 pos);
virtual void doLineFeed();
virtual void finishDraw(u32 pos);
virtual bool isInScroll();
#endif
virtual void setScroll(f32 scroll);
virtual void setAddScroll(f32 scroll, bool up, bool down);
virtual f32 getScroll() { return mfScroll; }
#ifdef MYTIMANAGER_IMPLEMENTATION
virtual f32 getScrollFrom();
virtual f32 getScrollTo();
#else
virtual f32 getScroll() { return mfScroll; }
virtual f32 getScrollFrom() { return mfScrollFrom; }
virtual f32 getScrollTo() { return mfScrollTo; }
#endif
virtual f32 getScrollTo() { return mfScrollTo; }
virtual void open();
virtual void close();
@@ -100,7 +72,7 @@ namespace textinput {
virtual void onArrowRTrig();
virtual void onArrowLTrig();
virtual void setNigaoeEventObserver(NigaoeEventObserver* nigaoeObserver) { mpNigaoeObserver = nigaoeObserver; }
virtual void setNigaoeEventObserver(NigaoeEventObserver* nigaoeObserver);
virtual nw4r::lyt::Pane* getNigaoePane();
virtual nw4r::lyt::Material* getNigaoePaneMaterial();
@@ -122,6 +94,33 @@ namespace textinput {
virtual void onCommandOnEditMode(INPUT_COMMAND command, void* arg);
virtual void doAutoScroll();
#ifdef MYTIINPUTFORM_IMPLEMENTATION
virtual void pure_0() = 0;
virtual void pure_1() = 0;
virtual void pure_2() = 0;
virtual void pure_3() = 0;
virtual void pure_4() = 0;
virtual void pure_5() = 0;
#endif
virtual void create(MEMAllocator* allocator, inputform::EditBuffer* editBuffer);
virtual void moveCursorUp();
virtual void moveCursorDown();
virtual void onCommand(CommandReceiver::INPUT_COMMAND command, void* arg);
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
virtual bool updateInput(textinput::input::HKBManager& hkbManager);
virtual void init();
virtual void draw();
virtual void calc();
virtual void doScroll(CommandReceiver::Scroll* scroll);
virtual u32 calcCursorPos(f32 x, f32 y);
virtual void drawCursor(f32 x, f32 y);
virtual nw4r::math::VEC2 getScale() const;
virtual void preDraw(u32);
virtual void doLineFeed();
virtual void finishDraw(u32);
virtual bool isInScroll();
/* For letter writing */
@@ -131,11 +130,7 @@ namespace textinput {
void setEditScrollDown(bool editScrollDown) { mbEditScrollUp = editScrollDown; }
void setCloseWithSend(bool closeWithSend) { mbCloseWithSend = closeWithSend; }
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
void setEditMode(EditMode editMode);
#else
void setEditMode(EditMode editMode) { meEditMode = editMode; }
#endif
bool isEdited() { return mbEdited; }
bool isGoodBye() { return mbGoodBye; }
@@ -147,24 +142,11 @@ namespace textinput {
tistring::Decolated* getSendString() { return mpSendString; }
#ifdef MYTILETTERFORM_IMPLEMENTATION
protected:
#else
private:
#endif
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
nw4r::lyt::Pane* mpMemoPane;
nw4r::lyt::Pane* mpMemoRootPane;
nw4r::lyt::Pane* mpBoundPane;
nw4r::lyt::Pane* mpDrawPane;
#else
#ifdef MYTIMANAGER_IMPLEMENTATION
undefined4* unk_0x308;
#endif
undefined4* unk_0x30C;
undefined4* unk_0x310;
undefined4* unk_0x314;
#endif
nw4r::lyt::Pane* mpMemoPane; // 0x308
nw4r::lyt::Pane* mpMemoRootPane; // 0x30C
nw4r::lyt::Pane* mpBoundPane; // 0x310
nw4r::lyt::Pane* mpDrawPane; // 0x314
f32 mfScroll; // 0x318
f32 mfScrollFrom; // 0x31C
f32 mfScrollTo; // 0x320
@@ -176,11 +158,7 @@ namespace textinput {
nw4r::lyt::Size mDefaultBoundSize; // 0x358
Mtx mDrawMtx; // 0x360
Mtx mBoundMtx; // 0x390
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
util::Animation mExScrollAnm; // 0x3C0
#else
u8 /*todo*/ mExScrollAnm[32]; // 0x3C0
#endif
NigaoeEventObserver* mpNigaoeObserver; // 0x3E0
GXTexObj* mpDefaultNigaoe; // 0x3E4
tistring::Decolated* mpSendString; // 0x3E8
@@ -190,13 +168,10 @@ namespace textinput {
bool mbEditScrollDown; // 0x3EF
bool mbCloseWithSend; // 0x3F0
u8 padding[3]; // 0x3F1
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
ScrollButton* mpScrollButton;
#else
undefined4* mpScrollButton;
#endif
ScrollButton* mpScrollButton; // 0x3F4
bool mbScrollUp; // 0x3F8
bool mbScrollDown; // 0x3F9
u8 padding2[2]; // 0x3FA
EditMode meEditMode; // 0x3FC
};
}

View File

@@ -16,42 +16,36 @@ namespace textinput {
T_Last,
} Type;
#ifdef MYTIMANAGER_IMPLEMENTATION
InputForm(textinput::Manager* manager, nw4r::lyt::MultiArcResourceAccessor* multiArc,
const char* layoutName, EventObserver* event, const char* fontName)
: textinput::MemoInputForm(manager, multiArc, layoutName, event, fontName),
unk_0x400(0), mbPhotoDraw(false), meType(T_MailAddressSel) {}
#endif
InputForm(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName,
EventObserver* observer, const char* subName)
: MemoInputForm(manager, resAccessor, arcName, observer, subName),
mbPhotoScaledUp(false), mbPhotoDraw(false), meType(T_MailAddressSel) {}
~InputForm();
virtual void create(MEMAllocator* allocator, inputform::EditBuffer* editBuffer);
virtual void drawBody();
virtual void drawFooter();
virtual void open();
virtual void close();
virtual bool isWholePaneInAnimation();
#ifdef MYTILETTERFORM_IMPLEMENTATION
virtual ~InputForm();
virtual void create(MEMAllocator*, inputform::EditBuffer*);
virtual void drawBody();
virtual void drawFooter();
virtual void open();
virtual void close();
virtual bool isWholePaneInAnimation();
#endif
virtual nw4r::lyt::Material* getPhotoPaneMaterial();
virtual void onPhotoTrig();
virtual void onPhotoPoint();
virtual void onPhotoLeft();
virtual bool isPhotoScaledUp();
virtual void setPhotoDraw(bool photoDraw) { mbPhotoDraw = photoDraw; }
virtual void setPhotoDraw(bool photoDraw);
virtual void setType(Type type) { meType = type; }
virtual void setType(Type type);
virtual void setSendOutMessage(const wchar_t* sendOutMessage);
void resizePhotoPane(f32 width, f32 height);
private:
#ifdef MYTILETTERFORM_IMPLEMENTATION
bool mbPhotoScaledUp;
#else
u8 unk_0x400;
#endif
bool mbPhotoScaledUp; // 0x400
bool mbPhotoDraw; // 0x401
Type meType; // 0x404
};

View File

@@ -8,6 +8,10 @@
namespace textinput {
namespace extend {
namespace bg {
class LayoutByNW4R;
}
namespace memo {
class State;
@@ -28,9 +32,7 @@ namespace textinput {
CT_NumericWithSeparator,
CT_NormalWithoutLineFeedWithSign,
CT_PredictWithoutLineFeed,
#ifdef MYTIMANAGER_IMPLEMENTATION
CT_PredictBigText,
#endif
CT_Last
} ConfigType;
@@ -81,35 +83,21 @@ namespace textinput {
virtual void start();
virtual void end();
#ifdef MYTIMANAGER_IMPLEMENTATION
virtual textinput::InputForm* createInputForm();
#else
virtual InputForm* createInputForm();
#endif
virtual textinput::InputForm* createInputForm();
virtual void memoDraw();
virtual void setSaveData(savedata::MemoSetting memoSetting) {
mMemoSetting = memoSetting;
}
virtual savedata::MemoSetting getSaveData() { return mMemoSetting; }
virtual void setSaveData(savedata::MemoSetting memoSetting);
virtual savedata::MemoSetting getSaveData();
virtual void changeState(StateTimeLine stateTimeLine);
virtual State* getState() { return mpCurrentState; }
virtual State* getState();
virtual void setState(StateType stateType);
virtual ConfigType getConfigType() { return meConfigType; }
virtual ConfigType getConfigType();
#ifdef MYTIMANAGER_IMPLEMENTATION
virtual void setSaveData();
#else
virtual void setSaveData_();
#endif
virtual void reflectSaveData();
#ifdef MYTIMANAGER_IMPLEMENTATION
void reflectSaveDataRev1();
void reflectSaveDataDefault();
#endif
virtual void configDefault();
virtual void configLetter();
@@ -126,21 +114,24 @@ namespace textinput {
virtual void configNormalWithoutLineFeedWithSign();
virtual void configPredictWithoutLineFeed();
virtual void configPredictBigText();
#ifdef MYTIMANAGER_IMPLEMENTATION
virtual textinput::MemoInputForm* createMemoInputForm();
virtual textinput::LetterInputForm* createLetterInputForm();
virtual textinput::InputForm* createBigTextInputForm();
virtual void* createBG();
#else
virtual void createMemoInputForm();
virtual void createLetterInputForm();
virtual void createBigTextInputForm();
virtual void createBG();
#endif
virtual InputForm* createMemoInputForm();
virtual letter::InputForm* createLetterInputForm();
virtual textinput::InputForm* createBigTextInputForm();
virtual bg::LayoutByNW4R* createBG();
#ifdef MYTIMANAGER_IMPLEMENTATION
void* getBackGround() const { return mpBackGround; }
#endif
virtual void pure_0() {}
virtual void pure_1() {}
virtual void pure_2() {}
virtual void pure_3() {}
virtual void pure_4() {}
virtual void pure_5() {}
virtual void pure_6() {}
virtual void pure_7() {}
virtual void pure_8() {}
virtual void pure_9() {}
void reflectSaveDataRev1();
void reflectSaveDataDefault();
private:
State* mpCurrentState; // 0x40
@@ -149,25 +140,22 @@ namespace textinput {
MemoInputForm* mpMemoInputForm; // 0x50
LetterInputForm* mpLetterInputForm; // 0x54
textinput::InputForm* mpBigTextInputForm; // 0x58
void* mpDefaultPCKeyboard; // 0x5C
void* mpDefaultCellPhoneKeyboard; // 0x60
keyboard::pctype::LayoutByNW4R* mpDefaultPCKeyboard; // 0x5C
keyboard::cellphonetype::LayoutByNW4R* mpDefaultCellPhoneKeyboard; // 0x60
textinput::InputForm* mpDefaultInputForm; // 0x64
void* mpDefaultCandidateBox; // 0x68
void* mpDefaultToolBar; // 0x6C
void* mpDefaultPredictLanguageDialog; // 0x70
void* mpDefaultSignWindow; // 0x74
void* mpBackGround; // 0x78
candidatebox::LayoutByNW4R* mpDefaultCandidateBox; // 0x68
toolbar::LayoutByNW4R* mpDefaultToolBar; // 0x6C
predictlang::LayoutByNW4R* mpDefaultPredictLanguageDialog; // 0x70
keyboard::signwindow::LayoutByNW4R* mpDefaultSignWindow; // 0x74
bg::LayoutByNW4R* mpBackGround; // 0x78
friend class State;
};
class State {
public:
#ifdef MYTIMANAGER_IMPLEMENTATION
State() : mpManager(NULL) {}
Manager* getManager() const { return mpManager; }
void setManager(Manager* manager) { mpManager = manager; }
#endif
virtual ~State();
#ifdef MYTIMANAGER_MATCHING
virtual Manager::StateType getStateType() = 0;
virtual void create() = 0;
@@ -185,11 +173,49 @@ namespace textinput {
virtual void start() = 0;
virtual void end() = 0;
#else
virtual InputForm* InputForm();
virtual keyboard::hwkey::HWKeyboard* HWKeyboard();
virtual keyboard::pctype::LayoutByNW4R* PCKeyboard();
virtual keyboard::cellphonetype::LayoutByNW4R* CellPhoneKeyboard();
virtual keyboard::signwindow::LayoutByNW4R* SignKeyboard();
virtual candidatebox::LayoutByNW4R* CandidateBox();
virtual toolbar::LayoutByNW4R* ToolBar();
virtual predictlang::LayoutByNW4R* PredictLanguageSelectDialog();
virtual bg::LayoutByNW4R* BG();
protected:
Manager* mpManager; // 0x04
friend class Manager;
};
class DispMemoState : public State {
public:
virtual ~DispMemoState();
virtual Manager::StateType getStateType();
virtual void create();
virtual void init();
virtual void draw();
virtual void memoDraw();
virtual void calc();
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release);
virtual bool updateInput(input::HKBManager& hkbManager);
virtual void start();
virtual void end();
};
class AppearMemoState : public State {
public:
AppearMemoState() : mfAnim(0.0f) {}
virtual ~AppearMemoState();
virtual Manager::StateType getStateType();
virtual void create();
virtual void init();
virtual void draw();
@@ -203,25 +229,44 @@ namespace textinput {
virtual void start();
virtual void end();
#endif
#ifdef MYTIMANAGER_IMPLEMENTATION
virtual InputForm* InputForm();
virtual keyboard::hwkey::HWKeyboard* HWKeyboard();
virtual keyboard::pctype::LayoutByNW4R* PCKeyboard();
virtual keyboard::cellphonetype::LayoutByNW4R* CellPhoneKeyboard();
virtual void* SignKeyboard();
virtual candidatebox::LayoutByNW4R* CandidateBox();
virtual toolbar::LayoutByNW4R* ToolBar();
virtual void* PredictLanguageSelectDialog();
virtual void* BG();
#endif
protected:
f32 mfAnim; // 0x08
};
private:
Manager* mpManager; // 0x04
class EditMemoState : public State {
public:
virtual ~EditMemoState();
virtual Manager::StateType getStateType();
virtual void create();
virtual void init();
virtual void draw();
virtual void memoDraw();
virtual void calc();
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release);
virtual bool updateInput(input::HKBManager& hkbManager);
virtual void start();
virtual void end();
};
class DisappearMemoState : public AppearMemoState {
public:
virtual ~DisappearMemoState();
virtual Manager::StateType getStateType();
virtual void calc();
virtual void start();
};
}
}
typedef extend::memo::Manager MemoManager;
}
#include "MyTiBg.h"
#endif // TEXTINPUT_MY_MANAGER_H

View File

@@ -48,9 +48,6 @@ namespace textinput {
class CandidateBoxCaller {
public:
#ifdef TIINPUTFORM_IMPLEMENTATION
CandidateBoxCaller() : mpCandidateBox(NULL) {}
#endif
// This candidate thing is a bit different from the dwarf
class Candidates {
public:
@@ -77,9 +74,11 @@ namespace textinput {
class Base : public CommandSender {
public:
#ifdef TIMANAGER_IMPLEMENTATION
Base(Manager* manager) : mpCandidates(NULL), mpAllocator(NULL), mbOn(false), mbInvalid(true), meLanguage(USA), mpManager(manager) {}
#ifdef TI_CANDIDATEBOX_SAMPLE_CLASS
Base(Manager* manager)
: mpCandidates(NULL), mpAllocator(NULL), mbOn(false), mbInvalid(true), meLanguage(USA), mpManager(manager) {}
#endif
virtual ~Base();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override {}
@@ -114,9 +113,8 @@ namespace textinput {
class EventHandler : public nw4rmanager::TiEventHandler {
public:
#ifdef TIMANAGER_IMPLEMENTATION
EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
#endif
virtual void onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) override; // 0x18
LayoutByNW4R* mpLayoutByNW4R; // 0xC
@@ -290,13 +288,13 @@ namespace textinput {
// TODO
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public UIObj::Listener {
public:
#ifdef TIMANAGER_IMPLEMENTATION
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* accessor, EventObserver* observer, const char* layoutName)
: Base(manager), nw4rmanager::Layout(accessor, layoutName, observer), mEventHandler(this), mpTiString(NULL),
mTextArea(0, this, this), mLeftScroll(1, this, this), mRightScroll(2, this, this), mOnOffButton(3, this, this),
mTextWindow(4, this, this), mbActive(true) {}
const UIOnOffButton& getOnOffButton() const { return mOnOffButton; }
#ifdef TI_CANDIDATEBOX_SAMPLE_CLASS
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, arcName, observer), mEventHandler(this),
mpTiString(NULL), mTextArea(0, this, this), mLeftScroll(1, this, this), mRightScroll(2, this, this),
mOnOffButton(3, this, this), mTextWindow(4, this, this), mbActive(true) {}
#endif
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
@@ -325,11 +323,7 @@ namespace textinput {
virtual u16 getScroll() { return mTextArea.GetDispOffset(); } // 0x100
virtual bool isInScroll(); // 0x104
virtual void setActive(bool active); // 0x108
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
virtual bool isActive() const { return mbActive; }
#else
virtual bool isActive() const;
#endif // 0x10C
virtual bool isActive() const; // 0x10C
virtual void setSelectedTextPane(int pane) { mTextArea.SetSelectedText(pane); } // 0x110
virtual void setFocusedTextPane(int pane) { mTextArea.SetFocusedText(pane); } // 0x114
virtual int getFocusedTextPane() { return mTextArea.GetFocusedText(); } // 0x118
@@ -339,13 +333,13 @@ namespace textinput {
virtual void cancelStateFocusIn(); // 0x128
virtual void onEvent(UIObj*, u32, void*) override; // 0x12C
#ifdef TIINPUTFORM_IMPLEMENTATION
UITextArea& getTextArea() { return mTextArea; }
#endif
void onPressedShift(bool shift);
void onReleasedShift();
void startTurnOn(bool);
UIOnOffButton& getOnOffButton() { return mOnOffButton; }
const UIOnOffButton& getOnOffButton() const { return mOnOffButton; }
private:
void createAnmPane_(MEMAllocator* allocator);
@@ -408,6 +402,17 @@ namespace textinput {
virtual void onAnmEvent(AnmPaneEvent paneEvent) override; // 0x10
};
#ifdef TI_CANDIDATEBOX_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, arcName, observer) {}
virtual ~Sample();
};
#else
class Sample {};
#endif
} // namespace candidatebox
} // namespace textinput

View File

@@ -1,273 +1,226 @@
#ifndef TEXTINPUT_CELL_PHONE_H
#define TEXTINPUT_CELL_PHONE_H
#include "tiNw4rManager.h"
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
#include "tiKeyboard.h"
#endif
#include "tiNw4rManager.h"
#ifdef TI_CELLPHONE_IMPLEMENTATION
#include <revolution/gx.h>
#endif
namespace textinput {
class Manager;
#ifdef TI_CELLPHONE_SAMPLE_CLASS
class EventObserver;
#endif
namespace predictlang {
class LayoutByNW4R;
}
namespace keyboard {
#ifdef TI_CELLPHONE_IMPLEMENTATION
enum VKeyCode {
VK_LINE_FEED = 0,
VK_DELETE = 1,
VK_SIGN_INPUT = 9,
VK_PREDICT_LANGUAGE = 10,
VK_INPUT_MODE_02 = 11,
VK_INPUT_MODE_03 = 13,
VK_INPUT_MODE_00 = 18,
VK_INPUT_MODE_01 = 19,
VK_TOGGLE_ABC_MODE = 23,
};
#endif
namespace signwindow {
class LayoutByNW4R;
}
}
namespace keyboard {
class KeyboardBase;
typedef enum VKeyCode {
VK_LF = 0,
VK_DELETE = 1,
VK_SPACE = 2,
VK_OTHERS = 9,
VK_PRDC = 0xA,
VK_TAG_02 = 0xB,
VK_TAG_03 = 0xD,
VK_UNKNOWN_11 = 0x11,
VK_TAG_00 = 0x12,
VK_TAG_01 = 0x13,
VK_SML_CPT = 0x17,
VK_NONE = 0x1B,
} VKeyCode;
namespace cellphonetype {
class EventHandler;
#ifdef TI_CELLPHONE_IMPLEMENTATION
class CellPhoneAnmPane;
struct PaneNameToCharCode;
#endif
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
class Base : public textinput::keyboard::KeyboardBase {
#else
class Base {
#endif
struct KeySet;
struct LanguageDependency;
class LayoutByNW4R;
class Base : public KeyboardBase {
public:
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
#if defined(MYTIMANAGER_IMPLEMENTATION) && defined(TI_CELLPHONE_SAMPLE_CLASS)
Base(Manager* manager) : mPreviousInputMode(0), mCurrentInputMode(0), mpManager(manager) {}
#endif
enum InputMode {
typedef enum InputMode {
IM_00,
IM_01,
IM_02,
IM_03,
IM_04,
};
IM_05,
} InputMode;
virtual ~Base();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void updateFromReceiver(u32, void*) override;
virtual void onKey(u32, void*) override;
#ifdef TIMANAGER_IMPLEMENTATION
#ifdef TI_CELLPHONE_SAMPLE_CLASS
Base(Manager* manager) : mpManager(manager) {}
#endif
#if defined(TI_CELLPHONE_IMPLEMENTATION)
virtual u32 getType() override;
#elif defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION)
virtual int getType() override;
#elif defined(TIHWKEYBOARD_IMPLEMENTATION)
virtual int getType() override;
#else
virtual void getType() override;
#endif
virtual void onActive() override;
virtual void calc();
virtual void draw();
virtual InputMode getInputMode() const;
virtual bool isLocked() const;
virtual bool isNumeric() const;
virtual bool isNumericWithDot() const;
virtual bool isHoldingButton() const;
virtual void doNumericMode(bool);
virtual void changeInputMode(InputMode);
virtual bool isUpperCase();
virtual void setInputMode(InputMode);
virtual void setUpperCaseJP(bool);
virtual void setLangKeyActive(bool);
virtual bool onClose();
virtual void goSignInputMode();
virtual void changePredictLanguage();
virtual void setAbcMode(bool);
virtual bool isZiActive();
virtual bool isAtokActive();
virtual void doInput();
virtual void updateFixMode();
#ifdef TI_CELLPHONE_IMPLEMENTATION
wchar_t convertToZiCellphoneInput_(wchar_t value);
#endif
#else
virtual void vt_0x08();
virtual void vt_0x0C();
virtual void vt_0x10();
virtual void vt_0x14();
virtual void vt_0x18();
virtual void vt_0x1C();
virtual void vt_0x20();
virtual void vt_0x24();
virtual void vt_0x28();
virtual void vt_0x2C();
virtual void vt_0x30();
virtual void vt_0x34();
virtual void vt_0x38();
virtual void vt_0x3C();
virtual void vt_0x40();
virtual void vt_0x44();
virtual bool isNumeric() const;
virtual void create(MEMAllocator* allocator) override; // 0x0C
virtual void init() override; // 0x10
virtual void setCommandReceiver(CommandReceiver* receiver) override; // 0x14
virtual void sendCommand(u32, void*) override; // 0x18
virtual void updateFromReceiver(u32, void*) override; // 0x1C
virtual void onKey(u32, void*); // 0x20
virtual int getType(); // 0x24
virtual void setLanguage(Language language) override; // 0x28
virtual Language getLanguage() const override; // 0x2C
virtual void onActive() override; // 0x34
virtual void calc(); // 0x38
virtual void draw(); // 0x3C
virtual int getInputMode() const; // 0x40
virtual bool isLocked() const; // 0x44
virtual bool isNumeric() const; // 0x48
virtual bool isNumericWithDot() const; // 0x4C
virtual bool isHoldingButton() const; // 0x50
virtual void doNumericMode(bool); // 0x54
virtual void changeInputMode(InputMode mode); // 0x58
virtual bool isUpperCase(); // 0x5C
virtual void setInputMode(InputMode mode); // 0x60
virtual void setUpperCaseJP(bool); // 0x64
virtual void setLangKeyActive(bool); // 0x68
virtual void onClose(); // 0x6C
virtual void goSignInputMode(); // 0x70
virtual void changePredictLanguage(); // 0x74
virtual void setAbcMode(bool); // 0x78
virtual bool isZiActive(); // 0x7C
virtual bool isAtokActive(); // 0x80
virtual void doInput(); // 0x84
virtual void updateFixMode(); // 0x88
virtual void vt_0x4C();
virtual void vt_0x50();
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
virtual void doNumericMode(bool);
#else
virtual void vt_0x54();
#endif
virtual void vt_0x58();
virtual void vt_0x5C();
virtual void vt_0x60();
virtual void vt_0x64();
virtual void vt_0x68(bool);
void onCtrlKey_(VKeyCode code);
wchar_t convertToZiCellphoneInput_(wchar_t wc);
virtual bool onClose();
#endif
// TODO enum?
int getInputType() const;
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
void resetHoldingButton();
#endif
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
#if defined(MYTIMANAGER_IMPLEMENTATION) && defined(TI_CELLPHONE_IMPLEMENTATION)
protected:
#else
private:
#endif
u32 mPreviousInputMode;
u32 mCurrentInputMode;
bool mbInputModeLocked;
bool mbNumericMode;
bool mbNumericWithDotMode;
bool mbUpperCaseMode;
bool mbAbcMode;
bool mbLanguageKeyMode;
#ifdef TI_CELLPHONE_IMPLEMENTATION
const PaneNameToCharCode* mHoldingButton;
#else
u32 mHoldingButton;
#endif
void* mpInputModeTable;
MEMAllocator* mpAllocator;
#ifdef TI_CELLPHONE_IMPLEMENTATION
Manager* mpManager;
bool mInputState;
#elif defined(TIMANAGER_IMPLEMENTATION)
Manager* mpManager;
u32 mInputState;
#else
void* mpInputSettings;
u32 mInputState;
#endif
#ifdef TI_CELLPHONE_IMPLEMENTATION
void onCtrlKey_(VKeyCode keyCode);
#endif
#endif
Manager* mgr() { return mpManager; }
s32 mTapIndex; // 0x14
s32 mInputMode; // 0x18
u8 mbLocked; // 0x1C
u8 mbNumeric; // 0x1D
u8 mbNumericWithDot; // 0x1E
u8 mbUpperCase; // 0x1F
u8 mbShiftHeld; // 0x20
u8 unk_0x21; // 0x21
const PaneNameToCharCode* mpHoldingPane; // 0x24
const LanguageDependency* mpLanguageDep; // 0x28
MEMAllocator* mpAllocator; // 0x2C
Manager* mpManager; // 0x30
u8 mbLangKeyActive; // 0x34
u8 unk_0x35[3]; // 0x35
};
#ifndef TI_CELLPHONE_MATCH_LAYOUT
#include "tiCellPhoneLayout.h"
#else
class LayoutByNW4R;
#endif
#ifdef TI_CELLPHONE_IMPLEMENTATION
enum Animation {
ANM_Normal,
ANM_FocusIn,
ANM_FocusOut,
ANM_RollOver,
ANM_Pushed,
ANM_05,
ANM_06,
ANM_ToggleOff,
ANM_Last,
};
enum KeyType {
KT_NormalButton,
KT_ControlButton,
};
#ifdef TI_CELLPHONE_MATCH_LAYOUT
class EventHandler : public nw4rmanager::TiEventHandler {
public:
EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
virtual ~EventHandler();
virtual void onTiEvent(gui::PaneComponent* pane, u32 event, Input* input) override;
EventHandler(LayoutByNW4R* layout) : mpLayout(layout) {}
virtual void onTiEvent(gui::PaneComponent* paneComponent, u32 event, TiEventHandler::Input* input); // 0x18
private:
LayoutByNW4R* mpLayoutByNW4R;
LayoutByNW4R* mpLayout; // 0x0C
};
#endif
class CellPhoneAnmPane : public nw4rmanager::AnmPane {
public:
CellPhoneAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
#ifdef TI_CELLPHONE_MATCH_LAYOUT
: nw4rmanager::AnmPane(pane, observer), meState(ANM_Normal), meKeyType(KT_NormalButton) {
CellPhoneAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer, u32 keyType)
: nw4rmanager::AnmPane(pane, observer) {
mState = 0;
mKeyType = keyType;
init();
changeAnimation(meState);
changeAnimation(mState);
}
#else
: nw4rmanager::AnmPane(pane, observer), meState(ANM_Normal), meKeyType(KT_NormalButton) {}
#endif
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent event) override;
virtual void changeAnimation(u32 id) override;
virtual KeyType getKeyType() const;
u32 getAnimationState() const { return meState; }
virtual ~CellPhoneAnmPane();
virtual void init(); // 0x08
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
virtual void changeAnimation(u32 id); // 0x14
virtual u32 getKeyType() const; // 0x24
protected:
Animation meState;
KeyType meKeyType;
s32 mState; // 0x2C
u32 mKeyType; // 0x30
};
class CellPhoneControlAnmPane : public CellPhoneAnmPane {
public:
CellPhoneControlAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: CellPhoneAnmPane(pane, observer) { meKeyType = KT_ControlButton; }
CellPhoneControlAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer, u32 keyType)
: CellPhoneAnmPane(pane, observer, 0) {
mKeyType = keyType;
}
virtual void onAnmEvent(AnmPaneEvent event) override;
virtual ~CellPhoneControlAnmPane();
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
};
#ifndef TI_CELLPHONE_MATCH_LAYOUT
class EventHandler : public nw4rmanager::TiEventHandler {
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
public:
EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
virtual ~EventHandler();
virtual void onTiEvent(gui::PaneComponent* pane, u32 event, Input* input) override;
#ifdef TI_CELLPHONE_SAMPLE_CLASS
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, arcName, observer),
mpEventHandler(NULL) {}
#endif
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void setCommandReceiver(CommandReceiver* receiver) override;
virtual void updateFromReceiver(u32, void*) override;
virtual void onKey(u32, void*) override;
virtual void setLanguage(Language language) override;
virtual void update() override;
virtual void onActive() override;
virtual void calc() override;
virtual void draw() override;
virtual void doNumericMode(bool) override;
virtual void changeInputMode(InputMode mode) override;
virtual void setInputMode(InputMode mode) override;
virtual void setUpperCaseJP(bool) override;
virtual void setLangKeyActive(bool) override;
virtual void onClose() override;
virtual void goSignInputMode() override;
virtual void changePredictLanguage() override;
virtual void setAbcMode(bool) override;
virtual void setPredictLanguageDialog(predictlang::LayoutByNW4R*); // 0x104
virtual void setSignWindow(signwindow::LayoutByNW4R*); // 0x108
virtual void doNumericWithDotMode(bool); // 0x10C
virtual void setLineFeedButton(bool); // 0x110
virtual void setPredictLanguageButton(bool); // 0x114
virtual void setSignWindowButton(bool); // 0x118
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); // 0x11C
virtual bool updateInput(textinput::input::HKBManager& hkbManager); // 0x120
virtual nw4rmanager::AnmPane* getAnmPane(InputMode mode); // 0x124
virtual void throwReleaseForAll(); // 0x128
virtual void changeAnimationAllToNormal(); // 0x12C
virtual void updatePredictLanguage(CommandReceiver::ChangePredictMode* mode); // 0x130
virtual void changeKeyTop(const PaneNameToCharCode* table); // 0x134
virtual void changeSpaceKeyTop(const PaneNameToCharCode* table); // 0x138
void onPressedShift(bool shift);
void onReleasedShift();
void resetHoldingButton();
private:
LayoutByNW4R* mpLayoutByNW4R;
bool mbLineFeed; // 0xE0
u8 unk_0xE1[3]; // 0xE1
GXTexObj mSpaceTexObjJP; // 0xE4
GXTexObj mSpaceTexObjCN; // 0x104
GXTexObj mSpaceTexObjKR; // 0x124
EventHandler* mpEventHandler; // 0x144
predictlang::LayoutByNW4R* mpPredictLanguageDialog; // 0x148
signwindow::LayoutByNW4R* mpSignWindow; // 0x14C
};
#endif
#endif
#ifdef TI_CELLPHONE_MATCH_LAYOUT
#include "tiCellPhoneLayout.h"
#ifdef TI_CELLPHONE_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, arcName, observer) {}
virtual ~Sample();
};
#else
class Sample {};
#endif
} // namespace cellphonetype

View File

@@ -72,10 +72,10 @@ namespace textinput {
virtual ~EventHandler() {} // 0x08
virtual void onEvent(GUIComponent& comp, u32 event, void* data) {} // 0x0C
virtual void onEvent(GUIComponent& comp, u32 event, void* data); // 0x0C
virtual void setLatestEventCtrlNo(int ctrlNo) { muLatestEventCtrlNo = ctrlNo; } // 0x10
virtual int getLatestEventCtrlNo() { return muLatestEventCtrlNo; } // 0x14
virtual void setLatestEventCtrlNo(int ctrlNo); // 0x10
virtual int getLatestEventCtrlNo(); // 0x14
protected:
int muLatestEventCtrlNo; // 0x04
@@ -92,9 +92,6 @@ namespace textinput {
EVENT_RELEASE
};
#ifdef TIINPUTFORM_IMPLEMENTATION
virtual void init();
#else
virtual void init() { // 0x10
for (int i = 0; i < GUI_POINTS_MAX; i++) {
mbPointed[i] = false;
@@ -103,20 +100,19 @@ namespace textinput {
mFlightDuration[i] = 0;
}
}
#endif
GUIComponent(u32 id)
: GUIInterface(), mbInitialize(false), mDraggingButton(0xFFFF), mID(id), mbTriggerTarget(false), mpManager(NULL), mpListener(NULL) {
init();
}
virtual ~GUIComponent() {} // 0x08
virtual ~GUIComponent(); // 0x08
virtual u32 getID() { return mID; } // 0x20
virtual u32 getID(); // 0x20
virtual bool isPointed(int point) { return mbPointed[point]; } // 0x24
virtual bool isDragging(int point) { return mbDragging[point]; } // 0x28
virtual bool isPointed(int point); // 0x24
virtual bool isDragging(int point); // 0x28
virtual void setPointed(int point, bool bEnable) { mbPointed[point] = bEnable; } // 0x2C
virtual void setPointed(int point, bool bEnable); // 0x2C
void onEvent(u32 event, void* data) {
if (mpListener) {
@@ -124,39 +120,30 @@ namespace textinput {
}
}
virtual void onPointIn(int point) { mFlightDuration[point] = 0; } // 0x30
virtual void onPointOut(int point) { mFlightDuration[point] = 0; } // 0x34
virtual void onPointIn(int point); // 0x30
virtual void onPointOut(int point); // 0x34
virtual void onDrag(f32 x, f32 y) {}
virtual void onMove(int point, f32 x, f32 y) { mFlightDuration[point]++; } // 0x38
virtual void onTrig(int point, u32 trig, Vec& dragPos) {
if (trig & mDraggingButton) {
mDraggingPos[point] = dragPos;
mbDragging[point] = true;
mFlightDuration[point] = 0;
}
}
virtual void onDrag(f32 x, f32 y);
virtual void onMove(int point, f32 x, f32 y); // 0x38
virtual void onTrig(int point, u32 trig, Vec& dragPos);
virtual void setDraggingButton(u32 dragBtn) { mDraggingButton = dragBtn; } // 0x3C
virtual void setDraggingButton(u32 dragBtn); // 0x3C
virtual u32 updatePointer(const GUIPointer& pointer) { return updatePointerImpl(pointer); } // 0x40
virtual u32 updatePointer(int point, f32 x, f32 y, u32 trig, u32 hold, u32 release) { // 0x44
GUIPointer pointer(point, x, y, hold, trig, release);
return updatePointerImpl(pointer);
}
virtual u32 updatePointer(const GUIPointer& pointer); // 0x48
virtual u32 updatePointer(int point, f32 x, f32 y, u32 trig, u32 hold, u32 release); // 0x4C
virtual bool isTriggerTarget() { return mbTriggerTarget; } // 0x48
virtual void setTriggerTarget(bool bEnable) { mbTriggerTarget = bEnable; } // 0x4C
virtual bool isTriggerTarget(); // 0x50
virtual void setTriggerTarget(bool bEnable); // 0x54
void setParentManager(GUIManager* manager) { mpManager = manager; }
GUIManager* getParentManager() { return mpManager; }
virtual bool isVisible() { return true; } // 0x50
virtual bool isVisible(); // 0x58
virtual u16 getFlightDuration(int point) { return mFlightDuration[point]; } // 0x54
virtual void setFlightDuration(int point, u16 flightDir) { mFlightDuration[point] = flightDir; } // 0x58
virtual u16 getFlightDuration(int point); // 0x5C
virtual void setFlightDuration(int point, u16 flightDir); // 0x60
virtual bool contain(f32 x, f32 y) = 0; // 0x5C
virtual bool contain(f32 x, f32 y) = 0; // 0x64
void setListener(EventHandler* listener) { mpListener = listener; }
@@ -167,9 +154,9 @@ namespace textinput {
bool mbInitialize; // 0x04
bool mbPointed[GUI_POINTS_MAX]; // 0x08
bool mbPointed[GUI_POINTS_MAX]; // 0x05
bool mbDragging[GUI_POINTS_MAX]; // 0x10
bool mbDragging[GUI_POINTS_MAX]; // 0x0D
Vec mDraggingPos[GUI_POINTS_MAX]; // 0x18
int mDraggingButton; // 0x78
@@ -177,10 +164,10 @@ namespace textinput {
u16 mFlightDuration[GUI_POINTS_MAX]; // 0x80
bool mbTriggerTarget; // 0x8A
bool mbTriggerTarget; // 0x90
GUIManager* mpManager; // 0x8C
EventHandler* mpListener; // 0x90
GUIManager* mpManager; // 0x94
EventHandler* mpListener; // 0x98
};
class GUIManager : public GUIInterface {
@@ -200,27 +187,15 @@ namespace textinput {
virtual GUIComponent* getComponent(u32 id); // 0x24
virtual GUIComponent* getComponent(u32 id) const; // 0x28
virtual bool update(int point, const KPADStatus* kpad, f32, f32, void* data) { return false; } // 0x2C
virtual bool update(int point, const KPADStatus* kpad, f32, f32, void* data); // 0x2C
virtual bool update(int point, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); // 0x30
virtual void onEvent(GUIComponent& comp, u32 event, int point, void* data) { // 0x34
if (mpEventHandler) {
mpEventHandler->setLatestEventCtrlNo(point);
mpEventHandler->onEvent(comp, event, data);
}
comp.onEvent(event, data);
}
virtual void onEvent(GUIComponent& comp, u32 event, int point, void* data); // 0x34
virtual void setAllComponentTriggerTarget(bool bEnable); // 0x38
virtual void setEventHandler(EventHandler* eventHandler) { // 0x3C
mpEventHandler = eventHandler;
}
virtual EventHandler* changeEventHandler(EventHandler* eventHandler) { // 0x40
EventHandler* prevHandler = mpEventHandler;
mpEventHandler = eventHandler;
return prevHandler;
}
virtual void setEventHandler(EventHandler* eventHandler); // 0x3C
virtual EventHandler* changeEventHandler(EventHandler* eventHandler); // 0x40
virtual void setDraggingButton(u32 dragBtn); // 0x44
@@ -259,7 +234,7 @@ namespace textinput {
virtual PaneComponent* getPaneComponentByPane(nw4r::lyt::Pane* pane); // 0x4C
virtual const nw4r::lyt::DrawInfo* getDrawInfo() { return mpDrawInfo; } // 0x50
virtual const nw4r::lyt::DrawInfo* getDrawInfo(); // 0x50
virtual void setDrawInfo(const nw4r::lyt::DrawInfo* drawInfo) { mpDrawInfo = drawInfo; } // 0x54
virtual void setAllBoundingBoxComponentTriggerTarget(bool bEnable); // 0x58
@@ -298,11 +273,11 @@ namespace textinput {
virtual void draw(); // 0x1C
virtual bool isVisible(); // 0x50
virtual bool isVisible(); // 0x58
virtual bool contain(f32 x, f32 y); // 0x5C
virtual bool contain(f32 x, f32 y); // 0x64
virtual void setPane(nw4r::lyt::Pane* pane) { mpPane = pane; } // 0x60
virtual void setPane(nw4r::lyt::Pane* pane); // 0x68
nw4r::lyt::Pane* getPane() { return mpPane; }
nw4r::lyt::TextBox* getTextPane() { return static_cast<nw4r::lyt::TextBox*>(mpPane); }

View File

@@ -4,232 +4,158 @@
#include <revolution/types.h>
#include <revolution/mem/allocator.h>
#include <revolution/os.h>
#include "keyboard/tiCpData.h"
#ifdef TIHKBMANAGER_IMPLEMENTATION
#include <revolution/kbd.h>
enum _KBDEc { KBD_EC_BUSY = 7 };
#endif
typedef enum _KBDEc {
KBD_EC_0 = 0,
KBD_EC_1,
KBD_EC_2,
KBD_EC_3,
KBD_EC_4,
KBD_EC_5,
KBD_EC_6,
KBD_EC_OK,
} KBDEc;
typedef struct _KBDDevEvent {
u8 chan;
u8 unk_0x01[0x1F];
} KBDDevEvent;
typedef struct _KBDKeyEvent {
u8 chan;
u8 key;
u8 unk_0x02[2];
u32 mods;
} KBDKeyEvent;
extern "C" {
void KBDInitRegionUS(void);
void KBDInit(void);
void KBDSetAttachCallback(void (*cb)(KBDDevEvent*));
void KBDSetDetachCallback(void (*cb)(KBDDevEvent*));
void KBDSetKeyCallback(void (*cb)(KBDKeyEvent*));
int KBDSetLedsAsync(u8 chan, u8 leds, void (*cb)(KBDEc, void*), void* arg);
int KBDSetLeds(u8 chan, u8 leds);
int KBDSetModState(u8 chan, u32 mods);
int KBDSetCountry(u8 chan, u32 country);
int KBDSetLockProcessing(u8 chan, int lock);
u16 KBDTranslateHidCode(u8 key, u32 country);
}
namespace textinput {
namespace input {
#ifdef TIHKBMANAGER_IMPLEMENTATION
class HKBManager {
public:
class KeyState_ {
public:
void NotifyEvent(u8 down, u8 code);
void Update();
void UpdateModState_();
void Clear() {
held = 0;
triggered = 0;
released = 0;
repeated = 0;
current = 0;
pending = 0;
modifiers &= 0x700;
forceMask = 0;
forceState = 0;
retryLeds = 0;
}
void Initialize(u8 channel) {
held = 0;
triggered = 0;
released = 0;
repeated = 0;
current = 0;
pending = 0;
forceMask = 0;
forceState = 0;
retryLeds = 0;
device = channel;
country = 0xf;
modifiers = 0;
}
u8 device;
u32 held, triggered, released, repeated;
u32 previous, current, pending;
u32 modifiers, forceState, forceMask;
s32 country;
u8 retryLeds;
u8 previousKeys[8], currentKeys[8], pendingKeys[8];
u32 repeatDelay[8];
};
HKBManager();
~HKBManager();
static HKBManager& getInstance() { return sInstance; }
void Initialize();
void Update();
u32 GetModifierState() const;
void SetModifierState(u32 state, u32 mask);
void SetForceModifierState(u32 state, u32 mask);
void SetCountry(u8 country);
void ClearState();
class KeySet {
public:
KeySet() {}
KeySet(const HKBManager* owner, u8 kind)
: manager(owner), type(kind), index(-1), device(0), vcode(0) {}
u8 GetKey() const;
u32 GetWChar() const;
u32 GetVCode() const;
u32 IsValid() const;
bool CheckValidity() const {
if (!manager) return false;
s8 keyIndex = index;
if (keyIndex < 0 || keyIndex >= 8) return false;
u8 keyDevice = device;
if (keyDevice >= 2) return false;
switch (type) {
case 0: return (manager->states[keyDevice].held & (1 << keyIndex)) != 0;
case 1: return (manager->states[keyDevice].triggered & (1 << keyIndex)) != 0;
case 2: return (manager->states[keyDevice].released & (1 << keyIndex)) != 0;
case 3: return (manager->states[keyDevice].repeated & (1 << keyIndex)) != 0;
}
return false;
}
KeySet GetNext() const;
const HKBManager* manager;
u8 type;
s8 index;
u8 device;
mutable u16 vcode;
KeySet(const HKBManager* manager, u8 type) :
mpManager(manager), mType(type),
mIndex(-1), mSubIndex(0), mVCode(0) {}
u8 GetKey() const;
wchar_t GetWChar() const;
wchar_t GetVCode() const;
bool IsValid() const;
KeySet GetNext() const;
const HKBManager* mpManager; // 0x00
u8 mType; // 0x04
s8 mIndex; // 0x05
u8 mSubIndex; // 0x06
mutable u16 mVCode; // 0x08
};
class KBDListenerOwn;
class KBDListenerLinks {
KeySet GetTriggeredKeySet() const;
KeySet GetReleasedKeySet() const;
KeySet GetRepeatedKeySet() const;
private:
class KeyState_ {
public:
KBDListenerLinks() : previous(0), next(0) {}
virtual ~KBDListenerLinks() {}
virtual void OnAttach(KBDDevEvent*) = 0;
virtual void OnDetach(KBDDevEvent*) = 0;
virtual void OnKeyEvent(KBDKeyEvent*) = 0;
KBDListenerOwn* previous;
KBDListenerOwn* next;
void NotifyEvent(u8 type, u8 key);
void Update();
void UpdateModState_();
u8 mKbdChan; // 0x00
u8 pad_0x01[3];
u32 mMaskWork; // 0x04
u32 mTrigMask; // 0x08
u32 mRelMask; // 0x0C
u32 mRepMask; // 0x10
u32 mPrevMask; // 0x14
u32 mCurMask; // 0x18
u32 mInputMask; // 0x1C
u32 mModState; // 0x20
u32 mForceMod; // 0x24
u32 mForceMask; // 0x28
s32 mCountry; // 0x2C
u8 mLedOK; // 0x30
u8 mReleasedKeys[8]; // 0x31
u8 mPrevKeys[8]; // 0x39
u8 mCurKeys[8]; // 0x41
u8 pad_0x49[3];
u32 mRepeatCtr[8]; // 0x4C
};
class KBDListenerOwn : public KBDListenerLinks {
class KBDListener {
public:
KBDListenerOwn(HKBManager* owner) : manager(owner) {}
virtual ~KBDListenerOwn();
KBDListener() : unk_0x04(0), mpNext(NULL) {}
virtual ~KBDListener() {}
virtual void OnAttach(KBDDevEvent* event);
virtual void OnDetach(KBDDevEvent* event);
virtual void OnKeyEvent(KBDKeyEvent* event);
HKBManager* manager;
u32 unk_0x04;
KBDListener* mpNext;
};
HKBManager() __attribute__((never_inline));
~HKBManager();
static HKBManager& getInstance() { return sInstance; }
void Initialize();
void ClearState();
u32 GetModifierState() const;
void SetCountry(u8 country);
void SetModifierState(u32 state, u32 mask);
void SetForceModifierState(u32 state, u32 mask);
void Update();
KeySet GetTriggeredKeySet() const;
KeySet GetReleasedKeySet() const;
KeySet GetRepeatedKeySet() const;
#ifdef TIHWKEYBOARD_IMPLEMENTATION
KeySet GetReleasedKeySet() const;
#endif
static void SetLedCB(_KBDEc result, void* userData);
class KBDListenerOwn : public KBDListener {
public:
KBDListenerOwn(HKBManager* manager) : mpManager(manager) {}
virtual void OnAttach(KBDDevEvent* event);
virtual void OnDetach(KBDDevEvent* event);
virtual void OnKeyEvent(KBDKeyEvent* event);
HKBManager* mpManager; // 0x0C
};
static void SetLedCB(KBDEc result, void* arg);
static void AttachCB(KBDDevEvent* event);
static void DetachCB(KBDDevEvent* event);
static void KeyEventCB(KBDKeyEvent* event);
private:
u8 initialized;
u8 attached[2];
u32 lockState;
u32 retryDevices;
const wchar_t* allowedCharacters;
u32 allowedCharacterCount;
KeyState_ states[2];
KBDListenerOwn listener;
static HKBManager sInstance;
};
#else
class HKBManager {
public:
#ifdef TIMANAGER_IMPLEMENTATION
void ClearState();
#endif
static HKBManager& getInstance() { return sInstance; }
void Initialize();
void Update();
u32 GetModifierState() const;
void SetModifierState(u32, u32);
#if defined(TI_CELLPHONE_HKB_KEYSET)
class KeySet {
public:
u8 GetKey() const;
u32 GetWChar() const;
bool IsValid() const;
KeySet GetNext() const;
KeySet(const KeySet& other)
: mpManager(other.mpManager), mKind(other.mKind), mIndex(other.mIndex),
mDevice(other.mDevice), mCharacter(other.mCharacter) {}
private:
const HKBManager* mpManager;
u8 mKind;
s8 mIndex;
u8 mDevice;
u16 mCharacter;
};
KeySet GetTriggeredKeySet() const;
KeySet GetRepeatedKeySet() const;
#else
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
class KeySet {
public:
u8 GetKey() const;
#ifdef TIHWKEYBOARD_IMPLEMENTATION
u32 GetWChar() const;
#else
wchar_t GetWChar() const;
#endif
bool IsValid() const;
KeySet GetNext() const;
KeySet(const KeySet& other)
: mpManager(other.mpManager), mKind(other.mKind), mIndex(other.mIndex), mDevice(other.mDevice), mCharacter(other.mCharacter) {}
#ifdef TIHWKEYBOARD_IMPLEMENTATION
KeySet() : mpManager(NULL), mKind(0), mIndex(-1), mDevice(0), mCharacter(0) {}
#endif
private:
const HKBManager* mpManager;
u8 mKind;
s8 mIndex;
u8 mDevice;
u16 mCharacter;
};
KeySet GetTriggeredKeySet() const;
KeySet GetRepeatedKeySet() const;
#ifdef TIHWKEYBOARD_IMPLEMENTATION
KeySet GetReleasedKeySet() const;
#endif
void SetForceModifierState(u32 mask, u32 state);
#else
class KeySet {
private:
keyboard::cellphonetype::PaneNameToCharCode* pPaneNameToCharCode; // 0x00
wchar_t szKeySetName[17]; // 0x04
u16 uNum; // 0x26
u16 uType; // 0x28
#ifdef TI_CELLPHONE_IMPLEMENTATION
public:
bool IsValid() const;
u32 GetKey() const;
wchar_t GetWChar() const;
KeySet GetNext() const;
#endif
};
#ifdef TI_CELLPHONE_IMPLEMENTATION
KeySet GetTriggeredKeySet() const;
KeySet GetRepeatedKeySet() const;
#endif
#endif
#endif
private:
u8 unk_0x00[0xFC];
u8 mInitialized; // 0x00
u8 mAttached[2]; // 0x01
u8 pad_0x03;
u32 mModState; // 0x04
u32 mPendingLeds; // 0x08
const wchar_t* mpKeyTable; // 0x0C
u32 mKeyTableNum; // 0x10
KeyState_ mKeyStates[2]; // 0x14
KBDListenerOwn mListener; // 0xEC
static HKBManager sInstance;
};
#endif
} // namespace input
} // namespace textinput

View File

@@ -8,62 +8,39 @@ namespace textinput {
class Manager;
namespace keyboard {
namespace hwkey {
#ifdef TIMANAGER_IMPLEMENTATION
class HWKeyboard : public CommandSender {
#else
class HWKeyboard : CommandSender {
#endif
public:
struct AnimationFile {
u32 mAnimationNo;
char mFileName[0x40];
};
static const AnimationFile csAninationFile[8];
HWKeyboard(Manager *);
#ifdef TIMANAGER_IMPLEMENTATION
inline ~HWKeyboard();
#else
~HWKeyboard();
#endif
#ifdef TIMANAGER_IMPLEMENTATION
void setLanguage(Destination destination, Language language);
#endif
virtual void init();
#if defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
wchar_t convertWCCode(wchar_t code) const;
#endif
virtual ~HWKeyboard();
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
#else
virtual void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
#endif
virtual bool updateInput(input::HKBManager& hkbManager);
#ifdef TIINPUTFORM_IMPLEMENTATION
void resetQuoteState() { mbSingleQuoteClosing = 0; mbDoubleQuoteClosing = 0; }
#endif
private:
#ifdef TIHWKEYBOARD_IMPLEMENTATION
bool updateRepeatKey_(input::HKBManager&);
bool updateTriggerKey_(input::HKBManager&);
bool updateTappingShift_(input::HKBManager&);
#endif
void updateShift(input::HKBManager& hkbManager);
bool updateRepeatKey_(input::HKBManager& hkbManager);
bool updateTriggerKey_(input::HKBManager& hkbManager);
bool updateTappingShift_(input::HKBManager& hkbManager);
public:
u16 convertWCCode(wchar_t wc) const;
void setLanguage(Destination destination, Language language);
private:
void controlKeyTriggeredHandler(input::HKBManager);
Manager *mgr() { return mpManager; }
Manager* mpManager; // 0x10
u8 field_0x14; // 0x14
#ifdef TIINPUTFORM_IMPLEMENTATION
u8 mbSingleQuoteClosing;
u8 mbDoubleQuoteClosing;
#else
#ifdef TIHWKEYBOARD_IMPLEMENTATION
bool field_0x15;
bool field_0x16;
#else
u8 field_0x15; // 0x15
u8 field_0x16; // 0x16
#endif
#endif
bool field_0x15; // 0x15
bool field_0x16; // 0x16
};

View File

@@ -13,43 +13,17 @@
#include "tiZiString.h"
#include "tiSEId.h"
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
extern "C" wchar_t KPRGetChar(KPRQueue* queue);
extern "C" void KPRPutChar(KPRQueue* queue, wchar_t character);
extern "C" void KPRClearQueue(KPRQueue* queue);
extern "C" void KPRInitRegionUS();
extern "C" u8 KPRLookAhead(KPRQueue* queue, wchar_t* character, wchar_t* combining);
#endif
namespace textinput {
#ifdef TIMANAGER_IMPLEMENTATION
class Manager;
#endif
namespace inputform {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
class Base;
class EventHandler;
class LayoutByNW4R;
#endif
class EditBuffer {
#ifdef TIMANAGER_IMPLEMENTATION
friend class textinput::Manager;
public:
EditBuffer() : mpString(NULL), mpUnfixString(NULL), mpZiString(NULL), mpAllocator(NULL) {}
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
friend class LayoutByNW4R;
friend class Base;
#endif
public:
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
void create(MEMAllocator* allocator);
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
EditBuffer() : mpString(NULL), mpUnfixString(NULL), mpZiString(NULL), mpAllocator(NULL) {}
virtual ~EditBuffer();
#else
~EditBuffer();
#endif
virtual void create(MEMAllocator* allocator);
void* getString() const { return mpString; }
void* getZiString() const { return mpZiString; }
private:
void* mpString; // 0x04
@@ -59,27 +33,10 @@ namespace textinput {
};
class DeadKeyStream {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
public:
DeadKeyStream() { KPRInitRegionUS(); init(); }
static wchar_t ToCombineClass(Language language, wchar_t code);
static wchar_t ToIndependentClass(wchar_t code);
inline wchar_t getChar();
void init();
u8 lookAhead() { return KPRLookAhead(&mKPRQueue, NULL, NULL); }
void putChar(wchar_t character) { KPRPutChar(&mKPRQueue, character); }
bool isEmpty() const { return mKPRQueue.oCount == 0; }
void clear() { KPRClearQueue(&mKPRQueue); }
private:
#ifdef TIMANAGER_IMPLEMENTATION
friend class textinput::Manager;
#endif
static bool sbCompatibleFilterEnabled;
static inline bool isCompatible(wchar_t character);
#elif defined(TI_PC_KEYBOARD_IMPLEMENTATION)
public:
static wchar_t ToIndependentClass(wchar_t code);
#endif
static wchar_t ToIndependentClass(wchar_t wc);
private:
KPRQueue mKPRQueue; // 0x00
};
@@ -128,57 +85,17 @@ namespace textinput {
// TODO - location
class RowInfoManager {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
friend class LayoutByNW4R;
friend class Base;
public:
RowInfoManager(u16 maxLength) : mpInfo(NULL), mMaxLength(maxLength), mpAllocator(NULL) {}
void init();
~RowInfoManager();
#endif
private:
Info_* mpInfo; // 0x00
u16 mMaxLength; // 0x04
MEMAllocator* mpAllocator; // 0x08
};
#ifdef TISIGNWINDOW_IMPLEMENTATION
bool isAtokActive() const;
#endif
#ifdef MYTILETTERFORM_IMPLEMENTATION
virtual void create(MEMAllocator* allocator);
virtual void init();
virtual void onCommand(INPUT_COMMAND command, void* data);
#endif
virtual ~Base();
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
Base(Manager* manager);
virtual void create(MEMAllocator* allocator);
virtual void init();
virtual void onCommand(INPUT_COMMAND command, void* data);
void setCursorPos(tistring::Decolated* string, u32 pos);
void calcCursorTimer();
bool isAtokActive() const;
bool isVacancy() const;
void dirtyCacheAll();
tistring::Decolated* getCurrentString(bool inputting);
void moveCandidateToIdx(s32 index);
void onPressDownHWKB();
void onPressLeftHWKB();
void onPressRightHWKB();
void toggleAtokMode_(u8 operation);
void onSpaceKeyHWKB(u32 modifiers);
void onHKBCtrlCode(HVKCode code, u32 modifiers);
void confirmInput_();
void confirmInputting_(wchar_t character, bool direct, u16 letterMode, bool confirmOnly, void* holdingKey);
void inputCharZi_(wchar_t character, u32 modifiers);
void inputCharDefault_(wchar_t character, u32 modifiers);
void inputInputting_(wchar_t character);
inline bool hasZiPredictions() const;
inline bool usesZiPrediction() const;
inline void resetPredictionContext();
inline void resetInputRelation();
#endif
virtual void create(MEMAllocator* allocator);
virtual void init();
virtual void onCommand(INPUT_COMMAND command, void* data);
virtual void create(MEMAllocator* allocator, EditBuffer* editBuffer);
@@ -217,6 +134,7 @@ namespace textinput {
virtual void setAtokDictionary(void* atokDict, int atokDictSize, void* apotDict, int apotDictSize, void* nintendoDict, int nintendoDictSize);
virtual void closeAtokDictionary();
virtual bool isAtokDictionaryOpened();
bool isAtokActive() const;
void setZiDictionary(void* ziOemDict, void* ziDict) {
mpZiString->openDictionary(ziDict, ziOemDict);
@@ -226,6 +144,7 @@ namespace textinput {
void initZiString();
void resetContextPredict_();
void dirtyCacheAll();
void notifyChangeMode();
@@ -234,12 +153,9 @@ namespace textinput {
virtual void enableSpaceByRight(bool rightWithSpace);
virtual void onClose();
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
tistring::WithAtok* getCurrentString(bool fixed);
virtual bool canConvert() { return getCurrentString(false) == mpUnfixString; }
#else
virtual bool canConvert();
#endif
void* getCurrentString(bool flag);
virtual void setString(const wchar_t* string);
@@ -269,10 +185,6 @@ namespace textinput {
virtual void onSE(sound::SE seId);
#ifdef MYTIMANAGER_IMPLEMENTATION
void dirtyCacheAll();
#endif
virtual void clear();
virtual u32 calcCursorPos(f32 x, f32 y);
@@ -289,21 +201,15 @@ namespace textinput {
virtual void makeUpCursorPos(CursorPos* cursorPos, u32 pos, s32 startLine, s32 endLine);
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
bool isVacancy() const;
bool isPredictOn() const { return mbPredictOn; }
protected:
#if !defined(TIINPUTFORM_IMPLEMENTATION) && !defined(TIMANAGER_IMPLEMENTATION)
void setCursorPos(tistring::Decolated* string, u32 pos);
void calcCursorTimer();
#endif
void resetRelation();
#else
private:
#endif
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
nw4r::ut::Rect mRect;
#else
Rect mRect;
#endif
nw4r::ut::Rect mRect; // 0x120
nw4r::math::MTX34 mMtx; // 0x130
Destination meDestination; // 0x160
tistring::Decolated* mpString; // 0x164
@@ -311,9 +217,6 @@ namespace textinput {
tistring::WithZi* mpZiString; // 0x16C
InputMode meInputMode; // 0x170
PredictMode mePredictMode; // 0x174
#ifdef TIMANAGER_IMPLEMENTATION
friend class textinput::Manager;
#endif
bool mbPredictOn; // 0x178
bool mbDoWordWrap; // 0x179
bool mbRightWithSpace; // 0x17A
@@ -349,18 +252,14 @@ namespace textinput {
};
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
friend class EventHandler;
inline const nw4r::lyt::Pane* getLanguageTextPane() const;
#endif
public:
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
LayoutByNW4R(textinput::Manager*, nw4r::lyt::MultiArcResourceAccessor*, const char*, EventObserver*, const char*);
#endif
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName,
EventObserver* observer, const char* subName);
~LayoutByNW4R();
virtual void init();
virtual void onCommand(INPUT_COMMAND command, void* data);
virtual void onSE(sound::SE seId);
virtual void create(MEMAllocator* allocator, EditBuffer* editBuffer);
@@ -371,9 +270,6 @@ namespace textinput {
virtual nw4r::math::VEC2 getScale() const;
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
void updateRepeatInput(u32 trig, u32 hold);
#endif
virtual void updateInputCommon(int chan, u32 trig, u32 hold, u32 release, void* data);
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
virtual bool updateInput(textinput::input::HKBManager& hkbManager);
@@ -384,38 +280,27 @@ namespace textinput {
virtual void setRootPaneScaleFor16x9();
virtual void setRootPaneScaleFor4x3();
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
virtual void onSE(sound::SE seId);
#endif
virtual void visibleSeparator(bool flag);
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
protected:
const void* mpLayoutData;
const void* mpLanguageData;
const char* mpFontName;
bool mbUpVisible;
bool mbDownVisible;
bool mbRepeat;
nw4rmanager::TiEventHandler* mpInputEventHandler;
nw4r::ut::ResFont mFont;
int mUpRepeat;
int mDownRepeat;
int mLeftRepeat;
int mRightRepeat;
int mDeleteRepeat;
int mConfirmRepeat;
u32 mRepeatButtons;
#else
private:
#ifdef MYTIMANAGER_IMPLEMENTATION
u8 unk_0x2C0[0x48];
#else
u8 unk_0x2C0[0x4C];
#endif
#endif
u8 unk_0x2C0[0x0C];
bool mbAbleToUp; // 0x2CC
bool mbAbleToDown; // 0x2CD
bool mbSeparator; // 0x2CE
u8 unk_0x2CF;
nw4rmanager::TiEventHandler* mpInputEventHandler; // 0x2D0
u8 unk_0x2D4[0x34];
};
#ifdef TI_INPUTFORM_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName,
EventObserver* observer, const char* subName)
: LayoutByNW4R(manager, resAccessor, arcName, observer, subName) {}
virtual ~Sample();
};
#endif
}
typedef inputform::LayoutByNW4R InputForm;
typedef inputform::Base InputFormBase;

View File

@@ -8,50 +8,16 @@ namespace textinput {
class KeyboardBase : public CommandSender {
public:
#ifdef TIMANAGER_IMPLEMENTATION
KeyboardBase() : meLanguage(JP) {}
#endif
virtual ~KeyboardBase() {}
#if !(defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) && !defined(TIMANAGER_IMPLEMENTATION) && !defined(TISIGNWINDOW_IMPLEMENTATION)
virtual void create(MEMAllocator* alloc) override;
virtual void init() override;
#ifndef TI_CELLPHONE_MATCH_LAYOUT
virtual void setCommandReceiver(CommandReceiver* receiver) override;
virtual void sendCommand(u32 command, void*) override;
#endif
#endif
#if !defined(TIMANAGER_IMPLEMENTATION) && !defined(TISIGNWINDOW_IMPLEMENTATION)
virtual void updateFromReceiver(u32, void*) override;
#endif
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || (defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION)
virtual void onKey(u32, void*);
#else
virtual void onKey(u32);
#endif
#ifdef TI_CELLPHONE_IMPLEMENTATION
virtual u32 getType();
#elif (defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION)
virtual int getType();
#else
virtual void getType();
#endif
#ifdef TI_CELLPHONE_IMPLEMENTATION
virtual void setLanguage(Language language) { meLanguage = language; }
#else
virtual void setLanguage(Language language);
#endif
#if (defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION)
#ifdef TISIGNWINDOW_IMPLEMENTATION
virtual Language getLanguage() const;
#else
virtual Language getLanguage() const { return meLanguage; }
#endif
virtual void update() {}
#else
virtual Language getLanguage() const;
virtual void update();
#endif
virtual void onActive();
protected:

View File

@@ -19,13 +19,12 @@ namespace textinput {
bool isHoldingShift() const {
return isHWPressedShift() || isPressedShiftB();
}
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
u8 isCapsLock() const { return mbCpasLock; }
void setPressedShiftB(bool pressed) { mbPressedShiftB = pressed; }
#endif
u8 isHWPressedShift() const { return mbPressedShift; }
u8 isPressedShiftB() const { return mbPressedShiftB; }
void setHWPressedShift(const u8& arg) { mbPressedShift = arg; }
void setHWPressedShift(u8 arg) { mbPressedShift = arg; }
void setPressedShiftB(u8 arg) { mbPressedShiftB = arg; }
void clearPressedShift() { mbPressedShift = 0; mbPressedShiftB = 0; }
class Singleton {
public:

View File

@@ -9,6 +9,8 @@
#include "tiToolBar.h"
#include "tiPcKeyboard.h"
#include "tiCellPhone.h"
#include "tiPredictLang.h"
#include "tiSignWindow.h"
#include <nw4r/lyt/pane.h>
#include <nw4r/lyt/arcResourceAccessor.h>
@@ -23,25 +25,16 @@
namespace textinput {
class EventObserver {
public:
virtual void onInput(CommandReceiver::INPUT_COMMAND command, void* data) {} // 0x08
virtual void onCommand(CommandReceiver::INPUT_COMMAND command, void* data) {} // 0x0C
virtual void onEvent(nw4r::lyt::Pane* pane, u32 event) {} // 0x10
virtual void onInput(CommandReceiver::INPUT_COMMAND command, void* data); // 0x08
virtual void onCommand(CommandReceiver::INPUT_COMMAND command, void* data); // 0x0C
virtual void onEvent(nw4r::lyt::Pane* pane, u32 event); // 0x10
virtual void onSE(sound::SE seId) {}
#ifdef TIMANAGER_IMPLEMENTATION
virtual void onOK();
virtual void onCancel();
virtual void onOutOfLength();
#else
virtual void onOK() { printf("OK!\n"); }
virtual void onCancel() { printf("Cancel!\n"); }
virtual void onOutOfLength() { printf("OutOfLength\n"); }
#endif
virtual void onSE(sound::SE seId);
virtual void onOK();
virtual void onCancel();
virtual void onOutOfLength();
};
#ifdef TIMANAGER_IMPLEMENTATION
namespace predictlang { class LayoutByNW4R; }
#endif
class Manager : public Base {
public:
Manager(MEMAllocator* allocator, nw4r::lyt::MultiArcResourceAccessor* multiArc, textinput::EventObserver* event);
@@ -64,10 +57,7 @@ namespace textinput {
virtual void setWCString(const wchar_t* string);
virtual void setLanguage(Language language);
virtual Language getLanguage() const { return meLanguage; }
#ifdef MYTIMANAGER_IMPLEMENTATION
Language getLanguageForMemo() const { return meLanguage; }
#endif
virtual Language getLanguage() const;
virtual void setDestination(Destination destination);
@@ -78,74 +68,49 @@ namespace textinput {
virtual void setAspectRatio(bool b4x3);
#ifdef MYTIMANAGER_IMPLEMENTATION
MEMAllocator* getAllocatorForMemo() const { return mpAllocator; }
inputform::EditBuffer* getEditBufferForMemo() const { return mpEditBuffer; }
void setEditBufferForMemo(inputform::EditBuffer* editBuffer) { mpEditBuffer = editBuffer; }
void setHWKeyboardForMemo(keyboard::hwkey::HWKeyboard* keyboard) { mpHWKeyboard = keyboard; }
nw4r::lyt::MultiArcResourceAccessor* getMultiArcForMemo() const { return mpMultiArcResourceAccessor; }
EventObserver* getEventObserverForMemo() const { return mpEventObserver; }
InputForm* getInputFormForMemo() const { return mpInputForm; }
void setInputFormForMemo(InputForm* inputForm) { mpInputForm = inputForm; }
toolbar::LayoutByNW4R* getToolBarForMemo() const { return mpToolBar; }
candidatebox::LayoutByNW4R* getCandidateBoxForMemo() const { return mpCandidateBox; }
void setPCKeyboardForMemo(keyboard::pctype::LayoutByNW4R* keyboard) { mpPCKeyboard = keyboard; }
void setCellPhoneKeyboardForMemo(keyboard::cellphonetype::LayoutByNW4R* keyboard) { mpCellPhoneKeyboard = keyboard; }
void setCandidateBoxForMemo(candidatebox::LayoutByNW4R* candidateBox) { mpCandidateBox = candidateBox; }
void setToolBarForMemo(toolbar::LayoutByNW4R* toolBar) { mpToolBar = toolBar; }
void setPredictLanguageDialogForMemo(void* dialog) { mpPredictLanguageDialog = dialog; }
void setSignWindowForMemo(void* signWindow) { mpSignWindow = signWindow; }
void* getSignWindowForMemo() const { return mpSignWindow; }
keyboard::pctype::LayoutByNW4R* getPCKeyboardForMemo() const { return mpPCKeyboard; }
keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboardForMemo() const { return mpCellPhoneKeyboard; }
Destination getDestinationForMemo() const { return meDestination; }
void initAspect();
#endif
virtual void setSecretInputMode(bool secretInputMode) { mpInputForm->setSecretModeOn(secretInputMode); }
#if defined(IPL_ADDRESS_EDIT_CPP) || defined(TIMANAGER_IMPLEMENTATION)
void enableKSXFilter(bool compatibleFilter);
#endif
virtual void setDefaultPredictionJP(int num, const char** predicts);
virtual void setFixedPredictionJP(int num, const char** predicts);
#ifdef TIMANAGER_IMPLEMENTATION
virtual void setTitleText(wchar_t* titleText);
void initAspect();
#else
virtual void setTitleText(const wchar_t* titleText);
#endif
virtual void setTitleText(wchar_t* titleText);
virtual void start() {}
virtual void end() {}
void setTitleText(const wchar_t* titleText) {
nw4r::lyt::Pane* pane = mpInputForm->getPane("T_title_text");
nw4r::lyt::TextBox* textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
if (textBox != NULL) {
textBox->SetString(titleText, 0);
}
}
virtual void start();
virtual void end();
#ifdef TIHWKEYBOARD_IMPLEMENTATION
EventObserver* getEventObserverForHardware() const { return mpEventObserver; }
#endif
virtual InputForm* getInputForm() { return mpInputForm; }
virtual const InputForm* getInputForm() const { return mpInputForm; }
virtual const InputForm* getInputForm() const;
virtual keyboard::hwkey::HWKeyboard* getHWKeyboard() { return mpHWKeyboard; }
virtual const keyboard::hwkey::HWKeyboard* getHWKeyboard() const { return mpHWKeyboard; }
virtual const keyboard::hwkey::HWKeyboard* getHWKeyboard() const;
virtual keyboard::pctype::LayoutByNW4R* getPCKeyboard() { return mpPCKeyboard; }
virtual const keyboard::pctype::LayoutByNW4R* getPCKeyboard() const { return mpPCKeyboard; }
virtual keyboard::pctype::LayoutByNW4R* getPCKeyboard();
virtual const keyboard::pctype::LayoutByNW4R* getPCKeyboard() const;
virtual keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() { return mpCellPhoneKeyboard; }
virtual const keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() const { return mpCellPhoneKeyboard; }
virtual const keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() const;
virtual void* getSignKeyboard() { return mpSignWindow; }
virtual const void* getSignKeyboard() const { return mpSignWindow; }
virtual void* getSignKeyboard();
virtual const void* getSignKeyboard() const;
virtual candidatebox::LayoutByNW4R* getCandidateBox() { return mpCandidateBox; }
virtual candidatebox::LayoutByNW4R* getCandidateBox();
virtual const candidatebox::LayoutByNW4R* getCandidateBox() const { return mpCandidateBox; }
virtual toolbar::LayoutByNW4R* getToolBar() { return mpToolBar; }
virtual const toolbar::LayoutByNW4R* getToolBar() const { return mpToolBar; }
virtual toolbar::LayoutByNW4R* getToolBar();
virtual const toolbar::LayoutByNW4R* getToolBar() const;
virtual void* getPredictLanguageSelectDialog() { return mpPredictLanguageDialog; }
virtual const void* getPredictLanguageSelectDialog() const { return mpPredictLanguageDialog; }
virtual void* getPredictLanguageSelectDialog();
virtual const void* getPredictLanguageSelectDialog() const;
EventObserver* getEventObserver() { return mpEventObserver; }
virtual inputform::EditBuffer* createEditBuffer();
virtual keyboard::hwkey::HWKeyboard* createHWKeyboard();
@@ -161,14 +126,17 @@ namespace textinput {
virtual void setLayoutScaleFor4x3();
void enableCompatibleFilter(bool compatibleFilter);
void enableKSXFilter(bool flag);
void startPredictTurnOn(bool flag);
bool isPredictTurning() const;
bool isVacancy() const;
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
bool isPredictTurning() const;
void startPredictTurnOn(bool enabled);
#endif
private:
protected:
void initAspect();
protected:
MEMAllocator* mpAllocator; // 0x04
nw4r::lyt::MultiArcResourceAccessor* mpMultiArcResourceAccessor; // 0x08
@@ -180,14 +148,9 @@ namespace textinput {
InputForm* mpInputForm; // 0x1C
candidatebox::LayoutByNW4R* mpCandidateBox; // 0x20
toolbar::LayoutByNW4R* mpToolBar; // 0x24
#ifdef TIMANAGER_IMPLEMENTATION
predictlang::LayoutByNW4R* mpPredictLanguageDialog;
keyboard::signwindow::LayoutByNW4R* mpSignWindow;
#else
void* mpPredictLanguageDialog; // 0x28
void* mpSignWindow; // 0x2C
predictlang::LayoutByNW4R* mpPredictLanguageDialog; // 0x28
keyboard::signwindow::LayoutByNW4R* mpSignWindow; // 0x2C
#endif
EventObserver* mpEventObserver; // 0x30
Destination meDestination; // 0x34

View File

@@ -14,29 +14,20 @@ namespace textinput {
class TiEventHandler : public gui::EventHandler {
public:
typedef struct Input {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
u32 controller;
f32 x;
f32 y;
u32 trigger;
u32 hold;
u32 release;
u8 remaining[8];
#else
// todo
u32 field_0x00; // 0x00
u8 dummy[8];
u32 field_0x0C; // 0x0C
u32 field_0x10; // 0x10
u8 dummy2[12];
#endif
u32 field_0x00; // 0x00 chan
f32 mfX; // 0x04
f32 mfY; // 0x08
u32 field_0x0C; // 0x0C trigger
u32 field_0x10; // 0x10 hold
u32 field_0x14; // 0x14 release
u8 dummy[8]; // 0x18
} Input;
virtual void onEvent(gui::GUIComponent& comp, u32 event, void* data); // 0x0C
virtual void onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) = 0; // 0x18
virtual void setEventObserver(EventObserver *event) { mpEventObserver = event; } // 0x1C
virtual void setEventObserver(EventObserver *event); // 0x1C
protected:
EventObserver* mpEventObserver; // 0x08
@@ -90,35 +81,21 @@ namespace textinput {
PE_5,
PE_6,
PE_7,
PE_8,
PE_9,
PE_10,
PE_11,
PE_Last,
} AnmPaneEvent;
virtual void init() {} // 0x08
virtual void calc(); // 0x0C
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
virtual void onAnmEvent(AnmPaneEvent) {}
#else
virtual void onAnmEvent(AnmPaneEvent paneEvent);
#endif // 0x10
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
virtual void changeAnimation(u32 id); // 0x14
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
virtual bool isInAnimation() { return mpCurrentAnim != NULL; }
#else
virtual bool isInAnimation();
#endif // 0x18
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
virtual Anim* searchAnimation(u32 id) {
for (Anim* animation = static_cast<Anim*>(nw4r::ut::List_GetNext(&mAnms, NULL)); animation != NULL;
animation = static_cast<Anim*>(nw4r::ut::List_GetNext(&mAnms, animation))) {
if (animation->muID == id) return animation;
}
return NULL;
}
#else
virtual Anim* searchAnimation(u32 id);
#endif // 0x1C
virtual bool isInAnimation(); // 0x18
virtual Anim* searchAnimation(u32 id); // 0x1C
virtual ~AnmPane(); // 0x20
@@ -156,11 +133,11 @@ namespace textinput {
class AnimPaneGroup {
public:
#ifdef MYTIINPUTFORM_IMPLEMENTATION
AnimPaneGroup() {}
AnimPaneGroup(nw4r::lyt::Group* group) : mpGroup(group) {
nw4r::ut::List_Init(&mAnmPaneList, offsetof(AnmPane, mGroupLink));
}
#endif
virtual void create() {} // 0x08
virtual void init() {} // 0x0C
@@ -214,11 +191,7 @@ namespace textinput {
virtual nw4r::lyt::Pane* get(int i) { return mpaFifo[i]; } // 0x10
virtual nw4r::lyt::Pane* getLast() { // 0x14
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
for (int i = MAX_COUNT-1; i > -1; i--) {
#else
for (int i = MAX_COUNT-1; i > -1; i++) {
#endif
if (mpaFifo[i] != NULL) {
return mpaFifo[i];
}
@@ -247,14 +220,14 @@ namespace textinput {
virtual bool updateInput(int point, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); // 0x20
virtual bool updateInput(input::HKBManager& hkbManager); // 0x24
virtual TiLayout* getLayout() { return mpLayout; } // 0x28
virtual TiLayout* getLayout(); // 0x28
virtual nw4r::lyt::Pane* getPane(const char* paneName); // 0x2C
virtual const nw4r::lyt::Pane* getPane(const char* paneName) const; // 0x30
virtual u32 getFlightDuration(int point, const char* paneName); // 0x34
virtual void setAnimOn(bool flag) { mbAnimOn = flag; } // 0x38
virtual void setAnimOn(bool flag); // 0x38
virtual void drawPane(const char* paneName); // 0x3C
@@ -263,16 +236,8 @@ namespace textinput {
virtual void setProjectionMtx(); // 0x48
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
virtual void setPaneLastDrawReceived(nw4r::lyt::Pane* pane) { mAnmPaneFifo.push(pane); }
#else
virtual void setPaneLastDrawReceived(nw4r::lyt::Pane* paneLastDraw);
#endif // 0x4C
#ifdef TI_PC_KEYBOARD_IMPLEMENTATION
virtual void initPaneLastDrawReceived() { mAnmPaneFifo.init(); }
#else
virtual void initPaneLastDrawReceived();
#endif // 0x50
virtual void setPaneLastDrawReceived(nw4r::lyt::Pane* paneLastDraw); // 0x4C
virtual void initPaneLastDrawReceived(); // 0x50
virtual void setVisible(const char* paneName, bool flag); // 0x54
virtual bool isVisible(const char* paneName, bool* result) const; // 0x58
@@ -282,8 +247,8 @@ namespace textinput {
virtual AnmPane* searchAnmPane(const char* paneName); // 0x60
virtual AnmPane* searchAnmPane(wchar_t ch); // 0x64
virtual nw4r::ut::List& getAnmPaneList() { return mAnmPanes; } // 0x68
virtual gui::PaneManager* getPaneManager() { return mpPaneManager; } // 0x6C
virtual nw4r::ut::List& getAnmPaneList(); // 0x68
virtual gui::PaneManager* getPaneManager(); // 0x6C
virtual void AdjustPaneMtx(Mtx& mtx, const nw4r::lyt::DrawInfo& drawInfo, const nw4r::math::MTX34& mGlobalMtx); // 0x70

View File

@@ -1,210 +1,340 @@
#ifndef TEXTINPUT_PC_KEYBOARD_H
#define TEXTINPUT_PC_KEYBOARD_H
#if (defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION)
#include "tiPcKeyboardImpl.h"
#else
#include "tiNw4rManager.h"
#include "tiTextInputBase.h"
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
#include "tiKeyboard.h"
#endif
#include "tiNw4rManager.h"
#include "tiGUIManager.h"
namespace textinput {
class Manager;
namespace predictlang {
class LayoutByNW4R;
}
namespace keyboard {
namespace signwindow {
class LayoutByNW4R;
}
namespace pctype {
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
class UIObj {
class LayoutByNW4R;
class AnmPane;
class UIObj : public gui::EventHandler {
public:
class Listener {
public:
virtual void onEvent(UIObj*, u32, void*);
virtual void onEvent(UIObj* uiObj, u32, void*) = 0; // 0x08
};
UIObj(u32 ctrlNo, LayoutByNW4R* layout, Listener* listener) : mCtrlNo(ctrlNo), mpLayout(layout) {
mpListener = listener;
}
virtual ~UIObj(); // 0x08
virtual void onEvent(gui::GUIComponent& comp, u32 event, void* data); // 0x0C
virtual void onGUIEvent(gui::PaneComponent& pane, u32 event, nw4rmanager::TiEventHandler::Input* input); // 0x18
protected:
u32 mCtrlNo; // 0x08
LayoutByNW4R* mpLayout; // 0x0C
Listener* mpListener; // 0x10
};
#endif
// TODO
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
class Base : public textinput::keyboard::KeyboardBase {
#else
class Base : public CommandSender {
#endif
class UIModifierButton : public UIObj {
friend class LayoutByNW4R;
public:
enum TranslateMode {
UIModifierButton(u32 ctrlNo, LayoutByNW4R* layout, Listener* listener);
virtual ~UIModifierButton();
virtual void onGUIEvent(gui::PaneComponent& pane, u32 event, nw4rmanager::TiEventHandler::Input* input);
private:
gui::PaneComponent* mpPaneComp1; // 0x14
gui::PaneComponent* mpPaneComp2; // 0x18
nw4rmanager::AnmPane* mpAnmPane; // 0x1C
u8 mbFocused; // 0x20
};
class UIModePanel : public UIObj {
friend class LayoutByNW4R;
public:
UIModePanel(u32 ctrlNo, LayoutByNW4R* layout, Listener* listener);
virtual ~UIModePanel();
virtual void onGUIEvent(gui::PaneComponent& pane, u32 event, nw4rmanager::TiEventHandler::Input* input);
void Create(nw4rmanager::Layout* layout);
private:
u32 unk_0x14; // 0x14
gui::PaneComponent* mpComps1[5]; // 0x18
gui::PaneComponent* mpComps2[5]; // 0x2C
nw4rmanager::AnmPane* mpAnmPanes[5]; // 0x40
nw4r::lyt::Pane* mExtraPanes[3]; // 0x54
GXTexObj mTexObjs[4]; // 0x60
};
class AnmPane : public nw4rmanager::AnmPane {
public:
AnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: nw4rmanager::AnmPane(pane, observer) {
mState = 0;
}
virtual void init(); // 0x08
virtual void changeAnimation(u32 id); // 0x14
virtual ~AnmPane(); // 0x20
virtual u32 getState() const { return mState; } // 0x24
virtual u32 getKeyType() const { return mKeyType; } // 0x28
protected:
s32 mState; // 0x2C
u32 mKeyType; // 0x30
};
class NormalButtonAnmPane : public AnmPane {
public:
NormalButtonAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) {
mKeyType = 0;
}
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
virtual ~NormalButtonAnmPane();
};
class ShiftCapsAnmPane : public AnmPane {
public:
ShiftCapsAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) {
mKeyType = 1;
mbFocused = false;
}
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
virtual ~ShiftCapsAnmPane();
virtual bool isFocused() const; // 0x2C
private:
u8 mbFocused; // 0x34
};
class ToggleButtonAnmPane : public AnmPane {
public:
ToggleButtonAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) {
mKeyType = 2;
}
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
virtual ~ToggleButtonAnmPane();
};
class OnOffButtonAnmPane : public AnmPane {
public:
OnOffButtonAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) {
mKeyType = 3;
}
virtual void onAnmEvent(AnmPaneEvent paneEvent); // 0x10
virtual ~OnOffButtonAnmPane();
};
class EventHandler : public nw4rmanager::TiEventHandler {
public:
EventHandler(LayoutByNW4R* layout) : mpLayout(layout) {}
virtual ~EventHandler(); // 0x08
virtual void onTiEvent(gui::PaneComponent* paneComponent, u32 event, TiEventHandler::Input* input); // 0x18
private:
LayoutByNW4R* mpLayout; // 0x0C
};
class Base : public KeyboardBase {
public:
typedef enum TranslateMode {
TM_00,
#ifdef TIINPUTFORM_IMPLEMENTATION
TM_Kana,
TM_Roman,
#endif
};
TM_01,
TM_02,
TM_03,
} TranslateMode;
enum InputType {
IT_00,
IT_01,
IT_02,
IT_03,
IT_04,
};
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
enum InputMode {
typedef enum InputMode {
IM_00,
IM_01,
IM_02,
IM_03,
IM_04,
IM_05,
IM_06,
IM_07,
IM_08,
} InputMode;
typedef enum InputType {
IT_00,
IT_01,
IT_02,
IT_03,
IT_04,
} InputType;
struct KeyState {
#ifdef TI_PCTYPE_SAMPLE_CLASS
KeyState() : mFlags(0), mIsABC(0), mAIUFlags(0), mLanguage((Language)1) {}
#endif
void refresh_();
void refreshText(nw4r::lyt::Pane* pane);
void setABCFlag(u32 flag);
wchar_t getWCCode(u32 keyType);
wchar_t getWCCode(char* out);
u32 mFlags; // 0x00
u32 mIsABC; // 0x04
u32 mAIUFlags; // 0x08
Language mLanguage; // 0x0C
const void* mpLanguageDep; // 0x10
Base* mpBase; // 0x14
};
#ifdef TI_PCTYPE_SAMPLE_CLASS
Base(Manager* manager) {
mKeyState.mpLanguageDep = NULL;
mKeyState.mpBase = this;
mpAllocator = NULL;
mbOnlyQwerty = false;
mpManager = manager;
}
#endif
virtual ~Base();
virtual void create(MEMAllocator* allocator) override; // 0x0C
virtual void init() override; // 0x10
virtual void updateFromReceiver(u32, void*) override; // 0x1C
virtual void onKey(u32, void*); // 0x20
virtual int getType(); // 0x24
virtual void setLanguage(Language language) override; // 0x28
virtual void onActive() override; // 0x34
virtual void inputCharCode(wchar_t wc); // 0x38
virtual void* getState(); // 0x3C
virtual bool isShiftOn() const; // 0x40
virtual bool isCapsOn() const; // 0x44
virtual bool isABC(); // 0x48
virtual void setABC(bool); // 0x4C
virtual int getABCInputMode() const; // 0x50
virtual int getAIUInputMode() const; // 0x54
virtual TranslateMode getTranslateMode() const; // 0x58
virtual void setTranslateMode(TranslateMode mode); // 0x5C
virtual void onlyQwerty(bool); // 0x60
virtual void setLangKeyActive(bool); // 0x64
virtual void setInputModeJP(bool, u32, u32); // 0x68
virtual void setInputModeCK(u32); // 0x6C
virtual void refreshState(); // 0x70
virtual void changeABCInputMode(InputMode mode); // 0x74
virtual void changeAIUInputMode(InputMode mode); // 0x78
virtual void onClose(); // 0x7C
virtual wchar_t getWCCode(char* out); // 0x80
virtual u32 getControlKey(char* out); // 0x84
virtual void sendInputWChar(wchar_t wc, bool flag); // 0x88
virtual void goSignInputMode(); // 0x8C
virtual void changePredictLanguage(); // 0x90
virtual void updateFixMode(); // 0x94
protected:
Manager* mgr() { return mpManager; }
public:
u8 unk_0x14; // 0x14
u8 unk_0x15[3]; // 0x15
u32 unk_0x18; // 0x18
const void* mpLanguageDep; // 0x1C
KeyState mKeyState; // 0x20
MEMAllocator* mpAllocator; // 0x38
u8 mbOnlyQwerty; // 0x3C
u8 mbLangKeyActive; // 0x3D
u8 unk_0x3E[2]; // 0x3E
Manager* mpManager; // 0x40
};
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public UIObj::Listener {
public:
#ifdef TI_PCTYPE_SAMPLE_CLASS
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, arcName, observer), mpEventHandler(NULL),
mShiftButton(1, this, this), mCapsButton(0, this, this), mModePanel(2, this, this) {}
#endif
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void updateFromReceiver(u32, void*) override;
virtual void onKey(u32, void*) override;
#ifdef TI_CELLPHONE_IMPLEMENTATION
virtual u32 getType() override;
#else
virtual void getType() override;
#endif
virtual void setLanguage(Language) override;
virtual void setLanguage(Language language) override;
virtual void onActive() override;
virtual void inputCharCode(u16);
virtual void getState();
virtual bool isShiftOn() const;
virtual bool isCapsOn() const;
virtual bool isABC();
virtual void setABC(bool);
virtual InputMode getABCInputMode() const;
virtual InputMode getAIUInputMode() const;
virtual TranslateMode getTranslateMode() const;
virtual void setTranslateMode(TranslateMode);
virtual void onlyQwerty(bool);
virtual void setLangKeyActive(bool);
virtual void setInputModeJP(bool, u32, u32);
virtual void setInputModeCK(u32);
virtual void refreshState();
virtual void changeABCInputMode(InputMode);
virtual void changeAIUInputMode(InputMode);
virtual void onClose();
virtual void getWCCode(char*);
virtual void getControlKey(char*);
virtual void sendInputWChar(u16, bool);
virtual void goSignInputMode();
virtual void changePredictLanguage();
virtual void updateFixMode();
#else
virtual ~Base();
virtual void create(MEMAllocator* allocator);
virtual void init();
virtual void setCommandReceiver(textinput::CommandReceiver*);
virtual void updateFromReceiver(u32, void*);
virtual void onKey();
virtual void getType();
virtual void setLanguage();
virtual void getLanguage();
virtual void update();
virtual void onActive();
virtual void inputCharCode();
virtual void getState();
virtual void isShiftOn();
virtual void isCapsOn();
virtual void isABC();
virtual void setABC();
virtual void getABCInputMode();
virtual void getAIUInputMode();
virtual TranslateMode getTranslateMode();
virtual void setTranslateMode(TranslateMode);
virtual void onlyQwerty();
virtual void setLangKeyActive(bool);
virtual void setInputModeJP();
virtual void setInputModeCK();
virtual void refreshState();
virtual void changeABCInputMode();
virtual void changeAIUInputMode();
virtual void onClose();
virtual void getWCCode();
virtual void getControlKey();
virtual void sendInputWChar();
virtual void goSignInputMode();
virtual void changePredictLanguage();
virtual void updateFixMode();
#endif
virtual void inputCharCode(wchar_t wc) override;
virtual void setABC(bool) override;
virtual void setTranslateMode(TranslateMode mode) override;
virtual void onlyQwerty(bool) override;
virtual void setLangKeyActive(bool) override;
virtual void setInputModeJP(bool, u32, u32) override;
virtual void setInputModeCK(u32) override;
virtual void refreshState() override;
virtual void onClose() override;
virtual void sendInputWChar(wchar_t wc, bool flag) override;
virtual void goSignInputMode() override;
virtual void changePredictLanguage() override;
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
private:
u8 mKeyboardInputFlags[8];
const void* mpKeyStateTable;
u32 mTranslateMode;
u32 mABCInputMode;
u32 mAIUInputMode;
u32 mCurrentInputType;
u32 mInputState;
const void* mpLanguageData;
#ifdef TIINPUTFORM_IMPLEMENTATION
MEMAllocator* mpAllocator;
#endif
bool mbOnlyQwerty;
bool mbLanguageKeyActive;
u16 mKeyboardFlags;
void* mpInputSettings;
void* mpCurrentKeyState;
virtual void draw(); // 0x11C
virtual void calc(); // 0x120
virtual void setPredictLanguageDialog(predictlang::LayoutByNW4R* dialog); // 0x124
virtual void setSignWindow(signwindow::LayoutByNW4R* window); // 0x128
virtual void setLineFeedButton(bool); // 0x12C
virtual void setPredictLanguageButton(bool); // 0x130
virtual void setSignWindowButton(bool); // 0x134
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); // 0x138
virtual bool updateInput(textinput::input::HKBManager& hkbManager); // 0x13C
virtual void changeAnimationAllToNormal(); // 0x140
virtual void throwReleaseForAll(); // 0x144
virtual void cancelStateFocusIn(); // 0x148
virtual void updatePredictLanguage(CommandReceiver::ChangePredictMode* mode); // 0x14C
virtual void updateDakuten(); // 0x150
virtual void initLayout(); // 0x154
virtual void onEvent(UIObj* uiObj, u32, void*); // 0x158
public:
#ifdef TIINPUTFORM_IMPLEMENTATION
bool isQwertyOnly() const { return mbOnlyQwerty; }
bool isLanguageKeyActive() const { return mbLanguageKeyActive; }
#endif
u32 getTranslateModeForMemo() const { return mTranslateMode; }
u32 getABCInputModeForMemo() const { return mABCInputMode; }
u32 getAIUInputModeForMemo() const { return mAIUInputMode; }
#endif
};
// TODO
class LayoutByNW4R : public Base, public nw4rmanager::Layout
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
, public UIObj::Listener
#endif
{
public:
// TODO - ...
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
virtual void draw();
virtual void calc();
virtual void setPredictLanguageDialog(void*);
virtual void setSignWindow(void*);
virtual void setLineFeedButton(bool);
virtual void setPredictLanguageButton(bool);
virtual void setSignWindowButton(bool);
#endif
virtual void onClose();
void onPressedShift(bool shift);
void createAnmPane_(MEMAllocator* allocator);
void onPressedCaps();
void onPressedShift(bool);
void onReleasedShift();
#ifdef TIINPUTFORM_IMPLEMENTATION
bool hasLineFeedButton() const { return mbLineFeedButton; }
private:
void* mpPredictLanguageDialog;
void* mpSignWindow;
bool mbLineFeedButton;
public:
#endif
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION)
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data) override;
virtual bool updateInput(input::HKBManager& hkbManager) override;
#endif
EventHandler* mpEventHandler; // 0xF0
predictlang::LayoutByNW4R* mpPredictLanguageDialog; // 0xF4
signwindow::LayoutByNW4R* mpSignWindow; // 0xF8
bool mbLineFeed; // 0xFC
u8 unk_0xFD[3]; // 0xFD
UIModifierButton mShiftButton; // 0x100
UIModifierButton mCapsButton; // 0x124
UIModePanel mModePanel; // 0x148
};
#ifdef TI_PCTYPE_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, arcName, observer) {}
virtual ~Sample();
};
#else
class Sample {};
#endif
} // namespace pctype
} // namespace keyboard
} // namespace textinput
#endif
#endif // TEXTINPUT_HW_KEYBOARD_H
#endif // TEXTINPUT_PC_KEYBOARD_H

View File

@@ -14,17 +14,13 @@ namespace textinput {
class Base : public CommandSender {
public:
#if defined(TI_PREDICTLANG_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
#ifdef TI_PREDICTLANG_SAMPLE_CLASS
Base(Manager* manager) : mePredictMode(inputform::Base::PM_USEn), mpAllocator(NULL), mpManager(manager) {}
#endif
#ifdef TIMANAGER_IMPLEMENTATION
virtual ~Base();
virtual void init();
virtual void create(MEMAllocator* allocator) override;
#else
virtual ~Base() {}
virtual void create(MEMAllocator* allocator) override { mpAllocator = allocator; }
#endif
virtual void init();
virtual void setPredictMode(inputform::Base::PredictMode mode) { mePredictMode = mode; }
protected:
@@ -38,20 +34,16 @@ namespace textinput {
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public nw4rmanager::AnmObserver {
public:
#ifdef TIMANAGER_IMPLEMENTATION
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
: Base(manager), nw4rmanager::Layout(resAccessor, layoutName, observer), mbActive(false), mbInput(false),
mpEventHandler(NULL), meDestination(DST_US), mpCaller(NULL) {}
#elif defined(TI_PREDICTLANG_SAMPLE_CLASS)
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, "fs_prdicSelWidw_a.brlyt", observer), mbActive(false), mbInput(false),
#ifdef TI_PREDICTLANG_SAMPLE_CLASS
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, arcName, observer), mbActive(false), mbInput(false),
mpEventHandler(NULL), meDestination(DST_US), mpCaller(NULL) {}
#endif
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void draw() override;
virtual void init() override;
virtual void open(inputform::Base::PredictMode predictMode, keyboard::KeyboardBase* keyboard);
virtual void endToOpen();
@@ -78,21 +70,12 @@ namespace textinput {
keyboard::KeyboardBase* mpCaller; // 0xD4
};
#if defined(TI_PREDICTLANG_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
#ifdef TI_PREDICTLANG_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
#ifdef TIMANAGER_IMPLEMENTATION
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
: LayoutByNW4R(manager, resAccessor, observer, layoutName) {}
#else
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, observer) {}
#endif
#ifdef TIMANAGER_IMPLEMENTATION
virtual ~Sample();
#else
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, arcName, observer) {}
virtual ~Sample() {}
#endif
};
#endif

View File

@@ -7,7 +7,13 @@ namespace textinput {
namespace extend {
namespace savedata {
typedef struct MemoSetting {
u8 uRevisionAndType; // 0x00
union {
u8 uRevisionAndType; // 0x00
struct {
u8 uType : 4; // 0x00:11110000
u8 uRevision : 4; // 0x00:00001111
};
};
union {
struct {

View File

@@ -3,132 +3,152 @@
#include "tiKeyboard.h"
#include "tiNw4rManager.h"
#include "tiTextInputBase.h"
#include "tiSwData.h"
namespace textinput {
class Manager;
namespace keyboard {
class Manager;
namespace signwindow {
struct LanguageDependency {
u8 count;
const PaneNameToCharCodeInSignMode* keys;
};
class Base : public KeyboardBase {
public:
virtual ~Base();
virtual void create(MEMAllocator*) override;
virtual void init() override;
virtual void onKey(u32, void*) override;
virtual bool isLocked();
virtual void setPage(u8);
virtual u8 getPage();
virtual void movePrevSignPage();
virtual void moveNextSignPage();
virtual void close();
virtual int getType() override;
virtual void setLanguage(Language) override;
protected:
u8 mInputFlags;
bool mbLocked;
bool mbRepeat;
u8 muPage;
const LanguageDependency* mpLanguageDependency;
MEMAllocator* mpAllocator;
Manager* mpManager;
};
class EventHandler;
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public nw4rmanager::AnmObserver {
public:
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator*) override;
virtual void init() override;
virtual void onKey(u32, void*) override;
virtual void movePrevSignPage() override;
virtual void moveNextSignPage() override;
virtual void close() override;
virtual void draw() override;
virtual void open(KeyboardBase*, bool);
virtual bool isActive();
virtual void onChangeAnmState(AnmEvent, nw4rmanager::AnmPane*, nw4rmanager::Anim*) override;
virtual bool updateInput(int, f32, f32, u32, u32, u32, void*) override;
virtual bool updateInput(input::HKBManager&) override;
virtual void throwReleaseForAll();
virtual void resetAnmSignWindow();
virtual void setSignKeyTop(u16, u16);
virtual void setPageNumber(u16);
virtual void endToClose();
virtual void startToInput();
virtual void movePrevSignWindow();
virtual void moveNextSignWindow();
bool mbActive;
bool mbInput;
EventHandler* mpEventHandler;
KeyboardBase* mpKeyboard;
};
class Sample : public LayoutByNW4R {
public:
virtual ~Sample();
};
class EventHandler : public nw4rmanager::TiEventHandler {
public:
explicit EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
virtual ~EventHandler();
virtual void onTiEvent(gui::PaneComponent*, u32, Input*) override;
LayoutByNW4R* mpLayoutByNW4R;
};
class AnmPane : public nw4rmanager::AnmPane {
public:
AnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: nw4rmanager::AnmPane(pane, observer), muAnimation(0) {}
inline virtual ~AnmPane();
virtual void init() override;
virtual void changeAnimation(u32) override;
virtual u32 getKeyType() const;
protected:
s32 muAnimation;
u32 muKeyType;
};
class CellPhoneSignAllAnmPane : public AnmPane {
public:
CellPhoneSignAllAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: AnmPane(pane, observer) { muKeyType = 0; }
virtual ~CellPhoneSignAllAnmPane();
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent) override;
};
class CellPhoneSignScrollAnmPane : public AnmPane {
public:
CellPhoneSignScrollAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: AnmPane(pane, observer) { muKeyType = 1; }
virtual ~CellPhoneSignScrollAnmPane();
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent) override;
};
class CellPhoneSignButtonPane : public AnmPane {
public:
CellPhoneSignButtonPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: AnmPane(pane, observer) { muKeyType = 2; }
virtual ~CellPhoneSignButtonPane();
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent) override;
};
}
}
}
namespace keyboard {
namespace signwindow {
struct LanguageDependency {
u8 count;
const PaneNameToCharCodeInSignMode* keys;
};
class Base : public KeyboardBase {
public:
#ifdef TI_SIGNWINDOW_SAMPLE_CLASS
Base(Manager* manager) : mpAllocator(NULL), mpManager(manager) {}
#endif
virtual ~Base();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void onKey(u32, void*);
virtual int getType();
virtual void setLanguage(Language language) override;
virtual bool isLocked(); // 0x38
virtual void setPage(u8 page); // 0x3C
virtual u8 getPage(); // 0x40
virtual void movePrevSignPage(); // 0x44
virtual void moveNextSignPage(); // 0x48
virtual void close(); // 0x4C
protected:
u8 mInputFlags; // 0x14
bool mbLocked; // 0x15
bool mbRepeat; // 0x16
u8 muPage; // 0x17
const LanguageDependency* mpLanguageDependency; // 0x18
MEMAllocator* mpAllocator; // 0x1C
Manager* mpManager; // 0x20
};
class AnmPane;
class EventHandler;
class LayoutByNW4R : public Base, public nw4rmanager::Layout, public nw4rmanager::AnmObserver {
public:
#ifdef TI_SIGNWINDOW_SAMPLE_CLASS
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, arcName, observer), mbActive(false), mbInput(false),
mpEventHandler(NULL), mpKeyboard(NULL) {}
#endif
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void onKey(u32, void*) override;
virtual void movePrevSignPage() override; // 0x44
virtual void moveNextSignPage() override; // 0x48
virtual void close() override; // 0x4C
virtual void draw(); // 0xD4
virtual void open(KeyboardBase* keyboard, bool flag); // 0xD8
virtual bool isActive(); // 0xDC
virtual void onChangeAnmState(nw4rmanager::AnmObserver::AnmEvent anmEvent,
nw4rmanager::AnmPane* anmPane, nw4rmanager::Anim* anim); // 0xE0
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); // 0xE4
virtual bool updateInput(textinput::input::HKBManager& hkbManager); // 0xE8
virtual void throwReleaseForAll(); // 0xEC
virtual void resetAnmSignWindow(); // 0xF0
virtual void setSignKeyTop(u16, u16); // 0xF4
virtual void setPageNumber(u16); // 0xF8
virtual void endToClose(); // 0xFC
virtual void startToInput(); // 0x100
virtual void movePrevSignWindow(); // 0x104
virtual void moveNextSignWindow(); // 0x108
private:
bool mbActive; // 0xD0
bool mbInput; // 0xD1
EventHandler* mpEventHandler; // 0xD4
KeyboardBase* mpKeyboard; // 0xD8
};
#ifdef TI_SIGNWINDOW_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, arcName, observer) {}
virtual ~Sample();
};
#else
class Sample {};
#endif
class EventHandler : public nw4rmanager::TiEventHandler {
public:
explicit EventHandler(LayoutByNW4R* layout) : mpLayoutByNW4R(layout) {}
virtual ~EventHandler();
virtual void onTiEvent(gui::PaneComponent*, u32, Input*) override;
LayoutByNW4R* mpLayoutByNW4R;
};
class AnmPane : public nw4rmanager::AnmPane {
public:
AnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: nw4rmanager::AnmPane(pane, observer), muAnimation(0) {}
inline virtual ~AnmPane();
virtual void init() override;
virtual void changeAnimation(u32) override;
virtual u32 getKeyType() const;
protected:
s32 muAnimation;
u32 muKeyType;
};
class CellPhoneSignAllAnmPane : public AnmPane {
public:
CellPhoneSignAllAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: AnmPane(pane, observer) { muKeyType = 0; }
virtual ~CellPhoneSignAllAnmPane();
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent) override;
};
class CellPhoneSignScrollAnmPane : public AnmPane {
public:
CellPhoneSignScrollAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: AnmPane(pane, observer) { muKeyType = 1; }
virtual ~CellPhoneSignScrollAnmPane();
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent) override;
};
class CellPhoneSignButtonPane : public AnmPane {
public:
CellPhoneSignButtonPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
: AnmPane(pane, observer) { muKeyType = 2; }
virtual ~CellPhoneSignButtonPane();
virtual void init() override;
virtual void onAnmEvent(AnmPaneEvent) override;
};
} // namespace signwindow
} // namespace keyboard
} // namespace textinput
#endif // TEXTINPUT_SIGN_WINDOW_H

View File

@@ -3,9 +3,7 @@
#include <revolution/types.h>
#include <revolution/mem/allocator.h>
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
#include <revolution/kpr.h>
#endif
namespace textinput {
namespace tistring {
@@ -36,23 +34,15 @@ namespace textinput {
virtual void setLength(u16);
virtual wchar_t* getWCString() const { return mpszString; }
virtual wchar_t* getWCString() const;
virtual void setCandidate(wchar_t candidate) { mwcCandidate = candidate; }
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
virtual wchar_t getCandidate() const { return mwcCandidate; }
#else
virtual wchar_t getCandidate() { return mwcCandidate; }
#endif
virtual bool hasCandidate() const;
virtual wchar_t getLastWChar();
#if defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
protected:
#else
private:
#endif
u16 muMaxLength; // 0x04
u16 muLength; // 0x06
@@ -65,56 +55,41 @@ namespace textinput {
};
class KanaStream {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
public:
KPRQueue mQueue;
wchar_t mPending;
wchar_t mOutput[5];
#else
private:
u8 field_0x00[0x24];
#endif
};
class Decolated : public StringBase {
public:
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
Decolated(u16 maxLen) : StringBase(maxLen), mCursorStart(0), mCursorEnd(0), mbSustain(false), mTranslateMode(0) { initKanaConverter(); }
#else
Decolated(u16 maxLen) : StringBase(maxLen), field_0x18(0), field_0x1C(0), field_0x20(0), field_0x24(0) { initKanaConverter(); }
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
virtual ~Decolated();
enum TranslateMode { TM_Direct, TM_Kana, TM_Roman, TM_Hangul };
Decolated(u16 maxLen) : StringBase(maxLen), mCursorStart(0), mCursorEnd(0), mbSustain(false), mTranslateMode(0) { initKanaConverter(); }
virtual ~Decolated();
virtual void clear();
virtual void set(const wchar_t* string);
virtual void setLength(u16 length);
void setTranslateMode(TranslateMode mode);
TranslateMode getTranslateMode() const { return static_cast<TranslateMode>(mTranslateMode); }
void inputString(const wchar_t* string, TranslateMode mode);
virtual void inputChar(wchar_t ch);
virtual void inputString(const wchar_t* string);
virtual void setLength(u16);
virtual void inputChar(wchar_t);
virtual void inputString(const wchar_t*);
virtual void deleteChar();
virtual void backSpace();
virtual void confirm(const wchar_t* string);
virtual void confirm(const wchar_t*);
virtual bool moveCursorRight();
virtual bool moveCursorLeft();
virtual void setCursorPos(u32 pos);
virtual void setCursorPos(u32);
virtual void onSustain();
virtual void offSustain();
virtual bool isOnSustain();
virtual u32 getCursorPos() const;
virtual void getCursorPos(u32* start, u32* end);
virtual void getCursorPos(u32*, u32*);
virtual bool canBackSpace();
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
virtual bool deleteForward();
#else
virtual void deleteForward();
#endif
virtual void getSelected(u32& start, u32& end);
virtual void getSelected(u32&, u32&);
virtual wchar_t getWCharAtCursor();
virtual void replaceAtCursor(wchar_t ch);
virtual void replaceAtCursor(wchar_t);
virtual bool isDakuten();
virtual void converDakuten();
virtual bool isHandaku();
@@ -124,123 +99,68 @@ namespace textinput {
virtual void converSmall();
virtual bool atTheBeginningOfASentence();
virtual void initKanaConverter();
virtual wchar_t* getKanaBuffer();
virtual void* getKanaBuffer();
virtual bool isKanaFix() const;
virtual void confirmKana();
virtual void clearKana();
virtual void EnableKSXFilter(bool enable);
#else
virtual void inputChar();
virtual void inputString();
virtual void deleteChar();
virtual void backSpace();
virtual void confirm();
virtual void moveCursorRight();
virtual void moveCursorLeft();
virtual void setCursorPos();
virtual void onSustain();
virtual void offSustain();
virtual void isOnSustain();
virtual void getCursorPos();
virtual void getCursorPos(u32*, u32*);
virtual void canBackSpace();
virtual void deleteForward();
virtual void getSelected();
virtual void getWCharAtCursor();
virtual void replaceAtCursor();
virtual void isDakuten();
virtual void converDakuten();
virtual void isHandaku();
virtual void converHandaku();
virtual void convertAll();
virtual void isSmall();
virtual void converSmall();
virtual bool atTheBeginningOfASentence();
virtual void initKanaConverter();
virtual void getKanaBuffer();
virtual void isKanaFix();
virtual void confirmKana();
virtual void clearKana();
virtual void EnableKSXFilter();
virtual void EnableKSXFilter(bool);
#endif
void setTranslateMode(TranslateMode mode);
TranslateMode getTranslateMode() const { return static_cast<TranslateMode>(mTranslateMode); }
void inputString(const wchar_t* string, TranslateMode mode);
#if defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
protected:
#else
private:
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
u32 mCursorStart;
u32 mCursorEnd;
#if defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
u8 mbSustain;
s32 mTranslateMode;
#else
bool mbSustain;
u32 mTranslateMode;
#endif
#else
u32 field_0x18; // 0x18
u32 field_0x1C; // 0x1C
u8 field_0x20; // 0x20
u32 field_0x24; // 0x24
#endif
u32 mCursorStart; // 0x18
u32 mCursorEnd; // 0x1C
u8 mbSustain; // 0x20
s32 mTranslateMode; // 0x24
KanaStream mKanaStream; // 0x28
};
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
class WithAtok : public Decolated {
public:
WithAtok(u16 maxLength) : Decolated(maxLength) {}
virtual ~WithAtok();
struct DrawInfo;
~WithAtok();
virtual void pushBack(wchar_t ch);
virtual void popBack();
virtual void inputChar(wchar_t ch);
virtual void inputChar(wchar_t);
virtual void backSpace();
virtual void confirm(const wchar_t* string);
virtual void confirm(const wchar_t*);
virtual bool moveCursorRight();
virtual bool moveCursorLeft();
virtual void getCursorPos(u32* start, u32* end);
struct DrawInfo {
const wchar_t* string;
u32 start;
u32 end;
u32 selectedStart;
u32 selectedEnd;
};
virtual void getCursorPos(u32*, u32*);
virtual bool isFix();
virtual void setFix(bool fix);
virtual void setFix(bool);
virtual void initConverting();
virtual bool isConverting();
virtual wchar_t* getConfirmedWCString() const;
virtual int getCurrentNumPredicted();
virtual void getPredicted(int index, wchar_t* string);
virtual void commitPredicted(int index);
virtual void setSelectedCandidate(s32 index);
virtual bool getPredicted(int, wchar_t*);
virtual void commitPredicted(int);
virtual void setSelectedCandidate(long);
virtual bool isCandidateSelected();
virtual s32 getSelectedCandidate();
virtual int getSelectedCandidate();
virtual void init();
virtual void setInputting(wchar_t ch);
virtual void getDrawString(DrawInfo& info);
virtual void openDictionary(void* atok, int atokSize, void* apot, int apotSize, void* nintendo, int nintendoSize);
virtual void setInputting(wchar_t);
virtual void getDrawString(DrawInfo&);
virtual void openDictionary(void*, int, void*, int, void*, int);
virtual void closeDictionary();
virtual bool hasConfirmedString();
virtual void enableConfirmedString(bool enable);
virtual void enableConfirmedString(bool);
virtual void startConverting();
virtual bool isDictionaryOpened();
virtual void changeKanaMode(bool kana);
virtual wchar_t getInputStringLength();
virtual void changeKanaMode(bool);
virtual int getInputStringLength();
virtual void resetRelation();
virtual void setFixMode(bool fixed);
virtual void setFixPrediction(int count, const char** predictions);
virtual void setDefaultPrediction(int count, const char** predictions);
virtual s16 getSelectedConverting();
virtual s32 getFixedPredictionNum();
virtual void setFixMode(bool);
virtual void setFixPrediction(int, const char* const*);
virtual void setDefaultPrediction(int, const char* const*);
virtual int getSelectedConverting();
virtual int getFixedPredictionNum();
};
#else
class WithAtok : public StringBase {};
#endif
}
}

View File

@@ -6,17 +6,10 @@
#include <nw4r/ut/CharWriter.h>
#include <nw4r/ut/Rect.h>
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
#include <string.h>
#endif
namespace textinput {
namespace textdrawer {
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
class Base : public nw4r::ut::CharWriter {
#else
class Base : nw4r::ut::CharWriter {
#endif
public:
typedef struct ViewPort {
f32 xOrig; // 0x00
@@ -34,23 +27,11 @@ namespace textinput {
} CursorPos;
typedef struct DrawInfo {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
nw4r::ut::Rect rect;
wchar_t character;
#else
u8 unk_0x00[32];
#endif
nw4r::ut::Rect rect; // 0x00
wchar_t character; // 0x10
u8 unk_0x12[6]; // 0x12
} DrawInfo;
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
Base() : mpDrawAllocator(NULL), mfViewX(0.0f), mfViewY(0.0f), mfViewWidth(0.0f), mfViewHeight(0.0f),
mfVIWidth(640.0f), mbAspect4x3(false), mbDrawClipped(false), muLine(0), mfLineSpacing(0.0f),
mfCharacterSpacing(0.0f), mfFontWidth(0.0f), mfFontHeight(0.0f), mfModifyStartY(0.0f), mfMinScrollY(0.0f),
muDrawStartPos(0), muDrawEndPos(65535), mbSecretMode(false), muDrawModifyStartLine(0), muDrawModifyEndLine(0),
muDrawModifyStartPos(0), muDrawModifyEndPos(0), muCachedStartPos(0), muCachedEndPos(0), mbDrawCache(false),
mfCachedCursorX(0.0f), mfCachedCursorY(0.0f), mfDrawScrollY(0.0f), muCachedCursorPosition(0),
mbCursorCache(false), mbMaintainCursorCache(true) { memset(&mCachedCursor, 0, sizeof(mCachedCursor)); }
#endif
virtual void create(MEMAllocator* allocator);
virtual void draw(CursorPos* cursorPos);
virtual void draw();
@@ -72,7 +53,7 @@ namespace textinput {
virtual nw4r::math::VEC2 getScale() const = 0;
virtual void setSecretModeOn(bool secretMode) { mbSecretMode = secretMode; }
virtual void setSecretModeOn(bool secretMode);
virtual void doBeforeDrawProcess(const wchar_t*, u32, const DrawInfo& drawInfo);
virtual void doAfterDrawProcess(const wchar_t*, u32, const DrawInfo& drawInfo);
@@ -94,116 +75,49 @@ namespace textinput {
virtual u32 getEndPos() const;
// todo
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
virtual void setDrawModifyScopeLine(s32 startLine, s32 endLine);
virtual void setDrawCacheScopeLine(s32 startLine, s32 endLine);
virtual void modifyCursorCache(s32 line, u32 position, f32 x, f32 y, f32 width, f32 height);
#else
virtual void setDrawModifyScopeLine();
virtual void setDrawCacheScopeLine();
virtual void modifyCursorCache();
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
virtual void setDrawModifyScopeLine(s32, s32);
virtual void setDrawCacheScopeLine(s32, s32);
virtual void modifyCursorCache(s32, u32, f32, f32, f32, f32);
virtual bool isEnableCursorCache() const;
#else
virtual void isEnableCursorCache();
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
virtual u32 getDrawModifyStartLine() const;
virtual u32 getDrawModifyEndLine() const;
#else
virtual void getDrawModifyStartLine();
virtual void getDrawModifyEndLine();
#endif
virtual s32 getDrawModifyStartLine() const;
virtual s32 getDrawModifyEndLine() const;
virtual u32 getDrawCacheStartPos() const;
virtual void dirtyDrawCache();
virtual void dirtyCursorCache();
#ifdef TITEXTDRAWER_IMPLEMENTATION
protected:
const wchar_t* mpDrawString;
ViewPort mSavedViewport;
f32 mSavedProjection[7];
nw4r::ut::Rect mProjectionRect;
f32 mfVIWidth;
bool mbAspect4x3;
bool mbDrawClipped;
s32 muLine;
f32 mfLineSpacing;
f32 mfCharacterSpacing;
f32 mfFontWidth;
f32 mfFontHeight;
f32 mfModifyStartY;
f32 mfMinScrollY;
u32 muDrawStartPos;
u32 muDrawEndPos;
u32 muDrawCacheStartPos;
bool mbSecretMode;
s32 muDrawModifyStartLine;
s32 muDrawModifyEndLine;
s32 muDrawModifyStartPos;
s32 muDrawModifyEndPos;
u32 muCachedStartPos;
u32 muCachedEndPos;
bool mbDrawCache;
f32 mfCachedCursorX;
f32 mfCachedCursorY;
f32 mfDrawScrollY;
s32 mnCachedCursorLine;
CursorPos mCachedCursor;
bool mbCursorCache;
bool mbMaintainCursorCache;
#else
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
protected:
MEMAllocator* mpDrawAllocator;
u8 mDrawConfiguration[0x34];
f32 mfViewX;
f32 mfViewY;
f32 mfViewWidth;
f32 mfViewHeight;
f32 mfVIWidth;
bool mbAspect4x3;
bool mbDrawClipped;
u32 muLine;
f32 mfLineSpacing;
f32 mfCharacterSpacing;
f32 mfFontWidth;
f32 mfFontHeight;
f32 mfModifyStartY;
f32 mfMinScrollY;
u32 muDrawStartPos;
u32 muDrawEndPos;
u32 muDrawCacheStartPos;
#else
private:
u8 unk_0x50[0x78];
#endif
bool mbSecretMode; // 0xC8
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
u32 muDrawModifyStartLine;
u32 muDrawModifyEndLine;
u32 muDrawModifyStartPos;
u32 muDrawModifyEndPos;
u32 muCachedStartPos;
u32 muCachedEndPos;
bool mbDrawCache;
f32 mfCachedCursorX;
f32 mfCachedCursorY;
f32 mfDrawScrollY;
u32 muCachedCursorPosition;
CursorPos mCachedCursor;
bool mbCursorCache;
bool mbMaintainCursorCache;
#elif defined(MYTIINPUTFORM_IMPLEMENTATION)
protected:
u8 mDrawState[0x27];
f32 mfDrawScrollY;
u8 mDrawCacheState[0x14];
#else
u8 unk_0xCC[0x3C];
#endif
#endif
const wchar_t* mpDrawString; // 0x50
ViewPort mSavedViewport; // 0x54
f32 mSavedProjection[7]; // 0x6C
nw4r::ut::Rect mProjectionRect; // 0x88
f32 mfVIWidth; // 0x98
bool mbAspect4x3; // 0x9C
bool mbDrawClipped; // 0x9D
s32 muLine; // 0xA0
f32 mfLineSpacing; // 0xA4
f32 mfCharacterSpacing; // 0xA8
f32 mfFontWidth; // 0xAC
f32 mfFontHeight; // 0xB0
f32 mfModifyStartY; // 0xB4
f32 mfMinScrollY; // 0xB8
u32 muDrawStartPos; // 0xBC
u32 muDrawEndPos; // 0xC0
u32 muDrawCacheStartPos; // 0xC4
bool mbSecretMode; // 0xC8
s32 muDrawModifyStartLine; // 0xCC
s32 muDrawModifyEndLine; // 0xD0
s32 muDrawModifyStartPos; // 0xD4
s32 muDrawModifyEndPos; // 0xD8
u32 muCachedStartPos; // 0xDC
u32 muCachedEndPos; // 0xE0
bool mbDrawCache; // 0xE4
f32 mfCachedCursorX; // 0xE8
f32 mfCachedCursorY; // 0xEC
f32 mfDrawScrollY; // 0xF0
s32 mnCachedCursorLine; // 0xF4
CursorPos mCachedCursor; // 0xF8
bool mbCursorCache; // 0x104
bool mbMaintainCursorCache; // 0x105
};
}
}

View File

@@ -39,10 +39,6 @@ namespace textinput {
f32 y; // 0x08
} Scroll;
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
enum HVKCode { HVK_None = 0 };
#endif
class Base {
public :
virtual ~Base() {}
@@ -54,28 +50,23 @@ namespace textinput {
class CommandSender;
class CommandReceiver : public Base {
public:
#ifdef TI_CELLPHONE_IMPLEMENTATION
struct ChangePredictMode;
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
CommandReceiver() { clearSender(); }
virtual ~CommandReceiver();
#endif
#if defined(MYTIINPUTFORM_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
struct Scroll {
bool absY;
f32 x;
f32 y;
};
#endif
typedef enum INPUT_COMMAND {
IC_TRANSLATE_MODE = 6,
INPUT_COMMAND_0 = 0,
INPUT_COMMAND_37 = 37,
} INPUT_COMMAND;
#if (defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISIGNWINDOW_IMPLEMENTATION)
struct ChangePredictMode { u32 mode; bool enabled; };
#endif
typedef struct Scroll {
bool absY; // 0x00
f32 x; // 0x04
f32 y; // 0x08
} Scroll;
typedef struct ChangePredictMode {
u32 muLanguage; // 0x00
u8 mbPredictOn; // 0x04
} ChangePredictMode;
virtual void clearSender();
virtual void onCommand(INPUT_COMMAND command, void* data);
virtual void addSender(CommandSender* cmdSend);
@@ -89,13 +80,7 @@ namespace textinput {
CommandSender() : mpCommandReceiver(NULL) {}
virtual void setCommandReceiver(CommandReceiver* cmdRecv);
#if (defined(TI_PC_KEYBOARD_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)) || defined(TIMANAGER_IMPLEMENTATION)
virtual void sendCommand(u32 command, void* data) {
if (mpCommandReceiver != NULL) mpCommandReceiver->onCommand(static_cast<CommandReceiver::INPUT_COMMAND>(command), data);
}
#else
virtual void sendCommand(u32, void*);
#endif
virtual void updateFromReceiver(u32, void*) {}
nw4r::ut::Link mLink; // 0x00

View File

@@ -10,7 +10,7 @@ namespace textinput {
namespace toolbar {
class Base {
public:
#if defined(TI_TOOLBAR_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
#ifdef TI_TOOLBAR_SAMPLE_CLASS
Base(Manager* manager) : mQwerty(true), meLanguage(USA), mpAllocator(NULL), mpManager(manager) {}
#endif
@@ -35,20 +35,16 @@ namespace textinput {
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
public:
#ifdef TIMANAGER_IMPLEMENTATION
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
: Base(manager), nw4rmanager::Layout(resAccessor, layoutName, observer), mpEventHandler(NULL),
mbIsEnableQwertyChg(false) {}
#elif defined(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),
#ifdef TI_TOOLBAR_SAMPLE_CLASS
LayoutByNW4R(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: Base(manager), nw4rmanager::Layout(resAccessor, arcName, observer), mpEventHandler(NULL),
mbIsEnableQwertyChg(false) {}
#endif
virtual ~LayoutByNW4R();
virtual void create(MEMAllocator* allocator) override;
virtual void init() override;
virtual void draw() override;
virtual void init() override;
virtual void setQwerty(bool qwerty) override;
virtual void setLanguage(Language language) override;
@@ -56,19 +52,10 @@ namespace textinput {
virtual void onOK();
virtual void onCancel();
virtual void setQwertyWithSE(bool qwerty);
#ifdef TI_CELLPHONE_IMPLEMENTATION
virtual bool isEnableKeytopChange() const { return mbIsEnableQwertyChg; }
#else
virtual bool isEnableKeytopChange() const;
#endif
virtual void enableKeytopChange(bool enable);
#ifdef MYTIMANAGER_MATCHING
virtual nw4r::lyt::Pane* getDownArea();
virtual nw4r::lyt::Pane* getUpArea();
#else
virtual nw4r::lyt::Pane* getUpArea();
virtual nw4r::lyt::Pane* getDownArea();
#endif
virtual void setOKButtonVisible(bool visible);
virtual void setCancelButtonVisible(bool visible);
virtual void setOKButtonCaption(const wchar_t* caption);
@@ -130,21 +117,12 @@ namespace textinput {
KeyType meKeyType; // 0x30
};
#if defined(TI_TOOLBAR_SAMPLE_CLASS) || defined(TIMANAGER_IMPLEMENTATION)
#ifdef TI_TOOLBAR_SAMPLE_CLASS
class Sample : public LayoutByNW4R {
public:
#ifdef TIMANAGER_IMPLEMENTATION
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer, const char* layoutName)
: LayoutByNW4R(manager, resAccessor, observer, layoutName) {}
#else
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, observer) {}
#endif
#ifdef TIMANAGER_IMPLEMENTATION
virtual ~Sample();
#else
Sample(Manager* manager, nw4r::lyt::MultiArcResourceAccessor* resAccessor, const char* arcName, EventObserver* observer)
: LayoutByNW4R(manager, resAccessor, arcName, observer) {}
virtual ~Sample() {}
#endif
};
#else
class Sample {};

View File

@@ -7,9 +7,6 @@
namespace textinput {
namespace util {
#ifdef TIINPUTFORM_IMPLEMENTATION
wchar_t HankakuToZenkaku(wchar_t ch);
#endif
wchar_t toWLower(wchar_t ch);
wchar_t toWUpper(wchar_t ch);
@@ -20,15 +17,9 @@ namespace textinput {
wchar_t KBD_ConvertSmall(wchar_t ch);
wchar_t KBD_ConvertAll(wchar_t ch);
#ifdef TISTRING_IMPLEMENTATION
u32 KBD_IsDakuten(wchar_t ch);
u32 KBD_IsHandaku(wchar_t ch);
u32 KBD_IsSmall(wchar_t ch);
#else
bool KBD_IsDakuten(wchar_t ch);
bool KBD_IsHandaku(wchar_t ch);
bool KBD_IsSmall(wchar_t ch);
#endif
bool strcmp(const char* s1, const char* s2);
void replaceChar(char* dest, u32 destLen, const char* src, int replaceIdx, char newCh);
@@ -55,11 +46,10 @@ namespace textinput {
public:
Animation() : mfAnimationTime(0.0f), mbInAnimation(false), mbSE(false), mpAnimObserver(NULL) {}
#ifdef TIINPUTFORM_IMPLEMENTATION
virtual void startAnm(f32 start, f32 end, f32 duration, AnimObserver* observer, void* data);
#else
virtual void startAnm(AnimObserver*, f32, f32, f32, void*);
#endif // 0x08
virtual void startAnm(f32, f32, f32, AnimObserver*, void*); // 0x08
void startAnm(AnimObserver* observer, f32 start, f32 end, f32 frame, void* arg) {
startAnm(start, end, frame, observer, arg);
}
virtual void calc(); // 0x0C
virtual f32 getValue(); // 0x10
virtual bool isActive(); // 0x14

View File

@@ -16,7 +16,7 @@ namespace ipl {
virtual void onSE(textinput::sound::SE seId);
virtual void onOK();
virtual void onCancel();
virtual void setManager(Manager* manager) { mpKeyboardMgr = manager; }
virtual void setManager(Manager* manager);
private:
Manager* mpKeyboardMgr; // 0x04

View File

@@ -67,6 +67,7 @@ namespace ipl {
#ifdef IPL_SDMEMORY_TITLE_CACHE_ACCESS
const ESTitleId* getTitleCache() const { return &mData.titleCache[0][0]; }
ESTitleId getTitleCacheEntry(int index) const { return (&mData.titleCache[0][0])[index]; }
#endif
#ifdef IPL_SD_CHANNEL_SELECT_CPP
ESTitleId getCachedTitle(int index) const {

View File

@@ -17,6 +17,7 @@ namespace nw4r {
class FontRefLink {
public:
FontRefLink();
~FontRefLink();
void Set(const char* name, ut::Font* pFont);

View File

@@ -289,7 +289,7 @@ ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dict
extern ziU16 Zi8MatchAltSound(ziPtr soundTable, ziU16 soundCode, ziPtr pCodeTable, ziU16 index, ziU16 mask, ziU16 value, ziU8 flag ZI_NEED_WORK);
ziU16 Zi8GetPCode(ziU8* table, ziU8* node);
ziBool Zi8MatchPhonetic(ziPtr pCodeTable, ziPtr dictionary, ziPtr soundTable, ziU16 soundCode, ziU32 tableAddress, ziU8* node, ziU16* masks, ziU16* values, ziU16* count, ziU8** resultNode, ziU8** stringOffset, ziS8 partialMode, ziU8 strictMode, ziU8 numParts, ziU16 partMask, ziU16 partValue, ziU8 flag, ziU8 altMode, ziU16 initialCode, ziU16* resultCode, ziU8 lastMode ZI_NEED_WORK) {
ziBool Zi8MatchPhonetic(ziPtr pCodeTable, ziU8* dictionary, ziPtr soundTable, ziU16 soundCode, ziU32 tableAddress, ziU8* node, ziU16* masks, ziU16* values, ziU16* count, ziU8** resultNode, ziU8** stringOffset, ziU8 partialMode, ziU8 strictMode, ziU8 numParts, ziU16 partMask, ziU16 partValue, ziU8 flag, ziU8 altMode, ziU16 initialCode, ziU16* resultCode, ziU8 lastMode ZI_NEED_WORK) {
struct {
ziBool hasString;
ziU8 partIndex;
@@ -302,6 +302,10 @@ ziBool Zi8MatchPhonetic(ziPtr pCodeTable, ziPtr dictionary, ziPtr soundTable, zi
ziU16 code;
} traversal;
ziU8* sound;
typedef struct {
ziU8 header;
ziU8 content[11];
} DictionaryNode;
if (*stringOffset != 0) {
traversal.hasString = 1;
@@ -336,7 +340,12 @@ decode_node:
match_code:
if (partValue == (traversal.code & partMask)) goto next_node;
traversal.matchedParts = 1;
sound = (ziU8*)(((node[9] & 0xF) * 0x10000 + node[0xB]) + (tableAddress + node[0xA] * 0x100));
if (*count != 0) {
traversal.soundIndex = (initialCode - traversal.remaining) - 1;
} else {
traversal.soundIndex = initialCode;
}
sound = (ziU8*)(tableAddress + ((node[9] & 0xF) * 0x10000 + (node[0xB] + node[0xA] * 0x100)));
if (ZI_WORK->unk_0x16 != 0) {
switch (sound[0] & 7) {
case 2:
@@ -365,7 +374,8 @@ match_code:
*count = traversal.remaining;
return 1;
}
do {
next_group:
{
traversal.nextCode = *sound++;
traversal.partCount = traversal.nextCode & 0xF;
if ((traversal.nextCode & flag) == 0) {
@@ -377,7 +387,7 @@ match_code:
}
for (; traversal.partCount != 0; traversal.partCount--) {
traversal.partIndex = 1;
if (traversal.hasString && (*stringOffset < sound)) {
if (traversal.hasString && (sound > *stringOffset)) {
traversal.hasString = 0;
}
if (!traversal.hasString) {
@@ -389,17 +399,27 @@ match_code:
if (traversal.hasString) {
goto phonetic_skip;
}
traversal.code = Zi8GetPCode((ziU8*)pCodeTable, (ziU8*)dictionary + (traversal.dictionaryIndex & 0x7FFF) * 0xC);
if (((traversal.code & masks[traversal.partIndex]) != values[traversal.partIndex]) && (altMode == 0) && (((ziU8*)dictionary)[(traversal.dictionaryIndex & 0x7FFF) * 0xC] & 0x80) != 0) {
traversal.code = Zi8GetPCode((ziU8*)pCodeTable, dictionary + (traversal.dictionaryIndex & 0x7FFF) * sizeof(DictionaryNode));
if (((traversal.code & masks[traversal.partIndex]) != values[traversal.partIndex]) && (altMode == 0) && (dictionary[(traversal.dictionaryIndex & 0x7FFF) * sizeof(DictionaryNode)] & 0x80) != 0) {
traversal.code = Zi8MatchAltSound(soundTable, soundCode, pCodeTable, traversal.dictionaryIndex & 0x7FFF, masks[traversal.partIndex], values[traversal.partIndex], flag, ZI_WORK);
}
if ((traversal.code & masks[traversal.partIndex]) != values[traversal.partIndex]) {
goto phonetic_skip;
if ((traversal.code & masks[traversal.partIndex]) == values[traversal.partIndex]) {
goto phonetic_matched;
}
traversal.partIndex++;
if (traversal.partIndex == numParts) {
if ((partialMode != 0) && ((strictMode == 0 && (traversal.dictionaryIndex & 0x8000) != 0) || (strictMode != 0 && (traversal.dictionaryIndex & 0x8000) == 0))) {
goto phonetic_skip;
phonetic_skip:
if ((traversal.dictionaryIndex & 0x8000) == 0) {
sound++;
while ((*sound & 0x80) == 0) {
sound += 2;
}
sound++;
}
break;
phonetic_matched:
if (++traversal.partIndex == numParts) {
if (partialMode != 0) {
if (strictMode == 0 && (traversal.dictionaryIndex & 0x8000) != 0) goto phonetic_skip;
if (strictMode != 0 && (traversal.dictionaryIndex & 0x8000) == 0) goto phonetic_skip;
}
*resultNode = node;
*resultCode = ((ziU16)node[6] << 8) + node[7];
@@ -407,19 +427,10 @@ match_code:
return 1;
}
} while ((traversal.dictionaryIndex & 0x8000) == 0);
continue;
phonetic_skip:
if ((traversal.dictionaryIndex & 0x8000) == 0) {
sound++;
while ((*sound & 0x80) == 0) {
sound += 2;
}
sound++;
}
}
} while ((traversal.nextCode & 0x80) == 0);
goto next_node;
}
if ((traversal.nextCode & 0x80) != 0) goto next_node;
goto next_group;
check_code:
if (*values == (traversal.code & *masks)) goto match_code;
goto next_node;
@@ -430,22 +441,22 @@ check_code:
ziBool Zi8GetPyFinal(ziU8* pinyin, ziU8* initial, ziU8* final);
ziU8 Zi8GetPyPhonetic(ziWChar* text, ziU8 count, ziU16* initial, ziU16* final, ziU8* resultCount, ziU16* bestInitial, ziU16* bestFinal ZI_NEED_WORK) {
ziU8 firstInitial;
ziU8 pyFinal;
ziU8 pyInitial;
ziU8 pyFinal;
ziU8 convertedCount;
ziBool partial;
ziU8 result;
ziBool partial;
ziBool alternateInitial;
ziU8 outputIndex;
ziU16 value;
ziU8 index;
ziU16 value;
ziWChar converted[256];
ziWChar* current;
ziU8 pinyin[12];
ziWChar* current;
current = converted;
alternateInitial = 0;
result = 0;
partial = 0;
*resultCount = 0;
if (count == 0) {
Zi8LogError(0x135, ZI_WORK);
@@ -456,21 +467,19 @@ ziU8 Zi8GetPyPhonetic(ziWChar* text, ziU8 count, ziU16* initial, ziU16* final, z
for (; index < count; index++) {
if (((text[index] >= 0xF341) && (text[index] <= 0xF35A)) || ((text[index] >= 0x41) && (text[index] <= 0x5A))) {
if ((convertedCount != 0) && (current[convertedCount - 1] != 0xF360) && (current[convertedCount - 1] != 0x27)) {
current[convertedCount] = 0x27;
convertedCount++;
current[convertedCount++] = 0x27;
}
current[convertedCount] = (text[index] & 0xFF) + 0x20;
current[convertedCount++] = (text[index] & 0xFF) + 0x20;
} else {
current[convertedCount] = text[index];
current[convertedCount++] = text[index];
}
convertedCount++;
}
count = convertedCount;
outputIndex = 0;
*bestInitial = 0;
*bestFinal = 0;
while ((outputIndex < 0x10) && (count != 0)) {
while (count != 0) {
initial[outputIndex] = 0;
final[outputIndex] = 0;
value = *current;
@@ -484,41 +493,44 @@ check_pinyin_extension:
if (value < 0xF361) {
goto invalid_pinyin;
}
if (value <= 0xF37A) {
value += 0xC9F;
goto pinyin_initial;
}
if (value <= 0xF37A) goto pinyin_extension;
invalid_pinyin:
initial[0] = 0xFFFF;
final[0] = 0xFFFF;
*bestInitial = 0xFFFF;
*bestFinal = 0xFFFF;
*bestInitial = *bestFinal = initial[0] = final[0] = 0xFFFF;
return 1;
pinyin_extension:
value -= 0xF361;
goto pinyin_initial;
pinyin_ascii:
value -= 0x61;
pinyin_initial:
firstInitial = Zi8PinyinInitials[value];
if (firstInitial != 0) {
convertedCount = Zi8PinyinInitials[value];
if (convertedCount != 0) {
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
result++;
initial[outputIndex] = 0x7E00;
final[outputIndex] = (ziU16)firstInitial << 9;
*bestInitial = initial[outputIndex];
*bestFinal = final[outputIndex];
final[outputIndex] = (ziU16)(convertedCount & 0x7f) << 9;
*bestInitial = initial[0];
*bestFinal = final[0];
count--;
if (count == 0) {
break;
}
current += 1;
if (((firstInitial & 0x80) != 0) && ((current[0] == 0x68) || (current[0] == 0xF368))) {
if ((convertedCount & 0x80) != 0) {
if (alternateInitial) {
initial[outputIndex] &= 0xfdff;
final[outputIndex] &= 0xfdff;
}
value = *current;
if (value != 0x68 && value != 0xF368) goto scan_final;
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
final[outputIndex] += 0x200;
*bestInitial = initial[outputIndex];
*bestFinal = final[outputIndex];
*bestInitial = initial[0];
*bestFinal = final[0];
count--;
if (count == 0) {
break;
@@ -528,80 +540,80 @@ pinyin_initial:
} else if ((*current == 0xF369) || (*current == 0x69)) {
goto invalid_pinyin;
}
scan_final:
partial = 0;
for (index = 0; index < 4; index++) {
pinyin[index] = 0;
}
index = 0;
do {
while (1) {
if (index > 3) {
goto finish_final;
}
value = *current;
if ((value == 0x27) || (value == 0xF360) || (value == 0x20)) {
if (index != 0) {
partial = 1;
}
goto finish_final;
}
if ((value > 0xF330) && (value < 0xF336)) {
if (index != 0) {
partial = 1;
}
goto finish_final;
}
if ((value < 0x61) || (value > 0x7A)) {
if (value < 0xF361) {
goto finish_final;
}
value += 0xC9F;
if (value > 0x19) {
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
goto finish_final;
}
} else {
value -= 0x61;
}
pinyin[index] = (ziU8)value + 1;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) == 0) {
break;
}
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
current++;
index++;
count--;
if (count == 0) {
goto finish_final;
while (index < 4) {
value = *current;
if ((value == 0x27) || (value == 0xF360) || (value == 0x20)) {
if (index != 0) {
partial = 1;
}
goto finish_final;
}
if (index > 2) {
pinyin[index] = 0;
partial = 1;
break;
if ((value >= 0xF331) && (value < 0xF336)) {
if (index != 0) {
partial = 1;
}
goto finish_final;
}
pinyin[index + 1] = 0xFF;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) == 0) {
pinyin[index + 1] = 0;
pinyin[index] = 0;
partial = 1;
break;
if ((value < 0x61) || (value > 0x7A)) {
if (value < 0xF361) {
goto finish_final;
}
value -= 0xF361;
if (value > 0x19) {
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
goto finish_final;
}
} else {
value -= 0x61;
}
pinyin[index] = (ziU8)value + 1;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) == 0) goto try_final_extension;
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
pinyin[index + 1] = 0;
current++;
index++;
count--;
} while (count != 0);
if (count == 0) {
goto finish_final;
}
continue;
try_final_extension:
if (index < 3) {
pinyin[index + 1] = 0xFF;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
pinyin[index + 1] = 0;
current++;
index++;
count--;
if (count == 0) break;
} else {
pinyin[index + 1] = 0;
pinyin[index] = 0;
partial = 1;
break;
}
} else {
pinyin[index] = 0;
partial = 1;
break;
}
}
finish_final:
if ((index > 3) && (count != 0) && ((*current == 0x27) || (*current == 0xF360) || (*current == 0x20))) {
if ((index > 3) && (count != 0) && (((value = *current) == 0x27) || (value == 0xF360) || (value == 0x20))) {
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
@@ -611,35 +623,38 @@ finish_final:
if (index > 3) {
partial = 1;
}
if (!partial) {
pinyin[index] = 0xFF;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) == 0) {
pinyin[index] = 0;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (firstInitial == 0) {
result++;
initial[outputIndex] = 0x7E00;
final[outputIndex] = 0x200;
}
initial[outputIndex] |= (ziU16)pyInitial << 3;
final[outputIndex] |= (ziU16)pyFinal << 3;
*bestInitial = initial[outputIndex];
*bestFinal = final[outputIndex];
}
} else {
if (firstInitial == 0) {
if (partial && alternateInitial == 0) {
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (convertedCount == 0) {
result++;
initial[outputIndex] = 0x7E00;
final[outputIndex] = 0x200;
}
initial[outputIndex] |= (ziU16)pyInitial << 3;
final[outputIndex] |= (ziU16)pyFinal << 3;
*bestInitial = initial[outputIndex];
*bestFinal = final[outputIndex];
*bestInitial = initial[0];
*bestFinal = final[0];
} else {
if ((index != 0) && (count != 0)) {
goto invalid_pinyin;
}
}
} else {
pinyin[index] = 0xFF;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (convertedCount == 0) {
result++;
initial[outputIndex] = 0x7E00;
final[outputIndex] = 0x200;
}
initial[outputIndex] |= (ziU16)pyInitial << 3;
final[outputIndex] |= (ziU16)pyFinal << 3;
*bestInitial = initial[0];
*bestFinal = final[0];
if ((outputIndex == 0) && (count == 0)) {
pinyin[index] = 0;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (firstInitial == 0) {
if (convertedCount == 0) {
*bestInitial = 0x7E00;
*bestFinal = 0x200;
}
@@ -647,45 +662,42 @@ finish_final:
*bestFinal |= (ziU16)pyFinal << 3;
}
}
}
} else {
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (firstInitial == 0) {
result++;
initial[outputIndex] = 0x7E00;
final[outputIndex] = 0x200;
}
initial[outputIndex] |= (ziU16)pyInitial << 3;
final[outputIndex] |= (ziU16)pyFinal << 3;
*bestInitial = initial[outputIndex];
*bestFinal = final[outputIndex];
} else {
if ((index != 0) && (count != 0)) {
goto invalid_pinyin;
pinyin[index] = 0;
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
if (convertedCount == 0) {
result++;
initial[outputIndex] = 0x7E00;
final[outputIndex] = 0x200;
}
initial[outputIndex] |= (ziU16)pyInitial << 3;
final[outputIndex] |= (ziU16)pyFinal << 3;
*bestInitial = initial[0];
*bestFinal = final[0];
}
}
}
convertedCount = count;
}
if (count != 0) {
value = *current;
if ((value == 0x27) || (value == 0xF360) || (value == 0x20)) {
current++;
convertedCount = count - 1;
count--;
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
} else if ((value > 0xF330) && ((ziU16)(value + 0xCCF) < 5)) {
} else if ((value >= 0xF331) && ((value -= 0xF331) <= 4)) {
value++;
initial[outputIndex] |= 7;
final[outputIndex] |= value + 0xCD0;
*bestInitial = initial[outputIndex];
*bestFinal = final[outputIndex];
convertedCount = count - 1;
final[outputIndex] |= value;
*bestInitial = initial[0];
*bestFinal = final[0];
count--;
current++;
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
}
if ((convertedCount != 0) && ((*current == 0x27) || (*current == 0xF360) || (*current == 0x20))) {
convertedCount = count - 2;
if ((count != 0) && (((value = *current) == 0x27) || (value == 0xF360) || (value == 0x20))) {
count--;
current++;
if (outputIndex == 0) {
*resultCount = *resultCount + 1;
@@ -693,10 +705,10 @@ finish_final:
}
}
}
count = convertedCount;
outputIndex++;
if (outputIndex > 0xf) break;
}
if ((*resultCount > 1) && (text[*resultCount - 1] > 0xF340) && (text[*resultCount - 1] < 0xF35B)) {
if ((result > 1) && (text[*resultCount - 1] >= 0xF341) && (text[*resultCount - 1] <= 0xF35A)) {
*resultCount = *resultCount - 1;
}
return result;

View File

@@ -26,7 +26,7 @@ ziU8 Zi8_814813FC(ziWChar character, ziU8* result, ziU16* index, ziPtr workData)
ziU8 Zi8_81481E6C(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 count, ziPtr workData);
ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
ziPtr workData) {
ziPtr workData) {
struct {
ziU8 characterIndex;
ziU8 matched;
@@ -44,7 +44,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
ziU8* table1;
} state;
ziU16 buffer[100];
ziU32 result;
ziU8 result;
ziU16 currentCharacter;
ziU8* selectedTable;
@@ -72,13 +72,13 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
state.tableCount31 = Zi8GetTableCount(ZI8_LANG_KO, 0x31, workData);
for (state.elementIndex = 0; state.elementIndex < params->elementCount;
state.elementIndex++) {
state.elementIndex++) {
currentCharacter = params->elements[state.elementIndex];
if ((currentCharacter >= 0x61) && (currentCharacter <= 0x7A)) {
buffer[state.elementIndex] = state.table1[(currentCharacter - 0x61) * 2];
} else if ((currentCharacter >= 0x41) && (currentCharacter <= 0x5A)) {
buffer[state.elementIndex] = state.table1[(currentCharacter - 0x41) * 2 + 1];
buffer[state.elementIndex] = (state.table1 + (currentCharacter - 0x41) * 2)[1];
} else {
state.matched = 0;
for (; state.table2[state.matched * 3] != 0; state.matched++) {
@@ -86,8 +86,8 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
}
if (state.table2[state.matched * 3] != 0) {
buffer[state.elementIndex] =
((ziU16)state.table2[state.matched * 3 + 1] << 8) |
state.table2[state.matched * 3 + 2];
((ziU16)(state.table2 + state.matched * 3)[1] << 8) |
(state.table2 + state.matched * 3)[2];
} else {
Zi8LogError(0x161, workData);
return 0;
@@ -98,13 +98,13 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
result = 0;
for (currentCharacter = 0; currentCharacter < state.elementIndex; currentCharacter++) {
if (Zi8_814813FC(buffer[currentCharacter], &state.characterIndex,
&state.inputIndex, workData) != 0) {
&state.inputIndex, workData) != 0) {
state.matched = Zi8_81481E6C(&state.nextIndex,
buffer + currentCharacter + 1,
state.characterIndex,
(state.elementIndex - currentCharacter) - 1,
workData);
if ((((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 1) && (state.characterIndex < 0x1F)) {
buffer + currentCharacter + 1,
state.characterIndex,
(state.elementIndex - currentCharacter) - 1,
workData);
if ((((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 1)) {
switch (state.characterIndex) {
case 1:
selectedTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 0x1E, workData);
@@ -170,37 +170,30 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
} else {
state.matched = 0;
}
if (state.matched == 0) {
if (state.currentCandidate == 0) {
for (state.index = 0; state.index < state.tableCount31; state.index++) {
if (((ziU16)state.table31[(state.index * 3)] == buffer[currentCharacter]) &&
((ziU16)state.table31[(state.index * 3) + 1] == buffer[currentCharacter + 1])) {
if (currentCharacter == 0) {
params->count = 1;
}
params->candidates[result] =
state.tableCount0 + state.table31[(state.index * 3) + 2];
result++;
currentCharacter++;
break;
}
}
if (state.index == state.tableCount31) {
params->candidates[result] = buffer[currentCharacter];
if (buffer[currentCharacter] < 0xFF) {
if (currentCharacter == 0) {
params->count = 1;
}
params->candidates[result] += state.tableCount0;
result++;
}
}
if (state.matched != 0) {
if (state.tableCount6 == 0) {
state.nextIndex += state.inputIndex * state.tableCount3;
}
if (state.currentCandidate != 0) {
state.currentCandidate--;
} else {
params->candidates[(ziU8)result] =
((ziU16)selectedTable[state.nextIndex * 2] << 8) | (selectedTable + state.nextIndex * 2)[1];
if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 0)) {
params->candidates[(ziU8)result] += state.inputIndex * state.tableCount3;
}
result++;
}
if (currentCharacter == 0) {
params->count = state.matched + 1;
}
currentCharacter += state.matched;
} else {
if (state.currentCandidate != 0) {
state.index = 0;
while ((state.index < state.tableCount31) &&
(((ziU16)state.table31[(state.index * 3)] != buffer[currentCharacter]) ||
((ziU16)state.table31[(state.index * 3) + 1] != buffer[currentCharacter + 1]))) {
state.index++;
for (; state.index < state.tableCount31; state.index++) {
if (state.table31[state.index * 3] == buffer[currentCharacter] &&
(state.table31 + state.index * 3)[1] == buffer[currentCharacter + 1]) break;
}
if (state.index == state.tableCount31) {
state.currentCandidate--;
@@ -208,25 +201,30 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
if (currentCharacter == 0) {
params->count = 1;
}
}
} else {
if (state.tableCount6 == 0) {
state.nextIndex += state.inputIndex * state.tableCount3;
}
if (state.currentCandidate == 0) {
params->candidates[result] =
(selectedTable[state.nextIndex * 2] << 8) | selectedTable[state.nextIndex * 2 + 1];
if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 0)) {
params->candidates[result] += state.inputIndex * state.tableCount3;
}
result++;
} else {
state.currentCandidate--;
for (state.index = 0; state.index < state.tableCount31; state.index++) {
if ((state.table31[(state.index * 3)] == buffer[currentCharacter]) &&
((state.table31 + state.index * 3)[1] == buffer[currentCharacter + 1])) {
if (currentCharacter == 0) {
params->count = 1;
}
params->candidates[(ziU8)result] =
state.tableCount0 + (state.table31 + state.index * 3)[2];
result++;
currentCharacter++;
break;
}
}
if (state.index == state.tableCount31) {
if ((params->candidates[(ziU8)result] = buffer[currentCharacter]) < 0xFF) {
if (currentCharacter == 0) {
params->count = 1;
}
params->candidates[(ziU8)result] += state.tableCount0;
result++;
}
}
}
if (currentCharacter == 0) {
params->count = state.matched + 1;
}
currentCharacter += state.matched;
}
if (result >= params->maxCandidates) {
break;

View File

@@ -231,7 +231,7 @@ ziU32 Zi8_814834AC(ziGetParam* param, ziU16* remaining, ziU8* count,
Zi8_81483308(param, param->candidates[filter.compactIndex], inserted, ZI_WORK);
}
}
*remaining -= (ziU8)matched;
*remaining = *remaining - matched;
*count = 0;
}
}
@@ -285,8 +285,8 @@ ziU32 Zi8GetKOcandidates(ziGetParam* param, ZiKoreanCandidateOptions* options ZI
search.previousIndex = 0xFFFF;
search.resultCount = 0;
search.packedKeys.bytes[4] = 0;
search.packedKeys.firstWord = 0;
search.packedKeys.bytes[4] = 0;
search.remainingLetters = 0;
search.wordIndex = 0;
search.candidateCount = 0;
@@ -317,15 +317,15 @@ ziU32 Zi8GetKOcandidates(ziGetParam* param, ZiKoreanCandidateOptions* options ZI
if (((search.keyIndex = Zi8_8148302C(param->currentWord[0], keyTable, ZI_WORK)) != 0xFFFF) &&
((((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->keyBytes[4] & 8) != 0)) {
search.wordOffset = ((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->childLow |
((((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->keyBytes[4] & 3) << 16 |
((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->childHigh << 8);
((((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->keyBytes[4] & 3) << 16 |
((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->childHigh << 8);
search.remainingLetters = param->wordCharCount - 1;
search.wordIndex = 1;
wordNode = search.wordTable + search.wordOffset;
match_word:
while (search.remainingLetters != 0) {
search.keyIndex = Zi8_8148302C(param->currentWord[search.wordIndex], (ziU8*)keyTable, ZI_WORK);
if (search.keyIndex == (ziU16)((*wordNode & 0x1F) << 8 | wordNode[1])) {
if (search.keyIndex == (((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1])) {
--search.remainingLetters;
++search.wordIndex;
if ((*wordNode & 0x40) != 0) {
@@ -341,9 +341,9 @@ match_word:
}
}
if (search.remainingLetters == 0) {
search.keyIndex = (*wordNode & 0x1F) << 8 | wordNode[1];
search.character = (ziU16)(((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->characterHigh << 8 |
((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->characterLow);
search.keyIndex = ((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1];
search.character = (ziU16)((ziU16)((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->characterHigh << 8 |
((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->characterLow);
if (param->wordCharCount == 1) {
if (search.keyIndex == search.previousIndex) {
for (; (*wordNode & 0x40) == 0; wordNode = wordNode + 2) {
@@ -355,55 +355,46 @@ match_word:
}
search.previousIndex = search.keyIndex;
if (param->elementCount == 0) {
if (search.remainingCandidates == 0) {
if (search.remainingCandidates != 0) {
--search.remainingCandidates;
} else {
if (options->countOnly != 0) {
++search.prefixCount;
if ((ziS32)search.prefixCount < (ziS32)options->maxCount) {
if (++search.prefixCount < (ziS32)options->maxCount) {
goto skip_word;
}
return options->maxCount;
}
param->candidates[search.candidateCount] = search.character;
++search.candidateCount;
param->candidates[search.candidateCount++] = search.character;
++param->unk_0x20;
if (++param->letters >= param->maxCandidates) {
return param->letters;
}
} else {
--search.remainingCandidates;
}
} else {
param->candidates[search.candidateCount] = search.character;
++search.candidateCount;
param->candidates[search.candidateCount++] = search.character;
++param->unk_0x20;
if (++param->letters >= param->maxCandidates) {
Zi8_814834AC(param, &search.remainingCandidates, &search.candidateCount, &search.inserted, ZI_WORK);
param->unk_0x20 = search.candidateCount;
param->letters = search.candidateCount;
if (param->maxCandidates <= search.candidateCount) {
if (options->countOnly == 0) {
return search.candidateCount;
}
search.prefixCount += search.candidateCount;
if ((ziS32)options->maxCount <= (ziS32)search.prefixCount) {
return options->maxCount;
}
if (search.candidateCount < param->maxCandidates) goto skip_word;
if (options->countOnly != 0) {
if ((search.prefixCount += search.candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
param->unk_0x20 = 0;
param->letters = 0;
search.candidateCount = 0;
} else {
return search.candidateCount;
}
}
}
} else {
for (search.candidateIndex = 0;
(search.candidateIndex < search.candidateCount &&
(search.character != param->candidates[search.candidateIndex]));
search.candidateIndex = search.candidateIndex + 1) {
for (search.candidateIndex = 0; search.candidateIndex < search.candidateCount; search.candidateIndex++) {
if (search.character == param->candidates[search.candidateIndex]) break;
}
if ((search.candidateIndex == search.candidateCount) &&
(Zi8_814833F0(param, search.character, ZI_WORK) == 0)) {
param->candidates[search.candidateCount] = search.character;
++search.candidateCount;
param->candidates[search.candidateCount++] = search.character;
++param->unk_0x20;
if (++param->letters < param->maxCandidates) {
goto skip_word;
@@ -411,17 +402,14 @@ match_word:
Zi8_814834AC(param, &search.remainingCandidates, &search.candidateCount, &search.inserted, ZI_WORK);
param->unk_0x20 = search.candidateCount;
param->letters = search.candidateCount;
if (param->maxCandidates <= search.candidateCount) {
if (options->countOnly == 0) {
return search.candidateCount;
}
search.prefixCount += search.candidateCount;
if ((ziS32)options->maxCount <= (ziS32)search.prefixCount) {
return options->maxCount;
}
if (search.candidateCount < param->maxCandidates) goto skip_word;
if (options->countOnly != 0) {
if ((search.prefixCount += search.candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
param->unk_0x20 = 0;
param->letters = 0;
search.candidateCount = 0;
} else {
return search.candidateCount;
}
}
}
@@ -444,18 +432,21 @@ search_table:
if (search.candidateCount != 0) {
Zi8_814834AC(param, &search.remainingCandidates, &search.candidateCount, &search.inserted, ZI_WORK);
if (options->countOnly != 0) {
search.prefixCount += search.candidateCount;
if (search.prefixCount >= (ziS32)options->maxCount) return options->maxCount;
if ((search.prefixCount += search.candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
search.resultCount = search.prefixCount;
}
param->unk_0x20 = search.candidateCount;
param->letters = search.candidateCount;
}
if (param->elementCount < 10) {
if ((param->elementCount == 0) || (options->countOnly != 0)) {
search.matchPass = 1;
} else {
if (param->elementCount > 9) {
param->letters = 0;
return 0;
}
{
if (param->elementCount != 0 && options->countOnly == 0) {
search.matchPass = 0;
} else {
search.matchPass = 1;
}
search.tableCount = Zi8GetTableCount(ZI8_LANG_KO, 9, ZI_WORK);
Zi8_81483118(param, search.packedKeys.bytes);
@@ -466,8 +457,8 @@ search_table:
search.keyByte = 0;
if (1 < param->elementCount) {
for (search.keyByte = 0;
(ziU32)search.keyByte < (int)param->elementCount / 2;
search.keyByte = search.keyByte + 1) {
(ziS32)search.keyByte < (int)param->elementCount / 2;
search.keyByte++) {
if (search.packedKeys.bytes[search.keyByte] != search.entry->keyBytes[search.keyByte]) {
search.matches = ZI8_FALSE;
break;
@@ -476,7 +467,7 @@ search_table:
}
if ((search.matches && ((param->elementCount % 2) != 0)) &&
((search.packedKeys.bytes[search.keyByte] & 0xF0) !=
(search.entry->keyBytes[search.keyByte] & 0xF0))) {
(search.entry->keyBytes[search.keyByte] & 0xF0))) {
search.matches = ZI8_FALSE;
}
if (search.matches) {
@@ -499,17 +490,15 @@ search_table:
if (++search.resultCount >= (ziS32)options->maxCount) return options->maxCount;
} else {
param->candidates[search.candidateCount++] =
(ziU16)((ziU16)((ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable))->characterHigh << 8 |
((ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable))->characterLow);
(ziU16)((ziU16)((ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable))->characterHigh << 8 |
((ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable))->characterLow);
if (++param->letters >= param->maxCandidates) return param->letters;
}
}
next_entry:
;
}
} while (++search.matchPass < 2);
} else {
param->letters = 0;
} while (++search.matchPass < 2);
}
if (options->countOnly != 0) return search.resultCount;
return param->letters;

View File

@@ -106,7 +106,7 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
if ((index != 0) && ((buffers.component[5] & 1) == 0)) {
index--;
match->arrD[index] &= 0xf0;
match->arr1[index] = match->arr1[index] & 0xf0;
match->arr1[index] &= 0xf0;
}
nibbles = (ziU8)(buffers.component[5] + 1);
if (8 < nibbles) {
@@ -132,16 +132,16 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
case 1:
case 2:
case 4:
match->arr1[0] |= (ziU8)(mode << 4);
match->arrD[0] |= (ziU8)(mode << 4);
break;
match->arr1[0] |= (ziU8)(mode << 4);
match->arrD[0] |= (ziU8)(mode << 4);
break;
}
}
if (nibbles == 0) {
nibbles = 1;
}
if (((request->getMode == '\0') || (request->getMode == '\x10')) ||
(request->getMode == '\x05')) {
(request->getMode == '\x05')) {
Zi8Memcpy(buffers.masks,match->arr1,0xc);
Zi8Memcpy(buffers.strokes,match->arrD,0xc);
do {
@@ -170,26 +170,26 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
nibbles++;
}
if ((nibbles & 1) != 0) {
buffers.strokes[nibbles >> 1] = buffers.strokes[nibbles >> 1] | stroke;
buffers.strokes[nibbles >> 1] |= stroke;
if (element == 0xef0b) {
buffers.masks[nibbles >> 1] = buffers.masks[nibbles >> 1] | 8;
buffers.masks[nibbles >> 1] |= 8;
}
else if (element == 0xef0a) {
buffers.masks[nibbles >> 1] = buffers.masks[nibbles >> 1] | 4;
buffers.masks[nibbles >> 1] |= 4;
}
else if (element != 0xef00) {
buffers.masks[nibbles >> 1] = buffers.masks[nibbles >> 1] | 7;
buffers.masks[nibbles >> 1] |= 7;
}
} else {
buffers.strokes[nibbles >> 1] = buffers.strokes[nibbles >> 1] | (ziU8)(stroke << 4);
} else {
buffers.strokes[nibbles >> 1] |= stroke << 4;
if (element == 0xef0b) {
buffers.masks[nibbles >> 1] = buffers.masks[nibbles >> 1] | 0x80;
buffers.masks[nibbles >> 1] |= 0x80;
}
else if (element == 0xef0a) {
buffers.masks[nibbles >> 1] = buffers.masks[nibbles >> 1] | 0x40;
buffers.masks[nibbles >> 1] |= 0x40;
}
else if (element != 0xef00) {
buffers.masks[nibbles >> 1] = buffers.masks[nibbles >> 1] | 0x70;
buffers.masks[nibbles >> 1] |= 0x70;
}
}
nibbles++;
@@ -219,7 +219,7 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
Zi8Memcpy((ziU8 (*)[12])match->segs1 + match->nSeg,buffers.masks,0xc);
Zi8Memcpy((ziU8 (*)[12])match->segsD + match->nSeg,buffers.strokes,0xc);
match->nSeg++;
if (((stroke != 0xff) || (elementCount <= elementIndex)) || (0xf < match->nSeg)) goto complete;
if (stroke != 0xff || elementIndex >= elementCount || match->nSeg >= 0x10) goto complete;
Zi8Memset(buffers.masks,0,0xc);
Zi8Memset(buffers.strokes,0,0xc);
buffers.masks[0] = match->arr1[0] & 0xf0;
@@ -239,7 +239,7 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
}
if ((request->getMode == '\x01') || (request->getMode == '\f')) {
match->nCand = Zi8GetPyPhonetic(request->elements,elementCount,match->phon,match->phon2,
&request->count,&match->first,&match->first2,__zi8_work_data);
&request->count,&match->first,&match->first2,__zi8_work_data);
}
else {
initial = 0;
@@ -253,12 +253,24 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
request->count = request->elementCount;
phoneticLength = 1;
for (index = 0; index < elementCount; index++) {
if (Zi8GetBpmfPhonetic(buffers.phoneticInput,phoneticLength,&initial,&final,&bestInitial,&bestFinal,
__zi8_work_data) == 0) {
stroke = Zi8GetBpmfPhonetic(buffers.phoneticInput,phoneticLength,&initial,&final,&bestInitial,&bestFinal,
__zi8_work_data);
if (stroke != 0) {
previousInitial = bestInitial;
previousFinal = bestFinal;
savePhonetic:
match->phon[match->nCand] = initial;
match->phon2[match->nCand] = final;
if (match->nCand == 0) {
match->first = bestInitial;
match->first2 = bestFinal;
}
}
else {
if ((index == 0) ||
((((1 < phoneticLength && (buffers.phoneticInput[phoneticLength - 2] == 0xF360)) &&
(buffers.phoneticInput[phoneticLength - 1] == 0xF360)) ||
(++match->nCand == 0x10)))) {
((((1 < phoneticLength && (buffers.phoneticInput[phoneticLength - 2] == 0xF360)) &&
(buffers.phoneticInput[phoneticLength - 1] == 0xF360)) ||
(++match->nCand == 0x10)))) {
initial = 0xffff;
final = 0xffff;
bestInitial = 0xffff;
@@ -277,21 +289,10 @@ ziBool Zi8PrepareMatch(ziGetParam* request, ziMatchParam* match, ziU8 skipMode Z
if (match->nCand == 1) {
request->count = phoneticLength - 1;
}
buffers.phoneticInput += phoneticLength - 1;
buffers.phoneticInput = buffers.phoneticInput + phoneticLength - 1;
phoneticLength = 0;
index--;
}
else {
savePhonetic:
match->phon[match->nCand] = initial;
match->phon2[match->nCand] = final;
previousFinal = bestFinal;
previousInitial = bestInitial;
if (match->nCand == 0) {
match->first = bestInitial;
match->first2 = bestFinal;
}
}
phoneticLength++;
}
if (elementCount != 0) {
@@ -305,25 +306,23 @@ savePhonetic:
}
}
if (((request->context & contextMask) != 0) &&
((1 < match->nCand || (request->count != elementCount)))) {
((1 < match->nCand || (request->count != elementCount)))) {
match->phon[0] = 0xFFFF;
match->phon2[0] = 0xFFFF;
match->nCand = 0;
}
if (((request->getOptions & 0x20) == 0) &&
((match->phon[0] != 0xFFFF || (match->phon2[0] != 0xFFFF)))) {
if (match->nCand < 2) {
phoneticInitial = match->phon[0];
phoneticMask = match->phon2[0];
((match->phon[0] != 0xFFFF || (match->phon2[0] != 0xFFFF)))) {
if (match->nCand > 1) {
phoneticInitial = match->phon[match->nCand - 1] & 0xfff8;
phoneticMask = match->phon2[match->nCand - 1] & 0xfff8;
}
else {
phoneticInitial = match->phon[match->nCand - 1];
phoneticMask = match->phon2[match->nCand - 1];
phoneticInitial = match->phon[0] & 0xfff8;
phoneticMask = match->phon2[0] & 0xfff8;
}
phoneticInitial = phoneticInitial & 0xfff8;
phoneticMask = phoneticMask & 0xfff8;
for (phoneticLength = 0; phoneticLength < phoneticCount; phoneticLength++) {
phoneticCode = (buffers.phoneticTable[phoneticLength * 2 + 1] << 8) | buffers.phoneticTable[phoneticLength * 2];
phoneticCode = buffers.phoneticTable[phoneticLength * 2] | ((ziU16)buffers.phoneticTable[phoneticLength * 2 + 1] << 8);
if (phoneticMask == (phoneticCode & phoneticInitial)) break;
}
if (phoneticLength == phoneticCount) {

View File

@@ -1,8 +1,7 @@
#include <revolution/fa.h>
#include <revolution/os.h>
char lbl_81690A00[] = "<< RVL_SDK - FA \trelease build: Apr 20 2010 11:20:14 (0x4199_60831) >>";
char* __FAVersion[2] = {lbl_81690A00, NULL};
char* __FAVersion[2] = {"<< RVL_SDK - FA \trelease build: Apr 20 2010 11:20:14 (0x4199_60831) >>", NULL};
s32 FAInInitializing;
s32 FAFileSysInitialized;
extern s32 FADiskInitialized;

View File

@@ -1,7 +1,7 @@
#include <revolution/fa.h>
static FAInsertCallback g_attach_func;
static FAEjectCallback g_detach_func;
static FAInsertCallback g_attach_func;
extern s32 uhf_msc_is_media_insert(void);

View File

@@ -24,9 +24,16 @@ char NAND_Org_Path[64];
NAND_DISK_INFO nanddisk_info[23];
NAND_SEMAPHORE csem;
NAND_SEMAPHORE osem;
s32 Nanddisk_Internal_Info_Init;
s32 NAND_Init;
u32 fa_nanddrv_bss_tail[4];
__declspec(export) u32 fa_nanddrv_work0;
__declspec(export) u32 fa_nanddrv_work1;
__declspec(export) u32 fa_nanddrv_work2;
__declspec(export) u32 fa_nanddrv_work3;
__declspec(export) u32 fa_nanddrv_work4;
s32 fa_nanad_semid;
s32 NAND_Init;
s32 Nanddisk_Internal_Info_Init;
static inline s32 find_disk(PDM_DISK* disk, NAND_DISK_INFO** result) {
NAND_DISK_INFO* info;
@@ -164,18 +171,21 @@ static s32 fa_nanddrv_ParseCreateNANDFile(NAND_DISK_INFO* info) {
return error;
}
if (length > 11) { return -20; }
if (pf_strcmp(name, "..") != 0) { error = NANDCreateDir(name, 0x30, 0); }
if (pf_strcmp(name, "..\0") != 0) { error = NANDCreateDir(name, 0x30, 0); }
else { error = 0; }
if (error == 0 || error == -6 || error == -1) {
error = NANDChangeDir(name);
if (error != 0) { return error; }
path++;
pf_memset(name, 0, 16);
next = name;
length = 0;
break;
else { goto success; }
} else {
return error;
}
return error;
success:
path++;
pf_memset(name, 0, 16);
next = name;
length = 0;
break;
case 0:
if (length > 12) { return -20; }
error = NANDCreate(name, 0x30, 0);
@@ -193,6 +203,7 @@ static s32 fa_nanddrv_ParseCreateNANDFile(NAND_DISK_INFO* info) {
}
}
static s32 fa_nanddrv_VerifyBPB(u8* buf, u32* clusters) {
u8 sector_log = 0;
u8 cluster_log;
u16 value = 512;
@@ -403,7 +414,6 @@ s32 fa_nanddrv_init_drv_tbl(PDM_DISK_TBL* table, u32 extension) {
return 0;
}
s32 fa_nanddrv_NotifyNANDFile(const char* path, u32 size) {
NAND_DISK_INFO* info;
u16 index;
if (pf_strlen(path) >= 76) { return -20; }
if (Nanddisk_Internal_Info_Init == 0) {
@@ -416,10 +426,9 @@ s32 fa_nanddrv_NotifyNANDFile(const char* path, u32 size) {
if (fa_nanad_semid == 0) { return -21; }
}
for (index = 0; index < 23; index++) {
info = &nanddisk_info[index];
if (pf_strcmp(info->path, path) == 0) { return 0; }
if (pf_strcmp(nanddisk_info[index].path, path) == 0) { return 0; }
if (nanddisk_info[index].disk == 0) {
pf_strcpy(info->path, path);
pf_strcpy(nanddisk_info[index].path, path);
nanddisk_info[index].file_size = size;
break;
}
@@ -481,14 +490,14 @@ static s32 fa_nanddrv_physical_read(u32 count, u8* buf, u32 block, u32 bps, u32*
return error;
}
static s32 fa_nanddrv_physical_write(u32 count, const u8* buf, u32 block, u32 bps, u32* success, PDM_DISK* disk) {
u32 remaining;
u32 wanted;
u32 file_size;
NAND_DISK_INFO* info = 0;
u32 wanted;
u32 remaining;
s32 error;
u16 index;
u32 offset;
u32 position;
s32 error;
NAND_DISK_INFO* info = 0;
u8 work[512] __attribute__((aligned(32)));
for (index = 0; index < 23; index++) {
if (nanddisk_info[index].disk == disk) { info = &nanddisk_info[index]; break; }
@@ -533,3 +542,4 @@ static s32 fa_nanddrv_physical_write(u32 count, const u8* buf, u32 block, u32 bp
store_disk_error(disk, error);
return error;
}

View File

@@ -6,11 +6,11 @@ extern pf_s32 pdm_part_is_attached_partition(PDM_PARTITION* partition);
pf_u8 pfd_get_media_drv_char(PDM_DISK* disk, pf_s8* drives, pf_u32 capacity) {
pf_u32 partition_index;
PDM_PARTITION* partition;
pf_u32 volume_index;
PF_VOLUME* volume;
pf_u8 count;
pf_s8* next_drive;
pf_u32 volume_index;
PDM_PARTITION* partition;
if (drives == NULL || capacity == 0) {
return 0;
}
@@ -20,8 +20,7 @@ pf_u8 pfd_get_media_drv_char(PDM_DISK* disk, pf_s8* drives, pf_u32 capacity) {
for (partition_index = 0; partition_index < 26; partition_index++, partition++) {
if (pdm_part_is_attached_partition(partition) && partition->p_disk == disk) {
volume = pf_vol_set.volumes;
for (volume_index = 0; volume_index < 26; volume++) {
volume_index++;
for (volume_index = 0; volume_index < 26; volume_index++, volume++) {
if (volume->p_part == partition) {
count++;
*next_drive++ = volume->drv_char;

View File

@@ -3,13 +3,14 @@
#include <revolution/sdi.h>
typedef struct PFD_SDDRV_INFO {
u32 flags;
volatile u32 flags;
u32 bytes_per_sector;
SDDev* device;
SDDev* volatile device;
FADisk* disk;
u32 media_inserted;
volatile u32 media_inserted;
u32 media_ejected;
s8 drive;
u32 reserved;
} PFD_SDDRV_INFO;
typedef union PFD_SDDEV_STORAGE {
@@ -32,9 +33,16 @@ PFD_SDDRV_INFO g_pfd_sddrv_info;
PFD_SDDEV_STORAGE g_pfd_sddev;
u8 g_pfd_sddrv_buf[0x200];
static FAInsertCallback g_attach_func;
static FAEjectCallback g_detach_func;
u32 pfd_sddrv_reserved;
u32 g_event;
u32 pfd_sddrv_work0;
u32 pfd_sddrv_work1;
u32 pfd_sddrv_work2;
u32 pfd_sddrv_work3;
u32 pfd_sddrv_work4;
u32 pfd_sddrv_work5;
static FAEjectCallback g_detach_func;
static FAInsertCallback g_attach_func;
extern u8 pfd_get_media_drv_char(FADisk*, s8*, u32);
extern void pdm_disk_notify_media_insert(FADisk*);
@@ -233,12 +241,12 @@ const PFD_SDDRV_SIZE_DEPEND sddrv_size_depend_tbl[14] = {
static inline void update_media_drive(void) {
s8 drive;
if (g_pfd_sddrv_info.drive == 0 && pfd_get_media_drv_char(g_pfd_sddrv_info.disk, &drive, 1) == 1) {
if (g_pfd_sddrv_info.drive == 0 && pfd_get_media_drv_char(*(FADisk* volatile*)&g_pfd_sddrv_info.disk, &drive, 1) == 1) {
g_pfd_sddrv_info.drive = drive;
}
}
static inline void clear_mount_flag(void) {
static void clear_mount_flag(void) {
g_pfd_sddrv_info.flags &= ~2;
}
@@ -259,7 +267,7 @@ s32 pfd_st_inter_callback(s32 status, void* data) {
update_media_drive();
pdm_disk_notify_media_insert(g_pfd_sddrv_info.disk);
if (g_pfd_sddrv_info.drive != 0 && g_attach_func != 0) {
g_attach_func(g_pfd_sddrv_info.drive);
g_attach_func(*(s8 volatile*)&g_pfd_sddrv_info.drive);
}
}
g_pfd_sddrv_info.media_inserted = 1;
@@ -285,7 +293,7 @@ s32 pfd_st_removal_callback(s32 status, void* data) {
update_media_drive();
pdm_disk_notify_media_eject(g_pfd_sddrv_info.disk);
if (g_pfd_sddrv_info.drive != 0 && g_detach_func != 0) {
g_detach_func(g_pfd_sddrv_info.drive);
g_detach_func(*(s8 volatile*)&g_pfd_sddrv_info.drive);
}
}
return 0;
@@ -296,15 +304,16 @@ s32 pfd_sddrv_init(FADisk* disk) {
SDDev* device;
u32 status;
if (disk == 0) {
if (disk == (FADisk*)(status = 0)) {
return -30;
}
if ((g_pfd_sddrv_info.flags & 1) != 0) {
OSReport("INFO SD Card driver is already initialize. pfd_sddrv_init()\n");
if (disk == g_pfd_sddrv_info.disk) {
return 0;
sd_result = 0;
if (disk != g_pfd_sddrv_info.disk) {
sd_result = -44;
}
return -44;
return sd_result;
}
if ((g_pfd_sddrv_info.flags & 4) == 0) {
g_pfd_sddrv_info.bytes_per_sector = 0x200;
@@ -328,11 +337,11 @@ s32 pfd_sddrv_init(FADisk* disk) {
OSReport("ERR Failed to get sd card status. [ret = 0x%x]\n", sd_result);
return 21;
}
if ((status & 1) == 1) {
if ((status & 1) != 0) {
g_pfd_sddrv_info.media_inserted = 1;
}
g_pfd_sddrv_info.device = device;
if (g_pfd_sddrv_info.media_inserted == 1) {
if (g_pfd_sddrv_info.media_inserted != 0) {
g_event = 2;
sd_result = ISD_RegisterDeviceIntrHandler(device, (SDDevIntrCallback)pfd_st_removal_callback, &g_event);
if (sd_result != 0) {
@@ -351,7 +360,7 @@ s32 pfd_sddrv_init(FADisk* disk) {
return -42;
}
}
g_pfd_sddrv_info.disk = disk;
*(FADisk* volatile*)&g_pfd_sddrv_info.disk = disk;
g_pfd_sddrv_info.flags |= 1;
return 0;
}
@@ -463,15 +472,14 @@ s32 pfd_sddrv_unmount(FADisk* disk) {
}
s32 pfd_sddrv_finalize(FADisk* disk) {
s32 result;
if (disk == 0) {
return -30;
}
if ((g_pfd_sddrv_info.flags & 2) == 2) {
if ((g_pfd_sddrv_info.flags & 2) != 0) {
clear_mount_flag();
}
if ((g_pfd_sddrv_info.flags & 1) != 0) {
s32 result;
result = ISD_UnregisterDeviceIntrHandler(g_pfd_sddrv_info.device);
if (result != 0) {
OSReport("WARNING Faild to UnregisterDeviceIntrHandler sd card [ret = %d]\n", result);
@@ -482,10 +490,10 @@ s32 pfd_sddrv_finalize(FADisk* disk) {
}
g_pfd_sddrv_info.device = 0;
}
g_pfd_sddrv_info.flags = g_pfd_sddrv_info.flags & 0xfffffffe;
g_pfd_sddrv_info.media_inserted = g_pfd_sddrv_info.media_ejected = 0;
g_pfd_sddrv_info.disk = 0;
g_pfd_sddrv_info.drive = 0;
g_pfd_sddrv_info.flags = g_pfd_sddrv_info.flags & ~1;
g_pfd_sddrv_info.media_inserted = 0;
*(FADisk* volatile*)&g_pfd_sddrv_info.disk = 0;
*(s8 volatile*)&g_pfd_sddrv_info.drive = 0;
return 0;
}
@@ -557,7 +565,7 @@ s32 pfd_sddrv_is_media_insert(void) {
s8 drive;
if ((g_pfd_sddrv_info.flags & 1) != 0) {
if (g_pfd_sddrv_info.drive == 0 && pfd_get_media_drv_char(g_pfd_sddrv_info.disk, &drive, 1) == 1) {
if (g_pfd_sddrv_info.drive == 0 && pfd_get_media_drv_char(*(FADisk* volatile*)&g_pfd_sddrv_info.disk, &drive, 1) == 1) {
g_pfd_sddrv_info.drive = drive;
}
if (g_pfd_sddrv_info.media_inserted != 0) {
@@ -573,8 +581,8 @@ s32 pfd_sddrv_is_media_insert(void) {
}
static s32 pfd_sddrv_physical_read(u32 blocks, u8* buffer, u32 sector, u32 bytes_per_sector, u32* blocks_read) {
s32 result;
u32 current_sector;
s32 result;
u32 completed;
u8* current_buffer;
if ((g_pfd_sddrv_info.flags & 2) == 0) {
@@ -638,8 +646,8 @@ static s32 pfd_sddrv_physical_read(u32 blocks, u8* buffer, u32 sector, u32 bytes
}
s32 pfd_sddrv_physical_write(u32 blocks, u8* buffer, u32 sector, u32 bytes_per_sector, u32* blocks_written) {
s32 result;
u32 current_sector;
s32 result;
u32 completed;
u8* current_buffer;
if ((g_pfd_sddrv_info.flags & 2) == 0) {
@@ -731,7 +739,7 @@ s32 pfd_sddrv_get_total_sectors(u32* sectors, u16* bytes_per_sector) {
multiplier = (csd[2] >> 8) & 0xf;
minimum_multiplier = multiplier >= 9 ? multiplier : 9;
max_multiplier = minimum_multiplier <= 11 ? minimum_multiplier : 11;
multiplier_factor = 1 << (u16)(max_multiplier - 9);
multiplier_factor = (u16)1 << (u16)(max_multiplier - 9);
*sectors = cluster_blocks * multiplier_factor;
} else {
*sectors = ((csd[1] >> 8 & 0x3fffff) + 1) * 0x400;
@@ -844,7 +852,7 @@ s32 pfd_sddrv_calc_mbr_bpb(PFD_SDDRV_FORMAT_DATA* format_data) {
format_data->sectors_per_fat = fat_sectors;
format_data->partition_start_sector = start_sector;
format_data->partition_sector_count = format_data->total_sectors - start_sector;
clusters = (format_data->partition_sector_count - (fat_sectors * 2 + 0x21)) / format_data->sectors_per_cluster + 1;
clusters = (format_data->partition_sector_count - (next_fat_sectors * 2 + 0x21)) / format_data->sectors_per_cluster + 1;
if (clusters < 0xff5) {
format_data->fat_type = 0;
} else if (clusters >= 0xff5) {
@@ -853,12 +861,12 @@ s32 pfd_sddrv_calc_mbr_bpb(PFD_SDDRV_FORMAT_DATA* format_data) {
return -31;
}
OSTicksToCalendarTime(OSGetTime(), &current_time);
format_data->volume_serial_number = ((((current_time.year - 1900) & 0x7f) << 9) |
format_data->volume_serial_number = ((current_time.mday & 0x1f) |
((current_time.mon & 0xf) << 5) |
(current_time.mday & 0x1f)) * 0x10000 +
(((current_time.hour & 0x1f) << 11) |
(((current_time.year - 1900) & 0x7f) << 9)) * 0x10000 +
((current_time.sec & 0x1f) |
((current_time.min & 0x3f) << 5) |
(current_time.sec & 0x1f));
((current_time.hour & 0x1f) << 11));
return 0;
}

View File

@@ -2,7 +2,7 @@
#include <private/os/OSTime.h>
#include <private/bus.h>
static int __i2c_ident_flag = 1;
static volatile int __i2c_ident_flag = 1;
static u32 __i2c_ident_first;
#define I2C_OUT 0xCD8000C0

File diff suppressed because it is too large Load Diff

View File

@@ -138,7 +138,25 @@ static s32 Vdac_Flag_Region;
static s32 __type;
static s32 __gamma;
static s32 __level;
u32 Vdac_Flag_Changed_816991E0;
volatile u32 Vdac_Flag_Changed_816991E0;
static void __VISetCCSEL(u8 flag) {
u8 data[2];
data[0] = 0x6a;
data[1] = TRUE;
__VISendI2CData(0xe0, data, sizeof(data));
WaitMicroTime(2);
}
static void __VISetOverSampling(u8 flag) {
u8 data[2];
data[0] = 0x65;
data[1] = TRUE;
__VISendI2CData(0xe0, data, sizeof(data));
WaitMicroTime(2);
}
void __VISetVolume(u8 wd0, u8 wd1) {
u8 data[3];
@@ -233,36 +251,38 @@ void __VISetClosedCaption(void) {
WaitMicroTime(2);
}
typedef const u8* __VIMacrovisionImm;
static void __VISetMacrovisionImm(__VIMacrovisionImm macrovisionImm)
{
u8 data[0x1a + 1];
u8 i;
data[0] = 0x40;
for (i = 1; i < sizeof(data); i++) {
data[i] = macrovisionImm[i - 1];
}
__VISendI2CData(0xe0, data, sizeof(data));
WaitMicroTime(2);
}
void __VISetMacrovision(void) {
switch (__type) {
case 2:
switch (__tvType) {
case 0: {
u8 data[0x1b];
COPY_ACP(data, VINtscACPType1);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VINtscACPType1);
break;
}
case 1: {
u8 data[0x1b];
COPY_ACP(data, VIPalACPType1);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIPalACPType1);
break;
}
case 2: {
u8 data[0x1b];
COPY_ACP(data, VIMpalACPType1);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIMpalACPType1);
break;
}
case 5: {
u8 data[0x1b];
COPY_ACP(data, VIEurgb60ACPType1);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIEurgb60ACPType1);
break;
}
}
@@ -270,31 +290,19 @@ void __VISetMacrovision(void) {
case 3:
switch (__tvType) {
case 0: {
u8 data[0x1b];
COPY_ACP(data, VINtscACPType2);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VINtscACPType2);
break;
}
case 1: {
u8 data[0x1b];
COPY_ACP(data, VIPalACPType2);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIPalACPType2);
break;
}
case 2: {
u8 data[0x1b];
COPY_ACP(data, VIMpalACPType2);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIMpalACPType2);
break;
}
case 5: {
u8 data[0x1b];
COPY_ACP(data, VIEurgb60ACPType2);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIEurgb60ACPType2);
break;
}
}
@@ -302,103 +310,74 @@ void __VISetMacrovision(void) {
case 4:
switch (__tvType) {
case 0: {
u8 data[0x1b];
COPY_ACP(data, VINtscACPType3);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VINtscACPType3);
break;
}
case 1: {
u8 data[0x1b];
COPY_ACP(data, VIPalACPType3);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIPalACPType3);
break;
}
case 2: {
u8 data[0x1b];
COPY_ACP(data, VIMpalACPType3);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIMpalACPType3);
break;
}
case 5: {
u8 data[0x1b];
COPY_ACP(data, VIEurgb60ACPType3);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIEurgb60ACPType3);
break;
}
}
break;
case 1: {
u8 data[0x1b];
COPY_ACP(data, VIZeroACPType);
__VISendI2CData(0xe0, data, 0x1b);
WaitMicroTime(2);
__VISetMacrovisionImm(VIZeroACPType);
break;
}
}
}
void VISetMacrovision(s32 type) {
u8 oldType;
u8 oldWd2;
u8 oldWd0;
u8 mode;
u32 volume;
u8 newType;
u8 newWd2;
s32 tvFormat;
mode = 0;
volume = 0;
oldWd0 = __wd0;
oldType = __wd1;
oldWd2 = __wd2;
newType = oldType;
if (type == 3) {
goto type3;
}
if (type < 3) {
if (type == 1) {
goto type1;
} else if (type >= 1) {
goto type2;
}
goto done;
}
if (type >= 5) {
goto done;
}
goto type5;
type1:
mode = 0;
volume = 0;
goto done;
type2:
mode = 2;
volume = 3;
newType = 0;
goto done;
type3:
mode = 1;
volume = 3;
newType = 0;
goto done;
type5:
mode = 3;
volume = 3;
newType = 0;
done:
volume |= oldWd2 & 0xf0;
newWd2 = volume | mode << 2;
if ((oldType != newType) || (oldWd2 != newWd2)) {
__wd0 = oldWd0;
__wd1 = newType;
__wd2 = newWd2;
void VISetCGMS(u8 wd0, u8 wd1, u8 wd2) {
if (__wd0 != wd0 || __wd1 != wd1 || __wd2 != wd2) {
__wd0 = wd0;
__wd1 = wd1;
__wd2 = wd2;
Vdac_Flag_Changed_816991E0 |= 1;
}
}
void VISetMacrovision(s32 type) {
u32 tvFormat;
u8 mode = 0;
u8 volume = 0;
u8 wd0 = __wd0;
u8 wd1 = __wd1;
u8 wd2 = __wd2;
switch (type) {
case 1:
mode = 0;
volume = 0;
break;
case 2:
mode = 2;
volume = 3;
wd1 = 0;
break;
case 3:
mode = 1;
volume = 3;
wd1 = 0;
break;
case 4:
mode = 3;
volume = 3;
wd1 = 0;
break;
default:
break;
}
wd2 = wd2 & 0xF0;
wd2 = (wd2 | (mode << 2)) | volume;
VISetCGMS(wd0, wd1, wd2);
tvFormat = VIGetTvFormat();
if ((__type != type) || (__tvType != tvFormat)) {
__type = type;
@@ -578,101 +557,90 @@ void __VISetRevolutionMode(void) {
WaitMicroTime(2);
}
void __VISetRevolutionModeSimple(void) {
u32 i;
u8 powerCommand[2];
u8 clockCommand[2];
u8 outputCommand[2];
u8 volumeCommand[3];
u8 syncCommand[2];
u8 cgmsCommand[3];
u8 wssCommand[3];
u8 captionCommand[5];
u8 acpCommand[0x1c];
u8 driveCommand[2];
u8 filterCommand[2];
void __VISetTiming(s32 timing) {
u8 data[2];
powerCommand[0] = 0x6a;
powerCommand[1] = 1;
__VISendI2CData(0xe0, powerCommand, 2);
data[0] = 0;
data[1] = (u8)timing;
__VISendI2CData(0xe0, data, sizeof(data));
WaitMicroTime(2);
clockCommand[0] = 0x65;
clockCommand[1] = 1;
__VISendI2CData(0xe0, clockCommand, 2);
WaitMicroTime(2);
__VISetYUVSEL(VIGetDTVStatus());
outputCommand[0] = 0;
outputCommand[1] = 0;
__VISendI2CData(0xe0, outputCommand, 2);
WaitMicroTime(2);
volumeCommand[0] = 0x71;
volumeCommand[1] = 0x8e;
volumeCommand[2] = 0x8e;
__VISendI2CData(0xe0, volumeCommand, 3);
WaitMicroTime(2);
syncCommand[0] = 2;
syncCommand[1] = 7;
__VISendI2CData(0xe0, syncCommand, 2);
}
void __VISetVBICtrl(u8 arg0, u8 arg1, u8 arg2) {
u8 data[2];
data[0] = 2;
data[1] = (~arg2 & 1) | (((~arg1 & 1) << 2) | ((~arg0 & 1) << 1));
__VISendI2CData(0xe0, data, sizeof(data));
WaitMicroTime(2);
}
void __VISetCGMSClear(void) {
__wd0 = 0;
__wd1 = 0;
__wd2 = 0;
cgmsCommand[0] = 5;
cgmsCommand[1] = 0;
cgmsCommand[2] = 0;
__VISendI2CData(0xe0, cgmsCommand, 3);
WaitMicroTime(2);
if ((__gp1 != 0) || (__gp2 != 0) || (__gp3 != 0) || (__gp4 != 0)) {
__gp1 = 0;
__gp2 = 0;
__gp3 = 0;
__gp4 = 0;
__VISetCGMS();
}
void VISetWSS(u8 gp1, u8 gp2, u8 gp3, u8 gp4) {
if (__gp1 != gp1 || __gp2 != gp2 || __gp3 != gp3 || __gp4 != gp4) {
__gp1 = gp1;
__gp2 = gp2;
__gp3 = gp3;
__gp4 = gp4;
Vdac_Flag_Changed_816991E0 |= 2;
}
wssCommand[0] = 8;
wssCommand[1] = (__gp2 & 0xf) << 4 | __gp1 & 0xf;
wssCommand[2] = (__gp4 & 7) << 3 | __gp3 & 7;
__VISendI2CData(0xe0, wssCommand, 3);
WaitMicroTime(2);
if ((__cc1 != 0) || (__cc2 != 0) || (__cc3 != 0) || (__cc4 != 0)) {
__cc1 = 0;
__cc2 = 0;
__cc3 = 0;
__cc4 = 0;
}
void VISetClosedCaption(u8 cc1, u8 cc2, u8 cc3, u8 cc4) {
if (__cc1 != cc1 || __cc2 != cc2 || __cc3 != cc3 || __cc4 != cc4) {
__cc1 = cc1;
__cc2 = cc2;
__cc3 = cc3;
__cc4 = cc4;
Vdac_Flag_Changed_816991E0 |= 4;
}
captionCommand[0] = 0x7a;
captionCommand[1] = __cc1 & 0x7f;
captionCommand[2] = __cc2 & 0x7f;
captionCommand[3] = __cc3 & 0x7f;
captionCommand[4] = __cc4 & 0x7f;
__VISendI2CData(0xe0, captionCommand, 5);
WaitMicroTime(2);
for (i = 0; i < 0x1a; i++) {
acpCommand[i + 1] = VIZeroACPType[i];
}
acpCommand[0] = 0x40;
__VISendI2CData(0xe0, acpCommand, 0x1b);
WaitMicroTime(2);
if (__level != 0) {
__level = 0;
}
void VISetRGBOverDrive(s32 level) {
if (__level != level) {
__level = level;
Vdac_Flag_Changed_816991E0 |= 0x40;
}
if (Vdac_Flag_Region == 3) {
driveCommand[0] = 10;
driveCommand[1] = __level << 1 | 1;
__VISendI2CData(0xe0, driveCommand, 2);
WaitMicroTime(2);
}
void __VISetTrapFilterImm(u8 flag) {
u8 data[2];
data[0] = 3;
if (flag == TRUE) {
data[1] = 0;
} else {
driveCommand[0] = 10;
driveCommand[1] = 0;
__VISendI2CData(0xe0, driveCommand, 2);
WaitMicroTime(2);
data[1] = 1;
}
filterCommand[0] = 3;
filterCommand[1] = 1;
__VISendI2CData(0xe0, filterCommand, 2);
__VISendI2CData(0xe0, data, sizeof(data));
WaitMicroTime(2);
}
void __VISetRevolutionModeSimple(void) {
u32 dtvStatus;
__VISetCCSEL(TRUE);
__VISetOverSampling(TRUE);
dtvStatus = VIGetDTVStatus();
__VISetYUVSEL(dtvStatus);
__VISetTiming(0);
__VISetVolume(142, 142);
__VISetVBICtrl(0, 0, 0);
__VISetCGMSClear();
VISetWSS(0, 0, 0, 0);
__VISetWSS();
VISetClosedCaption(0, 0, 0, 0);
__VISetClosedCaption();
__VISetMacrovisionImm(VIZeroACPType);
VISetRGBOverDrive(0);
__VISetRGBOverDrive();
__VISetTrapFilterImm(0);
__VISetGammaImm(gammaSet[10]);
}

1
report.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -8,6 +8,7 @@
#include <private/nand.h>
#include <private/os.h>
#include <private/vi.h>
#include <private/hollywood/flipper.h>
#include <private/es.h>
#include <private/fs.h>
@@ -295,8 +296,8 @@ extern vu32 __DVDLayoutFormat;
void Run(u32 entryPoint, void *start, u32 blockCount, u32 argument) {
u8 *block = start;
for (; blockCount != 0; --blockCount) {
DCZeroRange(block, 32);
DCFlushRange(block, 32);
__dcbz(block, 0);
__dcbf(block, 0);
block += 32;
}
((void (*)(u32))entryPoint)(argument);
@@ -938,7 +939,8 @@ void BS2StartGCGame() {
}
__OSClearRTCFlags();
*(u32 *)0xCC003024 |= 7;
PI_SET_REG_F(0x24, 7);
(void)PI_READ_REG(0x24);
ticketViews = TicketViews;
ticketCount = 1;
BS2Report(" sysVersion = %016llx\n", 0x0000000100000100ULL);
@@ -1108,8 +1110,7 @@ void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length,
}
BOOL CheckBS2CommandStatus() {
u32 partCount;
u32 chunkLength;
DVDGameTOC *dataToc;
if (CheckDVDCommandStatus(&Block) == 0) {
BS2Report("DVD command is issuing\n");
return 0;
@@ -1192,16 +1193,14 @@ BOOL CheckBS2CommandStatus() {
if (BS2BootCaching != 0) {
BS2Report("Write partition ifno\n");
NandPending = 1;
partCount = ((DVDGameTOC *)DataToc)->partitionCount;
chunkLength = OSRoundUp32B(partCount * sizeof(DVDPartitionInfo)) + 32;
dataToc = (DVDGameTOC *)DataToc;
CacheCommandComplete = 1;
CacheLength = CacheLength + OSRoundUp32B(partCount * sizeof(DVDPartitionInfo));
CacheLength += 32;
CacheLength += OSRoundUp32B(dataToc->partitionCount * sizeof(DVDPartitionInfo)) + 32;
if ((unsigned int)CacheLength > 0xb00000) {
BS2NANDCallback(-1, NULL);
return 1;
} else {
BS2NANDDivideWriteAsync(&BS2CacheFileInfo, &PartitionInfoBuf, chunkLength, BS2NANDCallback, &BS2NandBlock);
BS2NANDDivideWriteAsync(&BS2CacheFileInfo, &PartitionInfoBuf, OSRoundUp32B(dataToc->partitionCount * sizeof(DVDPartitionInfo)) + 32, BS2NANDCallback, &BS2NandBlock);
return 0;
}
}
@@ -1339,11 +1338,17 @@ void BS2ReadDiskID(void *buffer, s32 length, u32 offset) {
BS2State BS2Tick() {
u32 interruptsEnabled = OSDisableInterrupts();
u32 titleCode, titlePrefix;
u32 titleCode;
s32 titlePrefix;
u8 titleCharacters[4];
u32 readOffset, readLength, readAddress;
struct {
u32 offset;
u32 length;
u32 address;
} loaderRead;
DVDFileInfo bannerFile;
s32 discRegion, status;
u32 discRegion;
s32 status;
u64 currentTime;
BOOL regionMatches;
char productRegion;
@@ -1376,8 +1381,7 @@ BS2State BS2Tick() {
currentTime = __OSGetSystemTime();
ResetTime = currentTime;
if (BS2WaitSpinup != 0 && BS2BootFromCache == 0) {
currentTime = __OSGetSystemTime();
SpinupDeadline = (u64)((OS_BUS_CLOCK >> 2) * 5) + currentTime;
SpinupDeadline = __OSGetSystemTime() + OSSecondsToTicks(5);
} else {
currentTime = __OSGetSystemTime();
SpinupDeadline = currentTime;
@@ -1403,8 +1407,7 @@ BS2State BS2Tick() {
currentTime = __OSGetSystemTime();
SpinupDeadline = currentTime;
} else {
currentTime = __OSGetSystemTime();
SpinupDeadline = (u64)((OS_BUS_CLOCK >> 2) * 7) + currentTime;
SpinupDeadline = __OSGetSystemTime() + OSSecondsToTicks(7);
}
__OSClearRTCFlags();
DVDResetAsync(&Block, BS2DVDCallback);
@@ -1421,7 +1424,7 @@ BS2State BS2Tick() {
status = CheckDVDCommandStatus(&CoverBlock);
if (status != 0) {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
@@ -1434,12 +1437,12 @@ BS2State BS2Tick() {
if (status != 0) {
State = BS2_STT_4;
case 4:
if (BS2BootFromCache == 0)
DVDInquiryAsync(&Block, &DriveInfo, BS2DVDCallback);
else {
if (BS2BootFromCache != 0) {
BS2Report("Read drive info from cache.dat\n");
NandPending = 1;
BS2NANDDivideReadAsync(&BS2CacheFileInfo, &DriveInfo, 0x20, BS2NANDCallback, &BS2NandBlock);
} else {
DVDInquiryAsync(&Block, &DriveInfo, BS2DVDCallback);
}
State = BS2_STT_5;
}
@@ -1465,26 +1468,28 @@ BS2State BS2Tick() {
break;
State = BS2_STT_8;
case 8:
if (BS2BootFromCache == 0)
DVDReadDiskID(&Block, &DiskID, BS2DVDCallback);
else {
if (BS2BootFromCache != 0) {
BS2Report("Read disk id from cache.dat\n");
NandPending = 1;
BS2NANDDivideReadAsync(&BS2CacheFileInfo, &DiskID, 0x20, BS2NANDCallback, &BS2NandBlock);
} else {
DVDReadDiskID(&Block, &DiskID, BS2DVDCallback);
}
State = BS2_STT_9;
break;
case 9:
case 10:
case 10: {
DVDDiskID *bootDisc;
status = CheckBS2CommandStatus();
if (status == 0)
break;
memcpy((void *)0x80000000, &DiskID, 0x20);
if ((*(u32 *)0x80000018) == 0x5d1c9ea3) {
status = strncmp((char *)0x80000000, "RAAE", 4);
if (status == 0 || strncmp((char *)0x80000000, "408", 3) == 0 ||
strncmp((char *)0x80000000, "410", 3) == 0 ||
strncmp((char *)0x80000000, "410", 3) == 0)
memcpy((void *)0x80000000, &DiskID, sizeof(DVDDiskID));
bootDisc = (DVDDiskID *)0x80000000;
if (bootDisc->rvlMagic == 0x5d1c9ea3) {
status = strncmp((char *)bootDisc, "RAAE", 4);
if (status == 0 || strncmp((char *)bootDisc, "408", 3) == 0 ||
strncmp((char *)bootDisc, "410", 3) == 0 ||
strncmp((char *)bootDisc, "410", 3) == 0)
regionMatches = FALSE;
else
regionMatches = TRUE;
@@ -1495,31 +1500,33 @@ BS2State BS2Tick() {
break;
}
}
if ((*(u32 *)0x8000001c) == -0x3dcc60c3) {
if (bootDisc->gcMagic == -0x3dcc60c3) {
BS2Report("DOLPHIN LAYOUT FORMAT\n");
__DVDLayoutFormat = 2;
State = BS2_STT_11;
} else {
BS2Report("UNKNOWN\n");
State = BS2_STT_54;
break;
}
case 0xb:
productRegion = (*(u8 *)0x80000008);
State = BS2_STT_11;
}
case 0xb: {
DVDDiskID *bootDisc = (DVDDiskID *)0x80000000;
u32 audioBufferSize;
if (AudioBufferUnconfigured == 0) {
State = BS2_STT_GC_GAME;
break;
}
AudioBufferUnconfigured = 0;
if (productRegion == '\0')
if (bootDisc->streaming != 0) {
audioBufferSize = bootDisc->streamingBufSize;
audioBufferSize = audioBufferSize != 0 ? audioBufferSize : 10;
__DVDAudioBufferConfig(&Block, 1, audioBufferSize, BS2DVDCallback);
} else {
__DVDAudioBufferConfig(&Block, 0, 0, BS2DVDCallback);
else {
productRegion = (*(u8 *)0x80000009);
if (productRegion == '\0')
productRegion = '\n';
__DVDAudioBufferConfig(&Block, 1, productRegion, BS2DVDCallback);
}
State = BS2_STT_12;
}
case 0xc:
status = CheckDVDCommandStatus(&Block);
if (status == 0)
@@ -1530,28 +1537,35 @@ BS2State BS2Tick() {
State = BS2_STT_14;
case 0xe:
status = CheckDVDCommandStatus(&Block);
discRegion = bi2.countryCode;
if (status == 0)
break;
discRegion = bi2.countryCode;
productRegion = SCGetProductGameRegion();
switch (productRegion) {
case 0:
regionMatches = discRegion == 0;
if (discRegion != 0)
goto invalidGcRegion;
regionMatches = TRUE;
break;
case 1:
regionMatches = discRegion == 1;
if (discRegion != 1)
goto invalidGcRegion;
regionMatches = TRUE;
break;
case 2:
regionMatches = discRegion == 2;
if (discRegion != 2)
goto invalidGcRegion;
regionMatches = TRUE;
break;
default:
invalidGcRegion:
regionMatches = FALSE;
break;
}
if (regionMatches)
State = BS2_STT_GC_GAME;
else
if (!regionMatches)
State = BS2_STT_54;
else
State = BS2_STT_GC_GAME;
break;
case 0xf:
if (LoadingTitle != 0) {
@@ -1609,62 +1623,80 @@ BS2State BS2Tick() {
State = BS2_STT_20;
case 0x14:
status = CheckBS2CommandStatus();
discRegion = bi3.countryCode;
if (status == 0)
break;
if (bi3.magic != -0x3c07e572) {
State = BS2_STT_54;
break;
}
productRegion = SCGetProductGameRegion();
switch (productRegion) {
case 0:
regionMatches = discRegion == 0;
break;
case 1:
regionMatches = discRegion == 1;
break;
case 2:
regionMatches = discRegion == 2;
break;
case 4:
regionMatches = discRegion == 4;
break;
case 5:
regionMatches = discRegion == 5;
break;
default:
regionMatches = FALSE;
break;
}
if (regionMatches) {
status = BS2IsValidDisc();
if (status == 0)
if (bi3.magic == -0x3c07e572) {
discRegion = bi3.countryCode;
productRegion = SCGetProductGameRegion();
switch (productRegion) {
case 0:
if (discRegion != 0)
goto invalidRvlRegion;
regionMatches = TRUE;
break;
case 1:
if (discRegion != 1)
goto invalidRvlRegion;
regionMatches = TRUE;
break;
case 2:
if (discRegion != 2)
goto invalidRvlRegion;
regionMatches = TRUE;
break;
case 4:
if (discRegion != 4)
goto invalidRvlRegion;
regionMatches = TRUE;
break;
case 5:
if (discRegion != 5)
goto invalidRvlRegion;
regionMatches = TRUE;
break;
default:
invalidRvlRegion:
regionMatches = FALSE;
break;
}
if (!regionMatches) {
State = BS2_STT_54;
else if (BS2BootFromCache == 0) {
if (UpdatePartition == 0) {
if (GamePartition == 0)
State = BS2_STT_54;
else
State = BS2_STT_37;
} else {
State = BS2_STT_21;
case 0x15:
DVDOpenPartitionAsync(&Block, (void *)(u32)&PartitionParams.tmd, (u32)((DVDPartitionInfo *)UpdatePartition)->partition,
BS2DVDCallback);
PartitionOpen = 1;
State = BS2_STT_22;
}
} else
State = BS2_STT_37;
} else
break;
}
status = BS2IsValidDisc();
if (status == 0) {
State = BS2_STT_54;
break;
}
} else {
State = BS2_STT_54;
break;
}
if (BS2BootFromCache != 0) {
State = BS2_STT_37;
break;
}
if (UpdatePartition != 0)
State = BS2_STT_21;
else {
if (GamePartition != 0)
State = BS2_STT_37;
else
State = BS2_STT_54;
break;
}
case 0x15:
DVDOpenPartitionAsync(&Block, &PartitionParams.tmd,
(u32)((DVDPartitionInfo *)UpdatePartition)->partition,
BS2DVDCallback);
PartitionOpen = 1;
State = BS2_STT_22;
break;
case 0x16:
status = CheckDVDCommandStatus(&Block);
if (status != 0) {
CurrentTmd = (u32)&PartitionParams.tmd;
BS2Report("TMD ver ... 0x%02X\n", PartitionParams.tmd.head.version);
BS2Report("TMD ver ... 0x%02X\n", ((ESTitleMeta *)CurrentTmd)->head.version);
BS2Report("CA CRL ver ... 0x%02X\n", ((ESTitleMeta *)CurrentTmd)->head.caCrlVersion);
BS2Report("Signer CRL ver ... 0x%02X\n", ((ESTitleMeta *)CurrentTmd)->head.signerCrlVersion);
BS2Report("Req sys ver ... 0x%08X%08X\n", (u32)(((ESTitleMeta *)CurrentTmd)->head.sysVersion >> 32),
@@ -1682,11 +1714,12 @@ BS2State BS2Tick() {
status = CheckDVDCommandStatus(&Block);
if (status == 0)
break;
if (UpdateDiskID.rvlMagic != 0x5d1c9ea3) {
if (UpdateDiskID.rvlMagic == 0x5d1c9ea3)
State = BS2_STT_25;
else {
State = BS2_STT_35;
break;
}
State = BS2_STT_25;
case 0x19:
DVDReadAbsAsyncForBS(&Block, &AppLoaderHdr, 0x20, 0x910, BS2DVDCallback);
State = BS2_STT_26;
@@ -1711,22 +1744,20 @@ BS2State BS2Tick() {
((void (*)(void *))((*(void **)&LoaderInit)))((void *)BS2Report);
BS2Report("\nApploader Initialized\n");
State = BS2_STT_29;
break;
case 0x1d:
status = ((int (*)(u32 *, u32 *, u32 *))((*(void **)&LoaderMain)))(&readAddress, &readLength, &readOffset);
if (status == 0)
State = BS2_STT_31;
else {
BS2Report("Addr [0x%x] length [0x%x] offset [0x%x]\n", readAddress, readLength, readOffset);
status = ((int (*)(u32 *, u32 *, u32 *))((*(void **)&LoaderMain)))(&loaderRead.address, &loaderRead.length, &loaderRead.offset);
if (status != 0) {
BS2Report("Addr [0x%x] length [0x%x] offset [0x%x]\n", loaderRead.address, loaderRead.length, loaderRead.offset);
readInterruptsEnabled = OSDisableInterrupts();
DVDReadAbsAsyncForBS(&Block, (void *)readAddress, readLength, readOffset >> (__DVDLayoutFormat & 0x3f), BS2DVDCallback);
DVDReadAbsAsyncForBS(&Block, (void *)loaderRead.address, loaderRead.length, loaderRead.offset >> __DVDLayoutFormat, BS2DVDCallback);
if (*(s32 *)DvdProgress != 0) {
DvdReadPending = 1;
DvdTransferLength = readLength;
DvdTransferLength = loaderRead.length;
}
OSRestoreInterrupts(readInterruptsEnabled);
State = BS2_STT_30;
}
} else
State = BS2_STT_31;
break;
case 0x1e:
status = CheckDVDCommandStatus(&Block);
@@ -1750,11 +1781,11 @@ BS2State BS2Tick() {
}
} else {
status = BS2GetUpdateEntryNum();
if ((status != 0) && (status = BS2UpdateState(), status == 1)) {
if ((status != 0) && (BS2UpdateState() == 1)) {
entryCount = BS2GetUpdateEntryNum();
BS2Report("%d entries\n", entryCount);
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
@@ -1768,9 +1799,9 @@ BS2State BS2Tick() {
break;
case 0x21:
status = CheckDVDCommandStatus(&CoverBlock);
if ((status != 0) && (status = BS2UpdateState(), status == 1)) {
if ((status != 0) && (BS2UpdateState() == 1)) {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
@@ -1837,14 +1868,12 @@ BS2State BS2Tick() {
}
State = BS2_STT_37;
case 0x25:
if (BS2BootFromCache == 0)
DVDOpenPartitionAsync(&Block, (void *)(u32)&PartitionParams.tmd, (u32)((DVDPartitionInfo *)GamePartition)->partition,
BS2DVDCallback);
else {
if (BS2BootFromCache != 0) {
BS2Report("Open partition from cache.dat\n");
NandPending = 1;
BS2NANDDivideReadAsync(&BS2CacheFileInfo, (void *)(u32)&PartitionParams.tmd, 0x4a00, BS2NANDCallback, &BS2NandBlock);
}
BS2NANDDivideReadAsync(&BS2CacheFileInfo, &PartitionParams.tmd, 0x4a00, BS2NANDCallback, &BS2NandBlock);
} else
DVDOpenPartitionAsync(&Block, &PartitionParams.tmd, (u32)((DVDPartitionInfo *)GamePartition)->partition, BS2DVDCallback);
PartitionOpen = 1;
State = BS2_STT_38;
break;
@@ -1853,7 +1882,7 @@ BS2State BS2Tick() {
if (status == 0)
break;
CurrentTmd = (u32)&PartitionParams.tmd;
BS2Report("TMD ver ... 0x%02X\n", PartitionParams.tmd.head.version);
BS2Report("TMD ver ... 0x%02X\n", ((ESTitleMeta *)CurrentTmd)->head.version);
BS2Report("CA CRL ver ... 0x%02X\n", ((ESTitleMeta *)CurrentTmd)->head.caCrlVersion);
BS2Report("Signer CRL ver ... 0x%02X\n", ((ESTitleMeta *)CurrentTmd)->head.signerCrlVersion);
BS2Report("Req sys ver ... 0x%08X%08X\n", (u32)(((ESTitleMeta *)CurrentTmd)->head.sysVersion >> 32),
@@ -1865,7 +1894,7 @@ BS2State BS2Tick() {
RequiredIosHigh = iosHigh;
titleCode = (u32)((ESTitleMeta *)CurrentTmd)->head.titleId;
TitleCode = titleCode;
if ((u32)((ESTitleMeta *)CurrentTmd)->head.sysVersion == 0x10 && (u32)(((ESTitleMeta *)CurrentTmd)->head.sysVersion >> 32) == 1) {
if (((ESTitleMeta *)CurrentTmd)->head.sysVersion == 0x0000000100000010ULL) {
BS2Report("This must be a backup disk\n");
State = BS2_STT_FATAL_ERROR;
break;
@@ -1874,80 +1903,95 @@ BS2State BS2Tick() {
titlePrefix = titleCode >> 0x18;
titleCharacters[3] = (u8)titleCode;
titleCharacters[0] = (char)(titleCode >> 0x18);
if (titlePrefix < 0x52) {
if (titlePrefix != 0x44)
goto unrestricted_title;
if (titlePrefix < 'R') {
if (titlePrefix == 'D')
goto check_title_region;
} else if (titlePrefix < 'U')
goto check_title_region;
regionMatches = TRUE;
goto title_region_checked;
{
check_title_region:
if (titleCharacters[3] == 0x41) {
regionMatches = TRUE;
goto title_region_checked;
}
productRegion = SCGetProductGameRegion();
if (productRegion == '\x03')
goto title_region_mismatch;
if ('\x02' < productRegion) {
if (productRegion == '\x05') {
if (titleCharacters[3] != 0x43)
goto title_region_mismatch;
regionMatches = TRUE;
} else {
if (('\x04' < productRegion) || (titleCharacters[3] != 0x4b))
goto title_region_mismatch;
regionMatches = TRUE;
}
goto title_region_checked;
}
if (productRegion == '\x01') {
if (titleCharacters[3] < 0x58) {
if (titleCharacters[3] == 0x45)
goto us_title_region;
} else if (titleCharacters[3] < 0x5b) {
us_title_region:
regionMatches = TRUE;
goto title_region_checked;
}
goto title_region_mismatch;
}
if (productRegion < '\x01') {
if ((productRegion < '\0') ||
((titleCharacters[3] != 0x57 && ((0x56 < titleCharacters[3] || (titleCharacters[3] != 0x4a))))))
goto title_region_mismatch;
regionMatches = TRUE;
} else {
switch (titleCharacters[3]) {
case 0x44:
case 0x46:
case 0x48:
case 0x49:
case 0x50:
case 0x52:
case 0x53:
case 0x55:
case 0x56:
case 0x58:
case 0x59:
case 0x5a:
switch (productRegion) {
case 0:
switch ((s32)titleCharacters[3]) {
case 'J':
case 'W':
regionMatches = TRUE;
break;
case 0x57:
titleCharacters[1] = (u8)(titleCode >> 0x10);
default:
goto title_region_mismatch;
}
break;
case 1:
switch ((s32)titleCharacters[3]) {
case 'E':
case 'X':
case 'Y':
case 'Z':
regionMatches = TRUE;
break;
default:
goto title_region_mismatch;
}
break;
case 2:
switch (titleCharacters[3]) {
case 'D':
case 'F':
case 'H':
case 'I':
case 'P':
case 'R':
case 'S':
case 'U':
case 'V':
case 'X':
case 'Y':
case 'Z':
regionMatches = TRUE;
break;
case 'W':
titleCharacters[1] = (u8)(titleCode >> 16);
titleCharacters[2] = (u8)(titleCode >> 8);
if (((titleCharacters[0] != 'R') || ((titleCode >> 0x10 & 0xff) != 0x4c)) || ((titleCode >> 8 & 0xff) != 0x57))
if (titleCharacters[0] != 'R' ||
(titleCode >> 16 & 0xff) != 'L' ||
(titleCode >> 8 & 0xff) != 'W')
goto title_region_mismatch;
regionMatches = TRUE;
break;
default:
title_region_mismatch:
regionMatches = FALSE;
break;
goto title_region_mismatch;
}
break;
case 4:
switch ((s32)titleCharacters[3]) {
case 'K':
regionMatches = TRUE;
break;
default:
goto title_region_mismatch;
}
break;
case 5:
switch ((s32)titleCharacters[3]) {
case 'C':
regionMatches = TRUE;
break;
default:
goto title_region_mismatch;
}
break;
default:
title_region_mismatch:
regionMatches = FALSE;
break;
}
goto title_region_checked;
} else {
if (titlePrefix < 0x55)
goto check_title_region;
unrestricted_title:
regionMatches = TRUE;
}
title_region_checked:
if (!regionMatches) {
@@ -1982,25 +2026,23 @@ BS2State BS2Tick() {
((void (*)(void *))((*(void **)&LoaderInit)))((void *)OSReport);
BS2Report("\nApploader Initialized\n");
State = BS2_STT_43;
break;
case 0x2b:
status = ((int (*)(u32 *, u32 *, u32 *))((*(void **)&LoaderMain)))(&readAddress, &readLength, &readOffset);
if (status == 0)
State = BS2_STT_45;
else {
BS2Report("Addr [0x%x] length [0x%x] offset [0x%x]\n", readAddress, readLength, readOffset);
status = ((int (*)(u32 *, u32 *, u32 *))((*(void **)&LoaderMain)))(&loaderRead.address, &loaderRead.length, &loaderRead.offset);
if (status != 0) {
BS2Report("Addr [0x%x] length [0x%x] offset [0x%x]\n", loaderRead.address, loaderRead.length, loaderRead.offset);
readInterruptsEnabled = OSDisableInterrupts();
BS2ReadDiskID((void *)readAddress, readLength, readOffset >> (__DVDLayoutFormat & 0x3f));
LoaderLength = readLength;
LoaderAddress = readAddress;
LoaderOffset = readOffset;
BS2ReadDiskID((void *)loaderRead.address, loaderRead.length, loaderRead.offset >> __DVDLayoutFormat);
LoaderLength = loaderRead.length;
LoaderAddress = loaderRead.address;
LoaderOffset = loaderRead.offset;
if ((*(s32 *)DvdProgress != 0) && (BS2BootFromCache == 0)) {
DvdReadPending = 1;
DvdTransferLength = readLength;
DvdTransferLength = loaderRead.length;
}
OSRestoreInterrupts(readInterruptsEnabled);
State = BS2_STT_44;
}
} else
State = BS2_STT_45;
break;
case 0x2c:
status = CheckBS2CommandStatus();
@@ -2008,10 +2050,14 @@ BS2State BS2Tick() {
State = BS2_STT_43;
break;
case 0x2d:
if (PartitionParams.numTmdBytes == 0) {
if (PartitionParams.numTmdBytes != 0) {
State = BS2_STT_47;
break;
}
{
__DVDFSInit();
status = DVDConvertPathToEntrynum("/opening.bnr");
if (-1 < status) {
if (status >= 0) {
DVDFastOpen(status, &bannerFile);
if (Allocator != 0) {
if (BannerAllocation != 0)
@@ -2033,7 +2079,7 @@ BS2State BS2Tick() {
}
if (bannerFile.length != 0) {
BS2ReadDiskID((void *)BannerBuffer, ((bannerFile.length + 0x1fU) & 0xffffffe0),
bannerFile.startAddr >> (__DVDLayoutFormat & 0x3f));
bannerFile.startAddr >> __DVDLayoutFormat);
State = BS2_STT_46;
break;
}
@@ -2046,8 +2092,7 @@ BS2State BS2Tick() {
BannerLength = 0;
}
State = BS2_STT_47;
} else
State = BS2_STT_47;
}
break;
case 0x2e:
status = CheckBS2CommandStatus();
@@ -2073,10 +2118,10 @@ BS2State BS2Tick() {
}
if (((u32)((ESTitleMeta *)CurrentTmd)->head.titleId == 0x4c4f43) && (LoadingTitle == 0))
State = BS2_STT_DATA_DISK;
else if (PartitionParams.numTmdBytes == 0)
State = BS2_STT_RVL_GAME;
else
else if (PartitionParams.numTmdBytes != 0)
State = BS2_STT_START_LOCKED_DISK;
else
State = BS2_STT_RVL_GAME;
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
@@ -2089,7 +2134,7 @@ BS2State BS2Tick() {
status = CheckDVDCommandStatus(&CoverBlock);
if ((status != 0) && (StartingGame == 0)) {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
@@ -2100,7 +2145,7 @@ BS2State BS2Tick() {
status = CheckDVDCommandStatus(&CoverBlock);
if ((status != 0) && (StartingGame == 0)) {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
@@ -2131,15 +2176,19 @@ BS2State BS2Tick() {
BS2BootFromCache = 0;
BS2BootCaching = 1;
LoadingTitle = 0;
if ((Block.state < 6) && (3 < Block.state))
switch (Block.state) {
case 4:
case 5:
CheckDVDCommandStatus(&Block);
else {
break;
default: {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
}
} break;
}
break;
case 0x36:
@@ -2168,31 +2217,6 @@ BS2State BS2Tick() {
}
LoadingTitle = 0;
break;
case 0x3b:
case 0x3f:
if (UpdateErrorFlag == 0) {
if (RetryErrorFlag != 0) {
RetryErrorFlag = 0;
State = BS2_STT_DIRTY_DISK;
}
if (AbortFlag == 0) {
if ((Block.state < 6) && (3 < Block.state))
CheckDVDCommandStatus(&Block);
else {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
}
}
} else {
AbortFlag = 0;
State = BS2_STT_64;
}
} else
State = BS2_STT_UPDATE_FAILED;
break;
case 0x3c:
status = CheckBS2CommandStatus();
if (status != 0)
@@ -2210,29 +2234,81 @@ BS2State BS2Tick() {
State = BS2_STT_63;
}
break;
case 0x46:
DVDGetPartitionParamsAsync(&Block, &PartitionParams, (u32)((DVDPartitionInfo *)GamePartition)->partition, BS2DVDCallback);
State = BS2_STT_71;
break;
case 0x47: {
status = CheckBS2CommandStatus();
if (status != 0) {
ticketByte = (char *)&PartitionParams.ticket;
for (status = 0; status < sizeof(PartitionParams.ticket); ++status) {
if ((u8)ticketByte[status] != 0) {
BS2Report("eTicket is none zero\n");
break;
}
}
memcpy(&PartitionParams.ticketView, (void *)TitleTicketView, sizeof(ESTicketView));
DCStoreRange(&PartitionParams.ticketView, sizeof(ESTicketView));
DVDOpenPartitionWithParamsAsync(&Block, &PartitionParams, (u32)((DVDPartitionInfo *)GamePartition)->partition, BS2DVDCallback);
PartitionOpen = 1;
State = BS2_STT_38;
}
} break;
case 0x3b:
case 0x3f:
if (UpdateErrorFlag != 0) {
State = BS2_STT_UPDATE_FAILED;
break;
}
if (RetryErrorFlag != 0) {
RetryErrorFlag = 0;
State = BS2_STT_DIRTY_DISK;
}
if (AbortFlag != 0) {
AbortFlag = 0;
State = BS2_STT_64;
break;
}
switch (Block.state) {
case 4:
case 5:
CheckDVDCommandStatus(&Block);
break;
default: {
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - CoverPollTime) >= OSMillisecondsToTicks((OSTime)100)) {
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
}
} break;
}
break;
case 0x40:
AbortFlag = 0;
if (RestartRequested != 0) {
RestartRequested = 0;
if (FatalErrorFlag == 0) {
if (PartitionOpen == 0) {
if ((__DVDLayoutFormat == 2) || ((BS2DriveReset != 0 && (DriveWasReset == 0))))
State = BS2_STT_2;
else {
if (Block.state == 10)
Block.state = 0;
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
State = BS2_STT_3;
}
} else {
PartitionOpen = 0;
State = BS2_STT_15;
}
} else
State = BS2_STT_FATAL_ERROR;
if (RestartRequested == 0)
break;
RestartRequested = 0;
if (FatalErrorFlag != 0) {
State = BS2_STT_FATAL_ERROR;
break;
}
if (PartitionOpen != 0) {
PartitionOpen = 0;
State = BS2_STT_15;
break;
}
if ((__DVDLayoutFormat == 2) || (BS2DriveReset != 0 && DriveWasReset == 0)) {
State = BS2_STT_2;
break;
}
if (Block.state == 10)
Block.state = 0;
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
__DVDGetCoverStatusAsync(&CoverBlock, BS2DVDCallback);
State = BS2_STT_3;
break;
case 0x41:
BannerAvailable = 0;
@@ -2245,7 +2321,7 @@ BS2State BS2Tick() {
break;
case 0x42:
currentTime = __OSGetSystemTime();
if ((OSTime)(currentTime - (((u64)CoverOpenTimeHigh << 32) | CoverOpenTimeLow)) < (OSTime)(((OS_BUS_CLOCK >> 2) / 1000) * 350))
if ((OSTime)(currentTime - (((u64)CoverOpenTimeHigh << 32) | CoverOpenTimeLow)) < OSMillisecondsToTicks((OSTime)350))
break;
currentTime = __OSGetSystemTime();
CoverPollTime = currentTime;
@@ -2255,27 +2331,6 @@ BS2State BS2Tick() {
case 0x44:
CheckDVDCommandStatus(&Block);
break;
case 0x46:
DVDGetPartitionParamsAsync(&Block, &PartitionParams, (u32)((DVDPartitionInfo *)GamePartition)->partition, BS2DVDCallback);
State = BS2_STT_71;
break;
case 0x47: {
status = CheckBS2CommandStatus();
if (status != 0) {
ticketByte = (char *)&PartitionParams.ticket;
for (status = 0; status < sizeof(PartitionParams.ticket); ++status) {
if (ticketByte[status] != 0) {
BS2Report("eTicket is none zero\n");
break;
}
}
memcpy(&PartitionParams.ticketView, (void *)TitleTicketView, sizeof(ESTicketView));
DCStoreRange(&PartitionParams.ticketView, sizeof(ESTicketView));
DVDOpenPartitionWithParamsAsync(&Block, &PartitionParams, (u32)((DVDPartitionInfo *)GamePartition)->partition, BS2DVDCallback);
PartitionOpen = 1;
State = BS2_STT_38;
}
} break;
default:
OSPanic("BS2Mach.c", 0x14e3, "BS2 ERROR >>> UNKNOWN STATE");
break;

View File

@@ -4164,17 +4164,13 @@ VmMethodDefine(Blob, CopyRangeFrom) {
count = CHANSVm_81451314(srcBlob, countObj, srcOff);
{
u32 destinationOffset = destOff;
if ((s64)count >= 0 && (s64)(destBlob->size - destinationOffset) >= (s64)count) {
okFlag = vmTrue;
}
okFlag = (s64)count >= 0 && (s64)(destBlob->size - destinationOffset) >= (s64)count;
}
if (okFlag) {
vmBoolInt sourceValid = vmFalse;
u32 sourceOffset = srcOff;
if ((s64)count >= 0 && (s64)(srcBlob->size - sourceOffset) >= (s64)count) {
sourceValid = vmTrue;
}
sourceValid = (s64)count >= 0 && (s64)(srcBlob->size - sourceOffset) >= (s64)count;
if (sourceValid) {
memmove(destBlob->pData + destOff, srcBlob->pData + srcOff, count);

View File

@@ -20,6 +20,15 @@ protected:
namespace extend {
namespace memo {
class EventHandler : public inputform::EventHandler {
public:
EventHandler(InputForm* form) : inputform::EventHandler(form), mpMemoForm(form) {}
virtual ~EventHandler();
virtual void onTiEvent(gui::PaneComponent*, u32, Input*);
private:
InputForm* mpMemoForm;
};
class AnmPane : public nw4rmanager::AnmPane {
protected:
AnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer)
@@ -28,8 +37,8 @@ public:
virtual ~AnmPane();
virtual void init();
virtual void changeAnimation(u32 id);
virtual u32 getState();
virtual u32 getKeyType() const;
virtual u32 getState();
protected:
u32 meState;
u32 meKeyType;
@@ -38,25 +47,17 @@ protected:
class WholePane : public AnmPane {
public:
WholePane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = 0; }
virtual ~WholePane() {}
virtual ~WholePane();
virtual void onAnmEvent(AnmPaneEvent event);
};
class NigaoePane : public AnmPane {
public:
NigaoePane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = 1; }
virtual ~NigaoePane() {}
virtual ~NigaoePane();
virtual void onAnmEvent(AnmPaneEvent event);
};
class SimpleAnmPane : public nw4rmanager::AnmPane {
public:
SimpleAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : nw4rmanager::AnmPane(pane, observer) {}
virtual ~SimpleAnmPane() {}
virtual void init();
virtual void changeAnimation(u32 id);
};
class ScrollButton {
public:
ScrollButton(TiLayout* layout) : muGroup(0), muAnimation(0), mpLayout(layout), mbLeftPressed(false), mbRightPressed(false) {}
@@ -74,13 +75,12 @@ private:
bool mbRightPressed;
};
class EventHandler : public inputform::EventHandler {
class SimpleAnmPane : public nw4rmanager::AnmPane {
public:
EventHandler(InputForm* form) : inputform::EventHandler(form), mpMemoForm(form) {}
virtual ~EventHandler() {}
virtual void onTiEvent(gui::PaneComponent*, u32, Input*);
private:
InputForm* mpMemoForm;
SimpleAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : nw4rmanager::AnmPane(pane, observer) {}
virtual ~SimpleAnmPane();
virtual void init();
virtual void changeAnimation(u32 id);
};
static const char* scPaneName[] = {
@@ -279,6 +279,12 @@ void InputForm::create(MEMAllocator* allocator, inputform::EditBuffer* editBuffe
mpScrollButton->create(allocator, mpMultiArcResourceAccessor);
}
} // namespace memo
} // namespace extend
namespace extend {
namespace memo {
void InputForm::createAnimation(MEMAllocator* allocator) {
for (u16 i = 0; i < 2; i++) {
const PaneAnimations& entry = csPaneToAnimation[i];
@@ -305,6 +311,9 @@ void InputForm::createAnimation(MEMAllocator* allocator) {
}
AnmPane::~AnmPane() {}
WholePane::~WholePane() {}
NigaoePane::~NigaoePane() {}
SimpleAnmPane::~SimpleAnmPane() {}
static const char* csGroupName[] = {
"G_ArwRoop", "G_ArwR_Focus", "G_ArwL_Focus", "G_ArwR_Ac", "G_ArwL_Ac",
@@ -399,7 +408,7 @@ void InputForm::onArrowRTrig() {
mpScrollButton->changeAnimation(false, 6);
f32 scroll = mfScroll - 3.0f * getLineHeight();
if (scroll <= getScrollMin()) scroll = getScrollMin();
mExScrollAnm.startAnm(NULL, mfScroll, scroll, 15.0f, NULL);
mExScrollAnm.startAnm(mfScroll, scroll, 15.0f, (util::AnimObserver*)NULL, NULL);
onSE(sound::SE_LINE_SCROLL);
}
}
@@ -408,7 +417,7 @@ void InputForm::onArrowLTrig() {
mpScrollButton->changeAnimation(true, 6);
f32 scroll = mfScroll + 3.0f * getLineHeight();
if (scroll >= getScrollMax()) scroll = getScrollMax();
mExScrollAnm.startAnm(NULL, mfScroll, scroll, 15.0f, NULL);
mExScrollAnm.startAnm(mfScroll, scroll, 15.0f, (util::AnimObserver*)NULL, NULL);
onSE(sound::SE_LINE_SCROLL);
}
}
@@ -446,8 +455,8 @@ bool InputForm::updateInput(input::HKBManager& hkbManager) {
void InputForm::init() {
if (mpBoundPane != NULL) mCharColor.Set(20, 20, 20, 255);
mbUpVisible = false;
mbDownVisible = false;
mbAbleToUp = false;
mbAbleToDown = false;
searchAnmPane("P_txtScrll_UP")->changeAnimation(7);
searchAnmPane("P_txtScrll_DOWN")->changeAnimation(7);
mbGoodBye = false;
@@ -483,6 +492,8 @@ void InputForm::setScroll(f32 scroll) {
mfDrawScrollY = meEditMode == EM_Edit ? -mfScroll : 0.0f;
}
extern "C" __declspec(section ".sdata") const f32 csfDrawScrollZero = 0.0f;
static nw4r::math::VEC2 transformedOrigin(const nw4r::ut::Rect& rect, const Mtx& matrix) {
nw4r::math::VEC3 position;
position.x = rect.left;
@@ -519,7 +530,7 @@ void InputForm::calc() {
if (meEditMode == EM_Edit) {
height = 2.0f * getLineHeight();
boundY = (mDefaultBoundTrans.y - (height - mDefaultBoundSize.height) / 2.0f) - mfScroll;
} else mfDrawScrollY = 0.0f;
} else mfDrawScrollY = csfDrawScrollZero;
mpBoundPane->SetSize(nw4r::lyt::Size(mpBoundPane->GetSize().width, height));
mpBoundPane->SetTranslate(nw4r::math::VEC2(mDefaultBoundTrans.x, boundY));
mpBoundPane->CalculateMtx(mDrawInfo);
@@ -536,14 +547,14 @@ void InputForm::calc() {
f32 halfLine = getLineHeight();
halfLine *= 0.5f;
if (mfScroll - halfLine > 0.0f) {
if (!mbUpVisible) {
if (!mbAbleToUp) {
searchAnmPane("P_txtScrll_UP")->changeAnimation(5);
mpPaneManager->getPaneComponentByPane(getPane("B_txtScrll_UP"))->init();
}
mbUpVisible = true;
mbAbleToUp = true;
} else {
if (mbUpVisible) searchAnmPane("P_txtScrll_UP")->changeAnimation(6);
mbUpVisible = false;
if (mbAbleToUp) searchAnmPane("P_txtScrll_UP")->changeAnimation(6);
mbAbleToUp = false;
}
f32 textHeight = getLine() * getLineHeight();
f32 lowerHalfLine = getLineHeight();
@@ -551,19 +562,19 @@ void InputForm::calc() {
f32 lowerEdge = mfScroll + height;
lowerEdge += lowerHalfLine;
if (lowerEdge < textHeight) {
if (!mbDownVisible) {
if (!mbAbleToDown) {
searchAnmPane("P_txtScrll_DOWN")->changeAnimation(5);
mpPaneManager->getPaneComponentByPane(getPane("B_txtScrll_DOWN"))->init();
}
mbDownVisible = true;
mbAbleToDown = true;
} else {
if (mbDownVisible) searchAnmPane("P_txtScrll_DOWN")->changeAnimation(6);
mbDownVisible = false;
if (mbAbleToDown) searchAnmPane("P_txtScrll_DOWN")->changeAnimation(6);
mbAbleToDown = false;
}
}
} else {
mbUpVisible = false;
mbDownVisible = false;
mbAbleToUp = false;
mbAbleToDown = false;
searchAnmPane("P_txtScrll_UP")->changeAnimation(7);
searchAnmPane("P_txtScrll_DOWN")->changeAnimation(7);
getPane("N_txt_scrl")->Animate(0);
@@ -757,6 +768,7 @@ void InputForm::finishDraw(u32) {
}
void WholePane::onAnmEvent(AnmPaneEvent) {}
EventHandler::~EventHandler() {}
void EventHandler::onTiEvent(gui::PaneComponent* component, u32 event, Input* input) {
inputform::EventHandler::onTiEvent(component, event, input);
const char* name = component->getPane()->GetName();
@@ -791,6 +803,12 @@ void AnmPane::init() { meState = 0; }
void NigaoePane::onAnmEvent(AnmPaneEvent) {}
bool InputForm::isInScroll() { return mExScrollAnm.isActive(); }
gui::EventHandler* gui::GUIManager::changeEventHandler(gui::EventHandler* eventHandler) {
gui::EventHandler* prevHandler = mpEventHandler;
mpEventHandler = eventHandler;
return prevHandler;
}
}
}
}

View File

@@ -1,5 +1,5 @@
#define MYTILETTERFORM_IMPLEMENTATION
#include "keyboard/MyTiLetterForm.h"
#include "keyboard/tiHwKeyboard.h"
#include "keyboard/tiUtil.h"
#include <nw4r/lyt/textbox.h>
#include <new>
@@ -69,8 +69,8 @@ static const char* paneNames[] = {
"N_Header", "N_Body", "B_Body", "N_Footer", "Nigaoe",
"T_Nigaoe", "B_Nigaoe", "T_Letter", "T_TouchLetter"
};
struct AnimationFile { u32 id; char fileName[64]; };
static const AnimationFile animationFiles[] = {
typedef keyboard::hwkey::HWKeyboard::AnimationFile AnimationFile;
const AnimationFile keyboard::hwkey::HWKeyboard::csAninationFile[8] = {
{0, "my_LetterL_PicFocusIn.brlan"},
{1, "my_LetterL_SelectPic.brlan"},
{2, "my_LetterL_ExitPic.brlan"},
@@ -86,12 +86,26 @@ struct PaneToAnimationGroup {
u32 count;
const AnimationFile* animations[12];
};
static const PaneToAnimationGroup animationGroups[] = {
{0, "N_MemoRoot", 4, {&animationFiles[4], &animationFiles[5], &animationFiles[6], &animationFiles[7]}},
{0, "SendPic", 4, {&animationFiles[4], &animationFiles[5], &animationFiles[6], &animationFiles[7]}},
{1, "N_Pic", 5, {&animationFiles[0], &animationFiles[1], &animationFiles[2], &animationFiles[3], &animationFiles[4]}},
{0, "N_SendMes", 1, {&animationFiles[5]}}
static const PaneToAnimationGroup animationGroups[2] = {
{0, "N_MemoRoot", 4, {&keyboard::hwkey::HWKeyboard::csAninationFile[4], &keyboard::hwkey::HWKeyboard::csAninationFile[5], &keyboard::hwkey::HWKeyboard::csAninationFile[6], &keyboard::hwkey::HWKeyboard::csAninationFile[7]}},
{0, "SendPic", 4, {&keyboard::hwkey::HWKeyboard::csAninationFile[4], &keyboard::hwkey::HWKeyboard::csAninationFile[5], &keyboard::hwkey::HWKeyboard::csAninationFile[6], &keyboard::hwkey::HWKeyboard::csAninationFile[7]}}
};
struct PaneToAnimationGroup2 {
s32 type;
const char* paneName;
u32 count;
const AnimationFile* animations[11];
};
static const PaneToAnimationGroup2 groupN_Pic = {
1, "N_Pic", 5, {&keyboard::hwkey::HWKeyboard::csAninationFile[0], &keyboard::hwkey::HWKeyboard::csAninationFile[1], &keyboard::hwkey::HWKeyboard::csAninationFile[2], &keyboard::hwkey::HWKeyboard::csAninationFile[3], &keyboard::hwkey::HWKeyboard::csAninationFile[4]}
};
char scN_SendMes[0xC] = "N_SendMes";
char scT_TouchLetter[0x10] = "T_TouchLetter";
char scN_SendMes2[0xC] = "N_SendMes";
char scN_txt_scrl[0xC] = "N_txt_scrl";
char scN_MemoRoot[0xC] = "N_MemoRoot";
char scT_SendMes[0xA] = "T_SendMes";
static const wchar_t* scEmptyPane = L"\0\0";
void InputForm::create(MEMAllocator* allocator, textinput::inputform::EditBuffer* editBuffer) {
memo::InputForm::create(allocator, editBuffer);
MEMFreeToAllocator(allocator, mpInputEventHandler);
@@ -99,6 +113,7 @@ void InputForm::create(MEMAllocator* allocator, textinput::inputform::EditBuffer
mpInputEventHandler->setEventObserver(mpEventObserver);
mpPaneManager->changeEventHandler(mpInputEventHandler);
(void)&groupN_Pic;
for (u16 i = 0; i < 4; i++) {
const PaneToAnimationGroup* group = &animationGroups[i];
AnmPane* pane = NULL;
@@ -115,10 +130,10 @@ void InputForm::create(MEMAllocator* allocator, textinput::inputform::EditBuffer
nw4r::ut::List_Append(&mAnmPanes, pane);
for (u16 j = 0; j < group->count; j++) {
void* resource = mpMultiArcResourceAccessor->GetResource(0, group->animations[j]->fileName);
void* resource = mpMultiArcResourceAccessor->GetResource(0, group->animations[j]->mFileName);
AnimTransformPane* transform = static_cast<AnimTransformPane*>(
getLayout()->CreateAnimTransform(resource, mpMultiArcResourceAccessor));
pane->addAnimation(allocator, group->animations[j]->id, transform, false, true);
pane->addAnimation(allocator, group->animations[j]->mAnimationNo, transform, false, true);
}
}
@@ -143,14 +158,14 @@ void InputForm::drawBody() {
}
if (!mbEdited) {
getPane("T_TouchLetter")->Draw(mDrawInfo);
getPane(scT_TouchLetter)->Draw(mDrawInfo);
}
getPane("SendPic")->Draw(mDrawInfo);
getPane("N_SendMes")->Draw(mDrawInfo);
getPane(scN_SendMes2)->Draw(mDrawInfo);
nw4r::lyt::Pane* scrollPane = getPane("N_txt_scrl");
nw4r::lyt::Pane* scrollPane = getPane(scN_txt_scrl);
f32 x = scrollPane->GetTranslate().x;
getPane("N_txt_scrl")->SetTranslate(nw4r::math::VEC2(x, -6.0f));
getPane(scN_txt_scrl)->SetTranslate(nw4r::math::VEC2(x, -6.0f));
}
void InputForm::drawFooter() {
@@ -193,13 +208,13 @@ void InputForm::open() {
memo::InputForm::open();
switch (meType) {
case T_MailAddressSel:
searchAnmPane("N_MemoRoot")->changeAnimation(6);
searchAnmPane(scN_MemoRoot)->changeAnimation(6);
break;
case T_Address:
case T_Picture:
case T_Reply:
default:
searchAnmPane("N_MemoRoot")->changeAnimation(4);
searchAnmPane(scN_MemoRoot)->changeAnimation(4);
break;
}
}
@@ -207,17 +222,17 @@ void InputForm::open() {
void InputForm::close() {
memo::InputForm::close();
if (mbCloseWithSend) {
searchAnmPane("N_MemoRoot")->changeAnimation(5);
searchAnmPane(scN_MemoRoot)->changeAnimation(5);
searchAnmPane("SendPic")->changeAnimation(5);
searchAnmPane("N_SendMes")->changeAnimation(5);
searchAnmPane(scN_SendMes2)->changeAnimation(5);
} else {
searchAnmPane("N_MemoRoot")->changeAnimation(7);
searchAnmPane(scN_MemoRoot)->changeAnimation(7);
searchAnmPane("SendPic")->changeAnimation(7);
}
}
bool InputForm::isWholePaneInAnimation() {
return searchAnmPane("N_MemoRoot")->isInAnimation();
return searchAnmPane(scN_MemoRoot)->isInAnimation();
}
void InputForm::resizePhotoPane(f32 width, f32 height) {
@@ -249,7 +264,7 @@ void InputForm::resizePhotoPane(f32 width, f32 height) {
void InputForm::setSendOutMessage(const wchar_t* sendOutMessage) {
nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(
mpLayout->GetRootPane()->FindPaneByName("T_SendMes", true))->SetString(sendOutMessage);
mpLayout->GetRootPane()->FindPaneByName(scT_SendMes, true))->SetString(sendOutMessage);
}
void EventHandler::onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) {
@@ -259,7 +274,7 @@ void EventHandler::onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input
nw4r::lyt::Pane* pane = paneComponent->getPane();
const char* paneName = pane->GetName();
if (paneName[0] == 'B') {
if (event == gui::GUIComponent::EVENT_TRIG && (input->trigger & 0x800) &&
if (event == gui::GUIComponent::EVENT_TRIG && (input->field_0x0C & 0x800) &&
util::strcmp("B_Pic", paneName)) {
static_cast<InputForm*>(mpMemoForm)->onPhotoTrig();
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,13 +4,13 @@
#include <new>
extern "C" const f32 lbl_81694D90;
extern "C" const f32 lbl_81694DA8;
extern "C" const f32 lbl_81694DAC;
extern "C" const f32 lbl_81694DB0;
extern "C" const f32 lbl_81694DB4;
extern "C" const f32 lbl_81694DBC;
extern "C" const double lbl_81694DC8;
extern "C" const f32 csfCandidate0;
extern "C" const f32 csfCandidate1;
extern "C" const f32 csfCandidate2;
extern "C" const f32 csfCandidate3;
extern "C" const f32 csfCandidate4;
extern "C" const f32 csfCandidate5;
extern "C" const double csdCandidate0;
extern "C" void _savegpr_24();
extern "C" void _restgpr_24();
extern "C" void GetFont__Q34nw4r3lyt8TextBoxCFv();
@@ -20,22 +20,25 @@ namespace textinput {
#pragma push
#pragma section const_type ".data"
extern "C" const char lbl_8165D2D0[15] = "T_prdc_Text_00";
extern "C" const char lbl_8165D2E0[17] = "P_prdc_scrl_Left";
extern "C" const char csTextPaneName[15] = "T_prdc_Text_00";
extern "C" const char csScrollLeftName[17] = "P_prdc_scrl_Left";
#pragma pop
#pragma push
#pragma section data_type ".sdata"
#pragma explicit_zero_data on
extern "C" const char* csCommonTextAnim = csTextPaneName;
extern "C" const char* csCommonScrollAnim = csScrollLeftName;
extern "C" wchar_t scEmptyWText[4] = {0, 0, 0, 0};
#pragma pop
#pragma push
#pragma section sconst_type ".sdata"
extern "C" const char* lbl_816973C0 = lbl_8165D2D0;
extern "C" const char* lbl_816973C4 = lbl_8165D2E0;
extern "C" const wchar_t lbl_816973C8[4] = {0, 0, 0, 1};
extern "C" const char lbl_816973D0[8] = "P_OnBtn";
extern "C" const char lbl_816973D8[8] = "B_OnBtn";
extern "C" const char csOnBtnPaneName[8] = "P_OnBtn";
extern "C" const char csOnBoundName[8] = "B_OnBtn";
#pragma pop
#define COMMON_TEXT_ANIM lbl_816973C0
#define COMMON_SCROLL_ANIM lbl_816973C4
#define COMMON_TEXT_ANIM csCommonTextAnim
#define COMMON_SCROLL_ANIM csCommonScrollAnim
// name made up, no dwarf (?)
struct AnimationFile {
@@ -76,7 +79,7 @@ namespace textinput {
char tail[12];
};
extern "C" const CandidatePaneData lbl_8165D2F8 __attribute__((aligned(8))) = {{
extern "C" const CandidatePaneData csCandidatePaneData __attribute__((aligned(8))) = {{
{KT_CandidateText, "N_predictInput", 1, NULL, {&csAninationFile[0]}},
{KT_ScrollButton,
"P_prdc_scrl_Left",
@@ -211,20 +214,19 @@ namespace textinput {
#pragma push
#pragma section const_type ".data"
extern "C" const char lbl_8165D984[132] =
"B_OffBtn\0\0\0"
"P_JPOffBtn\0"
"P_CNOffBtn\0"
"P_CNOnBtn\0\0"
"B_prdc_scrl_Left\0\0\0"
"P_prdc_scrl_Left\0\0\0"
"B_prdc_scrl_Rght\0\0\0"
"P_prdc_scrl_Rght\0\0\0"
"\0\0\0";
extern "C" char lbl_8165DA08[16] = "W_predictWindow";
extern "C" const char lbl_8165DA18[15] = "N_predictInput";
extern "C" const char lbl_8165DA28[13] = "W_OnOff_Area";
extern "C" const char lbl_8165DA38[13] = "N_prdc_Texts";
extern "C" const char csOffBtnPaneName[132] =
"B_OffBtn\0\0\0\0"
"P_JPOffBtn\0\0"
"P_CNOffBtn\0\0"
"P_CNOnBtn\0\0\0"
"B_prdc_scrl_Left\0\0\0\0"
"P_prdc_scrl_Left\0\0\0\0"
"B_prdc_scrl_Rght\0\0\0\0"
"P_prdc_scrl_Rght\0\0\0\0";
extern "C" char csPredictWindowName[16] = "W_predictWindow";
extern "C" const char csPredictScrllName[15] = "N_predictInput";
extern "C" const char csPredictTextName[13] = "W_OnOff_Area";
extern "C" const char csPredictIconName[13] = "N_prdc_Texts";
#pragma pop
void CandidateBoxCaller::Candidates::addCandidate(const wchar_t* wcString) {
@@ -397,19 +399,19 @@ namespace textinput {
mTextArea.Init();
mOnOffButton.Create(this);
mOnOffButton.Init();
const char* paneNames = lbl_8165D984;
const char* paneNames = csOffBtnPaneName;
mLeftScroll.Create(this, paneNames + 68, paneNames + 48);
mRightScroll.Create(this, paneNames + 108, paneNames + 88);
mLeftScroll.Init();
mRightScroll.Init();
mTextWindow.Create(this, lbl_8165DA08);
mTextWindow.Create(this, csPredictWindowName);
init();
}
void LayoutByNW4R::createAnmPane_(MEMAllocator* allocator) {
for (u16 i = 0; i < ARRAY_LENGTH(lbl_8165D2F8.panes); i++) {
for (u16 i = 0; i < ARRAY_LENGTH(csCandidatePaneData.panes); i++) {
CandidateTextAnmPane* pane = NULL;
const PaneToAnimation& p = lbl_8165D2F8.panes[i];
const PaneToAnimation& p = csCandidatePaneData.panes[i];
switch (p.type) {
case KT_ScrollButton: {
void* pBtnBuf = MEMAllocFromAllocator(allocator, sizeof(CandidateScrollAnmPane));
@@ -452,7 +454,7 @@ namespace textinput {
}
void LayoutByNW4R::init() {
searchAnmPane(lbl_8165DA18)->changeAnimation(ANM_Normal);
searchAnmPane(csPredictScrllName)->changeAnimation(ANM_Normal);
Base::setInvalid(false);
setActive(true);
setOnOff(false);
@@ -465,7 +467,7 @@ namespace textinput {
mpLayout->CalculateMtx(mDrawInfo);
if (meLanguage == KR) {
mTextWindow.SetVisible(false);
getPane(lbl_8165DA28)->SetVisible(false);
getPane(csPredictTextName)->SetVisible(false);
} else if (meLanguage == CN) {
setOnOff(true);
mTextWindow.SetVisible(true);
@@ -475,16 +477,16 @@ namespace textinput {
} else {
mTextWindow.ChangeAnimation(ANM_Normal);
}
getPane(lbl_8165DA28)->SetVisible(false);
getPane(csPredictTextName)->SetVisible(false);
} else {
getPane(lbl_8165DA28)->SetVisible(true);
getPane(csPredictTextName)->SetVisible(true);
}
}
void LayoutByNW4R::draw() {
getPane(lbl_8165DA38)->SetVisible(false);
getPane(csPredictIconName)->SetVisible(false);
nw4rmanager::Layout::draw();
getPane(lbl_8165DA38)->SetVisible(true);
getPane(csPredictIconName)->SetVisible(true);
if (!isInvalid()) {
mTextArea.Draw(mDrawInfo);
}
@@ -494,8 +496,8 @@ namespace textinput {
nw4rmanager::Layout::calc();
mTextArea.Calc();
if (mbAnimOn) {
getPane(lbl_8165DA38)->Animate(0);
getPane(lbl_8165DA38)->CalculateMtx(mDrawInfo);
getPane(csPredictIconName)->Animate(0);
getPane(csPredictIconName)->CalculateMtx(mDrawInfo);
}
}
@@ -503,7 +505,7 @@ namespace textinput {
Base::setLanguage(language);
init();
// Maybe inlines, maybe not
nw4r::math::VEC3 pos = searchAnmPane(lbl_8165DA08)->getPane()->GetTranslate();
nw4r::math::VEC3 pos = searchAnmPane(csPredictWindowName)->getPane()->GetTranslate();
if (meLanguage == CN || meLanguage == KR) {
Base::checkValidation();
// Potentially an inline
@@ -518,7 +520,7 @@ namespace textinput {
pos.x = 202.0f;
}
searchAnmPane(lbl_8165DA08)->getPane()->SetTranslate(pos);
searchAnmPane(csPredictWindowName)->getPane()->SetTranslate(pos);
if (meLanguage == CN) {
mTextArea.ApplyFontScale(1.2f);
} else if (meLanguage == KR) {
@@ -529,10 +531,10 @@ namespace textinput {
}
void LayoutByNW4R::onOnOffButton(bool arg) {
const char* base = lbl_8165D2D0;
const char* base = csTextPaneName;
mTextWindow.TurnOnOff(!isOn());
if (isOn()) {
searchAnmPane(lbl_816973D0)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
searchAnmPane(csOnBtnPaneName)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
if (arg) {
mpEventObserver->onSE(sound::SE_PREDICT_OFF);
}
@@ -586,7 +588,7 @@ namespace textinput {
}
void LayoutByNW4R::startTurnOn(bool on) {
const char* base = lbl_8165D2D0;
const char* base = csTextPaneName;
if (isInScroll()) {
return;
}
@@ -594,7 +596,7 @@ namespace textinput {
mTextWindow.TurnOnOff(on);
if (!on) {
searchAnmPane(lbl_816973D0)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
searchAnmPane(csOnBtnPaneName)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
mpEventObserver->onSE(sound::SE_PREDICT_OFF);
} else {
searchAnmPane(base + 0x6a8)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
@@ -635,7 +637,7 @@ namespace textinput {
current = reinterpret_cast<CandidateBoxCaller::Candidates*>(reinterpret_cast<u8*>(current) + sizeof(current->szwcPredicted[0]));
}
}
gui::PaneComponent* p = mpPaneManager->searchPaneComponent(isOn() ? lbl_816973D8 : lbl_8165D984);
gui::PaneComponent* p = mpPaneManager->searchPaneComponent(isOn() ? csOnBoundName : csOffBtnPaneName);
if (p != NULL) {
p->lockInitialize(true);
}
@@ -704,8 +706,8 @@ namespace textinput {
}
void LayoutByNW4R::cancelStateFocusIn() {
const PaneToAnimation* pane = lbl_8165D2F8.panes;
for (int i = 0; i < ARRAY_LENGTH(lbl_8165D2F8.panes); i++) {
const PaneToAnimation* pane = csCandidatePaneData.panes;
for (int i = 0; i < ARRAY_LENGTH(csCandidatePaneData.panes); i++) {
CandidateTextAnmPane* p = static_cast<CandidateTextAnmPane*>(searchAnmPane(pane->paneName));
if (p != NULL) {
switch (p->getKeyType()) {
@@ -758,12 +760,12 @@ namespace textinput {
mbActive = active;
if (meLanguage == CN || meLanguage == KR) {
mpManager->getPCKeyboard()->setLangKeyActive(active);
mpManager->getCellPhoneKeyboard()->vt_0x68(active);
mpManager->getCellPhoneKeyboard()->setLangKeyActive(active);
}
}
void LayoutByNW4R::onEvent(UIObj* obj, u32 id, void* data) {
const char* base = lbl_8165D2D0;
const char* base = csTextPaneName;
int tmp;
switch (id) {
@@ -994,7 +996,7 @@ namespace textinput {
void UITextArea::Create(nw4rmanager::Layout* layout) {
// These could have been static...
const char* textPanes[NUM_PANES] = {
lbl_8165D2D0, "T_prdc_Text_01", "T_prdc_Text_02", "T_prdc_Text_03", "T_prdc_Text_04", "T_prdc_Text_05", "T_prdc_Text_06",
csTextPaneName, "T_prdc_Text_01", "T_prdc_Text_02", "T_prdc_Text_03", "T_prdc_Text_04", "T_prdc_Text_05", "T_prdc_Text_06",
"T_prdc_Text_07", "T_prdc_Text_08", "T_prdc_Text_09", "T_prdc_Text_10", "T_prdc_Text_11", "T_prdc_Text_12", "T_prdc_Text_13",
"T_prdc_Text_14", "T_prdc_Text_15", "T_prdc_Text_16", "T_prdc_Text_17", "T_prdc_Text_18", "T_prdc_Text_19",
};
@@ -1013,7 +1015,7 @@ namespace textinput {
mpBoundingPane[i]->setListener(this);
}
mpTextAreaPane = mgr->searchPaneComponent("N_prdcTextArea");
mpTextsPane = mgr->searchPaneComponent(lbl_8165DA38);
mpTextsPane = mgr->searchPaneComponent(csPredictIconName);
mSize = mpTextBoxPane[0]->getTextPane()->GetFontSize();
mpTextAreaPane->setListener(this);
}
@@ -1021,7 +1023,7 @@ namespace textinput {
void UITextArea::Init() {
for (u32 i = 0; i < NUM_PANES; i++) {
mpTextBoxPane[i]->getTextPane()->SetString(const_cast<const wchar_t*>(lbl_816973C8), 0);
mpTextBoxPane[i]->getTextPane()->SetString(scEmptyWText, 0);
mpBoundingPane[i]->setTriggerTarget(true);
}
mfTextWidth = 0.0f;
@@ -1083,7 +1085,7 @@ namespace textinput {
nw4r::lyt::TextBox* textPane = mpTextBoxPane[i]->getTextPane();
nw4r::lyt::Bounding* boundPane = mpBoundingPane[i]->getBoundPane();
nw4r::lyt::Size sz1 = textPane->GetSize();
textPane->SetString(L"");
textPane->SetString(scEmptyWText);
textPane->SetVisible(false);
boundPane->SetSize(nw4r::lyt::Size(0.0f, sz1.height));
}
@@ -1206,7 +1208,7 @@ namespace textinput {
void UITextArea::Clear() {
for (u32 i = 0; i < NUM_PANES; i++) {
mpTextBoxPane[i]->getTextPane()->SetString(const_cast<const wchar_t*>(lbl_816973C8), 0);
mpTextBoxPane[i]->getTextPane()->SetString(scEmptyWText, 0);
}
}
@@ -1249,14 +1251,18 @@ namespace textinput {
struct {
f32 left;
f32 top;
f32 width;
f32 height;
f32 x;
f32 y;
} scissor;
nw4r::ut::Rect r = mpTextAreaPane->getPane()->GetPaneRect(drawInfo);
// TODO - These vectors are zero-initialized using GPRs first...
Vec v1 = {0, 0, 0};
Vec v2 = {0, 0, 0};
v1.x = r.left;
v1.y = r.top;
Vec v2 = {0, 0, 0};
v2.x = r.right;
v2.y = r.bottom;
MTXMultVec(mpTextAreaPane->getTextPane()->GetGlobalMtx(), &v1, &v1);
@@ -1307,27 +1313,27 @@ namespace textinput {
psq_st f23, 0x38(r1), 0, 0
addi r11, r1, 0x30
bl _savegpr_24
lfs f0, lbl_81694DA8(r2)
lfs f0, csfCandidate1(r2)
mr r24, r3
lfs f1, 0x1fc(r3)
mr r25, r4
lwz r5, 0xd8(r3)
fdivs f25, f0, f1
lfs f0, lbl_81694DB4(r2)
lfs f0, csfCandidate4(r2)
lwz r5, 0x9c(r5)
lwz r3, 0x38(r3)
lfs f31, 0x4c(r5)
lwz r27, 0x9c(r3)
fcmpo cr0, f1, f0
ble GetNextPageIdx_L1
lfs f28, lbl_81694DAC(r2)
lfs f28, csfCandidate2(r2)
b GetNextPageIdx_L2
GetNextPageIdx_L1:
lfs f28, lbl_81694DB0(r2)
lfs f28, csfCandidate3(r2)
GetNextPageIdx_L2:
fneg f23, f28
lfd f29, lbl_81694DC8(r2)
lfs f30, lbl_81694DBC(r2)
lfd f29, csdCandidate0(r2)
lfs f30, csfCandidate5(r2)
mr r26, r25
slwi r28, r4, 7
lis r31, 0x4330
@@ -1343,7 +1349,7 @@ namespace textinput {
add r0, r0, r28
addic. r30, r0, 4
bne GetNextPageIdx_L7
lfs f0, lbl_81694D90(r2)
lfs f0, csfCandidate0(r2)
b GetNextPageIdx_L8
GetNextPageIdx_L7:
mr r3, r27
@@ -1351,7 +1357,7 @@ namespace textinput {
lfs f26, 0xe4(r27)
mr r29, r3
lfs f24, 0xf0(r27)
lfs f27, lbl_81694D90(r2)
lfs f27, csfCandidate0(r2)
b GetNextPageIdx_L9
GetNextPageIdx_L10:
lwz r12, 0(r29)
@@ -1620,7 +1626,7 @@ namespace textinput {
if (mgr()->isInScroll() && event != 1 && event != 0) {
return;
}
if (!mgr()->searchAnmPane(lbl_8165DA08)->isInAnimation() || event == 1) {
if (!mgr()->searchAnmPane(csPredictWindowName)->isInAnimation() || event == 1) {
if (!mgr()->isInvalid()) {
switch (event) {
case 4:
@@ -1772,7 +1778,7 @@ namespace textinput {
if (mgr()->isInScroll() && event != 1 && event != 0) {
return;
}
if (!mgr()->searchAnmPane(lbl_8165DA08)->isInAnimation() || event == 1) {
if (!mgr()->searchAnmPane(csPredictWindowName)->isInAnimation() || event == 1) {
if (!mgr()->isInvalid()) {
switch (event) {
case 4:
@@ -1808,6 +1814,10 @@ namespace textinput {
}
}
u16 gui::GUIComponent::getFlightDuration(int point) {
return mFlightDuration[point];
}
UIOnOffButton::UIOnOffButton(u32 id, LayoutByNW4R* layout, UIObj::Listener* listener)
: UIObj(id, layout, listener), mpOnPictPane(NULL), mpOnBoundPane(NULL), mpOffPictPane(NULL), mpOffBoundPane(NULL), mpOnAnmPane(NULL),
mpOffAnmPane(NULL) {
@@ -1815,18 +1825,18 @@ namespace textinput {
void UIOnOffButton::Create(nw4rmanager::Layout* layout) {
gui::PaneManager* mgr = layout->getPaneManager();
mpOnPictPane = mgr->searchPaneComponent("P_OnBtn");
mpOnBoundPane = mgr->searchPaneComponent("B_OnBtn");
mpOnAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane("P_OnBtn"));
mpOffPictPane = mgr->searchPaneComponent(lbl_8165D2F8.tail);
mpOffBoundPane = mgr->searchPaneComponent(lbl_8165D984);
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(lbl_8165D2F8.tail));
mpOnPictPane = mgr->searchPaneComponent(csOnBtnPaneName);
mpOnBoundPane = mgr->searchPaneComponent(csOnBoundName);
mpOnAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(csOnBtnPaneName));
mpOffPictPane = mgr->searchPaneComponent(csCandidatePaneData.tail);
mpOffBoundPane = mgr->searchPaneComponent(csOffBtnPaneName);
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(csCandidatePaneData.tail));
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D2F8.tail)->GetMaterial()->GetTexture(&mOffTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D984 + 12)->GetMaterial()->GetTexture(&mOffTexJP, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D984 + 24)->GetMaterial()->GetTexture(&mOffTexCN, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_816973D0)->GetMaterial()->GetTexture(&mOnTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D984 + 36)->GetMaterial()->GetTexture(&mOnTexCN, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(csCandidatePaneData.tail)->GetMaterial()->GetTexture(&mOffTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(csOffBtnPaneName + 12)->GetMaterial()->GetTexture(&mOffTexJP, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(csOffBtnPaneName + 24)->GetMaterial()->GetTexture(&mOffTexCN, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(csOnBtnPaneName)->GetMaterial()->GetTexture(&mOnTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(csOffBtnPaneName + 36)->GetMaterial()->GetTexture(&mOnTexCN, 0);
mpOffBoundPane->setListener(this);
mpOnBoundPane->setListener(this);
@@ -1883,7 +1893,7 @@ namespace textinput {
if (mgr()->isInScroll() && event != 1 && event != 0) {
return;
}
if (!mgr()->searchAnmPane(lbl_8165DA08)->isInAnimation() || event == 1) {
if (!mgr()->searchAnmPane(csPredictWindowName)->isInAnimation() || event == 1) {
OnOffAnmPane* p;
if (&component == mpOnBoundPane) {
p = mpOnAnmPane;

File diff suppressed because it is too large Load Diff

View File

@@ -88,6 +88,20 @@ namespace textinput {
return event;
}
bool GUIComponent::isVisible() { return true; }
bool GUIComponent::isPointed(int point) { return mbPointed[point]; }
void GUIComponent::onMove(int point, f32 x, f32 y) { mFlightDuration[point]++; }
void GUIComponent::setPointed(int point, bool bEnable) { mbPointed[point] = bEnable; }
void GUIComponent::onPointIn(int point) { mFlightDuration[point] = 0; }
void GUIComponent::onPointOut(int point) { mFlightDuration[point] = 0; }
void GUIComponent::onDrag(f32 x, f32 y) {}
GUIManager::~GUIManager() {
IDToComponent* p = static_cast<IDToComponent*>(nw4r::ut::List_GetFirst(&mComponents));
while (p != NULL) {
@@ -125,6 +139,8 @@ namespace textinput {
}
}
u32 GUIComponent::getID() { return mID; }
GUIComponent* GUIManager::getComponent(u32 id) {
IDToComponent* p = static_cast<IDToComponent*>(nw4r::ut::List_GetNth(&mComponents, (u16)id));
return p->mpComponent;
@@ -192,6 +208,29 @@ namespace textinput {
return touched;
}
u32 GUIComponent::updatePointer(int point, f32 x, f32 y, u32 trig, u32 hold, u32 release) {
GUIPointer pointer(point, x, y, hold, trig, release);
return updatePointerImpl(pointer);
}
void GUIManager::onEvent(GUIComponent& comp, u32 event, int point, void* data) {
if (mpEventHandler) {
mpEventHandler->setLatestEventCtrlNo(point);
mpEventHandler->onEvent(comp, event, data);
}
comp.onEvent(event, data);
}
bool GUIComponent::isTriggerTarget() { return mbTriggerTarget; }
void GUIComponent::onTrig(int point, u32 trig, Vec& dragPos) {
if (trig & mDraggingButton) {
mDraggingPos[point] = dragPos;
mbDragging[point] = true;
mFlightDuration[point] = 0;
}
}
void GUIManager::calc() {
for (IDToComponent* p = static_cast<IDToComponent*>(nw4r::ut::List_GetFirst(&mComponents)); p != NULL;
p = static_cast<IDToComponent*>(nw4r::ut::List_GetNext(&mComponents, p))) {
@@ -220,6 +259,8 @@ namespace textinput {
}
}
void GUIComponent::setDraggingButton(u32 dragBtn) { mDraggingButton = dragBtn; }
PaneManager::~PaneManager() {
PaneToComponent* p = static_cast<PaneToComponent*>(nw4r::ut::List_GetFirst(&mPaneComponents));
while (p) {
@@ -243,6 +284,8 @@ namespace textinput {
PaneComponent::~PaneComponent() {}
GUIComponent::~GUIComponent() {}
void PaneManager::createLayoutScene(const nw4r::lyt::Layout& layout) {
mIDCounter = 0;
walkInChildren(layout.GetRootPane()->GetChildList());
@@ -288,6 +331,8 @@ namespace textinput {
addComponent(pComponent);
}
void PaneComponent::setPane(nw4r::lyt::Pane* pane) { mpPane = pane; }
PaneComponent* PaneManager::searchPaneComponent(const char* name) {
for (u32 i = 0; i < nw4r::ut::List_GetSize(&mPaneComponents); i++) {
PaneToComponent* p = static_cast<PaneToComponent*>(nw4r::ut::List_GetNth(&mPaneComponents, (u16)i));
@@ -354,6 +399,8 @@ namespace textinput {
extern "C" const u8 lbl_81694EEE = 0x00;
extern "C" const u8 lbl_81694EEF = 0xFF;
extern "C" const f32 lbl_81694EF0 = 0.5f;
const nw4r::lyt::DrawInfo* PaneManager::getDrawInfo() { return mpDrawInfo; }
#pragma pop
extern "C" asm void draw__Q39textinput3gui13PaneComponentFv() {
@@ -489,5 +536,13 @@ namespace textinput {
}
return true;
}
u32 GUIComponent::updatePointer(const GUIPointer& pointer) { return updatePointerImpl(pointer); }
void GUIManager::setEventHandler(EventHandler* eventHandler) {
mpEventHandler = eventHandler;
}
bool GUIManager::update(int point, const KPADStatus* kpad, f32, f32, void* data) { return false; }
} // namespace gui
} // namespace textinput

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,45 @@
#define TIHWKEYBOARD_IMPLEMENTATION
#include "keyboard/tiHwKeyboard.h"
#include "keyboard/tiManager.h"
#include "keyboard/tiHKBManager.h"
#include "keyboard/tiLayoutGather.h"
extern const u8 lbl_81616BD8[] = {0x0f, 0x21, 0x20, 0x08, 0x09, 0x0e, 0x19, 0x00, 0x21, 0x21, 0x00, 0x00};
extern const u8 lbl_81616BE4[] = {0x0f, 0x21, 0x20, 0x04, 0x09, 0x0e, 0x11, 0x00, 0x21, 0x21, 0x00, 0x00};
extern "C" const u8 scHwScrlKeyMap[];
extern "C" const u8 csAninationFile[];
struct HWKeyboardScrlData {
u32 field_0x00;
u32 field_0x04;
const u8* field_0x08;
u32 field_0x0c;
const u8* field_0x10;
u32 field_0x14[11];
};
extern const HWKeyboardScrlData scHwScrlData = {
0, 0, scHwScrlKeyMap, 1, csAninationFile + 0x154, {0},
};
extern const u32 scHwSendPacket[4] = {0, 0, 0x01000000, 0};
extern const u8 scHwInitSeq0[] = {0x0f, 0x21, 0x20, 0x08, 0x09, 0x0e, 0x19, 0x00, 0x21, 0x21, 0x00, 0x00};
extern const u8 scHwInitSeq1[] = {0x0f, 0x21, 0x20, 0x04, 0x09, 0x0e, 0x11, 0x00, 0x21, 0x21, 0x00, 0x00};
const u8 scKeyMap[136] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x01, 0x0a, 0x03, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x19, 0x1a, 0x1b, 0x13, 0x15, 0x17, 0x14, 0x16, 0x18, 0x00,
0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x05, 0x07, 0x0b, 0x06, 0x05, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
extern const u32 scKeyRepeatData[2];
extern const u32 scTriggerData[1];
#pragma push
#pragma section data_type ".sdata" ".sdata"
u8 sbShiftInit = 0;
u8 sbShiftOn = 1;
u8 sbShiftOff = 0;
#pragma pop
extern "C" void SetCountry__Q39textinput5input10HKBManagerFUc();
extern "C" textinput::input::HKBManager sInstance__Q39textinput5input10HKBManager;
extern "C" void convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw();
@@ -21,7 +54,7 @@ extern "C" void updateFromReceiver__Q29textinput13CommandSenderFUlPv();
#pragma push
#pragma section const_type ".data"
typedef void (*KeyboardDataFunction)();
extern "C" KeyboardDataFunction const jumptable_81668EF8[0x3f] = {
extern "C" KeyboardDataFunction const scHwKeyFuncTable[0x3f] = {
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000158),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001d8),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
@@ -104,11 +137,245 @@ namespace textinput {
namespace keyboard {
namespace hwkey {
struct Packet {
u16 code;
u16 unk_02;
u32 flags;
u32 unk_08;
u32 unk_0C;
};
extern "C" void GetTriggeredKeySet__Q39textinput5input10HKBManagerCFv();
extern "C" void IsValid__Q49textinput5input10HKBManager6KeySetCFv();
extern "C" void GetKey__Q49textinput5input10HKBManager6KeySetCFv();
extern "C" void GetNext__Q49textinput5input10HKBManager6KeySetCFv();
extern "C" void GetModifierState__Q39textinput5input10HKBManagerCFv();
bool HWKeyboard::updateRepeatKey_(input::HKBManager& hkbManager) {
s32 mods = hkbManager.GetModifierState();
input::HKBManager::KeySet keySet(NULL, 0);
keySet = hkbManager.GetRepeatedKeySet();
if (!keySet.IsValid()) {
return false;
}
if (!mgr()->getToolBar()->isQwerty() && mgr()->getToolBar()->isEnableKeytopChange()) {
return true;
}
u32 shift = mods & 0x8;
while (keySet.IsValid()) {
u8 key = keySet.GetKey();
u32 v;
switch (key) {
case 0x4C:
sendCommand(2, NULL);
break;
case 0x2A:
sendCommand(1, NULL);
break;
case 0x4F: v = 0x20; goto send_arrow;
case 0x50: v = 0x1F; goto send_arrow;
case 0x51: v = 0x1E; goto send_arrow;
case 0x52: v = 0x1D;
send_arrow: {
u32 data[2] = {v, mods};
sendCommand(0x26, data);
break;
}
case 0x2C:
if ((mgr()->getToolBar()->isQwerty() != 0 ||
mgr()->getCellPhoneKeyboard()->isNumeric() == 0) && shift == 0) {
u32 data[2] = {const_cast<u32*>(scKeyRepeatData)[0], mods};
sendCommand(0x26, data);
}
break;
}
keySet = keySet.GetNext();
}
return false;
}
bool HWKeyboard::updateTriggerKey_(input::HKBManager& hkbManager) {
s32 mods = hkbManager.GetModifierState();
input::HKBManager::KeySet keySet(NULL, 0);
keySet = hkbManager.GetTriggeredKeySet();
if (!keySet.IsValid()) {
return false;
}
if (mgr()->getToolBar()->isQwerty() == 0 &&
mgr()->getToolBar()->isEnableKeytopChange() != 0) {
return true;
}
if (mgr()->getPCKeyboard()->isABC() == 0) {
if (mgr()->getToolBar()->isQwerty() != 0 && mgr()->getEventObserver() != 0) {
mgr()->getEventObserver()->onSE((sound::SE)0xD);
}
mgr()->getPCKeyboard()->setABC(true);
}
while (keySet.IsValid()) {
wchar_t wc = keySet.GetWChar();
u8 key = keySet.GetKey();
const u8* keyMap = scKeyMap;
if (wc == 0x20) {
if (!(mods & 0x8)) {
goto check_caps;
}
u32 data[2] = {const_cast<u32*>(scTriggerData)[0], mods};
sendCommand(0x26, data);
}
else if (wc != 0) {
bool send = true;
if (mgr()->getToolBar()->isQwerty() == 0 &&
mgr()->getCellPhoneKeyboard()->isNumeric() != 0) {
if ((int)wc == 0x2F) {
goto bad_wc;
}
else if ((int)wc < 0x2F) {
if ((int)wc >= 0x2E) {
goto dot_wc;
}
goto bad_wc;
}
else {
if ((int)wc >= 0x3A) {
goto bad_wc;
}
goto ok_wc;
}
dot_wc:
if (mgr()->getCellPhoneKeyboard()->isNumericWithDot() != 0) {
goto ok_wc;
}
bad_wc:
send = false;
ok_wc:;
}
if (send) {
mods = 0;
if (hkbManager.GetModifierState() & 0x2) {
mods |= 1;
}
if (hkbManager.GetModifierState() & 0x200) {
mods |= 2;
}
if (!(mods & 1)) {
pctype::LayoutByNW4R* pcKbd = mgr()->getPCKeyboard();
pcKbd->mKeyState.setABCFlag(pcKbd->mKeyState.mFlags & ~0x8F);
}
wc = convertWCCode(wc);
Packet packet = *(const Packet*)scHwSendPacket;
packet.code = wc;
packet.flags = mods;
sendCommand(0, &packet);
if (mgr()->getLanguage() == 8) {
u32 shifted = wc + 0x10000;
if ((u16)(shifted - 0x201C) <= 1) {
field_0x16 = !field_0x16;
}
else if ((u16)(shifted - 0x2018) <= 1) {
field_0x15 = !field_0x15;
}
}
}
}
else {
bool send = true;
int code;
if (key < 0x20) {
code = 0;
}
else if (key < 0x98) {
code = keyMap[key - 0x20];
}
else if (key < 0xE0) {
code = 0;
}
else if (key < 0xF0) {
code = keyMap[key - 0x68];
}
else {
code = 0;
}
if (code == 0x1C) {
u32 m = !(hkbManager.GetModifierState() & 0x100);
if (mgr()->getToolBar()->isQwerty() == 0 &&
mgr()->getCellPhoneKeyboard()->isNumeric() != 0) {
m = 1;
}
hkbManager.SetModifierState(m ? 0x100 : 0, 0x100);
}
if (mgr()->getToolBar()->isQwerty() == 0 &&
mgr()->getCellPhoneKeyboard()->isNumeric() != 0) {
if (code < 0x1D) {
if (code >= 0x17 || code < 0x15) {
goto bad_code;
}
}
else {
if (code >= 0x21) {
goto bad_code;
}
goto ok_code;
bad_code:
send = false;
}
ok_code:;
}
if (send) {
u32 data[2] = {code, mods};
sendCommand(0x26, data);
}
}
check_caps:
switch ((int)keySet.GetKey()) {
case 0x39:
if (mgr()->getToolBar()->isQwerty() != 0 ||
mgr()->getToolBar()->isEnableKeytopChange() != 0) {
mgr()->getPCKeyboard()->onPressedCaps();
}
break;
}
keySet = keySet.GetNext();
}
return false;
}
bool HWKeyboard::updateTappingShift_(input::HKBManager& hkbManager) {
hkbManager.GetModifierState();
input::HKBManager::KeySet keySet(NULL, 0);
keySet = hkbManager.GetTriggeredKeySet();
while (keySet.IsValid()) {
switch (keySet.GetKey()) {
case 0xE1:
case 0xE5:
field_0x14 = 1;
return false;
default:
field_0x14 = 0;
keySet = keySet.GetNext();
break;
}
}
if (field_0x14 == 0) {
return false;
}
keySet = hkbManager.GetReleasedKeySet();
while (keySet.IsValid()) {
switch (keySet.GetKey()) {
case 0xE1:
case 0xE5:
field_0x14 = 0;
if (mgr()->getToolBar()->isQwerty() != 0 &&
mgr()->getPCKeyboard()->mbLangKeyActive != 0) {
sendCommand(0x2E, NULL);
}
return false;
default:
keySet = keySet.GetNext();
break;
}
}
return false;
}
extern "C" bool updateRepeatKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" bool updateTriggerKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" bool updateTappingShift___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
@@ -248,354 +515,11 @@ namespace textinput {
blr
}
struct NavigationCommand { u32 command; u32 modifiers; };
struct KeyInputData {
wchar_t character;
u16 flags;
u32 modifier;
u8 direct;
u8 repeated;
u16 reserved;
u32 data;
};
extern const u8 controlKeys[];
bool HWKeyboard::updateRepeatKey_(input::HKBManager& hkbManager) {
u32 modifierState = hkbManager.GetModifierState();
input::HKBManager::KeySet currentKeySet;
currentKeySet = hkbManager.GetRepeatedKeySet();
if (!currentKeySet.IsValid()) {
return false;
}
if (!mgr()->getToolBar()->isQwerty()) {
if (mgr()->getToolBar()->isEnableKeytopChange()) {
return true;
}
}
u32 modifierFlag = modifierState & 0x8;
while (currentKeySet.IsValid()) {
int key = currentKeySet.GetKey();
u32 command;
if (key == 0x4c) {
goto sendCommand2;
}
if (key < 0x4c) {
if (key != 0x2b) {
if (key < 0x2b) {
if (key >= 0x2a) {
goto sendCommand1;
}
} else {
if (key >= 0x2d) {
goto nextRepeatedKey;
}
goto checkSpecialCommand;
}
}
goto nextRepeatedKey;
}
if (key == 0x51) {
goto setNavigationCommand1e;
}
if (key < 0x51) {
if (key == 0x4f) {
goto setNavigationCommand20;
} else if (key >= 0x4f) {
goto setNavigationCommand1f;
}
} else {
if (key >= 0x53) {
goto nextRepeatedKey;
}
goto setNavigationCommand1d;
}
goto nextRepeatedKey;
sendCommand2:
sendCommand(2, NULL);
goto nextRepeatedKey;
sendCommand1:
sendCommand(1, NULL);
goto nextRepeatedKey;
setNavigationCommand20:
command = 0x20;
goto sendNavigationCommand;
setNavigationCommand1f:
command = 0x1f;
goto sendNavigationCommand;
setNavigationCommand1e:
command = 0x1e;
goto sendNavigationCommand;
setNavigationCommand1d:
command = 0x1d;
sendNavigationCommand:
{
u32 commandData[2];
commandData[0] = command;
commandData[1] = modifierState;
sendCommand(0x26, commandData);
}
goto nextRepeatedKey;
checkSpecialCommand:
if (mgr()->getToolBar()->isQwerty() ||
!mgr()->getCellPhoneKeyboard()->isNumeric()) {
if (modifierFlag == 0) {
goto sendSpecialCommand;
}
}
goto nextRepeatedKey;
sendSpecialCommand:
{
NavigationCommand commandData = {8, modifierState};
sendCommand(0x26, &commandData);
}
nextRepeatedKey:
currentKeySet = currentKeySet.GetNext();
}
return false;
}
bool HWKeyboard::updateTriggerKey_(input::HKBManager& hkbManager) {
u32 modifierState = hkbManager.GetModifierState();
input::HKBManager::KeySet currentKeySet;
currentKeySet = hkbManager.GetTriggeredKeySet();
if (!currentKeySet.IsValid()) {
return false;
}
if (!mgr()->getToolBar()->isQwerty() &&
mgr()->getToolBar()->isEnableKeytopChange()) {
return true;
}
if (!mgr()->getPCKeyboard()->isABC()) {
if (mgr()->getToolBar()->isQwerty()) {
EventObserver* eventObserver = mgr()->getEventObserverForHardware();
if (eventObserver != NULL) {
eventObserver->onSE(sound::SE_KETAI_MODE_SWITCHING);
}
}
mgr()->getPCKeyboard()->setABC(true);
}
while (currentKeySet.IsValid()) {
u32 character = currentKeySet.GetWChar();
u8 key = currentKeySet.GetKey();
if (static_cast<wchar_t>(character) == 0x20) {
if ((modifierState & 0x8) != 0) {
NavigationCommand commandData = {8, modifierState};
sendCommand(0x26, &commandData);
}
} else if (static_cast<wchar_t>(character) != 0) {
bool sendCharacter = true;
if (!mgr()->getToolBar()->isQwerty() &&
mgr()->getCellPhoneKeyboard()->isNumeric()) {
if (static_cast<wchar_t>(character) == '/') {
goto suppressCharacter;
}
if (static_cast<wchar_t>(character) < '/') {
if (static_cast<wchar_t>(character) >= '.') {
goto checkNumericDot;
}
goto suppressCharacter;
}
if (static_cast<wchar_t>(character) >= ':') {
goto suppressCharacter;
}
goto sendCharacterCheck;
checkNumericDot:
if (mgr()->getCellPhoneKeyboard()->isNumericWithDot()) {
goto sendCharacterCheck;
}
suppressCharacter:
sendCharacter = false;
}
goto sendCharacterCheck;
sendCharacterCheck:
if (sendCharacter) {
modifierState = 0;
if ((hkbManager.GetModifierState() & 0x2) != 0) {
modifierState |= 1;
}
if ((hkbManager.GetModifierState() & 0x200) != 0) {
modifierState |= 2;
}
if ((modifierState & 1) == 0) {
keyboard::pctype::Base::KeyState& keyState = mgr()->getPCKeyboard()->hardwareKeyState();
keyState.setABCFlag(keyState.abcFlags & 0xffffff70);
}
character = convertWCCode(character);
KeyInputData keyInputData = {0, 0, 0, 1, 0, 0, 0};
keyInputData.character = character;
keyInputData.modifier = modifierState;
sendCommand(0, &keyInputData);
if (mgr()->getLanguage() == CN) {
if (static_cast<wchar_t>(character + (0x10000 - 0x201c)) <= 1) {
field_0x16 = !field_0x16;
} else if (static_cast<wchar_t>(character + (0x10000 - 0x2018)) <= 1) {
field_0x15 = !field_0x15;
}
}
}
} else {
bool sendKey = true;
int translatedKey;
if (key < 0x20) {
translatedKey = 0;
} else if (key < 0x98) {
translatedKey = controlKeys[key - 0x20];
} else if (key < 0xe0) {
translatedKey = 0;
} else if (key < 0xf0) {
translatedKey = controlKeys[key - 0x68];
} else {
translatedKey = 0;
}
if (translatedKey == 0x1c) {
bool capsLock = !(hkbManager.GetModifierState() & 0x100);
if (!mgr()->getToolBar()->isQwerty() &&
mgr()->getCellPhoneKeyboard()->isNumeric()) {
capsLock = true;
}
hkbManager.SetModifierState(capsLock ? 0x100 : 0, 0x100);
}
if (mgr()->getToolBar()->isQwerty() ||
!mgr()->getCellPhoneKeyboard()->isNumeric()) {
goto sendKeyCheck;
}
switch (translatedKey) {
case 0x15:
case 0x16:
case 0x1d:
case 0x1e:
case 0x1f:
case 0x20:
break;
default:
sendKey = false;
break;
}
sendKeyCheck:
if (sendKey) {
u32 commandData[2] = {translatedKey, modifierState};
sendCommand(0x26, commandData);
}
}
int capsKey = currentKeySet.GetKey();
switch (capsKey) {
case 0x39:
if (mgr()->getToolBar()->isQwerty() ||
mgr()->getToolBar()->isEnableKeytopChange()) {
mgr()->getPCKeyboard()->onPressedCaps();
}
break;
default:
break;
}
currentKeySet = currentKeySet.GetNext();
}
return false;
}
const u8 controlKeys[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x01, 0x0a, 0x03,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x04, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
0x2b, 0x2c, 0x19, 0x1a, 0x1b, 0x13, 0x15, 0x17, 0x14, 0x16, 0x18, 0x00,
0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0f, 0x0e,
0x00, 0x00, 0x00, 0x00,
0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x07, 0x0b,
0x06, 0x05, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
bool HWKeyboard::updateTappingShift_(input::HKBManager& hkbManager) {
hkbManager.GetModifierState();
input::HKBManager::KeySet currentKeySet;
input::HKBManager::KeySet triggeredKeySet;
input::HKBManager::KeySet releasedKeySet;
input::HKBManager::KeySet releasedNextKeySet;
triggeredKeySet = hkbManager.GetTriggeredKeySet();
currentKeySet = triggeredKeySet;
while (currentKeySet.IsValid()) {
int key = currentKeySet.GetKey();
switch (key) {
case 0xe5:
case 0xe1:
field_0x14 = 1;
return false;
default:
field_0x14 = 0;
currentKeySet = currentKeySet.GetNext();
break;
}
}
if (field_0x14 == 0) {
return false;
}
releasedKeySet = hkbManager.GetReleasedKeySet();
currentKeySet = releasedKeySet;
while (currentKeySet.IsValid()) {
int key = currentKeySet.GetKey();
switch (key) {
case 0xe5:
case 0xe1:
field_0x14 = 0;
if (mgr()->getToolBar()->isQwerty() &&
mgr()->getPCKeyboard()->hardwareLanguageKeyActive()) {
sendCommand(0x2e, NULL);
}
return false;
default:
currentKeySet = currentKeySet.GetNext();
break;
}
}
return false;
}
HWKeyboard::HWKeyboard(Manager* manager) : mpManager(manager), field_0x14(0), field_0x15(0), field_0x16(0) {
}
void HWKeyboard::init() {
LayoutGather::Singleton::getInstance().setHWPressedShift(false);
LayoutGather::Singleton::getInstance().setHWPressedShift(sbShiftInit);
u32 state = input::HKBManager::getInstance().GetModifierState();
input::HKBManager::getInstance().SetModifierState(state | 0x100, 0x700);
@@ -621,12 +545,12 @@ const u8 controlKeys[] = {
bool previousShift = gather.isHoldingShift();
if (state & 0x2) {
gather.setHWPressedShift(true);
gather.setHWPressedShift(sbShiftOn);
if (!previousShift) {
mgr()->getPCKeyboard()->onPressedShift(true);
}
} else {
gather.setHWPressedShift(false);
gather.setHWPressedShift(sbShiftOff);
if (previousShift) {
if (!gather.isHoldingShift()) {
mgr()->getPCKeyboard()->onReleasedShift();
@@ -639,16 +563,16 @@ const u8 controlKeys[] = {
nofralloc
cmpwi r4, 2
bne setLanguage_L1
lis r4, lbl_81616BD8@ha
lis r4, scHwInitSeq0@ha
lis r3, sInstance__Q39textinput5input10HKBManager@ha
addi r4, r4, lbl_81616BD8@l
addi r4, r4, scHwInitSeq0@l
lbzx r4, r4, r5
addi r3, r3, sInstance__Q39textinput5input10HKBManager@l
b SetCountry__Q39textinput5input10HKBManagerFUc
setLanguage_L1:
lis r4, lbl_81616BE4@ha
lis r4, scHwInitSeq1@ha
lis r3, sInstance__Q39textinput5input10HKBManager@ha
addi r4, r4, lbl_81616BE4@l
addi r4, r4, scHwInitSeq1@l
lbzx r4, r4, r5
addi r3, r3, sInstance__Q39textinput5input10HKBManager@l
b SetCountry__Q39textinput5input10HKBManagerFUc
@@ -735,9 +659,9 @@ const u8 controlKeys[] = {
addi r0, r31, -0x21
cmplwi r0, 0x3e
bgt convertWCCode_HWKeyboard_L1
lis r3, jumptable_81668EF8@ha
lis r3, scHwKeyFuncTable@ha
slwi r0, r0, 2
addi r3, r3, jumptable_81668EF8@l
addi r3, r3, scHwKeyFuncTable@l
lwzx r3, r3, r0
mtctr r3
bctr
@@ -819,3 +743,5 @@ const u8 controlKeys[] = {
} // namespace textinput
const u32 scKeyRepeatData[2] = {8, 0};
const u32 scTriggerData[1] = {8};

File diff suppressed because it is too large Load Diff

494
src/keyboard/tiKeyboard.cpp Normal file
View File

@@ -0,0 +1,494 @@
#define TI_PCTYPE_SAMPLE_CLASS
#define TI_CELLPHONE_SAMPLE_CLASS
#define TI_INPUTFORM_SAMPLE_CLASS
#define TI_CANDIDATEBOX_SAMPLE_CLASS
#define TI_TOOLBAR_SAMPLE_CLASS
#define TI_PREDICTLANG_SAMPLE_CLASS
#define TI_SIGNWINDOW_SAMPLE_CLASS
#include "keyboard/tiPcKeyboard.h"
#include "keyboard/tiCellPhone.h"
#include "keyboard/tiCandidateBox.h"
#include "keyboard/tiInputForm.h"
#include "keyboard/tiToolBar.h"
#include "keyboard/tiPredictLang.h"
#include "keyboard/tiSignWindow.h"
#include "keyboard/tiManager.h"
#include "keyboard/tiCandidateBox.h"
#include "keyboard/tiPredictLang.h"
#include "keyboard/tiSignWindow.h"
#include <revolution/gx.h>
#include <revolution/sc.h>
#include <new>
namespace textinput {
static EventObserver sDefaultObserver;
Manager::Manager(MEMAllocator* allocator, nw4r::lyt::MultiArcResourceAccessor* multiArc,
textinput::EventObserver* event)
: mpAllocator(allocator), mpMultiArcResourceAccessor(multiArc), mpEditBuffer(NULL), mpHWKeyboard(NULL),
mpPCKeyboard(NULL), mpCellPhoneKeyboard(NULL), mpInputForm(NULL), mpCandidateBox(NULL), mpToolBar(NULL),
mpPredictLanguageDialog(NULL), mpSignWindow(NULL), mpEventObserver(event),
meDestination(DST_JP), meLanguage(JP), mbAspectRatio4x3(true) {
if (event == NULL) {
mpEventObserver = &sDefaultObserver;
}
}
Manager::~Manager() {
if (mpPCKeyboard != NULL) {
mpPCKeyboard->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpPCKeyboard);
}
if (mpCellPhoneKeyboard != NULL) {
mpCellPhoneKeyboard->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpCellPhoneKeyboard);
}
if (mpInputForm != NULL) {
mpInputForm->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpInputForm);
}
if (mpCandidateBox != NULL) {
mpCandidateBox->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpCandidateBox);
}
if (mpToolBar != NULL) {
mpToolBar->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpToolBar);
}
if (mpPredictLanguageDialog != NULL) {
mpPredictLanguageDialog->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpPredictLanguageDialog);
}
if (mpSignWindow != NULL) {
mpSignWindow->~LayoutByNW4R();
MEMFreeToAllocator(mpAllocator, mpSignWindow);
}
if (mpHWKeyboard != NULL) {
mpHWKeyboard->~HWKeyboard();
MEMFreeToAllocator(mpAllocator, mpHWKeyboard);
}
if (mpEditBuffer != NULL) {
mpEditBuffer->~EditBuffer();
MEMFreeToAllocator(mpAllocator, mpEditBuffer);
}
}
keyboard::hwkey::HWKeyboard::~HWKeyboard() {}
void Manager::create(MEMAllocator* allocator) {
mpEditBuffer = createEditBuffer();
mpEditBuffer->inputform::EditBuffer::create(mpAllocator);
mpHWKeyboard = createHWKeyboard();
mpPCKeyboard = (keyboard::pctype::LayoutByNW4R*)createPCTypeKeyboard();
mpPCKeyboard->create(mpAllocator);
mpCellPhoneKeyboard = (keyboard::cellphonetype::LayoutByNW4R*)createCellPhoneTypeKeyboard();
mpCellPhoneKeyboard->create(mpAllocator);
mpInputForm = createInputForm();
mpInputForm->create(mpAllocator, mpEditBuffer);
mpCandidateBox = (candidatebox::LayoutByNW4R*)createCandidateBox();
mpCandidateBox->create(mpAllocator);
mpToolBar = (toolbar::LayoutByNW4R*)createToolBar();
mpToolBar->create(mpAllocator);
mpPredictLanguageDialog = (predictlang::LayoutByNW4R*)createPredictLanguageDialog();
mpPredictLanguageDialog->create(mpAllocator);
mpSignWindow = (keyboard::signwindow::LayoutByNW4R*)createSignWindow();
mpSignWindow->create(mpAllocator);
initAspect();
init();
}
void Manager::initAspect() {
if (SCGetAspectRatio() == SC_ASPECT_RATIO_16x9) {
setLayoutScaleFor16x9();
mbAspectRatio4x3 = false;
} else {
setLayoutScaleFor4x3();
mbAspectRatio4x3 = true;
}
}
void Manager::init() {
input::HKBManager::getInstance().ClearState();
mpInputForm->clearSender();
mpHWKeyboard->setCommandReceiver(mpInputForm);
mpPCKeyboard->setCommandReceiver(mpInputForm);
mpCellPhoneKeyboard->setCommandReceiver(mpInputForm);
mpCandidateBox->setCommandReceiver(mpInputForm);
mpPredictLanguageDialog->setCommandReceiver(mpInputForm);
mpSignWindow->setCommandReceiver(mpInputForm);
mpInputForm->setCandidateBox(mpCandidateBox);
mpPCKeyboard->setPredictLanguageDialog(mpPredictLanguageDialog);
mpPCKeyboard->setSignWindow(mpSignWindow);
mpCellPhoneKeyboard->setPredictLanguageDialog(mpPredictLanguageDialog);
mpCellPhoneKeyboard->setSignWindow(mpSignWindow);
if (mbAspectRatio4x3 == true) {
setLayoutScaleFor4x3();
} else {
setLayoutScaleFor16x9();
}
mpPredictLanguageDialog->setDestination(meDestination);
mpInputForm->setDestination(meDestination);
mpInputForm->setLanguage(meLanguage);
mpPCKeyboard->setLanguage(meLanguage);
mpCellPhoneKeyboard->setLanguage(meLanguage);
mpSignWindow->setLanguage(meLanguage);
mpCandidateBox->setLanguage(meLanguage);
mpToolBar->setLanguage(meLanguage);
mpPredictLanguageDialog->setLanguage(meLanguage);
mpHWKeyboard->setLanguage(meDestination, meLanguage);
mpHWKeyboard->init();
mpPCKeyboard->init();
mpCellPhoneKeyboard->init();
mpInputForm->init();
mpCandidateBox->init();
mpToolBar->init();
mpPredictLanguageDialog->init();
mpSignWindow->init();
setFixedPredictionJP(0, NULL);
setSecretInputMode(false);
}
void Manager::setFixedPredictionJP(int num, const char** predicts) {
static_cast<tistring::WithAtok*>(getInputForm()->getAtokString())->setFixPrediction(num, predicts);
}
void Manager::calc() {
if (mpToolBar->isQwerty()) {
mpPCKeyboard->calc();
} else {
mpCellPhoneKeyboard->calc();
}
mpToolBar->calc();
mpCandidateBox->calc();
mpInputForm->calc();
if (mpPredictLanguageDialog->isActive()) {
mpPredictLanguageDialog->calc();
}
if (mpSignWindow->isActive()) {
mpSignWindow->calc();
}
}
void Manager::draw() {
GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
mpToolBar->draw();
mpInputForm->draw();
if (mpToolBar->isQwerty()) {
mpPCKeyboard->draw();
} else {
mpCellPhoneKeyboard->draw();
}
mpCandidateBox->draw();
if (mpPredictLanguageDialog->isActive()) {
mpPredictLanguageDialog->draw();
}
if (mpSignWindow->isActive()) {
mpSignWindow->draw();
}
}
bool Manager::updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release) {
bool qwerty = mpToolBar->isQwerty();
nw4rmanager::TiEventHandler::Input input;
input.field_0x00 = chan;
input.mfX = x;
input.mfY = y;
input.field_0x0C = trig;
input.field_0x10 = hold;
input.field_0x14 = release;
mpHWKeyboard->keyboard::hwkey::HWKeyboard::updateInput(chan, x, y, trig, hold, release, &input);
if (mpPredictLanguageDialog->isActive()) {
return mpPredictLanguageDialog
->updateInput(chan, x, y, trig, hold, release, &input);
}
mpInputForm->updateInputCommon(chan, trig, hold, release, &input);
if (mpSignWindow->isActive()) {
return mpSignWindow
->updateInput(chan, x, y, trig, hold, release, &input);
}
bool updatedKeyboard;
if (qwerty) {
updatedKeyboard = mpPCKeyboard->updateInput(chan, x, y, trig, hold, release, &input);
} else {
updatedKeyboard = mpCellPhoneKeyboard->updateInput(chan, x, y, trig, hold, release, &input);
}
bool updatedToolBar =
mpToolBar->updateInput(chan, x, y, trig, hold, release, &input);
bool updatedCandBox =
mpCandidateBox->updateInput(chan, x, y, trig, hold, release, &input);
bool updatedInputForm = mpInputForm->updateInput(chan, x, y, trig, hold, release, &input);
bool result = (updatedKeyboard | updatedToolBar | updatedCandBox | updatedInputForm) != 0;
if (mpToolBar->isQwerty() != qwerty) {
getInputForm()->onCommand((CommandReceiver::INPUT_COMMAND)6, NULL);
mpCandidateBox->checkValidation();
if (mpToolBar->isQwerty()) {
mpPCKeyboard->onActive();
} else {
mpCellPhoneKeyboard->onActive();
}
}
return result;
}
bool Manager::updateInput(input::HKBManager& hkbManager) {
bool qwerty = mpToolBar->isQwerty();
if (mpPredictLanguageDialog->isActive()) {
return mpPredictLanguageDialog
->updateInput(hkbManager);
}
if (mpSignWindow->isActive()) {
return mpSignWindow->updateInput(hkbManager);
}
bool updatedKeyboard;
if (qwerty) {
updatedKeyboard = mpPCKeyboard->updateInput(hkbManager);
} else {
updatedKeyboard = mpCellPhoneKeyboard->updateInput(hkbManager);
}
bool updatedToolBar = mpToolBar->updateInput(hkbManager);
bool updatedCandBox = mpCandidateBox->updateInput(hkbManager);
bool updatedInputForm = mpInputForm->updateInput(hkbManager);
bool result = (updatedKeyboard | updatedToolBar | updatedCandBox | updatedInputForm) != 0;
if (mpToolBar->isQwerty() != qwerty) {
getInputForm()->onCommand((CommandReceiver::INPUT_COMMAND)6, NULL);
mpCandidateBox->checkValidation();
if (mpToolBar->isQwerty()) {
mpPCKeyboard->onActive();
} else {
mpCellPhoneKeyboard->onActive();
}
}
return result;
}
wchar_t* Manager::getWCString() const {
return mpInputForm->getWCString();
}
void Manager::setWCString(const wchar_t* string) {
mpInputForm->inputform::Base::setString(string);
}
void Manager::setLanguage(Language language) {
meLanguage = language;
}
void Manager::setDestination(Destination destination) {
meDestination = destination;
}
void Manager::limitStringLength(u32 limitStringLength) {
mpInputForm->limitStringLength(limitStringLength);
}
void Manager::limitRowNum(u32 limitRowNum) {
mpInputForm->limitRowNum(limitRowNum);
}
void Manager::setAnimationOn(bool flag) {
mpPCKeyboard->setAnimOn(flag);
mpCellPhoneKeyboard->setAnimOn(flag);
mpInputForm->setAnimOn(flag);
mpCandidateBox->setAnimOn(flag);
mpToolBar->setAnimOn(flag);
mpPredictLanguageDialog
->setAnimOn(flag);
mpSignWindow
->setAnimOn(flag);
}
void Manager::setAspectRatio(bool b4x3) {
mbAspectRatio4x3 = b4x3;
if (mbAspectRatio4x3 == true) {
setLayoutScaleFor4x3();
} else {
setLayoutScaleFor16x9();
}
}
void Manager::setTitleText(wchar_t* titleText) {
nw4r::lyt::Pane* pane = mpInputForm->getPane("T_title_text");
nw4r::lyt::TextBox* textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
if (textBox != NULL) {
textBox->SetString(titleText, 0);
}
}
void Manager::setLayoutScaleFor16x9() {
mpPCKeyboard->setRootPaneScaleFor16x9();
mpCellPhoneKeyboard->setRootPaneScaleFor16x9();
mpInputForm->setRootPaneScaleFor16x9();
mpCandidateBox->setRootPaneScaleFor16x9();
mpToolBar->setRootPaneScaleFor16x9();
mpPredictLanguageDialog
->setRootPaneScaleFor16x9();
mpSignWindow
->setRootPaneScaleFor16x9();
}
void Manager::setLayoutScaleFor4x3() {
mpPCKeyboard->setRootPaneScaleFor4x3();
mpCellPhoneKeyboard->setRootPaneScaleFor4x3();
mpInputForm->setRootPaneScaleFor4x3();
mpCandidateBox->setRootPaneScaleFor4x3();
mpToolBar->setRootPaneScaleFor4x3();
mpPredictLanguageDialog
->setRootPaneScaleFor4x3();
mpSignWindow
->setRootPaneScaleFor4x3();
}
inputform::EditBuffer* Manager::createEditBuffer() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(inputform::EditBuffer))) inputform::EditBuffer();
}
keyboard::hwkey::HWKeyboard* Manager::createHWKeyboard() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::hwkey::HWKeyboard))) keyboard::hwkey::HWKeyboard(this);
}
void* Manager::createPCTypeKeyboard() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::pctype::Sample))) keyboard::pctype::Sample(this, mpMultiArcResourceAccessor, "fs_VK_ascii_keytop_a.brlyt", mpEventObserver);
}
void* Manager::createCellPhoneTypeKeyboard() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::cellphonetype::Sample))) keyboard::cellphonetype::Sample(this, mpMultiArcResourceAccessor, "fs_VK_cellPhone_a.brlyt", mpEventObserver);
}
InputForm* Manager::createInputForm() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(inputform::Sample)))
inputform::Sample(this, mpMultiArcResourceAccessor, "fs_VK_textBox_a.brlyt", mpEventObserver, NULL);
}
void* Manager::createCandidateBox() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(candidatebox::Sample))) candidatebox::Sample(this, mpMultiArcResourceAccessor, "fs_VK_predictInput_a.brlyt", mpEventObserver);
}
void* Manager::createToolBar() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(toolbar::Sample))) toolbar::Sample(this, mpMultiArcResourceAccessor, "fs_VK_toolbar_a.brlyt", mpEventObserver);
}
void* Manager::createPredictLanguageDialog() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(predictlang::Sample))) predictlang::Sample(this, mpMultiArcResourceAccessor, "fs_prdicSelWidw_a.brlyt", mpEventObserver);
}
void* Manager::createSignWindow() {
return new (MEMAllocFromAllocator(mpAllocator, sizeof(keyboard::signwindow::Sample))) keyboard::signwindow::Sample(this, mpMultiArcResourceAccessor, "fs_signWindow_a.brlyt", mpEventObserver);
}
void Manager::startPredictTurnOn(bool flag) {
if (getInputForm()->isPredictOn() != flag) {
getCandidateBox()->startTurnOn(flag);
}
}
bool Manager::isPredictTurning() const {
return getCandidateBox()->getOnOffButton().IsTurning();
}
void Manager::enableCompatibleFilter(bool compatibleFilter) {
inputform::DeadKeyStream::sbCompatibleFilterEnabled = compatibleFilter;
}
void Manager::enableKSXFilter(bool flag) {
static_cast<tistring::Decolated*>(mpEditBuffer->getString())->EnableKSXFilter(flag);
static_cast<tistring::Decolated*>(mpEditBuffer->getZiString())->EnableKSXFilter(flag);
}
bool Manager::isVacancy() const {
if (getInputForm() == NULL || getToolBar() == NULL) {
return true;
}
if (!getToolBar()->isQwerty()) {
if (getCellPhoneKeyboard()->isHoldingButton()) {
return false;
}
}
return getInputForm()->inputform::Base::isVacancy();
}
const InputForm* Manager::getInputForm() const {
return mpInputForm;
}
const keyboard::cellphonetype::LayoutByNW4R* Manager::getCellPhoneKeyboard() const {
return mpCellPhoneKeyboard;
}
void Manager::SetFont(nw4r::lyt::FontRefLink* fontLink) {
nw4r::ut::Font* font = fontLink->GetFont();
if (mpToolBar != NULL) {
mpToolBar->SetFontForce(font);
}
if (mpPCKeyboard != NULL) {
mpPCKeyboard->SetFontForce(font);
}
if (mpCandidateBox != NULL) {
mpCandidateBox->SetFontForce(font);
}
if (mpSignWindow != NULL) {
mpSignWindow
->SetFontForce(font);
}
if (mpInputForm != NULL) {
((nw4r::ut::CharWriter*)((char*)mpInputForm + 0x10))->SetFont(*font);
}
if (mpCellPhoneKeyboard != NULL) {
mpCellPhoneKeyboard->SetFontForce(font);
}
}
void* Manager::getPredictLanguageSelectDialog() {
return mpPredictLanguageDialog;
}
const void* Manager::getPredictLanguageSelectDialog() const {
return mpPredictLanguageDialog;
}
void* Manager::getSignKeyboard() {
return mpSignWindow;
}
const void* Manager::getSignKeyboard() const {
return mpSignWindow;
}
void Manager::setDefaultPredictionJP(int num, const char** predicts) {
static_cast<tistring::WithAtok*>(getInputForm()->getAtokString())->setDefaultPrediction(num, predicts);
}
void predictlang::Base::init() {}
keyboard::pctype::Sample::~Sample() {}
keyboard::cellphonetype::Sample::~Sample() {}
candidatebox::Sample::~Sample() {}
inputform::Sample::~Sample() {}
keyboard::signwindow::Sample::~Sample() {}
} // namespace textinput

File diff suppressed because it is too large Load Diff

View File

@@ -490,7 +490,7 @@ void EventHandler::onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input
s32 eventType = event;
const char* name = paneComponent->getPane()->GetName();
if (!mpLayoutByNW4R->isLocked() || event != 4) {
if (event == 4 && (input->trigger & 0x800) != 0) {
if (event == 4 && (input->field_0x0C & 0x800) != 0) {
mpLayoutByNW4R->onKey(4, const_cast<char*>(name));
}
if (name[0] == 'B') {
@@ -502,7 +502,7 @@ void EventHandler::onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input
if (pane != NULL) {
switch (eventType) {
case 4:
if ((input->trigger & 0x800) != 0) {
if ((input->field_0x0C & 0x800) != 0) {
pane->onAnmEvent(nw4rmanager::AnmPane::PE_0);
}
break;

View File

@@ -1,6 +1,7 @@
#define TISTRING_IMPLEMENTATION
#include "keyboard/tiString.h"
#include "keyboard/tiUtil.h"
#include <revolution/kpr.h>
#include <wchar.h>
extern "C" {
@@ -144,12 +145,12 @@ wchar_t StringBase::getLastWChar() {
void Decolated::inputChar(wchar_t ch) {
if (ch != 0xfffe) {
wchar_t input[8];
u16 count;
input[4] = 0;
input[3] = 0;
input[2] = 0;
input[1] = 0;
input[0] = 0;
u16 count;
if (static_cast<u32>(mTranslateMode) - 1 > 1) {
goto nonKana;
}
@@ -172,15 +173,21 @@ void Decolated::inputChar(wchar_t ch) {
goto inputReady;
}
nonKana:
if (mTranslateMode == 3) {
input[0] = ch;
input[1] = 0;
count = 1;
if ((s32)mTranslateMode == 3) {
int i = 0;
input[i] = 0;
if (ch == 10) {
i = 0;
}
input[i++] = ch;
count = i;
input[i] = 0;
mKanaStream.mOutput[0] = 0;
} else {
count = 1;
input[0] = ch;
input[1] = 0;
count = 0;
input[count] = ch;
count++;
input[count] = 0;
}
inputReady:
setCandidate(0);
@@ -389,7 +396,7 @@ void Decolated::replaceAtCursor(wchar_t ch) {
}
bool Decolated::isDakuten() {
return util::KBD_IsDakuten(getWCharAtCursor());
return util::KBD_IsDakuten(getWCharAtCursor()) != 0;
}
void Decolated::converDakuten() {
@@ -398,7 +405,7 @@ void Decolated::converDakuten() {
}
bool Decolated::isHandaku() {
return util::KBD_IsHandaku(getWCharAtCursor());
return util::KBD_IsHandaku(getWCharAtCursor()) != 0;
}
void Decolated::converHandaku() {
@@ -412,7 +419,7 @@ void Decolated::convertAll() {
}
bool Decolated::isSmall() {
return util::KBD_IsSmall(getWCharAtCursor());
return util::KBD_IsSmall(getWCharAtCursor()) != 0;
}
void Decolated::converSmall() {

View File

@@ -273,8 +273,8 @@ namespace textinput {
f32 xOffset = left;
xOffset *= scale - 1.0f;
viewport[0] = left + xOffset;
f32 height = (mProjectionRect.bottom -
mProjectionRect.top) * 0.5f;
f32 height = 0.5f * (mProjectionRect.bottom -
mProjectionRect.top);
viewport[1] = rect.bottom + height;
viewport[2] = scale * (100.0f + (rect.right - rect.left));
viewport[3] = rect.top - rect.bottom;

View File

@@ -115,8 +115,8 @@ void WithZi::clearCandidates() {
mCandidateCount = 0;
memset(ElementBuffer, 0, 0x1fe);
memset(CandidatesBuffer, 0, 0x200);
memset(CandidatesBuffer + 0x100, 0, 0x1fe);
memset(CandidatesBuffer + 0x200, 0, 0x200);
memset(&CandidatesBuffer[0x100], 0, 0x1fe);
memset(&CandidatesBuffer[0x200], 0, 0x200);
memset(CandidatedWord, 0, 0x1400);
memset(&mSearch, 0, sizeof(mSearch) + sizeof(mSearchState));
mSearch.language = getPredictLanguage();

View File

@@ -98,6 +98,21 @@ namespace ipl {
getLetterInputForm()->setSendOutMessage(System::getMessage(MESG_LETTERWRITER_SENDING));
}
void textinput::extend::memo::InputForm::setNigaoeEventObserver(NigaoeEventObserver* nigaoeObserver) {
mpNigaoeObserver = nigaoeObserver;
}
void textinput::extend::letter::InputForm::setPhotoDraw(bool photoDraw) {
mbPhotoDraw = photoDraw;
}
void textinput::extend::letter::InputForm::setType(Type type) {
meType = type;
}
void textinput::Manager::start() {
}
FaderSceneCommand LetterWriter::calcFadein() {
return TextWriter::calcFadein();
}
@@ -202,6 +217,10 @@ namespace ipl {
return mpCaptionString->getWCString();
}
wchar_t* textinput::tistring::StringBase::getWCString() const {
return mpszString;
}
FaderSceneCommand LetterWriter::calcNormal() {
const wchar_t* caption;
@@ -291,6 +310,9 @@ namespace ipl {
System::getKeyboard()->endMgr();
}
void textinput::Manager::end() {
}
FaderSceneCommand LetterWriter::calcFadeout() {
return TextWriter::calcFadeout();
}

View File

@@ -14,6 +14,10 @@
namespace ipl {
namespace scene {
inline void textinput::textdrawer::Base::setSecretModeOn(bool secretMode) {
mbSecretMode = secretMode;
}
// clang-format off
const char* ParentalDialog::smButtonName[ParentalDialog::BTN_MAX] = {
"B_BtnA",
@@ -166,9 +170,9 @@ namespace ipl {
case keyboard::Manager::STATE_APPEARING: {
if (state->wcString != NULL) {
if (*state->wcString == 0) {
System::getKeyboard()->memoMgr()->setTitleText(System::getMessage(MESG_PARENTAL_DLG_NO_PIN));
System::getKeyboard()->memoMgr()->setTitleText(const_cast<wchar_t*>(System::getMessage(MESG_PARENTAL_DLG_NO_PIN)));
} else {
System::getKeyboard()->memoMgr()->setTitleText(L"");
System::getKeyboard()->memoMgr()->setTitleText(const_cast<wchar_t*>(L""));
}
}
break;
@@ -316,7 +320,7 @@ namespace ipl {
System::getKeyboard()->start(chan, setting);
System::getKeyboard()->memoMgr()->setSecretInputMode(true);
System::getKeyboard()->memoMgr()->setTitleText(System::getMessage(MESG_PARENTAL_DLG_NO_PIN));
System::getKeyboard()->memoMgr()->setTitleText(const_cast<wchar_t*>(System::getMessage(MESG_PARENTAL_DLG_NO_PIN)));
mState = STATE_WAIT_INPUT;

View File

@@ -89,13 +89,13 @@ namespace ipl {
mpMainLayout->getAnim(5)->initAnmFrame();
mpMainLayout->getAnim(8)->initAnmFrame();
nw4r::lyt::TextBox* textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("T_Dialog_00"));
nw4r::lyt::TextBox* textBox = static_cast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("T_Dialog_00"));
textBox->SetString(System::getMessage(0xB0));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("TextBox_05"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("TextBox_05"));
textBox->SetString(System::getMessage(0xBB));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("TextBox_06"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("TextBox_06"));
textBox->SetString(System::getMessage(0xBC));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("T_BtnA"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpMainLayout->FindPaneByName("T_BtnA"));
textBox->SetString(System::getMessage(0x25));
mpTitleLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_b.brlyt");
@@ -124,29 +124,29 @@ namespace ipl {
mpTitleLayout->getAnim(11)->initAnmFrame();
mpTitleLayout->getAnim(14)->initAnmFrame();
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_Dialog"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_Dialog"));
textBox->SetString(System::getMessage(0xB6));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_00"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_00"));
textBox->SetString(System::getMessage(0xB7));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_01"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_01"));
textBox->SetString(System::getMessage(0xB8));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_02"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_02"));
textBox->SetString(System::getMessage(0xB9));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_03"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_03"));
textBox->SetString(System::getMessage(0xBA));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_Dialog_00"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_Dialog_00"));
textBox->SetString(System::getMessage(0xB6));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_05"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_05"));
textBox->SetString(System::getMessage(0xB8));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_06"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_06"));
textBox->SetString(System::getMessage(0xB9));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_07"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("TextBox_07"));
textBox->SetString(System::getMessage(0xBA));
const ESTitleId* cachedTitles = System::getSaveData()->getTitleCache();
const savedata::Manager* saveData = System::getSaveData();
s32 cachedTitleCount = 0;
for (s32 i = 0; i < 48; ++i) {
if (cachedTitles[i] == 0) {
if (saveData->getTitleCacheEntry(i) == 0) {
break;
}
++cachedTitleCount;
@@ -160,7 +160,7 @@ namespace ipl {
mpTitleLayout->FindPaneByName("N_Btn_4")->SetVisible(false);
mDisplayMode = 3;
}
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_BtnA"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_BtnA"));
textBox->SetString(System::getMessage(0xA5));
mpDialogLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_c.brlyt");
@@ -195,18 +195,19 @@ namespace ipl {
mpDialogLayout->getAnim(11)->initAnmFrame();
mpDialogLayout->getAnim(8)->initAnmFrame();
mpDialogLayout->getAnim(18)->initAnmFrame();
mpDialogLayout->getAnim(18)->initFrame();
mpDialogLayout->getAnim(18)->restart();
layout::Animator* scrollAnimator = mpDialogLayout->getAnim(18);
scrollAnimator->initFrame();
scrollAnimator->restart();
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpDialogLayout->FindPaneByName("T_CalExit"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpDialogLayout->FindPaneByName("T_CalExit"));
textBox->SetString(System::getMessage(0xA5));
textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpDialogLayout->FindPaneByName("T_CalExit_00"));
textBox = static_cast<nw4r::lyt::TextBox*>(mpDialogLayout->FindPaneByName("T_CalExit_00"));
textBox->SetString(System::getMessage(0xC4));
mpProgressLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_Background.brlyt");
mpProgressLayout->bindToGroup("mn_DialogWindow_Background_DialogIn.brlan", "G_InOut", false, true);
mpProgressLayout->bindToGroup("mn_DialogWindow_Background_DialogOut.brlan", "G_InOut", false, true);
mpProgressLayout->finishBinding();
mpDialogLayout->finishBinding();
mpProgressLayout->getAnim(0)->initAnmFrame();
ControlPaneEventHandler* controlEvent = new ControlPaneEventHandler(this);
@@ -240,6 +241,7 @@ namespace ipl {
mpPaneManagers[2]->setTriggerTarget(mpDialogLayout->FindPaneByName(sDialogPaneNames[i]), true);
}
mTransferFlags[0] = 1;
}
void SDMemory::setTitleLists(const TitleRange& nandTitles, const TitleRange& sdTitles) {

View File

@@ -489,9 +489,9 @@ namespace ipl {
mem2Buffer_, mem2Size,
static_cast<nand::File*>(mpWWWLibraryFile)->getBuffer(),
browserPath);
ext_ead::www::SurfaceManager::RegisterArcFile(static_cast<nand::File*>(mpWWWArchiveFile)->getBuffer());
ext_ead::www::SurfaceManager::RegisterIniFile(static_cast<nand::File*>(mpSettingHTMLFile)->getBuffer(),
static_cast<nand::File*>(mpSettingHTMLFile)->getLength());
ext_ead::www::SurfaceManager::RegisterArcFile(static_cast<nand::File*>(mpSettingHTMLFile)->getBuffer());
ext_ead::www::SurfaceManager::RegisterIniFile(static_cast<nand::File*>(mpWWWArchiveFile)->getBuffer(),
static_cast<nand::File*>(mpWWWArchiveFile)->getLength());
ext_ead::www::SurfaceManager::RegisterFontFile(0, static_cast<nand::File*>(mpFontFile)->getBuffer(),
static_cast<nand::File*>(mpFontFile)->getLength());
ext_ead::www::SurfaceManager::StartThread();
@@ -3122,9 +3122,8 @@ namespace ipl {
bool Setting::validateEULA_() {
ESTmdView* titleView = NULL;
s32 contentResult = 0;
s32 result = utility::ESMisc::GetTmdView(System::getMem1Root(), mUpdateTitleId, &titleView);
bool valid = false;
s32 result = utility::ESMisc::GetTmdView(System::getMem1Root(), mUpdateTitleId, &titleView);
if (result == -0x401 || result == -0x6a) {
unk_0x7C = 0;
unk_0x74 = 0xd;
@@ -3134,8 +3133,9 @@ namespace ipl {
System::getErrorHandler()->log("ES", result, "iplSetting.cpp", 0x10f1);
System::getErrorHandler()->set(ErrorHandler::DEFAULT, 2);
} else {
if (!utility::ESMisc::ContentExist(titleView, 1, &contentResult) && contentResult != 0) {
System::getErrorHandler()->log("ES", contentResult, "iplSetting.cpp", 0x10fc);
result = 0;
if (!utility::ESMisc::ContentExist(titleView, 1, &result) && result != 0) {
System::getErrorHandler()->log("ES", result, "iplSetting.cpp", 0x10fc);
System::getErrorHandler()->set(ErrorHandler::DEFAULT, 2);
}
valid = true;
@@ -3554,31 +3554,32 @@ namespace ipl {
}
void Setting::setUSBAP() {
if (unk_0x84 != 2) {
if (unk_0x84 < 2) {
if (unk_0x84 >= 1) {
if (static_cast<USBAPThread*>(mpUSBAPThread)->is()) {
bool result = SCGetOwnerNickName(reinterpret_cast<SCOwnerNickname*>(mSettingData));
if (!result) {
www::wiisetting::setFuncResult(2);
resetFuncMsgQ();
} else {
OSReport("USB SCGetOwnerNickName:%d\n", result);
static_cast<USBAPThread*>(mpUSBAPThread)->setData(
reinterpret_cast<const wchar_t*>(mSettingData), &unk_0x91C[1]);
static_cast<USBAPThread*>(mpUSBAPThread)->Init(
reinterpret_cast<unsigned short*>(mpMem2BrowserBuffer),
reinterpret_cast<u8*>(mpBrowserStringBuffer));
unk_0x84 = 2;
}
}
switch (unk_0x84) {
case 1:
if (static_cast<USBAPThread*>(mpUSBAPThread)->is()) {
bool result = SCGetOwnerNickName(reinterpret_cast<SCOwnerNickname*>(mSettingData));
if (result) {
OSReport("USB SCGetOwnerNickName:%d\n", result);
static_cast<USBAPThread*>(mpUSBAPThread)->setData(
reinterpret_cast<const wchar_t*>(mSettingData), &unk_0x91C[1]);
static_cast<USBAPThread*>(mpUSBAPThread)->Init(
reinterpret_cast<unsigned short*>(mpMem2BrowserBuffer),
reinterpret_cast<u8*>(mpBrowserStringBuffer));
unk_0x84 = 2;
} else {
www::wiisetting::setFuncResult(2);
resetFuncMsgQ();
}
}
} else if (unk_0x91C[1] != 0) {
www::wiisetting::setFuncResult(unk_0x91C[1]);
unk_0x84 = 1;
unk_0x91C[1] = 0;
resetFuncMsgQ();
break;
case 2:
if (unk_0x91C[1] != 0) {
www::wiisetting::setFuncResult(unk_0x91C[1]);
unk_0x84 = 1;
unk_0x91C[1] = 0;
resetFuncMsgQ();
}
break;
}
}

View File

@@ -13,7 +13,9 @@
#undef IPL_SOUND_RECT_OUT_OF_LINE
extern "C" ipl::System::Arg smArg__Q23ipl6System;
extern "C" void __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting();
extern "C" void __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting(
textinput::extend::savedata::MemoSetting* dst,
const textinput::extend::savedata::MemoSetting* src);
extern "C" void setMemoSetting__Q33ipl8savedata7ManagerFRCQ49textinput6extend8savedata11MemoSetting();
extern "C" void flushAsync__Q33ipl8savedata7ManagerFPQ23EGG4Heap();
@@ -235,7 +237,7 @@ namespace ipl {
textinput::extend::savedata::MemoSetting memoSetting;
memoSetting = System::getSaveData()->getMemoSetting();
memoSettingCopy = memoSetting;
mSaveData = memoSettingCopy;
__as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting(&mSaveData, &memoSettingCopy);
// Memo manager
mpManager = new (heap, 4) textinput::MemoManager(allocator, multiArc, &mEvent);
@@ -280,7 +282,48 @@ namespace ipl {
mpManager->setLanguage(textinput::JP);
#endif // JAPANESE_BUILD
}
} // namespace keyboard
} // namespace ipl
extern "C" void __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting(
textinput::extend::savedata::MemoSetting* dst,
const textinput::extend::savedata::MemoSetting* src) {
dst->uRevisionAndType = src->uRevisionAndType;
dst->uRawData.val[0] = src->uRawData.val[0];
dst->uRawData.val[1] = src->uRawData.val[1];
dst->uRawData.val[2] = src->uRawData.val[2];
dst->uRawData.val[3] = src->uRawData.val[3];
dst->uRawData.val[4] = src->uRawData.val[4];
dst->uRawData.val[5] = src->uRawData.val[5];
dst->uRawData.val[6] = src->uRawData.val[6];
}
namespace textinput {
namespace extend {
namespace memo {
void Manager::setSaveData(savedata::MemoSetting memoSetting) {
__as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting(&mMemoSetting, &memoSetting);
}
}
}
}
namespace ipl {
namespace keyboard {
void EventObserver::setManager(Manager* manager) {
mpKeyboardMgr = manager;
}
}
}
namespace nw4r {
namespace lyt {
FontRefLink::~FontRefLink() {}
}
}
namespace ipl {
namespace keyboard {
void Manager::init() {
mpManager->init();
@@ -438,7 +481,21 @@ namespace ipl {
}
}
}
} // namespace keyboard
} // namespace ipl
namespace textinput {
namespace extend {
namespace memo {
State* Manager::getState() {
return mpCurrentState;
}
}
}
}
namespace ipl {
namespace keyboard {
void Manager::draw() {
mpManager->draw();
GXSetZMode(GX_TRUE, GX_ALWAYS, GX_TRUE);
@@ -464,7 +521,7 @@ namespace ipl {
}
mpManager->limitStringLength(setting.stringLimit);
mpManager->limitRowNum(setting.rowLimit);
mpManager->setTitleText(L"");
mpManager->setTitleText(const_cast<wchar_t*>(L""));
mpManager->changeState(textinput::extend::memo::Manager::STL_Transition);
// Open!
@@ -482,7 +539,21 @@ namespace ipl {
doSave();
}
}
} // namespace keyboard
} // namespace ipl
namespace textinput {
namespace extend {
namespace memo {
Manager::ConfigType Manager::getConfigType() {
return meConfigType;
}
}
}
}
namespace ipl {
namespace keyboard {
void Manager::cancel() {
mState.pressOK = false;
mpManager->changeState(textinput::extend::memo::Manager::STL_Transition);
@@ -721,7 +792,21 @@ namespace ipl {
addi r1, r1, 0x30
blr
}
} // namespace keyboard
} // namespace ipl
namespace textinput {
namespace extend {
namespace memo {
savedata::MemoSetting Manager::getSaveData() {
return mMemoSetting;
}
}
}
}
namespace ipl {
namespace keyboard {
void Manager::touchFormInDisp(int unused) {
mpManager->changeState(textinput::extend::memo::Manager::STL_Transition);
snd::getSystem()->startSE("WIPL_SE_SK_OPEN");

View File

@@ -1514,6 +1514,16 @@ namespace ipl {
}
} // namespace ipl
namespace textinput {
void EventObserver::onOutOfLength() { printf("OutOfLength\n"); }
void EventObserver::onCancel() { printf("Cancel!\n"); }
void EventObserver::onOK() { printf("OK!\n"); }
void EventObserver::onSE(sound::SE seId) {}
void EventObserver::onEvent(nw4r::lyt::Pane* pane, u32 event) {}
void EventObserver::onCommand(CommandReceiver::INPUT_COMMAND command, void* data) {}
void EventObserver::onInput(CommandReceiver::INPUT_COMMAND command, void* data) {}
} // namespace textinput
#ifdef __MWERKS__
#pragma force_active on
extern "C" const f32 lbl_81694424 = -304.0f;

View File

@@ -315,3 +315,245 @@ Each compiling attempt rebuilt only CHANSVm.o, regenerated objdiff and compared
## Uncertainty
The reason for VmBlobFill raw branch differences remains unresolved. Register-only mismatches may be compiler tie-breaks; the attempts do not prove that no readable C variation can match them. Remaining .data/.rodata relocation and symbol comparisons are unresolved, so the unit is not complete.
## 2026-09-30 switch mapping and range-copy match
Baseline: 206/233 instruction-exact, 207/233 objdiff-exact; code 32400/53564; data 2232/6904; .data 18.050066%.
Accepted: VmBlobCopyRangeFrom, 100.0% objdiff, 136/136 instructions, ctxdiff diffs 0. Boolean range assignments replace conditional flag stores.
Final: 207/233 instruction-exact, 208/233 objdiff-exact; code 32944/53564; data 2232/6904; .data 18.050066%.
### Switch mapping
All 64 main opcode entries and their shared labels already have the target source-body order. Reordering those bodies would break the current order.
The three CHANSVmStep tables contain 121 relocations. The type table at .data+0x105c has 0/10 incorrect offsets; the operator table at 0x1084 has 47/47; the opcode table at 0x1140 has 51/64. Total: 98 incorrect offsets.
The main table offsets differ by 8 or 16 bytes through most of the interpreter. Its source and target function sizes are both 0x1394. Source/target .data payloads are byte-identical before relocation.
Stack/local, table-base hoisting, shared-tail and register allocation differences explain the shifted labels. No case reorder was retained.
opcode | source label | target offset | emitted offset
--- | --- | --- | ---
0x18 | CHANS_VM_OP_LOAD_IMM_1 | 0x013c | 0x0144
0x27 | CHANS_VM_OP_LOAD_IMM_2 | 0x0144 | 0x014c
0x28 | CHANS_VM_OP_LOAD_IMM_4 | 0x014c | 0x0154
0x29 | CHANS_VM_OP_LOAD_IMM_8 | 0x0154 | 0x015c
0x2a | CHANS_VM_OP_LOAD_FLOAT | 0x0188 | 0x0190
0x19 | CHANS_VM_OP_ADD_IMM | 0x01c4 | 0x01cc
0x1a | CHANS_VM_OP_SUB_IMM | 0x01d4 | 0x01dc
0x1b | CHANS_VM_OP_MUL_IMM | 0x01e4 | 0x01ec
0x1c | CHANS_VM_OP_DIV_IMM | 0x01f4 | 0x01fc
0x1d | CHANS_VM_OP_MOD_IMM | 0x0204 | 0x020c
0x1e | CHANS_VM_OP_AND_IMM | 0x0214 | 0x021c
0x1f | CHANS_VM_OP_OR_IMM | 0x0224 | 0x022c
0x20 | CHANS_VM_OP_XOR_IMM | 0x0234 | 0x023c
0x21 | CHANS_VM_OP_CMP_EQ_IMM | 0x0244 | 0x024c
0x22 | CHANS_VM_OP_CMP_NEQ_IMM | 0x0254 | 0x025c
0x23 | CHANS_VM_OP_CMP_LT_IMM | 0x0264 | 0x026c
0x24 | CHANS_VM_OP_CMP_GT_IMM | 0x0274 | 0x027c
0x25 | CHANS_VM_OP_CMP_LEQ_IMM | 0x0284 | 0x028c
0x26 | CHANS_VM_OP_CMP_GEQ_IMM | 0x0294 | 0x029c
0x04 | CHANS_VM_OP_PUSH | 0x0500 | 0x0510
0x05 | CHANS_VM_OP_POP | 0x056c | 0x057c
0x06 | CHANS_VM_OP_ADD | 0x0580 | 0x0590
0x07 | CHANS_VM_OP_SUB | 0x0590 | 0x05a0
0x08 | CHANS_VM_OP_MUL | 0x05a0 | 0x05b0
0x09 | CHANS_VM_OP_DIV | 0x05b0 | 0x05c0
0x0a | CHANS_VM_OP_MOD | 0x05c0 | 0x05d0
0x0b | CHANS_VM_OP_BIT_AND | 0x05d0 | 0x05e0
0x0c | CHANS_VM_OP_BIT_OR | 0x05e0 | 0x05f0
0x0d | CHANS_VM_OP_BIT_XOR | 0x05f0 | 0x0600
0x0e | CHANS_VM_OP_ULSHIFT | 0x0600 | 0x0610
0x0f | CHANS_VM_OP_ARSHIFT | 0x0610 | 0x0620
0x10 | CHANS_VM_OP_CMP_EQ | 0x0620 | 0x0630
0x11 | CHANS_VM_OP_CMP_NEQ | 0x0630 | 0x0640
0x12 | CHANS_VM_OP_CMP_LT | 0x0640 | 0x0650
0x13 | CHANS_VM_OP_CMP_GT | 0x0650 | 0x0660
0x14 | CHANS_VM_OP_CMP_LEQ | 0x0660 | 0x0670
0x15 | CHANS_VM_OP_CMP_GEQ | 0x0670 | 0x0680
0x00 | CHANS_VM_OP_RETURN | 0x06a0 | 0x06b0
0x01 | CHANS_VM_OP_RETURN_VALUE | 0x06d0 | 0x06e0
0x16 | CHANS_VM_OP_BIT_NOT | 0x06e8 | 0x06f8
0x17 | CHANS_VM_OP_LOG_NOT | 0x07a8 | 0x07b8
0x3e | CHANS_VM_OP_LOAD_INDIRECT | 0x07e4 | 0x07f4
0x30 | CHANS_VM_OP_CALL_METHOD | 0x0854 | 0x0864
0x02 | CHANS_VM_OP_IS_CLASS | 0x0894 | 0x08a4
0x31 | CHANS_VM_OP_CALL_FUNCTION | 0x08b0 | 0x08c0
0x32 | CHANS_VM_OP_PROP_GET | 0x08f4 | 0x0904
0x33 | CHANS_VM_OP_PROP_SET | 0x08f4 | 0x0904
0x3f | CHANS_VM_OP_STORE_INDIRECT | 0x0940 | 0x0950
0x2c | CHANS_VM_OP_LOAD_STRING_CONST | 0x09c8 | 0x09d8
0x2d | CHANS_VM_OP_SET_INDEX | 0x0a6c | 0x0a7c
0x34 | CHANS_VM_OP_GET_PROPERTY_NAME | 0x0b8c | 0x0b94
0x03 | CHANS_VM_OP_NEW_ARRAY | 0x0da4 | 0x0da4
0x35 | CHANS_VM_OP_JUMP | 0x0e74 | 0x0e74
0x2b | CHANS_VM_OP_STORE_UNDEFINED | 0x0f14 | 0x0f14
0x36 | CHANS_VM_OP_DELETE_SYMBOL | 0x0f2c | 0x0f2c
0x37 | CHANS_VM_OP_DELETE_INDIRECT | 0x0f80 | 0x0f80
### Remaining functions
CHANSVmGetSourceLine: 97.82609% | 16 register-allocation differences
CHANSVmNewObjData: 99.427086% | 10 register-allocation differences
CHANSVmParseInt: 94.69388% | endpoint initialization scheduling; 3 differences
CHANSVm_8144B4D4: 96.92771% | endpoint store scheduling and register allocation; 13 differences
VmArraySlice: 96.2782% | index clamping scheduling and registers; 56 differences
VmDateDtor: 94.96703% | calendar argument and table-load scheduling; 7 differences
VmStringFromCharCode: 99.40678% | output offset and mask register allocation; 6 differences
VmStringReplace: 97.106064% | 53 register-allocation differences
VmStringSplit: 96.04955% | 81 register-allocation differences
CHANSVm_8145049C: 98.58237% | character/shared-tail scheduling and registers; 42 differences
CHANSVm_81450D14: 97.391304% | 45/46 instructions; branch layout and add operand order
VmBlobGetHexString: 98.71951% | hex output counter/register allocation; 14 differences
VmBlobCalcRangeSHA1Digest: 96.484535% | range check scheduling and register allocation; 14 differences
VmBlobCalcHMAC: 99.453125% | 7 register-allocation differences
VmBlobCalcRangeHMAC: 99.97479% | context stack offset 0xc versus target 0x10; 3 differences
vmBlobParsePackFormatString: 99.69827% | decimal accumulator and character registers; 6 differences
VmBlobPackCommon: 92.603294% | 675/668 instructions; parser locals, switches, pack conversions
VmBlobUnpack: 92.083176% | 531/517 instructions; parser locals, switches, numeric conversions
VmImageCtor: 99.0% | image/pixel pointer register allocation; 4 differences
VmWinEmuWrite: 99.62687% | string and total-length register allocation; 5 differences
CHANSVmAddExe: 99.1063% | loop scheduling, address addition order, registers; 35 differences
CHANSVm_81455654: 94.0% | 34/35 instructions; return-pointer and branch layout
CHANSVmLinkModules: 98.677246% | 43 register-allocation differences
VmCallMethod: 97.2242% | call state and argument register allocation; 97 differences
CHANSVmStep: 95.172386% | 1253/1253 instructions; 894 differences, stack/register/base-address scheduling
VmBlobFill has objdiff 100.0% but two raw conditional-branch operands differ. It was unchanged; this accounts for the one-function discrepancy between the objdiff and instruction-exact gates. The instruction counter is stricter than objdiff for this function; relocation-aware linking was not investigated in this matching-only phase.
### Attempts
All unsuccessful candidates were restored. Each remaining objdiff-inexact function has at least three compiled, distinct source-level trials. VmBlobCopyRangeFrom reached exact on its first trial; a later output-offset-order trial regressed and was restored.
Compile-error probes were corrected and rerun or discarded; they are excluded from the attempt counts below.
CHANSVmStep: 1: two enum types and a two-object indirect/index scratch array; objdiff 95.18675; insns 1253/1253, diffs 876; .data 18.050066
CHANSVmStep: 2: reorder live temporaries; use copied index; propagate boolean error; order float bounds like target; objdiff 94.71907; insns 1249/1253, diffs 1230; .data 18.050066
CHANSVmStep: 3: typed two-entry enum array with direct indexing instead of byte-stride temporary; objdiff 94.847565; insns 1253/1253, diffs 899; .data 18.050066
VmBlobCalcRangeHMAC: 1: declare digest object before HMAC context; objdiff 99.97479; insns 119/119, diffs 3; .data 18.050066
VmBlobCalcRangeHMAC: 2: promote HMAC context to function scope; objdiff 99.97479; insns 119/119, diffs 3; .data 18.050066
VmBlobCalcRangeHMAC: 3: place context first among function locals; objdiff 99.97479; insns 119/119, diffs 3; .data 18.050066
vmBlobParsePackFormatString: 1: promote current format character to u32; objdiff 99.69827; insns 116/116, diffs 6; .data 18.050066
VmWinEmuWrite: 1: compute string length before offset initialization; objdiff 99.62687; insns 67/67, diffs 5; .data 18.050066
VmWinEmuWrite: 2: early return for nonstring argument; objdiff 94.62687; insns 69/67, diffs 54; .data 18.050066
VmWinEmuWrite: 3: declare total length before argument object; objdiff 99.17911; insns 67/67, diffs 8; .data 18.050066
CHANSVmNewObjData: 1: initialize entry search offset before chunk index; objdiff 99.427086; insns 96/96, diffs 10; .data 18.050066
CHANSVmNewObjData: 2: declare chunk pointer before loop index; objdiff 99.427086; insns 96/96, diffs 10; .data 18.050066
CHANSVmNewObjData: 3: count chunk search with for loop; objdiff 99.427086; insns 96/96, diffs 10; .data 18.050066
VmStringFromCharCode: 1: initialize output offset before argument index; objdiff 99.32204; insns 59/59, diffs 7; .data 18.050066
VmStringFromCharCode: 2: express character truncation as u16 conversion; objdiff 94.32204; insns 57/59, diffs 45; .data 18.050066
VmStringFromCharCode: 3: use a for loop for the argument traversal; objdiff 99.32204; insns 59/59, diffs 7; .data 18.050066
vmBlobParsePackFormatString: 2: put current character first in decimal accumulation; objdiff 99.69827; insns 116/116, diffs 6; .data 18.050066
vmBlobParsePackFormatString: 3: split decimal multiplication and digit addition; objdiff 99.655174; insns 116/116, diffs 6; .data 18.050066
VmBlobCalcHMAC: 1: declare key blob before parent blob; objdiff 99.453125; insns 64/64, diffs 7; .data 18.050066
VmBlobCalcHMAC: 2: hold argument only while resolving the key blob; objdiff 99.4375; insns 64/64, diffs 12; .data 18.050066
VmBlobCalcHMAC: 3: assign parent and key argument after declaring all locals; objdiff 99.453125; insns 64/64, diffs 7; .data 18.050066
VmImageCtor: 1: name pixel buffer before validating it; objdiff 86.6; insns 25/25, diffs 8; .data 18.050066
VmImageCtor: 2: express nested image checks with early return; objdiff 47.8; insns 17/25, diffs 25; .data 18.050066
VmImageCtor: 3: name image size as a separate scalar; objdiff 86.36; insns 25/25, diffs 10; .data 18.050066
CHANSVmAddExe: 1: initialize module during declaration; objdiff 99.1063; insns 254/254, diffs 35; .data 18.050066
CHANSVmAddExe: 2: increment table index before table byte offset; objdiff 99.15354; insns 254/254, diffs 34; .data 18.050066
CHANSVmAddExe: 3: initialize module before VM local; commute relocation additions; objdiff 99.185036; insns 254/254, diffs 33; .data 18.050066
VmDateDtor: 1: resolve month name before day name; objdiff 94.96703; insns 91/91, diffs 7; .data 18.050066
VmDateDtor: 2: resolve day name before month name; objdiff 94.96703; insns 91/91, diffs 7; .data 18.050066
VmDateDtor: 3: use direct date member access for formatted fields; objdiff 89.14286; insns 90/91, diffs 85; .data 18.050066
CHANSVmParseInt: 1: initialize parse endpoint before loading type; objdiff 83.67347; insns 49/49, diffs 5; .data 18.050066
CHANSVmParseInt: 2: declare initialized endpoint before output buffer; objdiff 94.69388; insns 49/49, diffs 3; .data 18.050066
CHANSVmParseInt: 3: load object type after initializing endpoint; objdiff 83.67347; insns 49/49, diffs 5; .data 18.050066
CHANSVm_81455654: 1: preserve result pointer through a single function return; objdiff 88.28571; insns 33/35, diffs 18; .data 18.050066
CHANSVm_81455654: 2: assign global reference through object field before shared return; objdiff 88.28571; insns 33/35, diffs 18; .data 18.050066
CHANSVm_81455654: 3: compute argument array separately before shared return; objdiff 88.28571; insns 33/35, diffs 18; .data 18.050066
CHANSVm_81450D14: 1: invert range validity branch; objdiff 97.391304; insns 45/46, diffs 29; .data 18.050066
CHANSVm_81450D14: 2: add blob size before negative relative index; objdiff 97.391304; insns 45/46, diffs 29; .data 18.050066
CHANSVm_81450D14: 3: return through explicit success result; objdiff 81.63043; insns 42/46, diffs 45; .data 18.050066
VmBlobGetHexString: 1: initialize emitted-digit index before output offset; objdiff 98.71951; insns 82/82, diffs 14; .data 18.050066
VmBlobGetHexString: 2: initialize traversal loop before output indices; objdiff 98.71951; insns 82/82, diffs 14; .data 18.050066
VmBlobGetHexString: 3: update output index before emitted-digit index; objdiff 98.71951; insns 82/82, diffs 14; .data 18.050066
VmBlobCalcRangeSHA1Digest: 1: cache range offset before checking two bounds; objdiff 99.793816; insns 97/97, diffs 4; .data 18.050066
VmBlobCalcRangeSHA1Digest: 2: separate signed range-validity calculation; objdiff 96.484535; insns 97/97, diffs 14; .data 18.050066
VmBlobCalcRangeSHA1Digest: 3: reuse cached offset for data address; objdiff 98.50516; insns 96/97, diffs 28; .data 18.050066
CHANSVm_8145049C: 1: assign character-format length before character pointer; objdiff 98.58237; insns 431/431, diffs 42; .data 18.050066
CHANSVm_8145049C: 2: hold copied string data before memcpy; objdiff 98.689095; insns 430/431, diffs 171; .data 18.050066
CHANSVm_8145049C: 3: terminate the character string before setting shared-format locals; objdiff 94.967514; insns 432/431, diffs 358; .data 18.050066
CHANSVmGetSourceLine: 1: cache program counter byte for the line-bit scan; objdiff 98.36957; insns 46/46, diffs 14; .data 18.050066
CHANSVmGetSourceLine: 2: read baseline offset after deriving bitfield; objdiff 97.82609; insns 46/46, diffs 16; .data 18.050066
CHANSVmGetSourceLine: 3: cache debug module once for validation and table access; objdiff 97.82609; insns 46/46, diffs 16; .data 18.050066
CHANSVmLinkModules: 1: initialize module iterator before blocking allocation; objdiff 98.677246; insns 189/189, diffs 43; .data 18.050066
CHANSVmLinkModules: 2: use a for loop for module traversal; objdiff 98.677246; insns 189/189, diffs 43; .data 18.050066
CHANSVmLinkModules: 3: copy dispatch entry fields into separate locals; objdiff 94.33862; insns 189/189, diffs 59; .data 18.050066
VmStringReplace: 1: load all string lengths before their data pointers; objdiff 97.106064; insns 132/132, diffs 53; .data 18.050066
VmStringReplace: 2: initialize output byte count before output data pointer; objdiff 97.030304; insns 132/132, diffs 55; .data 18.050066
VmStringReplace: 3: limit each converted argument to the validation/data setup scope; objdiff 97.106064; insns 132/132, diffs 53; .data 18.050066
VmStringSplit: 1: load delimiter length before its data pointer; objdiff 96.04955; insns 222/222, diffs 81; .data 18.050066
VmStringSplit: 2: initialize split limit before fetching delimiter; objdiff 95.14414; insns 222/222, diffs 93; .data 18.050066
VmStringSplit: 3: scope the limit argument to the optional limit block; objdiff 96.04955; insns 222/222, diffs 81; .data 18.050066
VmCallMethod: 1: initialize call state in declaration order; objdiff 97.2242; insns 281/281, diffs 97; .data 18.050066
VmCallMethod: 2: initialize accumulator during declaration; objdiff 97.2242; insns 281/281, diffs 97; .data 18.050066
VmCallMethod: 3: split end-depth and header-count declarations; objdiff 97.2242; insns 281/281, diffs 97; .data 18.050066
CHANSVm_8144B4D4: 1: use a typed endpoint instead of a volatile integer; objdiff 96.92771; insns 83/83, diffs 13; .data 18.050066
CHANSVm_8144B4D4: 2: remove endpoint volatility and initialize before type load; objdiff 94.518074; insns 83/83, diffs 13; .data 18.050066
CHANSVm_8144B4D4: 3: keep keyword/number endpoint as a scoped pointer; objdiff 94.518074; insns 83/83, diffs 13; .data 18.050066
VmArraySlice: 1: represent array length as signed 64-bit for index clamping; objdiff 84.50376; insns 138/133, diffs 107; .data 18.050066
VmArraySlice: 2: compute each negative index once as a signed value; objdiff 96.2782; insns 133/133, diffs 56; .data 18.050066
VmArraySlice: 3: add array length before negative argument index; objdiff 95.97744; insns 133/133, diffs 56; .data 18.050066
VmBlobCopyRangeFrom: 1: assign both range-validity flags from the bounds expression; objdiff 100.0; insns 136/136, diffs 0; .data 18.050066
VmBlobCopyRangeFrom: 3: initialize destination offset before source offset; objdiff 99.98529; insns 136/136, diffs 2; .data 18.050066
VmBlobPackCommon: 1: combine create-mode and parent validity check; objdiff 92.603294; insns 675/668, diffs 642; .data 18.050066
VmBlobPackCommon: 2: give sizing and output passes separate parsed format locals; objdiff 92.597305; insns 675/668, diffs 637; .data 18.050066
VmBlobPackCommon: 3: use signed opcode comparisons in both format passes; objdiff 92.603294; insns 675/668, diffs 642; .data 18.050066
VmBlobUnpack: 1: reject invalid format before the sizing switch; objdiff 92.067696; insns 530/517, diffs 497; .data 18.050066
VmBlobUnpack: 2: use signed format type comparisons in sizing pass; objdiff 92.083176; insns 531/517, diffs 496; .data 18.050066
VmBlobUnpack: 3: remove redundant initializations overwritten before parsing; objdiff 92.083176; insns 531/517, diffs 496; .data 18.050066
VmImageCtor: 4: bind pixel buffer within callback branch; objdiff 99.0; insns 25/25, diffs 4; .data 18.050066
CHANSVmParseInt: 4: promote object type to full integer; objdiff 94.69388; insns 49/49, diffs 3; .data 18.050066
CHANSVmGetSourceLine: 4: cache program counter before table indexing; objdiff 97.82609; insns 46/46, diffs 16; .data 18.050066
CHANSVmGetSourceLine: 5: type the local program counter as the debug offset; objdiff 97.82609; insns 46/46, diffs 16; .data 18.050066
CHANSVmParseInt: 5: scope output buffer and endpoint to the string conversion; objdiff 87.755104; insns 49/49, diffs 6; .data 18.050066
### Full gate
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/channelScript/CHANSVm] pool: IDENTICAL
[src/channelScript/CHANSVm] objdiff: code 32944/53564 data 2232/6904 functions 208/233 fuzzy 98.4492 linked code 0
[src/channelScript/CHANSVm] instruction-exact functions: 207/233
[src/channelScript/CHANSVm] section .data size 4672 match 18.050066
[src/channelScript/CHANSVm] section .rodata size 1432 match 100.0
[src/channelScript/CHANSVm] section .sbss size 16 match 100.0
[src/channelScript/CHANSVm] section .sdata size 600 match 100.0
[src/channelScript/CHANSVm] section .sdata2 size 184 match 100.0
[src/channelScript/CHANSVm] section .text size 53564 match 98.44918
[src/channelScript/CHANSVm] below 100: CHANSVmGetSourceLine 97.82609
[src/channelScript/CHANSVm] below 100: CHANSVmNewObjData 99.427086
[src/channelScript/CHANSVm] below 100: CHANSVmParseInt 94.69388
[src/channelScript/CHANSVm] below 100: CHANSVm_8144B4D4 96.92771
[src/channelScript/CHANSVm] below 100: VmArraySlice 96.2782
[src/channelScript/CHANSVm] below 100: VmDateDtor 94.96703
[src/channelScript/CHANSVm] below 100: VmStringFromCharCode 99.40678
[src/channelScript/CHANSVm] below 100: VmStringReplace 97.106064
[src/channelScript/CHANSVm] below 100: VmStringSplit 96.04955
[src/channelScript/CHANSVm] below 100: CHANSVm_8145049C 98.58237
[src/channelScript/CHANSVm] below 100: CHANSVm_81450D14 97.391304
[src/channelScript/CHANSVm] below 100: VmBlobGetHexString 98.71951
[src/channelScript/CHANSVm] below 100: VmBlobCalcRangeSHA1Digest 96.484535
[src/channelScript/CHANSVm] below 100: VmBlobCalcHMAC 99.453125
[src/channelScript/CHANSVm] below 100: VmBlobCalcRangeHMAC 99.97479
[src/channelScript/CHANSVm] below 100: vmBlobParsePackFormatString 99.69827
[src/channelScript/CHANSVm] below 100: VmBlobPackCommon 92.603294
[src/channelScript/CHANSVm] below 100: VmBlobUnpack 92.083176
[src/channelScript/CHANSVm] below 100: VmImageCtor 99.0
[src/channelScript/CHANSVm] below 100: VmWinEmuWrite 99.62687
[src/channelScript/CHANSVm] below 100: CHANSVmAddExe 99.1063
[src/channelScript/CHANSVm] below 100: CHANSVm_81455654 94.0
[src/channelScript/CHANSVm] below 100: CHANSVmLinkModules 98.677246
[src/channelScript/CHANSVm] below 100: VmCallMethod 97.2242
[src/channelScript/CHANSVm] below 100: CHANSVmStep 95.172386
[src/channelScript/CHANSVm] baseline: code 32400/53564 data 2232 functions 207 fuzzy 98.3831
regressions vs baseline: 0
global matched_code_percent: 84.84254 -> 84.86070
global fuzzy_match_percent: 98.08433 -> 98.08551
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43305 -> 90.43305
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
No source/header/configuration outside this leaf changed. No linking promotion was attempted.

View File

@@ -25,3 +25,25 @@ The initial source had 42 instruction-exact functions. Correcting the guarded ba
The unit remains `NonMatching`. All original code functions match; data has separate unresolved differences and no linking claim is made. All shared-header changes are guarded by `MYTIINPUTFORM_IMPLEMENTATION`, defined only in this source file.
The default gate merge-base is `112e4e1a`, for which the supplied tools have no baseline report. Gates use the available parent snapshot explicitly: `--base 0aca3c76`. No supplied baseline or tool was edited. Regression checks against that snapshot remain zero.
## Final state (second pass)
All 84 target functions at objdiff 100.0; `.text`/`.rodata`/`.sdata`/`.sdata2` all 100%; `.data` content byte-identical (0 diffs, 1616B) but scores 69.06% — the remaining 31% is symbol-name pairing only: base `.data` carries extraction-generated `lbl_8166xxxx`/`jumptable_8166xxxx` names while MWCC emits anonymous `@NNNN` labels for literal strings/jump tables; the same residual family documented for tiManager (.data 92.998%).
Mechanisms verified this pass:
- MWCC weak-vtable emission = reverse class-declaration order within a TU; reordering memo's local class decls landed all 7 vtables at byte-identical addresses.
- `gui::EventHandler` model: `~EventHandler` inline `{}` in every TU (base dtor folds to 16 insns); the other three virtuals decl-only everywhere with the single out-of-line impls in tiPcKeyboard.cpp.
- InputForm's six trailing zero vtable slots = six impl-guarded pure photo hooks (`getPhotoPaneMaterial`/`onPhotoTrig`/`onPhotoPoint`/`onPhotoLeft`/`isPhotoScaledUp`/`setPhotoDraw`), proven by letter::InputForm's vtable overriding the inherited slots with real impls at identical positions.
- MWCC emits `@N@fn` adjustor thunks WEAK in every TU whose emitted vtable references them (scratch-tested); the base .o shows them UNDEF because the linker attributes each weak thunk to one object — unfixable .o-level divergence, identical to the fused-name artifact at symbols.txt:5832.
- 32 extra weak fn defs in our .o vs base (thunks + inline virtuals) are not counted by objdiff; the unit's function/code metrics are unaffected.
AnmPane's 48B extraction label vs 44B real extent: the trailing 4B "zero" is an unlabeled adjacent object merged into the extraction extent, not a vtable slot (subclass vts are 44B without it). Content already identical.
## Session w0929-2: unit code 100% (84/84 fns)
- BREAKTHROUGH: `mbAbleToUp`/`mbAbleToDown`/`mbSeparator` are BASE-class members of `inputform::LayoutByNW4R` at 0x2CC/0x2CD/0x2CE (inside former `unk_0x2C0[0x10]` tail), not derived-class fields. Moving them fixed `init`+`calc` (both -> diffs 0). Derived `MyTiInputForm` writes via inherited names.
- Pane dtor linkage: in-class `virtual ~X() {}` -> WEAK; `virtual ~X();` + out-of-line `X::~X(){}` in same TU -> GLOBAL. Applied to WholePane/NigaoePane/SimpleAnmPane.
- `AnimPaneGroup(group)` ctor must inline `List_Init(&mAnmPaneList, offsetof(AnmPane, mGroupLink))` (arg 0x24) — added to tiNw4rManager.h ctor. Fixed `create__ScrollButton` (was missing the call -> 4-insn hole).
- `mExScrollAnm.startAnm(NULL, mfScroll, scroll, 15.0f, NULL)` (inline wrapper) vs direct virtual overload `startAnm(mfScroll, scroll, 15.0f, observer, arg)` — base uses the direct form (int-args emitted before floats). Fixed onArrowRTrig/onArrowLTrig.
- `AnimationFile` = `{u32 id; char name[0x40]}` (0x44, embedded names) — base .rodata confirms.
- Data: ALL sections byte-identical except .sdata tail — base 0x48 (8-aligned end), mine 0x43: last string "B_ArwL" padded to char[12]-equivalent in base (5 trailing zeros). No relocs into pad; likely section-end pad artifact or last-string emitted via char[12] member. Also base emits .sdata2 BEFORE .sdata in section order; mine reversed.

View File

@@ -2,7 +2,7 @@
"""Compact function diff with context: python ctxdiff.py <unit> <symbol> [--full]"""
import sys
sys.path.insert(0, "/home/cole/projects/tests")
sys.path.insert(0, "/home/ubuntu/decomp")
from odiff import dis, sym
import os
import itertools

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,593 @@
===== gate-initial.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 94.3115 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 94.31154
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 98.809525
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.067055
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 89.67863
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 86.2638 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 86.26383
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 83.33333
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 86.26383
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 86.2638
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 2712/5188 data 24/348 functions 2/3 fuzzy 86.9406 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 2/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 86.940636
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 97.22222
[libs/RVLMiddleware/eZiText/src/clib/zikorean] below 100: Zi8GetKoreanCandidates 72.63651
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 2712/5188 data 24 functions 2 fuzzy 86.9406
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 89.0165 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 89.01647
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 98.333336
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 85.95042
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 75.58496
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6360/6888 data 324/332 functions 15/17 fuzzy 99.9506 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 15/17
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 50.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 99.95064
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8GetDataSignature 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8IsDupWChar 99.36508
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6360/6888 data 324 functions 15 fuzzy 99.9506
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4356/4868 data 120/120 functions 5/6 fuzzy 99.9754 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 5/6
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 99.97535
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] below 100: Zi8MatchROMdata1 99.765625
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4356/4868 data 120 functions 5 fuzzy 99.9754
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.02277
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-filter.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 94.3885 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 94.38846
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 89.67863
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.02290
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-ko-blocks.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.4615 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.46154
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.59342
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.02998
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-ko-order.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6154 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.61539
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.89238
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.03025
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-prepare.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 93.4202 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 93.42021
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 93.42021
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 86.2638
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.03923
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-prepare2.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.0979 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 86.2638
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.04258
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-match.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 90.9767 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 90.976746
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 98.333336
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.09642
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 75.58496
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.04799
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-match2.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 528/728 functions 7/10 fuzzy 91.4627 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 91.46269
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 98.75
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 98.333336
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 76.92897
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
regressions vs baseline: 1
main/libs/RVLMiddleware/eZiText/src/clib/zi8match: matched_data 608 -> 528
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.04933
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.33570
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE FAIL: 1 regressions vs main
===== gate-py.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 96.6105 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 96.610466
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 98.333336
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 91.72702
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.06352
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-py2.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 98.6788 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 98.67878
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 98.333336
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 97.6727
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.06921
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-py3.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0329 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03294
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.69081
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.07019
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-korean.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 2712/5188 data 24/348 functions 2/3 fuzzy 99.3716 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 2/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 99.37163
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 97.22222
[libs/RVLMiddleware/eZiText/src/clib/zikorean] below 100: Zi8GetKoreanCandidates 98.68336
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 2712/5188 data 24 functions 2 fuzzy 86.9406
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.69363
global fuzzy_match_percent: 98.02277 -> 98.09173
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34007
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-korean-exact.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 60/348 functions 3/3 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 2712/5188 data 24 functions 2 fuzzy 86.9406
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.77630
global fuzzy_match_percent: 98.02277 -> 98.09282
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34203
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-full-pre-branch.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6154 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.61539
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.89238
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.0979 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 86.2638
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 60/348 functions 3/3 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 2712/5188 data 24 functions 2 fuzzy 86.9406
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0329 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03294
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.69081
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6360/6888 data 324/332 functions 15/17 fuzzy 99.9506 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 15/17
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 50.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 99.95064
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8GetDataSignature 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8IsDupWChar 99.36508
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6360/6888 data 324 functions 15 fuzzy 99.9506
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4356/4868 data 120/120 functions 5/6 fuzzy 99.9754 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 5/6
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 99.97535
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] below 100: Zi8MatchROMdata1 99.765625
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4356/4868 data 120 functions 5 fuzzy 99.9754
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.77630
global fuzzy_match_percent: 98.02277 -> 98.09282
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34203
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-py-branch.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0354 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03537
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.69777
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.77630
global fuzzy_match_percent: 98.02277 -> 98.09282
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34203
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-full-post-branch.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6154 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.61539
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.89238
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.0979 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 86.2638
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 60/348 functions 3/3 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 2712/5188 data 24 functions 2 fuzzy 86.9406
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0354 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03537
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.69777
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6360/6888 data 324/332 functions 15/17 fuzzy 99.9506 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 15/17
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 50.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 99.95064
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8GetDataSignature 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8IsDupWChar 99.36508
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6360/6888 data 324 functions 15 fuzzy 99.9506
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4356/4868 data 120/120 functions 5/6 fuzzy 99.9754 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 5/6
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 99.97535
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] below 100: Zi8MatchROMdata1 99.765625
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4356/4868 data 120 functions 5 fuzzy 99.9754
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.77630
global fuzzy_match_percent: 98.02277 -> 98.09282
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34203
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-final.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6154 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.61539
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.89238
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 94.3115
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.0979 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 86.2638
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 60/348 functions 3/3 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 2712/5188 data 24 functions 2 fuzzy 86.9406
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0354 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03537
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.69777
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 89.0165
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6360/6888 data 324/332 functions 15/17 fuzzy 99.9506 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 15/17
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 50.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 99.95064
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8GetDataSignature 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8IsDupWChar 99.36508
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6360/6888 data 324 functions 15 fuzzy 99.9506
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4356/4868 data 120/120 functions 5/6 fuzzy 99.9754 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 5/6
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 99.97535
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] below 100: Zi8MatchROMdata1 99.765625
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4356/4868 data 120 functions 5 fuzzy 99.9754
regressions vs baseline: 0
global matched_code_percent: 84.69363 -> 84.77630
global fuzzy_match_percent: 98.02277 -> 98.09282
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.34007 -> 90.34203
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,306 @@
===== gate-initial.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6154 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.61539
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.89238
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 98.6154
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.0979 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.09787
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 96.0979
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0354 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03537
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.69777
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6360/6888 data 324/332 functions 15/17 fuzzy 99.9506 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 15/17
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 50.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 99.95064
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8GetDataSignature 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8IsDupWChar 99.36508
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6360/6888 data 324 functions 15 fuzzy 99.9506
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4356/4868 data 120/120 functions 5/6 fuzzy 99.9754 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 5/6
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 99.97535
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] below 100: Zi8MatchROMdata1 99.765625
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4356/4868 data 120 functions 5 fuzzy 99.9754
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 60/348 functions 3/3 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 5188/5188 data 60 functions 3 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15438
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.43501
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-py-entry.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0378 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.03779
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.2011
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.704735
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15438
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.43501
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-ko-cursor.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6539 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.65385
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.96712
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 98.6154
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15447
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.43501
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-prepare-pointer.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.3191 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.319145
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.319145
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 96.0979
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15474
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.43501
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-match-group.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 608/728 functions 7/10 fuzzy 99.0451 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.04506
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 99.166664
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 97.242424
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.704735
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15474
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.43501
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-match-dictionary.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 728/728 functions 7/10 fuzzy 99.3934 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.39341
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 99.22314
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.704735
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15570
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.44156
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-match-offset.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 3720/8256 data 728/728 functions 7/10 fuzzy 99.4283 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 7/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.42829
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8MatchPhonetic 99.421486
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.704735
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.92520
global fuzzy_match_percent: 98.15438 -> 98.15581
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.44156
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-match-exact.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 5172/8256 data 728/728 functions 8/10 fuzzy 99.5300 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 8/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.53004
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.704735
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.97369
global fuzzy_match_percent: 98.15438 -> 98.15609
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.44156
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
===== gate-full.log =====
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 56/140 functions 1/7 fuzzy 98.6539 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.65385
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.96712
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 56 functions 1 fuzzy 98.6154
[libs/RVLMiddleware/eZiText/src/clib/zprepare] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zprepare] objdiff: code None/3760 data 8/68 functions 0/1 fuzzy 96.3191 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .data size 48 match None
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section .text size 3760 match 96.319145
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extab size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zprepare] section extabindex size 12 match 91.66667
[libs/RVLMiddleware/eZiText/src/clib/zprepare] below 100: Zi8PrepareMatch 96.319145
[libs/RVLMiddleware/eZiText/src/clib/zprepare] baseline: code None/3760 data 8 functions 0 fuzzy 96.0979
[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 5172/8256 data 728/728 functions 8/10 fuzzy 99.5300 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 8/10
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 99.53004
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyPhonetic 98.704735
[libs/RVLMiddleware/eZiText/src/clib/zi8match] below 100: Zi8GetPyFinal 99.245285
[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 3720/8256 data 608 functions 7 fuzzy 99.0354
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6360/6888 data 324/332 functions 15/17 fuzzy 99.9506 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 15/17
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 50.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 99.95064
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8GetDataSignature 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] below 100: Zi8IsDupWChar 99.36508
[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6360/6888 data 324 functions 15 fuzzy 99.9506
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4356/4868 data 120/120 functions 5/6 fuzzy 99.9754 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 5/6
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 99.97535
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] below 100: Zi8MatchROMdata1 99.765625
[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4356/4868 data 120 functions 5 fuzzy 99.9754
[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 60/348 functions 3/3 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 288 match None
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 5188/5188 data 60 functions 3 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 84.92520 -> 84.97369
global fuzzy_match_percent: 98.15438 -> 98.15609
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43501 -> 90.44156
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env python3
"""Local ctxdiff: compare a function in my .o vs orig .o.
usage: ldiff.py <unit> <symbol> [unit2] — unit like keyboard/tiCellPhone"""
import sys, subprocess, re
def disasm(obj, sym):
out = subprocess.check_output(['powerpc-eabi-objdump', '-dr', obj],
stderr=subprocess.DEVNULL).decode('latin1')
lines = out.splitlines()
res, cur = [], None
for l in lines:
m = re.match(r'^[0-9a-f]+ <([^>]+)>:', l)
if m:
cur = m.group(1)
if cur == sym:
im = re.match(r'^\s*([0-9a-f]+):\s+([0-9a-f ]+)\s+(\S+)(.*)$', l)
if im:
res.append((im.group(3), im.group(4).strip()))
if res and l.strip() == '':
break
return res
def main():
unit, name = sys.argv[1], sys.argv[2]
mine = disasm(f'build/43U/src/src/{unit}.o', name)
base = disasm(f'build/43U/obj/src/{unit}.o', name)
print(f'insns mine={len(mine)} base={len(base)}')
import difflib
a = [f'{m} {o}' for m, o in mine]
b = [f'{m} {o}' for m, o in base]
for d in difflib.unified_diff(b, a, 'base', 'mine', lineterm='', n=3):
print(d)
main()

View File

@@ -0,0 +1,734 @@
# Scenes round 6 attempts
Baseline: merged main `c923937c`. All original functions are present. Only the worker checkout and /tmp were used. Matching configuration was unchanged.
Coverage: all 27 initially open Select functions, eight initially open Setting functions and three initially open Memory functions received at least three distinct successful source builds this round. Earlier-round attempts are excluded. Failed builds do not count toward coverage. Trials are listed by baseline percentage.
No new instruction-exact functions or matched code/data bytes were gained. Retained changes restore original creation and dispatch behavior and improve Setting and Memory fuzzy scores. All three units remain incomplete.
## Measurements
- `src/scene/sdChannelSelect/iplSDChannelSelect`: instruction-exact 102 -> 102; objdiff exact 102 -> 102; matched code 24100 -> 24100/33828; matched data 224 -> 224/2960; fuzzy 98.042570% -> 98.042570%.
- `src/scene/setting/iplSetting`: instruction-exact 103 -> 103; objdiff exact 104 -> 104; matched code 30156 -> 30156/37884; matched data 1040 -> 1040/5696; fuzzy 98.495830% -> 98.664870%.
- `src/scene/sdChannelMemory/iplSDMemory`: instruction-exact 62 -> 62; objdiff exact 63 -> 63; matched code 14484 -> 14484/20872; matched data 200 -> 200/3344; fuzzy 97.657340% -> 98.189730%.
Function experiments: 144 successful builds and 6 failed builds.
## Retained changes
- Setting createBrowser registers the HTML layout archive from mpSettingHTMLFile and the browser configuration archive from mpWWWArchiveFile, following the original .64 and .68 member loads. The direct-page fallback remains initialized. The function improves from 98.843860% to 98.850500%, with 299/301 instructions.
- Setting validateEULA_ reuses the original status slot for GetTmdView and ContentExist, clears that status in the success block and initializes validity before lookup. The status and view are initialized on every path. The function improves from 81.212770% to 86.308510%, with 94/94 instructions and register/scheduling differences.
- Setting setUSBAP dispatches actual states 1 and 2 through a switch and places successful nickname initialization before the failure block. The function improves from 78.421050% to 98.070175%, with 56/57 instructions. The remaining difference is the original separate completion-byte condition/argument reload.
- Memory create uses static casts for the sixteen known TextBox panes, reads cached titles from the savedata manager field, retains the scroll animator across initialization and restart, restores the original dialog-layout binding receiver after background creation and writes the missing final transfer flag. The function improves from 95.456764% to 98.067670%, with 1060/1064 instructions. The indexed cache accessor is guarded by IPL_SDMEMORY_TITLE_CACHE_ACCESS, which only Memory.cpp defines.
- Select remains unchanged. The six flush experiments all retain exactly two reversed manager/heap loads. Source wrappers were restored after they did not change those instructions. All other unsuccessful Select trials were restored.
## Data and function-order audit
- All three pools are identical. Every original function exists. No owned assembly bodies remain. Explicit original function definitions retain their relative order; the three compiler-emitted Memory iterator helpers retain their existing ordering difference.
- Select .rodata/.sdata/.sdata2 and Memory .sdata/.sdata2 retain 100% objdiff section scores. Setting .bss/.sbss/.sdata/.sdata2 retain 100% section scores. Section-end alignment differences were not filled with artificial objects.
- Select .data remains 2736 bytes at 35.06984%; Setting .data remains 4016 bytes at 5.146636%; Memory .data remains 3144 bytes. Ordinary vtable relocations still differ from the extracted original deduplicated zero-filled weak data. Actual scene/handler tables and vtables retain their established order; no synthetic replacement vtables were introduced.
- Setting .rodata remains 600 versus 640 target bytes, at 32.25412%. Original scNumber/scNumber2 are two local 20-byte wide digit maps containing characters 0 through 9. The original unit has no relocation reference to either map, including section-relative references to their ranges. Their source callers remain unknown. Their local linkage was not changed to force emission, and no artificial references were added.
- The extracted original animation-table symbol spans 424 bytes, while the source named animation table spans 232 bytes and compiler jump tables follow it. The original symbol size was preserved.
- Raw instruction decoding undercounts objdiff-exact Setting::calcFadeout and Memory::updateState around CR1 varargs. Both raw and objdiff counts are reported; the decoder was unchanged.
Fresh ELF audit:
```text
src/scene/sdChannelSelect/iplSDChannelSelect: missing original functions []
original strong-function relative order identical True
.rodata original/source size 64/64
.data original/source size 2736/2736
.sdata2 original/source size 80/80
.sdata original/source size 80/79
src/scene/setting/iplSetting: missing original functions []
original strong-function relative order identical True
.bss original/source size 456/456
.rodata original/source size 640/600
.data original/source size 4016/4016
.sdata2 original/source size 64/60
.sdata original/source size 504/500
.sbss original/source size 16/12
__vt__Q33ipl5scene7APEvent original/source 0xe9c/0xe9c
__vt__Q33ipl5scene7Setting original/source 0xeb4/0xeb4
scNumber__Q23ipl5scene binding STB_LOCAL values [48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
original relocation references []
scNumber2__Q23ipl5scene binding STB_LOCAL values [48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
original relocation references []
original .rodata relocation targets ['lbl_81610AF0', 'lbl_81610B20', 'lbl_81610B80', 'scAnmTable__Q23ipl5scene']
src/scene/sdChannelMemory/iplSDMemory: missing original functions []
original strong-function relative order identical True
original compiler-emitted iterator helpers precede the two scene helpers in source output; original extracted helper ordering differs
.data original/source size 3144/3144
.sdata2 original/source size 48/48
.sdata original/source size 152/152
```
## Remaining functions
### src/scene/sdChannelSelect/iplSDChannelSelect
- `ipl::scene::SDChannelSelect::flushSaveDataAndMountSD()` 99.657140%: heap and NAND manager loads have reversed operand scheduling. src 0x8c base 0x8c insns 35/35.
- `ipl::scene::SDChannelSelect::handleSDTitleListResult()` 99.152050%: the short initial-result branch uses a different branch sequence plus register choices. src 0x2a8 base 0x2ac insns 170/171.
- `ipl::scene::SDChannelSelect::calcCommon()` 99.074070%: the button call emits an extra unused-parameter load. src 0x1b4 base 0x1b0 insns 109/108.
- `ipl::scene::SDChannelSelect::initializeNormalPage()` 98.936170%: the button call emits an extra unused-parameter load. src 0x17c base 0x178 insns 95/94.
- `ipl::scene::@unnamed@iplSDChannelSelect_cpp@::SDChannelSelectButtonEventHandler::onEventDerived(unsigned long, unsigned long, const ipl::controller::Interface*)` 98.541664%: 144/144 forwarding instructions retain receiver/register allocation and an initialized unused button argument. src 0x240 base 0x240 insns 144/144.
- `ipl::scene::SDChannelSelect::selectChannel(int, int)` 98.305084%: the button call emits an extra unused-parameter load. src 0xf0 base 0xec insns 60/59.
- `ipl::scene::SDChannelSelect::collectTitlesFromNandUsage(const long*, const long*, unsigned long long*, char*, unsigned long*)` 97.833336%: count increment and usage-threshold load scheduling differ. src 0x198 base 0x198 insns 102/102.
- `ipl::scene::SDChannelSelect::collectTitlesByUsage(const long*, const long*, unsigned long long*, char*, unsigned long*)` 97.811880%: count increment and usage-threshold load scheduling differ. src 0x194 base 0x194 insns 101/101.
- `ipl::scene::SDChannelSelect::enqueueNotice(unsigned long, unsigned long, unsigned long)` 97.511110%: initialized payload stores, member reloads and queue-call scheduling differ. src 0xb8 base 0xb4 insns 46/45.
- `ipl::scene::SDChannelSelect::collectTitlesByChannelOrder(const long*, const long*, unsigned long long*, char*, unsigned long*)` 97.293650%: 126/126 instructions retain usage-record reload scheduling and register differences. src 0x1f8 base 0x1f8 insns 126/126.
- `ipl::scene::SDChannelSelect::enqueueLoadNotice()` 95.652176%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x60 base 0x5c insns 24/23.
- `ipl::scene::SDChannelSelect::enqueuePageNotice()` 95.652176%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x60 base 0x5c insns 24/23.
- `ipl::scene::SDChannelSelect::enqueueResultNotice(unsigned long)` 95.652176%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x60 base 0x5c insns 24/23.
- `ipl::scene::SDChannelSelect::enqueueMoveNotice(unsigned long, unsigned long, unsigned long)` 95.652176%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x60 base 0x5c insns 24/23.
- `ipl::scene::SDChannelSelect::enqueueErrorNotice(unsigned long, unsigned long)` 95.652176%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x60 base 0x5c insns 24/23.
- `ipl::scene::SDChannelSelect::enqueueStateNotice(unsigned long, unsigned long, unsigned long, unsigned long)` 95.130430%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x60 base 0x5c insns 24/23.
- `ipl::scene::SDChannelSelect::destroy()` 95.097565%: teardown loop and pointer-reload scheduling differ. src 0x32c base 0x334 insns 203/205.
- `ipl::scene::SDChannelSelect::drawChannelTransitionObjects()` 94.974846%: paired-vector conversion, stack layout and transform scheduling differ. src 0x264 base 0x27c insns 153/159.
- `ipl::scene::SDChannelSelect::enqueueFinishNotice()` 94.444440%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x4c base 0x48 insns 19/18.
- `ipl::scene::SDChannelSelect::create()` 94.239720%: allocation receivers and polling-loop scheduling differ. src 0x248 base 0x248 insns 146/146.
- `ipl::scene::SDChannelSelect::enqueueStartNotice()` 94.117645%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x48 base 0x44 insns 18/17.
- `ipl::scene::SDChannelSelect::setChannelScissor(const ipl::scene::SDChannelObj*) const` 93.484980%: floating-point/register scheduling and scissor-bound evaluation differ. src 0x3a4 base 0x3a4 insns 233/233.
- `ipl::scene::SDChannelSelect::isCurrentTitleUsageEnough(const long*) const` 93.078430%: register, stack and operation scheduling differ. src 0xc8 base 0xcc insns 50/51.
- `ipl::scene::SDChannelSelect::enqueueChannelNotice(unsigned long, unsigned long, unsigned long, unsigned long)` 90.869570%: initialized payload stores, member reloads and queue-call scheduling differ. src 0x64 base 0x5c insns 25/23.
- `ipl::scene::SDChannelSelect::getCurrentTitleUsage(long*, long*) const` 86.823530%: register, stack and operation scheduling differ. src 0xc4 base 0xcc insns 49/51.
- `ipl::scene::SDChannelSelect::findAdjacentChannel(int, int*, int*) const` 81.777780%: 45/45 common-loop instructions still allocate page, slot and return values to different registers; early current-page load scheduling differs. src 0xb4 base 0xb4 insns 45/45.
- `ipl::scene::SDChannelSelect::collectTitlesBySpecialChannels(const long*, const long*, unsigned long long*, char*, unsigned long*)` 77.944595%: priority lookup sentinels, initialized coordinates, cache bounds and register lifetimes differ; the body has 350/361 instructions. src 0x578 base 0x5a4 insns 350/361.
### src/scene/setting/iplSetting
- `ipl::scene::Setting::createBrowser()` 98.850500%: correct archive registration is restored; rectangle conversion, stack placement and initialized direct-page dispatch leave 299/301 instructions. src 0x4ac base 0x4b4 insns 299/301.
- `ipl::scene::Setting::convertRevIP(unsigned char*, const char*)` 98.150690%: parser counters and output cursor use different callee-saved registers. src 0x124 base 0x124 insns 73/73.
- `ipl::scene::Setting::setUSBAP()` 98.070175%: state and success/failure blocks are restored; the compiler shares the tested completion byte with the call argument instead of the original separate reload at 56/57 instructions. src 0xe0 base 0xe4 insns 56/57.
- `ipl::scene::Setting::scanAP()` 94.562500%: animation-result normalization, dispatch and reload scheduling leave 266/272 instructions. src 0x428 base 0x440 insns 266/272.
- `ipl::scene::Setting::initKeyboard(const char*)` 93.309860%: initialized default limits, supported-form dispatch and allocation leave 212/213 instructions. src 0x350 base 0x354 insns 212/213.
- `ipl::scene::Setting::calcKeyboard()` 92.420690%: initialized default form text, supported-form dispatch and member reloads leave 289/290 instructions. src 0x484 base 0x488 insns 289/290.
- `ipl::scene::Setting::draw()` 91.036390%: the render-mode aggregate copy is shorter than the original field copies; stack placement and floating scheduling differ at 598/632 instructions. src 0x958 base 0x9e0 insns 598/632.
- `ipl::scene::Setting::validateEULA_()` 86.308510%: the shared initialized lookup/content status is restored; argument-base lifetime, validity allocation and scheduling still differ at 94/94 instructions. src 0x178 base 0x178 insns 94/94.
### src/scene/sdChannelMemory/iplSDMemory
- `ipl::scene::SDMemory::create(EGG::Heap*, ipl::nand::LayoutFile*, ipl::scene::SDChannelSelect*)` 98.067670%: original pane, binding and flag blocks are restored; true-visibility inlining and allocation/register scheduling differ at 1060/1064 instructions. src 0x1090 base 0x10a0 insns 1060/1064.
- `ipl::scene::SDMemory::onDialogState21()` 90.060974%: format initialization and pointer-length arithmetic differ; original empty-prefix initialization includes a zero-length memset whose source remains uncertain. Real prefix-copy trials did not match. src 0x13c base 0x148 insns 79/82.
- `ipl::scene::SDMemory::drawTransferTitles()` 85.421290%: color conversion, clipping, stack and register lifetimes differ at 422/451 instructions. The three gradient/clipping/iterator trials did not match. src 0x698 base 0x70c insns 422/451.
## New function attempt evidence
Each item records a distinct source transformation, its successful object build, instruction diff and pool result. Failed builds are separate. Restored experiments are not retained improvements. Payload words, button arguments, unsupported keyboard limits and failed-lookup coordinates remain initialized.
### src/scene/sdChannelSelect/iplSDChannelSelect
- `ipl::scene::SDChannelSelect::flushSaveDataAndMountSD()`: baseline 99.657140%, retained 99.657140%; 6 distinct successful attempts.
- read the named heap before a named save manager and invoke its flush: build OK; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind actual save manager and application heap as typed references: build OK; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101).
- resolve the asynchronous file inside a heap scope before storing it: build OK; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101).
- resolve the actual application heap through a named asynchronous save helper: build OK; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101).
- resolve the asynchronous save helper manager separately from its incoming heap: build OK; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101).
- resolve the actual application heap as a helper reference before asynchronous flushing: build OK; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::handleSDTitleListResult()`: baseline 99.152050%, retained 99.152050%; 3 distinct successful attempts.
- compare the location-missing result before the successful result: build OK; src 0x2a8 base 0x2ac insns 170/171; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- use an explicit fallback slot while loop and test the result before its added flag: build OK; src 0x2a8 base 0x2ac insns 170/171; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- keep a typed channel-title slot through the binary search and fallback clear: build FAILED; # Error: ^; # (10209) illegal implicit conversion from 'unsigned long *' to.
- keep the actual 32-bit channel-title slot through its binary search and clear: build OK; src 0x2a8 base 0x2ac insns 170/171; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::calcCommon()`: baseline 99.074070%, retained 99.074070%; 3 distinct successful attempts.
- resolve the new active handler through a named pointer before installation: build OK; src 0x1b4 base 0x1b0 insns 109/108; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101).
- pass an explicitly typed null outgoing handler to the actual button API: build FAILED; # Error: ^^; # (10473) '<' expected (you may have accidentally used a <: token).
- retain a named button receiver specifically for handler installation: build OK; src 0x1b4 base 0x1b0 insns 109/108; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101).
- pass the actual typed null handler using an unambiguous template spelling: build OK; src 0x1b4 base 0x1b0 insns 109/108; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::initializeNormalPage()`: baseline 98.936170%, retained 98.936170%; 3 distinct successful attempts.
- resolve the new active handler through a named pointer before installation: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- pass an explicitly typed null outgoing handler to the actual button API: build FAILED; # Error: ^^; # (10473) '<' expected (you may have accidentally used a <: token).
- retain a named button receiver specifically for handler installation: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- pass the actual typed null handler using an unambiguous template spelling: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::@unnamed@iplSDChannelSelect_cpp@::SDChannelSelectButtonEventHandler::onEventDerived(unsigned long, unsigned long, const ipl::controller::Interface*)`: baseline 98.541664%, retained 98.541664%; 3 distinct successful attempts.
- dispatch the supported button event through an unsigned switch: build OK; src 0x244 base 0x240 insns 145/144; --- replace mine 34:35 base 34:35; POOL IDENTICAL up to 101 (mine=101 base=101).
- exit unsupported events before entering the button state guards: build OK; src 0x240 base 0x240 insns 144/144; diffs 57: [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55]; POOL IDENTICAL up to 101 (mine=101 base=101).
- dispatch signed button events and bind the scene button as a typed reference: build OK; src 0x244 base 0x240 insns 145/144; --- replace mine 34:35 base 34:35; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::selectChannel(int, int)`: baseline 98.305084%, retained 98.305084%; 3 distinct successful attempts.
- resolve the new active handler through a named pointer before installation: build OK; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101).
- pass an explicitly typed null outgoing handler to the actual button API: build FAILED; # Error: ^^; # (10473) '<' expected (you may have accidentally used a <: token).
- retain a named button receiver specifically for handler installation: build OK; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101).
- pass the actual typed null handler using an unambiguous template spelling: build OK; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::collectTitlesFromNandUsage(const long*, const long*, unsigned long long*, char*, unsigned long*)`: baseline 97.833336%, retained 97.833336%; 3 distinct successful attempts.
- use a discarded postfix output-count increment before usage testing: build OK; src 0x198 base 0x198 insns 102/102; diffs 4: [69, 70, 71, 72]; POOL IDENTICAL up to 101 (mine=101 base=101).
- assign the commuted next count directly to the output count: build OK; src 0x198 base 0x198 insns 102/102; diffs 4: [69, 70, 71, 72]; POOL IDENTICAL up to 101 (mine=101 base=101).
- retain the current count and dereference the first usage threshold directly: build OK; src 0x198 base 0x198 insns 102/102; diffs 4: [69, 70, 71, 72]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::collectTitlesByUsage(const long*, const long*, unsigned long long*, char*, unsigned long*)`: baseline 97.811880%, retained 97.811880%; 3 distinct successful attempts.
- use a discarded postfix output-count increment before usage testing: build OK; src 0x194 base 0x194 insns 101/101; diffs 4: [67, 68, 69, 70]; POOL IDENTICAL up to 101 (mine=101 base=101).
- assign the commuted next count directly to the output count: build OK; src 0x194 base 0x194 insns 101/101; diffs 4: [67, 68, 69, 70]; POOL IDENTICAL up to 101 (mine=101 base=101).
- retain the current count and dereference the first usage threshold directly: build OK; src 0x194 base 0x194 insns 101/101; diffs 4: [67, 68, 69, 70]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueNotice(unsigned long, unsigned long, unsigned long)`: baseline 97.511110%, retained 97.511110%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0xd8 base 0xb4 insns 54/45; --- delete mine 4:5 base 4:4; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0xb8 base 0xb4 insns 46/45; --- replace mine 10:11 base 10:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0xb8 base 0xb4 insns 46/45; --- replace mine 10:11 base 10:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::collectTitlesByChannelOrder(const long*, const long*, unsigned long long*, char*, unsigned long*)`: baseline 97.293650%, retained 97.293650%; 3 distinct successful attempts.
- declare block usage before byte usage to change accumulator lifetimes: build OK; src 0x1f8 base 0x1f8 insns 126/126; diffs 31: [11, 12, 19, 23, 27, 28, 29, 33, 34, 36, 37, 38, 41, 42, 51, 52, 56, 57, 59, 62]; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the ordered channel index to the actual traversal-table entry: build OK; src 0x1f8 base 0x1f8 insns 126/126; diffs 22: [19, 23, 27, 28, 29, 33, 34, 36, 37, 38, 41, 42, 51, 52, 56, 85, 86, 87, 88, 102]; POOL IDENTICAL up to 101 (mine=101 base=101).
- use discarded postfix increments for NAND records and output count: build OK; src 0x1f8 base 0x1f8 insns 126/126; diffs 22: [19, 23, 27, 28, 29, 33, 34, 36, 37, 38, 41, 42, 51, 52, 56, 85, 86, 87, 88, 102]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueLoadNotice()`: baseline 95.652176%, retained 95.652176%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x6c base 0x5c insns 27/23; --- replace mine 7:19 base 7:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueuePageNotice()`: baseline 95.652176%, retained 95.652176%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x6c base 0x5c insns 27/23; --- replace mine 7:19 base 7:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueResultNotice(unsigned long)`: baseline 95.652176%, retained 95.652176%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x78 base 0x5c insns 30/23; --- replace mine 7:19 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueMoveNotice(unsigned long, unsigned long, unsigned long)`: baseline 95.652176%, retained 95.652176%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x74 base 0x5c insns 29/23; --- replace mine 7:20 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueErrorNotice(unsigned long, unsigned long)`: baseline 95.652176%, retained 95.652176%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x74 base 0x5c insns 29/23; --- replace mine 7:19 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueStateNotice(unsigned long, unsigned long, unsigned long, unsigned long)`: baseline 95.130430%, retained 95.130430%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x78 base 0x5c insns 30/23; --- replace mine 7:20 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:9; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::destroy()`: baseline 95.097565%, retained 95.097565%; 3 distinct successful attempts.
- compare real asynchronous completion results explicitly with false: build OK; src 0x32c base 0x334 insns 203/205; --- insert mine 11:11 base 11:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- retain the owned worker through cancellation, termination and deletion: build OK; src 0x32c base 0x334 insns 203/205; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 101 (mine=101 base=101).
- resolve each removed channel through an explicit head-removal loop: build OK; src 0x32c base 0x334 insns 203/205; --- insert mine 11:11 base 11:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::drawChannelTransitionObjects()`: baseline 94.974846%, retained 94.974846%; 3 distinct successful attempts.
- assign each typed translation vector before storing it in the destination pane: build OK; src 0x240 base 0x27c insns 144/159; --- replace mine 6:10 base 6:20; POOL IDENTICAL up to 101 (mine=101 base=101).
- separate channel visibility and ready-state exits before rendering: build OK; src 0x264 base 0x27c insns 153/159; --- replace mine 6:10 base 6:20; POOL IDENTICAL up to 101 (mine=101 base=101).
- use the equivalent source-coordinate negation and test destination index first: build OK; src 0x264 base 0x27c insns 153/159; --- replace mine 6:10 base 6:20; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueFinishNotice()`: baseline 94.444440%, retained 94.444440%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x58 base 0x48 insns 22/18; --- replace mine 2:3 base 2:4; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x4c base 0x48 insns 19/18; --- delete mine 12:13 base 12:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x4c base 0x48 insns 19/18; --- replace mine 2:3 base 2:3; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::create()`: baseline 94.239720%, retained 94.239720%; 3 distinct successful attempts.
- use the platform tick type for startup timestamps and elapsed ticks: build OK; src 0x248 base 0x248 insns 146/146; diffs 84: [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]; POOL IDENTICAL up to 101 (mine=101 base=101).
- retain the scene allocation heap for the two owned UI heaps: build OK; src 0x24c base 0x248 insns 147/146; --- delete mine 30:31 base 30:30; POOL IDENTICAL up to 101 (mine=101 base=101).
- poll startup through an explicit completed-state exit: build OK; src 0x248 base 0x248 insns 146/146; diffs 87: [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueStartNotice()`: baseline 94.117645%, retained 94.117645%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x54 base 0x44 insns 21/17; --- replace mine 2:3 base 2:4; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x48 base 0x44 insns 18/17; --- delete mine 12:13 base 12:12; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x48 base 0x44 insns 18/17; --- replace mine 2:3 base 2:3; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::setChannelScissor(const ipl::scene::SDChannelObj*) const`: baseline 93.484980%, retained 93.484980%; 3 distinct successful attempts.
- resolve projection before converting the channel translation vector: build OK; src 0x3a8 base 0x3a4 insns 234/233; --- replace mine 14:16 base 14:15; POOL IDENTICAL up to 101 (mine=101 base=101).
- calculate orthographic edges in top, bottom, left and right order: build OK; src 0x3a4 base 0x3a4 insns 233/233; diffs 69: [38, 39, 40, 41, 43, 44, 45, 46, 49, 50, 51, 52, 53, 54, 68, 69, 70, 71, 72, 74]; POOL IDENTICAL up to 101 (mine=101 base=101).
- expand scissor dimensions before moving the upper-left origin: build OK; src 0x3a4 base 0x3a4 insns 233/233; diffs 71: [38, 39, 40, 41, 43, 44, 46, 49, 50, 52, 53, 54, 68, 69, 70, 71, 72, 74, 75, 76]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::isCurrentTitleUsageEnough(const long*) const`: baseline 93.078430%, retained 93.078430%; 3 distinct successful attempts.
- declare the lookup cursor before reading the NAND record count: build OK; src 0xc8 base 0xcc insns 50/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101).
- search NAND records with an explicitly initialized while-loop cursor: build OK; src 0xc8 base 0xcc insns 50/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101).
- retain the current identifier as const and compare the terminal cursor with its limit: build OK; src 0xc8 base 0xcc insns 50/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::enqueueChannelNotice(unsigned long, unsigned long, unsigned long, unsigned long)`: baseline 90.869570%, retained 90.869570%; 3 distinct successful attempts.
- construct an immutable fully initialized command aggregate before queue insertion: build OK; src 0x80 base 0x5c insns 32/23; --- replace mine 7:19 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- bind the actual command-argument union before writing all payload values: build OK; src 0x64 base 0x5c insns 25/23; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the title identifier before command type and all initialized payload values: build OK; src 0x64 base 0x5c insns 25/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::getCurrentTitleUsage(long*, long*) const`: baseline 86.823530%, retained 86.823530%; 3 distinct successful attempts.
- declare the lookup cursor before reading the NAND record count: build OK; src 0xc4 base 0xcc insns 49/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101).
- search NAND records with an explicitly initialized while-loop cursor: build OK; src 0xc4 base 0xcc insns 49/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101).
- retain the current identifier as const and compare the terminal cursor with its limit: build OK; src 0xc4 base 0xcc insns 49/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::findAdjacentChannel(int, int*, int*) const`: baseline 81.777780%, retained 81.777780%; 6 distinct successful attempts.
- initialize the current page on declaration and keep the chosen direction step const: build OK; src 0xb4 base 0xb4 insns 45/45; diffs 9: [0, 2, 3, 4, 6, 13, 16, 17, 22]; POOL IDENTICAL up to 101 (mine=101 base=101).
- calculate slot remainder before its quotient: build OK; src 0xb4 base 0xb4 insns 45/45; diffs 21: [0, 2, 3, 4, 6, 7, 9, 11, 12, 13, 14, 16, 17, 19, 20, 27, 29, 32, 33, 35]; POOL IDENTICAL up to 101 (mine=101 base=101).
- store the selected index before page through the common found return: build OK; src 0xb4 base 0xb4 insns 45/45; diffs 11: [0, 2, 3, 4, 6, 13, 16, 17, 22, 35, 37]; POOL IDENTICAL up to 101 (mine=101 base=101).
- initialize forward direction before current coordinates and branch after linearizing the current slot: build OK; src 0xb4 base 0xb4 insns 45/45; diffs 12: [0, 2, 3, 4, 6, 7, 11, 13, 16, 17, 20, 22]; POOL IDENTICAL up to 101 (mine=101 base=101).
- initialize forward direction and the next slot before reading page bounds: build OK; src 0xb4 base 0xb4 insns 45/45; diffs 18: [0, 2, 3, 4, 6, 7, 11, 13, 14, 16, 17, 19, 20, 22, 27, 29, 33, 39]; POOL IDENTICAL up to 101 (mine=101 base=101).
- assign the chosen direction before retaining the current page as const: build OK; src 0xb4 base 0xb4 insns 45/45; diffs 12: [0, 2, 3, 4, 6, 7, 11, 13, 16, 17, 20, 22]; POOL IDENTICAL up to 101 (mine=101 base=101).
- `ipl::scene::SDChannelSelect::collectTitlesBySpecialChannels(const long*, const long*, unsigned long long*, char*, unsigned long*)`: baseline 77.944595%, retained 77.944595%; 3 distinct successful attempts.
- declare initialized priority coordinates before the NAND usage indices: build OK; src 0x57c base 0x5a4 insns 351/361; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101).
- predecrement the bounded cache cursor in the loop condition: build OK; src 0x57c base 0x5a4 insns 351/361; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101).
- exclude the second priority title before the first priority title: build OK; src 0x578 base 0x5a4 insns 350/361; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101).
### src/scene/setting/iplSetting
- `ipl::scene::Setting::createBrowser()`: baseline 98.843860%, retained 98.850500%; 3 distinct successful attempts.
- restore original HTML archive and browser configuration file registration receivers: build OK; src 0x4ac base 0x4b4 insns 299/301; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108).
- restore registration and give the direct-page fallback its own initialized default path: build OK; src 0x4b8 base 0x4b4 insns 302/301; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108).
- restore registration and scan direct-page names with an initialized while-loop cursor: build OK; src 0x4ac base 0x4b4 insns 299/301; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::convertRevIP(unsigned char*, const char*)`: baseline 98.150690%, retained 98.150690%; 6 distinct successful attempts.
- assign component cursors after character conversion before scanning: build OK; src 0x124 base 0x124 insns 73/73; diffs 26: [6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 28, 29, 30, 36, 38, 45]; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the first output slot separately from the advancing component cursor: build OK; src 0x11c base 0x124 insns 71/73; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 108 (mine=108 base=108).
- resolve a typed component substring before decimal conversion: build OK; src 0x124 base 0x124 insns 73/73; diffs 21: [6, 8, 12, 15, 16, 17, 18, 19, 21, 28, 29, 30, 36, 38, 45, 46, 47, 48, 50, 64]; POOL IDENTICAL up to 108 (mine=108 base=108).
- declare the parsed component count before its actual conversion buffer: build OK; src 0x124 base 0x124 insns 73/73; diffs 21: [6, 8, 12, 15, 16, 17, 18, 19, 21, 28, 29, 30, 36, 38, 45, 46, 47, 48, 50, 64]; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain a named scanning index in a while loop before the advancing output cursor: build OK; src 0x124 base 0x124 insns 73/73; diffs 16: [6, 8, 12, 15, 16, 17, 18, 19, 21, 29, 30, 36, 38, 45, 47, 48]; POOL IDENTICAL up to 108 (mine=108 base=108).
- resolve the output cursor before component offsets and advance count before storing the next offset: build OK; src 0x124 base 0x124 insns 73/73; diffs 21: [6, 8, 12, 15, 16, 17, 18, 19, 21, 28, 29, 30, 36, 38, 45, 46, 47, 48, 50, 64]; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::scanAP()`: baseline 94.562500%, retained 94.562500%; 3 distinct successful attempts.
- bind each selected scroll animator before initializing its frame: build OK; src 0x428 base 0x440 insns 266/272; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 108 (mine=108 base=108).
- compare actual animation completion with an explicit false value: build OK; src 0x428 base 0x440 insns 266/272; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 108 (mine=108 base=108).
- initialize the pane manager through a typed reference in a receiver scope: build OK; src 0x428 base 0x440 insns 266/272; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::initKeyboard(const char*)`: baseline 93.309860%, retained 93.309860%; 3 distinct successful attempts.
- initialize supported keyboard string limits before row limits: build OK; src 0x350 base 0x354 insns 212/213; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the actual memo form while selecting its regional dictionaries: build FAILED; # Error: ^^^^^^^^; # (10140) undefined identifier 'MemoForm'.
- construct the keyboard setting aggregate in physical member order: build OK; src 0x350 base 0x354 insns 212/213; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the declared memo input form while selecting its regional dictionaries: build OK; src 0x34c base 0x354 insns 211/213; --- delete mine 17:18 base 17:17; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::calcKeyboard()`: baseline 92.420690%, retained 92.420690%; 3 distinct successful attempts.
- retain the current mask-character pointer while advancing its index: build OK; src 0x480 base 0x488 insns 288/290; --- replace mine 11:12 base 11:12; POOL IDENTICAL up to 108 (mine=108 base=108).
- dispatch each original supported form explicitly in completion state: build FAILED; # Error: ^; # (10121) declaration syntax error.
- initialize the shared form pointer before dispatch and advance mask index separately: build OK; src 0x480 base 0x488 insns 288/290; --- delete mine 6:7 base 6:6; POOL IDENTICAL up to 108 (mine=108 base=108).
- dispatch the actual supported completion forms through separate switch cases: build OK; src 0x490 base 0x488 insns 292/290; --- replace mine 11:12 base 11:12; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::draw()`: baseline 91.036390%, retained 91.036390%; 3 distinct successful attempts.
- copy render mode through its actual const source object reference: build OK; src 0x958 base 0x9e0 insns 598/632; --- replace mine 18:19 base 18:19; POOL IDENTICAL up to 108 (mine=108 base=108).
- initialize the existing wide texture object before receiving browser texture data: build OK; src 0x970 base 0x9e0 insns 604/632; --- replace mine 14:15 base 14:15; POOL IDENTICAL up to 108 (mine=108 base=108).
- compare draw-layer membership directly with zero: build OK; src 0x958 base 0x9e0 insns 598/632; --- replace mine 18:19 base 18:19; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::validateEULA_()`: baseline 81.212770%, retained 86.308510%; 9 distinct successful attempts.
- test title-unavailable results in reverse order before the ES failure branch: build OK; src 0x174 base 0x178 insns 93/94; --- replace mine 5:6 base 5:8; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the allocated TMD view through the final heap release: build OK; src 0x174 base 0x178 insns 93/94; --- replace mine 5:6 base 5:8; POOL IDENTICAL up to 108 (mine=108 base=108).
- initialize content status on success and derive the valid result from lookup status: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the actual shared lookup/content status and initialize validity before lookup: build OK; src 0x178 base 0x178 insns 94/94; diffs 56: [6, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the shared status with the TMD output initialized before validity: build OK; src 0x178 base 0x178 insns 94/94; diffs 52: [6, 8, 9, 11, 12, 13, 23, 24, 25, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46]; POOL IDENTICAL up to 108 (mine=108 base=108).
- assign the shared initialized status after declaring its output slot: build OK; src 0x178 base 0x178 insns 94/94; diffs 56: [6, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; POOL IDENTICAL up to 108 (mine=108 base=108).
- hold EULA validation as the SDK BOOL status through lookup and cleanup: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108).
- hold the validation flag as a normalized unsigned status: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the actual lookup heap before initializing the SDK validation status: build OK; src 0x17c base 0x178 insns 95/94; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108).
- `ipl::scene::Setting::setUSBAP()`: baseline 78.421050%, retained 98.070175%; 9 distinct successful attempts.
- retain nickname success as const and test failure with explicit false: build OK; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- test the initial setup states through their equivalent signed range: build OK; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:8 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- retain the typed owner nickname storage before fetching it: build OK; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- derive successful nickname blocks and retain normalized success as a BOOL: build OK; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- derive successful nickname blocks and explicitly normalize an integer result twice: build OK; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- derive successful nickname blocks with an unsigned normalized status: build OK; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- express USB access and completion as the two actual switch states with normalized result: build OK; src 0xe0 base 0xe4 insns 56/57; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- switch actual USB states using the original boolean nickname status: build OK; src 0xe0 base 0xe4 insns 56/57; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108).
- make the actual idle USB state explicit before active switch states: build OK; src 0xe4 base 0xe4 insns 57/57; diffs 39: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]; POOL IDENTICAL up to 108 (mine=108 base=108).
### src/scene/sdChannelMemory/iplSDMemory
- `ipl::scene::SDMemory::create(EGG::Heap*, ipl::nand::LayoutFile*, ipl::scene::SDChannelSelect*)`: baseline 95.456764%, retained 98.067670%; 12 distinct successful attempts.
- derive the known textbox pane casts and restore the cache visibility branch order: build OK; src 0x1098 base 0x10a0 insns 1062/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- derive textbox casts and assign cache count from the successful slot index: build OK; src 0x10a0 base 0x10a0 insns 1064/1064; diffs 639: [5, 10, 17, 21, 27, 33, 34, 39, 40, 45, 46, 51, 57, 63, 69, 75, 81, 109, 116, 117]; POOL IDENTICAL up to 90 (mine=90 base=90).
- derive textbox casts and express cache capacity through the actual channel limit: build OK; src 0x1098 base 0x10a0 insns 1062/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- restore final transfer flag, original binding receiver and retained scroll animator: build OK; src 0x1094 base 0x10a0 insns 1061/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- restore creation blocks and declare the reusable textbox receiver before allocation: build OK; src 0x1094 base 0x10a0 insns 1061/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- restore creation blocks and retain the original cache reference as const: build OK; src 0x1094 base 0x10a0 insns 1061/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- inline known visible-pane operations and index the actual cache field from its manager: build OK; src 0x1088 base 0x10a0 insns 1058/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- bind cache manager by const reference with original creation blocks: build OK; src 0x1088 base 0x10a0 insns 1058/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- retain a const cache manager pointer and actual cache capacity with original creation blocks: build OK; src 0x1088 base 0x10a0 insns 1058/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- complete original creation blocks and resolve cached titles from their owning manager field: build OK; src 0x1090 base 0x10a0 insns 1060/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- complete original creation blocks with the savedata owner held by const reference: build OK; src 0x1090 base 0x10a0 insns 1060/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- complete original creation blocks using the named channel capacity for cache iteration: build OK; src 0x1090 base 0x10a0 insns 1060/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90).
- `ipl::scene::SDMemory::onDialogState21()`: baseline 90.060974%, retained 90.060974%; 3 distinct successful attempts.
- copy the actual message prefix with bounded wide-string copy and terminate its last element: build OK; src 0x144 base 0x148 insns 81/82; --- replace mine 5:8 base 5:8; POOL IDENTICAL up to 90 (mine=90 base=90).
- copy the exact message-prefix character range with wide memory copy: build OK; src 0x144 base 0x148 insns 81/82; --- replace mine 5:8 base 5:8; POOL IDENTICAL up to 90 (mine=90 base=90).
- copy the exact message prefix using its actual wide-character byte count: build OK; src 0x144 base 0x148 insns 81/82; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 90 (mine=90 base=90).
- `ipl::scene::SDMemory::drawTransferTitles()`: baseline 85.421290%, retained 85.421290%; 3 distinct successful attempts.
- bind explicit top and bottom gradient colors from the actual title color: build OK; src 0x718 base 0x70c insns 454/451; --- replace mine 22:23 base 22:23; POOL IDENTICAL up to 90 (mine=90 base=90).
- retain the floating row count and test the upper title clipping bound first: build OK; src 0x698 base 0x70c insns 422/451; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 90 (mine=90 base=90).
- advance title alpha iterators in the loop header and assign NAND row count explicitly: build OK; src 0x698 base 0x70c insns 422/451; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 90 (mine=90 base=90).
## Commits and changed files
- e8d31b46 restore scene creation and setup blocks
- `include/system/iplSaveDataManager.h`
- `src/scene/sdChannelMemory/iplSDMemory.cpp`
- `src/scene/setting/iplSetting.cpp`
- `tools/decomp-assist/sol-low-scenes-round6.md` records this round.
## Gate blocks
All captured round 6 gate blocks are copied verbatim below. Quick checks are identified by their filenames. The source commit followed a full GATE PASS. The final full block covers every unit exercised this round.
### sol-r6-baseline-gate.txt
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/sdChannelSelect/iplSDChannelSelect] pool: IDENTICAL
[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 24100/33828 data 224/2960 functions 102/129 fuzzy 98.0426 linked code 0
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 102/129
[src/scene/sdChannelSelect/iplSDChannelSelect] section .data size 2736 match 35.06984
[src/scene/sdChannelSelect/iplSDChannelSelect] section .rodata size 64 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata2 size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .text size 33828 match 98.04257
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: create__Q33ipl5scene15SDChannelSelectFv 94.23972
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStartNotice__Q33ipl5scene15SDChannelSelectFv 94.117645
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueFinishNotice__Q33ipl5scene15SDChannelSelectFv 94.44444
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 97.51111
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueLoadNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueuePageNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueResultNotice__Q33ipl5scene15SDChannelSelectFUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 90.86957
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueMoveNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 95.13043
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueErrorNotice__Q33ipl5scene15SDChannelSelectFUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv 99.15205
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl 93.07843
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl 86.82353
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 77.944595
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi 81.77778
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: calcCommon__Q33ipl5scene15SDChannelSelectFv 99.07407
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: destroy__Q33ipl5scene15SDChannelSelectFv 95.097565
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: drawChannelTransitionObjects__Q33ipl5scene15SDChannelSelectFv 94.974846
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: initializeNormalPage__Q33ipl5scene15SDChannelSelectFv 98.93617
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: selectChannel__Q33ipl5scene15SDChannelSelectFii 98.305084
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.48498
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: onEventDerived__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@33SDChannelSelectButtonEventHandlerFUlUlPCQ33ipl10controller9Interface 98.541664
[src/scene/sdChannelSelect/iplSDChannelSelect] baseline: code 24100/33828 data 224 functions 102 fuzzy 98.0426
[src/scene/setting/iplSetting] pool: IDENTICAL
[src/scene/setting/iplSetting] objdiff: code 30156/37884 data 1040/5696 functions 104/112 fuzzy 98.4958 linked code 0
[src/scene/setting/iplSetting] instruction-exact functions: 103/112
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
[src/scene/setting/iplSetting] section .data size 4016 match 5.146636
[src/scene/setting/iplSetting] section .rodata size 640 match 32.25412
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
[src/scene/setting/iplSetting] section .text size 37884 match 98.49583
[src/scene/setting/iplSetting] below 100: createBrowser__Q33ipl5scene7SettingFv 98.84386
[src/scene/setting/iplSetting] below 100: draw__Q33ipl5scene7SettingFv 91.03639
[src/scene/setting/iplSetting] below 100: initKeyboard__Q33ipl5scene7SettingFPCc 93.30986
[src/scene/setting/iplSetting] below 100: calcKeyboard__Q33ipl5scene7SettingFv 92.42069
[src/scene/setting/iplSetting] below 100: convertRevIP__Q33ipl5scene7SettingFPUcPCc 98.15069
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 94.5625
[src/scene/setting/iplSetting] below 100: validateEULA___Q33ipl5scene7SettingFv 81.21277
[src/scene/setting/iplSetting] below 100: setUSBAP__Q33ipl5scene7SettingFv 78.42105
[src/scene/setting/iplSetting] baseline: code 30156/37884 data 1040 functions 104 fuzzy 98.4958
[src/scene/sdChannelMemory/iplSDMemory] pool: IDENTICAL
[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 14484/20872 data 200/3344 functions 63/66 fuzzy 97.6573 linked code 0
[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 62/66
[src/scene/sdChannelMemory/iplSDMemory] section .data size 3144 match None
[src/scene/sdChannelMemory/iplSDMemory] section .sdata size 152 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .sdata2 size 48 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .text size 20872 match 97.65734
[src/scene/sdChannelMemory/iplSDMemory] below 100: create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect 95.456764
[src/scene/sdChannelMemory/iplSDMemory] below 100: onDialogState21__Q33ipl5scene8SDMemoryFv 90.060974
[src/scene/sdChannelMemory/iplSDMemory] below 100: drawTransferTitles__Q33ipl5scene8SDMemoryFv 85.42129
[src/scene/sdChannelMemory/iplSDMemory] baseline: code 14484/20872 data 200 functions 63 fuzzy 97.6573
regressions vs baseline: 0
global matched_code_percent: 84.58613 -> 84.58613
global fuzzy_match_percent: 97.98290 -> 97.98290
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.32545 -> 90.32545
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
### sol-r6-gate-derived-quick.txt
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/sdChannelSelect/iplSDChannelSelect] pool: IDENTICAL
[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 24100/33828 data 224/2960 functions 102/129 fuzzy 98.0426 linked code 0
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 102/129
[src/scene/sdChannelSelect/iplSDChannelSelect] section .data size 2736 match 35.06984
[src/scene/sdChannelSelect/iplSDChannelSelect] section .rodata size 64 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata2 size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .text size 33828 match 98.04257
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: create__Q33ipl5scene15SDChannelSelectFv 94.23972
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStartNotice__Q33ipl5scene15SDChannelSelectFv 94.117645
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueFinishNotice__Q33ipl5scene15SDChannelSelectFv 94.44444
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 97.51111
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueLoadNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueuePageNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueResultNotice__Q33ipl5scene15SDChannelSelectFUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 90.86957
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueMoveNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 95.13043
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueErrorNotice__Q33ipl5scene15SDChannelSelectFUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv 99.15205
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl 93.07843
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl 86.82353
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 77.944595
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi 81.77778
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: calcCommon__Q33ipl5scene15SDChannelSelectFv 99.07407
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: destroy__Q33ipl5scene15SDChannelSelectFv 95.097565
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: drawChannelTransitionObjects__Q33ipl5scene15SDChannelSelectFv 94.974846
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: initializeNormalPage__Q33ipl5scene15SDChannelSelectFv 98.93617
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: selectChannel__Q33ipl5scene15SDChannelSelectFii 98.305084
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.48498
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: onEventDerived__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@33SDChannelSelectButtonEventHandlerFUlUlPCQ33ipl10controller9Interface 98.541664
[src/scene/sdChannelSelect/iplSDChannelSelect] baseline: code 24100/33828 data 224 functions 102 fuzzy 98.0426
[src/scene/setting/iplSetting] pool: IDENTICAL
[src/scene/setting/iplSetting] objdiff: code 30156/37884 data 1040/5696 functions 104/112 fuzzy 98.6649 linked code 0
[src/scene/setting/iplSetting] instruction-exact functions: 103/112
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
[src/scene/setting/iplSetting] section .data size 4016 match 5.146636
[src/scene/setting/iplSetting] section .rodata size 640 match 32.25412
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
[src/scene/setting/iplSetting] section .text size 37884 match 98.66487
[src/scene/setting/iplSetting] below 100: createBrowser__Q33ipl5scene7SettingFv 98.8505
[src/scene/setting/iplSetting] below 100: draw__Q33ipl5scene7SettingFv 91.03639
[src/scene/setting/iplSetting] below 100: initKeyboard__Q33ipl5scene7SettingFPCc 93.30986
[src/scene/setting/iplSetting] below 100: calcKeyboard__Q33ipl5scene7SettingFv 92.42069
[src/scene/setting/iplSetting] below 100: convertRevIP__Q33ipl5scene7SettingFPUcPCc 98.15069
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 94.5625
[src/scene/setting/iplSetting] below 100: validateEULA___Q33ipl5scene7SettingFv 86.30851
[src/scene/setting/iplSetting] below 100: setUSBAP__Q33ipl5scene7SettingFv 98.070175
[src/scene/setting/iplSetting] baseline: code 30156/37884 data 1040 functions 104 fuzzy 98.4958
[src/scene/sdChannelMemory/iplSDMemory] pool: IDENTICAL
[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 14484/20872 data 200/3344 functions 63/66 fuzzy 98.1897 linked code 0
[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 62/66
[src/scene/sdChannelMemory/iplSDMemory] section .data size 3144 match None
[src/scene/sdChannelMemory/iplSDMemory] section .sdata size 152 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .sdata2 size 48 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .text size 20872 match 98.18973
[src/scene/sdChannelMemory/iplSDMemory] below 100: create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect 98.06767
[src/scene/sdChannelMemory/iplSDMemory] below 100: onDialogState21__Q33ipl5scene8SDMemoryFv 90.060974
[src/scene/sdChannelMemory/iplSDMemory] below 100: drawTransferTitles__Q33ipl5scene8SDMemoryFv 85.42129
[src/scene/sdChannelMemory/iplSDMemory] baseline: code 14484/20872 data 200 functions 63 fuzzy 97.6573
regressions vs baseline: 0
global matched_code_percent: 84.58613 -> 84.58613
global fuzzy_match_percent: 97.98290 -> 97.98875
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.32545 -> 90.32545
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
### sol-r6-gate-derived-full.txt
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/sdChannelSelect/iplSDChannelSelect] pool: IDENTICAL
[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 24100/33828 data 224/2960 functions 102/129 fuzzy 98.0426 linked code 0
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 102/129
[src/scene/sdChannelSelect/iplSDChannelSelect] section .data size 2736 match 35.06984
[src/scene/sdChannelSelect/iplSDChannelSelect] section .rodata size 64 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata2 size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .text size 33828 match 98.04257
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: create__Q33ipl5scene15SDChannelSelectFv 94.23972
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStartNotice__Q33ipl5scene15SDChannelSelectFv 94.117645
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueFinishNotice__Q33ipl5scene15SDChannelSelectFv 94.44444
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 97.51111
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueLoadNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueuePageNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueResultNotice__Q33ipl5scene15SDChannelSelectFUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 90.86957
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueMoveNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 95.13043
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueErrorNotice__Q33ipl5scene15SDChannelSelectFUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv 99.15205
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl 93.07843
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl 86.82353
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 77.944595
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi 81.77778
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: calcCommon__Q33ipl5scene15SDChannelSelectFv 99.07407
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: destroy__Q33ipl5scene15SDChannelSelectFv 95.097565
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: drawChannelTransitionObjects__Q33ipl5scene15SDChannelSelectFv 94.974846
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: initializeNormalPage__Q33ipl5scene15SDChannelSelectFv 98.93617
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: selectChannel__Q33ipl5scene15SDChannelSelectFii 98.305084
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.48498
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: onEventDerived__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@33SDChannelSelectButtonEventHandlerFUlUlPCQ33ipl10controller9Interface 98.541664
[src/scene/sdChannelSelect/iplSDChannelSelect] baseline: code 24100/33828 data 224 functions 102 fuzzy 98.0426
[src/scene/setting/iplSetting] pool: IDENTICAL
[src/scene/setting/iplSetting] objdiff: code 30156/37884 data 1040/5696 functions 104/112 fuzzy 98.6649 linked code 0
[src/scene/setting/iplSetting] instruction-exact functions: 103/112
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
[src/scene/setting/iplSetting] section .data size 4016 match 5.146636
[src/scene/setting/iplSetting] section .rodata size 640 match 32.25412
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
[src/scene/setting/iplSetting] section .text size 37884 match 98.66487
[src/scene/setting/iplSetting] below 100: createBrowser__Q33ipl5scene7SettingFv 98.8505
[src/scene/setting/iplSetting] below 100: draw__Q33ipl5scene7SettingFv 91.03639
[src/scene/setting/iplSetting] below 100: initKeyboard__Q33ipl5scene7SettingFPCc 93.30986
[src/scene/setting/iplSetting] below 100: calcKeyboard__Q33ipl5scene7SettingFv 92.42069
[src/scene/setting/iplSetting] below 100: convertRevIP__Q33ipl5scene7SettingFPUcPCc 98.15069
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 94.5625
[src/scene/setting/iplSetting] below 100: validateEULA___Q33ipl5scene7SettingFv 86.30851
[src/scene/setting/iplSetting] below 100: setUSBAP__Q33ipl5scene7SettingFv 98.070175
[src/scene/setting/iplSetting] baseline: code 30156/37884 data 1040 functions 104 fuzzy 98.4958
[src/scene/sdChannelMemory/iplSDMemory] pool: IDENTICAL
[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 14484/20872 data 200/3344 functions 63/66 fuzzy 98.1897 linked code 0
[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 62/66
[src/scene/sdChannelMemory/iplSDMemory] section .data size 3144 match None
[src/scene/sdChannelMemory/iplSDMemory] section .sdata size 152 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .sdata2 size 48 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .text size 20872 match 98.18973
[src/scene/sdChannelMemory/iplSDMemory] below 100: create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect 98.06767
[src/scene/sdChannelMemory/iplSDMemory] below 100: onDialogState21__Q33ipl5scene8SDMemoryFv 90.060974
[src/scene/sdChannelMemory/iplSDMemory] below 100: drawTransferTitles__Q33ipl5scene8SDMemoryFv 85.42129
[src/scene/sdChannelMemory/iplSDMemory] baseline: code 14484/20872 data 200 functions 63 fuzzy 97.6573
regressions vs baseline: 0
global matched_code_percent: 84.58613 -> 84.58613
global fuzzy_match_percent: 97.98290 -> 97.98875
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.32545 -> 90.32545
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
### sol-r6-gate-final.txt
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/sdChannelSelect/iplSDChannelSelect] pool: IDENTICAL
[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 24100/33828 data 224/2960 functions 102/129 fuzzy 98.0426 linked code 0
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 102/129
[src/scene/sdChannelSelect/iplSDChannelSelect] section .data size 2736 match 35.06984
[src/scene/sdChannelSelect/iplSDChannelSelect] section .rodata size 64 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata2 size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .text size 33828 match 98.04257
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: create__Q33ipl5scene15SDChannelSelectFv 94.23972
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStartNotice__Q33ipl5scene15SDChannelSelectFv 94.117645
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueFinishNotice__Q33ipl5scene15SDChannelSelectFv 94.44444
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 97.51111
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueLoadNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueuePageNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueResultNotice__Q33ipl5scene15SDChannelSelectFUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 90.86957
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueMoveNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 95.13043
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueErrorNotice__Q33ipl5scene15SDChannelSelectFUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv 99.15205
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl 93.07843
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl 86.82353
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 77.944595
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi 81.77778
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: calcCommon__Q33ipl5scene15SDChannelSelectFv 99.07407
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: destroy__Q33ipl5scene15SDChannelSelectFv 95.097565
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: drawChannelTransitionObjects__Q33ipl5scene15SDChannelSelectFv 94.974846
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: initializeNormalPage__Q33ipl5scene15SDChannelSelectFv 98.93617
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: selectChannel__Q33ipl5scene15SDChannelSelectFii 98.305084
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.48498
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: onEventDerived__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@33SDChannelSelectButtonEventHandlerFUlUlPCQ33ipl10controller9Interface 98.541664
[src/scene/sdChannelSelect/iplSDChannelSelect] baseline: code 24100/33828 data 224 functions 102 fuzzy 98.0426
[src/scene/setting/iplSetting] pool: IDENTICAL
[src/scene/setting/iplSetting] objdiff: code 30156/37884 data 1040/5696 functions 104/112 fuzzy 98.6649 linked code 0
[src/scene/setting/iplSetting] instruction-exact functions: 103/112
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
[src/scene/setting/iplSetting] section .data size 4016 match 5.146636
[src/scene/setting/iplSetting] section .rodata size 640 match 32.25412
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
[src/scene/setting/iplSetting] section .text size 37884 match 98.66487
[src/scene/setting/iplSetting] below 100: createBrowser__Q33ipl5scene7SettingFv 98.8505
[src/scene/setting/iplSetting] below 100: draw__Q33ipl5scene7SettingFv 91.03639
[src/scene/setting/iplSetting] below 100: initKeyboard__Q33ipl5scene7SettingFPCc 93.30986
[src/scene/setting/iplSetting] below 100: calcKeyboard__Q33ipl5scene7SettingFv 92.42069
[src/scene/setting/iplSetting] below 100: convertRevIP__Q33ipl5scene7SettingFPUcPCc 98.15069
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 94.5625
[src/scene/setting/iplSetting] below 100: validateEULA___Q33ipl5scene7SettingFv 86.30851
[src/scene/setting/iplSetting] below 100: setUSBAP__Q33ipl5scene7SettingFv 98.070175
[src/scene/setting/iplSetting] baseline: code 30156/37884 data 1040 functions 104 fuzzy 98.4958
[src/scene/sdChannelMemory/iplSDMemory] pool: IDENTICAL
[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 14484/20872 data 200/3344 functions 63/66 fuzzy 98.1897 linked code 0
[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 62/66
[src/scene/sdChannelMemory/iplSDMemory] section .data size 3144 match None
[src/scene/sdChannelMemory/iplSDMemory] section .sdata size 152 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .sdata2 size 48 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .text size 20872 match 98.18973
[src/scene/sdChannelMemory/iplSDMemory] below 100: create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect 98.06767
[src/scene/sdChannelMemory/iplSDMemory] below 100: onDialogState21__Q33ipl5scene8SDMemoryFv 90.060974
[src/scene/sdChannelMemory/iplSDMemory] below 100: drawTransferTitles__Q33ipl5scene8SDMemoryFv 85.42129
[src/scene/sdChannelMemory/iplSDMemory] baseline: code 14484/20872 data 200 functions 63 fuzzy 97.6573
regressions vs baseline: 0
global matched_code_percent: 84.58613 -> 84.58613
global fuzzy_match_percent: 97.98290 -> 97.98875
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.32545 -> 90.32545
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
### sol-r6-gate-log-final.txt
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/sdChannelSelect/iplSDChannelSelect] pool: IDENTICAL
[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 24100/33828 data 224/2960 functions 102/129 fuzzy 98.0426 linked code 0
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 102/129
[src/scene/sdChannelSelect/iplSDChannelSelect] section .data size 2736 match 35.06984
[src/scene/sdChannelSelect/iplSDChannelSelect] section .rodata size 64 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .sdata2 size 80 match 100.0
[src/scene/sdChannelSelect/iplSDChannelSelect] section .text size 33828 match 98.04257
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: create__Q33ipl5scene15SDChannelSelectFv 94.23972
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStartNotice__Q33ipl5scene15SDChannelSelectFv 94.117645
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueFinishNotice__Q33ipl5scene15SDChannelSelectFv 94.44444
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 97.51111
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueLoadNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueuePageNotice__Q33ipl5scene15SDChannelSelectFv 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueResultNotice__Q33ipl5scene15SDChannelSelectFUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 90.86957
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueMoveNotice__Q33ipl5scene15SDChannelSelectFUlUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl 95.13043
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: enqueueErrorNotice__Q33ipl5scene15SDChannelSelectFUlUl 95.652176
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv 99.15205
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl 93.07843
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl 86.82353
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 77.944595
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi 81.77778
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: calcCommon__Q33ipl5scene15SDChannelSelectFv 99.07407
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: destroy__Q33ipl5scene15SDChannelSelectFv 95.097565
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: drawChannelTransitionObjects__Q33ipl5scene15SDChannelSelectFv 94.974846
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: initializeNormalPage__Q33ipl5scene15SDChannelSelectFv 98.93617
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: selectChannel__Q33ipl5scene15SDChannelSelectFii 98.305084
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.48498
[src/scene/sdChannelSelect/iplSDChannelSelect] below 100: onEventDerived__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@33SDChannelSelectButtonEventHandlerFUlUlPCQ33ipl10controller9Interface 98.541664
[src/scene/sdChannelSelect/iplSDChannelSelect] baseline: code 24100/33828 data 224 functions 102 fuzzy 98.0426
[src/scene/setting/iplSetting] pool: IDENTICAL
[src/scene/setting/iplSetting] objdiff: code 30156/37884 data 1040/5696 functions 104/112 fuzzy 98.6649 linked code 0
[src/scene/setting/iplSetting] instruction-exact functions: 103/112
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
[src/scene/setting/iplSetting] section .data size 4016 match 5.146636
[src/scene/setting/iplSetting] section .rodata size 640 match 32.25412
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
[src/scene/setting/iplSetting] section .text size 37884 match 98.66487
[src/scene/setting/iplSetting] below 100: createBrowser__Q33ipl5scene7SettingFv 98.8505
[src/scene/setting/iplSetting] below 100: draw__Q33ipl5scene7SettingFv 91.03639
[src/scene/setting/iplSetting] below 100: initKeyboard__Q33ipl5scene7SettingFPCc 93.30986
[src/scene/setting/iplSetting] below 100: calcKeyboard__Q33ipl5scene7SettingFv 92.42069
[src/scene/setting/iplSetting] below 100: convertRevIP__Q33ipl5scene7SettingFPUcPCc 98.15069
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 94.5625
[src/scene/setting/iplSetting] below 100: validateEULA___Q33ipl5scene7SettingFv 86.30851
[src/scene/setting/iplSetting] below 100: setUSBAP__Q33ipl5scene7SettingFv 98.070175
[src/scene/setting/iplSetting] baseline: code 30156/37884 data 1040 functions 104 fuzzy 98.4958
[src/scene/sdChannelMemory/iplSDMemory] pool: IDENTICAL
[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 14484/20872 data 200/3344 functions 63/66 fuzzy 98.1897 linked code 0
[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 62/66
[src/scene/sdChannelMemory/iplSDMemory] section .data size 3144 match None
[src/scene/sdChannelMemory/iplSDMemory] section .sdata size 152 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .sdata2 size 48 match 100.0
[src/scene/sdChannelMemory/iplSDMemory] section .text size 20872 match 98.18973
[src/scene/sdChannelMemory/iplSDMemory] below 100: create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect 98.06767
[src/scene/sdChannelMemory/iplSDMemory] below 100: onDialogState21__Q33ipl5scene8SDMemoryFv 90.060974
[src/scene/sdChannelMemory/iplSDMemory] below 100: drawTransferTitles__Q33ipl5scene8SDMemoryFv 85.42129
[src/scene/sdChannelMemory/iplSDMemory] baseline: code 14484/20872 data 200 functions 63 fuzzy 97.6573
regressions vs baseline: 0
global matched_code_percent: 84.58613 -> 84.58613
global fuzzy_match_percent: 97.98290 -> 97.98875
global complete_code_percent: 58.20100 -> 58.20100
global matched_data_percent: 90.32545 -> 90.32545
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```

View File

@@ -0,0 +1,389 @@
# BS2Mach assembly reconstruction, round 2
Baseline 6ade1630. Only BS2Mach source is in scope. Target blocks are processed in address order, with frame and earliest structural differences first.
| Function | Original bytes | Baseline fuzzy |
| --- | --- | --- |
| BS2Tick | 7760 | 76.669075 |
| CheckBS2CommandStatus | 1624 | 80.697044 |
| BS2StartGame | 1572 | 95.496185 |
| BS2StartGCGame | 912 | 98.24561 |
| BS2NANDDivideCallback | 512 | 85.03906 |
| BS2NANDDivideReadAsync | 188 | 60.31915 |
| BS2NANDDivideWriteAsync | 188 | 60.31915 |
| Run | 172 | 0.88372093 |
## BS2Tick, frame and 8137D40C–8137D514
Target and source frame are 0x70. Initial switch prologue already aligns except branch distances. The first body discrepancy is initialization scheduling at 8137D44C, before the first state transition.
| BS2Tick | 2 | 8137D44C: derive progress once and clear through stored pointer | 76.66908 -> 76.66908; src 0x1db8 base 0x1e50 insns 1902/1940; restored |
| BS2Tick | 3 | 8137D44C: keep progress and partition-parameter addresses in scoped typed locals | 76.66908 -> 76.39175; src 0x1db8 base 0x1e50 insns 1902/1940; restored |
| BS2Tick | 4 | 8137D44C: load no-disk flag before final initialization stores | 76.66908 -> 76.65619; src 0x1db8 base 0x1e50 insns 1902/1940; restored |
BS2Tick prefix allocation depends on 64-bit elapsed-time comparisons later in the same function. Target 8137D69C uses mulhwu/mullw for a 64-bit 100ms threshold; the existing C truncates that product to 32 bits. Reconstruct that real type boundary before continuing the prefix.
| BS2Tick | 5 | frame-wide time lifetime: restore 64-bit 100ms products from target blocks | 76.66908 -> 76.28299; src 0x1dd8 base 0x1e50 insns 1910/1940; restored |
| BS2Tick | 6 | 8137D4F4: retain promoted clock addend before system time | 76.66908 -> 76.66908; src 0x1db8 base 0x1e50 insns 1902/1940; restored |
| BS2Tick | 7 | 8137D698: use signed wide milliseconds as OS conversion input | 76.66908 -> 79.39536; src 0x1e28 base 0x1e50 insns 1930/1940; kept |
| BS2Tick | 8 | 8137D4F4: named 32-bit spinup duration promoted at addition boundary | 79.39536 -> 79.39536; src 0x1e28 base 0x1e50 insns 1930/1940; restored |
Signed OS milliseconds input retained: BS2Tick 1902 -> 1930 instructions against 1940 target; fuzzy 76.669075 -> 79.39536. The first initialization group remains the same count but has scheduling and register lifetime differences. No block beyond the already-present structure is treated as validated until prefix ordering is resolved.
| BS2Tick | 9 | 8137D4E4: express deadline as clock call plus OS seconds macro | 79.39536 -> 79.45052; src 0x1e28 base 0x1e50 insns 1930/1940; kept |
| BS2Tick | 10 | 8137D44C: move audio initialization before progress pointer computation | 79.45052 -> 79.43402; src 0x1e28 base 0x1e50 insns 1930/1940; restored |
| BS2Tick | 11 | 8137D44C: keep command reset after all partition stores via local pointer | 79.45052 -> 79.44021; src 0x1e28 base 0x1e50 insns 1930/1940; restored |
The initial BS2Tick group has no missing operations: remaining prefix differences are scheduling, use of addze versus the live zero register, and register lifetimes. Scoped-pointer and literal-call translations have been tested before advancing. A direct logger alias is tested as an inline-helper boundary, without changing BS2Report or any other function.
| BS2Tick | 12 | prefix/helper boundary: invoke existing logger through typed local alias | 79.45052 -> 71.64794; src 0x1f9c base 0x1e50 insns 2023/1940; restored |
| BS2Tick | 13 | 8137D44C: clear parameter fields through a compound struct assignment | 79.45052 -> 79.45000; src 0x1e28 base 0x1e50 insns 1930/1940; restored |
## BS2Tick region blocks, address-order reconstruction
Target 8137D970 reads audio flags only after the unconfigured-state test; the existing C reads and sign-extends the disc byte before that test. Target 8137DAxx and 8137DDxx use explicit shared false branches rather than synthesized cntlzw booleans. These are real source structure differences; the initial scheduling group remains open and no complete-function claim is made.
| BS2Tick | 14 | 8137D970: read unsigned audio bytes after pending-state validation | 79.45052 -> 79.25258; src 0x1e24 base 0x1e50 insns 1929/1940; restored |
| BS2Tick | 15 | 8137DA20 and 8137DCB0: load country only on completed command path | 79.45052 -> 79.47217; src 0x1e20 base 0x1e50 insns 1928/1940; kept |
| BS2Tick | 16 | 8137DA20/8137DCD0: correct each region load within its own state block | 79.47217 -> 79.37990; src 0x1e28 base 0x1e50 insns 1930/1940; kept |
Attempt 15 had a transformation-scope error: its second country assignment was inserted in state 14 instead of state 20. Attempt 16 fixes the source scope before any gate or commit; measurements of attempt 15 are rejected.
| BS2Tick | 17 | 8137DAxx/8137DDxx: translate region case blocks with explicit boolean stores | 79.37990 -> 80.30154; src 0x1e70 base 0x1e50 insns 1948/1940; kept |
| BS2Tick | 18 | 8137DAxx: share false region branch at target default block | 80.30154 -> 80.30154; src 0x1e70 base 0x1e50 insns 1948/1940; restored |
| BS2Tick | 19 | region fields: retain unsigned country comparisons and signed API region | 80.30154 -> 80.43144; src 0x1e70 base 0x1e50 insns 1948/1940; kept |
## BS2Tick stack outputs
Target frame 0x70: titleCharacters at sp+8, readOffset at sp+c, readLength at sp+10, readAddress at sp+14, bannerFile at sp+18. Current frame is also 0x70 but the three loader outputs are allocated in the opposite order, pushing the title-character array to sp+14. Reconstruct a typed loader-read descriptor rather than introducing padding.
| BS2Tick | 20 | frame: group actual loader outputs in offset-length-address order | 80.43144 -> 80.44485; src 0x1e70 base 0x1e50 insns 1948/1940; kept |
| BS2Tick | 21 | frame: declare loader descriptor before title character buffer | 80.44485 -> 80.44485; src 0x1e70 base 0x1e50 insns 1948/1940; restored |
| BS2Tick | 22 | 8137D71C and 8137D808: put cache branches before DVD branches | 80.44485 -> 81.44846; src 0x1e70 base 0x1e50 insns 1948/1940; kept |
BS2Tick loader descriptor now matches all target stack output slots: sp+14 address, sp+10 length, sp+c offset; title character bytes are sp+8..b. Target frame remains 0x70. Subsequent block comparison is performed against this frame layout.
| BS2Tick | 23 | 8137E02x and 8137E8xx: use layout format directly for loader word offsets | 81.44846 -> 82.05876; src 0x1e68 base 0x1e50 insns 1946/1940; kept |
| BS2Tick | 24 | loader helper boundary: call stored entry pointers without pointer punning | 82.05876 -> 82.05876; src 0x1e68 base 0x1e50 insns 1946/1940; restored |
## BS2Tick disc identity and audio basic blocks
Target retains the boot disc ID address across memcpy and strncmp calls. The old source repeatedly reconstructs raw addresses. Translate the same fields through DVDDiskID and preserve literal pool order.
| BS2Tick | 25 | 8137D84x-8137D970: keep a typed boot disc pointer across signature calls | 82.05876 -> 82.17114; src 0x1e64 base 0x1e50 insns 1945/1940; kept |
| BS2Tick | 26 | 8137D970-8137D9E8: translate unsigned audio fields with positive branch first | 82.17114 -> 82.55618; src 0x1e60 base 0x1e50 insns 1944/1940; kept |
| BS2Tick | 27 | 8137D9A4: express default streaming-buffer size as conditional value | 82.55618 -> 82.65928; src 0x1e64 base 0x1e50 insns 1945/1940; kept |
| BS2Tick | 28 | 8137DA4x-8137DD64: share region rejection blocks exactly as target branches | 82.65928 -> 83.42732; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
| BS2Tick | 29 | 8137DAA4: emit region-reject state before region-success state | 83.42732 -> 83.43093; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
| BS2Tick | 30 | 8137DD64-8137DE34: flatten region, disc validity and partition branches in address order | 83.43093 -> 83.83402; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
## BS2Tick title-region block 8137E4BC–8137E700
Translate the title header through CurrentTmd, compare the full system version, then use the target product-region switch instead of the previous hand-expanded if tree. Keep the literal strings and order unchanged.
| BS2Tick | 31 | 8137DE5x/8137E4D4: read first TMD version through typed current header | 83.83402 -> 84.53093; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
| BS2Tick | 32 | 8137E558: compare the full required IOS title ID in one condition | 84.53093 -> 84.61031; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
| BS2Tick | 33 | 8137E59C: keep extracted title prefix as promoted signed integer | 84.61031 -> 84.39278; src 0x1e24 base 0x1e50 insns 1929/1940; restored |
| BS2Tick | 34 | 8137E5E0–8137E700: reconstruct regional title checks as target switch blocks | 84.61031 -> 85.61340; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
## BS2Tick banner, closing and error-state blocks 8137E858–8137F1E4
Continue the loader-positive branch, banner early exit, partition transitions, then move ticket and error groups into actual target address order.
| BS2Tick | 35 | 8137E858: emit loader-read positive branch before loader-close state | 85.61340 -> 86.15154; src 0x1e24 base 0x1e50 insns 1929/1940; kept |
| BS2Tick | 36 | 8137E8xx–8137EA6C: translate banner early exit and unmasked disc layout shift | 86.15154 -> 86.63145; src 0x1e20 base 0x1e50 insns 1928/1940; kept |
| BS2Tick | 37 | 8137EB1C: put nonzero TMD locked-disc state before regular-disc state | 86.63145 -> 86.63505; src 0x1e20 base 0x1e50 insns 1928/1940; kept |
| BS2Tick | 38 | 8137ED24/8137EFBC: express DVD transfer state bounds as 4 <= state < 6 | 86.63505 -> 86.63609; src 0x1e20 base 0x1e50 insns 1928/1940; kept |
| BS2Tick | 39 | 8137EE54–8137EF60: arrange close, ticket and error groups in target address order | 86.63609 -> 93.01392; src 0x1e20 base 0x1e50 insns 1928/1940; kept |
| BS2Tick | 40 | 8137F134: use wide signed millisecond conversion for cover-open delay | 93.01392 -> 93.39794; src 0x1e30 base 0x1e50 insns 1932/1940; kept |
Gate 3: PASS; pool identical, regressions 0, forbidden/readability 0, DOL hash correct; Tick 93.39794%, 1932/1940 instructions. Retain TMD, region-switch, loader-positive, banner, partition and address-order corrections.
| BS2Tick | 41 | 8137DFxx: emit positive update-apploader read branch first | 93.39794 -> 93.84742; src 0x1e30 base 0x1e50 insns 1932/1940; kept |
| BS2Tick | 42 | 8137E9AC: express actual banner alignment as subtraction of low address bits | 93.84742 -> 93.61495; src 0x1e34 base 0x1e50 insns 1933/1940; restored |
| BS2Tick | 43 | 8137EEEC: scan ticket bytes as unsigned bytes | 93.84742 -> 93.75413; src 0x1e30 base 0x1e50 insns 1932/1940; restored |
| BS2Tick | 44 | 8137EF60–8137F050: reconstruct error and abort exits before polling path | 93.84742 -> 94.28712; src 0x1e30 base 0x1e50 insns 1932/1940; kept |
| BS2Tick | 45 | 8137F054–8137F0EC: reconstruct restart error and partition exits before drive path | 94.28712 -> 95.13505; src 0x1e30 base 0x1e50 insns 1932/1940; kept |
| BS2Tick | 46 | 8137E3D8–8137E49C: emit cached partition branch before physical drive branch | 95.13505 -> 95.88454; src 0x1e30 base 0x1e50 insns 1932/1940; kept |
| BS2Tick | 47 | 8137E59C: place unrestricted-title block before regional validation in address order | 95.88454 -> 96.23659; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
| BS2Tick | 48 | 8137E650/8137E668: reconstruct Korean and Chinese title suffix switches | 96.23659 -> 96.39690; src 0x1e3c base 0x1e50 insns 1935/1940; kept |
| BS2Tick | 49 | 8137E070/8137E13C: evaluate update-state calls separately from short-circuit booleans | 96.39690 -> 96.62938; src 0x1e2c base 0x1e50 insns 1931/1940; kept |
| BS2Tick | 50 | 8137DEEC: put valid update disc state before invalid state | 96.62938 -> 96.82886; src 0x1e30 base 0x1e50 insns 1932/1940; kept |
| BS2Tick | 51 | 8137DD80: put update partition present branch before absent branch | 96.82886 -> 96.98711; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
| BS2Tick | 52 | 8137E39C: put game-partition present branch before absent branch | 96.98711 -> 96.90464; src 0x1e38 base 0x1e50 insns 1934/1940; restored |
## CheckBS2CommandStatus end-to-end block map
8137CC28–CC54 frame 0x20/save29; CC58–CCF0 readiness and completion exits; CCF0–CD18 dispatch; CD18–CD58 seek; CD5C–CDD0 drive; CDD4–CE48 ID; CE4C–CEC0 TOC; CEC4–CF60 partitions; CF64–CFD8 BI3; CFDC–D054 TMD; D058–D0CC loader header; D0D0–D150 loader; D154–D1CC loader payload; D1D0–D258 banner; D25C–D27C returns. Prefix through CD74 aligns structurally. First blocker CD90 is a reload of CacheLength immediately after its store; compiler forwards the stored nonvolatile value. Re-translate the following chunks with typed pointers and fresh field expressions; do not add volatile.
| CheckBS2CommandStatus | 2 | CD18–CD90: test block-scoped report declaration at inline-helper boundary | 80.69704 -> 80.69704; src 0x610 base 0x658 insns 388/406; restored |
| CheckBS2CommandStatus | 3 | CEC4–CF60: retranslate partition length without early cached length temporary | 80.69704 -> 83.23645; src 0x620 base 0x658 insns 392/406; kept |
| CheckBS2CommandStatus | 4 | CF64–D27C: retranslate fixed and rounded cache chunks with SDK alignment operations | 83.23645 -> 83.23645; src 0x620 base 0x658 insns 392/406; restored |
| CheckBS2CommandStatus | 5 | CC74–CCC0: retranslate cache readiness as direct combined condition | 83.23645 -> 83.23645; src 0x620 base 0x658 insns 392/406; restored |
Gate 4-valid: PASS; pool identical, regressions 0, forbidden/readability 0. Tick 96.98711%, CheckBS2CommandStatus 83.23645%. Earlier gate 4 ran concurrently with an experiment and is discarded; only the stable rerun is evidence. CheckBS2CommandStatus frame/prefix align, remaining 392/406 count and missing global reloads are structural; not a register-only completion.
| BS2Tick | 53 | 8137E59C: declare extracted title prefix separately as signed word | 96.98711 -> 97.04948; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
| BS2Tick | 54 | 8137E614: use suffix switch for US E and X-Y-Z region checks | 97.04948 -> 97.16392; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
## BS2StartGame full address-order translation
BD64–BD94 frame 0x50/save24 and CoverBlock; BD94–BE14 cover polling, report, NAND close; BE14–BE78 controller and boot fields; BE78–BED4 OS flags; BED4–BFF4 ticket/security/launch; BFF4–C0B4 IPC restoration; C0B8–C10C disc callback/poll; C10C–C194 error/fatal; C198–C244 identity and partition issue; C244–C318 partition result/error; C318–C364 fatal and partition reporting; C364–C3x legacy DI/audio/entry handoff. Frame and all non-poll blocks already align modulo registers. Target BD94 is a reloading empty CoverBlock.state loop; existing source uses the DVD status API to avoid unsafe compiler hoisting. C0E4/C130/C244/C2A0 likewise need repeated LowReadResult loads; current source uses interrupt calls. No volatile or assembly is permitted. Test distinct readable forms without accepting a hoisted asynchronous loop.
| BS2StartGame | 2 | C0F0–C194: retranslate disk completion and error dispatch as signed switch | 95.49618 -> 95.49618; src 0x644 base 0x624 insns 401/393; restored |
| BS2StartGame | 3 | C250–C318: retranslate partition completion, error and ticket dispatch as signed switch | 95.49618 -> 95.49618; src 0x644 base 0x624 insns 401/393; restored |
| BS2StartGame | 4 | BED4–BFF4: retranslate required IOS selection with full title ID temporary | 95.49618 -> 95.49618; src 0x644 base 0x624 insns 401/393; restored |
| BS2StartGame | 5 | BD64 frame: declare state flags and ticket output before transient values | 95.49618 -> 95.49618; src 0x644 base 0x624 insns 401/393; restored |
## BS2StartGCGame full address-order translation
C388–C3C4 frame 0x40, rtc sp+c, state flags sp+10, tickets sp+8; C3C4–C46C sound/video/language; C46C–C4A8 full-width RTC ticks; C4AC–C4E0 SRAM; C4E4–C53C NAND close; C53C–C594 controller/audio/state; C598–C5C8 legacy PI register; C5CC–C714 ES tickets/launch and return. First block still has API polling versus target field reload. One missing tail instruction is a hardware register readback: use the existing SDK PI register access definitions, not a new qualifier or hand-placed symbol.
| BS2StartGCGame | 2 | C598–C5C8: translate processor-interface control through existing SDK register macro | 98.24561 -> 98.24561; src 0x38c base 0x390 insns 227/228; restored |
| BS2StartGCGame | 3 | C388 frame: move state flag object beside RTC and ticket outputs | 98.24561 -> 98.24561; src 0x38c base 0x390 insns 227/228; restored |
| BS2StartGCGame | 4 | C46C–C4A8: retranslate RTC conversion through wide signed seconds macro | 98.24561 -> 98.24561; src 0x38c base 0x390 insns 227/228; restored |
| BS2StartGCGame | 5 | C3C4–C468: inline value temporaries at sound and progressive API boundaries | 98.24561 -> 98.24561; src 0x38c base 0x390 insns 227/228; restored |
## BS2NANDDivideCallback full address-order translation
C8B0–C8EC frame 0x10/save31 and cancellation; C8EC–C904 negative result; C904–C934 transferred/buffer and remaining bound; C934–C9AC write/read full chunk; C9AC–C9C8 callback error; C9C8–CA70 write/read final chunk; CA70–CA8C callback error; CA8C–CAAC completion/epilogue. Target reloads NandTransferred after store and rereads length/transferred at each later operation. Current compiler forwards nonvolatile globals. Translate early exits first, then chunk branches and completion in address order.
| BS2NANDDivideCallback | 2 | C8B0–C904: reconstruct cancellation and negative-result early returns | 85.03906 -> 85.03906; src 0x1dc base 0x200 insns 119/128; restored |
| BS2NANDDivideCallback | 3 | C904–C934: update byte pointer before transferred count | 85.03906 -> 85.00000; src 0x1dc base 0x200 insns 119/128; restored |
| BS2NANDDivideCallback | 4 | C9C8–CAAC: retranslate final chunk with explicit remaining-byte temporary | 85.03906 -> 70.85938; src 0x1dc base 0x200 insns 119/128; restored |
| BS2NANDDivideCallback | 5 | C934–CA70: use unsigned operation switch at NAND helper boundary | 85.03906 -> 84.94531; src 0x1dc base 0x200 insns 119/128; restored |
## BS2NANDDivideReadAsync full address-order translation
CAB0 frame 0x10/save31; six transfer-state stores; unsigned maximum 0x40000; report and NAND issue for full chunk; report and issue for final length; restore31/return. First structural gap is NandLength reload immediately after initialization. Body is fully represented in readable C but compiler forwards globals. No new qualifiers or artificial side effects are added.
| BS2NANDDivideReadAsync | 2 | initialization: keep file and buffer assignment before operation/length setup | 60.31915 -> 60.31915; src 0xb4 base 0xbc insns 45/47; restored |
| BS2NANDDivideReadAsync | 3 | helper boundary: test direct block-scoped report prototype | 60.31915 -> 60.31915; src 0xb4 base 0xbc insns 45/47; restored |
| BS2NANDDivideReadAsync | 4 | full-to-final chunk: retranslate length choice and common NAND issue | 60.31915 -> 35.31915; src 0x90 base 0xbc insns 36/47; restored |
| BS2NANDDivideReadAsync | 5 | initialization temporaries: snapshot incoming length through argument instead of stored global | 60.31915 -> 52.44681; src 0xc0 base 0xbc insns 48/47; restored |
## BS2NANDDivideWriteAsync full address-order translation
CB6C frame 0x10/save31; six transfer-state stores; unsigned maximum 0x40000; report and NAND issue for full chunk; report and issue for final length; restore31/return. First structural gap is NandLength reload immediately after initialization. Body is fully represented in readable C but compiler forwards globals. No new qualifiers or artificial side effects are added.
| BS2NANDDivideWriteAsync | 2 | initialization: keep file and buffer assignment before operation/length setup | 60.31915 -> 60.31915; src 0xb4 base 0xbc insns 45/47; restored |
| BS2NANDDivideWriteAsync | 3 | helper boundary: test direct block-scoped report prototype | 60.31915 -> 60.31915; src 0xb4 base 0xbc insns 45/47; restored |
| BS2NANDDivideWriteAsync | 4 | full-to-final chunk: retranslate length choice and common NAND issue | 60.31915 -> 35.31915; src 0x90 base 0xbc insns 36/47; restored |
| BS2NANDDivideWriteAsync | 5 | initialization temporaries: snapshot incoming length through argument instead of stored global | 60.31915 -> 52.44681; src 0xc0 base 0xbc insns 48/47; restored |
## Run end-to-end instruction audit
B3EC–B3F0 CTR/LR handoff; B3F4–B464 clears r0,r2,r3,r5,r7..r31; B468–B470 resets stack to 0x81600000; B474–B484 cache-line zero/flush counted loop; B488–B490 clears r4 and returns through LR; B494 loops to cache block. Target has no C frame. Ordinary C cannot specify these ABI register and stack resets, and new assembly is forbidden. Re-translate the expressible cache and entry operations; do not invent dummy locals for the register reset.
| Run | 2 | B48C–B490: reconstruct boot entry with zero r3 and r4 arguments | 0.88372 -> 0.00000; src 0x78 base 0xac insns 30/43; restored |
| Run | 3 | B474–B484: translate counted cache loop as explicit while | 0.88372 -> 0.88372; src 0x78 base 0xac insns 30/43; restored |
| Run | 4 | B478–B484: translate cache bounds through end pointer | 0.88372 -> 0.88372; src 0x78 base 0xac insns 30/43; restored |
## BS2Tick second structural pass
All state groups have now been translated through the shared epilogue in target address order. 97.16392%, 1933/1940 instructions. Remaining concrete differences include initial scheduling, low-memory address materialization, DVD magic failure ordering, banner alignment, unsigned ticket scan and DVD state range branch form. Continue source forms at those exact blocks; register-only status has not been reached.
| BS2Tick | 55 | 8137D860–8137D890: reconstruct header pointer only after memcpy | 97.16392 -> 97.24020; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
| BS2Tick | 56 | 8137DCCC: emit valid magic and region path before magic failure | 97.24020 -> 97.16908; src 0x1e38 base 0x1e50 insns 1934/1940; restored |
| BS2Tick | 57 | 8137D44C: establish audio setup flag before transfer zeroing | 97.24020 -> 97.06186; src 0x1e2c base 0x1e50 insns 1931/1940; restored |
| BS2Tick | 58 | 8137ED20/8137EFB8: translate active DVD state range as target switch form | 97.24020 -> 97.30825; src 0x1e3c base 0x1e50 insns 1935/1940; kept |
Run compiler binary exposes __dcbz and __dcbf intrinsics. These express the actual cache instructions as C, but do not expose the all-GPR and stack reset. Test intrinsic cache loop without introducing assembly.
| Run | 5 | B478–B47C: translate cache-line zero and flush with compiler cache intrinsics | compile failed |
Gate 5: PASS; pool identical, regressions 0, forbidden/readability 0; Tick 97.30825%. All eight full target functions have been read through their epilogues and at least three distinct source experiments compiled for each. This is not completion: several functions still have structural mismatches and do not meet the exact/register-only endpoint.
Tick device field is the existing SDK __OSDeviceCode at 800030E6; use that named SDK field rather than the raw absolute cast. No new volatile declaration or mapped symbol is introduced.
| BS2Tick | 59 | 8137D7A4–8137D7CC: use named SDK boot device code field | 97.30825 -> 97.30825; src 0x1e3c base 0x1e50 insns 1935/1940; restored |
| Run | 6 | B478–B47C: translate cache instructions with correct two-argument intrinsics | 0.88372 -> 16.74419; src 0x2c base 0xac insns 11/43; kept |
Run intrinsic cache translation is retained: 30 -> 11 instructions, 0.88372 -> 16.74419%. Prefix mtctr and cache loop now use actual target operations. CPU register/stack handoff remains outside the permitted C operations.
| Run | 7 | B474–B484: use unconditional cache loop as target, including zero-count behavior | 16.74419 -> 10.11628; src 0x24 base 0xac insns 9/43; restored |
| Run | 8 | B48C–B490: translate zero-valued boot arguments after intrinsic cache loop | 16.74419 -> 15.69768; src 0x30 base 0xac insns 12/43; restored |
| BS2Tick | 60 | 8137D44C: use typed partition reset descriptor and direct progress pointer | 97.30825 -> 97.30825; src 0x1e3c base 0x1e50 insns 1935/1940; restored |
| BS2Tick | 61 | 8137D44C: assign one actual initialization constant across reset fields | 97.30825 -> 97.30773; src 0x1e3c base 0x1e50 insns 1935/1940; restored |
| BS2Tick | 62 | 8137D44C and timeout blocks: keep clock temporary as signed OSTime | 97.30825 -> 97.30825; src 0x1e3c base 0x1e50 insns 1935/1940; restored |
GC target C5B4 stores the processor-interface control word, then C5B8 reads the same MMIO register back. This is a real target hardware readback, not a RAM reload. Translate it using the existing SDK PI access macros; no new volatile qualifier or addressed object is added. CoverBlock polling remains the separate unresolved issue.
| BS2StartGCGame | 6 | C598–C5C8: translate target PI control write and actual MMIO readback | 98.24561 -> 99.56140; src 0x390 base 0x390 insns 228/228; kept |
Test direct cover-state source control-flow forms only if compiler actually reloads in the loop. Reject hoisted polls even if fuzzy score rises.
| BS2StartGCGame | 7 | cover-prefix: translate target label and backward branch explicitly | 99.56140 -> 96.88596; src 0x390 base 0x390 insns 228/228; restored |
| BS2StartGCGame | 8 | cover-prefix: translate target do-while read loop | 99.56140 -> 96.88596; src 0x390 base 0x390 insns 228/228; restored |
| BS2StartGCGame | 9 | cover-prefix: translate break-controlled cover loop | 99.56140 -> 96.88596; src 0x390 base 0x390 insns 228/228; restored |
| BS2StartGame | 6 | cover-prefix: translate target label and backward branch explicitly | 95.49618 -> 93.94402; src 0x644 base 0x624 insns 401/393; restored |
| BS2StartGame | 7 | cover-prefix: translate target do-while read loop | 95.49618 -> 93.94402; src 0x644 base 0x624 insns 401/393; restored |
| BS2StartGame | 8 | cover-prefix: translate break-controlled cover loop | 95.49618 -> 93.94402; src 0x644 base 0x624 insns 401/393; restored |
Test the repository NO_INLINE helper boundary on the real BS2Report body. Original target retains direct calls to an empty report function; this experiment changes no behavior, data, qualifier or function name. Keep only measurable aggregate progress with no exact-function regression.
| BS2Report | 1 | inline helper boundary: explicitly retain report calls with repository NO_INLINE | compile failed |
| BS2Report | 2 | inline helper boundary: test compiler noinline declaration form for C | compile failed |
Gate 7: PASS; pool identical, regressions 0, forbidden/readability 0. Run cache intrinsics and GC processor-interface readback reviewed against target; no assembly, new qualifier, or hand-placed object. GC now 228/228 instructions with one opcode mismatch at the cover wait (bl API versus lwz state), not a register-only result.
| BS2StartGCGame | 10 | C490–C4A4: put timer frequency before signed seconds in full-width product | 99.56140 -> 99.42982; src 0x390 base 0x390 insns 228/228; restored |
| BS2Tick | 63 | 8137DCCC–8137DD98: include region and disc validity checks inside valid-magic branch | 97.30825 -> 97.78866; src 0x1e3c base 0x1e50 insns 1935/1940; kept |
| BS2Tick | 64 | 8137E59C–8137E5C4: reconstruct restricted title families as sparse switch | 97.78866 -> 97.70773; src 0x1e40 base 0x1e50 insns 1936/1940; restored |
| BS2Tick | 65 | 8137D938–8137D96C: assign GC layout successor after both magic branches | 97.78866 -> 97.83402; src 0x1e3c base 0x1e50 insns 1935/1940; kept |
Assembly audit found real unfinished loader control flow: 8137E014 falls directly into LoaderMain at E018; E808 likewise falls into E80C. The old C broke after loader initialization and delayed the first loader read to another tick. Remove both breaks to reproduce target behavior.
| BS2Tick | 66 | 8137E014/E808: restore immediate loader-main fallthrough after initialization | 97.83402 -> 98.04021; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
| BS2Tick | 67 | 8137EEEC: promote ticket scan byte as unsigned before zero comparison | 98.04021 -> 98.25309; src 0x1e34 base 0x1e50 insns 1933/1940; kept |
| BS2Tick | 68 | 8137E9AC: reconstruct target banner alignment by removing low five address bits | 98.25309 -> 97.99278; src 0x1e38 base 0x1e50 insns 1934/1940; restored |
BS2Tick now 98.25309%, 1933/1940. Real semantic gaps corrected: loader initialization immediately enters LoaderMain in the same tick; valid RVL magic includes region and disc validity checks before the later magic-reject block; unsigned ticket byte comparison matches target. Reindent the reconstructed valid-magic scope for review; no instruction change intended.
| BS2Tick | 69 | 8137D98C: load streaming byte before clearing audio configuration flag | 98.25309 -> 98.24794; src 0x1e34 base 0x1e50 insns 1933/1940; restored |
Gate 8: PASS; pool identical, regressions 0, forbidden/readability 0; Tick 98.25309%, 1933/1940. Streaming snapshot attempt 69 restored because it lowered fuzzy without instruction-count gain. Review confirms the new initialization fallthroughs and MMIO readback are actual target operations. All remaining nonmatches are structural; none is claimed finished or register-only.
BS2Tick: current 98.25309%; src 0x1e34 base 0x1e50 insns 1933/1940. Detailed final ctxdiff: /tmp/bs2r2-final-BS2Tick.diff.
CheckBS2CommandStatus: current 83.23645%; src 0x620 base 0x658 insns 392/406. Detailed final ctxdiff: /tmp/bs2r2-final-CheckBS2CommandStatus.diff.
BS2StartGame: current 95.496185%; src 0x644 base 0x624 insns 401/393. Detailed final ctxdiff: /tmp/bs2r2-final-BS2StartGame.diff.
BS2StartGCGame: current 99.5614%; src 0x390 base 0x390 insns 228/228. Detailed final ctxdiff: /tmp/bs2r2-final-BS2StartGCGame.diff.
BS2NANDDivideCallback: current 85.03906%; src 0x1dc base 0x200 insns 119/128. Detailed final ctxdiff: /tmp/bs2r2-final-BS2NANDDivideCallback.diff.
BS2NANDDivideReadAsync: current 60.31915%; src 0xb4 base 0xbc insns 45/47. Detailed final ctxdiff: /tmp/bs2r2-final-BS2NANDDivideReadAsync.diff.
BS2NANDDivideWriteAsync: current 60.31915%; src 0xb4 base 0xbc insns 45/47. Detailed final ctxdiff: /tmp/bs2r2-final-BS2NANDDivideWriteAsync.diff.
Run: current 16.744186%; src 0x2c base 0xac insns 11/43. Detailed final ctxdiff: /tmp/bs2r2-final-Run.diff.
Unmet endpoint: instruction-exact remains 21/29. Run still lacks GPR/stack/LR reset, StartGame/StartGCGame cover polling still uses an API call, and NAND/cache globals still have missing reloads. The forbidden volatile/assembly/configuration tricks were not used. All eight have target block maps through their returns and distinct compiled source attempts, but the requested exact-or-register-only endpoint has not been achieved.
## Final full clean gate and endpoint audit
Instruction-exact 21/29 -> 21/29; objdiff code 4052/16980 -> 4052/16980; data 155504/158528 -> 155504/158528; unit fuzzy 84.64641 -> 94.98469.
INCOMPLETE: none of the eight reaches the exact-or-register-only endpoint. No compiler/register/qualifier bypass is used to conceal this.
BS2Tick: 76.669075 -> 98.25309%; 68 logged attempts. 1933/1940 instructions; address materialization, initial/store scheduling, partition reloads, title-prefix branch and banner alignment still differ. This is structural, not register-only.
CheckBS2CommandStatus: 80.697044 -> 83.23645%; 4 logged attempts. 392/406; target reloads CacheLength after stores and repeats loader/banner length loads; generated C forwards those globals. Prefix/frame aligned.
BS2StartGame: 95.496185 -> 95.496185%; 7 logged attempts. 401/393; cover API call replaces target load and low-level callback waits add interrupt calls; direct loops tested this round hoist the load and are rejected.
BS2StartGCGame: 98.24561 -> 99.5614%; 9 logged attempts. 228/228; cover API bl/compare/backward branch differs from target lwz/cmpwi/bne. Direct label, do-while and break loops all produce bne -4 with the load outside the loop and are rejected. Remaining RTC operand registers also differ.
BS2NANDDivideCallback: 85.03906 -> 85.03906%; 4 logged attempts. 119/128; transferred/length/buffer reloads are forwarded and cancellation callback load is scheduled before the store.
BS2NANDDivideReadAsync: 60.31915 -> 60.31915%; 4 logged attempts. 45/47; stored length and final length reloads are forwarded; registers also differ.
BS2NANDDivideWriteAsync: 60.31915 -> 60.31915%; 4 logged attempts. 45/47; stored length and final length reloads are forwarded; registers also differ.
Run: 0.88372093 -> 16.744186%; 7 logged attempts. 11/43; actual dcbz/dcbf counted loop now present, but target GPR clears, SP replacement and LR handoff have no ordinary C expression in the exposed compiler intrinsics. New assembly is forbidden.
Retained source commits: 7d4bdea4, ad5c371e, 240d7a58, 0d575639, cb4db7d6, 9c829f69, ccd3577f. Only src/BS2/BS2Mach.c and this attempt log changed.
Final full gate (no --quick), after clean object rebuild:
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/BS2/BS2Mach] pool: IDENTICAL
[src/BS2/BS2Mach] objdiff: code 4052/16980 data 155504/158528 functions 21/29 fuzzy 94.9847 linked code 0
[src/BS2/BS2Mach] instruction-exact functions: 21/29
[src/BS2/BS2Mach] section .bss size 155232 match 100.0
[src/BS2/BS2Mach] section .data size 3024 match None
[src/BS2/BS2Mach] section .sbss size 240 match 100.0
[src/BS2/BS2Mach] section .sdata size 32 match 100.0
[src/BS2/BS2Mach] section .text size 16980 match 94.98469
[src/BS2/BS2Mach] below 100: Run 16.744186
[src/BS2/BS2Mach] below 100: BS2StartGame 95.496185
[src/BS2/BS2Mach] below 100: BS2StartGCGame 99.5614
[src/BS2/BS2Mach] below 100: BS2NANDDivideCallback 85.03906
[src/BS2/BS2Mach] below 100: BS2NANDDivideReadAsync 60.31915
[src/BS2/BS2Mach] below 100: BS2NANDDivideWriteAsync 60.31915
[src/BS2/BS2Mach] below 100: CheckBS2CommandStatus 83.23645
[src/BS2/BS2Mach] below 100: BS2Tick 98.25309
[src/BS2/BS2Mach] baseline: code 4052/16980 data 155504 functions 21 fuzzy 84.6464
regressions vs baseline: 0
global matched_code_percent: 84.84254 -> 84.84254
global fuzzy_match_percent: 98.07848 -> 98.13709
global complete_code_percent: 59.34297 -> 59.34297
global matched_data_percent: 90.43305 -> 90.43305
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```

View File

@@ -39,3 +39,12 @@ Measured trials:
- static initializer attempt 1: src 0x64 base 0x64 insns 25/25; diffs 0: []
- static initializer attempt 2: src 0x64 base 0x64 insns 25/25; diffs 22: [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
- static initializer attempt 3: src 0x64 base 0x64 insns 25/25; diffs 0: []
## LayoutByNW4R::create — session 3
The inlined UITextArea::Init loop: base carries `this+i*4` as an incremented
pointer (mr r26,r31; lwz 0x11c(r26); r26+=4) covering both adjacent arrays via
+0x50; mine recomputes `add r3,r31,r30` per iter. Tried explicit pointer-walk
(`p = mpTextBoxPane; p != end; ++p`, `p[NUM_PANES]` for bounding, two-pointer
p+e) — MWCC materializes both array bases instead; index form is the least
bad. Strength-reduction tie; create stays 351v352.

View File

@@ -214,3 +214,18 @@ textinput::keyboard::pctype::LayoutByNW4R::updateInput(textinput::input::HKBMana
textinput::keyboard::pctype::EventHandler::onTiEvent(textinput::gui::PaneComponent*, unsigned long, textinput::nw4rmanager::TiEventHandler::Input*): objdiff 88.83249; src 0x310 base 0x314 insns 196/197 | --- replace mine 17:18 base 17:18 | M 17 bne 692 | B 17 bne 696
@236@onEvent__Q49textinput8keyboard6pctype12LayoutByNW4RFPQ49textinput8keyboard6pctype5: objdiff None; target name absent; canonical thunk name differs
## Third pass (setTranslateMode solved, updateInput narrowing)
- setTranslateMode: SOLVED 105/105 diffs 0 — `u32 keyMode;` declared UNINITIALIZED with 3-case
switch and NO default: invalid-mode paths reach the compare with stale r31 (original UB).
- updateInput(HKBManager&): 227/227 insns, 1 diff @109 — base clrlwi r26,r3 (s16->u16
conversion materialized) vs mine mr; MWCC lazy-width elides the mask since the lha value
is already provably 16-bit. Tried: wchar_t/u16/int/u16-code/&0xFFFF/(u16) casts —
all elided or regressed. Documented lazy-width tie-break.
- @236@onEvent thunk: present in mine (8B, addi+b) but base symtab name is TRUNCATED
mid-mangle ("...pctype5" ~87 chars, no UIObjUlPv tail) — extraction name cap,
unmatchable by name. Same family as fused-name artifact.
- Data: .rodata/.data/.sdata2 byte-identical; .sdata/.bss/.sbss differ only by trailing
zero pads (name/pad family). matched_data 32% is a name-pairing artifact.
- Unit state: 136/141 fns 100; getControlKey/onPressedShift/onReleasedShift remain
documented reg-permutation tie-breaks (5+ forms each).

View File

@@ -15,3 +15,16 @@ Initial reconstruction uses the sibling tiString and tiUtil headers, real member
## character predicates
The sibling util declarations return bool, while target callers normalize an integer result. Guarded u32 declarations preserve every other translation unit and make all three predicates 16/16 with zero differences.
## inputChar mode==3 block — session 3
Base emits `input[0]=0` direct store, dead `cmplwi ch,0xa`, then `input[i]=ch`
via indexed `sthx` with i=0 in a reg, `i++`, `input[i]=0`, `count=i`,
`mOutput[0]=0`. For the indexed stores to survive, the index must be a variable
MWCC cannot constant-fold yet provably zero. Tried and ALL fold to direct
stores: u16/int/u32 index locals, `i++`/`++i` mutation, if/else identical arms,
`(ch==10)?10:ch` ternary (keeps compare but adds select insns), function-scope
shared `inputIndex` across the goto boundary, `static_cast<u8>` index casts,
`input[i&0xff]`, do-while(0) loop form. MWCC const-props through all of them.
The dead `cmplwi` + indexed-store pair has no reachable source form; retained
the readable direct-store version (125v136 insns).

View File

@@ -43,3 +43,17 @@ Remaining: pooled buffer base setup and callee-saved register assignments, with
3. Unsigned source/destination indices, store via length - 1: 56/56, same differences.
4. Remove the now-unused destination index: retained readable implementation; no output change.
Remaining: copy-loop address strength reduction, scheduling and caller-register assignments; 86.69643%.
## clearCandidates — session 3
Base binds the first static array (ElementBuffer) to r31 via lis/addi and
recomputes every memset arg as `addi r3,r31,off`; mine CSEs the
CandidatesBuffer base into a 4th callee reg (addi r31,r29,0x200). Tried:
`&arr[i]` vs `arr+i` args, cast forms, memset reorder — all invariant.
Same reverse-bind family: base binds globals high, this low.
## update — session 3
446v448, same family: base binds this->r28, global->r31 (savegpr_24 both);
mine rotates this->r29+ and gains 2 body insns. All-diff regions are pure
reg-name permutations; no structural gap found.