diff --git a/src/debugger/BreakpointMap.hxx b/src/debugger/BreakpointMap.hxx index 6155e63c7..40fed4f93 100644 --- a/src/debugger/BreakpointMap.hxx +++ b/src/debugger/BreakpointMap.hxx @@ -64,7 +64,7 @@ class BreakpointMap BreakpointMap() = default; - bool isInitialized() const { return myInitialized; } + inline bool isInitialized() const { return myInitialized; } /** Add new breakpoint */ void add(const Breakpoint& breakpoint, const uInt32 flags = 0); diff --git a/src/debugger/TimerMap.hxx b/src/debugger/TimerMap.hxx index 8b6b2e305..a916e7775 100644 --- a/src/debugger/TimerMap.hxx +++ b/src/debugger/TimerMap.hxx @@ -139,7 +139,7 @@ class TimerMap explicit TimerMap() = default; - bool isInitialized() const { return myList.size(); } + inline bool isInitialized() const { return myList.size(); } /** Add new timer */ uInt32 add(uInt16 fromAddr, uInt16 toAddr, diff --git a/src/debugger/TrapArray.hxx b/src/debugger/TrapArray.hxx index 1e10bdeeb..9505fb852 100644 --- a/src/debugger/TrapArray.hxx +++ b/src/debugger/TrapArray.hxx @@ -25,8 +25,8 @@ class TrapArray public: TrapArray() = default; - bool isSet(const uInt16 address) const { return myCount[address]; } - bool isClear(const uInt16 address) const { return myCount[address] == 0; } + inline bool isSet(const uInt16 address) const { return myCount[address]; } + inline bool isClear(const uInt16 address) const { return myCount[address] == 0; } void add(const uInt16 address) { myCount[address]++; } void remove(const uInt16 address) { myCount[address]--; } @@ -39,7 +39,7 @@ class TrapArray } void clearAll() { myInitialized = false; myCount.fill(0); } - bool isInitialized() const { return myInitialized; } + inline bool isInitialized() const { return myInitialized; } private: // The actual counts diff --git a/src/emucore/Cart.hxx b/src/emucore/Cart.hxx index b3b393e86..4807be253 100644 --- a/src/emucore/Cart.hxx +++ b/src/emucore/Cart.hxx @@ -165,7 +165,7 @@ class Cartridge : public Device @return Address of illegal access if one occurred, else 0 */ - uInt16 getIllegalRAMReadAccess() const { + inline uInt16 getIllegalRAMReadAccess() const { return myRamReadAccesses.size() > 0 ? myRamReadAccesses[0] : 0; } @@ -176,7 +176,7 @@ class Cartridge : public Device @return Address of illegal access if one occurred, else 0 */ - uInt16 getIllegalRAMWriteAccess() const { return myRamWriteAccess; } + inline uInt16 getIllegalRAMWriteAccess() const { return myRamWriteAccess; } /** Query the access counters diff --git a/src/emucore/System.hxx b/src/emucore/System.hxx index cce967b29..da1f8ac7b 100644 --- a/src/emucore/System.hxx +++ b/src/emucore/System.hxx @@ -101,14 +101,14 @@ class System : public Serializable @return The attached 6532 microprocessor */ - M6532& m6532() const { return myM6532; } + inline M6532& m6532() const { return myM6532; } /** Answer the TIA device attached to the system. @return The attached TIA device */ - TIA& tia() const { return myTIA; } + inline TIA& tia() const { return myTIA; } /** Answer the Cart attached to the system. @@ -140,14 +140,14 @@ class System : public Serializable @return The number of system cycles which have passed */ - uInt64 cycles() const { return myCycles; } + inline uInt64 cycles() const { return myCycles; } /** Increment the system cycles by the specified number of cycles. @param amount The amount to add to the system cycles counter */ - void incrementCycles(uInt32 amount) { myCycles += amount; } + inline void incrementCycles(uInt32 amount) { myCycles += amount; } /** Informs all attached devices that the console type has changed. diff --git a/src/emucore/tia/Audio.cxx b/src/emucore/tia/Audio.cxx index 493469bd5..e84f7f256 100644 --- a/src/emucore/tia/Audio.cxx +++ b/src/emucore/tia/Audio.cxx @@ -61,28 +61,6 @@ void Audio::setAudioQueue(const shared_ptr& queue) mySampleIndex = 0; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Audio::tick() -{ - switch (myCounter) { - case 9: - case 81: - myChannel0.phase0(); - myChannel1.phase0(); - break; - - case 37: - case 149: - phase1(); - break; - - default: - break; - } - - if (++myCounter == 228) myCounter = 0; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Audio::phase1() { @@ -117,18 +95,6 @@ void Audio::addSample(uInt8 sample0, uInt8 sample1) } } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AudioChannel& Audio::channel0() -{ - return myChannel0; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AudioChannel& Audio::channel1() -{ - return myChannel1; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Audio::save(Serializer& out) const { diff --git a/src/emucore/tia/Audio.hxx b/src/emucore/tia/Audio.hxx index de71e1f91..ea7493639 100644 --- a/src/emucore/tia/Audio.hxx +++ b/src/emucore/tia/Audio.hxx @@ -44,11 +44,11 @@ class Audio : public Serializable #endif } - void tick(); + FORCE_INLINE void tick(); - AudioChannel& channel0(); + inline AudioChannel& channel0() { return myChannel0; } - AudioChannel& channel1(); + inline AudioChannel& channel1() { return myChannel1; } /** Serializable methods (see that class for more information). @@ -85,4 +85,30 @@ class Audio : public Serializable Audio& operator=(Audio&&) = delete; }; +// ############################################################################ +// Implementation +// ############################################################################ + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Audio::tick() +{ + switch (myCounter) { + case 9: + case 81: + myChannel0.phase0(); + myChannel1.phase0(); + break; + + case 37: + case 149: + phase1(); + break; + + default: + break; + } + + if (++myCounter == 228) myCounter = 0; +} + #endif // TIA_AUDIO_HXX diff --git a/src/emucore/tia/Background.hxx b/src/emucore/tia/Background.hxx index 4b2a0a26a..13b599cc1 100644 --- a/src/emucore/tia/Background.hxx +++ b/src/emucore/tia/Background.hxx @@ -39,7 +39,7 @@ class Background : public Serializable void applyColorLoss(); - uInt8 getColor() const { return myColor; } + inline uInt8 getColor() const { return myColor; } /** Serializable methods (see that class for more information). diff --git a/src/emucore/tia/Ball.hxx b/src/emucore/tia/Ball.hxx index 6c258500d..29194a3b1 100644 --- a/src/emucore/tia/Ball.hxx +++ b/src/emucore/tia/Ball.hxx @@ -123,12 +123,12 @@ class Ball : public Serializable Is the ball visible? This is determined by looking at bit 15 of the collision mask. */ - bool isOn() const { return (collision & 0x8000); } + inline bool isOn() const { return (collision & 0x8000); } /** Get the current color. */ - uInt8 getColor() const { return myColor; } + inline uInt8 getColor() const { return myColor; } /** Shuffle the enabled flag. This is called in VDELBL mode when GRP1 is diff --git a/src/emucore/tia/Missile.hxx b/src/emucore/tia/Missile.hxx index 8e256a685..15ab383cc 100644 --- a/src/emucore/tia/Missile.hxx +++ b/src/emucore/tia/Missile.hxx @@ -64,7 +64,7 @@ class Missile : public Serializable void toggleEnabled(bool enabled); - bool isOn() const { return (collision & 0x8000); } + inline bool isOn() const { return (collision & 0x8000); } uInt8 getColor() const; uInt8 getPosition() const; diff --git a/src/emucore/tia/Player.hxx b/src/emucore/tia/Player.hxx index 9d2b0cc1a..990b96a50 100644 --- a/src/emucore/tia/Player.hxx +++ b/src/emucore/tia/Player.hxx @@ -66,7 +66,7 @@ class Player : public Serializable uInt8 getClock() const { return myCounter; } - bool isOn() const { return (collision & 0x8000); } + inline bool isOn() const { return (collision & 0x8000); } uInt8 getColor() const; void shufflePatterns(); diff --git a/src/emucore/tia/Playfield.hxx b/src/emucore/tia/Playfield.hxx index bc382a629..480b8f24a 100644 --- a/src/emucore/tia/Playfield.hxx +++ b/src/emucore/tia/Playfield.hxx @@ -118,7 +118,7 @@ class Playfield : public Serializable Is the playfield visible? This is determined by looking at bit 15 of the collision mask. */ - bool isOn() const { return (collision & 0x8000); } + inline bool isOn() const { return (collision & 0x8000); } /** Get the current color. diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index bcc1f5281..9b73d3b71 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -1591,7 +1591,7 @@ void TIA::scheduleCollisionUpdate() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void TIA::updateCollision() +FORCE_INLINE void TIA::updateCollision() { myCollisionMask |= ( myPlayer0.collision & @@ -1604,7 +1604,7 @@ void TIA::updateCollision() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void TIA::renderPixel(uInt32 x, uInt32 y) +FORCE_INLINE void TIA::renderPixel(uInt32 x, uInt32 y) { if (x >= TIAConstants::H_PIXEL) return; diff --git a/src/emucore/tia/frame-manager/AbstractFrameManager.hxx b/src/emucore/tia/frame-manager/AbstractFrameManager.hxx index 7a8a39ea6..5f1514e1e 100644 --- a/src/emucore/tia/frame-manager/AbstractFrameManager.hxx +++ b/src/emucore/tia/frame-manager/AbstractFrameManager.hxx @@ -78,7 +78,7 @@ class AbstractFrameManager : public Serializable * Should the TIA render its frame? This is buffered in a flag for * performance reasons; descendants must update the flag. */ - bool isRendering() const { return myIsRendering; } + inline bool isRendering() const { return myIsRendering; } /** * Is vsync on? @@ -88,7 +88,7 @@ class AbstractFrameManager : public Serializable /** * Is vblank on? */ - bool vblank() const { return myVblank; } + inline bool vblank() const { return myVblank; } /** * The number of scanlines in the last finished frame.