Mapper 115 support
This commit is contained in:
parent
288d827cf0
commit
242ad5a33a
5 changed files with 58 additions and 1 deletions
|
@ -209,7 +209,7 @@ class BaseMapper : public IMemoryHandler, public Snapshotable, public INotificat
|
|||
}
|
||||
}
|
||||
|
||||
void SelectCHRPage(uint16_t slot, uint16_t page)
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page)
|
||||
{
|
||||
_chrPageNumbers[slot] = page;
|
||||
|
||||
|
|
|
@ -197,6 +197,7 @@
|
|||
<ClInclude Include="ExpressionEvaluator.h" />
|
||||
<ClInclude Include="HdVideoFilter.h" />
|
||||
<ClInclude Include="IremTamS1.h" />
|
||||
<ClInclude Include="MMC3_115.h" />
|
||||
<ClInclude Include="SoundMixer.h" />
|
||||
<ClInclude Include="Namco108.h" />
|
||||
<ClInclude Include="Namco108_154.h" />
|
||||
|
|
|
@ -353,6 +353,9 @@
|
|||
<ClInclude Include="UnRom_94.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MMC3_115.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
|
51
Core/MMC3_115.h
Normal file
51
Core/MMC3_115.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MMC3.h"
|
||||
|
||||
class MMC3_115 : public MMC3
|
||||
{
|
||||
private:
|
||||
uint8_t _prgReg = 0;
|
||||
uint8_t _chrReg = 0;
|
||||
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
if(addr & 0x01) {
|
||||
_chrReg = value & 0x01;
|
||||
} else {
|
||||
_prgReg = value;
|
||||
}
|
||||
UpdateState();
|
||||
} else {
|
||||
MMC3::WriteRegister(addr, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page)
|
||||
{
|
||||
page |= (_chrReg << 8);
|
||||
BaseMapper::SelectCHRPage(slot, page);
|
||||
}
|
||||
|
||||
virtual void UpdateState()
|
||||
{
|
||||
MMC3::UpdateState();
|
||||
|
||||
if(_prgReg & 0x80) {
|
||||
SelectPRGPage(0, (_prgReg & 0x0F) << 1);
|
||||
SelectPRGPage(1, ((_prgReg & 0x0F) << 1) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream<uint8_t>(_prgReg);
|
||||
Stream<uint8_t>(_chrReg);
|
||||
}
|
||||
};
|
|
@ -16,6 +16,7 @@
|
|||
#include "MMC1.h"
|
||||
#include "MMC2.h"
|
||||
#include "MMC3.h"
|
||||
#include "MMC3_115.h"
|
||||
#include "MMC3_189.h"
|
||||
#include "MMC4.h"
|
||||
#include "MMC5.h"
|
||||
|
@ -92,6 +93,7 @@ BaseMapper* MapperFactory::GetMapperFromID(ROMLoader &romLoader)
|
|||
case 97: return new IremTamS1();
|
||||
case 101: return new JalecoJfxx(true);
|
||||
case 113: return new Nina03_06(true);
|
||||
case 115: return new MMC3_115();
|
||||
case 145: return new Sachen_145();
|
||||
case 146: return new Nina03_06(false);
|
||||
case 147: return new Sachen_147();
|
||||
|
|
Loading…
Add table
Reference in a new issue