j5350
05-26-2009, 10:44 PM
I haven't tested it, but I imagine it would look something like this:
;**********************************TurboGrafx CD********************************
else if (systemName = "TurboGrafx CD" && executable = "magicengine.exe")
{
RunWait, %DAEMONTOOLS% -mount 0`,"%romPath%%romName%%romExtension%"
hideDesktop()
Hotkey, %exitEmulatorKey%, CloseProcess
Run, %executable% , "%emuPath%", UseErrorLevel
}
Where exactly would this go?
JaronSenna
01-04-2012, 11:10 AM
I hope its ok to resurrect this thread, since I have a bit of a challenge getting this to run too. I have followed the tips mentioned here, but I guess I am either not understanding what to do, or I have messed something up:
Whenever I select a game to play from Hyperspin, the disc is mounted in daemon tools on F: (which I have set to be the cdrom drive in the PCE ini file as well), then a system startup screen is shown with flashing words " Press Run button". As soon as I do that, an image shows looking like a CD player. I am guessing I have to put the cursor on the play button and start or something, but I can't seem to get that done. And if I understand correctly, it should be possible to start the game immediately from Hyperspin, right?
Anybody a guess on what I am missing here?
Boogieman_nl
01-04-2012, 11:50 AM
I mapped the start button of my xbox360 controller to the RUN button in the PCE emulator.
Each time start a new game from HS I need to press the RUN button.
Maybe you could try my HL2.13 launch script which works fine for me.
You can ignore or keep the "SayGameDescription:" routine, which I made to let my loquendo text to speech voice speak out some stuff.
(You need the xpath.ahk script and say.exe in your HS root if you want to play with that. I've put those on the FTP in Upload Here\Boogieman_nl)
The JoyScan routine is used for triggering "back" and "start" at the same time on my xbxox360 controller to end the emulator and return to Hyperspin.
This can be removed if you don't need it.
The only thing that I'm still trying to figure out is why the FadeOutStart() function doesn't work (yet).
This is an integral part of the Hyperlaunch 2.13 script, but doesn't seem to work for this script... hope someone can fix that.
;----------------------------------------------------------------------------
; TurboGrafx CD (aka PC Engine CD)
; Magic Engine 1.1.3
; by djvj, customized by Boogieman_nl (proper DTLite mount,xbox360 hotkey combo and TTS)
; 1.1
;
; Notes:
; Make sure your path_to_daemontools in Settings\settings.ini is correct
; Download and extract nomousy to the folder with this module from http://www.autohotkey.com/forum/viewtopic.php?t=2197 (it makes the cursor transparent, so clicks will still register)
; This is used to prevent the mouse cursor from appearing in the middle of your screen when you run Magic Engine
; xPadder/joy2key don't work, the emu reads raw inputs. If you use gamepads, make sure you set your keys in Config->Gamepad
; Set your desired Video settings below.
; In Daemon Tools Lite, rightclick the tray icon and goto Virtual Devices->Add SCSI Virtual Drive. It may ask to install some more files and reboot.
; After your reboot, you will have a DT Virtual Drive and a SCSI Virtual Drive.
; Set your CDDriveLetter below to the letter of your daemontools drive
; Make sure you have the syscard3.pce rom in your emu dir. You can find the file here: http://www.fantasyanime.com/emuhelp/syscards.zip
;
; You have to have xpath.ahk in you Hyperspin root folder it's needed to read xml data
; Say.exe is needed to use Text-To-Speech
;----------------------------------------------------------------------------
#Include xpath.ahk
Hotkey, Joy8, JoyScan
;----------------------------------------------------------------------------
Windowed = y ; y=Simulated Fullscreen mode, n=Normal Fullscreen mode - Simulated Fullscreen mode is preferred, it still looks fullscreen
WideScreenMode = n ; y=enable, n=disable
DesktopMode = y ; y=enable, n=disable - This is basically what sets fullscreen mode. Set to n to show emu in a small window
FullscreenStretch = y ; y=enable, n=disable - This stretches the game screen while keeping the aspect ratio
HighResMode = y ; y=enable, n=disable
Filter = 1 ; 1=bilinear filtering , 0=disable
TripleBuffer = y ; y=enable, n=disable (DirectX only)
Zoom = 2 ; 4=zoom max , 0=no zoom, use any value between 0 and 4
scanlines = 0 ; 0=none, 40=black, use any value in between 0 and 40
vSync = 1 ; 0=disable, 1=enable, 2=vsync + timer (special vsync for windowed mode)
vDriver = 1 ; 0=DirectX, 1=OpenGL
xRes = 1280
yRes = 1024
bitDepth = 32
CDDriveLetter = J: ; Drive letter of your Daemon Tools Virtual drive used for CD-based systems only. Letter should be followed by a colon :
DisplayRes = n ; Display screen resolution for troubleshooting
UseNoMousy = false ; Use NoMousy tool to hide the mouse. If false, will move mouse off the screen instead
;----------------------------------------------------------------------------
MEINI := CheckFile(emuPath . "pce.ini")
CheckFile(emuPath . "SYSCARD3.PCE")
FadeInStart()
; Now let's update all our keys if they differ in the ini
iniLookup =
( ltrim c
video, windowed, %Windowed%
video, wide, %WideScreenMode%
video, desktop, %DesktopMode%
video, fullscreen, %FullscreenStretch%
video, high_res, %HighResMode%
video, filter, %Filter%
video, triple_buffer, %TripleBuffer%
video, Zoom, %Zoom%
video, scanlines, %scanlines%
video, vsync, %vSync%
video, driver, %vDriver%
video, screen_width, %xRes%
video, screen_height, %yRes%
video, screen_depth, %bitDepth%
cdrom, drive_letter, %CDDriveLetter%
misc, screen_resolution, %DisplayRes%
)
Loop, Parse, iniLookup, `n
{
StringSplit, split, A_LoopField, `,, %A_Space%%A_Tab%
IniRead, tempVar, %MEINI%, %split1%, %split2%
If ( tempVar != split3 )
IniWrite, % split3, %MEINI%, %split1%, %split2%
}
Run, %daemonToolsPath% -mount 0`,"%romPath%\%romName%%romExtension%"
GoSub, SayGameDescription
Run, %executable% syscard3.pce, %emuPath%
WinWait, MagicEngine ahk_class MagicEngineWindowClass
WinWaitActive, MagicEngine ahk_class MagicEngineWindowClass
If ( UseNoMousy = "true" )
Run, %A_Scriptdir%\Modules\%systemName%\nomousy.exe /hide ;hide cursor
Else
MouseMove %A_ScreenWidth%,%A_ScreenHeight%
FadeInExit()
Process, WaitClose, %executable%
If ( UseNoMousy = "true" )
Run, %A_Scriptdir%\Modules\%systemName%\nomousy.exe ;unhide cursor
RunWait, %daemonToolsPath% -unmount 0
FadeOutExit()
WinActivate, Hyperspin
ExitApp
SayGameDescription:
;MsgBox, %romName%
gameName := romName
gameName := RegExReplace(gameName, "&", "&")
gameName := RegExReplace(gameName, "'", "'")
xmlPath := A_ScriptDir . "\Databases\" . systemName . "\" . systemName . ".xml"
;MsgBox, %xmlPath%
xpath_load(objXml, xmlPath)
desc := xpath(objXml, "/menu/game[@name=" . gameName . "]/description[1]/text()")
;Msgbox, %desc%
cleanedDescription := desc . " "
StringReplace, cleanedDescription, cleanedDescription, (, --, All
StringReplace, cleanedDescription, cleanedDescription, ), ++, All
StringReplace, cleanedDescription, cleanedDescription, 100 Star, 100 Percent-Star, All
cleanedDescription := RegExReplace(cleanedDescription, "'", "'")
cleanedDescription := RegExReplace(cleanedDescription, "&", "and")
cleanedDescription := RegExReplace(cleanedDescription, "--(.*)++", "")
cleanedDescription := RegExReplace(cleanedDescription, "(.*), The (.*)", "The $1 $2")
cleanedDescription := RegExReplace(cleanedDescription, "X-", "x-")
cleanedDescription := RegExReplace(cleanedDescription, " II ", " 2 ")
cleanedDescription := RegExReplace(cleanedDescription, " II' ", " 2 Accent ")
cleanedDescription := RegExReplace(cleanedDescription, " III ", " 3 ")
cleanedDescription := RegExReplace(cleanedDescription, " IV ", " 4 ")
cleanedDescription := RegExReplace(cleanedDescription, " V ", " 5 ")
cleanedDescription := RegExReplace(cleanedDescription, " VI ", " 6 ")
cleanedDescription := RegExReplace(cleanedDescription, " VII ", " 7 ")
cleanedDescription := RegExReplace(cleanedDescription, " VIII ", " 8 ")
cleanedDescription := RegExReplace(cleanedDescription, " IX ", " 9 ")
cleanedDescription := RegExReplace(cleanedDescription, " X ", " 10 ")
cleanedDescription := RegExReplace(cleanedDescription, " XI ", " 11 ")
cleanedDescription := RegExReplace(cleanedDescription, " XII ", " 12 ")
cleanedDescription := RegExReplace(cleanedDescription, " XIII ", " 13 ")
cleanedDescription := RegExReplace(cleanedDescription, " XIV ", " 14 ")
cleanedDescription := RegExReplace(cleanedDescription, " XV ", " 15 ")
cleanedDescription := RegExReplace(cleanedDescription, " XVI ", " 16 ")
cleanedDescription := RegExReplace(cleanedDescription, " XVII ", " 17 ")
cleanedDescription := RegExReplace(cleanedDescription, " XVIII ", " 18 ")
cleanedDescription := RegExReplace(cleanedDescription, " XIX ", " 19 ")
cleanedDescription := RegExReplace(cleanedDescription, " XX ", " 20 ")
cleanedDescription := RegExReplace(cleanedDescription, " XXI ", " 21 ")
cleanedDescription := RegExReplace(cleanedDescription, " XXII ", " 22 ")
cleanedsystemName := systemName
cleanedsystemName := RegExReplace(cleanedsystemName, "TurboGrafx", "turbow-graphics")
Run, say.exe "Starting %cleanedsystemName% game`, %cleanedDescription%"
Sleep, 3000
Return
JoyScan:
GetKeyState, State, Joy7
if State = D
{
Goto CloseProcess
}
Return
CloseProcess:
Run, Say.exe "Returning to Hyper-spin"
FadeOutStart()
WinClose, MagicEngine ahk_class MagicEngineWindowClass
Return
Esc::Return ; this prevents the quick flash of Hyperspin when exiting with fade on. You can still exit with Esc.
JaronSenna
01-09-2012, 09:40 AM
Hi Boogieman,
I tried your script, but modified it to remove the references to say and the stuff for the gamepad. Also, the xpath include was removed, because I am not using that so far.
Next, setup the script to point to the correct drive (had to make another scsi drive in DT Lite). Then ran hyperspin, but unfortunately no luck. It checks for the pce.ini file, but throws an error on startup on that very line. I verified the file exists, and even changed it to all capital and all lowercapital a couple times to see if that was it, but so far no luck. I am right to have that .ini file in the same dir as the pce.exe file?