mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-17 23:41:53 +01:00
This commit is contained in:
parent
f3e90060e2
commit
5254ace17c
BIN
data/custombanner.bin
Normal file
BIN
data/custombanner.bin
Normal file
Binary file not shown.
@ -57,16 +57,50 @@ void AnimatedBanner::Clear()
|
|||||||
|
|
||||||
bool AnimatedBanner::LoadBanner(Banner *banner)
|
bool AnimatedBanner::LoadBanner(Banner *banner)
|
||||||
{
|
{
|
||||||
Clear();
|
|
||||||
u32 banner_bin_size;
|
u32 banner_bin_size;
|
||||||
const u8 *banner_bin = banner->GetFile((char*)"banner.bin", &banner_bin_size);
|
const u8 *banner_bin = banner->GetFile((char*)"banner.bin", &banner_bin_size);
|
||||||
if(banner_bin == NULL)
|
if(banner_bin == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
return LoadBannerBin(banner_bin, banner_bin_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AnimatedBanner::LoadBannerBin(const u8 *banner_bin, u32 banner_bin_size)
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
layout_banner = LoadLayout(banner_bin, banner_bin_size, "banner", CONF_GetLanguageString());
|
layout_banner = LoadLayout(banner_bin, banner_bin_size, "banner", CONF_GetLanguageString());
|
||||||
return (layout_banner != NULL);
|
return (layout_banner != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnimatedBanner::SetBannerText(const char *text_name, const wchar_t *wText)
|
||||||
|
{
|
||||||
|
if(!layout_banner || !wText)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Textbox *tbox = dynamic_cast<Textbox *>(layout_banner->FindPane(text_name));
|
||||||
|
if(tbox)
|
||||||
|
{
|
||||||
|
int len = wcslen(wText);
|
||||||
|
u16 *text_char16 = new u16[len+1];
|
||||||
|
|
||||||
|
for(int i = 0; i < len; i++)
|
||||||
|
text_char16[i] = (u16) wText[i];
|
||||||
|
text_char16[len] = 0;
|
||||||
|
|
||||||
|
tbox->SetText(text_char16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimatedBanner::SetBannerTexture(const char *tex_name, const u8 *data, float width, float height, u8 fmt)
|
||||||
|
{
|
||||||
|
if(!layout_banner)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Texture *texture = layout_banner->FindTexture( tex_name );
|
||||||
|
if(texture != NULL && data != NULL) {
|
||||||
|
texture->LoadTextureData(data, width, height, fmt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Layout* AnimatedBanner::LoadLayout(const u8 *bnr, u32 bnr_size, const std::string& lyt_name, const std::string &language)
|
Layout* AnimatedBanner::LoadLayout(const u8 *bnr, u32 bnr_size, const std::string& lyt_name, const std::string &language)
|
||||||
{
|
{
|
||||||
u32 brlyt_size = 0;
|
u32 brlyt_size = 0;
|
||||||
|
@ -37,7 +37,10 @@ public:
|
|||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
bool LoadBanner(Banner *banner);
|
bool LoadBanner(Banner *banner);
|
||||||
|
bool LoadBannerBin(const u8 *banner_bin, u32 banner_bin_size);
|
||||||
Layout *getBanner() const { return layout_banner; }
|
Layout *getBanner() const { return layout_banner; }
|
||||||
|
void SetBannerTexture(const char *tex_name, const u8 *data, float width, float height, u8 fmt);
|
||||||
|
void SetBannerText(const char *text_name, const wchar_t *wText);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Layout* LoadLayout(const u8 *bnr, u32 bnr_size, const std::string& lyt_name, const std::string &language);
|
Layout* LoadLayout(const u8 *bnr, u32 bnr_size, const std::string& lyt_name, const std::string &language);
|
||||||
|
@ -23,9 +23,11 @@
|
|||||||
|
|
||||||
BannerWindow *m_banner;
|
BannerWindow *m_banner;
|
||||||
|
|
||||||
void BannerWindow::LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2)
|
extern const u8 custombanner_bin[];
|
||||||
|
extern const u32 custombanner_bin_size;
|
||||||
|
|
||||||
|
void BannerWindow::Init(CVideo *vid, u8 *font1, u8 *font2)
|
||||||
{
|
{
|
||||||
changing = true;
|
|
||||||
MaxAnimSteps = 30;
|
MaxAnimSteps = 30;
|
||||||
returnVal = -1;
|
returnVal = -1;
|
||||||
reducedVol = false;
|
reducedVol = false;
|
||||||
@ -42,7 +44,19 @@ void BannerWindow::LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2)
|
|||||||
AnimPosY = 0.5f * (ScreenProps.y - fIconHeight);
|
AnimPosY = 0.5f * (ScreenProps.y - fIconHeight);
|
||||||
AnimationRunning = false;
|
AnimationRunning = false;
|
||||||
|
|
||||||
ChangeGame(banner);
|
gameBanner->Clear();
|
||||||
|
if(!FontLoaded)
|
||||||
|
{
|
||||||
|
gameBanner->LoadFont(sysFont1, sysFont2);
|
||||||
|
FontLoaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BannerWindow::LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2)
|
||||||
|
{
|
||||||
|
changing = true;
|
||||||
|
Init(vid, font1, font2);
|
||||||
|
gameBanner->LoadBanner(banner);
|
||||||
gameSelected = 1;
|
gameSelected = 1;
|
||||||
changing = false;
|
changing = false;
|
||||||
}
|
}
|
||||||
@ -64,15 +78,21 @@ BannerWindow::BannerWindow()
|
|||||||
gameBanner = new AnimatedBanner;
|
gameBanner = new AnimatedBanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BannerWindow::ChangeGame(Banner *banner)
|
void BannerWindow::LoadBannerBin(u8 *bnr, u32 bnr_size, CVideo *vid, u8 *font1, u8 *font2)
|
||||||
{
|
{
|
||||||
gameBanner->Clear();
|
changing = true;
|
||||||
if(!FontLoaded)
|
Init(vid, font1, font2);
|
||||||
{
|
gameBanner->LoadBannerBin(bnr, bnr_size);
|
||||||
gameBanner->LoadFont(sysFont1, sysFont2);
|
gameSelected = 1;
|
||||||
FontLoaded = true;
|
changing = false;
|
||||||
}
|
}
|
||||||
gameBanner->LoadBanner(banner);
|
|
||||||
|
void BannerWindow::CreateGCBanner(u8 *bnr, CVideo *vid, u8 *font1, u8 *font2, const wchar_t *title)
|
||||||
|
{
|
||||||
|
GC_OpeningBnr *openingBnr = (GC_OpeningBnr *)bnr;
|
||||||
|
LoadBannerBin((u8*)custombanner_bin, (u32)custombanner_bin_size, vid, font1, font2);
|
||||||
|
gameBanner->SetBannerTexture("GCIcon.tpl", openingBnr->tpl_data, 96, 32, GX_TF_RGB5A3);
|
||||||
|
gameBanner->SetBannerText("T_GameTitle", title);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BannerWindow::ToogleZoom(void)
|
bool BannerWindow::ToogleZoom(void)
|
||||||
|
@ -27,14 +27,31 @@
|
|||||||
|
|
||||||
#define FAVORITE_STARS 5
|
#define FAVORITE_STARS 5
|
||||||
|
|
||||||
|
typedef struct _GC_OpeningBnr
|
||||||
|
{
|
||||||
|
u32 magic; // BNR1 or BNR2
|
||||||
|
u8 pad[0x1C];
|
||||||
|
u8 tpl_data[0x1800]; // 96x32 pixel format GX_TF_RGB5A3
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
u8 disc_title[0x20]; // Gamename
|
||||||
|
u8 developer_short[0x20]; // Company/Developer
|
||||||
|
u8 full_title[0x40]; // Full Game Title
|
||||||
|
u8 developer[0x40]; // Company/Developer Full name, or description
|
||||||
|
u8 long_description[0x80]; // Game Description
|
||||||
|
} description[6]; // 6 only on BNR2 => English, German, French, Spanish, Italian, Dutch ??
|
||||||
|
} GC_OpeningBnr;
|
||||||
|
|
||||||
class BannerWindow
|
class BannerWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BannerWindow();
|
BannerWindow();
|
||||||
void DeleteBanner(bool gamechange = false);
|
void DeleteBanner(bool gamechange = false);
|
||||||
void LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2);
|
void LoadBanner(Banner *banner, CVideo *vid, u8 *font1, u8 *font2);
|
||||||
|
void LoadBannerBin(u8 *bnr, u32 bnr_size, CVideo *vid, u8 *font1, u8 *font2);
|
||||||
int GetSelectedGame() { return gameSelected; }
|
int GetSelectedGame() { return gameSelected; }
|
||||||
bool GetZoomSetting() { return AnimZoom; }
|
bool GetZoomSetting() { return AnimZoom; }
|
||||||
|
void CreateGCBanner(u8 *bnr, CVideo *vid, u8 *font1, u8 *font2, const wchar_t *title);
|
||||||
void Draw(void);
|
void Draw(void);
|
||||||
bool ToogleZoom(void);
|
bool ToogleZoom(void);
|
||||||
protected:
|
protected:
|
||||||
@ -43,6 +60,7 @@ class BannerWindow
|
|||||||
void ChangeGame(Banner *banner);
|
void ChangeGame(Banner *banner);
|
||||||
void DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color);
|
void DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color);
|
||||||
void ReSetup_GX(void);
|
void ReSetup_GX(void);
|
||||||
|
void Init(CVideo *vid, u8 *font1, u8 *font2);
|
||||||
|
|
||||||
static const float fBannerWidth = 608.f;
|
static const float fBannerWidth = 608.f;
|
||||||
static const float fBannerHeight = 448.f;
|
static const float fBannerHeight = 448.f;
|
||||||
|
@ -159,9 +159,9 @@ int GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamed
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc, u8 DMLvideoMode)
|
void DML_New_SetOptions(const char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc, u8 DMLvideoMode)
|
||||||
{
|
{
|
||||||
gprintf("Wiiflow DML: Launch game 'sd:/games/%s/game.iso' through memory (new method)\n", GamePath);
|
gprintf("Wiiflow DML: Launch game '%s' through memory (new method)\n", GamePath);
|
||||||
|
|
||||||
DMLCfg = (DML_CFG*)MEM1_alloc(sizeof(DML_CFG));
|
DMLCfg = (DML_CFG*)MEM1_alloc(sizeof(DML_CFG));
|
||||||
if(DMLCfg == NULL)
|
if(DMLCfg == NULL)
|
||||||
@ -177,10 +177,7 @@ void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, boo
|
|||||||
|
|
||||||
if(GamePath != NULL)
|
if(GamePath != NULL)
|
||||||
{
|
{
|
||||||
if(GC_GameIsInstalled(GamePath, "sd", "%s:/games") == 2)
|
strncpy(DMLCfg->GamePath, GamePath, sizeof(DMLCfg->GamePath));
|
||||||
snprintf(DMLCfg->GamePath, sizeof(DMLCfg->GamePath), "/games/%s/", GamePath);
|
|
||||||
else
|
|
||||||
snprintf(DMLCfg->GamePath, sizeof(DMLCfg->GamePath), "/games/%s/game.iso", GamePath);
|
|
||||||
DMLCfg->Config |= DML_CFG_GAME_PATH;
|
DMLCfg->Config |= DML_CFG_GAME_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +212,7 @@ void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, boo
|
|||||||
|
|
||||||
void DML_Old_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats)
|
void DML_Old_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats)
|
||||||
{
|
{
|
||||||
gprintf("Wiiflow DML: Launch game 'sd:/games/%s/game.iso' through boot.bin (old method)\n", GamePath);
|
gprintf("Wiiflow DML: Launch game '%s' through boot.bin (old method)\n", GamePath);
|
||||||
FILE *f;
|
FILE *f;
|
||||||
f = fopen("sd:/games/boot.bin", "wb");
|
f = fopen("sd:/games/boot.bin", "wb");
|
||||||
fwrite(GamePath, 1, strlen(GamePath) + 1, f);
|
fwrite(GamePath, 1, strlen(GamePath) + 1, f);
|
||||||
|
@ -49,7 +49,7 @@ void GC_SetVideoMode(u8 videomode);
|
|||||||
void GC_SetLanguage(u8 lang);
|
void GC_SetLanguage(u8 lang);
|
||||||
int GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir);
|
int GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir);
|
||||||
|
|
||||||
void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc, u8 DMLvideoMode);
|
void DML_New_SetOptions(const char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc, u8 DMLvideoMode);
|
||||||
void DML_Old_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats);
|
void DML_Old_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats);
|
||||||
void DML_New_SetBootDiscOption();
|
void DML_New_SetBootDiscOption();
|
||||||
void DML_New_WriteOptions();
|
void DML_New_WriteOptions();
|
||||||
|
117
source/gc/gcdisc.cpp
Normal file
117
source/gc/gcdisc.cpp
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2012 FIX94
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
****************************************************************************/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "gcdisc.hpp"
|
||||||
|
#include "loader/gc_disc_dump.hpp"
|
||||||
|
#include "mem2.hpp"
|
||||||
|
#include "gecko.h"
|
||||||
|
#include "gc.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void GC_Disc::init(char *path)
|
||||||
|
{
|
||||||
|
opening_bnr = NULL;
|
||||||
|
strncpy(GamePath, path, sizeof(GamePath));
|
||||||
|
FILE *f;
|
||||||
|
if(strcasestr(GamePath, "boot.bin") != NULL)
|
||||||
|
{
|
||||||
|
GameType = TYPE_FST;
|
||||||
|
string fst(GamePath);
|
||||||
|
fst.erase(fst.end() - 8, fst.end());
|
||||||
|
fst.append("fst.bin");
|
||||||
|
f = fopen(fst.c_str(), "rb");
|
||||||
|
fseek(f, 0, SEEK_END);
|
||||||
|
u32 size = ftell(f);
|
||||||
|
fseek(f, 0, SEEK_SET);
|
||||||
|
Read_FST(f, size);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameType = TYPE_ISO;
|
||||||
|
f = fopen(GamePath, "rb");
|
||||||
|
u8 *ReadBuffer = (u8*)MEM2_alloc(0x440);
|
||||||
|
fread(ReadBuffer, 1, 0x440, f);
|
||||||
|
u32 FSTOffset = *(vu32*)(ReadBuffer+0x424);
|
||||||
|
u32 FSTSize = *(vu32*)(ReadBuffer+0x428);
|
||||||
|
MEM2_free(ReadBuffer);
|
||||||
|
fseek(f, FSTOffset, SEEK_SET);
|
||||||
|
Read_FST(f, FSTSize);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GC_Disc::clear()
|
||||||
|
{
|
||||||
|
if(opening_bnr)
|
||||||
|
{
|
||||||
|
MEM2_free(opening_bnr);
|
||||||
|
opening_bnr = NULL;
|
||||||
|
}
|
||||||
|
if(FSTable)
|
||||||
|
{
|
||||||
|
MEM2_free(FSTable);
|
||||||
|
FSTable = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GC_Disc::Read_FST(FILE *f, u32 FST_size)
|
||||||
|
{
|
||||||
|
FSTable = (u8*)MEM2_alloc(FST_size);
|
||||||
|
fread(FSTable, 1, FST_size, f);
|
||||||
|
|
||||||
|
FSTEnt = *(vu32*)(FSTable+0x08);
|
||||||
|
FSTNameOff = (char*)(FSTable + FSTEnt * 0x0C);
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 *GC_Disc::GetGameCubeBanner()
|
||||||
|
{
|
||||||
|
FILE *f = NULL;
|
||||||
|
FST *fst = (FST *)(FSTable);
|
||||||
|
for(u32 i = 1; i < FSTEnt; ++i)
|
||||||
|
{
|
||||||
|
if(fst[i].Type) //Folder
|
||||||
|
continue;
|
||||||
|
else if(strcasecmp(FSTNameOff + fst[i].NameOffset, "opening.bnr") == 0)
|
||||||
|
{
|
||||||
|
if(GameType == TYPE_FST)
|
||||||
|
{
|
||||||
|
string path(GamePath);
|
||||||
|
path.erase(path.end() - 12, path.end());
|
||||||
|
path.append("root/opening.bnr");
|
||||||
|
f = fopen(path.c_str(), "rb");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
f = fopen(GamePath, "rb");
|
||||||
|
fseek(f, fst[i].FileOffset, SEEK_SET);
|
||||||
|
}
|
||||||
|
if(f)
|
||||||
|
{
|
||||||
|
opening_bnr = (u8*)MEM2_alloc(fst[i].FileLength);
|
||||||
|
fread(opening_bnr, 1, fst[i].FileLength, f);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return opening_bnr;
|
||||||
|
}
|
46
source/gc/gcdisc.hpp
Normal file
46
source/gc/gcdisc.hpp
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2012 FIX94
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef _GCDISC_HPP_
|
||||||
|
#define _GCDISC_HPP_
|
||||||
|
|
||||||
|
#include <gccore.h>
|
||||||
|
#include "banner/AnimatedBanner.h"
|
||||||
|
#include "banner/BannerWindow.hpp"
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
TYPE_ISO = 0,
|
||||||
|
TYPE_FST,
|
||||||
|
};
|
||||||
|
|
||||||
|
class GC_Disc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void init(char *path);
|
||||||
|
void clear();
|
||||||
|
u8 *GetGameCubeBanner();
|
||||||
|
private:
|
||||||
|
void Read_FST(FILE *f, u32 FST_size);
|
||||||
|
char GamePath[1024];
|
||||||
|
u8 GameType;
|
||||||
|
u8 *FSTable;
|
||||||
|
u32 FSTEnt;
|
||||||
|
char *FSTNameOff;
|
||||||
|
u8 *opening_bnr;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -77,7 +77,8 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
|||||||
if(!depth_limit)
|
if(!depth_limit)
|
||||||
temp_pathlist.push_back(sfmt("%s/%s", temp_pathlist[0].c_str(), ent->d_name));
|
temp_pathlist.push_back(sfmt("%s/%s", temp_pathlist[0].c_str(), ent->d_name));
|
||||||
else if(dml && !FoundFile && strncasecmp(ent->d_name, "sys", 3) == 0 &&
|
else if(dml && !FoundFile && strncasecmp(ent->d_name, "sys", 3) == 0 &&
|
||||||
fsop_FileExist(fmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name)))
|
fsop_FileExist(fmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name)) &&
|
||||||
|
!fsop_FileExist(fmt("%s/game.iso", temp_pathlist[0].c_str())))
|
||||||
{
|
{
|
||||||
FoundFile = true;
|
FoundFile = true;
|
||||||
//gprintf("Pushing %s to the list.\n", sfmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name).c_str());
|
//gprintf("Pushing %s to the list.\n", sfmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name).c_str());
|
||||||
@ -215,12 +216,12 @@ void CList<dir_discHdr>::GetHeaders(vector<string> pathlist, vector<dir_discHdr>
|
|||||||
|
|
||||||
if(gc_hdr.gc_magic == GC_MAGIC)
|
if(gc_hdr.gc_magic == GC_MAGIC)
|
||||||
{
|
{
|
||||||
|
strcpy(tmp.path, (*itr).c_str());
|
||||||
strncpy(tmp.id, (char*)gc_hdr.id, 6);
|
strncpy(tmp.id, (char*)gc_hdr.id, 6);
|
||||||
(*itr)[(*itr).find_last_of('/')] = 0;
|
(*itr)[(*itr).find_last_of('/')] = 0;
|
||||||
if(strcasecmp(filename, "boot.bin") == 0)
|
if(strcasecmp(filename, "boot.bin") == 0)
|
||||||
(*itr)[(*itr).find_last_of('/')] = 0;
|
(*itr)[(*itr).find_last_of('/')] = 0;
|
||||||
(*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]);
|
(*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]);
|
||||||
strcpy(tmp.path, (*itr).c_str());
|
|
||||||
GTitle = custom_titles.getString("TITLES", tmp.id);
|
GTitle = custom_titles.getString("TITLES", tmp.id);
|
||||||
tmp.casecolor = 0;
|
tmp.casecolor = 0;
|
||||||
int ccolor = custom_titles.getColor("COVERS", tmp.id, tmp.casecolor).intVal();
|
int ccolor = custom_titles.getColor("COVERS", tmp.id, tmp.casecolor).intVal();
|
||||||
|
@ -21,17 +21,16 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* gc_disc.cpp
|
* gc_disc_dump.cpp
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
|
|
||||||
#include "mem2.hpp"
|
#include "mem2.hpp"
|
||||||
#include "gc_disc.hpp"
|
#include "gc_disc_dump.hpp"
|
||||||
#include "DeviceHandler.hpp"
|
#include "DeviceHandler.hpp"
|
||||||
#include "disc.h"
|
#include "disc.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
@ -21,12 +21,12 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* gc_disc.hpp
|
* gc_disc_dump.hpp
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef GC_DISC_H_
|
#ifndef GC_DISC_DUMP_H_
|
||||||
#define GC_DISC_H_
|
#define GC_DISC_DUMP_H_
|
||||||
|
|
||||||
typedef void (*progress_callback_t)(int status,int total,void *user_data);
|
typedef void (*progress_callback_t)(int status,int total,void *user_data);
|
||||||
typedef void (*message_callback_t)(int message, int info, char *cinfo, void *user_data);
|
typedef void (*message_callback_t)(int message, int info, char *cinfo, void *user_data);
|
||||||
@ -39,6 +39,33 @@ enum spcall
|
|||||||
GB,
|
GB,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FST
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
u32 Type :8;
|
||||||
|
u32 NameOffset :24;
|
||||||
|
};
|
||||||
|
u32 TypeName;
|
||||||
|
};
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
u32 FileOffset;
|
||||||
|
u32 FileLength;
|
||||||
|
};
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
u32 ParentOffset;
|
||||||
|
u32 NextOffset;
|
||||||
|
};
|
||||||
|
u32 entry[2];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
class GCDump
|
class GCDump
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -100,32 +127,6 @@ private:
|
|||||||
u32 MultiGameDump;
|
u32 MultiGameDump;
|
||||||
u32 Gamesize[10];
|
u32 Gamesize[10];
|
||||||
u64 NextOffset;
|
u64 NextOffset;
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 Type :8;
|
|
||||||
u32 NameOffset :24;
|
|
||||||
};
|
|
||||||
u32 TypeName;
|
|
||||||
};
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 FileOffset;
|
|
||||||
u32 FileLength;
|
|
||||||
};
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 ParentOffset;
|
|
||||||
u32 NextOffset;
|
|
||||||
};
|
|
||||||
u32 entry[2];
|
|
||||||
};
|
|
||||||
} FST;
|
|
||||||
s32 __DiscReadRaw(void *outbuf, u64 offset, u32 length);
|
s32 __DiscReadRaw(void *outbuf, u64 offset, u32 length);
|
||||||
s32 __DiscWrite(char * path, u64 offset, u32 length, u8 *ReadBuffer);
|
s32 __DiscWrite(char * path, u64 offset, u32 length, u8 *ReadBuffer);
|
||||||
s32 __DiscWriteFile(FILE *f, u64 offset, u32 length, u8 *ReadBuffer);
|
s32 __DiscWriteFile(FILE *f, u64 offset, u32 length, u8 *ReadBuffer);
|
@ -22,7 +22,7 @@
|
|||||||
#include "gct.h"
|
#include "gct.h"
|
||||||
#include "DeviceHandler.hpp"
|
#include "DeviceHandler.hpp"
|
||||||
#include "musicplayer.h"
|
#include "musicplayer.h"
|
||||||
#include "loader/gc_disc.hpp"
|
#include "loader/gc_disc_dump.hpp"
|
||||||
|
|
||||||
//Also in wbfs.h
|
//Also in wbfs.h
|
||||||
#define PART_FS_WBFS 0
|
#define PART_FS_WBFS 0
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "gc/gc.h"
|
#include "gc/gc.h"
|
||||||
#include "gc/fileOps.h"
|
#include "gc/fileOps.h"
|
||||||
|
#include "gc/gcdisc.hpp"
|
||||||
#include "Gekko.h"
|
#include "Gekko.h"
|
||||||
|
|
||||||
extern const u8 btngamecfg_png[];
|
extern const u8 btngamecfg_png[];
|
||||||
@ -807,7 +808,17 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool DML)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(m_new_dml)
|
if(m_new_dml)
|
||||||
DML_New_SetOptions(hdr->path, CheatPath, NewCheatPath, cheats, DML_debug, NMM, nodisc, DMLvideoMode);
|
{
|
||||||
|
string path;
|
||||||
|
if(strcasestr(hdr->path, "boot.bin") != NULL)
|
||||||
|
{
|
||||||
|
path = &hdr->path[string(hdr->path).find_first_of(":/")+1];
|
||||||
|
path.erase(path.end() - 12, path.end());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
path = &hdr->path[string(hdr->path).find_first_of(":/")+1];
|
||||||
|
DML_New_SetOptions(path.c_str(), CheatPath, NewCheatPath, cheats, DML_debug, NMM, nodisc, DMLvideoMode);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
DML_Old_SetOptions(hdr->path, CheatPath, NewCheatPath, cheats);
|
DML_Old_SetOptions(hdr->path, CheatPath, NewCheatPath, cheats);
|
||||||
|
|
||||||
@ -1524,6 +1535,9 @@ void CMenu::_gameSoundThread(CMenu *m)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern SmartBuf m_wbf1_font;
|
||||||
|
extern SmartBuf m_wbf2_font;
|
||||||
|
|
||||||
bool custom = false;
|
bool custom = false;
|
||||||
u8 *custom_bnr_file = NULL;
|
u8 *custom_bnr_file = NULL;
|
||||||
u32 custom_bnr_size = 0;
|
u32 custom_bnr_size = 0;
|
||||||
@ -1556,9 +1570,14 @@ void CMenu::_gameSoundThread(CMenu *m)
|
|||||||
fp = fopen(custom_banner, "rb");
|
fp = fopen(custom_banner, "rb");
|
||||||
if(!fp && m->m_cf.getHdr()->type == TYPE_GC_GAME)
|
if(!fp && m->m_cf.getHdr()->type == TYPE_GC_GAME)
|
||||||
{
|
{
|
||||||
m_banner->DeleteBanner();
|
GC_Disc disc;
|
||||||
|
disc.init(m->m_cf.getHdr()->path);
|
||||||
|
u8 *opening_bnr = disc.GetGameCubeBanner();
|
||||||
|
if(opening_bnr != NULL)
|
||||||
|
m_banner->CreateGCBanner(opening_bnr, &m->m_vid, m_wbf1_font.get(), m_wbf2_font.get(), m->m_cf.getHdr()->title);
|
||||||
m->m_gameSound.Load(gc_ogg, gc_ogg_size, false);
|
m->m_gameSound.Load(gc_ogg, gc_ogg_size, false);
|
||||||
m->m_gamesound_changed = true;
|
m->m_gamesound_changed = true;
|
||||||
|
disc.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1599,9 +1618,6 @@ void CMenu::_gameSoundThread(CMenu *m)
|
|||||||
}
|
}
|
||||||
_extractBannerTitle(banner, GetLanguage(m->m_loc.getString(m->m_curLanguage, "gametdb_code", "EN").c_str()));
|
_extractBannerTitle(banner, GetLanguage(m->m_loc.getString(m->m_curLanguage, "gametdb_code", "EN").c_str()));
|
||||||
|
|
||||||
extern SmartBuf m_wbf1_font;
|
|
||||||
extern SmartBuf m_wbf2_font;
|
|
||||||
|
|
||||||
const u8 *soundBin = banner->GetFile((char *) "sound.bin", &sndSize);
|
const u8 *soundBin = banner->GetFile((char *) "sound.bin", &sndSize);
|
||||||
m_banner->LoadBanner(banner, &m->m_vid, m_wbf1_font.get(), m_wbf2_font.get());
|
m_banner->LoadBanner(banner, &m->m_vid, m_wbf1_font.get(), m_wbf2_font.get());
|
||||||
delete banner;
|
delete banner;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "menu.hpp"
|
#include "menu.hpp"
|
||||||
#include "loader/wbfs.h"
|
#include "loader/wbfs.h"
|
||||||
#include "lockMutex.hpp"
|
#include "lockMutex.hpp"
|
||||||
#include "loader/gc_disc.hpp"
|
#include "loader/gc_disc_dump.hpp"
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "fileOps.h"
|
#include "fileOps.h"
|
||||||
#include "music/SoundHandler.hpp"
|
#include "music/SoundHandler.hpp"
|
||||||
|
Loading…
Reference in New Issue
Block a user