diff --git a/src/common/StateManager.hxx b/src/common/StateManager.hxx index e4b336311..5f2a32544 100644 --- a/src/common/StateManager.hxx +++ b/src/common/StateManager.hxx @@ -18,7 +18,7 @@ #ifndef STATE_MANAGER_HXX #define STATE_MANAGER_HXX -#define STATE_HEADER "06070010state" +#define STATE_HEADER "06070020state" class OSystem; class RewindManager; diff --git a/src/emucore/tia/AudioChannel.cxx b/src/emucore/tia/AudioChannel.cxx index 679a92cd3..65e32e485 100644 --- a/src/emucore/tia/AudioChannel.cxx +++ b/src/emucore/tia/AudioChannel.cxx @@ -20,7 +20,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void AudioChannel::reset() { - myAudc = myAudv = myAudf = 0; + myAudc = myAudf = myAudv = 0; myClockEnable = myNoiseFeedback = myNoiseCounterBit4 = myPulseCounterHold = false; myDivCounter = myPulseCounter = myNoiseCounter = 0; } @@ -120,40 +120,14 @@ void AudioChannel::phase1() } } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// The actual volume of a chaneel is the volume register multiplied by the -// lowest of the pulse counter -uInt8 AudioChannel::actualVolume() const -{ - return (myPulseCounter & 0x01) * myAudv; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void AudioChannel::audc(uInt8 value) -{ - myAudc = value & 0x0f; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void AudioChannel::audv(uInt8 value) -{ - myAudv = value & 0x0f; -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void AudioChannel::audf(uInt8 value) -{ - myAudf = value & 0x1f; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool AudioChannel::save(Serializer& out) const { try { out.putByte(myAudc); - out.putByte(myAudv); out.putByte(myAudf); + out.putByte(myAudv); out.putBool(myClockEnable); out.putBool(myNoiseFeedback); @@ -179,8 +153,8 @@ bool AudioChannel::load(Serializer& in) try { myAudc = in.getByte(); - myAudv = in.getByte(); myAudf = in.getByte(); + myAudv = in.getByte(); myClockEnable = in.getBool(); myNoiseFeedback = in.getBool(); diff --git a/src/emucore/tia/AudioChannel.hxx b/src/emucore/tia/AudioChannel.hxx index 409f2a149..e80a444a4 100644 --- a/src/emucore/tia/AudioChannel.hxx +++ b/src/emucore/tia/AudioChannel.hxx @@ -33,13 +33,23 @@ class AudioChannel : public Serializable void phase1(); - uInt8 actualVolume() const; + // The actual volume of a channel is the volume register multiplied by the + // lowest of the pulse counter + uInt8 actualVolume() const { + return (myPulseCounter & 0x01) * myAudv; + } - void audc(uInt8 value); + void audc(uInt8 value) { + myAudc = value & 0x0f; + } - void audf(uInt8 value); + void audf(uInt8 value) { + myAudf = value & 0x1f; + } - void audv(uInt8 value); + void audv(uInt8 value) { + myAudv = value & 0x0f; + } /** Serializable methods (see that class for more information). @@ -49,8 +59,8 @@ class AudioChannel : public Serializable private: uInt8 myAudc{0}; - uInt8 myAudv{0}; uInt8 myAudf{0}; + uInt8 myAudv{0}; bool myClockEnable{false}; bool myNoiseFeedback{false};