Difference between revisions of "Loader:yabause loader0910"

From Wah!ki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Yabause 0.9.10 Loader =
 
== About ==
 
== 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.
 
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.
Line 12: Line 13:
 
# Copy ~/.config/yabause.ini to ~/.config/yabause-template.ini
 
# Copy ~/.config/yabause.ini to ~/.config/yabause-template.ini
  
== Usage ==
+
== Configure the Loader ==
Execute the script with the following commandline
+
 
<pre>
+
Configure the cdromcore variable for the type of device to use
''<full path to bios file> "[rompath]/[name].[romext]"
+
* ''my $cdromcore = "1";''<br />
</pre>
+
*# ISO
 +
*# 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.
 +
# Copy ~/.config/yabause-template.ini to ~/.config/yabause.ini
 +
# Start Yabause manually and config all the required option so a new ini is written
 +
# Copy ~/.config/yabause.ini to ~/.config/yabause-template.ini
 +
 
 +
== Wah!Cade commandline_format ==
 +
Execute the script with the following commandline_format:<br />
  
 +
''<full path to bios file>'' "[rompath]/[name].[romext]"
  
 
== Perl Script ==
 
== Perl Script ==
Line 74: 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";
}