Output protocol Auto

GPC2 script programming for Titan Two. Code examples, questions, requests.

Output protocol Auto

Postby fulash » Sun Dec 19, 2021 6:40 pm

Hi,

I use my Titan Two to play on PS5 & PC. I use a Dualshock 4 in Bluetooth.
To avoid must change the output protocol many times with Gtuner, I have put USB Automatic by default.
I believe on PS5 it's PS4 protocol and PC it's XB1 protocol but I want PS5 protocol and XB360.
I have make a script to have good protocol automatically but it don't works. My Titan Two display R and 0 intermittently.
Image

Can you help me?
Thanks
User avatar
fulash
Private First Class
Private First Class
 
Posts: 2
Joined: Sun Dec 19, 2021 6:18 pm

Re: Output protocol Auto

Postby Mad » Sun Dec 19, 2021 9:25 pm

Post your code so we can take a look.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Output protocol Auto

Postby fulash » Sun Dec 19, 2021 9:30 pm

Code: Select all
int timeInit;
bool activeAutoPress;
bool canActiveAutoPress;
bool canChangeProtocol;
uint8 outputProtocol;
 
init {   
    pmem_load(); // load directly XB360 when switch script from 2nd script
    if (pmem_read(0)==1) {
        port_connect(PORT_USB_C, PROTOCOL_XB360);
        outputProtocol=PROTOCOL_XB360;
        pmem_write(0, 0);
        pmem_save();
    } else { // load good protocol
        if (port_status(PORT_USB_C, &outputProtocol, NULL) & DIR_OUTPUT) {
            if (outputProtocol==PROTOCOL_XB1) {
                port_connect(PORT_USB_C, PROTOCOL_XB360);
                outputProtocol=PROTOCOL_XB360;
            } else if (outputProtocol==PROTOCOL_PS4) {
                port_connect(PORT_USB_C, PROTOCOL_PS5);
                outputProtocol=PROTOCOL_PS5;
            }   
        }
    }
    timeInit=0;
    activeAutoPress=FALSE;
    canActiveAutoPress=TRUE;
    canChangeProtocol=TRUE;
}
User avatar
fulash
Private First Class
Private First Class
 
Posts: 2
Joined: Sun Dec 19, 2021 6:18 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 71 guests