From c68dd1bddd56aa532999cd9025541e44a5263884 Mon Sep 17 00:00:00 2001 From: knakos Date: Tue, 27 Dec 2005 22:19:04 +0000 Subject: [PATCH] added paddle 0 emulation for smartphones git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@927 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/wince/missing.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stella/src/wince/missing.cpp b/stella/src/wince/missing.cpp index 21dd68b7e..3f4fbd8cc 100644 --- a/stella/src/wince/missing.cpp +++ b/stella/src/wince/missing.cpp @@ -26,6 +26,7 @@ char *msg = NULL; int EventHandlerState; extern OSystemWinCE *theOSystem; +extern int paddlespeed; int time(int dummy) { @@ -140,6 +141,8 @@ DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y) { return; } DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event) { + static int paddleres = 300000; + for (int i=0; iframeBuffer())))->IsSmartphone() ) + { + if (keycodes[0][K_RIGHT].state == 1 && paddleres > 200000) + paddleres -= paddlespeed; + else if (keycodes[0][K_LEFT].state == 1 && paddleres < 900000) + paddleres += paddlespeed; + + theOSystem->eventHandler().event()->set(Event::PaddleZeroResistance, paddleres); + theOSystem->eventHandler().event()->set(Event::PaddleZeroFire, keycodes[0][K_FIRE].state); + } + } event->type = SDL_NOEVENT; return 0;