From b4489ed0f721430e9c3d4d5fd9ffa9a133812916 Mon Sep 17 00:00:00 2001 From: Souryo Date: Sat, 17 Dec 2016 23:14:47 -0500 Subject: [PATCH] Linux: Fixed all clang warnings --- Core/A12Watcher.h | 2 +- Core/A65AS.h | 4 ++-- Core/APU.h | 8 ++++---- Core/AXROM.h | 10 ++++----- Core/Ac08.h | 2 +- Core/Action53.h | 10 ++++----- Core/ActionEnterprises.h | 10 ++++----- Core/ApuEnvelope.h | 4 ++-- Core/ApuFrameCounter.h | 8 ++++---- Core/ApuLengthCounter.h | 8 ++++---- Core/ArkanoidController.h | 12 +++++------ Core/AutoRomTest.h | 2 +- Core/Ax5705.h | 4 ++-- Core/BF9096.h | 10 ++++----- Core/BF909x.h | 10 ++++----- Core/Bandai74161_7432.h | 10 ++++----- Core/BandaiFcg.h | 20 +++++++++--------- Core/BandaiKaraoke.h | 12 +++++------ Core/BaseApuChannel.h | 4 ++-- Core/BaseControlDevice.h | 2 +- Core/BaseExpansionAudio.h | 2 +- Core/BaseFdsChannel.h | 2 +- Core/BaseMapper.cpp | 4 ++-- Core/BaseMapper.h | 13 +++++------- Core/Bb.h | 2 +- Core/Bmc11160.h | 2 +- Core/Bmc12in1.h | 2 +- Core/Bmc190in1.h | 4 ++-- Core/Bmc235.h | 12 +++++------ Core/Bmc255.h | 8 ++++---- Core/Bmc51.h | 14 ++++++------- Core/Bmc63.h | 12 +++++------ Core/Bmc64in1NoRepeat.h | 4 ++-- Core/Bmc70in1.h | 6 +++--- Core/Bmc810544CA1.h | 2 +- Core/BmcG146.h | 2 +- Core/BmcNtd03.h | 2 +- Core/BnRom.h | 8 ++++---- Core/Bs5.h | 8 ++++---- Core/CNROM.h | 10 ++++----- Core/CPU.h | 2 +- Core/Caltron41.h | 16 +++++++-------- Core/Cc21.h | 4 ++-- Core/ColorDreams.h | 10 ++++----- Core/ColorDreams46.h | 14 ++++++------- Core/Console.h | 1 - Core/ControlManager.h | 8 ++++---- Core/CpRom.h | 10 ++++----- Core/DaouInfosys.h | 14 ++++++------- Core/DeltaModulationChannel.h | 12 +++++------ Core/Disassembler.cpp | 2 +- Core/DreamTech01.h | 8 ++++---- Core/Edu2000.h | 8 ++++---- Core/FDS.h | 28 +++++++++++++------------- Core/FdsAudio.h | 4 ++-- Core/FrontFareast.h | 18 ++++++++--------- Core/GameClient.h | 2 +- Core/GameClientConnection.h | 4 ++-- Core/GameServerConnection.h | 4 ++-- Core/Ghostbusters63in1.h | 8 ++++---- Core/Gs2004.h | 4 ++-- Core/Gs2013.h | 4 ++-- Core/GxRom.h | 8 ++++---- Core/HdNesPack.h | 2 +- Core/Henggedianzi177.h | 12 +++++------ Core/Henggedianzi179.h | 12 +++++------ Core/IremG101.h | 10 ++++----- Core/IremH3001.h | 12 +++++------ Core/IremLrog017.h | 14 ++++++------- Core/IremTamS1.h | 8 ++++---- Core/JalecoJf11_14.h | 12 +++++------ Core/JalecoJf13.h | 12 +++++------ Core/JalecoJf16.h | 10 ++++----- Core/JalecoJf17_19.h | 12 +++++------ Core/JalecoJfxx.h | 12 +++++------ Core/JalecoSs88006.h | 12 +++++------ Core/JyCompany.h | 20 +++++++++--------- Core/Kaiser202.h | 12 +++++------ Core/Kaiser7016.h | 6 +++--- Core/Kaiser7022.h | 20 +++++++++--------- Core/Kaiser7037.h | 8 ++++---- Core/Kaiser7057.h | 6 +++--- Core/Kaiser7058.h | 12 +++++------ Core/LabelManager.cpp | 4 ++-- Core/Lh10.h | 6 +++--- Core/Lh32.h | 10 ++++----- Core/MMC1.h | 10 ++++----- Core/MMC1_105.h | 8 ++++---- Core/MMC2.h | 12 +++++------ Core/MMC3.h | 22 ++++++++++---------- Core/MMC3_114.h | 14 ++++++------- Core/MMC3_115.h | 10 ++++----- Core/MMC3_12.h | 10 ++++----- Core/MMC3_121.h | 16 +++++++-------- Core/MMC3_126.h | 2 +- Core/MMC3_14.h | 8 ++++---- Core/MMC3_165.h | 12 +++++------ Core/MMC3_182.h | 2 +- Core/MMC3_187.h | 14 ++++++------- Core/MMC3_189.h | 8 ++++---- Core/MMC3_196.h | 2 +- Core/MMC3_197.h | 2 +- Core/MMC3_199.h | 4 ++-- Core/MMC3_205.h | 12 +++++------ Core/MMC3_215.h | 2 +- Core/MMC3_217.h | 2 +- Core/MMC3_219.h | 2 +- Core/MMC3_238.h | 10 ++++----- Core/MMC3_249.h | 10 ++++----- Core/MMC3_250.h | 2 +- Core/MMC3_254.h | 10 ++++----- Core/MMC3_37.h | 14 ++++++------- Core/MMC3_44.h | 10 ++++----- Core/MMC3_45.h | 14 ++++++------- Core/MMC3_47.h | 14 ++++++------- Core/MMC3_49.h | 14 ++++++------- Core/MMC3_52.h | 14 ++++++------- Core/MMC3_ChrRam.h | 8 ++++---- Core/MMC3_Coolboy.h | 8 ++++---- Core/MMC3_StreetHeroes.h | 12 +++++------ Core/MMC4.h | 8 ++++---- Core/MMC5.h | 38 +++++++++++++++++------------------ Core/MMC5Audio.h | 18 ++++++++--------- Core/Malee.h | 6 +++--- Core/Mapper103.h | 16 +++++++-------- Core/Mapper106.h | 12 +++++------ Core/Mapper107.h | 8 ++++---- Core/Mapper108.h | 14 ++++++------- Core/Mapper112.h | 8 ++++---- Core/Mapper117.h | 12 +++++------ Core/Mapper120.h | 14 ++++++------- Core/Mapper15.h | 8 ++++---- Core/Mapper170.h | 20 +++++++++--------- Core/Mapper183.h | 16 +++++++-------- Core/Mapper200.h | 8 ++++---- Core/Mapper201.h | 8 ++++---- Core/Mapper202.h | 10 ++++----- Core/Mapper203.h | 8 ++++---- Core/Mapper204.h | 8 ++++---- Core/Mapper212.h | 12 +++++------ Core/Mapper213.h | 8 ++++---- Core/Mapper214.h | 8 ++++---- Core/Mapper216.h | 12 +++++------ Core/Mapper218.h | 8 ++++---- Core/Mapper220.h | 4 ++-- Core/Mapper221.h | 10 ++++----- Core/Mapper222.h | 12 +++++------ Core/Mapper225.h | 8 ++++---- Core/Mapper226.h | 12 +++++------ Core/Mapper227.h | 8 ++++---- Core/Mapper229.h | 8 ++++---- Core/Mapper230.h | 12 +++++------ Core/Mapper231.h | 10 ++++----- Core/Mapper233.h | 6 +++--- Core/Mapper234.h | 18 ++++++++--------- Core/Mapper240.h | 12 +++++------ Core/Mapper241.h | 8 ++++---- Core/Mapper242.h | 10 ++++----- Core/Mapper244.h | 8 ++++---- Core/Mapper246.h | 14 ++++++------- Core/Mapper253.h | 16 +++++++-------- Core/Mapper35.h | 12 +++++------ Core/Mapper40.h | 12 +++++------ Core/Mapper42.h | 12 +++++------ Core/Mapper50.h | 16 +++++++-------- Core/Mapper57.h | 10 ++++----- Core/Mapper58.h | 8 ++++---- Core/Mapper60.h | 10 ++++----- Core/Mapper61.h | 8 ++++---- Core/Mapper62.h | 10 ++++----- Core/Mapper83.h | 8 ++++---- Core/Mapper91.h | 14 ++++++------- Core/MemoryManager.h | 2 +- Core/ModChannel.h | 4 ++-- Core/NROM.h | 6 +++--- Core/Namco108.h | 4 ++-- Core/Namco108_154.h | 2 +- Core/Namco108_76.h | 4 ++-- Core/Namco108_88.h | 2 +- Core/Namco108_95.h | 2 +- Core/Namco163.h | 22 ++++++++++---------- Core/Namco163Audio.h | 4 ++-- Core/Nanjing.h | 18 ++++++++--------- Core/Nina01.h | 12 +++++------ Core/Nina03_06.h | 12 +++++------ Core/NoiseChannel.h | 10 ++++----- Core/NovelDiamond.h | 4 ++-- Core/NsfCart31.h | 12 +++++------ Core/NsfMapper.h | 26 ++++++++++++------------ Core/NtdecTc112.h | 12 +++++------ Core/OekaKids.h | 14 ++++++------- Core/OekaKidsTablet.h | 10 ++++----- Core/OpllChannel.h | 2 +- Core/OpllEmulator.h | 6 +++--- Core/OpllTables.h | 2 +- Core/PPU.h | 8 ++++---- Core/Racermate.h | 18 ++++++++--------- Core/Rambo1.h | 14 ++++++------- Core/Rt01.h | 4 ++-- Core/Sachen74LS374N.h | 14 ++++++------- Core/Sachen74LS374NB.h | 20 +++++++++--------- Core/Sachen8259.h | 14 ++++++------- Core/Sachen_133.h | 12 +++++------ Core/Sachen_136.h | 18 ++++++++--------- Core/Sachen_143.h | 8 ++++---- Core/Sachen_145.h | 12 +++++------ Core/Sachen_147.h | 12 +++++------ Core/Sachen_148.h | 8 ++++---- Core/Sachen_149.h | 8 ++++---- Core/Smb2j.h | 8 ++++---- Core/SoundMixer.h | 2 +- Core/SquareChannel.h | 10 ++++----- Core/StandardController.h | 10 ++++----- Core/StudyBox.h | 28 +++++++++++++------------- Core/Subor166.h | 10 ++++----- Core/Sunsoft184.h | 12 +++++------ Core/Sunsoft3.h | 12 +++++------ Core/Sunsoft4.h | 10 ++++----- Core/Sunsoft5bAudio.h | 4 ++-- Core/Sunsoft89.h | 8 ++++---- Core/Sunsoft93.h | 8 ++++---- Core/SunsoftFme7.h | 20 +++++++++--------- Core/Super40in1Ws.h | 8 ++++---- Core/Supervision.h | 14 ++++++------- Core/T262.h | 4 ++-- Core/TaitoTc0190.h | 8 ++++---- Core/TaitoTc0690.h | 10 ++++----- Core/TaitoX1005.h | 24 +++++++++++----------- Core/TaitoX1017.h | 20 +++++++++--------- Core/Tf1201.h | 12 +++++------ Core/TriangleChannel.h | 10 ++++----- Core/TxSRom.h | 4 ++-- Core/Txc22000.h | 18 ++++++++--------- Core/Txc22211A.h | 18 ++++++++--------- Core/Txc22211C.h | 2 +- Core/UNROM.h | 10 ++++----- Core/UnRom_180.h | 8 ++++---- Core/UnRom_94.h | 8 ++++---- Core/UnlPci556.h | 12 +++++------ Core/VRC1.h | 10 ++++----- Core/VRC2_4.h | 12 +++++------ Core/VRC3.h | 12 +++++------ Core/VRC6.h | 12 +++++------ Core/VRC7.h | 12 +++++------ Core/Vrc6Audio.h | 4 ++-- Core/Vrc6Pulse.h | 2 +- Core/Vrc6Saw.h | 2 +- Core/Vrc7Audio.h | 4 ++-- Core/VrcIrq.h | 2 +- Core/VsControlManager.h | 14 ++++++------- Core/VsSystem.h | 10 ++++----- Core/Waixing162.h | 14 ++++++------- Core/Waixing164.h | 14 ++++++------- Core/Waixing176.h | 14 ++++++------- Core/Waixing178.h | 16 +++++++-------- Core/Waixing252.h | 12 +++++------ Core/Zapper.h | 10 ++++----- Linux/BaseRenderer.cpp | 2 +- Linux/SdlRenderer.cpp | 8 ++++---- Linux/SdlSoundManager.h | 1 - Linux/SpriteFont.cpp | 7 +------ Utilities/Socket.cpp | 2 +- Utilities/Socket.h | 5 ++++- Utilities/Timer.h | 2 ++ 264 files changed, 1249 insertions(+), 1254 deletions(-) diff --git a/Core/A12Watcher.h b/Core/A12Watcher.h index d0ed3338..c30a60e7 100644 --- a/Core/A12Watcher.h +++ b/Core/A12Watcher.h @@ -19,7 +19,7 @@ private: uint32_t _cyclesDown = 0; public: - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(_lastCycle, _cyclesDown); } diff --git a/Core/A65AS.h b/Core/A65AS.h index ca0279a0..364c55d7 100644 --- a/Core/A65AS.h +++ b/Core/A65AS.h @@ -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 { diff --git a/Core/APU.h b/Core/APU.h index 2e460f15..c3ac0905 100644 --- a/Core/APU.h +++ b/Core/APU.h @@ -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(); diff --git a/Core/AXROM.h b/Core/AXROM.h index 81c3c931..88cf2a3e 100644 --- a/Core/AXROM.h +++ b/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); diff --git a/Core/Ac08.h b/Core/Ac08.h index 7bc7788a..093ac0c5 100644 --- a/Core/Ac08.h +++ b/Core/Ac08.h @@ -22,7 +22,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_reg); diff --git a/Core/Action53.h b/Core/Action53.h index b7f0d77d..5e370bf7 100644 --- a/Core/Action53.h +++ b/Core/Action53.h @@ -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); diff --git a/Core/ActionEnterprises.h b/Core/ActionEnterprises.h index d5f78699..f8f071a9 100644 --- a/Core/ActionEnterprises.h +++ b/Core/ActionEnterprises.h @@ -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; diff --git a/Core/ApuEnvelope.h b/Core/ApuEnvelope.h index 126f798d..1df00fd6 100644 --- a/Core/ApuEnvelope.h +++ b/Core/ApuEnvelope.h @@ -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); diff --git a/Core/ApuFrameCounter.h b/Core/ApuFrameCounter.h index 4d4cb53c..51c1da9e 100644 --- a/Core/ApuFrameCounter.h +++ b/Core/ApuFrameCounter.h @@ -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; diff --git a/Core/ApuLengthCounter.h b/Core/ApuLengthCounter.h index 5367990f..801567c9 100644 --- a/Core/ApuLengthCounter.h +++ b/Core/ApuLengthCounter.h @@ -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; diff --git a/Core/ArkanoidController.h b/Core/ArkanoidController.h index 6d87d3d0..4469bd25 100644 --- a/Core/ArkanoidController.h +++ b/Core/ArkanoidController.h @@ -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); }; \ No newline at end of file diff --git a/Core/AutoRomTest.h b/Core/AutoRomTest.h index 1ea67d75..a3e55565 100644 --- a/Core/AutoRomTest.h +++ b/Core/AutoRomTest.h @@ -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); diff --git a/Core/Ax5705.h b/Core/Ax5705.h index 5d52e3db..fbe48a87 100644 --- a/Core/Ax5705.h +++ b/Core/Ax5705.h @@ -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 { diff --git a/Core/BF9096.h b/Core/BF9096.h index 8f0f0123..97f689da 100644 --- a/Core/BF9096.h +++ b/Core/BF9096.h @@ -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); diff --git a/Core/BF909x.h b/Core/BF909x.h index ed45e08a..d33dfce3 100644 --- a/Core/BF909x.h +++ b/Core/BF909x.h @@ -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); diff --git a/Core/Bandai74161_7432.h b/Core/Bandai74161_7432.h index adbb6e26..d6c2db3e 100644 --- a/Core/Bandai74161_7432.h +++ b/Core/Bandai74161_7432.h @@ -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); diff --git a/Core/BandaiFcg.h b/Core/BandaiFcg.h index 49bf79eb..da8546e6 100644 --- a/Core/BandaiFcg.h +++ b/Core/BandaiFcg.h @@ -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: diff --git a/Core/BandaiKaraoke.h b/Core/BandaiKaraoke.h index a49d8dfd..3be9394e 100644 --- a/Core/BandaiKaraoke.h +++ b/Core/BandaiKaraoke.h @@ -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 diff --git a/Core/BaseApuChannel.h b/Core/BaseApuChannel.h index 8724a2b4..2b8b194c 100644 --- a/Core/BaseApuChannel.h +++ b/Core/BaseApuChannel.h @@ -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; } diff --git a/Core/BaseControlDevice.h b/Core/BaseControlDevice.h index 2a6c4520..f7e1278f 100644 --- a/Core/BaseControlDevice.h +++ b/Core/BaseControlDevice.h @@ -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) diff --git a/Core/BaseExpansionAudio.h b/Core/BaseExpansionAudio.h index 8fae489e..5d58da8e 100644 --- a/Core/BaseExpansionAudio.h +++ b/Core/BaseExpansionAudio.h @@ -11,7 +11,7 @@ private: protected: virtual void ClockAudio() = 0; - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(_clocksNeeded); } diff --git a/Core/BaseFdsChannel.h b/Core/BaseFdsChannel.h index 3f1e40ef..7caf8438 100644 --- a/Core/BaseFdsChannel.h +++ b/Core/BaseFdsChannel.h @@ -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); } diff --git a/Core/BaseMapper.cpp b/Core/BaseMapper.cpp index f0375651..bfb49071 100644 --- a/Core/BaseMapper.cpp +++ b/Core/BaseMapper.cpp @@ -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); diff --git a/Core/BaseMapper.h b/Core/BaseMapper.h index def69bbf..b143117c 100644 --- a/Core/BaseMapper.h +++ b/Core/BaseMapper.h @@ -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); diff --git a/Core/Bb.h b/Core/Bb.h index 44389fcb..a245ec3e 100644 --- a/Core/Bb.h +++ b/Core/Bb.h @@ -21,7 +21,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgReg, _chrReg); diff --git a/Core/Bmc11160.h b/Core/Bmc11160.h index d44987a5..932851cb 100644 --- a/Core/Bmc11160.h +++ b/Core/Bmc11160.h @@ -12,7 +12,7 @@ protected: { } - void Reset(bool softReset) + void Reset(bool softReset) override { BaseMapper::Reset(softReset); WriteRegister(0x8000, 0); diff --git a/Core/Bmc12in1.h b/Core/Bmc12in1.h index 0d2e4423..f3c4d106 100644 --- a/Core/Bmc12in1.h +++ b/Core/Bmc12in1.h @@ -19,7 +19,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_regs[0], _regs[1], _mode); diff --git a/Core/Bmc190in1.h b/Core/Bmc190in1.h index 30c02be3..6ff74851 100644 --- a/Core/Bmc190in1.h +++ b/Core/Bmc190in1.h @@ -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 { diff --git a/Core/Bmc235.h b/Core/Bmc235.h index 21da32d7..9a97675a 100644 --- a/Core/Bmc235.h +++ b/Core/Bmc235.h @@ -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); diff --git a/Core/Bmc255.h b/Core/Bmc255.h index 708d2a1f..ab16f9f2 100644 --- a/Core/Bmc255.h +++ b/Core/Bmc255.h @@ -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); diff --git a/Core/Bmc51.h b/Core/Bmc51.h index c6ed1322..fa078d6c 100644 --- a/Core/Bmc51.h +++ b/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); diff --git a/Core/Bmc63.h b/Core/Bmc63.h index 856af06b..f5ee919a 100644 --- a/Core/Bmc63.h +++ b/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); diff --git a/Core/Bmc64in1NoRepeat.h b/Core/Bmc64in1NoRepeat.h index 73886810..2aa178f3 100644 --- a/Core/Bmc64in1NoRepeat.h +++ b/Core/Bmc64in1NoRepeat.h @@ -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]); diff --git a/Core/Bmc70in1.h b/Core/Bmc70in1.h index 1a06fe09..80d7215b 100644 --- a/Core/Bmc70in1.h +++ b/Core/Bmc70in1.h @@ -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 { diff --git a/Core/Bmc810544CA1.h b/Core/Bmc810544CA1.h index 6c2422d9..3cad4785 100644 --- a/Core/Bmc810544CA1.h +++ b/Core/Bmc810544CA1.h @@ -12,7 +12,7 @@ protected: { } - void Reset(bool softReset) + void Reset(bool softReset) override { BaseMapper::Reset(softReset); WriteRegister(0x8000, 0); diff --git a/Core/BmcG146.h b/Core/BmcG146.h index 9f0637a9..19d03de0 100644 --- a/Core/BmcG146.h +++ b/Core/BmcG146.h @@ -12,7 +12,7 @@ protected: { } - void Reset(bool softReset) + void Reset(bool softReset) override { BaseMapper::Reset(softReset); diff --git a/Core/BmcNtd03.h b/Core/BmcNtd03.h index 885a8c73..6e72afcc 100644 --- a/Core/BmcNtd03.h +++ b/Core/BmcNtd03.h @@ -12,7 +12,7 @@ protected: { } - void Reset(bool softReset) + void Reset(bool softReset) override { BaseMapper::Reset(softReset); WriteRegister(0x8000, 0); diff --git a/Core/BnRom.h b/Core/BnRom.h index 769c6f89..de4cef41 100644 --- a/Core/BnRom.h +++ b/Core/BnRom.h @@ -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); diff --git a/Core/Bs5.h b/Core/Bs5.h index e0a46358..cdf5cad5 100644 --- a/Core/Bs5.h +++ b/Core/Bs5.h @@ -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; diff --git a/Core/CNROM.h b/Core/CNROM.h index f31bee58..02c06902 100644 --- a/Core/CNROM.h +++ b/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" diff --git a/Core/CPU.h b/Core/CPU.h index 107ca50a..77afefb4 100644 --- a/Core/CPU.h +++ b/Core/CPU.h @@ -843,7 +843,7 @@ private: } protected: - void StreamState(bool saving); + void StreamState(bool saving) override; public: static const uint32_t ClockRateNtsc = 1789773; diff --git a/Core/Caltron41.h b/Core/Caltron41.h index 8450907c..3b10b26b 100644 --- a/Core/Caltron41.h +++ b/Core/Caltron41.h @@ -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; diff --git a/Core/Cc21.h b/Core/Cc21.h index b418b43e..68820349 100644 --- a/Core/Cc21.h +++ b/Core/Cc21.h @@ -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 { diff --git a/Core/ColorDreams.h b/Core/ColorDreams.h index 28041a9b..ed8f79da 100644 --- a/Core/ColorDreams.h +++ b/Core/ColorDreams.h @@ -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." diff --git a/Core/ColorDreams46.h b/Core/ColorDreams46.h index d99552e0..b944b952 100644 --- a/Core/ColorDreams46.h +++ b/Core/ColorDreams46.h @@ -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; diff --git a/Core/Console.h b/Core/Console.h index 0ae4c33b..9acefaf9 100644 --- a/Core/Console.h +++ b/Core/Console.h @@ -37,7 +37,6 @@ class Console string _romFilepath; bool _stop = false; - bool _reset = false; atomic _resetRequested; atomic _lagCounter; diff --git a/Core/ControlManager.h b/Core/ControlManager.h index 03f2b780..f519867b 100644 --- a/Core/ControlManager.h +++ b/Core/ControlManager.h @@ -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; }; \ No newline at end of file diff --git a/Core/CpRom.h b/Core/CpRom.h index 12f69b77..ca1c571e 100644 --- a/Core/CpRom.h +++ b/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); diff --git a/Core/DaouInfosys.h b/Core/DaouInfosys.h index 3d764dda..bc81f0b3 100644 --- a/Core/DaouInfosys.h +++ b/Core/DaouInfosys.h @@ -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: diff --git a/Core/DeltaModulationChannel.h b/Core/DeltaModulationChannel.h index 1db07e74..f77cb325 100644 --- a/Core/DeltaModulationChannel.h +++ b/Core/DeltaModulationChannel.h @@ -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(); diff --git a/Core/Disassembler.cpp b/Core/Disassembler.cpp index fdd55109..c3c9b0a5 100644 --- a/Core/Disassembler.cpp +++ b/Core/Disassembler.cpp @@ -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> *cache; if(memoryAddr < 0x2000) { addr = memoryAddr & 0x7FF; diff --git a/Core/DreamTech01.h b/Core/DreamTech01.h index d352f968..eccc0e8d 100644 --- a/Core/DreamTech01.h +++ b/Core/DreamTech01.h @@ -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 { diff --git a/Core/Edu2000.h b/Core/Edu2000.h index f2d7330e..c5a843ae 100644 --- a/Core/Edu2000.h +++ b/Core/Edu2000.h @@ -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 { diff --git a/Core/FDS.h b/Core/FDS.h index d0c87e69..2bc1da31 100644 --- a/Core/FDS.h +++ b/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(); diff --git a/Core/FdsAudio.h b/Core/FdsAudio.h index 2653ea27..1e6e83fd 100644 --- a/Core/FdsAudio.h +++ b/Core/FdsAudio.h @@ -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); diff --git a/Core/FrontFareast.h b/Core/FrontFareast.h index a427ab19..d1249786 100644 --- a/Core/FrontFareast.h +++ b/Core/FrontFareast.h @@ -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: diff --git a/Core/GameClient.h b/Core/GameClient.h index fb2ab698..b3481488 100644 --- a/Core/GameClient.h +++ b/Core/GameClient.h @@ -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; }; \ No newline at end of file diff --git a/Core/GameClientConnection.h b/Core/GameClientConnection.h index b73949b0..a3dd7564 100644 --- a/Core/GameClientConnection.h +++ b/Core/GameClientConnection.h @@ -35,13 +35,13 @@ private: void DisableControllers(); protected: - void ProcessMessage(NetMessage* message); + void ProcessMessage(NetMessage* message) override; public: GameClientConnection(shared_ptr socket, shared_ptr connectionData); ~GameClientConnection(); - void ProcessNotification(ConsoleNotificationType type, void* parameter); + void ProcessNotification(ConsoleNotificationType type, void* parameter) override; uint8_t GetControllerState(uint8_t port); void SendInput(); diff --git a/Core/GameServerConnection.h b/Core/GameServerConnection.h index efeffc4c..f5e2ad4d 100644 --- a/Core/GameServerConnection.h +++ b/Core/GameServerConnection.h @@ -29,7 +29,7 @@ private: static uint8_t GetFirstFreeControllerPort(); protected: - void ProcessMessage(NetMessage* message); + void ProcessMessage(NetMessage* message) override; public: GameServerConnection(shared_ptr 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); }; diff --git a/Core/Ghostbusters63in1.h b/Core/Ghostbusters63in1.h index 34740938..a78702d2 100644 --- a/Core/Ghostbusters63in1.h +++ b/Core/Ghostbusters63in1.h @@ -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]); diff --git a/Core/Gs2004.h b/Core/Gs2004.h index a4f44cb9..e8be57ee 100644 --- a/Core/Gs2004.h +++ b/Core/Gs2004.h @@ -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 { diff --git a/Core/Gs2013.h b/Core/Gs2013.h index 68cb2dd4..646e59e4 100644 --- a/Core/Gs2013.h +++ b/Core/Gs2013.h @@ -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 { diff --git a/Core/GxRom.h b/Core/GxRom.h index 35de83e7..ecdbed52 100644 --- a/Core/GxRom.h +++ b/Core/GxRom.h @@ -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); diff --git a/Core/HdNesPack.h b/Core/HdNesPack.h index d88fadad..d1983f4b 100644 --- a/Core/HdNesPack.h +++ b/Core/HdNesPack.h @@ -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(); diff --git a/Core/Henggedianzi177.h b/Core/Henggedianzi177.h index ffedd7a5..536ec645 100644 --- a/Core/Henggedianzi177.h +++ b/Core/Henggedianzi177.h @@ -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); diff --git a/Core/Henggedianzi179.h b/Core/Henggedianzi179.h index 807336d0..83511d86 100644 --- a/Core/Henggedianzi179.h +++ b/Core/Henggedianzi179.h @@ -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); diff --git a/Core/IremG101.h b/Core/IremG101.h index 462f3d5b..1909a29a 100644 --- a/Core/IremG101.h +++ b/Core/IremG101.h @@ -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: diff --git a/Core/IremH3001.h b/Core/IremH3001.h index b74b099b..7d576f55 100644 --- a/Core/IremH3001.h +++ b/Core/IremH3001.h @@ -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; diff --git a/Core/IremLrog017.h b/Core/IremLrog017.h index 233801c5..d50135e8 100644 --- a/Core/IremLrog017.h +++ b/Core/IremLrog017.h @@ -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); diff --git a/Core/IremTamS1.h b/Core/IremTamS1.h index 15a72b55..9d690bba 100644 --- a/Core/IremTamS1.h +++ b/Core/IremTamS1.h @@ -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) { diff --git a/Core/JalecoJf11_14.h b/Core/JalecoJf11_14.h index 74b7a3dc..b4b0af61 100644 --- a/Core/JalecoJf11_14.h +++ b/Core/JalecoJf11_14.h @@ -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); diff --git a/Core/JalecoJf13.h b/Core/JalecoJf13.h index 7d27eb63..121f710f 100644 --- a/Core/JalecoJf13.h +++ b/Core/JalecoJf13.h @@ -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: diff --git a/Core/JalecoJf16.h b/Core/JalecoJf16.h index e4257475..2cba6e87 100644 --- a/Core/JalecoJf16.h +++ b/Core/JalecoJf16.h @@ -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); diff --git a/Core/JalecoJf17_19.h b/Core/JalecoJf17_19.h index 9d8e8ccb..06f096bd 100644 --- a/Core/JalecoJf17_19.h +++ b/Core/JalecoJf17_19.h @@ -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) { diff --git a/Core/JalecoJfxx.h b/Core/JalecoJfxx.h index 19f36136..cc1972be 100644 --- a/Core/JalecoJfxx.h +++ b/Core/JalecoJfxx.h @@ -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 diff --git a/Core/JalecoSs88006.h b/Core/JalecoSs88006.h index 64b6c523..177b8a6f 100644 --- a/Core/JalecoSs88006.h +++ b/Core/JalecoSs88006.h @@ -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 _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; diff --git a/Core/JyCompany.h b/Core/JyCompany.h index 57b50f10..edbd21fd 100644 --- a/Core/JyCompany.h +++ b/Core/JyCompany.h @@ -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(); diff --git a/Core/Kaiser202.h b/Core/Kaiser202.h index 26c36fbf..b9410120 100644 --- a/Core/Kaiser202.h +++ b/Core/Kaiser202.h @@ -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; diff --git a/Core/Kaiser7016.h b/Core/Kaiser7016.h index 53aae5d5..bde8067b 100644 --- a/Core/Kaiser7016.h +++ b/Core/Kaiser7016.h @@ -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); diff --git a/Core/Kaiser7022.h b/Core/Kaiser7022.h index 77d594bb..b471e26f 100644 --- a/Core/Kaiser7022.h +++ b/Core/Kaiser7022.h @@ -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; diff --git a/Core/Kaiser7037.h b/Core/Kaiser7037.h index 6ecd1e1b..93eb7cc9 100644 --- a/Core/Kaiser7037.h +++ b/Core/Kaiser7037.h @@ -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 regs{ _regs, 8 }; diff --git a/Core/Kaiser7057.h b/Core/Kaiser7057.h index 489e1c56..8e11b3a4 100644 --- a/Core/Kaiser7057.h +++ b/Core/Kaiser7057.h @@ -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 regs{ _regs, 8 }; diff --git a/Core/Kaiser7058.h b/Core/Kaiser7058.h index 3c5cae48..6c9c9dff 100644 --- a/Core/Kaiser7058.h +++ b/Core/Kaiser7058.h @@ -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; diff --git a/Core/LabelManager.cpp b/Core/LabelManager.cpp index a8e1f532..e58511e5 100644 --- a/Core/LabelManager.cpp +++ b/Core/LabelManager.cpp @@ -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); diff --git a/Core/Lh10.h b/Core/Lh10.h index 76c2c0cc..01af8302 100644 --- a/Core/Lh10.h +++ b/Core/Lh10.h @@ -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 regs{ _regs, 8 }; diff --git a/Core/Lh32.h b/Core/Lh32.h index 3ee4f8ef..253e8d2e 100644 --- a/Core/Lh32.h +++ b/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); diff --git a/Core/MMC1.h b/Core/MMC1.h index d5d994ff..e25f57b6 100644 --- a/Core/MMC1.h +++ b/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(); diff --git a/Core/MMC1_105.h b/Core/MMC1_105.h index 02a9571d..090506c3 100644 --- a/Core/MMC1_105.h +++ b/Core/MMC1_105.h @@ -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; diff --git a/Core/MMC2.h b/Core/MMC2.h index 14120382..6a560d12 100644 --- a/Core/MMC2.h +++ b/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]); diff --git a/Core/MMC3.h b/Core/MMC3.h index b01384ba..f9496656 100644 --- a/Core/MMC3.h +++ b/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 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: diff --git a/Core/MMC3_114.h b/Core/MMC3_114.h index f4bdfd97..a2dcc912 100644 --- a/Core/MMC3_114.h +++ b/Core/MMC3_114.h @@ -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: diff --git a/Core/MMC3_115.h b/Core/MMC3_115.h index f3de19e5..df7cddf6 100644 --- a/Core/MMC3_115.h +++ b/Core/MMC3_115.h @@ -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); diff --git a/Core/MMC3_12.h b/Core/MMC3_12.h index defe9b47..9afc4dd0 100644 --- a/Core/MMC3_12.h +++ b/Core/MMC3_12.h @@ -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; diff --git a/Core/MMC3_121.h b/Core/MMC3_121.h index 40a925ee..89004e91 100644 --- a/Core/MMC3_121.h +++ b/Core/MMC3_121.h @@ -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 exRegs{ _exRegs, 8 }; diff --git a/Core/MMC3_126.h b/Core/MMC3_126.h index 6af957fb..da8517dc 100644 --- a/Core/MMC3_126.h +++ b/Core/MMC3_126.h @@ -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; diff --git a/Core/MMC3_14.h b/Core/MMC3_14.h index 4fd627ef..5db48518 100644 --- a/Core/MMC3_14.h +++ b/Core/MMC3_14.h @@ -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 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; diff --git a/Core/MMC3_165.h b/Core/MMC3_165.h index 31d45bc4..f324f7d9 100644 --- a/Core/MMC3_165.h +++ b/Core/MMC3_165.h @@ -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(); diff --git a/Core/MMC3_182.h b/Core/MMC3_182.h index 5afd16ce..16eda81e 100644 --- a/Core/MMC3_182.h +++ b/Core/MMC3_182.h @@ -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; diff --git a/Core/MMC3_187.h b/Core/MMC3_187.h index 2d35f519..d2c9bbaa 100644 --- a/Core/MMC3_187.h +++ b/Core/MMC3_187.h @@ -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]); diff --git a/Core/MMC3_189.h b/Core/MMC3_189.h index fb025934..34a3d19c 100644 --- a/Core/MMC3_189.h +++ b/Core/MMC3_189.h @@ -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); diff --git a/Core/MMC3_196.h b/Core/MMC3_196.h index cc7ebb52..5c9eb449 100644 --- a/Core/MMC3_196.h +++ b/Core/MMC3_196.h @@ -7,7 +7,7 @@ private: uint8_t _exRegs[2]; protected: - void InitMapper() + void InitMapper() override { MMC3::InitMapper(); _exRegs[0] = _exRegs[1] = 0; diff --git a/Core/MMC3_197.h b/Core/MMC3_197.h index 93af5a14..347adf50 100644 --- a/Core/MMC3_197.h +++ b/Core/MMC3_197.h @@ -6,7 +6,7 @@ class MMC3_197 : public MMC3 { protected: - virtual void UpdateChrMapping() + virtual void UpdateChrMapping() override { if(_chrMode == 0) { SelectChrPage4x(0, _registers[0] << 1); diff --git a/Core/MMC3_199.h b/Core/MMC3_199.h index a8ed31cc..cd09e9ac 100644 --- a/Core/MMC3_199.h +++ b/Core/MMC3_199.h @@ -9,8 +9,8 @@ private: uint8_t _exRegs[4]; protected: - uint32_t GetChrRamSize() { return 0x2000; } - uint16_t GetChrRamPageSize() { return 0x400; } + uint32_t GetChrRamSize() override { return 0x2000; } + uint16_t GetChrRamPageSize() override { return 0x400; } void InitMapper() override { diff --git a/Core/MMC3_205.h b/Core/MMC3_205.h index 1f1fd49d..4658131c 100644 --- a/Core/MMC3_205.h +++ b/Core/MMC3_205.h @@ -8,16 +8,16 @@ private: uint8_t _selectedBlock = 0; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_selectedBlock); } - 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(_selectedBlock >= 2) { page &= 0x7F; @@ -30,7 +30,7 @@ protected: MMC3::SelectCHRPage(slot, page, memoryType); } - 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 { page &= _selectedBlock <= 1 ? 0x1F : 0x0F; page |= (_selectedBlock * 0x10); @@ -38,7 +38,7 @@ protected: MMC3::SelectPRGPage(slot, page, memoryType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { _selectedBlock = value & 0x03; diff --git a/Core/MMC3_215.h b/Core/MMC3_215.h index 58f4e369..043e6160 100644 --- a/Core/MMC3_215.h +++ b/Core/MMC3_215.h @@ -58,7 +58,7 @@ protected: } } - void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType) override + void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override { uint8_t sbank = 0; uint8_t bank = 0; diff --git a/Core/MMC3_217.h b/Core/MMC3_217.h index d4fd77ec..32ca0060 100644 --- a/Core/MMC3_217.h +++ b/Core/MMC3_217.h @@ -55,7 +55,7 @@ protected: MMC3::SelectPRGPage(slot, (_exRegs[1] << 5 & 0x60) | page); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { switch(addr) { diff --git a/Core/MMC3_219.h b/Core/MMC3_219.h index 8ee56620..d4496ec8 100644 --- a/Core/MMC3_219.h +++ b/Core/MMC3_219.h @@ -7,7 +7,7 @@ private: uint8_t _exRegs[3]; protected: - void InitMapper() + void InitMapper() override { MMC3::InitMapper(); SelectPrgPage4x(0, -4); diff --git a/Core/MMC3_238.h b/Core/MMC3_238.h index 79c58506..22084a57 100644 --- a/Core/MMC3_238.h +++ b/Core/MMC3_238.h @@ -9,9 +9,9 @@ private: uint8_t _exReg; protected: - virtual bool AllowRegisterRead() { return true; } + virtual bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { MMC3::InitMapper(); _exReg = 0; @@ -19,18 +19,18 @@ protected: RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read); } - void StreamState(bool saving) + void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_exReg); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { return _exReg; } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { _exReg = _securityLut[value & 0x03]; diff --git a/Core/MMC3_249.h b/Core/MMC3_249.h index 3e055aad..3e9d1ede 100644 --- a/Core/MMC3_249.h +++ b/Core/MMC3_249.h @@ -8,20 +8,20 @@ private: uint8_t _exReg; protected: - virtual void InitMapper() + virtual void InitMapper() override { MMC3::InitMapper(); AddRegisterRange(0x5000, 0x5000, MemoryOperation::Write); } - void StreamState(bool saving) + void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_exReg); } - 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(_exReg & 0x02) { page = (page & 0x03) | ((page >> 1) & 0x04) | ((page >> 4) & 0x08) | ((page >> 2) & 0x10) | ((page << 3) & 0x20) | ((page << 2) & 0xC0); @@ -30,7 +30,7 @@ protected: BaseMapper::SelectCHRPage(slot, page, memoryType); } - 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(_exReg & 0x02) { if(page < 0x20) { @@ -44,7 +44,7 @@ protected: BaseMapper::SelectPRGPage(slot, page, memoryType); } - virtual void WriteRegister(uint16_t addr, uint8_t value) + virtual void WriteRegister(uint16_t addr, uint8_t value) override { if(addr == 0x5000) { _exReg = value; diff --git a/Core/MMC3_250.h b/Core/MMC3_250.h index d77885ed..1ac6d368 100644 --- a/Core/MMC3_250.h +++ b/Core/MMC3_250.h @@ -5,7 +5,7 @@ class MMC3_250 : public MMC3 { protected: - virtual void WriteRegister(uint16_t addr, uint8_t value) + virtual void WriteRegister(uint16_t addr, uint8_t value) override { MMC3::WriteRegister((addr & 0xE000) | ((addr & 0x0400) >> 10), addr & 0xFF); } diff --git a/Core/MMC3_254.h b/Core/MMC3_254.h index 79be265a..ea28e42d 100644 --- a/Core/MMC3_254.h +++ b/Core/MMC3_254.h @@ -8,22 +8,22 @@ 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(); AddRegisterRange(0x6000, 0x7FFF, MemoryOperation::Read); RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_exRegs[0], _exRegs[1]); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { uint8_t value = InternalReadRam(addr); if(_exRegs[0]) { @@ -33,7 +33,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr) { case 0x8000: _exRegs[0] = 0xFF; break; diff --git a/Core/MMC3_37.h b/Core/MMC3_37.h index ebdc697f..2116a23e 100644 --- a/Core/MMC3_37.h +++ b/Core/MMC3_37.h @@ -8,22 +8,22 @@ private: uint8_t _selectedBlock = 0; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_selectedBlock); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { _selectedBlock = 0; UpdateState(); } - 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(_selectedBlock >= 4) { page |= 0x80; @@ -32,7 +32,7 @@ protected: MMC3::SelectCHRPage(slot, page, memoryType); } - 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(_selectedBlock <= 2) { page &= 0x07; @@ -50,7 +50,7 @@ protected: MMC3::SelectPRGPage(slot, page, memoryType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { if(CanWriteToWorkRam()) { diff --git a/Core/MMC3_44.h b/Core/MMC3_44.h index 504aec03..59c05cff 100644 --- a/Core/MMC3_44.h +++ b/Core/MMC3_44.h @@ -8,19 +8,19 @@ private: uint8_t _selectedBlock = 0; protected: - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_selectedBlock); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { _selectedBlock = 0; UpdateState(); } - 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 &= _selectedBlock <= 5 ? 0x7F : 0xFF; page |= _selectedBlock * 0x80; @@ -28,7 +28,7 @@ protected: MMC3::SelectCHRPage(slot, page, memoryType); } - 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 { page &= _selectedBlock <= 5 ? 0x0F : 0x1F; page |= _selectedBlock * 0x10; @@ -36,7 +36,7 @@ protected: MMC3::SelectPRGPage(slot, page, memoryType); } - virtual void WriteRegister(uint16_t addr, uint8_t value) + virtual void WriteRegister(uint16_t addr, uint8_t value) override { if((addr & 0xE001) == 0xA001) { _selectedBlock = value & 0x07; diff --git a/Core/MMC3_45.h b/Core/MMC3_45.h index 086860c2..e5a6ab39 100644 --- a/Core/MMC3_45.h +++ b/Core/MMC3_45.h @@ -9,10 +9,10 @@ private: uint8_t _reg[4]; protected: - virtual uint16_t RegisterStartAddress() { return 0x8000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x8000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); ArrayInfo reg = { _reg, 4 }; @@ -23,7 +23,7 @@ protected: } } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { AddRegisterRange(0x6000, 0x7FFF); _regIndex = 0; @@ -32,21 +32,21 @@ protected: UpdateState(); } - 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 &= 0xFF >> (0x0F - (_reg[2] & 0x0F)); page |= _reg[0] | ((_reg[2] & 0xF0) << 4); MMC3::SelectCHRPage(slot, page, memoryType); } - 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 { page &= 0x3F ^ (_reg[3] & 0x3F); page |= _reg[1]; MMC3::SelectPRGPage(slot, page, memoryType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { if(!(_reg[3] & 0x40)) { diff --git a/Core/MMC3_47.h b/Core/MMC3_47.h index 8bbca611..88f5041f 100644 --- a/Core/MMC3_47.h +++ b/Core/MMC3_47.h @@ -8,22 +8,22 @@ private: uint8_t _selectedBlock = 0; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_selectedBlock); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { _selectedBlock = 0; UpdateState(); } - 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 &= 0x7F; if(_selectedBlock == 1) { @@ -33,7 +33,7 @@ protected: MMC3::SelectCHRPage(slot, page, memoryType); } - 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 { page &= 0x0F; if(_selectedBlock == 1) { @@ -43,7 +43,7 @@ protected: MMC3::SelectPRGPage(slot, page, memoryType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { if(CanWriteToWorkRam()) { diff --git a/Core/MMC3_49.h b/Core/MMC3_49.h index f3a5f715..4c6374e1 100644 --- a/Core/MMC3_49.h +++ b/Core/MMC3_49.h @@ -10,16 +10,16 @@ private: uint8_t _prgMode = 0; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_selectedBlock, _prgReg, _prgMode); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { _prgReg = 0; _prgMode = false; @@ -27,14 +27,14 @@ protected: UpdateState(); } - 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 &= 0x7F; page |= 0x80 * _selectedBlock; MMC3::SelectCHRPage(slot, page, memoryType); } - 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(_prgMode) { page &= 0x0F; @@ -45,7 +45,7 @@ protected: MMC3::SelectPRGPage(slot, page, memoryType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { if(CanWriteToWorkRam()) { diff --git a/Core/MMC3_52.h b/Core/MMC3_52.h index 9927239f..9ed00ef1 100644 --- a/Core/MMC3_52.h +++ b/Core/MMC3_52.h @@ -8,22 +8,22 @@ private: uint8_t _extraReg = 0; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_extraReg); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { _extraReg = 0; UpdateState(); } - 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(_extraReg & 0x40) { page &= 0x7F; @@ -35,7 +35,7 @@ protected: MMC3::SelectCHRPage(slot, page, memoryType); } - 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(_extraReg & 0x08) { page &= 0x0F; @@ -47,7 +47,7 @@ protected: MMC3::SelectPRGPage(slot, page, memoryType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { if(CanWriteToWorkRam() && (_extraReg & 0x80) == 0) { diff --git a/Core/MMC3_ChrRam.h b/Core/MMC3_ChrRam.h index 262c5b90..cafb9ab3 100644 --- a/Core/MMC3_ChrRam.h +++ b/Core/MMC3_ChrRam.h @@ -10,10 +10,10 @@ private: uint16_t _chrRamSize; protected: - virtual uint16_t GetChrRamPageSize() { return 0x400; } - virtual uint32_t GetChrRamSize() { return _chrRamSize * 0x400; } + virtual uint16_t GetChrRamPageSize() override { return 0x400; } + virtual uint32_t GetChrRamSize() override { return _chrRamSize * 0x400; } - 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(page >= _firstRamBank && page <= _lastRamBank) { memoryType = ChrMemoryType::ChrRam; @@ -23,7 +23,7 @@ protected: MMC3::SelectCHRPage(slot, page, memoryType); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_firstRamBank, _lastRamBank, _chrRamSize); diff --git a/Core/MMC3_Coolboy.h b/Core/MMC3_Coolboy.h index dddbe765..3dad3f67 100644 --- a/Core/MMC3_Coolboy.h +++ b/Core/MMC3_Coolboy.h @@ -9,14 +9,14 @@ private: uint8_t _exRegs[4]; protected: - uint16_t RegisterStartAddress() { return 0x6000; } - uint32_t GetChrRamSize() { return 0x40000; } + uint16_t RegisterStartAddress() override { return 0x6000; } + uint32_t GetChrRamSize() override { return 0x40000; } void Reset(bool softReset) override { memset(_exRegs, 0, sizeof(_exRegs)); BaseMapper::Reset(softReset); - MMC3::Reset(); + MMC3::ResetMmc3(); UpdateState(); } @@ -88,7 +88,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { if(GetState().RegA001 & 0x80) { diff --git a/Core/MMC3_StreetHeroes.h b/Core/MMC3_StreetHeroes.h index bcd377ae..8efb4f73 100644 --- a/Core/MMC3_StreetHeroes.h +++ b/Core/MMC3_StreetHeroes.h @@ -9,9 +9,9 @@ private: uint8_t _resetSwitch; protected: - uint16_t GetChrRamPageSize() { return 0x2000; } - uint32_t GetChrRamSize() { return 0x2000; } - bool AllowRegisterRead() { return true; } + uint16_t GetChrRamPageSize() override { return 0x2000; } + uint32_t GetChrRamSize() override { return 0x2000; } + bool AllowRegisterRead() override { return true; } void InitMapper() override { @@ -24,13 +24,13 @@ protected: RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_exReg, _resetSwitch); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { if(softReset) { _resetSwitch ^= 0xFF; @@ -38,7 +38,7 @@ protected: UpdateState(); } - 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(_exReg & 0x40) { MMC3::SelectCHRPage(0, 0, ChrMemoryType::ChrRam); diff --git a/Core/MMC4.h b/Core/MMC4.h index d33ecd38..92585d17 100644 --- a/Core/MMC4.h +++ b/Core/MMC4.h @@ -5,10 +5,10 @@ class MMC4 : public MMC2 { protected: - 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 { _leftLatch = 1; _rightLatch = 1; @@ -24,7 +24,7 @@ class MMC4 : public MMC2 } public: - virtual void NotifyVRAMAddressChange(uint16_t addr) + virtual void NotifyVRAMAddressChange(uint16_t addr) override { if(_needChrUpdate) { SelectCHRPage(0, _leftChrPage[_leftLatch]); diff --git a/Core/MMC5.h b/Core/MMC5.h index 835f88da..42661ed0 100644 --- a/Core/MMC5.h +++ b/Core/MMC5.h @@ -169,7 +169,7 @@ private: } } - void ProcessCpuClock() + void ProcessCpuClock() override { if(!PPU::GetControlFlags().BackgroundEnabled && !PPU::GetControlFlags().SpritesEnabled) { _ppuInFrame = false; @@ -178,7 +178,7 @@ private: _audio.Clock(); } - virtual void NotifyVRAMAddressChange(uint16_t addr) + virtual void NotifyVRAMAddressChange(uint16_t addr) override { if(_spriteFetch != IsSpriteFetch() || _largeSprites != PPU::GetControlFlags().LargeSprites) { if(PPU::GetControlFlags().BackgroundEnabled || PPU::GetControlFlags().SpritesEnabled) { @@ -261,20 +261,20 @@ private: } protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x400; } - virtual uint16_t RegisterStartAddress() { return 0x5000; } - virtual uint16_t RegisterEndAddress() { return 0x5206; } - virtual uint32_t GetSaveRamSize() { return 0x10000; } //Emulate as if a single 64k block of saved ram existed - virtual uint32_t GetSaveRamPageSize() { return 0x2000; } - virtual uint32_t GetWorkRamSize() { return 0x400; } - virtual uint32_t GetWorkRamPageSize() { return 0x400; } - virtual bool ForceSaveRamSize() { return true; } - virtual bool ForceWorkRamSize() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x400; } + virtual uint16_t RegisterStartAddress() override { return 0x5000; } + virtual uint16_t RegisterEndAddress() override { return 0x5206; } + virtual uint32_t GetSaveRamSize() override { return 0x10000; } //Emulate as if a single 64k block of saved ram existed + virtual uint32_t GetSaveRamPageSize() override { return 0x2000; } + virtual uint32_t GetWorkRamSize() override { return 0x400; } + virtual uint32_t GetWorkRamPageSize() override { return 0x400; } + virtual bool ForceSaveRamSize() override { return true; } + virtual bool ForceWorkRamSize() override { return true; } - virtual bool AllowRegisterRead() { return true; } + virtual bool AllowRegisterRead() override { return true; } - virtual void InitMapper() + virtual void InitMapper() override { _hasBattery = true; @@ -333,7 +333,7 @@ protected: delete[] _emptyNametable; } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -353,7 +353,7 @@ protected: } } - virtual void WriteRAM(uint16_t addr, uint8_t value) + virtual void WriteRAM(uint16_t addr, uint8_t value) override { if(addr >= 0x5C00 && addr <= 0x5FFF && _extendedRamMode <= 1) { PPUControlFlags flags = PPU::GetControlFlags(); @@ -366,7 +366,7 @@ protected: BaseMapper::WriteRAM(addr, value); } - virtual uint8_t ReadVRAM(uint16_t addr, MemoryOperationType memoryOperationType) + virtual uint8_t ReadVRAM(uint16_t addr, MemoryOperationType memoryOperationType) override { if(_extendedRamMode <= 1 && _verticalSplitEnabled && memoryOperationType == MemoryOperationType::PpuRenderingRead) { uint32_t cycle = PPU::GetCurrentCycle(); @@ -449,7 +449,7 @@ protected: return BaseMapper::ReadVRAM(addr, memoryOperationType); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr >= 0x5113 && addr <= 0x5117) { SwitchPrgBank(addr, value); @@ -495,7 +495,7 @@ protected: } } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { switch(addr) { case 0x5010: case 0x5015: diff --git a/Core/MMC5Audio.h b/Core/MMC5Audio.h index 76953dd4..e844b722 100644 --- a/Core/MMC5Audio.h +++ b/Core/MMC5Audio.h @@ -10,12 +10,12 @@ class MMC5Square : public SquareChannel int8_t _currentOutput; private: - virtual void InitializeSweep() + virtual void InitializeSweep(uint8_t regValue) override { //"$5001 has no effect. The MMC5 pulse channels will not sweep, as they have no sweep unit." } - bool IsMuted() + bool IsMuted() override { //"Frequency values less than 8 do not silence the MMC5 pulse channels; they can output ultrasonic frequencies." return false; @@ -26,7 +26,7 @@ public: _currentOutput = 0; } - virtual void AddOutput(int8_t output) + virtual void AddOutput(int8_t output) override { _currentOutput = output; } @@ -36,9 +36,9 @@ public: return _currentOutput; } - void Run() + void RunChannel() { - SquareChannel::Run(1); + Run(1); EndFrame(); } }; @@ -56,7 +56,7 @@ private: uint8_t _pcmOutput; protected: - void StreamState(bool saving) + void StreamState(bool saving) override { BaseExpansionAudio::StreamState(saving); @@ -65,11 +65,11 @@ protected: Stream(square1, square2, _audioCounter, _lastOutput, _pcmReadMode, _pcmIrqEnabled, _pcmOutput); } - void ClockAudio() + void ClockAudio() override { _audioCounter--; - _square1.Run(); - _square2.Run(); + _square1.RunChannel(); + _square2.RunChannel(); if(_audioCounter <= 0) { //~240hz envelope/length counter _audioCounter = CPU::GetClockRate(Console::GetModel()) / 240; diff --git a/Core/Malee.h b/Core/Malee.h index a8498114..7cfad86b 100644 --- a/Core/Malee.h +++ b/Core/Malee.h @@ -5,10 +5,10 @@ class Malee : public BaseMapper { 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() + void InitMapper() override { SelectPrgPage4x(0, 0); SelectPrgPage4x(1, 4); diff --git a/Core/Mapper103.h b/Core/Mapper103.h index 08616964..f9ace014 100644 --- a/Core/Mapper103.h +++ b/Core/Mapper103.h @@ -9,14 +9,14 @@ private: uint8_t _prgReg; protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint32_t GetWorkRamSize() { return 0x4000; } - virtual uint32_t GetWorkRamPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x6000; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } + virtual uint32_t GetWorkRamSize() override { return 0x4000; } + virtual uint32_t GetWorkRamPageSize() override { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } virtual uint16_t EndStartAddress() { return 0xFFFF; } - void InitMapper() + void InitMapper() override { _prgRamDisabled = false; _prgReg = 0; @@ -24,7 +24,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgRamDisabled, _prgReg); @@ -44,7 +44,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF000) { case 0x6000: case 0x7000: diff --git a/Core/Mapper106.h b/Core/Mapper106.h index d5e616af..92b31edb 100644 --- a/Core/Mapper106.h +++ b/Core/Mapper106.h @@ -9,10 +9,10 @@ private: bool _irqEnabled; 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 { _irqEnabled = false; _irqCounter = 0; @@ -23,13 +23,13 @@ protected: SelectPRGPage(3, -1); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqCounter, _irqEnabled); } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqEnabled) { _irqCounter++; @@ -40,7 +40,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x0F) { case 0: case 2: SelectCHRPage(addr & 0x0F, value & 0xFE); break; diff --git a/Core/Mapper107.h b/Core/Mapper107.h index 31a61926..a3e6489e 100644 --- a/Core/Mapper107.h +++ b/Core/Mapper107.h @@ -5,16 +5,16 @@ class Mapper107 : 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 & 0xFE); SelectCHRPage(0, value); diff --git a/Core/Mapper108.h b/Core/Mapper108.h index c60d268a..635c9e8c 100644 --- a/Core/Mapper108.h +++ b/Core/Mapper108.h @@ -8,12 +8,12 @@ private: uint8_t _reg; protected: - virtual uint16_t RegisterStartAddress() { return 0x8000; } - virtual uint16_t RegisterEndAddress() { return 0x8FFF; } - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x8000; } + virtual uint16_t RegisterEndAddress() override { return 0x8FFF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { //Used by Bubble Bobble hack only AddRegisterRange(0xF000, 0xFFFF, MemoryOperation::Write); @@ -24,7 +24,7 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_reg); @@ -39,7 +39,7 @@ protected: SetCpuMemoryMapping(0x6000, 0x7FFF, _reg, PrgMemoryType::PrgRom); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { _reg = value; UpdateState(); diff --git a/Core/Mapper112.h b/Core/Mapper112.h index f38661a1..ab2aa8b7 100644 --- a/Core/Mapper112.h +++ b/Core/Mapper112.h @@ -9,23 +9,23 @@ private: uint8_t _currentReg; protected: - void InitMapper() + void InitMapper() override { MMC3::InitMapper(); SetMirroringType(MirroringType::Vertical); } - void UpdateMirroring() + void UpdateMirroring() override { } - void StreamState(bool saving) + void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_currentReg); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xE001) { case 0x8000: diff --git a/Core/Mapper117.h b/Core/Mapper117.h index e489e194..fadc5f51 100644 --- a/Core/Mapper117.h +++ b/Core/Mapper117.h @@ -13,10 +13,10 @@ private: A12Watcher _a12Watcher; 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 { _irqEnabled = false; _irqEnabledAlt = false; @@ -26,14 +26,14 @@ protected: SelectPrgPage4x(0, -4); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); SnapshotInfo a12Watcher{ &_a12Watcher }; Stream(_irqCounter, _irqEnabled, _irqEnabledAlt, _irqReloadValue, a12Watcher); } - void NotifyVRAMAddressChange(uint16_t addr) + void NotifyVRAMAddressChange(uint16_t addr) override { if(_a12Watcher.UpdateVramAddress(addr) == A12StateChange::Rise) { if(_irqEnabled && _irqEnabledAlt && _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) { case 0x8000: case 0x8001: case 0x8002: case 0x8003: diff --git a/Core/Mapper120.h b/Core/Mapper120.h index d6123081..2c6595c1 100644 --- a/Core/Mapper120.h +++ b/Core/Mapper120.h @@ -7,12 +7,12 @@ class Mapper120 : public BaseMapper private: uint8_t _prgReg; protected: - virtual uint16_t RegisterStartAddress() { return 0x41FF; } - virtual uint16_t RegisterEndAddress() { return 0x41FF; } - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x41FF; } + virtual uint16_t RegisterEndAddress() override { return 0x41FF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { _prgReg = 0; UpdatePrg(); @@ -20,7 +20,7 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgReg); @@ -34,7 +34,7 @@ protected: SetCpuMemoryMapping(0x6000, 0x7FFF, _prgReg, PrgMemoryType::PrgRom); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { _prgReg = value; UpdatePrg(); diff --git a/Core/Mapper15.h b/Core/Mapper15.h index 12b914c2..4966fa33 100644 --- a/Core/Mapper15.h +++ b/Core/Mapper15.h @@ -5,16 +5,16 @@ class Mapper15 : public BaseMapper { 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); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SetMirroringType(value & 0x40 ? MirroringType::Horizontal : MirroringType::Vertical); diff --git a/Core/Mapper170.h b/Core/Mapper170.h index 3b246150..ca707d62 100644 --- a/Core/Mapper170.h +++ b/Core/Mapper170.h @@ -8,13 +8,13 @@ private: uint8_t _reg; protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x7000; } - virtual uint16_t RegisterEndAddress() { return 0x7001; } - virtual bool AllowRegisterRead() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x7000; } + virtual uint16_t RegisterEndAddress() override { return 0x7001; } + virtual bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { _reg = 0; @@ -27,23 +27,23 @@ protected: SelectCHRPage(0, 0); } - void Reset(bool softReset) + void Reset(bool softReset) override { _reg = 0; } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_reg); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { _reg = (value << 1) & 0x80; } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { return _reg | ((addr >> 8) & 0x7F); } diff --git a/Core/Mapper183.h b/Core/Mapper183.h index 8a116ffd..866780e1 100644 --- a/Core/Mapper183.h +++ b/Core/Mapper183.h @@ -14,12 +14,12 @@ private: bool _needIrq; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x400; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x400; } - void InitMapper() + void InitMapper() override { memset(_chrRegs, 0, sizeof(_chrRegs)); _prgReg = 0; @@ -31,7 +31,7 @@ protected: UpdatePrg(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo chrRegs{ _chrRegs, 8 }; @@ -44,7 +44,7 @@ protected: SelectPRGPage(3, -1); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if((addr & 0xF800) == 0x6800) { _prgReg = addr & 0x3F; @@ -78,7 +78,7 @@ protected: } } - virtual void ProcessCpuClock() + virtual void ProcessCpuClock() override { if(_needIrq) { CPU::SetIRQSource(IRQSource::External); diff --git a/Core/Mapper200.h b/Core/Mapper200.h index a4761091..aa6ec7c4 100644 --- a/Core/Mapper200.h +++ b/Core/Mapper200.h @@ -5,17 +5,17 @@ class Mapper200 : 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, 0); SelectPRGPage(1, 0); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint8_t bank = addr & 0x07; SelectPRGPage(0, bank); diff --git a/Core/Mapper201.h b/Core/Mapper201.h index 0aba78ce..e95c10da 100644 --- a/Core/Mapper201.h +++ b/Core/Mapper201.h @@ -5,16 +5,16 @@ class Mapper201 : 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 { SelectCHRPage(0, addr & 0xFF); SelectPRGPage(0, addr & 0xFF); diff --git a/Core/Mapper202.h b/Core/Mapper202.h index c5123572..b7b36777 100644 --- a/Core/Mapper202.h +++ b/Core/Mapper202.h @@ -8,23 +8,23 @@ private: bool _prgMode1; 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, 0); SelectCHRPage(0, 0); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgMode1); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { _prgMode1 = (addr & 0x09) == 0x09; diff --git a/Core/Mapper203.h b/Core/Mapper203.h index e5fb648c..03e2ebbc 100644 --- a/Core/Mapper203.h +++ b/Core/Mapper203.h @@ -5,17 +5,17 @@ class Mapper203 : 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, 0); SelectPRGPage(1, 0); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(0, value >> 2); SelectPRGPage(1, value >> 2); diff --git a/Core/Mapper204.h b/Core/Mapper204.h index 1a821976..6fd68c9f 100644 --- a/Core/Mapper204.h +++ b/Core/Mapper204.h @@ -5,15 +5,15 @@ class Mapper204 : 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 bitMask = addr & 0x06; uint8_t page = bitMask + ((bitMask == 0x06) ? 0 : (addr & 0x01)); diff --git a/Core/Mapper212.h b/Core/Mapper212.h index 7c59a44b..301c55f1 100644 --- a/Core/Mapper212.h +++ b/Core/Mapper212.h @@ -5,16 +5,16 @@ class Mapper212 : 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 { WriteRegister(0x8000, 0); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { uint8_t value = InternalReadRam(addr); @@ -25,7 +25,7 @@ protected: return value; } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr & 0x4000) { SelectPrgPage2x(0, addr & 0x06); diff --git a/Core/Mapper213.h b/Core/Mapper213.h index 1c5154e0..9c87315c 100644 --- a/Core/Mapper213.h +++ b/Core/Mapper213.h @@ -5,15 +5,15 @@ class Mapper213 : 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 { WriteRegister(0x8000, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectCHRPage(0, (addr >> 3) & 0x07); SelectPRGPage(0, (addr >> 1) & 0x03); diff --git a/Core/Mapper214.h b/Core/Mapper214.h index f8fefe4c..4fc61b9f 100644 --- a/Core/Mapper214.h +++ b/Core/Mapper214.h @@ -5,15 +5,15 @@ class Mapper214 : 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 { SelectCHRPage(0, addr & 0x03); SelectPRGPage(0, (addr >> 2) & 0x03); diff --git a/Core/Mapper216.h b/Core/Mapper216.h index 7647a47d..bd36f734 100644 --- a/Core/Mapper216.h +++ b/Core/Mapper216.h @@ -5,24 +5,24 @@ class Mapper216 : public BaseMapper { protected: - uint16_t GetPRGPageSize() { return 0x8000; } - uint16_t GetCHRPageSize() { return 0x2000; } - bool AllowRegisterRead() { return true; } + uint16_t GetPRGPageSize() override { return 0x8000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { WriteRegister(0x8000, 0); AddRegisterRange(0x5000, 0x5000); RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { //For Videopoker Bonza? return 0; } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(0, addr & 0x01); SelectCHRPage(0, (addr & 0x0E) >> 1); diff --git a/Core/Mapper218.h b/Core/Mapper218.h index a792271d..4814c52c 100644 --- a/Core/Mapper218.h +++ b/Core/Mapper218.h @@ -4,10 +4,10 @@ class Mapper218 : 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() + void InitMapper() override { SelectPRGPage(0, 0); @@ -16,7 +16,7 @@ protected: } } - void SetDefaultNametables(uint8_t* nametableA, uint8_t* nametableB) + void SetDefaultNametables(uint8_t* nametableA, uint8_t* nametableB) override { BaseMapper::SetDefaultNametables(nametableA, nametableB); diff --git a/Core/Mapper220.h b/Core/Mapper220.h index 421355a1..6d0e7561 100644 --- a/Core/Mapper220.h +++ b/Core/Mapper220.h @@ -8,8 +8,8 @@ private: uint8_t _regs[8]; protected: - uint16_t GetPRGPageSize() { return 0x0800; } - uint16_t GetCHRPageSize() { return 0x2000; } + uint16_t GetPRGPageSize() override { return 0x0800; } + uint16_t GetCHRPageSize() override { return 0x2000; } void InitMapper() override { diff --git a/Core/Mapper221.h b/Core/Mapper221.h index 9377f4ea..a4638a49 100644 --- a/Core/Mapper221.h +++ b/Core/Mapper221.h @@ -9,10 +9,10 @@ private: uint8_t _prgReg; 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 { _prgReg = 0; _mode = 0; @@ -22,7 +22,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_mode, _prgReg); @@ -46,7 +46,7 @@ protected: SetMirroringType(_mode & 0x01 ? MirroringType::Horizontal : MirroringType::Vertical); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xC000) { case 0x8000: diff --git a/Core/Mapper222.h b/Core/Mapper222.h index 0cb5b380..6bdf2680 100644 --- a/Core/Mapper222.h +++ b/Core/Mapper222.h @@ -11,24 +11,24 @@ private: A12Watcher _a12Watcher; 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 { _irqCounter = 0; SelectPrgPage2x(1, -2); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); SnapshotInfo a12Watcher{ &_a12Watcher }; Stream(_irqCounter, a12Watcher); } - virtual void NotifyVRAMAddressChange(uint16_t addr) + virtual void NotifyVRAMAddressChange(uint16_t addr) override { if(_a12Watcher.UpdateVramAddress(addr) == A12StateChange::Rise) { if(_irqCounter) { @@ -41,7 +41,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF003) { case 0x8000: SelectPRGPage(0, value); break; diff --git a/Core/Mapper225.h b/Core/Mapper225.h index d6242118..426703d6 100644 --- a/Core/Mapper225.h +++ b/Core/Mapper225.h @@ -5,17 +5,17 @@ class Mapper225 : 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, 0); SelectPRGPage(1, 1); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint8_t highBit = (addr >> 8) & 0x40; uint8_t prgPage = ((addr >> 6) & 0x3F) | highBit; diff --git a/Core/Mapper226.h b/Core/Mapper226.h index 9e63b682..d6ecf02e 100644 --- a/Core/Mapper226.h +++ b/Core/Mapper226.h @@ -7,10 +7,10 @@ class Mapper226 : public BaseMapper protected: uint8_t _registers[2]; - 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 { _registers[0] = 0; _registers[1] = 0; @@ -20,13 +20,13 @@ protected: SelectCHRPage(0, 0); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_registers[0], _registers[1]); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { if(softReset) { _registers[0] = 0; @@ -55,7 +55,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x8001) { case 0x8000: _registers[0] = value; break; diff --git a/Core/Mapper227.h b/Core/Mapper227.h index 56c51313..748233f0 100644 --- a/Core/Mapper227.h +++ b/Core/Mapper227.h @@ -4,15 +4,15 @@ class Mapper227 : 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() + void InitMapper() override { WriteRegister(0x8000, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint16_t prgBank = ((addr >> 2) & 0x1F) | ((addr & 0x100) >> 3); bool sFlag = (addr & 0x01) == 0x01; diff --git a/Core/Mapper229.h b/Core/Mapper229.h index 6c69f068..f2b3de2f 100644 --- a/Core/Mapper229.h +++ b/Core/Mapper229.h @@ -5,15 +5,15 @@ class Mapper229 : 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 { SelectCHRPage(0, addr & 0xFF); if(!(addr & 0x1E)) { diff --git a/Core/Mapper230.h b/Core/Mapper230.h index 0a9037b9..f70e161d 100644 --- a/Core/Mapper230.h +++ b/Core/Mapper230.h @@ -8,22 +8,22 @@ private: bool _contraMode = 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 { SelectCHRPage(0, 0); Reset(true); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_contraMode); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { if(softReset) { _contraMode = !_contraMode; @@ -39,7 +39,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(_contraMode) { SelectPRGPage(0, value & 0x07); diff --git a/Core/Mapper231.h b/Core/Mapper231.h index 2d49d5cb..890ea445 100644 --- a/Core/Mapper231.h +++ b/Core/Mapper231.h @@ -5,23 +5,23 @@ class Mapper231 : 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, 0); SelectPRGPage(1, 0); SelectCHRPage(0, 0); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { SelectPRGPage(0, 0); SelectPRGPage(1, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint8_t prgBank = ((addr >> 5) & 0x01) | (addr & 0x1E); SelectPRGPage(0, prgBank & 0x1E); diff --git a/Core/Mapper233.h b/Core/Mapper233.h index 9f76d939..58801634 100644 --- a/Core/Mapper233.h +++ b/Core/Mapper233.h @@ -8,7 +8,7 @@ private: uint8_t _reset; protected: - void Reset(bool softReset) + void Reset(bool softReset) override { Mapper226::Reset(softReset); @@ -20,13 +20,13 @@ protected: } } - void StreamState(bool saving) + void StreamState(bool saving) override { Mapper226::StreamState(saving); Stream(_reset); } - uint8_t GetPrgPage() + uint8_t GetPrgPage() override { return (_registers[0] & 0x1F) | (_reset << 5) | ((_registers[1] & 0x01) << 6); } diff --git a/Core/Mapper234.h b/Core/Mapper234.h index 22569461..f777b611 100644 --- a/Core/Mapper234.h +++ b/Core/Mapper234.h @@ -8,14 +8,14 @@ private: uint8_t _regs[2]; protected: - virtual uint16_t RegisterStartAddress() { return 0xFF80; } - virtual uint16_t RegisterEndAddress() { return 0xFF9F; } - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual bool AllowRegisterRead() { return true; } - virtual bool HasBusConflicts() { return true; } + virtual uint16_t RegisterStartAddress() override { return 0xFF80; } + virtual uint16_t RegisterEndAddress() override { return 0xFF9F; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } + virtual bool AllowRegisterRead() override { return true; } + virtual bool HasBusConflicts() override { return true; } - void InitMapper() + void InitMapper() override { AddRegisterRange(0xFFE8, 0xFFF8, MemoryOperation::Any); memset(_regs, 0, sizeof(_regs)); @@ -37,7 +37,7 @@ protected: SetMirroringType(_regs[0] & 0x80 ? MirroringType::Horizontal : MirroringType::Vertical); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { uint8_t value = InternalReadRam(addr); if(addr <= 0xFF9F) { @@ -53,7 +53,7 @@ protected: return value; } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr <= 0xFF9F) { if(!(_regs[0] & 0x3F)) { diff --git a/Core/Mapper240.h b/Core/Mapper240.h index e017d351..076272ec 100644 --- a/Core/Mapper240.h +++ b/Core/Mapper240.h @@ -5,18 +5,18 @@ class Mapper240 : public BaseMapper { protected: - virtual uint16_t RegisterStartAddress() { return 0x4020; } - virtual uint16_t RegisterEndAddress() { return 0x5FFF; } - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x4020; } + virtual uint16_t RegisterEndAddress() override { return 0x5FFF; } + 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) & 0x0F); SelectCHRPage(0, value & 0x0F); diff --git a/Core/Mapper241.h b/Core/Mapper241.h index 4c549a3c..0885fac6 100644 --- a/Core/Mapper241.h +++ b/Core/Mapper241.h @@ -5,16 +5,16 @@ class Mapper241 : 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); } diff --git a/Core/Mapper242.h b/Core/Mapper242.h index a30d4126..de8279a4 100644 --- a/Core/Mapper242.h +++ b/Core/Mapper242.h @@ -5,22 +5,22 @@ class Mapper242 : 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 { Reset(false); SelectCHRPage(0, 0); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { SelectPRGPage(0, 0); SetMirroringType(MirroringType::Vertical); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SetMirroringType(addr & 0x02 ? MirroringType::Horizontal : MirroringType::Vertical); SelectPRGPage(0, (addr >> 3) & 0x0F); diff --git a/Core/Mapper244.h b/Core/Mapper244.h index 9f156352..eef86771 100644 --- a/Core/Mapper244.h +++ b/Core/Mapper244.h @@ -24,16 +24,16 @@ private: }; 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 { if(value & 0x08) { SelectCHRPage(0, _lutChr[(value >> 4) & 0x07][value & 0x07]); diff --git a/Core/Mapper246.h b/Core/Mapper246.h index 9eb6376b..f2f212df 100644 --- a/Core/Mapper246.h +++ b/Core/Mapper246.h @@ -5,22 +5,22 @@ class Mapper246 : public BaseMapper { protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0x67FF; } - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x0800; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0x67FF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x0800; } - void InitMapper() + void InitMapper() override { SelectPRGPage(3, 0xFF); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { SelectPRGPage(3, 0xFF); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if((addr & 0x7) <= 0x3) { SelectPRGPage(addr & 0x03, value); diff --git a/Core/Mapper253.h b/Core/Mapper253.h index 9c3f2148..699d87af 100644 --- a/Core/Mapper253.h +++ b/Core/Mapper253.h @@ -14,12 +14,12 @@ private: uint16_t _irqScaler; protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x400; } - virtual uint32_t GetChrRamSize() { return 0x800; } - virtual uint16_t GetChrRamPageSize() { return 0x400; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x400; } + virtual uint32_t GetChrRamSize() override { return 0x800; } + virtual uint16_t GetChrRamPageSize() override { return 0x400; } - void InitMapper() + void InitMapper() override { memset(_chrLow, 0, sizeof(_chrLow)); memset(_chrHigh, 0, sizeof(_chrHigh)); @@ -33,7 +33,7 @@ protected: SelectPRGPage(3, -1); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -58,7 +58,7 @@ protected: } } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqEnabled) { _irqScaler++; @@ -73,7 +73,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr >= 0xB000 && addr <= 0xE00C) { uint8_t slot = ((((addr & 0x08) | (addr >> 8)) >> 3) + 2) & 0x07; diff --git a/Core/Mapper35.h b/Core/Mapper35.h index 0431c4db..88053291 100644 --- a/Core/Mapper35.h +++ b/Core/Mapper35.h @@ -12,10 +12,10 @@ private: A12Watcher _a12Watcher; 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 { _irqEnabled = false; _irqCounter = 0; @@ -23,14 +23,14 @@ protected: SelectPRGPage(3, -1); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); SnapshotInfo a12Watcher{ &_a12Watcher }; Stream(_irqCounter, _irqEnabled, a12Watcher); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF007) { case 0x8000: case 0x8001: case 0x8002: case 0x8003: @@ -56,7 +56,7 @@ protected: } } - virtual void NotifyVRAMAddressChange(uint16_t addr) + virtual void NotifyVRAMAddressChange(uint16_t addr) override { //MMC3-style A12 IRQ counter if(_a12Watcher.UpdateVramAddress(addr) == A12StateChange::Rise) { diff --git a/Core/Mapper40.h b/Core/Mapper40.h index 02a3105d..223fd725 100644 --- a/Core/Mapper40.h +++ b/Core/Mapper40.h @@ -9,10 +9,10 @@ private: uint16_t _irqCounter; 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 { _irqCounter = 0; @@ -23,14 +23,14 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqCounter); } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqCounter > 0) { _irqCounter--; @@ -40,7 +40,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xE000) { case 0x8000: diff --git a/Core/Mapper42.h b/Core/Mapper42.h index 2c51ca92..4cf49d21 100644 --- a/Core/Mapper42.h +++ b/Core/Mapper42.h @@ -10,10 +10,10 @@ private: bool _irqEnabled; 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 { _irqCounter = 0; _irqEnabled = false; @@ -25,13 +25,13 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqCounter, _irqEnabled); } - 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 & 0xE003) { case 0x8000: diff --git a/Core/Mapper50.h b/Core/Mapper50.h index f76b2752..37ea3c37 100644 --- a/Core/Mapper50.h +++ b/Core/Mapper50.h @@ -10,12 +10,12 @@ private: bool _irqEnabled; protected: - virtual uint16_t RegisterStartAddress() { return 0x4020; } - virtual uint16_t RegisterEndAddress() { return 0x5FFF; } - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x4020; } + virtual uint16_t RegisterEndAddress() override { return 0x5FFF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { _irqCounter = 0; _irqEnabled = false; @@ -27,14 +27,14 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqCounter, _irqEnabled); } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqEnabled) { _irqCounter++; @@ -45,7 +45,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x4120) { case 0x4020: diff --git a/Core/Mapper57.h b/Core/Mapper57.h index 4e0bd08c..e46ea6d0 100644 --- a/Core/Mapper57.h +++ b/Core/Mapper57.h @@ -8,10 +8,10 @@ private: uint8_t _registers[2]; 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 { _registers[0] = 0; _registers[1] = 0; @@ -19,7 +19,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_registers[0], _registers[1]); @@ -40,7 +40,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x8800) { case 0x8000: _registers[0] = value; break; diff --git a/Core/Mapper58.h b/Core/Mapper58.h index 93d19a94..912d20cb 100644 --- a/Core/Mapper58.h +++ b/Core/Mapper58.h @@ -5,17 +5,17 @@ class Mapper58 : 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, 0); SelectPRGPage(1, 1); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint8_t prgBank = addr & 0x07; if(addr & 0x40) { diff --git a/Core/Mapper60.h b/Core/Mapper60.h index abd2055f..4821ff8c 100644 --- a/Core/Mapper60.h +++ b/Core/Mapper60.h @@ -8,10 +8,10 @@ private: uint8_t _resetCounter; 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 { _resetCounter = 0; SelectPRGPage(0, 0); @@ -19,7 +19,7 @@ protected: SelectCHRPage(0, 0); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { if(softReset) { _resetCounter = (_resetCounter + 1) % 4; @@ -30,7 +30,7 @@ protected: } } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_resetCounter); diff --git a/Core/Mapper61.h b/Core/Mapper61.h index 64a78fc7..0dc4cae1 100644 --- a/Core/Mapper61.h +++ b/Core/Mapper61.h @@ -5,17 +5,17 @@ class Mapper61 : 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, 0); SelectPRGPage(1, 1); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint8_t prgPage = ((addr & 0x0F) << 1) | ((addr >> 5) & 0x01); if(addr & 0x10) { diff --git a/Core/Mapper62.h b/Core/Mapper62.h index e207e1d4..d326f147 100644 --- a/Core/Mapper62.h +++ b/Core/Mapper62.h @@ -5,17 +5,17 @@ class Mapper62 : 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, 0); SelectPRGPage(1, 1); SelectCHRPage(0, 0); } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { if(softReset) { SelectPRGPage(0, 0); @@ -24,7 +24,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { uint8_t prgPage = ((addr & 0x3F00) >> 8) | (addr & 0x40); uint8_t chrPage = ((addr & 0x1F) << 2) | (value & 0x03); diff --git a/Core/Mapper83.h b/Core/Mapper83.h index 1862814d..4acf053f 100644 --- a/Core/Mapper83.h +++ b/Core/Mapper83.h @@ -17,11 +17,11 @@ class Mapper83 : public BaseMapper uint8_t _resetBit; protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x400; } - virtual bool AllowRegisterRead() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x400; } + virtual bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { memset(_regs, 0, sizeof(_regs)); memset(_exRegs, 0, sizeof(_exRegs)); diff --git a/Core/Mapper91.h b/Core/Mapper91.h index cc23ccea..0cffdbcb 100644 --- a/Core/Mapper91.h +++ b/Core/Mapper91.h @@ -5,24 +5,24 @@ class Mapper91 : public MMC3 { 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 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x800; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x800; } - void InitMapper() + void InitMapper() override { SelectPRGPage(2, -2); SelectPRGPage(3, -1); } - void UpdateState() + void UpdateState() override { //Do nothing, we are only using MMC3 code to emulate the IRQs } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x7003) { case 0x6000: SelectCHRPage(0, value); break; diff --git a/Core/MemoryManager.h b/Core/MemoryManager.h index 8c06d2b1..012b699d 100644 --- a/Core/MemoryManager.h +++ b/Core/MemoryManager.h @@ -29,7 +29,7 @@ class MemoryManager: public Snapshotable void InitializeMemoryHandlers(IMemoryHandler** memoryHandlers, IMemoryHandler* handler, vector *addresses, bool allowOverride); protected: - void StreamState(bool saving); + void StreamState(bool saving) override; public: MemoryManager(shared_ptr mapper); diff --git a/Core/ModChannel.h b/Core/ModChannel.h index 61403626..1a8ca084 100644 --- a/Core/ModChannel.h +++ b/Core/ModChannel.h @@ -16,7 +16,7 @@ private: uint16_t _overflowCounter = 0; protected: - void StreamState(bool saving) + void StreamState(bool saving) override { BaseFdsChannel::StreamState(saving); @@ -25,7 +25,7 @@ protected: } public: - virtual void WriteReg(uint16_t addr, uint8_t value) + virtual void WriteReg(uint16_t addr, uint8_t value) override { switch(addr & 0x03) { case 1: UpdateCounter(value & 0x7F); break; diff --git a/Core/NROM.h b/Core/NROM.h index c843fcd4..dff0624e 100644 --- a/Core/NROM.h +++ b/Core/NROM.h @@ -5,10 +5,10 @@ class NROM : 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; } - virtual void InitMapper() + virtual void InitMapper() override { SelectPRGPage(0, 0); SelectPRGPage(1, 1); diff --git a/Core/Namco108.h b/Core/Namco108.h index 250dd539..7d7beb13 100644 --- a/Core/Namco108.h +++ b/Core/Namco108.h @@ -6,13 +6,13 @@ class Namco108 : public MMC3 { protected: - virtual void UpdateMirroring() + virtual void UpdateMirroring() override { //Do nothing - Namco 108 has hardwired mirroring only //"Mirroring is hardwired, one game uses 4-screen mirroring (Gauntlet, DRROM)." } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { //Redirect all 0x8000-0xFFFF writes to 0x8000-0x8001, all other features do not exist in this version addr &= 0x8001; diff --git a/Core/Namco108_154.h b/Core/Namco108_154.h index 877cc0fb..f35d00ba 100644 --- a/Core/Namco108_154.h +++ b/Core/Namco108_154.h @@ -6,7 +6,7 @@ class Namco108_154 : public Namco108_88 { protected: - virtual void WriteRegister(uint16_t addr, uint8_t value) + virtual void WriteRegister(uint16_t addr, uint8_t value) override { SetMirroringType((value & 0x40) == 0x40 ? MirroringType::ScreenBOnly : MirroringType::ScreenAOnly); Namco108_88::WriteRegister(addr, value); diff --git a/Core/Namco108_76.h b/Core/Namco108_76.h index cd570429..a5f549da 100644 --- a/Core/Namco108_76.h +++ b/Core/Namco108_76.h @@ -5,10 +5,10 @@ class Namco108_76 : public Namco108 { -virtual uint16_t GetCHRPageSize() { return 0x0800; } +virtual uint16_t GetCHRPageSize() override { return 0x0800; } protected: - virtual void UpdateChrMapping() + virtual void UpdateChrMapping() override { SelectCHRPage(0, _registers[2]); SelectCHRPage(1, _registers[3]); diff --git a/Core/Namco108_88.h b/Core/Namco108_88.h index 6630fd04..57866cac 100644 --- a/Core/Namco108_88.h +++ b/Core/Namco108_88.h @@ -6,7 +6,7 @@ class Namco108_88 : public Namco108 { protected: - virtual void UpdateChrMapping() + virtual void UpdateChrMapping() override { _registers[0] &= 0x3F; _registers[1] &= 0x3F; diff --git a/Core/Namco108_95.h b/Core/Namco108_95.h index 1f3716fe..53dda5e5 100644 --- a/Core/Namco108_95.h +++ b/Core/Namco108_95.h @@ -6,7 +6,7 @@ class Namco108_95 : public Namco108 { protected: - virtual void WriteRegister(uint16_t addr, uint8_t value) + virtual void WriteRegister(uint16_t addr, uint8_t value) override { Namco108::WriteRegister(addr, value); diff --git a/Core/Namco163.h b/Core/Namco163.h index ea416068..4ff2e432 100644 --- a/Core/Namco163.h +++ b/Core/Namco163.h @@ -50,12 +50,12 @@ private: } protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x400; } - virtual uint32_t GetSaveRamPageSize() { return 0x800; } - virtual bool AllowRegisterRead() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x400; } + virtual uint32_t GetSaveRamPageSize() override { return 0x800; } + virtual bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { switch(_mapperID) { case 19: _variant = NamcoVariant::Namco163; _autoDetectVariant = true; break; @@ -82,7 +82,7 @@ protected: UpdateSaveRamAccess(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -93,7 +93,7 @@ protected: } } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqCounter & 0x8000 && (_irqCounter & 0x7FFF) != 0x7FFF) { _irqCounter++; @@ -107,7 +107,7 @@ protected: } } - void WriteRAM(uint16_t addr, uint8_t value) + void WriteRAM(uint16_t addr, uint8_t value) override { if(addr >= 0x6000 && addr <= 0x7FFF) { _notNamco340 = true; @@ -118,7 +118,7 @@ protected: BaseMapper::WriteRAM(addr, value); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { switch(addr & 0xF800) { case 0x4800: return _audio.ReadRegister(addr); @@ -128,7 +128,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { addr &= 0xF800; @@ -171,7 +171,7 @@ protected: } case 0xC000: case 0xC800: case 0xD000: case 0xD800: - if(addr >= 0xC8000) { + if(addr >= 0xC800) { SetVariant(NamcoVariant::Namco163); } else if(_variant != NamcoVariant::Namco163) { SetVariant(NamcoVariant::Namco175); diff --git a/Core/Namco163Audio.h b/Core/Namco163Audio.h index 45b64001..71638cfb 100644 --- a/Core/Namco163Audio.h +++ b/Core/Namco163Audio.h @@ -112,7 +112,7 @@ private: } protected: - void StreamState(bool saving) + void StreamState(bool saving) override { BaseExpansionAudio::StreamState(saving); @@ -121,7 +121,7 @@ protected: Stream(internalRam, channelOutput, _ramPosition, _autoIncrement, _updateCounter, _currentChannel, _lastOutput); } - void ClockAudio() + void ClockAudio() override { if(!_disableSound && GetNumberOfChannels()) { _updateCounter++; diff --git a/Core/Nanjing.h b/Core/Nanjing.h index e38acda5..861b8b0d 100644 --- a/Core/Nanjing.h +++ b/Core/Nanjing.h @@ -20,17 +20,17 @@ private: } protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x1000; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x1000; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo registers = { _registers, 5 }; Stream(registers, _toggle, _autoSwitchCHR); } - void InitMapper() + void InitMapper() override { memset(_registers, 0, sizeof(_registers)); _autoSwitchCHR = false; @@ -44,9 +44,9 @@ protected: SelectCHRPage(1, 0); } - uint16_t RegisterStartAddress() { return 0x5000; } - uint16_t RegisterEndAddress() { return 0x5FFF; } - void WriteRegister(uint16_t addr, uint8_t value) + uint16_t RegisterStartAddress() override { return 0x5000; } + uint16_t RegisterEndAddress() override { return 0x5FFF; } + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr >= 0x5000 && addr <= 0x5FFF) { //"(Address is masked with 0x7300, except for 5101)" @@ -83,7 +83,7 @@ protected: } public: - uint8_t ReadRAM(uint16_t addr) + uint8_t ReadRAM(uint16_t addr) override { if(addr >= 0x5000 && addr <= 0x5FFF) { //"Reading: (Address is masked with 0x7700)" @@ -105,7 +105,7 @@ public: } } - virtual void NotifyVRAMAddressChange(uint16_t addr) + virtual void NotifyVRAMAddressChange(uint16_t addr) override { if(_autoSwitchCHR) { if(PPU::GetCurrentScanline() == 239) { diff --git a/Core/Nina01.h b/Core/Nina01.h index bb4c4cf5..d8d0d46e 100644 --- a/Core/Nina01.h +++ b/Core/Nina01.h @@ -5,17 +5,17 @@ class Nina01 : public BaseMapper { protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x1000; } - virtual uint16_t RegisterStartAddress() { return 0x7FFD; } - virtual uint16_t RegisterEndAddress() { return 0x7FFF; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x1000; } + virtual uint16_t RegisterStartAddress() override { return 0x7FFD; } + virtual uint16_t RegisterEndAddress() override { return 0x7FFF; } - 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) { case 0x7FFD: SelectPRGPage(0, value & 0x01); break; diff --git a/Core/Nina03_06.h b/Core/Nina03_06.h index 971dc3fa..2d642ac2 100644 --- a/Core/Nina03_06.h +++ b/Core/Nina03_06.h @@ -8,18 +8,18 @@ private: bool _multicartMode; protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x4100; } - virtual uint16_t RegisterEndAddress() { return 0x5FFF; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x4100; } + virtual uint16_t RegisterEndAddress() override { return 0x5FFF; } - 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((addr & 0x5100) != 0) { if(_multicartMode) { diff --git a/Core/NoiseChannel.h b/Core/NoiseChannel.h index f5a1acb0..2356a95f 100644 --- a/Core/NoiseChannel.h +++ b/Core/NoiseChannel.h @@ -21,7 +21,7 @@ private: } protected: - void Clock() + void Clock() override { //Feedback is calculated as the exclusive-OR of bit 0 and one other bit: bit 6 if Mode flag is set, otherwise bit 1. uint16_t feedback = (_shiftRegister & 0x01) ^ ((_shiftRegister >> (_modeFlag ? 6 : 1)) & 0x01); @@ -40,7 +40,7 @@ public: { } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { ApuEnvelope::Reset(softReset); @@ -49,19 +49,19 @@ public: _modeFlag = false; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { ApuEnvelope::StreamState(saving); Stream(_shiftRegister, _modeFlag); } - void GetMemoryRanges(MemoryRanges &ranges) + void GetMemoryRanges(MemoryRanges &ranges) override { ranges.AddHandler(MemoryOperation::Write, 0x400C, 0x400F); } - void WriteRAM(uint16_t addr, uint8_t value) + void WriteRAM(uint16_t addr, uint8_t value) override { APU::StaticRun(); switch(addr & 0x03) { diff --git a/Core/NovelDiamond.h b/Core/NovelDiamond.h index 6fa74aae..fde7e344 100644 --- a/Core/NovelDiamond.h +++ b/Core/NovelDiamond.h @@ -5,8 +5,8 @@ class NovelDiamond : 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 { diff --git a/Core/NsfCart31.h b/Core/NsfCart31.h index 4f7ab5f5..84129cf5 100644 --- a/Core/NsfCart31.h +++ b/Core/NsfCart31.h @@ -5,20 +5,20 @@ class NsfCart31 : public BaseMapper { protected: - virtual uint16_t RegisterStartAddress() { return 0x5000; } - virtual uint16_t RegisterEndAddress() { return 0x5FFF; } + virtual uint16_t RegisterStartAddress() override { return 0x5000; } + virtual uint16_t RegisterEndAddress() override { return 0x5FFF; } - virtual uint16_t GetPRGPageSize() { return 0x1000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t GetPRGPageSize() override { return 0x1000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { WriteRegister(0x5FFF, 0xFF); SelectCHRPage(0, 0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(addr & 0x07, value); } diff --git a/Core/NsfMapper.h b/Core/NsfMapper.h index db82b013..b2838273 100644 --- a/Core/NsfMapper.h +++ b/Core/NsfMapper.h @@ -98,20 +98,20 @@ private: void ClockLengthAndFadeCounters(); protected: - uint16_t GetPRGPageSize() { return 0x1000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint32_t GetWorkRamSize() { return 0x4000; } - uint32_t GetWorkRamPageSize() { return 0x1000; } - bool AllowRegisterRead() { return true; } + uint16_t GetPRGPageSize() override { return 0x1000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint32_t GetWorkRamSize() override { return 0x4000; } + uint32_t GetWorkRamPageSize() override { return 0x1000; } + bool AllowRegisterRead() override { return true; } - void InitMapper(); - void InitMapper(RomData& romData); - void Reset(bool softReset); - void GetMemoryRanges(MemoryRanges &ranges); + void InitMapper() override; + void InitMapper(RomData& romData) override; + void Reset(bool softReset) override; + void GetMemoryRanges(MemoryRanges &ranges) override; - void ProcessCpuClock(); - uint8_t ReadRegister(uint16_t addr); - void WriteRegister(uint16_t addr, uint8_t value); + void ProcessCpuClock() override; + uint8_t ReadRegister(uint16_t addr) override; + void WriteRegister(uint16_t addr, uint8_t value) override; public: NsfMapper(); @@ -119,7 +119,7 @@ public: static NsfMapper* GetInstance(); - void SetNesModel(NesModel model); + void SetNesModel(NesModel model) override; void SelectTrack(uint8_t trackNumber); uint8_t GetCurrentTrack(); diff --git a/Core/NtdecTc112.h b/Core/NtdecTc112.h index dd58d5e5..9c91a4c6 100644 --- a/Core/NtdecTc112.h +++ b/Core/NtdecTc112.h @@ -5,20 +5,20 @@ class NtdecTc112 : 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 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x0800; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x0800; } - void InitMapper() + void InitMapper() override { SelectPRGPage(1, -3); SelectPRGPage(2, -2); SelectPRGPage(3, -1); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x03){ case 0: diff --git a/Core/OekaKids.h b/Core/OekaKids.h index 45eb1978..19635ea2 100644 --- a/Core/OekaKids.h +++ b/Core/OekaKids.h @@ -9,11 +9,11 @@ class OekaKids : public BaseMapper uint16_t _lastAddress; protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x1000; } - virtual bool HasBusConflicts() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x1000; } + virtual bool HasBusConflicts() override { return true; } - void InitMapper() + void InitMapper() override { _outerChrBank = 0; _innerChrBank = 0; @@ -22,7 +22,7 @@ protected: SelectPRGPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_outerChrBank, _innerChrBank, _lastAddress); @@ -34,7 +34,7 @@ protected: SelectCHRPage(1, _outerChrBank | 0x03); } - void NotifyVRAMAddressChange(uint16_t addr) + void NotifyVRAMAddressChange(uint16_t addr) override { if((_lastAddress & 0x3000) != 0x2000 && (addr & 0x3000) == 0x2000) { _innerChrBank = (addr >> 8) & 0x03; @@ -44,7 +44,7 @@ protected: _lastAddress = addr; } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(0, value & 0x03); _outerChrBank = value & 0x04; diff --git a/Core/OekaKidsTablet.h b/Core/OekaKidsTablet.h index cb61120e..1a7abfad 100644 --- a/Core/OekaKidsTablet.h +++ b/Core/OekaKidsTablet.h @@ -15,15 +15,15 @@ private: int32_t _yPosition = 0; protected: - virtual uint8_t RefreshState(); - uint8_t ProcessNetPlayState(uint32_t netplayState); - void StreamState(bool saving); + virtual uint8_t RefreshState() override; + uint8_t ProcessNetPlayState(uint32_t netplayState) override; + void StreamState(bool saving) override; public: using BaseControlDevice::BaseControlDevice; - virtual uint8_t GetPortOutput(); - virtual uint32_t GetNetPlayState(); + virtual uint8_t GetPortOutput() override; + virtual uint32_t GetNetPlayState() override; void WriteRam(uint8_t value); }; \ No newline at end of file diff --git a/Core/OpllChannel.h b/Core/OpllChannel.h index 0dbda911..a31465b7 100644 --- a/Core/OpllChannel.h +++ b/Core/OpllChannel.h @@ -124,7 +124,7 @@ namespace Vrc7Opll uint32_t egout; /* output */ protected: - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(type, feedback, output[0], output[1], phase, dphase, pgout, fnum, block, volume, sustine, tll, rks, eg_mode, eg_phase, eg_dphase, egout, patch.TL, patch.FB, patch.EG, patch.ML, patch.AR, patch.DR, patch.SL, patch.RR, patch.KR, patch.KL, patch.AM, patch.PM, patch.WF); diff --git a/Core/OpllEmulator.h b/Core/OpllEmulator.h index 3c88088a..f27b8c18 100644 --- a/Core/OpllEmulator.h +++ b/Core/OpllEmulator.h @@ -127,7 +127,7 @@ namespace Vrc7Opll return c >> b; } protected: - void StreamState(bool saving) + void StreamState(bool saving) override { ArrayInfo lowFreq{ LowFreq, 6 }; ArrayInfo hiFreq{ HiFreq, 6 }; @@ -415,14 +415,14 @@ namespace Vrc7Opll uint32_t SetMask(uint32_t mask) { uint32_t ret = mask; - mask = mask; + this->mask = mask; return ret; } uint32_t ToggleMask(uint32_t mask) { uint32_t ret = mask; - mask ^= mask; + this->mask ^= mask; return ret; } diff --git a/Core/OpllTables.h b/Core/OpllTables.h index a3701f54..d0af9898 100644 --- a/Core/OpllTables.h +++ b/Core/OpllTables.h @@ -142,7 +142,7 @@ namespace Vrc7Opll { } protected: - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(clk, rate); if(!saving) { diff --git a/Core/PPU.h b/Core/PPU.h index ea4104ab..1ba3c6f1 100644 --- a/Core/PPU.h +++ b/Core/PPU.h @@ -217,7 +217,7 @@ class PPU : public IMemoryHandler, public Snapshotable _simpleMode = true; } - void StreamState(bool saving); + void StreamState(bool saving) override; public: static const uint32_t ScreenWidth = 256; @@ -234,7 +234,7 @@ class PPU : public IMemoryHandler, public Snapshotable PPUDebugState GetState(); void SetState(PPUDebugState state); - void GetMemoryRanges(MemoryRanges &ranges) + void GetMemoryRanges(MemoryRanges &ranges) override { ranges.AddHandler(MemoryOperation::Read, 0x2000, 0x3FFF); ranges.AddHandler(MemoryOperation::Write, 0x2000, 0x3FFF); @@ -244,8 +244,8 @@ class PPU : public IMemoryHandler, public Snapshotable uint8_t ReadPaletteRAM(uint16_t addr); void WritePaletteRAM(uint16_t addr, uint8_t value); - uint8_t ReadRAM(uint16_t addr); - void WriteRAM(uint16_t addr, uint8_t value); + uint8_t ReadRAM(uint16_t addr) override; + void WriteRAM(uint16_t addr, uint8_t value) override; void SetNesModel(NesModel model); diff --git a/Core/Racermate.h b/Core/Racermate.h index 42de64fd..d745e8fe 100644 --- a/Core/Racermate.h +++ b/Core/Racermate.h @@ -8,13 +8,13 @@ private: uint16_t _irqCounter; protected: - virtual uint16_t GetPRGPageSize() { return 0x4000; } - virtual uint16_t GetCHRPageSize() { return 0x1000; } - virtual uint32_t GetChrRamSize() { return 0x10000; } - virtual uint32_t GetSaveRamSize() { return 0; } - virtual bool ForceChrBattery() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x4000; } + virtual uint16_t GetCHRPageSize() override { return 0x1000; } + virtual uint32_t GetChrRamSize() override { return 0x10000; } + virtual uint32_t GetSaveRamSize() override { return 0; } + virtual bool ForceChrBattery() override { return true; } - void InitMapper() + void InitMapper() override { _irqCounter = 0; @@ -22,13 +22,13 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqCounter); } - void ProcessCpuClock() + void ProcessCpuClock() override { _irqCounter--; if(_irqCounter == 0) { @@ -37,7 +37,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xC000) { case 0x8000: diff --git a/Core/Rambo1.h b/Core/Rambo1.h index 422bd3bd..d5a47ea2 100644 --- a/Core/Rambo1.h +++ b/Core/Rambo1.h @@ -23,16 +23,16 @@ private: bool _forceClock = false; 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 { memset(_registers, 0, sizeof(_registers)); SelectPRGPage(3, -1); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo registers = { _registers, 16 }; @@ -41,7 +41,7 @@ protected: a12Watcher, _cpuClockCounter, _currentRegister, registers, _forceClock); } - virtual void ProcessCpuClock() + virtual void ProcessCpuClock() override { if(_needIrqDelay) { _needIrqDelay--; @@ -109,7 +109,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xE001) { case 0x8000: @@ -154,7 +154,7 @@ protected: } public: - virtual void NotifyVRAMAddressChange(uint16_t addr) + virtual void NotifyVRAMAddressChange(uint16_t addr) override { if(!_irqCycleMode) { if(_a12Watcher.UpdateVramAddress(addr) == A12StateChange::Rise) { diff --git a/Core/Rt01.h b/Core/Rt01.h index fbc92468..ae05119c 100644 --- a/Core/Rt01.h +++ b/Core/Rt01.h @@ -5,8 +5,8 @@ class Rt01 : public BaseMapper { protected: - uint16_t GetPRGPageSize() { return 0x4000; } - uint16_t GetCHRPageSize() { return 0x800; } + uint16_t GetPRGPageSize() override { return 0x4000; } + uint16_t GetCHRPageSize() override { return 0x800; } bool AllowRegisterRead() override { return true; } void InitMapper() override diff --git a/Core/Sachen74LS374N.h b/Core/Sachen74LS374N.h index c439e3fd..519ef79e 100644 --- a/Core/Sachen74LS374N.h +++ b/Core/Sachen74LS374N.h @@ -9,19 +9,19 @@ private: uint8_t _regs[8]; protected: - uint16_t RegisterStartAddress() { return 0x4100; } - uint16_t RegisterEndAddress() { return 0x7FFF; } - uint16_t GetPRGPageSize() { return 0x8000; } - uint16_t GetCHRPageSize() { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x4100; } + uint16_t RegisterEndAddress() override { return 0x7FFF; } + uint16_t GetPRGPageSize() override { return 0x8000; } + uint16_t GetCHRPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { _currentRegister = 0; memset(_regs, 0, sizeof(_regs)); SelectPRGPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -38,7 +38,7 @@ protected: SetMirroringType(_regs[7] & 0x01 ? MirroringType::Vertical : MirroringType::Horizontal); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xC101) { case 0x4100: _currentRegister = value & 0x07; break; diff --git a/Core/Sachen74LS374NB.h b/Core/Sachen74LS374NB.h index 5d6ce1e7..98400b05 100644 --- a/Core/Sachen74LS374NB.h +++ b/Core/Sachen74LS374NB.h @@ -10,13 +10,13 @@ private: uint8_t _regs[8]; protected: - uint16_t RegisterStartAddress() { return 0x4100; } - uint16_t RegisterEndAddress() { return 0x7FFF; } - uint16_t GetPRGPageSize() { return 0x8000; } - uint16_t GetCHRPageSize() { return 0x2000; } - bool AllowRegisterRead() { return true; } + uint16_t RegisterStartAddress() override { return 0x4100; } + uint16_t RegisterEndAddress() override { return 0x7FFF; } + uint16_t GetPRGPageSize() override { return 0x8000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { _counter = 0; _currentRegister = 0; @@ -25,21 +25,21 @@ protected: SelectPRGPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo regs{ _regs, 8 }; Stream(_currentRegister, regs, _counter); } - void Reset(bool softReset) + void Reset(bool softReset) override { if(softReset) { _counter++; } } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { switch(addr & 0xC101) { case 0x4000: return (~_currentRegister) ^ (_counter & 1); @@ -66,7 +66,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xC101) { case 0x4100: _currentRegister = value & 0x07; break; diff --git a/Core/Sachen8259.h b/Core/Sachen8259.h index 7a4ae4fd..ff1b5ad1 100644 --- a/Core/Sachen8259.h +++ b/Core/Sachen8259.h @@ -19,12 +19,12 @@ private: uint8_t _chrOr[3]; protected: - uint16_t GetPRGPageSize() { return 0x8000; } - uint16_t GetCHRPageSize() { return _variant == Sachen8259Variant::Sachen8259D ? 0x400 : 0x800; } - uint16_t RegisterStartAddress() { return 0x4100; } - uint16_t RegisterEndAddress() { return 0x7FFF; } + uint16_t GetPRGPageSize() override { return 0x8000; } + uint16_t GetCHRPageSize() override { return _variant == Sachen8259Variant::Sachen8259D ? 0x400 : 0x800; } + uint16_t RegisterStartAddress() override { return 0x4100; } + uint16_t RegisterEndAddress() override { return 0x7FFF; } - void InitMapper() + void InitMapper() override { _currentReg = 0; memset(_regs, 0, sizeof(_regs)); @@ -32,7 +32,7 @@ protected: SelectPRGPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -74,7 +74,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xC101) { case 0x4100: _currentReg = value & 0x07; break; diff --git a/Core/Sachen_133.h b/Core/Sachen_133.h index 7d2074f1..1dddea98 100644 --- a/Core/Sachen_133.h +++ b/Core/Sachen_133.h @@ -5,18 +5,18 @@ class Sachen_133 : public BaseMapper { protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x4100; } - 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 0x4100; } + 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 { if((addr & 0x6100) == 0x4100) { SelectPRGPage(0, (value >> 2) & 0x01); diff --git a/Core/Sachen_136.h b/Core/Sachen_136.h index 2c68ce1e..63896ea6 100644 --- a/Core/Sachen_136.h +++ b/Core/Sachen_136.h @@ -8,13 +8,13 @@ private: uint8_t _chrReg; protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x4100; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } - virtual bool AllowRegisterRead() { return true; } + virtual uint16_t GetPRGPageSize() override { return 0x8000; } + virtual uint16_t GetCHRPageSize() override { return 0x2000; } + virtual uint16_t RegisterStartAddress() override { return 0x4100; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } + virtual bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { _chrReg = 0; SelectPRGPage(0, 0); @@ -23,18 +23,18 @@ protected: RemoveRegisterRange(0x4101, 0xFFFF, MemoryOperation::Read); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_chrReg); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { return (_chrReg & 0x3F) | (MemoryManager::GetOpenBus() & 0xC0); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if((addr & 0x0103) == 0x0102) { _chrReg = value + 3; diff --git a/Core/Sachen_143.h b/Core/Sachen_143.h index edc0a754..1fa26de7 100644 --- a/Core/Sachen_143.h +++ b/Core/Sachen_143.h @@ -4,11 +4,11 @@ class Sachen_143 : public NROM { protected: - uint16_t RegisterStartAddress() { return 0x4100; } - uint16_t RegisterEndAddress() { return 0x5FFF; } - bool AllowRegisterRead() { return true; } + uint16_t RegisterStartAddress() override { return 0x4100; } + uint16_t RegisterEndAddress() override { return 0x5FFF; } + bool AllowRegisterRead() override { return true; } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { return (~addr & 0x3F) | 0x40; } diff --git a/Core/Sachen_145.h b/Core/Sachen_145.h index ac4cc568..f55e893d 100644 --- a/Core/Sachen_145.h +++ b/Core/Sachen_145.h @@ -5,17 +5,17 @@ class Sachen_145 : public BaseMapper { protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x4100; } - 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 0x4100; } + virtual uint16_t RegisterEndAddress() override { return 0x7FFF; } - 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 { if((addr & 0x4100) == 0x4100) { SelectCHRPage(0, (value >> 7) & 0x01); diff --git a/Core/Sachen_147.h b/Core/Sachen_147.h index 4805adf2..da8df13c 100644 --- a/Core/Sachen_147.h +++ b/Core/Sachen_147.h @@ -5,17 +5,17 @@ class Sachen_147 : public BaseMapper { protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x4100; } - 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 0x4100; } + virtual uint16_t RegisterEndAddress() override { return 0x7FFF; } - 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 { if((addr & 0x4103) == 0x4102) { SelectPRGPage(0, ((value >> 2) & 0x01) | ((value >> 6) & 0x02)); diff --git a/Core/Sachen_148.h b/Core/Sachen_148.h index 786b9820..5c4a4603 100644 --- a/Core/Sachen_148.h +++ b/Core/Sachen_148.h @@ -5,15 +5,15 @@ class Sachen_148 : 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); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(0, (value >> 3) & 0x01); SelectCHRPage(0, value & 0x07); diff --git a/Core/Sachen_149.h b/Core/Sachen_149.h index e0dd16ab..91361f3e 100644 --- a/Core/Sachen_149.h +++ b/Core/Sachen_149.h @@ -5,15 +5,15 @@ class Sachen_149 : 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); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectCHRPage(0, (value >> 7) & 0x01); } diff --git a/Core/Smb2j.h b/Core/Smb2j.h index 9fe35a74..5100ac87 100644 --- a/Core/Smb2j.h +++ b/Core/Smb2j.h @@ -10,10 +10,10 @@ private: bool _irqEnabled; protected: - uint16_t GetPRGPageSize() { return 0x1000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint16_t RegisterStartAddress() { return 0x4122; } - uint16_t RegisterEndAddress() { return 0x4122; } + uint16_t GetPRGPageSize() override { return 0x1000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x4122; } + uint16_t RegisterEndAddress() override { return 0x4122; } void InitMapper() override { diff --git a/Core/SoundMixer.h b/Core/SoundMixer.h index 26d61eb6..a5fef2e0 100644 --- a/Core/SoundMixer.h +++ b/Core/SoundMixer.h @@ -59,7 +59,7 @@ private: void UpdateRates(bool forceUpdate); protected: - virtual void StreamState(bool saving); + virtual void StreamState(bool saving) override; public: SoundMixer(); diff --git a/Core/SquareChannel.h b/Core/SquareChannel.h index cedf1194..9a8b83bf 100644 --- a/Core/SquareChannel.h +++ b/Core/SquareChannel.h @@ -71,7 +71,7 @@ private: } protected: - void Clock() + void Clock() override { if(IsMuted()) { AddOutput(0); @@ -88,7 +88,7 @@ public: _isChannel1 = isChannel1; } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { ApuEnvelope::Reset(softReset); @@ -107,14 +107,14 @@ public: UpdateTargetPeriod(); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { ApuEnvelope::StreamState(saving); Stream(_realPeriod, _duty, _dutyPos, _sweepEnabled, _sweepPeriod, _sweepNegate, _sweepShift, _reloadSweep, _sweepDivider, _sweepTargetPeriod); } - void GetMemoryRanges(MemoryRanges &ranges) + void GetMemoryRanges(MemoryRanges &ranges) override { if(_isChannel1) { ranges.AddHandler(MemoryOperation::Write, 0x4000, 0x4003); @@ -123,7 +123,7 @@ public: } } - void WriteRAM(uint16_t addr, uint8_t value) + void WriteRAM(uint16_t addr, uint8_t value) override { APU::StaticRun(); switch(addr & 0x03) { diff --git a/Core/StandardController.h b/Core/StandardController.h index 5d4e9b64..98a629aa 100644 --- a/Core/StandardController.h +++ b/Core/StandardController.h @@ -14,16 +14,16 @@ private: uint8_t GetButtonState(); protected: - uint8_t RefreshState(); - virtual void StreamState(bool saving); + uint8_t RefreshState() override; + virtual void StreamState(bool saving) override; public: using BaseControlDevice::BaseControlDevice; - uint32_t GetNetPlayState(); + uint32_t GetNetPlayState() override; - uint8_t GetPortOutput(); - void RefreshStateBuffer(); + uint8_t GetPortOutput() override; + void RefreshStateBuffer() override; //Used for VS System button unscrambling uint32_t GetInternalState(); diff --git a/Core/StudyBox.h b/Core/StudyBox.h index 1757b007..0a6774c8 100644 --- a/Core/StudyBox.h +++ b/Core/StudyBox.h @@ -11,20 +11,20 @@ private: uint8_t _reg4202 = 0; protected: - virtual uint16_t RegisterStartAddress() { return 0x4200; } - virtual uint16_t RegisterEndAddress() { return 0x43FF; } - virtual bool AllowRegisterRead() { return true; } + virtual uint16_t RegisterStartAddress() override { return 0x4200; } + virtual uint16_t RegisterEndAddress() override { return 0x43FF; } + virtual bool AllowRegisterRead() override { return true; } - 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; } - virtual uint32_t GetSaveRamSize() { return 0xC00; } - virtual uint32_t GetSaveRamPageSize() { return 0xC00; } + virtual uint32_t GetSaveRamSize() override { return 0xC00; } + virtual uint32_t GetSaveRamPageSize() override { return 0xC00; } - virtual uint32_t GetWorkRamSize() { return 0x8000; } - virtual uint32_t GetWorkRamPageSize() { return 0x2000; } + virtual uint32_t GetWorkRamSize() override { return 0x8000; } + virtual uint32_t GetWorkRamPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { _prgRamReg = 0; @@ -35,13 +35,13 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgRamReg); } - uint8_t ReadRegister(uint16_t addr) + uint8_t ReadRegister(uint16_t addr) override { switch(addr) { case 0x4200: case 0x4203: return 0x00; @@ -61,7 +61,7 @@ protected: SetCpuMemoryMapping(0x6000, 0x7FFF, _prgRamReg, PrgMemoryType::WorkRam); } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_tapeReadyDelay > 0) { _tapeReadyDelay--; @@ -71,7 +71,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr & 0x4203) { switch(addr & 0x03) { diff --git a/Core/Subor166.h b/Core/Subor166.h index e328228d..fa540eed 100644 --- a/Core/Subor166.h +++ b/Core/Subor166.h @@ -8,23 +8,23 @@ private: uint8_t _regs[4]; 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 { memset(_regs, 0, sizeof(_regs)); WriteRegister(0x8000, 0); SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_regs[0], _regs[1], _regs[2], _regs[3]); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xE000) { case 0x8000: _regs[0] = value & 0x10; break; diff --git a/Core/Sunsoft184.h b/Core/Sunsoft184.h index 1aa3427c..b4b75558 100644 --- a/Core/Sunsoft184.h +++ b/Core/Sunsoft184.h @@ -5,17 +5,17 @@ class Sunsoft184 : public BaseMapper { protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x1000; } - 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 0x1000; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0x7FFF; } - 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 { SelectCHRPage(0, value & 0x07); diff --git a/Core/Sunsoft3.h b/Core/Sunsoft3.h index ef050c92..c62b73ec 100644 --- a/Core/Sunsoft3.h +++ b/Core/Sunsoft3.h @@ -11,21 +11,21 @@ private: uint16_t _irqCounter = 0; protected: - virtual uint16_t GetPRGPageSize() { return 0x4000; } - virtual uint16_t GetCHRPageSize() { return 0x800; } + virtual uint16_t GetPRGPageSize() override { return 0x4000; } + virtual uint16_t GetCHRPageSize() override { return 0x800; } - void InitMapper() + void InitMapper() override { SelectPRGPage(1, -1); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqLatch, _irqEnabled, _irqCounter); } - virtual void ProcessCpuClock() + virtual void ProcessCpuClock() override { if(_irqEnabled) { _irqCounter--; @@ -36,7 +36,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF800) { case 0x8800: SelectCHRPage(0, value); break; diff --git a/Core/Sunsoft4.h b/Core/Sunsoft4.h index f57e8f88..e15182f3 100644 --- a/Core/Sunsoft4.h +++ b/Core/Sunsoft4.h @@ -28,10 +28,10 @@ private: } protected: - virtual uint16_t GetPRGPageSize() { return 0x4000; } - virtual uint16_t GetCHRPageSize() { return 0x800; } + virtual uint16_t GetPRGPageSize() override { return 0x4000; } + virtual uint16_t GetCHRPageSize() override { return 0x800; } - void InitMapper() + void InitMapper() override { _useChrForNametables = false; _ntRegs[0] = _ntRegs[1] = 0; @@ -42,7 +42,7 @@ protected: SelectPRGPage(1, -1); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -53,7 +53,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF000) { case 0x8000: SelectCHRPage(0, value); break; diff --git a/Core/Sunsoft5bAudio.h b/Core/Sunsoft5bAudio.h index 8895fa48..cb7c9a5f 100644 --- a/Core/Sunsoft5bAudio.h +++ b/Core/Sunsoft5bAudio.h @@ -73,7 +73,7 @@ private: } protected: - void StreamState(bool saving) + void StreamState(bool saving) override { BaseExpansionAudio::StreamState(saving); @@ -83,7 +83,7 @@ protected: Stream(timer, registers, toneStep, _currentRegister, _lastOutput, _processTick); } - void ClockAudio() + void ClockAudio() override { if(_processTick) { for(int i = 0; i < 3; i++) { diff --git a/Core/Sunsoft89.h b/Core/Sunsoft89.h index d129b278..be3e9a92 100644 --- a/Core/Sunsoft89.h +++ b/Core/Sunsoft89.h @@ -5,15 +5,15 @@ class Sunsoft89 : 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(1, -1); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(0, (value >> 4) & 0x07); SelectCHRPage(0, value & 0x07 | ((value & 0x80) >> 4)); diff --git a/Core/Sunsoft93.h b/Core/Sunsoft93.h index ac571d50..b584438a 100644 --- a/Core/Sunsoft93.h +++ b/Core/Sunsoft93.h @@ -5,15 +5,15 @@ class Sunsoft93 : 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(1, -1); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { SelectPRGPage(0, (value >> 4) & 0x07); if((value & 0x01) == 0x01) { diff --git a/Core/SunsoftFme7.h b/Core/SunsoftFme7.h index 8636d448..e3e09238 100644 --- a/Core/SunsoftFme7.h +++ b/Core/SunsoftFme7.h @@ -15,14 +15,14 @@ private: uint16_t _irqCounter; protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x400; } - virtual uint32_t GetWorkRamSize() { return 0x8000; } - virtual uint32_t GetWorkRamPageSize() { return 0x2000; } - virtual uint32_t GetSaveRamSize() { return 0x8000; } - virtual uint32_t GetSaveRamPageSize() { return 0x2000; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x400; } + virtual uint32_t GetWorkRamSize() override { return 0x8000; } + virtual uint32_t GetWorkRamPageSize() override { return 0x2000; } + virtual uint32_t GetSaveRamSize() override { return 0x8000; } + virtual uint32_t GetSaveRamPageSize() override { return 0x2000; } - void InitMapper() + void InitMapper() override { _command = 0; _workRamValue = 0; @@ -35,7 +35,7 @@ protected: UpdateWorkRam(); } - void StreamState(bool saving) + void StreamState(bool saving) override { SnapshotInfo audio{ &_audio }; Stream(_command, _workRamValue, _irqEnabled, _irqCounterEnabled, _irqCounter, audio); @@ -44,7 +44,7 @@ protected: } } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqCounterEnabled) { _irqCounter--; @@ -68,7 +68,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xE000) { case 0x8000: diff --git a/Core/Super40in1Ws.h b/Core/Super40in1Ws.h index 22840c22..dbd19c95 100644 --- a/Core/Super40in1Ws.h +++ b/Core/Super40in1Ws.h @@ -8,10 +8,10 @@ private: bool _regLock; protected: - uint16_t GetPRGPageSize() { return 0x4000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint16_t RegisterStartAddress() { return 0x6000; } - uint16_t RegisterEndAddress() { return 0x6FFF; } + uint16_t GetPRGPageSize() override { return 0x4000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x6000; } + uint16_t RegisterEndAddress() override { return 0x6FFF; } void InitMapper() override { diff --git a/Core/Supervision.h b/Core/Supervision.h index dee96e45..55dd9223 100644 --- a/Core/Supervision.h +++ b/Core/Supervision.h @@ -11,13 +11,13 @@ private: bool _epromFirst; protected: - virtual uint16_t RegisterStartAddress() { return 0x6000; } - virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + virtual uint16_t RegisterStartAddress() override { return 0x6000; } + virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } - 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 { _epromFirst = _prgSize >= 0x8000 && CRC32::GetCRC(_prgRom, 0x8000) == EPROM_CRC; _regs[0] = _regs[1] = 0; @@ -25,7 +25,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_regs[0], _regs[1]); @@ -43,7 +43,7 @@ protected: SetMirroringType(_regs[0] & 0x20 ? MirroringType::Horizontal : MirroringType::Vertical); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { _regs[0] = value; diff --git a/Core/T262.h b/Core/T262.h index 7408f843..ac71845c 100644 --- a/Core/T262.h +++ b/Core/T262.h @@ -11,8 +11,8 @@ private: bool _mode; 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 { diff --git a/Core/TaitoTc0190.h b/Core/TaitoTc0190.h index b0030245..99f024b1 100644 --- a/Core/TaitoTc0190.h +++ b/Core/TaitoTc0190.h @@ -5,16 +5,16 @@ class TaitoTc0190 : 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; } - void InitMapper() + void InitMapper() override { SelectPRGPage(2, -2); SelectPRGPage(3, -1); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xA003) { case 0x8000: diff --git a/Core/TaitoTc0690.h b/Core/TaitoTc0690.h index f38c8063..86439cea 100644 --- a/Core/TaitoTc0690.h +++ b/Core/TaitoTc0690.h @@ -9,27 +9,27 @@ private: uint8_t _irqDelay; protected: - virtual void InitMapper() + virtual void InitMapper() override { _irqDelay = 0; SelectPRGPage(2, -2); SelectPRGPage(3, -1); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { MMC3::StreamState(saving); Stream(_irqDelay); } - virtual void TriggerIrq() + virtual void TriggerIrq() override { //"The IRQ seems to trip a little later than it does on MMC3. It looks like about a 4 CPU cycle delay from the normal MMC3 IRQ time." //A value of 5 removes the shaking from The Jetsons _irqDelay = 5; } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqDelay > 0) { _irqDelay--; @@ -39,7 +39,7 @@ protected: } } - virtual void WriteRegister(uint16_t addr, uint8_t value) + virtual void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xE003) { case 0x8000: diff --git a/Core/TaitoX1005.h b/Core/TaitoX1005.h index 1f36262c..558eb486 100644 --- a/Core/TaitoX1005.h +++ b/Core/TaitoX1005.h @@ -14,17 +14,17 @@ private: } protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x0400; } - virtual uint16_t RegisterStartAddress() { return 0x7EF0; } - virtual uint16_t RegisterEndAddress() { return 0x7EFF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x0400; } + virtual uint16_t RegisterStartAddress() override { return 0x7EF0; } + virtual uint16_t RegisterEndAddress() override { return 0x7EFF; } - virtual uint32_t GetWorkRamSize() { return 0x100; } - virtual uint32_t GetWorkRamPageSize() { return 0x100; } - virtual uint32_t GetSaveRamSize() { return 0x100; } - virtual uint32_t GetSaveRamPageSize() { return 0x100; } + virtual uint32_t GetWorkRamSize() override { return 0x100; } + virtual uint32_t GetWorkRamPageSize() override { return 0x100; } + virtual uint32_t GetSaveRamSize() override { return 0x100; } + virtual uint32_t GetSaveRamPageSize() override { return 0x100; } - void InitMapper() + void InitMapper() override { _ramPermission = 0; @@ -33,13 +33,13 @@ protected: UpdateRamAccess(); } - virtual bool ForceBattery() + virtual bool ForceBattery() override { //Patch: Force battery, because some headers are marked as having no battery even though the game expects one return true; } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr) { case 0x7EF0: @@ -89,7 +89,7 @@ protected: } } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_ramPermission); diff --git a/Core/TaitoX1017.h b/Core/TaitoX1017.h index d62b361b..477dbbc0 100644 --- a/Core/TaitoX1017.h +++ b/Core/TaitoX1017.h @@ -21,15 +21,15 @@ private: } protected: - virtual uint16_t GetPRGPageSize() { return 0x2000; } - virtual uint16_t GetCHRPageSize() { return 0x0400; } - virtual uint16_t RegisterStartAddress() { return 0x7EF0; } - virtual uint16_t RegisterEndAddress() { return 0x7EFF; } + virtual uint16_t GetPRGPageSize() override { return 0x2000; } + virtual uint16_t GetCHRPageSize() override { return 0x0400; } + virtual uint16_t RegisterStartAddress() override { return 0x7EF0; } + virtual uint16_t RegisterEndAddress() override { return 0x7EFF; } - virtual uint32_t GetSaveRamSize() { return 0x1400; } - virtual uint32_t GetSaveRamPageSize() { return 0x400; } + virtual uint32_t GetSaveRamSize() override { return 0x1400; } + virtual uint32_t GetSaveRamPageSize() override { return 0x400; } - void InitMapper() + void InitMapper() override { _chrMode = 0; memset(_ramPermission, 0, sizeof(_ramPermission)); @@ -40,7 +40,7 @@ protected: UpdateRamAccess(); } - virtual bool ForceBattery() + virtual bool ForceBattery() override { //Patch: Force battery, because some headers are marked as having no battery even though the game expects one return true; @@ -67,7 +67,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr) { case 0x7EF0: @@ -107,7 +107,7 @@ protected: } } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo ramPermission = { _ramPermission, 3 }; diff --git a/Core/Tf1201.h b/Core/Tf1201.h index c03cb998..80840276 100644 --- a/Core/Tf1201.h +++ b/Core/Tf1201.h @@ -14,10 +14,10 @@ private: bool _irqEnabled; 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 { memset(_prgRegs, 0, sizeof(_prgRegs)); memset(_chrRegs, 0, sizeof(_chrRegs)); @@ -32,7 +32,7 @@ protected: UpdatePrg(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo prgRegs{ _prgRegs, 2 }; @@ -60,7 +60,7 @@ protected: SelectPRGPage(3, -1); } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_irqEnabled) { _irqScaler -= 3; @@ -74,7 +74,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { addr = (addr & 0xF003) | ((addr & 0x0C) >> 2); if(addr >= 0xB000 && addr <= 0xE003) { diff --git a/Core/TriangleChannel.h b/Core/TriangleChannel.h index 1bca08e4..0410887b 100644 --- a/Core/TriangleChannel.h +++ b/Core/TriangleChannel.h @@ -17,7 +17,7 @@ private: uint8_t _sequencePosition = 0; protected: - void Clock() + void Clock() override { //The sequencer is clocked by the timer as long as both the linear counter and the length counter are nonzero. if(_lengthCounter > 0 && _linearCounter > 0) { @@ -37,7 +37,7 @@ public: { } - virtual void Reset(bool softReset) + virtual void Reset(bool softReset) override { ApuLengthCounter::Reset(softReset); @@ -49,19 +49,19 @@ public: _sequencePosition = 0; } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { ApuLengthCounter::StreamState(saving); Stream(_linearCounter, _linearCounterReload, _linearReloadFlag, _linearControlFlag, _sequencePosition); } - void GetMemoryRanges(MemoryRanges &ranges) + void GetMemoryRanges(MemoryRanges &ranges) override { ranges.AddHandler(MemoryOperation::Write, 0x4008, 0x400B); } - void WriteRAM(uint16_t addr, uint8_t value) + void WriteRAM(uint16_t addr, uint8_t value) override { APU::StaticRun(); switch(addr & 0x03) { diff --git a/Core/TxSRom.h b/Core/TxSRom.h index 158d6425..fca70c25 100644 --- a/Core/TxSRom.h +++ b/Core/TxSRom.h @@ -6,12 +6,12 @@ class TxSRom : public MMC3 { protected: - void UpdateMirroring() + void UpdateMirroring() override { //This is disabled, 8001 writes are used to setup mirroring instead } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if((addr & 0xE001) == 0x8001) { uint8_t nametable = value >> 7; diff --git a/Core/Txc22000.h b/Core/Txc22000.h index 4c097d51..be51c852 100644 --- a/Core/Txc22000.h +++ b/Core/Txc22000.h @@ -11,13 +11,13 @@ private: uint8_t _prgBank; 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 bool AllowRegisterRead() { return true; } + 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; } + virtual bool AllowRegisterRead() override { return true; } - void InitMapper() + void InitMapper() override { AddRegisterRange(0x4100, 0x5FFF, MemoryOperation::Any); RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read); @@ -30,18 +30,18 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_state, _prgBank, _prgBankingMode); } - virtual uint8_t ReadRegister(uint16_t addr) + virtual uint8_t ReadRegister(uint16_t addr) override { return MemoryManager::GetOpenBus() & 0xCF | (_state << 4); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { switch(addr & 0xE303) { diff --git a/Core/Txc22211A.h b/Core/Txc22211A.h index 3a511042..54bf96d7 100644 --- a/Core/Txc22211A.h +++ b/Core/Txc22211A.h @@ -5,15 +5,15 @@ class Txc22211A : 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 bool AllowRegisterRead() { return true; } + 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; } + virtual bool AllowRegisterRead() override { return true; } uint8_t _regs[4]; - void InitMapper() + void InitMapper() override { AddRegisterRange(0x4100, 0x4103, MemoryOperation::Any); RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read); @@ -24,13 +24,13 @@ protected: SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_regs[0], _regs[1], _regs[2], _regs[3]); } - virtual uint8_t ReadRegister(uint16_t addr) + virtual uint8_t ReadRegister(uint16_t addr) override { return (_regs[1] ^ _regs[2]) | 0x40; } @@ -41,7 +41,7 @@ protected: SelectCHRPage(0, _regs[2]); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr < 0x8000) { _regs[addr & 0x03] = value; diff --git a/Core/Txc22211C.h b/Core/Txc22211C.h index d42c737b..d09bddbc 100644 --- a/Core/Txc22211C.h +++ b/Core/Txc22211C.h @@ -5,7 +5,7 @@ class Txc22211C : public Txc22211A { protected: - virtual uint8_t ReadRegister(uint16_t addr) + virtual uint8_t ReadRegister(uint16_t addr) override { return (_regs[1] ^ _regs[2]) | 0x41; } diff --git a/Core/UNROM.h b/Core/UNROM.h index 4a9f2a63..86ccd909 100644 --- a/Core/UNROM.h +++ b/Core/UNROM.h @@ -5,10 +5,10 @@ class UNROM : 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 { //First and last PRG page SelectPRGPage(0, 0); @@ -17,9 +17,9 @@ class UNROM : public BaseMapper 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); } diff --git a/Core/UnRom_180.h b/Core/UnRom_180.h index e1a99f71..ccf0d733 100644 --- a/Core/UnRom_180.h +++ b/Core/UnRom_180.h @@ -5,10 +5,10 @@ class UnRom_180 : 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, 0); 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 & 0x07); } diff --git a/Core/UnRom_94.h b/Core/UnRom_94.h index c4494966..e71cbea3 100644 --- a/Core/UnRom_94.h +++ b/Core/UnRom_94.h @@ -5,10 +5,10 @@ class UnRom_94 : 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 { //First and last PRG page SelectPRGPage(0, 0); @@ -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 >> 2) & 0x07); } diff --git a/Core/UnlPci556.h b/Core/UnlPci556.h index 6971e34c..877e8f12 100644 --- a/Core/UnlPci556.h +++ b/Core/UnlPci556.h @@ -5,18 +5,18 @@ class UnlPci556 : public BaseMapper { protected: - virtual uint16_t GetPRGPageSize() { return 0x8000; } - virtual uint16_t GetCHRPageSize() { return 0x2000; } - virtual uint16_t RegisterStartAddress() { return 0x7000; } - 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 0x7000; } + 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 { SelectPRGPage(0, value & 0x03); SelectCHRPage(0, (value >> 2) & 0x03); diff --git a/Core/VRC1.h b/Core/VRC1.h index dc607374..f9cb2459 100644 --- a/Core/VRC1.h +++ b/Core/VRC1.h @@ -14,15 +14,15 @@ private: } protected: - 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; } - void InitMapper() + void InitMapper() override { SelectPRGPage(3, -1); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); @@ -30,7 +30,7 @@ protected: Stream(chrBanks); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF000) { case 0x8000: SelectPRGPage(0, value & 0x0F); break; diff --git a/Core/VRC2_4.h b/Core/VRC2_4.h index 6e1e7f68..66cc5423 100644 --- a/Core/VRC2_4.h +++ b/Core/VRC2_4.h @@ -78,10 +78,10 @@ class VRC2_4 : 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; } - void InitMapper() + void InitMapper() override { DetectVariant(); @@ -95,7 +95,7 @@ class VRC2_4 : public BaseMapper UpdateState(); } - void ProcessCpuClock() + void ProcessCpuClock() override { _irq.ProcessCpuClock(); } @@ -124,7 +124,7 @@ class VRC2_4 : public BaseMapper } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { addr = TranslateAddress(addr) & 0xF00F; @@ -278,7 +278,7 @@ class VRC2_4 : public BaseMapper return (addr & 0xFF00) | (A1 << 1) | A0; } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo loChrRegs = { _loCHRRegs, 8 }; diff --git a/Core/VRC3.h b/Core/VRC3.h index 2998a70b..35518fa5 100644 --- a/Core/VRC3.h +++ b/Core/VRC3.h @@ -13,22 +13,22 @@ private: uint16_t _irqCounter = 0; 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(1, -1); SelectCHRPage(0, 0); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_irqEnableOnAck, _smallCounter, _irqEnabled, _irqCounter, _irqReload); } - virtual void ProcessCpuClock() + virtual void ProcessCpuClock() override { if(_irqEnabled) { if(_smallCounter) { @@ -49,7 +49,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0xF000) { case 0x8000: _irqReload = (_irqReload & 0xFFF0) | (value & 0x0F); break; diff --git a/Core/VRC6.h b/Core/VRC6.h index 1914f4fb..12920dc7 100644 --- a/Core/VRC6.h +++ b/Core/VRC6.h @@ -23,10 +23,10 @@ private: } 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 { _irq.Reset(); _audio.Reset(); @@ -34,7 +34,7 @@ protected: SelectPRGPage(3, -1); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo chrRegisters = { _chrRegisters, 8 }; @@ -48,7 +48,7 @@ protected: } } - void ProcessCpuClock() + void ProcessCpuClock() override { _irq.ProcessCpuClock(); _audio.Clock(); @@ -96,7 +96,7 @@ protected: UpdatePrgRamAccess(); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(_model == VRCVariant::VRC6b) { addr = (addr & 0xFFFC) | ((addr & 0x01) << 1) | ((addr & 0x02) >> 1); diff --git a/Core/VRC7.h b/Core/VRC7.h index ccecfcf8..d65541a9 100644 --- a/Core/VRC7.h +++ b/Core/VRC7.h @@ -19,10 +19,10 @@ private: } 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 { _irq.Reset(); _controlFlags = 0; @@ -30,7 +30,7 @@ protected: SelectPRGPage(3, -1); } - virtual void StreamState(bool saving) + virtual void StreamState(bool saving) override { BaseMapper::StreamState(saving); SnapshotInfo irq{ &_irq }; @@ -44,7 +44,7 @@ protected: } } - void ProcessCpuClock() + void ProcessCpuClock() override { _irq.ProcessCpuClock(); _audio.Clock(); @@ -62,7 +62,7 @@ protected: UpdatePrgRamAccess(); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr & 0x10 && (addr & 0xF010) != 0x9010) { addr |= 0x08; diff --git a/Core/Vrc6Audio.h b/Core/Vrc6Audio.h index 8b72e8dc..9f60d086 100644 --- a/Core/Vrc6Audio.h +++ b/Core/Vrc6Audio.h @@ -13,7 +13,7 @@ private: int32_t _lastOutput; protected: - void StreamState(bool saving) + void StreamState(bool saving) override { SnapshotInfo pulse1{ &_pulse1 }; SnapshotInfo pulse2{ &_pulse2 }; @@ -22,7 +22,7 @@ protected: Stream(_lastOutput, _haltAudio, pulse1, pulse2, saw); } - void ClockAudio() + void ClockAudio() override { if(!_haltAudio) { _pulse1.Clock(); diff --git a/Core/Vrc6Pulse.h b/Core/Vrc6Pulse.h index 570d6915..7bb149c5 100644 --- a/Core/Vrc6Pulse.h +++ b/Core/Vrc6Pulse.h @@ -15,7 +15,7 @@ private: uint8_t _step = 0; uint8_t _frequencyShift = 0; - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(_volume, _dutyCycle, _ignoreDuty, _frequency, _enabled, _timer, _step, _frequencyShift); } diff --git a/Core/Vrc6Saw.h b/Core/Vrc6Saw.h index 474103f6..5bb37c9c 100644 --- a/Core/Vrc6Saw.h +++ b/Core/Vrc6Saw.h @@ -14,7 +14,7 @@ private: uint8_t _step = 0; uint8_t _frequencyShift = 0; - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(_accumulatorRate, _accumulator, _frequency, _enabled, _timer, _step, _frequencyShift); } diff --git a/Core/Vrc7Audio.h b/Core/Vrc7Audio.h index 46323541..3da11de9 100644 --- a/Core/Vrc7Audio.h +++ b/Core/Vrc7Audio.h @@ -13,7 +13,7 @@ private: double _clockTimer; protected: - void ClockAudio() + void ClockAudio() override { _clockTimer--; if(_clockTimer <= 0) { @@ -24,7 +24,7 @@ protected: } } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseExpansionAudio::StreamState(saving); diff --git a/Core/VrcIrq.h b/Core/VrcIrq.h index a6309460..280fcd87 100644 --- a/Core/VrcIrq.h +++ b/Core/VrcIrq.h @@ -13,7 +13,7 @@ private: bool _irqCycleMode; protected: - void StreamState(bool saving) + void StreamState(bool saving) override { Stream(_irqReloadValue, _irqCounter, _irqPrescalerCounter, _irqEnabled, _irqEnabledAfterAck, _irqCycleMode); } diff --git a/Core/VsControlManager.h b/Core/VsControlManager.h index 74cf9983..48fd083e 100644 --- a/Core/VsControlManager.h +++ b/Core/VsControlManager.h @@ -74,12 +74,12 @@ public: } } - shared_ptr GetZapper(uint8_t port) + shared_ptr GetZapper(uint8_t port) override { return shared_ptr(new VsZapper(port)); } - void Reset(bool softReset) + void Reset(bool softReset) override { _protectionCounter = 0; } @@ -89,7 +89,7 @@ public: return _instance; } - void StreamState(bool saving) + void StreamState(bool saving) override { ControlManager::StreamState(saving); Stream(_prgChrSelectBit, _protectionCounter); @@ -118,7 +118,7 @@ public: _serviceButton = pushed; } - void GetMemoryRanges(MemoryRanges &ranges) + void GetMemoryRanges(MemoryRanges &ranges) override { ControlManager::GetMemoryRanges(ranges); ranges.AddHandler(MemoryOperation::Read, 0x4020, 0x5FFF); @@ -176,7 +176,7 @@ public: } } - void RefreshAllPorts() + void RefreshAllPorts() override { ControlManager::RefreshAllPorts(); if(_inputType != VsInputType::Default) { @@ -184,7 +184,7 @@ public: } } - uint8_t ReadRAM(uint16_t addr) + uint8_t ReadRAM(uint16_t addr) override { UpdateCoinInsertedFlags(); @@ -245,7 +245,7 @@ public: return value; } - void WriteRAM(uint16_t addr, uint8_t value) + void WriteRAM(uint16_t addr, uint8_t value) override { ControlManager::WriteRAM(addr, value); diff --git a/Core/VsSystem.h b/Core/VsSystem.h index 65035bc1..3a4993bc 100644 --- a/Core/VsSystem.h +++ b/Core/VsSystem.h @@ -9,10 +9,10 @@ private: uint8_t _prgChrSelectBit = false; 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; } - virtual void InitMapper() + virtual void InitMapper() override { //"Note: unlike all other mappers, an undersize mapper 99 image implies open bus instead of mirroring." //However, it doesn't look like any game actually rely on this behavior? So not implemented for now. @@ -27,14 +27,14 @@ protected: _gameSystem = GameSystem::VsUniSystem; } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgChrSelectBit); } - void ProcessCpuClock() + void ProcessCpuClock() override { if(_prgChrSelectBit != VsControlManager::GetInstance()->GetPrgChrSelectBit()) { _prgChrSelectBit = VsControlManager::GetInstance()->GetPrgChrSelectBit(); diff --git a/Core/Waixing162.h b/Core/Waixing162.h index 67cfa7d1..171eaf53 100644 --- a/Core/Waixing162.h +++ b/Core/Waixing162.h @@ -7,12 +7,12 @@ private: uint8_t _regs[4]; protected: - uint16_t GetPRGPageSize() { return 0x8000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint16_t RegisterStartAddress() { return 0x5000; } - uint16_t RegisterEndAddress() { return 0x5FFF; } + uint16_t GetPRGPageSize() override { return 0x8000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x5000; } + uint16_t RegisterEndAddress() override { return 0x5FFF; } - void InitMapper() + void InitMapper() override { _regs[0] = 3; _regs[1] = 0; @@ -23,7 +23,7 @@ protected: UpdateState(); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); ArrayInfo regs{ _regs, 4 }; @@ -40,7 +40,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { _regs[(addr >> 8) & 0x03] = value; UpdateState(); diff --git a/Core/Waixing164.h b/Core/Waixing164.h index 2ff2c875..f1421ea5 100644 --- a/Core/Waixing164.h +++ b/Core/Waixing164.h @@ -7,25 +7,25 @@ private: uint8_t _prgBank; protected: - uint16_t GetPRGPageSize() { return 0x8000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint16_t RegisterStartAddress() { return 0x5000; } - uint16_t RegisterEndAddress() { return 0x5FFF; } + uint16_t GetPRGPageSize() override { return 0x8000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x5000; } + uint16_t RegisterEndAddress() override { return 0x5FFF; } - void InitMapper() + void InitMapper() override { _prgBank = 0x0F; SelectPRGPage(0, _prgBank); SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_prgBank); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr & 0x7300) { case 0x5000: _prgBank = (_prgBank & 0xF0) | (value & 0x0F); SelectPRGPage(0, _prgBank); break; diff --git a/Core/Waixing176.h b/Core/Waixing176.h index 32a5ba6d..5e750fcc 100644 --- a/Core/Waixing176.h +++ b/Core/Waixing176.h @@ -7,12 +7,12 @@ private: bool _registersEnabled; protected: - uint16_t GetPRGPageSize() { return 0x2000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint16_t RegisterStartAddress() { return 0x5000; } - uint16_t RegisterEndAddress() { return 0x5FFF; } + uint16_t GetPRGPageSize() override { return 0x2000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x5000; } + uint16_t RegisterEndAddress() override { return 0x5FFF; } - void InitMapper() + void InitMapper() override { _registersEnabled = false; @@ -22,13 +22,13 @@ protected: SelectPRGPage(3, (GetPRGPageCount() - 1) & 0x3F); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_registersEnabled); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { switch(addr) { case 0x5001: diff --git a/Core/Waixing178.h b/Core/Waixing178.h index f348b6a7..41f1cae1 100644 --- a/Core/Waixing178.h +++ b/Core/Waixing178.h @@ -7,20 +7,20 @@ private: uint8_t _regs[4]; protected: - uint16_t GetPRGPageSize() { return 0x4000; } - uint16_t GetCHRPageSize() { return 0x2000; } - uint16_t RegisterStartAddress() { return 0x4800; } - uint16_t RegisterEndAddress() { return 0x4FFF; } - uint32_t GetWorkRamSize() { return 0x8000; } + uint16_t GetPRGPageSize() override { return 0x4000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint16_t RegisterStartAddress() override { return 0x4800; } + uint16_t RegisterEndAddress() override { return 0x4FFF; } + uint32_t GetWorkRamSize() override { return 0x8000; } - void InitMapper() + void InitMapper() override { memset(_regs, 0, sizeof(_regs)); UpdateState(); SelectCHRPage(0, 0); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); Stream(_regs[0], _regs[1], _regs[2], _regs[3]); @@ -54,7 +54,7 @@ protected: SetMirroringType(_regs[0] & 0x01 ? MirroringType::Horizontal : MirroringType::Vertical); } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { _regs[addr & 0x03] = value; UpdateState(); diff --git a/Core/Waixing252.h b/Core/Waixing252.h index b5dd0f15..36b78781 100644 --- a/Core/Waixing252.h +++ b/Core/Waixing252.h @@ -9,10 +9,10 @@ private: VrcIrq _irq; 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() + void InitMapper() override { memset(_chrRegs, 0, sizeof(_chrRegs)); @@ -20,7 +20,7 @@ protected: SelectPRGPage(3, -1); } - void StreamState(bool saving) + void StreamState(bool saving) override { BaseMapper::StreamState(saving); SnapshotInfo irq{ &_irq }; @@ -32,7 +32,7 @@ protected: } } - void ProcessCpuClock() + void ProcessCpuClock() override { _irq.ProcessCpuClock(); } @@ -45,7 +45,7 @@ protected: } } - void WriteRegister(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) override { if(addr <= 0x8FFF) { SelectPRGPage(0, value); diff --git a/Core/Zapper.h b/Core/Zapper.h index 3c3d5a88..b81b33b8 100644 --- a/Core/Zapper.h +++ b/Core/Zapper.h @@ -21,15 +21,15 @@ private: int32_t _yPosition = -1; protected: - virtual uint8_t RefreshState(); - uint8_t ProcessNetPlayState(uint32_t netplayState); - void StreamState(bool saving); + virtual uint8_t RefreshState() override; + uint8_t ProcessNetPlayState(uint32_t netplayState) override; + void StreamState(bool saving) override; ZapperButtonState GetZapperState(); public: using BaseControlDevice::BaseControlDevice; - virtual uint8_t GetPortOutput(); + virtual uint8_t GetPortOutput() override; - virtual uint32_t GetNetPlayState(); + virtual uint32_t GetNetPlayState() override; }; \ No newline at end of file diff --git a/Linux/BaseRenderer.cpp b/Linux/BaseRenderer.cpp index db5b5350..4a77a8c6 100644 --- a/Linux/BaseRenderer.cpp +++ b/Linux/BaseRenderer.cpp @@ -103,7 +103,7 @@ void BaseRenderer::ShowFpsCounter() if(elapsedSeconds > 1.0) { //Update fps every sec uint32_t frameCount = VideoDecoder::GetInstance()->GetFrameCount(); - if(frameCount - _lastFrameCount < 0) { + if(frameCount < _lastFrameCount) { _currentFPS = 0; } else { _currentFPS = (int)(std::round((double)(frameCount - _lastFrameCount) / elapsedSeconds)); diff --git a/Linux/SdlRenderer.cpp b/Linux/SdlRenderer.cpp index c3375604..9d6ee4ec 100755 --- a/Linux/SdlRenderer.cpp +++ b/Linux/SdlRenderer.cpp @@ -34,8 +34,8 @@ void SdlRenderer::Init() SDL_SetWindowSize(_sdlWindow, _screenWidth, _screenHeight); - _frameBuffer = new uint8_t[_nesFrameHeight*_nesFrameWidth*4]; - memset(_frameBuffer, 0, _nesFrameHeight*_nesFrameWidth*4); + _frameBuffer = new uint8_t[_nesFrameHeight*_nesFrameWidth*_bytesPerPixel]; + memset(_frameBuffer, 0, _nesFrameHeight*_nesFrameWidth*_bytesPerPixel); } void SdlRenderer::Cleanup() @@ -91,7 +91,7 @@ void SdlRenderer::UpdateFrame(void *frameBuffer, uint32_t width, uint32_t height { _frameLock.Acquire(); SetScreenSize(width, height); - memcpy(_frameBuffer, frameBuffer, width*height*4); + memcpy(_frameBuffer, frameBuffer, width*height*_bytesPerPixel); _frameChanged = true; _frameLock.Release(); } @@ -109,7 +109,7 @@ void SdlRenderer::Render() SDL_LockTexture(_sdlTexture, nullptr, (void**)&textureBuffer, &rowPitch); uint32_t* ppuFrameBuffer = (uint32_t*)_frameBuffer; for(uint32_t i = 0, iMax = _nesFrameHeight; i < iMax; i++) { - memcpy(textureBuffer, ppuFrameBuffer, _nesFrameWidth*4); + memcpy(textureBuffer, ppuFrameBuffer, _nesFrameWidth*_bytesPerPixel); ppuFrameBuffer += _nesFrameWidth; textureBuffer += rowPitch; } diff --git a/Linux/SdlSoundManager.h b/Linux/SdlSoundManager.h index d0f69133..3feac7c3 100755 --- a/Linux/SdlSoundManager.h +++ b/Linux/SdlSoundManager.h @@ -29,7 +29,6 @@ private: string _deviceName; bool _needReset = false; - uint16_t _lastWriteOffset = 0; uint16_t _previousLatency = 0; uint32_t _sampleRate = 0; bool _isStereo = false; diff --git a/Linux/SpriteFont.cpp b/Linux/SpriteFont.cpp index dedce80c..d533bbf4 100644 --- a/Linux/SpriteFont.cpp +++ b/Linux/SpriteFont.cpp @@ -79,11 +79,6 @@ static const char spriteFontMagic[] = "DXTKfont"; // Comparison operators make our sorted glyph vector work with std::binary_search and lower_bound. -static inline bool operator< (SpriteFont::Glyph const& left, SpriteFont::Glyph const& right) -{ - return left.Character < right.Character; -} - static inline bool operator< (wchar_t left, SpriteFont::Glyph const& right) { return (uint32_t)left < right.Character; @@ -302,7 +297,7 @@ RECT SpriteFont::MeasureDrawBounds(wchar_t const* text, XMFLOAT2 const& position result.bottom = long(maxY); }); - if (result.left == LONG_MAX) + if (result.left == UINT32_MAX) { result.left = 0; result.top = 0; diff --git a/Utilities/Socket.cpp b/Utilities/Socket.cpp index 02c21c55..1c7cd1e8 100644 --- a/Utilities/Socket.cpp +++ b/Utilities/Socket.cpp @@ -188,7 +188,7 @@ bool Socket::Connect(const char* hostname, uint16_t port) } else { //Could not connect if(returnVal == SOCKET_ERROR) { - int nError = WSAGetLastError(); + //int nError = WSAGetLastError(); //std::cout << "select failed: nError " << std::to_string(nError) << " returnVal" << std::to_string(returnVal) << std::endl; } SetConnectionErrorFlag(); diff --git a/Utilities/Socket.h b/Utilities/Socket.h index cb7b75a7..82690c62 100644 --- a/Utilities/Socket.h +++ b/Utilities/Socket.h @@ -5,9 +5,12 @@ class Socket { private: + #ifdef WIN32 + bool _cleanupWSA = false; + #endif + uintptr_t _socket = ~0; bool _connectionError = false; - bool _cleanupWSA = false; char* _sendBuffer; int _bufferPosition; int32_t _UPnPPort = -1; diff --git a/Utilities/Timer.h b/Utilities/Timer.h index 60384db8..eedfb72f 100644 --- a/Utilities/Timer.h +++ b/Utilities/Timer.h @@ -4,7 +4,9 @@ class Timer { private: + #ifdef WIN32 double _frequency = 0.0; + #endif uint64_t _start; public: