mirror of
https://github.com/wiidev/usbloadergx.git
synced 2025-02-16 19:39:14 +01:00
*using new app_booter for homebrew booting (see WiiXplorer changelog)
*reload back to entry ios when starting homebrew instead of starting it in cIOS *removed limit of .csv and .txt gamelist creation *fixed META.XML format *Added use of the internal Wii System Menu font (removed old one) (thx to giantpune and r-win) *Changed default Font Scale to 0.8 to fit with the new font. If you don't reset configs it's recommended to change it manually in the settings to 0.8.
This commit is contained in:
parent
f8ae27c2e2
commit
4a2899ac38
@ -2,14 +2,14 @@
|
|||||||
<app version="1">
|
<app version="1">
|
||||||
<name> USB Loader GX</name>
|
<name> USB Loader GX</name>
|
||||||
<coder>USB Loader GX Team</coder>
|
<coder>USB Loader GX Team</coder>
|
||||||
<version>2.2 r1099</version>
|
<version>2.2 r1101</version>
|
||||||
<release_date>201106272106</release_date>
|
<release_date>201106301853</release_date>
|
||||||
<!-- // remove this line to enable arguments
|
<!-- // remove this line to enable arguments
|
||||||
<arguments>
|
<arguments>
|
||||||
<arg>--ios=250</arg>
|
<arg>--ios=250</arg>
|
||||||
<arg>--usbport=0</arg>
|
<arg>--usbport=0</arg>
|
||||||
</arguments>
|
</arguments>
|
||||||
--> // remove this line to enable arguments
|
// remove this line to enable arguments -->
|
||||||
<no_ios_reload/>
|
<no_ios_reload/>
|
||||||
<short_description>Loads games from USB-devices</short_description>
|
<short_description>Loads games from USB-devices</short_description>
|
||||||
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
||||||
|
BIN
data/app_booter.bin
Normal file
BIN
data/app_booter.bin
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 104 KiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -63,15 +63,23 @@ wchar_t* charToWideChar(const char* strChar)
|
|||||||
/**
|
/**
|
||||||
* Default constructor for the FreeTypeGX class for WiiXplorer.
|
* Default constructor for the FreeTypeGX class for WiiXplorer.
|
||||||
*/
|
*/
|
||||||
FreeTypeGX::FreeTypeGX(const uint8_t* fontBuffer, FT_Long bufferSize)
|
FreeTypeGX::FreeTypeGX(const uint8_t* fontBuffer, FT_Long bufferSize, bool lastFace)
|
||||||
{
|
{
|
||||||
|
int faceIndex = 0;
|
||||||
ftPointSize = 0;
|
ftPointSize = 0;
|
||||||
|
|
||||||
FT_Init_FreeType(&ftLibrary);
|
FT_Init_FreeType(&ftLibrary);
|
||||||
FT_New_Memory_Face(ftLibrary, (FT_Byte *) fontBuffer, bufferSize, 0, &ftFace);
|
if(lastFace)
|
||||||
|
{
|
||||||
|
FT_New_Memory_Face(ftLibrary, (FT_Byte *)fontBuffer, bufferSize, -1, &ftFace);
|
||||||
|
faceIndex = ftFace->num_faces - 1; // Use the last face
|
||||||
|
FT_Done_Face(ftFace);
|
||||||
|
ftFace = NULL;
|
||||||
|
}
|
||||||
|
FT_New_Memory_Face(ftLibrary, (FT_Byte *) fontBuffer, bufferSize, faceIndex, &ftFace);
|
||||||
|
|
||||||
setVertexFormat(GX_VTXFMT1);
|
setVertexFormat(GX_VTXFMT1);
|
||||||
ftKerningEnabled = false;
|
ftKerningEnabled = false;//FT_HAS_KERNING(ftFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,7 +132,7 @@ class FreeTypeGX
|
|||||||
int16_t screenZ, GXColor color);
|
int16_t screenZ, GXColor color);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FreeTypeGX(const uint8_t* fontBuffer, FT_Long bufferSize);
|
FreeTypeGX(const uint8_t* fontBuffer, FT_Long bufferSize, bool lastFace = false);
|
||||||
~FreeTypeGX();
|
~FreeTypeGX();
|
||||||
|
|
||||||
void setVertexFormat(uint8_t vertexIndex);
|
void setVertexFormat(uint8_t vertexIndex);
|
||||||
|
@ -312,7 +312,7 @@ void Text::Draw()
|
|||||||
GXColor c = color;
|
GXColor c = color;
|
||||||
c.a = this->GetAlpha();
|
c.a = this->GetAlpha();
|
||||||
|
|
||||||
int newSize = (int) (size * GetScale() * Settings.FontScaleFactor);
|
int newSize = (int) (size * GetScale());
|
||||||
|
|
||||||
if (newSize != currentSize)
|
if (newSize != currentSize)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ static GXColor presetColor = (GXColor) {255, 255, 255, 255};
|
|||||||
GuiText::GuiText(const char * t, int s, GXColor c)
|
GuiText::GuiText(const char * t, int s, GXColor c)
|
||||||
{
|
{
|
||||||
text = NULL;
|
text = NULL;
|
||||||
size = s;
|
size = (int) (s * Settings.FontScaleFactor);
|
||||||
currentSize = size;
|
currentSize = size;
|
||||||
color = c;
|
color = c;
|
||||||
alpha = c.a;
|
alpha = c.a;
|
||||||
@ -61,7 +61,7 @@ GuiText::GuiText(const char * t, int s, GXColor c)
|
|||||||
GuiText::GuiText(const wchar_t * t, int s, GXColor c)
|
GuiText::GuiText(const wchar_t * t, int s, GXColor c)
|
||||||
{
|
{
|
||||||
text = NULL;
|
text = NULL;
|
||||||
size = s;
|
size = (int) (s * Settings.FontScaleFactor);
|
||||||
currentSize = size;
|
currentSize = size;
|
||||||
color = c;
|
color = c;
|
||||||
alpha = c.a;
|
alpha = c.a;
|
||||||
@ -95,7 +95,7 @@ GuiText::GuiText(const wchar_t * t, int s, GXColor c)
|
|||||||
GuiText::GuiText(const char * t)
|
GuiText::GuiText(const char * t)
|
||||||
{
|
{
|
||||||
text = NULL;
|
text = NULL;
|
||||||
size = presetSize;
|
size = (int) (presetSize * Settings.FontScaleFactor);
|
||||||
currentSize = size;
|
currentSize = size;
|
||||||
color = presetColor;
|
color = presetColor;
|
||||||
alpha = presetColor.a;
|
alpha = presetColor.a;
|
||||||
@ -531,7 +531,7 @@ void GuiText::Draw()
|
|||||||
GXColor c = color;
|
GXColor c = color;
|
||||||
c.a = GetAlpha();
|
c.a = GetAlpha();
|
||||||
|
|
||||||
int newSize = (int) (size * GetScale() * Settings.FontScaleFactor);
|
int newSize = (int) (size * GetScale());
|
||||||
|
|
||||||
if (newSize != currentSize)
|
if (newSize != currentSize)
|
||||||
{
|
{
|
||||||
|
@ -158,6 +158,7 @@ int StartUpProcess::Run(int argc, char *argv[])
|
|||||||
|
|
||||||
int StartUpProcess::Execute()
|
int StartUpProcess::Execute()
|
||||||
{
|
{
|
||||||
|
Settings.EntryIOS = IOS_GetVersion();
|
||||||
SetTextf("Start up\n");
|
SetTextf("Start up\n");
|
||||||
|
|
||||||
if(IosLoader::LoadAppCios() < 0)
|
if(IosLoader::LoadAppCios() < 0)
|
||||||
|
@ -5,44 +5,6 @@
|
|||||||
#include "utils/uncompress.h"
|
#include "utils/uncompress.h"
|
||||||
#include "OpeningBNR.hpp"
|
#include "OpeningBNR.hpp"
|
||||||
|
|
||||||
typedef struct _IMD5Header
|
|
||||||
{
|
|
||||||
u32 fcc;
|
|
||||||
u32 filesize;
|
|
||||||
u8 zeroes[8];
|
|
||||||
u8 crypto[16];
|
|
||||||
} __attribute__((packed)) IMD5Header;
|
|
||||||
|
|
||||||
typedef struct _U8Header
|
|
||||||
{
|
|
||||||
u32 fcc;
|
|
||||||
u32 rootNodeOffset;
|
|
||||||
u32 headerSize;
|
|
||||||
u32 dataOffset;
|
|
||||||
u8 zeroes[16];
|
|
||||||
} __attribute__((packed)) U8Header;
|
|
||||||
|
|
||||||
typedef struct _U8Entry
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 fileType :8;
|
|
||||||
u32 nameOffset :24;
|
|
||||||
};
|
|
||||||
u32 fileOffset;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
u32 fileLength;
|
|
||||||
u32 numEntries;
|
|
||||||
};
|
|
||||||
} __attribute__( ( packed ) ) U8Entry;
|
|
||||||
|
|
||||||
|
|
||||||
static inline const char * u8Filename(const U8Entry *fst, int i)
|
|
||||||
{
|
|
||||||
return (char *) (fst + fst[0].numEntries) + fst[i].nameOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
BNRInstance * BNRInstance::instance = NULL;
|
BNRInstance * BNRInstance::instance = NULL;
|
||||||
|
|
||||||
OpeningBNR::OpeningBNR()
|
OpeningBNR::OpeningBNR()
|
||||||
|
@ -17,6 +17,44 @@ typedef struct _IMETHeader
|
|||||||
u8 crypto[16];
|
u8 crypto[16];
|
||||||
} __attribute__((packed)) IMETHeader;
|
} __attribute__((packed)) IMETHeader;
|
||||||
|
|
||||||
|
typedef struct _IMD5Header
|
||||||
|
{
|
||||||
|
u32 fcc;
|
||||||
|
u32 filesize;
|
||||||
|
u8 zeroes[8];
|
||||||
|
u8 crypto[16];
|
||||||
|
} __attribute__((packed)) IMD5Header;
|
||||||
|
|
||||||
|
typedef struct _U8Header
|
||||||
|
{
|
||||||
|
u32 fcc;
|
||||||
|
u32 rootNodeOffset;
|
||||||
|
u32 headerSize;
|
||||||
|
u32 dataOffset;
|
||||||
|
u8 zeroes[16];
|
||||||
|
} __attribute__((packed)) U8Header;
|
||||||
|
|
||||||
|
typedef struct _U8Entry
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
u32 fileType :8;
|
||||||
|
u32 nameOffset :24;
|
||||||
|
};
|
||||||
|
u32 fileOffset;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
u32 fileLength;
|
||||||
|
u32 numEntries;
|
||||||
|
};
|
||||||
|
} __attribute__( ( packed ) ) U8Entry;
|
||||||
|
|
||||||
|
|
||||||
|
static inline const char * u8Filename(const U8Entry *fst, int i)
|
||||||
|
{
|
||||||
|
return (char *) (fst + fst[0].numEntries) + fst[i].nameOffset;
|
||||||
|
}
|
||||||
|
|
||||||
class OpeningBNR
|
class OpeningBNR
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -9,18 +9,25 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Controls/DeviceHandler.hpp"
|
#include "Controls/DeviceHandler.hpp"
|
||||||
#include "../lstub.h"
|
#include "settings/CSettings.h"
|
||||||
#include "../sys.h"
|
#include "lstub.h"
|
||||||
#include "../gecko.h"
|
#include "sys.h"
|
||||||
|
#include "gecko.h"
|
||||||
|
|
||||||
#include "dolloader.h"
|
#define EXECUTE_ADDR ((u8 *) 0x92000000)
|
||||||
|
#define BOOTER_ADDR ((u8 *) 0x93000000)
|
||||||
|
#define ARGS_ADDR ((u8 *) 0x93200000)
|
||||||
|
|
||||||
static u8 *homebrewbuffer = (u8 *) 0x92000000;
|
extern const u8 app_booter_bin[];
|
||||||
|
extern const u32 app_booter_bin_size;
|
||||||
|
|
||||||
|
typedef void (*entrypoint) (void);
|
||||||
|
extern "C" { void __exception_closeall(); }
|
||||||
|
|
||||||
|
static u8 *homebrewbuffer = EXECUTE_ADDR;
|
||||||
static u32 homebrewsize = 0;
|
static u32 homebrewsize = 0;
|
||||||
static std::vector<std::string> Arguments;
|
static std::vector<std::string> Arguments;
|
||||||
|
|
||||||
extern const u8 app_booter_dol[];
|
|
||||||
|
|
||||||
void AddBootArgument(const char * argv)
|
void AddBootArgument(const char * argv)
|
||||||
{
|
{
|
||||||
std::string arg(argv);
|
std::string arg(argv);
|
||||||
@ -37,7 +44,7 @@ int CopyHomebrewMemory(u8 *temp, u32 pos, u32 len)
|
|||||||
|
|
||||||
void FreeHomebrewBuffer()
|
void FreeHomebrewBuffer()
|
||||||
{
|
{
|
||||||
homebrewbuffer = (u8 *) 0x92000000;
|
homebrewbuffer = EXECUTE_ADDR;
|
||||||
homebrewsize = 0;
|
homebrewsize = 0;
|
||||||
|
|
||||||
Arguments.clear();
|
Arguments.clear();
|
||||||
@ -91,18 +98,24 @@ static int RunAppbooter()
|
|||||||
|
|
||||||
ExitApp();
|
ExitApp();
|
||||||
|
|
||||||
|
if(Settings.EntryIOS != IOS_GetVersion())
|
||||||
|
IOS_ReloadIOS(Settings.EntryIOS);
|
||||||
|
|
||||||
struct __argv args;
|
struct __argv args;
|
||||||
SetupARGV(&args);
|
SetupARGV(&args);
|
||||||
|
|
||||||
u32 cpu_isr;
|
u32 cpu_isr;
|
||||||
|
|
||||||
entrypoint entry = (entrypoint) load_dol((void*) app_booter_dol, &args);
|
memcpy(BOOTER_ADDR, app_booter_bin, app_booter_bin_size);
|
||||||
|
DCFlushRange(BOOTER_ADDR, app_booter_bin_size);
|
||||||
|
|
||||||
if (!entry)
|
entrypoint entry = (entrypoint) BOOTER_ADDR;
|
||||||
{
|
|
||||||
FreeHomebrewBuffer();
|
if (args.argvMagic == ARGV_MAGIC)
|
||||||
return -1;
|
{
|
||||||
}
|
memmove(ARGS_ADDR, &args, sizeof(args));
|
||||||
|
DCFlushRange(ARGS_ADDR, sizeof(args));
|
||||||
|
}
|
||||||
|
|
||||||
u64 currentStub = getStubDest();
|
u64 currentStub = getStubDest();
|
||||||
loadStub();
|
loadStub();
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
#include <malloc.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ogc/machine/processor.h>
|
|
||||||
#include <gccore.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "dolloader.h"
|
|
||||||
|
|
||||||
typedef struct _dolheader {
|
|
||||||
u32 text_pos[7];
|
|
||||||
u32 data_pos[11];
|
|
||||||
u32 text_start[7];
|
|
||||||
u32 data_start[11];
|
|
||||||
u32 text_size[7];
|
|
||||||
u32 data_size[11];
|
|
||||||
u32 bss_start;
|
|
||||||
u32 bss_size;
|
|
||||||
u32 entry_point;
|
|
||||||
} dolheader;
|
|
||||||
|
|
||||||
u32 load_dol(const void *dolstart, struct __argv *argv)
|
|
||||||
{
|
|
||||||
u32 i;
|
|
||||||
dolheader *dolfile;
|
|
||||||
|
|
||||||
if (dolstart)
|
|
||||||
{
|
|
||||||
dolfile = (dolheader *) dolstart;
|
|
||||||
for (i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
if ((!dolfile->text_size[i]) || (dolfile->text_start[i] < 0x100))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
memmove((void *) dolfile->text_start[i], dolstart
|
|
||||||
+ dolfile->text_pos[i], dolfile->text_size[i]);
|
|
||||||
|
|
||||||
DCFlushRange ((void *) dolfile->text_start[i], dolfile->text_size[i]);
|
|
||||||
ICInvalidateRange((void *) dolfile->text_start[i], dolfile->text_size[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 11; i++)
|
|
||||||
{
|
|
||||||
if ((!dolfile->data_size[i]) || (dolfile->data_start[i] < 0x100))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
memmove((void *) dolfile->data_start[i], dolstart
|
|
||||||
+ dolfile->data_pos[i], dolfile->data_size[i]);
|
|
||||||
|
|
||||||
DCFlushRange((void *) dolfile->data_start[i],
|
|
||||||
dolfile->data_size[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (argv && argv->argvMagic == ARGV_MAGIC)
|
|
||||||
{
|
|
||||||
void *new_argv = (void *) (dolfile->entry_point + 8);
|
|
||||||
memmove(new_argv, argv, sizeof(*argv));
|
|
||||||
DCFlushRange(new_argv, sizeof(*argv));
|
|
||||||
}
|
|
||||||
return dolfile->entry_point;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
#ifndef _DOLLOADER_H_
|
|
||||||
#define _DOLLOADER_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void __exception_closeall();
|
|
||||||
typedef void (*entrypoint) (void);
|
|
||||||
|
|
||||||
u32 load_dol(const void *dolstart, struct __argv *argv);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -29,8 +29,7 @@
|
|||||||
#include "utils/StringTools.h"
|
#include "utils/StringTools.h"
|
||||||
#include "mload/mload.h"
|
#include "mload/mload.h"
|
||||||
#include "FileOperations/fileops.h"
|
#include "FileOperations/fileops.h"
|
||||||
#include "menu.h"
|
#include "menu/menus.h"
|
||||||
#include "menu.h"
|
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "wpad.h"
|
#include "wpad.h"
|
||||||
#include "wad/wad.h"
|
#include "wad/wad.h"
|
||||||
@ -42,11 +41,6 @@
|
|||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
#include "lstub.h"
|
#include "lstub.h"
|
||||||
|
|
||||||
/*** Extern variables ***/
|
|
||||||
s32 gameStart = 0;
|
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* OnScreenNumpad
|
* OnScreenNumpad
|
||||||
*
|
*
|
||||||
@ -237,9 +231,9 @@ void WindowCredits()
|
|||||||
|
|
||||||
char SvnRev[80];
|
char SvnRev[80];
|
||||||
#ifdef FULLCHANNEL
|
#ifdef FULLCHANNEL
|
||||||
snprintf(SvnRev, sizeof(SvnRev), "V2.2c IOS%u (Rev %u)", IOS_GetVersion(), IOS_GetRevision());
|
snprintf(SvnRev, sizeof(SvnRev), "Rev%sc IOS%u (Rev %u)", GetRev(), IOS_GetVersion(), IOS_GetRevision());
|
||||||
#else
|
#else
|
||||||
snprintf(SvnRev, sizeof(SvnRev), "V2.2 IOS%u (Rev %u)", IOS_GetVersion(), IOS_GetRevision());
|
snprintf(SvnRev, sizeof(SvnRev), "Rev%s IOS%u (Rev %u)", GetRev(), IOS_GetVersion(), IOS_GetRevision());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char IosInfo[80] = "";
|
char IosInfo[80] = "";
|
||||||
|
@ -1114,13 +1114,10 @@ bool save_gamelist(int txt) // save gamelist
|
|||||||
{
|
{
|
||||||
struct discHdr* header = gameList[i];
|
struct discHdr* header = gameList[i];
|
||||||
WBFS_GameSize(header->id, &size);
|
WBFS_GameSize(header->id, &size);
|
||||||
if (i < 500)
|
fprintf(f, "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2], header->id[3], header->id[4],
|
||||||
{
|
header->id[5]);
|
||||||
fprintf(f, "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2], header->id[3], header->id[4],
|
fprintf(f, " [%.2f] ", size);
|
||||||
header->id[5]);
|
fprintf(f, " %s", GameTitles.GetTitle(header));
|
||||||
fprintf(f, " [%.2f] ", size);
|
|
||||||
fprintf(f, " %s", GameTitles.GetTitle(header));
|
|
||||||
}
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1132,11 +1129,8 @@ bool save_gamelist(int txt) // save gamelist
|
|||||||
{
|
{
|
||||||
struct discHdr* header = gameList[i];
|
struct discHdr* header = gameList[i];
|
||||||
WBFS_GameSize(header->id, &size);
|
WBFS_GameSize(header->id, &size);
|
||||||
if (i < 500)
|
fprintf(f, "\"%c%c%c%c%c%c\",\"%.2f\",\"%s\"\n", header->id[0], header->id[1], header->id[2],
|
||||||
{
|
header->id[3], header->id[4], header->id[5], size, GameTitles.GetTitle(header));
|
||||||
fprintf(f, "\"%c%c%c%c%c%c\",\"%.2f\",\"%s\"\n", header->id[0], header->id[1], header->id[2],
|
|
||||||
header->id[3], header->id[4], header->id[5], size, GameTitles.GetTitle(header));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
@ -119,7 +119,7 @@ void CSettings::SetDefault()
|
|||||||
USBPort = 0;
|
USBPort = 0;
|
||||||
CacheTitles = ON;
|
CacheTitles = ON;
|
||||||
WSFactor = 0.8f; //actually should be 0.75 for real widescreen
|
WSFactor = 0.8f; //actually should be 0.75 for real widescreen
|
||||||
FontScaleFactor = 1.0f;
|
FontScaleFactor = 0.8f; //it's a work around to not have to change ALL fonts now
|
||||||
EnabledCategories.resize(1);
|
EnabledCategories.resize(1);
|
||||||
EnabledCategories[0] = 0;
|
EnabledCategories[0] = 0;
|
||||||
Wiinnertag = OFF;
|
Wiinnertag = OFF;
|
||||||
|
@ -125,6 +125,7 @@ class CSettings
|
|||||||
short GameListOffset;
|
short GameListOffset;
|
||||||
short sneekVideoPatch;
|
short sneekVideoPatch;
|
||||||
std::vector<u32> EnabledCategories;
|
std::vector<u32> EnabledCategories;
|
||||||
|
u8 EntryIOS;
|
||||||
protected:
|
protected:
|
||||||
bool ValidVersion(FILE * file);
|
bool ValidVersion(FILE * file);
|
||||||
bool SetSetting(char *name, char *value);
|
bool SetSetting(char *name, char *value);
|
||||||
|
@ -29,13 +29,27 @@
|
|||||||
#include "CTheme.h"
|
#include "CTheme.h"
|
||||||
#include "GUI/gui.h"
|
#include "GUI/gui.h"
|
||||||
#include "settings/CSettings.h"
|
#include "settings/CSettings.h"
|
||||||
|
#include "banner/OpeningBNR.hpp"
|
||||||
#include "FileOperations/fileops.h"
|
#include "FileOperations/fileops.h"
|
||||||
#include "menu/menus.h"
|
#include "menu/menus.h"
|
||||||
|
#include "wad/nandtitle.h"
|
||||||
#include "FreeTypeGX.h"
|
#include "FreeTypeGX.h"
|
||||||
|
|
||||||
|
typedef struct map_entry
|
||||||
|
{
|
||||||
|
char name[8];
|
||||||
|
u8 hash[20];
|
||||||
|
} __attribute__((packed)) map_entry_t;
|
||||||
|
|
||||||
|
static const char contentMapPath[] ATTRIBUTE_ALIGN(32) = "/shared1/content.map";
|
||||||
|
static const u8 WIIFONT_HASH[] = {0x32, 0xb3, 0x39, 0xcb, 0xbb, 0x50, 0x7d, 0x50, 0x27, 0x79, 0x25, 0x9a, 0x78, 0x66, 0x99, 0x5d, 0x03, 0x0b, 0x1d, 0x88};
|
||||||
|
static const u8 WIIFONT_HASH_KOR[] = {0xb7, 0x15, 0x6d, 0xf0, 0xf4, 0xae, 0x07, 0x8f, 0xd1, 0x53, 0x58, 0x3e, 0x93, 0x6e, 0x07, 0xc0, 0x98, 0x77, 0x49, 0x0e};
|
||||||
|
|
||||||
FreeTypeGX * fontSystem = NULL;
|
FreeTypeGX * fontSystem = NULL;
|
||||||
static FT_Byte * MainFont = NULL;
|
static FT_Byte * systemFont = NULL;
|
||||||
static u32 MainFontSize = 0;
|
static u32 systemFontSize = 0;
|
||||||
|
static FT_Byte * customFont = NULL;
|
||||||
|
static u32 customFontSize = 0;
|
||||||
|
|
||||||
bool Theme::ShowTooltips = true;
|
bool Theme::ShowTooltips = true;
|
||||||
|
|
||||||
@ -149,13 +163,76 @@ bool Theme::Load(const char * theme_file_path)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Theme::loadSystemFont(bool korean)
|
||||||
|
{
|
||||||
|
u8 *contentMap = NULL;
|
||||||
|
u32 mapsize = 0;
|
||||||
|
|
||||||
|
NandTitle::LoadFileFromNand(contentMapPath, &contentMap, &mapsize);
|
||||||
|
if(!contentMap)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int fileCount = mapsize / sizeof(map_entry_t);
|
||||||
|
|
||||||
|
map_entry_t *mapEntryList = (map_entry_t *) contentMap;
|
||||||
|
|
||||||
|
for (int i = 0; i < fileCount; i++)
|
||||||
|
{
|
||||||
|
if (memcmp(mapEntryList[i].hash, korean ? WIIFONT_HASH_KOR : WIIFONT_HASH, 20) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Name found, load it and unpack it
|
||||||
|
char font_filename[32] ATTRIBUTE_ALIGN(32);
|
||||||
|
snprintf(font_filename, sizeof(font_filename), "/shared1/%.8s.app", mapEntryList[i].name);
|
||||||
|
|
||||||
|
u8 *fontArchive = NULL;
|
||||||
|
u32 filesize = 0;
|
||||||
|
|
||||||
|
NandTitle::LoadFileFromNand(font_filename, &fontArchive, &filesize);
|
||||||
|
if(!fontArchive)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const U8Header *u8Archive = (U8Header *) fontArchive;
|
||||||
|
const U8Entry *fst = (const U8Entry *) (((const u8 *) u8Archive) + u8Archive->rootNodeOffset);
|
||||||
|
|
||||||
|
if(fst[0].numEntries < 1)
|
||||||
|
{
|
||||||
|
free(fontArchive);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(systemFont)
|
||||||
|
delete [] systemFont;
|
||||||
|
|
||||||
|
systemFontSize = fst[1].fileLength;
|
||||||
|
systemFont = new (std::nothrow) FT_Byte[systemFontSize];
|
||||||
|
if(!systemFont)
|
||||||
|
{
|
||||||
|
free(fontArchive);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(systemFont, fontArchive + fst[1].fileOffset, systemFontSize);
|
||||||
|
|
||||||
|
free(fontArchive);
|
||||||
|
free(contentMap);
|
||||||
|
gprintf("Loaded Wii System Font: %s\n", u8Filename(fst, 1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(contentMap);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Theme::LoadFont(const char *path)
|
bool Theme::LoadFont(const char *path)
|
||||||
{
|
{
|
||||||
char FontPath[300];
|
char FontPath[300];
|
||||||
bool result = false;
|
bool result = false;
|
||||||
FILE *pfile = NULL;
|
FILE *pfile = NULL;
|
||||||
|
|
||||||
ClearFontData();
|
delete [] customFont;
|
||||||
|
customFont = NULL;
|
||||||
|
|
||||||
snprintf(FontPath, sizeof(FontPath), "%s/font.ttf", path);
|
snprintf(FontPath, sizeof(FontPath), "%s/font.ttf", path);
|
||||||
|
|
||||||
@ -164,22 +241,32 @@ bool Theme::LoadFont(const char *path)
|
|||||||
if (pfile)
|
if (pfile)
|
||||||
{
|
{
|
||||||
fseek(pfile, 0, SEEK_END);
|
fseek(pfile, 0, SEEK_END);
|
||||||
MainFontSize = ftell(pfile);
|
customFontSize = ftell(pfile);
|
||||||
rewind(pfile);
|
rewind(pfile);
|
||||||
|
|
||||||
MainFont = new (std::nothrow) FT_Byte[MainFontSize];
|
customFont = new (std::nothrow) FT_Byte[customFontSize];
|
||||||
if (MainFont)
|
if (customFont)
|
||||||
{
|
{
|
||||||
fread(MainFont, 1, MainFontSize, pfile);
|
fread(customFont, 1, customFontSize, pfile);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
fclose(pfile);
|
fclose(pfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
FT_Byte * loadedFont = MainFont ? MainFont : (FT_Byte *) Resources::GetFile("font.ttf");
|
FT_Byte *loadedFont = customFont;
|
||||||
u32 loadedFontSize = MainFont ? MainFontSize : Resources::GetFileSize("font.ttf");
|
u32 loadedFontSize = customFontSize;
|
||||||
|
|
||||||
fontSystem = new FreeTypeGX(loadedFont, loadedFontSize);
|
if(!loadedFont)
|
||||||
|
{
|
||||||
|
if(!systemFont)
|
||||||
|
loadSystemFont(CONF_GetLanguage() == CONF_LANG_KOREAN);
|
||||||
|
|
||||||
|
//! Default to system font if no custom is loaded
|
||||||
|
loadedFont = systemFont;
|
||||||
|
loadedFontSize = systemFontSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
fontSystem = new FreeTypeGX(loadedFont, loadedFontSize, loadedFont == systemFont);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -190,7 +277,11 @@ void Theme::ClearFontData()
|
|||||||
delete fontSystem;
|
delete fontSystem;
|
||||||
fontSystem = NULL;
|
fontSystem = NULL;
|
||||||
|
|
||||||
if (MainFont)
|
if(customFont)
|
||||||
delete [] MainFont;
|
delete [] customFont;
|
||||||
MainFont = NULL;
|
customFont = NULL;
|
||||||
|
|
||||||
|
if (systemFont)
|
||||||
|
delete [] systemFont;
|
||||||
|
systemFont = NULL;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@ class Theme
|
|||||||
//!Enable tooltips: special case treaded because it is called every frame
|
//!Enable tooltips: special case treaded because it is called every frame
|
||||||
static bool ShowTooltips;
|
static bool ShowTooltips;
|
||||||
private:
|
private:
|
||||||
|
//!Load the original Wii System Menu font
|
||||||
|
static bool loadSystemFont(bool korean);
|
||||||
//!Clear the font data and free the memory
|
//!Clear the font data and free the memory
|
||||||
static void ClearFontData();
|
static void ClearFontData();
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* USB Loader GX resource files.
|
* USB Loader GX resource files.
|
||||||
* This file is generated automatically.
|
* This file is generated automatically.
|
||||||
* Includes 189 files.
|
* Includes 188 files.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
* Any manual modification of this file will be overwriten by the generation.
|
* Any manual modification of this file will be overwriten by the generation.
|
||||||
@ -575,9 +575,6 @@ extern const u32 success_ogg_size;
|
|||||||
extern const u8 clock_ttf[];
|
extern const u8 clock_ttf[];
|
||||||
extern const u32 clock_ttf_size;
|
extern const u32 clock_ttf_size;
|
||||||
|
|
||||||
extern const u8 font_ttf[];
|
|
||||||
extern const u32 font_ttf_size;
|
|
||||||
|
|
||||||
RecourceFile Resources::RecourceFiles[] =
|
RecourceFile Resources::RecourceFiles[] =
|
||||||
{
|
{
|
||||||
{"abcIcon.png", abcIcon_png, abcIcon_png_size, NULL, 0},
|
{"abcIcon.png", abcIcon_png, abcIcon_png_size, NULL, 0},
|
||||||
@ -768,7 +765,6 @@ RecourceFile Resources::RecourceFiles[] =
|
|||||||
{"menuout.ogg", menuout_ogg, menuout_ogg_size, NULL, 0},
|
{"menuout.ogg", menuout_ogg, menuout_ogg_size, NULL, 0},
|
||||||
{"success.ogg", success_ogg, success_ogg_size, NULL, 0},
|
{"success.ogg", success_ogg, success_ogg_size, NULL, 0},
|
||||||
{"clock.ttf", clock_ttf, clock_ttf_size, NULL, 0},
|
{"clock.ttf", clock_ttf, clock_ttf_size, NULL, 0},
|
||||||
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
|
|
||||||
{NULL, NULL, 0, NULL, 0}
|
{NULL, NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -282,9 +282,9 @@ int set_frag_list(u8 *id)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
// verify id matches
|
// verify id matches
|
||||||
char discid[8];
|
char discid[32] ATTRIBUTE_ALIGN(32);
|
||||||
memset(discid, 0, sizeof(discid));
|
memset(discid, 0, sizeof(discid));
|
||||||
ret = WDVD_UnencryptedRead(discid, 8, 0);
|
ret = WDVD_UnencryptedRead(discid, 32, 0);
|
||||||
gprintf("Reading ID after setting fraglist: %s (expected: %s)\n", discid, id);
|
gprintf("Reading ID after setting fraglist: %s (expected: %s)\n", discid, id);
|
||||||
return (strncasecmp((char *) id, discid, 6) != 0) ? -3 : 0;
|
return (strncasecmp((char *) id, discid, 6) != 0) ? -3 : 0;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ EOF
|
|||||||
<arg>--ios=250</arg>
|
<arg>--ios=250</arg>
|
||||||
<arg>--usbport=0</arg>
|
<arg>--usbport=0</arg>
|
||||||
</arguments>
|
</arguments>
|
||||||
--> // remove this line to enable arguments
|
// remove this line to enable arguments -->
|
||||||
<no_ios_reload/>
|
<no_ios_reload/>
|
||||||
<short_description>Loads games from USB-devices</short_description>
|
<short_description>Loads games from USB-devices</short_description>
|
||||||
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user