Results 1 to 10 of 10

Thread: XInput -> JVS IO adapter

  1. #1
    I asked for a
    Custom Rank and
    Learned My Lesson.

    Join Date
    Oct 2005
    Location
    USA

    Posts
    5,397

    XInput -> JVS IO adapter

    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 by SpamYouToDeath; 09-14-2018 at 11:58 PM.
    I turned off signatures. So should you.

  2. #2
    Metal Slug Mechanic
    shadowkn55's Avatar
    Join Date
    Dec 2006
    Location
    SoCal

    Posts
    2,177
    Awesome work. Makes me want to brush off the dust of a similar project I set aside ages ago.

  3. #3
    New Challenger

    Join Date
    Apr 2008
    Location
    Houston Tx

    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.

  4. #4
    I asked for a
    Custom Rank and
    Learned My Lesson.

    Join Date
    Oct 2005
    Location
    USA

    Posts
    5,397
    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.

    Quote Originally Posted by fisk View Post
    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.
    I turned off signatures. So should you.

  5. #5
    Crazed MVS Addict
    nam9's Avatar
    Join Date
    Oct 2014
    Location
    Norway

    Posts
    136
    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...

  6. #6
    I asked for a
    Custom Rank and
    Learned My Lesson.

    Join Date
    Oct 2005
    Location
    USA

    Posts
    5,397
    Quote Originally Posted by nam9 View Post
    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.
    I turned off signatures. So should you.

  7. #7
    Genbu's Turtle Keeper
    kuze's Avatar
    Join Date
    Apr 2013
    Location
    In the year 2248

    Posts
    2,391
    Pretty damn cool! Nice project.

  8. #8
    Cinema Ninja!
    bubba966's Avatar
    Join Date
    Sep 2013
    Location
    Washington

    Posts
    1,229
    Quote Originally Posted by shadowkn55 View Post
    Awesome work. Makes me want to brush off the dust of a similar project I set aside ages ago.
    Dust it off and sell me one at PRGE


    [Rot] 2:38 am: Z'OMG... ANYTHING... is cool in 15/70... even GregN home movies

  9. #9
    I asked for a
    Custom Rank and
    Learned My Lesson.

    Join Date
    Oct 2005
    Location
    USA

    Posts
    5,397
    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...
    I turned off signatures. So should you.

  10. #10
    I asked for a
    Custom Rank and
    Learned My Lesson.

    Join Date
    Oct 2005
    Location
    USA

    Posts
    5,397
    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.
    I turned off signatures. So should you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •