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
#define STATE_MANAGER_HXX
#define STATE_HEADER "06070010state"
#define STATE_HEADER "06070020state"
class OSystem;
class RewindManager;

View File

@ -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();

View File

@ -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};