From c0a75930c7e6aeec6ba7e7bf03d8dfb43cf69351 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Thu, 5 Jun 2008 21:34:45 +0000 Subject: disable more more compiler warnings svn-id: r32564 --- backends/platform/wii/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile index 0654fa254d..74425246f2 100644 --- a/backends/platform/wii/Makefile +++ b/backends/platform/wii/Makefile @@ -62,8 +62,9 @@ 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-multichar -Wno-unknown-pragmas -Wno-reorder \ + -fno-exceptions -fno-rtti CXXFLAGS += $(addprefix -I,$(INCDIR)) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(TARGET).elf.map -- cgit v1.2.3 From 1217f0a42be87138a2d375bd78b50b880b2bdcab Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 7 Jun 2008 15:37:17 +0000 Subject: added support for reset and power buttons svn-id: r32593 --- backends/platform/wii/main.cpp | 19 +++++++++++++++++++ backends/platform/wii/osystem.cpp | 2 ++ backends/platform/wii/osystem.h | 13 +++++++++++++ backends/platform/wii/osystem_events.cpp | 9 +++++++++ 4 files changed, 43 insertions(+) (limited to 'backends') 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 #include +#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(); -- cgit v1.2.3 From b17d9f4fb0a12db1d0af3c20196f67e3b9af7ef4 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 7 Jun 2008 15:39:25 +0000 Subject: -Wno-multichar slipped in twice svn-id: r32594 --- backends/platform/wii/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile index 74425246f2..a52ceb1774 100644 --- a/backends/platform/wii/Makefile +++ b/backends/platform/wii/Makefile @@ -63,8 +63,7 @@ INCDIR = $(srcdir) . $(srcdir)/engines/ $(DEVKITPRO)/libogc/include LIBDIR = $(DEVKITPRO)/libogc/lib/wii CXXFLAGS = -g -Os -Wall $(MACHDEP) -D__WII__ -Wno-multichar -Wno-long-long \ - -Wno-multichar -Wno-unknown-pragmas -Wno-reorder \ - -fno-exceptions -fno-rtti + -Wno-unknown-pragmas -Wno-reorder -fno-exceptions -fno-rtti CXXFLAGS += $(addprefix -I,$(INCDIR)) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(TARGET).elf.map -- cgit v1.2.3 From 280a7c4c229c14984f97a8e27b1a681b4c2476bb Mon Sep 17 00:00:00 2001 From: Jordi Vilalta Prat Date: Mon, 9 Jun 2008 03:59:16 +0000 Subject: Show warnings when a plugin couldn't be loaded svn-id: r32627 --- backends/plugins/dynamic-plugin.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends') 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; } -- cgit v1.2.3