diff options
| author | Ian C <ianc@noddybox.co.uk> | 2026-06-13 17:19:51 +0100 |
|---|---|---|
| committer | Ian C <ianc@noddybox.co.uk> | 2026-06-13 17:19:51 +0100 |
| commit | 8f4656b7920d37b3f1df5944dfe9307264a52f0b (patch) | |
| tree | e5540480b3e8aced36c7c1f738f90d26c685e103 /src/main.c | |
| parent | 24a7e3ac0103979dcef910f0b87f3eea234d2353 (diff) | |
Reorganised tape files a bit and select one if none selected when patch is hit
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 49 |
1 files changed, 8 insertions, 41 deletions
@@ -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(f<argc && argv[f][0]=='-') @@ -118,7 +114,7 @@ int main(int argc, char *argv[]) Usage(); } - strcpy(tape_in,argv[++f]); + TAPEMount(TAP_IN, argv[++f]); break; case 's': @@ -127,7 +123,7 @@ int main(int argc, char *argv[]) Usage(); } - strcpy(tape_out,argv[++f]); + TAPEMount(TAP_OUT, argv[++f]); break; default: @@ -143,16 +139,6 @@ int main(int argc, char *argv[]) quit=MemoryMenu(z80); } - if (tape_in[0]) - { - SPECMount(SPEC_TAPE_IN,tape_in); - } - - if (tape_out[0]) - { - SPECMount(SPEC_TAPE_IN,tape_out); - } - /* Main loop */ while(!quit) @@ -233,48 +219,29 @@ int main(int argc, char *argv[]) break; case SDLK_F4: - if (e->key.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; |
