summaryrefslogtreecommitdiff
path: root/int2tap.c
diff options
context:
space:
mode:
Diffstat (limited to 'int2tap.c')
-rw-r--r--int2tap.c61
1 files changed, 59 insertions, 2 deletions
diff --git a/int2tap.c b/int2tap.c
index b2fba26..2c3eae9 100644
--- a/int2tap.c
+++ b/int2tap.c
@@ -34,6 +34,7 @@ static const char id[]="$Id$";
#include "intel.h"
#include "tap.h"
+#include "basic.h"
/* ---------------------------------------- GLOBALS
@@ -53,6 +54,7 @@ static void Usage(void)
{
fprintf(stderr,"%s: usage %s [ -b ] [ -s ] [ -a address ] "
"output-file input-file ... \n",progname,progname);
+ exit(EXIT_FAILURE);
}
@@ -158,9 +160,15 @@ int main(int argc, char *argv[])
printf("Memory altered from 0x%4.4x for 0x%4.4x bytes, base 0x%4.4x\n",
info[f].low,info[f].len,info[f].addr);
+
+ if (!addr_defined)
+ {
+ exec_addr=info[f].addr;
+ addr_defined=TRUE;
+ }
}
- /* TODO: Properly - just a quick test
+ /* Create the tape
*/
printf("Creating %s\n",outname);
@@ -170,7 +178,56 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- TapWrite(mem,info[0].low,info[0].len,TRUE);
+ /* Create the basic loader
+ */
+ if (!bin_only)
+ {
+ BasicInit();
+
+ BasicLoadLine();
+
+ if (split)
+ {
+ for(f=1;f<no;f++)
+ {
+ BasicLoadLine();
+ }
+ }
+
+ BasicRandUsr(exec_addr);
+
+ TapBasic(BasicBase(),BasicLength(),10);
+ }
+
+ /* Create the binary files
+ */
+ if (split)
+ {
+ for(f=0;f<no;f++)
+ {
+ TapBinary(mem,info[f].low,info[f].len);
+ }
+ }
+ else
+ {
+ unsigned low=0xffff;
+ unsigned high=0x0000;
+
+ for(f=0;f<no;f++)
+ {
+ if (info[f].low<low)
+ {
+ low=info[f].low;
+ }
+
+ if (info[f].high>high)
+ {
+ high=info[f].high;
+ }
+ }
+
+ TapBinary(mem,low,high-low+1);
+ }
TapClose();