diff --git a/ChangeLog b/ChangeLog index b995dfc..1310378 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ Core: Additions: - Homebrew module (Phil Smith) - Support for mapper 31 (rainwarrior) + - Support for MMC3 Big CHR-RAM Board ---------------------------------------------------------------- 1.49 diff --git a/source/core/NstCartridge.cpp b/source/core/NstCartridge.cpp index c159d97..3dca9a0 100644 --- a/source/core/NstCartridge.cpp +++ b/source/core/NstCartridge.cpp @@ -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()) diff --git a/source/core/NstCartridgeInes.cpp b/source/core/NstCartridgeInes.cpp index 7be67fe..37e6789 100644 --- a/source/core/NstCartridgeInes.cpp +++ b/source/core/NstCartridgeInes.cpp @@ -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") diff --git a/source/core/api/NstApiCartridge.hpp b/source/core/api/NstApiCartridge.hpp index 49ae5a6..9ae71f5 100644 --- a/source/core/api/NstApiCartridge.hpp +++ b/source/core/api/NstApiCartridge.hpp @@ -810,6 +810,11 @@ namespace Nes * Submapper ID. */ uint subMapper; + + /** + * CHR RAM Size. + */ + uint chrRam; }; /** diff --git a/source/core/board/NstBoard.cpp b/source/core/board/NstBoard.cpp index dab4931..86d30c4 100644 --- a/source/core/board/NstBoard.cpp +++ b/source/core/board/NstBoard.cpp @@ -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); diff --git a/source/core/board/NstBoard.hpp b/source/core/board/NstBoard.hpp index f5780e8..2e7ffea 100644 --- a/source/core/board/NstBoard.hpp +++ b/source/core/board/NstBoard.hpp @@ -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;