From af8d1018ca02bd0e8e677ac17652e11172f64132 Mon Sep 17 00:00:00 2001 From: Rich Stephens Date: Sun, 26 Oct 2025 09:38:42 -0400 Subject: [PATCH 1/2] CoCo: Fixed pause to be (properly) ticks instead of seconds --- src/coco/pause.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/coco/pause.c b/src/coco/pause.c index a2123f49..3e4e0490 100644 --- a/src/coco/pause.c +++ b/src/coco/pause.c @@ -9,21 +9,28 @@ void pause(unsigned char delay) { -#ifdef DRAGON -asm -{ - // We come here from a JMP $C000 in Color Basic (normally at - // $A10A in v1.2). At this point, the 60 Hz interrupt has - // not been enabled yet, so enable it. - lda $FF03 // get control register of PIA0, port B +#ifdef DRAGON + asm + { + // We come here from a JMP $C000 in Color Basic (normally at + // $A10A in v1.2). At this point, the 60 Hz interrupt has + // not been enabled yet, so enable it. + lda $FF03 // get control register of PIA0, port B ora #1 - sta $FF03 // enable 60 Hz interrupt + sta $FF03 // enable 60 Hz interrupt - // Unmask interrupts to allow the timer IRQ to be processed. + // Unmask interrupts to allow the timer IRQ to be processed. andcc #$AF -} + } #endif - sleep(delay/20); + + if (!delay) + { + return; + } + + setTimer(0); + while (getTimer() < delay); } #endif /* _CMOC_VERSION */ From 1c629d24fd8f4c981d75068c24359cc9aa1e14ce Mon Sep 17 00:00:00 2001 From: Rich Stephens Date: Tue, 28 Oct 2025 09:48:17 -0400 Subject: [PATCH 2/2] CoCo: Implement lobby command --- src/coco/input.c | 8 ++++++++ src/coco/mount_and_boot.c | 18 ++++++++++++++++++ src/coco/screen.c | 29 +++++++++++++++++++++++++---- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/coco/input.c b/src/coco/input.c index d3ae6f07..785e0bb4 100644 --- a/src/coco/input.c +++ b/src/coco/input.c @@ -284,6 +284,10 @@ HDSubState input_hosts_and_devices_hosts(void) bar_jump(selected_host_slot); k = 0; return HD_HOSTS; + case 'l': + case 'L': + mount_and_boot_lobby(); + return HD_HOSTS; case '1': case '2': case '3': @@ -316,6 +320,10 @@ HDSubState input_hosts_and_devices_devices(void) case 'e': hosts_and_devices_eject((byte)bar_get()); break; + case 'L': + case 'l': + mount_and_boot_lobby(); + return HD_DEVICES; case 'R': case 'r': selected_device_slot = (byte)bar_get(); diff --git a/src/coco/mount_and_boot.c b/src/coco/mount_and_boot.c index 0212e0ab..9d14d458 100644 --- a/src/coco/mount_and_boot.c +++ b/src/coco/mount_and_boot.c @@ -1,10 +1,28 @@ #ifdef _CMOC_VERSION_ #include "mount_and_boot.h" +#include "../screen.h" #include "../typedefs.h" +#include "../globals.h" void mount_and_boot_lobby(void) { + if (screen_mount_and_boot_lobby()) + { + fuji_set_boot_mode(2); + system_boot(); + } + else + { + if (hd_subState == HD_HOSTS) + { + screen_hosts_and_devices_hosts(); + } + else if (hd_subState == HD_DEVICES) + { + screen_hosts_and_devices_devices(); + } + } } void mount_and_boot(void) diff --git a/src/coco/screen.c b/src/coco/screen.c index f9153637..e6fd3da5 100644 --- a/src/coco/screen.c +++ b/src/coco/screen.c @@ -571,14 +571,35 @@ void screen_connect_wifi(NetConfig *nc) screen_add_shadow(9,BLUE); // change to CYAN } +bool screen_mount_and_boot_lobby(void) +{ + unsigned char k; + + // Confirm we want to go to there + locate(0, 15); + printf(" BOOT TO LOBBY? y/n"); + + k = waitkey(true); + + switch (k) + { + case 'Y': + case 'y': + return true; + default: + return false; + } +} + void screen_end(void) { - // Restore the original casing flag. - asm { + // Restore the original casing flag. + asm + { lda orig_casflag sta $011A - } - return; + } + return; } #endif