XInput -> JVS IO adapter

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
I had been playing NAOMI games on my TV using a supergun and JAMMA converter board, but of course that gets pretty unwieldy. I was frustrated with the giant pile of electronics necessary to run it all. The NAOMI has its own PSU and already outputs VGA video and stereo line-level audio... so really, the supergun and JAMMA converter were only necessary to provide the input. I figured I could make a much smaller solution - something that would just act as a JVS IO slave, and provide the switch inputs from some kind of game controller.

The JVS IO protocol isn't documented anywhere in English, but there's a Japanese spec floating around, and some people have made working implementations.
This guy made a IO slave out of an Arduino-type board:
https://github.com/charcole/TeensyJVS

These two guys have pretty good documentation:
https://github.com/TheOnlyJoey/openjvs/wiki/Protocol
http://wiki.pcbotaku.com/wiki/JVS_I/O

So with those resources, the Japanese copy of the spec, and Google Translate, I was able to get a working implementation mocked up on my computer in an hour or two. It responded correctly to the sample frames on those web pages, and was reasonably simple to run.

So I started looking for a microcontroller that could handle it, and also poll some kind of game controller for input. It would have been trivial to support an SNES or PSX controller or something, but those are actually getting hard to find now. Most consoles for the last 10 years have been USB-based, so I decided to go with something that could host a USB bus.

I settled on the PIC32MX220, which was convenient because I already had a development kit from a college class.

With the PIC32 and a MAX485 transceiver, I was able to make up a prototype that could poll an Xbox controller and relay the results to a JVS game:

mess.jpg

(Seen here amongst a very messy workspace)

So I made up a circuit board and ordered a batch from DirtyPCBs. The whole thing fits in 40x80mm - really tiny, though I used all through-hole parts to make the soldering easy.

blank.jpg


The parts got here today, and I put one together - including a little aluminum case for it. (I didn't have anything to properly cut the end caps, though.)

soldered.jpg
box.jpg

There's two LED lights. I use one to indicate whether a USB gamepad device has been enumerated, and one to indicate that the JVS master has assigned an address to the adapter.

chain.jpg

It works great for one player right now, but it's still a bit unfinished. Obviously I need to support USB hubs to handle multiple controllers, and it's a real pain to write all that USB driver code from scratch. I'm working on it, though. Also, there's an EEPROM on board for saving control settings, but the software doesn't yet support that.

test.jpg
 
Last edited:

shadowkn55

Genbu's Turtle Keeper
15 Year Member
Joined
Dec 9, 2006
Posts
2,386
Awesome work. Makes me want to brush off the dust of a similar project I set aside ages ago.
 

fisk

n00b
Joined
Apr 22, 2008
Posts
20
Will you be selling these in the future? I have a couple NAOMI's that I have consolized and would love to try this out on them.
 

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
I worked a bit more on this over the weekend - I got support for the EEPROM working, and set it up so I can rebind controls on-the-fly and have them saved across power cycles. With that, I've confirmed that all of the design is functional - so I went ahead and assembled the rest of the boards.

assem.jpg

I still don't have hub support implemented - I'm dreading that mess. According to Microsoft, there's all kinds of ways that a hub can misbehave, and they just handle it all in the drivers. So, that's going to be fun.

Will you be selling these in the future? I have a couple NAOMI's that I have consolized and would love to try this out on them.

Well, I've got 10 of them. I just can't guarantee that they'll work with a given USB device in advance. Let's say... I'll sell them to anyone who has their own PIC programmer. They cost me about $30/each to make.
 

nam9

Zero's Secretary
Joined
Oct 24, 2014
Posts
151
Would a PicKit 3 be sufficient to program with?
This looks interesting for a TTX2 buil I am working on, as well as the Naomi...
 

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
Would a PicKit 3 be sufficient to program with?
This looks interesting for a TTX2 buil I am working on, as well as the Naomi...

Yeah, it's just a PIC32MX220 and I've got their standard programming connector on the board (should be the same 6-pin port as on the PICKit3).

I mainly want to avoid implementing a firmware update feature - it would be technically possible to reflash the thing using a file on a USB drive, but that would probably triple the amount of code needed on the PIC. Programmers for the PIC are super-cheap anyway. I assume anyone who wants something like this doesn't mind getting familiar with it.
 

kuze

Akari's Big Brother
10 Year Member
Joined
Apr 20, 2013
Posts
2,549
Pretty damn cool! Nice project.
 

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
I'm working on PS3/PS4 controller support, but they're not as obvious as an XInput controller. They seem to just look like regular HID-class devices, and I'm not sure how to properly determine that something "is a PS3 controller" or "is a PS4 controller". I can detect and use the first-party DualShock 4, though.

I hooked up analog controls as a hack, and got very distracted playing Crazy Taxi...
 

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
After a bit more frustration, I've got USB hubs working now. So, I can connect 4 controllers, and play 4-player games (i.e. Power Stone 2) with them. I light up the XInput LEDs according to the player number; I still haven't gotten around to making the DS4 LEDs work.

hub.jpg

I'm still a bit confused as to exactly what distinguishes a PS3 or PS4 controller from a usual USB HID.
 

Epyc

n00b
Joined
Jan 28, 2020
Posts
2
We briefly chatted, any updates on this? I’m particularly interested in the JVS to Discrete adapter you mentioned.
 

JoeAwesome

I survived Secret Santa, It wasn't Easy.,
Joined
Feb 19, 2016
Posts
3,090
Wow. This would be crazy with a TTX2 multi setup.
 

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
I'm working on a better approach (i.e. not hosting the USB myself) but my PCB order ran into the New Year holiday. The factory re-opens on the 4th so I should be able to test the new boards soon. I'll post a new thread about those when I've got them working.
 

SpamYouToDeath

I asked for a, Custom Rank and, Learned My Lesson.
15 Year Member
Joined
Oct 3, 2005
Posts
6,059
The factory finally re-opened and shipped the PCBs. So, that's coming as soon as I get some assembled and tested.
 
Top