From: epetrich Date: Tue, 13 Jan 2004 06:31:25 +0000 (+0000) Subject: * src/z80/main.c (_parseOptions): fixed the portmode= command line X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7702dd8254d5530b7a6b3e102c2e8bcf20dc1269;p=fw%2Fsdcc * src/z80/main.c (_parseOptions): fixed the portmode= command line option so that it actually works. Made it specific to the z80, since the gbz80 doesn't have these kinds of I/O ports. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3131 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 67cde9b2..dad429de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-01-13 Erik Petrich + + * src/z80/main.c (_parseOptions): fixed the portmode= command line + option so that it actually works. Made it specific to the z80, since + the gbz80 doesn't have these kinds of I/O ports. + 2004-01-13 Erik Petrich * device/include/z180.h, diff --git a/src/z80/main.c b/src/z80/main.c index 0f9faade..44cd21e3 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -46,7 +46,13 @@ Z80_OPTS z80_opts; static OPTION _z80_options[] = { { 0, "--callee-saves-bc", &z80_opts.calleeSavesBC, "Force a called function to always save BC" }, - { 80, "--portmode", &z80_opts.port_mode, "Determine PORT I/O mode (z80/z180)" }, + { 0, "--portmode=", NULL, "Determine PORT I/O mode (z80/z180)" }, + { 0, NULL } + }; + +static OPTION _gbz80_options[] = + { + { 0, "--callee-saves-bc", &z80_opts.calleeSavesBC, "Force a called function to always save BC" }, { 0, NULL } }; @@ -304,6 +310,19 @@ _parseOptions (int *pargc, char **argv, int *i) return TRUE; } } + else if (!strncmp (argv[*i], "--portmode=", 11)) + { + if (!strcmp (argv[*i], "--portmode=z80")) + { + z80_opts.port_mode = 80; + return TRUE; + } + else if (!strcmp (argv[*i], "--portmode=z180")) + { + z80_opts.port_mode = 180; + return TRUE; + } + } } return FALSE; } @@ -707,7 +726,7 @@ PORT gbz80_port = "_", _gbz80_init, _parseOptions, - _z80_options, + _gbz80_options, _finaliseOptions, _setDefaultOptions, z80_assignRegisters,