mirror of https://github.com/stella-emu/stella.git
More default initialization updates.
This commit is contained in:
parent
b2c70d7677
commit
0c6f8bf381
|
@ -32,10 +32,10 @@ class BankRomCheat : public Cheat
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<uInt8, 16> savedRom;
|
std::array<uInt8, 16> savedRom;
|
||||||
uInt16 address;
|
uInt16 address{0};
|
||||||
uInt8 value;
|
uInt8 value{0};
|
||||||
uInt8 count;
|
uInt8 count{0};
|
||||||
int bank;
|
int bank{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -28,8 +28,7 @@ class Cheat
|
||||||
Cheat(OSystem& osystem, const string& name, const string& code)
|
Cheat(OSystem& osystem, const string& name, const string& code)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myName(name == "" ? code : name),
|
myName(name == "" ? code : name),
|
||||||
myCode(code),
|
myCode(code)
|
||||||
myEnabled(false)
|
|
||||||
{ }
|
{ }
|
||||||
virtual ~Cheat() = default;
|
virtual ~Cheat() = default;
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ class Cheat
|
||||||
string myName;
|
string myName;
|
||||||
string myCode;
|
string myCode;
|
||||||
|
|
||||||
bool myEnabled;
|
bool myEnabled{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -50,11 +50,11 @@ class CheatCodeDialog : public Dialog
|
||||||
void addOneShotCheat();
|
void addOneShotCheat();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CheckListWidget* myCheatList;
|
CheckListWidget* myCheatList{nullptr};
|
||||||
unique_ptr<InputTextDialog> myCheatInput;
|
unique_ptr<InputTextDialog> myCheatInput;
|
||||||
|
|
||||||
ButtonWidget* myEditButton;
|
ButtonWidget* myEditButton{nullptr};
|
||||||
ButtonWidget* myRemoveButton;
|
ButtonWidget* myRemoveButton{nullptr};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kAddCheatCmd = 'CHTa',
|
kAddCheatCmd = 'CHTa',
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CheatManager::CheatManager(OSystem& osystem)
|
CheatManager::CheatManager(OSystem& osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem)
|
||||||
myListIsDirty(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ class CheatManager
|
||||||
string myCurrentCheat;
|
string myCurrentCheat;
|
||||||
|
|
||||||
// Indicates that the list has been modified, and should be saved to disk
|
// Indicates that the list has been modified, and should be saved to disk
|
||||||
bool myListIsDirty;
|
bool myListIsDirty{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -32,9 +32,9 @@ class CheetahCheat : public Cheat
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<uInt8, 16> savedRom;
|
std::array<uInt8, 16> savedRom;
|
||||||
uInt16 address;
|
uInt16 address{0};
|
||||||
uInt8 value;
|
uInt8 value{0};
|
||||||
uInt8 count;
|
uInt8 count{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -31,8 +31,8 @@ class RamCheat : public Cheat
|
||||||
void evaluate() override;
|
void evaluate() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uInt16 address;
|
uInt16 address{0};
|
||||||
uInt8 value;
|
uInt8 value{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -25,11 +25,7 @@ AudioQueue::AudioQueue(uInt32 fragmentSize, uInt32 capacity, bool isStereo)
|
||||||
: myFragmentSize(fragmentSize),
|
: myFragmentSize(fragmentSize),
|
||||||
myIsStereo(isStereo),
|
myIsStereo(isStereo),
|
||||||
myFragmentQueue(capacity),
|
myFragmentQueue(capacity),
|
||||||
myAllFragments(capacity + 2),
|
myAllFragments(capacity + 2)
|
||||||
mySize(0),
|
|
||||||
myNextFragment(0),
|
|
||||||
myIgnoreOverflows(true),
|
|
||||||
myOverflowLogger("audio buffer overflow", Logger::Level::INFO)
|
|
||||||
{
|
{
|
||||||
const uInt8 sampleSize = myIsStereo ? 2 : 1;
|
const uInt8 sampleSize = myIsStereo ? 2 : 1;
|
||||||
|
|
||||||
|
|
|
@ -99,10 +99,10 @@ class AudioQueue
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// The size of an individual fragment (in stereo / mono samples)
|
// The size of an individual fragment (in stereo / mono samples)
|
||||||
uInt32 myFragmentSize;
|
uInt32 myFragmentSize{0};
|
||||||
|
|
||||||
// Are we using stereo samples?
|
// Are we using stereo samples?
|
||||||
bool myIsStereo;
|
bool myIsStereo{false};
|
||||||
|
|
||||||
// The fragment queue
|
// The fragment queue
|
||||||
vector<Int16*> myFragmentQueue;
|
vector<Int16*> myFragmentQueue;
|
||||||
|
@ -114,23 +114,23 @@ class AudioQueue
|
||||||
unique_ptr<Int16[]> myFragmentBuffer;
|
unique_ptr<Int16[]> myFragmentBuffer;
|
||||||
|
|
||||||
// The nubmer if queued fragments
|
// The nubmer if queued fragments
|
||||||
uInt32 mySize;
|
uInt32 mySize{0};
|
||||||
|
|
||||||
// The next fragment.
|
// The next fragment.
|
||||||
uInt32 myNextFragment;
|
uInt32 myNextFragment{0};
|
||||||
|
|
||||||
// We need a mutex for thread safety.
|
// We need a mutex for thread safety.
|
||||||
std::mutex myMutex;
|
std::mutex myMutex;
|
||||||
|
|
||||||
// The first (empty) enqueue call returns this fragment.
|
// The first (empty) enqueue call returns this fragment.
|
||||||
Int16* myFirstFragmentForEnqueue;
|
Int16* myFirstFragmentForEnqueue{nullptr};
|
||||||
// The first (empty) dequeue call replaces the returned fragment with this fragment.
|
// The first (empty) dequeue call replaces the returned fragment with this fragment.
|
||||||
Int16* myFirstFragmentForDequeue;
|
Int16* myFirstFragmentForDequeue{nullptr};
|
||||||
|
|
||||||
// Log overflows?
|
// Log overflows?
|
||||||
bool myIgnoreOverflows;
|
bool myIgnoreOverflows{true};
|
||||||
|
|
||||||
StaggeredLogger myOverflowLogger;
|
StaggeredLogger myOverflowLogger{"audio buffer overflow", Logger::Level::INFO};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -46,14 +46,7 @@ FBSurfaceSDL2::FBSurfaceSDL2(FrameBufferSDL2& buffer,
|
||||||
FrameBuffer::ScalingInterpolation interpolation,
|
FrameBuffer::ScalingInterpolation interpolation,
|
||||||
const uInt32* staticData)
|
const uInt32* staticData)
|
||||||
: myFB(buffer),
|
: myFB(buffer),
|
||||||
myInterpolationMode(interpolation),
|
myInterpolationMode(interpolation)
|
||||||
mySurface(nullptr),
|
|
||||||
mySrcR({0, 0, 0, 0}),
|
|
||||||
myDstR({0, 0, 0, 0}),
|
|
||||||
myIsVisible(true),
|
|
||||||
myIsStatic(false),
|
|
||||||
mySrcGUIR({0, 0, 0, 0}),
|
|
||||||
myDstGUIR({0, 0, 0, 0})
|
|
||||||
{
|
{
|
||||||
createSurface(width, height, staticData);
|
createSurface(width, height, staticData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,13 +98,14 @@ class FBSurfaceSDL2 : public FBSurface
|
||||||
FrameBufferSDL2& myFB;
|
FrameBufferSDL2& myFB;
|
||||||
|
|
||||||
unique_ptr<Blitter> myBlitter;
|
unique_ptr<Blitter> myBlitter;
|
||||||
FrameBuffer::ScalingInterpolation myInterpolationMode;
|
FrameBuffer::ScalingInterpolation myInterpolationMode
|
||||||
|
{FrameBuffer::ScalingInterpolation::none};
|
||||||
|
|
||||||
SDL_Surface* mySurface;
|
SDL_Surface* mySurface{nullptr};
|
||||||
SDL_Rect mySrcR, myDstR;
|
SDL_Rect mySrcR{0, 0, 0, 0}, myDstR{0, 0, 0, 0};
|
||||||
|
|
||||||
bool myIsVisible;
|
bool myIsVisible{true};
|
||||||
bool myIsStatic;
|
bool myIsStatic{false};
|
||||||
|
|
||||||
Common::Rect mySrcGUIR, myDstGUIR;
|
Common::Rect mySrcGUIR, myDstGUIR;
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,11 +35,6 @@
|
||||||
class FilesystemNodeZIP : public AbstractFSNode
|
class FilesystemNodeZIP : public AbstractFSNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* Creates a FilesystemNodeZIP with the root node as path.
|
|
||||||
*/
|
|
||||||
// FilesystemNodeZIP();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a FilesystemNodeZIP for a given path.
|
* Creates a FilesystemNodeZIP for a given path.
|
||||||
*
|
*
|
||||||
|
|
|
@ -37,7 +37,7 @@ class FpsMeter
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct entry {
|
struct entry {
|
||||||
uInt32 frames;
|
uInt32 frames{0};
|
||||||
std::chrono::time_point<std::chrono::high_resolution_clock> timestamp;
|
std::chrono::time_point<std::chrono::high_resolution_clock> timestamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,14 +45,14 @@ class FpsMeter
|
||||||
|
|
||||||
vector<entry> myQueue;
|
vector<entry> myQueue;
|
||||||
|
|
||||||
uInt32 myQueueOffset;
|
uInt32 myQueueOffset{0};
|
||||||
|
|
||||||
uInt32 myFrameCount;
|
uInt32 myFrameCount{0};
|
||||||
|
|
||||||
uInt32 myGarbageFrameCounter;
|
uInt32 myGarbageFrameCounter{0};
|
||||||
uInt32 myGarbageFrameLimit;
|
uInt32 myGarbageFrameLimit{0};
|
||||||
|
|
||||||
float myFps;
|
float myFps{0.F};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FpsMeter(const FpsMeter&) = delete;
|
FpsMeter(const FpsMeter&) = delete;
|
||||||
|
|
|
@ -29,15 +29,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FrameBufferSDL2::FrameBufferSDL2(OSystem& osystem)
|
FrameBufferSDL2::FrameBufferSDL2(OSystem& osystem)
|
||||||
: FrameBuffer(osystem),
|
: FrameBuffer(osystem)
|
||||||
myWindow(nullptr),
|
|
||||||
myRenderer(nullptr),
|
|
||||||
myCenter(false),
|
|
||||||
myRenderTargetSupport(false),
|
|
||||||
myWindowW(0),
|
|
||||||
myWindowH(0),
|
|
||||||
myRenderW(0),
|
|
||||||
myRenderH(0)
|
|
||||||
{
|
{
|
||||||
ASSERT_MAIN_THREAD;
|
ASSERT_MAIN_THREAD;
|
||||||
|
|
||||||
|
|
|
@ -225,23 +225,23 @@ class FrameBufferSDL2 : public FrameBuffer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The SDL video buffer
|
// The SDL video buffer
|
||||||
SDL_Window* myWindow;
|
SDL_Window* myWindow{nullptr};
|
||||||
SDL_Renderer* myRenderer;
|
SDL_Renderer* myRenderer{nullptr};
|
||||||
|
|
||||||
// Used by mapRGB (when palettes are created)
|
// Used by mapRGB (when palettes are created)
|
||||||
SDL_PixelFormat* myPixelFormat;
|
SDL_PixelFormat* myPixelFormat{nullptr};
|
||||||
|
|
||||||
// Center setting of current window
|
// Center setting of current window
|
||||||
bool myCenter;
|
bool myCenter{false};
|
||||||
|
|
||||||
// last position of windowed window
|
// last position of windowed window
|
||||||
Common::Point myWindowedPos;
|
Common::Point myWindowedPos;
|
||||||
|
|
||||||
// Does the renderer support render targets?
|
// Does the renderer support render targets?
|
||||||
bool myRenderTargetSupport;
|
bool myRenderTargetSupport{false};
|
||||||
|
|
||||||
// Window and renderer dimensions
|
// Window and renderer dimensions
|
||||||
int myWindowW, myWindowH, myRenderW, myRenderH;
|
int myWindowW{0}, myWindowH{0}, myRenderW{0}, myRenderH{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -52,11 +52,11 @@ class Logger {
|
||||||
const string& logMessages() const { return myLogMessages; }
|
const string& logMessages() const { return myLogMessages; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Logger() { setLogParameters(Level::MAX, true); }
|
Logger() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int myLogLevel;
|
int myLogLevel{static_cast<int>(Level::MAX)};
|
||||||
bool myLogToConsole;
|
bool myLogToConsole{true};
|
||||||
|
|
||||||
// The list of log messages
|
// The list of log messages
|
||||||
string myLogMessages;
|
string myLogMessages;
|
||||||
|
|
|
@ -33,16 +33,15 @@ static constexpr char CTRL_DELIM = '^';
|
||||||
PhysicalJoystickHandler::PhysicalJoystickHandler(
|
PhysicalJoystickHandler::PhysicalJoystickHandler(
|
||||||
OSystem& system, EventHandler& handler)
|
OSystem& system, EventHandler& handler)
|
||||||
: myOSystem(system),
|
: myOSystem(system),
|
||||||
myHandler(handler),
|
myHandler(handler)
|
||||||
myLeftMode(EventMode::kEmulationMode),
|
|
||||||
myRightMode(EventMode::kEmulationMode)
|
|
||||||
{
|
{
|
||||||
Int32 version = myOSystem.settings().getInt("event_ver");
|
Int32 version = myOSystem.settings().getInt("event_ver");
|
||||||
// Load previously saved joystick mapping (if any) from settings
|
// Load previously saved joystick mapping (if any) from settings
|
||||||
istringstream buf(myOSystem.settings().getString("joymap"));
|
istringstream buf(myOSystem.settings().getString("joymap"));
|
||||||
string joymap, joyname;
|
string joymap, joyname;
|
||||||
|
|
||||||
// First compare if event list version has changed, and disregard the entire mapping if true
|
// First compare if event list version has changed, and disregard the entire
|
||||||
|
// mapping if true
|
||||||
getline(buf, joymap, CTRL_DELIM); // event list size, ignore
|
getline(buf, joymap, CTRL_DELIM); // event list size, ignore
|
||||||
if(version == Event::VERSION)
|
if(version == Event::VERSION)
|
||||||
{
|
{
|
||||||
|
|
|
@ -138,18 +138,19 @@ class PhysicalJoystickHandler
|
||||||
|
|
||||||
// Structures used for action menu items
|
// Structures used for action menu items
|
||||||
struct EventMapping {
|
struct EventMapping {
|
||||||
Event::Type event;
|
Event::Type event{Event::NoType};
|
||||||
int button;
|
int button{0};
|
||||||
JoyAxis axis = JoyAxis::NONE;
|
JoyAxis axis{JoyAxis::NONE};
|
||||||
JoyDir adir = JoyDir::NONE;
|
JoyDir adir{JoyDir::NONE};
|
||||||
int hat = JOY_CTRL_NONE;
|
int hat{JOY_CTRL_NONE};
|
||||||
JoyHatDir hdir = JoyHatDir::CENTER;
|
JoyHatDir hdir{JoyHatDir::CENTER};
|
||||||
};
|
};
|
||||||
using EventMappingArray = std::vector<EventMapping>;
|
using EventMappingArray = std::vector<EventMapping>;
|
||||||
|
|
||||||
void setDefaultAction(const PhysicalJoystickPtr& j,
|
void setDefaultAction(const PhysicalJoystickPtr& j,
|
||||||
EventMapping map, Event::Type event = Event::NoType,
|
EventMapping map, Event::Type event = Event::NoType,
|
||||||
EventMode mode = EventMode::kEmulationMode, bool updateDefaults = false);
|
EventMode mode = EventMode::kEmulationMode,
|
||||||
|
bool updateDefaults = false);
|
||||||
|
|
||||||
/** returns the event's controller mode */
|
/** returns the event's controller mode */
|
||||||
EventMode getEventMode(const Event::Type event, const EventMode mode) const;
|
EventMode getEventMode(const Event::Type event, const EventMode mode) const;
|
||||||
|
@ -165,8 +166,8 @@ class PhysicalJoystickHandler
|
||||||
void enableMapping(const Event::Type event, EventMode mode);
|
void enableMapping(const Event::Type event, EventMode mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EventMode myLeftMode;
|
EventMode myLeftMode{EventMode::kEmulationMode};
|
||||||
EventMode myRightMode;
|
EventMode myRightMode{EventMode::kEmulationMode};
|
||||||
|
|
||||||
// Controller menu and common emulation mappings
|
// Controller menu and common emulation mappings
|
||||||
static EventMappingArray DefaultMenuMapping;
|
static EventMappingArray DefaultMenuMapping;
|
||||||
|
|
|
@ -42,12 +42,7 @@ static constexpr int MOD3 = KBDM_ALT;
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler& handler)
|
PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler& handler)
|
||||||
: myOSystem(system),
|
: myOSystem(system),
|
||||||
myHandler(handler),
|
myHandler(handler)
|
||||||
myLeftMode(EventMode::kEmulationMode),
|
|
||||||
myRightMode(EventMode::kEmulationMode)
|
|
||||||
#ifdef BSPF_UNIX
|
|
||||||
, myAltKeyCounter(0)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
Int32 version = myOSystem.settings().getInt("event_ver");
|
Int32 version = myOSystem.settings().getInt("event_ver");
|
||||||
|
|
||||||
|
|
|
@ -81,9 +81,9 @@ class PhysicalKeyboardHandler
|
||||||
|
|
||||||
// Structure used for action menu items
|
// Structure used for action menu items
|
||||||
struct EventMapping {
|
struct EventMapping {
|
||||||
Event::Type event;
|
Event::Type event{Event::NoType};
|
||||||
StellaKey key;
|
StellaKey key{StellaKey(0)};
|
||||||
int mod = KBDM_NONE;
|
int mod{KBDM_NONE};
|
||||||
};
|
};
|
||||||
using EventMappingArray = std::vector<EventMapping>;
|
using EventMappingArray = std::vector<EventMapping>;
|
||||||
|
|
||||||
|
@ -109,8 +109,8 @@ class PhysicalKeyboardHandler
|
||||||
// Hashmap of key events
|
// Hashmap of key events
|
||||||
KeyMap myKeyMap;
|
KeyMap myKeyMap;
|
||||||
|
|
||||||
EventMode myLeftMode;
|
EventMode myLeftMode{EventMode::kEmulationMode};
|
||||||
EventMode myRightMode;
|
EventMode myRightMode{EventMode::kEmulationMode};
|
||||||
|
|
||||||
#ifdef BSPF_UNIX
|
#ifdef BSPF_UNIX
|
||||||
// Sometimes key combos with the Alt key become 'stuck' after the
|
// Sometimes key combos with the Alt key become 'stuck' after the
|
||||||
|
@ -124,7 +124,7 @@ class PhysicalKeyboardHandler
|
||||||
// the count is updated to 2, but only if it was already updated to 1
|
// the count is updated to 2, but only if it was already updated to 1
|
||||||
// TODO - This may be a bug in SDL, and might be removed in the future
|
// TODO - This may be a bug in SDL, and might be removed in the future
|
||||||
// It only seems to be an issue in Linux
|
// It only seems to be an issue in Linux
|
||||||
uInt8 myAltKeyCounter;
|
uInt8 myAltKeyCounter{0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Controller menu and common emulation mappings
|
// Controller menu and common emulation mappings
|
||||||
|
|
|
@ -192,6 +192,7 @@ class PNGLibrary
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
PNGLibrary() = delete;
|
||||||
PNGLibrary(const PNGLibrary&) = delete;
|
PNGLibrary(const PNGLibrary&) = delete;
|
||||||
PNGLibrary(PNGLibrary&&) = delete;
|
PNGLibrary(PNGLibrary&&) = delete;
|
||||||
PNGLibrary& operator=(const PNGLibrary&) = delete;
|
PNGLibrary& operator=(const PNGLibrary&) = delete;
|
||||||
|
|
|
@ -109,8 +109,8 @@ struct Rect
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Rect() = default;
|
Rect() = default;
|
||||||
explicit Rect(const Size& s) : top(0), left(0), bottom(s.h), right(s.w) { assert(valid()); }
|
explicit Rect(const Size& s) : bottom(s.h), right(s.w) { assert(valid()); }
|
||||||
Rect(uInt32 w, uInt32 h) : top(0), left(0), bottom(h), right(w) { assert(valid()); }
|
Rect(uInt32 w, uInt32 h) : bottom(h), right(w) { assert(valid()); }
|
||||||
Rect(const Point& p, uInt32 w, uInt32 h) : top(p.y), left(p.x), bottom(h), right(w) { assert(valid()); }
|
Rect(const Point& p, uInt32 w, uInt32 h) : top(p.y), left(p.x), bottom(h), right(w) { assert(valid()); }
|
||||||
Rect(uInt32 x1, uInt32 y1, uInt32 x2, uInt32 y2) : top(y1), left(x1), bottom(y2), right(x2) { assert(valid()); }
|
Rect(uInt32 x1, uInt32 y1, uInt32 x2, uInt32 y2) : top(y1), left(x1), bottom(y2), right(x2) { assert(valid()); }
|
||||||
|
|
||||||
|
|
|
@ -41,13 +41,6 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings)
|
SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings)
|
||||||
: Sound(osystem),
|
: Sound(osystem),
|
||||||
myIsInitializedFlag(false),
|
|
||||||
myVolume(100),
|
|
||||||
myVolumeFactor(0xffff),
|
|
||||||
myDevice(0),
|
|
||||||
myEmulationTiming(nullptr),
|
|
||||||
myCurrentFragment(nullptr),
|
|
||||||
myUnderrun(false),
|
|
||||||
myAudioSettings(audioSettings)
|
myAudioSettings(audioSettings)
|
||||||
{
|
{
|
||||||
ASSERT_MAIN_THREAD;
|
ASSERT_MAIN_THREAD;
|
||||||
|
|
|
@ -131,23 +131,23 @@ class SoundSDL2 : public Sound
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Indicates if the sound device was successfully initialized
|
// Indicates if the sound device was successfully initialized
|
||||||
bool myIsInitializedFlag;
|
bool myIsInitializedFlag{false};
|
||||||
|
|
||||||
// Current volume as a percentage (0 - 100)
|
// Current volume as a percentage (0 - 100)
|
||||||
uInt32 myVolume;
|
uInt32 myVolume{100};
|
||||||
float myVolumeFactor;
|
float myVolumeFactor{0xffff};
|
||||||
|
|
||||||
// Audio specification structure
|
// Audio specification structure
|
||||||
SDL_AudioSpec myHardwareSpec;
|
SDL_AudioSpec myHardwareSpec;
|
||||||
|
|
||||||
SDL_AudioDeviceID myDevice;
|
SDL_AudioDeviceID myDevice{0};
|
||||||
|
|
||||||
shared_ptr<AudioQueue> myAudioQueue;
|
shared_ptr<AudioQueue> myAudioQueue;
|
||||||
|
|
||||||
EmulationTiming* myEmulationTiming;
|
EmulationTiming* myEmulationTiming{nullptr};
|
||||||
|
|
||||||
Int16* myCurrentFragment;
|
Int16* myCurrentFragment{nullptr};
|
||||||
bool myUnderrun;
|
bool myUnderrun{false};
|
||||||
|
|
||||||
unique_ptr<Resampler> myResampler;
|
unique_ptr<Resampler> myResampler;
|
||||||
|
|
||||||
|
|
|
@ -38,16 +38,7 @@ namespace {
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
StaggeredLogger::StaggeredLogger(const string& message, Logger::Level level)
|
StaggeredLogger::StaggeredLogger(const string& message, Logger::Level level)
|
||||||
: myMessage(message),
|
: myMessage(message),
|
||||||
myLevel(level),
|
myLevel(level)
|
||||||
myCurrentEventCount(0),
|
|
||||||
myIsCurrentlyCollecting(false),
|
|
||||||
myCurrentIntervalSize(100),
|
|
||||||
myMaxIntervalFactor(9),
|
|
||||||
myCurrentIntervalFactor(1),
|
|
||||||
myCooldownTime(1000),
|
|
||||||
myTimer(make_unique<TimerManager>()),
|
|
||||||
myTimerId(0),
|
|
||||||
myTimerCallbackId(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,29 +60,29 @@ class StaggeredLogger
|
||||||
string myMessage;
|
string myMessage;
|
||||||
Logger::Level myLevel;
|
Logger::Level myLevel;
|
||||||
|
|
||||||
uInt32 myCurrentEventCount;
|
uInt32 myCurrentEventCount{0};
|
||||||
bool myIsCurrentlyCollecting;
|
bool myIsCurrentlyCollecting{false};
|
||||||
|
|
||||||
std::chrono::high_resolution_clock::time_point myLastIntervalStartTimestamp;
|
std::chrono::high_resolution_clock::time_point myLastIntervalStartTimestamp;
|
||||||
std::chrono::high_resolution_clock::time_point myLastIntervalEndTimestamp;
|
std::chrono::high_resolution_clock::time_point myLastIntervalEndTimestamp;
|
||||||
|
|
||||||
uInt32 myCurrentIntervalSize;
|
uInt32 myCurrentIntervalSize{100};
|
||||||
uInt32 myMaxIntervalFactor;
|
uInt32 myMaxIntervalFactor{9};
|
||||||
uInt32 myCurrentIntervalFactor;
|
uInt32 myCurrentIntervalFactor{1};
|
||||||
uInt32 myCooldownTime;
|
uInt32 myCooldownTime{1000};
|
||||||
|
|
||||||
std::mutex myMutex;
|
std::mutex myMutex;
|
||||||
|
|
||||||
// We need control over the destruction porcess and over the exact point where
|
// We need control over the destruction porcess and over the exact point where
|
||||||
// the worker thread joins -> allocate on the heap end delete explicitly in
|
// the worker thread joins -> allocate on the heap end delete explicitly in
|
||||||
// our destructor.
|
// our destructor.
|
||||||
unique_ptr<TimerManager> myTimer;
|
unique_ptr<TimerManager> myTimer{make_unique<TimerManager>()};
|
||||||
TimerManager::TimerId myTimerId;
|
TimerManager::TimerId myTimerId{0};
|
||||||
|
|
||||||
// It is possible that the timer callback is running even after TimerManager::clear
|
// It is possible that the timer callback is running even after TimerManager::clear
|
||||||
// returns. This id is unique per timer and is used to return from the callback
|
// returns. This id is unique per timer and is used to return from the callback
|
||||||
// early in case the time is stale.
|
// early in case the time is stale.
|
||||||
uInt32 myTimerCallbackId;
|
uInt32 myTimerCallbackId{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STAGGERED_LOGGER
|
#endif // STAGGERED_LOGGER
|
||||||
|
|
|
@ -31,9 +31,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
StateManager::StateManager(OSystem& osystem)
|
StateManager::StateManager(OSystem& osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem)
|
||||||
myCurrentSlot(0),
|
|
||||||
myActiveMode(Mode::Off)
|
|
||||||
{
|
{
|
||||||
myRewindManager = make_unique<RewindManager>(myOSystem, *this);
|
myRewindManager = make_unique<RewindManager>(myOSystem, *this);
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -163,10 +163,10 @@ class StateManager
|
||||||
OSystem& myOSystem;
|
OSystem& myOSystem;
|
||||||
|
|
||||||
// The current slot for load/save states
|
// The current slot for load/save states
|
||||||
int myCurrentSlot;
|
int myCurrentSlot{0};
|
||||||
|
|
||||||
// Whether the manager is in record or playback mode
|
// Whether the manager is in record or playback mode
|
||||||
Mode myActiveMode;
|
Mode myActiveMode{Mode::Off};
|
||||||
|
|
||||||
// MD5 of the currently active ROM (either in movie or rewind mode)
|
// MD5 of the currently active ROM (either in movie or rewind mode)
|
||||||
string myMD5;
|
string myMD5;
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ConvolutionBuffer::ConvolutionBuffer(uInt32 size)
|
ConvolutionBuffer::ConvolutionBuffer(uInt32 size)
|
||||||
: myFirstIndex(0),
|
: mySize(size)
|
||||||
mySize(size)
|
|
||||||
{
|
{
|
||||||
myData = make_unique<float[]>(mySize);
|
myData = make_unique<float[]>(mySize);
|
||||||
std::fill_n(myData.get(), mySize, 0.F);
|
std::fill_n(myData.get(), mySize, 0.F);
|
||||||
|
|
|
@ -34,9 +34,9 @@ class ConvolutionBuffer
|
||||||
|
|
||||||
unique_ptr<float[]> myData;
|
unique_ptr<float[]> myData;
|
||||||
|
|
||||||
uInt32 myFirstIndex;
|
uInt32 myFirstIndex{0};
|
||||||
|
|
||||||
uInt32 mySize;
|
uInt32 mySize{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
HighPass::HighPass(float cutOffFrequency, float frequency)
|
HighPass::HighPass(float cutOffFrequency, float frequency)
|
||||||
: myLastValueIn(0),
|
: myAlpha(1.F / (1.F + 2.F*BSPF::PI_f*cutOffFrequency/frequency))
|
||||||
myLastValueOut(0),
|
|
||||||
myAlpha(1.F / (1.F + 2.F*BSPF::PI_f*cutOffFrequency/frequency))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,11 @@ class HighPass
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
float myLastValueIn;
|
float myLastValueIn{0.F};
|
||||||
|
|
||||||
float myLastValueOut;
|
float myLastValueOut{0.F};
|
||||||
|
|
||||||
float myAlpha;
|
float myAlpha{0.F};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -71,15 +71,10 @@ LanczosResampler::LanczosResampler(
|
||||||
// -> we find N from fully reducing the fraction.
|
// -> we find N from fully reducing the fraction.
|
||||||
myPrecomputedKernelCount(reducedDenominator(formatFrom.sampleRate, formatTo.sampleRate)),
|
myPrecomputedKernelCount(reducedDenominator(formatFrom.sampleRate, formatTo.sampleRate)),
|
||||||
myKernelSize(2 * kernelParameter),
|
myKernelSize(2 * kernelParameter),
|
||||||
myCurrentKernelIndex(0),
|
|
||||||
myKernelParameter(kernelParameter),
|
myKernelParameter(kernelParameter),
|
||||||
myCurrentFragment(nullptr),
|
|
||||||
myFragmentIndex(0),
|
|
||||||
myIsUnderrun(true),
|
|
||||||
myHighPassL(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
myHighPassL(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
||||||
myHighPassR(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
myHighPassR(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
||||||
myHighPass(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
myHighPass(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate))
|
||||||
myTimeIndex(0)
|
|
||||||
{
|
{
|
||||||
myPrecomputedKernels = make_unique<float[]>(myPrecomputedKernelCount * myKernelSize);
|
myPrecomputedKernels = make_unique<float[]>(myPrecomputedKernelCount * myKernelSize);
|
||||||
|
|
||||||
|
|
|
@ -43,26 +43,26 @@ class LanczosResampler : public Resampler
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
uInt32 myPrecomputedKernelCount;
|
uInt32 myPrecomputedKernelCount{0};
|
||||||
uInt32 myKernelSize;
|
uInt32 myKernelSize{0};
|
||||||
uInt32 myCurrentKernelIndex;
|
uInt32 myCurrentKernelIndex{0};
|
||||||
unique_ptr<float[]> myPrecomputedKernels;
|
unique_ptr<float[]> myPrecomputedKernels;
|
||||||
|
|
||||||
uInt32 myKernelParameter;
|
uInt32 myKernelParameter{0};
|
||||||
|
|
||||||
unique_ptr<ConvolutionBuffer> myBuffer;
|
unique_ptr<ConvolutionBuffer> myBuffer;
|
||||||
unique_ptr<ConvolutionBuffer> myBufferL;
|
unique_ptr<ConvolutionBuffer> myBufferL;
|
||||||
unique_ptr<ConvolutionBuffer> myBufferR;
|
unique_ptr<ConvolutionBuffer> myBufferR;
|
||||||
|
|
||||||
Int16* myCurrentFragment;
|
Int16* myCurrentFragment{nullptr};
|
||||||
uInt32 myFragmentIndex;
|
uInt32 myFragmentIndex{0};
|
||||||
bool myIsUnderrun;
|
bool myIsUnderrun{true};
|
||||||
|
|
||||||
HighPass myHighPassL;
|
HighPass myHighPassL;
|
||||||
HighPass myHighPassR;
|
HighPass myHighPassR;
|
||||||
HighPass myHighPass;
|
HighPass myHighPass;
|
||||||
|
|
||||||
uInt32 myTimeIndex;
|
uInt32 myTimeIndex{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LANCZOS_RESAMPLER_HXX
|
#endif // LANCZOS_RESAMPLER_HXX
|
||||||
|
|
|
@ -39,9 +39,9 @@ class Resampler {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
uInt32 sampleRate;
|
uInt32 sampleRate{31400};
|
||||||
uInt32 fragmentSize;
|
uInt32 fragmentSize{512};
|
||||||
bool stereo;
|
bool stereo{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,10 @@ class SimpleResampler : public Resampler
|
||||||
void fillFragment(float* fragment, uInt32 length) override;
|
void fillFragment(float* fragment, uInt32 length) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Int16* myCurrentFragment{nullptr};
|
||||||
Int16* myCurrentFragment;
|
uInt32 myTimeIndex{0};
|
||||||
uInt32 myTimeIndex;
|
uInt32 myFragmentIndex{0};
|
||||||
uInt32 myFragmentIndex;
|
bool myIsUnderrun{true};
|
||||||
bool myIsUnderrun;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ namespace {
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
KeyValueRepositoryConfigfile::KeyValueRepositoryConfigfile(const string& filename)
|
KeyValueRepositoryConfigfile::KeyValueRepositoryConfigfile(const string& filename)
|
||||||
: myFilename(filename)
|
: myFilename(filename)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
std::map<string, Variant> KeyValueRepositoryConfigfile::load()
|
std::map<string, Variant> KeyValueRepositoryConfigfile::load()
|
||||||
|
|
|
@ -28,12 +28,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SqliteDatabase::SqliteDatabase(
|
SqliteDatabase::SqliteDatabase(const string& databaseDirectory,
|
||||||
const string& databaseDirectory,
|
const string& databaseName)
|
||||||
const string& databaseName
|
: myDatabaseFile(databaseDirectory + SEPARATOR + databaseName + ".sqlite3")
|
||||||
) : myDatabaseFile(databaseDirectory + SEPARATOR + databaseName + ".sqlite3"),
|
{
|
||||||
myHandle(nullptr)
|
}
|
||||||
{}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SqliteDatabase::~SqliteDatabase()
|
SqliteDatabase::~SqliteDatabase()
|
||||||
|
|
|
@ -42,7 +42,7 @@ class SqliteDatabase
|
||||||
|
|
||||||
string myDatabaseFile;
|
string myDatabaseFile;
|
||||||
|
|
||||||
sqlite3* myHandle;
|
sqlite3* myHandle{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
#include "SqliteError.hxx"
|
#include "SqliteError.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SqliteStatement::SqliteStatement(sqlite3* handle, string sql) : myStmt(nullptr), myHandle(handle)
|
SqliteStatement::SqliteStatement(sqlite3* handle, string sql)
|
||||||
|
: myHandle(handle)
|
||||||
{
|
{
|
||||||
if (sqlite3_prepare_v2(handle, sql.c_str(), -1, &myStmt, nullptr) != SQLITE_OK)
|
if (sqlite3_prepare_v2(handle, sql.c_str(), -1, &myStmt, nullptr) != SQLITE_OK)
|
||||||
throw SqliteError(handle);
|
throw SqliteError(handle);
|
||||||
|
|
|
@ -41,9 +41,9 @@ class SqliteStatement {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
sqlite3_stmt* myStmt;
|
sqlite3_stmt* myStmt{nullptr};
|
||||||
|
|
||||||
sqlite3* myHandle;
|
sqlite3* myHandle{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SqliteTransaction::SqliteTransaction(SqliteDatabase& db)
|
SqliteTransaction::SqliteTransaction(SqliteDatabase& db)
|
||||||
: myDb(db),
|
: myDb(db)
|
||||||
myTransactionClosed(false)
|
|
||||||
{
|
{
|
||||||
myDb.exec("BEGIN TRANSACTION");
|
myDb.exec("BEGIN TRANSACTION");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class SqliteTransaction {
|
||||||
|
|
||||||
SqliteDatabase& myDb;
|
SqliteDatabase& myDb;
|
||||||
|
|
||||||
bool myTransactionClosed;
|
bool myTransactionClosed{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,9 @@
|
||||||
#include "ThreadDebugging.hxx"
|
#include "ThreadDebugging.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
BilinearBlitter::BilinearBlitter(FrameBufferSDL2& fb, bool interpolate) :
|
BilinearBlitter::BilinearBlitter(FrameBufferSDL2& fb, bool interpolate)
|
||||||
myTexture(nullptr),
|
: myFB(fb),
|
||||||
mySecondaryTexture(nullptr),
|
myInterpolate(interpolate)
|
||||||
mySrcRect({0, 0, 0, 0}),
|
|
||||||
myDstRect({0, 0, 0, 0}),
|
|
||||||
myInterpolate(interpolate),
|
|
||||||
myTexturesAreAllocated(false),
|
|
||||||
myRecreateTextures(false),
|
|
||||||
myStaticData(nullptr),
|
|
||||||
myFB(fb)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,19 +40,18 @@ class BilinearBlitter : public Blitter {
|
||||||
virtual void blit(SDL_Surface& surface) override;
|
virtual void blit(SDL_Surface& surface) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
FrameBufferSDL2& myFB;
|
||||||
|
|
||||||
SDL_Texture* myTexture;
|
SDL_Texture* myTexture{nullptr};
|
||||||
SDL_Texture* mySecondaryTexture;
|
SDL_Texture* mySecondaryTexture{nullptr};
|
||||||
SDL_Rect mySrcRect, myDstRect;
|
SDL_Rect mySrcRect{0, 0, 0, 0}, myDstRect{0, 0, 0, 0};
|
||||||
FBSurface::Attributes myAttributes;
|
FBSurface::Attributes myAttributes;
|
||||||
|
|
||||||
bool myInterpolate;
|
bool myInterpolate{false};
|
||||||
bool myTexturesAreAllocated;
|
bool myTexturesAreAllocated{false};
|
||||||
bool myRecreateTextures;
|
bool myRecreateTextures{false};
|
||||||
|
|
||||||
SDL_Surface* myStaticData;
|
SDL_Surface* myStaticData{nullptr};
|
||||||
|
|
||||||
FrameBufferSDL2& myFB;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,8 @@
|
||||||
#include "ThreadDebugging.hxx"
|
#include "ThreadDebugging.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
QisBlitter::QisBlitter(FrameBufferSDL2& fb) :
|
QisBlitter::QisBlitter(FrameBufferSDL2& fb)
|
||||||
mySrcTexture(nullptr),
|
: myFB(fb)
|
||||||
myIntermediateTexture(nullptr),
|
|
||||||
mySecondaryIntermedateTexture(nullptr),
|
|
||||||
mySrcRect({0, 0, 0, 0}),
|
|
||||||
myIntermediateRect({0, 0, 0, 0}),
|
|
||||||
myDstRect({0, 0, 0, 0}),
|
|
||||||
myTexturesAreAllocated(false),
|
|
||||||
myRecreateTextures(false),
|
|
||||||
myStaticData(nullptr),
|
|
||||||
myFB(fb)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,21 +43,21 @@ class QisBlitter : public Blitter {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
SDL_Texture* mySrcTexture;
|
FrameBufferSDL2& myFB;
|
||||||
SDL_Texture* myIntermediateTexture;
|
|
||||||
SDL_Texture* mySecondaryIntermedateTexture;
|
|
||||||
|
|
||||||
SDL_Rect mySrcRect, myIntermediateRect, myDstRect;
|
SDL_Texture* mySrcTexture{nullptr};
|
||||||
|
SDL_Texture* myIntermediateTexture{nullptr};
|
||||||
|
SDL_Texture* mySecondaryIntermedateTexture{nullptr};
|
||||||
|
|
||||||
|
SDL_Rect mySrcRect{0, 0, 0, 0}, myIntermediateRect{0, 0, 0, 0}, myDstRect{0, 0, 0, 0};
|
||||||
FBSurface::Attributes myAttributes;
|
FBSurface::Attributes myAttributes;
|
||||||
|
|
||||||
bool myTexturesAreAllocated;
|
bool myTexturesAreAllocated{false};
|
||||||
bool myRecreateTextures;
|
bool myRecreateTextures{false};
|
||||||
|
|
||||||
SDL_Surface* myStaticData;
|
SDL_Surface* myStaticData{nullptr};
|
||||||
unique_ptr<uInt32[]> myBlankBuffer;
|
unique_ptr<uInt32[]> myBlankBuffer;
|
||||||
|
|
||||||
FrameBufferSDL2& myFB;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void free();
|
void free();
|
||||||
|
|
|
@ -179,8 +179,8 @@ class AtariNTSC
|
||||||
|
|
||||||
struct pixel_info_t
|
struct pixel_info_t
|
||||||
{
|
{
|
||||||
int offset;
|
int offset{0};
|
||||||
float negate;
|
float negate{0.F};
|
||||||
std::array<float, 4> kernel;
|
std::array<float, 4> kernel;
|
||||||
};
|
};
|
||||||
static const std::array<pixel_info_t, alignment_count> atari_ntsc_pixels;
|
static const std::array<pixel_info_t, alignment_count> atari_ntsc_pixels;
|
||||||
|
|
|
@ -286,7 +286,7 @@ class CartDebug : public DebuggerSystem
|
||||||
std::array<bool, 24> IOReadWrite;
|
std::array<bool, 24> IOReadWrite;
|
||||||
std::array<bool, 128> ZPRAM;
|
std::array<bool, 128> ZPRAM;
|
||||||
AddrToLabel Label;
|
AddrToLabel Label;
|
||||||
bool breakFound;
|
bool breakFound{false};
|
||||||
};
|
};
|
||||||
ReservedEquates myReserved;
|
ReservedEquates myReserved;
|
||||||
|
|
||||||
|
|
|
@ -63,10 +63,7 @@ Debugger* Debugger::myStaticDebugger = nullptr;
|
||||||
Debugger::Debugger(OSystem& osystem, Console& console)
|
Debugger::Debugger(OSystem& osystem, Console& console)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem),
|
||||||
myConsole(console),
|
myConsole(console),
|
||||||
mySystem(console.system()),
|
mySystem(console.system())
|
||||||
myDialog(nullptr),
|
|
||||||
myWidth(DebuggerDialog::kSmallFontMinW),
|
|
||||||
myHeight(DebuggerDialog::kSmallFontMinH)
|
|
||||||
{
|
{
|
||||||
// Init parser
|
// Init parser
|
||||||
myParser = make_unique<DebuggerParser>(*this, osystem.settings());
|
myParser = make_unique<DebuggerParser>(*this, osystem.settings());
|
||||||
|
|
|
@ -338,7 +338,7 @@ class Debugger : public DialogContainer
|
||||||
Console& myConsole;
|
Console& myConsole;
|
||||||
System& mySystem;
|
System& mySystem;
|
||||||
|
|
||||||
DebuggerDialog* myDialog;
|
DebuggerDialog* myDialog{nullptr};
|
||||||
unique_ptr<DebuggerParser> myParser;
|
unique_ptr<DebuggerParser> myParser;
|
||||||
unique_ptr<CartDebug> myCartDebug;
|
unique_ptr<CartDebug> myCartDebug;
|
||||||
unique_ptr<CpuDebug> myCpuDebug;
|
unique_ptr<CpuDebug> myCpuDebug;
|
||||||
|
@ -351,8 +351,8 @@ class Debugger : public DialogContainer
|
||||||
FunctionDefMap myFunctionDefs;
|
FunctionDefMap myFunctionDefs;
|
||||||
|
|
||||||
// Dimensions of the entire debugger window
|
// Dimensions of the entire debugger window
|
||||||
uInt32 myWidth;
|
uInt32 myWidth{DebuggerDialog::kSmallFontMinW};
|
||||||
uInt32 myHeight;
|
uInt32 myHeight{DebuggerDialog::kSmallFontMinH};
|
||||||
|
|
||||||
// Various builtin functions and operations
|
// Various builtin functions and operations
|
||||||
struct BuiltinFunction {
|
struct BuiltinFunction {
|
||||||
|
|
|
@ -57,11 +57,7 @@ using std::right;
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
DebuggerParser::DebuggerParser(Debugger& d, Settings& s)
|
DebuggerParser::DebuggerParser(Debugger& d, Settings& s)
|
||||||
: debugger(d),
|
: debugger(d),
|
||||||
settings(s),
|
settings(s)
|
||||||
myCommand(0),
|
|
||||||
argCount(0),
|
|
||||||
execDepth(0),
|
|
||||||
execPrefix("")
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,8 @@ class DebuggerParser
|
||||||
string cmdString;
|
string cmdString;
|
||||||
string description;
|
string description;
|
||||||
string extendedDesc;
|
string extendedDesc;
|
||||||
bool parmsRequired;
|
bool parmsRequired{false};
|
||||||
bool refreshRequired;
|
bool refreshRequired{false};
|
||||||
std::array<Parameters, 10> parms;
|
std::array<Parameters, 10> parms;
|
||||||
std::function<void (DebuggerParser*)> executor;
|
std::function<void (DebuggerParser*)> executor;
|
||||||
};
|
};
|
||||||
|
@ -101,10 +101,10 @@ class DebuggerParser
|
||||||
|
|
||||||
struct Trap
|
struct Trap
|
||||||
{
|
{
|
||||||
bool read;
|
bool read{false};
|
||||||
bool write;
|
bool write{false};
|
||||||
uInt32 begin;
|
uInt32 begin{0};
|
||||||
uInt32 end;
|
uInt32 end{0};
|
||||||
string condition;
|
string condition;
|
||||||
|
|
||||||
Trap(bool r, bool w, uInt32 b, uInt32 e, const string& c)
|
Trap(bool r, bool w, uInt32 b, uInt32 e, const string& c)
|
||||||
|
@ -121,13 +121,13 @@ class DebuggerParser
|
||||||
ostringstream commandResult;
|
ostringstream commandResult;
|
||||||
|
|
||||||
// currently execute command id
|
// currently execute command id
|
||||||
int myCommand;
|
int myCommand{0};
|
||||||
// Arguments in 'int' and 'string' format for the currently running command
|
// Arguments in 'int' and 'string' format for the currently running command
|
||||||
IntArray args;
|
IntArray args;
|
||||||
StringList argStrings;
|
StringList argStrings;
|
||||||
uInt32 argCount;
|
uInt32 argCount{0};
|
||||||
|
|
||||||
uInt32 execDepth;
|
uInt32 execDepth{0};
|
||||||
string execPrefix;
|
string execPrefix;
|
||||||
|
|
||||||
StringList myWatches;
|
StringList myWatches;
|
||||||
|
|
|
@ -30,9 +30,6 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
|
||||||
myList(list),
|
myList(list),
|
||||||
mySettings(s),
|
mySettings(s),
|
||||||
myReserved(reserved),
|
myReserved(reserved),
|
||||||
myOffset(0),
|
|
||||||
myPC(0),
|
|
||||||
myPCEnd(0),
|
|
||||||
myLabels(labels),
|
myLabels(labels),
|
||||||
myDirectives(directives)
|
myDirectives(directives)
|
||||||
{
|
{
|
||||||
|
@ -1120,16 +1117,7 @@ void DiStella::processDirectives(const CartDebug::DirectiveList& directives)
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
DiStella::Settings DiStella::settings = {
|
DiStella::Settings DiStella::settings;
|
||||||
Base::Fmt::_2, // gfxFormat
|
|
||||||
true, // resolveCode (opposite of -d in Distella)
|
|
||||||
true, // showAddresses (not used externally; always off)
|
|
||||||
false, // aFlag (-a in Distella)
|
|
||||||
true, // fFlag (-f in Distella)
|
|
||||||
false, // rFlag (-r in Distella)
|
|
||||||
false, // bFlag (-b in Distella)
|
|
||||||
8+1 // number of bytes to use with .byte directive
|
|
||||||
};
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
const std::array<DiStella::Instruction_tag, 256> DiStella::ourLookup = { {
|
const std::array<DiStella::Instruction_tag, 256> DiStella::ourLookup = { {
|
||||||
|
|
|
@ -42,14 +42,14 @@ class DiStella
|
||||||
// This will eventually grow to include all options supported by
|
// This will eventually grow to include all options supported by
|
||||||
// standalone Distella
|
// standalone Distella
|
||||||
struct Settings {
|
struct Settings {
|
||||||
Common::Base::Fmt gfxFormat;
|
Common::Base::Fmt gfxFormat{Common::Base::Fmt::_2};
|
||||||
bool resolveCode; // Attempt to detect code vs. data sections
|
bool resolveCode{true}; // Attempt to detect code vs. data sections
|
||||||
bool showAddresses; // Show PC addresses (always off for external output)
|
bool showAddresses{true}; // Show PC addresses (always off for external output)
|
||||||
bool aFlag; // Turns 'A' off in accumulator instructions (-a in Distella)
|
bool aFlag{false}; // Turns 'A' off in accumulator instructions (-a in Distella)
|
||||||
bool fFlag; // Forces correct address length (-f in Distella)
|
bool fFlag{true}; // Forces correct address length (-f in Distella)
|
||||||
bool rFlag; // Relocate calls out of address range (-r in Distella)
|
bool rFlag{false}; // Relocate calls out of address range (-r in Distella)
|
||||||
bool bFlag; // Process break routine (-b in Distella)
|
bool bFlag{false}; // Process break routine (-b in Distella)
|
||||||
int bytesWidth; // Number of bytes to use per line (with .byte xxx)
|
int bytesWidth{8+1}; // Number of bytes to use per line (with .byte xxx)
|
||||||
};
|
};
|
||||||
static Settings settings; // Default settings
|
static Settings settings; // Default settings
|
||||||
|
|
||||||
|
@ -123,13 +123,13 @@ class DiStella
|
||||||
CartDebug::ReservedEquates& myReserved;
|
CartDebug::ReservedEquates& myReserved;
|
||||||
stringstream myDisasmBuf;
|
stringstream myDisasmBuf;
|
||||||
std::queue<uInt16> myAddressQueue;
|
std::queue<uInt16> myAddressQueue;
|
||||||
uInt16 myOffset, myPC, myPCEnd;
|
uInt16 myOffset{0}, myPC{0}, myPCEnd{0};
|
||||||
uInt16 mySegType;
|
uInt16 mySegType{0};
|
||||||
|
|
||||||
struct resource {
|
struct resource {
|
||||||
uInt16 start;
|
uInt16 start{0};
|
||||||
uInt16 end;
|
uInt16 end{0};
|
||||||
uInt16 length;
|
uInt16 length{0};
|
||||||
} myAppData;
|
} myAppData;
|
||||||
|
|
||||||
/* Stores info on how each address is marked, both in the general
|
/* Stores info on how each address is marked, both in the general
|
||||||
|
@ -185,12 +185,12 @@ class DiStella
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Instruction_tag {
|
struct Instruction_tag {
|
||||||
const char* const mnemonic;
|
const char* const mnemonic{nullptr};
|
||||||
AddressingMode addr_mode;
|
AddressingMode addr_mode{AddressingMode::IMPLIED};
|
||||||
AccessMode source;
|
AccessMode source{AccessMode::NONE};
|
||||||
RWMode rw_mode;
|
RWMode rw_mode{RWMode::NONE};
|
||||||
uInt8 cycles;
|
uInt8 cycles{0};
|
||||||
uInt8 bytes;
|
uInt8 bytes{0};
|
||||||
};
|
};
|
||||||
static const std::array<Instruction_tag, 256> ourLookup;
|
static const std::array<Instruction_tag, 256> ourLookup;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue