mirror of
https://github.com/NovaSquirrel/Mesen-X.git
synced 2024-06-01 02:48:18 -04:00
Add Mapper 404
This commit is contained in:
parent
0037d4c9f3
commit
61f13afe7f
|
@ -873,6 +873,7 @@
|
|||
<ClInclude Include="Namco163.h" />
|
||||
<ClInclude Include="Namco163Audio.h" />
|
||||
<ClInclude Include="MMC1_105.h" />
|
||||
<ClInclude Include="MMC1_404.h" />
|
||||
<ClInclude Include="NovelDiamond.h" />
|
||||
<ClInclude Include="NsfCart31.h" />
|
||||
<ClInclude Include="NsfeLoader.h" />
|
||||
|
|
|
@ -982,6 +982,9 @@
|
|||
<ClInclude Include="MMC1_105.h">
|
||||
<Filter>Nes\Mappers\MMC</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MMC1_404.h">
|
||||
<Filter>Nes\Mappers\MMC</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MMC1_550.h">
|
||||
<Filter>Nes\Mappers\MMC</Filter>
|
||||
</ClInclude>
|
||||
|
|
63
Core/MMC1_404.h
Normal file
63
Core/MMC1_404.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
#pragma once
|
||||
#include "MMC1.h"
|
||||
|
||||
// JY012005 - 1998 Super HiK 8-in-1 (JY-021B) multicart.
|
||||
|
||||
class MMC1_404 : public MMC1
|
||||
{
|
||||
private:
|
||||
uint8_t _outerPrgBank;
|
||||
uint8_t _outerChrBank;
|
||||
uint8_t _prgMask;
|
||||
uint8_t _reg;
|
||||
|
||||
protected:
|
||||
void InitMapper() override
|
||||
{
|
||||
AddRegisterRange(0x6000, 0x7FFF, MemoryOperation::Write);
|
||||
MMC1::InitMapper();
|
||||
}
|
||||
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
MMC1::Reset(softReset);
|
||||
|
||||
_outerPrgBank = 0;
|
||||
_outerChrBank = 0;
|
||||
_prgMask = 0x0F;
|
||||
_reg = 0;
|
||||
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
MMC1::StreamState(saving);
|
||||
Stream(_outerPrgBank, _outerChrBank, _prgMask, _reg);
|
||||
}
|
||||
|
||||
void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType) override
|
||||
{
|
||||
MMC1::SelectCHRPage(slot, _outerChrBank | (page & 0x1F), memoryType);
|
||||
}
|
||||
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType) override
|
||||
{
|
||||
MMC1::SelectPRGPage(slot, _outerPrgBank | (page & _prgMask), memoryType);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
if (!(_reg & 0x80)) {
|
||||
_reg = value;
|
||||
_prgMask = (_reg & 0x40) ? 0x07 : 0x0F;
|
||||
_outerPrgBank = ((_reg & 0x0F) << 3) & ~_prgMask;
|
||||
_outerChrBank = ((_reg & 0x0F) << 5);
|
||||
UpdateState();
|
||||
}
|
||||
} else {
|
||||
MMC1::WriteRegister(addr, value);
|
||||
}
|
||||
}
|
||||
};
|
|
@ -181,6 +181,7 @@
|
|||
#include "MMC1.h"
|
||||
#include "MMC1_105.h"
|
||||
#include "MMC1_155.h"
|
||||
#include "MMC1_404.h"
|
||||
#include "MMC1_550.h"
|
||||
#include "MMC2.h"
|
||||
#include "MMC3.h"
|
||||
|
@ -718,6 +719,8 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
|||
//396-400
|
||||
case 401: return new MMC3_401();
|
||||
|
||||
case 404: return new MMC1_404();
|
||||
//
|
||||
case 409: return new Mapper409();
|
||||
case 410: return new MMC3_410();
|
||||
case 411: return new MMC3_411();
|
||||
|
|
Loading…
Reference in a new issue