2016-01-28 20:47:16 -05:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2016-12-11 10:56:23 -05:00
|
|
|
#include <cmath>
|
2018-02-16 20:33:48 -05:00
|
|
|
#include "Types.h"
|
2018-07-07 14:52:51 -04:00
|
|
|
#include "NESHeader.h"
|
2016-01-28 20:47:16 -05:00
|
|
|
|
|
|
|
enum class RomHeaderVersion
|
|
|
|
{
|
|
|
|
iNes = 0,
|
|
|
|
Nes2_0 = 1,
|
|
|
|
OldiNes = 2
|
|
|
|
};
|
|
|
|
|
2016-06-25 20:46:54 -04:00
|
|
|
struct NsfHeader
|
|
|
|
{
|
|
|
|
char Header[5];
|
|
|
|
uint8_t Version;
|
|
|
|
uint8_t TotalSongs;
|
|
|
|
uint8_t StartingSong;
|
|
|
|
uint16_t LoadAddress;
|
|
|
|
uint16_t InitAddress;
|
|
|
|
uint16_t PlayAddress;
|
|
|
|
char SongName[256];
|
|
|
|
char ArtistName[256];
|
|
|
|
char CopyrightHolder[256];
|
|
|
|
uint16_t PlaySpeedNtsc;
|
|
|
|
uint8_t BankSetup[8];
|
|
|
|
uint16_t PlaySpeedPal;
|
|
|
|
uint8_t Flags;
|
|
|
|
uint8_t SoundChips;
|
|
|
|
uint8_t Padding[4];
|
|
|
|
|
|
|
|
//NSFe extensions
|
|
|
|
char RipperName[256];
|
|
|
|
char TrackName[20000];
|
|
|
|
int32_t TrackLength[256];
|
|
|
|
int32_t TrackFade[256];
|
|
|
|
};
|
|
|
|
|
2016-07-26 19:19:28 -04:00
|
|
|
struct GameInfo
|
|
|
|
{
|
|
|
|
uint32_t Crc;
|
|
|
|
string System;
|
|
|
|
string Board;
|
|
|
|
string Pcb;
|
|
|
|
string Chip;
|
2017-03-18 19:11:26 -04:00
|
|
|
uint16_t MapperID;
|
2016-07-26 19:19:28 -04:00
|
|
|
uint32_t PrgRomSize;
|
|
|
|
uint32_t ChrRomSize;
|
|
|
|
uint32_t ChrRamSize;
|
|
|
|
uint32_t WorkRamSize;
|
|
|
|
uint32_t SaveRamSize;
|
|
|
|
bool HasBattery;
|
|
|
|
string Mirroring;
|
2020-04-18 13:40:32 -04:00
|
|
|
GameInputType InputType;
|
2017-04-01 15:47:43 -04:00
|
|
|
string BusConflicts;
|
2017-05-18 22:43:21 -04:00
|
|
|
string SubmapperID;
|
2020-04-18 13:40:32 -04:00
|
|
|
VsSystemType VsType;
|
|
|
|
PpuModel VsPpuModel;
|
2016-07-26 19:19:28 -04:00
|
|
|
};
|
|
|
|
|
2018-07-07 14:52:51 -04:00
|
|
|
struct RomInfo
|
2016-06-18 18:16:25 -04:00
|
|
|
{
|
|
|
|
string RomName;
|
|
|
|
string Filename;
|
2017-03-04 22:24:41 -05:00
|
|
|
RomFormat Format;
|
2016-06-18 18:16:25 -04:00
|
|
|
|
2018-07-07 14:52:51 -04:00
|
|
|
bool IsNes20Header = false;
|
2018-07-13 22:19:26 -04:00
|
|
|
bool IsInDatabase = false;
|
2018-08-13 18:35:56 -04:00
|
|
|
bool IsHeaderlessRom = false;
|
2018-07-07 14:52:51 -04:00
|
|
|
|
2018-08-20 20:12:34 -04:00
|
|
|
uint32_t FilePrgOffset = 0;
|
|
|
|
|
2016-06-25 20:46:54 -04:00
|
|
|
uint16_t MapperID = 0;
|
2016-06-18 18:16:25 -04:00
|
|
|
uint8_t SubMapperID = 0;
|
2018-07-07 14:52:51 -04:00
|
|
|
|
2016-06-18 18:16:25 -04:00
|
|
|
GameSystem System = GameSystem::Unknown;
|
2018-07-07 17:30:13 -04:00
|
|
|
VsSystemType VsType = VsSystemType::Default;
|
2019-01-19 13:27:23 -05:00
|
|
|
GameInputType InputType = GameInputType::Unspecified;
|
2018-07-07 17:30:13 -04:00
|
|
|
PpuModel VsPpuModel = PpuModel::Ppu2C02;
|
2018-07-07 14:52:51 -04:00
|
|
|
|
|
|
|
bool HasChrRam = false;
|
2016-06-18 18:16:25 -04:00
|
|
|
bool HasBattery = false;
|
|
|
|
bool HasTrainer = false;
|
2016-12-11 10:56:23 -05:00
|
|
|
MirroringType Mirroring = MirroringType::Horizontal;
|
2017-04-01 15:47:43 -04:00
|
|
|
BusConflictType BusConflicts = BusConflictType::Default;
|
2018-07-07 14:52:51 -04:00
|
|
|
|
|
|
|
HashInfo Hash;
|
|
|
|
|
|
|
|
NESHeader NesHeader;
|
|
|
|
NsfHeader NsfInfo;
|
|
|
|
GameInfo DatabaseInfo;
|
|
|
|
};
|
|
|
|
|
2019-12-31 20:23:26 -05:00
|
|
|
struct PageInfo
|
|
|
|
{
|
2020-01-01 18:47:13 -05:00
|
|
|
uint32_t LeadInOffset;
|
2019-12-31 20:23:26 -05:00
|
|
|
uint32_t AudioOffset;
|
|
|
|
vector<uint8_t> Data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StudyBoxData
|
|
|
|
{
|
|
|
|
string FileName;
|
|
|
|
vector<uint8_t> AudioFile;
|
|
|
|
vector<PageInfo> Pages;
|
|
|
|
};
|
|
|
|
|
2018-07-07 14:52:51 -04:00
|
|
|
struct RomData
|
|
|
|
{
|
|
|
|
RomInfo Info;
|
|
|
|
|
2016-06-18 18:16:25 -04:00
|
|
|
int32_t ChrRamSize = -1;
|
2016-07-29 17:28:01 -04:00
|
|
|
int32_t SaveChrRamSize = -1;
|
2016-07-26 19:19:28 -04:00
|
|
|
int32_t SaveRamSize = -1;
|
|
|
|
int32_t WorkRamSize = -1;
|
2018-07-07 14:52:51 -04:00
|
|
|
|
2016-06-18 18:16:25 -04:00
|
|
|
vector<uint8_t> PrgRom;
|
|
|
|
vector<uint8_t> ChrRom;
|
|
|
|
vector<uint8_t> TrainerData;
|
|
|
|
vector<vector<uint8_t>> FdsDiskData;
|
2017-05-04 22:55:46 -04:00
|
|
|
vector<vector<uint8_t>> FdsDiskHeaders;
|
2019-12-31 20:23:26 -05:00
|
|
|
StudyBoxData StudyBox;
|
2016-06-18 18:16:25 -04:00
|
|
|
|
|
|
|
vector<uint8_t> RawData;
|
|
|
|
|
|
|
|
bool Error = false;
|
2018-07-02 14:49:19 -04:00
|
|
|
bool BiosMissing = false;
|
2018-07-07 14:52:51 -04:00
|
|
|
};
|