![]() |
![]() |
![]() |
#1 |
Registered User
![]() Join Date: Apr 2008
Location: France
Age: 38
Posts: 158
|
Command line WHDLoad support ?
Hi everyone !
I'm setting up a NUC as an emulation machine. It's pretty good ! I'm using Advance Menu to start MAME/MESS/etc. and I hope FS-UAE soon ! What I would like to know is if it's possible to start fs-uae from the command line with a WHDLoad game ? It works from fs-uae-launcher but in order to integrate it in AdvMenu I would need command line support ![]() I know it was planned but I don't know if it's possible yet ? Cheers & thanks again a lot to all involved ! |
![]() |
![]() |
#2 |
Registered User
Join Date: Apr 2013
Location: Engelsdorf / Germany
Posts: 440
|
|
![]() |
![]() |
#3 |
Registered User
![]() Join Date: Apr 2008
Location: France
Age: 38
Posts: 158
|
Well, I did read this beforehand
![]() |
![]() |
![]() |
#4 |
Registered User
Join Date: Apr 2013
Location: Engelsdorf / Germany
Posts: 440
|
Now what's the problem?
You can create a config file for your WHDLoad game with the Launcher and start fs-uae with command line like: Code:
fs-uae <path-to-your-config-file> |
![]() |
![]() |
#5 |
Registered User
![]() Join Date: Apr 2008
Location: France
Age: 38
Posts: 158
|
Ah, yes, you're right ! I didn't consider this. Indeed, I can generate a config file from a script or something and then start fs-uae. Turned out I was too lazy, I thought I could just invoke fs-uae with the whdload game .zip as an option
![]() Hmm, I thought, however, that it was fs-uae-launcher and not fs-uae itself that took care of creating the temporary system to autostart a whdload game. Last edited by torturedutopian; 02 May 2014 at 14:55. |
![]() |
![]() |
#6 |
Registered User
![]() Join Date: Sep 2013
Location: outer space
Posts: 22
|
I m making the same thing, it s the code I m using in my front end
Code:
#include <array.au3> #include <File.au3> local $fichier = $CmdLineRaw ;clen name $fichier = StringTrimRight( $fichier, 1 ) $fichier = StringTrimleft( $fichier, 1 ) local $tmp = @ScriptDir & '\WHD_loader\tmp\' local $app local $config = @ScriptDir & '\WHD_loader\WHDLoader.uae' ;delete previous archives DirRemove(@scriptdir & "\WHD_loader\tmp\",1) DirCreate(@scriptdir & "\WHD_loader\tmp\") ;unzip archive _Zip_UnzipAll($fichier,$tmp) ;we get the name of the game Local $search = FileFindFirstFile($tmp & '*.info') If $search = -1 Then exit 0 Local $file = FileFindNextFile($search) $file = StringTrimRight( $file, 5 ) FileClose($search) ;file modification Local $file2 = FileOpen(@ScriptDir & '\WHD_loader\WHD\S\user-startup',2) If $file2 = -1 Then exit 0 Local $patch = IniRead(@ScriptDir & "\Data.ini", "PATCH", $file, "") Local $save = IniRead(@ScriptDir & "\Data.ini", "SAVE", $file, "") ;Add save if exist if $save <> "" Then local $search2 = FileFindFirstFile(@scriptdir & '\SAVE\' & $file & '\' & $save & '\' & '\*.*' ) If $search2 <> -1 then local $fileSave = FileFindNextFile($search2) while $fileSave <> '' FileCopy (@scriptdir & '\SAVE\' & $file & '\' & $save & '\' & $fileSave, $tmp & $file & '\' & $save & '\' & $fileSave, 1 ) $fileSave = FileFindNextFile($search2) wend Endif FileClose($search2) $patch = 'NOWRITECACHE ' & $patch Endif FileWriteLine($file2, 'echo "";') FileWriteLine($file2, 'echo "WHD loader";') FileWriteLine($file2, 'echo "Running: ' & $file & '.Slave";') FileWriteLine($file2, 'echo "Special command : ' & $patch & '";') FileWriteLine($file2, 'echo "";') FileWriteLine($file2, 'echo "Remember to use the quit key instead of closing WinUAE!";') FileWriteLine($file2, 'echo "";') FileWriteLine($file2, 'cd dh1:' & $file & ';') FileWriteLine($file2, 'whdload ' & $file & '.Slave PRELOAD ' & $patch & ';') FileClose($file2) #CS ;for WinUAE $app = @ScriptDir & '\..\WinUAE\WinUAE.exe' ;configuration modification local $aLines _FileReadToArray($config, $aLines) for $i = 0 To $aLines[0] If StringInStr($aLines[$i], "filesystem2=rw,DH1") Then _FileWriteToLine($config, $i ,"filesystem2=rw,DH1:DH1:" & $tmp & ",0", 1) EndIf If StringInStr($aLines[$i], "uaehf1=dir,rw,DH1:") Then _FileWriteToLine($config, $i ,"uaehf1=dir,rw,DH1:DH1:" & $tmp & ",0", 1) EndIf Next Runwait('"' & $app & '" -config="' & $config ) #Ce ;#cs ;For FS-UAE $app = @ScriptDir & '\..\fs-uae\fs-uae.exe' $config = @ScriptDir & '\WHD_loader\whd.fs-uae' Runwait('"' & $app & '" ' & $config ) ;#ce ;Sauvegarde if $save <> "" Then local $search2 = FileFindFirstFile(@scriptdir & '\SAVE\' & $file & '\' & $save & '\' & '\*.*' ) If $search2 <> -1 then local $fileSave = FileFindNextFile($search2) while $fileSave <> '' FileCopy ($tmp & $file & '\' & $save & '\' & $fileSave, @scriptdir & '\SAVE\' & $file & '\' & $save & '\' & $fileSave, 1 ) $fileSave = FileFindNextFile($search2) wend Endif FileClose($search2) Endif exit 0 ;========================================================================== ; ; Function Name: _Zip_DllChk() ; Description: Internal error handler. ; Parameter(s): none. ; Requirement(s): none. ; Return Value(s): Failure - @extended = 1 ; Author(s): smashley ; ;=============================================================================== Func _Zip_DllChk() If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return 2 If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return 3 Return 0 EndFunc ;==>_Zip_DllChk ;=============================================================================== ; ; Function Name: _Zip_UnzipAll() ; Description: Extract all files contained in a ZIP Archieve. ; Parameter(s): $hZipFile - Complete path to zip file that will be created (or handle if existant) ; $hDestPath - Complete path to where the files will be extracted ; $flag = 1 ; - 1 no progress box ; - 0 progress box ; Requirement(s): none. ; Return Value(s): On Success - 0 ; On Failure - sets @error 1~3 ; @error = 1 no Zip file ; @error = 2 no dll ; @error = 3 dll isn't registered ; Author(s): torels_ ; Notes: The return values will be given once the extracting process is ultimated... it takes some time with big files ; ;=============================================================================== Func _Zip_UnzipAll($hZipFile, $hDestPath, $flag = 1) Local $DLLChk = _Zip_DllChk() If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll If not _IsFullPath($hZipFile) then Return SetError(4,0) ;zip file isn't a full path If Not FileExists($hZipFile) Then Return SetError(2, 0, 0) ;no zip file If Not FileExists($hDestPath) Then DirCreate($hDestPath) Local $aArray[1] $oApp = ObjCreate("Shell.Application") $oApp.Namespace($hDestPath).CopyHere($oApp.Namespace($hZipFile).Items) For $item In $oApp.Namespace($hZipFile).Items _ArrayAdd($aArray, $item) Next While 1 If $flag = 1 then _Hide() If FileExists($hDestPath & "\" & $aArray[UBound($aArray) - 1]) Then Return SetError(0, 0, 1) ExitLoop EndIf Sleep(500) WEnd EndFunc ;==>_Zip_UnzipAll ;=============================================================================== ; ; Function Name: _Hide() ; Description: Internal Function. ; Parameter(s): none ; Requirement(s): none. ; Return Value(s): none. ; Author(s): torels_ ; ;=============================================================================== Func _Hide() If ControlGetHandle("[CLASS:#32770]", "", "[CLASS:SysAnimate32; INSTANCE:1]") <> "" And WinGetState("[CLASS:#32770]") <> @SW_HIDE Then ;The Window Exists $hWnd = WinGetHandle("[CLASS:#32770]") WinSetState($hWnd, "", @SW_HIDE) EndIf EndFunc ;=============================================================================== ; ; Function Name: _IsFullPath() ; Description: Internal Function. ; Parameter(s): $path - a zip path ; Requirement(s): none. ; Return Value(s): success - True. ; failure - False. ; Author(s): torels_ ; ;=============================================================================== Func _IsFullPath($path) if StringInStr($path,":\") then Return True Else Return False EndIf Endfunc It s an autoit script, you don't have all the files, but it s not hard to modify. But the problem is to find a "standard configuration" for all WHDgame and that is another problem. We realy need to use the "config per game" fs-uae fonctionnality ![]() |
![]() |
![]() |
#7 |
The Human/Gray Hybrid
![]() Join Date: Dec 2009
Location: The Elizabeth Arkham Asylum for the Criminally Insane
Posts: 364
|
Hi.
I tried getting fs-uae to run a whdload game or three but it seems it doesn't work ![]() ![]() all whdload games work on the launcher, and the config is done according to the documentation |
![]() |
![]() |
#8 |
Registered User
![]() Join Date: Sep 2013
Location: outer space
Posts: 22
|
You need 2 thing for WHDload working:
1 - the game in zip format/lha format or decompressed 2 - a special folder with "system file" and all WHDload configuration file (and kickstarts) 3 - Give the correct argument in command line, the zip name not working. For the second point you can use this one from fs-uae (lost in windows user files) or make you own folder. and use in fs-uae config hard_drive_0 = F:\emulateur\Amiga\MyWHDLoader\WHD_loader\WHD << your special folder hard_drive_1 = F:\emulateur\Amiga\MyWHDLoader\WHD_loader\tmp << the folder with game |
![]() |
![]() |
#9 | |
FS-UAE Developer
![]() ![]() Join Date: Dec 2011
Location: Førde, Norway
Age: 40
Posts: 3,752
|
Quote:
I'll likely add the possibility to do something like this: Code:
fs-uae-launcher --run /path/to/config.fs-uae |
|
![]() |
![]() |
#10 |
Fantasy Man!
![]() Join Date: Apr 2002
Location: UK
Posts: 1,352
|
Is it possible to do something like...
fs-uae /games/WHDLoad/ChaosEngine.zip ... or ... fs-uae-launcher /games/WHDLoad/ChaosEngine.zip ... yet? I can't quite make complete sense of how the WHDLoad launching is supposed to work from the command line. |
![]() |
![]() |
#11 |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 416
|
I think the easiest way is: Open the launcher, configure you amiga, set ChaosEngine.zip as first hard drive, save config.
Later you can launch it directly with Code:
fs-uae-launcher /full/path/to/yourconfig |
![]() |
![]() |
#12 |
Fantasy Man!
![]() Join Date: Apr 2002
Location: UK
Posts: 1,352
|
Unfortunately that's not really the easiest when you have hundreds of WHDLoad files. Loading games "Just works" through the launcher so I thought it would work the same way through the command line.
|
![]() |
![]() |
#13 | |
FS-UAE Developer
![]() ![]() Join Date: Dec 2011
Location: Førde, Norway
Age: 40
Posts: 3,752
|
Quote:
Perhaps I'll make a feature where - if you give FS-UAE Launcher a zip file as a command line argument - it will automatically configure the WHDLoad feature (if the zip file is a zipped WHDLoad game) as if you used the hard drive selector button in the GUI. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
WHDload and FS-UAE command line | browniesrgut | support.FS-UAE | 4 | 12 April 2013 15:21 |
LHA in command line for PC | Vollldo | request.Apps | 2 | 04 March 2012 13:27 |
is there new command line ? | turrican3 | support.WinUAE | 1 | 15 April 2007 13:21 |
command line? | Drake1009 | support.WinUAE | 7 | 14 August 2004 18:17 |
Command Line. | ruttolibero | support.WinUAE | 1 | 25 July 2003 16:05 |
|
|