mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-05 02:55:07 +01:00
2570d6dae8
*Changed boot process to wait for USB in GUI mode. *Changed headless ID stuff (actually was in last rev) *Added a GameTitles class for WiiTDB titles and fixed parental control (probably crashed before) *Removed cfg.c completely now. Nothing left in it. *Moved per game lock feature from game statistics to the individual game settings. It is not a game statistic ;).
67 lines
1.3 KiB
C++
67 lines
1.3 KiB
C++
#include <string.h>
|
|
#include "GameTitles.h"
|
|
|
|
CGameTitles GameTitles;
|
|
|
|
void CGameTitles::SetGameTitle(const char * id, const char * title)
|
|
{
|
|
if(!id || !title)
|
|
return;
|
|
|
|
for(u32 i = 0; i < TitleList.size(); ++i)
|
|
{
|
|
if(strncasecmp(id, TitleList[i].GameID, 6) == 0)
|
|
{
|
|
TitleList[i].Title = title;
|
|
return;
|
|
}
|
|
}
|
|
|
|
GameTitle newTitle;
|
|
newTitle.Title = title;
|
|
|
|
//! Just in case a 0 termination is missing
|
|
int n;
|
|
for(n = 0; n < 6; ++n)
|
|
newTitle.GameID[n] = id[n];
|
|
|
|
newTitle.GameID[n] = '\0';
|
|
|
|
TitleList.push_back(newTitle);
|
|
}
|
|
|
|
const char * CGameTitles::GetTitle(const char * id)
|
|
{
|
|
if(!id)
|
|
return NULL;
|
|
|
|
for(u32 i = 0; i < TitleList.size(); ++i)
|
|
{
|
|
if(strncasecmp(id, TitleList[i].GameID, 6) == 0)
|
|
return TitleList[i].Title.c_str();
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
const char * CGameTitles::GetTitle(const struct discHdr *header)
|
|
{
|
|
if(!header)
|
|
return NULL;
|
|
|
|
for(u32 i = 0; i < TitleList.size(); ++i)
|
|
{
|
|
if(strncasecmp((const char *) header->id, TitleList[i].GameID, 6) == 0)
|
|
return TitleList[i].Title.c_str();
|
|
}
|
|
|
|
return header->title;
|
|
}
|
|
|
|
void CGameTitles::SetDefault()
|
|
{
|
|
TitleList.clear();
|
|
//! Free vector memory
|
|
std::vector<GameTitle>().swap(TitleList);
|
|
}
|