[hatari-devel] Wii port

Eero Tamminen eerot at users.berlios.de
Sun Jan 18 18:16:56 CET 2009


Hi,

On Saturday 17 January 2009, Yohanes Nugroho wrote:
> I have uploaded a patch for running Hatari on the Wii console to berlios.
>
> I have released a port from the mercurial version on my website
> (http://tinyhack.com) for testing, and so far there is no problem in
> Hatari code. There are some problems in the SDL port for Wii, for
> example: it only support 32 bit resolution correctly, but once i fixed
> that (I am working on the SDL port) everything will be fine.  In the
> version that i released, I added  "Wii Version (http://tinyhack.com)"
> in the about , just to make sure that people who have questions for
> the Wii version will ask me instead of the official page. If this
> patch is accepted, I can write a description in hatari's homepage or
> just make a link to my homepage.

It needs some work first. Ifdefs should be avoided and if they're needed,
they should prefereably be specific to some feature, not a platform.  For
example:


* why things like these are "GEKKO"(?) specific:
---------------
+ifneq ($(GEKKO), 1)
 	$(MAKE) -C tools/hmsa/
+endif
---------------
?


* There shouldn't be a need for separate config-*.h file.  Add a suitable
  feature ifdef to the default one and define the needed thing in
  the Makefile-wii.cnf compiler options.


* Why binary name cannot be "Hatari":
-------------------------------
+ifneq ($(GEKKO), 1)
 all: hatari
+else
+all: hatari.dol
+endif
-------------------------------
?


* It would be better that there were a define for path prefix in one place
  e.g. in the paths.h and the code modified to take advantage of that.
-------------------------------
+#ifdef GEKKO
+	strcpy(sConfigFileName, "fat3:/apps/hatari/hatari.cfg");
+#else
...
+#ifdef GEKKO
+	strcpy(nvram_filename, "fat3:/apps/hatari/hatari.nvram");
+#else
...
+#ifdef GEKKO
+	strcpy(psGlobalConfig, "fat3:/apps/hatari/hatari.cfg");
+#else
------------------------------
(this may need a bit larger patch and cleaning up some Amiga stuff too)


* Ifdef should be about required feature (fileno()? select()?):
------------------------------
 bool File_InputAvailable(FILE *fp)
 {
+
+#ifndef GEKKO
------------------------------


* These wii.* files don't seem to have anything Wii specific, so some more
  generic define and file name should be used:
------------------------------
-  unzip.c utils.c vdi.c video.c wavFormat.c xbios.c ymFormat.c zip.c
+  unzip.c utils.c vdi.c video.c wavFormat.c xbios.c ymFormat.c zip.c \
+	wii.c
...
+#ifdef GEKKO
+#include "wii.h"
+#endif
------------------------------


* Maybe you could instead of this put "Wii" into the version string
  (in HG version normally "devel", so it could be "Wii-devel"):
-----------------------------
+#ifndef GEKKO
 	{ SGTEXT, 0, 0, 14,2, 12,1, "============" },
+#else
+	{ SGTEXT, 0, 0, 1,2, 38,1, "Wii Version (http://tinyhack.com)" },
+#endif
-----------------------------
Thomas, maybe the Hatari name/version should be centralized in the about 
dialog?


* I don't think we want kludges around devel SDL version bugs,
  your version of SDL should be fixed instead:
-----------------------------
+#ifdef GEKKO
+			//delay to make the message visible
+			SDL_Delay(2000);
+#endif
...
+#ifdef GEKKO	
+	SDL_ShowCursor(SDL_DISABLE);
+#endif
...
+#ifdef GEKKO
+		SDL_Flip(pSdlGuiScrn);
+#endif
-----------------------------


* Default settings are handled by providing a suitable configuration file
  to Hatari etc/ directory, not by hard-coding them into source code:
-----------------------------
+#ifndef GEKKO
+			 Main_RequestQuit();
+#else
+			 //in Wii, home button is mapped to quit
+			Dialog_DoProperty();           /* Show options dialog */
+#endif
...
+#ifdef GEKKO
+		//currently SDL port for wii only handle this bit depth correctly 
+		BitCount = 32;
+#endif
-----------------------------


	- Eero



More information about the hatari-devel mailing list