aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorAndre Heider2008-12-23 19:16:38 +0000
committerAndre Heider2008-12-23 19:16:38 +0000
commit700c69e942e558c8942bdd14dad52844dcb0a826 (patch)
treef3a4d3ec3e8d3fffd67b8d9faa7fa9464b2dbaac /backends/platform
parent71d879296b75d0c07277ba7b73c2b8823be8bc82 (diff)
downloadscummvm-rg350-700c69e942e558c8942bdd14dad52844dcb0a826.tar.gz
scummvm-rg350-700c69e942e558c8942bdd14dad52844dcb0a826.tar.bz2
scummvm-rg350-700c69e942e558c8942bdd14dad52844dcb0a826.zip
changes for devkitPPC r16
svn-id: r35499
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/wii/Makefile8
-rw-r--r--backends/platform/wii/gecko_console.cpp91
-rw-r--r--backends/platform/wii/gecko_console.h14
-rw-r--r--backends/platform/wii/main.cpp35
4 files changed, 26 insertions, 122 deletions
diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile
index 90ebcccb66..b87212127d 100644
--- a/backends/platform/wii/Makefile
+++ b/backends/platform/wii/Makefile
@@ -59,7 +59,6 @@ LD = $(PREFIX)gcc
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 @@ CXXFLAGS += -DUSE_MT32EMU
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 @@ include $(srcdir)/Makefile.common
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: distclean-wii
distclean-wii:
@-$(RM) dist
-upload:
+upload: $(TARGET).dol
ifeq ($(GAMECUBE),1)
$(DEVKITPPC)/bin/geckoupload $(TARGET).dol
else
@@ -177,5 +175,7 @@ endif
$(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
diff --git a/backends/platform/wii/gecko_console.cpp b/backends/platform/wii/gecko_console.cpp
deleted file mode 100644
index c419f6e7e5..0000000000
--- a/backends/platform/wii/gecko_console.cpp
+++ /dev/null
@@ -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
-
diff --git a/backends/platform/wii/gecko_console.h b/backends/platform/wii/gecko_console.h
deleted file mode 100644
index ba7c393add..0000000000
--- a/backends/platform/wii/gecko_console.h
+++ /dev/null
@@ -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
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index 8bb1bff904..097f23a47c 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -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 @@ int main(int argc, char *argv[]) {
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 @@ int main(int argc, char *argv[]) {
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 @@ int main(int argc, char *argv[]) {
printf("shutdown\n");
- if (!fatUnmount(PI_DEFAULT)) {
- printf("fatUnmount failed\n");
- fatUnsafeUnmount(PI_DEFAULT);
- }
+ fatUnmountDefault();
if (power_btn_pressed) {
printf("shutting down\n");