summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c49
1 files changed, 8 insertions, 41 deletions
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(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;