New melonDS feature: GBA connectivity
Hi everyone, I'm a new contributor to melonDS, Chagall on IRC and rzumer on GitHub. Being a fan of the melonDS project, I wanted to contribute something to it, and my most wanted missing feature being GBA connectivity, I spent a few weeks on and off implementing it.

This feature is mostly used in DS games to grant bonuses to players who own specific GBA titles. For example, inserting a GBA Ace Attorney game and launching the DS version will unlock all cases in the remake. Some games go further and read/write save data from/to the GBA cartridge (as in Pokémon games), or in one case polls its I/O port (Lunar Knights/Boktai DS).

All these features are now integrated in the master branch of the melonDS git repository. As far as I'm aware, this makes melonDS the first emulator to support solar sensor emulation in Lunar Knights. The video below demonstrates using the Solar Sensor item in Boktai DS with Bokura no Taiyou in the GBA slot.



Of course, you can also send your pocket monsters from GBA to DS, as demonstrated in this video:



As on real hardware, the GBA save file is modified during migration as the Pokémon are moved to the DS game:



Thanks to endrift of mGBA for the solar sensor emulation code that I used as a primary reference, and to DeSmuME authors for the GBA cartridge Flash save read/write logic that helped a lot with supporting the Pokémon games. Martin Korth's GBATEK document was also a great general reference.

For those curious to try this new feature as soon as possible, another bit of news is the addition of continuous integration to the melonDS git repository, which generates binaries for Windows and Linux from the master branch. If you have a GitHub account, head over to the Workflows page, select the newest build for your platform, and download the artifact shown on the page. Unfortunately we don't have a way to provide the latest build to users who are not logged into GitHub yet.

To load a GBA title, either drag and drop a .gba file over melonDS, use the "Open ROM..." menu and select the "GBA ROM" file type, or, if you happen to use the command-line interface, add the path to the GBA ROM file as an extra argument following that of the DS one. Note that if the DS is on while a GBA cartridge is inserted, it will usually not be recognized in-game (as on real hardware). Either load the GBA cartridge before booting the system, or reset afterwards.

Solar sensor level is bound by default to the left (4) and right (6) keypad arrow keys, but can be rebound in the settings. Note that it is only active while a valid Boktai cartridge is inserted.

I hope everyone enjoys this new feature. melonDS is moving forwards at a good pace, so it's a great time to get involved if you are interested in improving DS emulation.
poudink says:
Feb 1st 2020
not yet, this just means you can do the slot 2 connectivity thing. I believe actual gba support is a planned feature though.
Generic aka RSDuck says:
Feb 1st 2020
> I believe actual gba support is a planned feature though.

unless Arisotura has something up her sleeve there's nothing that I know of. It wouldn't make much sense anyway, the DS is complicated enough and with mgba there already exists a great gba emulator.
anon says:
Feb 1st 2020
I guess melonDS could return an error when you try to run a Slot 2 ROM.
MelonMan says:
Feb 2nd 2020
anon: Yes, if you try to run a GBA rom then it just gives you a white screen.
poudink says:
Feb 2nd 2020
RDDuck: it's in the melonDS roadmap (https://melonds.kuribo64.net/board/thread.php?id=222) for melonDS 1.0. I thought it was weird at first and even asked in the thread but it seems GBA emulation is indeed planned.
poudink says:
Feb 2nd 2020
*RSDuck
nonsio says:
Feb 2nd 2020
Great job! Keep going!
I have a question for you:
is Pokéwalker emulation going to be implemented somehow? (The Pokéwalker was a pedometer device sold with Pokémon HeartGold and SoulSilver that is able to interact with the games in various manners)
MelonMan says:
Feb 2nd 2020
What if MelonDS and mGBA are linked in some way? So if you launch a GBA rom from melonDS, it opens that game in mGBA. There are also some DS games that link to the Wii, so if MelonDS and Dolphin could connect that would be pretty cool.
This is just an idea and I don't know how practical it would be and if it could be implemented.
poudink says:
Feb 3rd 2020
I mean it could be implemented but at that point just launch your rom with mGBA
Chagall says:
Feb 6th 2020
nonsio: Pokéwalker would be interesting, but I don't have the resources (time or equipment) to research the hardware and communication protocol and dump the firmware on top of spending time implementing an emulator for it.
Zinx says:
Feb 6th 2020
GBE+ would implement the Pokewalker most likely.
It implements all sorts of obscure stuff.
anon says:
Feb 7th 2020
@MelonMan That isn't exactly an error. The app should return a proper error immediately.
poudink says:
Feb 8th 2020
I'm fine with the white screen behaviour. It's the same as if no game is loaded which how it should be since melonds isn't running anything from slot 2.
squeegily says:
Apr 1st 2020
I'm running git.2020-03-30 but I can't see any way to insert a flashcart (for Opera) or an Emerald save (for Diamond)…is it not implemented in the UI yet?
That Guy says:
Aug 5th 2020
Why is there a box full of Bulbasaur :0
Post a comment
Name:
DO NOT TOUCH