diff --git a/include/layout/iplLayout.h b/include/layout/iplLayout.h index 9256a7b1..5716b549 100644 --- a/include/layout/iplLayout.h +++ b/include/layout/iplLayout.h @@ -143,8 +143,8 @@ namespace ipl { void adjustHeap(); void destroyHeap(); - static Object* create(EGG::Heap* heap, u32 unk0, nand::LayoutFile* file, const char* directory, const char* fileName); - static Object* create(EGG::Heap* heap, u32 unk0, void* buffer, const char* directory, const char* fileName); + static Object* create(EGG::Heap* heap, u32 allocSize, nand::LayoutFile* file, const char* directory, const char* fileName); + static Object* create(EGG::Heap* heap, u32 allocSize, void* buffer, const char* directory, const char* fileName); /** @brief Prepare the camera for the layout. */ static void setCamera() { utility::Graphics::setOrtho(); } @@ -191,10 +191,10 @@ namespace ipl { void setVisible(const char* paneName, bool flag) { layout::Wrapper::SetVisible(FindPaneByName(paneName), flag); } nw4r::lyt::Pane* GetRootPane() { return mLayout.GetRootPane(); } - nw4r::lyt::Pane* FindPaneByName(const char* findName) { return GetRootPane()->FindPaneByName(findName); } + nw4r::lyt::Group* FindGroupByName(const char* findName) const { return mLayout.GetGroupContainer()->FindGroupByName(findName); } + nw4r::lyt::GroupList& GetGroupList() const { return mLayout.GetGroupContainer()->GetGroupList(); } - void SetTranslate(const math::VEC3& translate) { SetTranslate(translate); } - void SetTranslate(const math::VEC2& translate) { SetTranslate(math::VEC3(translate.x, translate.y, 0.0f)); } + nw4r::lyt::Pane* FindPaneByName(const char* findName) { return GetRootPane()->FindPaneByName(findName); } private: void init_(const char* fileName); diff --git a/include/scene/channelSelect/iplChannelObj.h b/include/scene/channelSelect/iplChannelObj.h new file mode 100644 index 00000000..778a2e8c --- /dev/null +++ b/include/scene/channelSelect/iplChannelObj.h @@ -0,0 +1,157 @@ +#ifndef IPL_SCENE_CHANNEL_OBJECT_H +#define IPL_SCENE_CHANNEL_OBJECT_H + +#include "layout/iplLayout.h" +#include "system/iplNand.h" +#include "system/iplNandShared.h" + +#include "system/iplChannelRsoThread.h" + +#include + +#include + +namespace ipl { + namespace scene { + class ChannelObj { + public: + ChannelObj(EGG::Heap* heap, int page, int index); + ~ChannelObj(); + + void create(nand::LayoutFile* layoutFile); + void prepare(); + + void calc(); + void calcNormal(); + + void setHeaps(EGG::Heap* heap0, EGG::Heap* heap1); + void setDiskLayouts(layout::Object* diskLyt, layout::Animator* diskAnim, EGG::Heap* diskHeap); + void setBasePane(const nw4r::lyt::Pane* basePane); + + void initExtModule(EGG::Heap* moduleHeap, channel::RsoThread* moduleThread); + + int calcExtModule(EGG::ExpHeap* expHeap, bool unk0, bool unk1); + + void drawThumbnail(); + void drawCursor(); + void drawBalloon(); + + void createDiskLayout(void* data); + void destroyDiskLayout(); + void changeDisk(); + void resetDiskTitleName(); + + nw4r::math::VEC3& getTranslate() const; + + BOOL isLayoutCreated() const; + BOOL isDiskChannel() const; + BOOL isValid() const; + + void onPoint(int unk); + void onLeft(int unk); + void onPinch(bool unk); + + void setCursorDecideAnim(); + + void initCursorAnim(bool unk); + void initBalloonAnim(bool unk); + + void FillModuleCount(); + + static void setLangPane(const layout::Object* layout); + + static void bindRsoAnm(layout::Object* layout, layout::Animator** anims, const char* unk); + + int loadThumbnailAsync(); + + void createThumbnail(); + + f32 createWadThumbnail(); + f32 createWrongThumbnail(); + f32 createEmptyThumbnail(); + + void initCursor(); + void calcCursor(const nw4r::math::VEC3& vec); + + void setCursorAnim(int unk); + void calcCursorAnim(); + void startCursorAnim(int unk); + + void initBalloon(); + void setBalloonText(const wchar_t* text); + void calcBalloon(const nw4r::math::VEC3& vec); + + void setBalloonAnim(int unk); + void calcBalloonAnim(int unk); + + void clearModuleParam(); + + void bindNewAnm(layout::Object* layout); + + void setupNew(); + void updateNew(); + + private: + u8 unk_0x00[8]; + + EGG::Heap* unk_0x08; + EGG::Heap* unk_0x0C; + EGG::Heap* unk_0x10; + EGG::Heap* mpDiskHeap; // 0x14 + + int unk_0x18; + + int mChanPage; // 0x1C + int mChanIndex; // 0x20 + + nand::LayoutFile* unk_0x24; + + nw4r::lyt::Pane* mpBasePane; // 0x28 + + nand::File* unk_0x2C; + layout::Object* unk_0x30; + layout::Animator* unk_0x34; + layout::Object* mpDiskLyt; // 0x38 + layout::Animator* mpDiskAnim; // 0x3C + layout::Object* unk_0x40; + layout::Animator* unk_0x44; + layout::Object* unk_0x48; + layout::Animator* unk_0x4C[3]; + int unk_0x58; + int unk_0x5C; + layout::Object* unk_0x60; + u8 unk_0x64[4]; + int unk_0x68; + int unk_0x6C; + int unk_0x70; + int unk_0x74; + nw4r::lyt::Group* unk_0x78; + int unk_0x7C; + u8 unk_0x80; + int unk_0x84; + int unk_0x88; + f32 unk_0x8C; + f32 unk_0x90; + f32 mLocationAdjust; // 0x94 + EGG::Heap* mpModuleHeap; // 0x98 + EGG::ExpHeap* unk_0x9C; + EGG::ExpHeap* unk_0xA0; + layout::Animator* unk_0xA4[16]; + u8 unk_0xE4; + channel::RsoThread* unk_0xE8; + int unk_0xEC; + nand::SharedFile* unk_0xF0; + u8 unk_0xF4; + u32 unk_0xF8; + u32 unk_0xFC; + RSOObjectHeader* unk_0x100; + u8* unk_0x104; + channel::CalcFunc unk_0x108; + u8 unk_0x10C; + u8 unk_0x10D; + EGG::ExpHeap* unk_0x110; + }; + } +} + +#endif // IPL_SCENE_CHANNEL_OBJECT_H diff --git a/include/system/iplChannelManager.h b/include/system/iplChannelManager.h index 281297d3..c1d9530f 100644 --- a/include/system/iplChannelManager.h +++ b/include/system/iplChannelManager.h @@ -44,6 +44,11 @@ namespace ipl { SECONARY_TYPE_NORMAL = 0, SECONARY_TYPE_SYSTEM, }; + + enum { + SCENE_ID_WAD_CHANNEL = 0x0E, // ? + SCENE_ID_DISK_CHANNEL = 0x0F, + }; typedef struct SChannelInfo { inline void clear() { @@ -51,7 +56,7 @@ namespace ipl { secondaryType = 0; reserved[0] = 0; reserved[1] = 0; - flags = 0; + sceneID = 0; titleType = 0; titleCode = 0; } @@ -60,7 +65,7 @@ namespace ipl { u8 reserved[2]; // 0x02 - s32 flags; // 0x04 + s32 sceneID; // 0x04 union { struct { @@ -246,9 +251,21 @@ namespace ipl { void makeLoadOrderList(int* list) const; + SEntry& getChannel(int page, int index) { return mChannels[page][index]; } + ESTitleId getTitleID(int page, int index) const; u16* getTitleName(int page, int index, int nameIndex) const; + /* SEntry */ + bool hasLoadedBnr(int page, int index) const { return mChannels[page][index].loadedBnr; } + int getSceneID(int page, int index) const { return mChannels[page][index].loadedBnr ? mChannels[page][index].info.sceneID : 0; } + + /* SMetaBlockHeader */ + u32 getMetaHdr_IconRSOIdx(int page, int index) const { return mChannels[page][index].loadedBnr ? mChannels[page][index].metaHdr->blockHdr.iconRSOIdx : 0; } + u32 getMetaHdr_IconCSIdx(int page, int index) const { return mChannels[page][index].loadedBnr ? mChannels[page][index].metaHdr->blockHdr.iconCSIdx : 0; } + u32 getMetaHdr_BannerRSOIdx(int page, int index) const { return mChannels[page][index].loadedBnr ? mChannels[page][index].metaHdr->blockHdr.bannerRSOIdx : 0; } + u32 getMetaHdr_BannerCSIdx(int page, int index) const { return mChannels[page][index].loadedBnr ? mChannels[page][index].metaHdr->blockHdr.bannerCSIdx : 0; } + int updateInitState(); int updateWaitSCFlush(); void updateDiskState(); @@ -281,8 +298,6 @@ namespace ipl { void fn_8133A9F0(); void fn_8133AA50(ESTitleId titleId); - SEntry& getChannel(int page, int index) { return mChannels[page][index]; } - BOOL isReady() { return mState == FINISH; } private: diff --git a/include/system/iplChannelRsoThread.h b/include/system/iplChannelRsoThread.h index 951e6c8d..309b312c 100644 --- a/include/system/iplChannelRsoThread.h +++ b/include/system/iplChannelRsoThread.h @@ -7,7 +7,9 @@ namespace ipl { namespace channel { - typedef void (*CalcFunc)(); + typedef void (*CreateFunc)(void*); + typedef BOOL (*CalcFunc)(int); + typedef void (*ThreadCalcFunc)(); class RsoThread : public utility::ut_thread { public: @@ -19,7 +21,7 @@ namespace ipl { void start(); /** @param func The new loop function. */ - void setCalcFunc(CalcFunc func); + void setCalcFunc(ThreadCalcFunc func); OSMessageQueue* getCalcQueue() { return &mCalcQueue; } @@ -28,7 +30,7 @@ namespace ipl { bool mbStarted; // 0x330 - CalcFunc mpCalcFunc; // 0x334 + ThreadCalcFunc mpCalcFunc; // 0x334 OSMessageQueue mCalcQueue; // 0x338 OSMessage mCalcMsg; // 0x358 }; diff --git a/include/system/iplChannelScriptManager.h b/include/system/iplChannelScriptManager.h index e4b52a81..88a2cf6f 100644 --- a/include/system/iplChannelScriptManager.h +++ b/include/system/iplChannelScriptManager.h @@ -10,6 +10,8 @@ #include "system/iplChannelRsoThread.h" #include "system/iplNand.h" +#include "layout/iplLayout.h" + #include "channelScript/CHANSVm.h" namespace ipl { @@ -18,17 +20,13 @@ namespace ipl { public: class CSData { public: - undefined4 unk_0x00; - undefined4 unk_0x04; - undefined4 unk_0x08; - undefined4 unk_0x0C; - undefined4 unk_0x10; - u32 nwc24AppId; // 0x14 - bool unk_0x18; - undefined unk_0x19; - undefined unk_0x1A; - undefined unk_0x1B; - undefined4 unk_0x1C; + EGG::ExpHeap* unk_0x00; + layout::Object* unk_0x04; + layout::Animator** unk_0x08; + u64 unk_0x10; + u8 unk_0x18; + u8 unk_0x19; + u8 unk_0x1A; }; ChannelScriptManager(); diff --git a/include/system/iplNand.h b/include/system/iplNand.h index 5db4eac5..a46f86b4 100644 --- a/include/system/iplNand.h +++ b/include/system/iplNand.h @@ -65,8 +65,8 @@ namespace ipl { /** @brief Writes the file contents. */ virtual void write(); // 0x10 - virtual bool isFinished() { return mbDoneTask; } // 0x14 - virtual int checkData() { return mResult; } // 0x18 + virtual bool isFinished() { return mbDoneTask; } // 0x14 + virtual int checkData() { return mResult; } // 0x18 virtual bool isFatalError(); // 0x1C u8* getBuffer() const { return mpBuffer; } diff --git a/include/utility/iplFrameController.h b/include/utility/iplFrameController.h index 37b877ad..c5d85f00 100644 --- a/include/utility/iplFrameController.h +++ b/include/utility/iplFrameController.h @@ -35,6 +35,8 @@ namespace ipl { void setMinFrame(f32 value) { mMinFrame = value; } void setMinFrame(u32 value) { mMinFrame = value; } f32 getMinFrame() const { return mMinFrame; } + + f32 getLength() const { return mMaxFrame - mMinFrame; } void setCurrentFrame(f32 value) { mFrame = value; } f32 getCurrentFrame() const { return mFrame; } diff --git a/libs/NW4R/include/nw4r/lyt/group.h b/libs/NW4R/include/nw4r/lyt/group.h index 958d55d0..eb3bc239 100644 --- a/libs/NW4R/include/nw4r/lyt/group.h +++ b/libs/NW4R/include/nw4r/lyt/group.h @@ -34,7 +34,7 @@ namespace nw4r { ut::LinkListNode mLink; // 0x04 - protected: + private: PaneLinkList mPaneLinkList; // 0x0C char mName[16]; // 0x18 diff --git a/libs/NW4R/include/nw4r/lyt/material.h b/libs/NW4R/include/nw4r/lyt/material.h index cd30c0fa..c927a603 100644 --- a/libs/NW4R/include/nw4r/lyt/material.h +++ b/libs/NW4R/include/nw4r/lyt/material.h @@ -50,27 +50,29 @@ namespace nw4r { virtual void SetAnimationEnable(AnimTransform* animTrans, bool bEnable); - const char* GetName() const { return mName; } - GXColorS10 GetTevColor(u32 idx) const { return mTevCols[idx]; } + const char* GetName() const { return mName; } - u8 GetTextureCap() const { return mGXMemCap.texMap; } + GXColorS10 GetTevColor(u32 idx) const { return mTevCols[idx]; } + void SetTevColor(u32 idx, const GXColorS10& val) { mTevCols[idx] = val; } - u8 GetTexSRTCap() const { return mGXMemCap.texSRT; } + u8 GetTextureCap() const { return mGXMemCap.texMap; } - u8 GetTexCoordGenCap() const { return mGXMemCap.texCoordGen; } + u8 GetTexSRTCap() const { return mGXMemCap.texSRT; } - u8 GetIndTexSRTCap() const { return mGXMemCap.indSRT; } + u8 GetTexCoordGenCap() const { return mGXMemCap.texCoordGen; } - bool IsTevSwapCap() const { return static_cast(mGXMemCap.tevSwap); } - bool IsBlendModeCap() const { return static_cast(mGXMemCap.blendMode); } - bool IsAlphaCompareCap() const { return static_cast(mGXMemCap.alpComp); } + u8 GetIndTexSRTCap() const { return mGXMemCap.indSRT; } - bool IsMatColorCap() const { return static_cast(mGXMemCap.matCol); } - bool IsChanCtrlCap() const { return static_cast(mGXMemCap.chanCtrl); } + bool IsTevSwapCap() const { return static_cast(mGXMemCap.tevSwap); } + bool IsBlendModeCap() const { return static_cast(mGXMemCap.blendMode); } + bool IsAlphaCompareCap() const { return static_cast(mGXMemCap.alpComp); } - u8 GetTextureNum() const { return mGXMemNum.texMap; } + bool IsMatColorCap() const { return static_cast(mGXMemCap.matCol); } + bool IsChanCtrlCap() const { return static_cast(mGXMemCap.chanCtrl); } - bool IsUserAllocated() const { return mbUserAllocated; } + u8 GetTextureNum() const { return mGXMemNum.texMap; } + + bool IsUserAllocated() const { return mbUserAllocated; } void SetName(const char* name); diff --git a/libs/RVL_SDK/include/revolution/rso.h b/libs/RVL_SDK/include/revolution/rso.h index 967c49e8..2c2a52c4 100644 --- a/libs/RVL_SDK/include/revolution/rso.h +++ b/libs/RVL_SDK/include/revolution/rso.h @@ -99,7 +99,7 @@ RSOExportTable* RSOGetExport(RSOSymbolHeader* exp); int RSOLink(RSOObjectHeader* rsoImp, RSOObjectHeader* rsoExp); void RSOUnLink(RSOObjectHeader* rsoImp, RSOObjectHeader* rsoExp); -RSOHash RSOGetHash(char* symbolname); +RSOHash RSOGetHash(const char* symbolname); int RSOGetNumImportSymbols(RSOSymbolHeader* imp); int RSOGetNumImportSymbolsUnresolved(RSOObjectHeader* rso); @@ -112,13 +112,13 @@ int RSOGetNumExportSymbols(RSOSymbolHeader* exp); char* RSOGetExportSymbolName(RSOSymbolHeader* exp, int index); void* RSOGetExportSymbolAddr(RSOObjectHeader* rso, int index); -void* RSOFindExportSymbolAddr(RSOObjectHeader* rso, char* name); -RSOExportTable* RSOFindExportSymbol(RSOObjectHeader* rso, char* name); +void* RSOFindExportSymbolAddr(RSOObjectHeader* rso, const char* name); +RSOExportTable* RSOFindExportSymbol(RSOObjectHeader* rso, const char* name); -BOOL RSOListInit(void* i_staticRso); +BOOL RSOListInit(void* staticRso); -BOOL RSOLinkList(void* i_newRso, void* i_bss); -BOOL RSOUnLinkList(void* i_oldRso); +BOOL RSOLinkList(void* newRso, void* bss); +BOOL RSOUnLinkList(void* oldRso); #ifdef __cplusplus } diff --git a/libs/RVL_SDK/src/rso/RSOLink.c b/libs/RVL_SDK/src/rso/RSOLink.c index 49b7cd1c..97e92186 100644 --- a/libs/RVL_SDK/src/rso/RSOLink.c +++ b/libs/RVL_SDK/src/rso/RSOLink.c @@ -127,7 +127,7 @@ static void RSOResolveImportSymbol(RSOObjectHeader* rsoImp, int index, void* add static void RSOUnresolveImportSymbol(RSOObjectHeader* rsoImp, int index); static void RSOUnresolveImportSymbolAll(RSOObjectHeader* rso); -static int FindExportIndex(RSOObjectHeader* rso, char* name); +static int FindExportIndex(RSOObjectHeader* rso, const char* name); static void RSORelocate(RSORel* rel, int index, u32 offset); static void RSORelocateImportSymbol(RSOObjectHeader* rso, RSOImportTable* impTab, int impIndex); @@ -435,7 +435,7 @@ void RSOUnLink(RSOObjectHeader* rsoImp, RSOObjectHeader* rsoExp) { } } -RSOHash RSOGetHash(char* symbolname) { +RSOHash RSOGetHash(const char* symbolname) { RSOHash h = 0x00000000; RSOHash g; @@ -533,7 +533,7 @@ void* RSOGetExportSymbolAddr(RSOObjectHeader* rso, int index) { return (void*)(expSec->offset + expTab->value); } -static int FindExportIndex(RSOObjectHeader* rso, char* name) { +static int FindExportIndex(RSOObjectHeader* rso, const char* name) { RSOHash a_hash = RSOGetHash(name); int i; char* expName; @@ -617,7 +617,7 @@ static int FindExportIndex(RSOObjectHeader* rso, char* name) { return -1; } -void* RSOFindExportSymbolAddr(RSOObjectHeader* rso, char* name) { +void* RSOFindExportSymbolAddr(RSOObjectHeader* rso, const char* name) { int a_idx = FindExportIndex(rso, name); if (a_idx == -1) { @@ -627,7 +627,7 @@ void* RSOFindExportSymbolAddr(RSOObjectHeader* rso, char* name) { return RSOGetExportSymbolAddr(rso, a_idx); } -RSOExportTable* RSOFindExportSymbol(RSOObjectHeader* rso, char* name) { +RSOExportTable* RSOFindExportSymbol(RSOObjectHeader* rso, const char* name) { int a_idx = FindExportIndex(rso, name); if (a_idx == -1) { diff --git a/src/layout/iplLayout.cpp b/src/layout/iplLayout.cpp index 95ed43c6..fe06bfa3 100644 --- a/src/layout/iplLayout.cpp +++ b/src/layout/iplLayout.cpp @@ -430,13 +430,13 @@ namespace ipl { mpHeap->destroy(); } - Object* Object::create(EGG::Heap* heap, u32 unk0, nand::LayoutFile* file, const char* directory, const char* fileName) { - EGG::ExpHeap* expHeap = EGG::ExpHeap::create(unk0, heap, MEM_HEAP_OPT_DEBUG_FILL); + Object* Object::create(EGG::Heap* heap, u32 allocSize, nand::LayoutFile* file, const char* directory, const char* fileName) { + EGG::ExpHeap* expHeap = EGG::ExpHeap::create(allocSize, heap, MEM_HEAP_OPT_DEBUG_FILL); return new(expHeap, 4) Object(expHeap, file, directory, fileName); } - Object* Object::create(EGG::Heap* heap, u32 unk0, void* buffer, const char* directory, const char* fileName) { - EGG::ExpHeap* expHeap = EGG::ExpHeap::create(unk0, heap, MEM_HEAP_OPT_DEBUG_FILL); + Object* Object::create(EGG::Heap* heap, u32 allocSize, void* buffer, const char* directory, const char* fileName) { + EGG::ExpHeap* expHeap = EGG::ExpHeap::create(allocSize, heap, MEM_HEAP_OPT_DEBUG_FILL); return new(expHeap, 4) Object(expHeap, buffer, directory, fileName); } diff --git a/src/scene/board/iplFocusObject.cpp b/src/scene/board/iplFocusObject.cpp index 0e5c1888..9179fea8 100644 --- a/src/scene/board/iplFocusObject.cpp +++ b/src/scene/board/iplFocusObject.cpp @@ -10,7 +10,7 @@ #include #include -#pragma sym on + namespace ipl { namespace scene { const char* focus_object::mAnimNames[BoardObject::TYPE_MAX][1+ANIM_ARROW_MAX] = { @@ -25,7 +25,7 @@ namespace ipl { "my_Memo_a_Appear.brlan", "my_Memo_a_Lost.brlan", "my_Memo_a_HDActionStart.brlan", - "my_Memo_a_HDActionEnd.brlan" + "my_Memo_a_HDActionEnd.brlan" }, { "my_LetterL.brlyt", @@ -38,7 +38,7 @@ namespace ipl { "my_LetterL_Appear.brlan", "my_LetterL_Lost.brlan", "my_LetterL_HDActionStart.brlan", - "my_LetterL_HDActionEnd.brlan", + "my_LetterL_HDActionEnd.brlan", }, { "my_Memo_a.brlyt", @@ -51,7 +51,7 @@ namespace ipl { "my_Memo_a_Appear.brlan", "my_Memo_a_Lost.brlan", "my_Memo_a_HDActionStart.brlan", - "my_Memo_a_HDActionEnd.brlan", + "my_Memo_a_HDActionEnd.brlan", } }; diff --git a/src/scene/channelSelect/iplChannelObj.cpp b/src/scene/channelSelect/iplChannelObj.cpp new file mode 100644 index 00000000..de6258cb --- /dev/null +++ b/src/scene/channelSelect/iplChannelObj.cpp @@ -0,0 +1,1006 @@ +#include "scene/channelSelect/iplChannelObj.h" + +#include + +#include "iplSystem.h" + +namespace ipl { + namespace scene { + static const char* scPaneAnims[] = { + "Cursur_a", + "T_Balloon", + }; + + static const char* scCursorAnims[] = { + "my_IplTop_d_FocusOff.brlan", + "my_IplTop_d_FocusOn.brlan", + "my_IplTop_d_Select.brlan", + }; + + static const char* scLangGroups[] = { + "JPN", + "ENG", + "GER", + "FRA", + "SPA", + "ITA", + "NED", + "CHN", + "ENG", + "KOR", + }; + + static const char* lbl_8164E328[SC_PRODUCT_AREA_MAX][16] = { + // Japan + { + "JPN", + NULL, + }, + // USA + { + "ENG", + "FRA", + "SPA", + NULL, + }, + // Europe + { + "ENG", + "FRA", + "GER", + "SPA", + "ITA", + "NED", + NULL, + }, + { + NULL, + }, + { + NULL, + }, + { + NULL, + }, + // Korean + { + "KOR", + NULL, + }, + { + NULL, + }, + { + NULL, + }, + { + NULL, + }, + { + NULL, + }, + // China + { + "CHN", + NULL, + }, + }; + + static const u32 scLangLookup[SC_PRODUCT_AREA_MAX][16] = { + // Japan + { + SC_LANG_JAPANESE, + -1 + }, + // USA + { + SC_LANG_ENGLISH, + SC_LANG_FRENCH, + SC_LANG_SPANISH, + -1 + }, + // Europe + { + SC_LANG_ENGLISH, + SC_LANG_FRENCH, + SC_LANG_GERMAN, + SC_LANG_SPANISH, + SC_LANG_ITALIAN, + SC_LANG_DUTCH, + -1 + }, + { + -1 + }, + { + -1 + }, + { + -1 + }, + // Korean + { + SC_LANG_KOREAN, + -1 + }, + { + -1 + }, + { + -1 + }, + { + -1 + }, + { + -1 + }, + // China + { + SC_PRODUCT_AREA_HKG, + -1 + }, + }; + + const float cfChanThumbOfss[][2] = { + { + 64.0f, 48.0f + }, + { + 85.0f, 48.0f + } + }; + + ChannelObj::ChannelObj(EGG::Heap* heap, int page, int index) : + unk_0x10(heap), + unk_0x08(NULL), + unk_0x0C(NULL), + mpDiskHeap(NULL), + unk_0x18(0), + mChanPage(page), + mChanIndex(index), + mpBasePane(NULL), + mpDiskLyt(NULL), + mpDiskAnim(NULL), + unk_0x40(NULL), + unk_0x44(NULL), + unk_0x48(NULL), + unk_0x58(0), + unk_0x5C(0), + unk_0x60(NULL), + unk_0x68(0), + unk_0x6C(0), + unk_0x70(0), + unk_0x74(0), + unk_0x78(NULL), + unk_0x7C(0), + unk_0x80(0), + unk_0x84(0), + unk_0x88(0), + unk_0x8C(cfChanThumbOfss[SCGetAspectRatio()][0]), + unk_0x90(cfChanThumbOfss[SCGetAspectRatio()][1]), + mpModuleHeap(NULL), + unk_0x9C(NULL), + unk_0xA0(NULL), + unk_0xE4(0), + unk_0xE8(NULL), + unk_0xEC(0), + unk_0xF4(0), + unk_0xF8(36000), + unk_0xFC(36000), + unk_0x100(NULL), + unk_0x104(NULL), + unk_0x110(NULL) { + if (SCGetAspectRatio() == SC_ASPECT_RATIO_16x9) { + nw4r::ut::Rect projRect4x3; + System::getProjectionRect4x3(&projRect4x3); + nw4r::ut::Rect projRect16x9; + System::getProjectionRect16x9(&projRect16x9); + + mLocationAdjust = projRect16x9.GetWidth() / projRect4x3.GetWidth(); + } + else { + mLocationAdjust = 1.0f; + } + + memset(unk_0xA4, 0, sizeof(unk_0xA4)); + } + + ChannelObj::~ChannelObj() { + if (unk_0x2C != NULL) { + delete unk_0x2C; + } + + if (isDiskChannel()) { + destroyDiskLayout(); + } + else { + unk_0x30->destroyHeap(); + } + + if (unk_0x48 != NULL) { + delete unk_0x48; + } + + if (unk_0x60 != NULL) { + delete unk_0x60; + } + } + + void ChannelObj::prepare() { + if (!unk_0x18) { + unk_0x18 = loadThumbnailAsync(); + } + } + + void ChannelObj::setHeaps(EGG::Heap* heap0, EGG::Heap* heap1) { + unk_0x08 = heap0; + unk_0x0C = heap1; + } + + void ChannelObj::setDiskLayouts(layout::Object* diskLyt, layout::Animator* diskAnim, EGG::Heap* diskHeap) { + mpDiskLyt = diskLyt; + mpDiskAnim = diskAnim; + mpDiskHeap = diskHeap; + } + + void ChannelObj::setBasePane(const nw4r::lyt::Pane* basePane) { + mpBasePane = (nw4r::lyt::Pane*)basePane; + } + + void ChannelObj::initExtModule(EGG::Heap* moduleHeap, channel::RsoThread* moduleThread) { + mpModuleHeap = moduleHeap; + unk_0xE8 = moduleThread; + } + + void ChannelObj::create(nand::LayoutFile* layoutFile) { + if (!isLayoutCreated()) { + unk_0x24 = layoutFile; + + if (unk_0x48 == NULL) { + initCursor(); + } + + if (unk_0x60 == NULL && System::getChannelManager()->isLoaded(mChanPage, mChanIndex)) { + initBalloon(); + } + + if (unk_0x18 == 2 || unk_0x18 == 1 && unk_0x2C->isFinished()) { + createThumbnail(); + unk_0x18 = 3; + } + } + } + + void ChannelObj::calc() { + switch (unk_0x18) { + case 0: { + unk_0x18 = loadThumbnailAsync(); + break; + } + case 1: { + if (!unk_0x2C->isFinished()) { + break; + } + unk_0x18 = 2; + } + case 2: { + createThumbnail(); + unk_0x18 = 3; + break; + } + case 3: { + calcNormal(); + break; + } + } + } + + int ChannelObj::calcExtModule(EGG::ExpHeap* expHeap, bool unk0, bool unk1) { + int result = 1; + + switch (unk_0xEC) { + case 0: { + result = 0; + break; + } + case 1: { + if (System::getFader()->getStatus() == EGG::Fader::PREPARE_OUT) { + unk_0xF8 += 1; + if (unk0 && unk_0xF8 > unk_0xFC) { + unk_0xA0 = unk_0x9C; + unk_0x9C = expHeap; + + unk_0xF0 = System::getChannelManager()->loadThumbnailRsoAsync(mpModuleHeap, mChanPage, mChanIndex); + if (unk_0xF0 == NULL) { + unk_0xF0 = System::getChannelManager()->loadThumbnailCSAsync(mpModuleHeap, mChanPage, mChanIndex); + unk_0xEC = 4; + } + else { + unk_0xEC = 2; + } + + result = 2; + } + else { + result = 1; + } + } + break; + } + case 2: { + if (unk_0xF0->isFinished()) { + if (unk_0xF0->checkData() != nand::RESULT_SUCCESS && unk_0xF0->checkData() != nand::RESULT_NONE) { + clearModuleParam(); + return 3; + } + + unk_0x100 = (RSOObjectHeader*)unk_0xF0->getBuffer(); + unk_0x104 = NULL; + + if (unk_0x100->bssSize != 0) { + unk_0x104 = new(mpModuleHeap, DEFAULT_ALIGN) u8[unk_0x100->bssSize]; + memset(unk_0x104, 0, unk_0x100->bssSize); + } + + RSOLinkList(unk_0x100, unk_0x104); + + if (RSOIsImportSymbolResolvedAll(unk_0x100)) { + OSReport("Module's ImportSymbol is resolved all.\n"); + } + else { + OSReport("%d module's ImportSymbols are not resolved.\n", RSOGetNumImportSymbolsUnresolved(unk_0x100)); + } + + // Calc(int) + unk_0x108 = (channel::CalcFunc)RSOFindExportSymbolAddr(unk_0x100, "Calc"); + + // ThreadCalc() + unk_0xE8->setCalcFunc((channel::ThreadCalcFunc)RSOFindExportSymbolAddr(unk_0x100, "ThreadCalc")); + + ((void(*)())unk_0x100->prolog)(); + + // Create(nw4r::lyt::Layout*) + channel::CreateFunc createFunc = (channel::CreateFunc)RSOFindExportSymbolAddr(unk_0x100, "Create"); + if (createFunc != NULL) { + createFunc(unk_0x30->getNW4RLyt()); + } + + unk_0xE8->start(); + + unk_0x10C = 0; + unk_0x10D = 0; + + unk_0xEC = 3; + } + + result = 2; + break; + } + case 3: { + if (unk_0x10D == 0 && unk_0xE8->IsThreadTerminated()) { + unk_0xE8->WaitForThreadExit(); + unk_0x10D = 1; + } + + if (unk_0x10C == 0 && unk_0x108(!unk1)) { + unk_0x10C = 1; + } + + if (unk_0x10D && unk_0x10C) { + unk_0xE4 = 1; + + ((void(*)())unk_0x100->epilog)(); + + RSOUnLinkList(unk_0x100); + + unk_0x108 = 0; + + unk_0xE8->setCalcFunc(NULL); + + clearModuleParam(); + + result = 3; + } + else { + result = 2; + } + + break; + } + case 4: { + if (unk_0xF0->isFinished()) { + if (unk_0xF0->checkData() != nand::RESULT_SUCCESS && unk_0xF0->checkData() != nand::RESULT_NONE) { + clearModuleParam(); + result = 3; + break; + } + + if (unk_0x110 == NULL) { + unk_0x110 = EGG::ExpHeap::create(-1, mpModuleHeap, 0); + } + + System::getCSManager()->create(unk_0x110); + + channel::ChannelScriptManager::CSData data; + + data.unk_0x00 = unk_0x9C; + data.unk_0x08 = unk_0xA4; + data.unk_0x04 = unk_0x30; + data.unk_0x10 = System::getChannelManager()->getTitleID(mChanPage, mChanIndex); + data.unk_0x18 = unk_0xE4; + data.unk_0x19 = 1; + data.unk_0x1A = 1; + + if (!(System::getNwc24Manager() != NULL && System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.unk_0x10)))) { + data.unk_0x1A = 0; + } + + System::getCSManager()->setData(data); + if (!System::getCSManager()->init(unk_0xF0, unk_0xE8)) { + unk_0xEC = 6; + } + else { + unk_0xEC = 5; + } + + delete unk_0xF0; + unk_0xF0 = NULL; + } + + result = 2; + break; + } + case 5: { + System::getCSManager()->calc(); + + if (unk_0xE8->IsThreadTerminated()) { + System::getCSManager()->finish(); + unk_0xE4 = 1; + unk_0xEC = 6; + } + + result = 2; + break; + } + case 6: { + System::getCSManager()->destroy(); + clearModuleParam(); + result = 3; + break; + } + default: { + break; + } + } + + return result; + } + + void ChannelObj::drawThumbnail() { + if (isLayoutCreated()) { + unk_0x30->draw(); + } + } + + void ChannelObj::drawCursor() { + unk_0x48->draw(); + } + + void ChannelObj::drawBalloon() { + if (unk_0x60 != NULL) { + unk_0x60->draw(); + } + } + + void ChannelObj::createDiskLayout(void* data) { + unk_0x40 = layout::Object::create(mpDiskHeap, 0x19000, data, "arc", "icon.brlyt"); + setLangPane(unk_0x40); + + if (unk_0x40->searchFile("icon.brlan")) { + unk_0x44 = unk_0x40->bind("icon.brlan"); + } + else if (unk_0x40->searchFile("icon_Whole.brlan")) { + unk_0x44 = unk_0x40->bind("icon_Whole.brlan"); + } + else { + unk_0x44 = NULL; + } + + changeDisk(); + + bindNewAnm(unk_0x40); + + unk_0x84 = 1; + + unk_0x40->finishBinding(); + } + + void ChannelObj::destroyDiskLayout() { + if (unk_0x40 != NULL) { + unk_0x40->destroyHeap(); + unk_0x40 = NULL; + + unk_0x44 = NULL; + + unk_0x80 = 0; + unk_0x84 = 0; + } + } + + void ChannelObj::changeDisk() { + if (isDiskChannel() && (unk_0x68 == 1 || unk_0x68 == 2 || unk_0x68 == 3)) { + setBalloonAnim(4); + setBalloonAnim(1); + } + } + + void ChannelObj::resetDiskTitleName() { + if (isDiskChannel()) { + if (unk_0x40 != NULL) { + setBalloonText((wchar_t*)System::getChannelManager()->getTitleName(mChanPage, mChanIndex, 0)); + } + else { + setBalloonText(System::getMessage(0)); + } + } + } + + nw4r::math::VEC3& ChannelObj::getTranslate() const { + return (nw4r::math::VEC3&)unk_0x30->GetRootPane()->GetTranslate(); + } + + BOOL ChannelObj::isDiskChannel() const { + if (isValid() && System::getChannelManager()->getSceneID(mChanPage, mChanIndex) == channel::SCENE_ID_DISK_CHANNEL) { + return TRUE; + } + else { + return FALSE; + } + } + + BOOL ChannelObj::isValid() const { + return System::getChannelManager()->hasLoadedBnr(mChanPage, mChanIndex); + } + + void ChannelObj::onPoint(int unk) { + if (unk & 0x10000U) { + unk_0x74 = 0; + } + else if (unk & 0x20000U) { + unk_0x74 = 1; + } + else if ((unk_0x74 += 1) > 1) { + return; + } + + if (!(unk & 1)) { + setCursorAnim(1); + } + if (!(unk & 2)) { + setBalloonAnim(1); + } + } + + void ChannelObj::onLeft(int unk) { + if (unk & 0x10000U) { + unk_0x74 = 0; + } + else if (unk & 0x20000U) { + unk_0x74 = 1; + } + else if ((unk_0x74 -= 1) > 0) { + return; + } + + if (!(unk & 1)) { + setCursorAnim(3); + } + if (!(unk & 2)) { + setBalloonAnim(4); + } + } + + void ChannelObj::onPinch(bool unk) { + if (unk) { + setCursorAnim(1); + unk_0x74 = 1; + } + else { + setCursorAnim(0); + unk_0x74 = 0; + } + + setBalloonAnim(0); + } + + void ChannelObj::setCursorDecideAnim() { + setCursorAnim(4); + } + + void ChannelObj::initCursorAnim(bool unk) { + setCursorAnim(0); + if (unk) { + unk_0x74 = 0; + } + } + + void ChannelObj::initBalloonAnim(bool unk) { + setBalloonAnim(0); + if (unk) { + unk_0x74 = 0; + } + } + + void ChannelObj::FillModuleCount() { + unk_0xF8 = 36000; + } + + void ChannelObj::setLangPane(const layout::Object* layout) { + int lang = System::getLanguage(); + const char* langGroup = scLangGroups[lang]; + char local_50[20] = ""; + + bool bVar4 = false; + + for (nw4r::lyt::GroupList::Iterator it = layout->GetGroupList().GetBeginIter(); it != layout->GetGroupList().GetEndIter(); it++) { + if (strcmp(it->GetName(), langGroup) == 0) { + bVar4 = true; + } + else { + bool bVar3 = true; + for (int i = 0; i < 16; i++) { + char name[6]; + sprintf(name, "Rso%d", i); + if (strncmp(it->GetName(), name, 5) == 0) { + bVar3 = false; + break; + } + } + + if (bVar3) { + nw4r::lyt::Group* group = layout->FindGroupByName(langGroup); + for (nw4r::lyt::PaneLinkList::Iterator it2 = group->GetPaneList().GetBeginIter(); it2 != group->GetPaneList().GetEndIter(); it2++) { + it2->mTarget->SetVisible(false); + } + + for (int i = 0; i < 10; i++) { + if (strncmp(it->GetName(), scLangGroups[i], 3) == 0) { + memcpy(&local_50[i], it->GetName(), 3); + local_50[i + 3] = 0; + break; + } + } + } + } + } + + if (bVar4) { + nw4r::lyt::Group* group = layout->FindGroupByName(langGroup); + for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++) { + it->mTarget->SetVisible(true); + } + } + else { + s32 region = System::getRegion(); + for (int i = 0; i < 16; i++) { + char* groupName = (char*)lbl_8164E328[region][i]; + + if (groupName != NULL) { + if (strcmp(groupName, &local_50[scLangLookup[region][i]]) == 0) { + nw4r::lyt::Group* group = layout->FindGroupByName(groupName); + for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++) { + it->mTarget->SetVisible(true); + } + } + } + } + } + } + + void ChannelObj::bindRsoAnm(layout::Object* layout, layout::Animator** anims, const char* unk) { + for (int i = 0; i < 16; i++) { + char fileName[20]; + sprintf(fileName, "%s_Rso%d.brlan", unk, i); + if (layout->searchFile(fileName)) { + char groupName[5]; + sprintf(groupName, "Rso%d", i); + bool bVar4 = false; + for (nw4r::lyt::GroupList::Iterator it = layout->GetGroupList().GetBeginIter(); it != layout->GetGroupList().GetEndIter(); it++) { + if (strcmp(it->GetName(), groupName) == 0) { + anims[i] = layout->bindToGroup(fileName, groupName, false, false); + bVar4 = true; + break; + } + } + + if (!bVar4) { + anims[i] = layout->bind(fileName, false); + } + } + } + } + + BOOL ChannelObj::loadThumbnailAsync() { + if (!System::getChannelManager()->isLoaded(mChanPage, mChanIndex)) { + return FALSE; + } + + unk_0x2C = System::getChannelManager()->loadThumbnailAsync(unk_0x10, mChanPage, mChanIndex); + return (unk_0x2C == NULL) + 1; + } + + void ChannelObj::createThumbnail() { + bool bVar1 = false; + + if (unk_0x60 == NULL && System::getChannelManager()->isLoaded(mChanPage, mChanIndex)) { + initBalloon(); + } + + f32 frame; + + if (isValid()) { + if (System::getChannelManager()->getSceneID(mChanPage, mChanIndex) == channel::SCENE_ID_DISK_CHANNEL) { + frame = 0.0f; + } + else { + if (unk_0x2C->checkData() == nand::RESULT_SUCCESS) { + frame = createWadThumbnail(); + } + else { + frame = createWrongThumbnail(); + bVar1 = true; + } + } + } + else { + frame = createEmptyThumbnail(); + bVar1 = true; + } + + calcNormal(); + + if (unk_0x34 != NULL) { + unk_0x34->play(); + } + unk_0x30->finishBinding(); + if (unk_0x34 != NULL) { + unk_0x34->setCurrentFrame(frame); + } + + if (bVar1) { + unk_0x30->adjustHeap(); + } + } + + f32 ChannelObj::createWadThumbnail() { + f32 frame = 0.0f; + + unk_0x30 = layout::Object::create(unk_0x10, 0x8000, unk_0x2C->getBuffer(), "arc", "icon.brlyt"); + setLangPane(unk_0x30); + + u32 rsoIdx = System::getChannelManager()->getMetaHdr_IconRSOIdx(mChanPage, mChanIndex); + u32 csIdx = System::getChannelManager()->getMetaHdr_IconCSIdx(mChanPage, mChanIndex); + + if (rsoIdx != 0) { + if (unk_0x30->searchFile("icon_Start.brlan")) { + unk_0x34 = unk_0x30->bind("icon_Start.brlan"); + } + else { + unk_0x34 = NULL; + } + } + else { + if (csIdx != 0) { + if (unk_0x30->searchFile("icon_Start.brlan")) { + unk_0x34 = unk_0x30->bind("icon_Start.brlan"); + } + else { + unk_0x34 = NULL; + } + } + else { + if (unk_0x30->searchFile("icon.brlan")) { + unk_0x34 = unk_0x30->bind("icon_.brlan"); + } + else { + if (unk_0x30->searchFile("icon_Whole.brlan")) { + unk_0x34 = unk_0x30->bind("icon_Whole.brlan"); + } + else { + unk_0x34 = NULL; + } + } + } + } + + if (unk_0x34 != NULL) { + if (rsoIdx != 0 || csIdx != 0) { + frame = unk_0x34->getMinFrame(); + } + else { + frame = unk_0x34->getMinFrame() + (System::getRndm()->get_u16() % (u16)(unk_0x34->getMaxFrame() - unk_0x34->getMinFrame())); + } + } + + if (rsoIdx != 0 || csIdx != 0) { + unk_0xEC = 1; + bindRsoAnm(unk_0x30, unk_0xA4, "icon"); + } + + bindNewAnm(unk_0x30); + + unk_0x84 = 1; + + return frame; + } + + f32 ChannelObj::createWrongThumbnail() { + unk_0x30 = layout::Object::create(unk_0x10, 0x8000, unk_0x24, "arc", "my_IplTop_b.brlyt"); + + unk_0x30->FindPaneByName("Ch0")->SetVisible(false); + unk_0x30->FindPaneByName("Ch1")->GetMaterial()->SetTevColor(0, (GXColorS10){0, 0, 0, 255}); + + unk_0x34 = NULL; + + return 0.0f; + } + + f32 ChannelObj::createEmptyThumbnail() { + unk_0x30 = layout::Object::create(unk_0x10, 0x8000, unk_0x24, "arc", "my_IplTop_b.brlyt"); + unk_0x34 = unk_0x30->bind("my_IplTop_b.brlan"); + + return System::getRndm()->get_u16() % 2000; + } + + void ChannelObj::calcNormal() { + if (isDiskChannel()) { + if (unk_0x40 != NULL) { + unk_0x30 = unk_0x40; + unk_0x34 = unk_0x44; + } + else { + unk_0x30 = mpDiskLyt; + unk_0x34 = mpDiskAnim; + } + } + + updateNew(); + + nw4r::math::VEC3 pos(0, 0, 0); + + MTXMultVec(mpBasePane->GetGlobalMtx(), pos, pos); + unk_0x30->GetRootPane()->SetTranslate(pos); + + unk_0x30->calc(); + + calcCursor(pos); + calcBalloon(pos); + } + + nw4r::math::VEC3 ForceCTORWeak() { + return nw4r::math::VEC3(NULL, NULL, NULL); + } + + void ChannelObj::initCursor() { + unk_0x48 = new(unk_0x08, 4) layout::Object(unk_0x08, unk_0x24, "arc", "my_IplTop_d.brlyt"); + + for (int i = 0; i < 3; i++) { + unk_0x4C[i] = unk_0x48->bind(scCursorAnims[i], scPaneAnims[0], false); + } + + setCursorAnim(0); + unk_0x48->finishBinding(); + } + + void ChannelObj::calcCursor(const nw4r::math::VEC3& vec) { + unk_0x48->GetRootPane()->SetTranslate(vec); + calcCursorAnim(); + unk_0x48->calc(); + } + + void ChannelObj::setCursorAnim(int unk) { + if (unk == 0) { + unk_0x58 = 0; + unk_0x5C = 0; + + for (int i = 0; i < 3; i++) { + unk_0x4C[i]->initFrame(); + } + + unk_0x48->getAnim(1)->initAnmFrame(); + unk_0x48->GetRootPane()->SetVisible(false); + } + else if (unk == 4) { + unk_0x58 = 4; + unk_0x5C = 0; + unk_0x48->GetRootPane()->SetVisible(true); + startCursorAnim(2); + } + else { + switch (unk_0x58) { + case 0: { + if (unk == 1) { + unk_0x58 = 1; + unk_0x48->GetRootPane()->SetVisible(true); + startCursorAnim(1); + } + break; + } + case 1: { + if (unk == 2) { + unk_0x58 = 2; + } + else if (unk == 3) { + unk_0x5C = 3; + } + else if (unk == 1) { + unk_0x5C = 0; + } + break; + } + case 2: { + if (unk == 3) { + unk_0x58 = 3; + startCursorAnim(0); + } + break; + } + case 3: { + if (unk == 1) { + unk_0x5C = 1; + } + else if (unk == 3) { + unk_0x5C = 0; + } + break; + } + } + } + } + + void ChannelObj::calcCursorAnim() { + + } + + /*void ChannelObj::startCursorAnim(int unk) { + + } + + void ChannelObj::initBalloon() { + + } + + void ChannelObj::setBalloonText(const wchar_t* text) { + + } + + void ChannelObj::calcBalloon(const nw4r::math::VEC3& vec) { + + } + + void ChannelObj::setBalloonAnim(int unk) { + + } + + void ChannelObj::calcBalloonAnim(int unk) { + + } + + void ChannelObj::clearModuleParam() { + + } + + void ChannelObj::bindNewAnm(layout::Object* layout) { + + } + + void ChannelObj::updateNew() { + + } + + void ChannelObj::setupNew() { + + }*/ + } +} diff --git a/src/system/iplChannelManager.cpp b/src/system/iplChannelManager.cpp index a4d8ee82..fb33873c 100644 --- a/src/system/iplChannelManager.cpp +++ b/src/system/iplChannelManager.cpp @@ -28,84 +28,56 @@ namespace ipl { static const u32 scLangLookup[SC_PRODUCT_AREA_MAX][16] = { // Japan { - SC_LANG_JAPANESE, -1, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0 + SC_LANG_JAPANESE, + -1 }, // USA { - SC_LANG_ENGLISH, SC_LANG_FRENCH, SC_LANG_SPANISH, -1, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + SC_LANG_ENGLISH, + SC_LANG_FRENCH, + SC_LANG_SPANISH, + -1 }, // Europe { - SC_LANG_ENGLISH, SC_LANG_FRENCH, SC_LANG_GERMAN, SC_LANG_SPANISH, - SC_LANG_ITALIAN, SC_LANG_DUTCH, -1, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0 + SC_LANG_ENGLISH, + SC_LANG_FRENCH, + SC_LANG_GERMAN, + SC_LANG_SPANISH, + SC_LANG_ITALIAN, + SC_LANG_DUTCH, + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, // Korean { - SC_LANG_KOREAN, -1, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0 + SC_LANG_KOREAN, + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, { - -1, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 + -1 }, // China { - SC_PRODUCT_AREA_HKG, -1, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0 + SC_PRODUCT_AREA_HKG, + -1 }, }; @@ -593,7 +565,7 @@ namespace ipl { *page = *index = 0; for (int i = 0; i < MAX_CHANNEL_PAGE; i++) { for (int j = 0; j < MAX_CHANNEL_INDEX; j++) { - if (mChannels[i][j].info.flags == 0x0F) { + if (mChannels[i][j].info.sceneID == SCENE_ID_DISK_CHANNEL) { *page = i; *index = j; return; @@ -705,7 +677,7 @@ namespace ipl { // It is a normal channel mTmpChannel.info.primaryType = PRIMARY_TYPE_CHANNEL; - mTmpChannel.info.flags = 0x0E; + mTmpChannel.info.sceneID = SCENE_ID_WAD_CHANNEL; s32 ret = utility::ESMisc::GetValidTicketIndex(System::getMem2Sys(), titleId); if (ret == -1) { @@ -794,7 +766,7 @@ namespace ipl { else if (info.primaryType == channel::PRIMARY_TYPE_DISK) { // Load disk banner mChannels[page][index].loadedBnr = true; - if (mChannels[page][index].info.flags == 0x0F) { + if (mChannels[page][index].info.sceneID == SCENE_ID_DISK_CHANNEL) { if (mChannels[page][index].metaHdr == NULL) { mChannels[page][index].metaHdr = &mDiskChanMetaHdr; } diff --git a/src/system/iplChannelRsoThread.cpp b/src/system/iplChannelRsoThread.cpp index ffd2180c..318b6c9e 100644 --- a/src/system/iplChannelRsoThread.cpp +++ b/src/system/iplChannelRsoThread.cpp @@ -32,11 +32,9 @@ namespace ipl { Create(mpStack, STACK_SIZE, 17); } } - void RsoThread::setCalcFunc(CalcFunc func) { + void RsoThread::setCalcFunc(ThreadCalcFunc func) { mpCalcFunc = func; OSInitMessageQueue(&mCalcQueue, &mCalcMsg, 1); } } } - -