Author Topic: Amiga lha games/whd games  (Read 51 times)

SegaDoesWhatNintenDont

  • Newbie
  • *
  • Posts: 26
Amiga lha games/whd games
« on: February 02, 2019, 12:48:52 PM »
Hello Amiga pros!
I'm trying to understand how to load rom archives with .lha extension. I have some to test. They came from a rasberrypi setup using amiberry.

Now I'm a little bit familiar with WinUAE and adf files and tried to read up on how to run lha games. I'm very confused now, and don't really know how to setup WinUAE, WinUAEloader, WHDrun or whatever.

Is there a simple way of setting up the software on a portable flash drive so it will recognize and launch my packed .lha files? Or do I need to partition a real physical drive somehow? Any help on this would be much appreciated.. :)

Aeliss

  • Hero Member
  • *****
  • Posts: 761
Re: Amiga lha games/whd games
« Reply #1 on: February 05, 2019, 10:18:54 AM »
For WHD, I have already done a topic for that http://www.mgalaxy.com/forum/index.php?topic=496.0.
For HDF, its' a little bit more complicated, because it's a n harddrive image, so you need to load a complete system image and mount this file.
For LHA, its' just a compressed file, so unzip them to see what is the content, but I just think it's the same file, *.zip on windows and *.lha on amiga.

This topic is old, from my memory fs-uae can now launch whd archive, but I haven't tried this feature yet : https://fs-uae.net/whdload-support
« Last Edit: February 05, 2019, 10:25:47 AM by Aeliss »

SegaDoesWhatNintenDont

  • Newbie
  • *
  • Posts: 26
Re: Amiga lha games/whd games
« Reply #2 on: February 09, 2019, 10:48:55 AM »
Thank you for the tip, Aleliss. :)

I tried it and got FS-UAE working perfectly by using the launcher to load WHDs and get the config from the online database.

Now my problem is that I don't know the first thing about autoit or how to use scripts. I tried to understand but it seems to me all the instructions given on this forum are targeted towards people who actually know already how to do it but just need help with the right code..

What I would like to do is use FS UAE from within mGalaxy. I tried pointing the emulator to the FS-UAE-launcher.exe, but that doesn't seem to do the trick.

Can you explain to me - in a noob friendly way - where to go and what to edit in order to get FS-UAE-launcher.exe to run a specific .lha archive? ;)

Aeliss

  • Hero Member
  • *****
  • Posts: 761
Re: Amiga lha games/whd games
« Reply #3 on: February 10, 2019, 05:51:10 AM »
WinUAELoader.exe works with fs-uae too ?

BTW if you are using fs-uae, have you a command line to launch game ? A command line with FS-UAE-launcher.exe ?

From my memory no, so if you wana use the "hard way". Some explanation about autoit
- you will find some script in F:\emulateur\mGalaxy\Data\Scripts
- You can edit them with notepad, but better to use the application with it.
- When you have instaled mGalaxy it have also installed autoit, so you don't need more.
- To make *.exe with the script > tools/ compile.

On my side I m using the exe file as executable, but my script have changed since the last one.
Here my last one

Code: AutoIt
  1. #include <array.au3>
  2. #include <File.au3>
  3.  
  4. local $fichier = $CmdLineRaw
  5. ;clen name
  6. $fichier = StringTrimRight( $fichier, 1 )
  7. $fichier = StringTrimleft( $fichier, 1 )
  8.  
  9. local $tmp = @ScriptDir & '\WHD_loader\tmp\'
  10. local $app
  11. local $config = @ScriptDir & '\WHD_loader\WHDLoader.uae'
  12.  
  13. ;delete previous archives
  14. DirRemove(@scriptdir & "\WHD_loader\tmp\",1)
  15. DirCreate(@scriptdir & "\WHD_loader\tmp\")
  16.  
  17. ;unzip archive
  18. _Zip_UnzipAll($fichier,$tmp)
  19.  
  20. ;we get the name of the game
  21. Local $search = FileFindFirstFile($tmp & '*.info')
  22. If $search = -1 Then exit 0
  23. Local $file = FileFindNextFile($search)
  24. $file = StringTrimRight( $file, 5 )
  25. FileClose($search)
  26.  
  27. ;file modification
  28. Local $file2 = FileOpen(@ScriptDir & '\WHD_loader\WHD\S\user-startup',2)
  29. If $file2 = -1 Then exit 0
  30.  
  31. Local $patch = IniRead(@ScriptDir & "\Data.ini", "PATCH", $file, "")
  32. Local $save = IniRead(@ScriptDir & "\Data.ini", "SAVE", $file, "")
  33.  
  34. ;Add save if exist
  35. if $save <> "" Then
  36.    local $search2 = FileFindFirstFile(@scriptdir & '\SAVE\' & $file & '\' & $save & '\'  & '\*.*' )
  37.    If $search2 <> -1 then
  38.           local $fileSave = FileFindNextFile($search2)
  39.           while $fileSave <> ''
  40.                  FileCopy (@scriptdir & '\SAVE\' & $file & '\' & $save & '\' & $fileSave, $tmp & $file & '\' & $save & '\' & $fileSave, 1 )
  41.                  $fileSave = FileFindNextFile($search2)
  42.           wend
  43.    Endif
  44.    FileClose($search2)
  45.    $patch = 'NOWRITECACHE ' & $patch
  46.  
  47. FileWriteLine($file2, 'echo "";')
  48. FileWriteLine($file2, 'echo "WHD loader";')
  49. FileWriteLine($file2, 'echo "Running: ' & $file & '.Slave";')
  50. FileWriteLine($file2, 'echo "Special command : ' & $patch & '";')
  51. FileWriteLine($file2, 'echo "";')
  52. FileWriteLine($file2, 'echo "Remember to use the quit key instead of closing WinUAE!";')
  53. FileWriteLine($file2, 'echo "";')
  54. FileWriteLine($file2, 'cd dh1:' & $file & ';')
  55. FileWriteLine($file2, 'whdload ' & $file & '.Slave PRELOAD ' & $patch & ';')
  56. FileClose($file2)
  57.  
  58. #cs
  59. ;for WinUAE
  60. $app = @ScriptDir & '\..\WinUAE\WinUAE.exe'
  61.  
  62. ;configuration modification
  63. local $aLines
  64.  
  65. _FileReadToArray($config, $aLines)
  66. for $i = 0 To $aLines[0]
  67.    If StringInStr($aLines[$i], "filesystem2=rw,DH1") Then
  68.          _FileWriteToLine($config, $i ,"filesystem2=rw,DH1:DH1:" & $tmp & ",0", 1)
  69.    EndIf
  70.    If StringInStr($aLines[$i], "uaehf1=dir,rw,DH1:") Then
  71.          _FileWriteToLine($config, $i ,"uaehf1=dir,rw,DH1:DH1:" & $tmp & ",0", 1)
  72.    EndIf
  73. Next
  74. Runwait('"' & $app & '" -config="' & $config )
  75. #Ce
  76.  
  77. ;#cs
  78. ;For FS-UAE
  79. $app = @ScriptDir & '\..\fs-uae\Windows\fs-uae\fs-uae.exe'
  80. $config = @ScriptDir & '\WHD_loader\whd.fs-uae'
  81.  
  82. Runwait('"' & $app & '" ' & $config )
  83. ;#ce
  84.  
  85. ;Sauvegarde
  86. if $save <> "" Then
  87.    local $search2 = FileFindFirstFile(@scriptdir & '\SAVE\' & $file & '\' & $save & '\'  & '\*.*' )
  88.    If $search2 <> -1 then
  89.           local $fileSave = FileFindNextFile($search2)
  90.           while $fileSave <> ''
  91.                  FileCopy ($tmp & $file & '\' & $save & '\' & $fileSave, @scriptdir & '\SAVE\' & $file & '\' & $save & '\' & $fileSave, 1 )
  92.                  $fileSave = FileFindNextFile($search2)
  93.           wend
  94.    Endif
  95.    FileClose($search2)
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. ;==========================================================================
  103. ;
  104. ; Function Name:    _Zip_DllChk()
  105. ; Description:      Internal error handler.
  106. ; Parameter(s):     none.
  107. ; Requirement(s):   none.
  108. ; Return Value(s):  Failure - @extended = 1
  109. ; Author(s):        smashley
  110. ;
  111. ;===============================================================================
  112. Func _Zip_DllChk()
  113.         If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return 2
  114.         If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return 3
  115.         Return 0
  116.  EndFunc   ;==>_Zip_DllChk
  117.  
  118.  ;===============================================================================
  119. ;
  120. ; Function Name:    _Zip_UnzipAll()
  121. ; Description:      Extract all files contained in a ZIP Archieve.
  122. ; Parameter(s):     $hZipFile - Complete path to zip file that will be created (or handle if existant)
  123. ;                                       $hDestPath - Complete path to where the files will be extracted
  124. ;                                       $flag = 1
  125. ;                                       - 1 no progress box
  126. ;                                       - 0 progress box
  127. ; Requirement(s):   none.
  128. ; Return Value(s):  On Success - 0
  129. ;                   On Failure - sets @error 1~3
  130. ;                                       @error = 1 no Zip file
  131. ;                                       @error = 2 no dll
  132. ;                                       @error = 3 dll isn't registered
  133. ; Author(s):        torels_
  134. ; Notes:                        The return values will be given once the extracting process is ultimated... it takes some time with big files
  135. ;
  136. ;===============================================================================
  137. Func _Zip_UnzipAll($hZipFile, $hDestPath, $flag = 1)  
  138.         Local $DLLChk = _Zip_DllChk()
  139.         If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll
  140.         If not _IsFullPath($hZipFile) then Return SetError(4,0) ;zip file isn't a full path
  141.         If Not FileExists($hZipFile) Then Return SetError(2, 0, 0) ;no zip file
  142.         If Not FileExists($hDestPath) Then DirCreate($hDestPath)
  143.         Local $aArray[1]
  144.         $oApp = ObjCreate("Shell.Application")
  145.         $oApp.Namespace($hDestPath).CopyHere($oApp.Namespace($hZipFile).Items)
  146.         For $item In $oApp.Namespace($hZipFile).Items
  147.                 _ArrayAdd($aArray, $item)
  148.         Next
  149.         While 1
  150.                 If $flag = 1 then _Hide()
  151.                 If FileExists($hDestPath & "\" & $aArray[UBound($aArray) - 1]) Then
  152.                         Return SetError(0, 0, 1)
  153.                         ExitLoop
  154.                 EndIf
  155.                 Sleep(500)
  156.         WEnd
  157.  EndFunc   ;==>_Zip_UnzipAll
  158.  
  159. ;===============================================================================
  160. ;
  161. ; Function Name:    _Hide()
  162. ; Description:      Internal Function.
  163. ; Parameter(s):     none
  164. ; Requirement(s):   none.
  165. ; Return Value(s):  none.
  166. ; Author(s):        torels_
  167. ;
  168. ;===============================================================================
  169. Func _Hide()
  170.         If ControlGetHandle("[CLASS:#32770]", "", "[CLASS:SysAnimate32; INSTANCE:1]") <> "" And WinGetState("[CLASS:#32770]") <> @SW_HIDE       Then ;The Window Exists
  171.                 $hWnd = WinGetHandle("[CLASS:#32770]")
  172.                 WinSetState($hWnd, "", @SW_HIDE)
  173.         EndIf
  174.  
  175.  ;===============================================================================
  176. ;
  177. ; Function Name:    _IsFullPath()
  178. ; Description:      Internal Function.
  179. ; Parameter(s):     $path - a zip path
  180. ; Requirement(s):   none.
  181. ; Return Value(s):  success - True.
  182. ;                                       failure - False.
  183. ; Author(s):        torels_
  184. ;
  185. ;===============================================================================
  186. Func _IsFullPath($path)
  187.     if StringInStr($path,":\") then
  188.         Return True
  189.     Else
  190.         Return False
  191.     EndIf

And to use it

Code: [Select]
  <System guid="Commodore Amiga-Zc3nHfED" type="Computer">
    <Name ss="75" em="Commodore_Amiga" tgdb="Amiga" gb="1|AMI">Commodore Amiga</Name>
    <UserName>Commodore Amiga WHD</UserName>
    <AppPath>F:\emulateur\Amiga\MyWHDLoader\WHDloader.exe</AppPath>
    <RomPath>F:\emulateur\Amiga\Jeux WHD</RomPath>
    <SnapPath>F:\emulateur\mGalaxy\snapsemul\AmigaWHD</SnapPath>
    <VidPath>
    </VidPath>
    <CoverPath>
    </CoverPath>
    <LogoPath>
    </LogoPath>
    <ArtPath>
    </ArtPath>
    <Emu selected="My loader">
      <Cmd hidden="false" name="FS-UAE" value="--fullscreen=1 --floppy-drive-0=&quot;%path\%file%ext&quot;" extensions=".adf,.adz,.dms,.fdi,.gz,.hdf,.hdz,.ipf,.rdf,.rdz,.vhd,.zip" />
      <Cmd hidden="false" name="WinUAE" value="-config=mGalaxy.uae -0 &quot;%path\%file%ext&quot;" extensions=".adf,.adz,.dms,.fdi,.gz,.hdf,.hdz,.ipf,.rdf,.rdz,.vhd,.zip" />
      <Cmd hidden="true" name="RetroArch [puae_libretro.dll]" value="-f -L cores\puae_libretro.dll &quot;%path\%file%ext&quot;" extensions=".adf,.adz,.dms,.fdi,.gz,.hdf,.hdz,.ipf,.rdf,.rdz,.vhd,.zip" />
      <Cmd hidden="false" name="My loader" value="&quot;%path\%file%ext&quot;" extensions=".adf,.adz,.dms,.fdi,.gz,.hdf,.hdz,.ipf,.rdf,.rdz,.vhd,.zip" />
    </Emu>
    <Active>True</Active>
    <Script>True</Script>
    <Database>True</Database>
    <Screensaver>False</Screensaver>
    <Theme>
    </Theme>
    <Prelaunch enable="False">
      <Data app="" cmd="" state="0" />
    </Prelaunch>
  </System>
« Last Edit: February 10, 2019, 05:55:12 AM by Aeliss »