aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorChristopher Page2008-06-11 17:36:21 +0000
committerChristopher Page2008-06-11 17:36:21 +0000
commite86a422e252ade394ca796cae767c4d3221d3c4a (patch)
treecce35a7a31f15119d531a91448a19029e0099b99 /backends
parent4fddafa3e6ef1c250804ea6ce9baaf2a911027e8 (diff)
parent33fd755a0ebab6d3ca4e877b15c4d3d7d25877f9 (diff)
downloadscummvm-rg350-e86a422e252ade394ca796cae767c4d3221d3c4a.tar.gz
scummvm-rg350-e86a422e252ade394ca796cae767c4d3221d3c4a.tar.bz2
scummvm-rg350-e86a422e252ade394ca796cae767c4d3221d3c4a.zip
Merged revisions 32564-32565,32567-32575,32577,32579-32594,32596-32603,32605-32639,32644-32646,32648-32666 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r32667
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/wii/Makefile4
-rw-r--r--backends/platform/wii/main.cpp19
-rw-r--r--backends/platform/wii/osystem.cpp2
-rw-r--r--backends/platform/wii/osystem.h13
-rw-r--r--backends/platform/wii/osystem_events.cpp9
-rw-r--r--backends/plugins/dynamic-plugin.h4
6 files changed, 49 insertions, 2 deletions
diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile
index 0654fa254d..a52ceb1774 100644
--- a/backends/platform/wii/Makefile
+++ b/backends/platform/wii/Makefile
@@ -62,8 +62,8 @@ MACHDEP = -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float \
INCDIR = $(srcdir) . $(srcdir)/engines/ $(DEVKITPRO)/libogc/include
LIBDIR = $(DEVKITPRO)/libogc/lib/wii
-CXXFLAGS = -g -Os -Wall $(MACHDEP) -D__WII__ \
- -Wno-multichar -fno-exceptions -fno-rtti
+CXXFLAGS = -g -Os -Wall $(MACHDEP) -D__WII__ -Wno-multichar -Wno-long-long \
+ -Wno-unknown-pragmas -Wno-reorder -fno-exceptions -fno-rtti
CXXFLAGS += $(addprefix -I,$(INCDIR))
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(TARGET).elf.map
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index 7529df6de3..5753ecefe4 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -36,6 +36,17 @@
extern "C" {
#endif
+bool reset_btn_pressed = false;
+bool power_btn_pressed = false;
+
+void reset_cb(void) {
+ reset_btn_pressed = true;
+}
+
+void power_cb(void) {
+ power_btn_pressed = true;
+}
+
int main(int argc, char *argv[]) {
s32 res;
@@ -50,6 +61,9 @@ int main(int argc, char *argv[]) {
printf("startup\n");
+ SYS_SetResetCallback(reset_cb);
+ SYS_SetPowerCallback(power_cb);
+
if (!fatInitDefault()) {
printf("fatInitDefault failed\n");
} else {
@@ -77,6 +91,11 @@ int main(int argc, char *argv[]) {
fatUnsafeUnmount(PI_DEFAULT);
}
+ if (power_btn_pressed) {
+ printf("shutting down\n");
+ SYS_ResetSystem(SYS_POWEROFF, 0, 0);
+ }
+
printf("reloading\n");
return res;
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index 97bee24d0f..2667ecb69d 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -63,6 +63,8 @@ OSystem_Wii::OSystem_Wii() :
_mouseKeyColor(0),
_mouseCursor(NULL),
+ _event_quit(false),
+
_savefile(NULL),
_mixer(NULL),
_timer(NULL) {
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index f65310bada..2a168fd0b7 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -37,6 +37,17 @@
#include <gccore.h>
#include <ogcsys.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bool reset_btn_pressed;
+extern bool power_btn_pressed;
+
+#ifdef __cplusplus
+}
+#endif
+
class OSystem_Wii : public OSystem {
private:
s64 _startup_time;
@@ -69,6 +80,8 @@ private:
u8 _mouseKeyColor;
u8 *_mouseCursor;
+ bool _event_quit;
+
u32 _lastPadCheck;
void initGfx();
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
index 09dfb5e96b..2d7c2d9c18 100644
--- a/backends/platform/wii/osystem_events.cpp
+++ b/backends/platform/wii/osystem_events.cpp
@@ -140,6 +140,15 @@ void OSystem_Wii::updateEventScreenResolution() {
} while (0)
bool OSystem_Wii::pollEvent(Common::Event &event) {
+ if ((reset_btn_pressed || power_btn_pressed) && !_event_quit) {
+ _event_quit = true;
+ event.type = Common::EVENT_QUIT;
+
+ printf("quit event\n");
+
+ return true;
+ }
+
u32 bd, bh, bu;
PAD_ScanPads();
diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h
index 4771f1c086..ec051c4ed7 100644
--- a/backends/plugins/dynamic-plugin.h
+++ b/backends/plugins/dynamic-plugin.h
@@ -46,6 +46,7 @@ public:
return false;
}
if (verFunc() != PLUGIN_VERSION) {
+ warning("Plugin uses a different API version (you have: '%d', needed is: '%d')", verFunc(), PLUGIN_VERSION);
unloadPlugin();
return false;
}
@@ -58,6 +59,7 @@ public:
}
_type = (PluginType)typeFunc();
if (_type >= PLUGIN_TYPE_MAX) {
+ warning("Plugin type unknown: %d", _type);
unloadPlugin();
return false;
}
@@ -69,6 +71,7 @@ public:
return false;
}
if (typeVerFunc() != pluginTypeVersions[_type]) {
+ warning("Plugin uses a different type API version (you have: '%d', needed is: '%d')", typeVerFunc(), pluginTypeVersions[_type]);
unloadPlugin();
return false;
}
@@ -83,6 +86,7 @@ public:
// Get the plugin object
_pluginObject = getObject();
if (!_pluginObject) {
+ warning("Couldn't get the plugin object");
unloadPlugin();
return false;
}