mirror of
https://github.com/libretro/Mesen.git
synced 2025-02-24 18:41:48 +00:00
Mapper 15 support
This commit is contained in:
parent
16b2d26fcf
commit
e17a013f2b
@ -383,6 +383,7 @@
|
||||
<ClInclude Include="JalecoJf17_19.h" />
|
||||
<ClInclude Include="Mapper107.h" />
|
||||
<ClInclude Include="Mapper112.h" />
|
||||
<ClInclude Include="Mapper15.h" />
|
||||
<ClInclude Include="Mapper200.h" />
|
||||
<ClInclude Include="Mapper201.h" />
|
||||
<ClInclude Include="Mapper202.h" />
|
||||
|
49
Core/Mapper15.h
Normal file
49
Core/Mapper15.h
Normal file
@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "BaseMapper.h"
|
||||
|
||||
class Mapper15 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
{
|
||||
WriteRegister(0x8000, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
SetMirroringType(value & 0x40 ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
|
||||
uint8_t subBank = value >> 7;
|
||||
uint8_t bank = (value & 0x7F) << 1;
|
||||
switch(addr & 0x03) {
|
||||
case 0:
|
||||
SelectPRGPage(0, bank ^ subBank);
|
||||
SelectPRGPage(1, (bank + 1) ^ subBank);
|
||||
SelectPRGPage(2, (bank + 2) ^ subBank);
|
||||
SelectPRGPage(3, (bank + 3) ^ subBank);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
bank |= subBank;
|
||||
SelectPRGPage(0, bank);
|
||||
SelectPRGPage(1, bank + 1);
|
||||
SelectPRGPage(2, bank + ((addr & 0x02) ? 0 : 1));
|
||||
SelectPRGPage(3, bank + 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
bank |= subBank;
|
||||
SelectPRGPage(0, bank);
|
||||
SelectPRGPage(1, bank);
|
||||
SelectPRGPage(2, bank);
|
||||
SelectPRGPage(3, bank);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
@ -21,6 +21,7 @@
|
||||
#include "JalecoJf17_19.h"
|
||||
#include "JalecoJfxx.h"
|
||||
#include "JalecoSs88006.h"
|
||||
#include "Mapper15.h"
|
||||
#include "Mapper57.h"
|
||||
#include "Mapper58.h"
|
||||
#include "Mapper61.h"
|
||||
@ -110,6 +111,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
||||
case 11: return new ColorDreams();
|
||||
case 12: return new MMC3_12();
|
||||
case 13: return new CpRom();
|
||||
case 15: return new Mapper15();
|
||||
case 16: break; //18 games
|
||||
case 18: return new JalecoSs88006();
|
||||
case 19: break; //16 games
|
||||
|
Loading…
x
Reference in New Issue
Block a user