What's new

Niko

Champion
Joined
Sep 22, 2015
Messages
1,159
Reaction score
1,825
Location
Louisville, Kentucky
Last edited:
Very cool, Niko. Thanks for sharing this with the community!
 
As someone who has not been following your X2 thread (I'm assuming this is related to that in some way), what exactly does this do?
 
As someone who has not been following your X2 thread (I'm assuming this is related to that in some way), what exactly does this do?
Technically this could be used with any PC based system that uses JVS. It basically connects to the COM port and communicates with JVS I/O allowing you to interpret the inputs. On the TypeX2 I use it to map JVS input to keyboard keys so users can interface with the GUI, or other non X2 games that might accept keyboard input.
 
question how do you handle key release. i either get one short press or i have it stuck on in games
 
fixed. i derped very hard on this one. forgot to specify the wscan on key up. may have been working on this for a few hours. :rolleyes:
 
https://mega.nz/#!5thiHBrb!SXGuljtAPTATKNpbJfTwrH_Xdbjd_QDUfcmlyHZ8JiA

RE-Uploaded Niko's source setup to use keyboard.

For the non programmers.
You will need Visual Studio (VS). VS 2015 express will be fine and is free.

Once VS is installed open the file cjvs.sln.
This should open VS automatically.
On the right side panel you should see a file called key_config.h.
This is the file you will need to edit for your desired layout.

At the top of the file is a link to a site which has all the hex scancodes you can use.
Eg. the Enter key's scan code is 0x1C so
#define P1_START 0xFF would become #define P1_START 0x1C if you wanted to use Enter for start.

I have preset player one joystick to arrow keys as they require a little extra code in the main program file to work correctly.
Player 1 start + button 1 will execute what ever #define S_ESC is set to.
Once you have edited the file to your liking press CTRL + S to save the file.

Now on the top panel you will see 2 drop down boxes one saying debug and another x64.
You will need to change debug to release and x64 to x86.
Once you have them selected. click on build in the top bar menu and select build solution.
This will create a folder called release in the folder cjsv.sln is. Inside this folder is your program you can use.
cjvs.exe.

If you have any issues or questions don't hesitate to ask.

Also a big shout out to Niko for his jvs code he has done some amazing work with it.
 
If you have any issues or questions don't hesitate to ask.

Also a big shout out to Niko for his jvs code he has done some amazing work with it.
Sorry Corey, well first of all thanks for the tutorial.
I have some stupid questions...
I did compile the code adding custom keys mapping, no problem at all.
Now, since I didn't find any reference to serial port in the code, this mean that i can not use any rs-422/485 serial adapter?
I have to strictly use the Taito JVS I/O board?
The software just doesen't seems to run, i don't even find a process in the Windows Task Manager.
This is how is suppose to work or is that related to the missing Taito I/O?

Many thanks
 
the software is configured to run on com2 which is the com port a TTX uses for its 485 to 232 adapter and subsequently the jvs io board.
it should work with any jvs io board. the should means it has been tested on the main common boards so your results may vary on clones and uncommon ones.

if it cant bind to COM2 it will auto close. if all is working it will display a blank cmd window. well i think its blank haven't used the tool in awhile so cant remember

if you search the source code for com2 you can then change to the required port you need or you can change your com port to com2 in device manager.
 
Thanks coery
I actually did the test only with my USB>Serial adapter set on com1, I will try again tomorrow ^^
 
With the com2 present the software run in background without any problem.
I did the teste with an USB>rs422 adapter, the rs485 will arrive very soon.
Thank you Corey and of course big thanks to Niko
 
Ok, so i bought this cheap ass usb>rs485 converter which use an original FTDI chip.
416LhusbDpL.jpg

And It's working very well so far.
Thank Corey for the tutorial and again, thanks Niko (have a beer on me man!)
 
Thank Corey for the tutorial and again, thanks Niko (have a beer on me man!)
No worries happy to help.

That plug-able terminal block is nice especially on a cheaper board like that.
 
Thanks for this guys, modified the keyboard definitions and compiled and it works really well. :thumbsup:

It doesn't however work with MAME, any ideas why? It works in great explorer, windows games that I've tested and a MAME GUI but not MAME itself.

Cheers.
 
mame uses its own keys and is configuable

The MAME defaults are defined in src\inptport.c


Player 1:
Button 1 - Left Control
Button 2 - Left Alt
Button 3 - Spacebar
Button 4 - Left Shift
Button 5 - Z
Button 6 - X
Button 7 - C
Button 8 - V
Button 9 - B
Button 10 - N
Start - 1
Coin - 5
Up - Up Arrow
Down - Down Arrow
Left - Left Arrow
Right - Right Arrow


Player 2:
Button 1 - A
Button 2 - S
Button 3 - Q
Button 4 - W
Up - R
Down - F
Left - D
Right - G
Start - 2
Coin - 6


Player 3:
Button 1 - Right Control
Button 2 - Right Shift
Button 3 - Enter
Up - I
Down - K
Left - J
Right - L
Start - 3
Coin - 7


Player 4:
Button 1 - 0 Pad
Button 2 - Del Pad
Button 3 - Enter Pad
Up - 8 Pad
Down - 2 Pad
Left - 4 Pad
Right - 6 Pad
Start - 4
Coin - 8
 
i think mame actually has an issue with reading the inputs generated by the tool i havent looked at this for quite awhile so not 100% on that


Edit:
Just looked at the code again and i used scancodes so technically it should work with anything as that is supposed to mimic a hardware interrupt.
Well that's what i got from the documentation of sendinput and why i used it over VKs which more mimics the keys presses on the on screen keyboard and requires window focus and so on.

i have no way of testing at the moment so i cant investigate the issue.
 
Last edited:
Back
Top