* src/z80/main.c (_parseOptions): fixed the portmode= command line
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 13 Jan 2004 06:31:25 +0000 (06:31 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 13 Jan 2004 06:31:25 +0000 (06:31 +0000)
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

ChangeLog
src/z80/main.c

index 67cde9b2eaa96e4e0083cba7463dc52988085a61..dad429de4370da079131163f81224c558814fc4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-13 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * 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 <epetrich@ivorytower.norman.ok.us>
 
        * device/include/z180.h,
index 0f9faade3bbfef50eb38e54fb9b481074fa3c8ad..44cd21e372a12822924cf40b903877e9b6ea2c31 100644 (file)
@@ -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,