Skip to content

Commit

Permalink
PC speaker/Timer: Mode 3 (square wave) and counter == 1 generates a l…
Browse files Browse the repository at this point in the history
…ow frequency buzz. Fixes Paratrooper [#1492]
  • Loading branch information
joncampbell123 committed Apr 28, 2020
1 parent af6bb46 commit 42f4d90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
0.83.1
- PC speaker: Mode 3 (square wave) and a counter value
of 1 produces a low frequency square wave. Ulrasonic
frequencies do not begin until count == 2. This fixes
helicopter noises in Paratrooper.
- dosbox-x.conf is now recognized as the default config
file name in addition to dosbox.conf (Wengier)
- Tandy DAC output fixed to slowly ramp last sample to
Expand Down
6 changes: 6 additions & 0 deletions src/hardware/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@ static void write_latch(Bitu port,Bitu val,Bitu /*iolen*/) {
else
p->set_next_counter(9999/*check this*/);
}
else if (p->write_latch == 1 && p->mode == 3/*square wave, count by 2*/) { /* counter==1 and mode==3 makes a low frequency buzz (Paratrooper) */
if (p->bcd == false)
p->set_next_counter(0x10001);
else
p->set_next_counter(10000/*check this*/);
}
else {
p->set_next_counter(p->write_latch);
}
Expand Down

0 comments on commit 42f4d90

Please sign in to comment.