[stella] DASM question

B. Watson atari at hardcoders.org
Fri Sep 15 14:13:08 CDT 2006



On Fri, 15 Sep 2006, Manuel Rotschkar wrote:

>> Why don't you rename your source something like *.S64 and set a new
>> default for that?
>
> Well, for one am I running out of Textpad shortcuts (CTRL-1 = DASM, CTRL-2
> = Z26, CTRL-3 = Perl, CTRL-4 = 7800 Make, CTRL-5 = XML-Spy, etc...) and
> then it'd mean assigning the same tool twice, which somehow doesn't feel
> elegant :)

Could you make ctrl-1 call a wrapper script that invokes DASM with the
correct parameters, depending on the source file name extension?

I don't know how you'd do it as a DOS batch file, but in perl it could
look something like:

----------------------------------------------------------------
#!/usr/bin/perl -w

%type_map = (
 	DEFAULT => 'bin',
 	s64 => 'prg',
# put whatever else you want here...
);

$file = shift || die "Missing filename\n";
($base, $src_ext) = split /\./, $file;
$dst_ext = $type_map{lc $src_ext} || $type_map{DEFAULT};

system("dasm $file -o$base.$dst_ext -v3 -f3");
----------------------------------------------------------------

Then have ctrl-1 execute "perl scriptname.pl filename"

--
B.




More information about the Stella mailing list