From 0f8fb4d79d4fd91bea2f8659e0eabdc1db2b2de2 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 29 Jan 2017 22:39:51 +0100 Subject: [PATCH] Merge with current version --- cfg/telemon30.cfg | 43 +++++++++++++++++++++++++++++++++++++++++++ src/ca65/main.c | 13 +++++++++---- src/cc65/main.c | 11 ++++++----- src/common/target.c | 2 ++ src/common/target.h | 1 + 5 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 cfg/telemon30.cfg diff --git a/cfg/telemon30.cfg b/cfg/telemon30.cfg new file mode 100644 index 000000000..b9f0b4026 --- /dev/null +++ b/cfg/telemon30.cfg @@ -0,0 +1,43 @@ +SYMBOLS { + + __ORIXHDR__: type = import; + + __STACKSIZE__: type = weak, value = $0800; # 2K stack + + __RAMEND__: type = weak, value = $9800; +} +MEMORY { + ZP: file = "", define = yes, start = $00E0, size = $001A; + ORIXHDR: file = %O, type = ro, start = $0000, size = $001F; + BASHEAD: file = %O, define = yes, start = $0801, size = $000D; + MAIN: file = %O, define = yes, start = __BASHEAD_LAST__, size = __RAMEND__ - __MAIN_START__; + BSS: file = "", start = __ONCE_RUN__, size = __RAMEND__ - __STACKSIZE__ - __ONCE_RUN__; +} +SEGMENTS { + ZEROPAGE: load = ZP, type = zp; + ORIXHDR: load = ORIXHDR, type = ro; + STARTUP: load = MAIN, type = ro; + LOWCODE: load = MAIN, type = ro, optional = yes; + CODE: load = MAIN, type = ro; + RODATA: load = MAIN, type = ro; + DATA: load = MAIN, type = rw; + INIT: load = MAIN, type = rw; + ONCE: load = MAIN, type = ro, define = yes; + BASTAIL: load = MAIN, type = ro, optional = yes; + BSS: load = BSS, type = bss, define = yes; +} +FEATURES { + CONDES: type = constructor, + label = __CONSTRUCTOR_TABLE__, + count = __CONSTRUCTOR_COUNT__, + segment = ONCE; + CONDES: type = destructor, + label = __DESTRUCTOR_TABLE__, + count = __DESTRUCTOR_COUNT__, + segment = RODATA; + CONDES: type = interruptor, + label = __INTERRUPTOR_TABLE__, + count = __INTERRUPTOR_COUNT__, + segment = RODATA, + import = __CALLIRQ__; +} diff --git a/src/ca65/main.c b/src/ca65/main.c index 4aa60f2f0..91f652811 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -222,6 +222,10 @@ static void SetSys (const char* Sys) CBMSystem ("__C16__"); break; + case TGT_C65: + CBMSystem("__C65__"); + break; + case TGT_C64: CBMSystem ("__C64__"); break; @@ -623,11 +627,12 @@ static void OptVerbose (const char* Opt attribute ((unused)), -static void OptVersion (const char* Opt attribute ((unused)), - const char* Arg attribute ((unused))) -/* Print the assembler version */ +static void OptVersion(const char* Opt attribute((unused)), + const char* Arg attribute((unused))) + /* Print the assembler version */ { - fprintf (stderr, "ca65 V%s\n", GetVersionAsString ()); + fprintf(stderr, "%s V%s\n", ProgName, GetVersionAsString()); + exit(EXIT_SUCCESS); } diff --git a/src/cc65/main.c b/src/cc65/main.c index f25a44d69..b7abf959c 100644 --- a/src/cc65/main.c +++ b/src/cc65/main.c @@ -746,12 +746,13 @@ static void OptVerbose (const char* Opt attribute ((unused)), -static void OptVersion (const char* Opt attribute ((unused)), - const char* Arg attribute ((unused))) -/* Print the compiler version */ + +static void OptVersion(const char* Opt attribute((unused)), + const char* Arg attribute((unused))) + /* Print the compiler version */ { - fprintf (stderr, "cc65 V%s\n", GetVersionAsString ()); - exit (EXIT_SUCCESS); + fprintf(stderr, "%s V%s\n", ProgName, GetVersionAsString()); + exit(EXIT_SUCCESS); } diff --git a/src/common/target.c b/src/common/target.c index adbc080bf..31274d48a 100644 --- a/src/common/target.c +++ b/src/common/target.c @@ -209,6 +209,8 @@ static const TargetProperties PropertyTable[TGT_COUNT] = { { "sim65c02", CPU_65C02, BINFMT_BINARY, CTNone }, { "pce", CPU_HUC6280, BINFMT_BINARY, CTNone }, { "gamate", CPU_6502, BINFMT_BINARY, CTNone }, + { "c65", CPU_4510, BINFMT_BINARY, CTPET }, + }; /* Target system */ diff --git a/src/common/target.h b/src/common/target.h index 4bc00225d..93bcfe20d 100644 --- a/src/common/target.h +++ b/src/common/target.h @@ -82,6 +82,7 @@ typedef enum { TGT_SIM65C02, TGT_PCENGINE, TGT_GAMATE, + TGT_C65, TGT_COUNT /* Number of target systems */ } target_t; -- 2.39.2