mirror of https://github.com/stella-emu/stella.git
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:
parent
eff87589ec
commit
5d9d0b8a08
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@ class AudioChannel : public Serializable
|
|||
|
||||
void phase0();
|
||||
|
||||
uInt8 phase1();
|
||||
void phase1();
|
||||
|
||||
uInt8 volume();
|
||||
|
||||
void audc(uInt8 value);
|
||||
|
||||
|
|
Loading…
Reference in New Issue