This commit is contained in:
Maschell 2022-06-19 11:42:52 +02:00
parent 8b3cbc8ad5
commit 24c65284bb
5 changed files with 7 additions and 29 deletions

View File

@ -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 . .

View File

@ -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

View File

@ -2,7 +2,7 @@
#include <coreinit/filesystem.h>
#include <coreinit/filesystem_fsa.h>
#include <cstdint>
#include <stdint.h>
#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

View File

@ -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

View File

@ -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<IOSOpenMode>(0));
if (haxHandle < 0) {
DEBUG_FUNCTION_LINE_ERR("Failed to open /dev/iosuhax");