Skip to content

Commit

Permalink
Remove HBL support from code.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
  • Loading branch information
V10lator committed Mar 21, 2024
1 parent 8e6600f commit 03714e0
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 261 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Expand Up @@ -20,12 +20,6 @@ RUN apt-fast -y --no-install-recommends update && \
RUN apt-fast -y install --no-install-recommends autoconf automake libtool openjdk-11-jre-headless && \
apt-fast clean

# Install the requirements to build the homebrew
RUN git clone --recursive https://github.com/yawut/libromfs-wiiu --single-branch && \
cd libromfs-wiiu && \
make -j$(nproc) && \
make install

# Install nghttp2 for HTTP/2 support (WUT don't include this)
RUN wget https://github.com/nghttp2/nghttp2/releases/download/v1.60.0/nghttp2-$NGHTTP2_VER.tar.xz && \
mkdir nghttp2 && \
Expand Down
5 changes: 0 additions & 5 deletions include/file.h
Expand Up @@ -85,12 +85,7 @@ extern "C"
const char *translateFSErr(FSError err) __attribute__((__cold__));
size_t getFilesize(const char *path) __attribute__((__hot__));
NUSDEV getDevFromPath(const char *path);
#ifdef NUSSPLI_HBL
size_t readFile(const char *path, void **buffer) __attribute__((__hot__));
#else
size_t readFileNew(const char *path, void **buffer) __attribute__((__hot__));
#define readFile(path, buffer) readFileNew(path, buffer)
#endif
size_t getDirsize(const char *path);
TMD *getTmd(const char *dir, bool allowNoIntro);
TMD_STATE verifyTmd(const TMD *tmd, size_t size) __attribute__((__hot__));
Expand Down
38 changes: 0 additions & 38 deletions include/jailbreak.h

This file was deleted.

4 changes: 0 additions & 4 deletions include/romfs.h
Expand Up @@ -20,8 +20,4 @@

#include <wut-fixups.h>

#ifdef NUSSPLI_HBL
#define ROMFS_PATH "romfs:/"
#else
#define ROMFS_PATH "/vol/content/"
#endif
4 changes: 0 additions & 4 deletions include/state.h
Expand Up @@ -51,14 +51,10 @@ extern "C"
void enableShutdown();
void disableShutdown();
bool isAroma();
#ifdef NUSSPLI_HBL
#define isChannel() false
#else
#ifdef NUSSPLI_LITE
#define isChannel() false
#else
bool isChannel();
#endif
#endif
bool AppRunning(bool mainthread) __attribute__((__hot__));
uint32_t homeButtonCallback(void *dummy);
Expand Down
3 changes: 1 addition & 2 deletions include/updater.h
Expand Up @@ -30,8 +30,7 @@ extern "C"
typedef enum
{
NUSSPLI_TYPE_AROMA = 0,
NUSSPLI_TYPE_CHANNEL = 1,
NUSSPLI_TYPE_HBL = 2
NUSSPLI_TYPE_CHANNEL = 1
} NUSSPLI_TYPE;

bool updateCheck();
Expand Down
61 changes: 1 addition & 60 deletions src/file.c
Expand Up @@ -187,7 +187,7 @@ size_t getFilesize(const char *path)
return stat.size;
}

size_t readFileNew(const char *path, void **buffer)
size_t readFile(const char *path, void **buffer)
{
char *toScreen = getToFrameBuffer();
toScreen[0] = '\0';
Expand Down Expand Up @@ -230,65 +230,6 @@ size_t readFileNew(const char *path, void **buffer)
return 0;
}

#ifdef NUSSPLI_HBL
static size_t getFilesizeOld(FILE *fp)
{
struct stat info;
OSTime t = OSGetTime();

if(fstat(fileno(fp), &info) == -1)
return -1;

t = OSGetTime() - t;
addEntropy(&t, sizeof(OSTime));

return (size_t)(info.st_size);
}

size_t readFile(const char *path, void **buffer)
{
if(strncmp("romfs:/", path, strlen("romfs:/")) != 0)
return readFileNew(path, buffer);

char *toScreen = getToFrameBuffer();
toScreen[0] = '\0';
FILE *file = fopen(path, "rb");
if(file != NULL)
{
size_t filesize = getFilesizeOld(file);
if(filesize != -1)
{
*buffer = MEMAllocFromDefaultHeapEx(FS_ALIGN(filesize), 0x40);
if(*buffer != NULL)
{
if(fread(*buffer, filesize, 1, file) == 1)
{
fclose(file);
return filesize;
}

sprintf(toScreen, "Error reading %s!", path);
MEMFreeToDefaultHeap(*buffer);
}
else
sprintf(toScreen, "Error creating buffer!");
}
else
sprintf(toScreen, "Error getting filesize for %s!", path);

fclose(file);
}
else
sprintf(toScreen, "Error opening %s!", path);

*buffer = NULL;
if(toScreen[0] != '\0')
addToScreenLog(toScreen);

return 0;
}
#endif

size_t getDirsize(const char *path)
{
char *newPath = MEMAllocFromDefaultHeapEx(FS_MAX_PATH, 0x40);
Expand Down
7 changes: 0 additions & 7 deletions src/filesystem.c
Expand Up @@ -61,9 +61,6 @@ void initFSSpace()

bool initFS(bool validCfw)
{
#ifdef NUSSPLI_HBL
romfsInit();
#endif

if(FSAInit() == FS_ERROR_OK)
{
Expand Down Expand Up @@ -124,10 +121,6 @@ void deinitFS(bool validCfw)

FSADelClient(handle);
FSAShutdown();

#ifdef NUSSPLI_HBL
romfsExit();
#endif
}

FSAClientHandle getFSAClient()
Expand Down
7 changes: 0 additions & 7 deletions src/installer.c
Expand Up @@ -199,15 +199,8 @@ bool install(const char *game, bool hasDeps, NUSDEV dev, const char *path, bool
case 0xfffbfc17:
sprintf(toScreen,
"%s \"%s\""
#ifdef NUSSPLI_HBL
"\n%s"
#endif
,
localise("Internal error installing"), path
#ifdef NUSSPLI_HBL
,
localise("We're supporting HBL on Tiramisu only!")
#endif
);
break;
default:
Expand Down
47 changes: 0 additions & 47 deletions src/jailbreak.c

This file was deleted.

47 changes: 3 additions & 44 deletions src/main.c
Expand Up @@ -28,7 +28,6 @@
#include <input.h>
#include <installer.h>
#include <ioQueue.h>
#include <jailbreak.h>
#include <localisation.h>
#include <menu/download.h>
#include <menu/main.h>
Expand Down Expand Up @@ -77,14 +76,15 @@ static void drawLoadingScreen(const char *toScreenLog, const char *loadingMsg)
drawFrame();
}

static void innerMain(const char *cfwError)
static void innerMain()
{
OSThread *mainThread = OSGetCurrentThread();
OSSetThreadName(mainThread, "NUSspli");
#ifdef NUSSPLI_DEBUG
OSSetThreadStackUsage(mainThread);
#endif

const char *cfwError = cfwValid();
if(cfwError == NULL)
{
addEntropy(&(mainThread->id), sizeof(uint16_t));
Expand Down Expand Up @@ -238,30 +238,7 @@ static void innerMain(const char *cfwError)
int main()
{
initState();

#ifdef NUSSPLI_HBL
bool jailbreaking;
uint64_t tid = OSGetTitleID();
#endif
const char *cfwError = cfwValid();
if(cfwError == NULL)
{
#ifdef NUSSPLI_HBL
jailbreaking = !isAroma() && (tid & 0xFFFFFFFFFFFFF0FF) == 0x000500101004A000; // Mii Maker
if(jailbreaking)
jailbreaking = jailbreak();

if(!jailbreaking)
#endif
innerMain(NULL);
}
else
{
innerMain(cfwError);
#ifdef NUSSPLI_HBL
jailbreaking = false;
#endif
}
innerMain();

deinitCfw();

Expand All @@ -274,25 +251,7 @@ int main()
if(app != APP_STATE_STOPPED)
{
if(!launchingTitle())
{
#ifdef NUSSPLI_HBL
if(isAroma())
SYSLaunchMenu();
else if(!jailbreaking)
{
if((tid & 0xFFFFFFFFFFFFF0FF) == 0x000500101004E000) // Health & Safety
{
tid &= 0xFFFFFFFFFFFF0FFF;
tid |= 0x000000000000A000;
_SYSLaunchTitleWithStdArgsInNoSplash(tid, NULL);
}
else
SYSRelaunchTitle(0, NULL);
}
#else
SYSLaunchMenu();
#endif
}

if(app == APP_STATE_HOME)
{
Expand Down
2 changes: 0 additions & 2 deletions src/menu/updateMenu.c
Expand Up @@ -69,9 +69,7 @@ bool updateMenu(const char *newVersion, NUSSPLI_TYPE type)
{
if(update(newVersion, type))
{
#ifndef NUSSPLI_HBL
relaunch();
#endif
return true;
}
else
Expand Down
6 changes: 0 additions & 6 deletions src/state.c
Expand Up @@ -39,11 +39,9 @@

volatile APP_STATE app;
static bool shutdownEnabled = true;
#ifndef NUSSPLI_HBL
#ifndef NUSSPLI_LITE
static bool channel;
#endif
#endif
static bool aroma;
static bool apdEnabled;
static uint32_t apdDisabledCount = 0;
Expand Down Expand Up @@ -111,14 +109,12 @@ bool isAroma()
return aroma;
}

#ifndef NUSSPLI_HBL
#ifndef NUSSPLI_LITE
bool isChannel()
{
return channel;
}
#endif
#endif

uint32_t homeButtonCallback(void *dummy)
{
Expand Down Expand Up @@ -148,10 +144,8 @@ void initState()
ACPInitialize();

aroma = RPXLoader_InitLibrary() == RPX_LOADER_RESULT_SUCCESS;
#ifndef NUSSPLI_HBL
#ifndef NUSSPLI_LITE
channel = OSGetTitleID() == 0x0005000010155373;
#endif
#endif

uint32_t ime;
Expand Down

0 comments on commit 03714e0

Please sign in to comment.