Added some cassette-related sanity checks, closes #1567.

This commit is contained in:
OBattler
2021-07-29 18:17:09 +02:00
parent 026bed4e53
commit 14f6eaca39
2 changed files with 3 additions and 2 deletions

View File

@@ -516,7 +516,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
timer_process();
if (kbd->type <= 1)
if ((kbd->type <= 1) && (cassette != NULL))
pc_cas_set_motor(cassette, (kbd->pb & 0x08) == 0);
speaker_update();

View File

@@ -618,7 +618,8 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
timer_process();
pc_cas_set_motor(cassette, (pcjr->pb & 0x08) == 0);
if (cassette != NULL)
pc_cas_set_motor(cassette, (pcjr->pb & 0x08) == 0);
speaker_update();
speaker_gated = val & 1;