Message
par takki » 11 mars 2014 - 19:42
;*************************************Sega Naomi Demul 0.5.6**************************
Sleep, 1000
if (systemName = "Sega Naomi" executable = "demul.exe")
hideDesktop()
Hotkey, %exitEmulatorKey%, CloseProcess
;Blockinput on
;\\\optional plain black screen\\\
;Gui +AlwaysOnTop -Caption +ToolWindow
;Gui, color, 0
;Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE
;\\\Please Wait Loading Screen change size,color,font,background color,what you want to say\\\
IniRead, Long_RomName, %emupath%settings.ini, %Romname%, Long_RomName
WinHide ahk_class Shell_TrayWnd
guiheight:=A_ScreenHeight/9*4
Gui, +toolwindow -Caption +AlwaysOnTop
Gui, Color, black
Gui, Font, S24 Cred, verdanna
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%,
IniRead, system, %emupath%settings.ini, %RomName%, System,
IniRead, Screen_Timeout, %emupath%settings.ini, %Romname%, Screen_Timeout
IniRead, LoadDecrypted, %emupath%settings.ini, %Romname%, LoadDecrypted
;\\\This section swaps out controls for different game types\\\
demul_controller_code = 16777216
demul_mouse_code = 131072
demul_keyboard_code = 1073741824
demul_lightgun_code = -2147483648
IniRead, controls, %emupath%settings.ini, %RomName%, controls, standard
IniRead, current_device, %emupath%demul.ini, PORTB, device, demul_controller_code
IniRead, current_controls, %emupath%padDemul.ini, CONTROL_TYPE, CONTROL_TYPE, standard
If(controls = "standard" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%STANDARD_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "sfstyle" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%SFSTYLE_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "ggxstyle" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%GGXSTYLE_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "reverse" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%REVERSE_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "driving" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%DRIVING_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "fps" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%FPS_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "samba" (current_device != demul_controller_code or current_controls != controls))
{
filecopy, %emupath%SAMBA_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_controller_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "lightgun" (current_device != demul_mouse_code or current_controls != controls))
{
filecopy, %emupath%STANDARD_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_mouse_code%, %emupath%demul.ini, PORTB, device
}
Else if(controls = "keyboard" (current_device != demul_keyboard_code or current_controls != controls))
{
filecopy, %emupath%STANDARD_padDemul.ini, %emupath%padDemul.ini, 1
IniWrite, %demul_keyboard_code%, %emupath%demul.ini, PORTB, device
}
;\\\add sounds\\\
;sounds go in demul directory change to .mp3 if desired or specify a directory of sounds for "romname"
;soundplay, %A_ScriptDir%\%systemame%.wav
;soundplay, %A_ScriptDir%\%Romname%.wav
;soundplay, %A_ScriptDir%\%anyname%.wav
if (system = "Sega Naomi" LoadDecrypted = "false")
{
Run, %emupath%%executable% -run=%system% -rom=%Romname%
sleep, %Screen_Timeout%
sleep, 2000
Process, Close, hypersplash.exe
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen demul 56
Blockinput off
sleep, 1000
Gui Destroy
winactivate, DEMUL
Process, WaitClose, %executable%
}
else if (system = "Sega Naomi" LoadDecrypted = "true")
{
Run, %emupath%%executable% -run=%system% -rom=%Romname%
send, {Down 2}
send, {ENTER}
send, {shiftdown}{Tab}{Shiftup}
send, {Enter}
sleep, 2000
clipboard=
clipboard=%A_ScriptDir%\%romName%
ClipWait
Sleep,100
Send,^v
Sleep,100
send, {ENTER}
sleep, %Screen_Timeout%
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen demul 56
Blockinput off
sleep, 1000
Gui Destroy
winwaitactive, DEMUL
Process, WaitClose, %executable%
}
Else if (system = "Naomi" LoadDecrypted = "false")
{
Run, %emupath%%executable% -run=%system% -rom=%Romname%
Sleep, %Screen_Timeout%
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen demul 56
Blockinput off
sleep, 1000
Gui Destroy
winactivate, DEMUL
Process, WaitClose, %executable%
}
Else if (system = "Naomi" LoadDecrypted = "true")
{
Run, %emupath%%executable% -run=%system% -rom=%Romname%
clipboard=
clipboard=%A_ScriptDir%\%romName%
ClipWait
Sleep,100
Send,^v
Sleep,100
send, {ENTER}
Sleep, %Screen_Timeout%
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen demul 56
Blockinput off
sleep, 1000
Gui Destroy
winactivate, DEMUL
Process, WaitClose, %executable%
}
Else if (system = "Hikaru" LoadDecrypted = "false")
{
Run, %emupath%%executable% -run=%system% -rom=%Romname%
Sleep, %Screen_Timeout%
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen demul 56
Blockinput off
sleep, 1000
Gui Destroy
winactivate, DEMUL
Process, WaitClose, %executable%
}
Else if (system = "Hikaru" LoadDecrypted = "true")
{
Run, %emupath%%executable% -run=%system% -rom=%Romname%
clipboard=
clipboard=%A_ScriptDir%\%romName%
ClipWait
Sleep,100
Send,^v
Sleep,100
send, {ENTER}
Sleep, %Screen_Timeout%
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen demul 56
sleep, 1000
Blockinput off
Gui Destroy
winactivate, DEMUL
Process, WaitClose, %executable%
}
CloseProcess:
Process, Close, %executable%
Process, Close, hypersplash.exe
sleep, 500
ExitApp
return