Linux, ADB, and the RG35XX

In which the command line comes to the rescue

I bought myself one of those handheld retroconsoles for Christmas - it’s been a long year and I had been tempted for a while. Sill, I didn’t want to shell out for anything super expensive so I went with the RG35XX, a neat little thing with 256 MB of ram that can run handhelds up to the Game Boy Advanced and home consoles up to the PS11 which is perfect for me. I’ve played virtually nothing from this time period (I’m ever so slightly too young) so this isn’t a nostalgia trip; rather just think they’re still worth playing and wish you could just Buy a GameBoy in this here decade.

Credits for a certain game for the GameBoy Color

This is neither a guide for basic usage nor an ad. I bought fresh SD cards2 and put GarlicOS on them like people say to and everything has worked fine for me, but your mileage may vary. At least it’s a fairly cheap device. But to put something new (and legitimately acquired, officer, people make and sell new gameboy games on itch all the time and they’re really good) you have to pull the card out and copy it over and I’ve had enough media go bad on me in my life to get the heebie-jeebies about that however careful I’m being.

Some kind soul has already made a tool for this called GarlicPress, which lets you plug in your device and change all kinds of things over the Android Debug Bridge protocol, or ADB, over USB. By all accounts this works great but I can’t get it to work in Linux, even after installing a bunch of .NET stuff in my wineprefix. The connection drops immediately after it is created and I can’t find the error; it might be permissions related but regardless I don’t know how to debug the interaction between .NET, wine, and physical hardware.

There is hope, however! ADB itself is not windows only and I don’t strictly need the extra functionality of GarlicPress however neat it looks; I just need to move files from one machine to another.

In Varoom 3D even third place is a ‘WIN’

The Arch Wiki pointed me to the package android-sdk-platform-tools which contains the adb program in that particular distro ecosystem; I think it’s easier to find on debian. After running the ‘toggle ADB’ program I had installed on the handheld earlier (which is really just a shell script that creates or deletes a file that GarlicOS picks up as a flag at boot) and hitting the reset button on side of the device it was swiftly picked up desktop-side with adb devices:

$ adb devices
List of devices attached
0123456789ABCDEF        no permissions; see [http://developer.android.com/tools/device.html]

The bit about ‘no permissions’ turns out to be important; the link was less so. When using ADB with a proper android device - instead of a generic ARM embedded Linux that just happens to be supporting the protocol - you may need to go into the developer settings and even possibly root the device, to be able to do what you want. In this case though it seems to be a permissions issue on the desktop end and not the handheld end. Possibly there is a group you could add your user to that would get around the issue but I’m in a group and it’s called ‘sudo’ and that’s all I need:

$ adb kill-server
$ sudo adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
$ adb devices
List of devices attached
0123456789ABCDEF        device

Perfect! Maybe something like this would have fixed the GUI tool I had tried earlier but we’re too deep to back out now.3 adb shell now gets some kind of root shell (it doesn’t seem to be quite the same as what you can get with other tools directly on the device) and I made a folder called transfer/ on the main ‘internal’ SD card:

$ adb shell
root@q88_hd:/ # cd mnt
root@q88_hd:/mnt # ls
SDCARD
data
mmc
sdcard
vendor
root@q88_hd:/mnt # cd mmc
root@q88_hd:/mnt/mmc # mkdir transfer
root@q88_hd:/mnt/mmc # ls
CFW
Roms
Saves
Screenshots
transfer
root@q88_hd:/mnt/mmc # ^D

This is just a temporary place to put the files. I could have tried copying stuff directly into the correct folders in SDCARD, the second card where I normally put roms, but that adds more typing and extra room for error. The command for moving game.gb to the device is now as simple as:

$ adb push game.gb /mnt/mmc/transfer

You can also pull your saves and such-like back to your main computer in a similar way, e.g. to copy screenshots on the second card to your PC:

$ adb pull /mnt/SDCARD/Screenshots RG35XX-Screenshots/
/mnt/SDCARD/Screenshots/: 300 files pulled, 0 skipped. 0.7 MB/s (4082329 bytes in 5.537s)

After that sudo adb kill-server and you can disconnect the USB.

All that’s left is copying into the right folder. You could, again, have probably done this directly or via the root shell you had earlier, but I used DinguxCommander which is a two-column file manager that has been ported to GarlicOS and which I had already installed. After that the games worked like they had been there the whole time.

If you’re not specifically after an answer to this problem this is probably all greek to you: that’s fine. I might write something more general about this fun little device in future, and I’m getting tempted to develop something for it myself, but for now I noticed that there was nothing online about how to use ADB to communicate with it if GarlicPress wasn’t working. As usual then this is as much a resource for me to look back at when I need to remember how to do it again in a few months or years than it is for a general audience. In the meantime though - I have some games to play!

Luggage Retrieval Officer is a very chill game - I had a physical puzzle that worked on a similar principle as a kid

Itch games pictured


  1. But not other consoles contemporary with the PS1; for whatever reasons emulators for the Saturn and N64 are less efficient but since I’ve never so much as seen either of those devices in person to me it’s entirely academic.↩︎

  2. The RG35XX is one of those devices that calls micro SD cards TF cards, which I always find amusing.↩︎

  3. (Insert maniacal laughter here)↩︎

File under:

Tags: