AudioChannel::phase1() no longer returns uInt8

the uInt8 is retreived with the new AudioChannel::volume() function

this separation is because we want to take the volume of the audio channel
every colour clock but 'phase 1' for the channel happens only twice
per scanline
This commit is contained in:
JetSetIlly 2024-08-06 22:40:14 +01:00
parent eff87589ec
commit 5d9d0b8a08
3 changed files with 12 additions and 5 deletions

View File

@ -98,8 +98,8 @@ void Audio::tick()
{
// volume for each channel is sampled every color clock. the average of
// these samples will be taken twice a scanline in the phase1() function
sumChannel0 += (uInt32)myChannel0.phase1();
sumChannel1 += (uInt32)myChannel1.phase1();
sumChannel0 += (uInt32)myChannel0.volume();
sumChannel1 += (uInt32)myChannel1.volume();
sumCt++;
switch (myCounter) {
@ -111,7 +111,9 @@ void Audio::tick()
case 37:
case 149:
phase1();
myChannel0.phase1();
myChannel1.phase1();
phase1();
break;
default:

View File

@ -77,7 +77,7 @@ void AudioChannel::phase0()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 AudioChannel::phase1()
void AudioChannel::phase1()
{
if (myClockEnable) {
bool pulseFeedback = false;
@ -118,7 +118,10 @@ uInt8 AudioChannel::phase1()
}
}
}
}
uInt8 AudioChannel::volume()
{
return (myPulseCounter & 0x01) * myAudv;
}

View File

@ -30,7 +30,9 @@ class AudioChannel : public Serializable
void phase0();
uInt8 phase1();
void phase1();
uInt8 volume();
void audc(uInt8 value);