Skip to content
Permalink
Browse files

Initial support for NES 2.0 submappers

  • Loading branch information...
rdanbrook committed Jul 21, 2015
1 parent a5689af commit 2e099c1c0c0f20fc39ef40b7c69dfa695c38c356
@@ -278,7 +278,7 @@ namespace Nes

if (profile.board.type.empty() || !b.DetectBoard( profile.board.type.c_str(), profile.board.GetWram() ))
{
if (profile.board.mapper == Profile::Board::NO_MAPPER || !b.DetectBoard( profile.board.mapper, profile.board.GetWram(), profileEx.wramAuto ) && board)
if (profile.board.mapper == Profile::Board::NO_MAPPER || !b.DetectBoard( profile.board.mapper, profile.board.GetWram(), profileEx.wramAuto, profile.board.subMapper ) && board)
return RESULT_ERR_UNSUPPORTED_MAPPER;

if (profile.board.type.empty())
@@ -192,7 +192,9 @@ namespace Nes
static const char title[] = "Ines: ";

if (setup.version)
log << title << "version 2.0 detected" NST_LINEBREAK;
{
log << title << "NES 2.0 (extended iNES)" NST_LINEBREAK;
}

if (result == RESULT_WARN_BAD_FILE_HEADER)
log << title << "warning, unknown or invalid header data!" NST_LINEBREAK;
@@ -335,7 +337,7 @@ namespace Nes
log << NST_LINEBREAK;

if (setup.version && setup.subMapper)
log << title << "unknown sub-mapper " << setup.subMapper << " set" NST_LINEBREAK;
log << title << "submapper " << setup.subMapper << " set" NST_LINEBREAK;

TrainerSetup trainerSetup;

@@ -405,6 +407,7 @@ namespace Nes
}

profile.board.mapper = setup.mapper;
profile.board.subMapper = setup.subMapper;
profileEx.wramAuto = (setup.version == 0 && profile.board.wram.empty());

switch (setup.mirroring)
@@ -252,7 +252,7 @@ namespace Nes
: battery(false) {}

Cartridge::Profile::Board::Board() throw()
: solderPads(0), mapper(NO_MAPPER) {}
: solderPads(0), mapper(NO_MAPPER), subMapper(0) {}

Cartridge::Profile::Board::~Board() throw()
{
@@ -805,6 +805,11 @@ namespace Nes
* Mapper ID.
*/
uint mapper;

/**
* Submapper ID.
*/
uint subMapper;
};

/**
@@ -1211,7 +1211,7 @@ namespace Nes
return true;
}

bool Board::Context::DetectBoard(const byte mapper,const dword wram,bool wramAuto)
bool Board::Context::DetectBoard(const byte mapper,const dword wram,bool wramAuto,const byte submapper)
{
Type::Id id;

@@ -643,7 +643,7 @@ namespace Nes
Context(Cpu*,Apu*,Ppu*,Ram&,Ram&,const Ram&,Type::Nmt,bool,bool,Chips&);

bool DetectBoard(wcstring,dword);
bool DetectBoard(byte,dword,bool);
bool DetectBoard(byte,dword,bool,byte);

cstring name;
Type type;

0 comments on commit 2e099c1

Please sign in to comment.
You can’t perform that action at this time.