when we change resolution, we lost accuracy (640x480 -> 320*240), so i've found a way to calibrate it before roms start.
here' s my script for it with autohotkey and hyperspin:
using smog driver and AUTOCALIBRATION FEATURE.
Simple principe, before roms start, i change the display to match roms size with white GUI, msbox blok the script, turn off then on your gun (guncon mode switch), calibrate, hit ok when done, then repeat for player 2.. then roms start with correct accuracy
Warning, don't mess with custom resolution, this can damage your monitor !
ONLY FOR CRT or TV monitor with USB GUNS and wingun, or smog drivers
Mame.ahk
Codice: Seleziona tutto
;----------------------------------------------------------------------------
; MAME
; MAME .140
; by BBB "top gun version"
; 1.0
;
; Info:
; This script is exactly the same as regular mame.
;
; Since MAME needs to save hi scores and data on exit, then we can't force
; MAME closed with a hotkey. So make sure you have your own exit key setup
; in MAME first. We will leave the CloseProcess section below blank, but
; it is still required.
;
;----------------------------------------------------------------------------
EncodeInteger( p_value, p_size, p_address, p_offset )
{
loop, %p_size%
DllCall( "RtlFillMemory"
, "uint", p_address+p_offset+A_Index-1
, "uint", 1
, "uchar", ( p_value >> ( 8*( A_Index-1 ) ) ) & 0xFF )
}
IniRead, system, %emupath%settings.ini, %RomName%, system, standard
IniRead, windowname, %emupath%settings.ini, %RomName%, windowname, standard
IniRead, class, %emupath%settings.ini, %RomName%, class, standard
If ( system = "area51" )
{
; ChangeDisplaySettings
; http://www.autohotkey.com/forum/viewtopic.php?t=8355
colorDepth = 32 ; bits (quality)
screenWidth = 320 ; pixels ; just change this
screenHeight = 240 ; pixels; ; just change this
refreshRate = 60 ; Hz (frequency)
; Don't change anything below!
struct_devicemode_size = 156
VarSetCapacity(device_mode, struct_devicemode_size, 0)
EncodeInteger(struct_devicemode_size, 2, &device_mode, 36)
success := DllCall("EnumDisplaySettings", "uint", 0, "uint", -1, "uint", &device_mode)
; DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLAYFREQUENCY
EncodeInteger(0x00040000|0x00080000|0x00100000|0x00400000, 4, &device_mode, 40)
EncodeInteger(colorDepth, 4, &device_mode, 104)
EncodeInteger(screenWidth, 4, &device_mode, 108)
EncodeInteger(screenHeight, 4, &device_mode, 112)
EncodeInteger(refreshRate, 4, &device_mode, 120)
DllCall("ChangeDisplaySettings", "uint", &device_mode, "uint", 0)
}
Else If ( system = "ghlpanic" )
{
; ChangeDisplaySettings
; http://www.autohotkey.com/forum/viewtopic.php?t=8355
colorDepth = 32 ; bits (quality)
screenWidth = 640 ; pixels
screenHeight = 480 ; pixels
refreshRate = 60 ; Hz (frequency)
; Don't change anything below!
struct_devicemode_size = 156
VarSetCapacity(device_mode, struct_devicemode_size, 0)
EncodeInteger(struct_devicemode_size, 2, &device_mode, 36)
success := DllCall("EnumDisplaySettings", "uint", 0, "uint", -1, "uint", &device_mode)
; DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLAYFREQUENCY
EncodeInteger(0x00040000|0x00080000|0x00100000|0x00400000, 4, &device_mode, 40)
EncodeInteger(colorDepth, 4, &device_mode, 104)
EncodeInteger(screenWidth, 4, &device_mode, 108)
EncodeInteger(screenHeight, 4, &device_mode, 112)
EncodeInteger(refreshRate, 4, &device_mode, 120)
DllCall("ChangeDisplaySettings", "uint", &device_mode, "uint", 0)
}
WinHide ahk_class Shell_TrayWnd
guiheight:=A_ScreenHeight/9*4
Gui, +toolwindow
Gui, -Caption
Gui, Color, white
Gui, Font, S40 CWhite Underline, Verdana
Gui, Add, Text, y%guiheight% W%A_ScreenWidth% H%A_ScreenHeight% Center, Please Wait
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%, BlackScreen
MsgBox Calibrate your GUN1! press Ok when finish
MsgBox Calibrate your GUN2! press Ok when finish
;Pause
Process, Close, %executable%
Runwait, %executable% %romName%, %emuPath%, Hide UseErrorLevel
if(ErrorLevel != 0){
if (ErrorLevel = 1){
Error = Failed Validity
}else if(ErrorLevel = 2){
Error = Missing Files
}else if(ErrorLevel = 3){
Error = Fatal Error
}else if(ErrorLevel = 4){
Error = Device Error
}else if(ErrorLevel = 5){
Error = Game Does Not Exist
}else if(ErrorLevel = 6){
Error = Invalid Config
}else if(ErrorLevel = 7 || ErrorLevel = 8 || ErrorLevel = 9){
Error = Identification Error
}else{
Error = Mame Error
}
MsgBox Mame Error - %Error%
}
ExitApp
;Required
CloseProcess:
Run C:\hyperspin\Emulators\SSF\SSF_012_beta_R2\hyperspin.bat, C:\hyperspin\Emulators\SSF\SSF_012_beta_R2
;Doesnt have to do anything but make sure to have the line before and after this line.
return
add settings.ini in emupath
Codice: Seleziona tutto
#System specifies whether the game name
[area51]
system = area51
[ghlpanic]
system = ghlpanic
you can add simply games you want with rom's name and add in mame.ahk
i use a litte bat for restore 640*480 after closing mame, autohotkey script can handle this too