[Scummvm-cvs-logs] scummvm master -> b098b74e76e9758b797a302ac83a9b17efd3616c

digitall dgturner at iee.org
Tue Jan 21 21:24:19 CET 2014


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
eff22cb43d WII: Implement changes needed by DevKitPPC R26 and later
b098b74e76 Merge pull request #413 from AReim1982/master


Commit: eff22cb43d22b0f47ac2bf5063916639a632705d
    https://github.com/scummvm/scummvm/commit/eff22cb43d22b0f47ac2bf5063916639a632705d
Author: AReim1982 (alexander at areim.de)
Date: 2014-01-21T07:03:47-08:00

Commit Message:
WII: Implement changes needed by DevKitPPC R26 and later

This changes makes ScummVM compilable with newer versions of DevKitPPC. ScummVM can be linked against the original libogc and libfat. That makes some newer WiiMotes work, improves audio-/video-playback and contains various improvements.

Changed paths:
    backends/fs/wii/wii-fs-factory.cpp
    backends/fs/wii/wii-fs.cpp
    backends/fs/wii/wii-fs.h
    backends/platform/wii/main.cpp
    backends/platform/wii/osystem_events.cpp
    backends/platform/wii/wii.mk
    configure



diff --git a/backends/fs/wii/wii-fs-factory.cpp b/backends/fs/wii/wii-fs-factory.cpp
index 760e531..987e7f5 100644
--- a/backends/fs/wii/wii-fs-factory.cpp
+++ b/backends/fs/wii/wii-fs-factory.cpp
@@ -125,6 +125,8 @@ bool WiiFilesystemFactory::failedToMount(FileSystemType type) {
 	return false;
 }
 
+const DISC_INTERFACE* dvd = &__io_wiidvd;
+
 void WiiFilesystemFactory::mount(FileSystemType type) {
 	switch (type) {
 	case kDVD:
@@ -133,7 +135,7 @@ void WiiFilesystemFactory::mount(FileSystemType type) {
 			break;
 
 		printf("mount dvd\n");
-		if (ISO9660_Mount()) {
+		if (ISO9660_Mount("dvd", dvd)) {
 			_dvdMounted = true;
 			_dvdError = false;
 			printf("ISO9660 mounted\n");
@@ -179,7 +181,7 @@ void WiiFilesystemFactory::umount(FileSystemType type) {
 
 		printf("umount dvd\n");
 
-		ISO9660_Unmount();
+		ISO9660_Unmount("dvd:");
 
 		_dvdMounted = false;
 		_dvdError = false;
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
index 4a19e18..43f4f59 100644
--- a/backends/fs/wii/wii-fs.cpp
+++ b/backends/fs/wii/wii-fs.cpp
@@ -80,9 +80,9 @@ void WiiFilesystemNode::clearFlags() {
 
 void WiiFilesystemNode::setFlags(const struct stat *st) {
 	_exists = true;
-	_isDirectory = S_ISDIR(st->st_mode);
-	_isReadable = (st->st_mode & S_IRUSR) > 0;
-	_isWritable = (st->st_mode & S_IWUSR) > 0;
+	_isDirectory = ( (st->st_mode & S_IFDIR) != 0 );
+	_isReadable = ( (st->st_mode & S_IRUSR) != 0 );
+	_isWritable = ( (st->st_mode & S_IWUSR) != 0 );
 }
 
 WiiFilesystemNode::WiiFilesystemNode() {
@@ -106,7 +106,7 @@ WiiFilesystemNode::WiiFilesystemNode(const Common::String &p) {
 	_displayName = lastPathComponent(_path, '/');
 
 	struct stat st;
-	if (!stat(_path.c_str(), &st))
+	if(stat(_path.c_str(), &st) != -1)
 		setFlags(&st);
 	else
 		clearFlags();
@@ -152,33 +152,45 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
 	if (_path.empty())
 		return getDevopChildren(list, mode, hidden);
 
-	DIR_ITER* dp = diropen (_path.c_str());
+	DIR* dp = opendir (_path.c_str());
+	DIR* tmpdir;
 
 	if (dp == NULL)
 		return false;
 
-	char filename[MAXPATHLEN];
-	struct stat st;
+	struct dirent *pent;
 
-	while (dirnext(dp, filename, &st) == 0) {
-		if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
+	while ((pent = readdir(dp)) != NULL) {
+		if (strcmp(pent->d_name, ".") == 0 || strcmp(pent->d_name, "..") == 0)
 			continue;
 
 		Common::String newPath(_path);
 		if (newPath.lastChar() != '/')
-			newPath += '/';
-		newPath += filename;
-
-		bool isDir = S_ISDIR(st.st_mode);
-
+		  newPath += '/';
+		newPath += pent->d_name;
+	  
+		bool isDir = false;
+		tmpdir = opendir(newPath.c_str());
+		if(tmpdir)
+		{
+			isDir = true;
+			closedir(tmpdir);
+		}
+		
 		if ((mode == Common::FSNode::kListFilesOnly && isDir) ||
 			(mode == Common::FSNode::kListDirectoriesOnly && !isDir))
 			continue;
-
+		
+		struct stat st;
+		st.st_mode = 0;
+		st.st_mode |= ( isDir ? S_IFDIR : 0 );
+		st.st_mode |= S_IRUSR;
+		st.st_mode |= S_IWUSR;
+			
 		list.push_back(new WiiFilesystemNode(newPath, &st));
 	}
 
-	dirclose(dp);
+	closedir(dp);
 
 	return true;
 }
diff --git a/backends/fs/wii/wii-fs.h b/backends/fs/wii/wii-fs.h
index 11679d0..f785101 100644
--- a/backends/fs/wii/wii-fs.h
+++ b/backends/fs/wii/wii-fs.h
@@ -51,7 +51,7 @@ public:
 	 *
 	 * @param path Common::String with the path the new node should point to.
 	 */
-	WiiFilesystemNode(const Common::String &path);
+	WiiFilesystemNode(const Common::String &p);
 	WiiFilesystemNode(const Common::String &p, const struct stat *st);
 
 	virtual bool exists() const;
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index affe053..ec62315 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -225,7 +225,8 @@ int main(int argc, char *argv[]) {
 	printf("shutdown\n");
 
 	SYS_UnregisterResetFunc(&resetinfo);
-	fatUnmountDefault();
+	fatUnmount("usb:/");
+	fatUnmount("sd:/");
 
 	if (res)
 		show_console(res);
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
index 3ba66ae..aa63c8a 100644
--- a/backends/platform/wii/osystem_events.cpp
+++ b/backends/platform/wii/osystem_events.cpp
@@ -188,7 +188,7 @@ void OSystem_Wii::initEvents() {
 	_padAcceleration = 9 - ConfMan.getInt("wii_pad_acceleration");
 
 #ifdef USE_WII_KBD
-	_kbd_active = KEYBOARD_Init() >= 0;
+	_kbd_active = KEYBOARD_Init(NULL) >= 0;
 #endif
 }
 
diff --git a/backends/platform/wii/wii.mk b/backends/platform/wii/wii.mk
index 7d2db68..99ef463 100644
--- a/backends/platform/wii/wii.mk
+++ b/backends/platform/wii/wii.mk
@@ -17,10 +17,10 @@ geckoupload: $(WII_EXE_STRIPPED)
 	$(DEVKITPPC)/bin/geckoupload $<
 
 wiigdb:
-	$(DEVKITPPC)/bin/powerpc-gekko-gdb -n $(EXECUTABLE)
+	$(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE)
 
 wiidebug:
-	$(DEVKITPPC)/bin/powerpc-gekko-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt
+	$(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt
 
 # target to create a Wii snapshot
 wiidist: all
diff --git a/configure b/configure
index cb0b890..8e98544 100755
--- a/configure
+++ b/configure
@@ -1426,7 +1426,7 @@ webos)
 wii)
 	_host_os=wii
 	_host_cpu=ppc
-	_host_alias=powerpc-gekko
+	_host_alias=powerpc-eabi
 	;;
 wince)
 	_host_os=wince
@@ -2704,6 +2704,7 @@ if test -n "$_host"; then
 			_backend="wii"
 			_build_scalers=no
 			_vkeybd=yes
+			_taskbar=no
 			_port_mk="backends/platform/wii/wii.mk"
 			add_line_to_config_mk 'GAMECUBE = 0'
 			add_line_to_config_h '#define AUDIO_REVERSE_STEREO'


Commit: b098b74e76e9758b797a302ac83a9b17efd3616c
    https://github.com/scummvm/scummvm/commit/b098b74e76e9758b797a302ac83a9b17efd3616c
Author: David Turner (dgturner at iee.org)
Date: 2014-01-21T12:23:56-08:00

Commit Message:
Merge pull request #413 from AReim1982/master

WII: Implement changes needed by DevKitPPC R26 and later

Changed paths:
    backends/fs/wii/wii-fs-factory.cpp
    backends/fs/wii/wii-fs.cpp
    backends/fs/wii/wii-fs.h
    backends/platform/wii/main.cpp
    backends/platform/wii/osystem_events.cpp
    backends/platform/wii/wii.mk
    configure









More information about the Scummvm-git-logs mailing list