From 98cdbaba4bad9ef0cea8104b0c4451842600dac7 Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 12 Aug 2003 11:01:46 +0000 Subject: [PATCH] Allow a CPU spec in the GLOBAL section of the info file git-svn-id: svn://svn.cc65.org/cc65/trunk@2269 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/da65/infofile.c | 14 ++++++++++++++ src/da65/scanner.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/da65/infofile.c b/src/da65/infofile.c index c9e0863aa..eef73cde1 100644 --- a/src/da65/infofile.c +++ b/src/da65/infofile.c @@ -44,6 +44,7 @@ #endif /* common */ +#include "cpu.h" #include "xmalloc.h" /* da65 */ @@ -51,6 +52,7 @@ #include "error.h" #include "global.h" #include "infofile.h" +#include "opctable.h" #include "scanner.h" @@ -65,6 +67,7 @@ static void GlobalSection (void) /* Parse a global section */ { static const IdentTok GlobalDefs[] = { + { "CPU", INFOTOK_CPU }, { "INPUTNAME", INFOTOK_INPUTNAME }, { "OUTPUTNAME", INFOTOK_OUTPUTNAME }, { "PAGELENGTH", INFOTOK_PAGELENGTH }, @@ -86,6 +89,17 @@ static void GlobalSection (void) /* Look at the token */ switch (InfoTok) { + case INFOTOK_CPU: + InfoNextTok (); + InfoAssureStr (); + if (CPU != CPU_UNKNOWN) { + InfoError ("CPU already specified"); + } + CPU = FindCPU (InfoSVal); + SetOpcTable (CPU); + InfoNextTok (); + break; + case INFOTOK_INPUTNAME: InfoNextTok (); InfoAssureStr (); diff --git a/src/da65/scanner.h b/src/da65/scanner.h index 529b0aa13..d26f191e2 100644 --- a/src/da65/scanner.h +++ b/src/da65/scanner.h @@ -65,6 +65,7 @@ typedef enum token_t { INFOTOK_LABEL, /* Global section */ + INFOTOK_CPU, INFOTOK_INPUTNAME, INFOTOK_OUTPUTNAME, INFOTOK_PAGELENGTH, -- 2.39.5