Skip to content
Permalink
Browse files

PC Speaker: If pcspeaker=false, do not respond to any calls from the …

…8254 PIT timer code and do not generate PIT output. This fixes problems with PC speaker output and pcspeaker=false
  • Loading branch information...
joncampbell123 committed Jan 17, 2019
1 parent 12ff077 commit ad20e21de095f44dfaebca39c601868f4a5dcc04
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/hardware/pcspeaker.cpp
@@ -277,6 +277,9 @@ static void ForwardPIT(pic_tickindex_t newindex) {
}

void PCSPEAKER_SetPITControl(Bitu mode) {
if (spkr.chan == NULL)
return;

pic_tickindex_t newindex = PIC_TickIndex();
ForwardPIT(newindex);
#ifdef SPKR_DEBUGGING
@@ -313,6 +316,9 @@ void PCSPEAKER_SetPITControl(Bitu mode) {

// new mode WITHOUT writing port 43h
void PCSPEAKER_SetCounter_NoNewMode(Bitu cntr) {
if (spkr.chan == NULL)
return;

if (!spkr.last_ticks) {
if(spkr.chan) spkr.chan->Enable(true);
spkr.last_index=0;
@@ -366,6 +372,9 @@ void PCSPEAKER_SetCounter_NoNewMode(Bitu cntr) {
}

void PCSPEAKER_SetCounter(Bitu cntr, Bitu mode) {
if (spkr.chan == NULL)
return;

#ifdef SPKR_DEBUGGING
fprintf(PCSpeakerLog, "%f counter: %u, mode: %u\n", PIC_FullIndex(), cntr, mode);
speaker_state_change_t temp;
@@ -452,6 +461,9 @@ void PCSPEAKER_SetCounter(Bitu cntr, Bitu mode) {
}

void PCSPEAKER_SetType(bool pit_clock_gate_enabled, bool pit_output_enabled) {
if (spkr.chan == NULL)
return;

#ifdef SPKR_DEBUGGING
fprintf(
PCSpeakerLog,

0 comments on commit ad20e21

Please sign in to comment.
You can’t perform that action at this time.