diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index 5b468d2f6..7a2fda607 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -29,6 +29,8 @@ #include <86box/86box.h> #include "cpu.h" #include <86box/timer.h> +#include <86box/device.h> +#include <86box/cassette.h> #include <86box/io.h> #include <86box/nmi.h> #include <86box/pic.h> @@ -614,6 +616,10 @@ kbd_write(uint16_t port, uint8_t val, void *priv) case 0x61: pcjr->pb = val; + timer_process(); + + pc_cas_set_motor(cassette, (pcjr->pb & 0x08) == 0); + speaker_update(); speaker_gated = val & 1; speaker_enable = val & 2; @@ -657,10 +663,14 @@ kbd_read(uint16_t port, void *priv) case 0x61: ret = pcjr->pb; break; - + case 0x62: ret = (pcjr->latched ? 1 : 0); ret |= 0x02; /*Modem card not installed*/ + if ((pcjr->pb & 0x08) || (cassette == NULL)) + ret |= (ppispeakon ? 0x10 : 0); + else + ret |= (pc_cas_get_inp(cassette) ? 0x10 : 0); ret |= (ppispeakon ? 0x10 : 0); ret |= (ppispeakon ? 0x20 : 0); ret |= (pcjr->data ? 0x40: 0);