4 ###APPAUTHOR: xiaoranzzz
5 ###APPDATE: Wed Oct 3 09:58:14 2007
7 ###APPDESC: qemu with default arguments
9 ###APPEXAMPLE: r-qemu -hda boot.raw
10 ###APPOPTION: ?:see qemu --help
12 $ARGV[0]="-h" unless
(@ARGV
);
14 exit(system
("plhelp",$0,@ARGV
)) if($_ eq
"-h" ||
$_ eq
"--help");
27 push @
{$result{noname
}},$last if($last);
37 push @
{$result{noname
}},$_;
49 my
%OPTS
=getOpt
(@ARGV
);
51 @noname
=@
{$OPTS{noname
}} if($OPTS{noname
});
53 foreach my
$arg (@noname
) {
54 foreach
(qw
/-hda -hdb -hdc -hdd -cdrom -fda -fdb/) {
64 foreach
(["-fda","a"],["-hda","c"],["-cdrom","d"]) {
65 if(defined
($OPTS{@
$_[0]})) {
73 push @args
,qw
'-localtime -soundhw sb16';# -smp 1 -m 320 -monitor stdio';# -soundhw sb16';
74 #push @args,qw'-hdd /myplace/emuos/datapool.raw' if(-f "/myplace/emuos/datapool.raw");
75 my
$emulator = 'qemu';
76 foreach
(sort keys
%OPTS
) {
77 next
if($_ eq
"noname");
81 elsif
($OPTS{$_} eq
$_) {
89 system
("printarg", "%-10s :\t%s\n",@args
);
90 #print("qemu ",join(" ",@args),"\n");
91 $ENV{QEMU_AUDIO_DRV
}="alsa";
92 exec($emulator,@args
);