From: Toni Wilen Date: Tue, 10 Jul 2018 06:59:36 +0000 (+0300) Subject: RP update. X-Git-Tag: 4010~18 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e4c5e18b4982eba007e378661b4b321416465b4e;p=francis%2Fwinuae.git RP update. --- diff --git a/od-win32/cloanto/RetroPlatformIPC.h b/od-win32/cloanto/RetroPlatformIPC.h index e849a66a..efa04874 100644 --- a/od-win32/cloanto/RetroPlatformIPC.h +++ b/od-win32/cloanto/RetroPlatformIPC.h @@ -9,7 +9,7 @@ : Software Foundation. Authors : os, m Created : 2007-08-27 13:55:49 - Updated : 2017-09-10 12:13:00 + Updated : 2018-07-08 10:54:00 Comment : RetroPlatform Player interprocess communication include file *****************************************************************************/ @@ -18,9 +18,9 @@ #include -#define RETROPLATFORM_API_VER "7.2" +#define RETROPLATFORM_API_VER "7.3" #define RETROPLATFORM_API_VER_MAJOR 7 -#define RETROPLATFORM_API_VER_MINOR 2 +#define RETROPLATFORM_API_VER_MINOR 3 #define RPIPC_HostWndClass "RetroPlatformHost%s" #define RPIPC_GuestWndClass "RetroPlatformGuest%d" @@ -62,6 +62,8 @@ #define RP_IPC_TO_HOST_PRIVATE_TYPECLIPDONE (WM_APP + 32) // introduced in RetroPlatform API 7.2 #define RP_IPC_TO_HOST_PRIVATE_KEYEVENT (WM_APP + 33) // introduced in RetroPlatform API 7.2 #define RP_IPC_TO_HOST_PRIVATE_GUESTEVENT (WM_APP + 34) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_HOST_PRIVATE_KEYREMINDER (WM_APP + 35) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_HOST_RAWINPUT_EVENT (WM_APP + 36) // introduced in RetroPlatform API 7.3 // **************************************************************************** // Host-to-Guest Messages @@ -92,6 +94,7 @@ #define RP_IPC_TO_GUEST_PRIVATE_CANESCAPE (WM_APP + 226) // introduced in RetroPlatform API 7.2 #define RP_IPC_TO_GUEST_PRIVATE_LOGGING (WM_APP + 227) // introduced in RetroPlatform API 7.2 #define RP_IPC_TO_GUEST_PRIVATE_INPUTDEVICES (WM_APP + 228) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_GUEST_PRIVATE_KEYREMINDER (WM_APP + 229) // introduced in RetroPlatform API 7.2 // **************************************************************************** // Message Data Structures and Defines @@ -126,6 +129,7 @@ #define RP_FEATURE_MEMORY_BASIC 0x02000000 // Memory I/O basic features: Read, Write #define RP_FEATURE_MEMORY_ADVANCED 0x04000000 // Memory I/O advanced features: Watch, Find, Alert, Freeze, Lock, Unlock, Off (must set both flags if full set is supported!) #define RP_FEATURE_SCREENCAPTURE 0x08000000 // new screen capture functionality is available (see RP_IPC_TO_GUEST_SCREENCAPTURE message) +#define RP_FEATURE_RAWINPUT_EVENT 0x10000000 // RawInput mouse buttons events are forwarded via RP_IPC_TO_HOST_RAWINPUT_EVENT messages typedef struct RPScreenMode { diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 078ce625..03e20a67 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -2106,7 +2106,7 @@ static void initialize_windowsmouse (void) static uae_u8 rawkeystate[256]; static int rawprevkey; -static void handle_rawinput_2 (RAWINPUT *raw) +static void handle_rawinput_2 (RAWINPUT *raw, LPARAM lParam) { int i, num; struct didata *did; @@ -2156,12 +2156,20 @@ static void handle_rawinput_2 (RAWINPUT *raw) if (num == num_mouse) return; + USHORT usButtonFlags = rm->usButtonFlags; + +#ifdef RETROPLATFORM + if (isfocus() > 0 && usButtonFlags) { + usButtonFlags = rp_rawbuttons(lParam, usButtonFlags); + } +#endif + if (isfocus () > 0 || istest) { static int lastx[MAX_INPUT_DEVICES], lasty[MAX_INPUT_DEVICES]; static int lastmbr[MAX_INPUT_DEVICES]; for (i = 0; i < (5 > did->buttons ? did->buttons : 5); i++) { - if (rm->usButtonFlags & (3 << (i * 2))) { - int state = (rm->usButtonFlags & (1 << (i * 2))) ? 1 : 0; + if (usButtonFlags & (3 << (i * 2))) { + int state = (usButtonFlags & (1 << (i * 2))) ? 1 : 0; if (!istest && i == 2 && (currprefs.input_mouse_untrap & MOUSEUNTRAP_MIDDLEBUTTON)) continue; setmousebuttonstate (num, i, state); @@ -2215,7 +2223,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) } } if (isfocus () && !istest) { - if (did->buttons >= 3 && (rm->usButtonFlags & RI_MOUSE_MIDDLE_BUTTON_DOWN)) { + if (did->buttons >= 3 && (usButtonFlags & RI_MOUSE_MIDDLE_BUTTON_DOWN)) { if (currprefs.input_mouse_untrap & MOUSEUNTRAP_MIDDLEBUTTON) { if ((isfullscreen() < 0 && currprefs.win32_minimize_inactive) || isfullscreen() > 0) minimizewindow(0); @@ -2720,7 +2728,7 @@ void handle_rawinput (LPARAM lParam) if (GetRawInputData ((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof (RAWINPUTHEADER)) == dwSize) { raw = (RAWINPUT*)lpb; if (!isguiactive() || (inputdevice_istest() && isguiactive())) { - handle_rawinput_2 (raw); + handle_rawinput_2 (raw, lParam); } DefRawInputProc (&raw, 1, sizeof (RAWINPUTHEADER)); } else { diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index b93759ad..fe8b6b33 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -1557,6 +1557,7 @@ static void sendfeatures (void) feat |= RP_FEATURE_INPUTDEVICE_JOYPAD; feat |= RP_FEATURE_INPUTDEVICE_ANALOGSTICK; feat |= RP_FEATURE_INPUTDEVICE_LIGHTPEN; + feat |= RP_FEATURE_RAWINPUT_EVENT; write_log (_T("RP_IPC_TO_HOST_FEATURES=%x %d\n"), feat, WIN32GFX_IsPicassoScreen(mon)); RPSendMessagex (RP_IPC_TO_HOST_FEATURES, feat, 0, NULL, 0, &guestinfo, NULL); } @@ -2098,6 +2099,16 @@ end: return 0; } +USHORT rp_rawbuttons(LPARAM lParam, USHORT usButtonFlags) +{ + LRESULT lr; + if (!initialized) + return usButtonFlags; + if (RPSendMessage(RP_IPC_TO_HOST_RAWINPUT_EVENT, 0, lParam, NULL, 0, &guestinfo, &lr)) + usButtonFlags = (USHORT)lr; + return usButtonFlags; +} + int rp_isactive (void) { return initialized; diff --git a/od-win32/rp.h b/od-win32/rp.h index 9bdbc6d6..58aab764 100644 --- a/od-win32/rp.h +++ b/od-win32/rp.h @@ -19,6 +19,7 @@ extern HWND rp_getparent (void); extern void rp_rtg_switch (void); extern void rp_screenmode_changed (void); extern void rp_keymap(TrapContext*, uaecptr, uae_u32); +extern USHORT rp_rawbuttons(LPARAM lParam, USHORT usButtonFlags); extern TCHAR *rp_param; extern int rp_rpescapekey;