Added support for MMC3 Big CHR-RAM Board

This commit is contained in:
rdanbrook 2019-11-27 19:07:14 -05:00
parent 32622f15a9
commit 830761d363
6 changed files with 19 additions and 3 deletions

View file

@ -11,6 +11,7 @@ Core:
Additions:
- Homebrew module (Phil Smith)
- Support for mapper 31 (rainwarrior)
- Support for MMC3 Big CHR-RAM Board
----------------------------------------------------------------
1.49

View file

@ -276,7 +276,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, profile.board.subMapper ) && board))
if (profile.board.mapper == Profile::Board::NO_MAPPER || (!b.DetectBoard( profile.board.mapper, profile.board.subMapper, profile.board.chrRam, profile.board.GetWram(), profileEx.wramAuto ) && board))
return RESULT_ERR_UNSUPPORTED_MAPPER;
if (profile.board.type.empty())

View file

@ -233,6 +233,7 @@ namespace Nes
{
if (setup.chrRam)
{
profile.board.chrRam = setup.chrRam / SIZE_1K;
log << title
<< (setup.chrRam % SIZE_1K ? setup.chrRam : setup.chrRam / SIZE_1K)
<< (setup.chrRam % SIZE_1K ? " bytes" : "k")

View file

@ -810,6 +810,11 @@ namespace Nes
* Submapper ID.
*/
uint subMapper;
/**
* CHR RAM Size.
*/
uint chrRam;
};
/**

View file

@ -1218,7 +1218,7 @@ namespace Nes
return true;
}
bool Board::Context::DetectBoard(const byte mapper,const dword wram,bool wramAuto,const byte submapper)
bool Board::Context::DetectBoard(const byte mapper,const byte submapper,const dword chrRam,const dword wram,bool wramAuto)
{
Type::Id id;
@ -1446,6 +1446,13 @@ namespace Nes
break;
}
if (chrRam == 32)
{
name = "UNL-MMC3BIGCHRRAM";
id = Type::UNL_MMC3BIGCHRRAM;
break;
}
if (nmt == Type::NMT_FOURSCREEN)
{
if (prg == SIZE_64K && (chr == SIZE_32K || chr == SIZE_64K) && !wram && !useWramAuto)
@ -3403,6 +3410,7 @@ namespace Nes
case Type::STD_TR1ROM :
case Type::STD_TSROM :
case Type::STD_TVROM :
case Type::UNL_MMC3BIGCHRRAM :
case Type::UNL_TRXROM : return new TxRom (c);
case Type::STD_TLSROM : return new TlsRom (c);
case Type::STD_TKSROM : return new TksRom (c);

View file

@ -557,6 +557,7 @@ namespace Nes
UNL_UXROM_M5 = MakeId< 180, 4096, 8, 8, 0, CRM_0, NMT_X, 0 >::ID,
UNL_TRXROM = MakeId< 4, 512, 256, 8, 0, CRM_0, NMT_4, 0 >::ID,
UNL_XZY = MakeId< 176, 1024, 256, 8, 0, CRM_0, NMT_X, 0 >::ID,
UNL_MMC3BIGCHRRAM = MakeId< 4, 512, 0, 0, 0, CRM_32, NMT_X, 0 >::ID,
// Waixing
WAIXING_PS2_0 = MakeId< 15, 1024, 0, 0, 0, CRM_8, NMT_V, 0 >::ID,
WAIXING_PS2_1 = MakeId< 15, 1024, 0, 8, 0, CRM_8, NMT_V, 0 >::ID,
@ -652,7 +653,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,byte);
bool DetectBoard(byte,byte,dword,dword,bool);
cstring name;
Type type;