Mapper 37 support
This commit is contained in:
parent
c034133518
commit
642faea14a
4 changed files with 62 additions and 1 deletions
|
@ -382,6 +382,7 @@
|
|||
<ClInclude Include="Mapper246.h" />
|
||||
<ClInclude Include="Mapper58.h" />
|
||||
<ClInclude Include="MMC3_115.h" />
|
||||
<ClInclude Include="MMC3_37.h" />
|
||||
<ClInclude Include="MMC3_ChrRam.h" />
|
||||
<ClInclude Include="NtdecTc112.h" />
|
||||
<ClInclude Include="SoundMixer.h" />
|
||||
|
|
|
@ -407,6 +407,9 @@
|
|||
<ClInclude Include="MMC3_205.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MMC3_37.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
|
56
Core/MMC3_37.h
Normal file
56
Core/MMC3_37.h
Normal file
|
@ -0,0 +1,56 @@
|
|||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "MMC3.h"
|
||||
|
||||
class MMC3_37 : public MMC3
|
||||
{
|
||||
private:
|
||||
uint8_t _selectedBlock = 0;
|
||||
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
{
|
||||
Stream<uint8_t>(_selectedBlock);
|
||||
MMC3::StreamState(saving);
|
||||
}
|
||||
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default)
|
||||
{
|
||||
if(_selectedBlock >= 4) {
|
||||
page |= 0x80;
|
||||
}
|
||||
|
||||
MMC3::SelectCHRPage(slot, page, memoryType);
|
||||
}
|
||||
|
||||
virtual void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom)
|
||||
{
|
||||
if(_selectedBlock <= 2) {
|
||||
page &= 0x07;
|
||||
} else if(_selectedBlock == 3) {
|
||||
page &= 0x07;
|
||||
page |= 0x08;
|
||||
} else if(_selectedBlock == 7) {
|
||||
page &= 0x07;
|
||||
page |= 0x20;
|
||||
} else if(_selectedBlock >= 4) {
|
||||
page &= 0x0F;
|
||||
page |= 0x10;
|
||||
}
|
||||
|
||||
MMC3::SelectPRGPage(slot, page, memoryType);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
_selectedBlock = value & 0x07;
|
||||
UpdateState();
|
||||
} else {
|
||||
MMC3::WriteRegister(addr, value);
|
||||
}
|
||||
}
|
||||
};
|
|
@ -31,6 +31,7 @@
|
|||
#include "MMC1.h"
|
||||
#include "MMC2.h"
|
||||
#include "MMC3.h"
|
||||
#include "MMC3_37.h"
|
||||
#include "MMC3_115.h"
|
||||
#include "MMC3_189.h"
|
||||
#include "MMC3_205.h"
|
||||
|
@ -92,7 +93,7 @@ BaseMapper* MapperFactory::GetMapperFromID(ROMLoader &romLoader)
|
|||
case 32: return new IremG101();
|
||||
case 33: return new TaitoTc0190();
|
||||
case 34: return (romLoader.GetChrSize() > 0) ? (BaseMapper*)new Nina01() : (BaseMapper*)new BnRom(); //BnROM uses CHR RAM (so no CHR rom in the .NES file)
|
||||
case 37: break;
|
||||
case 37: return new MMC3_37();
|
||||
case 38: return new UnlPci556();
|
||||
case 58: return new Mapper58();
|
||||
case 66: return new GxRom();
|
||||
|
|
Loading…
Add table
Reference in a new issue