Offline
Michigan

Real slick Ben.

Offline
Ardèche, France
BennVenn wrote:

The gameboy could never support USB, it just doesn't have the bandwidth or IO to generate USB compatible signaling. All USB cables must have a protocol translator within.

Personally, I'm not a programmer, but a friend of mine (a data scientist), when I've send him a link to this topic, said to me that, apparently, the gameboy can handle USB, then he linked me this, and said the gameboy can handle a serial link of about 9600bps (I don't really know what this means), and then he tells me USB can largely handle this.
I've tell him to create an account for cm.org, but actually he's at work.

Also, he talked about a cable, Link to USB, he had when he was young, to replace a Gameboy Printer by a normal USB serial printer. He had this with his Pokémon Gold collector edition.

Offline
Austin, TX

Really looking forward to seeing what comes of all this.

Offline
Austin, TX

edit: double post

Last edited by HimsyPimsy (Feb 15, 2016 6:19 pm)

Offline
Unsubscribe

why not just use a nes to usb type controller?
http://www.amazon.com/Classic-USB-NES-C … B002YVD3KM

Offline
Australia
Adzetko wrote:
BennVenn wrote:

The gameboy could never support USB, it just doesn't have the bandwidth or IO to generate USB compatible signaling. All USB cables must have a protocol translator within.

Personally, I'm not a programmer, but a friend of mine (a data scientist), when I've send him a link to this topic, said to me that, apparently, the gameboy can handle USB, then he linked me this, and said the gameboy can handle a serial link of about 9600bps (I don't really know what this means), and then he tells me USB can largely handle this.
I've tell him to create an account for cm.org, but actually he's at work.

Also, he talked about a cable, Link to USB, he had when he was young, to replace a Gameboy Printer by a normal USB serial printer. He had this with his Pokémon Gold collector edition.

Happy to discuss this with your friend. The main 2 reasons it can't work are the electrical interface - USB uses a differential data pair. These are both inputs and outputs. This requires the gameboy to have total control over 2 io pins. The gameboy has a primitive shift register and only one input and output pin.

Second is timing. The USB spec is very timing sensitive and you have a very small window to acknowledge a token/request/reset. This cannot ever be achieved at 9600bps. Ever. Even on the GBC it doesnt have the speed.

Then there is the frame construction, crc, error handling, address handling. These are all usually handled in a hardware usb engine due to the speed they must run at.

Then we get Into the software layer which is a little easier and given the rom space we could have datastreams ready to shift out so the gameboy doesnt have to think.

Small avr's have managed a software only usb engine but they are very primitive and can really only shift a byte back and forward at very slow speed and not do much else.

His cable is likely the madcatz LPT cable. It isn't usb. The later versions are usb and have a usb micro in the cable.

Happy to be proven wrong on this. Its amazing what people get old hardware to do.

Offline
Australia
herr_prof wrote:

why not just use a nes to usb type controller?
http://www.amazon.com/Classic-USB-NES-C … B002YVD3KM

We're after the authenticity of the real gb interface. Plus most of us have a flash cart to run the software required and the soldering is dead simple. 4 wires into a through hole board.

Offline
Unsubscribe

Well you better wip up a VNC screen of the emulator output while you are at it big_smile

Offline
Australia

OK, I've got the ARM firmware reading the 8 bits from the gameboy then reading a 9th bit just to be safe. This means worst case we loose a bit and everything gets messed up, it will only be that way for 1 USB frame (~1ms) until we're back in sync. Worst case on startup, that is first powering up the gameboy, we'll have to wait 8ms for a complete new re-sync. I can live with that!

After playing flappy bird for about 5 minutes I didn't get one mis-sync so I guess that's robust enough.

https://youtu.be/f8kUAH45abc

Again sorry for the poor video quality, We live about 25km from the nearest phone tower, over a set of hills. We're completely off-grid which means no more broadband :-( Only nice slow 3G.

I'll post pics of the hardware and the firmware in the morning.


The second photo is the same ARM microcontroller used in an 'ST-Link Programmer' these are only a couple of dollars on eBay. (This particular one controlls an array of wireless power outlets) Only a couple of pins are available and I've modified the code to use these pins.

I'll add a kit to my store, You'll get a pre-programmed board, a 3d printed enclosure. You'll need to BYO link cable. $10 with free shipping worldwide.

I'll post the firmware this afternoon

Last edited by BennVenn (Feb 16, 2016 9:16 pm)

Offline
Alabama

It would also be cool to see this as a means for sending MIDI notes out to a PC...

Offline
Abandoned on Fire
MaxDolensky wrote:

It would also be cool to see this as a means for sending MIDI notes out to a PC...

Oh my! Now you've hit on something!

Offline
Abandoned on Fire

Also is there any reason this wouldn't work on other GB models? GBC specifically.

Offline
Austin, TX
herr_prof wrote:

why not just use a nes to usb type controller?
http://www.amazon.com/Classic-USB-NES-C … B002YVD3KM

The "dogbone" style gets even closer to the DMG button layout:

http://www.amazon.com/Retro-Link-NES-Do … es+dogbone

Feels pretty nice.

Offline
Australia

It works just as good on a GBC/GBA. MIDI out? Is there nothing that already does this?

Not sure if you've ever held a Chinese clone controller, they are far from 'nice'. Flexible body, sharp edges on the buttons. You really need that 2 decades of finger mashing to round those edges. Or a legitimate dogbone controller which are rare in these parts.

I had a sync issue last night so it looks like I'll need to do some kind of handshaking. This shouldn't slow the response down at all as both the GB and ARM run at a higher rate than the USB packet request.

Back to the MIDI thing, just one note per key, polyphonic?

Offline
Austin, TX
BennVenn wrote:

Not sure if you've ever held a Chinese clone controller, they are far from 'nice'. Flexible body, sharp edges on the buttons. You really need that 2 decades of finger mashing to round those edges. Or a legitimate dogbone controller which are rare in these parts.


Agreed.  I was lucky enough to snag an authentic one at goodwill for a few bucks.  The RetroPort adapter from retrousb.com is a little pricey, but works really well, and connects to the original plug pretty snugly.

I picked up a clone snes controller to use with my super gameboy, because I didn't want to wear out my original ones.  It really didn't feel right.

Offline
Austin, TX

Edit:  Double post.

Last edited by HimsyPimsy (Feb 18, 2016 8:58 pm)