From: cuz Date: Fri, 10 Oct 2003 17:08:08 +0000 (+0000) Subject: Use common code to determine the CPU X-Git-Tag: V2.12.0~1274 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e24853a8fda95c929ecfb8219f60c1a146c41b6d;p=cc65 Use common code to determine the CPU git-svn-id: svn://svn.cc65.org/cc65/trunk@2502 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/main.c b/src/ca65/main.c index e758680c1..047c37b02 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -200,18 +200,11 @@ static void OptAutoImport (const char* Opt attribute ((unused)), static void OptCPU (const char* Opt attribute ((unused)), const char* Arg) /* Handle the --cpu option */ { - if (strcmp (Arg, "6502") == 0) { - SetCPU (CPU_6502); - } else if (strcmp (Arg, "65C02") == 0) { - SetCPU (CPU_65C02); - } else if (strcmp (Arg, "65816") == 0) { - SetCPU (CPU_65816); -#ifdef SUNPLUS - } else if (strcmp (Arg, "sunplus") == 0) { - SetCPU (CPU_SUNPLUS); -#endif - } else { + cpu_t CPU = FindCPU (Arg); + if (CPU == CPU_UNKNOWN) { AbEnd ("Invalid CPU: `%s'", Arg); + } else { + SetCPU (CPU); } }