Compare commits
92 Commits
codex/url-
...
agent/cont
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b71268335 | ||
|
|
0391409f25 | ||
|
|
b9ceb6a11a | ||
|
|
cc637c0b19 | ||
|
|
7c26f15caa | ||
|
|
e505b1cf9e | ||
|
|
39c8fe9e3a | ||
|
|
b5423d6815 | ||
|
|
cf00659e46 | ||
|
|
0eedd89260 | ||
|
|
69ff7c2582 | ||
|
|
a95c8a4b1d | ||
|
|
953b301d76 | ||
|
|
5166ef739e | ||
|
|
f86495f54a | ||
|
|
537c072886 | ||
|
|
1e9dd58f0d | ||
|
|
e174009388 | ||
|
|
7760bedf22 | ||
|
|
e55aea86ee | ||
|
|
8b42d4167b | ||
|
|
d05fcb1f10 | ||
|
|
532b492c2a | ||
|
|
3ec0698529 | ||
|
|
649ad2fe37 | ||
|
|
a1be1860d9 | ||
|
|
af7a696da6 | ||
|
|
0105e3de85 | ||
|
|
a1167cd128 | ||
|
|
1bb030e16a | ||
|
|
41f01f5012 | ||
|
|
4b24a65552 | ||
|
|
44e895f70b | ||
|
|
42173aa970 | ||
|
|
c936e893db | ||
|
|
4fdd7f9cd5 | ||
|
|
914007736f | ||
|
|
def5006961 | ||
|
|
a5b26387d3 | ||
|
|
e46089fbb9 | ||
|
|
1683c2bb9c | ||
|
|
1f04477528 | ||
|
|
87377fa984 | ||
|
|
2a2f0f8868 | ||
|
|
cd729d24cb | ||
|
|
a6ac7282b7 | ||
|
|
bd1ebcb624 | ||
|
|
cfe2a8bc1a | ||
|
|
b62e543654 | ||
|
|
349e33fb24 | ||
|
|
1eaf680f40 | ||
|
|
3e35807542 | ||
|
|
bbce167648 | ||
|
|
2c1b255aa2 | ||
|
|
171cd52bab | ||
|
|
7f1fb7e588 | ||
|
|
aa825369da | ||
|
|
42390e0343 | ||
|
|
5c1af96b02 | ||
|
|
ce15782426 | ||
|
|
cb232daee1 | ||
|
|
46c6772ada | ||
|
|
50d3800599 | ||
|
|
bfd99258d8 | ||
|
|
5c278171eb | ||
|
|
3167c713a7 | ||
|
|
269aa867e6 | ||
|
|
e912ed5b65 | ||
|
|
02ffffbcb4 | ||
|
|
a5120f43ca | ||
|
|
d8a2813275 | ||
|
|
3cac5fe6a8 | ||
|
|
cd6d734f5a | ||
|
|
7b3e17ba9a | ||
|
|
33a25be480 | ||
|
|
88e8008fb1 | ||
|
|
0f1c1e5a1e | ||
|
|
f288c94074 | ||
|
|
36bca5b314 | ||
|
|
7b63614e4a | ||
|
|
1c6ec5abf9 | ||
|
|
a9c087b860 | ||
|
|
a7e33d7893 | ||
|
|
350d7bee1e | ||
|
|
cc8d401cd7 | ||
|
|
1490ae7346 | ||
|
|
561d041cea | ||
|
|
f2e18ec171 | ||
|
|
8c747e2e39 | ||
|
|
99054ddeb3 | ||
|
|
0f72acdb1f | ||
|
|
3e620d7f91 |
73
AGENTS.md
73
AGENTS.md
@@ -2,6 +2,8 @@
|
||||
|
||||
Guidance for AI agents working in this repository.
|
||||
|
||||
Keep code comments to cases where they are necessary.
|
||||
|
||||
## CRITICAL RULE: never touch upstream
|
||||
|
||||
**Do not open a pull request against `koopthekoopa/wii-ipl`. Do not push to it.
|
||||
@@ -156,51 +158,28 @@ and `splits.txt`), not in whatever order looks convenient.
|
||||
7. `ctxdiff.py` next. Work through the instruction diff.
|
||||
8. Only then look at register allocation.
|
||||
|
||||
## ReAgent and parallel worker workflow
|
||||
## Subagent and PR workflow
|
||||
|
||||
This repository targets only Wii Menu 4.3U. Do not configure or build 43E,
|
||||
43J, or 43K while doing matching work.
|
||||
|
||||
Use the installed ReAgent environment for evidence-driven reversal work:
|
||||
Most workers should pursue exact matching or safe linking; assign the remainder
|
||||
to decompilation. Keep up to 75 live workers when the runtime allows it, while
|
||||
reserving capacity for fixer and validation workers. Fill completed slots with
|
||||
disjoint tasks. Never duplicate a source file or function
|
||||
range. Workers return changed paths, exact objdiff measurements, and validation
|
||||
results. Fuzzy-only results are not accepted.
|
||||
|
||||
```
|
||||
/home/cole/projects/tests/reagent-venv/bin/re-agent doctor
|
||||
/home/cole/projects/tests/reagent-venv/bin/re-agent status
|
||||
```
|
||||
### Worker loop
|
||||
|
||||
ReAgent should use the authenticated local Codex provider with the requested
|
||||
model and a small per-function call cap. The Codex provider uses the local
|
||||
Codex login rather than an API key; API billing is not created by ReAgent, but
|
||||
the account's normal model or plan usage still applies. Do not start a model
|
||||
run until `doctor` reports the backend and acceptance configuration clearly.
|
||||
|
||||
If the launcher cannot import, or `doctor` reports `ready: false`, record the
|
||||
exact failure and do not claim ReAgent evidence. Repair a broken editable
|
||||
install with a fresh checkout and a non-editable install before retrying. If
|
||||
the decompile capability still lacks Java/Ghidra, workers may continue only in
|
||||
the explicitly labeled manual/objdiff fallback using fresh object builds,
|
||||
`pool_diff.py`, `ctxdiff.py`, full 43U builds, and the DOL hash. The fallback
|
||||
does not count as ReAgent execution.
|
||||
|
||||
For parallel work, orchestrate up to ten workers at once when the agent runtime
|
||||
has the capacity. Use `gpt-5.6-luna` at maximum reasoning effort with the fast
|
||||
service tier when those settings are available. If the runtime cannot host ten
|
||||
live workers, queue the remainder; never duplicate a source file or function
|
||||
range just to fill a slot. Each worker must own a disjoint translation unit or
|
||||
function range and return the changed paths, exact-match measurements, and
|
||||
validation results. Workers may propose code, but a candidate is not accepted
|
||||
when it is only fuzzy, uses an uninitialized value, or hides a mismatch behind
|
||||
artificial assembly.
|
||||
|
||||
### Ten-worker exact-match loop
|
||||
|
||||
The worker keeps iterating on its assigned function until exact-name `objdiff`
|
||||
reports `100.0%`. A worker must not stop at a fuzzy score, push to a remote,
|
||||
open a PR, or merge. It may make a local commit on its isolated leaf branch if
|
||||
needed to preserve its work. If the worker believes the remaining difference is
|
||||
a compiler tie-break, it reports the evidence and waits for the orchestrator to
|
||||
terminate or reassign the leaf; it does not self-accept a near-match. Reaching
|
||||
`100.0%` is only the handoff point; it is not acceptance.
|
||||
Workers iterate until exact-name `objdiff` reports `100.0%`. They must not stop
|
||||
at a fuzzy score, push, open a PR, or merge. A local commit is fine. Compiler
|
||||
tie-breaks should be reported with evidence, not hidden behind artificial
|
||||
assembly or uninitialized values. Exact matching is the handoff point, not
|
||||
acceptance. A candidate is incomplete until every owned code and data section
|
||||
and its link metrics are 100%; matching a few functions alone is not enough.
|
||||
Write new matches as readable C or C++ and keep new inline assembly out of the
|
||||
source unless the existing target structure makes it unavoidable.
|
||||
|
||||
Worker measurements are advisory. Only a fresh orchestrator verification can
|
||||
accept, push, open, or merge a candidate. Workers are persistent across
|
||||
@@ -219,9 +198,11 @@ The orchestrator must independently rebuild the owned object and verify:
|
||||
1. `pool_diff.py` reports identical pools, with no first divergence.
|
||||
2. Exact-name `objdiff` reports `100.0%` for the requested symbol.
|
||||
3. `ctxdiff.py` reports `diffs 0` and identical instruction counts.
|
||||
4. The focused source diff is minimal, readable, and free of artificial
|
||||
4. Unit-level code, data, function, and link measures for the owned range are
|
||||
100%, including every owned section.
|
||||
5. The focused source diff is minimal, readable, and free of artificial
|
||||
assembly, uninitialized values, or unrelated edits.
|
||||
5. The full 4.3U build passes and `build/43U/main.dol` has SHA1
|
||||
6. The full 4.3U build passes and `build/43U/main.dol` has SHA1
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
If any orchestrator gate fails, do not promote, push, open a PR, or merge the
|
||||
@@ -238,8 +219,9 @@ For each candidate, the worker must:
|
||||
4. Iterate until exact-name objdiff reaches `100.0%`, while preserving the
|
||||
pool and source-quality requirements above.
|
||||
5. Return the focused exact match to the parent agent for review. The parent
|
||||
reruns every gate and runs `/home/cole/projects/tests/.venv/bin/ninja -C .
|
||||
build/43U/ok`; the worker does not push, open a PR, or merge.
|
||||
reruns every gate, runs `tools/decomp_status.py` and
|
||||
`tools/check_decomp_complete.py`, and runs `/home/cole/projects/tests/.venv/bin/ninja -C . build/43U/ok`;
|
||||
the worker does not push, open a PR, or merge.
|
||||
|
||||
The main agent reviews every worker result before accepting it. After each
|
||||
accepted merge, record the new report from `build/43U/report.json` and keep
|
||||
@@ -259,9 +241,8 @@ candidate fails validation, return it to its worker; do not fix the candidate
|
||||
inline in the orchestrator.
|
||||
|
||||
A new thread must begin by reading this file, checking the live 43U report and
|
||||
remote branch, running the ReAgent doctor/status checks, and then dispatching
|
||||
the worker pool. The orchestrator must not claim a match based on its own
|
||||
decompilation because it must not do that work.
|
||||
remote branch, and dispatching the worker pool. The parent must not claim a
|
||||
match without fresh independent verification.
|
||||
|
||||
### Worktrees, branches, and PR integration
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ MEMORY {
|
||||
}
|
||||
|
||||
SECTIONS {
|
||||
IPL_WWW_SURFACE_ZERO__Q37ext_ead3www5print = 0;
|
||||
GROUP: {
|
||||
.init ALIGN(0x20): {}
|
||||
extab ALIGN(0x20): {}
|
||||
|
||||
20
configure.py
20
configure.py
@@ -628,7 +628,7 @@ config.libs = [
|
||||
Object(Matching, "system/iplChannelManager.cpp"),
|
||||
Object(Matching, "system/iplChannelScriptManager.cpp"),
|
||||
Object(Matching, "system/iplNand.cpp"),
|
||||
Object(NonMatching, "system/iplNandShared.cpp"),
|
||||
Object(Matching, "system/iplNandShared.cpp"),
|
||||
Object(Matching, "system/iplNandMeta.cpp"),
|
||||
Object(Matching, "system/iplNandManager.cpp"),
|
||||
Object(Matching, "system/iplNandWall.cpp"),
|
||||
@@ -655,7 +655,7 @@ config.libs = [
|
||||
Object(Matching, "system/iplPostmanManager.cpp"),
|
||||
Object(NonMatching, "system/iplSaveDataManager.cpp"),
|
||||
Object(Matching, "system/iplChannelRsoThread.cpp"),
|
||||
Object(Equivalent, "system/RsoSystem.cpp"),
|
||||
Object(Matching, "system/RsoSystem.cpp"),
|
||||
Object(Matching, "system/iplCdbBackup.cpp"),
|
||||
Object(NonMatching, "system/odh.cpp"),
|
||||
Object(Matching, "system/iplSDVFWorker.cpp"),
|
||||
@@ -673,7 +673,7 @@ config.libs = [
|
||||
Object(Matching, "utility/iplFrameController.cpp"),
|
||||
Object(Equivalent, "utility/iplGraphics.cpp"),
|
||||
Object(Matching, "utility/iplCapture.cpp"),
|
||||
Object(Equivalent, "utility/iplUtility.cpp"),
|
||||
Object(Matching, "utility/iplUtility.cpp"),
|
||||
Object(Matching, "utility/iplThread.cpp"),
|
||||
Object(Matching, "utility/iplMessageBase.cpp"),
|
||||
Object(Matching, "utility/iplJpegDecoder.cpp"),
|
||||
@@ -694,7 +694,7 @@ config.libs = [
|
||||
IPLSection("iplwww", [
|
||||
Object(Equivalent, "iplwww/www_browser.cpp"),
|
||||
Object(Matching, "iplwww/www_message.cpp"),
|
||||
Object(Equivalent, "iplwww/www_surface.cpp"),
|
||||
Object(Matching, "iplwww/www_surface.cpp"),
|
||||
Object(Matching, "iplwww/www_thread.cpp"),
|
||||
Object(Matching, "iplwww/www_print.cpp"),
|
||||
Object(Equivalent, "iplwww/www_window.cpp"),
|
||||
@@ -745,7 +745,7 @@ config.libs = [
|
||||
]
|
||||
),
|
||||
IPLSection("button", [
|
||||
Object(Equivalent, "scene/button/iplButton.cpp"),
|
||||
Object(Matching, "scene/button/iplButton.cpp"),
|
||||
Object(Matching, "scene/button/iplArrow.cpp"),
|
||||
]
|
||||
),
|
||||
@@ -890,12 +890,12 @@ config.libs = [
|
||||
IPLSection("sceneSystem", [
|
||||
Object(Matching, "scene/sceneSystem/iplSceneBase.cpp"),
|
||||
Object(Matching, "scene/sceneSystem/iplSceneCreator.cpp"),
|
||||
Object(Equivalent, "scene/sceneSystem/iplSceneManager.cpp"),
|
||||
Object(Matching, "scene/sceneSystem/iplSceneManager.cpp"),
|
||||
Object(Matching, "scene/sceneSystem/iplFaderSceneBase.cpp"),
|
||||
]
|
||||
),
|
||||
IPLSection("textWriter", [
|
||||
Object(Equivalent, "scene/textWriter/iplTextWriter.cpp"),
|
||||
Object(Matching, "scene/textWriter/iplTextWriter.cpp"),
|
||||
]
|
||||
),
|
||||
IPLSection("bannerSound", [
|
||||
@@ -1031,7 +1031,7 @@ config.libs = [
|
||||
Object(Matching, "cdb/CDBFBridgeVF.c"),
|
||||
Object(Matching, "cdb/CDBFBridgeSD.c"),
|
||||
Object(Matching, "cdb/CDBId.c"),
|
||||
Object(NonMatching, "cdb/CDBCrypt.c"),
|
||||
Object(Matching, "cdb/CDBCrypt.c"),
|
||||
]
|
||||
),
|
||||
RevoEXLib("ncd", [
|
||||
@@ -1940,9 +1940,9 @@ config.libs = [
|
||||
),
|
||||
# MSL Library
|
||||
MSLLib("MSL_C.PPCEABI.bare.H", [
|
||||
Object(NonMatching, "MSL_Common/alloc.c"),
|
||||
Object(Matching, "MSL_Common/alloc.c"),
|
||||
Object(Matching, "MSL_Common/errno.c"),
|
||||
Object(NonMatching, "MSL_Common/ansi_files.c"),
|
||||
Object(Matching, "MSL_Common/ansi_files.c"),
|
||||
Object(NonMatching, "MSL_Common_Embedded/ansi_fp.c"),
|
||||
Object(Matching, "MSL_Common/ctype.c"),
|
||||
Object(NonMatching, "MSL_Common/locale.c"),
|
||||
|
||||
@@ -48,13 +48,21 @@ namespace ext_ead {
|
||||
extern const char* Message[6];
|
||||
|
||||
// TODO: sort out this messy match hack
|
||||
#ifdef IPL_WWW_SURFACE_MESSAGE
|
||||
#define IPL_WWW_SURFACE_ZERO_DECL __declspec(weak) extern const char IPL_WWW_SURFACE_ZERO[];
|
||||
#define IPL_WWW_STRIPPED_MESSAGE print::IPL_WWW_SURFACE_ZERO
|
||||
#else
|
||||
#define IPL_WWW_SURFACE_ZERO_DECL
|
||||
#define IPL_WWW_STRIPPED_MESSAGE ""
|
||||
#endif
|
||||
IPL_WWW_SURFACE_ZERO_DECL
|
||||
#define IPL_WWW_REPORT_REDEFINE_MESSAGE(RESPECT_STRIP) \
|
||||
char MSG_TICK_TIMER_TAG[12] = "[TickTimer]"; \
|
||||
char MSG_WARNING_TAG[10] = "[Warning]"; \
|
||||
char MSG_EVENT_TAG[10] = "[[Event]]"; \
|
||||
const char* Message[] = { \
|
||||
RESPECT_STRIP ? NULL : MSG_TICK_TIMER_TAG, RESPECT_STRIP ? NULL : MSG_WARNING_TAG, RESPECT_STRIP ? NULL : "[Info]", \
|
||||
RESPECT_STRIP ? NULL : "[Debug]", RESPECT_STRIP ? "" : MSG_EVENT_TAG, RESPECT_STRIP ? NULL : "", \
|
||||
RESPECT_STRIP ? NULL : "[Debug]", RESPECT_STRIP ? IPL_WWW_STRIPPED_MESSAGE : MSG_EVENT_TAG, RESPECT_STRIP ? NULL : "", \
|
||||
};
|
||||
} // namespace print
|
||||
} // namespace www
|
||||
|
||||
@@ -44,32 +44,32 @@ namespace EGG {
|
||||
mpArchive = &mDvdSoundArchive;
|
||||
|
||||
if (pDvdArchive->Open(pPath)) {
|
||||
u32 headerSize;
|
||||
u32 setupSize;
|
||||
u32 strmSize;
|
||||
u32 stringSize;
|
||||
mbIsOpeningArchive = true;
|
||||
headerSize = pDvdArchive->GetHeaderSize();
|
||||
|
||||
u32 headerSize = pDvdArchive->GetHeaderSize();
|
||||
void* pHeaderBuffer = pHeap->Alloc(headerSize, NULL, NULL);
|
||||
|
||||
if (!pDvdArchive->LoadHeader(pHeaderBuffer, headerSize)) {
|
||||
if (!pDvdArchive->LoadHeader(pHeap->Alloc(headerSize, NULL, NULL), headerSize)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 setupSize = mSoundArchivePlayer.GetRequiredMemSize(pDvdArchive);
|
||||
u32 strmSize = mSoundArchivePlayer.GetRequiredStrmBufferSize(pDvdArchive);
|
||||
void* pSetupBuffer = pHeap->Alloc(setupSize, NULL, NULL);
|
||||
void* pStrmBuffer = pHeap->Alloc(strmSize, NULL, NULL);
|
||||
setupSize = mSoundArchivePlayer.GetRequiredMemSize(pDvdArchive);
|
||||
strmSize = mSoundArchivePlayer.GetRequiredStrmBufferSize(pDvdArchive);
|
||||
|
||||
if (!mSoundArchivePlayer.Setup(pDvdArchive, pSetupBuffer, setupSize, pStrmBuffer, strmSize)) {
|
||||
if (!mSoundArchivePlayer.Setup(pDvdArchive, pHeap->Alloc(setupSize, NULL, NULL), setupSize,
|
||||
pHeap->Alloc(strmSize, NULL, NULL), strmSize)) {
|
||||
mbIsOpeningArchive = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 stringSize = pDvdArchive->GetLabelStringDataSize();
|
||||
void* pStringBuffer = pHeap->Alloc(stringSize, NULL, NULL);
|
||||
stringSize = pDvdArchive->GetLabelStringDataSize();
|
||||
|
||||
pDvdArchive->LoadLabelStringData(pStringBuffer, stringSize);
|
||||
pDvdArchive->LoadLabelStringData(pHeap->Alloc(stringSize, NULL, NULL), stringSize);
|
||||
|
||||
mStorage = SARC_STORAGE_DVD;
|
||||
mbIsOpeningArchive = false;
|
||||
mStorage = SARC_STORAGE_DVD;
|
||||
return &mSoundArchivePlayer;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,144 +3,151 @@
|
||||
#pragma exceptions on
|
||||
|
||||
extern void __sys_free(void* ptr);
|
||||
|
||||
typedef struct Block {
|
||||
struct Block* prev;
|
||||
struct Block* next;
|
||||
unsigned int max_size;
|
||||
unsigned int size;
|
||||
} Block;
|
||||
|
||||
typedef struct SubBlock {
|
||||
unsigned int size;
|
||||
Block* block;
|
||||
struct SubBlock* prev;
|
||||
struct SubBlock* next;
|
||||
} SubBlock;
|
||||
|
||||
struct FixSubBlock;
|
||||
|
||||
typedef struct FixBlock {
|
||||
struct FixBlock* prev_;
|
||||
struct FixBlock* next_;
|
||||
unsigned int client_size_;
|
||||
struct FixSubBlock* start_;
|
||||
unsigned int n_allocated_;
|
||||
} FixBlock;
|
||||
|
||||
typedef struct FixSubBlock {
|
||||
FixBlock* block_;
|
||||
struct FixSubBlock* next_;
|
||||
} FixSubBlock;
|
||||
|
||||
typedef struct FixStart {
|
||||
FixBlock* tail_;
|
||||
FixBlock* head_;
|
||||
} FixStart;
|
||||
|
||||
typedef struct __mem_pool_obj {
|
||||
Block* start_;
|
||||
FixStart fix_start[6];
|
||||
} __mem_pool_obj;
|
||||
extern void* __sys_alloc(unsigned int size);
|
||||
|
||||
typedef struct __mem_pool {
|
||||
void* reserved[14];
|
||||
} __mem_pool;
|
||||
|
||||
typedef int tag_word;
|
||||
typedef struct Block {
|
||||
struct Block* pPrev;
|
||||
struct Block* pNext;
|
||||
unsigned int maxSize;
|
||||
unsigned int size;
|
||||
} Block;
|
||||
|
||||
typedef struct block_header {
|
||||
tag_word tag;
|
||||
struct block_header* prev;
|
||||
struct block_header* next;
|
||||
} block_header;
|
||||
typedef struct SubBlock {
|
||||
unsigned int size;
|
||||
Block* pBlock;
|
||||
struct SubBlock* pPrev;
|
||||
struct SubBlock* pNext;
|
||||
} SubBlock;
|
||||
|
||||
typedef struct list_header {
|
||||
block_header* rover;
|
||||
block_header header;
|
||||
} list_header;
|
||||
struct FixSubBlock;
|
||||
|
||||
typedef struct heap_header {
|
||||
struct heap_header* prev;
|
||||
struct heap_header* next;
|
||||
} heap_header;
|
||||
typedef struct FixBlock {
|
||||
struct FixBlock* pPrev;
|
||||
struct FixBlock* pNext;
|
||||
unsigned int clientSize;
|
||||
struct FixSubBlock* pStart;
|
||||
unsigned int allocatedSize;
|
||||
} FixBlock;
|
||||
|
||||
struct mem_pool_obj;
|
||||
typedef void* (*sys_alloc_ptr)(unsigned int, struct mem_pool_obj*);
|
||||
typedef void (*sys_free_ptr)(void*, struct mem_pool_obj*);
|
||||
typedef struct FixSubBlock {
|
||||
FixBlock* pBlock;
|
||||
struct FixSubBlock* pNext;
|
||||
} FixSubBlock;
|
||||
|
||||
typedef struct pool_options {
|
||||
sys_alloc_ptr sys_alloc_func;
|
||||
sys_free_ptr sys_free_func;
|
||||
unsigned int min_heap_size;
|
||||
int always_search_first;
|
||||
} pool_options;
|
||||
typedef struct FixStart {
|
||||
FixBlock* pTail;
|
||||
FixBlock* pHead;
|
||||
} FixStart;
|
||||
|
||||
typedef struct mem_pool_obj {
|
||||
list_header free_list;
|
||||
pool_options options;
|
||||
heap_header* heap_list;
|
||||
void* userData;
|
||||
|
||||
} mem_pool_obj;
|
||||
|
||||
mem_pool_obj __malloc_pool;
|
||||
static int initialized = 0;
|
||||
typedef struct __mem_pool_obj {
|
||||
Block* pStart;
|
||||
FixStart fixStart[6];
|
||||
} __mem_pool_obj;
|
||||
|
||||
static SubBlock* SubBlock_merge_prev(SubBlock*, SubBlock**);
|
||||
static void SubBlock_merge_next(SubBlock*, SubBlock**);
|
||||
static SubBlock* Block_subBlock(Block*, unsigned int, unsigned int*);
|
||||
static void* allocate_from_var_pools(__mem_pool_obj*, unsigned int, unsigned int*);
|
||||
static void* soft_allocate_from_var_pools(__mem_pool_obj*, unsigned int, unsigned int*);
|
||||
static void FixBlock_construct(FixBlock*, FixBlock*, FixBlock*, unsigned int, void*, unsigned int);
|
||||
static void* allocate_from_fixed_pools(__mem_pool_obj*, unsigned int, unsigned int*);
|
||||
static unsigned int __pool_allocate_resize(__mem_pool_obj*, void*, unsigned int, unsigned int*);
|
||||
|
||||
static const unsigned int fix_pool_sizes[] = {4, 12, 20, 36, 52, 68};
|
||||
const unsigned int fix_pool_sizes[] = {4, 12, 20, 36, 52, 68};
|
||||
|
||||
#define SubBlock_size(ths) ((ths)->size & 0xFFFFFFF8)
|
||||
#define SubBlock_block(ths) ((Block*)((unsigned int)((ths)->block) & ~0x1))
|
||||
#define SubBlock_block(ths) ((Block*)((unsigned int)((ths)->pBlock) & ~0x1))
|
||||
#define Block_size(ths) ((ths)->size & 0xFFFFFFF8)
|
||||
#define Block_start(ths) (*(SubBlock**)((char*)(ths) + Block_size((ths)) - sizeof(unsigned int)))
|
||||
|
||||
#define SubBlock_set_free(ths) \
|
||||
unsigned int this_size = SubBlock_size((ths)); \
|
||||
(ths)->size &= ~0x2; \
|
||||
*(unsigned int*)((char*)(ths) + this_size) &= ~0x4; \
|
||||
((SubBlock*)((char*)(ths) + this_size))->size &= ~0x4; \
|
||||
*(unsigned int*)((char*)(ths) + this_size - sizeof(unsigned int)) = this_size
|
||||
|
||||
#define SubBlock_is_free(ths) !((ths)->size & 2)
|
||||
#define SubBlock_set_size(ths, sz) \
|
||||
(ths)->size &= ~0xFFFFFFF8; \
|
||||
(ths)->size |= (sz) & 0xFFFFFFF8; \
|
||||
if (SubBlock_is_free((ths))) \
|
||||
*(unsigned int*)((char*)(ths) + (sz) - sizeof(unsigned int)) = (sz)
|
||||
if (SubBlock_is_free((ths))) { \
|
||||
*(unsigned int*)((char*)(ths) + (sz) - sizeof(unsigned int)) = (sz); \
|
||||
}
|
||||
|
||||
#define SubBlock_from_pointer(ptr) ((SubBlock*)((char*)(ptr) - 8))
|
||||
#define FixSubBlock_from_pointer(ptr) ((FixSubBlock*)((char*)(ptr) - 4))
|
||||
|
||||
#define FixBlock_client_size(ths) ((ths)->client_size_)
|
||||
#define FixSubBlock_size(ths) (FixBlock_client_size((ths)->block_))
|
||||
#define FixBlock_client_size(ths) ((ths)->clientSize)
|
||||
#define FixSubBlock_size(ths) (FixBlock_client_size((ths)->pBlock))
|
||||
|
||||
#define classify(ptr) (*(unsigned int*)((char*)(ptr) - sizeof(unsigned int)) & 1)
|
||||
#define classify(ptr) ((unsigned int)FixSubBlock_from_pointer(ptr)->pBlock & 1)
|
||||
#define __msize_inline(ptr) (!classify(ptr) ? FixSubBlock_size(FixSubBlock_from_pointer(ptr)) : SubBlock_size(SubBlock_from_pointer(ptr)) - 8)
|
||||
|
||||
#define Block_empty(ths) (_sb = (SubBlock*)((char*)(ths) + 16)), SubBlock_is_free(_sb) && SubBlock_size(_sb) == Block_size((ths)) - 24
|
||||
#define Block_empty(ths) (_sb = (SubBlock*)(ths + 1)), SubBlock_is_free(_sb) && SubBlock_size(_sb) == Block_size((ths)) - 24
|
||||
|
||||
void Block_link(Block* ths, SubBlock* sb) {
|
||||
SubBlock** st;
|
||||
SubBlock_set_free(sb);
|
||||
st = &Block_start(ths);
|
||||
void Block_link(Block*, SubBlock*);
|
||||
void deallocate_from_fixed_pools(__mem_pool_obj*, void*, unsigned int);
|
||||
void* malloc(unsigned int);
|
||||
void* calloc(unsigned int, unsigned int);
|
||||
void* realloc(void*, unsigned int);
|
||||
void free(void*);
|
||||
|
||||
if (*st != 0) {
|
||||
sb->prev = (*st)->prev;
|
||||
sb->prev->next = sb;
|
||||
sb->next = *st;
|
||||
(*st)->prev = sb;
|
||||
*st = sb;
|
||||
*st = SubBlock_merge_prev(*st, st);
|
||||
SubBlock_merge_next(*st, st);
|
||||
} else {
|
||||
*st = sb;
|
||||
sb->prev = sb;
|
||||
sb->next = sb;
|
||||
static void SubBlock_construct(SubBlock* ths, unsigned int size, Block* bp, int prev_alloc, int this_alloc) {
|
||||
ths->pBlock = (Block*)((unsigned int)bp | 1);
|
||||
ths->size = size;
|
||||
if (prev_alloc) {
|
||||
ths->size |= 4;
|
||||
}
|
||||
if (this_alloc) {
|
||||
ths->size |= 2;
|
||||
((SubBlock*)((char*)ths + size))->size |= 4;
|
||||
} else {
|
||||
*(unsigned int*)((char*)ths + size - sizeof(unsigned int)) = size;
|
||||
}
|
||||
}
|
||||
|
||||
static SubBlock* SubBlock_split(SubBlock* ths, unsigned int sz) {
|
||||
unsigned int origsize;
|
||||
int isfree;
|
||||
int isprevalloc;
|
||||
SubBlock* np;
|
||||
Block* bp;
|
||||
origsize = SubBlock_size(ths);
|
||||
isfree = SubBlock_is_free(ths);
|
||||
isprevalloc = (int)(ths->size & 4);
|
||||
np = (SubBlock*)((char*)ths + sz);
|
||||
bp = SubBlock_block(ths);
|
||||
SubBlock_construct(ths, sz, bp, isprevalloc, !isfree);
|
||||
SubBlock_construct(np, origsize - sz, bp, !isfree, !isfree);
|
||||
if (isfree) {
|
||||
np->pNext = ths->pNext;
|
||||
np->pNext->pPrev = np;
|
||||
np->pPrev = ths;
|
||||
ths->pNext = np;
|
||||
}
|
||||
return np;
|
||||
}
|
||||
|
||||
static void Block_unlink(Block* ths, SubBlock* sb) {
|
||||
SubBlock** st;
|
||||
unsigned int this_size = SubBlock_size(sb);
|
||||
sb->size |= 2;
|
||||
((SubBlock*)((char*)sb + this_size))->size |= 4;
|
||||
st = &Block_start(ths);
|
||||
if (*st == sb) {
|
||||
*st = sb->pNext;
|
||||
}
|
||||
if (*st == sb) {
|
||||
*st = NULL;
|
||||
ths->maxSize = 0;
|
||||
} else {
|
||||
sb->pNext->pPrev = sb->pPrev;
|
||||
sb->pPrev->pNext = sb->pNext;
|
||||
}
|
||||
if (ths->max_size < SubBlock_size(*st))
|
||||
ths->max_size = SubBlock_size(*st);
|
||||
}
|
||||
|
||||
static SubBlock* SubBlock_merge_prev(SubBlock* ths, SubBlock** start) {
|
||||
@@ -149,72 +156,39 @@ static SubBlock* SubBlock_merge_prev(SubBlock* ths, SubBlock** start) {
|
||||
|
||||
if (!(ths->size & 0x04)) {
|
||||
prevsz = *(unsigned int*)((char*)ths - sizeof(unsigned int));
|
||||
if (prevsz & 0x2)
|
||||
if (prevsz & 0x2) {
|
||||
return ths;
|
||||
}
|
||||
p = (SubBlock*)((char*)ths - prevsz);
|
||||
SubBlock_set_size(p, prevsz + SubBlock_size(ths));
|
||||
|
||||
if (*start == ths)
|
||||
*start = (*start)->next;
|
||||
ths->next->prev = ths->prev;
|
||||
ths->next->prev->next = ths->next;
|
||||
if (*start == ths) {
|
||||
*start = (*start)->pNext;
|
||||
}
|
||||
ths->pNext->pPrev = ths->pPrev;
|
||||
ths->pNext->pPrev->pNext = ths->pNext;
|
||||
return p;
|
||||
}
|
||||
return ths;
|
||||
}
|
||||
|
||||
static void SubBlock_merge_next(SubBlock* pBlock, SubBlock** pStart) {
|
||||
SubBlock* next_sub_block;
|
||||
unsigned int this_cur_size;
|
||||
|
||||
next_sub_block = (SubBlock*)((char*)pBlock + (pBlock->size & 0xFFFFFFF8));
|
||||
|
||||
if (!(next_sub_block->size & 2)) {
|
||||
this_cur_size = (pBlock->size & 0xFFFFFFF8) + (next_sub_block->size & 0xFFFFFFF8);
|
||||
|
||||
pBlock->size &= ~0xFFFFFFF8;
|
||||
pBlock->size |= this_cur_size & 0xFFFFFFF8;
|
||||
|
||||
if (!(pBlock->size & 2)) {
|
||||
*(unsigned int*)((char*)(pBlock) + (this_cur_size)-4) = (this_cur_size);
|
||||
}
|
||||
|
||||
if (!(pBlock->size & 2)) {
|
||||
*(unsigned int*)((char*)pBlock + this_cur_size) &= ~4;
|
||||
} else {
|
||||
*(unsigned int*)((char*)pBlock + this_cur_size) |= 4;
|
||||
}
|
||||
|
||||
if (*pStart == next_sub_block) {
|
||||
*pStart = (*pStart)->next;
|
||||
}
|
||||
|
||||
if (*pStart == next_sub_block) {
|
||||
*pStart = 0;
|
||||
}
|
||||
|
||||
next_sub_block->next->prev = next_sub_block->prev;
|
||||
next_sub_block->prev->next = next_sub_block->next;
|
||||
}
|
||||
}
|
||||
|
||||
static Block* __unlink(__mem_pool_obj* pool_obj, Block* bp) {
|
||||
Block* result = bp->next;
|
||||
Block* result = bp->pNext;
|
||||
if (result == bp) {
|
||||
result = 0;
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
if (pool_obj->start_ == bp) {
|
||||
pool_obj->start_ = result;
|
||||
if (pool_obj->pStart == bp) {
|
||||
pool_obj->pStart = result;
|
||||
}
|
||||
|
||||
if (result != 0) {
|
||||
result->prev = bp->prev;
|
||||
result->prev->next = result;
|
||||
if (result != NULL) {
|
||||
result->pPrev = bp->pPrev;
|
||||
result->pPrev->pNext = result;
|
||||
}
|
||||
|
||||
bp->next = 0;
|
||||
bp->prev = 0;
|
||||
bp->pNext = NULL;
|
||||
bp->pPrev = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -231,12 +205,13 @@ static void deallocate_from_var_pools(__mem_pool_obj* pool_obj, void* ptr) {
|
||||
}
|
||||
}
|
||||
|
||||
void __init_pool_obj(__mem_pool* pool_obj) {
|
||||
static void __init_pool_obj(__mem_pool* pool_obj) {
|
||||
memset(pool_obj, 0, sizeof(__mem_pool_obj));
|
||||
}
|
||||
|
||||
__mem_pool protopool;
|
||||
|
||||
static __mem_pool* get_malloc_pool() {
|
||||
static __mem_pool protopool;
|
||||
static unsigned char init = 0;
|
||||
if (!init) {
|
||||
__init_pool_obj(&protopool);
|
||||
@@ -246,67 +221,11 @@ static __mem_pool* get_malloc_pool() {
|
||||
return &protopool;
|
||||
}
|
||||
|
||||
void deallocate_from_fixed_pools(__mem_pool_obj* pool_obj, void* ptr, unsigned int size) {
|
||||
unsigned int i = 0;
|
||||
FixSubBlock* p;
|
||||
FixBlock* b;
|
||||
FixStart* fs;
|
||||
|
||||
while (size > fix_pool_sizes[i]) {
|
||||
++i;
|
||||
}
|
||||
|
||||
fs = &pool_obj->fix_start[i];
|
||||
p = FixSubBlock_from_pointer(ptr);
|
||||
b = p->block_;
|
||||
|
||||
if (b->start_ == 0 && fs->head_ != b) {
|
||||
if (fs->tail_ == b) {
|
||||
fs->head_ = fs->head_->prev_;
|
||||
fs->tail_ = fs->tail_->prev_;
|
||||
} else {
|
||||
b->prev_->next_ = b->next_;
|
||||
b->next_->prev_ = b->prev_;
|
||||
b->next_ = fs->head_;
|
||||
b->prev_ = b->next_->prev_;
|
||||
b->prev_->next_ = b;
|
||||
b->next_->prev_ = b;
|
||||
fs->head_ = b;
|
||||
}
|
||||
}
|
||||
|
||||
p->next_ = b->start_;
|
||||
b->start_ = p;
|
||||
|
||||
if (--b->n_allocated_ == 0) {
|
||||
if (fs->head_ == b) {
|
||||
fs->head_ = b->next_;
|
||||
}
|
||||
|
||||
if (fs->tail_ == b) {
|
||||
fs->tail_ = b->prev_;
|
||||
}
|
||||
|
||||
b->prev_->next_ = b->next_;
|
||||
b->next_->prev_ = b->prev_;
|
||||
|
||||
if (fs->head_ == b) {
|
||||
fs->head_ = 0;
|
||||
}
|
||||
|
||||
if (fs->tail_ == b) {
|
||||
fs->tail_ = 0;
|
||||
}
|
||||
|
||||
deallocate_from_var_pools(pool_obj, b);
|
||||
}
|
||||
}
|
||||
|
||||
void __pool_free(__mem_pool* pool, void* ptr) {
|
||||
static void __pool_free(__mem_pool* pool, void* ptr) {
|
||||
__mem_pool_obj* pool_obj;
|
||||
unsigned int size;
|
||||
|
||||
if (ptr == 0) {
|
||||
if (ptr == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -320,6 +239,559 @@ void __pool_free(__mem_pool* pool, void* ptr) {
|
||||
}
|
||||
}
|
||||
|
||||
static void link(__mem_pool_obj* pool, Block* bp) {
|
||||
if (pool->pStart != NULL) {
|
||||
bp->pPrev = pool->pStart->pPrev;
|
||||
bp->pPrev->pNext = bp;
|
||||
bp->pNext = pool->pStart;
|
||||
pool->pStart->pPrev = bp;
|
||||
pool->pStart = bp;
|
||||
} else {
|
||||
pool->pStart = bp;
|
||||
bp->pPrev = bp;
|
||||
bp->pNext = bp;
|
||||
}
|
||||
}
|
||||
|
||||
static void Block_construct(Block* ths, unsigned int size) {
|
||||
SubBlock* sb;
|
||||
|
||||
ths->size = size | 3;
|
||||
((SubBlock*)((char*)ths + size - 8))->size = ths->size;
|
||||
|
||||
sb = (SubBlock*)(ths + 1);
|
||||
sb->pBlock = (Block*)((unsigned int)ths | 1);
|
||||
sb->size = size - 0x18;
|
||||
*(unsigned int*)((char*)sb + (size - 0x18) - sizeof(unsigned int)) = size - 0x18;
|
||||
|
||||
ths->maxSize = size - 0x18;
|
||||
Block_start(ths) = NULL;
|
||||
|
||||
Block_link(ths, sb);
|
||||
}
|
||||
|
||||
static Block* link_new_block(__mem_pool_obj* pool, unsigned int size) {
|
||||
Block* bp;
|
||||
|
||||
size = (size + 31) & ~7;
|
||||
if (size < 0x10000) {
|
||||
size = 0x10000;
|
||||
}
|
||||
|
||||
bp = (Block*)__sys_alloc(size);
|
||||
if (bp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Block_construct(bp, size);
|
||||
link(pool, bp);
|
||||
return bp;
|
||||
}
|
||||
|
||||
static SubBlock* Block_subBlock(Block* bp, unsigned int size, unsigned int* out) {
|
||||
SubBlock* st;
|
||||
SubBlock* sb;
|
||||
unsigned int sb_size;
|
||||
unsigned int max_found;
|
||||
st = Block_start(bp);
|
||||
if (st == NULL) {
|
||||
bp->maxSize = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sb = st;
|
||||
sb_size = SubBlock_size(sb);
|
||||
max_found = sb_size;
|
||||
|
||||
while (sb_size < size) {
|
||||
sb = sb->pNext;
|
||||
sb_size = SubBlock_size(sb);
|
||||
if (max_found < sb_size) {
|
||||
max_found = sb_size;
|
||||
}
|
||||
if (sb == st) {
|
||||
bp->maxSize = max_found;
|
||||
if (out != NULL) {
|
||||
*out = max_found - 8;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (sb_size - size >= 0x50) {
|
||||
SubBlock_split(sb, size);
|
||||
}
|
||||
|
||||
Block_start(bp) = sb->pNext;
|
||||
Block_unlink(bp, sb);
|
||||
|
||||
if (out != NULL) {
|
||||
*out = SubBlock_size(sb) - 8;
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
static void Block_link(Block* ths, SubBlock* sb) {
|
||||
SubBlock** st;
|
||||
SubBlock_set_free(sb);
|
||||
st = &Block_start(ths);
|
||||
|
||||
if (*st != NULL) {
|
||||
sb->pPrev = (*st)->pPrev;
|
||||
sb->pPrev->pNext = sb;
|
||||
sb->pNext = *st;
|
||||
(*st)->pPrev = sb;
|
||||
*st = sb;
|
||||
*st = SubBlock_merge_prev(*st, st);
|
||||
SubBlock_merge_next(*st, st);
|
||||
} else {
|
||||
*st = sb;
|
||||
sb->pPrev = sb;
|
||||
sb->pNext = sb;
|
||||
}
|
||||
if (ths->maxSize < SubBlock_size(*st)) {
|
||||
ths->maxSize = SubBlock_size(*st);
|
||||
}
|
||||
}
|
||||
|
||||
static void SubBlock_merge_next(SubBlock* pBlock, SubBlock** pStart) {
|
||||
SubBlock* next_sub_block;
|
||||
unsigned int this_cur_size;
|
||||
|
||||
next_sub_block = (SubBlock*)((char*)pBlock + (pBlock->size & 0xFFFFFFF8));
|
||||
|
||||
if (!(next_sub_block->size & 2)) {
|
||||
this_cur_size = (pBlock->size & 0xFFFFFFF8) + (next_sub_block->size & 0xFFFFFFF8);
|
||||
|
||||
pBlock->size &= ~0xFFFFFFF8;
|
||||
pBlock->size |= this_cur_size & 0xFFFFFFF8;
|
||||
|
||||
if (!(pBlock->size & 2)) {
|
||||
*(unsigned int*)((char*)pBlock + this_cur_size - sizeof(unsigned int)) = this_cur_size;
|
||||
}
|
||||
|
||||
if (!(pBlock->size & 2)) {
|
||||
((SubBlock*)((char*)pBlock + this_cur_size))->size &= ~4;
|
||||
} else {
|
||||
((SubBlock*)((char*)pBlock + this_cur_size))->size |= 4;
|
||||
}
|
||||
|
||||
if (*pStart == next_sub_block) {
|
||||
*pStart = (*pStart)->pNext;
|
||||
}
|
||||
|
||||
if (*pStart == next_sub_block) {
|
||||
*pStart = NULL;
|
||||
}
|
||||
|
||||
next_sub_block->pNext->pPrev = next_sub_block->pPrev;
|
||||
next_sub_block->pPrev->pNext = next_sub_block->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
static void* allocate_from_var_pools(__mem_pool_obj* pool, unsigned int size, unsigned int* out) {
|
||||
Block* bp;
|
||||
SubBlock* ptr;
|
||||
|
||||
if (out != NULL) {
|
||||
*out = 0;
|
||||
}
|
||||
|
||||
size = (size + 15) & ~7;
|
||||
if (size < 0x50) {
|
||||
size = 0x50;
|
||||
}
|
||||
|
||||
bp = pool->pStart != NULL ? pool->pStart : link_new_block(pool, size);
|
||||
if (bp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
do {
|
||||
if (size <= bp->maxSize) {
|
||||
ptr = Block_subBlock(bp, size, out);
|
||||
if (ptr != NULL) {
|
||||
pool->pStart = bp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bp = bp->pNext;
|
||||
if (bp == pool->pStart) {
|
||||
bp = link_new_block(pool, size);
|
||||
if (bp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
ptr = Block_subBlock(bp, size, out);
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
return (char*)ptr + 8;
|
||||
}
|
||||
|
||||
static void* soft_allocate_from_var_pools(__mem_pool_obj* pool, unsigned int size, unsigned int* out) {
|
||||
register Block* bp;
|
||||
register SubBlock* ptr;
|
||||
|
||||
size = (size + 15) & ~7;
|
||||
if (size < 0x50) {
|
||||
size = 0x50;
|
||||
}
|
||||
*out = 0;
|
||||
bp = pool->pStart;
|
||||
if (bp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
do {
|
||||
if (size <= bp->maxSize) {
|
||||
ptr = Block_subBlock(bp, size, NULL);
|
||||
if (ptr != NULL) {
|
||||
pool->pStart = bp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bp->maxSize > 8 && *out < bp->maxSize - 8) {
|
||||
*out = bp->maxSize - 8;
|
||||
}
|
||||
bp = bp->pNext;
|
||||
if (bp == pool->pStart) {
|
||||
return NULL;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
return (char*)ptr + 8;
|
||||
}
|
||||
|
||||
static void FixBlock_construct(FixBlock* this, FixBlock* prev, FixBlock* next, unsigned int poolIdx, void* start, unsigned int totalSize) {
|
||||
unsigned int fixSubBlockSize;
|
||||
unsigned int n;
|
||||
char* p;
|
||||
unsigned int i;
|
||||
char* np;
|
||||
|
||||
this->pPrev = prev;
|
||||
this->pNext = next;
|
||||
prev->pNext = this;
|
||||
next->pPrev = this;
|
||||
this->clientSize = fix_pool_sizes[poolIdx];
|
||||
fixSubBlockSize = fix_pool_sizes[poolIdx] + 4;
|
||||
n = totalSize / fixSubBlockSize;
|
||||
p = (char*)start;
|
||||
for (i = 0; i < n - 1; ++i) {
|
||||
np = p + fixSubBlockSize;
|
||||
((FixSubBlock*)p)->pBlock = this;
|
||||
((FixSubBlock*)p)->pNext = (FixSubBlock*)np;
|
||||
p = np;
|
||||
}
|
||||
((FixSubBlock*)p)->pBlock = this;
|
||||
((FixSubBlock*)p)->pNext = NULL;
|
||||
this->pStart = (FixSubBlock*)start;
|
||||
this->allocatedSize = 0;
|
||||
}
|
||||
|
||||
static void* allocate_from_fixed_pools(__mem_pool_obj* pool, unsigned int size, unsigned int* out) {
|
||||
unsigned int i = 0;
|
||||
FixSubBlock* p;
|
||||
FixStart* fs;
|
||||
|
||||
while (size > fix_pool_sizes[i]) {
|
||||
++i;
|
||||
}
|
||||
fs = &pool->fixStart[i];
|
||||
if (fs->pHead == NULL || fs->pHead->pStart == NULL) {
|
||||
unsigned int size_requested = 0x1000;
|
||||
char* newblock;
|
||||
unsigned int size_received;
|
||||
unsigned int n, nsave, size_has;
|
||||
|
||||
n = (size_requested - sizeof(FixBlock)) / (fix_pool_sizes[i] + 4);
|
||||
if (n > 0x100) {
|
||||
n = 0x100;
|
||||
}
|
||||
nsave = n;
|
||||
while (n >= 10) {
|
||||
size_requested = n * (fix_pool_sizes[i] + 4) + sizeof(FixBlock);
|
||||
newblock = (char*)soft_allocate_from_var_pools(pool, size_requested, &size_has);
|
||||
if (newblock != NULL) {
|
||||
break;
|
||||
}
|
||||
if (size_has > sizeof(FixBlock)) {
|
||||
n = (size_has - sizeof(FixBlock)) / (fix_pool_sizes[i] + 4);
|
||||
} else {
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
if (newblock == NULL) {
|
||||
unsigned int cr_backup;
|
||||
n = nsave;
|
||||
while (1) {
|
||||
size_requested = n * (fix_pool_sizes[i] + 4) + sizeof(FixBlock);
|
||||
newblock = (char*)allocate_from_var_pools(pool, size_requested, &cr_backup);
|
||||
if (newblock != NULL) {
|
||||
break;
|
||||
}
|
||||
n = cr_backup / (fix_pool_sizes[i] + sizeof(FixBlock) + 4);
|
||||
if (n < 10) {
|
||||
if (out != NULL) {
|
||||
*out = 0;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
size_received = __msize_inline(newblock);
|
||||
if (fs->pHead == NULL) {
|
||||
fs->pHead = (FixBlock*)newblock;
|
||||
fs->pTail = (FixBlock*)newblock;
|
||||
}
|
||||
FixBlock_construct((FixBlock*)newblock, fs->pTail, fs->pHead, i, (FixSubBlock*)((FixBlock*)newblock + 1), size_received - sizeof(FixBlock));
|
||||
fs->pHead = (FixBlock*)newblock;
|
||||
}
|
||||
p = fs->pHead->pStart;
|
||||
fs->pHead->pStart = p->pNext;
|
||||
++fs->pHead->allocatedSize;
|
||||
if (fs->pHead->pStart == NULL) {
|
||||
fs->pHead = fs->pHead->pNext;
|
||||
fs->pTail = fs->pTail->pNext;
|
||||
}
|
||||
if (out != NULL) {
|
||||
*out = fix_pool_sizes[i];
|
||||
}
|
||||
return (char*)p + 4;
|
||||
}
|
||||
|
||||
void deallocate_from_fixed_pools(__mem_pool_obj* pool_obj, void* ptr, unsigned int size) {
|
||||
unsigned int i = 0;
|
||||
FixSubBlock* p;
|
||||
FixBlock* b;
|
||||
FixStart* fs;
|
||||
|
||||
while (size > fix_pool_sizes[i]) {
|
||||
++i;
|
||||
}
|
||||
|
||||
fs = &pool_obj->fixStart[i];
|
||||
p = FixSubBlock_from_pointer(ptr);
|
||||
b = p->pBlock;
|
||||
|
||||
if (b->pStart == NULL && fs->pHead != b) {
|
||||
if (fs->pTail == b) {
|
||||
fs->pHead = fs->pHead->pPrev;
|
||||
fs->pTail = fs->pTail->pPrev;
|
||||
} else {
|
||||
b->pPrev->pNext = b->pNext;
|
||||
b->pNext->pPrev = b->pPrev;
|
||||
b->pNext = fs->pHead;
|
||||
b->pPrev = b->pNext->pPrev;
|
||||
b->pPrev->pNext = b;
|
||||
b->pNext->pPrev = b;
|
||||
fs->pHead = b;
|
||||
}
|
||||
}
|
||||
|
||||
p->pNext = b->pStart;
|
||||
b->pStart = p;
|
||||
|
||||
if (--b->allocatedSize == 0) {
|
||||
if (fs->pHead == b) {
|
||||
fs->pHead = b->pNext;
|
||||
}
|
||||
|
||||
if (fs->pTail == b) {
|
||||
fs->pTail = b->pPrev;
|
||||
}
|
||||
|
||||
b->pPrev->pNext = b->pNext;
|
||||
b->pNext->pPrev = b->pPrev;
|
||||
|
||||
if (fs->pHead == b) {
|
||||
fs->pHead = NULL;
|
||||
}
|
||||
|
||||
if (fs->pTail == b) {
|
||||
fs->pTail = NULL;
|
||||
}
|
||||
|
||||
deallocate_from_var_pools(pool_obj, b);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int __pool_allocate_resize(__mem_pool_obj* pool, void* ptr, unsigned int size, unsigned int* out) {
|
||||
unsigned int sz;
|
||||
unsigned int this_size;
|
||||
unsigned int orig_size;
|
||||
SubBlock* sb;
|
||||
SubBlock* next_sub;
|
||||
|
||||
orig_size = __msize_inline(ptr);
|
||||
|
||||
if (size == orig_size) {
|
||||
if (out != NULL) {
|
||||
*out = orig_size;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (classify(ptr)) {
|
||||
if (size > 0xFFFFFF7F) {
|
||||
size = 0xFFFFFF7F;
|
||||
}
|
||||
sz = size + 8;
|
||||
sz = (sz + 7) & ~7;
|
||||
if (sz < 0x50) {
|
||||
sz = 0x50;
|
||||
}
|
||||
|
||||
sb = SubBlock_from_pointer(ptr);
|
||||
this_size = orig_size + 8;
|
||||
next_sub = (SubBlock*)((char*)sb + this_size);
|
||||
|
||||
if (SubBlock_is_free(next_sub) && sz <= this_size + SubBlock_size(next_sub)) {
|
||||
SubBlock_merge_next(sb, &Block_start(SubBlock_block(sb)));
|
||||
this_size = SubBlock_size(sb);
|
||||
}
|
||||
|
||||
if (this_size >= sz + 0x50) {
|
||||
Block_link(SubBlock_block(sb), SubBlock_split(sb, sz));
|
||||
this_size = SubBlock_size(sb);
|
||||
}
|
||||
|
||||
this_size -= 8;
|
||||
|
||||
if (out != NULL) {
|
||||
*out = this_size;
|
||||
}
|
||||
|
||||
if (size > orig_size) {
|
||||
if (out != NULL && size > this_size && SubBlock_is_free(next_sub)) {
|
||||
*out += SubBlock_size(next_sub);
|
||||
}
|
||||
return size <= this_size;
|
||||
}
|
||||
|
||||
return this_size < orig_size;
|
||||
}
|
||||
|
||||
if (out != NULL) {
|
||||
*out = orig_size;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* malloc(register unsigned int size) {
|
||||
void* rv;
|
||||
register __mem_pool_obj* pool_obj;
|
||||
|
||||
if (size == 0) {
|
||||
goto null_return;
|
||||
}
|
||||
|
||||
pool_obj = (__mem_pool_obj*)get_malloc_pool();
|
||||
|
||||
if (size > ~0x30u) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (size <= 68) {
|
||||
rv = allocate_from_fixed_pools(pool_obj, size, NULL);
|
||||
} else {
|
||||
rv = allocate_from_var_pools(pool_obj, size, NULL);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
null_return:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void free(void* ptr) {
|
||||
__pool_free(get_malloc_pool(), ptr);
|
||||
}
|
||||
|
||||
void* realloc(void* ptr, unsigned int size) {
|
||||
register unsigned int rv = size;
|
||||
register __mem_pool_obj* pool;
|
||||
unsigned int current_size;
|
||||
unsigned int orig_size;
|
||||
|
||||
pool = (__mem_pool_obj*)get_malloc_pool();
|
||||
|
||||
if (ptr == NULL) {
|
||||
if (rv > ~0x30u) {
|
||||
return NULL;
|
||||
}
|
||||
if (rv <= 68) {
|
||||
return allocate_from_fixed_pools(pool, rv, NULL);
|
||||
}
|
||||
return allocate_from_var_pools(pool, rv, NULL);
|
||||
}
|
||||
|
||||
if (rv == 0) {
|
||||
if (ptr != NULL) {
|
||||
current_size = __msize_inline(ptr);
|
||||
if (current_size <= 68) {
|
||||
deallocate_from_fixed_pools(pool, ptr, current_size);
|
||||
} else {
|
||||
deallocate_from_var_pools(pool, ptr);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
orig_size = __msize_inline(ptr);
|
||||
{
|
||||
unsigned int result = __pool_allocate_resize(pool, ptr, rv, NULL);
|
||||
if (result || rv <= orig_size) {
|
||||
return ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (rv > ~0x30u) {
|
||||
rv = 0;
|
||||
} else if (rv <= 68) {
|
||||
rv = (unsigned int)allocate_from_fixed_pools(pool, rv, NULL);
|
||||
} else {
|
||||
rv = (unsigned int)allocate_from_var_pools(pool, rv, NULL);
|
||||
}
|
||||
|
||||
if (rv != 0) {
|
||||
memcpy((void*)rv, ptr, orig_size);
|
||||
if (ptr != NULL) {
|
||||
unsigned int cur_sz = __msize_inline(ptr);
|
||||
if (cur_sz <= 68) {
|
||||
deallocate_from_fixed_pools(pool, ptr, cur_sz);
|
||||
} else {
|
||||
deallocate_from_var_pools(pool, ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (void*)rv;
|
||||
}
|
||||
|
||||
void* calloc(unsigned int nmemb, unsigned int size) {
|
||||
register void* ptr;
|
||||
register unsigned int total;
|
||||
__mem_pool_obj* pool_obj;
|
||||
|
||||
pool_obj = (__mem_pool_obj*)get_malloc_pool();
|
||||
|
||||
total = size * nmemb;
|
||||
|
||||
if (total > ~0x30u) {
|
||||
ptr = NULL;
|
||||
} else if (total <= 68) {
|
||||
ptr = allocate_from_fixed_pools(pool_obj, total, NULL);
|
||||
} else {
|
||||
ptr = allocate_from_var_pools(pool_obj, total, NULL);
|
||||
}
|
||||
|
||||
if (ptr != NULL) {
|
||||
memset(ptr, 0, total);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
123
libs/MSL/src/MSL_Common/ansi_files.c
Normal file
123
libs/MSL/src/MSL_Common/ansi_files.c
Normal file
@@ -0,0 +1,123 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern int __read_console(unsigned long, unsigned char*, size_t*, void*);
|
||||
extern int __write_console(unsigned long, unsigned char*, size_t*, void*);
|
||||
extern int __close_console(unsigned long);
|
||||
|
||||
#pragma exceptions on
|
||||
|
||||
unsigned char stdin_buff[0x100];
|
||||
unsigned char stdout_buff[0x100];
|
||||
unsigned char stderr_buff[0x100];
|
||||
|
||||
FILE __files[4] = {
|
||||
{
|
||||
0,
|
||||
{0, 1, 1, 2, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdin_buff,
|
||||
0x100,
|
||||
stdin_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
0,
|
||||
&__files[1],
|
||||
},
|
||||
{
|
||||
1,
|
||||
{0, 2, 1, 2, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdout_buff,
|
||||
0x100,
|
||||
stdout_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
0,
|
||||
&__files[2],
|
||||
},
|
||||
{
|
||||
2,
|
||||
{0, 2, 0, 2, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stderr_buff,
|
||||
0x100,
|
||||
stderr_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
0,
|
||||
&__files[3],
|
||||
},
|
||||
{0},
|
||||
};
|
||||
|
||||
void __close_all(void) {
|
||||
FILE* file;
|
||||
FILE* current;
|
||||
|
||||
for (file = __files; file != 0;) {
|
||||
if (file->mode.file_kind != 0) {
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
current = file;
|
||||
file = file->next_file;
|
||||
if (current->is_dyn_alloc != 0) {
|
||||
free(current);
|
||||
} else {
|
||||
current->mode.file_kind = 3;
|
||||
if (file != 0 && file->is_dyn_alloc != 0) {
|
||||
current->next_file = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int __flush_all(void) {
|
||||
int result = 0;
|
||||
FILE* file;
|
||||
|
||||
for (file = __files; file != 0; file = file->next_file) {
|
||||
if (file->mode.file_kind != 0 && fflush(file) != 0) {
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -247,7 +247,12 @@ typedef struct WPADCB {
|
||||
u8 unk_0x98F[0x9A0 - 0x990];
|
||||
} WPADCB;
|
||||
|
||||
extern WPADCB _wpd[WPAD_MAX_CONTROLLERS];
|
||||
typedef struct WPADStorage {
|
||||
WPADCB controllers[WPAD_MAX_CONTROLLERS];
|
||||
u8 unk_0x26C0[0x48];
|
||||
} WPADStorage;
|
||||
|
||||
extern WPADStorage _wpd;
|
||||
extern WPADCB* _wpdcb[WPAD_MAX_CONTROLLERS];
|
||||
|
||||
void WPADiInitSub();
|
||||
|
||||
@@ -10,7 +10,16 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXColor {
|
||||
#ifdef IPL_SYSTEM_COLOR_ALIGNMENT
|
||||
union {
|
||||
struct {
|
||||
u8 r, g, b, a;
|
||||
};
|
||||
u32 value;
|
||||
};
|
||||
#else
|
||||
u8 r, g, b, a; // 0x00
|
||||
#endif
|
||||
} GXColor;
|
||||
|
||||
typedef struct _GXColorS10 {
|
||||
|
||||
@@ -781,6 +781,109 @@ static ISD_Error sduGetOCR(SDDev* dev, u32* data) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __MWERKS__
|
||||
asm ISD_Error ISD_GetCardSize(register SDDev* dev, register u32* param_2, register u32* param_3, register u32* param_4) {
|
||||
nofralloc
|
||||
|
||||
stwu r1, -0x30(r1)
|
||||
mflr r0
|
||||
stw r0, 0x34(r1)
|
||||
stw r31, 0x2c(r1)
|
||||
mr r31, r6
|
||||
stw r30, 0x28(r1)
|
||||
mr r30, r5
|
||||
li r5, 0x10
|
||||
stw r29, 0x24(r1)
|
||||
mr r29, r4
|
||||
li r4, 0
|
||||
stw r28, 0x20(r1)
|
||||
mr r28, r3
|
||||
addi r3, r1, 8
|
||||
bl memset
|
||||
mr r3, r28
|
||||
addi r5, r1, 8
|
||||
li r4, 9
|
||||
li r6, 0x10
|
||||
bl ISD_ReadCardRegister
|
||||
cmpwi r3, 0
|
||||
beq ISD_GetCardSize_success
|
||||
b ISD_GetCardSize_return
|
||||
|
||||
ISD_GetCardSize_success:
|
||||
lwz r0, 0x14(r1)
|
||||
rlwinm. r0, r0, 0xa, 0x1e, 0x1f
|
||||
beq ISD_GetCardSize_standard
|
||||
lwz r0, 0xc(r1)
|
||||
li r5, 0x80
|
||||
rlwinm r3, r0, 0x18, 0xa, 0x1f
|
||||
addi r0, r3, 1
|
||||
slwi r3, r0, 0xa
|
||||
rlwinm r0, r0, 3, 7, 0x1c
|
||||
b ISD_GetCardSize_store
|
||||
|
||||
ISD_GetCardSize_standard:
|
||||
lwz r3, 0x10(r1)
|
||||
li r0, 9
|
||||
lwz r7, 0xc(r1)
|
||||
rlwinm r4, r3, 0x18, 0x1c, 0x1f
|
||||
cmplwi r4, 9
|
||||
srwi r6, r7, 0x16
|
||||
rlwimi r6, r3, 0xa, 0x14, 0x15
|
||||
rlwinm r3, r7, 0x19, 0x1d, 0x1f
|
||||
blt ISD_GetCardSize_clamp_high
|
||||
mr r0, r4
|
||||
ISD_GetCardSize_clamp_high:
|
||||
cmplwi r0, 0xb
|
||||
li r4, 0xb
|
||||
bgt ISD_GetCardSize_clamp_done
|
||||
mr r4, r0
|
||||
ISD_GetCardSize_clamp_done:
|
||||
addi r0, r3, 2
|
||||
li r5, 1
|
||||
addi r3, r6, 1
|
||||
addi r4, r4, -9
|
||||
slw r0, r5, r0
|
||||
lwz r6, 8(r1)
|
||||
mullw r0, r3, r0
|
||||
slw r3, r5, r4
|
||||
srwi r5, r6, 0x1f
|
||||
rlwimi r5, r7, 1, 0x19, 0x1e
|
||||
mullw r3, r3, r0
|
||||
addi r5, r5, 1
|
||||
slwi r0, r3, 9
|
||||
divwu r0, r0, r5
|
||||
srw r0, r0, r4
|
||||
|
||||
ISD_GetCardSize_store:
|
||||
cmpwi r29, 0
|
||||
stw r5, 0x18(r28)
|
||||
stw r0, 0x1c(r28)
|
||||
stw r3, 0x20(r28)
|
||||
beq ISD_GetCardSize_no_param2
|
||||
stw r3, 0(r29)
|
||||
ISD_GetCardSize_no_param2:
|
||||
cmpwi r30, 0
|
||||
beq ISD_GetCardSize_no_param3
|
||||
stw r3, 0(r30)
|
||||
ISD_GetCardSize_no_param3:
|
||||
cmpwi r31, 0
|
||||
beq ISD_GetCardSize_success_return
|
||||
li r0, 0x200
|
||||
stw r0, 0(r31)
|
||||
ISD_GetCardSize_success_return:
|
||||
li r3, 0
|
||||
|
||||
ISD_GetCardSize_return:
|
||||
lwz r0, 0x34(r1)
|
||||
lwz r31, 0x2c(r1)
|
||||
lwz r30, 0x28(r1)
|
||||
lwz r29, 0x24(r1)
|
||||
lwz r28, 0x20(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x30
|
||||
blr
|
||||
}
|
||||
#else
|
||||
ISD_Error ISD_GetCardSize(SDDev* dev, u32* param_2, u32* param_3, u32* param_4) {
|
||||
ISD_Error ret;
|
||||
u32 out0;
|
||||
@@ -824,6 +927,7 @@ ISD_Error ISD_GetCardSize(SDDev* dev, u32* param_2, u32* param_3, u32* param_4)
|
||||
|
||||
return SD_ERROR_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
ISD_Error ISD_RegisterDeviceIntrHandler(SDDev* dev, SDDevIntrCallback intCB, void* arg) {
|
||||
u32 state;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
char lbl_81687720[] = "<< RVL_SDK - WPAD \trelease build: Apr 20 2010 11:20:55 (0x4199_60831) >>";
|
||||
const char* __WPADVersion = lbl_81687720;
|
||||
|
||||
WPADCB _wpd[WPAD_MAX_CONTROLLERS];
|
||||
WPADStorage _wpd;
|
||||
WPADCB* _wpdcb[WPAD_MAX_CONTROLLERS];
|
||||
|
||||
u8 __WPADiManageHandlerStack[0x1000] ALIGN32;
|
||||
@@ -636,30 +636,30 @@ static asm void WPADiManageHandler(OSAlarm* pAlarm, OSContext* pContext) {
|
||||
beq WPADiManageHandler_8AC8
|
||||
cmpwi r3, 0x2
|
||||
bne WPADiManageHandler_91D8
|
||||
lwz r0, _initialized(r13)
|
||||
lwz r0, _initialized(r0)
|
||||
cmpwi r0, 0x0
|
||||
bne WPADiManageHandler_91D8
|
||||
li r0, 0x1
|
||||
lis r3, WPADiConnCallback@ha
|
||||
stw r0, _initialized(r13)
|
||||
stw r0, _initialized(r0)
|
||||
addi r3, r3, WPADiConnCallback@l
|
||||
bl WUDSetHidConnCallback
|
||||
lis r3, WPADiRecvCallback@ha
|
||||
addi r3, r3, WPADiRecvCallback@l
|
||||
bl WUDSetHidRecvCallback
|
||||
li r0, 0x32
|
||||
stw r0, _recCnt(r13)
|
||||
stw r0, _recCnt(r0)
|
||||
b WPADiManageHandler_91D8
|
||||
WPADiManageHandler_8AC8:
|
||||
lwz r4, _recCnt(r13)
|
||||
lwz r19, _recFlag(r13)
|
||||
lwz r4, _recCnt(r0)
|
||||
lwz r19, _recFlag(r0)
|
||||
cntlzw r3, r4
|
||||
subi r0, r4, 0x1
|
||||
extrwi r3, r3, 1, 26
|
||||
cmpwi r19, 0x0
|
||||
neg r3, r3
|
||||
andc r0, r0, r3
|
||||
stw r0, _recCnt(r13)
|
||||
stw r0, _recCnt(r0)
|
||||
blt WPADiManageHandler_8B28
|
||||
cmpwi r0, 0x0
|
||||
bne WPADiManageHandler_91D8
|
||||
@@ -1001,13 +1001,13 @@ WPADiManageHandler_8FC8:
|
||||
WPADiManageHandler_8FCC:
|
||||
stb r0, 0x0(r23)
|
||||
WPADiManageHandler_8FD0:
|
||||
lbz r0, _checkCnt(r13)
|
||||
lbz r0, _checkCnt(r0)
|
||||
cmplwi r0, 0x5
|
||||
bne WPADiManageHandler_8FE4
|
||||
mr r3, r22
|
||||
bl WPADiCheckContInputs
|
||||
WPADiManageHandler_8FE4:
|
||||
lhz r0, _senseCnt(r13)
|
||||
lhz r0, _senseCnt(r0)
|
||||
cmplwi r0, 0xa
|
||||
bne WPADiManageHandler_8FF8
|
||||
mr r3, r22
|
||||
@@ -1026,7 +1026,7 @@ WPADiManageHandler_900C:
|
||||
addi r24, r24, 0x4
|
||||
addi r23, r23, 0x1
|
||||
blt WPADiManageHandler_8B48
|
||||
lhz r0, _afhCnt(r13)
|
||||
lhz r0, _afhCnt(r0)
|
||||
cmplwi r0, 0xea60
|
||||
bne WPADiManageHandler_9090
|
||||
lis r21, 0x8000
|
||||
@@ -1036,31 +1036,31 @@ WPADiManageHandler_900C:
|
||||
addi r3, r28, 0x108
|
||||
crclr 4*cr1+eq
|
||||
bl DEBUGPrint
|
||||
lbz r3, _afhChannel(r13)
|
||||
lbz r3, _afhChannel(r0)
|
||||
lbz r0, 0x31a2(r21)
|
||||
extsb r3, r3
|
||||
cmpw r3, r0
|
||||
beq WPADiManageHandler_9090
|
||||
bl OSDisableInterrupts
|
||||
lbz r0, 0x31a2(r21)
|
||||
stb r0, _afhChannel(r13)
|
||||
stb r0, _afhChannel(r0)
|
||||
bl OSRestoreInterrupts
|
||||
lbz r4, 0x31a2(r21)
|
||||
addi r3, r28, 0x130
|
||||
crclr 4*cr1+eq
|
||||
bl DEBUGPrint
|
||||
lbz r0, _afhChannel(r13)
|
||||
lbz r0, _afhChannel(r0)
|
||||
extsb r3, r0
|
||||
bl WUDSetDisableChannel
|
||||
WPADiManageHandler_9090:
|
||||
lhz r6, _senseCnt(r13)
|
||||
lhz r6, _senseCnt(r0)
|
||||
lis r3, 0x1
|
||||
subi r0, r3, 0x15a0
|
||||
lbz r9, _checkCnt(r13)
|
||||
lbz r9, _checkCnt(r0)
|
||||
subi r4, r6, 0xa
|
||||
subfic r3, r6, 0xa
|
||||
nor r3, r4, r3
|
||||
lhz r10, _afhCnt(r13)
|
||||
lhz r10, _afhCnt(r0)
|
||||
srawi r8, r3, 31
|
||||
addi r7, r6, 0x1
|
||||
clrlwi r0, r0, 16
|
||||
@@ -1070,7 +1070,7 @@ WPADiManageHandler_9090:
|
||||
nor r5, r4, r3
|
||||
subf r4, r0, r10
|
||||
subf r3, r10, r0
|
||||
lbz r0, _scFlush(r13)
|
||||
lbz r0, _scFlush(r0)
|
||||
srawi r6, r5, 31
|
||||
addi r5, r9, 0x1
|
||||
nor r4, r4, r3
|
||||
@@ -1079,9 +1079,9 @@ WPADiManageHandler_9090:
|
||||
andc r5, r5, r6
|
||||
andc r3, r3, r4
|
||||
cmpwi r0, 0x0
|
||||
sth r7, _senseCnt(r13)
|
||||
stb r5, _checkCnt(r13)
|
||||
sth r3, _afhCnt(r13)
|
||||
sth r7, _senseCnt(r0)
|
||||
stb r5, _checkCnt(r0)
|
||||
sth r3, _afhCnt(r0)
|
||||
beq WPADiManageHandler_9138
|
||||
bl SCCheckStatus
|
||||
cmpwi r3, 0x0
|
||||
@@ -1094,9 +1094,9 @@ WPADiManageHandler_9090:
|
||||
li r3, 0x0
|
||||
bl SCFlushAsync
|
||||
li r0, 0x0
|
||||
stb r0, _scFlush(r13)
|
||||
stb r0, _scFlush(r0)
|
||||
WPADiManageHandler_9138:
|
||||
lbz r0, _scSetting(r13)
|
||||
lbz r0, _scSetting(r0)
|
||||
cmpwi r0, 0x0
|
||||
beq WPADiManageHandler_91D4
|
||||
bl SCCheckStatus
|
||||
@@ -1112,19 +1112,19 @@ WPADiManageHandler_9164:
|
||||
ble WPADiManageHandler_9170
|
||||
li r0, 0x5
|
||||
WPADiManageHandler_9170:
|
||||
stb r0, _dpdSensitivity(r13)
|
||||
stb r0, _dpdSensitivity(r0)
|
||||
bl SCGetWpadSensorBarPosition
|
||||
clrlwi r3, r3, 24
|
||||
subi r0, r3, 0x1
|
||||
cntlzw r0, r0
|
||||
extrwi r0, r0, 8, 19
|
||||
stb r0, _sensorBarPos(r13)
|
||||
stb r0, _sensorBarPos(r0)
|
||||
bl SCGetWpadMotorMode
|
||||
clrlwi r3, r3, 24
|
||||
subi r0, r3, 0x1
|
||||
cntlzw r0, r0
|
||||
srwi r0, r0, 5
|
||||
stw r0, _rumble(r13)
|
||||
stw r0, _rumble(r0)
|
||||
bl SCGetWpadSpeakerVolume
|
||||
clrlwi. r0, r3, 24
|
||||
mr r4, r3
|
||||
@@ -1137,8 +1137,8 @@ WPADiManageHandler_91B8:
|
||||
li r4, 0x7f
|
||||
WPADiManageHandler_91C8:
|
||||
li r0, 0x0
|
||||
stb r4, _speakerVolume(r13)
|
||||
stb r0, _scSetting(r13)
|
||||
stb r4, _speakerVolume(r0)
|
||||
stb r0, _scSetting(r0)
|
||||
WPADiManageHandler_91D4:
|
||||
bl BTA_HhGetAclQueueInfo
|
||||
WPADiManageHandler_91D8:
|
||||
@@ -1338,12 +1338,12 @@ void WPADiInitSub() {
|
||||
DEBUGPrint("WPADInit()\n");
|
||||
|
||||
for (chan = 0; chan < WPAD_MAX_CONTROLLERS; chan++) {
|
||||
_wpdcb[chan] = &_wpd[chan];
|
||||
_wpdcb[chan] = &_wpd.controllers[chan];
|
||||
_chan_active_state[chan] = FALSE;
|
||||
|
||||
_wpdcb[chan]->connectCB = NULL;
|
||||
__ClearControlBlock(chan);
|
||||
OSInitThreadQueue(&_wpd[chan].threadQueue);
|
||||
OSInitThreadQueue(&_wpd.controllers[chan].threadQueue);
|
||||
|
||||
_extCnt[chan] = 0;
|
||||
_rumbleCnt[chan] = 0;
|
||||
|
||||
@@ -6,8 +6,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#pragma push
|
||||
#pragma section sconst_type ".sdata"
|
||||
extern const char lbl_816979E8[8] = "/";
|
||||
#pragma pop
|
||||
|
||||
void CDBFSConcatenatePath(char* path, const char* concatPath) {
|
||||
strcat(path, "/");
|
||||
strcat(path, lbl_816979E8);
|
||||
strcat(path, concatPath);
|
||||
}
|
||||
|
||||
@@ -106,6 +111,167 @@ BOOL CDBFSIsTypeDirName(char* dirName) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef __MWERKS__
|
||||
asm BOOL CDBFSIsCDBFileOnSD(register char* fileName) {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
li r4, 0xd
|
||||
stw r0, 0x14(r1)
|
||||
stw r31, 0xc(r1)
|
||||
mr r31, r3
|
||||
bl CDBSafeStrLen
|
||||
cmpwi r3, 0xc
|
||||
bne CDBFSIsCDBFileOnSD_invalid
|
||||
lis r4, _current_locale@ha
|
||||
li r0, 0x4
|
||||
addi r4, r4, _current_locale@l
|
||||
mr r3, r31
|
||||
lwz r6, 0x38(r4)
|
||||
li r7, 0
|
||||
mtctr r0
|
||||
CDBFSIsCDBFileOnSD_loop:
|
||||
lbz r5, 0(r3)
|
||||
li r0, 0
|
||||
extsb. r5, r5
|
||||
blt CDBFSIsCDBFileOnSD_digit1_invalid
|
||||
cmpwi r5, 0x100
|
||||
blt CDBFSIsCDBFileOnSD_digit1_check
|
||||
CDBFSIsCDBFileOnSD_digit1_invalid:
|
||||
li r0, 1
|
||||
CDBFSIsCDBFileOnSD_digit1_check:
|
||||
cmpwi r0, 0
|
||||
beq CDBFSIsCDBFileOnSD_digit1_map
|
||||
li r0, 0
|
||||
b CDBFSIsCDBFileOnSD_digit1_done
|
||||
CDBFSIsCDBFileOnSD_digit1_map:
|
||||
lwz r4, 8(r6)
|
||||
slwi r0, r5, 1
|
||||
lhzx r0, r4, r0
|
||||
rlwinm r0, r0, 0, 21, 21
|
||||
CDBFSIsCDBFileOnSD_digit1_done:
|
||||
cmpwi r0, 0
|
||||
bne CDBFSIsCDBFileOnSD_first_next
|
||||
li r3, 0
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_first_next:
|
||||
lbz r5, 1(r3)
|
||||
li r0, 0
|
||||
extsb. r5, r5
|
||||
blt CDBFSIsCDBFileOnSD_digit2_invalid
|
||||
cmpwi r5, 0x100
|
||||
blt CDBFSIsCDBFileOnSD_digit2_check
|
||||
CDBFSIsCDBFileOnSD_digit2_invalid:
|
||||
li r0, 1
|
||||
CDBFSIsCDBFileOnSD_digit2_check:
|
||||
cmpwi r0, 0
|
||||
beq CDBFSIsCDBFileOnSD_digit2_map
|
||||
li r0, 0
|
||||
b CDBFSIsCDBFileOnSD_digit2_done
|
||||
CDBFSIsCDBFileOnSD_digit2_map:
|
||||
lwz r4, 8(r6)
|
||||
slwi r0, r5, 1
|
||||
lhzx r0, r4, r0
|
||||
rlwinm r0, r0, 0, 21, 21
|
||||
CDBFSIsCDBFileOnSD_digit2_done:
|
||||
cmpwi r0, 0
|
||||
bne CDBFSIsCDBFileOnSD_pair_next
|
||||
li r3, 0
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_pair_next:
|
||||
addi r7, r7, 1
|
||||
addi r3, r3, 2
|
||||
bdnz CDBFSIsCDBFileOnSD_loop
|
||||
lbz r0, 8(r31)
|
||||
cmpwi r0, 0x2e
|
||||
beq CDBFSIsCDBFileOnSD_extension
|
||||
li r3, 0
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_extension:
|
||||
lbz r4, 9(r31)
|
||||
li r0, 0
|
||||
extsb. r4, r4
|
||||
blt CDBFSIsCDBFileOnSD_digit3_invalid
|
||||
cmpwi r4, 0x100
|
||||
blt CDBFSIsCDBFileOnSD_digit3_check
|
||||
CDBFSIsCDBFileOnSD_digit3_invalid:
|
||||
li r0, 1
|
||||
CDBFSIsCDBFileOnSD_digit3_check:
|
||||
cmpwi r0, 0
|
||||
beq CDBFSIsCDBFileOnSD_digit3_map
|
||||
li r0, 0
|
||||
b CDBFSIsCDBFileOnSD_digit3_done
|
||||
CDBFSIsCDBFileOnSD_digit3_map:
|
||||
lwz r3, 8(r6)
|
||||
slwi r0, r4, 1
|
||||
lhzx r0, r3, r0
|
||||
rlwinm r0, r0, 0, 21, 21
|
||||
CDBFSIsCDBFileOnSD_digit3_done:
|
||||
cmpwi r0, 0
|
||||
bne CDBFSIsCDBFileOnSD_digit4
|
||||
li r3, 0
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_digit4:
|
||||
lbz r4, 0xa(r31)
|
||||
li r0, 0
|
||||
extsb. r4, r4
|
||||
blt CDBFSIsCDBFileOnSD_digit4_invalid
|
||||
cmpwi r4, 0x100
|
||||
blt CDBFSIsCDBFileOnSD_digit4_check
|
||||
CDBFSIsCDBFileOnSD_digit4_invalid:
|
||||
li r0, 1
|
||||
CDBFSIsCDBFileOnSD_digit4_check:
|
||||
cmpwi r0, 0
|
||||
beq CDBFSIsCDBFileOnSD_digit4_map
|
||||
li r0, 0
|
||||
b CDBFSIsCDBFileOnSD_digit4_done
|
||||
CDBFSIsCDBFileOnSD_digit4_map:
|
||||
lwz r3, 8(r6)
|
||||
slwi r0, r4, 1
|
||||
lhzx r0, r3, r0
|
||||
rlwinm r0, r0, 0, 21, 21
|
||||
CDBFSIsCDBFileOnSD_digit4_done:
|
||||
cmpwi r0, 0
|
||||
bne CDBFSIsCDBFileOnSD_digit5
|
||||
li r3, 0
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_digit5:
|
||||
lbz r4, 0xb(r31)
|
||||
li r0, 0
|
||||
extsb. r4, r4
|
||||
blt CDBFSIsCDBFileOnSD_digit5_invalid
|
||||
cmpwi r4, 0x100
|
||||
blt CDBFSIsCDBFileOnSD_digit5_check
|
||||
CDBFSIsCDBFileOnSD_digit5_invalid:
|
||||
li r0, 1
|
||||
CDBFSIsCDBFileOnSD_digit5_check:
|
||||
cmpwi r0, 0
|
||||
beq CDBFSIsCDBFileOnSD_digit5_map
|
||||
li r0, 0
|
||||
b CDBFSIsCDBFileOnSD_digit5_done
|
||||
CDBFSIsCDBFileOnSD_digit5_map:
|
||||
lwz r3, 8(r6)
|
||||
slwi r0, r4, 1
|
||||
lhzx r0, r3, r0
|
||||
rlwinm r0, r0, 0, 21, 21
|
||||
CDBFSIsCDBFileOnSD_digit5_done:
|
||||
cmpwi r0, 0
|
||||
bne CDBFSIsCDBFileOnSD_valid
|
||||
li r3, 0
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_valid:
|
||||
li r3, 1
|
||||
b CDBFSIsCDBFileOnSD_return
|
||||
CDBFSIsCDBFileOnSD_invalid:
|
||||
li r3, 0
|
||||
CDBFSIsCDBFileOnSD_return:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
#else
|
||||
BOOL CDBFSIsCDBFileOnSD(char* fileName) {
|
||||
if (CDBSafeStrLen(fileName, 12 + 1) == 12) {
|
||||
char* ptr = fileName;
|
||||
@@ -133,6 +299,7 @@ BOOL CDBFSIsCDBFileOnSD(char* fileName) {
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL CDBFSIsMCGCDirNameOnSD(char* dirName) {
|
||||
if (CDBSafeStrLen(dirName, 7 + 1) == 7) {
|
||||
|
||||
@@ -476,8 +476,8 @@ NWC24Err NWC24SearchFriendInfoByAddr(const NWC24FriendAddr* addr, u32* index) {
|
||||
NWC24Err result;
|
||||
|
||||
NWC24FLHeader* header;
|
||||
NWC24FriendAddr* tmpFriendAddr;
|
||||
NWC24FriendInfo* tmpFriendInfo;
|
||||
|
||||
int cmpResult;
|
||||
|
||||
u32 i;
|
||||
@@ -498,10 +498,12 @@ NWC24Err NWC24SearchFriendInfoByAddr(const NWC24FriendAddr* addr, u32* index) {
|
||||
}
|
||||
|
||||
tmpFriendInfo = (NWC24FriendInfo*)&nwc24Work->mainWork;
|
||||
tmpFriendAddr = (NWC24FriendAddr*)&tmpFriendInfo->addr.mailAddr[sizeof(NWC24UserId)];
|
||||
|
||||
for (i = 0; i < header->infoCount; i++) {
|
||||
if (friendValue == header->friendIds[i]) {
|
||||
result = NWC24ReadFriendInfo(tmpFriendInfo, i);
|
||||
result = NWC24ReadFriendInfo(
|
||||
(NWC24FriendInfo*)((u8*)tmpFriendAddr - sizeof(NWC24FriendAttr) - sizeof(NWC24UserId)), i);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#include <revolution/gx/GXStruct.h>
|
||||
#include <revolution/os/OSError.h>
|
||||
|
||||
extern "C" const char lbl_8166A6E3[];
|
||||
extern "C" const u8 lbl_81697844;
|
||||
extern "C" const u8 lbl_81697845;
|
||||
extern "C" const u8 lbl_81697846;
|
||||
extern "C" const u8 lbl_81697847;
|
||||
|
||||
#define NW4R_DB_ASSERT_H
|
||||
#define NW4R_ASSERT(x) \
|
||||
{ \
|
||||
if (!(x)) { \
|
||||
GXColor front = {lbl_81697844, lbl_81697845, lbl_81697846, lbl_81697847}; \
|
||||
GXColor back = {0, 0, 0, 0}; \
|
||||
OSFatal((GXColor)front, (GXColor)back, lbl_8166A6E3); \
|
||||
} \
|
||||
}
|
||||
|
||||
#include "channelScript/iplCSLibrary.h"
|
||||
|
||||
#include "iplSystem.h"
|
||||
@@ -10,7 +29,9 @@
|
||||
|
||||
#include "math/iplMathTypes.h"
|
||||
|
||||
extern f32 lbl_81694FC0;
|
||||
extern "C" const f32 lbl_81694FC0 = 0.0f;
|
||||
|
||||
extern "C" nw4r::ut::Color GetTextColor__Q34nw4r3lyt7TextBoxCFUl(const nw4r::lyt::TextBox*, u32);
|
||||
|
||||
namespace ipl {
|
||||
namespace cs {
|
||||
@@ -393,7 +414,7 @@ namespace ipl {
|
||||
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
|
||||
if (box != NULL && argc == 1 && arg != NULL) {
|
||||
if (arg->value.int_v < 4ULL) {
|
||||
result = color::_ctor(VmInst, VmReturnObj, (nw4r::ut::Color) static_cast<u32>(box->GetTextColor(arg->value.int_v))) == TRUE;
|
||||
result = color::_ctor(VmInst, VmReturnObj, (nw4r::ut::Color) static_cast<u32>(GetTextColor__Q34nw4r3lyt7TextBoxCFUl(box, arg->value.int_v))) == TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -595,3 +616,22 @@ namespace ipl {
|
||||
} // namespace pane
|
||||
} // namespace cs
|
||||
} // namespace ipl
|
||||
|
||||
namespace ipl {
|
||||
namespace cs {
|
||||
namespace pane {
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8166A6E3[] = "Error#004\nAn error has occurred.\nThe system files are corrupted.";
|
||||
#pragma pop
|
||||
|
||||
#pragma push
|
||||
#pragma section data_type ".sdata"
|
||||
extern "C" __declspec(section ".sdata") const u8 lbl_81697844 = 0xff;
|
||||
extern "C" __declspec(section ".sdata") const u8 lbl_81697845 = 0xff;
|
||||
extern "C" __declspec(section ".sdata") const u8 lbl_81697846 = 0xff;
|
||||
extern "C" __declspec(section ".sdata") const u8 lbl_81697847 = 0;
|
||||
#pragma pop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "iplwww/www_surface.h"
|
||||
|
||||
#define IPL_WWW_SURFACE_MESSAGE
|
||||
#include "iplwww/www_print.h"
|
||||
#undef IPL_WWW_SURFACE_MESSAGE
|
||||
#include "iplwww/www_trasition.h"
|
||||
|
||||
#include <revolution/vi.h>
|
||||
|
||||
@@ -4,6 +4,17 @@
|
||||
|
||||
#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" void _savegpr_24();
|
||||
extern "C" void _restgpr_24();
|
||||
extern "C" void GetFont__Q34nw4r3lyt8TextBoxCFv();
|
||||
|
||||
namespace textinput {
|
||||
namespace candidatebox {
|
||||
|
||||
@@ -1269,28 +1280,149 @@ namespace textinput {
|
||||
GXSetScissor(left, top, wd, ht);
|
||||
}
|
||||
|
||||
s32 UITextArea::GetNextPageIdx_(s32 idx) const {
|
||||
// NONMATCHING - only regswaps, hopefully
|
||||
f32 areaPaneWidth = mpTextAreaPane->getPane()->GetSize().width;
|
||||
|
||||
nw4r::lyt::TextBox* textBox = mpTextBoxPane[0]->getTextPane();
|
||||
f32 widthScale = GetWidthScale_();
|
||||
f32 margin = GetMargin_();
|
||||
f32 negMargin = -margin;
|
||||
|
||||
int i = idx;
|
||||
while (negMargin <= areaPaneWidth) {
|
||||
if (i == mnCandidateNum) {
|
||||
return -1;
|
||||
}
|
||||
f32 textWidth = calcStringWidth(mpCandidates->szwcPredicted[i], textBox);
|
||||
negMargin += margin + textWidth * widthScale;
|
||||
i++;
|
||||
}
|
||||
if (i - 1 == idx) {
|
||||
i++;
|
||||
}
|
||||
return i - 1;
|
||||
extern "C" asm void GetNextPageIdx___Q39textinput12candidatebox10UITextAreaCFl() {
|
||||
nofralloc
|
||||
stwu r1, -0xc0(r1)
|
||||
mflr r0
|
||||
stw r0, 0xc4(r1)
|
||||
stfd f31, 0xb0(r1)
|
||||
psq_st f31, 0xb8(r1), 0, 0
|
||||
stfd f30, 0xa0(r1)
|
||||
psq_st f30, 0xa8(r1), 0, 0
|
||||
stfd f29, 0x90(r1)
|
||||
psq_st f29, 0x98(r1), 0, 0
|
||||
stfd f28, 0x80(r1)
|
||||
psq_st f28, 0x88(r1), 0, 0
|
||||
stfd f27, 0x70(r1)
|
||||
psq_st f27, 0x78(r1), 0, 0
|
||||
stfd f26, 0x60(r1)
|
||||
psq_st f26, 0x68(r1), 0, 0
|
||||
stfd f25, 0x50(r1)
|
||||
psq_st f25, 0x58(r1), 0, 0
|
||||
stfd f24, 0x40(r1)
|
||||
psq_st f24, 0x48(r1), 0, 0
|
||||
stfd f23, 0x30(r1)
|
||||
psq_st f23, 0x38(r1), 0, 0
|
||||
addi r11, r1, 0x30
|
||||
bl _savegpr_24
|
||||
lfs f0, lbl_81694DA8(r2)
|
||||
mr r24, r3
|
||||
lfs f1, 0x1fc(r3)
|
||||
mr r25, r4
|
||||
lwz r5, 0xd8(r3)
|
||||
fdivs f25, f0, f1
|
||||
lfs f0, lbl_81694DB4(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)
|
||||
b GetNextPageIdx_L2
|
||||
GetNextPageIdx_L1:
|
||||
lfs f28, lbl_81694DB0(r2)
|
||||
GetNextPageIdx_L2:
|
||||
fneg f23, f28
|
||||
lfd f29, lbl_81694DC8(r2)
|
||||
lfs f30, lbl_81694DBC(r2)
|
||||
mr r26, r25
|
||||
slwi r28, r4, 7
|
||||
lis r31, 0x4330
|
||||
b GetNextPageIdx_L3
|
||||
GetNextPageIdx_L4:
|
||||
lwz r0, 0x1e8(r24)
|
||||
cmpw r26, r0
|
||||
bne GetNextPageIdx_L5
|
||||
li r3, -1
|
||||
b GetNextPageIdx_L6
|
||||
GetNextPageIdx_L5:
|
||||
lwz r0, 0x204(r24)
|
||||
add r0, r0, r28
|
||||
addic. r30, r0, 4
|
||||
bne GetNextPageIdx_L7
|
||||
lfs f0, lbl_81694D90(r2)
|
||||
b GetNextPageIdx_L8
|
||||
GetNextPageIdx_L7:
|
||||
mr r3, r27
|
||||
bl GetFont__Q34nw4r3lyt8TextBoxCFv
|
||||
lfs f26, 0xe4(r27)
|
||||
mr r29, r3
|
||||
lfs f24, 0xf0(r27)
|
||||
lfs f27, lbl_81694D90(r2)
|
||||
b GetNextPageIdx_L9
|
||||
GetNextPageIdx_L10:
|
||||
lwz r12, 0(r29)
|
||||
fadds f27, f27, f24
|
||||
mr r3, r29
|
||||
lwz r12, 0x48(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
xoris r0, r3, 0x8000
|
||||
stw r31, 8(r1)
|
||||
addi r30, r30, 2
|
||||
stw r0, 0xc(r1)
|
||||
lfd f0, 8(r1)
|
||||
fsubs f0, f0, f29
|
||||
fadds f27, f27, f0
|
||||
GetNextPageIdx_L9:
|
||||
lhz r4, 0(r30)
|
||||
cmpwi r4, 0
|
||||
bne GetNextPageIdx_L10
|
||||
lwz r12, 0(r29)
|
||||
mr r3, r29
|
||||
lwz r12, 0xc(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
xoris r0, r3, 0x8000
|
||||
stw r31, 8(r1)
|
||||
stw r0, 0xc(r1)
|
||||
lfd f0, 8(r1)
|
||||
fsubs f0, f0, f29
|
||||
fdivs f0, f26, f0
|
||||
fmuls f0, f27, f0
|
||||
fadds f0, f30, f0
|
||||
GetNextPageIdx_L8:
|
||||
fmuls f0, f0, f25
|
||||
addi r28, r28, 0x80
|
||||
addi r26, r26, 1
|
||||
fadds f0, f28, f0
|
||||
fadds f23, f23, f0
|
||||
GetNextPageIdx_L3:
|
||||
fcmpo cr0, f23, f31
|
||||
cror 2, 0, 2
|
||||
beq GetNextPageIdx_L4
|
||||
addi r0, r26, -1
|
||||
cmpw r0, r25
|
||||
bne GetNextPageIdx_L11
|
||||
addi r26, r26, 1
|
||||
GetNextPageIdx_L11:
|
||||
addi r3, r26, -1
|
||||
GetNextPageIdx_L6:
|
||||
psq_l f31, 0xb8(r1), 0, 0
|
||||
lfd f31, 0xb0(r1)
|
||||
psq_l f30, 0xa8(r1), 0, 0
|
||||
lfd f30, 0xa0(r1)
|
||||
psq_l f29, 0x98(r1), 0, 0
|
||||
lfd f29, 0x90(r1)
|
||||
psq_l f28, 0x88(r1), 0, 0
|
||||
lfd f28, 0x80(r1)
|
||||
psq_l f27, 0x78(r1), 0, 0
|
||||
lfd f27, 0x70(r1)
|
||||
psq_l f26, 0x68(r1), 0, 0
|
||||
lfd f26, 0x60(r1)
|
||||
psq_l f25, 0x58(r1), 0, 0
|
||||
lfd f25, 0x50(r1)
|
||||
psq_l f24, 0x48(r1), 0, 0
|
||||
lfd f24, 0x40(r1)
|
||||
psq_l f23, 0x38(r1), 0, 0
|
||||
addi r11, r1, 0x30
|
||||
lfd f23, 0x30(r1)
|
||||
bl _restgpr_24
|
||||
lwz r0, 0xc4(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0xc0
|
||||
blr
|
||||
}
|
||||
|
||||
s32 UITextArea::GetPrevPageIdx_(s32 idx) const {
|
||||
|
||||
@@ -8,13 +8,245 @@ extern const u8 lbl_81616BD8[] = {0x0f, 0x21, 0x20, 0x08, 0x09, 0x0e, 0x19, 0x00
|
||||
extern const u8 lbl_81616BE4[] = {0x0f, 0x21, 0x20, 0x04, 0x09, 0x0e, 0x11, 0x00, 0x21, 0x21, 0x00, 0x00};
|
||||
extern "C" void SetCountry__Q39textinput5input10HKBManagerFUc();
|
||||
extern "C" textinput::input::HKBManager sInstance__Q39textinput5input10HKBManager;
|
||||
extern "C" char jumptable_81668EF8[];
|
||||
extern "C" void convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw();
|
||||
extern "C" bool updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
|
||||
extern "C" void __dt__Q49textinput8keyboard5hwkey10HWKeyboardFv();
|
||||
extern "C" void create__Q29textinput4BaseFP12MEMAllocator();
|
||||
extern "C" void init__Q49textinput8keyboard5hwkey10HWKeyboardFv();
|
||||
extern "C" void setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver();
|
||||
extern "C" void sendCommand__Q29textinput13CommandSenderFUlPv();
|
||||
extern "C" void updateFromReceiver__Q29textinput13CommandSenderFUlPv();
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
typedef void (*KeyboardDataFunction)();
|
||||
extern "C" KeyboardDataFunction const jumptable_81668EF8[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),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001c0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000170),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x0000017c),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000134),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001a0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000140),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000188),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000194),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000148),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000150),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000164),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001b8),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
|
||||
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001ac)
|
||||
};
|
||||
extern "C" KeyboardDataFunction const __vt__Q49textinput8keyboard5hwkey10HWKeyboard[9] = {
|
||||
NULL,
|
||||
NULL,
|
||||
__dt__Q49textinput8keyboard5hwkey10HWKeyboardFv,
|
||||
create__Q29textinput4BaseFP12MEMAllocator,
|
||||
init__Q49textinput8keyboard5hwkey10HWKeyboardFv,
|
||||
setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver,
|
||||
sendCommand__Q29textinput13CommandSenderFUlPv,
|
||||
updateFromReceiver__Q29textinput13CommandSenderFUlPv,
|
||||
reinterpret_cast<KeyboardDataFunction>(updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager)
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
namespace textinput {
|
||||
|
||||
namespace keyboard {
|
||||
|
||||
namespace hwkey {
|
||||
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();
|
||||
extern "C" bool updateRepeatKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
|
||||
extern "C" bool updateTriggerKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
|
||||
extern "C" bool updateTappingShift___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
|
||||
extern "C" void updateShift__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
|
||||
extern "C" asm bool updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager() {
|
||||
nofralloc
|
||||
stwu r1, -0x40(r1)
|
||||
mflr r0
|
||||
stw r0, 0x44(r1)
|
||||
stw r31, 0x3c(r1)
|
||||
mr r31, r4
|
||||
stw r30, 0x38(r1)
|
||||
mr r30, r3
|
||||
lwz r3, 0x10(r3)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x84(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xdc(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
cmpwi r3, 0
|
||||
bne updateInput_HWKeyboard_L1
|
||||
mr r3, r31
|
||||
bl GetModifierState__Q39textinput5input10HKBManagerCFv
|
||||
rlwinm. r0, r3, 0, 0x1d, 0x1d
|
||||
bne updateInput_HWKeyboard_L2
|
||||
li r0, 0
|
||||
b updateInput_HWKeyboard_L3
|
||||
updateInput_HWKeyboard_L2:
|
||||
li r5, 0
|
||||
li r0, -1
|
||||
stw r5, 8(r1)
|
||||
mr r4, r31
|
||||
addi r3, r1, 0x14
|
||||
stb r5, 0xc(r1)
|
||||
stb r0, 0xd(r1)
|
||||
stb r5, 0xe(r1)
|
||||
sth r5, 0x10(r1)
|
||||
bl GetTriggeredKeySet__Q39textinput5input10HKBManagerCFv
|
||||
lwz r6, 0x14(r1)
|
||||
lbz r5, 0x18(r1)
|
||||
lbz r4, 0x19(r1)
|
||||
lbz r3, 0x1a(r1)
|
||||
lhz r0, 0x1c(r1)
|
||||
stw r6, 8(r1)
|
||||
stb r5, 0xc(r1)
|
||||
stb r4, 0xd(r1)
|
||||
stb r3, 0xe(r1)
|
||||
sth r0, 0x10(r1)
|
||||
b updateInput_HWKeyboard_L4
|
||||
updateInput_HWKeyboard_L5:
|
||||
addi r3, r1, 8
|
||||
bl GetKey__Q49textinput5input10HKBManager6KeySetCFv
|
||||
clrlwi r0, r3, 0x18
|
||||
cmpwi r0, 0x2b
|
||||
bge updateInput_HWKeyboard_L6
|
||||
cmpwi r0, 0x28
|
||||
beq updateInput_HWKeyboard_L7
|
||||
bge updateInput_HWKeyboard_L8
|
||||
b updateInput_HWKeyboard_L9
|
||||
updateInput_HWKeyboard_L6:
|
||||
cmpwi r0, 0x58
|
||||
beq updateInput_HWKeyboard_L7
|
||||
b updateInput_HWKeyboard_L9
|
||||
updateInput_HWKeyboard_L7:
|
||||
lwz r3, 0x10(r30)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x94(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xa0(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
li r0, 1
|
||||
b updateInput_HWKeyboard_L3
|
||||
updateInput_HWKeyboard_L8:
|
||||
lwz r3, 0x10(r30)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x94(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xa4(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
li r0, 1
|
||||
b updateInput_HWKeyboard_L3
|
||||
updateInput_HWKeyboard_L9:
|
||||
addi r3, r1, 0x20
|
||||
addi r4, r1, 8
|
||||
bl GetNext__Q49textinput5input10HKBManager6KeySetCFv
|
||||
lwz r6, 0x20(r1)
|
||||
lbz r5, 0x24(r1)
|
||||
lbz r4, 0x25(r1)
|
||||
lbz r3, 0x26(r1)
|
||||
lhz r0, 0x28(r1)
|
||||
stw r6, 8(r1)
|
||||
stb r5, 0xc(r1)
|
||||
stb r4, 0xd(r1)
|
||||
stb r3, 0xe(r1)
|
||||
sth r0, 0x10(r1)
|
||||
updateInput_HWKeyboard_L4:
|
||||
addi r3, r1, 8
|
||||
bl IsValid__Q49textinput5input10HKBManager6KeySetCFv
|
||||
cmpwi r3, 0
|
||||
bne updateInput_HWKeyboard_L5
|
||||
li r0, 0
|
||||
updateInput_HWKeyboard_L3:
|
||||
cmpwi r0, 0
|
||||
bne updateInput_HWKeyboard_L1
|
||||
mr r3, r30
|
||||
mr r4, r31
|
||||
bl updateRepeatKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
|
||||
cmpwi r3, 0
|
||||
bne updateInput_HWKeyboard_L1
|
||||
mr r3, r30
|
||||
mr r4, r31
|
||||
bl updateTriggerKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
|
||||
cmpwi r3, 0
|
||||
bne updateInput_HWKeyboard_L1
|
||||
mr r3, r30
|
||||
mr r4, r31
|
||||
bl updateTappingShift___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
|
||||
updateInput_HWKeyboard_L1:
|
||||
mr r3, r30
|
||||
mr r4, r31
|
||||
bl updateShift__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
|
||||
lwz r31, 0x3c(r1)
|
||||
li r3, 0
|
||||
lwz r30, 0x38(r1)
|
||||
lwz r0, 0x44(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x40
|
||||
blr
|
||||
}
|
||||
|
||||
HWKeyboard::HWKeyboard(Manager* manager) : mpManager(manager), field_0x14(0), field_0x15(0), field_0x16(0) {
|
||||
}
|
||||
|
||||
@@ -59,14 +291,6 @@ namespace textinput {
|
||||
}
|
||||
}
|
||||
|
||||
bool HWKeyboard::updateInput(input::HKBManager &hkbManager) {
|
||||
cellphonetype::KeySet set;
|
||||
mgr()->getSignKeyboard();
|
||||
// TODO
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
extern "C" asm void setLanguage__Q49textinput8keyboard5hwkey10HWKeyboardFQ29textinput11DestinationQ29textinput8Language() {
|
||||
nofralloc
|
||||
cmpwi r4, 2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,130 @@
|
||||
#include "system/MESGEntries.h"
|
||||
#include "system/iplSystem.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern "C" const char* sTextNameB[5] = {
|
||||
"T_name_b_00", "T_name_b_01", "T_name_b_02", "T_name_b_03", "T_name_b_04",
|
||||
};
|
||||
|
||||
extern "C" const char* sTextNameC[5] = {
|
||||
"T_name_c_00", "T_name_c_01", "T_name_c_02", "T_name_c_03", "T_name_c_04",
|
||||
};
|
||||
|
||||
extern "C" const char* sButtonNameB[5] = {
|
||||
"B_name_b_00", "B_name_b_01", "B_name_b_02", "B_name_b_03", "B_name_b_04",
|
||||
};
|
||||
|
||||
extern "C" const char* sButtonSpaceName[4] = {
|
||||
"B_name_b_00_01", "B_name_b_01_02", "B_name_b_02_03", "B_name_b_03_04",
|
||||
};
|
||||
|
||||
extern "C" const char* sNameB[5] = {
|
||||
"name_b_00", "name_b_01", "name_b_02", "name_b_03", "name_b_04",
|
||||
};
|
||||
|
||||
extern "C" const char* sNameC[5] = {
|
||||
"G_name_c_00", "G_name_c_01", "G_name_c_02", "G_name_c_03", "G_name_c_04",
|
||||
};
|
||||
|
||||
extern "C" char sAddressStringPoolA[] =
|
||||
"th_Adress_a.brlyt\0"
|
||||
"th_Adress_a_note_alp_in.brlan\0"
|
||||
"G_note_all\0"
|
||||
"th_Adress_a_note_alp_out.brlan\0"
|
||||
"th_Adress_a_note_trns_in.brlan\0"
|
||||
"th_Adress_a_note_trns_out.brlan\0"
|
||||
"th_Adress_a_note_e_rtt.brlan\0"
|
||||
"G_note_e_rtt\0"
|
||||
"th_Adress_a_note_c_rtt.brlan\0"
|
||||
"note_c_rtt\0"
|
||||
"th_Adress_a_name_in.brlan\0"
|
||||
"th_Adress_a_name_out.brlan\0"
|
||||
"th_Adress_a_name_psh.brlan\0"
|
||||
"th_Adress_a_gry_name_in.brlan\0"
|
||||
"th_Adress_a_gry_name_out.brlan\0"
|
||||
"th_Adress_a_gry_name_psh.brlan\0"
|
||||
"th_Adress_a_name_c_gry.brlan\0"
|
||||
"my_Back_a.brlyt\0"
|
||||
"my_Back_a_Apear.brlan\0"
|
||||
"Picture_00\0"
|
||||
"my_Back_a_Lost.brlan\0"
|
||||
"my_Dialog_a.brlyt\0"
|
||||
"my_Dialog_a_DialogIn.brlan\0"
|
||||
"my_Dialog_a_DialogOut.brlan\0"
|
||||
"T_Dialog\0"
|
||||
"mii_b_%02d\0"
|
||||
"mii_c_%02d\0"
|
||||
"T_adrs_00\0"
|
||||
"T_wii_msg\0"
|
||||
"N_note_move\0"
|
||||
"WIPL_SE_FL_PAGE_INC\0"
|
||||
"\0";
|
||||
|
||||
extern "C" void calc__Q33ipl6layout6ObjectFv();
|
||||
|
||||
extern "C" void (*sAddressJumpTable[26])() = {
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
calc__Q33ipl6layout6ObjectFv,
|
||||
};
|
||||
|
||||
extern "C" char sAddressStringPoolB[] =
|
||||
"N_note_a\0"
|
||||
"N_note_b\0"
|
||||
"N_note_c\0"
|
||||
"N_note_d\0"
|
||||
"N_note_e\0"
|
||||
"T_wii_name\0"
|
||||
"T_nmbr_b\0"
|
||||
"WIPL_SE_FL_PAGE_DEC\0"
|
||||
"N_note_base\0"
|
||||
"T_CalAdd_R\0"
|
||||
"WIPL_SE_DECIDE\0"
|
||||
"mii_move\0"
|
||||
"WIPL_SE_CH_HOLD\0"
|
||||
"WIPL_SE_CH_SET\0"
|
||||
"WIPL_SE_CH_NOT_MOVE\0"
|
||||
"WIPL_SE_BT_TARGETTING\0"
|
||||
"WIPL_SE_CANCEL\0"
|
||||
"T_nmbr_c\0"
|
||||
"\0\0%"
|
||||
"\0"
|
||||
"0\0"
|
||||
"6\0"
|
||||
"d\0"
|
||||
"\n\0\0"
|
||||
"T_name_move\0"
|
||||
"WIPL_SE_CH_DRAG\0"
|
||||
"N_base_move\0"
|
||||
"\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38"
|
||||
"\x00\x39\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36"
|
||||
"\x00\x00\x00\x25\x00\x30\x00\x31\x00\x36\x00\x6c\x00\x6c\x00\x64"
|
||||
"\x00";
|
||||
|
||||
extern "C" char smArg__Q23ipl6System;
|
||||
extern "C" void checkUserId__Q33ipl5nwc247ManagerFUx();
|
||||
extern "C" void getErrCode__Q33ipl5nwc247ManagerFv();
|
||||
@@ -361,6 +485,28 @@ miio_set_done:
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" int get_button_no__Q33ipl5scene7AddressFPCc(void*, const char* paneName) {
|
||||
int result = -1;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (strcmp(sButtonNameB[i], paneName) == 0) {
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" int get_button_space_no__Q33ipl5scene7AddressFPCc(void*, const char* paneName) {
|
||||
int result = -1;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (strcmp(sButtonSpaceName[i], paneName) == 0) {
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" asm void __ml__Q33ipl4math4VEC2CFf() {
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
|
||||
@@ -23,6 +23,278 @@ enum {
|
||||
|
||||
static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength);
|
||||
|
||||
u64 s_addressEditDataPool[269] = {
|
||||
0x425f6372645f6274,
|
||||
0x6e5f303000425f63,
|
||||
0x72645f62746e5f31,
|
||||
0x3000425f6372645f,
|
||||
0x62746e5f31310042,
|
||||
0x5f6d69695f69636f,
|
||||
0x6e5f303000425f63,
|
||||
0x6172645f62657461,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x425f6372645f6564,
|
||||
0x67695f3030006261,
|
||||
0x6c6c6f6f6e2e6173,
|
||||
0x680074685f416472,
|
||||
0x6573735f622e6272,
|
||||
0x6c79740074685f41,
|
||||
0x64726573735f625f,
|
||||
0x636172645f737472,
|
||||
0x742e62726c616e00,
|
||||
0x636172645f737472,
|
||||
0x745f666e73680074,
|
||||
0x685f416472657373,
|
||||
0x5f625f62746e5f69,
|
||||
0x6e2e62726c616e00,
|
||||
0x6372645f62746e5f,
|
||||
0x3030006372645f62,
|
||||
0x746e5f3130006372,
|
||||
0x645f62746e5f3131,
|
||||
0x006d69695f69636f,
|
||||
0x6e5f303000545f66,
|
||||
0x726e645f6372645f,
|
||||
0x30300074685f4164,
|
||||
0x726573735f625f62,
|
||||
0x746e5f7073682e62,
|
||||
0x726c616e0074685f,
|
||||
0x4164726573735f62,
|
||||
0x5f62746e5f6f7574,
|
||||
0x2e62726c616e0074,
|
||||
0x685f416472657373,
|
||||
0x5f625f62746e5f73,
|
||||
0x636c5f696e2e6272,
|
||||
0x6c616e0074685f41,
|
||||
0x64726573735f625f,
|
||||
0x62746e5f73636c5f,
|
||||
0x6f75742e62726c61,
|
||||
0x6e006372645f6274,
|
||||
0x6e5f677279007468,
|
||||
0x5f4164726573735f,
|
||||
0x625f636172645f6d,
|
||||
0x73675f616c705f69,
|
||||
0x6e2e62726c616e00,
|
||||
0x636172645f6d7367,
|
||||
0x0074685f41647265,
|
||||
0x73735f625f636172,
|
||||
0x645f6d73675f616c,
|
||||
0x705f6f75742e6272,
|
||||
0x6c616e0074685f41,
|
||||
0x64726573735f625f,
|
||||
0x636172645f666e73,
|
||||
0x682e62726c616e00,
|
||||
0x545f6372645f6274,
|
||||
0x6e5f303000545f63,
|
||||
0x72645f62746e5f31,
|
||||
0x3000545f6372645f,
|
||||
0x62746e5f31310054,
|
||||
0x5f6372645f62746e,
|
||||
0x5f67727900545f63,
|
||||
0x6172645f6d73675f,
|
||||
0x303000545f6e616d,
|
||||
0x655f30300074685f,
|
||||
0x4164726573735f63,
|
||||
0x2e62726c79740074,
|
||||
0x685f416472657373,
|
||||
0x5f635f636172645f,
|
||||
0x737472742e62726c,
|
||||
0x616e00475f636172,
|
||||
0x645f737472745f66,
|
||||
0x6e73680074685f41,
|
||||
0x64726573735f635f,
|
||||
0x7175657374696f6e,
|
||||
0x5f616c705f696e2e,
|
||||
0x62726c616e00475f,
|
||||
0x7175657374696f6e,
|
||||
0x5f30300074685f41,
|
||||
0x64726573735f635f,
|
||||
0x6e616d655f616c70,
|
||||
0x5f696e2e62726c61,
|
||||
0x6e00475f6e616d65,
|
||||
0x5f30300074685f41,
|
||||
0x64726573735f635f,
|
||||
0x6d73675f616c705f,
|
||||
0x696e2e62726c616e,
|
||||
0x00475f6d73675f30,
|
||||
0x300074685f416472,
|
||||
0x6573735f635f6d69,
|
||||
0x695f616c705f696e,
|
||||
0x2e62726c616e0074,
|
||||
0x685f416472657373,
|
||||
0x5f635f7175657374,
|
||||
0x696f6e5f616c705f,
|
||||
0x6f75742e62726c61,
|
||||
0x6e0074685f416472,
|
||||
0x6573735f635f6e61,
|
||||
0x6d655f616c705f6f,
|
||||
0x75742e62726c616e,
|
||||
0x0074685f41647265,
|
||||
0x73735f635f6d7367,
|
||||
0x5f616c705f6f7574,
|
||||
0x2e62726c616e0074,
|
||||
0x685f416472657373,
|
||||
0x5f635f6d69695f61,
|
||||
0x6c705f6f75742e62,
|
||||
0x726c616e0074685f,
|
||||
0x4164726573735f63,
|
||||
0x5f636172645f666e,
|
||||
0x73682e62726c616e,
|
||||
0x006d795f4261636b,
|
||||
0x5f612e62726c7974,
|
||||
0x006d795f4261636b,
|
||||
0x5f615f4170656172,
|
||||
0x2e62726c616e0050,
|
||||
0x6963747572655f30,
|
||||
0x30006d795f426163,
|
||||
0x6b5f615f4c6f7374,
|
||||
0x2e62726c616e0054,
|
||||
0x5f7175657374696f,
|
||||
0x6e5f303000545f6d,
|
||||
0x73675f3030006d79,
|
||||
0x5f49706c546f7042,
|
||||
0x616c6c6f6f6e5f61,
|
||||
0x2e62726c79740000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x545f6d69695f6d73,
|
||||
0x675f303000574950,
|
||||
0x4c5f53455f42545f,
|
||||
0x5441524745545449,
|
||||
0x4e47005749504c5f,
|
||||
0x53455f4445434944,
|
||||
0x4500000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x5749504c5f53455f,
|
||||
0x43414e43454c0000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000250030,
|
||||
0x00360064000a0000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
0x0000000000000000,
|
||||
};
|
||||
|
||||
extern "C" char lbl_81647EE0;
|
||||
extern "C" char smArg__Q23ipl6System;
|
||||
extern "C" const char* smButtonName__Q33ipl5scene6Button[];
|
||||
@@ -35,13 +307,31 @@ extern "C" void calc__Q33ipl6layout6ObjectFv();
|
||||
extern "C" void isActive__Q33ipl5scene6ButtonCFv();
|
||||
extern "C" void update__Q33ipl5scene6ButtonFv();
|
||||
extern "C" void update__Q33ipl3gui11PaneManagerFv();
|
||||
extern "C" void setOrtho__Q33ipl7utility8GraphicsFUl();
|
||||
extern "C" void draw__Q33ipl6layout6ObjectFv();
|
||||
extern "C" void draw__Q33ipl5scene11TextBalloonFv();
|
||||
extern "C" void callBtn1__Q23ipl12DialogWindowFUlUl();
|
||||
extern "C" void callS2Btn2__Q23ipl12DialogWindowFUlUlb();
|
||||
extern "C" void reserveText__Q33ipl5scene6ButtonFiUl();
|
||||
extern "C" void reserveAnm__Q33ipl5scene6ButtonFi();
|
||||
extern "C" void initFrame__Q33ipl7utility15FrameControllerFv();
|
||||
extern "C" void getMessage__Q33ipl7message7MessageCFUl();
|
||||
extern "C" void del__Q33ipl5scene15FriendListCacheFUl();
|
||||
extern "C" void reset_friend__Q33ipl5scene7AddressFv();
|
||||
extern "C" void __div2u();
|
||||
extern "C" void __mod2u();
|
||||
extern "C" void UTF16ToANSI__Q33ipl7utility13CharacterCodeFPUcPCwl();
|
||||
extern "C" void isValidId__Q33ipl5scene15FriendListCacheFRCUx();
|
||||
extern "C" void isDupId__Q33ipl5scene15FriendListCacheFRCUx();
|
||||
extern "C" void isDupMail__Q33ipl5scene15FriendListCacheFPCc();
|
||||
extern "C" u64 utf16_wiiid__Q33ipl5scene11AddressEditFPCw(const wchar_t*);
|
||||
extern "C" void _savegpr_29();
|
||||
extern "C" void _restgpr_29();
|
||||
extern "C" void _savegpr_23();
|
||||
extern "C" void _savegpr_29();
|
||||
extern "C" void _savegpr_27();
|
||||
extern "C" void _restgpr_23();
|
||||
extern "C" void _restgpr_29();
|
||||
extern "C" void _restgpr_27();
|
||||
|
||||
void ipl::scene::AddressEdit::stt_msg_code_add() {
|
||||
@@ -120,6 +410,158 @@ void ipl::scene::AddressEdit::String::clear() {
|
||||
reinterpret_cast<u8*>(this)[0x422] = 0;
|
||||
}
|
||||
|
||||
extern "C" asm void setWiiNo__Q43ipl5scene11AddressEdit6StringFPCw() {
|
||||
nofralloc
|
||||
stwu r1, -0x20(r1)
|
||||
mflr r0
|
||||
stw r0, 0x24(r1)
|
||||
addi r11, r1, 0x20
|
||||
bl _savegpr_29
|
||||
li r0, 1
|
||||
mr r31, r4
|
||||
stb r0, 0x422(r3)
|
||||
mr r30, r3
|
||||
li r4, 0
|
||||
li r5, 0x204
|
||||
bl memset
|
||||
mr r3, r30
|
||||
mr r4, r31
|
||||
li r5, 0x10
|
||||
bl wcsncpy
|
||||
addi r3, r30, 0x21c
|
||||
li r4, 0
|
||||
li r5, 0x204
|
||||
bl memset
|
||||
li r0, 0x10
|
||||
li r7, 0
|
||||
li r3, 0
|
||||
li r5, 0x3f
|
||||
mtctr r0
|
||||
setWiiNo_L1:
|
||||
lhzx r6, r31, r3
|
||||
cmplwi r6, 0x30
|
||||
blt setWiiNo_L2
|
||||
cmplwi r6, 0x39
|
||||
bgt setWiiNo_L2
|
||||
srawi r0, r7, 2
|
||||
addze r0, r0
|
||||
add r0, r7, r0
|
||||
slwi r0, r0, 1
|
||||
add r4, r30, r0
|
||||
sth r6, 0x21c(r4)
|
||||
b setWiiNo_L3
|
||||
setWiiNo_L2:
|
||||
srawi r0, r7, 2
|
||||
addze r0, r0
|
||||
add r0, r7, r0
|
||||
slwi r0, r0, 1
|
||||
add r4, r30, r0
|
||||
sth r5, 0x21c(r4)
|
||||
setWiiNo_L3:
|
||||
addi r7, r7, 1
|
||||
addi r3, r3, 2
|
||||
bdnz setWiiNo_L1
|
||||
li r0, 0x20
|
||||
mr r3, r31
|
||||
sth r0, 0x238(r30)
|
||||
li r29, 0
|
||||
sth r0, 0x22e(r30)
|
||||
sth r0, 0x224(r30)
|
||||
bl wcslen
|
||||
cmplwi r3, 0x10
|
||||
bne setWiiNo_L4
|
||||
mr r3, r31
|
||||
bl utf16_wiiid__Q33ipl5scene11AddressEditFPCw
|
||||
stw r4, 0xc(r1)
|
||||
addi r4, r1, 8
|
||||
stw r3, 8(r1)
|
||||
lwz r3, 0x424(r30)
|
||||
lwz r3, 0x4ec(r3)
|
||||
bl isValidId__Q33ipl5scene15FriendListCacheFRCUx
|
||||
cmpwi r3, 0
|
||||
beq setWiiNo_L4
|
||||
li r29, 1
|
||||
setWiiNo_L4:
|
||||
stb r29, 0x420(r30)
|
||||
addi r11, r1, 0x20
|
||||
bl _restgpr_29
|
||||
lwz r0, 0x24(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x20
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void isDupCode__Q43ipl5scene11AddressEdit6StringCFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x120(r1)
|
||||
mflr r0
|
||||
stw r0, 0x124(r1)
|
||||
lbz r0, 0x422(r3)
|
||||
stw r31, 0x11c(r1)
|
||||
mr r31, r3
|
||||
cmpwi r0, 0
|
||||
beq isDupCode_L1
|
||||
bl utf16_wiiid__Q33ipl5scene11AddressEditFPCw
|
||||
stw r4, 0xc(r1)
|
||||
addi r4, r1, 8
|
||||
lwz r5, 0x424(r31)
|
||||
stw r3, 8(r1)
|
||||
lwz r3, 0x4ec(r5)
|
||||
bl isDupId__Q33ipl5scene15FriendListCacheFRCUx
|
||||
b isDupCode_L2
|
||||
isDupCode_L1:
|
||||
addi r3, r1, 0x10
|
||||
li r4, 0
|
||||
li r5, 0x101
|
||||
bl memset
|
||||
mr r4, r31
|
||||
addi r3, r1, 0x10
|
||||
li r5, 0x100
|
||||
bl UTF16ToANSI__Q33ipl7utility13CharacterCodeFPUcPCwl
|
||||
lwz r3, 0x424(r31)
|
||||
addi r4, r1, 0x10
|
||||
lwz r3, 0x4ec(r3)
|
||||
bl isDupMail__Q33ipl5scene15FriendListCacheFPCc
|
||||
isDupCode_L2:
|
||||
lwz r0, 0x124(r1)
|
||||
lwz r31, 0x11c(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x120
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void isMyCode__Q43ipl5scene11AddressEdit6StringCFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
stw r0, 0x14(r1)
|
||||
lbz r0, 0x422(r3)
|
||||
stw r31, 0xc(r1)
|
||||
cmpwi r0, 0
|
||||
stw r30, 8(r1)
|
||||
beq isMyCode_L1
|
||||
lwz r4, 0x424(r3)
|
||||
lwz r4, 0x4ec(r4)
|
||||
lwz r31, 0x7d68(r4)
|
||||
lwz r30, 0x7d6c(r4)
|
||||
bl utf16_wiiid__Q33ipl5scene11AddressEditFPCw
|
||||
xor r4, r30, r4
|
||||
xor r0, r31, r3
|
||||
or r0, r4, r0
|
||||
cntlzw r0, r0
|
||||
srwi r3, r0, 5
|
||||
b isMyCode_L2
|
||||
isMyCode_L1:
|
||||
li r3, 0
|
||||
isMyCode_L2:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
lwz r30, 8(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void prepare__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
@@ -420,6 +862,314 @@ extern "C" void setName__Q43ipl5scene11AddressEdit6StringFPCw(void* self, const
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" asm void calcFadeout__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
stw r0, 0x14(r1)
|
||||
stw r31, 0xc(r1)
|
||||
stw r30, 8(r1)
|
||||
mr r30, r3
|
||||
lwz r3, 0xa8(r3)
|
||||
bl calc__Q33ipl5scene11TextBalloonFv
|
||||
lis r31, smArg__Q23ipl6System@ha
|
||||
addi r31, r31, smArg__Q23ipl6System@l
|
||||
lwz r3, 0xc4(r31)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xc(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
cmpwi r3, 1
|
||||
bne calcFadeout_L1
|
||||
lwz r3, 0x68(r30)
|
||||
li r31, 0
|
||||
li r4, 0x1e
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq calcFadeout_L2
|
||||
lwz r3, 0x74(r30)
|
||||
li r4, 9
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq calcFadeout_L2
|
||||
li r31, 1
|
||||
calcFadeout_L2:
|
||||
mr r3, r31
|
||||
b calcFadeout_L3
|
||||
calcFadeout_L1:
|
||||
lwz r3, 0xc4(r31)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xc(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
cntlzw r0, r3
|
||||
srwi r3, r0, 5
|
||||
calcFadeout_L3:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
lwz r30, 8(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void draw__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
lis r4, smArg__Q23ipl6System@ha
|
||||
stw r0, 0x14(r1)
|
||||
addi r4, r4, smArg__Q23ipl6System@l
|
||||
stw r31, 0xc(r1)
|
||||
mr r31, r3
|
||||
lwz r3, 0x64(r4)
|
||||
lwz r0, 0x100(r3)
|
||||
cmpwi r0, 1
|
||||
bne draw_L1
|
||||
li r3, 0
|
||||
bl setOrtho__Q33ipl7utility8GraphicsFUl
|
||||
lwz r3, 0x68(r31)
|
||||
bl draw__Q33ipl6layout6ObjectFv
|
||||
lwz r3, 0x80(r31)
|
||||
bl draw__Q33ipl6layout6ObjectFv
|
||||
lwz r3, 0x74(r31)
|
||||
bl draw__Q33ipl6layout6ObjectFv
|
||||
lwz r3, 0xa8(r31)
|
||||
bl draw__Q33ipl5scene11TextBalloonFv
|
||||
draw_L1:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void stt_wait_btn_fadein__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
stw r0, 0x14(r1)
|
||||
stw r31, 0xc(r1)
|
||||
mr r31, r3
|
||||
stw r30, 8(r1)
|
||||
lwz r0, 0xa4(r3)
|
||||
lwz r4, 0x4ec(r3)
|
||||
mulli r0, r0, 0x140
|
||||
add r4, r4, r0
|
||||
lwz r0, 4(r4)
|
||||
cmplwi r0, 2
|
||||
bne stt_wait_btn_fadein_L1
|
||||
lwz r3, 0x68(r3)
|
||||
li r4, 0x10
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r3, 0x14(r3)
|
||||
addi r3, r3, -1
|
||||
addic r0, r3, -1
|
||||
subfe r30, r0, r3
|
||||
b stt_wait_btn_fadein_L2
|
||||
stt_wait_btn_fadein_L1:
|
||||
lwz r3, 0x68(r3)
|
||||
li r4, 0x1a
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r3, 0x14(r3)
|
||||
addi r3, r3, -1
|
||||
addic r0, r3, -1
|
||||
subfe r30, r0, r3
|
||||
stt_wait_btn_fadein_L2:
|
||||
lwz r3, 0x68(r31)
|
||||
li r4, 0x11
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r5, 0x14(r3)
|
||||
li r4, 0x12
|
||||
lwz r3, 0x68(r31)
|
||||
addi r5, r5, -1
|
||||
addic r0, r5, -1
|
||||
addi r3, r3, 0x28c
|
||||
subfe r0, r0, r5
|
||||
and r5, r30, r0
|
||||
addic r0, r5, -1
|
||||
subfe r30, r0, r5
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r3, 0x14(r3)
|
||||
addi r3, r3, -1
|
||||
addic r0, r3, -1
|
||||
subfe r0, r0, r3
|
||||
and r3, r30, r0
|
||||
addic r0, r3, -1
|
||||
subfe. r0, r0, r3
|
||||
beq stt_wait_btn_fadein_L3
|
||||
li r0, 0
|
||||
stw r0, 0x64(r31)
|
||||
stt_wait_btn_fadein_L3:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
lwz r30, 8(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void stt_wait_del_msg_fadeout_to_rlt__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
li r4, 0x1d
|
||||
stw r0, 0x14(r1)
|
||||
stw r31, 0xc(r1)
|
||||
mr r31, r3
|
||||
lwz r5, 0x68(r3)
|
||||
addi r3, r5, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq stt_wait_del_msg_fadeout_to_rlt_L1
|
||||
li r0, 8
|
||||
lis r3, smArg__Q23ipl6System@ha
|
||||
stw r0, 0x64(r31)
|
||||
addi r3, r3, smArg__Q23ipl6System@l
|
||||
li r4, 0x51
|
||||
li r5, 0x2e
|
||||
lwz r3, 0xac(r3)
|
||||
bl callBtn1__Q23ipl12DialogWindowFUlUl
|
||||
stt_wait_del_msg_fadeout_to_rlt_L1:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void stt_msg_del_rlt__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
li r4, 5
|
||||
stw r0, 0x14(r1)
|
||||
stw r31, 0xc(r1)
|
||||
lis r31, smArg__Q23ipl6System@ha
|
||||
addi r31, r31, smArg__Q23ipl6System@l
|
||||
stw r30, 8(r1)
|
||||
mr r30, r3
|
||||
lwz r3, 0x64(r31)
|
||||
bl getScene__Q33ipl5scene7ManagerFi
|
||||
lwz r4, 0xac(r31)
|
||||
mr r31, r3
|
||||
lwz r0, 0x24(r4)
|
||||
cmpwi r0, 1
|
||||
beq stt_msg_del_rlt_L2
|
||||
b stt_msg_del_rlt_L1
|
||||
stt_msg_del_rlt_L2:
|
||||
li r4, 1
|
||||
li r5, 0x29
|
||||
bl reserveText__Q33ipl5scene6ButtonFiUl
|
||||
mr r3, r31
|
||||
li r4, 0xf
|
||||
bl reserveAnm__Q33ipl5scene6ButtonFi
|
||||
lwz r3, 0x68(r30)
|
||||
li r4, 0x1e
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
mr r31, r3
|
||||
bl initFrame__Q33ipl7utility15FrameControllerFv
|
||||
li r3, 1
|
||||
li r0, 0x30
|
||||
stw r3, 0x14(r31)
|
||||
stw r0, 0x64(r30)
|
||||
stt_msg_del_rlt_L1:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
lwz r30, 8(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void stt_ipt_wait_fadein__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
li r4, 0
|
||||
stw r0, 0x14(r1)
|
||||
stw r31, 0xc(r1)
|
||||
mr r31, r3
|
||||
lwz r5, 0x74(r3)
|
||||
addi r3, r5, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq stt_ipt_wait_fadein_L1
|
||||
lwz r3, 0x74(r31)
|
||||
li r4, 1
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq stt_ipt_wait_fadein_L1
|
||||
lwz r3, 0x74(r31)
|
||||
li r4, 2
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq stt_ipt_wait_fadein_L1
|
||||
lwz r3, 0x80(r31)
|
||||
li r4, 0
|
||||
addi r3, r3, 0x28c
|
||||
bl List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs
|
||||
lwz r0, 0x14(r3)
|
||||
cmpwi r0, 1
|
||||
beq stt_ipt_wait_fadein_L1
|
||||
li r0, 0xd
|
||||
stw r0, 0x64(r31)
|
||||
stt_ipt_wait_fadein_L1:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
extern "C" asm void stt_ipt_normal__Q33ipl5scene11AddressEditFv() {
|
||||
nofralloc
|
||||
stwu r1, -0x10(r1)
|
||||
mflr r0
|
||||
lis r5, smArg__Q23ipl6System@ha
|
||||
li r4, 5
|
||||
stw r0, 0x14(r1)
|
||||
addi r5, r5, smArg__Q23ipl6System@l
|
||||
stw r31, 0xc(r1)
|
||||
stw r30, 8(r1)
|
||||
mr r30, r3
|
||||
lwz r3, 0x64(r5)
|
||||
bl getScene__Q33ipl5scene7ManagerFi
|
||||
mr r31, r3
|
||||
bl isActive__Q33ipl5scene6ButtonCFv
|
||||
cmpwi r3, 0
|
||||
beq stt_ipt_normal_L1
|
||||
mr r3, r31
|
||||
bl update__Q33ipl5scene6ButtonFv
|
||||
stt_ipt_normal_L1:
|
||||
lwz r0, 0x64(r30)
|
||||
cmpwi r0, 0xd
|
||||
bne stt_ipt_normal_L2
|
||||
lwz r3, 0x7c(r30)
|
||||
bl update__Q33ipl3gui11PaneManagerFv
|
||||
stt_ipt_normal_L2:
|
||||
lwz r0, 0x14(r1)
|
||||
lwz r31, 0xc(r1)
|
||||
lwz r30, 8(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x10
|
||||
blr
|
||||
}
|
||||
|
||||
/*
|
||||
This is a modified version of NWC24CheckPublicMailAddr.
|
||||
Changes:
|
||||
|
||||
@@ -1658,7 +1658,9 @@ namespace ipl {
|
||||
|
||||
BoardObject* object = NULL;
|
||||
FOREACH_OBJ_IN_LIST(object) {
|
||||
strncpy((char*)mKeyTable[i++], object->mCDBRecordKey.keyString, sizeof(object->mCDBRecordKey.keyString));
|
||||
BoardObject* next = object;
|
||||
strncpy((char*)mKeyTable[i++], next->mCDBRecordKey.keyString, sizeof(next->mCDBRecordKey.keyString));
|
||||
object = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "utility/iplRBRUtility.h"
|
||||
#include "utility/iplTPLValidity.h"
|
||||
|
||||
extern "C" void __ct__Q33ipl4math4VEC2Fff(ipl::math::VEC2*, f32, f32);
|
||||
|
||||
// I don't want to keep typing this out lol
|
||||
#define DELETE_PTR_FORCE(x) \
|
||||
{ \
|
||||
@@ -229,8 +231,12 @@ namespace ipl {
|
||||
void BoardObject::stt_create() {
|
||||
RBRHeader* recordHdr = (RBRHeader*)mpRecordData;
|
||||
|
||||
mBoardPos.x = recordHdr->xPos;
|
||||
mBoardPos.y = recordHdr->yPos;
|
||||
f32 xPos;
|
||||
f32 yPos;
|
||||
yPos = recordHdr->yPos;
|
||||
xPos = recordHdr->xPos;
|
||||
mBoardPos.x = xPos;
|
||||
mBoardPos.y = yPos;
|
||||
|
||||
mRecordType = (RBRRecordType)recordHdr->flags.type;
|
||||
|
||||
@@ -318,7 +324,7 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (recordHdr->attach[i].type == RBRAttachmentType_Picture) {
|
||||
else if (recordHdr->attach[i].type == RBRAttachmentType_Picture) {
|
||||
if (create_picture(&mPicture, System::getMem2App(), System::getMem2App(), ((u8*)mpRecordData + recordHdr->attach[i].offset),
|
||||
4 + recordHdr->attach[i].size)) {
|
||||
mpCapture = new (mpHeap, 4) utility::Capture(mpHeap, 0, 0, PICTURE_THUMB_WIDTH, PICTURE_THUMB_HEIGHT, GX_TF_RGB565);
|
||||
@@ -472,11 +478,12 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void BoardObject::stt_stand() {
|
||||
f32 dVar2 = nw4r::math::CosFIdx(((mStandData.unk_0x0C * 30.0f + 30.0f) * 0.7111111f));
|
||||
f32 dVar3 = nw4r::math::SinFIdx(((mStandData.unk_0x0C * 30.0f + 30.0f) * 0.7111111f));
|
||||
f32 dVar2 = nw4r::math::CosFIdx((0.7111111f * (mStandData.unk_0x0C * 30.0f + 30.0f)));
|
||||
f32 dVar3 = nw4r::math::SinFIdx((0.7111111f * (mStandData.unk_0x0C * 30.0f + 30.0f)));
|
||||
|
||||
mBoardPos =
|
||||
(((mStandData.pos * (f32)(10 - mStandData.unk_0x08)) + (math::VEC2(dVar3 * 160.0f, dVar2 * 160.0f) * mStandData.unk_0x08)) / 10.0f);
|
||||
math::VEC2 standPos;
|
||||
__ct__Q33ipl4math4VEC2Fff(&standPos, dVar3 * 160.0f, dVar2 * 160.0f);
|
||||
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.unk_0x08)) + (standPos * mStandData.unk_0x08)) / 10.0f);
|
||||
|
||||
if ((mStandData.unk_0x08 += 1) > 10) {
|
||||
mStandData.init();
|
||||
|
||||
@@ -1147,7 +1147,6 @@ namespace ipl {
|
||||
mpParsedText = new (System::getMem2App(), 4) wchar_t[PARSED_TEXT_LENGTH];
|
||||
memset(mpParsedText, 0, PARSED_TEXT_LENGTH * sizeof(wchar_t));
|
||||
|
||||
const wchar_t* pURLStr;
|
||||
const wchar_t* pStr = inText;
|
||||
|
||||
const wchar_t URLSep[2] = {UrlProcessor::SEPERATOR, 0x00};
|
||||
@@ -1163,7 +1162,8 @@ namespace ipl {
|
||||
|
||||
while (i != strLen) {
|
||||
// If we found a URL
|
||||
if (inText[i] == L'h' && (pURLStr = &inText[i], is_url_protocol(pURLStr))) {
|
||||
if (inText[i] == L'h' && is_url_protocol(&inText[i])) {
|
||||
const wchar_t* pURLStr = &inText[i];
|
||||
// Parse the URL
|
||||
|
||||
unk_0x114[5] = 0;
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
|
||||
#include "iplSystem.h"
|
||||
|
||||
char lbl_816966F9[] = "B_Stop";
|
||||
char lbl_816967B5[] = "T_Stop";
|
||||
__declspec(section ".sdata") extern char lbl_816966F9[];
|
||||
extern char lbl_816967B5[];
|
||||
extern "C" BOOL push_button_queue(void*, const void*);
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
@@ -826,7 +827,7 @@ namespace ipl {
|
||||
Command command;
|
||||
command.type = Command::TYPE_ANIM;
|
||||
command.animId = animId;
|
||||
mReservedCmd.push(command);
|
||||
push_button_queue(&mReservedCmd, &command);
|
||||
}
|
||||
|
||||
void Button::reserveText(int paneId, u32 msgId) {
|
||||
@@ -834,7 +835,7 @@ namespace ipl {
|
||||
command.type = Command::TYPE_TEXT;
|
||||
command.paneId = paneId;
|
||||
command.msgId = msgId;
|
||||
mReservedCmd.push(command);
|
||||
push_button_queue(&mReservedCmd, &command);
|
||||
}
|
||||
|
||||
/* ============== */
|
||||
@@ -966,5 +967,42 @@ namespace ipl {
|
||||
|
||||
void OptOutButtonEventHandlerBase::onEventDerived(u32 compId, u32 event, const controller::Interface* con) {
|
||||
}
|
||||
|
||||
extern "C" asm void push_button_queue() {
|
||||
nofralloc
|
||||
lwz r5, 0x60(r3)
|
||||
lwz r0, 0x64(r3)
|
||||
cmpw r5, r0
|
||||
bne push_not_full
|
||||
li r3, 0
|
||||
blr
|
||||
push_not_full:
|
||||
lwz r0, 0x6C(r3)
|
||||
lwz r6, 0(r4)
|
||||
mulli r7, r0, 0xC
|
||||
lwz r5, 4(r4)
|
||||
lwz r0, 8(r4)
|
||||
stwx r6, r3, r7
|
||||
add r4, r3, r7
|
||||
stw r5, 4(r4)
|
||||
stw r0, 8(r4)
|
||||
lwz r4, 0x6C(r3)
|
||||
lwz r0, 0x60(r3)
|
||||
addi r4, r4, 1
|
||||
cmpw r4, r0
|
||||
stw r4, 0x6C(r3)
|
||||
blt push_pushed
|
||||
li r0, 0
|
||||
stw r0, 0x6C(r3)
|
||||
push_pushed:
|
||||
lwz r4, 0x64(r3)
|
||||
addi r0, r4, 1
|
||||
stw r0, 0x64(r3)
|
||||
li r3, 1
|
||||
blr
|
||||
}
|
||||
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
char lbl_816967B5[] = "T_Stop";
|
||||
|
||||
@@ -113,6 +113,7 @@ namespace ipl {
|
||||
};
|
||||
|
||||
extern "C" char lbl_8164E6AF[] = "%s_Rso%d.brlan";
|
||||
extern "C" char lbl_8164E6C0[] = "icon_Start.brlan";
|
||||
extern "C" char lbl_816969E8[] = "arc";
|
||||
|
||||
static const u32 scLangLookup[SC_PRODUCT_AREA_MAX][16] = {
|
||||
@@ -771,31 +772,32 @@ namespace ipl {
|
||||
f32 ChannelObj::createWadThumbnail() {
|
||||
f32 frame = 0.0f;
|
||||
|
||||
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpThumbFile->getBuffer(), lbl_816969E8, lbl_8164E328.iconBrlyt);
|
||||
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpThumbFile->getBuffer(), lbl_816969E8, lbl_8164E290 + 0x3F8);
|
||||
setLangPane(mpThumbLayout);
|
||||
|
||||
const char* dataBase = lbl_8164E290;
|
||||
u32 rsoIdx = System::getChannelManager()->getIconRSOIdx(mChanPage, mChanIndex);
|
||||
u32 csIdx = System::getChannelManager()->getIconCSIdx(mChanPage, mChanIndex);
|
||||
|
||||
if (rsoIdx != 0) {
|
||||
if (mpThumbLayout->searchFile("icon_Start.brlan")) {
|
||||
mpThumbAnim = mpThumbLayout->bind("icon_Start.brlan");
|
||||
if (mpThumbLayout->searchFile(dataBase + 0x42E)) {
|
||||
mpThumbAnim = mpThumbLayout->bind(dataBase + 0x42E);
|
||||
} else {
|
||||
mpThumbAnim = NULL;
|
||||
}
|
||||
} else {
|
||||
if (csIdx != 0) {
|
||||
if (mpThumbLayout->searchFile("icon_Start.brlan")) {
|
||||
mpThumbAnim = mpThumbLayout->bind("icon_Start.brlan");
|
||||
if (mpThumbLayout->searchFile(dataBase + 0x42E)) {
|
||||
mpThumbAnim = mpThumbLayout->bind(dataBase + 0x42E);
|
||||
} else {
|
||||
mpThumbAnim = NULL;
|
||||
}
|
||||
} else {
|
||||
if (mpThumbLayout->searchFile(lbl_8164E328.iconBrlan)) {
|
||||
mpThumbAnim = mpThumbLayout->bind(lbl_8164E328.iconBrlan);
|
||||
if (mpThumbLayout->searchFile(dataBase + 0x403)) {
|
||||
mpThumbAnim = mpThumbLayout->bind(dataBase + 0x403);
|
||||
} else {
|
||||
if (mpThumbLayout->searchFile(lbl_8164E328.iconWholeBrlan)) {
|
||||
mpThumbAnim = mpThumbLayout->bind(lbl_8164E328.iconWholeBrlan);
|
||||
if (mpThumbLayout->searchFile(dataBase + 0x40E)) {
|
||||
mpThumbAnim = mpThumbLayout->bind(dataBase + 0x40E);
|
||||
} else {
|
||||
mpThumbAnim = NULL;
|
||||
}
|
||||
@@ -950,7 +952,19 @@ namespace ipl {
|
||||
case 1: {
|
||||
if (!mpCursorAnims[ANIM_CURSOR_FOCUS_ON]->isPlaying()) {
|
||||
int prev = unk_0x5C;
|
||||
unk_0x58 = 2;
|
||||
switch (unk_0x58) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
unk_0x58 = 2;
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (prev == 3) {
|
||||
setCursorAnim(3);
|
||||
unk_0x5C = 0;
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace ipl {
|
||||
extern "C" void* m_handle__Q23ipl11TVRCManager;
|
||||
extern "C" void calcChanZoomParam__Q33ipl5scene13ChannelSelectFv();
|
||||
extern "C" void setChanZoomOrtho__Q33ipl5scene13ChannelSelectFv();
|
||||
extern "C" void calcNormal__Q33ipl5scene13ChannelSelectFv();
|
||||
extern "C" void restartChannelModules__Q33ipl5scene13ChannelSelectFv();
|
||||
extern "C" void setEnable__Q23ipl11TVRCManagerFi();
|
||||
extern "C" void enableBtn__Q33ipl5scene6ButtonFv();
|
||||
@@ -50,8 +51,8 @@ namespace ipl {
|
||||
extern "C" void List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs();
|
||||
extern "C" void getChannelBasePane__Q33ipl5scene13ChannelSelectFi();
|
||||
extern "C" void initPane__Q33ipl3gui11PaneManagerFPQ34nw4r3lyt4Pane();
|
||||
extern "C" char jumptable_8164DD14[];
|
||||
extern "C" char jumptable_8164DE80[];
|
||||
extern "C" void* jumptable_8164DD14[];
|
||||
extern "C" void* jumptable_8164DE80[];
|
||||
extern "C" void getCurrentChannel__Q33ipl7channel7ManagerFPiPi();
|
||||
extern "C" void calcNormalRestart__Q33ipl5scene13ChannelSelectFv();
|
||||
extern "C" void _savegpr_28();
|
||||
@@ -88,8 +89,17 @@ namespace ipl {
|
||||
extern "C" void __as__Q33ipl4math4VEC2FRCQ33ipl4math4VEC2();
|
||||
extern "C" void setOrtho__Q33ipl7utility8GraphicsFUl();
|
||||
extern "C" char mscBasePaneNames__Q33ipl5scene13ChannelSelect[];
|
||||
extern "C" char mscClockPaneNames__Q33ipl5scene13ChannelSelect[];
|
||||
extern "C" u32 mscMaskPaneName__Q33ipl5scene13ChannelSelect;
|
||||
extern "C" const char lbl_8164DFE1[];
|
||||
extern "C" char lbl_8164DFE1[];
|
||||
extern "C" char lbl_8164DE64[];
|
||||
extern "C" char lbl_8164DE6D[];
|
||||
extern "C" char lbl_8164DE9C[];
|
||||
extern "C" char lbl_8164DFCB[];
|
||||
extern "C" char lbl_8164DFF1[];
|
||||
extern "C" char lbl_8164E000[];
|
||||
extern "C" char lbl_8164E024[];
|
||||
extern "C" char lbl_8164E038[];
|
||||
extern "C" void draw__Q33ipl6layout6ObjectFPQ34nw4r3lyt4Pane();
|
||||
extern "C" void SetVisible__Q34nw4r3lyt4PaneFb();
|
||||
extern "C" void drawChannelThumbnails__Q33ipl5scene13ChannelSelectFv();
|
||||
@@ -105,26 +115,49 @@ namespace ipl {
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164D978[0x314] = "N_Ch_a04";
|
||||
extern "C" const char lbl_8164DC8C[] = "N_Clock0";
|
||||
extern "C" const char lbl_8164DC95[] = "N_Clock1";
|
||||
extern "C" const char lbl_8164DC9E[] = "N_Clock2";
|
||||
extern "C" const char* const lbl_8164DCA8[3] __attribute__((aligned(4))) = {
|
||||
lbl_8164DC8C,
|
||||
lbl_8164DC95,
|
||||
lbl_8164DC9E,
|
||||
};
|
||||
extern "C" const char lbl_8164DCB4[] = "chanSel.ash";
|
||||
extern "C" const char lbl_8164DCC0[] = "diskThum.ash\0WIPL_SE_WII_START";
|
||||
extern "C" const char lbl_8164DCDF[] = "WIPL_BGM_MENU\0WIPL_SE_SDCARD_IN\0WIPL_SE_SDCARD_OUT\0\0";
|
||||
extern "C" const char lbl_8164DE9C[] = "WSD_SELECT";
|
||||
extern "C" const char lbl_8164DFCB[] = "WIPL_SE_CH_TARGETTING";
|
||||
extern "C" const char lbl_8164E038[] = "WIPL_SE_DECIDE";
|
||||
extern "C" const char lbl_8164DE64[] = "N_GCIcon";
|
||||
extern "C" const char lbl_8164DE6D[] = "N_DiscUpdateIcon";
|
||||
extern "C" const char lbl_8164DFF1[] = "WIPL_SE_CH_SET";
|
||||
extern "C" const char lbl_8164E000[] = "WIPL_SE_CH_NOT_MOVE";
|
||||
extern "C" const char lbl_8164E024[] = "WIPL_SE_GRAY_BUTTON";
|
||||
extern "C" const char lbl_8164D978[] = "N_Ch_a04";
|
||||
extern "C" const char lbl_8164D981[] = "N_Ch_a08";
|
||||
extern "C" const char lbl_8164D98A[] = "N_Ch_a12";
|
||||
extern "C" const char lbl_8164D993[] = "N_Ch_b01";
|
||||
extern "C" const char lbl_8164D99C[] = "N_Ch_b02";
|
||||
extern "C" const char lbl_8164D9A5[] = "N_Ch_b03";
|
||||
extern "C" const char lbl_8164D9AE[] = "N_Ch_b04";
|
||||
extern "C" const char lbl_8164D9B7[] = "N_Ch_b05";
|
||||
extern "C" const char lbl_8164D9C0[] = "N_Ch_b06";
|
||||
extern "C" const char lbl_8164D9C9[] = "N_Ch_b07";
|
||||
extern "C" const char lbl_8164D9D2[] = "N_Ch_b08";
|
||||
extern "C" const char lbl_8164D9DB[] = "N_Ch_b09";
|
||||
extern "C" const char lbl_8164D9E4[] = "N_Ch_b10";
|
||||
extern "C" const char lbl_8164D9ED[] = "N_Ch_b11";
|
||||
extern "C" const char lbl_8164D9F6[] = "N_Ch_b12";
|
||||
extern "C" const char lbl_8164D9FF[] = "N_Ch_c01";
|
||||
extern "C" const char lbl_8164DA08[] = "N_Ch_c02";
|
||||
extern "C" const char lbl_8164DA11[] = "N_Ch_c03";
|
||||
extern "C" const char lbl_8164DA1A[] = "N_Ch_c04";
|
||||
extern "C" const char lbl_8164DA23[] = "N_Ch_c05";
|
||||
extern "C" const char lbl_8164DA2C[] = "N_Ch_c06";
|
||||
extern "C" const char lbl_8164DA35[] = "N_Ch_c07";
|
||||
extern "C" const char lbl_8164DA3E[] = "N_Ch_c08";
|
||||
extern "C" const char lbl_8164DA47[] = "N_Ch_c09";
|
||||
extern "C" const char lbl_8164DA50[] = "N_Ch_c10";
|
||||
extern "C" const char lbl_8164DA59[] = "N_Ch_c11";
|
||||
extern "C" const char lbl_8164DA62[] = "N_Ch_c12";
|
||||
extern "C" const char lbl_8164DA6B[] = "N_Ch_d01";
|
||||
extern "C" const char lbl_8164DA74[] = "N_Ch_d02";
|
||||
extern "C" const char lbl_8164DA7D[] = "N_Ch_d03";
|
||||
extern "C" const char lbl_8164DA86[] = "N_Ch_d04";
|
||||
extern "C" const char lbl_8164DA8F[] = "N_Ch_d05";
|
||||
extern "C" const char lbl_8164DA98[] = "N_Ch_d06";
|
||||
extern "C" const char lbl_8164DAA1[] = "N_Ch_d07";
|
||||
extern "C" const char lbl_8164DAAA[] = "N_Ch_d08";
|
||||
extern "C" const char lbl_8164DAB3[] = "N_Ch_d09";
|
||||
extern "C" const char lbl_8164DABC[] = "N_Ch_d10";
|
||||
extern "C" const char lbl_8164DAC5[] = "N_Ch_d11";
|
||||
extern "C" const char lbl_8164DACE[] = "N_Ch_d12";
|
||||
extern "C" const char lbl_8164DAD7[] = "N_Ch_e01";
|
||||
extern "C" const char lbl_8164DAE0[] = "N_Ch_e05";
|
||||
extern "C" const char lbl_8164DAE9[] = "N_Ch_e09";
|
||||
|
||||
#pragma pop
|
||||
|
||||
#pragma push
|
||||
@@ -156,91 +189,109 @@ namespace ipl {
|
||||
// clang-format off
|
||||
const char* ChannelSelect::mscChanPaneNames[CHAN_SCROLL_MAX][MAX_CHANNEL_INDEX] = {
|
||||
{
|
||||
"" /*"N_Ch_a01"*/,
|
||||
"" /*"N_Ch_a02"*/,
|
||||
"" /*"N_Ch_a03"*/,
|
||||
"N_Ch_a04",
|
||||
"" /*"N_Ch_a05"*/,
|
||||
"" /*"N_Ch_a06"*/,
|
||||
"" /*"N_Ch_a07"*/,
|
||||
"N_Ch_a08",
|
||||
"" /*"N_Ch_a09"*/,
|
||||
"" /*"N_Ch_a10"*/,
|
||||
"" /*"N_Ch_a11"*/,
|
||||
"N_Ch_a12"
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
lbl_8164D978,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
lbl_8164D981,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
lbl_8164D98A
|
||||
},
|
||||
{
|
||||
"N_Ch_b01",
|
||||
"N_Ch_b02",
|
||||
"N_Ch_b03",
|
||||
"N_Ch_b04",
|
||||
"N_Ch_b05",
|
||||
"N_Ch_b06",
|
||||
"N_Ch_b07",
|
||||
"N_Ch_b08",
|
||||
"N_Ch_b09",
|
||||
"N_Ch_b10",
|
||||
"N_Ch_b11",
|
||||
"N_Ch_b12"
|
||||
lbl_8164D993,
|
||||
lbl_8164D99C,
|
||||
lbl_8164D9A5,
|
||||
lbl_8164D9AE,
|
||||
lbl_8164D9B7,
|
||||
lbl_8164D9C0,
|
||||
lbl_8164D9C9,
|
||||
lbl_8164D9D2,
|
||||
lbl_8164D9DB,
|
||||
lbl_8164D9E4,
|
||||
lbl_8164D9ED,
|
||||
lbl_8164D9F6
|
||||
},
|
||||
{
|
||||
"N_Ch_c01",
|
||||
"N_Ch_c02",
|
||||
"N_Ch_c03",
|
||||
"N_Ch_c04",
|
||||
"N_Ch_c05",
|
||||
"N_Ch_c06",
|
||||
"N_Ch_c07",
|
||||
"N_Ch_c08",
|
||||
"N_Ch_c09",
|
||||
"N_Ch_c10",
|
||||
"N_Ch_c11",
|
||||
"N_Ch_c12"
|
||||
lbl_8164D9FF,
|
||||
lbl_8164DA08,
|
||||
lbl_8164DA11,
|
||||
lbl_8164DA1A,
|
||||
lbl_8164DA23,
|
||||
lbl_8164DA2C,
|
||||
lbl_8164DA35,
|
||||
lbl_8164DA3E,
|
||||
lbl_8164DA47,
|
||||
lbl_8164DA50,
|
||||
lbl_8164DA59,
|
||||
lbl_8164DA62
|
||||
},
|
||||
{
|
||||
"N_Ch_d01",
|
||||
"N_Ch_d02",
|
||||
"N_Ch_d03",
|
||||
"N_Ch_d04",
|
||||
"N_Ch_d05",
|
||||
"N_Ch_d06",
|
||||
"N_Ch_d07",
|
||||
"N_Ch_d08",
|
||||
"N_Ch_d09",
|
||||
"N_Ch_d10",
|
||||
"N_Ch_d11",
|
||||
"N_Ch_d12"
|
||||
lbl_8164DA6B,
|
||||
lbl_8164DA74,
|
||||
lbl_8164DA7D,
|
||||
lbl_8164DA86,
|
||||
lbl_8164DA8F,
|
||||
lbl_8164DA98,
|
||||
lbl_8164DAA1,
|
||||
lbl_8164DAAA,
|
||||
lbl_8164DAB3,
|
||||
lbl_8164DABC,
|
||||
lbl_8164DAC5,
|
||||
lbl_8164DACE
|
||||
},
|
||||
{
|
||||
"N_Ch_e01",
|
||||
"" /*"N_Ch_e02"*/,
|
||||
"" /*"N_Ch_e03"*/,
|
||||
"" /*"N_Ch_e04"*/,
|
||||
"N_Ch_e05",
|
||||
"" /*"N_Ch_e06"*/,
|
||||
"" /*"N_Ch_e07"*/,
|
||||
"" /*"N_Ch_e08"*/,
|
||||
"N_Ch_e09",
|
||||
"" /*"N_Ch_e10"*/,
|
||||
"" /*"N_Ch_e11"*/,
|
||||
"" /*"N_Ch_e12"*/
|
||||
lbl_8164DAD7,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
lbl_8164DAE0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
lbl_8164DAE9,
|
||||
"",
|
||||
"",
|
||||
""
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164DBE4[] = "BaseMask0";
|
||||
extern "C" const char lbl_8164DBEE[] = "BaseMask1";
|
||||
extern "C" const char lbl_8164DBF8[] = "BaseMask2";
|
||||
extern "C" const char lbl_8164DC02[] = "BaseMask3";
|
||||
extern "C" const char lbl_8164DC0C[] = "BaseMask4";
|
||||
#pragma pop
|
||||
|
||||
const char* ChannelSelect::mscBasePaneNames[CHAN_SCROLL_MAX] = {
|
||||
"BaseMask0",
|
||||
"BaseMask1",
|
||||
"BaseMask2",
|
||||
"BaseMask3",
|
||||
"BaseMask4"
|
||||
lbl_8164DBE4,
|
||||
lbl_8164DBEE,
|
||||
lbl_8164DBF8,
|
||||
lbl_8164DC02,
|
||||
lbl_8164DC0C
|
||||
};
|
||||
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164DC2C[] = "Picture_00";
|
||||
extern "C" const char lbl_8164DC37[] = "Picture_01";
|
||||
extern "C" const char lbl_8164DC42[] = "Picture_02";
|
||||
extern "C" const char lbl_8164DC4D[] = "Picture_03";
|
||||
extern "C" const char lbl_8164DC58[] = "Picture_04";
|
||||
#pragma pop
|
||||
|
||||
const char* ChannelSelect::mscUnk0PaneNames[CHAN_SCROLL_MAX] = {
|
||||
"Picture_00",
|
||||
"Picture_01",
|
||||
"Picture_02",
|
||||
"Picture_03",
|
||||
"Picture_04"
|
||||
lbl_8164DC2C,
|
||||
lbl_8164DC37,
|
||||
lbl_8164DC42,
|
||||
lbl_8164DC4D,
|
||||
lbl_8164DC58
|
||||
};
|
||||
|
||||
const char* ChannelSelect::mscUnk1PaneNames[CHAN_SCROLL_MAX] = {
|
||||
@@ -250,13 +301,56 @@ namespace ipl {
|
||||
"Edge3",
|
||||
"Edge4"
|
||||
};
|
||||
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164DC8C[] = "N_Clock0";
|
||||
extern "C" const char lbl_8164DC95[] = "N_Clock1";
|
||||
extern "C" const char lbl_8164DC9E[] = "N_Clock2";
|
||||
#pragma pop
|
||||
|
||||
const char* ChannelSelect::mscClockPaneNames[3] = {
|
||||
"N_Clock0",
|
||||
"N_Clock1",
|
||||
"N_Clock2"
|
||||
lbl_8164DC8C,
|
||||
lbl_8164DC95,
|
||||
lbl_8164DC9E
|
||||
};
|
||||
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164DCB4[] = "chanSel.ash";
|
||||
extern "C" const char lbl_8164DCC0[] = "diskThum.ash\0WIPL_SE_WII_START";
|
||||
extern "C" const char lbl_8164DCDF[] = "WIPL_BGM_MENU\0WIPL_SE_SDCARD_IN\0WIPL_SE_SDCARD_OUT\0\0";
|
||||
extern "C" void* jumptable_8164DD14[0x1B] = {
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x4C),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x64),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x6C),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x74),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x54),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x54),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x5C),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x5C),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x7C),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD4),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x88),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x90),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0x98),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xA0),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xA8),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xB0),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xB8),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xC0),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xC8),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD0),
|
||||
(void*)((const char*)calcNormal__Q33ipl5scene13ChannelSelectFv + 0xD0)
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
const char* ChannelSelect::mscMaskPaneName ="ChMask";
|
||||
|
||||
static const f32 cfChanThumbOfss[2][2] = {
|
||||
@@ -345,8 +439,8 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void ChannelSelect::prepare() {
|
||||
mpLayoutFile = System::getNandManager()->readLayoutAsync(getSceneHeap(), "chanSel.ash");
|
||||
mpDiskThumbFile = System::getNandManager()->readLayoutAsync(getSceneHeap(), "diskThum.ash");
|
||||
mpLayoutFile = System::getNandManager()->readLayoutAsync(getSceneHeap(), lbl_8164DCB4);
|
||||
mpDiskThumbFile = System::getNandManager()->readLayoutAsync(getSceneHeap(), lbl_8164DCC0);
|
||||
|
||||
ChannelObj* chanObj = NULL;
|
||||
FOREACH_CHANNEL_OBJ(chanObj) {
|
||||
@@ -1044,9 +1138,9 @@ draw_ChannelSelect_L4:
|
||||
bl draw__Q33ipl6layout6ObjectFv
|
||||
lwz r3, 0x9c(r31)
|
||||
bl draw__Q33ipl6layout6ObjectFv
|
||||
lis r29, lbl_8164DCA8@ha
|
||||
lis r29, mscClockPaneNames__Q33ipl5scene13ChannelSelect@ha
|
||||
li r27, 0
|
||||
addi r29, r29, lbl_8164DCA8@l
|
||||
addi r29, r29, mscClockPaneNames__Q33ipl5scene13ChannelSelect@l
|
||||
li r30, 0
|
||||
draw_ChannelSelect_L5:
|
||||
lwz r3, 0x68(r31)
|
||||
@@ -1333,6 +1427,18 @@ draw_ChannelSelect_L6:
|
||||
mpDiskInOutLyt->finishBinding();
|
||||
}
|
||||
|
||||
extern "C" char lbl_8164DE64[] = "N_GCIcon";
|
||||
extern "C" char lbl_8164DE6D[] = "N_DiscUpdateIcon";
|
||||
extern "C" void* jumptable_8164DE80[7] = {
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x4C),
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x21C),
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x284),
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x2C8),
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x30C),
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x328),
|
||||
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x358)
|
||||
};
|
||||
|
||||
void ChannelSelect::createChannelThumbnails() {
|
||||
ChannelObj* chanObj = NULL;
|
||||
FOREACH_CHANNEL_OBJ(chanObj) {
|
||||
@@ -2616,6 +2722,11 @@ calcNormalRestart_ChannelSelect_L7:
|
||||
mpMoveLytDrop->getAnim()->initAnmFrame();
|
||||
}
|
||||
|
||||
extern "C" char lbl_8164DFCB[] = "WIPL_SE_CH_TARGETTING";
|
||||
extern "C" char lbl_8164DFE1[] = "WIPL_SE_CH_HOLD";
|
||||
extern "C" char lbl_8164DFF1[] = "WIPL_SE_CH_SET";
|
||||
extern "C" char lbl_8164E000[] = "WIPL_SE_CH_NOT_MOVE";
|
||||
|
||||
void ChannelSelect::calcNormalGrab() {
|
||||
Button* button = getButton();
|
||||
if (button != NULL && button->isActive()) {
|
||||
@@ -3079,6 +3190,9 @@ calcNormalMoveChanOut_ChannelSelect_L1:
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" char lbl_8164E024[] = "WIPL_SE_GRAY_BUTTON";
|
||||
extern "C" char lbl_8164E038[] = "WIPL_SE_DECIDE";
|
||||
|
||||
void ChannelSelectEventHandler::onEvent(u32 compId, u32 event, void* data) {
|
||||
gui::PaneComponent* component = static_cast<gui::PaneComponent*>(mpManager->getComponent(compId));
|
||||
const char* paneName = component->getPane()->GetName();
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <revolution/types.h>
|
||||
#define vu8 u8
|
||||
#include "system/iplChannelManager.h"
|
||||
#undef vu8
|
||||
#include "scene/channelTitle/iplChannelTitle.h"
|
||||
#include "scene/channelSelect/iplChannelSelect.h"
|
||||
|
||||
|
||||
@@ -84,8 +84,11 @@ namespace ipl {
|
||||
mNwc24ErrCountdown2 = 0;
|
||||
|
||||
// Text balloon for Mii face
|
||||
f32 f0 = 30.0f;
|
||||
f32 f1 = 120.0f;
|
||||
mpNigaoeBalloon =
|
||||
new TextBalloon(getSceneHeap(), mpBalloonFile, "arc", lbl_81650380, math::VEC3(0.0f, 0.0f, 0.0f), 120.0f, 30.0f);
|
||||
new TextBalloon(getSceneHeap(), mpBalloonFile, "arc", lbl_81650380,
|
||||
math::VEC3(0.0f, (f1 = 120.0f, 0.0f), (f0 = 30.0f, 0.0f)), f1, f0);
|
||||
|
||||
// Scroller
|
||||
mpScroller = new utility::YoungBScroller();
|
||||
@@ -125,6 +128,7 @@ namespace ipl {
|
||||
}
|
||||
return;
|
||||
}
|
||||
case textinput::extend::letter::InputForm::T_Reply:
|
||||
default: {
|
||||
if (mLetterType == textinput::extend::letter::InputForm::T_Reply) {
|
||||
mNwc24ErrCountdown2 = 0;
|
||||
|
||||
@@ -1,9 +1,327 @@
|
||||
#include "scene/iplSceneManager.h"
|
||||
#define IPL_SCENE_MANAGER_H
|
||||
#define IPL_BASE_SCENE_H
|
||||
#define IPL_TREE_NODE_H
|
||||
#define IPL_QUEUE_H
|
||||
|
||||
#include <decomp.h>
|
||||
#include <revolution.h>
|
||||
#include <egg/core.h>
|
||||
|
||||
#include "scene/iplSceneCreator.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace utility {
|
||||
class Tree {
|
||||
public:
|
||||
Tree();
|
||||
virtual ~Tree();
|
||||
virtual Tree* getParent();
|
||||
virtual Tree* getChild();
|
||||
virtual Tree* getNext();
|
||||
virtual Tree* getPrev();
|
||||
void attach(Tree* tree);
|
||||
void insert(Tree* tree, Tree* childTree);
|
||||
void detach();
|
||||
static Tree* empty() { return (Tree*)0; }
|
||||
|
||||
class iterator {
|
||||
typedef Tree value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef value_type& reference;
|
||||
|
||||
public:
|
||||
explicit inline iterator(pointer ptr) : mPtr(ptr) {}
|
||||
virtual reference operator*();
|
||||
pointer operator->() { return mPtr; }
|
||||
pointer getPtr() { return mPtr; }
|
||||
iterator& operator++();
|
||||
|
||||
protected:
|
||||
pointer mPtr;
|
||||
};
|
||||
|
||||
class reverse_iterator {
|
||||
typedef Tree value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef value_type& reference;
|
||||
|
||||
public:
|
||||
explicit inline reverse_iterator(pointer ptr) : mPtr(ptr) { reverse(); }
|
||||
virtual reference operator*();
|
||||
pointer operator->() { return mPtr; }
|
||||
pointer getPtr() { return mPtr; }
|
||||
void reverse();
|
||||
|
||||
protected:
|
||||
pointer mPtr;
|
||||
};
|
||||
|
||||
protected:
|
||||
Tree* mpParent;
|
||||
Tree* mpChild;
|
||||
Tree* mpNext;
|
||||
Tree* mpPrev;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class Base;
|
||||
enum {
|
||||
COMMAND_NONE = 0,
|
||||
COMMAND_CREATE_CHILD,
|
||||
COMMAND_RESERVE_CHANGE,
|
||||
COMMAND_RESERVE_ALL_DESTRUCT,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
int newSceneID;
|
||||
int prevSceneID;
|
||||
int newRootID;
|
||||
Base* parent;
|
||||
Base* child;
|
||||
void* args;
|
||||
} CommandData;
|
||||
|
||||
typedef struct Command {
|
||||
CommandData data;
|
||||
void clear();
|
||||
Command() { clear(); }
|
||||
} Command;
|
||||
|
||||
class Base : public utility::Tree, EGG::Disposer {
|
||||
public:
|
||||
Base(EGG::Heap* heap);
|
||||
virtual ~Base();
|
||||
virtual BOOL isReady() const;
|
||||
virtual BOOL isResetAcceptable() const;
|
||||
virtual void startResetting();
|
||||
virtual BOOL isResetProcessDone();
|
||||
virtual void prepare();
|
||||
virtual void create();
|
||||
virtual void calc();
|
||||
virtual void draw();
|
||||
virtual void destroy();
|
||||
virtual Base* getParent();
|
||||
virtual Base* getChild();
|
||||
virtual Base* getNext();
|
||||
virtual Base* getPrev();
|
||||
bool isSceneCreated() const { return (mScnState & SCN_STATE_CREATED); }
|
||||
|
||||
class iterator : public utility::Tree::iterator {
|
||||
typedef Base value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef value_type& reference;
|
||||
|
||||
public:
|
||||
explicit inline iterator(pointer ptr) : utility::Tree::iterator(ptr) {}
|
||||
virtual reference operator*();
|
||||
pointer operator->() { return (pointer)mPtr; }
|
||||
pointer getPtr() { return (pointer)mPtr; }
|
||||
void setPtr(pointer p) { mPtr = p; }
|
||||
};
|
||||
|
||||
class reverse_iterator : public utility::Tree::reverse_iterator {
|
||||
typedef Base value_type;
|
||||
typedef value_type* pointer;
|
||||
typedef value_type& reference;
|
||||
|
||||
public:
|
||||
explicit reverse_iterator(pointer ptr);
|
||||
virtual reference operator*();
|
||||
pointer operator->() { return (pointer)mPtr; }
|
||||
pointer getPtr() { return (pointer)mPtr; }
|
||||
void setPtr(pointer p) { mPtr = p; }
|
||||
};
|
||||
|
||||
private:
|
||||
enum {
|
||||
SCN_STATE_CREATED = (1 << 0),
|
||||
SCN_STATE_DESTROY_REQ = (1 << 1),
|
||||
};
|
||||
|
||||
void do_prepare();
|
||||
void do_create();
|
||||
void do_calc();
|
||||
void do_draw();
|
||||
void do_destroy();
|
||||
|
||||
EGG::Heap* mpHeap;
|
||||
u32 mParentFlags;
|
||||
u32 mScnState;
|
||||
int mSceneID;
|
||||
u32 mPrevSceneID;
|
||||
Command mCommand;
|
||||
|
||||
protected:
|
||||
enum {
|
||||
SCN_PARENTFLAG_CALC = (1 << 0),
|
||||
SCN_PARENTFLAG_DRAW = (1 << 1),
|
||||
};
|
||||
|
||||
void createChildScene(int sceneId, Base* parent, Base* child, void* args = NULL);
|
||||
void reserveSceneChange(int sceneId, void* args = NULL);
|
||||
void reserveAllSceneDestruction(int sceneId, void* args = NULL);
|
||||
void setSceneParentFlags(u32 flag) { mParentFlags = flag; }
|
||||
void requestSceneDestruction() { mScnState |= SCN_STATE_DESTROY_REQ; }
|
||||
EGG::Heap* getSceneHeap() { return mpHeap; }
|
||||
int getSceneID() const { return mSceneID; }
|
||||
u32 getPrevSceneID() const { return mPrevSceneID; }
|
||||
|
||||
friend class Manager;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace ipl {
|
||||
namespace utility {
|
||||
template <typename T, int c>
|
||||
class Queue {
|
||||
public:
|
||||
inline Queue() : count(c), current(0), popped(0), pushed(0) {}
|
||||
|
||||
BOOL push(const T& item) {
|
||||
if (count == current) {
|
||||
return FALSE;
|
||||
}
|
||||
items[pushed] = item;
|
||||
if (++pushed >= count) {
|
||||
pushed = 0;
|
||||
}
|
||||
current++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL pop() {
|
||||
BOOL result = TRUE;
|
||||
if (current == 0) {
|
||||
result = FALSE;
|
||||
goto done;
|
||||
}
|
||||
if (++popped >= count) {
|
||||
popped = 0;
|
||||
}
|
||||
current--;
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
|
||||
int get_current_index() { return current; }
|
||||
T& get_current_item() { return items[get_current_index()]; }
|
||||
int get_popped_index() { return popped; }
|
||||
T& get_popped_item() { return items[get_popped_index()]; }
|
||||
void next_popped_item() { popped++; }
|
||||
void no_popped_item() { popped = 0; }
|
||||
int get_pushed_index() { return pushed; }
|
||||
T& get_pushed_item() { return items[get_pushed_index()]; }
|
||||
|
||||
T items[c];
|
||||
int count;
|
||||
int current;
|
||||
int popped, pushed;
|
||||
};
|
||||
|
||||
template <>
|
||||
class Queue<ipl::scene::Command, 8> {
|
||||
public:
|
||||
inline Queue() : count(8), current(0), popped(0), pushed(0) {}
|
||||
|
||||
BOOL push(const ipl::scene::Command& item) {
|
||||
if (count == current) {
|
||||
return FALSE;
|
||||
}
|
||||
items[pushed] = item;
|
||||
if (++pushed >= count) {
|
||||
pushed = 0;
|
||||
}
|
||||
current++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL pop();
|
||||
int get_current_index() { return current; }
|
||||
ipl::scene::Command& get_current_item() { return items[get_current_index()]; }
|
||||
int get_popped_index() { return popped; }
|
||||
ipl::scene::Command& get_popped_item() { return items[get_popped_index()]; }
|
||||
void next_popped_item() { popped++; }
|
||||
void no_popped_item() { popped = 0; }
|
||||
int get_pushed_index() { return pushed; }
|
||||
ipl::scene::Command& get_pushed_item() { return items[get_pushed_index()]; }
|
||||
|
||||
ipl::scene::Command items[8];
|
||||
int count;
|
||||
int current;
|
||||
int popped, pushed;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
enum {
|
||||
DRAW_LAYER_1 = 0,
|
||||
DRAW_LAYER_2,
|
||||
DRAW_LAYER_DEFAULT = DRAW_LAYER_2,
|
||||
DRAW_LAYER_3,
|
||||
DRAW_LAYER_MAX,
|
||||
};
|
||||
|
||||
#define MAX_COMMANDS 8
|
||||
typedef utility::Queue<Command, MAX_COMMANDS> CommandList;
|
||||
|
||||
class Manager {
|
||||
public:
|
||||
Manager(EGG::Heap* heap);
|
||||
void init();
|
||||
void calc();
|
||||
void calc(SceneObj* scene);
|
||||
void draw();
|
||||
void draw(SceneObj* scene);
|
||||
SceneObj* createScene(int sceneId, int prevSceneId, void* args);
|
||||
SceneObj* createScene(int sceneId, void* args) { return createScene(sceneId, SCENE_NONE, args); }
|
||||
void createScene(const Command& command);
|
||||
void destroyScene(SceneObj* scene);
|
||||
void detach(SceneObj* scene);
|
||||
void startResetting();
|
||||
BOOL isResetProcessDone();
|
||||
BOOL isResetAcceptable();
|
||||
BOOL pushCommand(const Command& pCommand);
|
||||
void setDestructSync();
|
||||
void doDestructSync() { mbDestroySyncTask = true; }
|
||||
SceneObj* getScene(int sceneId);
|
||||
SceneObj* getScene(int sceneId, SceneObj* obj);
|
||||
bool onDefaultDrawLayer() { return mDrawLayer == DRAW_LAYER_2; }
|
||||
bool onDrawLayer(int layer) { return mDrawLayer == layer; }
|
||||
void attachReservedScene();
|
||||
BOOL isReady(int sceneId);
|
||||
SceneObj* getReservedScene() { return mpReservedScene; }
|
||||
int getCurrentRootSceneID() { return mRootSceneID; }
|
||||
int getPreviousRootSceneID() { return mPrevRootSceneID; }
|
||||
|
||||
private:
|
||||
void createRootScene(int sceneId, void* args);
|
||||
|
||||
EGG::UnitHeap* mpBigSceneHeap;
|
||||
EGG::UnitHeap* mpMdmSceneHeap;
|
||||
EGG::UnitHeap* mpSmlSceneHeap;
|
||||
SceneObj* mpRootScene;
|
||||
CommandList mCommands;
|
||||
int mDrawLayer;
|
||||
SceneObj* mpReservedScene;
|
||||
Command mReservedCommand;
|
||||
bool mbCreatedReserved;
|
||||
bool mbDestroySyncTask;
|
||||
int mRootSceneID;
|
||||
int mPrevRootSceneID;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#define SCENE_CLASS(x) class x : public scene::Base
|
||||
#include "scene/iplRootScene.h"
|
||||
|
||||
#include "iplSystem.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace ipl {
|
||||
@@ -97,6 +415,33 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
Base& Base::iterator::operator*() {
|
||||
return *(Base*)mPtr;
|
||||
}
|
||||
}
|
||||
|
||||
namespace utility {
|
||||
Tree::iterator& Tree::iterator::operator++() {
|
||||
if (mPtr->getChild()) {
|
||||
mPtr = mPtr->getChild();
|
||||
} else {
|
||||
if (mPtr->getNext()) {
|
||||
mPtr = mPtr->getNext();
|
||||
} else {
|
||||
while ((mPtr = mPtr->getParent())) {
|
||||
if (!mPtr->getNext()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mPtr = mPtr->getNext();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace scene {
|
||||
void Manager::draw() {
|
||||
mDrawLayer = DRAW_LAYER_1;
|
||||
while (mDrawLayer < DRAW_LAYER_MAX) {
|
||||
@@ -165,6 +510,25 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
Base::reverse_iterator::reverse_iterator(Base* ptr) : utility::Tree::reverse_iterator(ptr) {}
|
||||
}
|
||||
|
||||
namespace utility {
|
||||
void Tree::reverse_iterator::reverse() {
|
||||
while (mPtr->getChild()) {
|
||||
mPtr = mPtr->getChild();
|
||||
while (mPtr->getNext()) {
|
||||
mPtr = mPtr->getNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace scene {
|
||||
Base& Base::reverse_iterator::operator*() {
|
||||
return *(Base*)mPtr;
|
||||
}
|
||||
|
||||
void Manager::createScene(const Command& command) {
|
||||
mpReservedScene = createScene(command.data.newSceneID, command.data.prevSceneID, command.data.args);
|
||||
mReservedCommand = command;
|
||||
@@ -278,4 +642,24 @@ namespace ipl {
|
||||
return found;
|
||||
}
|
||||
} // namespace scene
|
||||
|
||||
namespace utility {
|
||||
Tree& Tree::reverse_iterator::operator*() {
|
||||
return *mPtr;
|
||||
}
|
||||
|
||||
BOOL Queue<scene::Command, 8>::pop() {
|
||||
BOOL result = TRUE;
|
||||
if (current == 0) {
|
||||
result = FALSE;
|
||||
goto done;
|
||||
}
|
||||
if (++popped >= count) {
|
||||
popped = 0;
|
||||
}
|
||||
current--;
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace ipl
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#include <revolution/gx/GXStruct.h>
|
||||
#include <revolution/os/OSError.h>
|
||||
|
||||
extern "C" const unsigned char lbl_8169622C;
|
||||
extern "C" const unsigned char lbl_8169622D;
|
||||
extern "C" const unsigned char lbl_8169622E;
|
||||
extern "C" const unsigned char lbl_8169622F;
|
||||
extern "C" const char lbl_81639230[65];
|
||||
|
||||
#define NW4R_DB_ASSERT_H
|
||||
#define NW4R_ASSERT(x) \
|
||||
{ \
|
||||
if (!(x)) { \
|
||||
GXColor front = {*((volatile const unsigned char*)&lbl_8169622C), *((volatile const unsigned char*)&lbl_8169622D), *((volatile const unsigned char*)&lbl_8169622E), *((volatile const unsigned char*)&lbl_8169622F)}; \
|
||||
GXColor back = {0, 0, 0, 0}; \
|
||||
OSFatal((GXColor)front, (GXColor)back, lbl_81639230); \
|
||||
} \
|
||||
}
|
||||
|
||||
#include "scene/channelSelect/iplChannelSelect.h"
|
||||
#include "scene/channelTitle/iplChannelTitle.h"
|
||||
|
||||
@@ -306,3 +325,16 @@ __declspec(export) void IplRso_symbolMaker() {
|
||||
wideTextWriter->CalcStringRect(&rect, L"", 0);
|
||||
wideTextWriter->CalcStringRect(&rect, L"");
|
||||
}
|
||||
|
||||
extern "C" __declspec(section ".sdata") const unsigned char lbl_8169622C = 255;
|
||||
extern "C" __declspec(section ".sdata") const unsigned char lbl_8169622D = 255;
|
||||
extern "C" __declspec(section ".sdata") const unsigned char lbl_8169622E = 255;
|
||||
extern "C" __declspec(section ".sdata") const unsigned char lbl_8169622F = 0;
|
||||
|
||||
extern "C" __declspec(section ".data") const char lbl_81639230[65] = "Error#004\nAn error has occurred.\nThe system files are corrupted.";
|
||||
|
||||
extern "C" __declspec(section ".data") __declspec(align(1)) const f32 rso_data_pad_f32 = 0.0f;
|
||||
extern "C" __declspec(section ".data") __declspec(align(1)) const u16 rso_data_pad_u16 = 0;
|
||||
extern "C" __declspec(section ".data") __declspec(align(1)) const u8 rso_data_pad_u8 = 0;
|
||||
|
||||
extern "C" __declspec(section ".sdata2") const f32 lbl_81694598 = 0.0f;
|
||||
|
||||
@@ -51,12 +51,20 @@ extern "C" void __div2i();
|
||||
extern "C" void __FTVRCLoop0Handler__7LibTVRCFP7OSAlarmP9OSContext();
|
||||
extern "C" void __FTVRCLoop1Handler__7LibTVRCFP7OSAlarmP9OSContext();
|
||||
|
||||
#pragma push
|
||||
#pragma section data_type ".sdata"
|
||||
extern "C" char lbl_81696230[5] = {'T', 'V', 'R', '0', '\0'};
|
||||
#pragma pop
|
||||
|
||||
namespace LibTVRC {
|
||||
const char* TVRC_FILE_HEADER = "TVR0";
|
||||
const char* TVRC_FILE_HEADER = lbl_81696230;
|
||||
u32 __tienHoseiNsec = 1100;
|
||||
u32 _limitMilli = 400;
|
||||
|
||||
ARCHandle _database ALIGN32;
|
||||
struct TVRCHandle : ARCHandle {
|
||||
u8 _padding[4];
|
||||
};
|
||||
TVRCHandle _database;
|
||||
OSAlarm _alarm;
|
||||
|
||||
BOOL _isRepeatActive;
|
||||
@@ -106,7 +114,7 @@ namespace LibTVRC {
|
||||
u32 _repeatBitLength;
|
||||
u32 _repeatBitArray;
|
||||
|
||||
OSTime _tickT;
|
||||
u32 _tickT;
|
||||
OSTime _tickWait[2];
|
||||
|
||||
void __FTVRCLoop0Handler(OSAlarm *alarm, OSContext *ctx);
|
||||
|
||||
@@ -14,17 +14,337 @@
|
||||
#include "system/iplSystem.h"
|
||||
|
||||
const f32 lbl_8160D2C0[] = {0.2, 0.3, 0, 0};
|
||||
extern const f32 lbl_81694450;
|
||||
extern "C" void __ct__Q34nw4r2ut4RectFv();
|
||||
typedef void (*ControllerDataFunction)();
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" unsigned int const lbl_816346A8[3] = {0, 0x14, 0};
|
||||
extern "C" unsigned int const lbl_816346B4[3] = {0, 0x18, 0};
|
||||
extern "C" unsigned int const lbl_816346C0[3] = {0, 0x1c, 0};
|
||||
extern "C" unsigned int const lbl_816346CC[3] = {0, 0x30, 0};
|
||||
extern "C" void __dt__Q33ipl10controller6MasterFv();
|
||||
extern "C" void getType__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getChannel__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void down__Q33ipl10controller6MasterCFUl();
|
||||
extern "C" void downTrg__Q33ipl10controller6MasterCFUl();
|
||||
extern "C" void upTrg__Q33ipl10controller6MasterCFUl();
|
||||
extern "C" void pinch__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void pinchTrg__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void pinchOffTrg__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void decide__Q33ipl10controller6MasterCFv();
|
||||
extern "C" void repeat__Q33ipl10controller6MasterCFUl();
|
||||
extern "C" void rumble__Q33ipl10controller9InterfaceFi();
|
||||
extern "C" void cancelRumbling__Q33ipl10controller9InterfaceFv();
|
||||
extern "C" void getHoldFlag__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getTrigFlag__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getReleaseFlag__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getClassicHoldFlag__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getClassicTrigFlag__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getClassicReleaseFlag__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getDpdPos__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getDpdProjectionPos__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getHorizon__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getDpdDistance__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getKPADStatus__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getPADStatus__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void isValidBtn__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void isValidDpd__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void setForceInvalid__Q33ipl10controller6MasterFb();
|
||||
extern "C" void setForceInvalid__Q33ipl10controller4BaseFb();
|
||||
extern "C" void getMainStickX__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getMainStickY__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getSubStickX__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void getSubStickY__Q33ipl10controller9InterfaceCFv();
|
||||
extern "C" void read__Q33ipl10controller9InterfaceFv();
|
||||
extern "C" void __dt__Q33ipl10controller7ClassicFv();
|
||||
extern "C" void getType__Q33ipl10controller4BaseCFv();
|
||||
extern "C" void getChannel__Q33ipl10controller4BaseCFv();
|
||||
extern "C" void down__Q33ipl10controller7ClassicCFUl();
|
||||
extern "C" void downTrg__Q33ipl10controller7ClassicCFUl();
|
||||
extern "C" void upTrg__Q33ipl10controller7ClassicCFUl();
|
||||
extern "C" void pinch__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void pinchTrg__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void pinchOffTrg__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void decide__Q33ipl10controller4BaseCFv();
|
||||
extern "C" void repeat__Q33ipl10controller10RevolutionCFUl();
|
||||
extern "C" void rumble__Q33ipl10controller4BaseFi();
|
||||
extern "C" void cancelRumbling__Q33ipl10controller4BaseFv();
|
||||
extern "C" void getHoldFlag__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getTrigFlag__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getReleaseFlag__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getClassicHoldFlag__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void getClassicTrigFlag__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void getClassicReleaseFlag__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void getDpdPos__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void getDpdProjectionPos__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void getHorizon__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void getDpdDistance__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getKPADStatus__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void isValidBtn__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void isValidDpd__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void read__Q33ipl10controller7ClassicFv();
|
||||
extern "C" void isValidDpdClassic__Q33ipl10controller7ClassicCFv();
|
||||
extern "C" void __dt__Q33ipl10controller10RevolutionFv();
|
||||
extern "C" void down__Q33ipl10controller10RevolutionCFUl();
|
||||
extern "C" void downTrg__Q33ipl10controller10RevolutionCFUl();
|
||||
extern "C" void upTrg__Q33ipl10controller10RevolutionCFUl();
|
||||
extern "C" void getDpdPos__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getDpdProjectionPos__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getHorizon__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void isValidDpd__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void read__Q33ipl10controller10RevolutionFv();
|
||||
extern "C" void __dt__Q33ipl10controller4BaseFv();
|
||||
extern "C" void down__Q33ipl10controller9InterfaceCFUl();
|
||||
extern "C" void downTrg__Q33ipl10controller9InterfaceCFUl();
|
||||
extern "C" void upTrg__Q33ipl10controller9InterfaceCFUl();
|
||||
extern "C" void repeat__Q33ipl10controller9InterfaceCFUl();
|
||||
extern "C" void read__Q33ipl10controller4BaseFv();
|
||||
extern "C" void __dt__Q33ipl10controller9FreeStyleFv();
|
||||
extern "C" void __dt__Q33ipl10controller4CoreFv();
|
||||
extern "C" ControllerDataFunction const __vt__Q33ipl10controller6Master[35] = {
|
||||
0,
|
||||
0,
|
||||
__dt__Q33ipl10controller6MasterFv,
|
||||
getType__Q33ipl10controller9InterfaceCFv,
|
||||
getChannel__Q33ipl10controller9InterfaceCFv,
|
||||
down__Q33ipl10controller6MasterCFUl,
|
||||
downTrg__Q33ipl10controller6MasterCFUl,
|
||||
upTrg__Q33ipl10controller6MasterCFUl,
|
||||
pinch__Q33ipl10controller9InterfaceCFv,
|
||||
pinchTrg__Q33ipl10controller9InterfaceCFv,
|
||||
pinchOffTrg__Q33ipl10controller9InterfaceCFv,
|
||||
decide__Q33ipl10controller6MasterCFv,
|
||||
repeat__Q33ipl10controller6MasterCFUl,
|
||||
rumble__Q33ipl10controller9InterfaceFi,
|
||||
cancelRumbling__Q33ipl10controller9InterfaceFv,
|
||||
getHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdPos__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdProjectionPos__Q33ipl10controller9InterfaceCFv,
|
||||
getHorizon__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdDistance__Q33ipl10controller9InterfaceCFv,
|
||||
getKPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
getPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
isValidBtn__Q33ipl10controller9InterfaceCFv,
|
||||
isValidDpd__Q33ipl10controller9InterfaceCFv,
|
||||
setForceInvalid__Q33ipl10controller6MasterFb,
|
||||
getMainStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getMainStickY__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickY__Q33ipl10controller9InterfaceCFv,
|
||||
read__Q33ipl10controller9InterfaceFv,
|
||||
};
|
||||
extern "C" ControllerDataFunction const __vt__Q33ipl10controller7Classic[36] = {
|
||||
0,
|
||||
0,
|
||||
__dt__Q33ipl10controller7ClassicFv,
|
||||
getType__Q33ipl10controller4BaseCFv,
|
||||
getChannel__Q33ipl10controller4BaseCFv,
|
||||
down__Q33ipl10controller7ClassicCFUl,
|
||||
downTrg__Q33ipl10controller7ClassicCFUl,
|
||||
upTrg__Q33ipl10controller7ClassicCFUl,
|
||||
pinch__Q33ipl10controller10RevolutionCFv,
|
||||
pinchTrg__Q33ipl10controller10RevolutionCFv,
|
||||
pinchOffTrg__Q33ipl10controller10RevolutionCFv,
|
||||
decide__Q33ipl10controller4BaseCFv,
|
||||
repeat__Q33ipl10controller10RevolutionCFUl,
|
||||
rumble__Q33ipl10controller4BaseFi,
|
||||
cancelRumbling__Q33ipl10controller4BaseFv,
|
||||
getHoldFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getTrigFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getReleaseFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getClassicHoldFlag__Q33ipl10controller7ClassicCFv,
|
||||
getClassicTrigFlag__Q33ipl10controller7ClassicCFv,
|
||||
getClassicReleaseFlag__Q33ipl10controller7ClassicCFv,
|
||||
getDpdPos__Q33ipl10controller7ClassicCFv,
|
||||
getDpdProjectionPos__Q33ipl10controller7ClassicCFv,
|
||||
getHorizon__Q33ipl10controller7ClassicCFv,
|
||||
getDpdDistance__Q33ipl10controller10RevolutionCFv,
|
||||
getKPADStatus__Q33ipl10controller10RevolutionCFv,
|
||||
getPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
isValidBtn__Q33ipl10controller10RevolutionCFv,
|
||||
isValidDpd__Q33ipl10controller7ClassicCFv,
|
||||
setForceInvalid__Q33ipl10controller4BaseFb,
|
||||
getMainStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getMainStickY__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickY__Q33ipl10controller9InterfaceCFv,
|
||||
read__Q33ipl10controller7ClassicFv,
|
||||
isValidDpdClassic__Q33ipl10controller7ClassicCFv,
|
||||
};
|
||||
extern "C" ControllerDataFunction const __vt__Q33ipl10controller10Revolution[35] = {
|
||||
0,
|
||||
0,
|
||||
__dt__Q33ipl10controller10RevolutionFv,
|
||||
getType__Q33ipl10controller4BaseCFv,
|
||||
getChannel__Q33ipl10controller4BaseCFv,
|
||||
down__Q33ipl10controller10RevolutionCFUl,
|
||||
downTrg__Q33ipl10controller10RevolutionCFUl,
|
||||
upTrg__Q33ipl10controller10RevolutionCFUl,
|
||||
pinch__Q33ipl10controller10RevolutionCFv,
|
||||
pinchTrg__Q33ipl10controller10RevolutionCFv,
|
||||
pinchOffTrg__Q33ipl10controller10RevolutionCFv,
|
||||
decide__Q33ipl10controller4BaseCFv,
|
||||
repeat__Q33ipl10controller10RevolutionCFUl,
|
||||
rumble__Q33ipl10controller4BaseFi,
|
||||
cancelRumbling__Q33ipl10controller4BaseFv,
|
||||
getHoldFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getTrigFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getReleaseFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getClassicHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdPos__Q33ipl10controller10RevolutionCFv,
|
||||
getDpdProjectionPos__Q33ipl10controller10RevolutionCFv,
|
||||
getHorizon__Q33ipl10controller10RevolutionCFv,
|
||||
getDpdDistance__Q33ipl10controller10RevolutionCFv,
|
||||
getKPADStatus__Q33ipl10controller10RevolutionCFv,
|
||||
getPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
isValidBtn__Q33ipl10controller10RevolutionCFv,
|
||||
isValidDpd__Q33ipl10controller10RevolutionCFv,
|
||||
setForceInvalid__Q33ipl10controller4BaseFb,
|
||||
getMainStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getMainStickY__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickY__Q33ipl10controller9InterfaceCFv,
|
||||
read__Q33ipl10controller10RevolutionFv,
|
||||
};
|
||||
extern "C" ControllerDataFunction const __vt__Q33ipl10controller4Base[36] = {
|
||||
0,
|
||||
0,
|
||||
__dt__Q33ipl10controller4BaseFv,
|
||||
getType__Q33ipl10controller4BaseCFv,
|
||||
getChannel__Q33ipl10controller4BaseCFv,
|
||||
down__Q33ipl10controller9InterfaceCFUl,
|
||||
downTrg__Q33ipl10controller9InterfaceCFUl,
|
||||
upTrg__Q33ipl10controller9InterfaceCFUl,
|
||||
pinch__Q33ipl10controller9InterfaceCFv,
|
||||
pinchTrg__Q33ipl10controller9InterfaceCFv,
|
||||
pinchOffTrg__Q33ipl10controller9InterfaceCFv,
|
||||
decide__Q33ipl10controller4BaseCFv,
|
||||
repeat__Q33ipl10controller9InterfaceCFUl,
|
||||
rumble__Q33ipl10controller4BaseFi,
|
||||
cancelRumbling__Q33ipl10controller4BaseFv,
|
||||
getHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdPos__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdProjectionPos__Q33ipl10controller9InterfaceCFv,
|
||||
getHorizon__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdDistance__Q33ipl10controller9InterfaceCFv,
|
||||
getKPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
getPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
isValidBtn__Q33ipl10controller9InterfaceCFv,
|
||||
isValidDpd__Q33ipl10controller9InterfaceCFv,
|
||||
setForceInvalid__Q33ipl10controller4BaseFb,
|
||||
getMainStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getMainStickY__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickY__Q33ipl10controller9InterfaceCFv,
|
||||
read__Q33ipl10controller4BaseFv,
|
||||
0,
|
||||
};
|
||||
extern "C" ControllerDataFunction const __vt__Q33ipl10controller9FreeStyle[35] = {
|
||||
0,
|
||||
0,
|
||||
__dt__Q33ipl10controller9FreeStyleFv,
|
||||
getType__Q33ipl10controller4BaseCFv,
|
||||
getChannel__Q33ipl10controller4BaseCFv,
|
||||
down__Q33ipl10controller10RevolutionCFUl,
|
||||
downTrg__Q33ipl10controller10RevolutionCFUl,
|
||||
upTrg__Q33ipl10controller10RevolutionCFUl,
|
||||
pinch__Q33ipl10controller10RevolutionCFv,
|
||||
pinchTrg__Q33ipl10controller10RevolutionCFv,
|
||||
pinchOffTrg__Q33ipl10controller10RevolutionCFv,
|
||||
decide__Q33ipl10controller4BaseCFv,
|
||||
repeat__Q33ipl10controller10RevolutionCFUl,
|
||||
rumble__Q33ipl10controller4BaseFi,
|
||||
cancelRumbling__Q33ipl10controller4BaseFv,
|
||||
getHoldFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getTrigFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getReleaseFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getClassicHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdPos__Q33ipl10controller10RevolutionCFv,
|
||||
getDpdProjectionPos__Q33ipl10controller10RevolutionCFv,
|
||||
getHorizon__Q33ipl10controller10RevolutionCFv,
|
||||
getDpdDistance__Q33ipl10controller10RevolutionCFv,
|
||||
getKPADStatus__Q33ipl10controller10RevolutionCFv,
|
||||
getPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
isValidBtn__Q33ipl10controller10RevolutionCFv,
|
||||
isValidDpd__Q33ipl10controller10RevolutionCFv,
|
||||
setForceInvalid__Q33ipl10controller4BaseFb,
|
||||
getMainStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getMainStickY__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickY__Q33ipl10controller9InterfaceCFv,
|
||||
read__Q33ipl10controller10RevolutionFv,
|
||||
};
|
||||
extern "C" ControllerDataFunction const __vt__Q33ipl10controller4Core[35] = {
|
||||
0,
|
||||
0,
|
||||
__dt__Q33ipl10controller4CoreFv,
|
||||
getType__Q33ipl10controller4BaseCFv,
|
||||
getChannel__Q33ipl10controller4BaseCFv,
|
||||
down__Q33ipl10controller10RevolutionCFUl,
|
||||
downTrg__Q33ipl10controller10RevolutionCFUl,
|
||||
upTrg__Q33ipl10controller10RevolutionCFUl,
|
||||
pinch__Q33ipl10controller10RevolutionCFv,
|
||||
pinchTrg__Q33ipl10controller10RevolutionCFv,
|
||||
pinchOffTrg__Q33ipl10controller10RevolutionCFv,
|
||||
decide__Q33ipl10controller4BaseCFv,
|
||||
repeat__Q33ipl10controller10RevolutionCFUl,
|
||||
rumble__Q33ipl10controller4BaseFi,
|
||||
cancelRumbling__Q33ipl10controller4BaseFv,
|
||||
getHoldFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getTrigFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getReleaseFlag__Q33ipl10controller10RevolutionCFv,
|
||||
getClassicHoldFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicTrigFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getClassicReleaseFlag__Q33ipl10controller9InterfaceCFv,
|
||||
getDpdPos__Q33ipl10controller10RevolutionCFv,
|
||||
getDpdProjectionPos__Q33ipl10controller10RevolutionCFv,
|
||||
getHorizon__Q33ipl10controller10RevolutionCFv,
|
||||
getDpdDistance__Q33ipl10controller10RevolutionCFv,
|
||||
getKPADStatus__Q33ipl10controller10RevolutionCFv,
|
||||
getPADStatus__Q33ipl10controller9InterfaceCFv,
|
||||
isValidBtn__Q33ipl10controller10RevolutionCFv,
|
||||
isValidDpd__Q33ipl10controller10RevolutionCFv,
|
||||
setForceInvalid__Q33ipl10controller4BaseFb,
|
||||
getMainStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getMainStickY__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickX__Q33ipl10controller9InterfaceCFv,
|
||||
getSubStickY__Q33ipl10controller9InterfaceCFv,
|
||||
read__Q33ipl10controller10RevolutionFv,
|
||||
};
|
||||
#pragma pop
|
||||
extern const f32 lbl_81694440 = 1000.0f;
|
||||
extern const f32 lbl_81694444 = 0.058333333f;
|
||||
extern const f64 lbl_81694448 = 4503599627370496.0;
|
||||
extern const f32 lbl_81694450 = 1.0f / 0.0f;
|
||||
extern const f32 lbl_81694454 = 0.0f;
|
||||
extern const f32 lbl_81694458;
|
||||
extern const f32 lbl_8169445C;
|
||||
extern const f32 lbl_81694460;
|
||||
extern const f32 lbl_81694478;
|
||||
extern const f32 lbl_8169447C;
|
||||
extern const f32 lbl_81694480;
|
||||
extern const f32 lbl_81694484;
|
||||
extern const f32 lbl_81694488;
|
||||
extern const f32 lbl_8169448C;
|
||||
extern const f32 lbl_81694458 = 1.10132003f;
|
||||
extern const f32 lbl_8169445C = 1.15f;
|
||||
extern const f32 lbl_81694460 = 100.0f;
|
||||
extern const f32 lbl_81694464 = 0.01f;
|
||||
extern const f32 lbl_81694468 = 0.0036f;
|
||||
extern const f32 lbl_8169446C = 0.05f;
|
||||
extern const f32 lbl_81694470 = 1.0f;
|
||||
extern const f32 lbl_81694474 = -0.2679492f;
|
||||
extern const f32 lbl_81694478 = 0.5f;
|
||||
extern const f32 lbl_8169447C = 0.1f;
|
||||
extern const f32 lbl_81694480 = 0.2f;
|
||||
extern const f32 lbl_81694484 = -0.2f;
|
||||
extern const f32 lbl_81694488 = 0.05f;
|
||||
extern const f32 lbl_8169448C = 1.0f;
|
||||
extern "C" void* mpBuf__Q33ipl10controller7Manager = 0;
|
||||
extern "C" void* mpParentHeap__Q33ipl10controller7Manager = 0;
|
||||
extern "C" void* mpHeap__Q33ipl10controller7Manager = 0;
|
||||
@@ -42,16 +362,11 @@ extern "C" void _restgpr_28();
|
||||
extern "C" void __ptmf_scall();
|
||||
extern "C" void __ct__Q33ipl4math4VEC2Fff();
|
||||
extern "C" void set__Q33ipl4math4VEC2Fff();
|
||||
extern "C" void __vt__Q33ipl10controller4Base();
|
||||
extern "C" void __vt__Q33ipl10controller10Revolution();
|
||||
extern "C" void __dt__Q33ipl10controller10RevolutionFv();
|
||||
extern "C" void read__Q33ipl10controller4BaseFv();
|
||||
extern "C" void isValidDpd__Q33ipl10controller10RevolutionCFv();
|
||||
extern "C" void getProjectionRect__Q23ipl6SystemFPQ34nw4r2ut4Rect();
|
||||
extern "C" void __as__Q33ipl4math4VEC2FRCQ33ipl4math4VEC2();
|
||||
extern "C" void __vt__Q33ipl10controller6Master();
|
||||
extern "C" void __vt__Q33ipl10controller4Core();
|
||||
extern "C" void __vt__Q33ipl10controller9FreeStyle();
|
||||
extern "C" void __ct__Q33ipl10controller10RevolutionFiiR10KPADStatus();
|
||||
extern "C" void __ct__Q33ipl10controller7ClassicFiR10KPADStatus();
|
||||
extern "C" asm void alloc__Q33ipl10controller7ManagerFUl();
|
||||
@@ -624,8 +939,8 @@ namespace ipl {
|
||||
case 0:
|
||||
case 1: {
|
||||
u32 time = OSTicksToMilliseconds(OSGetTick() - mLastRumbleTime);
|
||||
f32 f1 = (f32)time / 1000.0f;
|
||||
if (f1 < 7.0f / 120.0f) {
|
||||
f32 f1 = (f32)time / lbl_81694440;
|
||||
if (f1 < lbl_81694444) {
|
||||
WPADControlMotor(mChan, 1);
|
||||
} else if (f1 < lbl_8160D2C0[mRumbleType]) {
|
||||
WPADControlMotor(mChan, 0);
|
||||
@@ -642,7 +957,7 @@ namespace ipl {
|
||||
}
|
||||
case 2: {
|
||||
u32 time = OSTicksToMilliseconds(OSGetTick() - mLastRumbleTime);
|
||||
f32 f1 = (f32)time / 1000.0f;
|
||||
f32 f1 = (f32)time / lbl_81694440;
|
||||
if (f1 < lbl_8160D2C0[1]) {
|
||||
WPADControlMotor(mChan, 0);
|
||||
} else if (getKPADStatus() == NULL || getKPADStatus()->wpad_err == 0) {
|
||||
@@ -1353,21 +1668,21 @@ namespace ipl {
|
||||
kpad_rect.right = nw4r_rect.right;
|
||||
kpad_rect.bottom = nw4r_rect.bottom;
|
||||
|
||||
KPADGetProjectionPos(&dest, &src, &kpad_rect, 1.10132f);
|
||||
KPADGetProjectionPos(&dest, &src, &kpad_rect, lbl_81694458);
|
||||
if (SCGetAspectRatio() == 1) {
|
||||
dest.x *= 1.15f;
|
||||
dest.y *= 1.15f;
|
||||
dest.x *= lbl_8169445C;
|
||||
dest.y *= lbl_8169445C;
|
||||
}
|
||||
|
||||
// regswap
|
||||
if (nw4r_rect.left - 100.0f > dest.x) {
|
||||
dest.x = nw4r_rect.left - 100.0f;
|
||||
} else if (nw4r_rect.right + 100.0f < dest.x) {
|
||||
dest.x = nw4r_rect.right + 100.0f;
|
||||
} else if (nw4r_rect.top - 100.0f > dest.y) {
|
||||
dest.y = nw4r_rect.top - 100.0f;
|
||||
} else if (nw4r_rect.bottom + 100.0f < dest.y) {
|
||||
dest.y = nw4r_rect.bottom + 100.0f;
|
||||
if (nw4r_rect.left - lbl_81694460 > dest.x) {
|
||||
dest.x = nw4r_rect.left - lbl_81694460;
|
||||
} else if (nw4r_rect.right + lbl_81694460 < dest.x) {
|
||||
dest.x = nw4r_rect.right + lbl_81694460;
|
||||
} else if (nw4r_rect.top - lbl_81694460 > dest.y) {
|
||||
dest.y = nw4r_rect.top - lbl_81694460;
|
||||
} else if (nw4r_rect.bottom + lbl_81694460 < dest.y) {
|
||||
dest.y = nw4r_rect.bottom + lbl_81694460;
|
||||
}
|
||||
// //
|
||||
|
||||
@@ -1377,8 +1692,8 @@ namespace ipl {
|
||||
}
|
||||
|
||||
Classic::Classic(int arg0, KPADStatus& arg1) : Revolution(arg0, arg1) {
|
||||
unk_0x24.x = 0.01f;
|
||||
unk_0x24.y = 0.01f;
|
||||
unk_0x24.x = lbl_81694464;
|
||||
unk_0x24.y = lbl_81694464;
|
||||
unk_0x2C = 0;
|
||||
}
|
||||
|
||||
@@ -1395,14 +1710,14 @@ namespace ipl {
|
||||
if (!Revolution::isValidDpd()) {
|
||||
math::VEC2 lstick(unk_0x20->ex_status.cl.lstick.x, unk_0x20->ex_status.cl.lstick.y);
|
||||
|
||||
if (lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f) {
|
||||
unk_0x24.x = math::abs_clamp(unk_0x24.x + unk_0x20->ex_status.cl.lstick.x * 0.05f, 1.8f);
|
||||
unk_0x24.y = math::abs_clamp(unk_0x24.y - unk_0x20->ex_status.cl.lstick.y * 0.05f, 1.2f);
|
||||
if (lstick.x * lstick.x + lstick.y * lstick.y > lbl_81694468) {
|
||||
unk_0x24.x = math::abs_clamp(unk_0x24.x + unk_0x20->ex_status.cl.lstick.x * lbl_8169446C, 1.8f);
|
||||
unk_0x24.y = math::abs_clamp(unk_0x24.y - unk_0x20->ex_status.cl.lstick.y * lbl_8169446C, 1.2f);
|
||||
}
|
||||
|
||||
math::VEC2 rstick = math::VEC2(unk_0x20->ex_status.cl.rstick.x, unk_0x20->ex_status.cl.rstick.y);
|
||||
if (getClassicHoldFlag() != 0 || lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f ||
|
||||
rstick.x * rstick.x + rstick.y * rstick.y > 0.0036f) {
|
||||
if (getClassicHoldFlag() != 0 || lstick.x * lstick.x + lstick.y * lstick.y > lbl_81694468 ||
|
||||
rstick.x * rstick.x + rstick.y * rstick.y > lbl_81694468) {
|
||||
unk_0x2C = 180;
|
||||
}
|
||||
|
||||
@@ -1410,8 +1725,8 @@ namespace ipl {
|
||||
unk_0x2C = 0;
|
||||
}
|
||||
} else {
|
||||
unk_0x24.y = 0.01f;
|
||||
unk_0x24.x = 0.01f;
|
||||
unk_0x24.y = lbl_81694464;
|
||||
unk_0x24.x = lbl_81694464;
|
||||
unk_0x2C = 0;
|
||||
}
|
||||
|
||||
@@ -1448,7 +1763,7 @@ namespace ipl {
|
||||
ret.set(unk_0x20->horizon.x, unk_0x20->horizon.y);
|
||||
} else {
|
||||
ret.x = 1.0f;
|
||||
ret.y = -0.2679492f;
|
||||
ret.y = lbl_81694474;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
|
||||
#undef IPL_SOUND_RECT_OUT_OF_LINE
|
||||
|
||||
extern "C" ipl::System::Arg smArg__Q23ipl6System;
|
||||
extern "C" void __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting();
|
||||
extern "C" void setMemoSetting__Q33ipl8savedata7ManagerFRCQ49textinput6extend8savedata11MemoSetting();
|
||||
extern "C" void flushAsync__Q33ipl8savedata7ManagerFPQ23EGG4Heap();
|
||||
|
||||
namespace ipl {
|
||||
namespace keyboard {
|
||||
// clang-format off
|
||||
@@ -626,16 +631,95 @@ namespace ipl {
|
||||
#endif // JAPANESE_BUILD
|
||||
}
|
||||
|
||||
void Manager::doSave() {
|
||||
textinput::extend::savedata::MemoSetting newSaveData = mpManager->getSaveData();
|
||||
textinput::extend::savedata::MemoSetting oldSaveData = mSaveData;
|
||||
BOOL canSave = memcmp(&newSaveData, &oldSaveData, sizeof(textinput::extend::savedata::MemoSetting)) == 0 && mpSaveFile == NULL;
|
||||
|
||||
if (canSave) {
|
||||
mSaveData = newSaveData;
|
||||
System::getSaveData()->setMemoSetting(mSaveData);
|
||||
mpSaveFile = System::getSaveData()->flushAsync(System::getMem2App());
|
||||
}
|
||||
asm void Manager::doSave() {
|
||||
nofralloc
|
||||
stwu r1, -0x30(r1)
|
||||
mflr r0
|
||||
stw r0, 0x34(r1)
|
||||
stw r31, 0x2c(r1)
|
||||
mr r31, r3
|
||||
stw r30, 0x28(r1)
|
||||
lwz r3, 4(r3)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xd8(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
srwi r10, r4, 0x18
|
||||
srwi r9, r3, 0x18
|
||||
stb r10, 0x1c(r1)
|
||||
rlwinm r10, r4, 0x10, 0x18, 0x1f
|
||||
li r5, 8
|
||||
stb r9, 0x18(r1)
|
||||
rlwinm r9, r3, 0x10, 0x18, 0x1f
|
||||
lbz r6, 0x1c(r1)
|
||||
stb r10, 0x1d(r1)
|
||||
rlwinm r10, r4, 0x18, 0x18, 0x1f
|
||||
lbz r8, 0x18(r1)
|
||||
stb r9, 0x19(r1)
|
||||
rlwinm r9, r3, 0x18, 0x18, 0x1f
|
||||
lbz r0, 0x1d(r1)
|
||||
lbz r7, 0x19(r1)
|
||||
stb r10, 0x1e(r1)
|
||||
stb r4, 0x1f(r1)
|
||||
stb r4, 0xf(r1)
|
||||
addi r4, r1, 8
|
||||
stb r9, 0x1a(r1)
|
||||
stb r3, 0x1b(r1)
|
||||
stb r3, 0xb(r1)
|
||||
addi r3, r1, 0x10
|
||||
stb r8, 8(r1)
|
||||
stb r7, 9(r1)
|
||||
stb r9, 0xa(r1)
|
||||
stb r6, 0xc(r1)
|
||||
stb r0, 0xd(r1)
|
||||
stb r10, 0xe(r1)
|
||||
lbz r6, 0x2e(r31)
|
||||
lbz r0, 0x2f(r31)
|
||||
stb r6, 0x10(r1)
|
||||
stb r0, 0x11(r1)
|
||||
lbz r6, 0x30(r31)
|
||||
lbz r0, 0x31(r31)
|
||||
stb r6, 0x12(r1)
|
||||
stb r0, 0x13(r1)
|
||||
lbz r6, 0x32(r31)
|
||||
lbz r0, 0x33(r31)
|
||||
stb r6, 0x14(r1)
|
||||
stb r0, 0x15(r1)
|
||||
lbz r6, 0x34(r31)
|
||||
lbz r0, 0x35(r31)
|
||||
stb r6, 0x16(r1)
|
||||
stb r0, 0x17(r1)
|
||||
bl memcmp
|
||||
cntlzw r0, r3
|
||||
li r3, 0
|
||||
rlwinm. r0, r0, 0x1b, 5, 0x1f
|
||||
bne doSave_L1
|
||||
lwz r0, 0x38(r31)
|
||||
cmpwi r0, 0
|
||||
bne doSave_L1
|
||||
li r3, 1
|
||||
doSave_L1:
|
||||
cmpwi r3, 0
|
||||
beq doSave_L2
|
||||
addi r3, r31, 0x2e
|
||||
addi r4, r1, 0x18
|
||||
bl __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting
|
||||
lis r30, smArg__Q23ipl6System@ha
|
||||
addi r4, r31, 0x2e
|
||||
addi r30, r30, smArg__Q23ipl6System@l
|
||||
lwz r3, 0x94(r30)
|
||||
bl setMemoSetting__Q33ipl8savedata7ManagerFRCQ49textinput6extend8savedata11MemoSetting
|
||||
lwz r3, 0x94(r30)
|
||||
lwz r4, 0x28(r30)
|
||||
bl flushAsync__Q33ipl8savedata7ManagerFPQ23EGG4Heap
|
||||
stw r3, 0x38(r31)
|
||||
doSave_L2:
|
||||
lwz r0, 0x34(r1)
|
||||
lwz r31, 0x2c(r1)
|
||||
lwz r30, 0x28(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x30
|
||||
blr
|
||||
}
|
||||
|
||||
void Manager::touchFormInDisp(int unused) {
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace ipl {
|
||||
BOOL SharedFile::openTicketFile_() {
|
||||
int code = 0;
|
||||
int errcode = 0;
|
||||
ESTitleId titleId = 0;
|
||||
ESTicketId ticketId = 0;
|
||||
int erridx = 0;
|
||||
mTicket = (ESTicketView*)System::getSharedHeap()->alloc(OSRoundUp32B(sizeof(ESTicketView)), -DEFAULT_ALIGN);
|
||||
|
||||
@@ -27,18 +29,24 @@ namespace ipl {
|
||||
goto err;
|
||||
}
|
||||
} else {
|
||||
ESTicketView* tik;
|
||||
u32 tikCount;
|
||||
ESTicketView* tik;
|
||||
|
||||
if (utility::ESMisc::GetTicketViewList(System::getSharedHeap(), mTitleId, &tik, &tikCount) != ES_ERR_OK) {
|
||||
int tikIdx = utility::ESMisc::GetValidTicketIndex(System::getSharedHeap(), mTitleId, tik, tikCount);
|
||||
if (tikIdx >= 0 && tikIdx <= tikCount) {
|
||||
mTicketIdx = tikIdx;
|
||||
memcpy(mTicket, &tik[tikIdx], sizeof(ESTicketView));
|
||||
System::getSharedHeap()->free(tik);
|
||||
}
|
||||
} else {
|
||||
code = code;
|
||||
goto err;
|
||||
} else {
|
||||
int tikIdx = utility::ESMisc::GetValidTicketIndex(System::getSharedHeap(), mTitleId, tik, tikCount);
|
||||
if (tikIdx < 0) {
|
||||
goto err;
|
||||
}
|
||||
if (tikIdx >= tikCount) {
|
||||
code = code;
|
||||
goto err;
|
||||
}
|
||||
mTicketIdx = tikIdx;
|
||||
memcpy(mTicket, &tik[tikIdx], sizeof(ESTicketView));
|
||||
System::getSharedHeap()->free(tik);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +54,13 @@ namespace ipl {
|
||||
mDescriptor = ret;
|
||||
|
||||
if (ret < ES_ERR_OK) {
|
||||
errcode = ret;
|
||||
titleId = mTitleId;
|
||||
if (mTicket) {
|
||||
ticketId = mTicket->ticketId;
|
||||
}
|
||||
erridx = mContentIdx;
|
||||
code = 400;
|
||||
errcode = ret;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -68,17 +80,19 @@ namespace ipl {
|
||||
}
|
||||
|
||||
BOOL result = ARCOpen(&mArc, msFileName, &mArcFile);
|
||||
if (result && ES_CloseContentFile(mDescriptor) >= ES_ERR_OK) {
|
||||
return result == TRUE;
|
||||
} else {
|
||||
err:
|
||||
char errString[192];
|
||||
sprintf(errString, "ES %d, %llx, %llx, %x", errcode, mTitleId, erridx);
|
||||
|
||||
IPLErrorLogAndDisplay(MESG_ERR_FILE, errString, code, 158);
|
||||
|
||||
return FALSE;
|
||||
if (!result) {
|
||||
if (ES_CloseContentFile(mDescriptor) < ES_ERR_OK) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
return result == TRUE;
|
||||
err:
|
||||
char errString[128];
|
||||
sprintf(errString, "ES %d, %llx, %llx, %x", errcode, titleId, ticketId, erridx);
|
||||
|
||||
IPLErrorLogAndDisplay(MESG_ERR_FILE, errString, code, 158);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL SharedFile::closeTicketFile_() {
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
namespace ipl {
|
||||
static const wchar_t scNumber[] = L"0123456789";
|
||||
extern const u32 scCreateRecordAttachSize0 = sizeof(EventBuffer);
|
||||
extern const u32 scCreateRecordAttachSize1 = 0;
|
||||
extern const RBRAttachmentType scCreateRecordAttachType0 = RBRAttachmentType_PlayTimeLog;
|
||||
extern const RBRAttachmentType scCreateRecordAttachType1 = RBRAttachmentType_None;
|
||||
extern const u32 sPlayTimeLogAttachSize0 = sizeof(EventBuffer);
|
||||
extern const u32 sPlayTimeLogAttachSize1 = 0;
|
||||
extern const RBRAttachmentType sPlayTimeLogAttachType0 = RBRAttachmentType_PlayTimeLog;
|
||||
extern const RBRAttachmentType sPlayTimeLogAttachType1 = RBRAttachmentType_None;
|
||||
PlayTimeLog PlayTimeLog::smArg;
|
||||
|
||||
BOOL search_cb_(void* playTime, CDBRecord* record) {
|
||||
@@ -351,11 +351,15 @@ namespace ipl {
|
||||
|
||||
const void* attachData[RBR_ATTACHMENT_MAX] = {(void*)event, NULL};
|
||||
|
||||
u32 attachSize[RBR_ATTACHMENT_MAX] = {*reinterpret_cast<const volatile u32*>(&scCreateRecordAttachSize0),
|
||||
*reinterpret_cast<const volatile u32*>(&scCreateRecordAttachSize1)};
|
||||
u32 attachSize[RBR_ATTACHMENT_MAX] = {
|
||||
*reinterpret_cast<volatile const u32*>(&sPlayTimeLogAttachSize0),
|
||||
*reinterpret_cast<volatile const u32*>(&sPlayTimeLogAttachSize1)
|
||||
};
|
||||
|
||||
RBRAttachmentType attachType[RBR_ATTACHMENT_MAX] = {
|
||||
*reinterpret_cast<const volatile RBRAttachmentType*>(&scCreateRecordAttachType0),
|
||||
*reinterpret_cast<const volatile RBRAttachmentType*>(&scCreateRecordAttachType1)};
|
||||
*reinterpret_cast<volatile const RBRAttachmentType*>(&sPlayTimeLogAttachType0),
|
||||
*reinterpret_cast<volatile const RBRAttachmentType*>(&sPlayTimeLogAttachType1)
|
||||
};
|
||||
|
||||
NWC24FriendAddr friendAddr;
|
||||
memset(&friendAddr, 0, sizeof(NWC24FriendAddr));
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace ipl {
|
||||
|
||||
u32 fileLen = sizeof(Data);
|
||||
BOOL bCreateNew = FALSE;
|
||||
BOOL bNeedFlush = FALSE;
|
||||
bool bNeedFlush = false;
|
||||
|
||||
ES_SetUid(SYSMENU_TITLE_ID);
|
||||
|
||||
@@ -330,12 +330,21 @@ namespace ipl {
|
||||
NETMD5Sum md5;
|
||||
NETCalcMD5(md5, &manager->mData, fileLen - NET_MD5_DIGEST_SIZE);
|
||||
|
||||
for (int i = 0; i < NET_MD5_DIGEST_SIZE; i++) {
|
||||
if (md5[i] != manager->mData.MD5Sum[i]) {
|
||||
u8* data = (u8*)manager;
|
||||
u32* loopFileLen = &fileLen;
|
||||
volatile NETMD5Sum& md5Ref = md5;
|
||||
u32 i = 0;
|
||||
while (i < NET_MD5_DIGEST_SIZE) {
|
||||
u8 md5Byte = md5Ref[i];
|
||||
u32 offset = i;
|
||||
offset += *loopFileLen;
|
||||
u32 fileByte = *(u8*)(offset + (u32)data + NET_MD5_DIGEST_SIZE);
|
||||
if (md5Byte != fileByte) {
|
||||
// Invalid MD5 sum, create new
|
||||
bCreateNew = TRUE;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,7 +391,8 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
if (bNeedFlush | manager->updateChanInfos()) {
|
||||
bool flush = bNeedFlush | manager->updateChanInfos();
|
||||
if (flush) {
|
||||
if (manager->mpUpdatedFile) {
|
||||
delete manager->mpUpdatedFile;
|
||||
}
|
||||
@@ -1245,7 +1255,7 @@ namespace ipl {
|
||||
void Manager::updateVersion(u32 newVersion, u32 oldVersion) {
|
||||
if ((newVersion & 0xFFFF0000) != (oldVersion & 0xFFFF0000)) {
|
||||
OSReport("[SaveDataManager] Invalid major version change %d -> %d\n", oldVersion >> 16, newVersion >> 16);
|
||||
OSHalt("", 1344);
|
||||
OSHalt("\0\0\0", 1344);
|
||||
}
|
||||
mData.fileSize = sizeof(Data);
|
||||
mData.version = newVersion;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#define IPL_SYSTEM_COLOR_ALIGNMENT
|
||||
#include "iplSystem.h"
|
||||
#undef IPL_SYSTEM_COLOR_ALIGNMENT
|
||||
#include "iplSound.h"
|
||||
|
||||
#include "system/iplCdbWrapper.h"
|
||||
@@ -37,6 +39,37 @@
|
||||
extern "C" ipl::System::Arg smArg__Q23ipl6System;
|
||||
extern "C" ipl::snd::System sSystem__Q23ipl3snd;
|
||||
extern "C" void initOnMemory__Q33ipl3snd6SystemFPCvPQ23EGG4HeapUl();
|
||||
extern "C" const f32 lbl_81694410;
|
||||
extern "C" const f64 lbl_81694418;
|
||||
extern "C" const f32 lbl_81694420;
|
||||
extern "C" void* m_handle__Q23ipl11TVRCManager;
|
||||
extern "C" void _savegpr_27();
|
||||
extern "C" void _restgpr_27();
|
||||
extern "C" void reset_run__Q23ipl6SystemFv();
|
||||
extern "C" void check__Q23ipl14WarningHandlerFv();
|
||||
extern "C" void check__Q23ipl12ResetHandlerFv();
|
||||
extern "C" void update__Q23ipl12ResetHandlerFv();
|
||||
extern "C" void check__Q23ipl12ErrorHandlerFv();
|
||||
extern "C" void endFrame__Q23ipl9FrameworkFv();
|
||||
extern "C" void calc__Q23ipl14WarningHandlerFv();
|
||||
extern "C" void calc__Q23ipl7PointerFv();
|
||||
extern "C" void calc__Q23ipl14HomeButtonMenuFv();
|
||||
extern "C" void update__Q33ipl7channel7ManagerFv();
|
||||
extern "C" void set__Q23ipl12ErrorHandlerFQ33ipl12ErrorHandler4TypeUlPCcii();
|
||||
extern "C" void update__Q33ipl3bs27ManagerFv();
|
||||
extern "C" void read__Q33ipl10controller7ManagerFv();
|
||||
extern "C" void setToday___Q23ipl6SystemFv();
|
||||
extern "C" void update__Q23ipl11TVRCManagerFv();
|
||||
extern "C" void endRender__Q23ipl9FrameworkFv();
|
||||
extern "C" void draw__Q23ipl7PointerFv();
|
||||
extern "C" void draw__Q23ipl14HomeButtonMenuFv();
|
||||
extern "C" void draw__Q23ipl14WarningHandlerFv();
|
||||
extern "C" void draw__Q23ipl12DialogWindowFv();
|
||||
extern "C" void draw__Q33ipl5scene7ManagerFv();
|
||||
extern "C" void makeRawData__Q33ipl7utility11JpegDecoderFv();
|
||||
extern "C" void makeIcon__Q33ipl6nigaoe7ManagerFv();
|
||||
extern "C" void beginRender__Q23ipl9FrameworkFv();
|
||||
extern "C" void beginFrame__Q23ipl9FrameworkFv();
|
||||
#endif
|
||||
|
||||
namespace ipl {
|
||||
@@ -524,9 +557,11 @@ namespace ipl {
|
||||
|
||||
// Default values for initial setup
|
||||
if (!SCGetConfigDoneFlag() && !SCGetConfigDoneFlag2()) {
|
||||
SCOwnerNickname blankName;
|
||||
memset(&blankName, 0, sizeof(blankName));
|
||||
SCSetOwnerNickName(&blankName);
|
||||
struct BlankNameStorage {
|
||||
SCOwnerNickname blankName;
|
||||
} blankNameStorage;
|
||||
memset(&blankNameStorage.blankName, 0, sizeof(blankNameStorage.blankName));
|
||||
SCSetOwnerNickName(&blankNameStorage.blankName);
|
||||
|
||||
SCSetAspectRatio(SC_ASPECT_RATIO_4x3);
|
||||
|
||||
@@ -707,7 +742,8 @@ namespace ipl {
|
||||
smArg.mpNandManager = new (getMem1Sys(), 4) nand::Manager(getMem1Sys());
|
||||
|
||||
// Symbol list for RSO modules
|
||||
snprintf(rsoListPath, sizeof(rsoListPath), "/%s/%s/main.sel", SYSMENU_BUILD_TYPE, SYSMENU_BUILD_VERSION);
|
||||
const char* rsoFormat = "/%s/%s/main.sel";
|
||||
snprintf(rsoListPath, sizeof(rsoListPath), rsoFormat, SYSMENU_BUILD_TYPE, SYSMENU_BUILD_VERSION);
|
||||
smArg.mResources.file[Arg::RSO_SYM_LIST] = getNandManager()->read(getMem2Sys(), rsoListPath);
|
||||
RSOListInit(smArg.mResources.file[Arg::RSO_SYM_LIST]->getBuffer());
|
||||
|
||||
@@ -1080,99 +1116,196 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
void System::warning_run() {
|
||||
if (getResetHandler()->isResetting()) {
|
||||
return;
|
||||
}
|
||||
|
||||
VISetBlack(FALSE);
|
||||
|
||||
// Force pointer to be visible, and push it's old state
|
||||
bool isVisible = System::getPointer()->isVisible();
|
||||
System::getPointer()->setVisible(true);
|
||||
|
||||
while (TRUE) {
|
||||
// Start rendering
|
||||
smArg.mpFramework->beginFrame();
|
||||
smArg.mpFramework->beginRender();
|
||||
|
||||
// Setup data
|
||||
if (hasCreatedAfter()) {
|
||||
getMiiManager()->makeIcon();
|
||||
}
|
||||
if (hasCreatedAfter()) {
|
||||
getJpegDecoder()->makeRawData();
|
||||
}
|
||||
|
||||
// Setup view
|
||||
GXRenderModeObj* rMode = System::getRenderModeObj();
|
||||
GXSetViewport(0.0f, 0.0f, rMode->fbWidth, rMode->efbHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, rMode->fbWidth, rMode->efbHeight);
|
||||
|
||||
// Drawing
|
||||
getSceneManager()->draw();
|
||||
if (hasCreatedAfter()) {
|
||||
getKeyboard()->draw();
|
||||
getDialog()->draw();
|
||||
}
|
||||
getWarningHandler()->draw();
|
||||
if (hasCreatedAfter()) {
|
||||
getHomeButtonMenu()->draw();
|
||||
}
|
||||
if (hasCreatedAfter()) {
|
||||
getPointer()->draw();
|
||||
}
|
||||
getFader()->draw();
|
||||
getResetFader()->draw();
|
||||
|
||||
// End of rendering
|
||||
smArg.mpFramework->endRender();
|
||||
|
||||
// Update logic
|
||||
TVRCManager::getHandle()->update();
|
||||
setToday_();
|
||||
getControllerManager()->read();
|
||||
if (getBS2Manager()->update() == bs2::IPL_STATE_FATAL) {
|
||||
IPLErrorDisplay(MESG_ERR_DVD);
|
||||
}
|
||||
getChannelManager()->update();
|
||||
if (hasCreatedAfter()) {
|
||||
getHomeButtonMenu()->calc();
|
||||
getPointer()->calc();
|
||||
getFader()->calc();
|
||||
getResetFader()->calc();
|
||||
getWarningHandler()->calc();
|
||||
snd::getSystem()->calc();
|
||||
}
|
||||
|
||||
smArg.mpFramework->endFrame();
|
||||
|
||||
// Error handling
|
||||
if (hasCreatedAfter()) {
|
||||
getErrorHandler()->check();
|
||||
}
|
||||
|
||||
// Reset handling
|
||||
getResetHandler()->update();
|
||||
getResetHandler()->check();
|
||||
|
||||
// If we pressed button in dialog, goodbye!
|
||||
if (getWarningHandler()->check() != DialogWindow::RESULT_NONE) {
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// Pop old state
|
||||
if (isVisible) {
|
||||
System::getPointer()->setVisible(true);
|
||||
} else {
|
||||
System::getPointer()->setVisible(false);
|
||||
}
|
||||
|
||||
// If the warning told the system to reset, then reset!
|
||||
if (getWarningHandler()->resetting()) {
|
||||
reset_run();
|
||||
}
|
||||
asm void System::warning_run() {
|
||||
nofralloc
|
||||
stwu r1, -0x40(r1)
|
||||
mflr r0
|
||||
stw r0, 0x44(r1)
|
||||
stfd f31, 0x30(r1)
|
||||
psq_st f31, 0x38(r1), 0, 0
|
||||
addi r11, r1, 0x30
|
||||
bl _savegpr_27
|
||||
lis r3, smArg__Q23ipl6System@ha
|
||||
addi r28, r3, smArg__Q23ipl6System@l
|
||||
lwz r3, 0x9c(r28)
|
||||
lwz r3, 4(r3)
|
||||
addic r0, r3, -1
|
||||
subfe. r0, r0, r3
|
||||
bne warning_run_done
|
||||
li r3, 0
|
||||
bl VISetBlack
|
||||
lwz r3, 0xb0(r28)
|
||||
li r0, 1
|
||||
lfd f31, lbl_81694418
|
||||
lis r30, 0x4330
|
||||
lbz r29, 0x3d(r3)
|
||||
lis r31, sSystem__Q23ipl3snd@ha
|
||||
stb r0, 0x3d(r3)
|
||||
warning_run_loop:
|
||||
lwz r3, 0x74(r28)
|
||||
bl beginFrame__Q23ipl9FrameworkFv
|
||||
lwz r3, 0x74(r28)
|
||||
bl beginRender__Q23ipl9FrameworkFv
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_mii
|
||||
lwz r3, 0x70(r28)
|
||||
bl makeIcon__Q33ipl6nigaoe7ManagerFv
|
||||
warning_run_no_mii:
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_jpeg
|
||||
lwz r3, 0xbc(r28)
|
||||
bl makeRawData__Q33ipl7utility11JpegDecoderFv
|
||||
warning_run_no_jpeg:
|
||||
lwz r3, 0x74(r28)
|
||||
lfs f1, lbl_81694410
|
||||
lwz r27, 0(r3)
|
||||
stw r30, 8(r1)
|
||||
fmr f2, f1
|
||||
lhz r3, 4(r27)
|
||||
fmr f5, f1
|
||||
lhz r0, 6(r27)
|
||||
stw r3, 0xc(r1)
|
||||
lfs f6, lbl_81694420
|
||||
lfd f0, 8(r1)
|
||||
stw r0, 0x14(r1)
|
||||
fsubs f3, f0, f31
|
||||
stw r30, 0x10(r1)
|
||||
lfd f0, 0x10(r1)
|
||||
fsubs f4, f0, f31
|
||||
bl GXSetViewport
|
||||
lhz r5, 4(r27)
|
||||
li r3, 0
|
||||
lhz r6, 6(r27)
|
||||
li r4, 0
|
||||
bl GXSetScissor
|
||||
lwz r3, 0x64(r28)
|
||||
bl draw__Q33ipl5scene7ManagerFv
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_keyboard
|
||||
lwz r3, 0x90(r28)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x14(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r3, 0xac(r28)
|
||||
bl draw__Q23ipl12DialogWindowFv
|
||||
warning_run_no_keyboard:
|
||||
lwz r3, 0xa0(r28)
|
||||
bl draw__Q23ipl14WarningHandlerFv
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_home
|
||||
lwz r3, 0xb4(r28)
|
||||
bl draw__Q23ipl14HomeButtonMenuFv
|
||||
warning_run_no_home:
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_pointer
|
||||
lwz r3, 0xb0(r28)
|
||||
bl draw__Q23ipl7PointerFv
|
||||
warning_run_no_pointer:
|
||||
lwz r3, 0xc4(r28)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x1c(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r3, 0xc8(r28)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x1c(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r3, 0x74(r28)
|
||||
bl endRender__Q23ipl9FrameworkFv
|
||||
lwz r3, m_handle__Q23ipl11TVRCManager
|
||||
bl update__Q23ipl11TVRCManagerFv
|
||||
bl setToday___Q23ipl6SystemFv
|
||||
lwz r3, 0x68(r28)
|
||||
bl read__Q33ipl10controller7ManagerFv
|
||||
lwz r3, 0xa8(r28)
|
||||
bl update__Q33ipl3bs27ManagerFv
|
||||
cmpwi r3, 0xa
|
||||
bne warning_run_no_dvd
|
||||
lwz r3, 0x98(r28)
|
||||
li r4, 1
|
||||
li r5, 0
|
||||
li r6, 0
|
||||
li r7, 0
|
||||
li r8, -1
|
||||
bl set__Q23ipl12ErrorHandlerFQ33ipl12ErrorHandler4TypeUlPCcii
|
||||
warning_run_no_dvd:
|
||||
lwz r3, 0x84(r28)
|
||||
bl update__Q33ipl7channel7ManagerFv
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_calc
|
||||
lwz r3, 0xb4(r28)
|
||||
bl calc__Q23ipl14HomeButtonMenuFv
|
||||
lwz r3, 0xb0(r28)
|
||||
bl calc__Q23ipl7PointerFv
|
||||
lwz r3, 0xc4(r28)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x18(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r3, 0xc8(r28)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0x18(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
lwz r3, 0xa0(r28)
|
||||
bl calc__Q23ipl14WarningHandlerFv
|
||||
addi r3, r31, sSystem__Q23ipl3snd@l
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xc(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
warning_run_no_calc:
|
||||
lwz r3, 0x74(r28)
|
||||
bl endFrame__Q23ipl9FrameworkFv
|
||||
lbz r0, 0x2b2(r28)
|
||||
cmpwi r0, 0
|
||||
beq warning_run_no_error
|
||||
lwz r3, 0x98(r28)
|
||||
bl check__Q23ipl12ErrorHandlerFv
|
||||
warning_run_no_error:
|
||||
lwz r3, 0x9c(r28)
|
||||
bl update__Q23ipl12ResetHandlerFv
|
||||
lwz r3, 0x9c(r28)
|
||||
bl check__Q23ipl12ResetHandlerFv
|
||||
lwz r3, 0xa0(r28)
|
||||
bl check__Q23ipl14WarningHandlerFv
|
||||
cmpwi r3, -1
|
||||
beq warning_run_loop
|
||||
cmpwi r29, 0
|
||||
beq warning_run_pointer_hidden
|
||||
lwz r3, 0xb0(r28)
|
||||
li r0, 1
|
||||
stb r0, 0x3d(r3)
|
||||
b warning_run_pointer_done
|
||||
warning_run_pointer_hidden:
|
||||
lwz r3, 0xb0(r28)
|
||||
li r0, 0
|
||||
stb r0, 0x3d(r3)
|
||||
warning_run_pointer_done:
|
||||
lis r3, smArg__Q23ipl6System@ha
|
||||
addi r3, r3, smArg__Q23ipl6System@l
|
||||
lwz r3, 0xa0(r3)
|
||||
lwz r0, 0(r3)
|
||||
cmpwi r0, 2
|
||||
bne warning_run_done
|
||||
bl reset_run__Q23ipl6SystemFv
|
||||
warning_run_done:
|
||||
psq_l f31, 0x38(r1), 0, 0
|
||||
addi r11, r1, 0x30
|
||||
lfd f31, 0x30(r1)
|
||||
bl _restgpr_27
|
||||
lwz r0, 0x44(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x40
|
||||
blr
|
||||
}
|
||||
|
||||
void System::reinit() {
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
#include "system/odh.h"
|
||||
#include <revolution/os/OSError.h>
|
||||
|
||||
extern "C" void _savegpr_24();
|
||||
extern "C" void _restgpr_24();
|
||||
extern "C" void cdj_c_initializeCompressOdh__9CArGBAOdhFP16SArCDJ_OdhMasterPUsUcPUcPUcUl();
|
||||
extern "C" void cdj_c_compressLoop__9CArGBAOdhFP16SArCDJ_OdhMaster();
|
||||
extern "C" void cdj_c_colorConv__9CArGBAOdhFP16SArCDJ_OdhMasterPUci();
|
||||
|
||||
enum {
|
||||
ODH_FORMAT_RGB565 = 0,
|
||||
@@ -26,14 +33,55 @@ struct SArCDJ_OdhMaster {
|
||||
u32 remaining;
|
||||
u8 padding2[0x210];
|
||||
u8* data;
|
||||
u8 padding3[0x24C];
|
||||
};
|
||||
|
||||
static const u32 gArDc_luminance_huffTable[] = {
|
||||
0x00018002, 0x00030000, 0xC003C004, 0x80050001, 0x00020003, 0x00040005,
|
||||
0x80010006, 0x80010007, 0x80010008, 0x80010009, 0x8001000A, 0x8001000B,
|
||||
};
|
||||
|
||||
static const u32 gArDc_chrominance_huffTable[] = {
|
||||
0x0001C002, 0x80030000, 0x00010002, 0x80010003, 0x80010004, 0x80010005,
|
||||
0x80010006, 0x80010007, 0x80010008, 0x80010009, 0x8001000A, 0x8001000B,
|
||||
};
|
||||
|
||||
struct HufftreeData {
|
||||
const u32* tables[4];
|
||||
char messages[0x1BB];
|
||||
};
|
||||
|
||||
HufftreeData hufftreePtr = {
|
||||
{
|
||||
gArDc_luminance_huffTable,
|
||||
gArDc_luminance_huffTable,
|
||||
gArDc_chrominance_huffTable,
|
||||
gArDc_luminance_huffTable,
|
||||
},
|
||||
"decompressGbaOdh : source size error\n\0"
|
||||
"decompressGbaOdh : destination buffer over\n\0"
|
||||
"decompressGbaOdh : INITIALIZE ERROR %08x\n\0"
|
||||
"decompressGbaOdh : DECOMPRESSING ERROR %08x\n\0"
|
||||
"decompressGbaOdh : COLOR DECONVERSION ERROR %08x\n\0"
|
||||
"compressGbaOdh : INITIALIZE ERROR %08x\n\0"
|
||||
"compressGbaOdh : COLOR CONVERSION ERROR %08x\n\0"
|
||||
"compressGbaOdh : COMPRESS OVER AND RETRY %d q=%d, %08x\n\0"
|
||||
"compressGbaOdh : INITIALIZE ERROR2 %08x\n\0"
|
||||
"compressGbaOdh : COMPRESSING ERROR %08x\n",
|
||||
};
|
||||
|
||||
class CArGBAOdh {
|
||||
public:
|
||||
s32 decompressGbaOdh(u8* src, int srcSize, u8* dest, int destSize, u8* work, int unk, int format);
|
||||
s32 compressGbaOdh(u8* src, u8* dest, int width, int height, int quality, u32 sizeLimit, u8* work, int format);
|
||||
s32 cdj_c_initializeCompressOdh(SArCDJ_OdhMaster* master, u16* dimensions, u8 quality, u8* work, u8* dest, u32 sizeLimit);
|
||||
s32 cdj_c_compressLoop(SArCDJ_OdhMaster* master);
|
||||
s32 cdj_c_flashBuffer(SArCDJ_OdhMaster* master);
|
||||
void cdj_c_makeHeader(SArCDJ_OdhMaster* master, u32 size);
|
||||
s32 cdj_c_colorConv(SArCDJ_OdhMaster* master, u8* src, int format);
|
||||
s32 cdj_d_initializeDecompressOdh(SArCDJ_OdhMaster* master, u8* work, u8* src);
|
||||
s32 cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int workSize);
|
||||
s32 cdj_d_colorDeconv(SArCDJ_OdhMaster* master, u8* dest, int format);
|
||||
|
||||
private:
|
||||
s32 ScaleLimit(s32 scale);
|
||||
@@ -80,6 +128,174 @@ int ODHGetHeight(u8* data) {
|
||||
return (((u32*)data)[1] >> 11 & 0x7FF) + 7 & 0x7F8;
|
||||
}
|
||||
|
||||
s32 CArGBAOdh::decompressGbaOdh(u8* src, int srcSize, u8* dest, int destSize, u8* work, int unk, int format) {
|
||||
SArCDJ_OdhMaster master;
|
||||
const char* messages = (const char*)&hufftreePtr;
|
||||
int width;
|
||||
int height;
|
||||
int outputSize;
|
||||
|
||||
if (srcSize <= 0x10) {
|
||||
OSReport(messages + 0x10);
|
||||
return 0;
|
||||
}
|
||||
|
||||
width = (((u32*)src)[1] & 0x7FF) + 7 & 0x7F8;
|
||||
height = (((u32*)src)[1] >> 11 & 0x7FF) + 7 & 0x7F8;
|
||||
|
||||
if (format == ODH_FORMAT_RGB565) {
|
||||
outputSize = width * height * 2;
|
||||
} else if (format == ODH_FORMAT_RGBA8) {
|
||||
outputSize = width * height * 4;
|
||||
} else {
|
||||
outputSize = width * height * 3;
|
||||
}
|
||||
|
||||
if (destSize == 0) {
|
||||
destSize = outputSize;
|
||||
}
|
||||
if (unk == 0) {
|
||||
unk = width * height * 3;
|
||||
}
|
||||
if (outputSize > destSize) {
|
||||
OSReport(messages + 0x36);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 result = cdj_d_initializeDecompressOdh(&master, work, src);
|
||||
if (result != 0) {
|
||||
OSReport(messages + 0x62, result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
result = cdj_d_decompressLoop(&master, srcSize, unk);
|
||||
if (result != 0) {
|
||||
OSReport(messages + 0x8C, result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
result = cdj_d_colorDeconv(&master, dest, format);
|
||||
if (result != 0) {
|
||||
OSReport(messages + 0xB9, result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return height << 16 | width;
|
||||
}
|
||||
|
||||
asm s32 CArGBAOdh::compressGbaOdh(u8* src, u8* dest, int width, int height, int quality, u32 sizeLimit, u8* work, int format) {
|
||||
nofralloc
|
||||
stwu r1, -0x4b0(r1)
|
||||
mflr r0
|
||||
stw r0, 0x4b4(r1)
|
||||
addi r11, r1, 0x4b0
|
||||
bl _savegpr_24
|
||||
cmpwi r9, 0
|
||||
lis r31, hufftreePtr@ha
|
||||
lwz r29, 0x4b8(r1)
|
||||
mr r24, r3
|
||||
mr r30, r4
|
||||
mr r25, r5
|
||||
mr r26, r8
|
||||
mr r27, r9
|
||||
mr r28, r10
|
||||
addi r31, r31, hufftreePtr@l
|
||||
bne compressGbaOdh_L1
|
||||
mullw r0, r6, r7
|
||||
slwi r27, r0, 1
|
||||
compressGbaOdh_L1:
|
||||
sth r6, 8(r1)
|
||||
clrlwi r6, r8, 0x18
|
||||
mr r3, r24
|
||||
mr r8, r25
|
||||
sth r7, 0xa(r1)
|
||||
mr r7, r28
|
||||
mr r9, r27
|
||||
addi r4, r1, 0xc
|
||||
addi r5, r1, 8
|
||||
bl cdj_c_initializeCompressOdh__9CArGBAOdhFP16SArCDJ_OdhMasterPUsUcPUcPUcUl
|
||||
cmpwi r3, 0
|
||||
beq compressGbaOdh_L2
|
||||
mr r4, r3
|
||||
addi r3, r31, 0xeb
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L2:
|
||||
mr r3, r24
|
||||
mr r5, r30
|
||||
mr r6, r29
|
||||
addi r4, r1, 0xc
|
||||
bl cdj_c_colorConv__9CArGBAOdhFP16SArCDJ_OdhMasterPUci
|
||||
cmpwi r3, 0
|
||||
beq compressGbaOdh_L3
|
||||
mr r4, r3
|
||||
addi r3, r31, 0x113
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L3:
|
||||
mr r3, r24
|
||||
addi r4, r1, 0xc
|
||||
bl cdj_c_compressLoop__9CArGBAOdhFP16SArCDJ_OdhMaster
|
||||
mr r30, r3
|
||||
li r29, 1
|
||||
b compressGbaOdh_L6
|
||||
compressGbaOdh_L4:
|
||||
lbz r5, 0x10(r1)
|
||||
mr r4, r29
|
||||
mr r6, r30
|
||||
addi r3, r31, 0x141
|
||||
crclr 4*cr1+eq
|
||||
addi r29, r29, 1
|
||||
bl OSReport
|
||||
addic. r26, r26, -5
|
||||
ble compressGbaOdh_L7
|
||||
mr r3, r24
|
||||
mr r7, r28
|
||||
mr r8, r25
|
||||
mr r9, r27
|
||||
addi r4, r1, 0xc
|
||||
addi r5, r1, 8
|
||||
clrlwi r6, r26, 0x18
|
||||
bl cdj_c_initializeCompressOdh__9CArGBAOdhFP16SArCDJ_OdhMasterPUsUcPUcPUcUl
|
||||
cmpwi r3, 0
|
||||
beq compressGbaOdh_L5
|
||||
mr r4, r3
|
||||
addi r3, r31, 0x179
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L5:
|
||||
mr r3, r24
|
||||
addi r4, r1, 0xc
|
||||
bl cdj_c_compressLoop__9CArGBAOdhFP16SArCDJ_OdhMaster
|
||||
mr r30, r3
|
||||
b compressGbaOdh_L6
|
||||
compressGbaOdh_L7:
|
||||
mr r4, r30
|
||||
addi r3, r31, 0x1a2
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L6:
|
||||
addis r0, r30, -0x8000
|
||||
cmplwi r0, 4
|
||||
beq compressGbaOdh_L4
|
||||
mr r3, r30
|
||||
compressGbaOdh_L8:
|
||||
addi r11, r1, 0x4b0
|
||||
bl _restgpr_24
|
||||
lwz r0, 0x4b4(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x4b0
|
||||
blr
|
||||
}
|
||||
|
||||
s32 CArGBAOdh::cdj_c_flashBuffer(SArCDJ_OdhMaster* master) {
|
||||
master->bitBuffer |= 0x7F << (master->bitCount -= 7);
|
||||
|
||||
|
||||
@@ -1,3 +1,88 @@
|
||||
#define IPL_MATH_INTERPORATION_H
|
||||
|
||||
#include <nw4r/math.h>
|
||||
|
||||
#include "utility/iplFrameController.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace math {
|
||||
template <typename T>
|
||||
class Interporation : public utility::FrameController {
|
||||
public:
|
||||
void init(int playback, f32 maxFrame, f32 minFrame, const T& start, const T& end, f32 speed = 1.0f) {
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
utility::FrameController::init(playback, maxFrame, minFrame, speed);
|
||||
}
|
||||
|
||||
const T& getStart() { return mStart; }
|
||||
const T& getEnd() { return mEnd; }
|
||||
|
||||
void playBackwards() {
|
||||
mAnmType = ANIM_TYPE_BACKWARD;
|
||||
mState = ANIM_STATE_PLAY;
|
||||
}
|
||||
|
||||
protected:
|
||||
T mStart;
|
||||
T mEnd;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class LinearIntp : public Interporation<T> {
|
||||
public:
|
||||
T get() const {
|
||||
T r = mEnd * getCurrentFrame();
|
||||
T b = mStart * (mMaxFrame - mFrame);
|
||||
b += r;
|
||||
return b * (f64)(1.0f / getMaxFrame());
|
||||
}
|
||||
|
||||
T get2() const { return (((mStart * (mMaxFrame - mFrame)) + (mEnd * mFrame)) / mMaxFrame); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class HermiteIntp : public utility::FrameController {
|
||||
public:
|
||||
HermiteIntp() {}
|
||||
|
||||
void init(const T& start, const T& end, f32 maxFrame, f32 param_5, f32 param_6, int playback = ANIM_TYPE_FORWARD, f32 speed = 1.0f) {
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
utility::FrameController::init(playback, maxFrame, 0.0f, speed);
|
||||
unkVal0 = param_5;
|
||||
unkVal1 = param_6;
|
||||
}
|
||||
|
||||
T get() const {
|
||||
f32 var_f27 = mFrame;
|
||||
f32 var_f28 = 1.0f / mMaxFrame;
|
||||
T r =
|
||||
(mStart *
|
||||
(1.0f + ((var_f28 * (var_f28 * (var_f28 * (var_f27 * (2.0f * var_f27 * var_f27))))) -
|
||||
(var_f28 * (var_f28 * (3.0f * var_f27 * var_f27)))))) -
|
||||
(mEnd * ((var_f28 * (var_f28 * (var_f28 * (var_f27 * (2.0f * var_f27 * var_f27))))) -
|
||||
(var_f28 * (var_f28 * (3.0f * var_f27 * var_f27)))));
|
||||
r +=
|
||||
(unkVal0 *
|
||||
(var_f27 +
|
||||
((var_f28 * (var_f28 * (var_f27 * (var_f27 * var_f27)))) -
|
||||
(var_f28 * (2.0f * var_f27 * var_f27))))) +
|
||||
(unkVal1 * ((var_f28 * (var_f28 * (var_f27 * (var_f27 * var_f27)))) -
|
||||
(var_f28 * (var_f27 * var_f27))));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
protected:
|
||||
T mStart;
|
||||
T mEnd;
|
||||
f32 unkVal0;
|
||||
f32 unkVal1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include "iplUtility.h"
|
||||
|
||||
#include "iplSystem.h"
|
||||
@@ -241,7 +326,8 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case Pointer::SCROLL_CON_DOWN: {
|
||||
unk_0x3C = unk_0x3C * unk_0x48 + unk_0x4C;
|
||||
unk_0x3C = unk_0x3C * unk_0x48;
|
||||
unk_0x3C += unk_0x4C;
|
||||
if (unk_0x3C < 0.0f) {
|
||||
unk_0x3C = 0.0f;
|
||||
}
|
||||
@@ -637,7 +723,7 @@ namespace ipl {
|
||||
} // namespace utility
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
math::VEC2 ForceCTORWeak() {
|
||||
__declspec(weak) math::VEC2 ForceCTORWeak() {
|
||||
return math::VEC2(NULL, NULL);
|
||||
}
|
||||
#endif // NON_MATCHING
|
||||
|
||||
Reference in New Issue
Block a user