Offline
Australia

A place to discuss the use of a Gameboy as a USB Controller, for PC emulators.

Is there a current solution for this?

Offline
Michigan

An all-in-one solution? Well, kitsch bent has common-ground replacement boards
http://store.kitsch-bent.com/product/co … button-pcb

And Im sure there are hundreds of public arduino sketches for usb-button dongles.

Offline
Australia

I thought a custom ROM and Linkport to USB bridge would be most convenient? Adzetko mentioned the Nanoloop USB cable may be able to do it?

Offline
Melbourne, Australia
Jazzmarazz wrote:

An all-in-one solution? Well, kitsch bent has common-ground replacement boards
http://store.kitsch-bent.com/product/co … button-pcb

Along the same lines, I made this a few years back - but then once you put one of these boards in I guess you're really using something other than the GameBoy itself...

Offline
Michigan
uXe wrote:
Jazzmarazz wrote:

An all-in-one solution? Well, kitsch bent has common-ground replacement boards
http://store.kitsch-bent.com/product/co … button-pcb

Oh! You're talking about a non-intrusive option. I like that a lot, but link cables are difficult to come by for sacrifice.
What about a custom cart that has a micro USB cable on the top. The cart can map a special memory address to store the data in the button flag registers. :shrug:

Along the same lines, I made this a few years back - but then once you put one of these boards in I guess you're really using something other than the GameBoy itself...

Thats pretty sweet. And I know for sure that there are NES to USB kits, so taking it one step further...

Offline
Australia

Very cool!

I think I'd prefer to use an unmodified gameboy. Seems simpler and more portable. I'll throw one together tonight and post a few pics.

I'll post the schematic and source too for those that want to play along at home.

Offline
Melbourne, Australia
BennVenn wrote:

Very cool!

I think I'd prefer to use an unmodified gameboy. Seems simpler and more portable. I'll throw one together tonight and post a few pics.

I'll post the schematic and source too for those that want to play along at home.

Looking forward to it! big_smile

Offline
Unsubscribe

you might be able to use the arduinoboy serial code maybe??

Offline
Ardèche, France

The Nanoloop link PCB I was talking about is nothing more than a basic "re-wireing" to adapt a male link port into a male USB port. The communication is made between Nanoloop and the computer only with the Nanoloop software (PC side and GB side). But the hardware is really simple, so I think it is possible to hack it with any interfacing ROM and software.

Last edited by Adzetko (Feb 15, 2016 9:02 am)

Offline
Ardèche, France
Jazzmarazz wrote:

An all-in-one solution? Well, kitsch bent has common-ground replacement boards
http://store.kitsch-bent.com/product/co … button-pcb

And Im sure there are hundreds of public arduino sketches for usb-button dongles.

Once I get my hand on a 3D printer, I think I will make a custom housing for this PCB (plus an arduino).

Offline
Australia
Adzetko wrote:

The Nanoloop link PCB I was talking about is nothing more than a basic "re-wireing" to adapt a male link port into a male USB port. The communication is made between Nanoloop and the computer only with the Nanoloop software (PC side and GB side). But the hardware is really simple, so I think it is possible to hack it with any interfacing ROM and software.

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.

Offline
Ardèche, France

Oh, so how's Nanoloop magic working?

Offline
Toronto, Ontario, Canada
Adzetko wrote:

Oh, so how's Nanoloop magic working?

There's an IC on that adaptor, it's not a passive unit.

Offline
Australia

Just wrote a very simple GB ROM. It disables the LCD, reads the keypad, sends the data to the Link port, waits patiently until something clocks the data out of the GB then reads the keypad again etc....

No error correction or synchronization but lucky for us the USB code in the ARM runs around 100 times faster than the GB and can flush the Link port of any missed bits before the gameboy finishes its previous instruction.


Main:
    di ; disable interrupts
    ld    hl,$c200 ; we want a stack
    ld    sp,hl

ScreenOff:    
    ldh    a,[rLY]        ;load a with Current Y co-ordinate (144-153 represents VBLANK)
    cp    144        ;copmare with 144
    jr    nz,ScreenOff    ;not equal? then jmp to wait
    ld    a,0        ;equal? then load a with 0
    ldh    [rLCDC],a    ;load a into LCDC - Display off, BG off, Spr off etc

MainLoop:    
    call JoyPadRead
    call TRX_Byte
jp MainLoop

TRX_Byte:
    ld  [$FF01],a
    ld   a,$80
    ld  [$FF02],a
ByteNotSent:
    ld a,[$FF02]
    cp $FE
    jr z, ByteNotSent
    ld a,[$FF01]
    ret

JoyPadRead:
        ; Routine finding which buttons were pressed since the last check
        LD A,$20    ; Set 0 at the output line P14
        LD [$FF00],A ; 
        LD A,[$FF00] ; Read JOYPAD several times to accomodate the noise
        LD A,[$FF00] ;
        LD A,[$FF00] ;
        LD A,[$FF00] ;
        CPL          ; Bits 0-3 are now 1s if corresponding buttons pressed
        AND $0F      ; Extract lower 4 bits carrying button status...
        SWAP A       ; ...and move them into upper four bits
        LD B,A       ; At this point: B = START.SELECT.B.A.x.x.x.x
        LD A,$10     ; Set 0 at the output line P15
        LD [$FF00],A ;
        LD A,[$FF00] ; Read JOYPAD several times to accomodate the noise
        LD A,[$FF00] ;
        LD A,[$FF00];
        LD A,[$FF00] ;
        LD A,[$FF00] ;
        LD A,[$FF00] ;
        CPL          ; Bits 0-3 are now 1s if corresponding buttons pressed
        AND $0F      ; Extract lower 4 bits carrying buttons' status...
        OR B         ; ...and combine them with 4 other button status bits
        LD D,A       ; At this point: D = START.SELECT.B.A.DOWN.UP.LEFT.RIGHT
    
        LD A,$30     ; Set 1s at both P14 and P15 lines
        LD [$FF00],A ; [probably to reset the circuitry]
        ld A,D
        ret

I'm tidying up the ARM code and I'll post the hex/bin/ben too. Oh and the wiring diagram.

Hardware wise, you need a Link cable (only half of it...) and an STM32F103 MCU with supporting components. You can get these in a variety of forms from the 'Leaf labs maple', the itead clone of the original, a STM8/32 programmer from ebay, a chinese knock off of the original etc... You'd be surprised where you can find them. I'll put a few links up too.

Offline
Abandoned on Fire

This is pretty neat stuff going on here! cool

Offline
Ardèche, France
jefftheworld wrote:
Adzetko wrote:

Oh, so how's Nanoloop magic working?

There's an IC on that adaptor, it's not a passive unit.

Oh my appologies! I didn't knew this! Thank you.