psx - fix input

This commit is contained in:
zeromus 2014-12-16 04:02:55 +00:00
parent 69473b842c
commit 98cf92a665
2 changed files with 44 additions and 45 deletions

View File

@ -1,7 +1,7 @@
//TODO hook up newer file ID stuff, think about how to combine it with the disc ID
//TODO change display manager to not require 0xFF alpha channel set on videoproviders. check gdi+ and opengl! this will get us a speedup in some places
//TODO Disc.Structure.Sessions[0].length_aba was 0
//TODO add sram dump option (bold it if dirty) to file menu
//TODO mednafen 0.9.37 changed some disc region detection heuristics. analyze and apply in c# side. also the SCEX id handling changed, maybe simplified
using System;
using System.ComponentModel;
@ -35,14 +35,13 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
"P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 Select", "P1 Start", "P1 Square", "P1 Triangle", "P1 Circle", "P1 Cross", "P1 L1",
"P1 R1", "P1 L2", "P1 R2", "P1 L3", "P1 R3", "P1 MODE",
//"P2 Up", "P2 Down", "P2 Left", "P2 Right", "P2 Select", "P2 Start", "P2 Square", "P2 Triangle", "P2 Circle", "P2 Cross", "P2 L1",
//"P2 R1", "P2 L2", "P2 R2", "P2 L3", "P2 R3", "P2 MODE",
// "P2 R1", "P2 L2", "P2 R2", "P2 L3", "P2 R3", "P2 MODE",
"Eject", "Reset",
},
FloatControls =
{
"P1 LStick X", "P1 LStick Y", "P1 RStick X", "P1 RStick Y",
//"P2 LStick X", "P2 LStick Y", "P2 RStick X", "P2 RStick Y",
//TODO: Fix "Disc Switch",
"Disc Select",
},
FloatRanges =
@ -302,28 +301,28 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
uint buttons = 0;
//dualshock style
if (Controller["Select"]) buttons |= 1;
if (Controller["L3"]) buttons |= 2;
if (Controller["R3"]) buttons |= 4;
if (Controller["Start"]) buttons |= 8;
if (Controller["Up"]) buttons |= 16;
if (Controller["Right"]) buttons |= 32;
if (Controller["Down"]) buttons |= 64;
if (Controller["Left"]) buttons |= 128;
if (Controller["L2"]) buttons |= 256;
if (Controller["R2"]) buttons |= 512;
if (Controller["L1"]) buttons |= 1024;
if (Controller["R1"]) buttons |= 2048;
if (Controller["Triangle"]) buttons |= 4096;
if (Controller["Circle"]) buttons |= 8192;
if (Controller["Cross"]) buttons |= 16384;
if (Controller["Square"]) buttons |= 32768;
if (Controller["MODE"]) buttons |= 65536;
if (Controller["P1 Select"]) buttons |= 1;
if (Controller["P1 L3"]) buttons |= 2;
if (Controller["P1 R3"]) buttons |= 4;
if (Controller["P1 Start"]) buttons |= 8;
if (Controller["P1 Up"]) buttons |= 16;
if (Controller["P1 Right"]) buttons |= 32;
if (Controller["P1 Down"]) buttons |= 64;
if (Controller["P1 Left"]) buttons |= 128;
if (Controller["P1 L2"]) buttons |= 256;
if (Controller["P1 R2"]) buttons |= 512;
if (Controller["P1 L1"]) buttons |= 1024;
if (Controller["P1 R1"]) buttons |= 2048;
if (Controller["P1 Triangle"]) buttons |= 4096;
if (Controller["P1 Circle"]) buttons |= 8192;
if (Controller["P1 Cross"]) buttons |= 16384;
if (Controller["P1 Square"]) buttons |= 32768;
if (Controller["P1 MODE"]) buttons |= 65536;
byte left_x = (byte)Controller.GetFloat("LStick X");
byte left_y = (byte)Controller.GetFloat("LStick Y");
byte right_x = (byte)Controller.GetFloat("RStick X");
byte right_y = (byte)Controller.GetFloat("RStick Y");
byte left_x = (byte)Controller.GetFloat("P1 LStick X");
byte left_y = (byte)Controller.GetFloat("P1 LStick Y");
byte right_x = (byte)Controller.GetFloat("P1 RStick X");
byte right_y = (byte)Controller.GetFloat("P1 RStick Y");
OctoshockDll.shock_Peripheral_SetPadInput(psx, 0x01, buttons, left_x, left_y, right_x, right_y);
}

View File

@ -630,23 +630,23 @@
"Power": ""
},
"DualShock Controller": {
"Up": "X1 DpadUp,UpArrow",
"Down": "X1 DpadDown,DownArrow",
"Left": "X1 DpadLeft,LeftArrow",
"Right": "X1 DpadRight,RightArrow",
"Select": "X1 Back,Space",
"Start": "X1 Start,Return",
"Square": "X1 X,A",
"Triangle": "X1 Y,S",
"Circle": "X1 B,X",
"Cross": "X1 A,Z",
"L1": "X1 LeftShoulder,Q",
"R1": "X1 RightShoulder,W",
"L2": "X1 LeftTrigger,E",
"R2": "X1 RightTrigger,R",
"L3": "X1 LeftThumb,T",
"R3": "X1 RightThumb,Y",
"MODE": "A"
"P1 Up": "X1 DpadUp,UpArrow",
"P1 Down": "X1 DpadDown,DownArrow",
"P1 Left": "X1 DpadLeft,LeftArrow",
"P1 Right": "X1 DpadRight,RightArrow",
"P1 Select": "X1 Back,Space",
"P1 Start": "X1 Start,Return",
"P1 Square": "X1 X,A",
"P1 Triangle": "X1 Y,S",
"P1 Circle": "X1 B,X",
"P1 Cross": "X1 A,Z",
"P1 L1": "X1 LeftShoulder,Q",
"P1 R1": "X1 RightShoulder,W",
"P1 L2": "X1 LeftTrigger,E",
"P1 R2": "X1 RightTrigger,R",
"P1 L3": "X1 LeftThumb,T",
"P1 R3": "X1 RightThumb,Y",
"P1 MODE": "A"
},
"Lynx Controller": {
"Up": "UpArrow",
@ -963,22 +963,22 @@
"WonderSwan Controller": {},
"Lynx Controller": {},
"DualShock Controller": {
"LStick X": {
"P1 LStick X": {
"Value": "X1 LeftThumbX",
"Mult": 1.0,
"Deadzone": 0.1
},
"LStick Y": {
"P1 LStick Y": {
"Value": "X1 LeftThumbY",
"Mult": 1.0,
"Deadzone": 0.1
},
"RStick X": {
"P1 RStick X": {
"Value": "X1 RightThumbX",
"Mult": 1.0,
"Deadzone": 0.1
},
"RStick Y": {
"P1 RStick Y": {
"Value": "X1 RightThumbY",
"Mult": 1.0,
"Deadzone": 0.1