Categories
Uncategorized

More Folders for More Games

Time for more adventures with the Anbernic RG35XX running GarlicOS! After I got a large set of games, I thought to myself “Maybe I’ll have two SD cards, one with my favorites, and one with everything. Well, I didn’t have to do that, because I discovered you can just make your own folders, and put whatever ROMs you want into them. So here’s a look at my current setup.

Those “FAV” folders show up with text labels because there is not a corresponding image file to display. (Which is a handy trick as well!) I may make some images at some point, or not…

To get this to work you have to edit the coremapping.json file. You can just duplicate the original line and make a new folder name. Here I’ve added GBA-FAV right under GBA. Note that the folders are displays in alphabetical order in GarlicOS. But also note, you can name the folders anything you want. So you could order them manually using naming conventions with letters or numbers.

Also note, you can’t mix ROMs, so putting Game Boy and Game Gear ROMs in the same folder will not work. Each folder’s ROMs will run using the specific library listed in the line of the file. Still, this can go a long way towards organizing things.

You can find the coremapping.json file in the CFW folder. (If you have two SD cards it will be on the first one… Mine is on the MISC partition. (If you screw up the file the UI will display blanks, so make a backup file first if needed.)

I do know you can mark games as Favorites in GarlicOS, and I still use that feature (in my own way) but I found that it was too easy for me to “unmark” a favorite and then have it disappear from the list (and my mind) so this lets me have my curated folder of favorites along with the folder of “everything else”.

One more tip! If I want to move ROMs between the FAV folder and “regular” folder I can do it on a computer but it’s also very easy to do it using Dingux Commander running directly on the RG35XX.

Categories
Uncategorized

Fix Corrupt PICO-8 Save Data on Anbernic RG35XX

I’m still loving the Anbernic RG35XX but sometimes thing go wrong and I need to pop the SD card into a computer to delete a file to get some things working again. The OS saves the game state when you close a game, and occasionally with PICO-8 games the save file gets corrupted and you can’t launch the game again until you delete the bad file…

Since there’s a terminal application you could go into that and cd to the correct directory and delete the file, but they keyboard is… well, it’s like a TV remote. Arrow around a keyboard and enter keys one at a time, so there has to be a better way… so I wrote a script.

I just launch SimpleTerminal, and to save keystrokes the script lives right in that directory…

So I type ./fixp8.sh (Or actually just ./fi and then the tab key to autocomplete…

…And then the script runs, and shows some instructions. It also shows the most recently modified file so you can choose to fix it, skip it, or quit the script.

If that file doesn’t belong to the game causing issues, I skip it, and it moves on to the next most recently modified file…

The script only accepts f, s, or q for input. When you are done (hopefully after fixing the bad file) you can quit.

Note that the script doesn’t delete any files, just renames them, in case you “fix” the wrong file. (You can un-fix it easily on a computer by renaming it back. We just add a ~ after the file name.)

I think (and should confirm) that the way the system works, if you launch a game by selecting it and pressing the A button it should try to reload the last saved state, but if you press the Start button, it should start fresh ignoring the save file. It seemed like this didn’t always work… maybe just with PICO-8 games? If you find out, let me know.

In the meantime it’s been really interesting (and a little fun!?) learning how to write and run scripts on this device. I mean, it’s basically Linux. You can even run scripts at startup, and I think I saw that you can get cron installed, which is pretty wild but also not really, because Linux.

(Note: Since I wrote this I found another use case for fixing files, and I’ll follow up with that in another post.)

Here’s the script!

#!/bin/sh

# where the directory is located
# mms for first card, SDCARD for second card
SAVEDIR="/mnt/SDCARD/Saves/CurrentProfile/saves/fake-08/cdata/"

cd "$SAVEDIR"

# we need a way to get only txt files not txt~ files
FILES=`ls -t *txt | head -n 50`

echo ""
echo "This will fix bad P8 save files."
echo "Fix a file, skip it, or quit."
echo "Fix [F], Skip [S], Quit [Q]."
echo ""

for f in $FILES
do
	while true; do
	    read -p "Fix $f? " fsq
	    case $fsq in
	        [Ff]* ) echo "Fixing $f"; echo ""; mv "$f" "$f~"; break;;
	        [Ss]* ) echo "Skipping $f"; echo""; break;;
	        [Qq]* ) echo "Quitting"; echo""; exit;;
	        * ) echo "Please answer F, S, or Q.";;
	    esac
	done
done