From d8ef103650fdfeb33357789cfd90fe4a796fad48 Mon Sep 17 00:00:00 2001 From: David Kuder Date: Tue, 2 May 2023 15:04:36 -0400 Subject: [PATCH] Jumper reading for Analog GS --- common/buffers.c | 2 ++ common/buffers.h | 2 ++ common/config.c | 6 ++++++ common/main.c | 3 +++ 4 files changed, 13 insertions(+) diff --git a/common/buffers.c b/common/buffers.c index 1ffa91e..e76e418 100644 --- a/common/buffers.c +++ b/common/buffers.c @@ -11,6 +11,8 @@ volatile uint32_t busactive = 0; volatile uint8_t __attribute__((section (".appledata."))) apple_memory[64*1024]; volatile uint8_t __attribute__((section (".appledata."))) private_memory[64*1024]; +volatile uint8_t jumpers = 0; + #ifdef FUNCTION_VGA volatile uint8_t *text_p1 = apple_memory + 0x0400; volatile uint8_t *text_p2 = apple_memory + 0x0800; diff --git a/common/buffers.h b/common/buffers.h index c1b1fa9..4397af8 100644 --- a/common/buffers.h +++ b/common/buffers.h @@ -16,6 +16,8 @@ extern volatile uint8_t cfbuf[4096]; #define config_cmdbuf ((uint8_t*)(apple_memory+0xC0F0+(cardslot<<8))) #define config_rpybuf ((uint8_t*)(apple_memory+0xC0F8+(cardslot<<8))) +extern volatile uint8_t jumpers; + #ifdef FUNCTION_VGA extern volatile uint8_t *text_p1; extern volatile uint8_t *text_p2; diff --git a/common/config.c b/common/config.c index aed9da0..49f7ba4 100644 --- a/common/config.c +++ b/common/config.c @@ -808,6 +808,12 @@ void DELAYED_COPY_CODE(config_handler)() { config_rpybuf[rs++] = HWREV; // '1' break; + case 'j': + // Read jumpers + retval = REPLY_OK; + config_rpybuf[rs++] = jumpers; + break; + case 'd': // Identify Date Request retval = REPLY_OK; diff --git a/common/main.c b/common/main.c index 2b5c9b7..dcd1480 100644 --- a/common/main.c +++ b/common/main.c @@ -35,6 +35,9 @@ static void __noinline __time_critical_func(core1_loop)() { } } +#ifdef ANALOG_GS + jumpers = (value >> 26) & 0x3f; +#endif busactive = 1; if(CARD_SELECT) {