Linux: Fixed all clang warnings
This commit is contained in:
parent
a6579fbfdb
commit
b4489ed0f7
264 changed files with 1249 additions and 1254 deletions
|
@ -19,7 +19,7 @@ private:
|
|||
uint32_t _cyclesDown = 0;
|
||||
|
||||
public:
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
Stream(_lastCycle, _cyclesDown);
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
class A65AS : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ class APU : public Snapshotable, public IMemoryHandler
|
|||
static void FrameCounterTick(FrameType type);
|
||||
|
||||
protected:
|
||||
void StreamState(bool saving);
|
||||
void StreamState(bool saving) override;
|
||||
|
||||
public:
|
||||
APU(MemoryManager* memoryManager);
|
||||
|
@ -56,9 +56,9 @@ class APU : public Snapshotable, public IMemoryHandler
|
|||
void Reset(bool softReset);
|
||||
void SetNesModel(NesModel model, bool forceInit = false);
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr);
|
||||
void WriteRAM(uint16_t addr, uint8_t value);
|
||||
void GetMemoryRanges(MemoryRanges &ranges);
|
||||
uint8_t ReadRAM(uint16_t addr) override;
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override;
|
||||
void GetMemoryRanges(MemoryRanges &ranges) override;
|
||||
|
||||
void Exec();
|
||||
|
||||
|
|
10
Core/AXROM.h
10
Core/AXROM.h
|
@ -5,18 +5,18 @@
|
|||
class AXROM : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
bool HasBusConflicts() { return _subMapperID == 2; }
|
||||
bool HasBusConflicts() override { return _subMapperID == 2; }
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(0, value & 0x0F);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_reg);
|
||||
|
|
|
@ -10,10 +10,10 @@ private:
|
|||
uint8_t _mirroringBit;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_selectedReg = 0;
|
||||
memset(_regs, 0, sizeof(_regs));
|
||||
|
@ -23,7 +23,7 @@ protected:
|
|||
SelectPRGPage(1, -1);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
|
||||
|
@ -76,7 +76,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr <= 0x5FFF) {
|
||||
_selectedReg = ((value & 0x80) >> 6) | (value & 0x01);
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
class ActionEnterprises : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
virtual void Reset(bool softReset)
|
||||
virtual void Reset(bool softReset) override
|
||||
{
|
||||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
uint8_t chipSelect = (addr >> 11) & 0x03;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ protected:
|
|||
}
|
||||
|
||||
public:
|
||||
virtual void Reset(bool softReset)
|
||||
virtual void Reset(bool softReset) override
|
||||
{
|
||||
ApuLengthCounter::Reset(softReset);
|
||||
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
_counter = 0;
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
ApuLengthCounter::StreamState(saving);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
_writeDelayCounter = -1;
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
Stream(_nextIrqCycle, _previousCycle, _currentStep, _stepMode, _inhibitIRQ, _nesModel, _blockFrameCounterTick, _writeDelayCounter, _newValue);
|
||||
|
||||
|
@ -185,17 +185,17 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void GetMemoryRanges(MemoryRanges &ranges)
|
||||
void GetMemoryRanges(MemoryRanges &ranges) override
|
||||
{
|
||||
ranges.AddHandler(MemoryOperation::Write, 0x4017);
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WriteRAM(uint16_t addr, uint8_t value)
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
APU::StaticRun();
|
||||
_newValue = value;
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
return ApuLengthCounter::_needToRun;
|
||||
}
|
||||
|
||||
virtual void Reset(bool softReset)
|
||||
virtual void Reset(bool softReset) override
|
||||
{
|
||||
BaseApuChannel::Reset(softReset);
|
||||
|
||||
|
@ -72,19 +72,19 @@ public:
|
|||
ApuLengthCounter::_needToRun = false;
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseApuChannel::StreamState(saving);
|
||||
|
||||
Stream(_enabled, _lengthCounterHalt, _newHaltValue, _lengthCounter, _lengthCounterPreviousValue, _lengthCounterReloadValue);
|
||||
}
|
||||
|
||||
bool GetStatus()
|
||||
bool GetStatus() override
|
||||
{
|
||||
return _lengthCounter > 0;
|
||||
}
|
||||
|
||||
virtual void Run(uint32_t targetCycle)
|
||||
virtual void Run(uint32_t targetCycle) override
|
||||
{
|
||||
ApuLengthCounter::_needToRun = false;
|
||||
_lengthCounterHalt = _newHaltValue;
|
||||
|
|
|
@ -12,17 +12,17 @@ private:
|
|||
bool IsButtonPressed();
|
||||
|
||||
protected:
|
||||
uint8_t RefreshState();
|
||||
virtual void StreamState(bool saving);
|
||||
uint8_t RefreshState() override;
|
||||
virtual void StreamState(bool saving) override;
|
||||
|
||||
public:
|
||||
using BaseControlDevice::BaseControlDevice;
|
||||
|
||||
uint8_t GetPortOutput();
|
||||
void RefreshStateBuffer();
|
||||
uint8_t GetPortOutput() override;
|
||||
void RefreshStateBuffer() override;
|
||||
|
||||
virtual uint32_t GetNetPlayState();
|
||||
uint8_t ProcessNetPlayState(uint32_t netplayState);
|
||||
virtual uint32_t GetNetPlayState() override;
|
||||
uint8_t ProcessNetPlayState(uint32_t netplayState) override;
|
||||
|
||||
uint8_t GetExpansionPortOutput(uint8_t port);
|
||||
};
|
|
@ -38,7 +38,7 @@ public:
|
|||
AutoRomTest();
|
||||
virtual ~AutoRomTest();
|
||||
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter);
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter) override;
|
||||
void Record(string filename, bool reset);
|
||||
void RecordFromMovie(string testFilename, string movieFilename);
|
||||
void RecordFromTest(string newTestFilename, string existingTestFilename);
|
||||
|
|
|
@ -8,8 +8,8 @@ private:
|
|||
uint8_t _chrReg[8];
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x400; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x400; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -9,10 +9,10 @@ private:
|
|||
uint8_t _prgPage;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_prgPage = 0;
|
||||
_prgBlock = 0;
|
||||
|
@ -23,7 +23,7 @@ protected:
|
|||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr >= 0xC000) {
|
||||
_prgPage = value & 0x03;
|
||||
|
@ -43,7 +43,7 @@ protected:
|
|||
SelectPRGPage(1, (_prgBlock << 2) | 3);
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgBlock, _prgPage);
|
||||
|
|
|
@ -8,10 +8,10 @@ private:
|
|||
bool _bf9097Mode = false; //Auto-detect for firehawk
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
if(_subMapperID == 1) {
|
||||
_bf9097Mode = true;
|
||||
|
@ -24,7 +24,7 @@ protected:
|
|||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr == 0x9000) {
|
||||
//Firehawk uses $9000 to change mirroring
|
||||
|
@ -38,7 +38,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_bf9097Mode);
|
||||
|
|
|
@ -8,10 +8,10 @@ private:
|
|||
bool _enableMirroringControl;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectPRGPage(1, -1);
|
||||
|
@ -21,7 +21,7 @@ protected:
|
|||
SetMirroringType(MirroringType::Vertical);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
bool mirroringBit = (value & 0x80) == 0x80;
|
||||
if(mirroringBit) {
|
||||
|
@ -39,7 +39,7 @@ protected:
|
|||
SelectCHRPage(0, value & 0x0F);
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_enableMirroringControl);
|
||||
|
|
|
@ -13,13 +13,13 @@ private:
|
|||
uint8_t _chrRegs[8];
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() { return 0x400; }
|
||||
uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
bool AllowRegisterRead() { return true; }
|
||||
uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x400; }
|
||||
uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
bool AllowRegisterRead() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
memset(_chrRegs, 0, sizeof(_chrRegs));
|
||||
_irqEnabled = false;
|
||||
|
@ -41,7 +41,7 @@ protected:
|
|||
SelectPRGPage(1, 0x0F);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
|
||||
|
@ -49,7 +49,7 @@ protected:
|
|||
Stream(_irqEnabled, _irqCounter, _irqReload, _prgPage, _prgBankSelect, chrRegs);
|
||||
}
|
||||
|
||||
void ProcessCpuClock()
|
||||
void ProcessCpuClock() override
|
||||
{
|
||||
if(_irqEnabled) {
|
||||
//Checking counter before decrementing seems to be the only way to get both
|
||||
|
@ -62,13 +62,13 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t ReadRegister(uint16_t addr)
|
||||
uint8_t ReadRegister(uint16_t addr) override
|
||||
{
|
||||
//Pretend EEPROM data is always 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0x000F) {
|
||||
case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
class BandaiKaraoke : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual bool AllowRegisterRead() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual bool AllowRegisterRead() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
AddRegisterRange(0x6000, 0x7FFF, MemoryOperation::Read);
|
||||
RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read);
|
||||
|
@ -21,13 +21,13 @@ protected:
|
|||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
uint8_t ReadRegister(uint16_t addr)
|
||||
uint8_t ReadRegister(uint16_t addr) override
|
||||
{
|
||||
//Microphone not implemented - always return A/B buttons as not pressed
|
||||
return 0x03;
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(value & 0x10) {
|
||||
//Select internal rom
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
if(!saving) {
|
||||
_previousCycle = 0;
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ protected:
|
|||
virtual uint8_t RefreshState() = 0;
|
||||
virtual uint8_t ProcessNetPlayState(uint32_t netplayState);
|
||||
|
||||
virtual void StreamState(bool saving);
|
||||
virtual void StreamState(bool saving) override;
|
||||
|
||||
public:
|
||||
//Used by controller-specific code to get the current state (buttons, position, etc)
|
||||
|
|
|
@ -11,7 +11,7 @@ private:
|
|||
protected:
|
||||
virtual void ClockAudio() = 0;
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
Stream(_clocksNeeded);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ protected:
|
|||
//"Few FDS NSFs write to this register. The BIOS initializes this to $FF."
|
||||
uint8_t _masterSpeed = 0xFF;
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
Stream(_speed, _gain, _envelopeOff, _volumeIncrease, _frequency, _timer, _masterSpeed);
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ void BaseMapper::SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memor
|
|||
{
|
||||
_prgPageNumbers[slot] = page;
|
||||
|
||||
if(_prgSize < PrgAddressRangeSize && GetPRGPageSize() > _prgSize) {
|
||||
if(_prgSize < 0x8000 && GetPRGPageSize() > _prgSize) {
|
||||
//Total PRG size is smaller than available memory range, map the entire PRG to all slots
|
||||
//i.e same logic as NROM (mapper 0) when PRG is 16kb
|
||||
//Needed by "Pyramid" (mapper 79)
|
||||
|
@ -221,7 +221,7 @@ void BaseMapper::SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memor
|
|||
MessageManager::DisplayMessage("Debug", "PrgSizeWarning");
|
||||
#endif
|
||||
|
||||
for(slot = 0; slot < PrgAddressRangeSize / _prgSize; slot++) {
|
||||
for(slot = 0; slot < 0x8000 / _prgSize; slot++) {
|
||||
uint16_t startAddr = 0x8000 + slot * _prgSize;
|
||||
uint16_t endAddr = startAddr + _prgSize - 1;
|
||||
SetCpuMemoryMapping(startAddr, endAddr, 0, memoryType);
|
||||
|
|
|
@ -57,9 +57,6 @@ struct CartridgeState
|
|||
class BaseMapper : public IMemoryHandler, public Snapshotable, public INotificationListener
|
||||
{
|
||||
private:
|
||||
const uint16_t PrgAddressRangeSize = 0x8000;
|
||||
const uint16_t ChrAddressRangeSize = 0x2000;
|
||||
|
||||
MirroringType _mirroringType;
|
||||
string _batteryFilename;
|
||||
|
||||
|
@ -183,7 +180,7 @@ protected:
|
|||
void AddRegisterRange(uint16_t startAddr, uint16_t endAddr, MemoryOperation operation = MemoryOperation::Any);
|
||||
void RemoveRegisterRange(uint16_t startAddr, uint16_t endAddr, MemoryOperation operation = MemoryOperation::Any);
|
||||
|
||||
virtual void StreamState(bool saving);
|
||||
virtual void StreamState(bool saving) override;
|
||||
|
||||
uint8_t* GetNametable(uint8_t index);
|
||||
void AddNametable(uint8_t index, uint8_t *nametable);
|
||||
|
@ -201,8 +198,8 @@ public:
|
|||
virtual void SetNesModel(NesModel model) { }
|
||||
virtual void ProcessCpuClock() { }
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr);
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter);
|
||||
virtual void GetMemoryRanges(MemoryRanges &ranges);
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter) override;
|
||||
virtual void GetMemoryRanges(MemoryRanges &ranges) override;
|
||||
|
||||
void ApplyCheats();
|
||||
void SaveBattery();
|
||||
|
@ -214,8 +211,8 @@ public:
|
|||
uint32_t GetPrgCrc32();
|
||||
string GetRomName();
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr);
|
||||
virtual void WriteRAM(uint16_t addr, uint8_t value);
|
||||
uint8_t ReadRAM(uint16_t addr) override;
|
||||
virtual void WriteRAM(uint16_t addr, uint8_t value) override;
|
||||
void WritePrgRam(uint16_t addr, uint8_t value);
|
||||
|
||||
uint8_t InternalReadVRAM(uint16_t addr);
|
||||
|
|
|
@ -21,7 +21,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgReg, _chrReg);
|
||||
|
|
|
@ -12,7 +12,7 @@ protected:
|
|||
{
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
BaseMapper::Reset(softReset);
|
||||
WriteRegister(0x8000, 0);
|
||||
|
|
|
@ -19,7 +19,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_regs[0], _regs[1], _mode);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
class Bmc190in1 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -7,22 +7,22 @@ class Bmc235 : public BaseMapper
|
|||
private:
|
||||
bool _openBus = false;
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPrgPage2x(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
SelectPrgPage2x(0, 0);
|
||||
_openBus = false;
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_openBus);
|
||||
|
@ -31,7 +31,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SetMirroringType((addr & 0x0400) ? MirroringType::ScreenAOnly : (addr & 0x2000) ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
class Bmc255 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
uint8_t prgBit = (addr & 0x1000) ? 0 : 1;
|
||||
uint8_t bank = ((addr >> 8) & 0x40) | ((addr >> 6) & 0x3F);
|
||||
|
|
14
Core/Bmc51.h
14
Core/Bmc51.h
|
@ -9,19 +9,19 @@ private:
|
|||
uint8_t _mode;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_bank = 0;
|
||||
_mode = 1;
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_bank, _mode);
|
||||
|
@ -44,7 +44,7 @@ protected:
|
|||
SetMirroringType(_mode == 0x03 ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr <= 0x7FFF) {
|
||||
_mode = ((value >> 3) & 0x02) | ((value >> 1) & 0x01);
|
||||
|
|
12
Core/Bmc63.h
12
Core/Bmc63.h
|
@ -8,20 +8,20 @@ private:
|
|||
bool _openBus;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
_openBus = false;
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_openBus);
|
||||
|
@ -30,7 +30,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
_openBus = ((addr & 0x0300) == 0x0300);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ protected:
|
|||
AddRegisterRange(0x5000, 0x5003, MemoryOperation::Write);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
BaseMapper::Reset(softReset);
|
||||
|
||||
|
@ -27,7 +27,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_regs[0], _regs[1], _regs[2], _regs[3]);
|
||||
|
|
|
@ -13,9 +13,9 @@ private:
|
|||
bool _useOuterBank;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
bool AllowRegisterRead() { return true; }
|
||||
uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
bool AllowRegisterRead() override { return true; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ protected:
|
|||
{
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
BaseMapper::Reset(softReset);
|
||||
WriteRegister(0x8000, 0);
|
||||
|
|
|
@ -12,7 +12,7 @@ protected:
|
|||
{
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
BaseMapper::Reset(softReset);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ protected:
|
|||
{
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
BaseMapper::Reset(softReset);
|
||||
WriteRegister(0x8000, 0);
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
class BnRom : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
//"While the original BNROM board connects only 2 bits, it is recommended that emulators implement this as an 8-bit register allowing selection of up to 8 MB PRG ROM if present."
|
||||
SelectPRGPage(0, value);
|
||||
|
|
|
@ -8,8 +8,8 @@ private:
|
|||
uint8_t _dipSwitch = 0;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x800; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x800; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
@ -19,13 +19,13 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_dipSwitch);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
if(softReset) {
|
||||
_dipSwitch = (_dipSwitch + 1) & 0x03;
|
||||
|
|
10
Core/CNROM.h
10
Core/CNROM.h
|
@ -8,18 +8,18 @@ private:
|
|||
bool _enableCopyProtection;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
bool HasBusConflicts() { return (_mapperID == 3 && _subMapperID == 2) || _mapperID == 185; }
|
||||
bool HasBusConflicts() override { return (_mapperID == 3 && _subMapperID == 2) || _mapperID == 185; }
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(_enableCopyProtection) {
|
||||
//"if C AND $0F is nonzero, and if C does not equal $13: CHR is enabled"
|
||||
|
|
|
@ -843,7 +843,7 @@ private:
|
|||
}
|
||||
|
||||
protected:
|
||||
void StreamState(bool saving);
|
||||
void StreamState(bool saving) override;
|
||||
|
||||
public:
|
||||
static const uint32_t ClockRateNtsc = 1789773;
|
||||
|
|
|
@ -9,17 +9,17 @@ private:
|
|||
uint8_t _chrBank;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
AddRegisterRange(0x6000, 0x67FF, MemoryOperation::Write);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
_chrBank = 0;
|
||||
_prgBank = 0;
|
||||
|
@ -27,13 +27,13 @@ protected:
|
|||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgBank, _chrBank);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr <= 0x67FF) {
|
||||
_prgBank = addr & 0x07;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
class Cc21 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
class ColorDreams : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual bool HasBusConflicts() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual bool HasBusConflicts() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(_mapperID == 144) {
|
||||
//"This addition means that only the ROM's least significant bit always wins bus conflicts."
|
||||
|
|
|
@ -8,18 +8,18 @@ private:
|
|||
uint8_t _regs[2];
|
||||
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
WriteRegister(0x6000, 0);
|
||||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
virtual void Reset(bool softReset)
|
||||
virtual void Reset(bool softReset) override
|
||||
{
|
||||
WriteRegister(0x6000, 0);
|
||||
WriteRegister(0x8000, 0);
|
||||
|
@ -31,7 +31,7 @@ protected:
|
|||
SelectCHRPage(0, ((_regs[0] & 0xF0) >> 1) | ((_regs[1] & 0x70) >> 4));
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
_regs[0] = value;
|
||||
|
|
|
@ -37,7 +37,6 @@ class Console
|
|||
string _romFilepath;
|
||||
|
||||
bool _stop = false;
|
||||
bool _reset = false;
|
||||
|
||||
atomic<bool> _resetRequested;
|
||||
atomic<uint32_t> _lagCounter;
|
||||
|
|
|
@ -40,7 +40,7 @@ class ControlManager : public Snapshotable, public IMemoryHandler
|
|||
uint8_t GetPortValue(uint8_t port);
|
||||
virtual void RefreshAllPorts();
|
||||
|
||||
virtual void StreamState(bool saving);
|
||||
virtual void StreamState(bool saving) override;
|
||||
|
||||
public:
|
||||
ControlManager();
|
||||
|
@ -69,12 +69,12 @@ class ControlManager : public Snapshotable, public IMemoryHandler
|
|||
|
||||
static void BroadcastInput(uint8_t port, uint8_t state);
|
||||
|
||||
virtual void GetMemoryRanges(MemoryRanges &ranges)
|
||||
virtual void GetMemoryRanges(MemoryRanges &ranges) override
|
||||
{
|
||||
ranges.AddHandler(MemoryOperation::Read, 0x4016, 0x4017);
|
||||
ranges.AddHandler(MemoryOperation::Write, 0x4016);
|
||||
}
|
||||
|
||||
virtual uint8_t ReadRAM(uint16_t addr);
|
||||
virtual void WriteRAM(uint16_t addr, uint8_t value);
|
||||
virtual uint8_t ReadRAM(uint16_t addr) override;
|
||||
virtual void WriteRAM(uint16_t addr, uint8_t value) override;
|
||||
};
|
10
Core/CpRom.h
10
Core/CpRom.h
|
@ -5,18 +5,18 @@
|
|||
class CpRom : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x1000; }
|
||||
virtual uint32_t GetChrRamSize() { return 0x4000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x1000; }
|
||||
virtual uint32_t GetChrRamSize() override { return 0x4000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
SetMirroringType(MirroringType::Vertical);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr >= 0x8000) {
|
||||
SelectCHRPage(1, value & 0x03);
|
||||
|
|
|
@ -9,12 +9,12 @@ private:
|
|||
uint8_t _chrHigh[8];
|
||||
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0xC000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xC014; }
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x400; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0xC000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xC014; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x400; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
memset(_chrLow, 0, sizeof(_chrLow));
|
||||
memset(_chrHigh, 0, sizeof(_chrHigh));
|
||||
|
@ -22,7 +22,7 @@ protected:
|
|||
SetMirroringType(MirroringType::ScreenAOnly);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
|
||||
|
@ -42,7 +42,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr) {
|
||||
case 0xC000: case 0xC001: case 0xC002: case 0xC003:
|
||||
|
|
|
@ -35,19 +35,19 @@ private:
|
|||
void InitSample();
|
||||
void FillReadBuffer();
|
||||
|
||||
void Clock();
|
||||
void Clock() override;
|
||||
|
||||
public:
|
||||
DeltaModulationChannel(AudioChannel channel, SoundMixer* mixer, MemoryManager* memoryManager);
|
||||
|
||||
virtual void Reset(bool softReset);
|
||||
virtual void StreamState(bool saving);
|
||||
virtual void Reset(bool softReset) override;
|
||||
virtual void StreamState(bool saving) override;
|
||||
|
||||
bool IrqPending(uint32_t cyclesToRun);
|
||||
bool NeedToRun();
|
||||
bool GetStatus();
|
||||
void GetMemoryRanges(MemoryRanges &ranges);
|
||||
void WriteRAM(uint16_t addr, uint8_t value);
|
||||
bool GetStatus() override;
|
||||
void GetMemoryRanges(MemoryRanges &ranges) override;
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override;
|
||||
|
||||
void SetEnabled(bool enabled);
|
||||
void StartDmcTransfer();
|
||||
|
|
|
@ -189,7 +189,7 @@ uint32_t Disassembler::BuildCache(int32_t absoluteAddr, int32_t absoluteRamAddr,
|
|||
|
||||
void Disassembler::InvalidateCache(uint16_t memoryAddr, int32_t absoluteRamAddr)
|
||||
{
|
||||
uint32_t addr;
|
||||
int32_t addr;
|
||||
vector<shared_ptr<DisassemblyInfo>> *cache;
|
||||
if(memoryAddr < 0x2000) {
|
||||
addr = memoryAddr & 0x7FF;
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
class DreamTech01 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() { return 0x5020; }
|
||||
uint16_t RegisterEndAddress() { return 0x5020; }
|
||||
uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() override { return 0x5020; }
|
||||
uint16_t RegisterEndAddress() override { return 0x5020; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -8,10 +8,10 @@ private:
|
|||
uint8_t _reg;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint32_t GetWorkRamSize() { return 0x8000; }
|
||||
uint32_t GetWorkRamPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
uint32_t GetWorkRamSize() override { return 0x8000; }
|
||||
uint32_t GetWorkRamPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
28
Core/FDS.h
28
Core/FDS.h
|
@ -71,16 +71,16 @@ private:
|
|||
bool _fastForwarding = false;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint32_t GetWorkRamPageSize() { return 0x8000; }
|
||||
virtual uint32_t GetWorkRamSize() { return 0x8000; }
|
||||
uint16_t RegisterStartAddress() { return 0x4020; }
|
||||
uint16_t RegisterEndAddress() { return 0x4092; }
|
||||
bool AllowRegisterRead() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual uint32_t GetWorkRamPageSize() override { return 0x8000; }
|
||||
virtual uint32_t GetWorkRamSize() override { return 0x8000; }
|
||||
uint16_t RegisterStartAddress() override { return 0x4020; }
|
||||
uint16_t RegisterEndAddress() override { return 0x4092; }
|
||||
bool AllowRegisterRead() override { return true; }
|
||||
|
||||
void InitMapper();
|
||||
void InitMapper(RomData &romData);
|
||||
void InitMapper() override;
|
||||
void InitMapper(RomData &romData) override;
|
||||
|
||||
uint32_t GetFdsDiskSideSize(uint8_t side);
|
||||
uint8_t ReadFdsDisk();
|
||||
|
@ -88,17 +88,17 @@ protected:
|
|||
|
||||
void ClockIrq();
|
||||
|
||||
void ProcessCpuClock();
|
||||
void ProcessCpuClock() override;
|
||||
void UpdateCrc(uint8_t value);
|
||||
|
||||
bool IsDiskInserted();
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value);
|
||||
uint8_t ReadRegister(uint16_t addr);
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override;
|
||||
uint8_t ReadRegister(uint16_t addr) override;
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr);
|
||||
uint8_t ReadRAM(uint16_t addr) override;
|
||||
|
||||
void StreamState(bool saving);
|
||||
void StreamState(bool saving) override;
|
||||
|
||||
public:
|
||||
FDS();
|
||||
|
|
|
@ -33,7 +33,7 @@ private:
|
|||
uint8_t _lastOutput = 0;
|
||||
|
||||
protected:
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseExpansionAudio::StreamState(saving);
|
||||
|
||||
|
@ -44,7 +44,7 @@ protected:
|
|||
Stream(volume, mod, _waveWriteEnabled, _disableEnvelopes, _haltWaveform, _masterVolume, _waveOverflowCounter, _wavePitch, _wavePosition, _lastOutput, waveTable);
|
||||
}
|
||||
|
||||
void ClockAudio()
|
||||
void ClockAudio() override
|
||||
{
|
||||
//"The envelopes are not ticked while the waveform is halted."
|
||||
_volume.TickEnvelope(_disableEnvelopes || _haltWaveform);
|
||||
|
|
|
@ -10,13 +10,13 @@ private:
|
|||
bool _ffeAltMode;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x400; }
|
||||
uint32_t GetChrRamSize() { return 0x8000; }
|
||||
uint16_t RegisterStartAddress() { return 0x42FE; }
|
||||
uint16_t RegisterEndAddress() { return 0x4517; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x400; }
|
||||
uint32_t GetChrRamSize() override { return 0x8000; }
|
||||
uint16_t RegisterStartAddress() override { return 0x42FE; }
|
||||
uint16_t RegisterEndAddress() override { return 0x4517; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_irqCounter = 0;
|
||||
_irqEnabled = false;
|
||||
|
@ -40,13 +40,13 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_irqCounter, _irqEnabled, _ffeAltMode);
|
||||
}
|
||||
|
||||
void ProcessCpuClock()
|
||||
void ProcessCpuClock() override
|
||||
{
|
||||
if(_irqEnabled) {
|
||||
_irqCounter++;
|
||||
|
@ -57,7 +57,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr) {
|
||||
case 0x42FE:
|
||||
|
|
|
@ -35,5 +35,5 @@ public:
|
|||
|
||||
static uint8_t GetControllerState(uint8_t port);
|
||||
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter);
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter) override;
|
||||
};
|
|
@ -35,13 +35,13 @@ private:
|
|||
void DisableControllers();
|
||||
|
||||
protected:
|
||||
void ProcessMessage(NetMessage* message);
|
||||
void ProcessMessage(NetMessage* message) override;
|
||||
|
||||
public:
|
||||
GameClientConnection(shared_ptr<Socket> socket, shared_ptr<ClientConnectionData> connectionData);
|
||||
~GameClientConnection();
|
||||
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter);
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter) override;
|
||||
|
||||
uint8_t GetControllerState(uint8_t port);
|
||||
void SendInput();
|
||||
|
|
|
@ -29,7 +29,7 @@ private:
|
|||
static uint8_t GetFirstFreeControllerPort();
|
||||
|
||||
protected:
|
||||
void ProcessMessage(NetMessage* message);
|
||||
void ProcessMessage(NetMessage* message) override;
|
||||
|
||||
public:
|
||||
GameServerConnection(shared_ptr<Socket> socket);
|
||||
|
@ -41,7 +41,7 @@ public:
|
|||
string GetPlayerName();
|
||||
uint8_t GetControllerPort();
|
||||
|
||||
virtual void ProcessNotification(ConsoleNotificationType type, void* parameter);
|
||||
virtual void ProcessNotification(ConsoleNotificationType type, void* parameter) override;
|
||||
|
||||
static GameServerConnection* GetNetPlayDevice(uint8_t port);
|
||||
};
|
||||
|
|
|
@ -8,20 +8,20 @@ private:
|
|||
uint8_t _regs[2];
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
_regs[0] = _regs[1] = 0;
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_regs[0], _regs[1]);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
class Gs2004 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
class Gs2013 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
class GxRom : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(0, (value >> 4) & 0x03);
|
||||
SelectCHRPage(0, value & 0x03);
|
||||
|
|
|
@ -254,7 +254,7 @@ public:
|
|||
_loadLock.Release();
|
||||
}
|
||||
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter)
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter) override
|
||||
{
|
||||
if(type == ConsoleNotificationType::GameLoaded) {
|
||||
LoadHdNesPack();
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
class Henggedianzi177 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(0, value);
|
||||
SetMirroringType(value & 0x20 ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
class Henggedianzi179 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
AddRegisterRange(0x5000, 0x5FFF, MemoryOperation::Write);
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr >= 0x8000) {
|
||||
SetMirroringType(value & 0x01 ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
class IremG101 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0400; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x0400; }
|
||||
|
||||
uint8_t _prgRegs[2];
|
||||
uint8_t _prgMode;
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_prgRegs[0] = _prgRegs[1] = 0;
|
||||
_prgMode = 0;
|
||||
|
@ -26,7 +26,7 @@ class IremG101 : public BaseMapper
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
|
||||
|
@ -48,7 +48,7 @@ class IremG101 : public BaseMapper
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0xF000) {
|
||||
case 0x8000:
|
||||
|
|
|
@ -11,10 +11,10 @@ private:
|
|||
uint16_t _irqReloadValue = 0;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x400; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x400; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectPRGPage(1, 1);
|
||||
|
@ -22,13 +22,13 @@ protected:
|
|||
SelectPRGPage(3, -1);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_irqEnabled, _irqCounter, _irqReloadValue);
|
||||
}
|
||||
|
||||
virtual void ProcessCpuClock()
|
||||
virtual void ProcessCpuClock() override
|
||||
{
|
||||
if(_irqEnabled) {
|
||||
_irqCounter--;
|
||||
|
@ -39,7 +39,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr) {
|
||||
case 0x8000: SelectPRGPage(0, value); break;
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
class IremLrog017 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0800; }
|
||||
virtual uint32_t GetChrRamSize() { return 0x1800; }
|
||||
virtual uint16_t GetChrRamPageSize() { return 0x0800; }
|
||||
virtual bool HasBusConflicts() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x0800; }
|
||||
virtual uint32_t GetChrRamSize() override { return 0x1800; }
|
||||
virtual uint16_t GetChrRamPageSize() override { return 0x0800; }
|
||||
virtual bool HasBusConflicts() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
|
@ -22,7 +22,7 @@ protected:
|
|||
SelectCHRPage(3, 2, ChrMemoryType::ChrRam);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(0, value & 0x0F);
|
||||
SelectCHRPage(0, (value >> 4) & 0x0F);
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
class IremTamS1 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, -1);
|
||||
SelectPRGPage(1, -1);
|
||||
|
@ -16,7 +16,7 @@ protected:
|
|||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(1, value & 0x0F);
|
||||
switch(value >> 6) {
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
class JalecoJf11_14 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0x7FFF; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0x7FFF; }
|
||||
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(0, (value >> 4) & 0x03);
|
||||
SelectCHRPage(0, value & 0x0F);
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
class JalecoJf13 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0x7FFF; }
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0x7FFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0x7000) {
|
||||
case 0x6000:
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
class JalecoJf16 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual bool HasBusConflicts() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual bool HasBusConflicts() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectPRGPage(1, -1);
|
||||
|
@ -17,7 +17,7 @@ protected:
|
|||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
SelectPRGPage(0, value & 0x07);
|
||||
SelectCHRPage(0, (value >> 4) & 0x0F);
|
||||
|
|
|
@ -11,11 +11,11 @@ private:
|
|||
bool _chrFlag = false;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual bool HasBusConflicts() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual bool HasBusConflicts() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectPRGPage(1, -1);
|
||||
|
@ -23,13 +23,13 @@ protected:
|
|||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgFlag, _chrFlag);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(!_prgFlag && (value & 0x80)) {
|
||||
if(_jf19Mode) {
|
||||
|
|
|
@ -8,18 +8,18 @@ private:
|
|||
bool _orderedBits;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0x7FFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0x7FFF; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
SelectCHRPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(_orderedBits) {
|
||||
//Mapper 101
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
class JalecoSs88006 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0400; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x0400; }
|
||||
|
||||
const vector<uint16_t> _irqMask = { { 0xFFFF, 0x0FFF, 0x00FF, 0x000F } };
|
||||
|
||||
|
@ -18,7 +18,7 @@ class JalecoSs88006 : public BaseMapper
|
|||
uint8_t _irqCounterSize;
|
||||
bool _irqEnabled;
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
memset(_prgBanks, 0, 3);
|
||||
memset(_chrBanks, 0, 8);
|
||||
|
@ -30,7 +30,7 @@ class JalecoSs88006 : public BaseMapper
|
|||
SelectPRGPage(3, -1);
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
|
||||
|
@ -72,7 +72,7 @@ class JalecoSs88006 : public BaseMapper
|
|||
SelectCHRPage(bankNumber, _chrBanks[bankNumber]);
|
||||
}
|
||||
|
||||
virtual void ProcessCpuClock()
|
||||
virtual void ProcessCpuClock() override
|
||||
{
|
||||
//Clock irq counter every memory read/write (each cpu cycle either reads or writes memory)
|
||||
ClockIrqCounter();
|
||||
|
@ -96,7 +96,7 @@ class JalecoSs88006 : public BaseMapper
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
bool updateUpperBits = (addr & 0x01) == 0x01;
|
||||
value &= 0x0F;
|
||||
|
|
|
@ -52,11 +52,11 @@ private:
|
|||
uint16_t _lastPpuAddr;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0400; }
|
||||
virtual bool AllowRegisterRead() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x0400; }
|
||||
virtual bool AllowRegisterRead() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read);
|
||||
AddRegisterRange(0x5000, 0x5FFF, MemoryOperation::Any);
|
||||
|
@ -102,7 +102,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
|
||||
|
@ -241,7 +241,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t ReadRegister(uint16_t addr)
|
||||
uint8_t ReadRegister(uint16_t addr) override
|
||||
{
|
||||
switch(addr & 0xF803) {
|
||||
case 0x5000: return 0; //Dip switches
|
||||
|
@ -253,7 +253,7 @@ protected:
|
|||
return MemoryManager::GetOpenBus();
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
switch(addr & 0xF803) {
|
||||
|
@ -336,14 +336,14 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void ProcessCpuClock()
|
||||
void ProcessCpuClock() override
|
||||
{
|
||||
if(_irqSource == JyIrqSource::CpuClock || (_irqSource == JyIrqSource::CpuWrite && CPU::IsCpuWrite())) {
|
||||
TickIrqCounter();
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t ReadVRAM(uint16_t addr, MemoryOperationType type)
|
||||
uint8_t ReadVRAM(uint16_t addr, MemoryOperationType type) override
|
||||
{
|
||||
if(_irqSource == JyIrqSource::PpuRead && type == MemoryOperationType::PpuRenderingRead) {
|
||||
TickIrqCounter();
|
||||
|
@ -351,7 +351,7 @@ protected:
|
|||
return BaseMapper::ReadVRAM(addr, type);
|
||||
}
|
||||
|
||||
void NotifyVRAMAddressChange(uint16_t addr)
|
||||
void NotifyVRAMAddressChange(uint16_t addr) override
|
||||
{
|
||||
if(_irqSource == JyIrqSource::PpuA12Rise && (addr & 0x1000) && !(_lastPpuAddr & 0x1000)) {
|
||||
TickIrqCounter();
|
||||
|
|
|
@ -11,10 +11,10 @@ class Kaiser202 : public BaseMapper
|
|||
uint8_t _prgRegs[4];
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0400; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x0400; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_irqReloadValue = 0;
|
||||
_irqCounter = 0;
|
||||
|
@ -25,7 +25,7 @@ protected:
|
|||
SelectPRGPage(3, -1);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_irqReloadValue, _irqCounter, _irqEnabled, _selectedReg, _prgRegs[0], _prgRegs[1], _prgRegs[2], _prgRegs[3]);
|
||||
|
@ -35,7 +35,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void ProcessCpuClock()
|
||||
void ProcessCpuClock() override
|
||||
{
|
||||
if(_irqEnabled) {
|
||||
_irqCounter++;
|
||||
|
@ -46,7 +46,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0xF000) {
|
||||
case 0x8000: _irqReloadValue = (_irqReloadValue & 0xFFF0) | (value & 0x0F); break;
|
||||
|
|
|
@ -7,8 +7,8 @@ class Kaiser7016 : public BaseMapper
|
|||
uint8_t _prgReg;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgReg);
|
||||
|
|
|
@ -8,13 +8,13 @@ private:
|
|||
uint8_t _reg;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual bool AllowRegisterRead() { return true; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
virtual bool AllowRegisterRead() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
_reg = 0;
|
||||
RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read);
|
||||
|
@ -22,19 +22,19 @@ protected:
|
|||
SelectPRGPage(0, 0);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
_reg = 0;
|
||||
ReadRegister(0xFFFC);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_reg);
|
||||
}
|
||||
|
||||
uint8_t ReadRegister(uint16_t addr)
|
||||
uint8_t ReadRegister(uint16_t addr) override
|
||||
{
|
||||
SelectCHRPage(0, _reg);
|
||||
SelectPRGPage(0, _reg);
|
||||
|
@ -43,7 +43,7 @@ protected:
|
|||
return InternalReadRam(addr);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr) {
|
||||
case 0x8000: SetMirroringType(value & 0x04 ? MirroringType::Horizontal : MirroringType::Vertical); break;
|
||||
|
|
|
@ -9,9 +9,9 @@ private:
|
|||
uint8_t _regs[8];
|
||||
|
||||
protected:
|
||||
uint32_t GetWorkRamPageSize() { return 0x1000; }
|
||||
uint16_t GetPRGPageSize() { return 0x1000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint32_t GetWorkRamPageSize() override { return 0x1000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x1000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
ArrayInfo<uint8_t> regs{ _regs, 8 };
|
||||
|
|
|
@ -8,8 +8,8 @@ private:
|
|||
uint8_t _regs[8];
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x800; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x800; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
ArrayInfo<uint8_t> regs{ _regs, 8 };
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
class Kaiser7058 : public BaseMapper
|
||||
{
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x1000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0xF000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x1000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0xF000; }
|
||||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
SelectPRGPage(0, 0);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0xF080) {
|
||||
case 0xF000: SelectCHRPage(0, value); break;
|
||||
|
|
|
@ -68,7 +68,7 @@ int32_t LabelManager::GetLabelAddress(uint16_t relativeAddr, bool checkRegisters
|
|||
|
||||
string LabelManager::GetLabel(uint16_t relativeAddr, bool checkRegisters)
|
||||
{
|
||||
uint32_t labelAddr = GetLabelAddress(relativeAddr, checkRegisters);
|
||||
int32_t labelAddr = GetLabelAddress(relativeAddr, checkRegisters);
|
||||
|
||||
if(labelAddr >= 0) {
|
||||
auto result = _codeLabels.find(labelAddr);
|
||||
|
@ -82,7 +82,7 @@ string LabelManager::GetLabel(uint16_t relativeAddr, bool checkRegisters)
|
|||
|
||||
string LabelManager::GetComment(uint16_t relativeAddr)
|
||||
{
|
||||
uint32_t labelAddr = GetLabelAddress(relativeAddr, false);
|
||||
int32_t labelAddr = GetLabelAddress(relativeAddr, false);
|
||||
|
||||
if(labelAddr >= 0) {
|
||||
auto result = _codeComments.find(labelAddr);
|
||||
|
|
|
@ -9,8 +9,8 @@ private:
|
|||
uint8_t _regs[8];
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
ArrayInfo<uint8_t> regs{ _regs, 8 };
|
||||
|
|
10
Core/Lh32.h
10
Core/Lh32.h
|
@ -8,10 +8,10 @@ private:
|
|||
uint8_t _prgReg;
|
||||
|
||||
protected:
|
||||
uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() { return 0x6000; }
|
||||
uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||
uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() override { return 0x6000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ protected:
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgReg);
|
||||
|
|
10
Core/MMC1.h
10
Core/MMC1.h
|
@ -165,7 +165,7 @@ class MMC1 : public BaseMapper
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_state.Reg8000, _state.RegA000, _state.RegC000, _state.RegE000, _writeBuffer, _shiftCount, _lastWriteCycle, _lastChrReg);
|
||||
|
@ -174,10 +174,10 @@ class MMC1 : public BaseMapper
|
|||
}
|
||||
}
|
||||
|
||||
virtual uint16_t GetPRGPageSize() { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x1000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x4000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x1000; }
|
||||
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
_state.Reg8000 = 0x0C; //On powerup: bits 2,3 of $8000 are set (this ensures the $8000 is bank 0, and $C000 is the last bank - needed for SEROM/SHROM/SH1ROM which do no support banking)
|
||||
_state.RegA000 = 0x00;
|
||||
|
@ -192,7 +192,7 @@ class MMC1 : public BaseMapper
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
int32_t currentCycle = CPU::GetCycleCount();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ private:
|
|||
bool _irqEnabled;
|
||||
|
||||
protected:
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
MMC1::InitMapper();
|
||||
_initState = 0;
|
||||
|
@ -18,13 +18,13 @@ protected:
|
|||
_state.RegA000 |= 0x10; //Set I bit to 1
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
MMC1::StreamState(saving);
|
||||
Stream(_initState, _irqCounter, _irqEnabled);
|
||||
}
|
||||
|
||||
void ProcessCpuClock()
|
||||
void ProcessCpuClock() override
|
||||
{
|
||||
if(_irqEnabled) {
|
||||
_irqCounter++;
|
||||
|
@ -36,7 +36,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void UpdateState()
|
||||
void UpdateState() override
|
||||
{
|
||||
if(_initState == 0 && (_state.RegA000 & 0x10) == 0x00) {
|
||||
_initState = 1;
|
||||
|
|
12
Core/MMC2.h
12
Core/MMC2.h
|
@ -22,10 +22,10 @@ class MMC2 : public BaseMapper
|
|||
uint8_t _rightChrPage[2];
|
||||
bool _needChrUpdate;
|
||||
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x1000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x1000; }
|
||||
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
_leftLatch = 1;
|
||||
_rightLatch = 1;
|
||||
|
@ -43,13 +43,13 @@ class MMC2 : public BaseMapper
|
|||
SelectCHRPage(0, 1);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_leftLatch, _rightLatch, _needChrUpdate, _leftChrPage[0], _leftChrPage[1], _rightChrPage[0], _rightChrPage[1]);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch((MMC2Registers)(addr >> 12)) {
|
||||
case MMC2Registers::RegA000:
|
||||
|
@ -83,7 +83,7 @@ class MMC2 : public BaseMapper
|
|||
}
|
||||
|
||||
public:
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr)
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr) override
|
||||
{
|
||||
if(_needChrUpdate) {
|
||||
SelectCHRPage(0, _leftChrPage[_leftLatch]);
|
||||
|
|
22
Core/MMC3.h
22
Core/MMC3.h
|
@ -66,7 +66,7 @@ class MMC3 : public BaseMapper
|
|||
return _chrMode;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void ResetMmc3()
|
||||
{
|
||||
_state.Reg8000 = 0;
|
||||
_state.RegA000 = 0;
|
||||
|
@ -148,7 +148,7 @@ class MMC3 : public BaseMapper
|
|||
_prgMode = (_state.Reg8000 & 0x40) >> 6;
|
||||
|
||||
if(_subMapperID == 1) {
|
||||
bool wramEnabled = (_state.Reg8000 & 0x20) == 0x20;
|
||||
//bool wramEnabled = (_state.Reg8000 & 0x20) == 0x20;
|
||||
RemoveCpuMemoryMapping(0x6000, 0x7000);
|
||||
|
||||
uint8_t firstBankAccess = (_state.RegA001 & 0x10 ? MemoryAccessType::Write : 0) | (_state.RegA001 & 0x20 ? MemoryAccessType::Read : 0);
|
||||
|
@ -175,7 +175,7 @@ class MMC3 : public BaseMapper
|
|||
UpdateChrMapping();
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
ArrayInfo<uint8_t> registers = { _registers, 8 };
|
||||
|
@ -190,24 +190,24 @@ class MMC3 : public BaseMapper
|
|||
UpdateState();
|
||||
}
|
||||
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0400; }
|
||||
virtual uint32_t GetSaveRamPageSize() { return _subMapperID == 1 ? 0x200 : 0x2000; }
|
||||
virtual uint32_t GetSaveRamSize() { return _subMapperID == 1 ? 0x400 : 0x2000; }
|
||||
virtual uint16_t GetPRGPageSize() override { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x0400; }
|
||||
virtual uint32_t GetSaveRamPageSize() override { return _subMapperID == 1 ? 0x200 : 0x2000; }
|
||||
virtual uint32_t GetSaveRamSize() override { return _subMapperID == 1 ? 0x400 : 0x2000; }
|
||||
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
//Force MMC3A irqs for boards that are known to use the A revision.
|
||||
//Some MMC3B boards also have the A behavior, but currently no way to tell them apart.
|
||||
_forceMmc3RevAIrqs = _databaseInfo.Chip.substr(0, 5).compare("MMC3A") == 0;
|
||||
|
||||
Reset();
|
||||
ResetMmc3();
|
||||
SetCpuMemoryMapping(0x6000, 0x7FFF, 0, HasBattery() ? PrgMemoryType::SaveRam : PrgMemoryType::WorkRam);
|
||||
UpdateState();
|
||||
UpdateMirroring();
|
||||
}
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch((MMC3Registers)(addr & 0xE001)) {
|
||||
case MMC3Registers::Reg8000:
|
||||
|
@ -271,7 +271,7 @@ class MMC3 : public BaseMapper
|
|||
|
||||
|
||||
public:
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr)
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr) override
|
||||
{
|
||||
switch(_a12Watcher.UpdateVramAddress(addr)) {
|
||||
case A12StateChange::Fall:
|
||||
|
|
|
@ -10,22 +10,22 @@ private:
|
|||
uint8_t _exRegs[2];
|
||||
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0x5000; }
|
||||
virtual bool ForceMmc3RevAIrqs() { return true; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x5000; }
|
||||
virtual bool ForceMmc3RevAIrqs() override { return true; }
|
||||
|
||||
void InitMapper()
|
||||
void InitMapper() override
|
||||
{
|
||||
MMC3::InitMapper();
|
||||
_exRegs[0] = _exRegs[1] = 0;
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_exRegs[0], _exRegs[1]);
|
||||
}
|
||||
|
||||
virtual void UpdatePrgMapping()
|
||||
virtual void UpdatePrgMapping() override
|
||||
{
|
||||
if(_exRegs[0] & 0x80) {
|
||||
SelectPrgPage2x(0, _exRegs[0] & 0x1F);
|
||||
|
@ -35,12 +35,12 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void UpdateMirroring()
|
||||
virtual void UpdateMirroring() override
|
||||
{
|
||||
//See $8000 writes below
|
||||
}
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0xE000) {
|
||||
case 0x4000: case 0x6000:
|
||||
|
|
|
@ -10,15 +10,15 @@ private:
|
|||
uint8_t _chrReg = 0;
|
||||
|
||||
protected:
|
||||
virtual uint16_t RegisterStartAddress() { return 0x6000; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default)
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default) override
|
||||
{
|
||||
page |= (_chrReg << 8);
|
||||
BaseMapper::SelectCHRPage(slot, page);
|
||||
}
|
||||
|
||||
virtual void UpdateState()
|
||||
virtual void UpdateState() override
|
||||
{
|
||||
MMC3::UpdateState();
|
||||
|
||||
|
@ -28,7 +28,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
if(addr & 0x01) {
|
||||
|
@ -42,7 +42,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_prgReg, _chrReg);
|
||||
|
|
|
@ -8,21 +8,21 @@ private:
|
|||
uint8_t _chrSelection = 0;
|
||||
|
||||
protected:
|
||||
virtual bool ForceMmc3RevAIrqs() { return true; }
|
||||
virtual bool ForceMmc3RevAIrqs() override { return true; }
|
||||
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
AddRegisterRange(0x4020, 0x5FFF);
|
||||
MMC3::InitMapper();
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_chrSelection);
|
||||
}
|
||||
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default)
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default) override
|
||||
{
|
||||
if(slot < 4 && (_chrSelection & 0x01)) {
|
||||
//0x0000 to 0x0FFF
|
||||
|
@ -35,7 +35,7 @@ protected:
|
|||
MMC3::SelectCHRPage(slot, page, memoryType);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr <= 0x5FFF) {
|
||||
_chrSelection = value;
|
||||
|
|
|
@ -9,9 +9,9 @@ private:
|
|||
uint8_t _exRegs[8];
|
||||
|
||||
protected:
|
||||
virtual bool AllowRegisterRead() { return true; }
|
||||
virtual bool AllowRegisterRead() override { return true; }
|
||||
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
MMC3::InitMapper();
|
||||
|
||||
|
@ -19,18 +19,18 @@ protected:
|
|||
RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read);
|
||||
}
|
||||
|
||||
virtual void Reset(bool softReset)
|
||||
virtual void Reset(bool softReset) override
|
||||
{
|
||||
memset(_exRegs, 0, sizeof(_exRegs));
|
||||
_exRegs[3] = 0x80;
|
||||
}
|
||||
|
||||
virtual uint8_t ReadRegister(uint16_t addr)
|
||||
virtual uint8_t ReadRegister(uint16_t addr) override
|
||||
{
|
||||
return _exRegs[4];
|
||||
}
|
||||
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType)
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
|
||||
{
|
||||
uint8_t orValue = (_exRegs[3] & 0x80) >> 2;
|
||||
if(_exRegs[5] & 0x3F) {
|
||||
|
@ -43,7 +43,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType)
|
||||
void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType) override
|
||||
{
|
||||
if(_prgSize == _chrRomSize) {
|
||||
//Hack for Super 3-in-1
|
||||
|
@ -78,7 +78,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
//$5000-$5FFF
|
||||
|
@ -109,7 +109,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
ArrayInfo<uint8_t> exRegs{ _exRegs, 8 };
|
||||
|
|
|
@ -7,7 +7,7 @@ class MMC3_126 : public MMC3
|
|||
private:
|
||||
uint8_t _exRegs[4];
|
||||
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType) override
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
|
||||
{
|
||||
uint16_t reg = _exRegs[0];
|
||||
page &= ((~reg >> 2) & 0x10) | 0x0F;
|
||||
|
|
|
@ -11,7 +11,7 @@ private:
|
|||
uint8_t _mode;
|
||||
|
||||
protected:
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
_mode = 0;
|
||||
_vrcMirroring = 0;
|
||||
|
@ -21,7 +21,7 @@ protected:
|
|||
MMC3::InitMapper();
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
ArrayInfo<uint8_t> prgRegs{ _vrcPrgRegs, 2 };
|
||||
|
@ -29,7 +29,7 @@ protected:
|
|||
Stream(_mode, _vrcMirroring, prgRegs, chrRegs);
|
||||
}
|
||||
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default)
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default) override
|
||||
{
|
||||
if(_mode & 0x02) {
|
||||
if(slot <= 3) {
|
||||
|
@ -59,7 +59,7 @@ protected:
|
|||
SetMirroringType(_vrcMirroring & 0x01 ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr == 0xA131) {
|
||||
_mode = value;
|
||||
|
|
|
@ -9,17 +9,17 @@ private:
|
|||
bool _needUpdate = false;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetCHRPageSize() { return 0x1000; }
|
||||
virtual uint32_t GetChrRamSize() { return 0x1000; }
|
||||
virtual uint16_t GetChrRamPageSize() { return 0x1000; }
|
||||
virtual uint16_t GetCHRPageSize() override { return 0x1000; }
|
||||
virtual uint32_t GetChrRamSize() override { return 0x1000; }
|
||||
virtual uint16_t GetChrRamPageSize() override { return 0x1000; }
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_chrLatch[0], _chrLatch[1], _needUpdate);
|
||||
}
|
||||
|
||||
virtual void UpdateChrMapping()
|
||||
virtual void UpdateChrMapping() override
|
||||
{
|
||||
uint16_t page;
|
||||
|
||||
|
@ -35,7 +35,7 @@ protected:
|
|||
_needUpdate = false;
|
||||
}
|
||||
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr)
|
||||
virtual void NotifyVRAMAddressChange(uint16_t addr) override
|
||||
{
|
||||
if(_needUpdate) {
|
||||
UpdateChrMapping();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class MMC3_182 : public MMC3
|
||||
{
|
||||
protected:
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0xE001) {
|
||||
case 0x8001: MMC3::WriteRegister(0xA000, value); break;
|
||||
|
|
|
@ -9,9 +9,9 @@ private:
|
|||
uint8_t _exRegs[2];
|
||||
|
||||
protected:
|
||||
virtual bool AllowRegisterRead() { return true; }
|
||||
virtual bool AllowRegisterRead() override { return true; }
|
||||
|
||||
virtual void InitMapper()
|
||||
virtual void InitMapper() override
|
||||
{
|
||||
MMC3::InitMapper();
|
||||
|
||||
|
@ -21,7 +21,7 @@ protected:
|
|||
RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read);
|
||||
}
|
||||
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default)
|
||||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default) override
|
||||
{
|
||||
if((_chrMode && slot >= 4) || (!_chrMode && slot < 4)) {
|
||||
page |= 0x100;
|
||||
|
@ -29,7 +29,7 @@ protected:
|
|||
BaseMapper::SelectCHRPage(slot, page);
|
||||
}
|
||||
|
||||
virtual void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom)
|
||||
virtual void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
|
||||
{
|
||||
if(!(_exRegs[0] & 0x80)) {
|
||||
BaseMapper::SelectPRGPage(slot, page & 0x3F, memoryType);
|
||||
|
@ -59,13 +59,13 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual uint8_t ReadRegister(uint16_t addr)
|
||||
virtual uint8_t ReadRegister(uint16_t addr) override
|
||||
{
|
||||
uint8_t security[4] = { 0x83,0x83,0x42,0x00 };
|
||||
return security[_exRegs[1] & 0x03];
|
||||
}
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
if(addr == 0x5000 || addr == 0x6000) {
|
||||
|
@ -86,7 +86,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_exRegs[0], _exRegs[1]);
|
||||
|
|
|
@ -8,9 +8,9 @@ class MMC3_189 : public MMC3
|
|||
private:
|
||||
uint8_t _prgReg = 0;
|
||||
|
||||
virtual uint16_t RegisterStartAddress() { return 0x4120; }
|
||||
virtual uint16_t RegisterStartAddress() override { return 0x4120; }
|
||||
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value)
|
||||
virtual void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr <= 0x4FFF) {
|
||||
_prgReg = value;
|
||||
|
@ -20,7 +20,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void UpdateState()
|
||||
virtual void UpdateState() override
|
||||
{
|
||||
MMC3::UpdateState();
|
||||
|
||||
|
@ -33,7 +33,7 @@ private:
|
|||
SelectPRGPage(3, prgPage+3);
|
||||
}
|
||||
|
||||
virtual void StreamState(bool saving)
|
||||
virtual void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_prgReg);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue