Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coco/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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();
Expand Down
18 changes: 18 additions & 0 deletions src/coco/mount_and_boot.c
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
29 changes: 18 additions & 11 deletions src/coco/pause.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
29 changes: 25 additions & 4 deletions src/coco/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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