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