diff --git a/Core/BaseControlDevice.cpp b/Core/BaseControlDevice.cpp index 88947133..b8266bb9 100644 --- a/Core/BaseControlDevice.cpp +++ b/Core/BaseControlDevice.cpp @@ -58,12 +58,12 @@ uint8_t BaseControlDevice::ProcessNetPlayState(uint32_t netplayState) uint8_t BaseControlDevice::GetControlState() { - GameServerConnection* netPlayDevice = nullptr; + GameServerConnection* netPlayDevice = GameServerConnection::GetNetPlayDevice(_port); if(Movie::Playing()) { _currentState = Movie::GetInstance()->GetState(_port); } else if(GameClient::Connected()) { _currentState = GameClient::GetControllerState(_port); - } else if(netPlayDevice = GameServerConnection::GetNetPlayDevice(_port)) { + } else if(netPlayDevice) { _currentState = ProcessNetPlayState(netPlayDevice->GetState()); } else { _currentState = RefreshState(); diff --git a/Core/BaseMapper.cpp b/Core/BaseMapper.cpp index dd590f46..c89c177f 100644 --- a/Core/BaseMapper.cpp +++ b/Core/BaseMapper.cpp @@ -4,6 +4,11 @@ #include "../Utilities/FolderUtilities.h" #include "CheatManager.h" +void BaseMapper::WriteRegister(uint16_t addr, uint8_t value) { } +uint8_t BaseMapper::ReadRegister(uint16_t addr) { return 0; } +void BaseMapper::InitMapper(RomData &romData) { } +void BaseMapper::Reset(bool softReset) { } + uint16_t BaseMapper::InternalGetPrgPageSize() { //Make sure the page size is no bigger than the size of the ROM itself @@ -72,8 +77,8 @@ void BaseMapper::SetCpuMemoryMapping(uint16_t startAddr, uint16_t endAddr, int16 void BaseMapper::SetPpuMemoryMapping(uint16_t startAddr, uint16_t endAddr, uint16_t pageNumber, ChrMemoryType type, int8_t accessType) { - uint32_t pageCount; - uint32_t pageSize; + uint32_t pageCount = 0; + uint32_t pageSize = 0; uint8_t* sourceMemory = nullptr; uint8_t defaultAccessType = MemoryAccessType::Read; switch(type) { @@ -272,13 +277,13 @@ void BaseMapper::RemoveRegisterRange(uint16_t startAddr, uint16_t endAddr) void BaseMapper::StreamState(bool saving) { - Stream(_mirroringType, - ArrayInfo{_chrRam, _chrRamSize}, - ArrayInfo{_workRam, GetWorkRamSize()}, - ArrayInfo{_saveRam, _saveRamSize}, - ArrayInfo{_prgPageNumbers, 64}, - ArrayInfo{_chrPageNumbers, 64}, - ArrayInfo{_nametableIndexes, 4}); + ArrayInfo chrRam = { _chrRam, _chrRamSize }; + ArrayInfo workRam = { _workRam, GetWorkRamSize() }; + ArrayInfo saveRam = { _saveRam, _saveRamSize }; + ArrayInfo prgPageNumbers = { _prgPageNumbers, 64 }; + ArrayInfo chrPageNumbers = { _chrPageNumbers, 64 }; + ArrayInfo nametableIndexes = { _nametableIndexes, 4 }; + Stream(_mirroringType, chrRam, workRam, saveRam, prgPageNumbers, chrPageNumbers, nametableIndexes); if(!saving) { for(uint16_t i = 0; i < 64; i++) { diff --git a/Core/BaseMapper.h b/Core/BaseMapper.h index b347b22d..25cb82e4 100644 --- a/Core/BaseMapper.h +++ b/Core/BaseMapper.h @@ -80,7 +80,7 @@ protected: bool _hasBattery = false; virtual void InitMapper() = 0; - virtual void InitMapper(RomData &romData) { } + virtual void InitMapper(RomData &romData); virtual uint16_t GetPRGPageSize() = 0; virtual uint16_t GetCHRPageSize() = 0; @@ -105,8 +105,8 @@ protected: uint8_t InternalReadRam(uint16_t addr); - virtual void WriteRegister(uint16_t addr, uint8_t value) { } - virtual uint8_t ReadRegister(uint16_t addr) { return 0; } + virtual void WriteRegister(uint16_t addr, uint8_t value); + virtual uint8_t ReadRegister(uint16_t addr); void SelectPrgPage4x(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom); void SelectPrgPage2x(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom); @@ -147,7 +147,7 @@ protected: public: void Initialize(RomData &romData); virtual ~BaseMapper(); - virtual void Reset(bool softReset) { } + virtual void Reset(bool softReset); virtual void ProcessCpuClock() { } virtual void NotifyVRAMAddressChange(uint16_t addr); diff --git a/Core/Breakpoint.cpp b/Core/Breakpoint.cpp index 3f83a4c9..81dfbb20 100644 --- a/Core/Breakpoint.cpp +++ b/Core/Breakpoint.cpp @@ -12,7 +12,7 @@ Breakpoint::~Breakpoint() bool Breakpoint::Matches(uint32_t memoryAddr, uint32_t absoluteAddr) { - return _addr == -1 || (memoryAddr == _addr && !_isAbsoluteAddr) || (absoluteAddr == _addr && _isAbsoluteAddr); + return _addr == -1 || ((int32_t)memoryAddr == _addr && !_isAbsoluteAddr) || ((int32_t)absoluteAddr == _addr && _isAbsoluteAddr); } BreakpointType Breakpoint::GetType() diff --git a/Core/CPU.h b/Core/CPU.h index 6b0ced9c..77cc2719 100644 --- a/Core/CPU.h +++ b/Core/CPU.h @@ -503,7 +503,6 @@ private: if(branch) { //"a taken non-page-crossing branch ignores IRQ/NMI during its last clock, so that next instruction executes before the IRQ" //Fixes "branch_delays_irq" test - bool skipIrq = false; if(_runIrq && !_prevRunIrq) { _runIrq = false; } diff --git a/Core/Console.cpp b/Core/Console.cpp index f32061b8..dea40daf 100644 --- a/Core/Console.cpp +++ b/Core/Console.cpp @@ -204,7 +204,6 @@ void Console::Run() { Timer clockTimer; double targetTime; - double elapsedTime = 0; uint32_t lastFrameNumber = -1; _runLock.Acquire(); @@ -314,6 +313,7 @@ double Console::UpdateNesModel(bool sendNotification) } else { //60.1fps (NTSC), 50.01fps (PAL/Dendy) switch(model) { + default: case NesModel::NTSC: frameDelay = 16.63926405550947; break; case NesModel::PAL: case NesModel::Dendy: frameDelay = 19.99720920217466; break; diff --git a/Core/ControlManager.cpp b/Core/ControlManager.cpp index a16b247a..38679dc6 100644 --- a/Core/ControlManager.cpp +++ b/Core/ControlManager.cpp @@ -217,7 +217,8 @@ void ControlManager::StreamState(bool saving) } } - Stream(_refreshState, _mousePosition.X, _mousePosition.Y, nesModel, expansionDevice, consoleType, ArrayInfo{controllerTypes, 4}, hasFourScore); + ArrayInfo types = { controllerTypes, 4 }; + Stream(_refreshState, _mousePosition.X, _mousePosition.Y, nesModel, expansionDevice, consoleType, types, hasFourScore); if(!saving) { EmulationSettings::SetNesModel(nesModel); diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 6d67cba0..d9dabf26 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -183,6 +183,7 @@ Default MultiThreadedDebugDLL + true Console @@ -209,6 +210,7 @@ Default MultiThreadedDebugDLL + true Console @@ -221,7 +223,7 @@ - Level3 + Level4 Use Full true @@ -235,6 +237,7 @@ Default MultiThreadedDLL + true Console @@ -259,6 +262,7 @@ Default MultiThreaded + true Console @@ -283,6 +287,7 @@ Default MultiThreaded + true Console @@ -293,7 +298,7 @@ - Level3 + Level4 Use Full true @@ -307,6 +312,7 @@ Default MultiThreadedDLL + true Console @@ -331,6 +337,7 @@ Default MultiThreaded + true Console @@ -355,6 +362,7 @@ Default MultiThreaded + true Console diff --git a/Core/FdsAudio.h b/Core/FdsAudio.h index 879037fd..117c2555 100644 --- a/Core/FdsAudio.h +++ b/Core/FdsAudio.h @@ -37,8 +37,9 @@ protected: Stream(&_volume); Stream(&_mod); - Stream(_waveWriteEnabled, _disableEnvelopes, _haltWaveform, _masterVolume, _waveOverflowCounter, _wavePitch, _wavePosition, _lastOutput, - ArrayInfo{_waveTable, 64}); + ArrayInfo waveTable = { _waveTable, 64 }; + + Stream(_waveWriteEnabled, _disableEnvelopes, _haltWaveform, _masterVolume, _waveOverflowCounter, _wavePitch, _wavePosition, _lastOutput, waveTable); } public: diff --git a/Core/GameConnection.cpp b/Core/GameConnection.cpp index 910b3c33..083e2ab4 100644 --- a/Core/GameConnection.cpp +++ b/Core/GameConnection.cpp @@ -10,6 +10,8 @@ #include "ClientConnectionData.h" #include "ForceDisconnectMessage.h" +const uint32_t PlayerListMessage::PlayerNameMaxLength; + GameConnection::GameConnection(shared_ptr socket, shared_ptr connectionData) { _connectionData = connectionData; diff --git a/Core/HdNesPack.h b/Core/HdNesPack.h index fbffd133..2f845504 100644 --- a/Core/HdNesPack.h +++ b/Core/HdNesPack.h @@ -216,7 +216,7 @@ public: } if(pixelInfo.Sprite.TileIndex != HdPpuTileInfo::NoTile) { - auto hdTile = _tileInfoByKey.find(pixelInfo.Sprite.GetKey(false)); + hdTile = _tileInfoByKey.find(pixelInfo.Sprite.GetKey(false)); if(hdTile != _tileInfoByKey.end()) { hdPackSpriteInfo = hdTile->second; } else { diff --git a/Core/JalecoSs88006.h b/Core/JalecoSs88006.h index 257c56bd..64b6c523 100644 --- a/Core/JalecoSs88006.h +++ b/Core/JalecoSs88006.h @@ -32,12 +32,12 @@ class JalecoSs88006 : public BaseMapper virtual void StreamState(bool saving) { - BaseMapper::StreamState(saving); - Stream(_irqCounter, _irqCounterSize, _irqEnabled, - ArrayInfo{_prgBanks, 3}, - ArrayInfo{_chrBanks, 8}, - ArrayInfo{_irqReloadValue, 4}); + + ArrayInfo prgBanks = { _prgBanks, 3 }; + ArrayInfo chrBanks = { _chrBanks, 8 }; + ArrayInfo irqReloadValue = { _irqReloadValue, 4 }; + Stream(_irqCounter, _irqCounterSize, _irqEnabled, prgBanks, chrBanks, irqReloadValue); } void SetMirroring(uint8_t value) diff --git a/Core/MMC3.h b/Core/MMC3.h index 8c4b2945..2c3f668c 100644 --- a/Core/MMC3.h +++ b/Core/MMC3.h @@ -149,9 +149,10 @@ class MMC3 : public BaseMapper virtual void StreamState(bool saving) { BaseMapper::StreamState(saving); + ArrayInfo registers = { _registers, 8 }; Stream(_state.Reg8000, _state.RegA000, _state.RegA001, _currentRegister, _chrMode, _prgMode, _irqReloadValue, _irqCounter, _irqReload, _irqEnabled, _lastCycle, _cyclesDown, - _wramEnabled, _wramWriteProtected, ArrayInfo{_registers, 8}, _needIrq); + _wramEnabled, _wramWriteProtected, registers, _needIrq); } virtual uint16_t GetPRGPageSize() { return 0x2000; } diff --git a/Core/MMC3_45.h b/Core/MMC3_45.h index 90158426..086860c2 100644 --- a/Core/MMC3_45.h +++ b/Core/MMC3_45.h @@ -15,7 +15,8 @@ protected: virtual void StreamState(bool saving) { MMC3::StreamState(saving); - Stream(_regIndex, ArrayInfo{_reg, 4}); + ArrayInfo reg = { _reg, 4 }; + Stream(_regIndex, reg); if(_reg[3] & 0x40) { RemoveRegisterRange(0x6000, 0x7FFF); diff --git a/Core/MMC5.h b/Core/MMC5.h index 888eb8d2..7dbf78ff 100644 --- a/Core/MMC5.h +++ b/Core/MMC5.h @@ -319,10 +319,12 @@ protected: { BaseMapper::StreamState(saving); + ArrayInfo prgBanks = { _prgBanks, 5 }; + ArrayInfo chrBanks = { _chrBanks, 12 }; Stream(_prgRamProtect1, _prgRamProtect2, _fillModeTile, _fillModeColor, _verticalSplitEnabled, _verticalSplitRightSide, _verticalSplitDelimiterTile, _verticalSplitScroll, _verticalSplitBank, _multiplierValue1, _multiplierValue2, _nametableMapping, _extendedRamMode, _exAttributeLastNametableFetch, _exAttrLastFetchCounter, _exAttrSelectedChrBank, - _prgMode, ArrayInfo{_prgBanks, 5}, _chrMode, _chrUpperBits, ArrayInfo{_chrBanks, 12}, _lastChrReg, + _prgMode, prgBanks, _chrMode, _chrUpperBits, chrBanks, _lastChrReg, _spriteFetch, _largeSprites, _irqCounterTarget, _irqEnabled, _previousScanline, _irqCounter, _irqPending, _ppuInFrame); if(!saving) { diff --git a/Core/MemoryManager.cpp b/Core/MemoryManager.cpp index 9c2740df..27927262 100644 --- a/Core/MemoryManager.cpp +++ b/Core/MemoryManager.cpp @@ -171,7 +171,8 @@ uint32_t MemoryManager::ToAbsoluteChrAddress(uint16_t vramAddr) void MemoryManager::StreamState(bool saving) { - Stream(ArrayInfo{_internalRAM, MemoryManager::InternalRAMSize}, - ArrayInfo{_nametableRAM[0], MemoryManager::NameTableScreenSize}, - ArrayInfo{_nametableRAM[1], MemoryManager::NameTableScreenSize}); + ArrayInfo internalRam = { _internalRAM, MemoryManager::InternalRAMSize }; + ArrayInfo nameTable0Ram = { _nametableRAM[0], MemoryManager::NameTableScreenSize }; + ArrayInfo nameTable1Ram = { _nametableRAM[1], MemoryManager::NameTableScreenSize }; + Stream(internalRam, nameTable0Ram, nameTable1Ram); } \ No newline at end of file diff --git a/Core/ModChannel.h b/Core/ModChannel.h index e747589c..61403626 100644 --- a/Core/ModChannel.h +++ b/Core/ModChannel.h @@ -19,7 +19,9 @@ protected: void StreamState(bool saving) { BaseFdsChannel::StreamState(saving); - Stream(_counter, _modulationDisabled, _modTablePosition, _overflowCounter, ArrayInfo{_modTable, 64}); + + ArrayInfo modTable = { _modTable, 64 }; + Stream(_counter, _modulationDisabled, _modTablePosition, _overflowCounter, modTable); } public: diff --git a/Core/Nanjing.h b/Core/Nanjing.h index c6350db0..e38acda5 100644 --- a/Core/Nanjing.h +++ b/Core/Nanjing.h @@ -26,7 +26,8 @@ protected: virtual void StreamState(bool saving) { BaseMapper::StreamState(saving); - Stream(ArrayInfo{_registers, 5}, _toggle, _autoSwitchCHR); + ArrayInfo registers = { _registers, 5 }; + Stream(registers, _toggle, _autoSwitchCHR); } void InitMapper() diff --git a/Core/PPU.cpp b/Core/PPU.cpp index 75c43842..1385f963 100644 --- a/Core/PPU.cpp +++ b/Core/PPU.cpp @@ -887,6 +887,12 @@ void PPU::ExecStatic() void PPU::StreamState(bool saving) { + ArrayInfo paletteRam = { _paletteRAM, 0x20 }; + ArrayInfo spriteRam = { _spriteRAM, 0x100 }; + ArrayInfo secondarySpriteRam = { _secondarySpriteRAM, 0x20 }; + ArrayInfo openBusDecayStamp = { _openBusDecayStamp, 8 }; + + Stream(_state.Control, _state.Mask, _state.Status, _state.SpriteRamAddr, _state.VideoRamAddr, _state.XScroll, _state.TmpVideoRamAddr, _state.WriteToggle, _state.HighBitShift, _state.LowBitShift, _flags.VerticalWrite, _flags.SpritePatternAddr, _flags.BackgroundPatternAddr, _flags.LargeSprites, _flags.VBlank, _flags.Grayscale, _flags.BackgroundMask, _flags.SpriteMask, _flags.BackgroundEnabled, _flags.SpritesEnabled, _flags.IntensifyRed, _flags.IntensifyGreen, @@ -894,11 +900,7 @@ void PPU::StreamState(bool saving) _cycle, _frameCount, _memoryReadBuffer, _currentTile.LowByte, _currentTile.HighByte, _currentTile.PaletteOffset, _nextTile.LowByte, _nextTile.HighByte, _nextTile.PaletteOffset, _nextTile.TileAddr, _previousTile.LowByte, _previousTile.HighByte, _previousTile.PaletteOffset, _spriteIndex, _spriteCount, _secondaryOAMAddr, _sprite0Visible, _oamCopybuffer, _spriteInRange, _sprite0Added, _spriteAddrH, _spriteAddrL, _oamCopyDone, _nesModel, _spriteDmaAddr, - _spriteDmaCounter, _prevRenderingEnabled, _renderingEnabled, _openBus, _ignoreVramRead, _skipScrollingIncrement, - ArrayInfo{_paletteRAM, 0x20}, - ArrayInfo{_spriteRAM, 0x100}, - ArrayInfo{_secondarySpriteRAM, 0x20}, - ArrayInfo{_openBusDecayStamp, 8}); + _spriteDmaCounter, _prevRenderingEnabled, _renderingEnabled, _openBus, _ignoreVramRead, _skipScrollingIncrement, paletteRam, spriteRam, secondarySpriteRam, openBusDecayStamp); for(int i = 0; i < 64; i++) { Stream(_spriteTiles[i].SpriteX, _spriteTiles[i].LowByte, _spriteTiles[i].HighByte, _spriteTiles[i].PaletteOffset, _spriteTiles[i].HorizontalMirror, _spriteTiles[i].BackgroundPriority); diff --git a/Core/Rambo1.h b/Core/Rambo1.h index 43e3a0f5..70016a1d 100644 --- a/Core/Rambo1.h +++ b/Core/Rambo1.h @@ -35,8 +35,9 @@ protected: void StreamState(bool saving) { BaseMapper::StreamState(saving); + ArrayInfo registers = { _registers, 16 }; Stream(_irqEnabled, _irqCycleMode, _needReload, _needIrqDelay, _irqCounter, _irqReloadValue, _lastCycle, - _cyclesDown, _cpuClockCounter, _currentRegister, ArrayInfo{_registers, 16}, _forceClock); + _cyclesDown, _cpuClockCounter, _currentRegister, registers, _forceClock); } virtual void ProcessCpuClock() diff --git a/Core/RomLoader.cpp b/Core/RomLoader.cpp index a47076bc..ef1c99ba 100644 --- a/Core/RomLoader.cpp +++ b/Core/RomLoader.cpp @@ -20,10 +20,10 @@ bool RomLoader::LoadFromZip(istream &zipFile) if(filename.length() > 4) { if(filename.substr(filename.length() - 4, 4).compare(".nes") == 0 || filename.substr(filename.length() - 4, 4).compare(".fds") == 0) { uint8_t* fileBuffer = nullptr; - size_t fileSize = 0; - reader.ExtractFile(filename, &fileBuffer, fileSize); + size_t size = 0; + reader.ExtractFile(filename, &fileBuffer, size); if(fileBuffer) { - result = LoadFromMemory(fileBuffer, fileSize); + result = LoadFromMemory(fileBuffer, size); delete[] fileBuffer; break; } diff --git a/Core/SaveStateManager.cpp b/Core/SaveStateManager.cpp index 225e3970..b4589e3f 100644 --- a/Core/SaveStateManager.cpp +++ b/Core/SaveStateManager.cpp @@ -6,6 +6,8 @@ #include "../Utilities/FolderUtilities.h" #include "EmulationSettings.h" +const uint32_t SaveStateManager::FileFormatVersion; + string SaveStateManager::GetStateFilepath(int stateIndex) { string folder = FolderUtilities::GetSaveStateFolder(); diff --git a/Core/Snapshotable.cpp b/Core/Snapshotable.cpp index d2a3a696..c66fbe33 100644 --- a/Core/Snapshotable.cpp +++ b/Core/Snapshotable.cpp @@ -13,7 +13,8 @@ void Snapshotable::StreamStartBlock() _blockBuffer = new uint8_t[0xFFFFF]; if(!_saving) { InternalStream(_blockSize); - InternalStream(ArrayInfo{_blockBuffer, std::min((uint32_t)0xFFFFF, _blockSize)}); + ArrayInfo arrayInfo = { _blockBuffer, std::min((uint32_t)0xFFFFF, _blockSize) }; + InternalStream(arrayInfo); } _blockPosition = 0; _inBlock = true; @@ -24,7 +25,8 @@ void Snapshotable::StreamEndBlock() _inBlock = false; if(_saving) { InternalStream(_blockPosition); - InternalStream(ArrayInfo{_blockBuffer, _blockPosition}); + ArrayInfo arrayInfo = { _blockBuffer, _blockPosition }; + InternalStream(arrayInfo); } delete[] _blockBuffer; @@ -43,7 +45,8 @@ void Snapshotable::Stream(Snapshotable* snapshotable) uint8_t *buffer = new uint8_t[size]; stream.read((char*)buffer, size); InternalStream(size); - InternalStream(ArrayInfo{buffer, size}); + ArrayInfo arrayInfo = { buffer, size }; + InternalStream(arrayInfo); delete[] buffer; } else { uint32_t size = 0; @@ -51,7 +54,8 @@ void Snapshotable::Stream(Snapshotable* snapshotable) if(_position + size <= _streamSize) { uint8_t *buffer = new uint8_t[size]; - InternalStream(ArrayInfo{buffer, size}); + ArrayInfo arrayInfo = { buffer, size }; + InternalStream(arrayInfo); stream.write((char*)buffer, size); stream.seekg(0, ios::beg); diff --git a/Core/SoundMixer.cpp b/Core/SoundMixer.cpp index 3677af9b..118f1336 100644 --- a/Core/SoundMixer.cpp +++ b/Core/SoundMixer.cpp @@ -31,7 +31,8 @@ void SoundMixer::StreamState(bool saving) UpdateRates(); } - Stream(_previousOutput, ArrayInfo{_currentOutput, MaxChannelCount}); + ArrayInfo currentOutput = { _currentOutput, MaxChannelCount }; + Stream(_previousOutput, currentOutput); } void SoundMixer::RegisterAudioDevice(IAudioDevice *audioDevice) @@ -172,13 +173,13 @@ void SoundMixer::EndFrame(uint32_t time) _timestamps.erase(std::unique(_timestamps.begin(), _timestamps.end()), _timestamps.end()); for(size_t i = 0, len = _timestamps.size(); i < len; i++) { - uint32_t time = _timestamps[i]; + uint32_t stamp = _timestamps[i]; for(int j = 0; j < MaxChannelCount; j++) { - _currentOutput[j] += _channelOutput[j][time]; + _currentOutput[j] += _channelOutput[j][stamp]; } int16_t currentOutput = GetOutputVolume(); - blip_add_delta(_blipBuf, time, (int)((currentOutput - _previousOutput) * masterVolume)); + blip_add_delta(_blipBuf, stamp, (int)((currentOutput - _previousOutput) * masterVolume)); _previousOutput = currentOutput; } blip_end_frame(_blipBuf, time); diff --git a/Core/TaitoX1017.h b/Core/TaitoX1017.h index f1d2dd25..d62b361b 100644 --- a/Core/TaitoX1017.h +++ b/Core/TaitoX1017.h @@ -110,7 +110,9 @@ protected: virtual void StreamState(bool saving) { BaseMapper::StreamState(saving); - Stream(ArrayInfo{_ramPermission, 3}, ArrayInfo{_chrRegs, 6}, _chrMode); + ArrayInfo ramPermission = { _ramPermission, 3 }; + ArrayInfo chrRegs = { _chrRegs, 6 }; + Stream(ramPermission, chrRegs, _chrMode); if(!saving) { UpdateRamAccess(); diff --git a/Core/VRC1.h b/Core/VRC1.h index 2c6a4614..dc607374 100644 --- a/Core/VRC1.h +++ b/Core/VRC1.h @@ -25,7 +25,9 @@ protected: virtual void StreamState(bool saving) { BaseMapper::StreamState(saving); - Stream(ArrayInfo{ _chrBanks, 2 }); + + ArrayInfo chrBanks = { _chrBanks, 2 }; + Stream(chrBanks); } void WriteRegister(uint16_t addr, uint8_t value) diff --git a/Core/VRC2_4.h b/Core/VRC2_4.h index 5601ca35..c7572e44 100644 --- a/Core/VRC2_4.h +++ b/Core/VRC2_4.h @@ -189,6 +189,8 @@ class VRC2_4 : public BaseMapper void StreamState(bool saving) { BaseMapper::StreamState(saving); - Stream(_prgReg0, _prgReg1, _prgMode, ArrayInfo{_loCHRRegs, 8}, ArrayInfo{_hiCHRRegs, 8}, _hasIRQ, _irq); + ArrayInfo loChrRegs = { _loCHRRegs, 8 }; + ArrayInfo hiChrRegs = { _hiCHRRegs, 8 }; + Stream(_prgReg0, _prgReg1, _prgMode, loChrRegs, hiChrRegs, _hasIRQ, _irq); } }; \ No newline at end of file diff --git a/Core/VRC6.h b/Core/VRC6.h index 746084d7..788bbdc7 100644 --- a/Core/VRC6.h +++ b/Core/VRC6.h @@ -34,7 +34,8 @@ protected: { BaseMapper::StreamState(saving); Stream(_irq); - Stream(_bankingMode, ArrayInfo{_chrRegisters, 8}); + ArrayInfo chrRegisters = { _chrRegisters, 8 }; + Stream(_bankingMode, chrRegisters); if(!saving) { UpdatePrgRamAccess(); diff --git a/Core/VRC7.h b/Core/VRC7.h index dab80b34..8fed5ad1 100644 --- a/Core/VRC7.h +++ b/Core/VRC7.h @@ -32,7 +32,8 @@ protected: { BaseMapper::StreamState(saving); Stream(_irq); - Stream(_controlFlags, ArrayInfo{_chrRegisters, 8}); + ArrayInfo chrRegisters = { _chrRegisters, 8 }; + Stream(_controlFlags, chrRegisters); if(!saving) { UpdatePrgRamAccess(); diff --git a/Core/stdafx.cpp b/Core/stdafx.cpp index 1577c4e3..fd4f341c 100644 --- a/Core/stdafx.cpp +++ b/Core/stdafx.cpp @@ -1 +1 @@ -#include "stdafx.h" \ No newline at end of file +#include "stdafx.h" diff --git a/Utilities/xBRZ/config.h b/Utilities/xBRZ/config.h index 824ed5a2..49a67904 100644 --- a/Utilities/xBRZ/config.h +++ b/Utilities/xBRZ/config.h @@ -30,4 +30,4 @@ struct ScalerCfg }; } -#endif \ No newline at end of file +#endif diff --git a/Windows/Renderer.cpp b/Windows/Renderer.cpp index 2a89e5e5..091493eb 100644 --- a/Windows/Renderer.cpp +++ b/Windows/Renderer.cpp @@ -34,8 +34,6 @@ namespace NES void Renderer::SetScreenSize(uint32_t width, uint32_t height) { - double scale = EmulationSettings::GetVideoScale(); - ScreenSize screenSize; VideoDecoder::GetInstance()->GetScreenSize(screenSize, false); diff --git a/Windows/WindowsKeyManager.h b/Windows/WindowsKeyManager.h index fe6a2297..807457be 100644 --- a/Windows/WindowsKeyManager.h +++ b/Windows/WindowsKeyManager.h @@ -1,7 +1,7 @@ #pragma once #include "stdafx.h" -#include "..\Core\IKeyManager.h" +#include "../Core/IKeyManager.h" #include "GamePad.h" struct KeyDefinition {