Merge branch 'master' into elf

This commit is contained in:
Stephen Anthony 2024-08-07 18:00:26 -02:30
commit 9304f28c2c
3 changed files with 19 additions and 35 deletions

View File

@ -18,7 +18,7 @@
#ifndef STATE_MANAGER_HXX #ifndef STATE_MANAGER_HXX
#define STATE_MANAGER_HXX #define STATE_MANAGER_HXX
#define STATE_HEADER "06070010state" #define STATE_HEADER "06070020state"
class OSystem; class OSystem;
class RewindManager; class RewindManager;

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void AudioChannel::reset() void AudioChannel::reset()
{ {
myAudc = myAudv = myAudf = 0; myAudc = myAudf = myAudv = 0;
myClockEnable = myNoiseFeedback = myNoiseCounterBit4 = myPulseCounterHold = false; myClockEnable = myNoiseFeedback = myNoiseCounterBit4 = myPulseCounterHold = false;
myDivCounter = myPulseCounter = myNoiseCounter = 0; 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 bool AudioChannel::save(Serializer& out) const
{ {
try try
{ {
out.putByte(myAudc); out.putByte(myAudc);
out.putByte(myAudv);
out.putByte(myAudf); out.putByte(myAudf);
out.putByte(myAudv);
out.putBool(myClockEnable); out.putBool(myClockEnable);
out.putBool(myNoiseFeedback); out.putBool(myNoiseFeedback);
@ -179,8 +153,8 @@ bool AudioChannel::load(Serializer& in)
try try
{ {
myAudc = in.getByte(); myAudc = in.getByte();
myAudv = in.getByte();
myAudf = in.getByte(); myAudf = in.getByte();
myAudv = in.getByte();
myClockEnable = in.getBool(); myClockEnable = in.getBool();
myNoiseFeedback = in.getBool(); myNoiseFeedback = in.getBool();

View File

@ -33,13 +33,23 @@ class AudioChannel : public Serializable
void phase1(); 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). Serializable methods (see that class for more information).
@ -49,8 +59,8 @@ class AudioChannel : public Serializable
private: private:
uInt8 myAudc{0}; uInt8 myAudc{0};
uInt8 myAudv{0};
uInt8 myAudf{0}; uInt8 myAudf{0};
uInt8 myAudv{0};
bool myClockEnable{false}; bool myClockEnable{false};
bool myNoiseFeedback{false}; bool myNoiseFeedback{false};