diff --git a/src/common/SoundSDL2.cxx b/src/common/SoundSDL2.cxx index cb556c053..bf45e5d19 100644 --- a/src/common/SoundSDL2.cxx +++ b/src/common/SoundSDL2.cxx @@ -238,13 +238,13 @@ void SoundSDL2::adjustVolume(Int8 direction) setVolume(percent); - // enabled audio if it is currently disabled + // Enable audio if it is currently disabled bool enabled = myAudioSettings.enabled(); - if (percent > 0 && !enabled) + if(percent > 0 && !enabled) { - setEnabled(!enabled); - myOSystem.console().initializeAudio(); + setEnabled(!enabled); + myOSystem.console().initializeAudio(); } // Now show an onscreen message diff --git a/src/debugger/BreakpointMap.cxx b/src/debugger/BreakpointMap.cxx index 7ee9377f9..fd9b1976b 100644 --- a/src/debugger/BreakpointMap.cxx +++ b/src/debugger/BreakpointMap.cxx @@ -18,12 +18,6 @@ #include #include "BreakpointMap.hxx" -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -BreakpointMap::BreakpointMap(void) - : myInitialized(false) -{ -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void BreakpointMap::add(const Breakpoint& breakpoint, const uInt32 flags) { diff --git a/src/debugger/BreakpointMap.hxx b/src/debugger/BreakpointMap.hxx index fe09d6997..dd8bcf620 100644 --- a/src/debugger/BreakpointMap.hxx +++ b/src/debugger/BreakpointMap.hxx @@ -29,87 +29,91 @@ */ class BreakpointMap { -private: - static const uInt16 ADDRESS_MASK = 0x1fff; // either 0x1fff or 0xffff (not needed then) + private: + static const uInt16 ADDRESS_MASK = 0x1fff; // either 0x1fff or 0xffff (not needed then) -public: - // breakpoint flags - static const uInt32 ONE_SHOT = 1 << 0; // used for 'trace' command + public: + // breakpoint flags + static const uInt32 ONE_SHOT = 1 << 0; // used for 'trace' command - static const uInt8 ANY_BANK = 255; // breakpoint valid in any bank + static const uInt8 ANY_BANK = 255; // breakpoint valid in any bank - struct Breakpoint - { - uInt16 addr; - uInt8 bank; - - Breakpoint() - : addr(0), bank(0) { } - Breakpoint(const Breakpoint& bp) - : addr(bp.addr), bank(bp.bank) { } - explicit Breakpoint(uInt16 c_addr, uInt8 c_bank) - : addr(c_addr), bank(c_bank) { } - - bool operator==(const Breakpoint& other) const + struct Breakpoint { - if(addr == other.addr) + uInt16 addr; + uInt8 bank; + + Breakpoint() : addr(0), bank(0) { } + explicit Breakpoint(uInt16 c_addr, uInt8 c_bank) : addr(c_addr), bank(c_bank) { } + Breakpoint(const Breakpoint&) = default; + Breakpoint& operator=(const Breakpoint&) = default; + Breakpoint(Breakpoint&&) = default; + Breakpoint& operator=(Breakpoint&&) = default; + + bool operator==(const Breakpoint& other) const { - if(bank == ANY_BANK || other.bank == ANY_BANK) - return true; - else - return bank == other.bank; + if(addr == other.addr) + { + if(bank == ANY_BANK || other.bank == ANY_BANK) + return true; + else + return bank == other.bank; + } + return false; } - return false; - } - bool operator<(const Breakpoint& other) const - { - return bank < other.bank || - (bank == other.bank && addr < other.addr); - } - }; - using BreakpointList = std::vector; + bool operator<(const Breakpoint& other) const + { + return bank < other.bank || (bank == other.bank && addr < other.addr); + } + }; + using BreakpointList = std::vector; - BreakpointMap(); - virtual ~BreakpointMap() = default; + BreakpointMap() : myInitialized(false) { } - bool isInitialized() const { return myInitialized; } + bool isInitialized() const { return myInitialized; } - /** Add new breakpoint */ - void add(const Breakpoint& breakpoint, const uInt32 flags = 0); - void add(const uInt16 addr, const uInt8 bank, const uInt32 flags = 0); + /** Add new breakpoint */ + void add(const Breakpoint& breakpoint, const uInt32 flags = 0); + void add(const uInt16 addr, const uInt8 bank, const uInt32 flags = 0); - /** Erase breakpoint */ - void erase(const Breakpoint& breakpoint); - void erase(const uInt16 addr, const uInt8 bank); + /** Erase breakpoint */ + void erase(const Breakpoint& breakpoint); + void erase(const uInt16 addr, const uInt8 bank); - /** Get info for breakpoint */ - uInt32 get(const Breakpoint& breakpoint) const; - uInt32 get(uInt16 addr, uInt8 bank) const; + /** Get info for breakpoint */ + uInt32 get(const Breakpoint& breakpoint) const; + uInt32 get(uInt16 addr, uInt8 bank) const; - /** Check if a breakpoint exists */ - bool check(const Breakpoint& breakpoint) const; - bool check(const uInt16 addr, const uInt8 bank) const; + /** Check if a breakpoint exists */ + bool check(const Breakpoint& breakpoint) const; + bool check(const uInt16 addr, const uInt8 bank) const; - /** Returns a sorted list of breakpoints */ - BreakpointList getBreakpoints() const; + /** Returns a sorted list of breakpoints */ + BreakpointList getBreakpoints() const; - /** clear all breakpoints */ - void clear() { myMap.clear(); } - size_t size() { return myMap.size(); } + /** clear all breakpoints */ + void clear() { myMap.clear(); } + size_t size() const { return myMap.size(); } -private: - Breakpoint convertBreakpoint(const Breakpoint& breakpoint); + private: + Breakpoint convertBreakpoint(const Breakpoint& breakpoint); - struct BreakpointHash { - size_t operator()(const Breakpoint& bp) const { - return std::hash()( - uInt64(bp.addr) * 13 // only check for address, bank check via == operator - ); - } - }; + struct BreakpointHash { + size_t operator()(const Breakpoint& bp) const { + return std::hash()( + uInt64(bp.addr) * 13 // only check for address, bank check via == operator + ); + } + }; - std::unordered_map myMap; - bool myInitialized; + std::unordered_map myMap; + bool myInitialized; + + // Following constructors and assignment operators not supported + BreakpointMap(const BreakpointMap&) = delete; + BreakpointMap(BreakpointMap&&) = delete; + BreakpointMap& operator=(const BreakpointMap&) = delete; + BreakpointMap& operator=(BreakpointMap&&) = delete; }; #endif diff --git a/src/emucore/M6502.hxx b/src/emucore/M6502.hxx index 108d6e23c..10df4a13a 100644 --- a/src/emucore/M6502.hxx +++ b/src/emucore/M6502.hxx @@ -436,6 +436,8 @@ class M6502 : public Serializable struct HitTrapInfo { string message; int address; + + HitTrapInfo() : message(""), address(0) { } }; HitTrapInfo myHitTrapInfo; diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index fccefc6e7..9e35a2663 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -580,19 +580,15 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font) ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10; new StaticTextWidget(myTab, infofont, HBORDER, ypos, "(*) Changes require a ROM reload"); +#if defined(DEBUGGER_SUPPORT) && defined(WINDOWED_SUPPORT) // Debugger is only realistically available in windowed modes 800x600 or greater // (and when it's actually been compiled into the app) - bool debuggerAvailable = -#if defined(DEBUGGER_SUPPORT) && defined(WINDOWED_SUPPORT) - (ds.w >= 800 && ds.h >= 600); // TODO - maybe this logic can disappear? -#else - false; -#endif - if(!debuggerAvailable) + if(ds.w < 800 || ds.h < 600); // TODO - maybe this logic can disappear? { myDebuggerWidthSlider->clearFlags(Widget::FLAG_ENABLED); myDebuggerHeightSlider->clearFlags(Widget::FLAG_ENABLED); } +#endif #else new StaticTextWidget(myTab, font, 0, 20, _w - 20, font.getFontHeight(), "Debugger support not included", TextAlign::Center); diff --git a/src/libretro/FSNodeLIBRETRO.cxx b/src/libretro/FSNodeLIBRETRO.cxx index c504e424a..594226c15 100644 --- a/src/libretro/FSNodeLIBRETRO.cxx +++ b/src/libretro/FSNodeLIBRETRO.cxx @@ -26,11 +26,12 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodeLIBRETRO::FilesystemNodeLIBRETRO() : _name("rom"), + _path("." + slash), _isDirectory(false), _isFile(true), + _isPseudoRoot(false), _isValid(true) { - _path = "." + slash; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -39,6 +40,7 @@ FilesystemNodeLIBRETRO::FilesystemNodeLIBRETRO(const string& p) _path(p), _isDirectory(false), _isFile(true), + _isPseudoRoot(false), _isValid(true) { // TODO: use retro_vfs_mkdir_t (file) or RETRO_MEMORY_SAVE_RAM (stream) or libretro save path diff --git a/src/libretro/StellaLIBRETRO.cxx b/src/libretro/StellaLIBRETRO.cxx index 65f5f362f..81ad1e044 100644 --- a/src/libretro/StellaLIBRETRO.cxx +++ b/src/libretro/StellaLIBRETRO.cxx @@ -49,6 +49,7 @@ StellaLIBRETRO::StellaLIBRETRO() video_phosphor = "byrom"; video_phosphor_blend = 60; + phosphor_default = false; rom_image = make_unique(getROMMax());