| |
| gdanko |
Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
I had set out to better integrate e-uae with Linux/Gnome. The requirements were:
1) Ability to launch either an a500 or a1200 from the adf's context menu in Nautilus. 2) The file action would find all disks in the set and attach the first four to uae. If the adf file name does not adhere to TOSEC naming standard (Filename (Disk x of y).adf), thae single disk would still be attached to uae and you would have to manually select the others as needed. 3) The GUI would never be seen. Once you double click your adf, the game would appear in a window. Once you exit the game you see nothing more.
I was able to accomplish this with some Perl magic and a custom build of uae. MorphOS is already to launch adfs via double click but it does not find the other disks in the set (Disk x of y)... I am wondering if something like this can be done in ARexx? I don't know if it supports regex or not. If anyone would like to take this on I could send you the perl code and perhaps it can be done in ARexx. Who knows.. Just a thought. :) |
|
|
| »2010/6/13 6:49 |
|
|
|
| itix |
Re: Better e-uae integration |
|
MorphOS Developer

Joined: 2003/2/24
Posts: 928 From: Finland
|
| |
| Perl scripts work in MorphOS if you have the SDK installed. |
|
|
| »2010/6/13 12:28 |
|
|
|
| Fab |
Re: Better e-uae integration |
|
MorphOS Developer

Joined: 2003/6/16
Posts: 820 From:
|
| |
I'll convert that to a rexx equivalent as soon as i'm done with my current stuff. :)
Rexx has no regexp, but for the thing you do, a simple: parse var filename basename '(Disk ' index ' of ' total ').adf' would be enough to set the basename, index and total variables. In fact, listing the directory and looking for the adfs is more work than the parsing part. :)
[ Edited by Fab on 2010/6/13 16:03 ] |
|
|
| »2010/6/13 15:58 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
| Would it be possible to include Perl as standard with MorphOS? Without trying to sound presumptuous, OS X includes Perl, so would it be an issue for Morph? |
|
|
| »2010/6/16 15:56 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
| I beat you to it, Fab. I emailed you the REXX script. I will hash out a couple of final details and then convert those last two commands to AREXX. I think it'll work. :) |
|
|
| »2010/6/16 15:57 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|
|
| »2010/6/16 16:32 |
|
|
|
|

Paladin of the Pegasos

Joined: 2003/3/1
Posts: 1792 From: Los Angeles
|
| |
better UAE integration has been a wish for some time, glad its getting done. Good job guys and good collaboration.
-- Pegasos 2 Freescale 7447 "G4" @ 1ghz 1gb Nanya Ram Triple Boot: MorphOS 2, Ubuntu PPC 8.04 GNU/Linux "Hardy Heron" , MacOS X 10.4 "TIGER",Radeon 9000 Pro 2 II GV-R9000 128bit Gfx |
|
|
| »2010/6/17 4:11 |
|
|
|
| xyphoid |
Re: Better e-uae integration |
|

Priest of the Order of the Butterfly

Joined: 2008/7/11
Posts: 558 From: Delaware, USA
|
| |
Well I can't wait seeing I never got it going anyways  |
|
|
| »2010/6/17 4:18 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|
|
| »2010/6/17 4:38 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
My script is working in that all the disks are hunted down and a working uae command string is generated. However, I don't know how to get ARexx to execute an external command. :(
In perl I can do: system("$command");
How is this done in ARexx? |
|
|
| »2010/6/20 7:08 |
|
|
|
| Fab |
Re: Better e-uae integration |
|
MorphOS Developer

Joined: 2003/6/16
Posts: 820 From:
|
| |
easy:
address command <command string>
If you need to change current directory for whatever reason, you'd use: pragma('D', <new directory>); |
|
|
| »2010/6/20 14:13 |
|
|
|
|

Paladin of the Pegasos

Joined: 2003/3/1
Posts: 1792 From: Los Angeles
|
| |
gdanko
How are you? Any updates on this project? :)
-- Pegasos 2 Freescale 7447 "G4" @ 1ghz 1gb Nanya Ram Triple Boot: MorphOS 2, Ubuntu PPC 8.04 GNU/Linux "Hardy Heron" , MacOS X 10.4 "TIGER",Radeon 9000 Pro 2 II GV-R9000 128bit Gfx |
|
|
| »2010/6/21 8:33 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
Yup! Over the weekend I worked on it and it's working. * The script logs to the ram disk * The script finds the first four disks of your set and maps them to dh0-3 * Disks not found are logged to the log file * If your adf is not of the filename format "Title (Disk x of y).adf" then just that adf is mapped to dh0 and disk swaps will be manual.
Many thanks to Fab for answering my ARexx questions. This was my first foray into the ARexx world. :)
[ Edited by gdanko on 2010/6/21 7:15 ] |
|
|
| »2010/6/21 15:13 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
| 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 ] |
|
|
| »2010/6/23 8:29 |
|
|
|
|

Paladin of the Pegasos

Joined: 2003/3/1
Posts: 1792 From: Los Angeles
|
| |
Very cool! Thanks alot man... I wonder if some dev in free time could do a quick interface or button to launch the arexx script.. I remember Targhan did some stuff like this way back when..
-- Pegasos 2 Freescale 7447 "G4" @ 1ghz 1gb Nanya Ram Triple Boot: MorphOS 2, Ubuntu PPC 8.04 GNU/Linux "Hardy Heron" , MacOS X 10.4 "TIGER",Radeon 9000 Pro 2 II GV-R9000 128bit Gfx |
|
|
| »2010/7/3 8:48 |
|
|
|
| amyren |
Re: Better e-uae integration |
|
|
| »2010/7/3 9:55 |
|
|
|
| Fab |
Re: Better e-uae integration |
|
MorphOS Developer

Joined: 2003/6/16
Posts: 820 From:
|
| |
| Yes, use this script as action instead of the simple previous command. Locating disks automagically is certainly better. ) |
|
|
| »2010/7/3 14:11 |
|
|
|
| gdanko |
Re: Better e-uae integration |
|

Caterpillar

Joined: 2010/6/8
Posts: 26 From:
|
| |
| You need to update the mime action as well |
|
|
| »2010/7/5 23:48 |
|
|
|
| amyren |
Re: Better e-uae integration |
|

Acolyte of the Butterfly

Joined: 2010/5/15
Posts: 107 From: Norway
|
| |
gdanko: "The Editor stripped my tab stops"
Thats probably why just editing the script makes this requestor pop up: 'Please insert volume "System: in any drive'
What did change in the editor? |
|
|
| »2010/7/6 8:49 |
|
|
|
PermissionsYou cannot post. You cannot edit. You cannot add polls. You cannot attach files.
| You cannot reply. You cannot delete. You cannot vote.
|
|
|
|
|
|
|