ou WinActivate, HyperSpin
j'ai le script taito qui pourai nous aider mais je sais pas ou le mettre
;--------------------------------------------------------------------------------------------------------------------
; Taito Type X
; PCLauncher.exe
; by djvj
; 1.3
;
; About the script:
; - Vertical games are windowed, rotated, windows hidden (taskbar/start button/desktop), then the correct resolution is calculated and the game's window is maximized. This gives the look of a fullscreen game, but it's actually in a window.
; - Arcana Heart 3 changes your windows res and does not restore it after you exit the game, my script records your res, then restores it after the game closes.
; - Raiden 4 requires a trick to get it to work correctly, otherwise it crashes everytime. I hope someone finds a better hack one day as the one I use I feel like it might not work everytime. There have been reports it doesn't work on every PC...
;
; Taito Type X Instructions:
; 1. Backup your game.exe and typex_bindings.bin for each game (only if you want to have a backup)
; 2. In HyperHQ, use the Wizard to create a new wheel, name it Taito Type X
; 3. Download everything you see on the FTP, keeping dir names/structure and empty "sv" dirs.
;
; Notes:
; - IMPORTANT *** Requires files located in my user dir on the ftp at /Upload Here/djvj/Taito Type X/. I hacked every exe to save its config/logs into the sv subdir. If you use my exes, make sure you create an sv dir so the game can save its settings. ***
; - IMPORTANT *** Edit the dxwnd.ini file and update the dirs to where your games are located, or update the paths in dxwnd itself. ***
; - PCLauncher.exe is just a dummy exe, it can be 0-byte if you don't have one.
; - Make sure the game's folder and bat files in each game's dir are named the same as the database's game name
; - Every game, except Arcana Hearts, saves config and logs to a D or Z partition. Arcana saves everything in the registry . I hacked every game.exe so you do not need D or Z drives. Instead you just create an sv dir inside each game's root folder and it will save all configs/logs in there instead.
; - The controls bin only needs to be made once, then copy/paste your control bin into each game's dir, overwriting the existing one.
; - Arcana Hearts I had to hex edit the controls into the exe. I provided a txt with info where (in hex) and what the controls are (CHANGE KEYS.txt).
; - Raiden 4 is very buggy, but I finally got it working 100% everytime on my PC. If it starts crashing when it worked prior, reboot your PC.
; - Taisen has no way to change the keys afaik, you are out of luck on this one until a solution surfaces.
; - All the games should exit with the ESC key except for Arcana Hearts which the script will send Alt+F4
; - Some systems iRotate might not work, try commenting the iRotate.exe lines and uncomment the display.exe lines instead
;
; - Homura and Shikigami no Shiro III use custom d3d8 and d3d9 dll files, these fix the the games from going hyperfast. I did not make them and they create a wahwahwah.arc file when you launch the game. Edit this file in notepad and change InitProxyFunctions to 0 and PartOfENBSeries to localhost. Save the file, then change it to read-only so it doesn't get restored.
; - If SF4 is locking up during the intro movie, copy the 2 d3d dlls to your SF4 dir. This will fix it.
;
; - If your KOF98 UM came with d3d9.dll, d3d9d.dll, or d3dx9_36.dll in its root folder, remove all these for the game to work.
;
; - Lastly, every PC is different, so results will vary. Try playing with sleep timers if you think the script is working too fast for your PC.
; - Also if you have video issues or odd things are happening in game, play with vsync and try updating to the latest video card driver, or revert to an older one.
;
; - If you have any further issues, please consult the discussion thread at
http://www.hyperspin-fe.com/forum/showt ... hp?t=13627
;--------------------------------------------------------------------------------------------------------------------
; check for and load into memory the Settings.ini
settingsFile := CheckFile(A_Scriptdir . "\Modules\" . systemName . "\Settings.ini")
IniRead, system, %settingsFile%, %RomName%, system, standard
IniRead, windowname, %settingsFile%, %RomName%, windowname, standard
IniRead, class, %settingsFile%, %RomName%, class, standard
IniRead, verticalMethod, %settingsFile%, settings, VerticalMethod
If ( system = "standard" ) {
; If ( romName = "Samurai Shodown - Edge of Destiny" ){
; WAS TESTING SOMETHING HERE FOR THIS GAME, DON'T REMEMBER WHAT
; }
Run, "%rompath%%romname%%romextension%", %rompath%, Hide
Process, WaitClose, %executable%
} Else If ( system = "arcana" ) {
;Store original resolution so we know what to restore to
VarSetCapacity(DM,156,0), NumPut(156,DM,36, "UShort")
DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,DM )
ColDep := NumGet(DM,104)
ScreenWidth := NumGet(DM,108)
ScreenHeight := NumGet(DM,112)
hideDesktop()
Hotkey, %exitEmulatorKey%, CloseArcana ;need to use alt+F4 to close game, otherwise it doesn't close correctly with ESC
Run, "%rompath%%romname%.exe", %rompath%, Hide UseErrorLevel ;run remap keys script. Place this in the Arcana Hearts 3 folder and compile it so it's called "Arcana Hearts 3.exe"
RunWait, "%rompath%%romname%%romextension%", %rompath%, Hide UseErrorLevel
Process, WaitClose, AH30-PC4-2pfixed-fullscreen.exe
Process, Close, %romname%.exe ;close remap keys script
;restore original resolution
ChangeDisplaySettings( (ClrDep:=%ColDep%) , (Wid:=%ScreenWidth%) , (Hei:=%ScreenHeight%) )
;
http://www.autohotkey.com/forum/topic8355.html
ChangeDisplaySettings( cD, sW, sH ) {
VarSetCapacity(dM,156,0), NumPut(156,2,dM,36)
DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,dM ), NumPut(0x5c0000,dM,40)
NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112)
Return DllCall( "ChangeDisplaySettings", UInt,dM, UInt,0 )
}
} Else If ( system = "vertical" ) {
; Get HS's original size so we can restore it properly later
;WinGetPos, hsX, hsY, hsW, hsH, ahk_class ThunderRT6FormDC ; HS1
;WinGetPos, hsX, hsY, hsW, hsH, ahk_class ApolloRuntimeContentWindow ; HS2, shouldn't be needed for HS2 though as it fixes itself
WinMinimize, ahk_class ApolloRuntimeContentWindow ; fix for HS2 not minimizing
Sleep, 100
WinMinimizeAll ;If we don't minimize, parts of HS still show on our screen, doesn't work with HS2 for an unknown reason
Run, dxwnd.exe, %A_ScriptDir%\Modules\%systemName%, Min ;launch app to force windowed mode
If ( verticalMethod = "irotate" )
Run, iRotate.exe /rotate=90 /exit, %A_ScriptDir%\Modules\%systemName% ; another option to rotate screen
Else If ( verticalMethod = "display" )
Run, display.exe /rotate:90, %A_ScriptDir%\Modules\%systemName% ; Switching to 90°
;Sleep, 200
;Making our own custom hideDesktop(), because upon rotation, coordinates get messed up and only part of the desktop is hidden
Gui, Color, 000000
Gui, -Caption +ToolWindow
Gui, Show, x0 y0 W%A_ScreenHeight% H%A_ScreenWidth%, BlackScreen
;Hide Taskbar and Start Button
WinHide, ahk_class Shell_TrayWnd
WinHide, Start ahk_class Button
Sleep, 200 ;DO NOT REMOVE THIS LINE, game will launch minimized if you do, increase sleep if this is still happening
RunWait, "%rompath%%romname%%romextension%", %rompath%
WinWait, %windowname%
Sleep, 500 ;Some lag so we don't lose our custom hideDesktop which happens if this is too short
WinActivate, %windowname%
WinSet, Style, -0xC00000, ahk_class %class% ;Removes the titlebar of the game window
WinSet, Style, -0x40000, ahk_class %class% ;Removes the border of the game window
WinGetPos, appX, appY, appWidth, appHeight, ahk_class %class%
widthMaxPercenty := ( A_ScreenWidth / appWidth )
heightMaxPercenty := ( A_ScreenHeight / appHeight )
If ( widthMaxPercenty heightMaxPercenty )
percentToEnlarge := widthMaxPercenty
Else
percentToEnlarge := heightMaxPercenty
appWidthNew := appWidth * percentToEnlarge
appHeightNew := appHeight * percentToEnlarge
;Transform, appX, Round, %appX%
Transform, appY, Round, %appY%
Transform, appWidthNew, Round, %appWidthNew%, 2
Transform, appHeightNew, Round, %appHeightNew%, 2
;This step is only necessary because this game resizes itself too wide, we need to bring it back to a normal vertical game ratio
If ( romName = "GigaWing Generations" )
appHeightNew := ( A_ScreenWidth * 0.789316 ) ;Vertical games have a 0.789316 ratio (width/height) when first launched, so whatever the new A_ScreenWidth (when rotated) is, we should multiply by this ratio to find out the new appHeightNew
;appXPos := ( A_ScreenWidth / 2 ) - ( appWidthNew / 2 )
appYPos := ( A_ScreenHeight / 2 ) - ( appHeightNew / 2 )
WinMove, ahk_class %class%,, 0, appYPos, appWidthNew, appHeightNew
; ToolTip, X = %appX%`nY = %appYPos%`nappWidthNew = %appWidthNew%`nappHeightNew = %appHeightNew%`nA_ScreenHeight = %A_ScreenHeight%`A_ScreenWidth = %A_ScreenWidth%, 50, 0, 1
; FileAppend, romname = %romname% -- %widthMaxPercenty% := ( %A_ScreenWidth% / %appWidth% ) %heightMaxPercenty% := ( %A_ScreenHeight% / %appHeight% ) percentToEnlarge = %percentToEnlarge% appWidthNew = %appWidthNew% appHeightNew = %appHeightNew% X = %appX% Y = %appYPos%`n,%emuPath%TTX_AHK_LOG.txt
Process, WaitClose, game.exe
WinClose, DXWnd
If ( verticalMethod = "irotate" )
Run, iRotate.exe /rotate=0 /exit, %A_ScriptDir%\Modules\%systemName% ; another option to rotate screen
Else If ( verticalMethod = "display" )
Run, display.exe /rotate:0, %A_ScriptDir%\Modules\%systemName% ; Switching back to 0°
WinMinimizeAllUndo
Sleep, 500
; Settings for restoring Hyperspin from vertical games
;IniRead, system, %settingsFile%, Screen, Fullscreen, standard ; unsure I needed this, shouldn't be needed
;WinMove, ahk_class ThunderRT6FormDC,, hsX, hsY, hsW, hsH ; HS1
;WinMove, ahk_class ApolloRuntimeContentWindow,, hsX, hsY, hsW, hsH ; HS2, shouldn't be needed for HS2 though as it fixes itself
; Sleep, 500 ;Uncomment these 2 lines if HS doesn't regain focus after closing a vertical game, sloppy but it works until something else is thought of
; Send, {ALTDOWN}{TAB}{ALTUP}
Sleep, 500 ;If you remove this, HyperSpin won't be in focus with the next line
WinActivate, HyperSpin
;Restore Taskbar and Start Button
WinShow, ahk_class Shell_TrayWnd
WinShow, Start ahk_class Button
}
ExitApp
CloseProcess:
; This is staying blank so ESC is sent by default. Might be possible to add fading on exit, have not tested.
return
CloseArcana:
Send, {ALTDOWN}{F4}{ALTUP}
Process, WaitClose, %Executable%
Gui, Color, 000000
Gui -Caption +ToolWindow +AlwaysOnTop
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%, BlackGui
WinActivate, HyperSpin
return