From: cuz Date: Wed, 30 Mar 2005 19:28:28 +0000 (+0000) Subject: Fixed numeric OS ids. Added new OS OPENCBM X-Git-Tag: V2.12.0~404 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d194bdd70217154260154bd8fbf07964735c6aea;p=cc65 Fixed numeric OS ids. Added new OS OPENCBM git-svn-id: svn://svn.cc65.org/cc65/trunk@3435 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ld65/config.c b/src/ld65/config.c index 9f9fba2c6..6762ac0da 100644 --- a/src/ld65/config.c +++ b/src/ld65/config.c @@ -865,6 +865,7 @@ static void ParseO65 (void) { "LUNIX", CFGTOK_LUNIX }, { "OSA65", CFGTOK_OSA65 }, { "CC65", CFGTOK_CC65 }, + { "OPENCBM", CFGTOK_OPENCBM }, }; /* Bitmask to remember the attributes we got already */ @@ -976,10 +977,11 @@ static void ParseO65 (void) } else { CfgSpecialToken (OperatingSystems, ENTRY_COUNT (OperatingSystems), "OS type"); switch (CfgTok) { - case CFGTOK_LUNIX: OS = O65OS_LUNIX; break; - case CFGTOK_OSA65: OS = O65OS_OSA65; break; - case CFGTOK_CC65: OS = O65OS_CC65; break; - default: CfgError ("Unexpected OS token"); + case CFGTOK_LUNIX: OS = O65OS_LUNIX; break; + case CFGTOK_OSA65: OS = O65OS_OSA65; break; + case CFGTOK_CC65: OS = O65OS_CC65; break; + case CFGTOK_OPENCBM: OS = O65OS_OPENCBM; break; + default: CfgError ("Unexpected OS token"); } } break; diff --git a/src/ld65/o65.c b/src/ld65/o65.c index 49c024378..714931308 100644 --- a/src/ld65/o65.c +++ b/src/ld65/o65.c @@ -1155,11 +1155,6 @@ void O65SetOS (O65Desc* D, unsigned OS, unsigned Version, unsigned Id) /* Write the correct option length */ switch (OS) { - case O65OS_OSA65: - case O65OS_LUNIX: - /* No id for these two */ - O65SetOption (D, O65OPT_OS, Opt, 2); - break; case O65OS_CC65: /* Set the 16 bit id */ @@ -1169,7 +1164,10 @@ void O65SetOS (O65Desc* D, unsigned OS, unsigned Version, unsigned Id) break; default: - Internal ("Trying to set invalid O65 operating system: %u", OS); + /* No id for OS/A65, Lunix, and unknown OSes */ + O65SetOption (D, O65OPT_OS, Opt, 2); + break; + } } diff --git a/src/ld65/o65.h b/src/ld65/o65.h index d9e8832f8..aec220a3c 100644 --- a/src/ld65/o65.h +++ b/src/ld65/o65.h @@ -66,6 +66,7 @@ typedef struct O65Desc O65Desc; #define O65OS_OSA65 1 #define O65OS_LUNIX 2 #define O65OS_CC65 3 +#define O65OS_OPENCBM 4 #define O65OS_MAX 255 diff --git a/src/ld65/scanner.h b/src/ld65/scanner.h index 5604f59ed..e7a943257 100644 --- a/src/ld65/scanner.h +++ b/src/ld65/scanner.h @@ -105,6 +105,7 @@ typedef enum { CFGTOK_LUNIX, CFGTOK_OSA65, CFGTOK_CC65, + CFGTOK_OPENCBM, CFGTOK_CONDES, CFGTOK_STARTADDRESS,