mirror of
https://github.com/wiiu-env/libmocha.git
synced 2024-11-16 08:39:14 +01:00
Fixes
This commit is contained in:
parent
8b3cbc8ad5
commit
24c65284bb
@ -1,6 +1,4 @@
|
|||||||
FROM wiiuenv/devkitppc:20220605
|
FROM wiiuenv/devkitppc:20220618
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
WORKDIR tmp_build
|
WORKDIR tmp_build
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
FROM wiiuenv/devkitppc:20220605
|
FROM wiiuenv/devkitppc:20220618
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
WORKDIR project
|
WORKDIR project
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <coreinit/filesystem.h>
|
#include <coreinit/filesystem.h>
|
||||||
#include <coreinit/filesystem_fsa.h>
|
#include <coreinit/filesystem_fsa.h>
|
||||||
#include <cstdint>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -15,7 +15,7 @@ extern "C" {
|
|||||||
* @param outHandle pointer where the handle of the raw device will be stored
|
* @param outHandle pointer where the handle of the raw device will be stored
|
||||||
* @return
|
* @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
|
* 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
|
* @param outHandle pointer where the handle of the raw device will be stored
|
||||||
* @return
|
* @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
|
* Closes a devices that was previously opened via FSAEx_RawOpen
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum MochaUtilsStatus {
|
typedef enum MochaUtilsStatus {
|
||||||
MOCHA_RESULT_SUCCESS = 0,
|
MOCHA_RESULT_SUCCESS = 0,
|
||||||
MOCHA_RESULT_INVALID_ARGUMENT = -0x01,
|
MOCHA_RESULT_INVALID_ARGUMENT = -0x01,
|
||||||
MOCHA_RESULT_MAX_CLIENT = -0x02,
|
MOCHA_RESULT_MAX_CLIENT = -0x02,
|
||||||
@ -21,7 +21,7 @@ enum MochaUtilsStatus {
|
|||||||
MOCHA_RESULT_UNSUPPORTED_COMMAND = -0x11,
|
MOCHA_RESULT_UNSUPPORTED_COMMAND = -0x11,
|
||||||
MOCHA_RESULT_LIB_UNINITIALIZED = -0x20,
|
MOCHA_RESULT_LIB_UNINITIALIZED = -0x20,
|
||||||
MOCHA_RESULT_UNKNOWN_ERROR = -0x100,
|
MOCHA_RESULT_UNKNOWN_ERROR = -0x100,
|
||||||
};
|
} MochaUtilsStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the mocha lib. Needs to be called before any other functions can be used
|
* Initializes the mocha lib. Needs to be called before any other functions can be used
|
||||||
|
@ -30,24 +30,6 @@ MochaUtilsStatus Mocha_InitLibrary() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (iosuhaxHandle < 0) {
|
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));
|
int haxHandle = IOS_Open((char *) ("/dev/iosuhax"), static_cast<IOSOpenMode>(0));
|
||||||
if (haxHandle < 0) {
|
if (haxHandle < 0) {
|
||||||
DEBUG_FUNCTION_LINE_ERR("Failed to open /dev/iosuhax");
|
DEBUG_FUNCTION_LINE_ERR("Failed to open /dev/iosuhax");
|
||||||
|
Loading…
Reference in New Issue
Block a user