mingaling
03-23-2010, 11:51 PM
[exe info]
path=C:\HyperSpin Install 1.0 Final\Emulators\mame\
rompath=C:\HyperSpin Install 1.0 Final\Emulators\mame\ROMs\
userompath = false
exe=mame.exe
romextension = zip
parameters =
searchsubfolders = false
pcgame = false
winstate = HIDDEN
hyperlaunch=true
[filters]
parents_only = false
themes_only = false
wheels_only = false
[themes]
use_parent_vids = true
use_parent_theme= true
animate_out_default = false
reload_backgrounds = false
[wheel]
alpha=.15
small_alpha = 1
style = normal
speed = high
pin_center_width = 500
horz_wheel_y = 512
vert_wheel_position=right
y_rotation = right
norm_large = 360
norm_small = 230
vert_large = 400
vert_small = 240
pin_large = 500
pin_small = 200
horz_large = 240
horz_small = 150
letter_wheel_x = 800
letter_wheel_y = 384
text_width = 700
text_font = Style2
small_text_width = 260
large_text_width = 400
text_stroke_size=6
text_stroke_color=0x000000
text_color1=0x00BFFD
text_color2=0xFFFFFF
text_color3=0x00BFFD
color_ratio=139
shadow_distance = 0
shadow_angle = 45
shadow_color=0x000000
shadow_alpha = 1
shadow_blur = 0
[pointer]
animated=true
x = 975
y = 384
[video defaults]
path=C:\HyperSpin Install 1.0 Final\Emulators\mame\Movies\
[sounds]
game_sounds = true
wheel_click = true
[navigation]
game_jump=50
use_indexes=false
jump_timer=400
remove_info_wheel=false
remove_info_text=false
use_last_game=true
last_game=ms5pcb
random_game=false
[Special Art A]
default=true
active=true
x=512
y=720
in=0.4
out=0.4
length=3
delay=0
type=normal
start=bottom
[Special Art B]
default=true
active=true
x=512
y=740
in=0.4
out=0.4
length=3
delay=0
type=fade
start=none
[Special Art C]
active=true
x=512
y=384
in=0
out=0
length=3
delay=10
type=fade
start=none
[Game Text]
game_text_active = true
show_year = true
show_manf = true
show_description = true
text_color1 = 0xffffff
text_color2 = 0x0099cc
stroke_color = 0x000000
text_font = Style1
text1_textsize = 26
text1_strokesize = 7
text1_x = 32
text1_y = 610
text2_textsize = 36
text2_strokesize = 8
text2_x = 30
text2_y = 640
and...
#SingleInstance force ;Prevent multiple instances
#InstallKeybdHook
SetTitleMatchMode 2
;------------------------------------------------------------------------------;
; MAIN SETTINGS ;
;------------------------------------------------------------------------------;
;[UNIVERSAL HOTKEYS] ;SEPERATE MULTIPLE KEYS WITH &(ampersand) up to 2 keys.
;exitScriptKey = ;Secret hotkey(s) to exit script if needed
;Not to be confused with exit emulator keys
exitEmulatorKey = Esc ;This key/key combo will close any emulators
;that do not have normal closing methods.
toggleCursorKey = t ;hotkey(s) to show or hide cursor if needed
;when hideCursor below is true
;[MOUSE CURSOR]
hideCursor = false ;Automatically hide cursor during script
;WARNING: Make sure ALL your emu's are running fine
;before setting this to true as a precaution.*
;[WINDOWS]
hideDesktop = true ;Attempts to hide desktop with black screen, might help
;on some emu's for hiding launching windows.
hideTaskbar = false ;Hide the windows taskbar when running emu's.
;WARNING: Make sure ALL your emu's are running fine
; before setting this to true as a precaution.*
daemontools = "C:\Program Files\DAEMON Tools Lite\daemon.exe" ;Hide the windows taskbar when running emu's.
;WARNING: Make sure ALL your emu's are running fine
; before setting this to true as a precaution.*
;------------------------------------------------------------------------------;
; GET PARAMATERS AND SET HOTKEYS ;
;------------------------------------------------------------------------------;
;CHECKING FOR 2 PARAMS, IF NOT THEN EXIT
if 0 < 2
{
MsgBox Usage: HyperLaunch.ahk/exe "System Name" "Rom Name"
ExitApp
}
systemName = %1%
romName = %2%
Hotkey, %exitScriptKey%, ExitScript
if (hideCursor = "true")
{
Hotkey, %toggleCursorKey%, ToggleCursor
SystemCursor("Off")
}
WinClose, cmd.exe
;------------------------------------------------------------------------------;
; GET AND CHECK PATHS ;
;------------------------------------------------------------------------------;
GoSub, CheckINI
IniRead, iniEmuPath, %A_ScriptDir%\Settings\%systemName%.ini, exe info, path
emuPath := GetFullName(iniEmuPath)
IniRead, iniRomPath, %A_ScriptDir%\Settings\%systemName%.ini, exe info, rompath
romPath := GetFullName(iniRomPath)
IniRead, executable, %A_ScriptDir%\Settings\%systemName%.ini, exe info, exe
IniRead, romExtensions, %A_ScriptDir%\Settings\%systemName%.ini, exe info, romextension
romExtension =
GoSub, CheckPaths
;------------------------------------------------------------------------------;
; RUN SYSTEM ;
;------------------------------------------------------------------------------;
;*************************************MAME******** ******************************
else if (systemName = "MAME" && executable = "mame.exe")
{
hideDesktop()
Hotkey, %exitEmulatorKey%, CloseProcess
Runwait, %executable% %romName%, %EmuPath%, Hide UseErrorLevel
Process, waitClose, %executable%
exitapp
}
;------------------------------------------------------------------------------;
; WHEN EMULATOR FINISHES OR IF LAUNCH EXE FAILS ;
;------------------------------------------------------------------------------;
;************PROBABLY DO NOT NEED TO EDIT THIS AREA*************
if (ErrorLevel = "ERROR")
{
MsgBox,48,Error,Failed to run executable check your paths,6
}
Goto ExitScript ; Exits script and returns to frontend
;------------------------------------------------------------------------------;
; KILL COMMANDS ;
;------------------------------------------------------------------------------;
;************PROBABLY DO NOT NEED TO EDIT THIS AREA*************
/*
Most emu's can be closed with CloseProcess when using a 2 key combo, if not set a custom
close.
*/
CloseJuke:
RunWait, %emuPath%%executable% --execute="program.shutdown(30);", Hide UseErrorLevel
return
CloseProcess:
Hotkey, %exitScriptKey%, Off
Process, Close, %Executable%
Process, WaitClose, %Executable%
Gui, Color, 000000
Gui -Caption +ToolWindow +AlwaysOnTop
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%, BlackGui
return
ExitScript:
Process, Exist, HyperSpin.exe
PID := errorLevel
if (PID)
{
WinActivate, ahk_pid %PID%
WinWaitActive, ahk_pid %PID%
Gui, destroy
if (hideCursor)
SystemCursor("On")
if (hideTaskbar)
WinShow ahk_class Shell_TrayWnd
ExitApp
}
OnExit, ExitScript
return
;------------------------------------------------------------------------------;
; REST OF SCRIPT ;
;------------------------------------------------------------------------------;
;************PROBABLY DO NOT NEED TO EDIT THIS AREA*************
SystemCursor(OnOff=1) ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
static AndMask, XorMask, $, h_cursor
,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
, b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13 ; blank cursors
, h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13 ; handles of default cursors
if (OnOff = "Init" or OnOff = "I" or $ = "") ; init when requested or at first call
{
$ = h ; active default cursors
VarSetCapacity( h_cursor,4444, 1 )
VarSetCapacity( AndMask, 32*4, 0xFF )
VarSetCapacity( XorMask, 32*4, 0 )
system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32 645,32646,32648,32649,32650
StringSplit c, system_cursors, `,
Loop %c0%
{
h_cursor := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
h%A_Index% := DllCall( "CopyImage", "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
, "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
}
}
if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
$ = b ; use blank cursors
else
$ = h ; use the saved cursors
Loop %c0%
{
h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
}
}
ToggleCursor:
SystemCursor("Toggle")
return
IniRead(Filename, Section, Key, Default = "") {
FileRead, text, *t %Filename%
text = `n%text%`n
StringTrimLeft, text, text, InStr(text, "`n[" . Section . "]`n")
Loop, 8 {
sp := sp . " "
StringReplace, text, text, %Key%%sp%=, %Key%=
If ErrorLevel
Break
}
start := InStr(text, "`n" . Key . "=")
If !start
Return, Default
start += StrLen(Key) + 2
StringMid, Value, text, start, InStr(text, "`n", false, start) - start
Return, Value
}
;Get Full Path from Relative Path
GetFullName( fn ) {
static buf, i
if !i
i := VarSetCapacity(buf, 512)
DllCall("GetFullPathNameA", "str", fn, "uint", 512, "str", buf, "str*", 0)
return buf
}
hideDesktop(){
;WinHide ahk_class Shell_TrayWnd
;Gui, +toolwindow
;Gui, -Caption
;Gui, Color, black
;Gui, show, +toolwindow Maximize
Gui, Color, 000000
Gui -Caption +ToolWindow
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%, BlackScreen
}
CheckINI:
IfNotExist, %A_ScriptDir%\HyperSpin.exe
{
MsgBox,48,Error, Must be in same directory as HyperSpin.exe,6
Goto ExitScript
}
IfNotExist, %A_ScriptDir%\Settings\%systemName%.ini
{
MsgBox,48,Error,Cannot Find %A_ScriptDir%\Settings\%systemName%.ini,6
Goto ExitScript
}
return
CheckPaths:
romFound =
StringRight, emuPathBackSlash, EmuPath, 1
StringRight, romPathBackSlash, RomPath, 1
If (emuPathBackSlash != "\" || romPathBackSlash != "\")
{
MsgBox,48,Error, Make sure your paths contains a backslash on the end ,6
Goto ExitScript
}
If (executable = "")
{
MsgBox,48,Error, Missing executable in %systemName%.ini ,6
Goto ExitScript
}
If (romPath = "")
{
MsgBox,48,Error, Missing rom path in %systemName%.ini ,6
Goto ExitScript
}
If (emuPath = "")
{
MsgBox,48,Error, Missing emulator path in %systemName%.ini ,6
Goto ExitScript
}
IfNotExist, %EmuPath%%Executable%
{
MsgBox,48,Error,Cannot Find %EmuPath%%Executable%,6
Goto ExitScript
}
if(systemName != "zinc")
{
If (romExtensions = "")
{
MsgBox,48,Error, Missing rom extension in %systemName%.ini ,6
Goto ExitScript
}
Loop, parse, romExtensions, `,
{
inputVar = %A_LoopField%
StringLeft, charToCheck, inputVar, 1
If(charToCheck = ".")
{
MsgBox,48,Error, Make sure your rom extensions do not contain a ".",6
Goto ExitScript
}
IfExist %RomPath%%RomName%.%A_LoopField%
{
romExtension = .%A_LoopField%
romFound = true
break
}else{
IfExist %RomPath%%RomName%\%RomName%.%A_LoopField%
{
RomPath = %RomPath%%RomName%\
MsgBox %RomPath%
romExtension = .%A_LoopField%
romFound = true
break
}else{
romFound = false
}
}
}
}
if (romFound = "false")
{
if(systemName != "daphne"){
MsgBox,48,Error,Cannot find Rom - %RomPath%%RomName% with any provided extension,6
Goto ExitScript
}else{
MsgBox,48,Error,Cannot find Daphne framefile - %RomPath%%RomName% with any provided extension,6
Goto ExitScript
}
}
return
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.