[Scummvm-cvs-logs] SF.net SVN: scummvm:[35499] scummvm/trunk/backends/platform/wii

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Tue Dec 23 20:16:41 CET 2008


Revision: 35499
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35499&view=rev
Author:   dhewg
Date:     2008-12-23 19:16:38 +0000 (Tue, 23 Dec 2008)

Log Message:
-----------
changes for devkitPPC r16

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wii/Makefile
    scummvm/trunk/backends/platform/wii/main.cpp

Removed Paths:
-------------
    scummvm/trunk/backends/platform/wii/gecko_console.cpp
    scummvm/trunk/backends/platform/wii/gecko_console.h

Modified: scummvm/trunk/backends/platform/wii/Makefile
===================================================================
--- scummvm/trunk/backends/platform/wii/Makefile	2008-12-23 17:20:01 UTC (rev 35498)
+++ scummvm/trunk/backends/platform/wii/Makefile	2008-12-23 19:16:38 UTC (rev 35499)
@@ -59,7 +59,6 @@
 AR      = $(PREFIX)ar cru
 RANLIB  = $(PREFIX)ranlib
 STRIP   = $(PREFIX)strip -g
-OBJCOPY = $(PREFIX)objcopy
 MKDIR   = mkdir -p
 RM      = rm -f
 CP      = cp -f
@@ -125,7 +124,6 @@
 endif
 
 OBJS := backends/platform/wii/main.o \
-		backends/platform/wii/gecko_console.o \
 		backends/platform/wii/gx_supp.o \
 		backends/platform/wii/osystem.o \
 		backends/platform/wii/osystem_gfx.o \
@@ -139,7 +137,7 @@
 all: $(TARGET).dol
 
 $(TARGET).dol: $(TARGET).elf
-	$(OBJCOPY) -O binary $< $@
+	$(DEVKITPPC)/bin/elf2dol $< $@
 
 $(TARGET).elf: $(OBJS)
 	$(LD) $^ $(LDFLAGS) $(LIBS) -o $@
@@ -154,7 +152,7 @@
 distclean-wii:
 	@-$(RM) dist
 
-upload:
+upload: $(TARGET).dol
 ifeq ($(GAMECUBE),1)
 	$(DEVKITPPC)/bin/geckoupload $(TARGET).dol
 else
@@ -177,5 +175,7 @@
 	$(CP) $(srcdir)/NEWS dist/scummvm/
 	$(CP) $(srcdir)/README dist/scummvm/
 	$(CP) $(DIST_FILES_THEMES) dist/scummvm/
+ifneq ($(DIST_FILES_ENGINEDATA),)
 	$(CP) $(DIST_FILES_ENGINEDATA) dist/scummvm/
+endif
 

Deleted: scummvm/trunk/backends/platform/wii/gecko_console.cpp
===================================================================
--- scummvm/trunk/backends/platform/wii/gecko_console.cpp	2008-12-23 17:20:01 UTC (rev 35498)
+++ scummvm/trunk/backends/platform/wii/gecko_console.cpp	2008-12-23 19:16:38 UTC (rev 35499)
@@ -1,91 +0,0 @@
-/*-------------------------------------------------------------
-
-Copyright (C) 2008
-Hector Martin (marcan)
-
-This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any
-damages arising from the use of this software.
-
-Permission is granted to anyone to use this software for any
-purpose, including commercial applications, and to alter it and
-redistribute it freely, subject to the following restrictions:
-
-1.	The origin of this software must not be misrepresented; you
-must not claim that you wrote the original software. If you use
-this software in a product, an acknowledgment in the product
-documentation would be appreciated but is not required.
-
-2.	Altered source versions must be plainly marked as such, and
-must not be misrepresented as being the original software.
-
-3.	This notice may not be removed or altered from any source
-distribution.
-
--------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <sys/iosupport.h>
-#include <ogcsys.h>
-#include <gccore.h>
-#include <reent.h>
-
-#include "gecko_console.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static const devoptab_t *dotab_console;
-int usb_sendbuffer_safe(s32 chn,const void *buffer,int size);
-int usb_sendbuffer(s32 chn,const void *buffer,int size);
-
-int __gecko_write(struct _reent *r,int fd,const char *ptr,int len) {
-	char *tmp = (char*)ptr;
-	u32 level;
-	if(dotab_console)
-		dotab_console->write_r(r,fd,ptr,len);
-		
-	if(!tmp || len<=0)
-		return -1;
-	level = IRQ_Disable();
-	usb_sendbuffer(1, ptr, len);
-	IRQ_Restore(level);
-	return len;
-}
-
-const devoptab_t dotab_gecko = {
-	"stdout",	// device name
-	0,			// size of file structure
-	NULL,		// device open
-	NULL,		// device close
-	__gecko_write,	// device write
-	NULL,		// device read
-	NULL,		// device seek
-	NULL,		// device fstat
-	NULL,		// device stat
-	NULL,		// device link
-	NULL,		// device unlink
-	NULL,		// device chdir
-	NULL,		// device rename
-	NULL,		// device mkdir
-	0,			// dirStateSize
-	NULL,		// device diropen_r
-	NULL,		// device dirreset_r
-	NULL,		// device dirnext_r
-	NULL,		// device dirclose_r
-	NULL		// device statvfs_r
-};
-
-void gecko_console_init(int chain) {
-	dotab_console = NULL;
-	if(chain)
-		dotab_console = devoptab_list[STD_OUT];
-	devoptab_list[STD_OUT] = &dotab_gecko;
-	devoptab_list[STD_ERR] = &dotab_gecko;
-}
-
-#ifdef __cplusplus
-}
-#endif
-

Deleted: scummvm/trunk/backends/platform/wii/gecko_console.h
===================================================================
--- scummvm/trunk/backends/platform/wii/gecko_console.h	2008-12-23 17:20:01 UTC (rev 35498)
+++ scummvm/trunk/backends/platform/wii/gecko_console.h	2008-12-23 19:16:38 UTC (rev 35499)
@@ -1,14 +0,0 @@
-#ifndef _WII_GECKO_CONSOLE_H_
-#define _WII_GECKO_CONSOLE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void gecko_console_init(int chain);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

Modified: scummvm/trunk/backends/platform/wii/main.cpp
===================================================================
--- scummvm/trunk/backends/platform/wii/main.cpp	2008-12-23 17:20:01 UTC (rev 35498)
+++ scummvm/trunk/backends/platform/wii/main.cpp	2008-12-23 19:16:38 UTC (rev 35499)
@@ -19,17 +19,17 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include <fat.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <unistd.h>
 
+#include <fat.h>
+
 #include "osystem.h"
 
 #ifdef DEBUG_WII
 #include <debug.h>
-#include <gecko_console.h>
 #endif
 
 #ifdef __cplusplus
@@ -55,11 +55,15 @@
 	AUDIO_Init(NULL);
 
 #ifdef DEBUG_WII
-	gecko_console_init(0);
+	CON_EnableGecko(1, false);
 	//DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
 #endif
 
-	printf("startup\n");
+	printf("startup as ");
+	if (argc > 0)
+		printf("'%s'\n", argv[0]);
+	else
+		printf("<unknown>\n");
 
 	SYS_SetResetCallback(reset_cb);
 #ifndef GAMECUBE
@@ -69,15 +73,23 @@
 	if (!fatInitDefault()) {
 		printf("fatInitDefault failed\n");
 	} else {
+#ifdef LIBFAT_READAHEAD_CACHE
+		fatSetReadAheadDefault(8, 128);
+#else
+		printf("read ahead cache not available\n");
+#endif
 		// set the default path if libfat couldnt set it
 		// this allows loading over tcp/usbgecko
-		char buf[MAXPATHLEN];
+		char cwd[MAXPATHLEN];
 
-		getcwd(buf, MAXPATHLEN);
-		if (!strcmp(buf, "fat:/"))
-			chdir("/apps/scummvm");
+		if (getcwd(cwd, MAXPATHLEN)) {
+			size_t len = strlen(cwd);
 
-		fatEnableReadAhead(PI_DEFAULT, 32, 128);
+			if (len > 2 && (cwd[len - 1] == ':' || cwd[len - 2] == ':')) {
+				printf("chdir to default\n");
+				chdir("/apps/scummvm");
+			}
+		}
 	}
 
 	g_system = new OSystem_Wii();
@@ -88,10 +100,7 @@
 
 	printf("shutdown\n");
 
-	if (!fatUnmount(PI_DEFAULT)) {
-		printf("fatUnmount failed\n");
-		fatUnsafeUnmount(PI_DEFAULT);
-	}
+	fatUnmountDefault();
 
 	if (power_btn_pressed) {
 		printf("shutting down\n");


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list