diff --git a/CMakeLists.txt b/CMakeLists.txt index 73d8760..f05edd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) set(CMAKE_VERBOSE_MAKEFILE OFF) set(VERSION_MAJOR 1) -set(VERSION_MINOR 98) +set(VERSION_MINOR 99) if(BUILD_PSP2) if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) @@ -143,7 +143,7 @@ if(BUILD_PSP2) -DUSE_UAE4ALL_VKBD -DUSE_ARMV7 -DUSE_ARMNEON - -marm -mfpu=neon -mcpu=cortex-a9 -march=armv7-a -mfloat-abi=hard -ffast-math + -marm -mfpu=neon -mtune=cortex-a9 -mfloat-abi=hard -ffast-math -fno-asynchronous-unwind-tables -funroll-loops -mword-relocations -fno-unwind-tables -fno-optimize-sibling-calls -mvectorize-with-neon-quad -funsafe-math-optimizations diff --git a/README.MD b/README.MD index cd81988..3e50358 100644 --- a/README.MD +++ b/README.MD @@ -4,19 +4,9 @@ On the Switch, since v1.84, please use nsp injection to start uae4all2, otherwis Recent Changes ====== -1.98 (Switch only) - -- recompile to add support for 9.0.0 firmware - -1.97 (Switch only) - -- add option to main menu that displays online instruction manual (opens web browser) +1.99 -1.96 - -- increase maximum displayed lines from 270 to 286, useful for overscan games like Babeanoid -- fix cia overlay in AGA mode, fixes Reshoot-R hang at title screen -- add instruction manual to Vita livearea screen +- allow touch input to control on-screen keyboard in addition to dpad Description ===== @@ -40,7 +30,7 @@ Thanks to CrashMidnick for the French virtual keyboard. Thanks to the original authors Chui, john4p, TomB, notaz, Bernd Schneider, Toni Wilen, Pickle, smoku, AnotherGuest, Anonymous engineer, finkel, Lubomyr, pelya and many more. -Thanks to my supporters on Patreon: Andyways, CountDuckula, Jason Crawford, Greg Gibson, Jesse Harlin, Özgür Karter, Matthew Machnee, Milenko, Ibrahim Fazel Poor, and RadicalR. +Thanks to my supporters on Patreon: Andyways, Count Duckula, Jesse Harlin, Özgür Karter, Matthew Machnee, Mored4u, Ibrahim Fazel Poor, and RadicalR. Installation ====== @@ -96,6 +86,7 @@ Vita/Switch-exclusive Features - Config file management (load, save as, etc.) - Thumbnail previews for savestates - Four different on-screen keyboard styles: original, warm, cool, and dark +- On-screen keyboard keys can be pressed via touch input in addition to dpad navigation Controls ===== @@ -267,7 +258,7 @@ Games with no fixes (or unknown fixes) - IK+ Issue: no sound fx - Fix: unknown, but can play PlayStation 1 version in Retroarch instead. This requires cycle exact, which is not supported. + Fix: unknown, but can play PlayStation 1 version in Retroarch instead. The Retroarch PUAE core can play this game correctly on Vita. - Nebulus 2 Issue: doors are not showing @@ -326,6 +317,10 @@ Compiling CHANGELOG ===== +1.99 + +- allow touch input to control on-screen keyboard, in addition to dpad + 1.98 (Switch only) - recompile to add support for 9.0.0 firmware diff --git a/psp2data/sce_sys/manual/001.png b/psp2data/sce_sys/manual/001.png index dc2c4b5..952766a 100644 Binary files a/psp2data/sce_sys/manual/001.png and b/psp2data/sce_sys/manual/001.png differ diff --git a/psp2data/sce_sys/manual/002.png b/psp2data/sce_sys/manual/002.png index 9ec91bd..085556f 100644 Binary files a/psp2data/sce_sys/manual/002.png and b/psp2data/sce_sys/manual/002.png differ diff --git a/psp2data/sce_sys/manual/003.png b/psp2data/sce_sys/manual/003.png index 9f40320..c403989 100644 Binary files a/psp2data/sce_sys/manual/003.png and b/psp2data/sce_sys/manual/003.png differ diff --git a/psp2data/sce_sys/manual/004.png b/psp2data/sce_sys/manual/004.png index 9bcbde0..8b82538 100644 Binary files a/psp2data/sce_sys/manual/004.png and b/psp2data/sce_sys/manual/004.png differ diff --git a/psp2data/sce_sys/manual/005.png b/psp2data/sce_sys/manual/005.png index 8b1566b..8bd1c7b 100644 Binary files a/psp2data/sce_sys/manual/005.png and b/psp2data/sce_sys/manual/005.png differ diff --git a/psp2data/sce_sys/manual/006.png b/psp2data/sce_sys/manual/006.png index 96f5ad7..e48e311 100644 Binary files a/psp2data/sce_sys/manual/006.png and b/psp2data/sce_sys/manual/006.png differ diff --git a/psp2data/sce_sys/manual/007.png b/psp2data/sce_sys/manual/007.png index 112a347..483fb07 100644 Binary files a/psp2data/sce_sys/manual/007.png and b/psp2data/sce_sys/manual/007.png differ diff --git a/psp2data/sce_sys/manual/008.png b/psp2data/sce_sys/manual/008.png index 4507458..1204806 100644 Binary files a/psp2data/sce_sys/manual/008.png and b/psp2data/sce_sys/manual/008.png differ diff --git a/psp2data/sce_sys/manual/009.png b/psp2data/sce_sys/manual/009.png index fd55d95..31619a3 100644 Binary files a/psp2data/sce_sys/manual/009.png and b/psp2data/sce_sys/manual/009.png differ diff --git a/psp2data/sce_sys/manual/010.png b/psp2data/sce_sys/manual/010.png index c638f0e..ccb1ea7 100644 Binary files a/psp2data/sce_sys/manual/010.png and b/psp2data/sce_sys/manual/010.png differ diff --git a/psp2data/sce_sys/manual/011.png b/psp2data/sce_sys/manual/011.png index b01e407..193b387 100644 Binary files a/psp2data/sce_sys/manual/011.png and b/psp2data/sce_sys/manual/011.png differ diff --git a/psp2data/sce_sys/manual/012.png b/psp2data/sce_sys/manual/012.png index 81ab121..da50cfa 100644 Binary files a/psp2data/sce_sys/manual/012.png and b/psp2data/sce_sys/manual/012.png differ diff --git a/psp2data/sce_sys/manual/013.png b/psp2data/sce_sys/manual/013.png index 8ed9839..6f2d27d 100644 Binary files a/psp2data/sce_sys/manual/013.png and b/psp2data/sce_sys/manual/013.png differ diff --git a/psp2data/sce_sys/manual/014.png b/psp2data/sce_sys/manual/014.png index f03d508..c59288d 100644 Binary files a/psp2data/sce_sys/manual/014.png and b/psp2data/sce_sys/manual/014.png differ diff --git a/psp2data/sce_sys/manual/015.png b/psp2data/sce_sys/manual/015.png index 190816a..8ec3238 100644 Binary files a/psp2data/sce_sys/manual/015.png and b/psp2data/sce_sys/manual/015.png differ diff --git a/psp2data/sce_sys/manual/016.png b/psp2data/sce_sys/manual/016.png index ef0a21a..083ebb8 100644 Binary files a/psp2data/sce_sys/manual/016.png and b/psp2data/sce_sys/manual/016.png differ diff --git a/psp2data/sce_sys/manual/017.png b/psp2data/sce_sys/manual/017.png new file mode 100644 index 0000000..91449dd Binary files /dev/null and b/psp2data/sce_sys/manual/017.png differ diff --git a/src/gp2x/menu/menu_main.cpp b/src/gp2x/menu/menu_main.cpp index a8e3160..b999ca2 100755 --- a/src/gp2x/menu/menu_main.cpp +++ b/src/gp2x/menu/menu_main.cpp @@ -945,7 +945,7 @@ SDL_ANDROID_SetScreenKeyboardShown(1); { // This works on all CFW WebWifiConfig conf; - webWifiCreate(&conf, NULL, "https://github.com/rsn8887/uae4all2/releases/latest", 0, 0); + webWifiCreate(&conf, NULL, "https://github.com/rsn8887/uae4all2/releases/latest", (Uuid){0}, 0); webWifiShow(&conf, NULL); // The following would be better, but crashes on SX OS //WebCommonConfig config; diff --git a/src/od-joy.cpp b/src/od-joy.cpp index 6a5fc5a..a0c0c45 100755 --- a/src/od-joy.cpp +++ b/src/od-joy.cpp @@ -762,9 +762,12 @@ void read_joystick(int nr, unsigned int *dir, int *button) } #endif else { //button release, pressing sticky keys is possible again. - for (int i=0; itfinger.fingerId; + if (vkbd_mode) { + if (port == 0) { + vkbd_touch_x = event->tfinger.x; + vkbd_touch_y = event->tfinger.y; + } + return; + } + int x = lastmx; int y = lastmy; @@ -267,6 +277,15 @@ void psp2ProcessFingerUp(TouchEvent *event) { // id (for multitouch) int id = event->tfinger.fingerId; + if (vkbd_mode) { + if (port == 0) { + vkbd_touch_x = -1; + vkbd_touch_y = -1; + vkbd_move &= ~VKBD_BUTTON; + } + return; + } + // find out how many fingers were down before this event int numFingersDown = 0; for (int i = 0; i < MAX_NUM_FINGERS; i++) { @@ -331,6 +350,9 @@ void psp2ProcessFingerUp(TouchEvent *event) { } void psp2ProcessFingerMotion(TouchEvent *event) { + if (vkbd_mode) + return; + // front (0) or back (1) panel int port = event->tfinger.touchId; // id (for multitouch) diff --git a/src/psp2/vita2d_fbo/lib/libvita2d.a b/src/psp2/vita2d_fbo/lib/libvita2d.a index 399daa9..e3d656e 100644 Binary files a/src/psp2/vita2d_fbo/lib/libvita2d.a and b/src/psp2/vita2d_fbo/lib/libvita2d.a differ diff --git a/src/switch/switch_touch.c b/src/switch/switch_touch.c index 2cda115..86a8fc6 100644 --- a/src/switch/switch_touch.c +++ b/src/switch/switch_touch.c @@ -17,6 +17,9 @@ #include "math.h" +typedef int bool; +#include "vkbd.h" + static void initTouch(); static void preprocessEvents(SDL_Event *event); static void preprocessFingerDown(SDL_Event *event); @@ -124,6 +127,14 @@ static void preprocessFingerDown(SDL_Event *event) { // id (for multitouch) SDL_FingerID id = event->tfinger.fingerId; + if (vkbd_mode) { + if (port == 0) { + vkbd_touch_x = event->tfinger.x; + vkbd_touch_y = event->tfinger.y; + } + return; + } + int x = lastmx; int y = lastmy; @@ -156,6 +167,15 @@ static void preprocessFingerUp(SDL_Event *event) { // id (for multitouch) SDL_FingerID id = event->tfinger.fingerId; + if (vkbd_mode) { + if (port == 0) { + vkbd_touch_x = -1; + vkbd_touch_y = -1; + vkbd_move &= ~VKBD_BUTTON; + } + return; + } + // find out how many fingers were down before this event int numFingersDown = 0; for (int i = 0; i < MAX_NUM_FINGERS; i++) { @@ -218,6 +238,9 @@ static void preprocessFingerUp(SDL_Event *event) { } static void preprocessFingerMotion(SDL_Event *event) { + if (vkbd_mode) + return; + // front (0) or back (1) panel SDL_TouchID port = event->tfinger.touchId; // id (for multitouch) diff --git a/src/vkbd/vkbd.cpp b/src/vkbd/vkbd.cpp index 220776d..63a1b48 100755 --- a/src/vkbd/vkbd.cpp +++ b/src/vkbd/vkbd.cpp @@ -10,12 +10,17 @@ #include "keyboard.h" +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + #define VKBD_MIN_HOLDING_TIME 200 #define VKBD_MOVE_DELAY 50 extern int keycode2amiga(SDL_keysym *prKeySym); extern int mainMenu_displayHires; +extern int mainMenu_displayedLines; +extern int mainMenu_shader; +extern int visibleAreaWidth; extern int mainMenu_vkbdLanguage; extern int mainMenu_vkbdStyle; @@ -41,6 +46,8 @@ t_vkbd_sticky_key vkbd_sticky_key[] = int vkbd_let_go_of_direction=0; int vkbd_mode=0; int vkbd_move=0; +float vkbd_touch_x=-1; +float vkbd_touch_y=-1; int vkbd_key=KEYCODE_NOTHING; SDLKey vkbd_button2=(SDLKey)0; //not implemented int vkbd_keysave=KEYCODE_NOTHING; @@ -182,6 +189,8 @@ static t_vkbd_rect vkbd_rect_US[]= {{211, 61, 14, 11 }, 81,12,89,91, AK_LF}, // 90 {{226, 61, 14, 11 }, 82,12,90,92, AK_DN}, // 91 {{241, 61, 14, 11 }, 83,13,91,69, AK_RT}, // 92 + {{0, 0, 0, 0 }, 0,0,0,0, 0}, // 93 + {{0, 0, 0, 0 }, 0,0,0,0, 0}, // 94 }; //UK KEYBOARD @@ -287,6 +296,7 @@ static t_vkbd_rect vkbd_rect_UK[]= {{241, 61, 14, 11 }, 83,13,91,69, AK_RT}, // 92 // UK extra keys {{31, 49, 14, 11 }, 55,86,70,71, AK_LTGT}, // 93 * + {{0, 0, 0, 0 }, 0,0,0,0, 0}, // 94 }; //GERMAN KEYBOARD @@ -827,12 +837,114 @@ void vkbd_displace_down(void) vkbd_y=prSDLScreen->h-ksur->h; } +int vkbd_touch_xy_to_actual(float touch_x, float touch_y) +{ + int x = 0; + int y = 0; + int x_offset = 0; + int y_offset = 0; + float scaled_width = 0; + float scaled_height = 0; +#ifdef __PSP2__ + int display_width = 960; + int display_height = 544; + //is a shader active? + if (mainMenu_shader != 0) + { + scaled_height = display_height; + if (mainMenu_displayHires) + scaled_width = (0.5f*(float)visibleAreaWidth*((float)544/(float)mainMenu_displayedLines)); + else + scaled_width = ((float)visibleAreaWidth*((float)544/(float)mainMenu_displayedLines)); + x_offset = (display_width - scaled_width) / 2; + y_offset = (display_height - scaled_height) / 2; + } + else //otherwise do regular integer 2* scaling without filtering to ensure good picture quality + { + scaled_height = (float) (2 * mainMenu_displayedLines); + if (mainMenu_displayHires) + scaled_width = (float) (1 * visibleAreaWidth); + else + scaled_width = (float) (2 * visibleAreaWidth); + x_offset = (display_width - scaled_width) / 2; + y_offset = (display_height - scaled_height) / 2; + } +#else + int display_width = 1280; + int display_height = 720; + if (mainMenu_shader == 0) { + // integer scaling + int screen_width; + int screen_height; + screen_width = visibleAreaWidth; + if (mainMenu_displayHires) + screen_height = 2 * mainMenu_displayedLines; + else + screen_height = mainMenu_displayedLines; + int scale_factor = MIN(display_height / screen_height, display_width / screen_width); + scaled_height = scale_factor * screen_height; + scaled_width = scale_factor * screen_width; + } else { + // scale to fit, preserve aspect ratio + scaled_height = display_height; + if (mainMenu_displayHires) + scaled_width = ((visibleAreaWidth * display_height) / (float) (2 * mainMenu_displayedLines)); + else + scaled_width = ((visibleAreaWidth * display_height) / (float) (mainMenu_displayedLines)); + } + // centering + x_offset = (display_width - scaled_width) / 2; + y_offset = (display_height - scaled_height) / 2; +#endif + x = (((touch_x * display_width) - x_offset) * visibleAreaWidth) / scaled_width; + y = (((touch_y * display_height) - y_offset) * mainMenu_displayedLines) / scaled_height; + x -= vkbd_x; + y -= vkbd_y; + if (mainMenu_displayHires) + x /= 2; + + for (int i = 0; i < 95; i++) + { + int x_min = vkbd_rect[i].rect.x; + int y_min = vkbd_rect[i].rect.y; + int x_max = x_min + vkbd_rect[i].rect.w; + int y_max = y_min + vkbd_rect[i].rect.h; + if (x_min != 0 && y_min != 0 && x >= x_min-1 && x <= x_max && y >= y_min-1 && y <= y_max) + return i; + } + return -1; +} + int vkbd_process(void) { Uint32 now=SDL_GetTicks(); SDL_Rect r; vkbd_redraw(); + + if (vkbd_touch_x != -1 && vkbd_touch_y != -1) { + int new_vkbd_actual = vkbd_touch_xy_to_actual(vkbd_touch_x, vkbd_touch_y); + if (new_vkbd_actual != -1) + { + vkbd_actual = new_vkbd_actual; + vkbd_move = VKBD_BUTTON; + // draw key dark while touched + if (mainMenu_displayHires) + { + r.x=vkbd_x+2*vkbd_rect[vkbd_actual].rect.x; + r.w=2*vkbd_rect[vkbd_actual].rect.w; + } + else + { + r.x=vkbd_x+vkbd_rect[vkbd_actual].rect.x; + r.w=vkbd_rect[vkbd_actual].rect.w; + } + r.y=vkbd_y+vkbd_rect[vkbd_actual].rect.y; + r.h=vkbd_rect[vkbd_actual].rect.h; + SDL_FillRect(prSDLScreen,&r,vkbd_color); + } + } + if (vkbd_move&VKBD_BUTTON) { vkbd_move=0; diff --git a/src/vkbd/vkbd.h b/src/vkbd/vkbd.h index be401a0..458716b 100755 --- a/src/vkbd/vkbd.h +++ b/src/vkbd/vkbd.h @@ -38,6 +38,8 @@ void vkbd_reset_sticky_keys(void); extern int vkbd_mode; extern int vkbd_move; +extern float vkbd_touch_x; +extern float vkbd_touch_y; typedef struct { int code; // amiga-side keycode