mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-18 01:09:16 +01:00
76df2b26b6
*add loading of wii games / nand channels / emu nand channels in all combinations into one list *add button on main view for quick choice between the combinations of the three *add "Real Nand" or "Emulated Nand" text on the game window prompt when starting a channel *removed the need of a cIOS to launch the loader (if anyone uses it with IOS58 for whatever reason). The warning that a cIOS is needed is still present. *removed support for both usb ports at once on hermes cIOS. Each can still be used individually but only one at a time. This is done because of some bugs in the new ehci module which make some games unbootable. The ehcimodule is now reverted to the last working one. Need feedback if the games work fine again. *some preparations for the upcoming stealth mode feature of the d2x cIOS *isfs is now initiated once and deinitated when cleaning up only (instead of the whole init/deinit every single access) *removed choice for emulated nand channel modes. Emulated nand channels always need full emulation which is now always used on emu nand for channels. *removed unused settings for channels from the per game setting *changed default partition to 0 when starting with fresh settings (instead of -1 wtf?)
87 lines
1.9 KiB
C++
87 lines
1.9 KiB
C++
#ifndef OPENING_BNR_HPP_
|
|
#define OPENING_BNR_HPP_
|
|
|
|
#include <gctypes.h>
|
|
|
|
typedef struct _IMETHeader
|
|
{
|
|
u8 zeroes[64];
|
|
u32 fcc;
|
|
u8 unk[8];
|
|
u32 iconSize;
|
|
u32 bannerSize;
|
|
u32 soundSize;
|
|
u32 flag1;
|
|
u16 names[10][42]; // 10 languages (thanks dkosmari for the info)
|
|
u16 zeroes_2[7*42]; // padding for 7 more languages (thanks dkosmari for the info)
|
|
u8 crypto[16];
|
|
} __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
|
|
{
|
|
public:
|
|
OpeningBNR();
|
|
~OpeningBNR();
|
|
bool Load(const u8 * gameID);
|
|
bool Load(const u64 &tid, const char *pathPrefix);
|
|
const u16 * GetIMETTitle(int lang);
|
|
const u16 * GetIMETTitle(const u8 * gameID, int lang) { Load(gameID); return GetIMETTitle(lang); };
|
|
const u8 * GetBannerSound(u32 * size);
|
|
const u8 * GetBannerSound(const u8 * gameID, u32 * size) { Load(gameID); return GetBannerSound(size); };
|
|
const u8 * GetBannerSound(const u64 &tid, u32 * size, const char *pathPrefix) { Load(tid, pathPrefix); return GetBannerSound(size); };
|
|
private:
|
|
IMETHeader *imetHdr;
|
|
char gameID[7];
|
|
};
|
|
|
|
class BNRInstance : public OpeningBNR
|
|
{
|
|
public:
|
|
static BNRInstance * Instance() { if(!instance) instance = new BNRInstance; return instance; };
|
|
static void DestroyInstance() { delete instance; instance = NULL; };
|
|
private:
|
|
BNRInstance() { };
|
|
~BNRInstance() { };
|
|
static BNRInstance * instance;
|
|
};
|
|
|
|
#endif
|