From 27ac9cf6e6ee577213b35b55d331a0d0ec450de0 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 21 Oct 2025 22:07:41 -0400 Subject: [PATCH] Support for PCjr keyboard IR reciever option Currently disabled as it Error B's --- src/include/86box/m_pcjr.h | 1 + src/machine/m_pcjr.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/include/86box/m_pcjr.h b/src/include/86box/m_pcjr.h index 9b4a7cbaf..f957252a6 100644 --- a/src/include/86box/m_pcjr.h +++ b/src/include/86box/m_pcjr.h @@ -68,6 +68,7 @@ typedef struct pcjr_s { uint8_t pb; uint8_t option_fdc; + uint8_t option_ir; pc_timer_t send_delay_timer; diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index c1b7aba9b..1b9e8a8f4 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -667,6 +667,8 @@ kbd_read(uint16_t port, void *priv) ret |= (pcjr->data ? 0x40 : 0); if (pcjr->data) ret |= 0x40; + if (pcjr->option_ir) + ret |= 0x80; /* Keyboard cable not connected */ break; case 0xa0: @@ -816,6 +818,19 @@ static const device_config_t pcjr_config[] = { .selection = { { 0 } }, .bios = { { 0 } } }, +#if 0 + { + .name = "ir_reciever", + .description = "Enable IR Reciever", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, +#endif { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -850,6 +865,11 @@ machine_pcjr_init(UNUSED(const machine_t *model)) pcjr = calloc(1, sizeof(pcjr_t)); pcjr->option_fdc = 0; +#if 0 + pcjr->option_ir = device_get_config_int("ir_reciever"); +#else + pcjr->option_ir = 0; +#endif is_pcjr = 1;