1
0
.dotfiles/home/bin/mednafen-zenity

34 lines
752 B
Plaintext
Raw Normal View History

2014-02-28 23:42:51 +00:00
#!/usr/bin/perl -w
# mednafen-ptk - Perl/Tk front-end for launching mednafen.
use strict;
use warnings;
# Path to ROMs.
my $root = shift(@ARGV) || "$ENV{HOME}/ROMS/GBA/Games";
# Get a ROM selection.
chdir($root);
my $rom = `zenity --title "Select a GameBoy or NES ROM" --file-selection`;
chomp $rom;
print "Selected: $rom\n";
# A selection?
2015-07-18 23:57:52 +00:00
if (defined $rom && $rom =~ /\.(gb|gbc|gba|nes|smc|sfc)/i) {
2014-02-28 23:42:51 +00:00
if (-f $rom) {
# Launch Mednafen.
exec(
#"padsp", # pulseaudio oss emulation
"mednafen",
-sounddriver => "sdl", #"alsa", # sound driver
-vdriver => "sdl", # video driver (or opengl)
"-gb.xscale" => 4, # gameboy scaling
"-gb.yscale" => 4,
"-gba.xscale" => 2, # GBA scaling
"-gba.yscale" => 2,
$rom,
);
}
}