2016-06-15 21:59:34 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include <unordered_map>
|
2016-07-26 19:19:28 -04:00
|
|
|
#include "RomData.h"
|
2016-06-15 21:59:34 -04:00
|
|
|
|
|
|
|
class GameDatabase
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static std::unordered_map<uint32_t, GameInfo> _gameDatabase;
|
2018-07-13 22:19:26 -04:00
|
|
|
static bool _enabled;
|
2016-06-15 21:59:34 -04:00
|
|
|
|
|
|
|
template<typename T> static T ToInt(string value);
|
|
|
|
|
2017-04-01 15:47:43 -04:00
|
|
|
static BusConflictType GetBusConflictType(string busConflictSetting);
|
2016-06-15 21:59:34 -04:00
|
|
|
static GameSystem GetGameSystem(string system);
|
|
|
|
static uint8_t GetSubMapper(GameInfo &info);
|
|
|
|
|
|
|
|
static void InitDatabase();
|
2016-07-26 19:19:28 -04:00
|
|
|
static void UpdateRomData(GameInfo &info, RomData &romData);
|
2018-12-31 09:40:38 -05:00
|
|
|
static void LoadGameDb(vector<string> data);
|
2016-06-15 21:59:34 -04:00
|
|
|
|
|
|
|
public:
|
2018-12-31 09:40:38 -05:00
|
|
|
static void LoadGameDb(std::istream & db);
|
2018-07-13 22:19:26 -04:00
|
|
|
|
|
|
|
static void SetGameDatabaseState(bool enabled);
|
|
|
|
static bool IsEnabled();
|
2018-01-04 19:03:47 -05:00
|
|
|
|
2018-04-14 22:31:19 -04:00
|
|
|
static void SetGameInfo(uint32_t romCrc, RomData &romData, bool updateRomData, bool forHeaderlessRom);
|
2017-03-18 19:11:26 -04:00
|
|
|
static bool GetiNesHeader(uint32_t romCrc, NESHeader &nesHeader);
|
2017-05-25 20:04:49 -04:00
|
|
|
static bool GetDbRomSize(uint32_t romCrc, uint32_t &prgSize, uint32_t &chrSize);
|
2016-06-15 21:59:34 -04:00
|
|
|
};
|