Author Topic: Playing 7zip PSX titles?  (Read 5123 times)

Aeliss

  • Hero Member
  • *****
  • Posts: 915
Re: Playing 7zip PSX titles?
« Reply #2 on: August 24, 2015, 11:27:24 AM »
Hi.
You can use unzip function in autoit, I  using a script like this one for amiga WHD.

Code: (autoit) [Select]
;==========================================================================
;
; 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

Aasum

  • Newbie
  • *
  • Posts: 1
Playing 7zip PSX titles?
« Reply #1 on: August 16, 2015, 10:58:00 PM »
I am trying to un-7zip my PS1 to a temp folder and have pcsxr load it from there and delete the temp folder when pcsxr is closed Something like the script below. The part am having issues with is the loading of the cue/iso/bin. Don't see a find file type thing in AutoIT. Thanks for any help you can give and sorry if it is a bother.

Code: [Select]
RunWait(@ComSpec & " /c " & "7zip.exe e -y &quot;\%file%ext&quot;" -otemp") ;
RunWait(@ComSpec & " /c " & "pcsxr.exe -nogui -cdfile &quot;temp\%file%ext&quot;") ;
RunWait(@ComSpec & " /c " & "rmdir /S temp") ;

::EDIT::

Hopefully the below helps someone else who wants this support :) sure it can be easily modded to support other disc based systems

Adding to Systems.xml

Code: [Select]
      <Cmd id="2" name="7z-Loader_PCSX-Reloaded" value="&quot;%path\%file%ext&quot;" />
    </Emu>
    <Extensions>.bin,.cue,.img,.iso,.7z</Extensions>


then setting emulator to
pcscrl.bat

Code: [Select]
rmdir /Q /S %temp%\psx
7za.exe e -y %* -o%temp%\psx
set psxcmd=%cd%\pcsxr.exe -nogui -cdfile
FORFILES /m *.cue /p %temp%\psx -c "cmd /c %cd%\pcsxrl2.bat start /D %cd% %psxcmd% @path"

pcsxrl2.bat is
Code: [Select]
%*
« Last Edit: August 19, 2015, 11:12:05 AM by Aasum »