Skip to content

Commit

Permalink
Update dependecies.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Rohloff <[email protected]>
  • Loading branch information
V10lator committed Jun 3, 2023
1 parent af33772 commit 044933e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 44 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ghcr.io/wiiu-env/devkitppc:20230326
FROM ghcr.io/wiiu-env/devkitppc:20230420

ENV DEBIAN_FRONTEND=noninteractive \
PATH=$DEVKITPPC/bin:$PATH \
WUT_ROOT=$DEVKITPRO/wut \
CURL_VER=8.0.1
CURL_VER=8.1.2

WORKDIR /

Expand Down Expand Up @@ -58,7 +58,7 @@ PKG_CONFIG=$DEVKITPRO/portlibs/wiiu/bin/powerpc-eabi-pkg-config && \
cd ../.. && \
rm -rf curl

COPY --from=ghcr.io/wiiu-env/libmocha:20220919 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libmocha:20230417 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/librpxloader:20230316 /artifacts $DEVKITPRO

RUN git config --global --add safe.directory /project
Expand Down
70 changes: 32 additions & 38 deletions src/cfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,61 +44,55 @@ static const uint32_t addys[6] = {
};
static uint32_t origValues[6];

extern FSClient *__wut_devoptab_fs_client;

bool cfwValid()
{
mochaReady = Mocha_InitLibrary() == MOCHA_RESULT_SUCCESS;
bool ret = mochaReady;
if(ret)
{
ret = Mocha_UnlockFSClient(__wut_devoptab_fs_client) == MOCHA_RESULT_SUCCESS;
WiiUConsoleOTP otp;
ret = Mocha_ReadOTP(&otp) == MOCHA_RESULT_SUCCESS;
if(ret)
{
WiiUConsoleOTP otp;
ret = Mocha_ReadOTP(&otp) == MOCHA_RESULT_SUCCESS;
MochaRPXLoadInfo info = {
.target = 0xDEADBEEF,
.filesize = 0,
.fileoffset = 0,
.path = "dummy"
};

MochaUtilsStatus s = Mocha_LaunchRPX(&info);
ret = s != MOCHA_RESULT_UNSUPPORTED_API_VERSION && s != MOCHA_RESULT_UNSUPPORTED_COMMAND;
if(ret)
{
MochaRPXLoadInfo info = {
.target = 0xDEADBEEF,
.filesize = 0,
.fileoffset = 0,
.path = "dummy"
};
if(isAroma())
{
char path[FS_MAX_PATH];
RPXLoaderStatus rs = RPXLoader_GetPathOfRunningExecutable(path, FS_MAX_PATH);
ret = rs == RPX_LOADER_RESULT_SUCCESS;
if(!ret)
debugPrintf("RPXLoader error: %s", RPXLoader_GetStatusStr(rs));
}

MochaUtilsStatus s = Mocha_LaunchRPX(&info);
ret = s != MOCHA_RESULT_UNSUPPORTED_API_VERSION && s != MOCHA_RESULT_UNSUPPORTED_COMMAND;
if(ret)
{
if(isAroma())
{
char path[FS_MAX_PATH];
RPXLoaderStatus rs = RPXLoader_GetPathOfRunningExecutable(path, FS_MAX_PATH);
ret = rs == RPX_LOADER_RESULT_SUCCESS;
if(!ret)
debugPrintf("RPXLoader error: %s", RPXLoader_GetStatusStr(rs));
}

if(ret)
for(int i = 0; i < 6; ++i)
{
for(int i = 0; i < 6; ++i)
{
s = Mocha_IOSUKernelRead32(addys[i], origValues + i);
if(s != MOCHA_RESULT_SUCCESS)
goto restoreIOSU;
s = Mocha_IOSUKernelRead32(addys[i], origValues + i);
if(s != MOCHA_RESULT_SUCCESS)
goto restoreIOSU;

s = Mocha_IOSUKernelWrite32(addys[i], i % 2 == 0 ? VALUE_A : VALUE_B);
if(s != MOCHA_RESULT_SUCCESS)
goto restoreIOSU;
s = Mocha_IOSUKernelWrite32(addys[i], i % 2 == 0 ? VALUE_A : VALUE_B);
if(s != MOCHA_RESULT_SUCCESS)
goto restoreIOSU;

continue;
restoreIOSU:
for(--i; i >= 0; --i)
Mocha_IOSUKernelWrite32(addys[i], origValues[i]);
continue;
restoreIOSU:
for(--i; i >= 0; --i)
Mocha_IOSUKernelWrite32(addys[i], origValues[i]);

debugPrintf("libmocha error: %s", Mocha_GetStatusStr(s));
return false;
}
debugPrintf("libmocha error: %s", Mocha_GetStatusStr(s));
return false;
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@

// WIP. This need a better implementation

extern FSClient *__wut_devoptab_fs_client;

FSClient *swkbdClient;
VPADStatus vpad;
static const KPADStatus kpad[4];
static const Swkbd_ControllerInfo controllerInfo = {
Expand Down Expand Up @@ -258,6 +257,9 @@ bool SWKBD_Init()
{
debugPrintf("SWKBD_Init()");

if(FSAddClient(createArg.fsClient, 0) != FS_STATUS_OK)
return false;

createArg.workMemory = MEMAllocFromDefaultHeap(Swkbd_GetWorkMemorySize(0));
if(createArg.workMemory == NULL)
return false;
Expand Down Expand Up @@ -287,7 +289,6 @@ bool SWKBD_Init()
break;
}

createArg.fsClient = __wut_devoptab_fs_client;
if(Swkbd_Create(&createArg))
{
OSBlockSet(&appearArg, 0, sizeof(Swkbd_AppearArg));
Expand Down Expand Up @@ -320,6 +321,7 @@ void SWKBD_Shutdown()
{
Swkbd_Destroy();
MEMFreeToDefaultHeap(createArg.workMemory);
FSDelClient(createArg.fsClient, 0);
}

void readInput()
Expand Down

0 comments on commit 044933e

Please sign in to comment.