Jump to content
(Open Beta) HyperSpin 2 is now available for everyone ×

Losing focus after exiting MAME


epetti

Recommended Posts

Posted

I have a rotating monitor that automatically rotates based on the game selected. This always worked well for me in the past, but recently I updated from Windows XP to Windows 7. Now, about a third of the time when I exit from a vertical game where it has to rotate the monitor, Hyperspin loses focus. I see it, but can't do anything unless I Alt-Tab back into it. I'm running the rotate command as a shell script as part of the script for MAME.

 

My MAME.ahk is:

 

Runwait, %emupath%\Rotation.exe "%romName%"
 
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%
}
 
process, waitclose, %executable%
 
Runwait, %emupath%\Rotation.exe "reset"
 
ExitApp
 
;Required
CloseProcess:
   ;Doesnt have to do anything but make sure to have the line before and after this line.
return
 
 
and my Rotation.ahk is:
 
;[Rotation.exe]
 
;
 
;
 
#SingleInstance force 
 
 
romName = %1%
 
If ((romName = "ace") | (romName = "maze") | (romName = "bang") | (romName = "batman") | (romName = "blasto") | (romName = "bullfgt") | (romName = "cannball") | (romName = "circus") | (romName = "combat") | (romName = "cotton") | (romName = "smash") | (romName = "dday") | (romName = "zero") | (romName = "edf") | (romName = "esb") | (romName = "flyball") | (romName = "gaia") | (romName = "galaxi") | (romName = "gng") | (romName = "grdnstrm") | (romName = "headon") | (romName = "car2") | (romName = "hustle") | (romName = "island") | (romName = "island2") | (romName = "joust") | (romName = "eto") | (romName = "le2") | (romName = "msh") | (romName = "mk") | (romName = "mk2") | (romName = "news") | (romName = "orbit") | (romName = "pass") | (romName = "pgm") | (romName = "phrcraze") | (romName = "popeye") | (romName = "kok") | (romName = "spy") | (romName = "safari") | (romName = "sonic") | (romName = "skyraid") | (romName = "sss") | (romName = "sf") | (romName = "roul") | (romName = "jleague") | (romName = "atetris") | (romName = "tetris") | (romName = "tictac") | (romName = "toki") | (romName = "tm") | (romName = "statriv2") | (romName = "vf") | (romName = "vr") | (romName = "topgun") | (romName = "ws"))
{
goto horizontalrotation
}
 
param := "%romName%"
 
;reads verticalRoms controlled roms list
 
IniRead, verticalRoms, %A_ScriptDir%\Rotation.ini, controls, Set2_vertical
 
;reads state of vertical, horizontal rotation (user added line in "controls.ini")
 
iniread, state, %a_scriptdir%\Rotation.ini, Controls, PrevState 
 
ifnotinstring, verticalRoms, %romname%, gosub, horizontalrotation
 
 
 
verticalrotation:
 
if ( State = "vertical") 
 
{
 
exitapp
 
 
else if ( State = "horizontal") 
 
 
Run, %COMSPEC% /c "smccmd --resume --speed -1000", ,{enter},hide
 
iniwrite, vertical, C:\HyperSpin\Emulators\MAME\Rotation.ini, controls, PrevState 
 
exitapp
 
}
 
 
 
horizontalrotation:
 
if ( State = "horizontal" ) 
 
{
 
exitapp
 
 
else if ( State = "vertical") 
 
 
Run, %COMSPEC% /c "smccmd --resume --speed 1200", ,{enter},hide
 
iniwrite, horizontal, C:\HyperSpin\Emulators\MAME\Rotation.ini, controls, PrevState 
 
exitapp
 
}
 

 

 

I'm still in Hyperspin 1.3 and Hyperlaunch. Don't want to upgrade unless absolutely necessary as everything else is working stably.

 

Any help would be appreciated.

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...