X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=platform%2Fsdl.cpp;h=1558c6af7ad95d255a24711548e6d43ae5cc31d4;hb=2af26f8a9741caf38e67844501d3921c3a0e90f4;hp=375519f1bfea95f43355d36b27485f5af88486fb;hpb=02ea2b4aee10098f26acde34cee19340fd8e4177;p=drnoksnes diff --git a/platform/sdl.cpp b/platform/sdl.cpp index 375519f..1558c6a 100644 --- a/platform/sdl.cpp +++ b/platform/sdl.cpp @@ -14,10 +14,10 @@ #include "soundux.h" #include "hacks.h" #include "snapshot.h" -#include "hgw.h" +#include "osso.h" #define kPollEveryNFrames 5 //Poll input only every this many frames -#define kPollHgwEveryNFrames 10 //Poll dbus only every this many frames +#define kPollOssoEveryNFrames 10 //Poll dbus only every this many frames #define TRACE printf("trace: %s:%s\n", __FILE__, __func__); #define DIE(format, ...) do { \ @@ -31,11 +31,6 @@ void S9xMessage(int type, int number, const char * message) printf("%s\n", message); } -void S9xLoadSDD1Data() -{TRACE - Settings.SDD1Pack=FALSE; -} - void S9xAutoSaveSRAM() { Memory.SaveSRAM(S9xGetFilename(FILE_SRAM)); @@ -186,32 +181,38 @@ static inline void pollEvents() { static int frames = 0; if (++frames > kPollEveryNFrames) { - S9xProcessEvents(FALSE); + S9xProcessEvents(false); frames = 0; } } -/** Wraps HgwPollEvents, taking care of kPollHgwEveryNFrames */ -static inline void pollHgwEvents() { +#if CONF_GUI +/** Wraps OssoPollEvents, taking care of kPollOssoEveryNFrames */ +static inline void pollOssoEvents() { static int frames = 0; - if (!hgwLaunched) return; + if (!OssoOk()) return; - if (++frames > kPollHgwEveryNFrames) { - HgwPollEvents(); + if (++frames > kPollOssoEveryNFrames) { + OssoPollEvents(); frames = 0; } } +#endif -int main(int argc, const char ** argv) { +int main(int argc, char ** argv) { // Initialise SDL if (SDL_Init(0) < 0) DIE("SDL_Init: %s", SDL_GetError()); // Configure snes9x - HgwInit(); // Hildon-games-wrapper initialization. +#if CONF_GUI + OssoInit(); // Hildon-games-wrapper initialization. +#endif S9xLoadConfig(argc, argv); // Load config files and parse cmd line. - HgwConfig(); // Apply specific hildon-games config. +#if CONF_GUI + OssoConfig(); // Apply specific hildon-games config. +#endif // S9x initialization S9xInitDisplay(argc, argv); @@ -236,7 +237,9 @@ int main(int argc, const char ** argv) { frameSync(); // May block, or set frameskip to true. S9xMainLoop(); // Does CPU things, renders if needed. pollEvents(); - pollHgwEvents(); +#if CONF_GUI + pollOssoEvents(); +#endif } while (!Config.quitting); // Deinitialization @@ -253,7 +256,9 @@ int main(int argc, const char ** argv) { S9xGraphicsDeinit(); Memory.Deinit(); S9xUnloadConfig(); - HgwDeinit(); +#if CONF_GUI + OssoDeinit(); +#endif SDL_Quit(); @@ -267,7 +272,6 @@ void S9xDoAction(unsigned char action) if (action & kActionToggleFullscreen) { S9xVideoToggleFullscreen(); - S9xInputScreenChanged(); } if (action & kActionQuickLoad1) {