From 772fd0130dbf00835997f2ad69ef2a4327dbed99 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Wed, 29 Dec 2021 15:09:19 +0100 Subject: [PATCH] Remove includes which are now in wut --- include/nn/cmpt/cmpt.h | 28 ---------------- include/nn/sl/FileStream.h | 28 ---------------- include/nn/sl/LaunchInfoDatabase.h | 33 ------------------ include/nn/sl/common.h | 54 ------------------------------ source/main.cpp | 16 ++++----- 5 files changed, 7 insertions(+), 152 deletions(-) delete mode 100644 include/nn/cmpt/cmpt.h delete mode 100644 include/nn/sl/FileStream.h delete mode 100644 include/nn/sl/LaunchInfoDatabase.h delete mode 100644 include/nn/sl/common.h diff --git a/include/nn/cmpt/cmpt.h b/include/nn/cmpt/cmpt.h deleted file mode 100644 index 6b4f028..0000000 --- a/include/nn/cmpt/cmpt.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum ScreenType { - SCREEN_TYPE_TV = 1, - SCREEN_TYPE_DRC, - SCREEN_TYPE_BOTH, -} ScreenType; - -int32_t -CMPTGetDataSize(uint32_t* outSize); - -int32_t -CMPTLaunchTitle(void* dataBuffer, uint32_t bufferSize, uint32_t titleId_low, uint32_t titleId_high); - -int32_t -CMPTAcctSetScreenType(ScreenType type); - -int32_t -CMPTCheckScreenState(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/nn/sl/FileStream.h b/include/nn/sl/FileStream.h deleted file mode 100644 index 907ab98..0000000 --- a/include/nn/sl/FileStream.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include -#include -#include -#include "common.h" - -namespace nn::sl { - class FileStream { - public: - FileStream() { - instance = __ct__Q3_2nn2sl10FileStreamFv(nullptr); - } - - ~FileStream() { - if (instance != nullptr) { - __dt__Q3_2nn2sl10FileStreamFv(instance); - } - } - - nn::Result Initialize(FSClient *client, FSCmdBlock *cmdBlock, char const *path, char const *mode) { - return Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(this->instance, client, cmdBlock, path, mode); - } - - FileStreamInternal *instance = nullptr; - }; - -} \ No newline at end of file diff --git a/include/nn/sl/LaunchInfoDatabase.h b/include/nn/sl/LaunchInfoDatabase.h deleted file mode 100644 index a7b1508..0000000 --- a/include/nn/sl/LaunchInfoDatabase.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include -#include "common.h" -#include "FileStream.h" - -namespace nn::sl { - class LaunchInfoDatabase { - public: - LaunchInfoDatabase() { - instance = __ct__Q3_2nn2sl18LaunchInfoDatabaseFv(nullptr); - } - - ~LaunchInfoDatabase() { - Finalize__Q3_2nn2sl18LaunchInfoDatabaseFv(instance); - } - - // nn::sl::LaunchInfoDatabase::Load(nn::sl::IStream &, nn::sl::Region) - nn::Result Load(nn::sl::FileStream *fileStream, nn::sl::Region region) { - return Load__Q3_2nn2sl18LaunchInfoDatabaseFRQ3_2nn2sl7IStreamQ3_2nn2sl6Region(instance, fileStream->instance, region); - } - - // nn::sl::LaunchInfoDatabase::GetLaunchInfoById(nn::sl::LaunchInfo *, unsigned long long) const - nn::Result GetLaunchInfoById(nn::sl::LaunchInfo *launchInfo, uint64_t titleId) { - return GetLaunchInfoById__Q3_2nn2sl18LaunchInfoDatabaseCFPQ3_2nn2sl10LaunchInfoUL(instance, launchInfo, titleId); - } - - private: - LaunchInfoDatabaseInternal *instance; - }; - -} \ No newline at end of file diff --git a/include/nn/sl/common.h b/include/nn/sl/common.h deleted file mode 100644 index 2c55560..0000000 --- a/include/nn/sl/common.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace nn::sl { - typedef struct WUT_PACKED FileStreamInternal { - WUT_UNKNOWN_BYTES(0x10); - } FileStreamInternal; - WUT_CHECK_SIZE(FileStreamInternal, 0x10); - - extern "C" nn::Result Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(FileStreamInternal *, FSClient *, FSCmdBlock *, char const *, char const *); - extern "C" FileStreamInternal *__ct__Q3_2nn2sl10FileStreamFv(FileStreamInternal *); - extern "C" void __dt__Q3_2nn2sl10FileStreamFv(FileStreamInternal *); - - typedef struct WUT_PACKED LaunchInfo { - uint64_t titleId; - WUT_UNKNOWN_BYTES(0x810 - 0x08); - } LaunchInfo; - - WUT_CHECK_OFFSET(LaunchInfo, 0x00, titleId); - WUT_CHECK_SIZE(LaunchInfo, 0x810); - - void - GetDefaultDatabasePath(char *, int size, uint32_t tid_hi, uint32_t tid_low) - asm("GetDefaultDatabasePath__Q2_2nn2slFPcUiUL"); - - nn::Result - Initialize(MEMAllocFromDefaultHeapExFn, MEMFreeToDefaultHeapFn) - asm("Initialize__Q2_2nn2slFPFUiT1_PvPFPv_v"); - - nn::Result - Finalize() - asm("Finalize__Q2_2nn2slFv"); - - typedef enum Region { - REGION_JPN = 0, - REGION_USA = 1, - REGION_EUR = 2 - } Region; - - typedef struct WUT_PACKED LaunchInfoDatabaseInternal { - WUT_UNKNOWN_BYTES(0x1C); - } LaunchInfoDatabaseInternal; - WUT_CHECK_SIZE(LaunchInfoDatabaseInternal, 0x1C); - - extern "C" LaunchInfoDatabaseInternal *__ct__Q3_2nn2sl18LaunchInfoDatabaseFv(LaunchInfoDatabaseInternal *); - extern "C" nn::Result Load__Q3_2nn2sl18LaunchInfoDatabaseFRQ3_2nn2sl7IStreamQ3_2nn2sl6Region(LaunchInfoDatabaseInternal *, nn::sl::FileStreamInternal *, nn::sl::Region); - extern "C" void Finalize__Q3_2nn2sl18LaunchInfoDatabaseFv(LaunchInfoDatabaseInternal *); - extern "C" nn::Result GetLaunchInfoById__Q3_2nn2sl18LaunchInfoDatabaseCFPQ3_2nn2sl10LaunchInfoUL(LaunchInfoDatabaseInternal *, nn::sl::LaunchInfo *, uint64_t titleId); -} - diff --git a/source/main.cpp b/source/main.cpp index 8ad4db3..f7c68e2 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -11,11 +11,9 @@ #include #include #include -#include +#include #include -#include -#include -#include +#include #include #include @@ -93,7 +91,7 @@ bool getQuickBoot() { if (bootCheck == 0) { nn::sl::Initialize(MEMAllocFromDefaultHeapEx, MEMFreeToDefaultHeap); char path[0x80]; - nn::sl::GetDefaultDatabasePath(path, 0x80, 0x00050010, 0x10066000); // ECO process + nn::sl::GetDefaultDatabasePath(path, 0x80, 0x0005001010066000); // ECO process FSCmdBlock cmdBlock; FSInitCmdBlock(&cmdBlock); @@ -227,11 +225,11 @@ static void launchvWiiTitle(uint32_t titleId_low, uint32_t titleId_high){ KPADInit(); // Try to find a screen type that works - CMPTAcctSetScreenType(SCREEN_TYPE_BOTH); + CMPTAcctSetScreenType(CMPT_SCREEN_TYPE_BOTH); if (CMPTCheckScreenState() < 0) { - CMPTAcctSetScreenType(SCREEN_TYPE_DRC); + CMPTAcctSetScreenType(CMPT_SCREEN_TYPE_DRC); if (CMPTCheckScreenState() < 0) { - CMPTAcctSetScreenType(SCREEN_TYPE_TV); + CMPTAcctSetScreenType(CMPT_SCREEN_TYPE_TV); } } @@ -272,7 +270,7 @@ int handleMenuScreen(void){ bool redraw = true; while (true) { VPADStatus vpad{}; - VPADRead(VPAD_CHAN_0, &vpad, 1, NULL); + VPADRead(VPAD_CHAN_0, &vpad, 1, nullptr); if (vpad.trigger & VPAD_BUTTON_UP) { if (selected > 0) {