Mesen-X/Core/Cc21.h

35 lines
736 B
C
Raw Normal View History

2016-11-08 20:12:54 -05:00
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Cc21 : public BaseMapper
{
protected:
2016-12-17 23:14:47 -05:00
uint16_t GetPRGPageSize() override { return 0x8000; }
uint16_t GetCHRPageSize() override { return 0x1000; }
2016-11-08 20:12:54 -05:00
void InitMapper() override
{
SelectPRGPage(0, 0);
SelectCHRPage(0, 0);
SelectCHRPage(1, 0);
2016-11-08 20:12:54 -05:00
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
2018-05-07 19:53:12 -04:00
uint8_t latch = (uint8_t)addr;
if(addr == 0x8000) {
latch = value;
}
if(_chrRomSize == 0x2000) {
SelectCHRPage(0, latch & 0x01);
SelectCHRPage(1, latch & 0x01);
} else {
//Overdumped roms
SelectChrPage2x(0, (latch & 0x01) << 1);
}
SetMirroringType(latch & 0x01 ? MirroringType::ScreenBOnly : MirroringType::ScreenAOnly);
2016-11-08 20:12:54 -05:00
}
};