#include "gfx.h"
#include "ppu.h"
#include "sdlv.h"
-#include "scaler.h"
#define DIE(format, ...) do { \
fprintf(stderr, "Died at %s:%d: ", __FILE__, __LINE__ ); \
static bool gotWindowSize, gotScreenSize;
/** The current scaler object */
-static Scaler* scaler;
+Scaler* scaler;
static void calculateScreenSize()
{
GUI.Width = gameWidth;
GUI.Height = gameHeight;
#endif
+#if CONF_EXIT_BUTTON
+ ExitBtnReset();
+#endif
// Safeguard
if (gameHeight > GUI.Height || gameWidth > GUI.Width)
{
if (Config.touchscreenInput) {
S9xInputScreenChanged();
- if (Config.touchscreenShow) {
- scaler->pause();
- SDL_FillRect(screen, NULL, 0);
- S9xInputScreenDraw(Settings.SixteenBit ? 2 : 1,
- screen->pixels, screen->pitch);
- SDL_Flip(screen);
- scaler->resume();
- }
+ }
+
+ if (Config.touchscreenShow) {
+ scaler->pause();
+ SDL_FillRect(screen, NULL, 0);
+ S9xInputScreenDraw(Settings.SixteenBit ? 2 : 1,
+ screen->pixels, screen->pitch);
+ SDL_Flip(screen);
+ scaler->resume();
}
}
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
DIE("SDL_InitSubSystem(VIDEO): %s", SDL_GetError());
-#if CONF_HD
- hd_setup();
-#endif
-
setupVideoSurface();
drawOnscreenControls();
}
drawOnscreenControls();
}
-void S9xVideoOutputFocus(bool hasFocus)
+void processVideoEvent(const SDL_Event& event)
{
-#if MAEMO
- if (scaler) {
- if (hasFocus) {
- scaler->resume();
- } else {
- scaler->pause();
- }
- }
-#endif
+ if (scaler)
+ scaler->filter(event);
}
// This is here for completeness, but palette mode is useless on N8x0
{
scaler->finish();
+#if CONF_EXIT_BUTTON
+ if (ExitBtnRequiresDraw()) {
+ scaler->pause();
+ ExitBtnDraw(screen);
+ scaler->resume();
+ }
+#endif
+
return TRUE;
}