English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 01 May 2014, 23:26   #1
torturedutopian
Registered User
 
Join Date: Apr 2008
Location: France
Posts: 109
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 !
torturedutopian is offline  
Old 02 May 2014, 07:25   #2
amigafreak68k
Registered User
 
Join Date: Apr 2013
Location: Engelsdorf / Germany
Posts: 416
http://fs-uae.net/command-line
amigafreak68k is offline  
Old 02 May 2014, 07:28   #3
torturedutopian
Registered User
 
Join Date: Apr 2008
Location: France
Posts: 109
Well, I did read this beforehand
torturedutopian is offline  
Old 02 May 2014, 11:04   #4
amigafreak68k
Registered User
 
Join Date: Apr 2013
Location: Engelsdorf / Germany
Posts: 416
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>
amigafreak68k is offline  
Old 02 May 2014, 13:41   #5
torturedutopian
Registered User
 
Join Date: Apr 2008
Location: France
Posts: 109
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 13:55.
torturedutopian is offline  
Old 02 May 2014, 23:20   #6
Aeliss
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
this code unzip the archive, edit config file, install special file for save, use special command and load game.
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 .
Aeliss is offline  
Old 03 May 2014, 19:41   #7
kkgarbod
The Human/Gray Hybrid

kkgarbod's Avatar
 
Join Date: Dec 2009
Location: The Elizabeth Arkham Asylum for the Criminally Insane
Posts: 337
Hi.

I tried getting fs-uae to run a whdload game or three but it seems it doesn't work a whdload game in a lha archive gives a black screen, an zip archive dumps you straight to the amiga cmndline. And running alien breeed 3d gives you a guru error

all whdload games work on the launcher, and the config is done according to the documentation
kkgarbod is offline  
Old 04 May 2014, 13:35   #8
Aeliss
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
Aeliss is offline  
Old 05 May 2014, 20:01   #9
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 38
Posts: 3,546
Quote:
Originally Posted by torturedutopian View Post
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.
Yes, that is correct. You can of course use FS-UAe alone to start WHDLoad games, but then you need to provide a complete and bootable Amiga hard drive.

I'll likely add the possibility to do something like this:
Code:
fs-uae-launcher --run /path/to/config.fs-uae
FrodeSolheim is offline  
Old 29 January 2015, 19:51   #10
Enverex
Fantasy Man!

Enverex's Avatar
 
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.
Enverex is offline  
Old 29 January 2015, 20:24   #11
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 410
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
jbl007 is offline  
Old 29 January 2015, 20:48   #12
Enverex
Fantasy Man!

Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,352
Quote:
Originally Posted by jbl007 View Post
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
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.
Enverex is offline  
Old 28 February 2015, 12:43   #13
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 38
Posts: 3,546
Quote:
Originally Posted by Enverex View Post
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.
When you select a WHDLoad zip file using the hard drive selector in FS-UAE Launcher, the Launcher performs some additional checks there and then - see if the archive contains a .slave file, and if so, automatically populate the WHDLoad Arguments option field.

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.
FrodeSolheim is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
WHDload and FS-UAE command line browniesrgut support.FS-UAE 4 12 April 2013 14:21
LHA in command line for PC Vollldo request.Apps 2 04 March 2012 12:27
is there new command line ? turrican3 support.WinUAE 1 15 April 2007 12:21
command line? Drake1009 support.WinUAE 7 14 August 2004 17:17
Command Line. ruttolibero support.WinUAE 1 25 July 2003 15:05

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.09661 seconds with 12 queries