2016-04-14 09:35:08 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
2016-04-16 09:55:32 +00:00
|
|
|
#include <Common/path.h>
|
|
|
|
#include <Common/IniFileClass.h>
|
2018-11-19 10:46:58 +00:00
|
|
|
#include <Common/StdString.h>
|
2016-04-16 09:55:32 +00:00
|
|
|
#include <Common/md5.h>
|
2016-04-18 06:57:49 +00:00
|
|
|
#include <Common/Thread.h>
|
2016-04-16 09:55:32 +00:00
|
|
|
#include <Project64-core/N64System/N64Types.h>
|
2016-04-14 09:35:08 +00:00
|
|
|
|
|
|
|
class CRomList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum FILE_FORMAT
|
|
|
|
{
|
|
|
|
Format_Uncompressed,
|
|
|
|
Format_Zip,
|
|
|
|
Format_7zip,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ROM_INFO
|
|
|
|
{
|
2020-05-12 12:19:05 +00:00
|
|
|
char szFullFileName[300];
|
2016-04-14 09:35:08 +00:00
|
|
|
FILE_FORMAT FileFormat;
|
2020-05-12 12:19:05 +00:00
|
|
|
char Status[60];
|
|
|
|
char FileName[200];
|
|
|
|
char InternalName[22];
|
|
|
|
char GoodName[200];
|
|
|
|
char Name[200];
|
|
|
|
char CartID[3];
|
|
|
|
char PluginNotes[250];
|
|
|
|
char CoreNotes[250];
|
|
|
|
char UserNotes[250];
|
|
|
|
char Developer[30];
|
|
|
|
char ReleaseDate[30];
|
|
|
|
char Genre[15];
|
|
|
|
int32_t Players;
|
|
|
|
uint32_t TextColor;
|
|
|
|
int32_t SelColor;
|
|
|
|
uint32_t SelTextColor;
|
|
|
|
int32_t RomSize;
|
|
|
|
uint8_t Manufacturer;
|
|
|
|
uint8_t Country;
|
|
|
|
uint32_t CRC1;
|
|
|
|
uint32_t CRC2;
|
|
|
|
CICChip CicChip;
|
|
|
|
char ForceFeedback[15];
|
2016-04-14 09:35:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
CRomList();
|
|
|
|
virtual ~CRomList();
|
|
|
|
|
2016-04-15 22:56:10 +00:00
|
|
|
void RefreshRomList(void);
|
2016-04-14 09:35:08 +00:00
|
|
|
void LoadRomList(void);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
typedef std::vector<ROM_INFO> ROMINFO_LIST;
|
2016-04-15 22:56:10 +00:00
|
|
|
|
2016-04-14 09:35:08 +00:00
|
|
|
virtual void RomListReset(void) {}
|
|
|
|
virtual void RomAddedToList(int32_t /*ListPos*/) {}
|
|
|
|
virtual void RomListLoaded(void) {}
|
|
|
|
|
2016-04-15 20:58:31 +00:00
|
|
|
MD5 RomListHash(strlist & FileList);
|
2016-04-15 22:56:10 +00:00
|
|
|
void AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File);
|
2016-04-14 09:35:08 +00:00
|
|
|
ROMINFO_LIST m_RomInfo;
|
|
|
|
bool m_StopRefresh;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void AddRomToList(const char * RomLocation);
|
2016-04-15 22:56:10 +00:00
|
|
|
void FillRomList(strlist & FileList, const char * Directory);
|
2016-04-14 09:35:08 +00:00
|
|
|
bool FillRomInfo(ROM_INFO * pRomInfo);
|
|
|
|
void FillRomExtensionInfo(ROM_INFO * pRomInfo);
|
|
|
|
bool LoadDataFromRomFile(const char * FileName, uint8_t * Data, int32_t DataLen, int32_t * RomSize, FILE_FORMAT & FileFormat);
|
2016-04-15 22:56:10 +00:00
|
|
|
void SaveRomList(strlist & FileList);
|
|
|
|
void RefreshRomListThread(void);
|
2016-04-14 09:35:08 +00:00
|
|
|
|
2016-04-15 22:56:10 +00:00
|
|
|
static void RefreshSettings(CRomList *);
|
2016-04-14 09:35:08 +00:00
|
|
|
static void NotificationCB(const char * Status, CRomList * _this);
|
2016-04-14 22:07:34 +00:00
|
|
|
static void RefreshRomListStatic(CRomList * _this);
|
2019-08-12 15:50:04 +00:00
|
|
|
static void ByteSwapRomData(uint8_t * Data, int32_t DataLen);
|
2016-04-14 09:35:08 +00:00
|
|
|
|
2016-04-15 22:56:10 +00:00
|
|
|
CPath m_GameDir;
|
2016-04-14 09:35:08 +00:00
|
|
|
CIniFile * m_NotesIniFile;
|
|
|
|
CIniFile * m_ExtIniFile;
|
|
|
|
CIniFile * m_RomIniFile;
|
2016-04-14 22:29:45 +00:00
|
|
|
#ifdef _WIN32
|
2016-04-14 09:35:08 +00:00
|
|
|
CIniFile * m_ZipIniFile;
|
2016-04-14 22:29:45 +00:00
|
|
|
#endif
|
2016-04-18 06:57:49 +00:00
|
|
|
CThread m_RefreshThread;
|
2019-08-12 15:50:04 +00:00
|
|
|
|
|
|
|
#define DISKSIZE_MAME 0x0435B0C0
|
|
|
|
#define DISKSIZE_SDK 0x03DEC800
|
2016-04-14 09:35:08 +00:00
|
|
|
};
|