Autoreallyrun


fells

Still Fresh
Joined
Jul 6, 2009
Messages
39
This doesn't really work yet -- it doesn't initialize graphics properly

Here are two scripts that let you "force" autorun to work even after quitting a program. Useful for gmenu2x. This should be used in place of the "Autorun" preference in the GPH default menu, so turn that off before installing these.

Run autoreallyrun-on first to set it up. Then you can go back and forth between autoreallyrun being on or off by running the two programs.

Please note: this is beta and may screw up your Wiz, forcing a reinstall from firmware. Use at your own risk!!. That said, it works for me. This works by copying your gp2xmenu executable off safely and replacing it with a shell script that boots your autorun.gpu file if it is accessible. So please be warned that a weird thing could happen that destroys your gp2xmenu executable. You can read the source, it's just two shell scripts, I'll even list them here. Any comments please let me know.

Here's the source of autoreallyrun-on and off, but it's easier if you just download the GPE files and put them on your Wiz.

Code:
#!/bin/sh
# autoreallyrun-on.gpe
# Check if we've already done the setup for this to work.
if [ -e /etc/autoreallyrun-setup ]; then
  # We have, don't do anything
  echo "Setup already done"
else
  # Copy the existing gp2xmenu2x to gp2xmenu.old
  cp /usr/gp2x/gp2xmenu /usr/gp2x/gp2xmenu.old
  # write gp2xmenu.new with a shell script
  cat > /usr/gp2x/gp2xmenu.new <<STOP
#!/bin/sh
# Check if there's an autorun file on the SD card (gmenu2x for example), if so, run it
if [ -e /mnt/sd/autorun.gpu ]; then
  exec /mnt/sd/autorun.gpu
fi
# else exec the old menu
exec /usr/gp2x/gp2xmenu.old
STOP
  # Set the "we've done the setup" bit
  touch /etc/autoreallyrun-setup
fi

# Setup check done. Assume everything is ready to go:
# Copy gp2xmenu.new to gp2xmenu
cp /usr/gp2x/gp2xmenu.new /usr/gp2x/gp2xmenu

# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu


Code:
#!/bin/sh
# autoreallyrun-off.gpe
# Check if we've already done the setup for this to work.
if [ -e /etc/autoreallyrun-setup ]; then
  # We have, don't do anything right now
  echo "Setup already done"
else
  # Exit. You need to run autoreallyrun-on first for this to do anything.
  # return to the menu screen
  cd /usr/gp2x
  sync
  exec /usr/gp2x/gp2xmenu  
fi

# Otherwise, replace old and restart
# Copy gp2xmenu.old to gp2xmenu
cp /usr/gp2x/gp2xmenu.old /usr/gp2x/gp2xmenu

# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu
 
Last edited by a moderator:
fells thanks for the scripts

Thinks also to remember:
1. If you update your firmware this change will be undone and you will have to redo (unless GPH actually fixes the problem in the firmware loaded)
2. Also if something does go wrong it should be possible to recover/fix the gp2xmenu with the autorun.gpu, possibly by copying a good version back. As long as the sutorun feature works, the wiz should be fixable without having to reload the entire firmware. But hopefully no has this problem.
 
Hmm... Can't get this to work
I'm probably doing something wrong, but when I run autoreallyrun-on.gpe I get
Code:
3: Syntax error: Unterminated quoted string
At least that is what I think it says. It's really hard to read that tiny text on the wiz screen.

Anyway, Thanks for the effort!

edit: Nevermind. My file was corrupted for some reason. Works great now.

Thanks.
 
One thing I forgot-- these programs make a lot more sense if you first turn off autorun in the GPH menu. Then you can use autoreallyrun-on/off as a better autorun preference :)

Also, make sure you download the zip file w/ the gpes in it instead of copy/pasting to your own scripts-- especially on Windows, things can get screwed up.
 
Last edited by a moderator:
fells said:
One thing I forgot-- these programs make a lot more sense if you first turn off autorun in the GPH menu. Then you can use autoreallyrun-on/off as a better autorun preference :)

Also, make sure you download the zip file w/ the gpes in it instead of copy/pasting to your own scripts-- especially on Windows, things can get screwed up.

That's right, Windows default text editors don't save the files in UNIX format, unless you use something good like Notepad++

Well, this program sorta scares me, but if you say I can reinstall the firmware to fix any potential problems then I'm willing to give it a try.

Edit: Well, using the autoreallyrun on worked, Gmenu2x loads every time now.
But as a result, I am unable to exit Gmenu2x, GP2Xmenu is inaccessible as Gmenu2x reloads.
That means I can't touch the music, video, photo, ebook, flash, etc functions of the Wiz unless I turn autoreallyrun off.

A good makeshift autorun though, I mostly only use my precious emulators and the occasional homebrew anyway. :)
 
Last edited by a moderator:
Er, I take that back, don't use this program.
It introduces a number of screen problems that can take place when you load or exit a program.

screenslice.jpg

picoslice.jpg

gmenu2xdistort.jpg

picodrivedistort.jpg


The screen problems seem to stop when you've entered/exited enough programs, but this just isn't worth being able to return to Gmenu2x.
 
Ouch that is scary.

Sounded good but I think I will wait a bit more.

How long does it take to load Gmenu2X currently? When I tried it it was painfully slow at about 15 seconds. It was only 2 or 3 seconds on the GP2X, I wonder why it was so much slower on the Wiz.
 
yikes!! I haven't seen that happen to me (referring to the pictures)

and I have no idea why that would happen. Does the gp2xmenu maybe init some parameters that the system needs? I wonder if you use "normal" (buggy) autorun if the gp2xmenu loads and then forks off the acutal autorun program, and of course this method totally bypasses it.

Well, I'll keep using it for a while until I can see what's going on. thanks for the reports. that's what beta means anyhow :)
 
The Wiz seems to have funny ways of handling the screen anyway, since it's actually a 240x320 screen that's turned on it's side.
That results in the diagonal tearing problem, and have you ever tried turning off the Wiz when running a program? Sometimes it distorts the screen like in the photos, sometimes you can see a bit of the shutdown screen, and on occasion you may actually see the wiz logo just fine. :p
 
I had Picodrive do some weird things before. I don't know what i ran but it started bogging and chugging.. Then I restarted it and I got similar weird screen glitches like that. I once had a game running in 1/4 of the screen like it was scaled down and all of the colors were glitched.

It may just be a weird Picodrive bug, does other stuff act weird?
 
fells said:
and I have no idea why that would happen. Does the gp2xmenu maybe init some parameters that the system needs?
Yes it indeed does. It mounts the SD and sets up LCD timings, among other things I guess.

Your uninstall script also doesn't remove /etc/autoreallyrun-setup.

DaveC said:
I had Picodrive do some weird things before. I don't know what i ran but it started bogging and chugging.. Then I restarted it and I got similar weird screen glitches like that. I once had a game running in 1/4 of the screen like it was scaled down and all of the colors were glitched.
You enabled 8bit renderer, which the original porter hasn't bother to implement properly.
 
Last edited by a moderator:
Thanks Notaz. So what this should do instead is force gp2xmenu to always run with the --autorun flag (I saw this in the filesystem dump).. This presumably does all the right system bootup stuff and then passes control to the autorun.

I can confirm the bug/failure btw.. if boot from cold boot it does this (because gp2xmenu was never run.) If you do it after gp2xmenu has been run once you're OK.

Will put through an update later today hopefully...
 
Hey Fells, did you manage to patch up the script? I tried to include gp2xmenu.old --autorun before it exec's gp2xmenu, but it didn't work.

Would be nice to use gp2xmenu as a more permanent replacement - it's so much nicer!
 
Back
Top