User avatar
carl_retrotext
Posts: 80
Joined: Sun May 06, 2012 1:05 pm
Location: essex
Contact: Website

How could I make a alternative boot?

Tue May 29, 2012 5:17 pm

I have a Commodore emulator that would work well with different over scan parameters to startx, is there a way of writing a config file and putting it somewhere that would first change the over-scan, then run the emulator, but it I reset the bios it will revert to the normal GUI over-scan?

just got the hang of sudo nano in command line, that is my level of experience. ;)

thanks

felix123
Posts: 153
Joined: Tue May 15, 2012 6:06 am

Re: How could I make a alternative boot?

Wed May 30, 2012 1:54 pm

config.txt is only read at boot, so you'll need to change it, then reboot before the settings take place.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: How could I make a alternative boot?

Wed May 30, 2012 2:00 pm

I made a couple of little bash-scripts last night to make this easier, but all the rebooting corrupted my filesysytem so I lost my changes! :( I'll try to reproduce it for you again this evening.

User avatar
carl_retrotext
Posts: 80
Joined: Sun May 06, 2012 1:05 pm
Location: essex
Contact: Website

Re: How could I make a alternative boot?

Wed May 30, 2012 4:36 pm

AndrewS wrote:I made a couple of little bash-scripts last night to make this easier, but all the rebooting corrupted my filesysytem so I lost my changes! :( I'll try to reproduce it for you again this evening.

Thank you AndrewS

Its so I can initiate an emulator that needs plenty of overscan but of course it would then be a nightmare to re configure it to normal for startx. :)

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: How could I make a alternative boot?

Thu May 31, 2012 1:24 am

Okay...
  1. copy config.txt to two other files

    Code: Select all

    sudo cp /boot/config.txt /boot/config_normal.txt
    sudo cp /boot/config.txt /boot/config_emu.txt
    and edit the two files to suit - one with your 'normal' overscan and the other with your emulator overscan
  • Create /usr/local/bin/runemu containing this code

    Code: Select all

    #!/bin/bash
    if [[ $EUID -ne 0 ]]
    then
      echo "This tool must be run as root"
      exit 1
    fi
    cp /boot/config_emu.txt /boot/config.txt
    touch /boot/run_emu
    sync
    reboot
    and make it executable

    Code: Select all

    sudo chmod +x /usr/bin/local/runemu
  • Add this code to /etc/rc.local (just before the final "return 0"

    Code: Select all

    if [ -f /boot/run_emu ]; then
        cp /boot/config_normal.txt /boot/config.txt
        rm /boot/run_emu
        sync
    fi
Now when you run "sudo runemu" it'll switch to the emulator overscan settings and reboot, and the very next time you reboot after that, it'll be back to your normal overscan settings 8-)

User avatar
carl_retrotext
Posts: 80
Joined: Sun May 06, 2012 1:05 pm
Location: essex
Contact: Website

Re: How could I make a alternative boot?

Thu May 31, 2012 4:37 pm

THANK YOU :D

Andrew you have played a blinder, also I understand what code you included so its a win win.

I will put it in the Pi tonight, and play with the emulator overscan settings. :)

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: How could I make a alternative boot?

Fri Jun 01, 2012 12:29 pm

Glad to hear that you got it working okay, and that you actually understand what it's doing - I deliberately kept it simple :)
Now you've got your scripting-toes wet ;) if you're feeling adventurous maybe you could try extending this system to also auto-run the emulator http://raspberrypi.org/phpBB3/viewtopic.php?f=29&t=7192 and then auto-reboot after quitting the emulator? :D
(you'd probably need some kind of secondary 'marker file')

User avatar
carl_retrotext
Posts: 80
Joined: Sun May 06, 2012 1:05 pm
Location: essex
Contact: Website

Re: How could I make a alternative boot?

Sat Jun 16, 2012 5:24 pm

Thanks again Andrew I have put this into the I and it works perfectly, in fact when I runemu the pi will indeed reboot, if I reboot in the normal way it always just hangs and I re power it, something that does not bother me.

You should be a mod or something, Kudos :)

User avatar
carl_retrotext
Posts: 80
Joined: Sun May 06, 2012 1:05 pm
Location: essex
Contact: Website

Re: How could I make a alternative boot?

Thu Aug 09, 2012 7:02 pm

Hi since upgrading to Wheezy Beta, this script does not work as well, it executes runemu okay and reboots in the eum overscan settings, however it never changes back.

what code should I use to make a 'runnormal' command that will manually return the rebooted pi to normal overscan settings- this is fine for me.

User avatar
carl_retrotext
Posts: 80
Joined: Sun May 06, 2012 1:05 pm
Location: essex
Contact: Website

Re: How could I make a alternative boot?

Thu Aug 09, 2012 7:40 pm

all sorted, I made another runemu file but called runnorm, and then made it pull the _normal.txt file.

happy days!

spannernick
Posts: 12
Joined: Sun Oct 12, 2014 11:50 am

Re: How could I make a alternative boot?

Mon Oct 13, 2014 2:56 pm

Can you tell me how you did this I have installed the c64 (x64) emulator but when running it in Debian its is very slow..

I need a walkthrough ..?

DirkS
Posts: 7621
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How could I make a alternative boot?

Mon Oct 13, 2014 3:01 pm

This topic has been dead for more than 2 years. Can't you find anything more recent?

Return to “Beginners”

Who is online

Users browsing this forum: Bing [Bot], Burngate, kaksi and 44 guests