Mapper 164 support
This commit is contained in:
parent
7d4ab35ff5
commit
9a88014389
4 changed files with 41 additions and 0 deletions
|
@ -575,6 +575,7 @@
|
|||
<ClInclude Include="VsControlManager.h" />
|
||||
<ClInclude Include="VsSystem.h" />
|
||||
<ClInclude Include="ScaleFilter.h" />
|
||||
<ClInclude Include="Waixing164.h" />
|
||||
<ClInclude Include="Waixing176.h" />
|
||||
<ClInclude Include="WaveRecorder.h" />
|
||||
<ClInclude Include="Zapper.h" />
|
||||
|
|
|
@ -664,6 +664,9 @@
|
|||
<ClInclude Include="Mapper227.h">
|
||||
<Filter>Nes\Mappers\Unnamed</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Waixing164.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
|
|
@ -106,6 +106,7 @@
|
|||
#include "VRC6.h"
|
||||
#include "VRC7.h"
|
||||
#include "VsSystem.h"
|
||||
#include "Waixing164.h"
|
||||
#include "Waixing176.h"
|
||||
|
||||
BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
||||
|
@ -222,6 +223,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
|||
case 157: return new BandaiFcg();
|
||||
case 159: return new BandaiFcg();
|
||||
case 163: return new Nanjing();
|
||||
case 164: return new Waixing164();
|
||||
case 176: return new Waixing176();
|
||||
case 180: return new UnRom_180();
|
||||
case 184: return new Sunsoft184();
|
||||
|
|
35
Core/Waixing164.h
Normal file
35
Core/Waixing164.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
#include "BaseMapper.h"
|
||||
|
||||
class Waixing164 : public BaseMapper
|
||||
{
|
||||
private:
|
||||
uint8_t _prgBank;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() { return 0x5000; }
|
||||
uint16_t RegisterEndAddress() { return 0x5FFF; }
|
||||
|
||||
void InitMapper()
|
||||
{
|
||||
_prgBank = 0x0F;
|
||||
SelectPRGPage(0, _prgBank);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgBank);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
switch(addr & 0x7300) {
|
||||
case 0x5000: _prgBank = (_prgBank & 0xF0) | (value & 0x0F); SelectPRGPage(0, _prgBank); break;
|
||||
case 0x5100: _prgBank = (_prgBank & 0x0F) | ((value & 0x0F) << 4); SelectPRGPage(0, _prgBank); break;
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue