diff --git a/src/keyboard_amstrad.c b/src/keyboard_amstrad.c index 60ae66e..2bff91f 100644 --- a/src/keyboard_amstrad.c +++ b/src/keyboard_amstrad.c @@ -76,6 +76,9 @@ void keyboard_amstrad_write(uint16_t port, uint8_t val, void *priv) keyboard_amstrad.pb = val; ppi.pb = val; + timer_process(); + timer_update_outstanding(); + speaker_gated = val & 1; speaker_enable = val & 2; if (speaker_enable) diff --git a/src/keyboard_at.c b/src/keyboard_at.c index 5e6d6ca..bcf8468 100644 --- a/src/keyboard_at.c +++ b/src/keyboard_at.c @@ -284,6 +284,10 @@ void keyboard_at_write(uint16_t port, uint8_t val, void *priv) case 0x61: ppi.pb = val; + + timer_process(); + timer_update_outstanding(); + speaker_gated = val & 1; speaker_enable = val & 2; if (speaker_enable) diff --git a/src/keyboard_olim24.c b/src/keyboard_olim24.c index e0258df..a728203 100644 --- a/src/keyboard_olim24.c +++ b/src/keyboard_olim24.c @@ -144,6 +144,9 @@ void keyboard_olim24_write(uint16_t port, uint8_t val, void *priv) case 0x61: ppi.pb = val; + timer_process(); + timer_update_outstanding(); + speaker_gated = val & 1; speaker_enable = val & 2; if (speaker_enable) diff --git a/src/keyboard_pcjr.c b/src/keyboard_pcjr.c index dd85d44..b354ebe 100644 --- a/src/keyboard_pcjr.c +++ b/src/keyboard_pcjr.c @@ -124,6 +124,10 @@ void keyboard_pcjr_write(uint16_t port, uint8_t val, void *priv) case 0x61: keyboard_pcjr.pb = val; + + timer_process(); + timer_update_outstanding(); + speaker_gated = val & 1; speaker_enable = val & 2; if (speaker_enable) diff --git a/src/keyboard_xt.c b/src/keyboard_xt.c index f3064f8..ac914f8 100644 --- a/src/keyboard_xt.c +++ b/src/keyboard_xt.c @@ -76,6 +76,9 @@ void keyboard_xt_write(uint16_t port, uint8_t val, void *priv) keyboard_xt.pb = val; ppi.pb = val; + timer_process(); + timer_update_outstanding(); + speaker_gated = val & 1; speaker_enable = val & 2; if (speaker_enable) diff --git a/src/sound_speaker.c b/src/sound_speaker.c index 760c0d1..eac0a2a 100644 --- a/src/sound_speaker.c +++ b/src/sound_speaker.c @@ -20,6 +20,8 @@ static void speaker_poll(void *p) { if (!pit.m[2] || pit.m[2]==4) speaker_buffer[speaker_pos] = speakval; + else if (pit.l[2] < 0x40) + speaker_buffer[speaker_pos] = 0xa00; else speaker_buffer[speaker_pos] = speakon ? 0x1400 : 0; }