I use Gnuboy 0.4B with the following script and setup. I have all of my .gb and .gbc games in my 'Gnuboy_0.4B' folder on the root of my SD but you can name it anything.
Inside this folder I have a script called 'gbroms.gpu' a 'Gnuboy.rc' file and the Gnuboy binary/executable renamed from its original name to 'gb' with no extension. 'gbroms.gpu' contains the following:
---------------------------------------------------
#!/bin/bash
for i in *.gbc;
do
rm "${i/.gbc/.gpe}"
echo "./gb \"$i\"" > "${i/.gbc/.gpe}"
echo "sync" >> "${i/.gbc/.gpe}"
echo "cd /usr/gp2x" >> "${i/.gbc/.gpe}"
echo "exec /usr/gp2x/gp2xmenu" >> "${i/.gbc/.gpe}"
done
sync
for i in *.gb;
do
echo "./gb \"$i\"" > "${i/.gb/.gpe}"
echo "sync" >> "${i/.gb/.gpe}"
echo "cd /usr/gp2x" >> "${i/.gb/.gpe}"
echo "exec /usr/gp2x/gp2xmenu" >> "${i/.gb/.gpe}"
done
sync
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu
--------------------------------------------------------------------
This script is one I modified from a downloaded one titled 'Gnuboy and script' so if anyone remembers the original author it would be nice to credit them. I am sure my modification could have been shorter / optimised but I dont remember much scripting.
When you run the script from your utilities menu it will create an individual launch file for each game that was in the directory you ran the script from. For example:
The script that runs Super Mario Land will contain:
-------------------------------------
./gb "Super Mario Land.gb"
sync
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu
---------------------------------------
In order to enable (unofficial save states support) in Gnuboy, I have a Resource file called 'Gnuboy.rc' that contains the following:
-----------------------------------
bind joy4 savestate
bind joy5 loadstate
bind joy0 +a
bind joy1 +b
------------------------------------
When you use this, pressing the 'Y' key will save states(bind joy4 ) and pressing the 'A' key will load the save state (bind joy5).
However be warned that the save states will be saved to the GP2X Nand under /root/.gnuboy/saves so you might not want to do this.
The other two lines at the end are the button mapping for the GBC A and B buttons to the GP2X 'X' and 'B' buttons.
'joy0 +a' refers to the GP2X 'B' button ------> mapped to the original GBC 'A' button location
'joy1 +b' refers to the GP2X 'X' button mapped to the original GBC 'B' button.
If you want to swap these around simply swap +b with +a or vice versa.
I also have managed to get Gnuboy working with the file selector so if anyone wants anymore details about this method let me know. I stopped using the file selector method because save states were not working correctly. When you use file selector, it takes the name of the game you select from the list as a variable which is then copied and renamed to rom.gbc and then executed so when you do a save state, instead of the save file being written as the actual game name, it is stored as rom.sav or something so when you try to load a save state for a different game, sometimes it will crash. This is my theory for save states being unreliable when using file selector. Apart from that, file selector works fine. If none of this works for you it is most likely because you are not using the updated Gnuboy 0.4B which is no longer compressed so check that your Gnuboy binary is around 935KB instead of around 400KB.