PDA

View Full Version : P2B3 not working (not the Q + S problem)...


mingaling
03-19-2010, 01:32 PM
Hiyas, ok at one point I had set the Q key to exit for player 2 exit (HyperHQ/Keyboard/Player2/exit). After realizing this could be a problem I removed that setting. I have also gone into the AHK and removed "Q & S" from the script line. The Q key works with mame when not run through HS. More to the point the Q key works up until the main wheel comes up. When the HS intro is playing I can hit the Q key to cancel out and go directly to the main wheel. After that I get no functionality from P2B3 at all. When I re-assign Q to another task (ie P1 Up) it works fine so it must be some issue with the P2B3 assignment?! At this point I have turned off LedBlinky so it has to be something in the HS settings that I am overlooking... UGH :)!

Thanks for any help you can give

BTW when running MAME through HS, when I go to Tab ingame and configure controls I also have no function from that button.

SophT
03-19-2010, 04:30 PM
The Q key works with mame when not run through HS. More to the point the Q key works up until the main wheel comes up. When the HS intro is playing I can hit the Q key to cancel out and go directly to the main wheel. After that I get no functionality from P2B3 at all. When I re-assign Q to another task (ie P1 Up) it works fine so it must be some issue with the P2B3 assignment?! At this point I have turned off LedBlinky so it has to be something in the HS settings that I am overlooking... UGH !


it should like within HS- you don't have p2b3 (Q) assigned to any function:

up, down
letter jump
favorites
genre
enter, back

if it's not any of those, the button does nothing. The reason that it skips the intro vid is because any key will skip it.

mingaling
03-20-2010, 03:40 AM
I know the Q button has no default purpose on the wheels. My issue is that once i load up MAME with HS the button looses it's functionality. So what I am saying is... When HS loads I know for a fact that it will allow me to hit the P2B3 key to skip the intro to HS. Somewhere between that point and having a MAME game running the button loses the ability to be used. Every button works except that one. Even when I Tab into the MAME settings and try manually assigning the Q key to P2B3 it will not register a keystroke. So where in the HS settings could there be a conflict or something I might have changed that would stop 1 button from working? I hope I am explaining this effectively ;)!

mingaling
03-21-2010, 02:33 PM
A little update...

So I assigned P2B3 (Q) to exit in HyperHQ. The button works for all menus in HS. Once a game is launched however, the key loses functionality. When I open the MAME console it will not let me add ANY input into P2B3. No key works for assigning that button?! I tested functionality with Daphne and the button works fine. It will allow me to escape from the current game and reenter the sub-wheel...

SophT
03-21-2010, 08:10 PM
sounds like a mame problem. are you on a keyboard encoder or a gamepad?

mingaling
03-21-2010, 11:47 PM
When I launch Mame outside of HS it works fine. So strange lol... Is there anywhere in the HS settings that could stop a button functioning? Eh I will look into the Mame settings AGAIN :). Hmmmmm

SophT
03-22-2010, 02:25 AM
only IF you're using hyperlaunch.

please post your mame.ini from /settings/

and your hyperlaunch.ahk using the [code ] brackets

Fantoboy
03-22-2010, 11:05 AM
I'm having the same issue. Not using hyperlaunch. Q does not work.

edit: figured out my issue. I was using a jvs-pac. You can switch to MVS layout using a shift + button combination. I must've switched without realizing. Although it's strange that it worked outside of hyperspin when it should have had the same issue. Whatever, resolved for me.

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

SophT
03-24-2010, 03:06 AM
ok, so you are using HyperLaunch.

What you can do is either in settings.ini make this change:


[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=false


OR in hyperlaunch.ahk make the following change:


;[UNIVERSAL HOTKEYS] ;SEPERATE MULTIPLE KEYS WITH &(ampersand) up to 2 keys.
;exitScriptKey = ~Q & ~S ;Secret hotkey(s) to exit script if needed
;Not to be confused with exit emulator keys


the difference from the original is the extra ~ in front of the keys that allows them to retain their original functionality: e.g. it won't kill them.

instead of deleting that line: I suggest if you really don't want it to map it to some keys that aren't on your CP.

mingaling
03-24-2010, 05:15 AM
I had already removed the Q & S line. However, launch=false completely escaped my attention ;). You are the man. Really appreciate your help. I never would have noticed it. Any chance you could explain exactly what was happening? Anyway, thanks for everything!!

SophT
03-24-2010, 06:25 AM
ok sure:

there are two methods of launching from hyperspin:

Normal and HyperLaunch

Normal means that HyperSpin just sends the commandline

"Drive:\path\to\executable.exe" "Drive:\path\to\rom.extension"

A lot of emulators work this way (like MAME)

However, some emulators require a different set of instructions. This is where hyperlaunch comes in. HyperSpin will send a commandline that looks like this:

"Hyperlaunch.exe" "system name" "rom name.extension"

those two variables are then sent into hyperlauch- where we've coded the launch scripts for various emulators- you'll notice that a lot of the scripts vary wildly. This is how you're able to just set the paths in HyperHQ and forget it.

-----

The issue that you ran into with HyperLaunch and the "Q & S" setting is that, as you experienced- some times things to work quite right with HyperLaunch. The main releases are tested and stable- but since we give the source code- any user added stuff could break it, like I gave you.

The Q & S hotkey (or whatever you define it as) is an 'emergency' hotkey for when HL hangs- hit those and it will kill hyperlaunch.exe and return you to HS.

Now, AHK specifies that when you set a hotkey like Q & S - it will "eat" them, meaning that if you press Q it won't register the press because it's waiting for S to be pressed too, to do a hotkey routine.

However, adding a ~means that it will not eat key- and keypresses will register.

Here's a basic breakdown:

hotkey, dosomething = Q & S
-----
Q = nothing happens
S = Nothing happens
Q & S = executes dosomething label


hotkey, dosomething, ~Q & ~S
Q = Q
S = S
Q & S = Q, S, executes dosomething label

mingaling
03-24-2010, 07:08 AM
Now that you have explained it I can remap the kill function to a different button set (ie maintenance buttons) so it will not interfere with gameplay!! You da man!!