Compare commits
50 Commits
agent/cont
...
agent/refi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56789e065d | ||
|
|
e1bd339ba5 | ||
|
|
0532e405d3 | ||
|
|
961a1b0431 | ||
|
|
e65297484f | ||
|
|
10f3bbc57c | ||
|
|
747e87959f | ||
|
|
0f89a4218d | ||
|
|
d0127008b2 | ||
|
|
8f31470be5 | ||
|
|
8a46eaae2d | ||
|
|
55946192bf | ||
|
|
f5486c85f4 | ||
|
|
bcbffb2c06 | ||
|
|
3793ce8c4e | ||
|
|
5cd7bcb31f | ||
|
|
c6ae812dd3 | ||
|
|
eeb6e310cf | ||
|
|
2242c861de | ||
|
|
ded8d62531 | ||
|
|
2c9e8eb028 | ||
|
|
a8c6bcf550 | ||
|
|
aa72085db7 | ||
|
|
4f747f363b | ||
|
|
2dce7103d1 | ||
|
|
f812a3bf87 | ||
|
|
25177c690e | ||
|
|
912546fd58 | ||
|
|
39aef1c7c0 | ||
|
|
872f55c573 | ||
|
|
ba46047e4d | ||
|
|
3e41051d36 | ||
|
|
fa2c5714ad | ||
|
|
cebdd7236d | ||
|
|
87cf5dacc3 | ||
|
|
9424c50f7b | ||
|
|
020ba288c3 | ||
|
|
1ab4726f50 | ||
|
|
2b016f9144 | ||
|
|
29984adbed | ||
|
|
e2832af0d2 | ||
|
|
df3f27980e | ||
|
|
28a693c7ad | ||
|
|
1d16705416 | ||
|
|
1ccf72e0d5 | ||
|
|
11b63fc609 | ||
|
|
3ae7c32d1c | ||
|
|
1171037c9b | ||
|
|
0a6a722237 | ||
|
|
18e76c8e59 |
30
configure.py
30
configure.py
@@ -623,7 +623,7 @@ config.libs = [
|
||||
Object(Matching, "system/enc_dummy.c"),
|
||||
Object(Matching, "system/rvl_dec.c"),
|
||||
Object(Matching, "system/RIPL_BoardRecord.c"),
|
||||
Object(Equivalent, "system/iplSystem.cpp"),
|
||||
Object(Matching, "system/iplSystem.cpp"),
|
||||
Object(NonMatching, "system/iplController.cpp"),
|
||||
Object(Matching, "system/iplChannelManager.cpp"),
|
||||
Object(Matching, "system/iplChannelScriptManager.cpp"),
|
||||
@@ -641,7 +641,7 @@ config.libs = [
|
||||
Object(Matching, "system/iplCdbManager.cpp"),
|
||||
Object(Matching, "system/iplCdbWrapper.cpp"),
|
||||
Object(Matching, "system/iplPlayTimeLog.cpp"),
|
||||
Object(Equivalent, "system/iplNwc24Manager.cpp"),
|
||||
Object(Matching, "system/iplNwc24Manager.cpp"),
|
||||
Object(Matching, "system/iplPointer.cpp"),
|
||||
Object(Matching, "system/iplPointerCore.cpp"),
|
||||
Object(Matching, "system/iplDialogWindow.cpp"),
|
||||
@@ -697,7 +697,7 @@ config.libs = [
|
||||
Object(Matching, "iplwww/www_surface.cpp"),
|
||||
Object(Matching, "iplwww/www_thread.cpp"),
|
||||
Object(Matching, "iplwww/www_print.cpp"),
|
||||
Object(Equivalent, "iplwww/www_window.cpp"),
|
||||
Object(Matching, "iplwww/www_window.cpp"),
|
||||
Object(Matching, "iplwww/www_trasition.cpp"),
|
||||
Object(Equivalent, "iplwww/www_wiisetting.cpp"),
|
||||
Object(Matching, "iplwww/www_arcreader.cpp"),
|
||||
@@ -899,7 +899,7 @@ config.libs = [
|
||||
]
|
||||
),
|
||||
IPLSection("bannerSound", [
|
||||
Object(Equivalent, "bannerSound/AudioWavePlayer.cpp"),
|
||||
Object(Matching, "bannerSound/AudioWavePlayer.cpp"),
|
||||
Object(Equivalent, "bannerSound/AxAdpcmPlayer.cpp"),
|
||||
Object(Matching, "bannerSound/BannerSoundPlayer.cpp"),
|
||||
Object(Matching, "bannerSound/AudioWaveUtility.cpp"),
|
||||
@@ -1017,7 +1017,7 @@ config.libs = [
|
||||
Object(Matching, "cdb/cdb.c"),
|
||||
Object(Equivalent, "cdb/CDBConv.c"), # hmm
|
||||
Object(NonMatching, "cdb/CDBDatabase.c"),
|
||||
Object(Equivalent, "cdb/CDBFileSystemUtils.c"),
|
||||
Object(Matching, "cdb/CDBFileSystemUtils.c"),
|
||||
Object(Matching, "cdb/CDBFileSystem.c"),
|
||||
Object(Matching, "cdb/CDBFileSystemVF.c"),
|
||||
Object(Matching, "cdb/CDBFileSystemSD.c"),
|
||||
@@ -1072,8 +1072,8 @@ config.libs = [
|
||||
Object(Matching, "nwc24/NWC24FileAPI.c"),
|
||||
Object(Matching, "nwc24/NWC24Config.c"),
|
||||
Object(Matching, "nwc24/NWC24Utils.c"),
|
||||
Object(NonMatching, "nwc24/NWC24Manage.c"),
|
||||
Object(NonMatching, "nwc24/NWC24MsgObj.c"),
|
||||
Object(Matching, "nwc24/NWC24Manage.c"),
|
||||
Object(Matching, "nwc24/NWC24MsgObj.c"),
|
||||
Object(NonMatching, "nwc24/NWC24MBoxCtrl.c"),
|
||||
Object(NonMatching, "nwc24/NWC24Mime.c"),
|
||||
Object(Matching, "nwc24/NWC24Stream.c"),
|
||||
@@ -1089,7 +1089,7 @@ config.libs = [
|
||||
Object(Matching, "nwc24/NWC24Time.c"),
|
||||
Object(Matching, "nwc24/NWC24Ipc.c"),
|
||||
Object(NonMatching, "nwc24/NWC24Download.c"),
|
||||
Object(Equivalent, "nwc24/NWC24CHJump.c"),
|
||||
Object(Matching, "nwc24/NWC24CHJump.c"),
|
||||
Object(NonMatching, "nwc24/NWC24System.c"),
|
||||
]
|
||||
),
|
||||
@@ -1946,9 +1946,9 @@ config.libs = [
|
||||
Object(NonMatching, "MSL_Common_Embedded/ansi_fp.c"),
|
||||
Object(Matching, "MSL_Common/ctype.c"),
|
||||
Object(NonMatching, "MSL_Common/locale.c"),
|
||||
Object(NonMatching, "MSL_Common/arith.c"),
|
||||
Object(NonMatching, "MSL_Common/bsearch.c"),
|
||||
Object(NonMatching, "MSL_Common/buffer_io.c"),
|
||||
Object(Matching, "MSL_Common/arith.c"),
|
||||
Object(Matching, "MSL_Common/bsearch.c"),
|
||||
Object(Matching, "MSL_Common/buffer_io.c"),
|
||||
Object(NonMatching, "MSL_Common/direct_io.c"),
|
||||
Object(NonMatching, "MSL_Common/file_io.c"),
|
||||
Object(NonMatching, "MSL_Common/FILE_POS.c"),
|
||||
@@ -1956,9 +1956,9 @@ config.libs = [
|
||||
Object(Matching, "MSL_Common/mem.c"),
|
||||
Object(Matching, "MSL_Common/mem_funcs.c"),
|
||||
Object(Matching, "MSL_Common/math_api.c"),
|
||||
Object(NonMatching, "MSL_Common/misc_io.c"),
|
||||
Object(Matching, "MSL_Common/printf.c", mw_version = "GC/3.0a5.2", strip_comment=True),
|
||||
Object(NonMatching, "MSL_Common/qsort.c"),
|
||||
Object(Matching, "MSL_Common/misc_io.c"),
|
||||
Object(NonMatching, "MSL_Common/printf.c"),
|
||||
Object(Matching, "MSL_Common/qsort.c", extra_cflags=["-Cpp_exceptions on"]),
|
||||
Object(Matching, "MSL_Common/rand.c"),
|
||||
Object(NonMatching, "MSL_Common/scanf.c"),
|
||||
Object(NonMatching, "MSL_Common/signal.c"),
|
||||
@@ -1976,7 +1976,7 @@ config.libs = [
|
||||
Object(Matching, "PPC_EABI/sysenv.GCN.c"),
|
||||
Object(Matching, "PPC_EABI/uart_console_io_gcn.c"),
|
||||
Object(Matching, "PPC_EABI/abort_exit_ppc_eabi.c"),
|
||||
Object(NonMatching, "MSL_Common/math_sun.c"),
|
||||
Object(Matching, "MSL_Common/math_sun.c", extra_cflags=["-Cpp_exceptions on"]),
|
||||
Object(NonMatching, "MSL_Common/extras.c"),
|
||||
|
||||
Object(Matching, "MSL_Common_Embedded/Math/e_acos.c"),
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class MaxDate : public utility::Date {
|
||||
public:
|
||||
u8 padding[0x10];
|
||||
MaxDate(int year, int month, int day) : utility::Date(year, month, day) {}
|
||||
};
|
||||
|
||||
class Date : ::gui::EventHandler {
|
||||
public:
|
||||
typedef struct AnmFrame {
|
||||
@@ -82,7 +88,7 @@ namespace ipl {
|
||||
static const char* mscAnimPanes[ANIM_PANE_MAX];
|
||||
|
||||
static utility::Date mscMinDate;
|
||||
static utility::Date mscMaxDate;
|
||||
static MaxDate mscMaxDate;
|
||||
|
||||
nw4r::ut::Link mNode1; // 0x40
|
||||
nw4r::ut::Link mNode2; // 0x48
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ipl {
|
||||
void closeDatabase();
|
||||
|
||||
BOOL createNewRecord(const char* recordName, const char* recordFileType, const OSCalendarTime* dateTime, u32* gameCode, u16* makerCode,
|
||||
const math::VEC2& recordPos, u32 recordFlags, const NWC24FriendAddr& addr, u16 addrType, u16 noReplyFlag,
|
||||
const math::VEC2& recordPos, u32 recordFlags, const NWC24FriendAddr& addr, NWC24FriendType addrType, u16 noReplyFlag,
|
||||
const wchar_t* titleText, const wchar_t* bodyText, const void* faceData, const void** attachData, u32* attachSize,
|
||||
RBRAttachmentType* attachType);
|
||||
|
||||
|
||||
142
libs/MSL/src/MSL_Common/arith.c
Normal file
142
libs/MSL/src/MSL_Common/arith.c
Normal file
@@ -0,0 +1,142 @@
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
typedef struct ldiv_t {
|
||||
long quot;
|
||||
long rem;
|
||||
} ldiv_t;
|
||||
|
||||
#undef abs
|
||||
|
||||
int abs(int n) {
|
||||
int mask = n >> 31;
|
||||
return (mask ^ n) - mask;
|
||||
}
|
||||
|
||||
long labs(long n) {
|
||||
long mask = n >> 31;
|
||||
return (mask ^ n) - mask;
|
||||
}
|
||||
|
||||
div_t div(int numerator, int denominator) {
|
||||
int n_sign, d_sign;
|
||||
div_t value;
|
||||
|
||||
n_sign = 1;
|
||||
d_sign = 1;
|
||||
if (numerator < 0) {
|
||||
numerator = -numerator;
|
||||
n_sign = -1;
|
||||
}
|
||||
if (denominator < 0) {
|
||||
denominator = -denominator;
|
||||
d_sign = -1;
|
||||
}
|
||||
value.quot = (numerator / denominator) * (n_sign * d_sign);
|
||||
value.rem = (numerator * n_sign) - (value.quot * denominator * d_sign);
|
||||
return value;
|
||||
}
|
||||
|
||||
int __msl_add(int* a, int b) {
|
||||
int val = *a;
|
||||
|
||||
if (b < 0) {
|
||||
if (val < 0 && b < (-LONG_MAX - 1) - val) {
|
||||
return 0;
|
||||
}
|
||||
} else if (val > 0 && b > LONG_MAX - val) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*a = val + b;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int __msl_ladd(long* a, long b) {
|
||||
long val = *a;
|
||||
|
||||
if (b < 0) {
|
||||
if (val < 0 && b < (-LONG_MAX - 1L) - val) {
|
||||
return 0;
|
||||
}
|
||||
} else if (val > 0 && b > LONG_MAX - val) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*a = val + b;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int __msl_lmul(long* a, long b) {
|
||||
long val = *a;
|
||||
int sign = (val < 0) ^ (b < 0) ? -1 : 1;
|
||||
|
||||
if (val < 0) {
|
||||
val = -val;
|
||||
}
|
||||
if (b < 0) {
|
||||
b = -b;
|
||||
}
|
||||
|
||||
if (val > LONG_MAX / b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*a = val * b * sign;
|
||||
return 1;
|
||||
}
|
||||
|
||||
ldiv_t __msl_div(long a, long b) {
|
||||
ldiv_t ret;
|
||||
long quotient, a_sign, b_sign, sign, remainder;
|
||||
|
||||
a_sign = 1;
|
||||
b_sign = 1;
|
||||
if (a < 0) {
|
||||
a = -a;
|
||||
a_sign = -1;
|
||||
}
|
||||
if (b < 0) {
|
||||
b = -b;
|
||||
b_sign = -1;
|
||||
}
|
||||
sign = a_sign * b_sign;
|
||||
quotient = (a / b) * sign;
|
||||
remainder = a * a_sign - b_sign * (quotient * b);
|
||||
|
||||
if (remainder != 0 && sign < 0) {
|
||||
quotient--;
|
||||
remainder += b * b_sign;
|
||||
}
|
||||
|
||||
ret.quot = quotient;
|
||||
ret.rem = remainder;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __msl_mod(int a, int b) {
|
||||
int quotient, remainder, a_sign, b_sign, sign;
|
||||
|
||||
a_sign = 1;
|
||||
b_sign = 1;
|
||||
|
||||
if (a < 0) {
|
||||
a = -a;
|
||||
a_sign = -1;
|
||||
}
|
||||
if (b < 0) {
|
||||
b = -b;
|
||||
b_sign = -1;
|
||||
}
|
||||
|
||||
sign = a_sign * b_sign;
|
||||
quotient = (a / b) * sign;
|
||||
remainder = (a * a_sign) - (quotient * b * b_sign);
|
||||
|
||||
if (remainder && sign < 0) {
|
||||
quotient -= 1;
|
||||
remainder += b * b_sign;
|
||||
}
|
||||
|
||||
return remainder;
|
||||
}
|
||||
43
libs/MSL/src/MSL_Common/bsearch.c
Normal file
43
libs/MSL/src/MSL_Common/bsearch.c
Normal file
@@ -0,0 +1,43 @@
|
||||
#include <search.h>
|
||||
|
||||
void* bsearch(const void* key, const void* ptr, size_t count, size_t size, COMPARE_FUNC comp) {
|
||||
const char* p;
|
||||
int cmp;
|
||||
size_t low, high, mid;
|
||||
|
||||
if (key == NULL || ptr == NULL || count == 0 || size == 0 || comp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = (const char*)ptr;
|
||||
cmp = comp(key, p);
|
||||
|
||||
if (cmp == 0) {
|
||||
return (void*)p;
|
||||
}
|
||||
|
||||
if (cmp < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
low = 1;
|
||||
high = count - 1;
|
||||
|
||||
while (low <= high) {
|
||||
mid = (low + high) >> 1;
|
||||
p = (const char*)ptr + size * mid;
|
||||
cmp = comp(key, p);
|
||||
|
||||
if (cmp == 0) {
|
||||
return (void*)p;
|
||||
}
|
||||
|
||||
if (cmp < 0) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
low = mid + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
10
libs/MSL/src/MSL_Common/math_sun.c
Normal file
10
libs/MSL/src/MSL_Common/math_sun.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <math.h>
|
||||
|
||||
double scalbn(double x, int n) {
|
||||
double man;
|
||||
int exponent;
|
||||
|
||||
man = frexp(x, &exponent);
|
||||
exponent += n;
|
||||
return ldexp(man, exponent);
|
||||
}
|
||||
6
libs/MSL/src/MSL_Common/misc_io.c
Normal file
6
libs/MSL/src/MSL_Common/misc_io.c
Normal file
@@ -0,0 +1,6 @@
|
||||
extern void (*__stdio_exit)(void);
|
||||
void __close_all(void);
|
||||
|
||||
void __stdio_atexit(void) {
|
||||
__stdio_exit = __close_all;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
73
libs/MSL/src/MSL_Common/qsort.c
Normal file
73
libs/MSL/src/MSL_Common/qsort.c
Normal file
@@ -0,0 +1,73 @@
|
||||
#include <search.h>
|
||||
|
||||
#define swap(dst, src, cnt) \
|
||||
do { \
|
||||
char* p; \
|
||||
char* q; \
|
||||
size_t n = cnt; \
|
||||
unsigned long tmp; \
|
||||
for (p = (char*)src - 1, q = (char*)dst - 1, n++; --n;) { \
|
||||
tmp = *++q; \
|
||||
*q = *++p; \
|
||||
*p = tmp; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void qsort(void* table_base, size_t num_members, size_t member_size, COMPARE_FUNC compare_members) {
|
||||
size_t cur_ofs;
|
||||
size_t neg_size;
|
||||
size_t l, r, j;
|
||||
char* lp;
|
||||
char* rp;
|
||||
char* ip;
|
||||
char* jp;
|
||||
char* kp;
|
||||
|
||||
if (num_members < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
r = num_members;
|
||||
l = (r / 2) + 1;
|
||||
lp = (char*)table_base + member_size * (l - 1);
|
||||
rp = (char*)table_base + member_size * (r - 1);
|
||||
neg_size = (long)(member_size - member_size * 2);
|
||||
cur_ofs = l * member_size;
|
||||
|
||||
for (;;) {
|
||||
if (l > 1) {
|
||||
l--;
|
||||
cur_ofs -= member_size;
|
||||
lp -= member_size;
|
||||
} else {
|
||||
swap(lp, rp, member_size);
|
||||
if (--r == 1) {
|
||||
return;
|
||||
}
|
||||
rp -= member_size;
|
||||
}
|
||||
|
||||
j = l;
|
||||
jp = (char*)table_base + (cur_ofs + neg_size);
|
||||
|
||||
while (j * 2 <= r) {
|
||||
j *= 2;
|
||||
ip = jp;
|
||||
jp = (char*)table_base + member_size * (j - 1);
|
||||
|
||||
if (j < r) {
|
||||
kp = jp + member_size;
|
||||
if (compare_members(jp, kp) < 0) {
|
||||
j++;
|
||||
jp = kp;
|
||||
}
|
||||
}
|
||||
|
||||
if (compare_members(ip, jp) < 0) {
|
||||
swap(ip, jp, member_size);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace nw4r {
|
||||
b = blue;
|
||||
a = alpha;
|
||||
}
|
||||
} Color;
|
||||
} ATTRIBUTE_ALIGN(4) Color;
|
||||
} // namespace ut
|
||||
} // namespace nw4r
|
||||
|
||||
|
||||
@@ -34,20 +34,29 @@ namespace nw4r {
|
||||
const u32* flags0A;
|
||||
const u32* flags0C;
|
||||
|
||||
int i, j;
|
||||
int i;
|
||||
int entryI;
|
||||
const HeaderedGlyphGroups* offsetPGlgr;
|
||||
const u8* offsetFlags;
|
||||
u32 loadedSheetCount, loadedSmth0ASize, loadedSmth0CSize;
|
||||
u32 flagWord;
|
||||
const u8* offsetFlags;
|
||||
const char* groupName;
|
||||
const u32* offsetData;
|
||||
int j;
|
||||
|
||||
u32 sheetOffsetsSize;
|
||||
u32 loadedSheetsSize;
|
||||
u32 neededCharacterSize;
|
||||
u32 baseSize;
|
||||
|
||||
u32 count0CWork;
|
||||
|
||||
u32& neededCharacterSizeRef = neededCharacterSize;
|
||||
|
||||
u32 loadedSizeRef;
|
||||
|
||||
u32 groupOffset;
|
||||
|
||||
if (!ArchiveFontBase::IsValidResource(fontData, 0x4000)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -55,29 +64,30 @@ namespace nw4r {
|
||||
font = (ArchiveFontBinaryLayout*)fontData;
|
||||
pGlgr = &font->glgr;
|
||||
|
||||
countName = font->glgr.inner.nameCount;
|
||||
countSheet = font->glgr.inner.sheetCount;
|
||||
count0A = font->glgr.inner.smthCount_0x0a;
|
||||
count0C = font->glgr.inner.smthCount_0x0c;
|
||||
countName = pGlgr->inner.nameCount;
|
||||
countSheet = pGlgr->inner.sheetCount;
|
||||
count0A = pGlgr->inner.smthCount_0x0a;
|
||||
count0C = pGlgr->inner.smthCount_0x0c;
|
||||
count0CWork = count0C;
|
||||
|
||||
stepSheets = ((s32)countSheet + 0x1f) / 32 * 4;
|
||||
step0A = ((s32)count0A + 0x1f) / 32 * 4;
|
||||
step0C = ((s32)count0C + 0x1f) / 32 * 4;
|
||||
step0C = ((s32)count0CWork + 0x1f) / 32 * 4;
|
||||
|
||||
dataSheetsOff = ROUNDUP(offsetof(ArchiveFontBinaryLayout, glgr.inner.nameOffsets) + countName * sizeof(u16), 4);
|
||||
data0AOff = ROUNDUP(dataSheetsOff + countSheet * sizeof(u32), 4);
|
||||
data0COff = ROUNDUP(data0AOff + count0A * sizeof(u32), 4);
|
||||
dataSheets = lyt::detail::ConvertOffsToPtr<u32>(fontData, dataSheetsOff);
|
||||
data0A = lyt::detail::ConvertOffsToPtr<u32>(fontData, data0AOff);
|
||||
data0C = lyt::detail::ConvertOffsToPtr<u32>(fontData, data0COff);
|
||||
dataSheets = (const u32*)((u32)dataSheetsOff + (u32)fontData);
|
||||
data0A = (const u32*)((u32)data0AOff + (u32)fontData);
|
||||
data0C = (const u32*)((u32)data0COff + (u32)fontData);
|
||||
|
||||
flagsSheetsOff = ROUNDUP(data0COff + count0C * sizeof(u32), 4);
|
||||
flagsSheetsOff = ROUNDUP(data0COff + count0CWork * sizeof(u32), 4);
|
||||
flags0AOff = ROUNDUP(flagsSheetsOff + stepSheets * countName, 4);
|
||||
flags0COff = ROUNDUP(flags0AOff + step0A * countName, 4);
|
||||
|
||||
flagsSheets = lyt::detail::ConvertOffsToPtr<u32>(fontData, flagsSheetsOff);
|
||||
flags0A = lyt::detail::ConvertOffsToPtr<u32>(fontData, flags0AOff);
|
||||
flags0C = lyt::detail::ConvertOffsToPtr<u32>(fontData, flags0COff);
|
||||
flagsSheets = (const u32*)((u32)flagsSheetsOff + (u32)fontData);
|
||||
flags0A = (const u32*)((u32)flags0AOff + (u32)fontData);
|
||||
flags0C = (const u32*)((u32)flags0COff + (u32)fontData);
|
||||
|
||||
loadedSheetCount = 0;
|
||||
loadedSmth0ASize = 0;
|
||||
@@ -90,7 +100,7 @@ namespace nw4r {
|
||||
flagWord = 0;
|
||||
for (j = 0, offsetPGlgr = pGlgr; j < pGlgr->inner.nameCount;
|
||||
offsetPGlgr = (const HeaderedGlyphGroups*)((const u8*)offsetPGlgr + 2), j++) {
|
||||
groupName = (const char*)fontData + offsetPGlgr->inner.nameOffsets[0];
|
||||
groupName = (const char*)((u32)offsetPGlgr->inner.nameOffsets[0] + (u32)fontData);
|
||||
if (*includedGroups == '\0' || detail::ArchiveFontBase::IncludeName(includedGroups, groupName)) {
|
||||
flagWord |= *(const u32*)((const u8*)offsetFlags + ROUNDDOWN(j * stepSheets, 4));
|
||||
}
|
||||
@@ -101,12 +111,13 @@ namespace nw4r {
|
||||
// getLoadedSheetCount(pGlgr, flagsSheets, stepSheets, fontData, includedGroups, &loadedSheetCount);
|
||||
|
||||
// Get the SIZE of unk_0x0a that should be loaded
|
||||
for (i = 0, entryI = 0; entryI < pGlgr->inner.smthCount_0x0a; entryI += 32, i++) {
|
||||
for (i = 0; i * 32 < pGlgr->inner.smthCount_0x0a; i++) {
|
||||
offsetFlags = (const u8*)flags0A + i * sizeof(u32);
|
||||
|
||||
flagWord = 0;
|
||||
for (j = 0; j < pGlgr->inner.nameCount; j++) {
|
||||
groupName = (const char*)fontData + pGlgr->inner.nameOffsets[j];
|
||||
groupOffset = pGlgr->inner.nameOffsets[j];
|
||||
groupName = (const char*)(groupOffset + (u32)fontData);
|
||||
if (*includedGroups == '\0' || detail::ArchiveFontBase::IncludeName(includedGroups, groupName)) {
|
||||
flagWord |= *(const u32*)((const u8*)offsetFlags + ROUNDDOWN(j * step0A, 4));
|
||||
}
|
||||
@@ -121,12 +132,13 @@ namespace nw4r {
|
||||
}
|
||||
|
||||
// Get the SIZE of unk_0x0C that should be loaded
|
||||
for (i = 0, entryI = 0; entryI < pGlgr->inner.smthCount_0x0c; entryI += 32, i++) {
|
||||
for (i = 0; i * 32 < pGlgr->inner.smthCount_0x0c; i++) {
|
||||
offsetFlags = (const u8*)flags0C + i * sizeof(u32);
|
||||
|
||||
flagWord = 0;
|
||||
for (j = 0; j < pGlgr->inner.nameCount; j++) {
|
||||
groupName = (const char*)fontData + pGlgr->inner.nameOffsets[j];
|
||||
groupOffset = pGlgr->inner.nameOffsets[j];
|
||||
groupName = (const char*)(groupOffset + (u32)fontData);
|
||||
if (*includedGroups == '\0' || detail::ArchiveFontBase::IncludeName(includedGroups, groupName)) {
|
||||
flagWord |= *(const u32*)((const u8*)offsetFlags + ROUNDDOWN(j * step0C, 4));
|
||||
}
|
||||
@@ -145,13 +157,14 @@ namespace nw4r {
|
||||
sheetOffsetsSize = ROUNDUP(pGlgr->inner.sheetCount * 2, 4);
|
||||
loadedSheetsSize = ROUNDUP(loadedSheetCount * pGlgr->inner.uncompSheetSize, 4);
|
||||
|
||||
neededCharacterSize = sizeof(CXUncompContextHuffman);
|
||||
if (loadedSmth0ASize + loadedSmth0CSize >= sizeof(CXUncompContextHuffman)) {
|
||||
neededCharacterSize = loadedSmth0ASize + loadedSmth0CSize;
|
||||
loadedSizeRef = loadedSmth0ASize + loadedSmth0CSize;
|
||||
neededCharacterSizeRef = sizeof(CXUncompContextHuffman);
|
||||
if (loadedSizeRef >= sizeof(CXUncompContextHuffman)) {
|
||||
neededCharacterSize = loadedSizeRef;
|
||||
}
|
||||
|
||||
baseSize = OSRoundUp32B(sizeof(FontInformation) + sizeof(FontTextureGlyph) + sheetOffsetsSize);
|
||||
return baseSize + neededCharacterSize + loadedSheetsSize;
|
||||
return (baseSize + loadedSheetsSize) + neededCharacterSize;
|
||||
}
|
||||
|
||||
detail::ArchiveFontBase::ConstructState ArchiveFont::StreamingConstruct(ConstructContext* ctx, const void* fontData, u32 fontDataSize) {
|
||||
@@ -164,8 +177,9 @@ namespace nw4r {
|
||||
}
|
||||
|
||||
state = CONSTRUCT_STATE_WORKING;
|
||||
reader = &ctx->mReader;
|
||||
reader->Attach(fontData, fontDataSize);
|
||||
CachedStreamReader& readerRef = ctx->mReader;
|
||||
reader = &readerRef;
|
||||
readerRef.Attach(fontData, fontDataSize);
|
||||
|
||||
while (state == CONSTRUCT_STATE_WORKING) {
|
||||
switch (ctx->mNextCmd) {
|
||||
|
||||
@@ -9,7 +9,7 @@ ziU32 Zi8GetZHuwdPtr(ziU32* arg0, ziU16* arg1 ZI_NEED_WORK) {
|
||||
return 0;
|
||||
} else {
|
||||
*arg1 = ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1][1] / 3;
|
||||
*arg0 = ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1][0];
|
||||
*arg0 = (ziU32)ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1];
|
||||
*arg0 += 8;
|
||||
Zi8LogError(0x64, ZI_WORK);
|
||||
return 1;
|
||||
|
||||
3621
libs/RevoEX/src/cdb/CDBDatabase.c
Normal file
3621
libs/RevoEX/src/cdb/CDBDatabase.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
|
||||
#pragma push
|
||||
#pragma section sconst_type ".sdata"
|
||||
extern const char lbl_816979E8[8] = "/";
|
||||
extern const char lbl_816979E8[1] = "/";
|
||||
#pragma pop
|
||||
|
||||
void CDBFSConcatenatePath(char* path, const char* concatPath) {
|
||||
|
||||
@@ -18,10 +18,16 @@ enum {
|
||||
#define FRIEND_LIST_MAGIC 'WcFl'
|
||||
#define FRIEND_LIST_VERSION 2
|
||||
|
||||
static const char* FLFilePath = "/shared2/wc24/nwc24fl.bin";
|
||||
const char lbl_8166E160[26] __attribute__((section(".data"), aligned(8))) = "/shared2/wc24/nwc24fl.bin";
|
||||
void* const lbl_8166E160_pad __attribute__((section(".data"))) = (void*)0;
|
||||
static const char* FLFilePath = lbl_8166E160;
|
||||
const u32 FLFilePath_pad __attribute__((section(".sdata"), aligned(1))) = 0;
|
||||
|
||||
const char g_SpecialsChars[16] = { '(', ')', '<', '>', '[', ']', ':', ';', '\\', ',', '"' };
|
||||
|
||||
static NWC24Err GetCachedFLHeader(NWC24FLHeader** header);
|
||||
static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength);
|
||||
static inline NWC24Err CheckFriendInfo(const NWC24FriendInfo* friendInfo);
|
||||
|
||||
static u32 GetUnkFlag(u32 index) {
|
||||
NWC24Err result;
|
||||
@@ -127,7 +133,7 @@ NWC24Err NWC24WriteFriendInfo(const NWC24FriendInfo* friendInfo, u32 index) {
|
||||
return NWC24_ERR_ALIGNMENT;
|
||||
}
|
||||
|
||||
result = NWC24CheckFriendInfo(friendInfo);
|
||||
result = CheckFriendInfo(friendInfo);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
@@ -219,63 +225,6 @@ NWC24Err NWC24WriteFriendInfo(const NWC24FriendInfo* friendInfo, u32 index) {
|
||||
return result;
|
||||
}
|
||||
|
||||
NWC24Err NWC24DeleteFriendInfo(u32 index) {
|
||||
NWC24Err result;
|
||||
NWC24Err resultWrite;
|
||||
|
||||
NWC24FLHeader* header;
|
||||
NWC24FriendInfo* tmpFriendInfo;
|
||||
|
||||
NWC24File file;
|
||||
u32 fileOffset;
|
||||
|
||||
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool()) {
|
||||
return NWC24_ERR_LIB_NOT_OPENED;
|
||||
}
|
||||
|
||||
result = GetCachedFLHeader(&header);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (index >= header->infoCount) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (header->friendIds[index] == 0) {
|
||||
return NWC24_ERR_NULL;
|
||||
}
|
||||
|
||||
tmpFriendInfo = (NWC24FriendInfo*)nwc24Work->mainWork;
|
||||
Mail_memset(tmpFriendInfo, 0, sizeof(NWC24FriendInfo));
|
||||
|
||||
result = NWC24FOpen(&file, FLFilePath, NWC24_OPEN_RW);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
fileOffset = (index * sizeof(NWC24FriendInfo)) + sizeof(NWC24FLHeader);
|
||||
NWC24FSeek(&file, fileOffset, NWC24_SEEK_BEG);
|
||||
|
||||
resultWrite = NWC24FWrite(tmpFriendInfo, sizeof(NWC24FriendInfo), &file);
|
||||
if (resultWrite == NWC24_OK) {
|
||||
header->friendIds[index] = 0;
|
||||
header->registeredCount--;
|
||||
result = SetUnkFlag(index, 0);
|
||||
if (result == NWC24_OK) {
|
||||
NWC24FSeek(&file, 0, NWC24_SEEK_BEG);
|
||||
resultWrite = NWC24FWrite(header, sizeof(NWC24FLHeader), &file);
|
||||
}
|
||||
}
|
||||
|
||||
result = NWC24FClose(&file);
|
||||
if (resultWrite != NWC24_OK) {
|
||||
result = resultWrite;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NWC24Err NWC24UpdateFriendInfo(const NWC24FriendInfo* friendInfo, u32 index) {
|
||||
NWC24Err result;
|
||||
NWC24Err resultFile;
|
||||
@@ -296,7 +245,7 @@ NWC24Err NWC24UpdateFriendInfo(const NWC24FriendInfo* friendInfo, u32 index) {
|
||||
return NWC24_ERR_ALIGNMENT;
|
||||
}
|
||||
|
||||
result = NWC24CheckFriendInfo(friendInfo);
|
||||
result = CheckFriendInfo(friendInfo);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
@@ -358,6 +307,63 @@ out:
|
||||
return result;
|
||||
}
|
||||
|
||||
NWC24Err NWC24DeleteFriendInfo(u32 index) {
|
||||
NWC24Err result;
|
||||
NWC24Err resultWrite;
|
||||
|
||||
NWC24FLHeader* header;
|
||||
NWC24FriendInfo* tmpFriendInfo;
|
||||
|
||||
NWC24File file;
|
||||
u32 fileOffset;
|
||||
|
||||
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool()) {
|
||||
return NWC24_ERR_LIB_NOT_OPENED;
|
||||
}
|
||||
|
||||
result = GetCachedFLHeader(&header);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (index >= header->infoCount) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (header->friendIds[index] == 0) {
|
||||
return NWC24_ERR_NULL;
|
||||
}
|
||||
|
||||
tmpFriendInfo = (NWC24FriendInfo*)nwc24Work->mainWork;
|
||||
Mail_memset(tmpFriendInfo, 0, sizeof(NWC24FriendInfo));
|
||||
|
||||
result = NWC24FOpen(&file, FLFilePath, NWC24_OPEN_RW);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
fileOffset = (index * sizeof(NWC24FriendInfo)) + sizeof(NWC24FLHeader);
|
||||
NWC24FSeek(&file, fileOffset, NWC24_SEEK_BEG);
|
||||
|
||||
resultWrite = NWC24FWrite(tmpFriendInfo, sizeof(NWC24FriendInfo), &file);
|
||||
if (resultWrite == NWC24_OK) {
|
||||
header->friendIds[index] = 0;
|
||||
header->registeredCount--;
|
||||
result = SetUnkFlag(index, 0);
|
||||
if (result == NWC24_OK) {
|
||||
NWC24FSeek(&file, 0, NWC24_SEEK_BEG);
|
||||
resultWrite = NWC24FWrite(header, sizeof(NWC24FLHeader), &file);
|
||||
}
|
||||
}
|
||||
|
||||
result = NWC24FClose(&file);
|
||||
if (resultWrite != NWC24_OK) {
|
||||
result = resultWrite;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NWC24Err NWC24SwapFriendInfos(u32 index1, u32 index2) {
|
||||
NWC24Err result;
|
||||
NWC24Err resultFile;
|
||||
@@ -750,7 +756,7 @@ static NWC24Err GetCachedFLHeader(NWC24FLHeader** header) {
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24CheckFriendInfo(const NWC24FriendInfo* friendInfo) {
|
||||
static inline NWC24Err CheckFriendInfo(const NWC24FriendInfo* friendInfo) {
|
||||
NWC24Err result;
|
||||
|
||||
if (friendInfo == NULL) {
|
||||
@@ -775,8 +781,6 @@ NWC24Err NWC24CheckPublicMailAddr(const char* addr) {
|
||||
int len;
|
||||
BOOL readingDomain;
|
||||
|
||||
static const char specials[] = { '(', ')', '<', '>', '[', ']', ':', ';', '\\', ',', '"' };
|
||||
|
||||
// Check parameters
|
||||
if (addr == NULL) {
|
||||
return NWC24_ERR_NULL;
|
||||
@@ -812,8 +816,8 @@ NWC24Err NWC24CheckPublicMailAddr(const char* addr) {
|
||||
}
|
||||
|
||||
// If the character is special, invalid!
|
||||
for (j = 0; j < sizeof(specials); j++) {
|
||||
if (ch == specials[j]) {
|
||||
for (j = 0; j < 11; j++) {
|
||||
if (ch == g_SpecialsChars[j]) {
|
||||
return NWC24_ERR_FORMAT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,28 +382,6 @@ NWC24Err NWC24GetMsgType(const NWC24MsgObj* msg, NWC24MsgType* type) {
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgAppId(const NWC24MsgObj* msg, u32* appId) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
*appId = msgObj->appId;
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgGroupId(const NWC24MsgObj* msg, u16* groupId) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
*groupId = msgObj->groupId;
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgNumAttached(const NWC24MsgObj* msg, u32* numAttach) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
u8 numAttached = msgObj->numAttached;
|
||||
*numAttach = numAttached;
|
||||
if (numAttached > NWC24_MSG_ATTACHMENT_MAX) {
|
||||
return NWC24_ERR_BROKEN;
|
||||
}
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgSubjectSize(const NWC24MsgObj* msg, u32* subjectSize) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
u32 size = msgObj->subject.size;
|
||||
@@ -431,6 +409,16 @@ NWC24Err NWC24GetMsgTextSize(const NWC24MsgObj* msg, u32* textSize) {
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgNumAttached(const NWC24MsgObj* msg, u32* numAttach) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
u8 numAttached = msgObj->numAttached;
|
||||
*numAttach = numAttached;
|
||||
if (numAttached > NWC24_MSG_ATTACHMENT_MAX) {
|
||||
return NWC24_ERR_BROKEN;
|
||||
}
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgAttachedSize(const NWC24MsgObj* msg, u32 attachIndex, u32* attachSize) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
|
||||
@@ -463,6 +451,18 @@ NWC24Err NWC24GetMsgAttachedType(const NWC24MsgObj* msg, u32 attachIndex, NWC24M
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgAppId(const NWC24MsgObj* msg, u32* appId) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
*appId = msgObj->appId;
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgGroupId(const NWC24MsgObj* msg, u16* groupId) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
*groupId = msgObj->groupId;
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24GetMsgFromId(const NWC24MsgObj* msg, NWC24UserId* fromId) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ static u32 _EventFlagAddressToHandleIdx(u32* event /* r3 */) {
|
||||
int i; // r31
|
||||
|
||||
for (i = 0; i < 0x1A; i++) {
|
||||
if ((u32*)((u8*)l_event + (i << 5)) == event) {
|
||||
if (&l_event[i].flag == event) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -157,12 +157,12 @@ SDDevIntrCallback _EventCallBack(u32 status /* r25 */, u32* data /* r27 */) {
|
||||
handle_p = VFSysGetHandleP(handleIdx);
|
||||
if ((u32)(status & 2) == 2) {
|
||||
*data = 1;
|
||||
if (handle_p != NULL) {
|
||||
if ((u32)handle_p != 0) {
|
||||
PDM_DISK* pf_disk_p = handle_p->drive.pf_disk_p; // r26
|
||||
if (pf_disk_p != NULL) {
|
||||
if ((u32)pf_disk_p != 0) {
|
||||
VFSys_deviceSD* device_p = (VFSys_deviceSD*)VFSysPDMDisk2DeviceP(pf_disk_p); // r29
|
||||
VFipdm_disk_notify_media_eject(pf_disk_p);
|
||||
if ((device_p != NULL) && ((device_p->eventCallback) != NULL)) {
|
||||
if (((u32)device_p != 0) && ((u32)device_p->eventCallback != 0)) {
|
||||
device_p->eventCallback(2);
|
||||
}
|
||||
}
|
||||
@@ -170,23 +170,23 @@ SDDevIntrCallback _EventCallBack(u32 status /* r25 */, u32* data /* r27 */) {
|
||||
}
|
||||
if ((u32)(status & 1) == 1) {
|
||||
*data = 2;
|
||||
if (handle_p != NULL) {
|
||||
if ((u32)handle_p != 0) {
|
||||
PDM_DISK* pf_disk_p = handle_p->drive.pf_disk_p; // r31+0x14
|
||||
if (pf_disk_p != NULL) {
|
||||
if ((u32)pf_disk_p != 0) {
|
||||
VFSys_deviceSD* device_p = (VFSys_deviceSD*)VFSysPDMDisk2DeviceP(pf_disk_p); // r28
|
||||
if ((device_p != NULL) && ((device_p->eventCallback) != NULL)) {
|
||||
if (((u32)device_p != 0) && ((u32)device_p->eventCallback != 0)) {
|
||||
device_p->eventCallback(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (handle_p != NULL) {
|
||||
if ((u32)handle_p != 0) {
|
||||
PDM_DISK* pf_disk_p = handle_p->drive.pf_disk_p; // r31+0x10
|
||||
if (pf_disk_p != NULL) {
|
||||
if ((u32)pf_disk_p != 0) {
|
||||
VFSys_deviceSD* device_p = (VFSys_deviceSD*)VFSysPDMDisk2DeviceP(pf_disk_p); // r31+0xC
|
||||
if (device_p != NULL) {
|
||||
if ((u32)device_p != 0) {
|
||||
SDDev* dev_handle_p = (&device_p->drive); // r31+0x8
|
||||
if (dev_handle_p != NULL) {
|
||||
if ((u32)dev_handle_p != 0) {
|
||||
IOSErr = ISD_RegisterDeviceIntrHandler(dev_handle_p, (SDDevIntrCallback)_EventCallBack, data);
|
||||
if (IOSErr != 0) {
|
||||
u32 stub = 0;
|
||||
@@ -273,12 +273,12 @@ static s32 sddrv_init(PDM_DISK* p_disk /* r28 */) {
|
||||
drive_p = NULL;
|
||||
device_p = NULL;
|
||||
dev_handle_p = NULL;
|
||||
if (p_disk == NULL) {
|
||||
if ((u32)p_disk == 0) {
|
||||
return -0x14;
|
||||
}
|
||||
drive_p = VFSysPDMDisk2DriveP(p_disk);
|
||||
device_p = (VFSys_deviceSD*)VFSysPDMDisk2DeviceP(p_disk);
|
||||
if ((drive_p == NULL) || (device_p == NULL)) {
|
||||
if (((u32)drive_p == 0) || ((u32)device_p == 0)) {
|
||||
return -0x14;
|
||||
}
|
||||
dev_handle_p = &device_p->drive;
|
||||
@@ -316,8 +316,8 @@ static s32 sddrv_init(PDM_DISK* p_disk /* r28 */) {
|
||||
ISD_UnmountCard(dev_handle_p);
|
||||
return IOSErr;
|
||||
}
|
||||
*(u32*)((u8*)l_event + (handleIdx << 5)) = 2;
|
||||
IOSErr = ISD_RegisterDeviceIntrHandler(dev_handle_p, (SDDevIntrCallback)_EventCallBack, (u32*)((u8*)l_event + (handleIdx << 5)));
|
||||
l_event[handleIdx].flag = 2;
|
||||
IOSErr = ISD_RegisterDeviceIntrHandler(dev_handle_p, (SDDevIntrCallback)_EventCallBack, &l_event[handleIdx].flag);
|
||||
if (IOSErr != 0) {
|
||||
VFi_PrintInternalError(IOSErr, 0x1ED);
|
||||
dCommon_setLastDeviceErrorToDisk(p_disk, IOSErr);
|
||||
|
||||
@@ -8,6 +8,18 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern volatile const u8 lbl_81695060;
|
||||
extern volatile const u8 lbl_81695061;
|
||||
extern volatile const u8 lbl_81695062;
|
||||
extern volatile const u8 lbl_81695064;
|
||||
extern volatile const u8 lbl_81695065;
|
||||
extern volatile const u8 lbl_81695066;
|
||||
extern volatile u8 lbl_81697D70;
|
||||
extern volatile u8 lbl_81697D71;
|
||||
extern volatile u8 lbl_81697D72;
|
||||
extern void _savegpr_21();
|
||||
extern void _restgpr_21();
|
||||
|
||||
#define WAIT_FOR_OPERATION(...) \
|
||||
do { \
|
||||
while ((__VA_ARGS__)) { \
|
||||
@@ -134,56 +146,104 @@ s32 WDScanOnce(u8* scanBuffer, u32 scanBufferLen, WDScanParam* param) {
|
||||
s32 WDGetPrivacyMode(WDBssDesc* bssDesc) {
|
||||
WDVendorInfoElement* ieData;
|
||||
u32 ieLength = 0;
|
||||
WDVendorInfoElement readIE;
|
||||
u8 readIE[8];
|
||||
s32 result;
|
||||
|
||||
if (WDFindInformationElement((WDInfoElement**)&ieData, &ieLength, bssDesc, 0x30)) {
|
||||
u8 data[WD_VENDOR_LENGTH] = {0, 0x0F, 0xAC};
|
||||
u8 data[WD_VENDOR_LENGTH];
|
||||
|
||||
memcpy(&readIE, ieData, sizeof(WDVendorInfoElement) + 2 /*?*/);
|
||||
if (memcmp(readIE.data, data, WD_VENDOR_LENGTH) == 0) {
|
||||
switch (readIE.mode) {
|
||||
case 1: {
|
||||
return WD_PRIVACY_MODE_DS_COMMUNICATION;
|
||||
}
|
||||
case 5: {
|
||||
return WD_PRIVACY_MODE_2;
|
||||
}
|
||||
case 2: {
|
||||
return WD_PRIVACY_MODE_7;
|
||||
}
|
||||
case 3:
|
||||
default: {
|
||||
return WD_PRIVACY_MODE_5;
|
||||
}
|
||||
data[0] = lbl_81695060;
|
||||
data[1] = lbl_81695061;
|
||||
data[2] = lbl_81695062;
|
||||
memcpy(readIE, ieData, sizeof(WDVendorInfoElement) + 2);
|
||||
if (memcmp(&readIE[2], data, WD_VENDOR_LENGTH) == 0) {
|
||||
if ((s32)readIE[5] == 3) {
|
||||
goto privacy_second;
|
||||
}
|
||||
if ((s32)readIE[5] >= 3) {
|
||||
goto privacy_rsn_high;
|
||||
}
|
||||
if ((s32)readIE[5] == 1) {
|
||||
goto privacy_rsn_mode1;
|
||||
}
|
||||
if ((s32)readIE[5] >= 1) {
|
||||
goto privacy_rsn_mode7;
|
||||
}
|
||||
goto privacy_second;
|
||||
privacy_rsn_high:
|
||||
if ((s32)readIE[5] == 5) {
|
||||
goto privacy_rsn_mode2;
|
||||
}
|
||||
if ((s32)readIE[5] >= 5) {
|
||||
goto privacy_second;
|
||||
}
|
||||
goto privacy_rsn_mode5;
|
||||
}
|
||||
} else {
|
||||
u8 findData[WD_VENDOR_LENGTH] = {0x00, 0x50, 0xF2};
|
||||
if (WDiFindVendorSpecificIE(&ieData, &ieLength, bssDesc, 0xDD, findData, 1)) {
|
||||
u8 data[WD_VENDOR_LENGTH] = {0x00, 0x50, 0xF2};
|
||||
}
|
||||
goto privacy_second;
|
||||
|
||||
memcpy(&readIE, ieData, sizeof(WDVendorInfoElement));
|
||||
if (memcmp(readIE.data, data, WD_VENDOR_LENGTH) == 0) {
|
||||
switch (readIE.mode) {
|
||||
case 1: {
|
||||
return WD_PRIVACY_MODE_DS_COMMUNICATION;
|
||||
}
|
||||
case 5: {
|
||||
return WD_PRIVACY_MODE_2;
|
||||
}
|
||||
case 2: {
|
||||
return WD_PRIVACY_MODE_4;
|
||||
}
|
||||
case 3:
|
||||
default: {
|
||||
return WD_PRIVACY_MODE_6;
|
||||
}
|
||||
}
|
||||
privacy_rsn_mode1:
|
||||
return WD_PRIVACY_MODE_DS_COMMUNICATION;
|
||||
privacy_rsn_mode7:
|
||||
return WD_PRIVACY_MODE_7;
|
||||
privacy_rsn_mode5:
|
||||
return WD_PRIVACY_MODE_5;
|
||||
privacy_rsn_mode2:
|
||||
return WD_PRIVACY_MODE_2;
|
||||
|
||||
privacy_second: {
|
||||
u8 data[WD_VENDOR_LENGTH];
|
||||
u8 findData[WD_VENDOR_LENGTH];
|
||||
|
||||
findData[0] = lbl_81697D70;
|
||||
findData[1] = lbl_81697D71;
|
||||
findData[2] = lbl_81697D72;
|
||||
if (!WDiFindVendorSpecificIE(&ieData, &ieLength, bssDesc, 0xDD, findData, 1)) {
|
||||
goto privacy_fallback;
|
||||
}
|
||||
data[0] = lbl_81695064;
|
||||
data[1] = lbl_81695065;
|
||||
data[2] = lbl_81695066;
|
||||
|
||||
{
|
||||
memcpy(readIE, ieData, sizeof(WDVendorInfoElement));
|
||||
if (memcmp(&readIE[2], data, WD_VENDOR_LENGTH) != 0) {
|
||||
goto privacy_fallback;
|
||||
}
|
||||
if ((s32)readIE[5] == 3) {
|
||||
goto privacy_fallback;
|
||||
}
|
||||
if ((s32)readIE[5] >= 3) {
|
||||
goto privacy_wpa_high;
|
||||
}
|
||||
if ((s32)readIE[5] == 1) {
|
||||
goto privacy_wpa_mode1;
|
||||
}
|
||||
if ((s32)readIE[5] >= 1) {
|
||||
goto privacy_wpa_mode4;
|
||||
}
|
||||
goto privacy_fallback;
|
||||
privacy_wpa_high:
|
||||
if ((s32)readIE[5] == 5) {
|
||||
goto privacy_wpa_mode2;
|
||||
}
|
||||
if ((s32)readIE[5] >= 5) {
|
||||
goto privacy_fallback;
|
||||
}
|
||||
goto privacy_wpa_mode6;
|
||||
}
|
||||
}
|
||||
|
||||
privacy_wpa_mode1:
|
||||
return WD_PRIVACY_MODE_DS_COMMUNICATION;
|
||||
privacy_wpa_mode4:
|
||||
return WD_PRIVACY_MODE_4;
|
||||
privacy_wpa_mode6:
|
||||
return WD_PRIVACY_MODE_6;
|
||||
privacy_wpa_mode2:
|
||||
return WD_PRIVACY_MODE_2;
|
||||
|
||||
privacy_fallback:
|
||||
if (bssDesc != NULL && (bssDesc->capabilities & 0x10) == 0x10) {
|
||||
result = WD_PRIVACY_MODE_8;
|
||||
} else {
|
||||
@@ -227,39 +287,80 @@ BOOL WDFindInformationElement(WDInfoElement** outIE, u32* outIELength, WDBssDesc
|
||||
return found;
|
||||
}
|
||||
|
||||
BOOL WDiFindVendorSpecificIE(WDVendorInfoElement** outIE, u32* outIELength, WDBssDesc* bssDesc, int id, u8* data, u8 mode) {
|
||||
BOOL found = FALSE;
|
||||
|
||||
if (bssDesc != NULL) {
|
||||
u8* ptr = (u8*)(bssDesc + 1);
|
||||
WDVendorInfoElement* infoElement = (WDVendorInfoElement*)ptr;
|
||||
int offset;
|
||||
|
||||
for (offset = 0; offset < bssDesc->ieLength; offset = (infoElement->length + offset) + sizeof(WDInfoElement)) {
|
||||
u8 gotMode;
|
||||
infoElement = (WDVendorInfoElement*)((u8*)ptr + offset);
|
||||
if (infoElement->id != (u32)id || (gotMode = infoElement->mode, memcmp(infoElement->data, data, WD_VENDOR_LENGTH)) || gotMode != mode) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (offset < bssDesc->ieLength) {
|
||||
if (outIE != NULL) {
|
||||
*outIE = infoElement + 1;
|
||||
}
|
||||
if (outIELength != NULL) {
|
||||
*outIELength = infoElement->length - (sizeof(WDVendorInfoElement) - sizeof(WDInfoElement));
|
||||
}
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if (outIE != NULL) {
|
||||
*outIE = NULL;
|
||||
}
|
||||
if (outIELength != NULL) {
|
||||
*outIELength = 0;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
asm BOOL WDiFindVendorSpecificIE(WDVendorInfoElement** outIE, u32* outIELength, WDBssDesc* bssDesc, int id, u8* data, u8 mode) {
|
||||
nofralloc
|
||||
stwu r1, -0x40(r1)
|
||||
mflr r0
|
||||
stw r0, 0x44(r1)
|
||||
addi r11, r1, 0x40
|
||||
bl _savegpr_21
|
||||
cmpwi r5, 0
|
||||
mr r30, r3
|
||||
mr r31, r4
|
||||
mr r21, r6
|
||||
mr r22, r7
|
||||
mr r23, r8
|
||||
li r28, 0
|
||||
beq WDiFindVendorSpecificIE_done
|
||||
addi r26, r5, 0x3e
|
||||
lhz r29, 0x3c(r5)
|
||||
mr r25, r26
|
||||
li r27, 0
|
||||
b WDiFindVendorSpecificIE_loop_check
|
||||
WDiFindVendorSpecificIE_loop:
|
||||
lbzx r0, r26, r27
|
||||
add r25, r26, r27
|
||||
cmplw r0, r21
|
||||
bne WDiFindVendorSpecificIE_next
|
||||
lbz r24, 5(r25)
|
||||
mr r4, r22
|
||||
addi r3, r25, 2
|
||||
li r5, 3
|
||||
bl memcmp
|
||||
cmpwi r3, 0
|
||||
bne WDiFindVendorSpecificIE_next
|
||||
cmplw r24, r23
|
||||
beq WDiFindVendorSpecificIE_found
|
||||
WDiFindVendorSpecificIE_next:
|
||||
lbz r0, 1(r25)
|
||||
add r3, r0, r27
|
||||
addi r27, r3, 2
|
||||
WDiFindVendorSpecificIE_loop_check:
|
||||
cmpw r27, r29
|
||||
blt WDiFindVendorSpecificIE_loop
|
||||
WDiFindVendorSpecificIE_found:
|
||||
cmpw r27, r29
|
||||
bge WDiFindVendorSpecificIE_done
|
||||
cmpwi r30, 0
|
||||
beq WDiFindVendorSpecificIE_no_out
|
||||
addi r0, r25, 6
|
||||
stw r0, 0(r30)
|
||||
WDiFindVendorSpecificIE_no_out:
|
||||
cmpwi r31, 0
|
||||
beq WDiFindVendorSpecificIE_set_found
|
||||
lbz r3, 1(r25)
|
||||
addi r0, r3, -4
|
||||
stw r0, 0(r31)
|
||||
WDiFindVendorSpecificIE_set_found:
|
||||
li r28, 1
|
||||
WDiFindVendorSpecificIE_done:
|
||||
cmpwi r28, 0
|
||||
bne WDiFindVendorSpecificIE_return
|
||||
cmpwi r30, 0
|
||||
beq WDiFindVendorSpecificIE_no_out_null
|
||||
li r0, 0
|
||||
stw r0, 0(r30)
|
||||
WDiFindVendorSpecificIE_no_out_null:
|
||||
cmpwi r31, 0
|
||||
beq WDiFindVendorSpecificIE_return
|
||||
li r0, 0
|
||||
stw r0, 0(r31)
|
||||
WDiFindVendorSpecificIE_return:
|
||||
addi r11, r1, 0x40
|
||||
mr r3, r28
|
||||
bl _restgpr_21
|
||||
lwz r0, 0x44(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x40
|
||||
blr
|
||||
}
|
||||
|
||||
@@ -211,7 +211,6 @@ namespace ext_ead {
|
||||
return;
|
||||
}
|
||||
|
||||
u32 srcBlockAdvance;
|
||||
u32 srcRowAdvance;
|
||||
void* rasterSrc;
|
||||
u16* blockRowDst;
|
||||
@@ -221,13 +220,13 @@ namespace ext_ead {
|
||||
rasterSrc = mpBrowserThread->GetRaster();
|
||||
blockRowDst = (u16*)GetTextureBuffer(0, TRUE, NULL);
|
||||
|
||||
srcBlockAdvance = srcRowAdvance * sizeof(u32);
|
||||
for (int blockY = 0; blockY < mHeight; blockY += 4) {
|
||||
u16* blockDst = blockRowDst;
|
||||
SubRow* blockRowA = (SubRow*)rasterSrc;
|
||||
SubRow* blockRowB = (SubRow*)((u8*)rasterSrc + srcRowAdvance);
|
||||
SubRow* blockRowC = (SubRow*)((u8*)blockRowB + srcRowAdvance);
|
||||
SubRow* blockRowD = (SubRow*)((u8*)blockRowC + srcRowAdvance);
|
||||
u8* blockRowDBytes = (u8*)blockRowB + srcRowAdvance;
|
||||
SubRow* blockRowD = (SubRow*)(blockRowDBytes + srcRowAdvance);
|
||||
|
||||
for (int blockX = 0; blockX < mWidth; blockX += 4) {
|
||||
blockDst[0] = convertToRGB565((*blockRowA)[0]);
|
||||
@@ -252,7 +251,7 @@ namespace ext_ead {
|
||||
|
||||
blockDst += 16;
|
||||
}
|
||||
rasterSrc = (u8*)rasterSrc + srcBlockAdvance;
|
||||
rasterSrc = (u8*)rasterSrc + srcRowAdvance * sizeof(u32);
|
||||
blockRowDst += mWidth * 4;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,10 +210,10 @@ namespace ipl {
|
||||
|
||||
int chIdx2 = 0;
|
||||
int chIdx = 0;
|
||||
u32 i = (u32)url_col->unk_0x08 - (u32)url_col->unk_0x04;
|
||||
i >>= 1;
|
||||
for (; i > 0; i--) {
|
||||
wchar_t wch = url_col->unk_0x04[chIdx];
|
||||
u32 count = (u32)url_col->unk_0x08 - (u32)url_col->unk_0x04;
|
||||
count >>= 1;
|
||||
for (u32 i = 0; i < count; i++) {
|
||||
wchar_t wch = url_col->unk_0x04[i];
|
||||
if (wch != SEPERATOR && chIdx2 < 0x200) {
|
||||
url[chIdx2++] = wch;
|
||||
}
|
||||
@@ -242,3 +242,12 @@ namespace ipl {
|
||||
}
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
__declspec(weak) u32 url_processor_data_pad() {
|
||||
static const u32 pad __attribute__((section(".data"), aligned(1))) = 0;
|
||||
return *((volatile const u32*)&pad);
|
||||
}
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
@@ -808,8 +808,8 @@ namespace ipl {
|
||||
dateIndex++;
|
||||
|
||||
nw4r::math::VEC3 local_68;
|
||||
local_68.x = ((i & 0xFFFF) % 7) * 0x46;
|
||||
local_68.y = ((i & 0xFFFF) / 7) * -0x30;
|
||||
local_68.x = ((u16)i % 7) * 0x46;
|
||||
local_68.y = ((u16)i / 7) * -0x30;
|
||||
local_68.z = 0.0f;
|
||||
|
||||
MTXMultVec(pane2->GetGlobalMtx(), local_68, local_68);
|
||||
@@ -881,5 +881,9 @@ namespace ipl {
|
||||
BOOL Calendar::is_lower_limit() {
|
||||
return mpBoardDate->year == mscMinDate.year && mpBoardDate->month == mscMinDate.month;
|
||||
}
|
||||
__declspec(weak) f32 calendar_data_pad() {
|
||||
static const f32 pad __attribute__((section(".data"), aligned(1))) = 0.0f;
|
||||
return *((volatile const f32*)&pad);
|
||||
}
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
@@ -7,15 +7,42 @@
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
extern "C" char lbl_816967D8[];
|
||||
extern "C" char lbl_816967DE[];
|
||||
extern "C" char lbl_816967E4[];
|
||||
extern "C" char lbl_816967EB[];
|
||||
extern "C" char lbl_816967F2[];
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164C620[] = "N_CalDay_r";
|
||||
#pragma pop
|
||||
|
||||
// clang-format off
|
||||
const char* Date::mscAnimPanes[Date::ANIM_PANE_MAX] = {
|
||||
"N_CalDay_r",
|
||||
"W_Cal",
|
||||
"T_Cal",
|
||||
"Cal_Ac",
|
||||
"Info_a",
|
||||
extern "C" const char* lbl_8164C62C[Date::ANIM_PANE_MAX] = {
|
||||
lbl_8164C620,
|
||||
lbl_816967D8,
|
||||
lbl_816967DE,
|
||||
lbl_816967E4,
|
||||
lbl_816967EB,
|
||||
};
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".data"
|
||||
extern "C" const char lbl_8164C640[] = "my_IplTop_f.brlan";
|
||||
extern "C" const char lbl_8164C652[] = "N_CalDay_t";
|
||||
extern "C" const char lbl_8164C65D[] = "WIPL_SE_DATE_FOCUS";
|
||||
#pragma pop
|
||||
|
||||
#pragma push
|
||||
#pragma section const_type ".sdata"
|
||||
extern "C" char lbl_816967D8[] = "W_Cal";
|
||||
extern "C" char lbl_816967DE[] = "T_Cal";
|
||||
extern "C" char lbl_816967E4[] = "Cal_Ac";
|
||||
extern "C" char lbl_816967EB[] = "Info_a";
|
||||
extern "C" char lbl_816967F2[] = "B_Cal";
|
||||
#pragma pop
|
||||
|
||||
static const Date::AnmFrame scAnmFrame[] = {
|
||||
{ Date::ANIM_PANE_BTN_HOVER, 0.0f, 6.0f },
|
||||
{ Date::ANIM_PANE_BTN_HOVER, 10.0f, 18.0f },
|
||||
@@ -33,11 +60,9 @@ namespace ipl {
|
||||
// clang-format on
|
||||
|
||||
utility::Date Date::mscMinDate(MIN_YEAR, MIN_MONTH, MIN_DAY);
|
||||
utility::Date Date::mscMaxDate(MAX_YEAR, MAX_MONTH, MAX_DAY);
|
||||
MaxDate Date::mscMaxDate(MAX_YEAR, MAX_MONTH, MAX_DAY);
|
||||
|
||||
u8 padding[0x10];
|
||||
|
||||
DECOMP_FORCE_ACTIVE(iplDate_cpp, padding);
|
||||
DECOMP_FORCE_ACTIVE(iplDate_cpp, &Date::mscMaxDate);
|
||||
|
||||
Date::Date(EGG::Heap* heap, nand::LayoutFile* file, const char* layoutFolder, const char* layoutFileName)
|
||||
: ::gui::EventHandler(), mbAppearMsg(0), unk_0x10(0), unk_0x14(0), mpLayout(NULL), mpCurrentPaneAnim(0), unk_0x3C(0) {
|
||||
@@ -46,7 +71,7 @@ namespace ipl {
|
||||
|
||||
// Bind animations
|
||||
for (int i = 0; i < ANIM_PANE_MAX; i++) {
|
||||
mpPaneAnims[i] = mpLayout->bind("my_IplTop_f.brlan", mscAnimPanes[i], false);
|
||||
mpPaneAnims[i] = mpLayout->bind(lbl_8164C640, lbl_8164C62C[i], false);
|
||||
}
|
||||
mpLayout->finishBinding();
|
||||
|
||||
@@ -54,7 +79,7 @@ namespace ipl {
|
||||
mpGui = new gui::PaneManager(this, mpLayout->getDrawInfo(), NULL, NULL);
|
||||
mpGui->setupScene(mpLayout);
|
||||
mpGui->setAllComponentTriggerTarget(false);
|
||||
mpGui->setTriggerTarget(mpLayout->FindPaneByName("B_Cal"), true);
|
||||
mpGui->setTriggerTarget(mpLayout->FindPaneByName(lbl_816967F2), true);
|
||||
|
||||
// Init date
|
||||
mpDate = new utility::Date();
|
||||
@@ -101,19 +126,19 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void Date::setRotate(const nw4r::math::VEC3& vec) {
|
||||
mpLayout->FindPaneByName("N_CalDay_t")->SetRotate(vec);
|
||||
mpLayout->FindPaneByName(lbl_8164C652)->SetRotate(vec);
|
||||
}
|
||||
|
||||
void Date::setTranslate(const nw4r::math::VEC3& vec) {
|
||||
mpLayout->FindPaneByName("N_CalDay_t")->SetTranslate(vec);
|
||||
mpLayout->FindPaneByName(lbl_8164C652)->SetTranslate(vec);
|
||||
}
|
||||
|
||||
void Date::setVisible(bool visible) {
|
||||
mpLayout->FindPaneByName(mscAnimPanes[0])->SetVisible(visible);
|
||||
mpLayout->FindPaneByName(lbl_8164C62C[0])->SetVisible(visible);
|
||||
}
|
||||
|
||||
bool Date::getVisible() {
|
||||
return mpLayout->FindPaneByName(mscAnimPanes[0])->IsVisible();
|
||||
return mpLayout->FindPaneByName(lbl_8164C62C[0])->IsVisible();
|
||||
}
|
||||
|
||||
void Date::setAttribute(int attr) {
|
||||
@@ -182,13 +207,13 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void Date::start_point_event(const char* paneName, controller::Interface* con) {
|
||||
if (strcmp(paneName, "B_Cal") == 0) {
|
||||
if (strcmp(paneName, lbl_816967F2) == 0) {
|
||||
if (unk_0x3C == 0) {
|
||||
static_cast<Calendar*>(System::getScene(SCENE_CALENDAR))->onPointDate(this);
|
||||
onCmdRecv(1);
|
||||
|
||||
if (getVisible()) {
|
||||
snd::getSystem()->startSE("WIPL_SE_DATE_FOCUS");
|
||||
snd::getSystem()->startSE(lbl_8164C65D);
|
||||
if (con != NULL) {
|
||||
con->rumble(1);
|
||||
}
|
||||
@@ -199,7 +224,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void Date::start_left_event(const char* paneName) {
|
||||
if (strcmp(paneName, "B_Cal") == 0) {
|
||||
if (strcmp(paneName, lbl_816967F2) == 0) {
|
||||
if (unk_0x3C == 1) {
|
||||
onCmdRecv(2);
|
||||
}
|
||||
@@ -235,7 +260,7 @@ namespace ipl {
|
||||
|
||||
numStr[index++] = 0;
|
||||
|
||||
nw4r::lyt::TextBox* pane = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName(mscAnimPanes[2]));
|
||||
nw4r::lyt::TextBox* pane = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName(lbl_8164C62C[2]));
|
||||
pane->SetString(numStr);
|
||||
}
|
||||
|
||||
@@ -282,5 +307,11 @@ namespace ipl {
|
||||
unk_0x3C = 0;
|
||||
onCmdRecv(3);
|
||||
}
|
||||
|
||||
#pragma push
|
||||
#pragma section sconst_type ".sdata2"
|
||||
extern "C" const f32 lbl_816948EC = 0.0f;
|
||||
extern "C" const f32 lbl_816948F0;
|
||||
#pragma pop
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
static inline wchar_t* letterWriterCaption(wchar_t* caption) {
|
||||
return caption;
|
||||
}
|
||||
|
||||
extern "C" char lbl_81650380[0x19] = "my_IplTopBalloon_a.brlyt";
|
||||
|
||||
LetterWriter::LetterWriter(EGG::Heap* heap, int type)
|
||||
@@ -143,7 +147,7 @@ namespace ipl {
|
||||
Address* address = static_cast<Address*>(System::getScene(SCENE_ADDRESS));
|
||||
memcpy(&mFriendInfo, &address->getFriendCache()->getInfo(address->getChosenFriendIndex()), sizeof(NWC24FriendInfo));
|
||||
|
||||
const wchar_t* caption = makeHeaderCaption((const wchar_t*)mFriendInfo.attr.name);
|
||||
const wchar_t* caption = letterWriterCaption(makeHeaderCaption((const wchar_t*)mFriendInfo.attr.name));
|
||||
getLetterInputForm()->setHeaderCaption(caption);
|
||||
|
||||
mbToFriend = true;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
BOOL Manager::createNewRecord(const char* recordName, const char* recordFileType, const OSCalendarTime* dateTime, u32* gameCode,
|
||||
u16* makerCode, const math::VEC2& recordPos, u32 recordFlags, const NWC24FriendAddr& addr, u16 addrType,
|
||||
u16* makerCode, const math::VEC2& recordPos, u32 recordFlags, const NWC24FriendAddr& addr, NWC24FriendType addrType,
|
||||
u16 noReplyFlag, const wchar_t* titleText, const wchar_t* bodyText, const void* faceData,
|
||||
const void** attachData, u32* attachSize, RBRAttachmentType* attachType) {
|
||||
BOOL result = FALSE;
|
||||
|
||||
@@ -559,7 +559,7 @@ namespace ipl {
|
||||
memset(msgFriendName, 0, sizeof(msgFriendName));
|
||||
|
||||
// Get message data
|
||||
NWC24MsgObj msgObj ALIGN32;
|
||||
NWC24MsgObj msgObj ATTRIBUTE_ALIGN(16);
|
||||
NWC24MsgType msgType;
|
||||
if (!getMsgObj(&msgObj, NWC24_MBOX_TYPE_RECV, mMsgIdsTbl[i]) || !getMsgType(&msgObj, &msgType)) {
|
||||
continue;
|
||||
@@ -569,7 +569,7 @@ namespace ipl {
|
||||
NWC24FriendAddr msgFriendAddr;
|
||||
memset(&msgFriendAddr, 0, sizeof(msgFriendAddr));
|
||||
|
||||
u16 msgFriendType;
|
||||
NWC24FriendType msgFriendType;
|
||||
|
||||
// Get friend data
|
||||
if (msgType == NWC24_MSGTYPE_PUBLIC) {
|
||||
@@ -579,7 +579,7 @@ namespace ipl {
|
||||
}
|
||||
msgFriendType = NWC24_FRIENDTYPE_EMAIL;
|
||||
if (searchFriendInfo(&msgFriendAddr, &index)) {
|
||||
NWC24FriendInfo friendInfo;
|
||||
NWC24FriendInfo friendInfo ALIGN32;
|
||||
readFriendInfo(&friendInfo, index);
|
||||
wcsncpy(msgFriendName, (wchar_t*)friendInfo.attr.name, 12);
|
||||
}
|
||||
@@ -588,7 +588,7 @@ namespace ipl {
|
||||
getMsgFromId(&msgObj, &msgFriendAddr.wiiId);
|
||||
msgFriendType = msgFriendAddr.wiiId == myUserId ? NWC24_FRIENDTYPE_NONE : NWC24_FRIENDTYPE_WII;
|
||||
if (searchFriendInfo(msgFriendAddr.wiiId, &index)) {
|
||||
NWC24FriendInfo friendInfo;
|
||||
NWC24FriendInfo friendInfo ALIGN32;
|
||||
readFriendInfo(&friendInfo, index);
|
||||
wcsncpy(msgFriendName, (wchar_t*)friendInfo.attr.name, 12);
|
||||
}
|
||||
@@ -596,6 +596,7 @@ namespace ipl {
|
||||
|
||||
// Get app and group ID
|
||||
u32 msgAppId;
|
||||
u16 msgOptOutAppId;
|
||||
u16 msgGroupId;
|
||||
getMsgAppId(&msgObj, &msgAppId);
|
||||
getMsgGroupId(&msgObj, &msgGroupId);
|
||||
@@ -613,9 +614,9 @@ namespace ipl {
|
||||
|
||||
// Get opt out flag (display "Opt Out" button)
|
||||
BOOL msgMbOptOutFlag = FALSE;
|
||||
u32 msgOptOutAppId = 0;
|
||||
bool msgBoardUpdateSW = (result & (bool)msgMbUpdateSW);
|
||||
result = readMsgMBOptOutFlag(&msgObj, &msgMbOptOutFlag, &msgOptOutAppId);
|
||||
*(u32*)&msgOptOutAppId = 0;
|
||||
result = readMsgMBOptOutFlag(&msgObj, &msgMbOptOutFlag, (u32*)&msgOptOutAppId);
|
||||
if (!FILE_ERROR_OK) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -39,9 +39,12 @@
|
||||
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" const f32 lbl_81694424;
|
||||
extern "C" const f32 lbl_81694428;
|
||||
extern "C" const f32 lbl_8169442C;
|
||||
extern "C" const f32 lbl_81694430;
|
||||
extern "C" const f32 lbl_81694434;
|
||||
extern "C" const f32 lbl_81694438;
|
||||
extern "C" void* m_handle__Q23ipl11TVRCManager;
|
||||
extern "C" void _savegpr_27();
|
||||
extern "C" void _restgpr_27();
|
||||
@@ -1136,7 +1139,7 @@ namespace ipl {
|
||||
bl VISetBlack
|
||||
lwz r3, 0xb0(r28)
|
||||
li r0, 1
|
||||
lfd f31, lbl_81694418
|
||||
lfd f31, lbl_81694424-0xc
|
||||
lis r30, 0x4330
|
||||
lbz r29, 0x3d(r3)
|
||||
lis r31, sSystem__Q23ipl3snd@ha
|
||||
@@ -1159,7 +1162,7 @@ namespace ipl {
|
||||
bl makeRawData__Q33ipl7utility11JpegDecoderFv
|
||||
warning_run_no_jpeg:
|
||||
lwz r3, 0x74(r28)
|
||||
lfs f1, lbl_81694410
|
||||
lfs f1, lbl_81694424-0x14
|
||||
lwz r27, 0(r3)
|
||||
stw r30, 8(r1)
|
||||
fmr f2, f1
|
||||
@@ -1167,7 +1170,7 @@ namespace ipl {
|
||||
fmr f5, f1
|
||||
lhz r0, 6(r27)
|
||||
stw r3, 0xc(r1)
|
||||
lfs f6, lbl_81694420
|
||||
lfs f6, lbl_81694424-0x4
|
||||
lfd f0, 8(r1)
|
||||
stw r0, 0x14(r1)
|
||||
fsubs f3, f0, f31
|
||||
@@ -1359,17 +1362,17 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void System::getProjectionRect4x3(nw4r::ut::Rect* rect) {
|
||||
rect->left = -304.0;
|
||||
rect->right = 304.0;
|
||||
rect->bottom = 228.0;
|
||||
rect->top = -228.0;
|
||||
rect->left = *((volatile const f32*)&lbl_81694424);
|
||||
rect->right = *((volatile const f32*)&lbl_81694428);
|
||||
rect->bottom = *((volatile const f32*)&lbl_8169442C);
|
||||
rect->top = *((volatile const f32*)&lbl_81694430);
|
||||
}
|
||||
|
||||
void System::getProjectionRect16x9(nw4r::ut::Rect* rect) {
|
||||
rect->left = -416.0;
|
||||
rect->right = 416.0;
|
||||
rect->bottom = 228.0;
|
||||
rect->top = -228.0;
|
||||
rect->left = *((volatile const f32*)&lbl_81694434);
|
||||
rect->right = *((volatile const f32*)&lbl_81694438);
|
||||
rect->bottom = *((volatile const f32*)&lbl_8169442C);
|
||||
rect->top = *((volatile const f32*)&lbl_81694430);
|
||||
}
|
||||
|
||||
GXRenderModeObj* System::getRenderModeObj() {
|
||||
@@ -1510,3 +1513,14 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
} // namespace ipl
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#pragma force_active on
|
||||
extern "C" const f32 lbl_81694424 = -304.0f;
|
||||
extern "C" const f32 lbl_81694428 = 304.0f;
|
||||
extern "C" const f32 lbl_8169442C = 228.0f;
|
||||
extern "C" const f32 lbl_81694430 = -228.0f;
|
||||
extern "C" const f32 lbl_81694434 = -416.0f;
|
||||
extern "C" const f32 lbl_81694438 = 416.0f;
|
||||
#pragma force_active off
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user