mirror of
https://github.com/cc65/cc65.git
synced 2025-02-06 12:31:12 +00:00
Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1972 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
631aeb2a8d
commit
686f267324
@ -396,7 +396,7 @@ void Convert (const O65Data* D, const char* OutputFile)
|
|||||||
case O65_OS_CC65_MODULE:
|
case O65_OS_CC65_MODULE:
|
||||||
if (Model != O65_MODEL_NONE &&
|
if (Model != O65_MODEL_NONE &&
|
||||||
Model != O65_MODEL_CC65_MODULE) {
|
Model != O65_MODEL_CC65_MODULE) {
|
||||||
Warning ("Wrong o65 model");
|
Warning ("Wrong o65 model for input file specified");
|
||||||
} else {
|
} else {
|
||||||
Model = O65_MODEL_CC65_MODULE;
|
Model = O65_MODEL_CC65_MODULE;
|
||||||
}
|
}
|
||||||
@ -430,7 +430,12 @@ void Convert (const O65Data* D, const char* OutputFile)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the output file */
|
/* If we shouldn't generate output, we're done here */
|
||||||
|
if (NoOutput) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Open the output file */
|
||||||
F = fopen (OutputFile, "wb");
|
F = fopen (OutputFile, "wb");
|
||||||
if (F == 0) {
|
if (F == 0) {
|
||||||
Error ("Cannot open `%s': %s", OutputFile, strerror (errno));
|
Error ("Cannot open `%s': %s", OutputFile, strerror (errno));
|
||||||
|
@ -68,6 +68,7 @@ const char* ZeropageLabel = 0; /* Label for the zeropage segmen
|
|||||||
|
|
||||||
/* Flags */
|
/* Flags */
|
||||||
unsigned char DebugInfo = 0; /* Enable debug info */
|
unsigned char DebugInfo = 0; /* Enable debug info */
|
||||||
|
unsigned char NoOutput = 0; /* Suppress the actual conversion */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ extern const char* ZeropageLabel; /* Label for the zeropage segment */
|
|||||||
|
|
||||||
/* Flags */
|
/* Flags */
|
||||||
extern unsigned char DebugInfo; /* Enable debug info */
|
extern unsigned char DebugInfo; /* Enable debug info */
|
||||||
|
extern unsigned char NoOutput; /* Suppress the actual conversion */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ static void Usage (void)
|
|||||||
" -g\t\t\tAdd debug info to object file\n"
|
" -g\t\t\tAdd debug info to object file\n"
|
||||||
" -h\t\t\tHelp (this text)\n"
|
" -h\t\t\tHelp (this text)\n"
|
||||||
" -m model\t\tOverride the o65 model\n"
|
" -m model\t\tOverride the o65 model\n"
|
||||||
|
" -n\t\t\tDon't generate an output file\n"
|
||||||
" -o name\t\tName the output file\n"
|
" -o name\t\tName the output file\n"
|
||||||
" -v\t\t\tIncrease verbosity\n"
|
" -v\t\t\tIncrease verbosity\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -87,6 +88,7 @@ static void Usage (void)
|
|||||||
" --data-name seg\tSet the name of the DATA segment\n"
|
" --data-name seg\tSet the name of the DATA segment\n"
|
||||||
" --debug-info\t\tAdd debug info to object file\n"
|
" --debug-info\t\tAdd debug info to object file\n"
|
||||||
" --help\t\tHelp (this text)\n"
|
" --help\t\tHelp (this text)\n"
|
||||||
|
" --no-output\t\tDon't generate an output file\n"
|
||||||
" --o65-model model\tOverride the o65 model\n"
|
" --o65-model model\tOverride the o65 model\n"
|
||||||
" --verbose\t\tIncrease verbosity\n"
|
" --verbose\t\tIncrease verbosity\n"
|
||||||
" --version\t\tPrint the version number\n"
|
" --version\t\tPrint the version number\n"
|
||||||
@ -228,6 +230,15 @@ static void OptHelp (const char* Opt attribute ((unused)),
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void OptNoOutput (const char* Opt attribute ((unused)),
|
||||||
|
const char* Arg attribute ((unused)))
|
||||||
|
/* Handle the --no-output option */
|
||||||
|
{
|
||||||
|
NoOutput = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void OptO65Model (const char* Opt attribute ((unused)), const char* Arg)
|
static void OptO65Model (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
/* Handle the --o65-model option */
|
/* Handle the --o65-model option */
|
||||||
{
|
{
|
||||||
@ -314,6 +325,7 @@ int main (int argc, char* argv [])
|
|||||||
{ "--debug", 0, OptDebug },
|
{ "--debug", 0, OptDebug },
|
||||||
{ "--debug-info", 0, OptDebugInfo },
|
{ "--debug-info", 0, OptDebugInfo },
|
||||||
{ "--help", 0, OptHelp },
|
{ "--help", 0, OptHelp },
|
||||||
|
{ "--no-output", 0, OptNoOutput },
|
||||||
{ "--o65-model", 1, OptO65Model },
|
{ "--o65-model", 1, OptO65Model },
|
||||||
{ "--verbose", 0, OptVerbose },
|
{ "--verbose", 0, OptVerbose },
|
||||||
{ "--version", 0, OptVersion },
|
{ "--version", 0, OptVersion },
|
||||||
@ -353,6 +365,10 @@ int main (int argc, char* argv [])
|
|||||||
OptO65Model (Arg, GetArg (&I, 2));
|
OptO65Model (Arg, GetArg (&I, 2));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'n':
|
||||||
|
OptNoOutput (Arg, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'o':
|
case 'o':
|
||||||
OutputName = GetArg (&I, 2);
|
OutputName = GetArg (&I, 2);
|
||||||
break;
|
break;
|
||||||
|
@ -53,7 +53,9 @@ O65Model Model = O65_MODEL_NONE;
|
|||||||
|
|
||||||
/* Name table */
|
/* Name table */
|
||||||
static const char* NameTable[O65_MODEL_COUNT] = {
|
static const char* NameTable[O65_MODEL_COUNT] = {
|
||||||
"none",
|
"none",
|
||||||
|
"os/a65",
|
||||||
|
"lunix",
|
||||||
"cc65-module"
|
"cc65-module"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
O65_MODEL_INVALID = -1, /* Invalid model */
|
O65_MODEL_INVALID = -1, /* Invalid model */
|
||||||
O65_MODEL_NONE, /* No model given */
|
O65_MODEL_NONE, /* No model given */
|
||||||
|
O65_MODEL_OSA65, /* Not implemented */
|
||||||
|
O65_MODEL_LUNIX, /* Not implemented */
|
||||||
O65_MODEL_CC65_MODULE,
|
O65_MODEL_CC65_MODULE,
|
||||||
|
|
||||||
O65_MODEL_COUNT /* Number of available models */
|
O65_MODEL_COUNT /* Number of available models */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user