Quote:
magnetic wrote:
gdanko
How are you? Any updates on this project? :)
Here is the script. You map it to your application/x-adf mime type and you're ready to go. For now you'll need one for a500 and one for a1200.
The mapping will look like this:
>nil: Data:Scripts/uae-a500.rexx %sp
Fab will hopefully integrate this into his howto so I won't reinvent the wheel and put up a new page.
/* uae-a500.rexx */
parse ARG adf_filename
/* strip double quotes from the filename since this breaks exist */
strlen = length(adf_filename)
if right(adf_filename, 1) = '"' then do
adf_filename = substr(adf_filename, 1, strlen -1)
strlen = length(adf_filename)
end
if left(adf_filename, 1) = '"' then do
adf_filename = substr(adf_filename, 2, strlen -1)
end
parse var adf_filename basename '(Disk 'index' of 'total').adf'
base_dir = "System:Applications/e-uae"
single_disk = "Yes"
counter = 1
log_file = "RAM:e-uae.log"
uae = base_dir"/e-uae"
/* arexx's time/date functions are weak */
month = date(M)
month = substr(month, 1, 3)
date = date(U)
date = substr(date, 4, 2)
datestamp = month date
timestamp = datestamp time(N)
/* open the log file for writing */
if open('FH', log_file, 'w') then do
call writeln('FH', timestamp "Starting")
end
uae_command = uae "-f" base_dir"/conf/A500-hires.conf"
/* hunt for disks 1-4 of any game and map them if they exist */
do while counter <= total
filename = basename"(Disk" counter "of" total").adf"
if exists(filename) then do
single disk = "No"
call close('ADF')
call writeln('FH', timestamp "Mapping" filename "to dh"counter-1)
uae_command = uae_command "-"counter-1 '"'filename'"'
end
else
call writeln('FH', timestamp "Unable to find "filename)
counter = counter + 1
end
/* only one disk to be mapped */
if single_disk = "Yes" then do
call writeln('FH', timestamp "Mapping" adf_filename "to dh0")
uae_command = uae_command "-0 " '"'adf_filename'"'
call writeln('FH', timestamp "The command is: "uae_command)
call close('FH')
/* launch uae */
address command uae_command
Hmm the editor stripped my tab stops :) Oh well.
[ Edited by gdanko on 2010/6/23 0:31 ]