From 86e3e5fda281586d9e5c6cf9932ad02bc6897f2d Mon Sep 17 00:00:00 2001 From: elpoep <154061395+elpoeprod@users.noreply.github.com> Date: Fri, 31 Jan 2025 00:58:18 +0300 Subject: [PATCH 1/8] Update gm82joy.c --- gm82joy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gm82joy.c b/gm82joy.c index 7654d99..ba7e536 100644 --- a/gm82joy.c +++ b/gm82joy.c @@ -227,3 +227,7 @@ GMREAL joy_ball_y(double id, double ball) { } return 0; } + +GMREAL joy_rumble(double id, double strength) { + return SDL_JoystickRumble(sticks[(int)id], 0x0000, (Uint16)(int)strength, 1); +} From dd58916779a124821d75cb49f6b53f66e99c9b41 Mon Sep 17 00:00:00 2001 From: elpoep Date: Fri, 31 Jan 2025 01:05:00 +0300 Subject: [PATCH 2/8] Update gm82joy.gml --- gm82joy.gml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gm82joy.gml b/gm82joy.gml index e5a67be..8bc5cce 100644 --- a/gm82joy.gml +++ b/gm82joy.gml @@ -384,4 +384,15 @@ return __gm82joy_deadzone(__gm82joy_call("joy_axis",argument0,5)) + + +#define joystick_rumble + ///joystick_rumble(id,strength) + //id: joystick (0-31) + //strength: rumble strength (0-0xFFFF) + //returns: 0 if rumble is supported by controller, otherwise -1. + //*rumble is joystick's vibration. Useful for making an atmosphere. + return __gm82joy_call("joy_rumble",argument0,argument1) + + \ No newline at end of file From 372c318c245ba0ccfebfae168dbe348c4e30a788 Mon Sep 17 00:00:00 2001 From: elpoep Date: Fri, 31 Jan 2025 01:06:54 +0300 Subject: [PATCH 3/8] Update gm82joy.gej --- gm82joy.gej | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gm82joy.gej b/gm82joy.gej index a489e79..f04623b 100644 --- a/gm82joy.gej +++ b/gm82joy.gej @@ -336,6 +336,18 @@ ], "returntype": 2 }, + { + "name": "joystick_rumble", + "extname": "", + "calltype": 2, + "helpline": "", + "hidden": false, + "argtypes": [ + 2, + 2 + ], + "returntype": 2 + }, { "name": "__gm82joy_call", "extname": "", From fe2add2b3793a6c0ade032dfad2261174c55098e Mon Sep 17 00:00:00 2001 From: elpoep <154061395+elpoeprod@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:10:58 +0300 Subject: [PATCH 4/8] i need to read more manuals --- gm82joy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gm82joy.c b/gm82joy.c index ba7e536..e3fe8f7 100644 --- a/gm82joy.c +++ b/gm82joy.c @@ -229,5 +229,5 @@ GMREAL joy_ball_y(double id, double ball) { } GMREAL joy_rumble(double id, double strength) { - return SDL_JoystickRumble(sticks[(int)id], 0x0000, (Uint16)(int)strength, 1); + return SDL_JoystickRumble(sticks[(int)id], (Uint16)(int)strength, (Uint16)(int)strength, 1); } From 7f4e957d056a77e15625047838f5340bf18d9580 Mon Sep 17 00:00:00 2001 From: elpoep <154061395+elpoeprod@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:16:57 +0300 Subject: [PATCH 5/8] define rumble function --- gm82joy.gml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gm82joy.gml b/gm82joy.gml index 8bc5cce..41aa7b2 100644 --- a/gm82joy.gml +++ b/gm82joy.gml @@ -83,6 +83,7 @@ __gm82joy_define("joy_hat_y" ,ty_real,ty_real) __gm82joy_define("joy_ball_x" ,ty_real,ty_real) __gm82joy_define("joy_ball_y" ,ty_real,ty_real) + __gm82joy_define("joy_rumble" ,ty_real,ty_real) __gm82joy_call("joy_init") @@ -395,4 +396,4 @@ return __gm82joy_call("joy_rumble",argument0,argument1) - \ No newline at end of file + From 01d08134bbfdede4042c3e79b1bc46fecc0ff34f Mon Sep 17 00:00:00 2001 From: elpoep <154061395+elpoeprod@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:30:17 +0300 Subject: [PATCH 6/8] length parameter 1 --- gm82joy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gm82joy.c b/gm82joy.c index e3fe8f7..407f675 100644 --- a/gm82joy.c +++ b/gm82joy.c @@ -228,6 +228,6 @@ GMREAL joy_ball_y(double id, double ball) { return 0; } -GMREAL joy_rumble(double id, double strength) { - return SDL_JoystickRumble(sticks[(int)id], (Uint16)(int)strength, (Uint16)(int)strength, 1); +GMREAL joy_rumble(double id, double strength, double len) { + return SDL_JoystickRumble(sticks[(int)id], (Uint16)(int)strength, (Uint16)(int)strength, (Uint32)(int)len); } From 9fca9dbef213879a744aaaaee5207c1819676dc5 Mon Sep 17 00:00:00 2001 From: elpoep <154061395+elpoeprod@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:30:51 +0300 Subject: [PATCH 7/8] length parameter 2 --- gm82joy.gej | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gm82joy.gej b/gm82joy.gej index f04623b..ccb3c04 100644 --- a/gm82joy.gej +++ b/gm82joy.gej @@ -343,6 +343,7 @@ "helpline": "", "hidden": false, "argtypes": [ + 2, 2, 2 ], @@ -439,4 +440,4 @@ "constants": [] } ] -} \ No newline at end of file +} From 1771a64ed5466e50b6fd8c55eeb414930f298d38 Mon Sep 17 00:00:00 2001 From: elpoep <154061395+elpoeprod@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:31:58 +0300 Subject: [PATCH 8/8] length parameter 3 --- gm82joy.gml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gm82joy.gml b/gm82joy.gml index 41aa7b2..0bfea98 100644 --- a/gm82joy.gml +++ b/gm82joy.gml @@ -83,7 +83,7 @@ __gm82joy_define("joy_hat_y" ,ty_real,ty_real) __gm82joy_define("joy_ball_x" ,ty_real,ty_real) __gm82joy_define("joy_ball_y" ,ty_real,ty_real) - __gm82joy_define("joy_rumble" ,ty_real,ty_real) + __gm82joy_define("joy_rumble" ,ty_real,ty_real,ty_real) __gm82joy_call("joy_init") @@ -388,12 +388,13 @@ #define joystick_rumble - ///joystick_rumble(id,strength) + ///joystick_rumble(id,strength,len) //id: joystick (0-31) //strength: rumble strength (0-0xFFFF) + //len: length of rumble, in milliseconds (Uint32 ms) //returns: 0 if rumble is supported by controller, otherwise -1. //*rumble is joystick's vibration. Useful for making an atmosphere. - return __gm82joy_call("joy_rumble",argument0,argument1) + return __gm82joy_call("joy_rumble",argument0,argument1,argument2)