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. We don't have a way to provide the latest build to users who are not logged into GitHub yet, but the latest build for Windows at this time is available here.

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.
chuckthetekkie says:
Aug 20th 2020
For Pokemon Pal Park I get an in-game error saying that this Game Card has already been stocked with six migrated Pokemon despite it not being true.
Post a comment
Name:
DO NOT TOUCH