R36S – Persisting game saves with GitHub repositories

I purchased an R36S portable emulator recently and, after erasing everything and installing a clean distro from scratch, my first action was to persist the game saves.

Why? Because over the years, losing save games has been one of the most frustrating experiences for me. I explored a few ways to implement cloud storage solutions—like Dropbox, Google Drive, and OneDrive—but after a while, Git repositories seemed like the best option.

A Git repository allows these small files to be stored along with their different versions over time. I don’t expect the repository to grow too large, and I don’t plan to abuse it, so I’m going to use GitHub as my remote. If it grows, I can change the remote later or adjust my strategy.

Configuring the RetroArch save folders

TThe first thing I did was change the save file directory from the individual ROM folders to the global /home/ark/.config/retroarch/saves/ instead.

OOpen RetroArch and go to Settings > Directory > Save Files.

Do the same for the Save States

Don’t forget to persist your configuration file before quitting.

Then, I created two private repositories: k36-saves and k36-states.

Creating the SSH keys

After enabling Wi-Fi or LAN on your R36S, log in via SSH using your preferred method (SSH, WSL SSH, PuTTY, etc.).
In my case, I used the following command:

ssh -o PreferredAuthentications=password ark@192.168.0.12

When asked for a password, I used the default ark
Now, you can create the SSH keys:

ssh-keygen -t rsa

This creates a public/private key pair in your user’s home folder.
Copy the contents of /home/ark/.ssh/id_rsa.pub and add them to your GitHub Settings > SSH and GPG keys section.
If you have other repositories, I recommend creating a separate account since this provides full write access to your repositories.

Creating the Local Repositories

Now, let’s go to the previously mentioned saves folder and initialize the repository there:

cd /home/ark/.config/retroarch/saves/
git init
git remote add origin git@github.com:viniciusrezende/k36-saves.git
git checkout -b main

Replace the remote URL with your own repository.
Repeat the same process for the states folder.

While we’re here, let’s configure the global information for the Git user:

git config --global user.email "ark@viniciusrezende.com.br"
git config --global user.name "ArkOS k36"

Creating the Auto-Commit / Auto-Push Script

Now, let’s create the script in our home folder:

touch ~/pushgit.sh
chmod +x ~/pushgit.sh
nano ~/pushgit.sh

Then paste the following contents:

set -e
timestamp=$(date +"%Y-%m-%d %H:%M:%S")

cd /home/ark/.config/retroarch/saves
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  exit 1
fi
if [[ -n "$(git status --porcelain)" ]]; then
  echo "Changes detected. Committing..."
  git add -A
  git commit -m "Auto commit: $timestamp"
fi
git push origin main

cd /home/ark/.config/retroarch/states
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  exit 1
fi
if [[ -n "$(git status --porcelain)" ]]; then
  echo "Changes detected. Committing..."
  git add -A
  git commit -m "Auto commit: $timestamp"
fi
git push origin main

Adding the cron event

For the last step, open the crontab with crontab -e and add the following line:

*/5 * * * * bash /home/ark/pushgit.sh

Extra

While writing this, I had some issues taking screenshots from the R36S.
For anyone curious, I used the following command:


sudo ffmpeg -f kmsgrab -i - -frames:v 1 -vf "hwdownload,format=bgr0" screenshot.png

Fixing broken chinese Ammoon Looper Pedal

Information compatible with:

  • Harley Benton Mini Looper
  • FAME Looper * Rowin LEF-332
  • Donner Looper
  • Ammoon AP-09 nano looper

I bought this little fella after I saw it listed as broken for a really low price, considering that I could make it work after updating its firmware.
The provided USB cable was faulty and I replaced it with a working one and the LooperSuite for macOS didn’t work at all. I searched both Rowin and Ammoon sites for an alternative firmware without any success.

Using LooperSuite v1.7 I tried to delete the Song 001 in vain. However, then I replaced the Song 001 with a blank WAV file and replugged the looper to my rig. To my surprise, everything was working as expected.

Considering the price it’s an awesome looper, but I have no idea if it’s going to freeze again.

EDIT:

LooperSuite 1.7

Working WAV file to use as a replacement

Arduino as ISP checklist for someone who didn’t burn/program anything in a long time

Back in 2009, I became aware of the existence of Arduino(through TuxRadar Podcast). The idea of open hardware and open software platform aroused my interest in electronics.

I got myself a kit and built a Serial RS232/DB9 board. That was my first soldering experience and really started my relationship with electronics as a hobbyist. Soon after, I got a counterfeit Arduino Mega from China and my Serial one was put aside.

This weekend I was testing a sketch and it was incompatible with Arduino Mega. Unfortunately, I was unable to find the right drivers for my serial adapter. Enough story, I ran into a few issues and here is a checklist to avoid them:

  • Don’t forget a 10μF cap between Reset and Ground.
  • External PSU, don’t rely on the programmer’s 5V.
  • Check USE_OLD_STYLE_WIRING constant on ArduinoAsISP sketch (when not using the ICSP header).
  • Install MiniCore boards on your Arduino board-manager (Check MiniCore GitHub for more information)