Compare commits

..

1 Commits

Author SHA1 Message Date
Devin AI
7ec5419c83 Link iplChannelTitle, iplController, iplSaveDataManager, eggAudioExpMgr
Flip the four units to Matching. eggAudioExpMgr uses an
EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS guard (external decls for the
header-inline virtuals and AutoLock) plus an unused inline Sample
subclass so the @52@ adjustor thunks emit in the original order.
Full ninja build passes with build/43U/main.dol: OK.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-28 11:07:55 +00:00
35 changed files with 3793 additions and 10253 deletions

View File

@@ -37,16 +37,11 @@ src/system/iplSystem.cpp:
.sdata start:0x81696060 end:0x81696080
src/system/iplController.cpp:
.text start:0x81335CCC end:0x81337318
.text start:0x81335CCC end:0x81337978
.rodata start:0x8160D2C0 end:0x8160D2D0
.data start:0x816346A8 end:0x81634910
.sdata2 start:0x81694440 end:0x81694478
.data start:0x816346A8 end:0x81634A28
.sdata2 start:0x81694440 end:0x81694490
.sdata start:0x81696080 end:0x81696088
src/system/iplControllerManager.cpp:
.text start:0x81337318 end:0x81337978
.data start:0x81634910 end:0x81634A28
.sdata2 start:0x81694478 end:0x81694490
.sbss start:0x81698680 end:0x81698690
src/system/iplChannelManager.cpp:

View File

@@ -13835,8 +13835,8 @@ scAnmTable__10homebutton = .rodata:0x8160F378; // type:object size:0x60 scope:lo
scGroupAnmTable__10homebutton = .rodata:0x8160F3D8; // type:object size:0x250 scope:local data:4byte
__DVDErrorMessage = .rodata:0x8160F628; // type:object size:0x28
lbl_8160F650 = .rodata:0x8160F650; // type:object size:0x16 data:2byte
specials$18760 = .rodata:0x8160F668; // type:object size:0xB data:byte
@19145 = .rodata:0x8160F673; // type:object size:0xC data:byte
lbl_8160F668 = .rodata:0x8160F668; // type:object size:0xB data:byte
lbl_8160F673 = .rodata:0x8160F673; // type:object size:0xC data:byte
lbl_8160F67F = .rodata:0x8160F67F; // type:object size:0xD data:byte
lbl_8160F690 = .rodata:0x8160F690; // type:object size:0x18 data:2byte
scAnmFrame__Q23ipl5scene = .rodata:0x8160F6A8; // type:object size:0x20 scope:local
@@ -15435,46 +15435,26 @@ __vt__Q33ipl5scene7Address = .data:0x81647B70; // type:object size:0x120
@11177 = .data:0x81647D9A; // type:object size:0xF scope:local data:string
__vt__Q33ipl5scene18AddressAddSelEvent = .data:0x81647DAC; // type:object size:0x18
__vt__Q33ipl5scene13AddressAddSel = .data:0x81647DC4; // type:object size:0x88
@16959 = .data:0x81647EE0; // type:object size:0xD data:string
@16960 = .data:0x81647EED; // type:object size:0xD data:string
@16961 = .data:0x81647EFA; // type:object size:0xD data:string
@16962 = .data:0x81647F07; // type:object size:0xE data:string
@16963 = .data:0x81647F15; // type:object size:0xC data:string
sButtonPaneNames = .data:0x81647F24; // type:object size:0x14
@16964 = .data:0x81647F38; // type:object size:0xE data:string
@23886 = .data:0x81647F46; // type:object size:0xC data:string
@24207 = .data:0x81647F52; // type:object size:0x12 data:string
@24208 = .data:0x81647F64; // type:object size:0x1C data:string
@24209 = .data:0x81647F80; // type:object size:0xF data:string
@24210 = .data:0x81647F8F; // type:object size:0x19 data:string
@24211 = .data:0x81647FA8; // type:object size:0xB data:string
@24212 = .data:0x81647FB3; // type:object size:0xB data:string
@24213 = .data:0x81647FBE; // type:object size:0xB data:string
@24214 = .data:0x81647FC9; // type:object size:0xC data:string
@24215 = .data:0x81647FD5; // type:object size:0xE data:string
@24216 = .data:0x81647FE3; // type:object size:0x1A data:string
@24217 = .data:0x81647FFD; // type:object size:0x1A data:string
@24218 = .data:0x81648017; // type:object size:0x1D data:string
@24219 = .data:0x81648034; // type:object size:0x1E data:string
@24220 = .data:0x81648052; // type:object size:0xC data:string
@24221 = .data:0x8164805E; // type:object size:0x22 data:string
@24222 = .data:0x81648080; // type:object size:0x9 data:string
@24223 = .data:0x81648089; // type:object size:0x23 data:string
@24224 = .data:0x816480AC; // type:object size:0x1C data:string
@24225 = .data:0x816480C8; // type:object size:0xD data:string
@24226 = .data:0x816480D5; // type:object size:0xD data:string
@24227 = .data:0x816480E2; // type:object size:0xD data:string
@24228 = .data:0x816480EF; // type:object size:0xE data:string
@24229 = .data:0x816480FD; // type:object size:0xE data:string
@24231 = .data:0x8164810B; // type:object size:0x1F5
@25188 = .data:0x81648300; // type:object size:0xC0 scope:local
@25187 = .data:0x816483C0; // type:object size:0xC0 scope:local
@25711 = .data:0x8164848D; // type:object size:0x16 data:string
@25835 = .data:0x816484A3; // type:object size:0xF data:string
@25838 = .data:0x816484B4; // type:object size:0x44 scope:local
@26007 = .data:0x81648508; // type:object size:0x58 scope:local
@26006 = .data:0x81648560; // type:object size:0x8C scope:local
@26030 = .data:0x816485EC; // type:object size:0xC data:wstring
lbl_81647EE0 = .data:0x81647EE0; // type:object size:0xD data:string
lbl_81647EED = .data:0x81647EED; // type:object size:0xD data:string
lbl_81647EFA = .data:0x81647EFA; // type:object size:0xD data:string
lbl_81647F07 = .data:0x81647F07; // type:object size:0xE data:string
lbl_81647F15 = .data:0x81647F15; // type:object size:0xC data:string
lbl_81647F24 = .data:0x81647F24; // type:object size:0x14
lbl_81647F38 = .data:0x81647F38; // type:object size:0xE data:string
lbl_81647F46 = .data:0x81647F46; // type:object size:0x83
lbl_81647FC9 = .data:0x81647FC9; // type:object size:0xC data:string
lbl_81647FD5 = .data:0x81647FD5; // type:object size:0x128
lbl_816480FD = .data:0x816480FD; // type:object size:0xE data:string
lbl_8164810B = .data:0x8164810B; // type:object size:0x1F5
jumptable_81648300 = .data:0x81648300; // type:object size:0xC0 scope:local
jumptable_816483C0 = .data:0x816483C0; // type:object size:0xC0 scope:local
lbl_8164848D = .data:0x8164848D; // type:object size:0x16 data:string
lbl_816484A3 = .data:0x816484A3; // type:object size:0xF data:string
jumptable_816484B4 = .data:0x816484B4; // type:object size:0x44 scope:local
jumptable_81648508 = .data:0x81648508; // type:object size:0x58 scope:local
jumptable_81648560 = .data:0x81648560; // type:object size:0x8C scope:local
lbl_816485EC = .data:0x816485EC; // type:object size:0xC data:wstring
__vt__Q33ipl5scene17AddressInputEvent = .data:0x816485F8; // type:object size:0x18
__vt__Q33ipl5scene16AddressEditEvent = .data:0x81648610; // type:object size:0x18
__vt__Q33ipl5scene11AddressEdit = .data:0x81648628; // type:object size:0x120
@@ -21711,7 +21691,7 @@ lbl_816965C4 = .sdata:0x816965C4; // type:object size:0x6 data:string
lbl_816965CA = .sdata:0x816965CA; // type:object size:0x4
smButtonName__Q33ipl5scene13AddressAddSel = .sdata:0x816965D0; // type:object size:0x8
@10971 = .sdata:0x816965D8; // type:object size:0x4 scope:local data:string
sInputPaneName = .sdata:0x816965E0; // type:object size:0x4 data:4byte
lbl_816965E0 = .sdata:0x816965E0; // type:object size:0x4 data:4byte
lbl_816965E4 = .sdata:0x816965E4; // type:object size:0x4 data:string
lbl_816965E8 = .sdata:0x816965E8; // type:object size:0x2
lbl_816965EA = .sdata:0x816965EA; // type:object size:0x6 data:string

View File

@@ -624,8 +624,7 @@ config.libs = [
Object(Matching, "system/rvl_dec.c"),
Object(Matching, "system/RIPL_BoardRecord.c"),
Object(Matching, "system/iplSystem.cpp"),
Object(NonMatching, "system/iplController.cpp"),
Object(NonMatching, "system/iplControllerManager.cpp"),
Object(Matching, "system/iplController.cpp"),
Object(Matching, "system/iplChannelManager.cpp"),
Object(Matching, "system/iplChannelScriptManager.cpp"),
Object(Matching, "system/iplNand.cpp"),
@@ -739,7 +738,7 @@ config.libs = [
),
IPLSection("board", [
Object(Equivalent, "scene/board/iplBoard.cpp"),
Object(Matching, "scene/board/iplBoardObject.cpp"),
Object(Equivalent, "scene/board/iplBoardObject.cpp"),
Object(Matching, "scene/board/iplBoardSD.cpp"),
Object(Matching, "scene/board/iplUrlProcessor.cpp"),
Object(Equivalent, "scene/board/iplFocusObject.cpp"),
@@ -772,7 +771,7 @@ config.libs = [
]
),
IPLSection("channelTitle", [
Object(Equivalent, "scene/channelTitle/iplChannelTitle.cpp"),
Object(Matching, "scene/channelTitle/iplChannelTitle.cpp"),
]
),
IPLSection("faceSelect", [
@@ -1908,7 +1907,7 @@ config.libs = [
[
Object(Matching, "core/eggAllocator.cpp"),
Object(Matching, "core/eggAudioArcPlayerMgr.cpp"),
Object(Equivalent, "core/eggAudioExpMgr.cpp"),
Object(Matching, "core/eggAudioExpMgr.cpp"),
Object(Matching, "core/eggAudioFxMgr.cpp"),
Object(Matching, "core/eggAudioMgr.cpp"),
Object(Matching, "core/eggAudioHeapMgr.cpp"),

View File

@@ -67,9 +67,6 @@ namespace textinput {
virtual void setAspectRatio(bool b4x3);
virtual void setSecretInputMode(bool secretInputMode) { mpInputForm->setSecretModeOn(secretInputMode); }
#ifdef IPL_ADDRESS_EDIT_CPP
void enableKSXFilter(bool compatibleFilter);
#endif
virtual void setDefaultPredictionJP(int num, const char** predicts);
virtual void setFixedPredictionJP(int num, const char** predicts);

View File

@@ -12,9 +12,6 @@ namespace ipl {
template <typename T>
class Interporation : public utility::FrameController {
public:
#ifdef IPL_BOARD_OBJECT_INLINE_INTERPOLATION_DTORS
virtual ~Interporation();
#endif
void init(int playback, f32 maxFrame, f32 minFrame, const T& start, const T& end, f32 speed = 1.0f) {
mStart = start;
mEnd = end;
@@ -37,9 +34,6 @@ namespace ipl {
template <typename T>
class LinearIntp : public Interporation<T> {
public:
#ifdef IPL_BOARD_OBJECT_INLINE_INTERPOLATION_DTORS
virtual ~LinearIntp();
#endif
T get() const {
T r = mEnd * getCurrentFrame();
T b = mStart * (mMaxFrame - mFrame);

View File

@@ -35,10 +35,6 @@ namespace ipl {
return x;
}
}
#ifdef IPL_CONTROLLER_OUT_OF_LINE_ABS_CLAMP
template <>
f32 abs_clamp<f32>(const f32& x, const f32& y);
#endif
typedef struct MTX33 : public nw4r::math::MTX33 {
} MTX33;
@@ -59,7 +55,7 @@ namespace ipl {
x = r.x;
y = r.y;
}
#ifdef IPL_CONTROLLER_OUT_OF_LINE_VEC2
#ifdef IPL_MATH_VEC2_CTOR_OUT_OF_LINE
VEC2(f32 fx, f32 fy);
#else
VEC2(f32 fx, f32 fy) {
@@ -72,14 +68,10 @@ namespace ipl {
VEC2 operator*(f32 val) const { return VEC2(x * val, y * val); }
#ifdef IPL_CONTROLLER_OUT_OF_LINE_VEC2
void set(f32 fx, f32 fy);
#else
void set(f32 fx, f32 fy) {
x = fx;
y = fy;
}
#endif
void clear() {
y = 0;
@@ -103,15 +95,11 @@ namespace ipl {
y = r.y;
z = 0.0f;
}
#ifdef IPL_ADDRESS_EDIT_CPP
VEC3(f32 fx, f32 fy, f32 fz);
#else
VEC3(f32 fx, f32 fy, f32 fz) {
x = fx;
y = fy;
z = fz;
}
#endif
VEC3& operator+=(const VEC3& rhs) {
VEC3Add(this, this, &rhs);

View File

@@ -1,277 +1,44 @@
#ifndef IPL_SCENE_ADDRESS_H
#define IPL_SCENE_ADDRESS_H
#include "iplSceneUIHeader.h"
#include "scene/button/iplButton.h"
#include "iplSceneHeader.h"
#include <revolution/nwc24.h>
namespace ipl {
namespace nigaoe {
class Object;
}
namespace scene {
class AddressEvent;
class FriendListCache {
public:
enum {
FRIEND_MAX = 100,
};
FriendListCache() : mbOpened(false) {}
BOOL init();
void fin();
void add(u32 index, const NWC24FriendInfo& info);
void update(u32 index, const wchar_t* name, u64 fdId);
void del(u32 index);
void swap(u32 index1, u32 index2);
BOOL isValidId(const NWC24UserId& userId);
BOOL isDupId(const NWC24UserId& userId);
BOOL isDupMail(const char* mailAddr);
void sendRegisterMail(u32 index);
s32 check();
s32 getErrCode() const;
const NWC24FriendInfo& getInfo(int index) const { return mInfos[index]; }
BOOL isThere(u32 index) const { return mbThere[index]; }
u32 getRegFriendNum() const { return mRegFriendNum; }
NWC24UserId getMyUserId() const { return mMyUserId; }
s32 getLastErr() const { return mErrCode; }
private:
NWC24FriendInfo mInfos[FRIEND_MAX]; // 0x0000
u8 mbThere[FRIEND_MAX]; // 0x7D00
NWC24UserId mMyUserId; // 0x7D68
u32 mRegFriendNum; // 0x7D70
u8 mSendWork[0x2000]; // 0x7D74
s32 mErrCode; // 0x9D74
bool mbOpened; // 0x9D78
NWC24FriendInfo mInfos[100];
};
FADER_SCENE_CLASS(Address), public ButtonEventHandlerBase {
FADER_SCENE_CLASS(Address) {
public:
Address(EGG::Heap * heap, int mode);
virtual ~Address();
virtual void prepare();
virtual void create();
virtual void draw();
virtual void destroy();
virtual FaderSceneCommand calcFadein();
virtual void initCalcNormal();
virtual FaderSceneCommand calcNormal();
virtual void initCalcFadeout();
virtual FaderSceneCommand calcFadeout();
virtual void calcCommonAfter();
virtual void onEventDerived(u32 compId, u32 event, const controller::Interface* con);
Address(EGG::Heap * heap, int);
virtual void destroy() override;
enum {
SCENE_ADD_WII = 1,
SCENE_ADD_EMAIL,
};
enum {
BTN_MAX = 5,
BTN_SPACE_MAX = BTN_MAX - 1,
PAGE_MAX = 20,
};
int getChosenFriendIndex() {
return mChosenFriend;
return unk_0xC0;
}
FriendListCache* getFriendCache() {
return mpFriendCache;
return unk_0x274;
}
private:
enum {
FADEIN_STATE_WAIT_OPEN = 0,
FADEIN_STATE_FADEIN,
FADEIN_STATE_DONE,
};
enum {
STATE_INIT = 0,
STATE_COVER_NORMAL,
STATE_COVER_FORWARD,
STATE_COVER_BACKWARD,
STATE_NORMAL,
STATE_FORWARD,
STATE_BACKWARD,
STATE_LOOP_FORWARD,
STATE_LOOP_BACKWARD,
STATE_DECIDE,
STATE_DRAG,
STATE_RELEASE,
STATE_WAIT_CHILD_CST,
STATE_WAIT_CHILD_DST,
STATE_WAIT_CHILD_FADEOUT,
STATE_MSG_NET,
STATE_WAIT_PARENTAL,
STATE_WAIT_PARENTAL_DST,
STATE_MSG_WC,
STATE_WAIT_PARENTAL_WC,
STATE_WAIT_PARENTAL_DST_WC,
STATE_MSG_NWC24_ERROR,
STATE_MSG_FI_FULL,
STATE_MSG_PARENTAL,
STATE_MSG_OPEN_FAILURE,
STATE_WAIT_DIALOG,
STATE_DONE,
};
class MiiObj {
public:
MiiObj();
~MiiObj();
void init(nw4r::lyt::Pane* pane);
void set(u64 fdId);
void reset();
static void create_callback(nigaoe::Object* object, void* work);
GXTexObj mTexObj; // 0x00
nigaoe::Object* mpNigaoe; // 0x20
nw4r::lyt::Material* mpMaterial; // 0x24
};
struct DragInfo {
nw4r::math::VEC2 mPos; // 0x00
int mChan; // 0x08
int mPage; // 0x0C
int mButton; // 0x10
int mNextCount; // 0x14
int mPrevCount; // 0x18
int unk_0x1C; // 0x1C
bool mbDragging; // 0x20
};
void fistt_wait_open();
void fistt_fadein();
void onInitFriendList();
void stt_cover_normal();
void stt_cover_forward();
void stt_cover_backward();
void stt_normal();
void stt_forward();
void stt_backward();
void stt_loop_forward();
void stt_loop_backward();
void stt_decide();
void stt_drag();
void stt_release();
void stt_wait_child_cst();
void stt_wait_child_dst();
void stt_wait_child_fadeout();
void stt_msg_net();
void stt_wait_parental();
void stt_wait_parental_dst();
void stt_msg_wc();
void stt_wait_parental_wc();
void stt_wait_parental_dst_wc();
void stt_msg_nwc24_error();
void stt_msg_fi_full();
void stt_msg_parental();
void stt_msg_open_failure();
void stt_wait_dialog();
void add_translate(nw4r::lyt::Pane* pane, const math::VEC2& offset);
void set_friend(const char* paneName, u32 friendNo, u32 buttonNo, MiiObj& miiObj, bool bDrag);
void set_page_text(const char* paneName, int page);
void set_textbox(const char* paneName, const wchar_t* text);
void set_textbox(const char* paneName, u32 msgId);
void reset_friend();
void start_point_event(const char* paneName, controller::Interface* con);
void start_left_event(const char* paneName);
void start_trig_event(const char* paneName);
void start_drag_event(const char* paneName, const controller::Interface* con);
void start_drag_point_event(const char* paneName, controller::Interface* con);
void start_drag_left_event(const char* paneName);
void start_release_event(const char* paneName);
void on_point_event(int buttonNo, controller::Interface* con);
void left_point_event(int buttonNo);
int get_button_no(const char* paneName);
int get_button_space_no(const char* paneName);
void reset_gui(bool bKeepPointed);
BOOL is_selectable(u32 friendNo);
void onNextPage();
void onPreviousPage();
void set_err_msg(wchar_t* errMsg, u32 errMsgLen, NWC24Err err);
void entry_friend();
bool isReleasableArea(int page, int buttonNo);
void changePage_onDrag();
void movePane_onDrag();
DragInfo mDrag; // 0x64
int mMode; // 0x88
layout::Object* mpLayout; // 0x8C
int unk_0x90; // 0x90
AddressEvent* mpEvent; // 0x94
gui::PaneManager* mpGui; // 0x98
layout::Object* mpBackLayout; // 0x9C
layout::Object* mpDialogLayout; // 0xA0
int mFadeinState; // 0xA4
int mWaitOpenCount; // 0xA8
int mState; // 0xAC
int mPage; // 0xB0
int mNextPageNum; // 0xB4
int mPrevPageNum; // 0xB8
int mSelectedButton; // 0xBC
u32 mChosenFriend; // 0xC0
bool mbFaceValid[BTN_MAX]; // 0xC4
int mPointCount[BTN_MAX]; // 0xCC
bool mbParentalOK; // 0xE0
bool mbCover; // 0xE1
MiiObj mMiiObj[BTN_MAX]; // 0xE4
MiiObj mNextMiiObj[BTN_MAX]; // 0x1AC
FriendListCache* mpFriendCache; // 0x274
GXTexObj mDragTexObj; // 0x278
u8* mpWork; // 0x298
f32 mDragOffsetX; // 0x29C
static const math::VEC2 smcPageOffset;
friend class AddressEvent;
#ifdef IPL_ADDRESS_EDIT_CPP
friend class AddressEdit;
#endif
};
class AddressEvent : public ::gui::EventHandler {
public:
AddressEvent(Address* instance) : ::gui::EventHandler(), mpInstance(instance) {}
virtual void onEvent(u32 compId, u32 event, void* data);
private:
Address* mpInstance; // 0x0C
int mTrigChan; // 0x10
u8 unk_0x58[0x68];
int unk_0xC0;
u8 unk_0xC4[0x1B0];
FriendListCache* unk_0x274;
u8 unk_0x278[0x28];
};
} // namespace scene
} // namespace ipl

View File

@@ -2,125 +2,22 @@
#define IPL_SCENE_ADDRESS_EDIT_H
#include "iplSceneHeader.h"
#include "scene/button/iplButton.h"
#include <RFL_Types.h>
#include <revolution/nwc24.h>
namespace ipl {
namespace nigaoe {
class Object;
}
namespace scene {
class AddressEditEvent;
class AddressInputEvent;
class FriendListCache;
FADER_SCENE_CLASS(AddressEdit), public ButtonEventHandlerBase {
FADER_SCENE_CLASS(AddressEdit) {
public:
AddressEdit(EGG::Heap * heap, int friendCode);
virtual ~AddressEdit();
virtual void prepare();
virtual void create();
virtual void draw();
virtual void initCalcNormal();
virtual void initCalcFadeout();
virtual void calcCommonAfter();
virtual FaderSceneCommand calcFadein();
virtual FaderSceneCommand calcNormal();
virtual FaderSceneCommand calcFadeout();
virtual void onEventDerived(u32 compId, u32 event, const controller::Interface* con);
void stt_msg_code_add();
void stt_msg_code_edit();
void stt_msg_parental();
void stt_msg_nwc24_error();
void reset_gui();
void start_point_event(const char* paneName, controller::Interface* controller);
void start_left_event(const char* paneName);
void start_trig_event(const char* paneName);
void start_ipt_point_event(const char* paneName, int channel);
void start_ipt_left_event(const char* paneName, int channel);
void start_ipt_trig_event(const char* paneName, int channel);
int get_button_no(const char*);
void add_friendinfo();
void delete_friendinfo();
void set_textbox(nw4r::lyt::Pane*, const wchar_t*);
void setDefaultTitleText(const wchar_t*, bool);
static void wiiid_utf16(u64, wchar_t*);
static void nigaoe_create_callback_add(ipl::nigaoe::Object*, void*);
static void nigaoe_create_callback_edit(ipl::nigaoe::Object*, void*);
void set_err_msg(wchar_t*, u32, NWC24Err);
void get_friendinfo();
static u64 utf16_wiiid(const wchar_t*);
void stt_add_code_fadein();
void stt_add_code_fadeout();
void stt_add_code_input();
void stt_add_code_normal();
void stt_add_confirm_fadein();
void stt_add_confirm_fadeout();
void stt_add_confirm_normal();
void stt_add_mii_fadein();
void stt_add_mii_fadeout();
void stt_add_mii_input();
void stt_add_mii_normal();
void stt_add_name_fadein();
void stt_add_name_fadeout();
void stt_add_name_input();
void stt_add_name_normal();
void stt_ipt_input();
void stt_ipt_normal();
void stt_ipt_wait_fadein();
void stt_ipt_wait_fadeout();
void stt_msg_add_rlt();
void stt_msg_code_invalid();
void stt_msg_del_rlt();
void stt_msg_dup_email();
void stt_msg_dup_wii_no();
void stt_msg_my_wii_no();
void stt_msg_net();
void stt_msg_no_established();
void stt_msg_no_mii();
void stt_msg_no_mii_add();
void stt_msg_wc();
void stt_select_mii();
void stt_wait_btn_fadein();
void stt_wait_btn_fadeout();
void stt_wait_del_msg_fadein();
void stt_wait_del_msg_fadeout();
void stt_wait_del_msg_fadeout_to_rlt();
void stt_wait_delete();
void stt_wait_decide_anm_add();
void stt_wait_parental();
void stt_wait_parental_dst();
void stt_wait_parental_dst_wc();
void stt_wait_parental_wc();
void stt_normal();
void stt_wait_decide_anm();
void update_friendinfo();
void requestSceneChange(int sceneId, void* args) { reserveSceneChange(sceneId, args); }
u32 getPreviousScene() const { return getPrevSceneID(); }
EGG::Heap* getHeap() { return getSceneHeap(); }
::gui::Manager* getGuiManager() { return mpManager; }
class String {
public:
void clear();
const wchar_t* getDispCodeLong() const;
void setName(const wchar_t* value);
void setEMail(const wchar_t* value);
void setWiiNo(const wchar_t* value);
wchar_t mValue[0x102];
wchar_t mName[0x0c];
wchar_t mDisplayText[0x102];
bool mbValidMail;
bool mbNameNotEmpty;
bool mbHasWiiNo;
};
enum {
@@ -128,28 +25,8 @@ namespace ipl {
SCENE_ADD_EMAIL,
};
int mState;
layout::Object* mpCodeLayout;
AddressEditEvent* mpEditEvent;
gui::PaneManager* mpEditGui;
layout::Object* mpNameLayout;
AddressInputEvent* mpInputEvent;
gui::PaneManager* mpInputGui;
layout::Object* mpBackgroundLayout;
int mMode;
int mSelectedButton;
int mSubState;
s32 mPointCount[5];
u32 mSelectedFriend;
TextBalloon* mpBalloon;
nand::LayoutFile* mpBalloonFile;
String mString;
AddressEdit* mpCallbackOwner;
bool mbParentalOK;
nigaoe::Object* mpNigaoe;
RFLCreateID mCreateID;
int mNigaoeState;
FriendListCache* mpFriendCache;
private:
u8 unk_0x58[0x498];
};
} // namespace scene
} // namespace ipl

View File

@@ -19,13 +19,6 @@
namespace ipl {
namespace scene {
extern wchar_t scTextDateJpnFormat[];
extern wchar_t scTextDateKorFormat[];
extern wchar_t scTextDateGerFormat[];
extern wchar_t scTextDatePalengFormat[];
#ifdef IPL_BOARD_DATE_HELPERS_INLINE
extern const u32 scWeekMsgId[];
#endif
class focus_object;
SCENE_CLASS(Board), public ButtonEventHandlerBase {
public:
@@ -88,57 +81,13 @@ namespace ipl {
void set_text_date();
void set_text_date(const utility::Date& date, const char* paneName);
#ifdef IPL_BOARD_DATE_HELPERS_INLINE
void get_text_jpn(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
const wchar_t* sep1 = msgMgr->getMessage(MESG_CALENDAR_MONDAY);
const wchar_t* sep2 = msgMgr->getMessage(MESG_CALENDAR_MONDAY);
const wchar_t* weekStart = msgMgr->getMessage(MESG_CALENDAR_WEEK_START);
const wchar_t* weekEnd = msgMgr->getMessage(MESG_CALENDAR_WEEK_END);
swprintf(text, textLen, scTextDateJpnFormat, date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
}
void get_text_kor(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
const wchar_t* sep1 = msgMgr->getMessage(MESG_CALENDAR_MONDAY);
const wchar_t* sep2 = msgMgr->getMessage(MESG_CALENDAR_MONDAY);
const wchar_t* weekStart = msgMgr->getMessage(MESG_CALENDAR_WEEK_START);
const wchar_t* weekEnd = msgMgr->getMessage(MESG_CALENDAR_WEEK_END);
swprintf(text, textLen, scTextDateKorFormat, date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
}
#else
void get_text_jpn(const utility::Date& date, wchar_t* text, u32 textLen);
void get_text_kor(const utility::Date& date, wchar_t* text, u32 textLen);
#endif
void get_text_spa(const utility::Date& date, wchar_t* text, u32 textLen);
#ifdef IPL_BOARD_DATE_HELPERS_INLINE
void get_text_ger(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
const wchar_t* weekStart = msgMgr->getMessage(MESG_CALENDAR_WEEK_START);
const wchar_t* weekEnd = msgMgr->getMessage(MESG_CALENDAR_WEEK_END);
swprintf(text, textLen, scTextDateGerFormat, date.day, date.month, weekStart, week, weekEnd);
}
#else
void get_text_ger(const utility::Date& date, wchar_t* text, u32 textLen);
#endif
void get_text_usaeng(const utility::Date& date, wchar_t* text, u32 textLen);
void get_text_usafre(const utility::Date& date, wchar_t* text, u32 textLen);
#ifdef IPL_BOARD_DATE_HELPERS_INLINE
void get_text_paleng(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
swprintf(text, textLen, scTextDatePalengFormat, week, date.day, date.month);
}
#else
void get_text_paleng(const utility::Date& date, wchar_t* text, u32 textLen);
#endif
void show_ricon();
void hide_ricon();
@@ -277,17 +226,8 @@ namespace ipl {
STATE_DONE,
};
#ifdef IPL_BOARD_INLINE_GETTERS
static Button* get_button() {
return static_cast<Button*>(System::getScene(SCENE_BUTTON));
}
static Arrow* get_arrow() {
return static_cast<Arrow*>(System::getScene(SCENE_ARROW));
}
#else
static Button* get_button();
static Arrow* get_arrow();
#endif
static const int OBJECTS_ON_SCREEN = 10;

View File

@@ -35,14 +35,7 @@ namespace ipl {
virtual void onSend();
virtual int sendMessageByNWC24(NWC24UserId userId, const wchar_t* wcString);
#ifdef IPL_ADDRESS_MATCHING
virtual void setFriendInfo(const NWC24FriendInfo& info) {
mbToFriend = true;
mFriendInfo = info;
}
#else
virtual void setFriendInfo(const NWC24FriendInfo& info);
#endif
virtual void setPhoto(const GXTexObj& texObj);
virtual int sendToWii(NWC24UserId userId, const wchar_t* wcString);

View File

@@ -62,200 +62,6 @@ namespace ipl {
};
// clang-format on
#ifdef IPL_CONTROLLER_NATIVE_HIERARCHY
#ifdef IPL_CONTROLLER_INLINE_INTERFACE
#define IPL_CONTROLLER_DEFAULT_VIRTUAL(signature, implementation) virtual signature implementation
#else
#define IPL_CONTROLLER_DEFAULT_VIRTUAL(signature, implementation) virtual signature;
#endif
class Interface {
public:
virtual ~Interface() = 0;
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getType() const, { return -1; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getChannel() const, { return -1; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool down(u32 button) const, { return false; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool downTrg(u32 button) const, { return false; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool upTrg(u32 button) const, { return false; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int pinch() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int pinchTrg() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int pinchOffTrg() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int decide() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool repeat(u32 button) const, { return false; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(BOOL rumble(int type = 0), { return FALSE; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(void cancelRumbling(), { })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getHoldFlag() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getTrigFlag() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getReleaseFlag() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getClassicHoldFlag() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getClassicTrigFlag() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getClassicReleaseFlag() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(math::VEC2 getDpdPos() const, { return math::VEC2(0.0f, 0.0f); })
IPL_CONTROLLER_DEFAULT_VIRTUAL(math::VEC2 getDpdProjectionPos() const, { return math::VEC2(0.0f, 0.0f); })
IPL_CONTROLLER_DEFAULT_VIRTUAL(math::VEC2 getHorizon() const, { return math::VEC2(0.0f, 0.0f); })
IPL_CONTROLLER_DEFAULT_VIRTUAL(f32 getDpdDistance() const, { return 0.0f; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(KPADStatus* getKPADStatus() const, { return NULL; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(PADStatus* getPADStatus() const, { return NULL; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool isValidBtn() const, { return false; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool isValidDpd() const, { return false; })
virtual void setForceInvalid(bool flag) = 0;
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getMainStickX() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getMainStickY() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getSubStickX() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int getSubStickY() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(void read(), { })
};
#undef IPL_CONTROLLER_DEFAULT_VIRTUAL
#ifdef IPL_CONTROLLER_INLINE_INTERFACE
inline Interface::~Interface() {}
#endif
class Base : public Interface {
public:
Base(int chan, KPADStatus& status) {
mButton = 0;
unk_0x08 = 0;
mLastRumbleTime = 0;
mRumbleType = -1;
mChan = chan;
mType = 2;
unk_0x1C = 0;
KPADEnableDPD(chan);
unk_0x1D = 0;
unk_0x1E = 0;
unk_0x20 = &status;
}
Base(int chan, int type, KPADStatus& status) {
mButton = 0;
unk_0x08 = 0;
mLastRumbleTime = 0;
mRumbleType = -1;
mChan = chan;
mType = type;
unk_0x1C = 0;
KPADEnableDPD(chan);
}
virtual ~Base();
virtual int getType() const override;
virtual int getChannel() const override;
virtual int decide() const override;
virtual BOOL rumble(int timer = 0) override;
virtual void cancelRumbling() override;
virtual void setForceInvalid(bool flag) override;
virtual void read() override;
protected:
u8 mButton;
u32 unk_0x08;
OSTick mLastRumbleTime;
s32 mRumbleType;
u32 mChan;
u32 mType;
u8 unk_0x1C;
u8 unk_0x1D;
u8 unk_0x1E;
KPADStatus* unk_0x20;
};
class Revolution : public Base {
public:
Revolution(int chan, KPADStatus& status) : Base(chan, status) {}
Revolution(int chan, int type, KPADStatus& status);
virtual ~Revolution();
virtual bool down(u32 button) const override;
virtual bool downTrg(u32 button) const override;
virtual bool upTrg(u32 button) const override;
virtual int pinch() const override;
virtual int pinchTrg() const override;
virtual int pinchOffTrg() const override;
virtual bool repeat(u32 button) const override;
virtual f32 getDpdDistance() const override;
virtual KPADStatus* getKPADStatus() const override;
virtual int getReleaseFlag() const override;
virtual int getTrigFlag() const override;
virtual int getHoldFlag() const override;
virtual math::VEC2 getDpdPos() const override;
virtual math::VEC2 getDpdProjectionPos() const override;
virtual math::VEC2 getHorizon() const override;
virtual bool isValidBtn() const override;
virtual bool isValidDpd() const override;
virtual void read() override;
};
class Classic : public Revolution {
public:
Classic(int chan, KPADStatus& status);
virtual ~Classic();
virtual bool down(u32 button) const override;
virtual bool downTrg(u32 button) const override;
virtual bool upTrg(u32 button) const override;
virtual int getClassicHoldFlag() const override;
virtual int getClassicTrigFlag() const override;
virtual int getClassicReleaseFlag() const override;
virtual math::VEC2 getDpdPos() const override;
virtual math::VEC2 getDpdProjectionPos() const override;
virtual math::VEC2 getHorizon() const override;
virtual bool isValidDpd() const override;
virtual void read() override;
virtual BOOL isValidDpdClassic() const;
private:
math::VEC2 unk_0x24;
int unk_0x2C;
};
class Master : public Interface {
public:
Master(Interface** controllers) : mpControllers(controllers) {}
virtual ~Master();
virtual bool down(u32 button) const override;
virtual bool downTrg(u32 button) const override;
virtual bool upTrg(u32 button) const override;
virtual bool repeat(u32 button) const override;
virtual int decide() const override;
virtual void setForceInvalid(bool flag) override;
private:
bool call(u32 button, bool (Interface::*func)(u32) const) const;
Interface** mpControllers;
};
class Core : public Revolution {
public:
Core(int chan, int type, KPADStatus& status) : Revolution(chan, type, status) {}
virtual ~Core();
};
class FreeStyle : public Revolution {
public:
FreeStyle(int chan, int type, KPADStatus& status) : Revolution(chan, type, status) {}
virtual ~FreeStyle();
};
class Manager {
public:
Manager(EGG::Heap* heap);
void read();
Interface* getController(int chan);
Interface* getMasterController();
Interface* getYoungController();
static void* alloc(u32 size);
static int free(void* ptr);
private:
static void* mpBuf;
static EGG::Heap* mpParentHeap;
static EGG::ExpHeap* mpHeap;
static EGG::Allocator* mpAllocator;
Interface* mControllers[4];
u32 mControllerStorage[4][12];
Master mMaster;
KPADStatus mKPADStatus[4];
s32 mInvalidCount[4];
};
#else
class Base {
public:
Base(int chan, KPADStatus& arg1) {
@@ -312,11 +118,11 @@ namespace ipl {
virtual bool setForceInvalid(bool flag); // 0x74
virtual int getMainStickX() const; // 0x78
virtual int getMainStickY() const; // 0x7C
virtual f32 getMainStickX() const; // 0x78
virtual f32 getMainStickY() const; // 0x7C
virtual int getSubStickX() const; // 0x80
virtual int getSubStickY() const; // 0x84
virtual f32 getSubStickX() const; // 0x80
virtual f32 getSubStickY() const; // 0x84
virtual void read(); // 0x88
@@ -363,10 +169,10 @@ namespace ipl {
virtual math::VEC2 getDpdPos() const override;
virtual math::VEC2 getDpdProjectionPos() const override;
virtual math::VEC2 getHorizon() const override;
virtual int getMainStickX() const override;
virtual int getMainStickY() const override;
virtual int getSubStickX() const override;
virtual int getSubStickY() const override;
virtual f32 getMainStickX() const override;
virtual f32 getMainStickY() const override;
virtual f32 getSubStickX() const override;
virtual f32 getSubStickY() const override;
virtual BOOL rumble(int type = 0) override;
virtual void read() override;
};
@@ -422,7 +228,6 @@ namespace ipl {
class Classic : public Revolution {
public:
Classic(int arg0, KPADStatus& arg1);
virtual ~Classic();
virtual bool down(u32 button) const override;
virtual bool downTrg(u32 button) const override;
@@ -463,7 +268,6 @@ namespace ipl {
static EGG::Allocator* mpAllocator;
u8 dummy[0x2F8];
};
#endif
} // namespace controller
} // namespace ipl

View File

@@ -54,9 +54,6 @@ namespace ipl {
const wchar_t* wcString; // 0x04
u32 stringLimit; // 0x08
u32 rowLimit; // 0x0C
#ifdef IPL_ADDRESS_EDIT_CPP
KeyboardSetting(KeyboardType keyboardType, const wchar_t* value, u32 limit, u32 rows);
#endif
} KeyboardSetting;
typedef struct State {

View File

@@ -38,9 +38,6 @@ namespace ipl {
}
const GXTexObj& getIconTexture() const { return mFaceTexObj; }
#ifdef IPL_ADDRESS_MATCHING
u8* getIconImage() const { return mpIconTex; }
#endif
u32 getIndex() const { return mFaceId; }
BOOL created() const { return mbCreated; }

View File

@@ -19,8 +19,6 @@ namespace ipl {
class Manager;
}
namespace savedata {
extern "C" BOOL iplSavedata_813597A0(void* manager, ESTitleId titleId);
class Manager {
public:
Manager(EGG::Heap* heap);
@@ -153,7 +151,6 @@ namespace ipl {
u8 unused_0x504[28];
friend class channel::Manager;
friend BOOL iplSavedata_813597A0(void* manager, ESTitleId titleId);
};
} // namespace savedata
} // namespace ipl

View File

@@ -20,12 +20,7 @@ namespace ipl {
Date() : year(MIN_YEAR), month(MIN_MONTH), day(MIN_DAY) {}
Date(int myYear, int myMonth, int myDay) : year(myYear), month(myMonth), day(myDay) {}
#ifdef IPL_BOARD_DATE_CTOR_OUT_OF_LINE
Date(const OSCalendarTime& cal);
#else
Date(const OSCalendarTime& cal) : year(cal.year), month(cal.mon + 1), day(cal.mday) {}
#endif
#line 24 "include/utility/iplCalendar.h"
Date(const Date& date) : year(date.year), month(date.month), day(date.day) {}
static Date getMaxDate() {
@@ -132,9 +127,6 @@ namespace ipl {
return days[month - 1];
}
#ifdef IPL_BOARD_WEEK_FUNCTION_OUT_OF_LINE
static int getWeek(const Date& date) NO_INLINE;
#else
static int getWeek(const Date& date) NO_INLINE {
int month, year, day;
month = date.month;
@@ -146,8 +138,6 @@ namespace ipl {
}
return (day + (((month * 13) + 8) / 5) + ((year / 400) + ((year + (year / 4)) - (year / 100)))) % 7;
}
#endif
#line 147 "include/utility/iplCalendar.h"
static int getWeek(int year, int month, int day) NO_INLINE {
if (month <= 2) {

View File

@@ -38,6 +38,19 @@ namespace EGG {
virtual void calc(); // 0x30
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x34
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x38
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x3C
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x44
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x44
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x48
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x50
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x50
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x58
#else
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, u32 id) { return mSoundArchivePlayer.StartSound(pHandle, id); } // 0x34
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, unsigned int id) { return mSoundArchivePlayer.StartSound(pHandle, id); } // 0x38
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, const char* pName) NO_INLINE {
@@ -62,6 +75,7 @@ namespace EGG {
u32 id = changeNameToId(pName);
return mSoundArchivePlayer.HoldSound(pHandle, id);
} // 0x58
#endif
u32 changeNameToId(const char* pName) { return mpArchive->ConvertLabelStringToSoundId(pName); }
const char* changeIdToName(u32 id) { return mpArchive->GetSoundLabelString(id); }

View File

@@ -19,6 +19,10 @@ namespace EGG {
~SoundHeapMgr() { destroySoundHeap(); }
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
virtual bool loadState(s32 id); // 0x08
virtual s32 getCurrentLevel(); // 0x0C
#else
virtual bool loadState(s32 id) {
s32 level = mHeap.GetCurrentLevel();
@@ -31,6 +35,7 @@ namespace EGG {
} // 0x08
virtual s32 getCurrentLevel() { return mHeap.GetCurrentLevel(); } // 0x0C
#endif
s32 saveState() { return mHeap.SaveState(); }

View File

@@ -1,30 +1,42 @@
#define EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
#include <egg/core.h>
#undef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
namespace EGG {
SimpleAudioMgrWithFx::SimpleAudioMgrWithFx() {
// Declaring this unused subclass makes the @52@ adjustor thunks emit in the
// original order (@52@__dt__ before @52@calc). All of its emissions strip.
class Sample : public SimpleAudioMgrWithFx {
public:
Sample() : SimpleAudioMgrWithFx() {}
virtual ~Sample() {}
};
SimpleAudioMgrWithFx::SimpleAudioMgrWithFx() {
}
SimpleAudioMgrWithFx::~SimpleAudioMgrWithFx() {
}
SimpleAudioMgrWithFx::ArgWithFx::ArgWithFx() : fxArg() {
// auto generates constructors
SimpleAudioMgrArg unused0;
AudioFxMgr::AudioFxMgrArg unused1;
}
void SimpleAudioMgrWithFx::initialize(IAudioMgr::Arg* arg) {
SimpleAudioMgr::initialize(arg);
if (arg != NULL) {
arg = (IAudioMgr::Arg*)&((ArgWithFx*)arg)->fxArg;
}
SimpleAudioMgrWithFx::~SimpleAudioMgrWithFx() {
}
initializeFx(&mHeap, (AudioFxMgrArg*)arg);
SimpleAudioMgrWithFx::ArgWithFx::ArgWithFx() : fxArg() {
// auto generates constructors
SimpleAudioMgrArg unused0;
AudioFxMgr::AudioFxMgrArg unused1;
}
setFxReverbHi(nw4r::snd::AUX_A, AudioFxMgr::getDefaultFxReverbHi());
setFxChorus(nw4r::snd::AUX_B, AudioFxMgr::getDefaultFxChorus());
void SimpleAudioMgrWithFx::initialize(IAudioMgr::Arg* arg) {
SimpleAudioMgr::initialize(arg);
mHeap.SaveState();
}
if (arg != NULL) {
arg = (IAudioMgr::Arg*)&((ArgWithFx*)arg)->fxArg;
}
initializeFx(&mHeap, (AudioFxMgrArg*)arg);
setFxReverbHi(nw4r::snd::AUX_A, AudioFxMgr::getDefaultFxReverbHi());
setFxChorus(nw4r::snd::AUX_B, AudioFxMgr::getDefaultFxChorus());
mHeap.SaveState();
}
} // namespace EGG

View File

@@ -50,10 +50,6 @@ namespace nw4r {
f32 FrSqrt(f32 x);
u32 CntBit1(u32 x);
#ifdef IPL_ADDRESS_MATCHING
inline f32 FSqrt(f32 x) { return (x <= 0.0f) ? 0.0f : x * FrSqrt(x); }
#endif
} // namespace math
} // namespace nw4r

View File

@@ -118,10 +118,6 @@ namespace nw4r {
return *this;
}
#ifdef IPL_ADDRESS_MATCHING
VEC2 operator-() const { return VEC2(-x, -y); }
#endif
VEC2 operator+(const VEC2& rhs) const { return VEC2(x + rhs.x, y + rhs.y); }
VEC2 operator-(const VEC2& rhs) const { return VEC2(x - rhs.x, y - rhs.y); }
VEC2 operator*(f32 val) const { return VEC2(val * x, val * y); }
@@ -134,10 +130,6 @@ namespace nw4r {
bool operator!=(const VEC2& rhs) const { return x != rhs.x || y != rhs.y; }
} VEC2;
#ifdef IPL_ADDRESS_MATCHING
inline f32 VEC2LenSq(const VEC2* p) { return p->x * p->x + p->y * p->y; }
#endif
typedef struct VEC3 VEC3;
inline VEC3* VEC3Transform(VEC3* pOut, const MTX34* pMtx, const VEC3* pVec);

View File

@@ -19,8 +19,13 @@ namespace nw4r {
template <typename T>
class AutoLock : private NonCopyable {
public:
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
explicit AutoLock(T& rLockObj);
~AutoLock();
#else
explicit AutoLock(T& rLockObj) : mLockObj(rLockObj) { Lock(rLockObj); }
~AutoLock() { Unlock(mLockObj); }
#endif
private:
T& mLockObj; // 0x00

View File

@@ -16,9 +16,7 @@ namespace nw4r {
#endif
Rect(f32 l, f32 t, f32 r, f32 b) : left(l), top(t), right(r), bottom(b) {}
#ifndef IPL_CONTROLLER_TRIVIAL_RECT_DTOR
~Rect() {}
#endif
void SetWidth(f32 width) { right = left + width; }
void SetHeight(f32 height) { bottom = top + height; }

View File

@@ -37,9 +37,6 @@ namespace nw4r {
} // namespace detail
template <typename TDerived, typename TBase>
#ifdef IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST
TDerived DynamicCast(TBase* pPtr);
#else
inline TDerived DynamicCast(TBase* pPtr) {
const detail::RuntimeTypeInfo* pDerivedTypeInfo = detail::GetTypeInfoFromPtr_(static_cast<TDerived>(NULL));
if (pPtr->GetRuntimeTypeInfo()->IsDerivedFrom(pDerivedTypeInfo)) {
@@ -47,7 +44,6 @@ namespace nw4r {
}
return NULL;
}
#endif
} // namespace ut
} // namespace nw4r

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,5 @@
#define IPL_BOARD_DATE_CTOR_OUT_OF_LINE
#define IPL_BOARD_WEEK_FUNCTION_OUT_OF_LINE
#include "iplSceneUI.h"
#include "iplSystem.h"
#if defined(SYSMENU_REGION_USA)
#define IPL_BOARD_DATE_HELPERS_INLINE
#endif
#define IPL_BOARD_INLINE_GETTERS
#include "scene/board/iplBoard.h"
#include "scene/board/iplBoardObject.h"
@@ -23,6 +13,8 @@
#include "scene/setting/iplSetting.h"
#include "iplSystem.h"
#include "utility/iplRBRUtility.h"
#define RECORD_DATE_TO_CDB(x) (CDBMakeCDBDate((x).year, (x).month, (x).day, (x).hour, (x).min, (x).sec))
@@ -79,11 +71,6 @@ namespace ipl {
init_search_condition();
}
}
namespace utility {
Date::Date(const OSCalendarTime& cal) : year(cal.year), month(cal.mon + 1), day(cal.mday) {}
}
namespace scene {
void Board::prepare() {
System::checkNandOverFlowFlagAsync();
@@ -440,13 +427,7 @@ namespace ipl {
cdb::Manager* cdbManager = System::getCdbManager();
struct InterruptState {
BOOL first;
BOOL second;
BOOL third;
BOOL result;
} interrupts;
interrupts.result = TRUE;
BOOL result = TRUE;
char recordType[8] = "";
@@ -479,17 +460,17 @@ namespace ipl {
// Find any free space to put the object on screen
interrupts.first = OSDisableInterrupts();
BOOL old = OSDisableInterrupts();
BOOL exist = is_exist_diff_date();
BoardObject* obj = mObjList.getNextFree();
OSRestoreInterrupts(interrupts.first);
OSRestoreInterrupts(old);
if (obj == NULL && exist) {
while (obj == NULL) {
OSSleepMilliseconds((OSTime)1);
interrupts.second = OSDisableInterrupts();
BOOL old2 = OSDisableInterrupts();
obj = mObjList.getNextFree();
OSRestoreInterrupts(interrupts.second);
OSRestoreInterrupts(old2);
}
}
@@ -529,16 +510,16 @@ namespace ipl {
goto close;
}
interrupts.result = TRUE;
result = TRUE;
if (((RBRHeader*)rbrData)->magic == RBR_MAGIC && cdbManager->isValidHeader((RBRHeader*)rbrData)) {
interrupts.third = OSDisableInterrupts();
BOOL old3 = OSDisableInterrupts();
if (recordDate == mCurrentDate) {
if (mbReading == true && mSearchRecord_Prev.created) {
mbReading = false;
delete[] rbrData;
OSRestoreInterrupts(interrupts.third);
OSRestoreInterrupts(old3);
return FALSE;
}
@@ -556,11 +537,11 @@ namespace ipl {
memcpy(&mSearchRecord_Prev, &mSearchRecord_Next, sizeof(SearchRecord));
}
} else {
interrupts.result = FALSE;
result = FALSE;
delete[] rbrData;
}
OSRestoreInterrupts(interrupts.third);
OSRestoreInterrupts(old3);
} else {
delete[] rbrData;
}
@@ -584,13 +565,13 @@ namespace ipl {
show_ricon();
}
interrupts.result = FALSE;
result = FALSE;
goto out;
error:
interrupts.result = FALSE;
result = FALSE;
out:
return interrupts.result;
return result;
}
void Board::stt_wait_cdb_init() {
@@ -1409,11 +1390,10 @@ namespace ipl {
#undef TEXT_LENGTH
}
const u32 scWeekMsgId[] = {MESG_CALENDAR_SUNDAY, MESG_CALENDAR_MONDAY, MESG_CALENDAR_TUESDAY, MESG_CALENDAR_WEDNESDAY,
MESG_CALENDAR_THURSDAY, MESG_CALENDAR_FRIDAY, MESG_CALENDAR_SATURDAY};
wchar_t scTextDateJpnFormat[] = L"%d%ls%d%ls%ls%ls%ls";
#ifndef IPL_BOARD_DATE_HELPERS_INLINE
inline void Board::get_text_jpn(const utility::Date& date, wchar_t* text, u32 textLen) {
static const u32 scWeekMsgId[] = {MESG_CALENDAR_SUNDAY, MESG_CALENDAR_MONDAY, MESG_CALENDAR_TUESDAY, MESG_CALENDAR_WEDNESDAY,
MESG_CALENDAR_THURSDAY, MESG_CALENDAR_FRIDAY, MESG_CALENDAR_SATURDAY};
void Board::get_text_jpn(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
const wchar_t* sep1 = msgMgr->getMessage(MESG_CALENDAR_MONDAY);
@@ -1421,13 +1401,10 @@ namespace ipl {
const wchar_t* weekStart = msgMgr->getMessage(MESG_CALENDAR_WEEK_START);
const wchar_t* weekEnd = msgMgr->getMessage(MESG_CALENDAR_WEEK_END);
swprintf(text, textLen, scTextDateJpnFormat, date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
swprintf(text, textLen, L"%d%ls%d%ls%ls%ls%ls", date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
}
#endif
wchar_t scTextDateKorFormat[] = L"%d%ls %d%ls%ls%ls%ls";
#ifndef IPL_BOARD_DATE_HELPERS_INLINE
inline void Board::get_text_kor(const utility::Date& date, wchar_t* text, u32 textLen) {
void Board::get_text_kor(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
const wchar_t* sep1 = msgMgr->getMessage(MESG_CALENDAR_MONDAY);
@@ -1435,25 +1412,9 @@ namespace ipl {
const wchar_t* weekStart = msgMgr->getMessage(MESG_CALENDAR_WEEK_START);
const wchar_t* weekEnd = msgMgr->getMessage(MESG_CALENDAR_WEEK_END);
swprintf(text, textLen, scTextDateKorFormat, date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
swprintf(text, textLen, L"%d%ls %d%ls%ls%ls%ls", date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
}
#endif
}
namespace utility {
int Calendar::getWeek(const Date& date) NO_INLINE {
int month, year, day;
month = date.month;
day = date.day;
year = date.year;
if (month <= 2) {
year--;
month += MAX_MONTH;
}
return (day + (((month * 13) + 8) / 5) + ((year / 400) + ((year + (year / 4)) - (year / 100)))) % 7;
}
}
namespace scene {
void Board::get_text_spa(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
@@ -1461,17 +1422,14 @@ namespace ipl {
swprintf(text, textLen, L"%ls %02d-%02d", week, date.day, date.month);
}
wchar_t scTextDateGerFormat[] = L"%02d.%02d.%ls%ls%ls";
#ifndef IPL_BOARD_DATE_HELPERS_INLINE
inline void Board::get_text_ger(const utility::Date& date, wchar_t* text, u32 textLen) {
void Board::get_text_ger(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
const wchar_t* weekStart = msgMgr->getMessage(MESG_CALENDAR_WEEK_START);
const wchar_t* weekEnd = msgMgr->getMessage(MESG_CALENDAR_WEEK_END);
swprintf(text, textLen, scTextDateGerFormat, date.day, date.month, weekStart, week, weekEnd);
swprintf(text, textLen, L"%02d.%02d.%ls%ls%ls", date.day, date.month, weekStart, week, weekEnd);
}
#endif
void Board::get_text_usaeng(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
@@ -1487,15 +1445,12 @@ namespace ipl {
swprintf(text, textLen, L"%ls %02d-%02d", week, date.month, date.day);
}
wchar_t scTextDatePalengFormat[] = L"%ls %02d/%02d";
#ifndef IPL_BOARD_DATE_HELPERS_INLINE
inline void Board::get_text_paleng(const utility::Date& date, wchar_t* text, u32 textLen) {
void Board::get_text_paleng(const utility::Date& date, wchar_t* text, u32 textLen) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
swprintf(text, textLen, scTextDatePalengFormat, week, date.day, date.month);
swprintf(text, textLen, L"%ls %02d/%02d", week, date.day, date.month);
}
#endif
void Board::show_ricon() {
u8 prev = mbRIconEnable;
@@ -2075,7 +2030,6 @@ namespace ipl {
}
}
#ifndef IPL_BOARD_INLINE_GETTERS
Button* Board::get_button() {
return static_cast<Button*>(System::getScene(SCENE_BUTTON));
}
@@ -2083,6 +2037,5 @@ namespace ipl {
Arrow* Board::get_arrow() {
return static_cast<Arrow*>(System::getScene(SCENE_ARROW));
}
#endif
} // namespace scene
} // namespace ipl

View File

@@ -1,6 +1,3 @@
#define IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST
#define IPL_BOARD_OBJECT_INLINE_INTERPOLATION_DTORS
#include "iplSceneUI.h"
#include "scene/board/iplBoard.h"
@@ -46,10 +43,6 @@ extern "C" void __ct__Q33ipl4math4VEC2Fff(ipl::math::VEC2*, f32, f32);
#define PICTURE_THUMB_HEIGHT 48
namespace ipl {
namespace math {
template <> inline LinearIntp<VEC2>::~LinearIntp() {}
template <> inline Interporation<VEC2>::~Interporation() {}
}
namespace scene {
// clang-format off
const char* BoardObject::mAnimNames[BoardObject::TYPE_MAX][1+BoardObject::ANIM_MAX] = {
@@ -485,10 +478,8 @@ namespace ipl {
}
void BoardObject::stt_stand() {
f32 degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
f32 dVar2 = nw4r::math::CosFIdx(degrees * 0.7111111f);
degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
f32 dVar3 = nw4r::math::SinFIdx(degrees * 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)));
math::VEC2 standPos;
__ct__Q33ipl4math4VEC2Fff(&standPos, dVar3 * 160.0f, dVar2 * 160.0f);
@@ -888,5 +879,14 @@ namespace ipl {
return result;
}
#ifndef NON_MATCHING
void forceWeakFunc(nw4r::math::VEC2& vec) {
nw4r::math::VEC2 end(vec / 10.0f);
}
#endif
void GenerateWEAK() {
nw4r::lyt::TextBox* textBox = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(((nw4r::lyt::Pane*)NULL)->FindPaneByName(NULL));
}
} // namespace scene
} // namespace ipl

File diff suppressed because it is too large Load Diff

View File

@@ -2900,6 +2900,67 @@ namespace ipl {
}
void ChannelTitle::startResetting() {
// clang-format off
static const f32 pad0 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad1 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad2 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad3 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad4 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad5 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad6 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad7 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad8 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad9 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad10 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad11 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad12 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad13 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad14 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad15 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad16 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad17 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad18 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad19 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad20 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad21 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad22 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad23 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad24 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad25 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad26 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad27 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad28 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad29 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad30 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad31 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad32 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad33 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad34 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad35 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad36 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad37 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad38 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad39 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad40 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad41 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad42 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad43 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad44 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad45 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad46 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad47 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad48 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad49 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad50 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad51 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad52 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const u8 pad53 __attribute__((section(".sdata"), aligned(1), used)) = 0;
static const u8 pad54 __attribute__((section(".sdata"), aligned(1), used)) = 0;
static const u8 pad55 __attribute__((section(".sdata"), aligned(1), used)) = 0;
static const u8 pad56 __attribute__((section(".sdata"), aligned(1), used)) = 0;
static const u8 pad57 __attribute__((section(".sdata"), aligned(1), used)) = 0;
static const u8 pad58 __attribute__((section(".sdata"), aligned(1), used)) = 0;
// clang-format on
snd::getSystem()->resetAllSound();
}
} // namespace scene

File diff suppressed because it is too large Load Diff

View File

@@ -1,187 +0,0 @@
#include <decomp/ide.h>
#include <math/iplMathTypes.h>
#define IPL_SOUND_RECT_OUT_OF_LINE
#include <nw4r/ut/Rect.h>
#undef IPL_SOUND_RECT_OUT_OF_LINE
#include <revolution/kpad.h>
#include <revolution/mtx/GeoTypes.h>
#include <revolution/os.h>
#include <revolution/os/OSTime.h>
#include <revolution/sc.h>
#include <revolution/wpad.h>
#define IPL_CONTROLLER_NATIVE_HIERARCHY
#include "system/iplController.h"
#undef IPL_CONTROLLER_NATIVE_HIERARCHY
#include "system/iplSystem.h"
extern "C" void _savegpr_16();
extern "C" void _restgpr_16();
extern "C" void _savegpr_29();
extern "C" void _restgpr_29();
extern "C" void _savegpr_27();
extern "C" void _restgpr_27();
extern "C" void _savegpr_28();
extern "C" void _restgpr_28();
namespace ipl {
namespace controller {
void* Manager::mpBuf;
EGG::Heap* Manager::mpParentHeap;
EGG::ExpHeap* Manager::mpHeap;
EGG::Allocator* Manager::mpAllocator;
void* Manager::alloc(u32 size) {
return mpAllocator->alloc(size);
}
int Manager::free(void* ptr) {
mpAllocator->free(ptr);
return TRUE;
}
Manager::Manager(EGG::Heap* heap) : mMaster(mControllers) {
memset(mKPADStatus, 0, sizeof(mKPADStatus));
memset(mControllers, 0, sizeof(mControllers));
u32 workSize = WPADGetWorkMemorySize() + 0x400;
if (mpBuf != NULL && mpParentHeap != NULL) {
mpParentHeap->free(mpBuf);
}
mpParentHeap = heap;
mpBuf = heap->alloc(workSize, 0x20);
if (mpHeap != NULL) {
mpHeap->destroy();
}
mpHeap = EGG::ExpHeap::create(mpBuf, workSize, 2);
if (mpAllocator != NULL) {
delete mpAllocator;
}
mpAllocator = new (heap, 4) EGG::Allocator(mpHeap, 4);
WPADRegisterAllocator(alloc, free);
KPADInit();
u32 sensitivity = SCGetBtDpdSensibility();
for (int i = 0; i < 4; i++) {
WPADSetDpdSensitivity(sensitivity);
KPADSetBtnRepeat(i, 0.5f, 0.1f);
}
read();
}
void Manager::read() {
for (int chan = 0; chan < 4; chan++) {
if (SCGetWpadSensorBarPosition() == 1) {
KPADSetSensorHeight(chan, 0.2f);
} else {
KPADSetSensorHeight(chan, -0.2f);
}
u32 deviceType;
s32 probe = WPADProbe(chan, &deviceType);
if (probe == -1) {
goto probe_invalid;
}
if (probe < -1) {
if (probe >= -3) {
goto probe_valid;
}
goto probe_invalid;
} else if (probe >= 1) {
goto probe_invalid;
}
probe_valid:
{
s32 read = KPADRead(chan, &mKPADStatus[chan], 1);
if (read > 0) {
if (mKPADStatus[chan].wpad_err == -4 || deviceType == 0xfd) {
goto store_null;
}
mInvalidCount[chan] = 0;
if (mKPADStatus[chan].wpad_err == -7 || deviceType == 0 || deviceType == 0xfb ||
deviceType == 0xfc || deviceType == 0xff) {
if (mControllers[chan] == NULL || mControllers[chan]->getType() != 0) {
mControllers[chan] = new (mControllerStorage[chan]) Core(chan, 0, mKPADStatus[chan]);
}
} else if (deviceType == 1) {
if (mControllers[chan] == NULL || mControllers[chan]->getType() != 1) {
mControllers[chan] = new (mControllerStorage[chan]) FreeStyle(chan, 1, mKPADStatus[chan]);
}
} else if (deviceType == 2) {
if (mControllers[chan] == NULL || mControllers[chan]->getType() != 2) {
mControllers[chan] = new (mControllerStorage[chan]) Classic(chan, mKPADStatus[chan]);
}
} else {
mControllers[chan] = NULL;
}
} else if (read == 0) {
mInvalidCount[chan]++;
if (mInvalidCount[chan] > 0x3c) {
mInvalidCount[chan] = 0x3c;
if (mControllers[chan] != NULL) {
WPADControlMotor(chan, 0);
}
mControllers[chan] = NULL;
}
} else {
goto store_null;
}
}
goto channel_done;
store_null:
mControllers[chan] = NULL;
goto channel_done;
probe_invalid:
KPADRead(chan, &mKPADStatus[chan], 1);
mControllers[chan] = NULL;
channel_done:
KPADSetPosParam(chan, 0.05f, 1.0f);
}
for (int chan = 0; chan < 4; chan++) {
if (mControllers[chan] != NULL) {
mControllers[chan]->read();
}
}
}
Revolution::Revolution(int chan, int type, KPADStatus& status) : Base(chan, type, status) {
unk_0x1D = 0;
unk_0x1E = 0;
unk_0x20 = &status;
}
Interface* Manager::getMasterController() {
return &mMaster;
}
Interface* Manager::getController(int chan) {
return ((Interface**)this)[chan];
}
Interface* Manager::getYoungController() {
Interface* ret = NULL;
for (int i = 0; i < 4; i++) {
Interface* controller = ((Interface**)this)[i];
if (controller != NULL) {
ret = controller;
break;
}
}
return ret;
}
Core::~Core() {}
FreeStyle::~FreeStyle() {}
}
}

View File

@@ -751,15 +751,51 @@ namespace ipl {
blr
}
void Manager::integrateTitleIDList(ESTitleId* titleIdsOut, ESTitleId* titleIdsIn, u32 titleCount) {
ESTitleId temporaryTitleIds[0x36] = {0};
int availableCount = getAvailableNumInList(titleIdsOut, 0x30);
if (availableCount != 0) {
makeTmpList(temporaryTitleIds, availableCount, titleIdsIn, titleCount);
moveTitleTmpToPrior(titleIdsOut, temporaryTitleIds);
}
asm void Manager::integrateTitleIDList(register ESTitleId* titleIdsOut, register ESTitleId* titleIdsIn, register u32 titleCount) {
nofralloc
stwu r1, -0x1d0(r1)
mflr r0
stw r0, 0x1d4(r1)
addi r11, r1, 0x1d0
bl _savegpr_28
li r0, 0x36
mr r28, r3
mr r29, r4
mr r30, r5
mr r31, r6
addi r4, r1, 4
li r3, 0
mtctr r0
integrateTitleIDList_L1:
stw r3, 4(r4)
stwu r3, 8(r4)
bdnz integrateTitleIDList_L1
mr r3, r28
mr r4, r29
li r5, 0x30
bl getAvailableNumInList__Q33ipl8savedata7ManagerFPCUxUl
cmpwi r3, 0
mr r5, r3
beq integrateTitleIDList_L2
mr r3, r28
mr r6, r30
mr r7, r31
addi r4, r1, 8
bl makeTmpList__Q33ipl8savedata7ManagerFPUxUlPUxUl
mr r3, r28
mr r4, r29
addi r5, r1, 8
bl moveTitleTmpToPrior__Q33ipl8savedata7ManagerFPUxPCUx
integrateTitleIDList_L2:
addi r11, r1, 0x1d0
bl _restgpr_28
lwz r0, 0x1d4(r1)
mtlr r0
addi r1, r1, 0x1d0
blr
}
asm void Manager::makeTmpList(register ESTitleId* titleIdsOut, register u32 availableCount, register ESTitleId* titleIdsIn, register u32 titleCount) {
nofralloc
stwu r1, -0x50(r1)
@@ -871,16 +907,48 @@ namespace ipl {
blr
}
void Manager::moveTitleTmpToPrior(ESTitleId* titleIdsOut, const ESTitleId* titleIdsIn) {
for (int titleIndex = 0; titleIndex < 0x36; titleIndex++) {
if (titleIdsIn[titleIndex] != TITLE_NULL) {
int availableIndex = getAvailableInList(titleIdsOut, 0x30);
if (availableIndex == -1) {
return;
}
titleIdsOut[availableIndex] = titleIdsIn[titleIndex];
}
}
asm void Manager::moveTitleTmpToPrior(register ESTitleId* titleIdsOut, register const ESTitleId* titleIdsIn) {
nofralloc
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
addi r11, r1, 0x20
bl _savegpr_26
mr r26, r3
mr r27, r4
mr r28, r5
li r29, 0
li r31, 0
moveTitleTmpToPrior_L1:
add r30, r28, r31
lwzx r0, r28, r31
lwz r3, 4(r30)
or. r0, r3, r0
beq moveTitleTmpToPrior_L2
mr r3, r26
mr r4, r27
li r5, 0x30
bl getAvailableInList__Q33ipl8savedata7ManagerFPCUxUl
cmpwi r3, -1
beq moveTitleTmpToPrior_L3
slwi r0, r3, 3
lwz r4, 4(r30)
add r3, r27, r0
lwz r0, 0(r30)
stw r4, 4(r3)
stw r0, 0(r3)
moveTitleTmpToPrior_L2:
addi r29, r29, 1
addi r31, r31, 8
cmpwi r29, 0x36
blt moveTitleTmpToPrior_L1
moveTitleTmpToPrior_L3:
addi r11, r1, 0x20
bl _restgpr_26
lwz r0, 0x24(r1)
mtlr r0
addi r1, r1, 0x20
blr
}
asm BOOL Manager::doUpdateChanInfos(register ESTitleId* titleIds) {
@@ -1131,7 +1199,6 @@ namespace ipl {
mData.prevSDPage = 0;
}
#ifdef __MWERKS__
asm void Manager::iplSavedata_813596B8(register ESTitleId titleId) {
nofralloc
lis r7, 0x4841
@@ -1201,16 +1268,27 @@ namespace ipl {
blr
}
extern "C" BOOL iplSavedata_813597A0(void* manager, ESTitleId titleId) {
Manager* savedataManager = static_cast<Manager*>(manager);
for (int index = 0; index < MAX_CHANNEL_TOTAL; index++) {
if (savedataManager->mData.titleCache[0][index] == titleId) {
return TRUE;
}
}
return FALSE;
extern "C" asm BOOL iplSavedata_813597A0(register void* manager, register ESTitleId titleId) {
nofralloc
li r0, 0x30
li r4, 0
mtctr r0
iplSavedata_813597A0_L1:
add r7, r3, r4
lwz r0, 0x340(r7)
lwz r7, 0x344(r7)
xor r0, r5, r0
xor r7, r6, r7
or. r0, r7, r0
bne iplSavedata_813597A0_L2
li r3, 1
blr
iplSavedata_813597A0_L2:
addi r4, r4, 8
bdnz iplSavedata_813597A0_L1
li r3, 0
blr
}
#endif
BOOL Manager::nand_error_handling(int code) {
BOOL result = FALSE;

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,8 @@ from odiff import dis, sym
import os
import itertools
os.chdir("/home/cole/projects/tests/wii-ipl")
def main():
unit, name = sys.argv[1], sys.argv[2]