GBA as GameCube Controller

Discussion in 'GBA - Console and Game Discussions, Help and Tips' started by Aliogeek, May 21, 2019.

  1. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    Hello everybody !

    Required hardware :
    - 1 GBA/GBA SP
    - 1 GBA to GCN Cable
    - 1 FlashCard running the program to make the GBA looking like a GC Controller

    I have made some edits to the original program that was made by EXTREMSCORNER (Many thanks to him !). The original source code can be downloaded there : https://github.com/ExtremsCorner/gba-as-controller

    Changelog of my version :
    - Added the possibility to select a game profile before start. You can add your own profiles by editing the source code and compile the program again. There is already some profiles that i've made for the games I play with (Mario Kart 8 Deluxe/Smash Ultimate/Mario Kart Double Dash).
    - Show all input presses, and the number of simultaneously pressed buttons
    - Cleaned the code a bit

    23/06/2019 version changelog :
    - You can now choose the timer0 value at launch. It can be useful to make the program work with some third party controller adapters. 3.99 microseconds is the default value, which works with Nintendo and Mayflash controller adapter.
    - Removed input presses printing. It was causing timer desync, consequently the compatibility with many controller adapters (except mine, which is one from MayFlash :mellow:) was broken.

    09/07/2019 version changelog :
    - Added a new game profile : New Super Mario Bros (works for Mario Maker 2/New Super Mario Bros U Deluxe)
    - Added a game profile builder, to map GBA <==> GC keys
    - Input presses are showed (again !), this time without causing any regression
    - Improved timer0 choice at launch : possibility to define a completely custom coefficient, between 50 and 1000. Default is 67 and should work in most cases.
    - Modifications to the console, in order to make everything look nicer and give more informations to the user
    - Added a softreset key combo : A+B+SELECT+START to change game profile fastly without having to load the program again
    - Code cleanups

    11/07/2019 version changelog :
    - Many code cleanups
    - Fixed timing regressions. Should now be equals again with the original program.
    - Showing input presses is removed again :( Definitely causing timer problems with some gc pad adapters
    - Fixed analog buttons status with custom game profiles
    - Added Licence in the zip

    12/07/2019 version changelog :
    - Code cleanups
    - Show in real time if a rumble cartridge is connected
    - Possibility to map GC D-Pad keys in a custom profile

    25/07/2019 version changelog :
    - Restarted from the original code (code cleanups)
    - Added a lite version, using a lite version of the game profile system. This version might be necessary with some third-party GC controller adapters which need to receive a very fast status answer to work. The lite version lacks of the game profile builder, but has exactly the same timings as the original program made by EXTREMS.

    You can use your GBA to play PC games with something like the MayFlash GC Adapter, which makes any GC Controller appearing as a standard DInput controller. It works on a real GameCube or a Wii U/Switch just perfectly. I prefer this method over using the "GBA Wireless Controller", which has random connection drops and latency spikes.

    How to use it ?
    Very simple, just load the program and connect the GBA to the gamecube/mayflash/wii u/switch gcn adapter using the cable. It will be recognized exactly as a GameCube Controller while the program is running.

    TIP : You can connect as many gba as you wish with one single flash cart. When the program is loaded, it stay on the RAM as long as the GBA is powered on so you can just withdraw the catridge from the GBA and load the program on another one. Rumble is supported if you insert a rumble gba game (or the slot2 Nintendo DS Rumble Pack)

    Happy gaming :yaysp:

    P.S : The source code of the latest version is on the archive below, with a ready-to-use binary

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    Licence
     

    Attached Files:

    Last edited by Aliogeek, Jul 27, 2019
    Riptide, smitty96, Nutez and 2 others like this.
  2. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    Uploaded a new version :
    - You can now choose the timer0 value at launch. It can be useful to make the program work with some third party controller adapters. 3.99 microseconds is the default value, which works with Nintendo and Mayflash controller adapter.
    - Removed input presses printing. It was causing timer desync, consequently the compatibility with many controller adapters (except mine, which is one from MayFlash :mellow:) was broken.

    Enjoy :sp:
     
    Last edited by Aliogeek, Jun 24, 2019
  3. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    New version !
    - Added a new game profile : New Super Mario Bros (works for Mario Maker 2/New Super Mario Bros U Deluxe)
    - Added a game profile builder, to map GBA <==> GC keys
    - Input presses are showed (again !), this time without causing any regression
    - Improved timer0 choice at launch : possibility to define a completely custom coefficient, between 50 and 1000. Default is 67 and should work in most cases.
    - Modifications to the console, in order to make everything look nicer
    - Added a softreset key combo : A+B+SELECT+START to change game profile fastly without having to load the program again

    Hope you guys enjoy it B-)

    Screenshots
     
    Last edited by Aliogeek, Jul 27, 2019
  4. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    New version uploaded ! It may be the final one.

    - Many code cleanups
    - Fixed timing regressions. Should now be equals again with the original program.
    - Showing input presses is removed again :( Definitely causing timer problems with some gc pad adapters
    - Fixed analog buttons status with custom game profiles
    - Added Licence in the zip

    Happy gaming :gba:
     
  5. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    New update :)

    - Code cleanups
    - Show in real time if a rumble cartridge is connected
    - Possibility to map GC D-Pad keys in a custom profile

    :grog:
     
    MrCokeacola likes this.
  6. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    25/07/2019 version changelog :
    - Restarted from the original code (code cleanups)
    - Added a lite version, using a lite version of the game profile system. This version might be necessary with some third-party GC controller adapters which need to receive a very fast status answer to work. The lite version lacks of the game profile builder, but has exactly the same timings as the original program made by EXTREMS.

    Enjoy :sp:
     
    zfreeman likes this.
  7. smitty96

    smitty96 Member

    Newcomer
    2
    May 16, 2009
    United States
    New Jersey
    This is awesome! I've been using Extrem's original version a bit lately, the ability to have multiple profiles should be really handy. I'm not sure how much you know about the rumble code involved, but do you think it'd be possible to use the built-in rumble of the EZ-Flash 3 in 1? I believe it has to be "set" to rumble pack mode before launching an official DS game, but DS homebrew like Lameboy are able to use it without doing anything ahead of time.
     
  8. zerofalcon

    zerofalcon GBAtemp Advanced Fan

    Member
    6
    Mar 14, 2009
    Somewhere close to my NES
    Hi! Thanks for this great app is really useful for some games, emus,etc. The GC adapter on android doesnt register the main joystick (left) at all, Is there a way to change the code to act as the digital pad instead of the Analog?
     
  9. Aliogeek
    OP

    Aliogeek Advanced Member

    Member
    4
    Mar 29, 2013
    France
    Seems possible, but don't know how. I don't have one to make tests, so it's not planned to add this.

    It might be a timing issue of my version. You can edit my source code or use the original program of Extrems which can be downloaded there : http://files.extremscorner.org/gamecube/apps/gbi/latest-extra

    I'm currently studying the C language and doing tests in order to make an update. The objectives :
    - Make standard version equals in terms of timing as the original program (or enough to pass all tests), so the "lite profile system" branch will become useless
    - Double check timings on 3 different adapters, and a real gamecube. I don't own any logic analyzer, which makes debug very difficult.
    - Show input presses in real time ? (still not sure if this is really possible without causing any problems... I've managed to make it work with my Mayflash GC adapter again, but i need to do more tests.)

    :)
     
    Last edited by Aliogeek, Aug 15, 2019 at 12:56 PM
Loading...