Gui Trick For Gmenu2x & Dosbox


rokdcasbah

got me a date with botticelli's niece
Joined
Jan 5, 2006
Messages
1,516
Location
up on cripple creek
Couple things:
1. I apologize if this has been covered before. I've never seen it done (though I'm sure it's common knowledge to some of you) and I can't think of a good way to search for it.
2. I wasn't sure if it belongs in Cool Ideas, since that's mostly port requests, but I won't be crushed if anyone moves it there.
3. You don't have to be using gmenu or dosbox to do this, it should work with kounch's selector app too, as well as anything similar.

--

I got the urge to play around with gmenu, to see if you could use it's selector to load apps in a list style rather than using the icons. This would be especially nice for dosbox since so far the most obvious way to sort dosbox launchers is to give them their own folder in gmenu and use an icon for each. OK, so the following script isn't going to change anyone's lives but:
CODE
#!/bin/sh
$1

Explanation: $n is a shell script variable that stores any argument passed to the script, with $1 being the first, $2 being second, etc. Selector, and gmenu's selector, is just a quick way to add arguments to something about to be executed, since the gp2x has no keyboard.

Instructions: take the above and save it as a script, in a good text editor that will do Unix-style line endings. Make an icon for it in gmenu. For "selector dir", you will want a directory full of whatever .gpe files you were previously using to launch dosbox games. Now you can browse your dosbox games in style, with nice screenshots or box art. B)

selectortrick.png


I didn't test it other than to make sure the gp2x doesn't do anything funny with $1, etc, so I don't know how it affects overclocking and such. My guess is that if you set the overclock in gmenu, it will stick, unless dosbox is setting its own. You can always script this using the cpu-lcd-ram tweaker, as well. Big gotcha: this does not work with spaces in the filenames. I tried to remedy this, but it seems like even though you can type in filenames with spaces and be ok (either by escaping or using quotes), if you try to do it using a variable, it chokes on the space. I won't show my sed 'code' for fear it ends up on thedailywtf.

But maybe some nice person will show us how you'd fix that? :D
Again, sorry if this has been talked about before.


Like Ryo says below, put quotes around $1.
 
My two cents:

CODE

#!/bin/sh
exec "$1"



exec replaces the shell with the command. It is slightly faster since it does not fork and you save the memory that the shell uses. Besides, if dosbox follows the normal life cycle for Gp2x, it will 'exec gp2xmenu' at the end. Then, a launching script without 'exec' will never end and after a few executions you will find lots of shells wasting your memory.
 
juanvvc said:
My two cents:

CODE

#!/bin/sh
exec "$1"
exec replaces the shell with the command. It is slightly faster since it does not fork and you save the memory that the shell uses. Besides, if dosbox follows the normal life cycle for Gp2x, it will 'exec gp2xmenu' at the end. Then, a launching script without 'exec' will never end and after a few executions you will find lots of shells wasting your memory.


Good to know :)
 
Last edited by a moderator:
One of the "games" in the list in my screenshot really does not belong (sadly only the Dukes are real). I'm wondering if anybody caught it, and if they agree with me that it's quite possibly the best game ever.

Also, thanks juanvvc for the tip about exec.
 
rokdcasbah said:
One of the "games" in the list in my screenshot really does not belong (sadly only the Dukes are real). I'm wondering if anybody caught it, and if they agree with me that it's quite possibly the best game ever.

Also, thanks juanvvc for the tip about exec.
How does duke2 run with the dynarec?
 
Last edited by a moderator:
Good question :D I don't play it a whole lot...Duke 1 is pretty smooth these days, but whatever settings I have right now make the sound go nuts. I haven't played around with the configs much for either, but I should. I'll investigate and let you know.

I'm sure many people played through episode one of duke 2, and i'm one of them. at the time I thought it was great, but I recently replayed it a little on my laptop and realized that, while it's one of the better DOS platformers, that isn't saying much :)

Huge Xargon fan though. I haven't tried it on the gp2x since I assumed it'd be heavy on resources, but maybe I'll fire it up. DOSBox is running pretty great these days. Thanks to you and MH-T for your hard work.

Since no one bit (and I'm impatient), I'll reveal the game I alluded to above to be Humbug, which doesn't belong because it's a text adventure. One of my favorite games.
 
Back
Top