2009-07-17 19:27:04 +02:00
|
|
|
/* FCE Ultra - NES/Famicom Emulator
|
|
|
|
*
|
|
|
|
* Copyright notice for this file:
|
|
|
|
* Copyright (C) 1998 Bero
|
|
|
|
* Copyright (C) 2002 Xodnizel
|
|
|
|
*
|
|
|
|
* 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 2 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, write to the Free Software
|
2012-12-14 18:18:20 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2009-07-17 19:27:04 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INES_H_
|
|
|
|
#define _INES_H_
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2012-12-14 18:18:20 +01:00
|
|
|
#include <map>
|
2009-07-17 19:27:04 +02:00
|
|
|
#ifdef INESPRIV
|
|
|
|
|
|
|
|
/* This order is necessary */
|
2012-12-14 18:43:51 +01:00
|
|
|
#define WRAM (GameMemBlock)
|
|
|
|
#define sizeofWRAM 8192
|
2009-07-17 19:27:04 +02:00
|
|
|
|
|
|
|
/* for the MMC5 code to work properly. It might be fixed later... */
|
2012-12-14 18:43:51 +01:00
|
|
|
#define CHRRAM (GameMemBlock + sizeofWRAM)
|
|
|
|
#define sizeofCHRRAM 8192
|
2009-07-17 19:27:04 +02:00
|
|
|
|
2012-12-14 18:43:51 +01:00
|
|
|
#define ExtraNTARAM (GameMemBlock + sizeofWRAM + sizeofCHRRAM)
|
|
|
|
#define sizeofExtraNTARAM 2048
|
2009-07-17 19:27:04 +02:00
|
|
|
|
|
|
|
#else
|
|
|
|
#endif
|
|
|
|
|
2012-12-14 18:18:20 +01:00
|
|
|
struct TMasterRomInfo
|
|
|
|
{
|
|
|
|
uint64 md5lower;
|
|
|
|
const char* params;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMasterRomInfoParams : public std::map<std::string,std::string>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool ContainsKey(const std::string& key) { return find(key) != end(); }
|
|
|
|
};
|
|
|
|
|
2009-07-17 19:27:04 +02:00
|
|
|
//mbg merge 6/29/06
|
|
|
|
extern uint8 *ROM;
|
|
|
|
extern uint8 *VROM;
|
|
|
|
extern uint32 VROM_size;
|
|
|
|
extern uint32 ROM_size;
|
|
|
|
extern int iNesSave(); //bbit Edited: line added
|
2009-07-18 00:54:58 +02:00
|
|
|
extern int iNesSaveAs(char* name);
|
2009-07-17 19:27:04 +02:00
|
|
|
extern char LoadedRomFName[2048]; //bbit Edited: line added
|
2012-12-14 18:18:20 +01:00
|
|
|
extern const TMasterRomInfo* MasterRomInfo;
|
|
|
|
extern TMasterRomInfoParams MasterRomInfoParams;
|
2009-07-17 19:27:04 +02:00
|
|
|
|
|
|
|
//mbg merge 7/19/06 changed to c++ decl format
|
|
|
|
struct iNES_HEADER {
|
2012-12-14 18:43:51 +01:00
|
|
|
char ID[4]; /*NES^Z*/
|
|
|
|
uint8 ROM_size;
|
|
|
|
uint8 VROM_size;
|
|
|
|
uint8 ROM_type;
|
|
|
|
uint8 ROM_type2;
|
|
|
|
uint8 reserve[8];
|
2009-07-17 19:27:04 +02:00
|
|
|
|
|
|
|
void cleanup()
|
|
|
|
{
|
|
|
|
if(!memcmp((char *)(this)+0x7,"DiskDude",8))
|
|
|
|
{
|
|
|
|
memset((char *)(this)+0x7,0,0x9);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!memcmp((char *)(this)+0x7,"demiforce",9))
|
|
|
|
{
|
|
|
|
memset((char *)(this)+0x7,0,0x9);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!memcmp((char *)(this)+0xA,"Ni03",4))
|
|
|
|
{
|
|
|
|
if(!memcmp((char *)(this)+0x7,"Dis",3))
|
|
|
|
memset((char *)(this)+0x7,0,0x9);
|
|
|
|
else
|
|
|
|
memset((char *)(this)+0xA,0,0x6);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2009-10-07 06:40:55 +02:00
|
|
|
extern struct iNES_HEADER head; //for mappers usage
|
2009-07-17 19:27:04 +02:00
|
|
|
|
|
|
|
void NSFVRC6_Init(void);
|
|
|
|
void NSFMMC5_Init(void);
|
|
|
|
void NSFAY_Init(void);
|
|
|
|
void NSFN106_Init(void);
|
|
|
|
void NSFVRC7_Init(void);
|
|
|
|
|
|
|
|
void Mapper1_Init(CartInfo *);
|
|
|
|
void Mapper4_Init(CartInfo *);
|
|
|
|
void Mapper5_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper6_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper8_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper9_Init(CartInfo *);
|
|
|
|
void Mapper10_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper11_Init(CartInfo *);
|
|
|
|
void Mapper12_Init(CartInfo *);
|
|
|
|
void Mapper15_Init(CartInfo *);
|
|
|
|
void Mapper16_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper17_Init(CartInfo *);
|
|
|
|
void Mapper18_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper19_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper21_Init(CartInfo *);
|
|
|
|
void Mapper22_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper23_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper24_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper25_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper26_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper32_Init(CartInfo *);
|
|
|
|
void Mapper33_Init(CartInfo *);
|
|
|
|
void Mapper34_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper36_Init(CartInfo *);
|
|
|
|
void Mapper37_Init(CartInfo *);
|
|
|
|
void Mapper38_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper40_Init(CartInfo *);
|
|
|
|
void Mapper41_Init(CartInfo *);
|
|
|
|
void Mapper42_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper43_Init(CartInfo *);
|
|
|
|
void Mapper44_Init(CartInfo *);
|
|
|
|
void Mapper45_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper46_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper47_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper48_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper49_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper50_Init(CartInfo *);
|
|
|
|
void Mapper51_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper52_Init(CartInfo *);
|
|
|
|
void Mapper57_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper59_Init(CartInfo *);
|
|
|
|
void Mapper61_Init(CartInfo *);
|
|
|
|
void Mapper62_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper64_Init(CartInfo *);
|
|
|
|
void Mapper65_Init(CartInfo *);
|
|
|
|
void Mapper67_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper68_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper69_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper70_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper71_Init(CartInfo *);
|
|
|
|
void Mapper72_Init(CartInfo *);
|
|
|
|
void Mapper73_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper74_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper75_Init(CartInfo *);
|
|
|
|
void Mapper76_Init(CartInfo *);
|
|
|
|
void Mapper77_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper78_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper79_Init(CartInfo *);
|
|
|
|
void Mapper80_Init(CartInfo *);
|
|
|
|
void Mapper82_Init(CartInfo *);
|
|
|
|
void Mapper83_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper85_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper86_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper87_Init(CartInfo *);
|
|
|
|
void Mapper88_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper89_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper90_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper91_Init(CartInfo *);
|
|
|
|
void Mapper92_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper93_Init(CartInfo *);
|
|
|
|
void Mapper94_Init(CartInfo *);
|
|
|
|
void Mapper95_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper96_Init(CartInfo *);
|
|
|
|
void Mapper97_Init(CartInfo *);
|
|
|
|
void Mapper99_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper101_Init(CartInfo *);
|
|
|
|
void Mapper103_Init(CartInfo *);
|
|
|
|
void Mapper105_Init(CartInfo *);
|
|
|
|
void Mapper106_Init(CartInfo *);
|
|
|
|
void Mapper107_Init(CartInfo *);
|
|
|
|
void Mapper108_Init(CartInfo *);
|
|
|
|
void Mapper112_Init(CartInfo *);
|
|
|
|
void Mapper113_Init(CartInfo *);
|
|
|
|
void Mapper114_Init(CartInfo *);
|
|
|
|
void Mapper115_Init(CartInfo *);
|
|
|
|
void Mapper117_Init(CartInfo *);
|
|
|
|
void Mapper119_Init(CartInfo *);
|
|
|
|
void Mapper120_Init(CartInfo *);
|
|
|
|
void Mapper121_Init(CartInfo *);
|
|
|
|
void Mapper125_Init(CartInfo *);
|
|
|
|
void Mapper134_Init(CartInfo *);
|
|
|
|
void Mapper140_Init(CartInfo *);
|
|
|
|
void Mapper144_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper151_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper152_Init(CartInfo *);
|
|
|
|
void Mapper153_Init(CartInfo *);
|
|
|
|
void Mapper154_Init(CartInfo *);
|
|
|
|
void Mapper155_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper156_Init(CartInfo *);
|
|
|
|
void Mapper157_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper163_Init(CartInfo *);
|
|
|
|
void Mapper164_Init(CartInfo *);
|
|
|
|
void Mapper165_Init(CartInfo *);
|
2012-12-14 18:43:51 +01:00
|
|
|
void Mapper166_Init(CartInfo *);
|
|
|
|
void Mapper167_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper168_Init(CartInfo *);
|
|
|
|
void Mapper170_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper171_Init(CartInfo *);
|
|
|
|
void Mapper172_Init(CartInfo *);
|
|
|
|
void Mapper173_Init(CartInfo *);
|
|
|
|
void Mapper175_Init(CartInfo *);
|
|
|
|
void Mapper177_Init(CartInfo *);
|
|
|
|
void Mapper178_Init(CartInfo *);
|
|
|
|
void Mapper180_Init(CartInfo *);
|
|
|
|
void Mapper181_Init(CartInfo *);
|
|
|
|
void Mapper183_Init(CartInfo *);
|
|
|
|
void Mapper184_Init(CartInfo *);
|
|
|
|
void Mapper185_Init(CartInfo *);
|
|
|
|
void Mapper186_Init(CartInfo *);
|
|
|
|
void Mapper187_Init(CartInfo *);
|
|
|
|
void Mapper188_Init(CartInfo *);
|
|
|
|
void Mapper189_Init(CartInfo *);
|
|
|
|
void Mapper191_Init(CartInfo *);
|
|
|
|
void Mapper192_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper193_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper194_Init(CartInfo *);
|
|
|
|
void Mapper195_Init(CartInfo *);
|
|
|
|
void Mapper196_Init(CartInfo *);
|
|
|
|
void Mapper197_Init(CartInfo *);
|
|
|
|
void Mapper198_Init(CartInfo *);
|
|
|
|
void Mapper199_Init(CartInfo *);
|
|
|
|
void Mapper200_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper201_Init(CartInfo *);
|
|
|
|
void Mapper202_Init(CartInfo *);
|
|
|
|
void Mapper203_Init(CartInfo *);
|
|
|
|
void Mapper204_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper205_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper206_Init(CartInfo *);
|
|
|
|
void Mapper207_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper208_Init(CartInfo *);
|
|
|
|
void Mapper209_Init(CartInfo *);
|
|
|
|
void Mapper210_Init(CartInfo *);
|
|
|
|
void Mapper211_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper212_Init(CartInfo *);
|
|
|
|
void Mapper213_Init(CartInfo *);
|
|
|
|
void Mapper214_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper216_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper217_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper220_Init(CartInfo *);
|
|
|
|
void Mapper222_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper225_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper226_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper227_Init(CartInfo *);
|
|
|
|
void Mapper228_Init(CartInfo *);
|
|
|
|
void Mapper229_Init(CartInfo *);
|
|
|
|
void Mapper230_Init(CartInfo *);
|
|
|
|
void Mapper231_Init(CartInfo *);
|
|
|
|
void Mapper232_Init(CartInfo *);
|
|
|
|
void Mapper233_Init(CartInfo *);
|
|
|
|
void Mapper234_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper235_Init(CartInfo *);
|
|
|
|
void Mapper236_Init(CartInfo *);
|
|
|
|
void Mapper237_Init(CartInfo *);
|
|
|
|
void Mapper240_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper241_Init(CartInfo *);
|
|
|
|
void Mapper242_Init(CartInfo *);
|
|
|
|
void Mapper244_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper245_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper246_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper249_Init(CartInfo *);
|
|
|
|
void Mapper250_Init(CartInfo *);
|
2012-12-14 18:18:20 +01:00
|
|
|
void Mapper252_Init(CartInfo *);
|
2009-10-07 06:40:55 +02:00
|
|
|
void Mapper253_Init(CartInfo *);
|
2009-07-17 19:27:04 +02:00
|
|
|
void Mapper254_Init(CartInfo *);
|
|
|
|
|
|
|
|
#endif
|