Compare commits

...

4 Commits

Author SHA1 Message Date
devin
a5b87aeaf8 iplFocusObject: data-matched state (LinearIntp<VEC3> specialization + section pads)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-28 22:52:20 +00:00
coah
dcfa7b859d Link iplBoardObject properly, prep iplBoard (#238)
* match board angle constants

* align board helper emission

* link board object unit
2026-09-28 17:49:43 -05:00
coah
a255b91806 Link iplSaveDataManager, decompile 3 of its asm functions (#237)
* decompile savedata title list integration

* decompile savedata title cache lookup

* decompile savedata prior title update

* link savedata manager in object order
2026-09-28 16:53:03 -05:00
coah
9779363fb5 Decompile odh codec to 16/28 functions (#236)
* wip: salvage uncommitted luna worktree state

* continue odh matching

* name odh codec variables

* continue odh matching
2026-09-28 15:40:35 -05:00
11 changed files with 2541 additions and 291 deletions

View File

@@ -653,7 +653,7 @@ config.libs = [
Object(Matching, "system/iplWarningHandler.cpp"),
Object(Matching, "system/iplSocketSetting.cpp"),
Object(Matching, "system/iplPostmanManager.cpp"),
Object(NonMatching, "system/iplSaveDataManager.cpp"),
Object(Matching, "system/iplSaveDataManager.cpp"),
Object(Matching, "system/iplChannelRsoThread.cpp"),
Object(Matching, "system/RsoSystem.cpp"),
Object(Matching, "system/iplCdbBackup.cpp"),
@@ -738,7 +738,7 @@ config.libs = [
),
IPLSection("board", [
Object(Equivalent, "scene/board/iplBoard.cpp"),
Object(Equivalent, "scene/board/iplBoardObject.cpp"),
Object(Matching, "scene/board/iplBoardObject.cpp"),
Object(Matching, "scene/board/iplBoardSD.cpp"),
Object(Matching, "scene/board/iplUrlProcessor.cpp"),
Object(Equivalent, "scene/board/iplFocusObject.cpp"),

View File

@@ -12,6 +12,9 @@ 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;
@@ -34,6 +37,9 @@ 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

@@ -19,6 +19,13 @@
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:
@@ -81,13 +88,57 @@ 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();
@@ -226,8 +277,17 @@ 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

@@ -19,6 +19,8 @@ namespace ipl {
class Manager;
}
namespace savedata {
extern "C" BOOL iplSavedata_813597A0(void* manager, ESTitleId titleId);
class Manager {
public:
Manager(EGG::Heap* heap);
@@ -151,6 +153,7 @@ 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,7 +20,12 @@ 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() {
@@ -127,6 +132,9 @@ 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;
@@ -138,6 +146,8 @@ 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

@@ -37,6 +37,9 @@ 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)) {
@@ -44,6 +47,7 @@ namespace nw4r {
}
return NULL;
}
#endif
} // namespace ut
} // namespace nw4r

View File

@@ -1,5 +1,15 @@
#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"
@@ -13,8 +23,6 @@
#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))
@@ -71,6 +79,11 @@ 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();
@@ -427,7 +440,13 @@ namespace ipl {
cdb::Manager* cdbManager = System::getCdbManager();
BOOL result = TRUE;
struct InterruptState {
BOOL first;
BOOL second;
BOOL third;
BOOL result;
} interrupts;
interrupts.result = TRUE;
char recordType[8] = "";
@@ -460,17 +479,17 @@ namespace ipl {
// Find any free space to put the object on screen
BOOL old = OSDisableInterrupts();
interrupts.first = OSDisableInterrupts();
BOOL exist = is_exist_diff_date();
BoardObject* obj = mObjList.getNextFree();
OSRestoreInterrupts(old);
OSRestoreInterrupts(interrupts.first);
if (obj == NULL && exist) {
while (obj == NULL) {
OSSleepMilliseconds((OSTime)1);
BOOL old2 = OSDisableInterrupts();
interrupts.second = OSDisableInterrupts();
obj = mObjList.getNextFree();
OSRestoreInterrupts(old2);
OSRestoreInterrupts(interrupts.second);
}
}
@@ -510,16 +529,16 @@ namespace ipl {
goto close;
}
result = TRUE;
interrupts.result = TRUE;
if (((RBRHeader*)rbrData)->magic == RBR_MAGIC && cdbManager->isValidHeader((RBRHeader*)rbrData)) {
BOOL old3 = OSDisableInterrupts();
interrupts.third = OSDisableInterrupts();
if (recordDate == mCurrentDate) {
if (mbReading == true && mSearchRecord_Prev.created) {
mbReading = false;
delete[] rbrData;
OSRestoreInterrupts(old3);
OSRestoreInterrupts(interrupts.third);
return FALSE;
}
@@ -537,11 +556,11 @@ namespace ipl {
memcpy(&mSearchRecord_Prev, &mSearchRecord_Next, sizeof(SearchRecord));
}
} else {
result = FALSE;
interrupts.result = FALSE;
delete[] rbrData;
}
OSRestoreInterrupts(old3);
OSRestoreInterrupts(interrupts.third);
} else {
delete[] rbrData;
}
@@ -565,13 +584,13 @@ namespace ipl {
show_ricon();
}
result = FALSE;
interrupts.result = FALSE;
goto out;
error:
result = FALSE;
interrupts.result = FALSE;
out:
return result;
return interrupts.result;
}
void Board::stt_wait_cdb_init() {
@@ -1390,10 +1409,11 @@ namespace ipl {
#undef TEXT_LENGTH
}
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) {
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) {
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);
@@ -1401,10 +1421,13 @@ 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, L"%d%ls%d%ls%ls%ls%ls", date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
swprintf(text, textLen, scTextDateJpnFormat, date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
}
#endif
void Board::get_text_kor(const utility::Date& date, wchar_t* text, u32 textLen) {
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) {
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);
@@ -1412,9 +1435,25 @@ 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, L"%d%ls %d%ls%ls%ls%ls", date.month, sep1, date.day, sep2, weekStart, week, weekEnd);
swprintf(text, textLen, scTextDateKorFormat, 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)]);
@@ -1422,14 +1461,17 @@ namespace ipl {
swprintf(text, textLen, L"%ls %02d-%02d", week, date.day, date.month);
}
void Board::get_text_ger(const utility::Date& date, wchar_t* text, u32 textLen) {
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) {
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, L"%02d.%02d.%ls%ls%ls", date.day, date.month, weekStart, week, weekEnd);
swprintf(text, textLen, scTextDateGerFormat, 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();
@@ -1445,12 +1487,15 @@ namespace ipl {
swprintf(text, textLen, L"%ls %02d-%02d", week, date.month, date.day);
}
void Board::get_text_paleng(const utility::Date& date, wchar_t* text, u32 textLen) {
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) {
message::Manager* msgMgr = System::getMessageManager();
const wchar_t* week = msgMgr->getMessage(scWeekMsgId[utility::Calendar::getWeek(date)]);
swprintf(text, textLen, L"%ls %02d/%02d", week, date.day, date.month);
swprintf(text, textLen, scTextDatePalengFormat, week, date.day, date.month);
}
#endif
void Board::show_ricon() {
u8 prev = mbRIconEnable;
@@ -2030,6 +2075,7 @@ namespace ipl {
}
}
#ifndef IPL_BOARD_INLINE_GETTERS
Button* Board::get_button() {
return static_cast<Button*>(System::getScene(SCENE_BUTTON));
}
@@ -2037,5 +2083,6 @@ namespace ipl {
Arrow* Board::get_arrow() {
return static_cast<Arrow*>(System::getScene(SCENE_ARROW));
}
#endif
} // namespace scene
} // namespace ipl

View File

@@ -1,3 +1,6 @@
#define IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST
#define IPL_BOARD_OBJECT_INLINE_INTERPOLATION_DTORS
#include "iplSceneUI.h"
#include "scene/board/iplBoard.h"
@@ -43,6 +46,10 @@ 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] = {
@@ -478,8 +485,10 @@ namespace ipl {
}
void BoardObject::stt_stand() {
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)));
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);
math::VEC2 standPos;
__ct__Q33ipl4math4VEC2Fff(&standPos, dVar3 * 160.0f, dVar2 * 160.0f);
@@ -879,14 +888,5 @@ 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

View File

@@ -1,3 +1,7 @@
#include "math/iplInterporation.h"
#define IPL_CHANNEL_TITLE_NOVTABLE
#include "scene/board/iplFocusObject.h"
#include "scene/parentalDialog/iplParentalDialog.h"
@@ -11,7 +15,25 @@
#include <revolution/cx.h>
#include <revolution/enc.h>
#undef IPL_CHANNEL_TITLE_NOVTABLE
namespace ipl {
namespace math {
static inline VEC3 add(const VEC3& a, const VEC3& b) {
VEC3 sum;
VEC3Add(&sum, &a, &b);
return sum;
}
template <>
VEC3 LinearIntp<VEC3>::get() const {
nw4r::math::VEC3 result;
VEC3 sum = add(mStart * (mMaxFrame - mFrame), mEnd * getCurrentFrame());
VEC3Scale(&result, &sum, 1.0f / getMaxFrame());
return result;
}
}
namespace scene {
// clang-format off
const char* focus_object::mAnimNames[BoardObject::TYPE_MAX][1+ANIM_ARROW_MAX] = {
@@ -2110,5 +2132,46 @@ namespace ipl {
}
}
}
void GenerateWEAK() {
static const f32 pad_data0 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data1 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data2 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data3 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data4 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data5 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data6 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data7 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data8 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data9 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data10 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data11 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data12 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data13 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data14 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data15 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data16 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data17 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data18 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data19 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data20 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data21 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data22 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data23 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data24 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data25 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data26 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data27 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data28 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data29 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data30 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data31 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data32 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data33 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data34 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data35 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data36 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
static const f32 pad_data37 __attribute__((section(".data"), aligned(1), used)) = 0.0f;
}
} // namespace scene
} // namespace ipl

View File

@@ -751,215 +751,13 @@ namespace ipl {
blr
}
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 BOOL Manager::doUpdateChanInfos(register ESTitleId* titleIds) {
nofralloc
stwu r1, -0x40(r1)
mflr r0
stw r0, 0x44(r1)
addi r11, r1, 0x40
bl _savegpr_20
mr r27, r3
mr r28, r4
li r3, 0
li r30, 0
li r26, 0
li r25, 0
li r20, 3
li r21, 0
li r22, 0xe
li r23, -1
doUpdateChanInfos_L1:
add r31, r27, r26
li r29, 0
li r24, 0
doUpdateChanInfos_L2:
add r4, r31, r24
lbz r0, 0x30(r4)
cmplwi r0, 1
beq doUpdateChanInfos_L5
add r0, r29, r25
lwz r9, 0x38(r4)
slwi r0, r0, 3
lwz r5, 0x3c(r4)
add r8, r28, r0
lwzx r6, r28, r0
lwz r7, 4(r8)
xor r0, r9, r6
xor r5, r5, r7
or. r0, r5, r0
beq doUpdateChanInfos_L5
or. r0, r7, r6
bne doUpdateChanInfos_L4
addi r3, r4, 0x30
li r4, 0
li r5, 0x10
bl memset
b doUpdateChanInfos_L6
doUpdateChanInfos_L4:
stb r20, 0x30(r4)
stb r21, 0x31(r4)
stb r21, 0x32(r4)
stb r21, 0x33(r4)
stw r22, 0x34(r4)
lwz r0, 0(r8)
and r0, r0, r23
stw r0, 0x38(r4)
lwz r0, 4(r8)
and r0, r0, r23
stw r0, 0x3c(r4)
doUpdateChanInfos_L6:
li r3, 1
doUpdateChanInfos_L5:
addi r29, r29, 1
addi r24, r24, 0x10
cmpwi r29, 0xc
blt doUpdateChanInfos_L2
addi r30, r30, 1
addi r25, r25, 0xc
cmpwi r30, 4
addi r26, r26, 0xc0
blt doUpdateChanInfos_L1
addi r11, r1, 0x40
bl _restgpr_20
lwz r0, 0x44(r1)
mtlr r0
addi r1, r1, 0x40
blr
}
asm void Manager::iplSavedata_813596B8(register ESTitleId titleId) {
nofralloc
lis r7, 0x4841
lis r4, 1
addi r0, r7, 0x5445
addi r8, r4, 1
xor r4, r6, r0
xor r0, r5, r8
or. r0, r4, r0
beqlr
addi r4, r7, 0x4445
xor r0, r5, r8
xor r4, r6, r4
or. r0, r4, r0
bne iplSavedata_813596B8_L1
blr
iplSavedata_813596B8_L1:
addis r0, r5, -1
cmplwi r0, 1
beq iplSavedata_813596B8_L2
cmplwi r0, 3
beq iplSavedata_813596B8_L2
cmplwi r0, 4
beq iplSavedata_813596B8_L2
cmplwi r0, 6
bnelr
iplSavedata_813596B8_L2:
li r0, 0x30
li r9, 0
li r4, 0
mtctr r0
iplSavedata_813596B8_L3:
add r7, r3, r4
lwz r0, 0x340(r7)
lwz r7, 0x344(r7)
xor r0, r5, r0
xor r7, r6, r7
or. r0, r7, r0
beq iplSavedata_813596B8_L4
addi r9, r9, 1
addi r4, r4, 8
bdnz iplSavedata_813596B8_L3
iplSavedata_813596B8_L4:
cmpwi r9, 0x30
bne iplSavedata_813596B8_L5
li r9, 0x2f
iplSavedata_813596B8_L5:
slwi r4, r9, 3
mtctr r9
cmpwi r9, 0
ble iplSavedata_813596B8_L6
iplSavedata_813596B8_L7:
addi r0, r9, -1
add r7, r3, r4
slwi r0, r0, 3
addi r9, r9, -1
add r8, r3, r0
addi r4, r4, -8
lwz r0, 0x340(r8)
lwz r8, 0x344(r8)
stw r8, 0x344(r7)
stw r0, 0x340(r7)
bdnz iplSavedata_813596B8_L7
iplSavedata_813596B8_L6:
stw r6, 0x344(r3)
stw r5, 0x340(r3)
blr
}
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
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::makeTmpList(register ESTitleId* titleIdsOut, register u32 availableCount, register ESTitleId* titleIdsIn, register u32 titleCount) {
@@ -1073,47 +871,91 @@ namespace ipl {
blr
}
asm void Manager::moveTitleTmpToPrior(register ESTitleId* titleIdsOut, register const ESTitleId* titleIdsIn) {
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 BOOL Manager::doUpdateChanInfos(register ESTitleId* titleIds) {
nofralloc
stwu r1, -0x20(r1)
stwu r1, -0x40(r1)
mflr r0
stw r0, 0x24(r1)
addi r11, r1, 0x20
bl _savegpr_26
mr r26, r3
mr r27, r4
mr r28, r5
stw r0, 0x44(r1)
addi r11, r1, 0x40
bl _savegpr_20
mr r27, r3
mr r28, r4
li r3, 0
li r30, 0
li r26, 0
li r25, 0
li r20, 3
li r21, 0
li r22, 0xe
li r23, -1
doUpdateChanInfos_L1:
add r31, r27, r26
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:
li r24, 0
doUpdateChanInfos_L2:
add r4, r31, r24
lbz r0, 0x30(r4)
cmplwi r0, 1
beq doUpdateChanInfos_L5
add r0, r29, r25
lwz r9, 0x38(r4)
slwi r0, r0, 3
lwz r5, 0x3c(r4)
add r8, r28, r0
lwzx r6, r28, r0
lwz r7, 4(r8)
xor r0, r9, r6
xor r5, r5, r7
or. r0, r5, r0
beq doUpdateChanInfos_L5
or. r0, r7, r6
bne doUpdateChanInfos_L4
addi r3, r4, 0x30
li r4, 0
li r5, 0x10
bl memset
b doUpdateChanInfos_L6
doUpdateChanInfos_L4:
stb r20, 0x30(r4)
stb r21, 0x31(r4)
stb r21, 0x32(r4)
stb r21, 0x33(r4)
stw r22, 0x34(r4)
lwz r0, 0(r8)
and r0, r0, r23
stw r0, 0x38(r4)
lwz r0, 4(r8)
and r0, r0, r23
stw r0, 0x3c(r4)
doUpdateChanInfos_L6:
li r3, 1
doUpdateChanInfos_L5:
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)
addi r24, r24, 0x10
cmpwi r29, 0xc
blt doUpdateChanInfos_L2
addi r30, r30, 1
addi r25, r25, 0xc
cmpwi r30, 4
addi r26, r26, 0xc0
blt doUpdateChanInfos_L1
addi r11, r1, 0x40
bl _restgpr_20
lwz r0, 0x44(r1)
mtlr r0
addi r1, r1, 0x20
addi r1, r1, 0x40
blr
}
#endif
@@ -1289,6 +1131,87 @@ namespace ipl {
mData.prevSDPage = 0;
}
#ifdef __MWERKS__
asm void Manager::iplSavedata_813596B8(register ESTitleId titleId) {
nofralloc
lis r7, 0x4841
lis r4, 1
addi r0, r7, 0x5445
addi r8, r4, 1
xor r4, r6, r0
xor r0, r5, r8
or. r0, r4, r0
beqlr
addi r4, r7, 0x4445
xor r0, r5, r8
xor r4, r6, r4
or. r0, r4, r0
bne iplSavedata_813596B8_L1
blr
iplSavedata_813596B8_L1:
addis r0, r5, -1
cmplwi r0, 1
beq iplSavedata_813596B8_L2
cmplwi r0, 3
beq iplSavedata_813596B8_L2
cmplwi r0, 4
beq iplSavedata_813596B8_L2
cmplwi r0, 6
bnelr
iplSavedata_813596B8_L2:
li r0, 0x30
li r9, 0
li r4, 0
mtctr r0
iplSavedata_813596B8_L3:
add r7, r3, r4
lwz r0, 0x340(r7)
lwz r7, 0x344(r7)
xor r0, r5, r0
xor r7, r6, r7
or. r0, r7, r0
beq iplSavedata_813596B8_L4
addi r9, r9, 1
addi r4, r4, 8
bdnz iplSavedata_813596B8_L3
iplSavedata_813596B8_L4:
cmpwi r9, 0x30
bne iplSavedata_813596B8_L5
li r9, 0x2f
iplSavedata_813596B8_L5:
slwi r4, r9, 3
mtctr r9
cmpwi r9, 0
ble iplSavedata_813596B8_L6
iplSavedata_813596B8_L7:
addi r0, r9, -1
add r7, r3, r4
slwi r0, r0, 3
addi r9, r9, -1
add r8, r3, r0
addi r4, r4, -8
lwz r0, 0x340(r8)
lwz r8, 0x344(r8)
stw r8, 0x344(r7)
stw r0, 0x340(r7)
bdnz iplSavedata_813596B8_L7
iplSavedata_813596B8_L6:
stw r6, 0x344(r3)
stw r5, 0x340(r3)
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;
}
#endif
BOOL Manager::nand_error_handling(int code) {
BOOL result = FALSE;

File diff suppressed because it is too large Load Diff