From 24c65284bbc1fb3d27dbeda76fd4205d84264d61 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 19 Jun 2022 11:42:52 +0200 Subject: [PATCH] Fixes --- Dockerfile | 4 +--- Dockerfile.buildlocal | 4 +--- include/mocha/fsa.h | 6 +++--- include/mocha/mocha.h | 4 ++-- source/utils.cpp | 18 ------------------ 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2be1484..46b22a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM wiiuenv/devkitppc:20220605 - -RUN git clone --depth 1 --single-branch -b filesystemstructs https://github.com/Maschell/wut && cd wut && git reset --hard f73f75225b62fd546fedc7b366cee1d87b4b72a5 && make install && cd .. && rm -rf wut +FROM wiiuenv/devkitppc:20220618 WORKDIR tmp_build COPY . . diff --git a/Dockerfile.buildlocal b/Dockerfile.buildlocal index c145907..9e97452 100644 --- a/Dockerfile.buildlocal +++ b/Dockerfile.buildlocal @@ -1,5 +1,3 @@ -FROM wiiuenv/devkitppc:20220605 - -RUN git clone --depth 1 --single-branch -b filesystemstructs https://github.com/Maschell/wut && cd wut && git reset --hard f73f75225b62fd546fedc7b366cee1d87b4b72a5 && make install && cd .. && rm -rf wut +FROM wiiuenv/devkitppc:20220618 WORKDIR project \ No newline at end of file diff --git a/include/mocha/fsa.h b/include/mocha/fsa.h index 558fca1..076c59f 100644 --- a/include/mocha/fsa.h +++ b/include/mocha/fsa.h @@ -2,7 +2,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { @@ -15,7 +15,7 @@ extern "C" { * @param outHandle pointer where the handle of the raw device will be stored * @return */ -FSError FSAEx_RawOpen(FSClient *client, char *device_path, int32_t *outHandle); +FSError FSAEx_RawOpen(FSClient *client, const char *device_path, int32_t *outHandle); /** * Opens a device for raw read/write @@ -24,7 +24,7 @@ FSError FSAEx_RawOpen(FSClient *client, char *device_path, int32_t *outHandle); * @param outHandle pointer where the handle of the raw device will be stored * @return */ -FSError FSAEx_RawOpenEx(FSAClientHandle clientHandle, char *device_path, int32_t *outHandle); +FSError FSAEx_RawOpenEx(FSAClientHandle clientHandle, const char *device_path, int32_t *outHandle); /** * Closes a devices that was previously opened via FSAEx_RawOpen diff --git a/include/mocha/mocha.h b/include/mocha/mocha.h index 34658b4..480a10c 100644 --- a/include/mocha/mocha.h +++ b/include/mocha/mocha.h @@ -9,7 +9,7 @@ extern "C" { #endif -enum MochaUtilsStatus { +typedef enum MochaUtilsStatus { MOCHA_RESULT_SUCCESS = 0, MOCHA_RESULT_INVALID_ARGUMENT = -0x01, MOCHA_RESULT_MAX_CLIENT = -0x02, @@ -21,7 +21,7 @@ enum MochaUtilsStatus { MOCHA_RESULT_UNSUPPORTED_COMMAND = -0x11, MOCHA_RESULT_LIB_UNINITIALIZED = -0x20, MOCHA_RESULT_UNKNOWN_ERROR = -0x100, -}; +} MochaUtilsStatus; /** * Initializes the mocha lib. Needs to be called before any other functions can be used diff --git a/source/utils.cpp b/source/utils.cpp index 93fcd9b..60eed7d 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -30,24 +30,6 @@ MochaUtilsStatus Mocha_InitLibrary() { } if (iosuhaxHandle < 0) { - auto res = MOCHA_RESULT_UNKNOWN_ERROR; - int mcpFd = IOS_Open("/dev/mcp", (IOSOpenMode) 0); - if (mcpFd >= 0) { - ALIGN_0x40 uint32_t io_buffer[0x40 / 4]; - io_buffer[0] = IPC_CUSTOM_START_MCP_THREAD; - if (IOS_Ioctl(mcpFd, 100, io_buffer, 4, io_buffer, 0x4) == IOS_ERROR_OK) { - if (io_buffer[0] != 1) { // Thread is starting - OSSleepTicks(OSMillisecondsToTicks(50)); - } - res = MOCHA_RESULT_SUCCESS; - } - - IOS_Close(mcpFd); - } - if (res != MOCHA_RESULT_SUCCESS) { - return res; - } - int haxHandle = IOS_Open((char *) ("/dev/iosuhax"), static_cast(0)); if (haxHandle < 0) { DEBUG_FUNCTION_LINE_ERR("Failed to open /dev/iosuhax");