2008-09-18 03:15:49 +00:00
|
|
|
#include "N64 Types.h"
|
|
|
|
|
2010-05-22 04:47:15 +00:00
|
|
|
class CN64Rom
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
//constant values
|
|
|
|
enum { ReadFromRomSection = 0x400000 };
|
|
|
|
|
|
|
|
//class variables
|
|
|
|
HANDLE m_hRomFile, m_hRomFileMapping;
|
|
|
|
BYTE * m_ROMImage;
|
|
|
|
DWORD m_RomFileSize;
|
|
|
|
Country m_Country;
|
|
|
|
CICChip m_CicChip;
|
|
|
|
LanguageStringID m_ErrorMsg;
|
|
|
|
stdstr m_RomName, m_FileName, m_MD5, m_RomIdent;
|
|
|
|
|
|
|
|
bool AllocateAndLoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly );
|
|
|
|
bool AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeOnly );
|
|
|
|
void ByteSwapRom ( void );
|
|
|
|
void SetError ( LanguageStringID ErrorMsg );
|
|
|
|
static void __stdcall NotificationCB ( LPCSTR Status, CN64Rom * _this );
|
|
|
|
void CalculateCicChip ( void );
|
|
|
|
|
|
|
|
public:
|
2010-05-22 04:47:15 +00:00
|
|
|
CN64Rom ( void );
|
2008-09-18 03:15:49 +00:00
|
|
|
~CN64Rom ( void );
|
|
|
|
bool LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly = false );
|
2012-09-26 14:42:28 +00:00
|
|
|
static bool IsValidRomImage( BYTE Test[4] );
|
2008-09-18 03:15:49 +00:00
|
|
|
void SaveRomSettingID ( void );
|
2008-11-14 20:51:06 +00:00
|
|
|
void ClearRomSettingID ( void );
|
2008-09-18 03:15:49 +00:00
|
|
|
CICChip CicChipID ( void );
|
|
|
|
BYTE * GetRomAddress ( void ) { return m_ROMImage; }
|
|
|
|
DWORD GetRomSize ( void ) { return m_RomFileSize; }
|
|
|
|
stdstr GetRomMD5 ( void ) { return m_MD5; }
|
|
|
|
stdstr GetRomName ( void ) { return m_RomName; }
|
|
|
|
stdstr GetFileName ( void ) { return m_FileName; }
|
|
|
|
Country GetCountry ( void ) { return m_Country; }
|
|
|
|
void UnallocateRomImage ( void );
|
|
|
|
|
|
|
|
//Get a message id for the reason that you failed to load the rom
|
|
|
|
LanguageStringID GetError ( void ) { return m_ErrorMsg; }
|
|
|
|
};
|