Author Topic: Change disc (RETROCUBE)  (Read 11733 times)

Dieterweireldt

  • Newbie
  • *
  • Posts: 2
    • Email
Re: Change disc (RETROCUBE)
« Reply #13 on: March 16, 2015, 09:01:21 AM »
thank you very much..

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1186
    • Email
Re: Change disc (RETROCUBE)
« Reply #12 on: March 15, 2015, 12:32:59 PM »
The command line for psxfin is
Code: [Select]
-f "%path\%file%ext"This system is already planned to be added by default to the next mGalaxy version.
« Last Edit: March 16, 2015, 09:45:10 AM by mgalaxy »

Dieterweireldt

  • Newbie
  • *
  • Posts: 2
    • Email
Re: Change disc (RETROCUBE)
« Reply #11 on: March 15, 2015, 05:30:58 AM »
Hi, sorry if I'm intruding on your post but I have a question concerning Pcxfin.. I really love mGalaxy because of it's simplicity to set everything up but I can't get Pcxfin to run on it (works fine stand-alone).. (Runway only gives me the option to use Epsxe or PCSX-Reloaded) but I would really like to use your AutoIt script for changing discs.. I already changed the systems.xml file to include PCXFIN but I don't know the command lines it uses to launch a game (neither the ones from the other 2 work, the give an error "the specified executable is not a valid application for this OS platform")

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Change disc (RETROCUBE)
« Reply #10 on: January 26, 2015, 11:22:27 AM »
I can't say if it's better, I haven't found comparative for compatibility.

Epsxe have more options, the picture is really better, PCX is an "accurate" emulator, so you will have same resolution than real PSX.

I have the compatibility list for PCX if you want it but for the moment I haven't see differences, I have some games that work better on one, and others better on the other one. On my Retrocube (c) I m using PCX since just 2 week, I used Epsxe before, not enought time to be sure, but I don't see how making swapping disk on epsxe.

N13770.U2

  • Newbie
  • *
  • Posts: 43
  • N13770.U2
    • N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
Re: Change disc (RETROCUBE)
« Reply #9 on: January 26, 2015, 03:24:49 AM »
Yo!!

Aeliss,

This emulator is better than the epsxe?
Runs all the games?

Marcelo Nietto
N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
https://www.youtube.com/user/N13770

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Change disc (RETROCUBE)
« Reply #8 on: January 25, 2015, 09:57:32 AM »
A new version.

It works on all language
I m using the "²" key to chnage CD
Less mGalaxy bug.
It tell the swapping cd. How to use it :
Use an online Text to Speech system to make mp3 file called "CD1.mp3" "CD2.mp3" ect .... put them on a folder called "sound" at same place than the script.

Every time you press the "²" key the script play the mp3 and swap disk.

Code: (autoit) [Select]
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Misc.au3>

Opt("WinTitleMatchMode", 1)

;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0

;Special parsing
$count = StringInStr($command, '"', 0 , 1, 1)
local $filename = StringTrimLeft( $command, $count )
$filename = StringTrimright( $filename, 1 )
;local $ext = StringTrimLeft($filename, StringInStr($filename, ".", 1, -1) - 1)
;local $file = StringLeft($filename, StringInStr($filename, ".", 1, -1) - 1 )
;$file = StringTrimLeft($file, StringInStr($file, "\", 1, -1) )

local $autchange = 1
local $oldCD = 1

;check if there is CD number
local $maxCD = 1
local $curCD = 1
local $type = 0
;look for CDX
local $aArray = StringRegExp ( $filename, "CD(\d)\.cue" , 1 )
if (UBound($aArray) > 0) then
   $type = 1
else
   ;look for (Disk X)
   $aArray = StringRegExp ( $filename, "\(Disk (\d)\)\.cue" , 1 )
   if (UBound($aArray) > 0) then $type = 2
Endif

if (UBound($aArray) > 0) then
   ;ok there is the tag
   
   ;active the function
   HotKeySet("{²}", "CDchange")
   
   ;set current CD number
   $curCD = $aArray[0]
   
   ;look for max cd Number
   for $i = 2 to 10
  If (($type = 1) AND FileExists(StringReplace($filename,'CD' & $curCD,'CD' & $i))) OR (($type = 2) AND FileExists(StringReplace($filename,'Disk ' & $curCD,'Disk ' & $i))) Then
$maxCD = $maxCD + 1
  Else
ExitLoop
  Endif
   next

Else
   ;only 1 CD
endif

local $PID = Run ( '"' & $app & '" ' & $command )

ProcessWaitClose($PID)

Exit 0

;***********************************************************************************
     
;Functions
Func CDchange()
   if ($maxCD = 1) then Return
 
   ;to prevent multiple call
   if ($autchange = 0) then return
   $autchange = 0
   
   $oldCD = $curCD
   $curCD = $curCD + 1
   if ($curCD > $maxCD) then $curCD = 1
   ;set new filename
   if $type = 1 then $filename = StringReplace($filename,'CD' & $oldCD,'CD' & $curCD )
   if $type = 2 then $filename = StringReplace($filename,'Disk ' & $oldCD,'Disk ' & $curCD)
 
   ;say CD name
   if FileExists("sound/CD" & $curCD & ".mp3") then  SoundPlay ( "sound/CD" & $curCD & ".mp3",1 )
   
   ;load the newCD
   Send("!{ENTER}")
   WinWaitActive ( "pSX" , "", 5 )
   sleep(1000);tempo for mGalaxy
   Send("!{f}")
   Send("{ENTER}")
   ;Need to change here
   ;WinwaitActive("Ouvrir","",5)
   WinWaitActive("[CLASS:#32770]", '', 5)
   send($filename & ' ', 1)
   send("{enter}")
   WinwaitActive("pSX")
   Send("!{ENTER}")
   
   $autchange = 1

EndFunc

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Change disc (RETROCUBE)
« Reply #7 on: January 11, 2015, 05:54:26 AM »
A new version.
This one work with name "iso name CDX.cue" and "iso name (Disk X).cue"
the Cd changement is invisible on my RetroCube, the display is slower than the manipulation, just some strange noise.

3 Problems left.
1 - Need to use other key than F1 because this one is used by emulator
2 - this version work only for french, need to chnage "ouvrir" by "open" this is not because of emulator but system language on windows
3 - Need to had a temporisation somewhere, you can have resize problem, sometime it's mGalaxy that have bad size after the return to front end ^^.

Code: (autoit) [Select]
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Misc.au3>

Opt("WinTitleMatchMode", 1)

;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0

;Special parsing
$count = StringInStr($command, '"', 0 , 1, 1)
local $filename = StringTrimLeft( $command, $count )
$filename = StringTrimright( $filename, 1 )
;local $ext = StringTrimLeft($filename, StringInStr($filename, ".", 1, -1) - 1)
;local $file = StringLeft($filename, StringInStr($filename, ".", 1, -1) - 1 )
;$file = StringTrimLeft($file, StringInStr($file, "\", 1, -1) )

local $autchange = 1
local $oldCD = 1

;check if there is CD number
local $maxCD = 1
local $curCD = 1
local $type = 0
;look for CDX
local $aArray = StringRegExp ( $filename, "CD(\d)\.cue" , 1 )
if (UBound($aArray) > 0) then
   $type = 1
else
   ;look for (Disk X)
   $aArray = StringRegExp ( $filename, "\(Disk (\d)\)\.cue" , 1 )
   if (UBound($aArray) > 0) then $type = 2
Endif

if (UBound($aArray) > 0) then
   ;ok there is the tag
   
   ;active the function
   HotKeySet("{F1}", "CDchange")
   
   ;set current CD number
   $curCD = $aArray[0]
   
   ;look for max cd Number
   for $i = 2 to 10
  If (($type = 1) AND FileExists(StringReplace($filename,'CD' & $curCD,'CD' & $i))) OR (($type = 2) AND FileExists(StringReplace($filename,'Disk ' & $curCD,'Disk ' & $i))) Then
$maxCD = $maxCD + 1
  Else
ExitLoop
  Endif
   next

Else
   ;only 1 CD
endif

local $PID = Run ( '"' & $app & '" ' & $command )

ProcessWaitClose($PID)

Exit 0

;***********************************************************************************
     
;Functions
Func CDchange()
   if ($maxCD = 1) then Return
 
   if $autchange = 0 then return
   $autchange = 0
   
   $oldCD = $curCD
   $curCD = $curCD + 1
   if ($curCD > $maxCD) then $curCD = 1
   ;set new filename
   if $type = 1 then $filename = StringReplace($filename,'CD' & $oldCD,'CD' & $curCD )
   if $type = 2 then $filename = StringReplace($filename,'Disk ' & $oldCD,'Disk ' & $curCD)
   
   ;load the newCD
   Send("!{ENTER}")
   WinWaitActive ( "pSX" , "", 5 )
   Send("!{f}")
   Send("{ENTER}")
   ;Need to change here
   WinwaitActive("Ouvrir","",5)
   send($filename & ' ', 1)
   send("{enter}")
   WinwaitActive("pSX")
   Send("!{ENTER}")
   
   $autchange = 1

EndFunc

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Change disc (RETROCUBE)
« Reply #6 on: January 10, 2015, 12:30:53 PM »
I haven't finished yet, but this one working for pCXfin, I just need to press "F1" (with xpadder on a pad) and the script swap disk itself (cd 1 > cd 2 > cd 3 > cd 1 > cd 2 >   ....)
But to test you need to edit it, I m waiting for french title in window, like "ouvrir".

Code: (autoit) [Select]
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Misc.au3>

Opt("WinTitleMatchMode", 1)

;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0

;Special parsing
$count = StringInStr($command, "-f", 0 , 1, 1)
local $filename = StringTrimLeft( $command, $count + 3 )
$filename = StringTrimright( $filename, 1 )
local $ext = StringTrimLeft($filename, StringInStr($filename, ".", 1, -1) - 1)
local $file = StringLeft($filename, StringInStr($filename, ".", 1, -1) - 1 )
$file = StringTrimLeft($file, StringInStr($file, "\", 1, -1) )

;check for CD
local $maxCD = 1
local $curCD = 1
if StringInStr($filename,"CD1") Then
   
   If FileExists(StringReplace($filename,'CD1','CD2')) Then
  $maxCD = 2
   EndIf
   
   If FileExists(StringReplace($filename,'CD1','CD3')) Then
  $maxCD = 3
   EndIf
   
endif

HotKeySet("{F1}", "CDchange")
 
local $PID = Run ( '"' & $app & '" ' & $command )
 
While ProcessExists ( $PID )
   sleep(100)
WEnd
 
Exit 0
     
;Functions
Func CDchange()
   if ($maxCD = 1) then Return
 
   $curCD = $curCD + 1
   if ($curCD > $maxCD) then $curCD = 1
   $filename = StringTrimright($filename,7) & 'CD' & $curCD & '.cue'
   
   ;load the newCD
   Send("!{ENTER}")
   WinWaitActive ( "pSX" , "", 5 )
   Send("!{f}")
   Send("{ENTER}")
   WinwaitActive("Ouvrir","",5)
   Sleep (3000) ; bug here
   send($filename & ' ', 1)
   send("{enter}")
   WinwaitActive("pSX")
   Send("!{ENTER}")

EndFunc


N13770.U2

  • Newbie
  • *
  • Posts: 43
  • N13770.U2
    • N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
Re: Change disc (RETROCUBE)
« Reply #5 on: January 09, 2015, 12:02:20 PM »
Yo!!

Interesting that psxfin ... but, I have no knowledge of autoit / script.
I need to learn autoit.

N13770.U2
Marcelo Nietto
N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
https://www.youtube.com/user/N13770

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Change disc (RETROCUBE)
« Reply #4 on: January 09, 2015, 10:19:43 AM »
Not necessarily.

I don't have enought time to check pcxfin, but if this one support swapping disk, we can make a script, with autoit we can simulate a copy/paste from clipboard and a menu selection, wait for a message in a windows, ect ....

But for the moment I m using only epsxe, so I need to play a game up to a disk changement wanted by the game with pcxfin to check if it 's possible.

Take a look on the tempest script http://www.mgalaxy.com/forum/index.php?topic=434.0 to see an exemple of the possibility.



N13770.U2

  • Newbie
  • *
  • Posts: 43
  • N13770.U2
    • N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
Re: Change disc (RETROCUBE)
« Reply #3 on: January 09, 2015, 05:00:55 AM »
Yo!!

Hello Aeliss!!!

So, the only solution for now, is to go with the keyboard + mouse set whenever you are using multi disc games. Unfortunately.
Marcelo Nietto
N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
https://www.youtube.com/user/N13770

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Change disc (RETROCUBE)
« Reply #2 on: January 08, 2015, 12:22:02 PM »
Nope, I had same problem with psx emulator. Long time ago I have start to search a script for epsxe, but I have give up this project because.
1 - I don't want to use Daemon
2 - With the command line -nogui, we can't acess to the menu to chnage disk
3 - Can't load iso without the command line -nogui

Perhaps I can retry with Pcx (pcxfin) but IDK if this one support the swap disk (never tried this one), if you can confirm that to me ?
I can make a script that do alt + enter then select the first menu "use iso", paste the new rom name, press enter, and alt + enter again (like for tempest emulator). But this command suite need to work in normal mode too.

N13770.U2

  • Newbie
  • *
  • Posts: 43
  • N13770.U2
    • N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
Change disc (RETROCUBE)
« Reply #1 on: January 08, 2015, 09:05:32 AM »
Yo!!

How will I only use joysticks in RETROCUBE as you would to exchange game consoles in the case of CD that has more than one disk, such as:

- SEGA CD
- SEGA SATURN
- 3DO
- PS1

Anyone have any ideas?

N13770.U2

Marcelo Nietto
N13770 TV - Carros, Games, Cinema, Brinquedos, Rock'n'Roll e Diversos
https://www.youtube.com/user/N13770