Nina Multicart (Mapper 113) support
This commit is contained in:
parent
c0a14b7886
commit
df9a506dbe
2 changed files with 30 additions and 14 deletions
|
@ -66,12 +66,13 @@ BaseMapper* MapperFactory::GetMapperFromID(uint8_t mapperID)
|
|||
case 70: return new Bandai74161_7432(false);
|
||||
case 71: return new BF909x();
|
||||
case 75: return new VRC1();
|
||||
case 79: return new Nina03_06();
|
||||
case 79: return new Nina03_06(false);
|
||||
case 80: return new TaitoX1005();
|
||||
case 87: return new JalecoJfxx(false);
|
||||
case 89: return new Sunsoft89();
|
||||
case 93: return new Sunsoft93();
|
||||
case 101: return new JalecoJfxx(true);
|
||||
case 113: return new Nina03_06(true);
|
||||
case 152: return new Bandai74161_7432(true);
|
||||
case 163: return new Nanjing();
|
||||
case 184: return new Sunsoft184();
|
||||
|
|
|
@ -4,23 +4,38 @@
|
|||
|
||||
class Nina03_06 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x4100; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0x5FFF; }
|
||||
private:
|
||||
bool _multicartMode;
|
||||
|
||||
void InitMapper()
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x4100; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0x5FFF; }
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
if((addr & 0x5100) != 0) {
|
||||
void InitMapper()
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
if((addr & 0x5100) != 0) {
|
||||
if(_multicartMode) {
|
||||
//Mapper 113
|
||||
SelectPRGPage(0, (value >> 3) & 0x07);
|
||||
SelectCHRPage(0, (value & 0x07) | ((value >> 6) & 0x01));
|
||||
SetMirroringType((value & 0x80) == 0x80 ? MirroringType::Vertical : MirroringType::Horizontal);
|
||||
} else {
|
||||
SelectPRGPage(0, (value >> 3) & 0x01);
|
||||
SelectCHRPage(0, value & 0x07);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
Nina03_06(bool multicartMode) : _multicartMode(multicartMode)
|
||||
{
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue