Difference between revisions of "Loader:yabause loader0910"

From Wah!ki
Jump to navigation Jump to search
 
Line 96: Line 96:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
[[Category:Script]][[Category:Sega Saturn]][[Category:Yabause]]

Latest revision as of 07:31, 5 February 2011

Yabause 0.9.10 Loader

About

This script addresses an issue with the broken commandline in Yabause 0.9.10. To work around this issue the loader rewrites the ini file at launch time with the required options.

The script itself is very much in an alpha state, use at your own risk.

Installation

  1. Save the script below to <filename>.pl
  2. Make the script executable. chmod +x <filename>.pl
  3. Add the loader into Wah!Cade
  4. Configure the commandline_format as per the Usage section
  5. Start Yabause manually and config all the required option so a new ini is written
  6. Copy ~/.config/yabause.ini to ~/.config/yabause-template.ini

Configure the Loader

Configure the cdromcore variable for the type of device to use

  • my $cdromcore = "1";
    1. ISO
    2. CD-ROM


Configure the correct yabpath for the version you are using, this is the location of the ini file Comment out the lines not required.

  • my $yabpath = $home . "/.config/";
  • my $yabpath = $home . "/.yabause/";


Configure the correct command to execute for the version of the emulator you have installed. Comment out the lines not required.

  • my $command = `which yabause-gtk`;
  • my $command = `which yabause-qt`;

Reconfiguring Yabause

If you need to reconfigure Yabause for any reason you will need to replace the yabause-template.ini.

  1. Copy ~/.config/yabause-template.ini to ~/.config/yabause.ini
  2. Start Yabause manually and config all the required option so a new ini is written
  3. Copy ~/.config/yabause.ini to ~/.config/yabause-template.ini

Wah!Cade commandline_format

Execute the script with the following commandline_format:

<full path to bios file> "[rompath]/[name].[romext]"

Perl Script

#!/usr/bin/perl
#
# Yabause Loader
# Work around to launch yabause 0.9.10

use IO::Handle;
my $home = "/home/" . `whoami`;
chomp($home);

######## CONFIG OPTIONS ########

my $cdromcore = "1";
my $yabpath = $home . "/.config/";
#my $yabpath = $home . "/.yabause/";
my $command = `which yabause-gtk`;
#my $command = `which yabause-qt`;

######## END CONFIG OPT ########

chomp($command);

my $cdrom = $ARGV[1];
my $biosfile = $ARGV[0];
my $procfile = $yabpath . "yabause-template.ini";
my $destfile = $yabpath . "yabause.ini";

# Pickup last used yabuse.ini at runtime
if ( -e $destfile ) {   
        system( "cp", "-u", $destfile, $procfile );
}

if ( -e $procfile && @ARGV > 1 ) {

        open (YABINI, ">", $destfile) or die $!;
        open (YABTINI, "<", $procfile) or die $!;
        while ($line = <YABTINI>) {
        if ($line =~ m/^CDROMCore\=/) {
                print YABINI "CDROMCore=1\n";
        } elsif ( $line =~ m/^CDROMDrive\=/ ) {
                print YABINI "CDROMDrive=".$cdrom."\n";
        } elsif ( $line =~ m/^BiosPath\=/ ) {
                print YABINI "BiosPath=".$biosfile."\n";
        } else {
                print YABINI $line;
        }
}
        system($command, "-a", "-f");
} else {
        print "Yabause Loader v0.1 by sairuk";
        print "\n";
        print "Usage: $0 BIOSFILE ISO\n";
}