From 8f4656b7920d37b3f1df5944dfe9307264a52f0b Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 13 Jun 2026 17:19:51 +0100 Subject: Reorganised tape files a bit and select one if none selected when patch is hit --- src/main.c | 49 ++++++++----------------------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a657edb..7e2844e 100644 --- a/src/main.c +++ b/src/main.c @@ -35,6 +35,7 @@ #include "config.h" #include "kbbmp.h" #include "exit.h" +#include "tape.h" #include "util.h" @@ -69,8 +70,6 @@ static void Usage(void) */ int main(int argc, char *argv[]) { - char tape_in[FILENAME_MAX]=""; - char tape_out[FILENAME_MAX]=""; Z80 *z80; SDL_Event *e; int quit; @@ -99,9 +98,6 @@ int main(int argc, char *argv[]) /* Parse switches */ inital_menu=FALSE; - tape_in[0]=0; - tape_out[0]=0; - f=1; while(fkey.state==SDL_PRESSED) - GUIMessage(eMessageBox, - "Mounted Tape Files", - "In: %-20.20s\nOut: %-20.20s", - tape_in[0] ? Basename(tape_in):"None", - tape_out[0] ? Basename(tape_out):"None"); + TAPEDisplayInfo(); break; case SDLK_F8: if (e->key.state==SDL_PRESSED) { - if (GUIFileSelect("TAPE TO LOAD",TRUE, - tape_in[0] ? - Dirname(tape_in) : - SConfig(CONF_TAPEDIR), - tape_in)) - { - SPECMount(SPEC_TAPE_IN,tape_in); - } + TAPESelectInput(); } break; case SDLK_F9: if (e->key.state==SDL_PRESSED) { - if (GUIFileSelect("TAPE TO SAVE",FALSE, - tape_out[0] ? - Dirname(tape_out) : - SConfig(CONF_TAPEDIR), - tape_out)) - { - SPECMount(SPEC_TAPE_OUT,tape_out); - } + TAPESelectOutput(); } break; case SDLK_F10: if (e->key.state==SDL_PRESSED) { - SPECUnmount(SPEC_TAPE_IN); - SPECUnmount(SPEC_TAPE_OUT); + TAPEUnmount(TAP_IN); + TAPEUnmount(TAP_OUT); } break; -- cgit v1.3