2012-02-09 22:18:16 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright (C) 2011 Dimok
|
|
|
|
*
|
|
|
|
* 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 _GCGAMES_H_
|
|
|
|
#define _GCGAMES_H_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <gccore.h>
|
|
|
|
#include "usbloader/disc.h"
|
|
|
|
#include "settings/CSettings.h"
|
|
|
|
|
2015-04-04 18:04:30 +02:00
|
|
|
int nintendontBuildDate(const char *NIN_loader_path, char* NINBuildDate);
|
|
|
|
int nintendontVersion(const char *NIN_loader_path, char* NINVersion, int len);
|
2012-02-09 22:18:16 +01:00
|
|
|
|
|
|
|
class GCGames
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static const u32 MAGIC = 0xC2339F3D;
|
|
|
|
|
|
|
|
static GCGames *Instance(void) { if(!instance) instance = new GCGames(); return instance; }
|
|
|
|
static void DestroyInstance(void) { delete instance; instance = NULL; }
|
|
|
|
|
|
|
|
static u8 *GetOpeningBnr(const char *gameID);
|
|
|
|
|
2012-05-06 12:59:58 +02:00
|
|
|
u32 LoadAllGames(void);
|
|
|
|
|
2021-08-01 19:00:15 +02:00
|
|
|
void LoadGameList(const std::string &path, std::vector<struct discHdr> &headerList, std::vector<std::string> &pathList);
|
2012-05-06 12:59:58 +02:00
|
|
|
|
2012-02-09 22:18:16 +01:00
|
|
|
bool RemoveGame(const char *gameID);
|
2012-05-06 12:59:58 +02:00
|
|
|
bool RemoveSDGame(const char *gameID);
|
2012-02-09 22:18:16 +01:00
|
|
|
float GetGameSize(const char *gameID);
|
|
|
|
|
|
|
|
const char *GetPath(const char *gameID) const;
|
|
|
|
|
2021-08-01 19:00:15 +02:00
|
|
|
std::vector<struct discHdr> & GetHeaders(void)
|
2012-02-09 22:18:16 +01:00
|
|
|
{
|
2014-04-25 17:34:53 +02:00
|
|
|
LoadAllGames();
|
2012-02-09 22:18:16 +01:00
|
|
|
|
|
|
|
return HeaderList;
|
|
|
|
}
|
2012-05-06 12:59:58 +02:00
|
|
|
|
2021-08-01 19:00:15 +02:00
|
|
|
std::vector<struct discHdr> & GetSDHeaders(void) {
|
2012-05-06 12:59:58 +02:00
|
|
|
return sdGCList;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CopyUSB2SD(const struct discHdr *header);
|
2012-12-09 21:31:55 +01:00
|
|
|
bool IsInstalled(const char *gameID, u8 disc_number) const;
|
2012-02-09 22:18:16 +01:00
|
|
|
private:
|
2012-05-06 12:59:58 +02:00
|
|
|
|
2012-02-09 22:18:16 +01:00
|
|
|
static GCGames *instance;
|
|
|
|
|
2021-08-01 19:00:15 +02:00
|
|
|
std::vector<std::string> PathList;
|
|
|
|
std::vector<struct discHdr> HeaderList;
|
|
|
|
std::vector<struct discHdr> sdGCList;
|
|
|
|
std::vector<std::string> sdGCPathList;
|
2012-02-09 22:18:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|