From a9899eba158dc8da33784ed25cf3f374209355b1 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 16 Feb 2003 14:32:13 +0000 Subject: [PATCH] Added a new extended (and machine specific) zeropage segment named EXTZP. Renamed GEOSZP to EXTZP. Added a --dump-config command that dumps a builtin linker config. git-svn-id: svn://svn.cc65.org/cc65/trunk@1987 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ld65/cfg/cbm510.cfg | 3 ++- src/ld65/cfg/cbm610.cfg | 3 ++- src/ld65/cfg/geos.cfg | 2 +- src/ld65/cfg/module.cfg | 1 + src/ld65/error.c | 20 ++++++++++++-------- src/ld65/main.c | 25 +++++++++++++++++++++---- src/ld65/tgtcfg.c | 31 ++++++++++++++++++++++++++----- src/ld65/tgtcfg.h | 22 +++++++++++++++++----- 8 files changed, 82 insertions(+), 25 deletions(-) diff --git a/src/ld65/cfg/cbm510.cfg b/src/ld65/cfg/cbm510.cfg index 777cbb66b..f11e5cc7b 100644 --- a/src/ld65/cfg/cbm510.cfg +++ b/src/ld65/cfg/cbm510.cfg @@ -1,5 +1,5 @@ MEMORY { - ZP: start = $02, size = $1A, type = rw, define = yes; + ZP: start = $02, size = $8E, type = rw, define = yes; RAM: start = $0001, size = $DFFF, file = %O; CHARRAM: start = $E000, size = $1000, define = yes, file = ""; VIDRAM: start = $F000, size = $0400, define = yes, file = ""; @@ -10,6 +10,7 @@ SEGMENTS { DATA: load = RAM, type = rw; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; + EXTZP: load = ZP, type = zp, define = yes; } FEATURES { CONDES: segment = RODATA, diff --git a/src/ld65/cfg/cbm610.cfg b/src/ld65/cfg/cbm610.cfg index 2c58eb14d..b8a4c2305 100644 --- a/src/ld65/cfg/cbm610.cfg +++ b/src/ld65/cfg/cbm610.cfg @@ -1,5 +1,5 @@ MEMORY { - ZP: start = $02, size = $1A, type = rw, define = yes; + ZP: start = $02, size = $8E, type = rw, define = yes; RAM: start = $0001, size = $FFF0, file = %O; } SEGMENTS { @@ -8,6 +8,7 @@ SEGMENTS { DATA: load = RAM, type = rw; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; + EXTZP: load = ZP, type = zp, define = yes; } FEATURES { CONDES: segment = RODATA, diff --git a/src/ld65/cfg/geos.cfg b/src/ld65/cfg/geos.cfg index 6e161c9ec..4eb0ef038 100644 --- a/src/ld65/cfg/geos.cfg +++ b/src/ld65/cfg/geos.cfg @@ -12,7 +12,7 @@ SEGMENTS { DATA: load = RAM, type = rw; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; - GEOSZP: load = ZP, type = zp; + EXTZP: load = ZP, type = zp; } FEATURES { CONDES: segment = RODATA, diff --git a/src/ld65/cfg/module.cfg b/src/ld65/cfg/module.cfg index 7783f995a..613716ff6 100644 --- a/src/ld65/cfg/module.cfg +++ b/src/ld65/cfg/module.cfg @@ -9,6 +9,7 @@ SEGMENTS { DATA: load = COMBINED, type = rw, define = yes; BSS: load = COMBINED, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; + EXTZP: load = ZP, type = zp; } FILES { %O: format = o65; diff --git a/src/ld65/error.c b/src/ld65/error.c index fa049488b..807a48cae 100644 --- a/src/ld65/error.c +++ b/src/ld65/error.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 1998-2000 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 1998-2003 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -36,7 +36,11 @@ #include #include #include + +/* common */ +#include "cmdline.h" +/* ld65 */ #include "error.h" @@ -52,7 +56,7 @@ void Warning (const char* Format, ...) { va_list ap; va_start (ap, Format); - fprintf (stderr, "Warning: "); + fprintf (stderr, "%s: Warning: ", ProgName); vfprintf (stderr, Format, ap); putc ('\n', stderr); va_end (ap); @@ -65,7 +69,7 @@ void Error (const char* Format, ...) { va_list ap; va_start (ap, Format); - fprintf (stderr, "Error: "); + fprintf (stderr, "%s: Error: ", ProgName); vfprintf (stderr, Format, ap); putc ('\n', stderr); va_end (ap); @@ -79,7 +83,7 @@ void Internal (const char* Format, ...) { va_list ap; va_start (ap, Format); - fprintf (stderr, "Internal error: "); + fprintf (stderr, "%s: Internal error: ", ProgName); vfprintf (stderr, Format, ap); putc ('\n', stderr); va_end (ap); @@ -87,4 +91,4 @@ void Internal (const char* Format, ...) } - + diff --git a/src/ld65/main.c b/src/ld65/main.c index 76a2e9f7e..489ac5cb9 100644 --- a/src/ld65/main.c +++ b/src/ld65/main.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 1998-2002 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 1998-2003 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -103,6 +103,7 @@ static void Usage (void) "\n" "Long options:\n" " --config name\t\tUse linker config file\n" + " --dump-config name\tDump a builtin configuration\n" " --help\t\tHelp (this text)\n" " --mapfile name\tCreate a map file\n" " --module-id id\tSpecify a module id\n" @@ -236,6 +237,21 @@ static void OptDbgFile (const char* Opt attribute ((unused)), const char* Arg) +static void OptDumpConfig (const char* Opt attribute ((unused)), const char* Arg) +/* Dump a builtin linker configuration */ +{ + /* Map the given target name to its id */ + target_t T = FindTarget (Arg); + if (T == TGT_UNKNOWN) { + Error ("Target system `%s' is unknown", Arg); + } + + /* Dump the builtin configuration */ + DumpBuiltinConfig (stdout, T); +} + + + static void OptHelp (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print usage information and exit */ @@ -314,6 +330,7 @@ int main (int argc, char* argv []) static const LongOpt OptTab[] = { { "--config", 1, OptConfig }, { "--dbgfile", 1, OptDbgFile }, + { "--dump-config", 1, OptDumpConfig }, { "--help", 0, OptHelp }, { "--mapfile", 1, OptMapFile }, { "--module-id", 1, OptModuleId }, diff --git a/src/ld65/tgtcfg.c b/src/ld65/tgtcfg.c index aac9005c5..219ce9302 100644 --- a/src/ld65/tgtcfg.c +++ b/src/ld65/tgtcfg.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 1998-2002 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 1998-2003 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -33,6 +33,10 @@ +/* common */ +#include "check.h" + +/* ld65 */ #include "binfmt.h" #include "tgtcfg.h" @@ -96,4 +100,21 @@ const TargetDesc Targets [TGT_COUNT] = { - +/*****************************************************************************/ +/* Code */ +/*****************************************************************************/ + + + +void DumpBuiltinConfig (FILE* F, target_t T) +/* Dump a builtin linker configuration */ +{ + /* Check the given parameter */ + PRECONDITION (T > TGT_UNKNOWN && T < TGT_COUNT); + + /* Dump the config */ + fprintf (F, "%s\n", Targets[T].Cfg); +} + + + diff --git a/src/ld65/tgtcfg.h b/src/ld65/tgtcfg.h index d60711c73..c37e2f313 100644 --- a/src/ld65/tgtcfg.h +++ b/src/ld65/tgtcfg.h @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 1998-2000 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 1998-2003 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -38,6 +38,8 @@ +#include + /* common */ #include "target.h" @@ -61,8 +63,18 @@ extern const TargetDesc Targets [TGT_COUNT]; -/* End of tgtcfg.h */ +/*****************************************************************************/ +/* Code */ +/*****************************************************************************/ + + +void DumpBuiltinConfig (FILE* F, target_t T); +/* Dump a builtin linker configuration */ + + + +/* End of tgtcfg.h */ #endif -- 2.39.5