"Short options:\n"\r
" -V\t\t\tPrint the version number\n"\r
" -h\t\t\tHelp (this text)\n"\r
+ " -n\t\tNo automatic start after loading program\n"\r
" -o name\t\tName the C1P output file (default: <input>.c1p)\n"\r
" -S addr\t\tLoad address (default 0x300)\n"\r
"\n"\r
}\r
\r
/* Commands of C1P PROM monitor */\r
-#define ADDRESS_MODE_CMD '.'\r
-#define DATA_MODE_CMD '/'\r
-#define EXECUTE_CMD 'G'\r
+#define ADDRESS_MODE_CMD '.'\r
+#define DATA_MODE_CMD '/'\r
+#define EXECUTE_CMD 'G'\r
#define DATA_MODE_ADDRESS 0x00FB\r
\r
/* Transform the cc65 executable binary into a series of\r
commands that make the C1P PROM monitor load the bytes\r
into memory.\r
*/\r
-static void Transform (unsigned long StartAddress, FILE *In, FILE *Out)\r
+static void Transform (unsigned long StartAddress, FILE *In, FILE *Out,\r
+ unsigned AutoStart)\r
{\r
int c;\r
\r
fprintf(Out, "%02.2X\n", (unsigned int) c & 0xFF);\r
}\r
\r
- /* Store 00 to 0x00FB to enable keyboard input at the end */\r
- fprintf(Out, "%c%04.4X%c%02.2X\n", ADDRESS_MODE_CMD,\r
- 0x00FB, DATA_MODE_CMD, 0x00);\r
-\r
- /* And execute\r
- fprintf (Out, "%c%04.4x%c",\r
+ if (AutoStart) {\r
+ /* Execute */\r
+ fprintf (Out, "%c%04.4x%c",\r
ADDRESS_MODE_CMD, (unsigned int) StartAddress & 0xFFFF,\r
EXECUTE_CMD);\r
- */\r
+ }\r
+ else {\r
+ /* Store 00 to 0x00FB to enable keyboard input at the end */\r
+ fprintf(Out, "%c%04.4X%c%02.2X\n", ADDRESS_MODE_CMD,\r
+ 0x00FB, DATA_MODE_CMD, 0x00);\r
+ }\r
} \r
\r
/* Default suffix for C1P object file */\r
/* Initialize with default start address defined in c1p.cfg */\r
unsigned long StartAddr = 0x300;\r
\r
+ /* Start program automatically after loading */\r
+ unsigned AutoStart = 1;\r
+\r
unsigned int I;\r
\r
/* Initialize the cmdline module */\r
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));\r
break;\r
\r
- case 'o':\r
- OutputFile = GetArg (&I, 2);\r
- break;\r
+ case 'n':\r
+ AutoStart = 0;\r
+ break;\r
+\r
+ case 'o':\r
+ OutputFile = GetArg(&I, 2);\r
+ break;\r
\r
- case 'S':\r
+ case 'S':\r
StartAddr = CvtNumber (Arg, GetArg (&I, 2));\r
break;\r
\r
if (!OutputFileFp) AbEnd ("Unable to open output file");\r
\r
/* Generate object file */\r
- Transform (StartAddr, InputFileFp, OutputFileFp);\r
+ Transform (StartAddr, InputFileFp, OutputFileFp, AutoStart);\r
\r
/* Cleanup */\r
if (fclose(InputFileFp) == EOF) AbEnd ("Error closing input file");\r