From a91679d6f5c9afc68e599809aea7336d2a218fa6 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Tue, 16 Jun 2020 14:21:35 +0200 Subject: [PATCH] IMLAC: Fix data switches. --- imlac/imlac_cpu.c | 23 +++++++++++++++++++++-- imlac/imlac_crt.c | 8 -------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/imlac/imlac_cpu.c b/imlac/imlac_cpu.c index 69f5a044..13c49138 100644 --- a/imlac/imlac_cpu.c +++ b/imlac/imlac_cpu.c @@ -25,6 +25,10 @@ */ #include "imlac_defs.h" +#ifdef HAVE_LIBSDL +#include "display/display.h" +#endif + /* Debug */ #define DBG_CPU 0001 @@ -45,7 +49,6 @@ static uint16 DS; static uint16 IR; static uint16 MA; static uint16 MB; -static uint16 SWITCHES; static int ion_delay = 0; /* IRQ state. */ @@ -77,7 +80,6 @@ REG cpu_reg[] = { { ORDATAD (IR, IR, 16, "Instruction") }, { ORDATAD (MA, MA, 13, "Memory Address") }, { ORDATAD (MB, MB, 16, "Memory Buffer") }, - { ORDATAD (SWITCHES, SWITCHES, 16, "Toggle switches") }, { NULL } }; @@ -574,3 +576,20 @@ rom_show_type (FILE *st, UNIT *up, int32 v, CONST void *dp) } return SCPE_OK; } + +#ifdef HAVE_LIBSDL +/* Called from display library to get data switches. */ +void +cpu_get_switches (unsigned long *p1, unsigned long *p2) +{ + *p1 = DS; + *p2 = 0; +} + +/* Called from display library to set data switches. */ +void +cpu_set_switches (unsigned long p1, unsigned long p2) +{ + DS = p1 & 0177777; +} +#endif /* HAVE_LIBSDL */ diff --git a/imlac/imlac_crt.c b/imlac/imlac_crt.c index 68b69f8b..6ecb2316 100644 --- a/imlac/imlac_crt.c +++ b/imlac/imlac_crt.c @@ -126,11 +126,3 @@ void crt_hvc (void) { } - -void cpu_get_switches (unsigned long *p1, unsigned long *p2) -{ -} - -void cpu_set_switches (unsigned long p1, unsigned long p2) -{ -}