Next Generation Emulation banner

1 - 7 of 7 Posts

·
Registered
Joined
·
3 Posts
Discussion Starter · #1 ·
Hi. I'm working on a Silent Hill 1 conversion to PC, using the ePSXe emulator as a base. I am aware it's already been done, but the other conversion laked some key features, namely gamepad support. For me, the ONLY way to play Silent Hill is with my gamepad, so i decided to do my own conversion.

Everything is working so far, except now i have to code the section that allows you to redefine input, and I can't decipher your registry codes. I would really like an explanation of how this works! I appreciate any help anyone has. Also remember: I need ot be able to use joystick as well. (i've already handled that from my end, now i just need the keycodes)

Credit has been given to the ePSXe team, and if you don't want me doing this, give the word. The PC conversion will be provided free online (minus the PSX ISO of course) when it is finished.

Thanks Alot!
 

·
Premium Member
Joined
·
21,977 Posts
why dont you just make a config file for a frontend that already exists, like Delta. that'd take like 10 minutes and it'd be much much easier. and you'd make Betamax happy ;)
 

·
Registered
Joined
·
9,506 Posts
True, but I'm not going to hold him back on that regard ;). However I'll warn ya know that you'll basically end up writing the guts of a psx pad plugin to pull this off ;).

Registry keys:

KeysX: Button layout for gamepad X. This includes the d pad. KeysX has the following layout

keysX = dPadLeft + "," + dPadRight + "," + dPadUp + "," +dPadDown + "," + triangle + "," + circle + "," + cross + "," + square + "," + triggerL1 + "," + triggerL2 + "," + triggerR1 + "," + triggerR2 + "," + startButton + "," + selectButton + "," +triggerL3 + "," + triggerR3;

GamepadAxis: Controls for the analogue sticks for all 4 pads. The first 4 entries are for pad1, the next 4 are for pad 2 etc. These groups are arranged as follows:

axisSubString = leftXAxis + "," + leftYAxis + "," + rightXAxis + "," + rightYAxis;


GamepadX: other configuration options (self explainitory). Each no is the setting for a pad, with pad 1 first, then pad 2 etc...

KeysX code nos:

0-255 standard direct input keymaps (see directX documentation)
256-511 joypad maps: Far too many to list directly. However you can work out the codes via these formulae

epsxeCode = 256 + 32*(jNoInt-1) + 16 + joyCode; // for buttons
epsxeCode = 384 + 32*(jNoInt -1) + pov/9000; // for POV
epsxeCode = 256 + 32*(jNoInt -1) + n; // for folks that try to map analogue controls to the dpad

where

epsxeCode = registry code no.
jNoInt = phsycial joypad no (as reported in control panel)
joycode = button no reported by directX
pov = POV displacement reported by directX
n = axis code no (left = 0, right = 1, down =2 and up = 3 )

Good luck ;)
 

·
Registered
Joined
·
3 Posts
Discussion Starter · #6 · (Edited)
awww man! I knew this was gonna be tough...

to be honest i am not really familiar with directx programming, and i was using the windows api for joystick input. Ill check the directx documentation, since they shouldnt be all that different. Thanks alot! This will really help.

physical joypad is easy...
what are the max, min values for the pov? windows api gives me 0-65535
what are the joypad buttons? cause I get 0-15
and i think i can handle the axis codes.

this is a great start anyways. Thanks alot Betamax. I appreciate it.

and I suppose i could make a frontend, but i want to be able to say "Inventory = I" and not "Square Button = I". Also, since I'm trying to make this seem like an authentic PC game, i want it to be similar to the other Silent Hill configuration dialogs for the versions that are on PC. (That, and I've already finished everything else but the key configureation)
 

·
Registered
Joined
·
9,506 Posts
>What are the max, min values for the pov? windows api gives me 0-65535

erm 0-36000

>what are the joypad buttons? cause I get 0-15

correct.
 
1 - 7 of 7 Posts
Top