# HG changeset patch # User Darren Alton # Date 1214917370 0 # Node ID 082cc3ffd7d8ea20713c2071b31f4b66042e23a1 # Parent 5e4274591163ef91cd2cc140ce538ef254bff342 Fixed a conflict between the touch and joystick drivers. They now should both behave as expected. diff -r 5e4274591163 -r 082cc3ffd7d8 src/file/SDL_rwops.c --- a/src/file/SDL_rwops.c Sun Jun 29 21:32:31 2008 +0000 +++ b/src/file/SDL_rwops.c Tue Jul 01 13:02:50 2008 +0000 @@ -466,9 +466,11 @@ SDL_RWFromFP(FILE * fp, SDL_bool autoclose) { SDL_RWops *rwops = NULL; -#ifdef __NDS__ +#if 0 +ifdef __NDS__ /* set it up so we can use stdio file function */ fatInitDefault(); + printf("called fatInitDefault()"); #endif /* __NDS__ */ rwops = SDL_AllocRW(); if (rwops != NULL) { diff -r 5e4274591163 -r 082cc3ffd7d8 src/joystick/nds/SDL_sysjoystick.c --- a/src/joystick/nds/SDL_sysjoystick.c Sun Jun 29 21:32:31 2008 +0000 +++ b/src/joystick/nds/SDL_sysjoystick.c Tue Jul 01 13:02:50 2008 +0000 @@ -91,7 +91,7 @@ { u32 keysd, keysu; int magnitude = 16384; - scanKeys(); + /*scanKeys();*/ keysd = keysDown(); keysu = keysUp(); diff -r 5e4274591163 -r 082cc3ffd7d8 src/touchscreen/nds/SDL_systouchscreen.c --- a/src/touchscreen/nds/SDL_systouchscreen.c Sun Jun 29 21:32:31 2008 +0000 +++ b/src/touchscreen/nds/SDL_systouchscreen.c Tue Jul 01 13:02:50 2008 +0000 @@ -85,7 +85,7 @@ Uint16 xpos=0, ypos=0, pressure = 32767; touchPosition touch; - scanKeys(); + /*scanKeys();*/ keysd = keysDown(); keysh = keysHeld(); keysu = keysUp(); @@ -94,13 +94,18 @@ ypos = (touch.py << 16) / 192 + 1; /* TODO uses touch.x and touch.y for something. we discussed in the mailing list having both "hardware x/y" and - "screen x/y" coordinates. */ + "screen x/y" coordinates. maybe modify structs for that too + also, find out how Colors! gets pressure and see if it's practical here + */ if ((keysd & KEY_TOUCH)) { SDL_PrivateTouchPress(touchscreen, 0, xpos, ypos, pressure); } if ((keysh & KEY_TOUCH)) { - SDL_PrivateTouchMove(touchscreen, 0, xpos, ypos, pressure); + /* sometimes the touch jumps to y=1 before it reports as keysUp */ + if(ypos > 1) { + SDL_PrivateTouchMove(touchscreen, 0, xpos, ypos, pressure); + } } if ((keysu & KEY_TOUCH)) { SDL_PrivateTouchRelease(touchscreen, 0); diff -r 5e4274591163 -r 082cc3ffd7d8 src/video/nds/SDL_ndsevents.c --- a/src/video/nds/SDL_ndsevents.c Sun Jun 29 21:32:31 2008 +0000 +++ b/src/video/nds/SDL_ndsevents.c Tue Jul 01 13:02:50 2008 +0000 @@ -38,7 +38,7 @@ void NDS_PumpEvents(_THIS) { - /* do nothing. */ + scanKeys(); } /* vi: set ts=4 sw=4 expandtab: */