mirror of
https://github.com/marcriera/ddgo-pnp-controller.git
synced 2025-04-16 00:39:29 +02:00
Finish SLPH-00051 support
This commit is contained in:
parent
f317be0f15
commit
b2daa5d017
2 changed files with 72 additions and 60 deletions
|
@ -21,9 +21,10 @@ This mod allows you to use your Densha de GO! Plug & Play as a USB controller fo
|
||||||
Connect the Plug & Play to a PC or console using the data cable. Press one of the following button combinations to select the controller you want to emulate:
|
Connect the Plug & Play to a PC or console using the data cable. Press one of the following button combinations to select the controller you want to emulate:
|
||||||
|
|
||||||
| Controller | Button combination | Notes |
|
| Controller | Button combination | Notes |
|
||||||
|-----------------------------------------|-----------------------|--------------------------------------------------|
|
|-----------------------------------------|--------------------------|--------------------------------------------------|
|
||||||
| One handle controller (Nintendo Switch) | UP | SELECT+START=HOME, SELECT+LEFT=L, SELECT+RIGHT=R |
|
| One handle controller (Nintendo Switch) | UP | SELECT+START=HOME, SELECT+LEFT=L, SELECT+RIGHT=R |
|
||||||
| Two handle controller (PC) | RIGHT | D-Pad is mapped to SELECT+ABCD |
|
| Two handle controller (PC) | RIGHT | D-Pad is mapped to SELECT+ABCD |
|
||||||
|
| Two handle controller (PS1) | DOWN + Power handle at 0 | Hold D to disable handles and enable D-Pad |
|
||||||
| Two handle controller "Type 2" (PS2) | D | |
|
| Two handle controller "Type 2" (PS2) | D | |
|
||||||
| Shinkansen controller (PS2) | B | Power notches are mapped to P2-P4-P7-P10-P13 |
|
| Shinkansen controller (PS2) | B | Power notches are mapped to P2-P4-P7-P10-P13 |
|
||||||
| Multi Train Controller (PS2) - P4/B7 | C + Power handle at 0 | SELECT+A=A2, SELECT+D=ATS, SELECT+D-Pad=Reverser |
|
| Multi Train Controller (PS2) - P4/B7 | C + Power handle at 0 | SELECT+A=A2, SELECT+D=ATS, SELECT+D-Pad=Reverser |
|
||||||
|
|
|
@ -134,10 +134,13 @@ bitflags! {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_gadget(state: &mut ControllerState) {
|
pub fn update_gadget(state: &mut ControllerState) {
|
||||||
let mut buttons1 = Buttons1::UP | Buttons1::DOWN;
|
let mut buttons1 = Buttons1::NONE;
|
||||||
let mut buttons2 = Buttons2::NONE;
|
let mut buttons2 = Buttons2::NONE;
|
||||||
|
|
||||||
|
// If D is pressed, D-pad mode is active
|
||||||
|
if !state.button_d {
|
||||||
// Calculate data for handles
|
// Calculate data for handles
|
||||||
|
buttons1.insert(Buttons1::UP | Buttons1::DOWN);
|
||||||
match state.power {
|
match state.power {
|
||||||
0 => {
|
0 => {
|
||||||
buttons1.insert(Buttons1::LEFT | Buttons1::RIGHT);
|
buttons1.insert(Buttons1::LEFT | Buttons1::RIGHT);
|
||||||
|
@ -190,6 +193,14 @@ pub fn update_gadget(state: &mut ControllerState) {
|
||||||
}
|
}
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// D-pad mode
|
||||||
|
if state.button_up { buttons1.insert(Buttons1::UP) }
|
||||||
|
if state.button_down { buttons1.insert(Buttons1::DOWN) }
|
||||||
|
if state.button_left { buttons1.insert(Buttons1::LEFT) }
|
||||||
|
if state.button_right { buttons1.insert(Buttons1::RIGHT) }
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate data for buttons
|
// Calculate data for buttons
|
||||||
if state.button_a { buttons2.insert(Buttons2::SQUARE) }
|
if state.button_a { buttons2.insert(Buttons2::SQUARE) }
|
||||||
|
|
Loading…
Add table
Reference in a new issue