Help with remapper - merging inputs

Gtuner IV general support. Operation, questions, updates, feature request.

Help with remapper - merging inputs

Postby ninjaninja2001 » Sun Dec 24, 2017 5:13 am

Hello, I have not quite figured out how to do what I am trying to do:

Input B has a PS4 gamepad, and I want to ignore all sticks and buttons except 8 buttons (Dpad + 4 face buttons)

Input A is also a PS4 gamepad, and I want to be standard passthrough (no remap, and all buttons)

For the output, I want some buttons (eg CROSS) to be InputA OR InputB (if either or both is pressed then it is pressed)

I am familiar with GPC scripts, but I am not sure how to describe inputs from different sources.
User avatar
ninjaninja2001
Master Sergeant
Master Sergeant
 
Posts: 31
Joined: Wed Aug 17, 2016 8:30 pm

Re: Help with remapper - merging inputs

Postby ninjaninja2001 » Sun Dec 24, 2017 5:36 am

Okay, so here is where I am at this point -
I have figured out how to create a GPC script using remapper(...) that works, but I mapped all of the unused inputs to ACCEL_2_Z (like Sky418 does...). Is there a better way to handle this? I probably don't want ACCEL_2_Z to always be a bonkers value. I'd rather just park it to a NULL (but NULL doesn't work, it maps to BUTTON_1).
User avatar
ninjaninja2001
Master Sergeant
Master Sergeant
 
Posts: 31
Joined: Wed Aug 17, 2016 8:30 pm

Re: Help with remapper - merging inputs

Postby sky418 » Sun Dec 24, 2017 7:24 am

Something like (last firmware update if interest in what firmware)
Code: Select all
const uint8 mapG13K[] = {
    RMP_USB_D,
//     RMP_USB_A,
    NULLNULLBUTTON_12, BUTTON_21BUTTON_13NULLBUTTON_3,
    NULLNULLBUTTON_20, ACCEL_2_Y, ACCEL_2_X, NULL, NULL,
    BUTTON_7, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, STICK_2_X, STICK_2_Y,
    NULL, BUTTON_9, BUTTON_4, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, BUTTON_1, BUTTON_2
};

Everything works, but some times BUTTON_20 or ACCEL_2_X stops responce. And i still don't understanding why.
And one more
Only the last remap button will work
so if you have something like this
Code: Select all
NULLNULLBUTTON_12, BUTTON_21BUTTON_13NULLBUTTON_12,

only the last key BUTTON 12 will response.
So instead of NULL you may do any button but only the latest will work
Code: Select all
BUTTON_12BUTTON_12BUTTON_12, BUTTON_21BUTTON_13BUTTON_13BUTTON_13,

And if you have NULL is equal BUTTON_1 you may try this
Code: Select all
NULLNULLNULL, BUTTON_21NULLNULLBUTTON_1,
User avatar
sky418
Command Sergeant Major
Command Sergeant Major
 
Posts: 124
Joined: Fri Nov 25, 2016 4:28 am

Re: Help with remapper - merging inputs

Postby Sillyasskid » Tue Dec 26, 2017 9:09 pm

ninjaninja2001 wrote:Is there a better way to handle this? I probably don't want ACCEL_2_Z to always be a bonkers value. I'd rather just park it to a NULL (but NULL doesn't work, it maps to BUTTON_1).
Hey, take a look at this below,

The Identifier BUTTON_1 expands to 0.
Image
You view/open the GPC input Reference in GtunerIV by pressing F1

Coincidentally NULL will also expand to 0.
This behavior is to be expected.
When you think about it, using NULL is actually no different than using BUTTON_1.


Anyways, This should work for what you had requested.
Code: Select all
#include <remapper.gph>
#define  RMP_NULL 255
const uint8 PortB_Mapping[39] = {                 
    RMP_USB_B,
    RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL,
    RMP_NULL, RMP_NULL, BUTTON_10, BUTTON_11, BUTTON_12, BUTTON_13, BUTTON_14,
    BUTTON_15, BUTTON_16, BUTTON_17, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL,
    RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL,
    RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL, RMP_NULL,
    RMP_NULL, RMP_NULL, RMP_NULL
};
init{
remapper(PortB_Mapping);
}
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Help with remapper - merging inputs

Postby J2Kbr » Wed Dec 27, 2017 10:17 am

Sillyasskid is correct NULL is the same as map to BUTTON_1.

However, using 255 can result in unpredicted behavior, as it overflows the structure that holds the I/O data.

A proper NULL mapping will be implemented soon, in the mean time the recommended is use the ACCEL_2_Z for this purpose.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to Gtuner IV Support

Who is online

Users browsing this forum: No registered users and 128 guests

cron