Main > Lightguns
USB2GUN not working on PC - looking for some help - offscreen reload not working
<< < (2/4) > >>
purbeast:
One other thing to note that something about the offscreen_reload setting isn't working correctly, is that I know it's supposed to move the cursor to (0,MAX) per the documentation, and I have the cursor visible, and when shooting off screen, it doesn't move the cursor anywhere.

https://docs.mamedev.org/commandline/commandline-all.html


--- Quote ----[no]offscreen_reload / -[no]reload

Controls whether or not MAME treats a second button input from a lightgun as a reload signal. In this case, MAME will report the gun's position as (0,MAX) with the trigger held, which is equivalent to an offscreen reload.

This is only needed for games that required you to shoot offscreen to reload, and then only if your gun does not support off screen reloads.

The default is OFF (-nooffscreen_reload).

--- End quote ---

I even tried running it from the command line with the example there "mame lethalen -offscreen_reload" and same result.
BadMouth:

--- Quote from: purbeast on June 26, 2023, 09:40:31 am ---When aiming the gun on screen it fires "joystick button 1" and when firing the gun off screen it fires "joystick button 2" as you can see in the windows calibration.  Supposedly the offscreen_reload option is supposed to make it so that "joystick button 2" moves the cursor to (0, MAX) which is the edge of the screen and inputs "joystick button 1".  But that just isn't happening.

--- End quote ---

I'm not aware of anywhere in MAME where could map button 2 to reload if the game didn't originally have a separate reload button.

So if the guns are not sending a button 1 press while pointed off-screen, MAME has no way of knowing that the trigger was pulled off-screen.
MAME would only see a button 2 press....and only do whatever button 2 is mapped to.

Is there any way to change the behavior of the USB2Gun to have both on-screen and off-screen shots register as button 1?
BadMouth:
from the JollyWest thread:


--- Quote from: sgtsocko on August 07, 2014, 12:44:45 pm --- I had some issues getting off-screen reload to work (in MAME) but since shooting off-screen triggers button 2 in Windows I just used XPadder to map that to a combination of up+ another button (mapped to trigger) on the keyboard and set the digital cursor speed to max. Since there is an area at the top of the screen for reloading, shooting off-screen instantly brings the cursor to the top and activates the trigger.  Works perfectly, problem solved!

--- End quote ---
purbeast:

--- Quote from: BadMouth on June 26, 2023, 02:24:45 pm ---from the JollyWest thread:


--- Quote from: sgtsocko on August 07, 2014, 12:44:45 pm --- I had some issues getting off-screen reload to work (in MAME) but since shooting off-screen triggers button 2 in Windows I just used XPadder to map that to a combination of up+ another button (mapped to trigger) on the keyboard and set the digital cursor speed to max. Since there is an area at the top of the screen for reloading, shooting off-screen instantly brings the cursor to the top and activates the trigger.  Works perfectly, problem solved!

--- End quote ---

--- End quote ---

Yeah I saw that but JollyWest didn't have to do that so I was trying to not do it.  That will be my final option though if I can't figure out what I'm doing wrong.

The whole offscreen_reload option is basically a "hack" for the game that MAME is supposed to register the button 2 press from the "joystick" and turn it into a button 1 press at the (0, MAX) position.  So it knows under the hood that button 2 was pressed then translates it to something the emulator can register as a reload, since shooting the edge of the screen in MAME is how you actually reload games like Area 51, Maximum Force, and Lethal Enforcers.  I've been reading a lot about how it works under the hood the past 2 days and was actually looking at the source code for it as well.

 I can reload with the Happ guns in all of those games if I shoot the edge of the screen, but that's just not fun to actually try and hit the edge lol.
purbeast:

--- Quote from: BadMouth on June 26, 2023, 02:21:00 pm ---
--- Quote from: purbeast on June 26, 2023, 09:40:31 am ---When aiming the gun on screen it fires "joystick button 1" and when firing the gun off screen it fires "joystick button 2" as you can see in the windows calibration.  Supposedly the offscreen_reload option is supposed to make it so that "joystick button 2" moves the cursor to (0, MAX) which is the edge of the screen and inputs "joystick button 1".  But that just isn't happening.

--- End quote ---

I'm not aware of anywhere in MAME where could map button 2 to reload if the game didn't originally have a separate reload button.

So if the guns are not sending a button 1 press while pointed off-screen, MAME has no way of knowing that the trigger was pulled off-screen.
MAME would only see a button 2 press....and only do whatever button 2 is mapped to.

Is there any way to change the behavior of the USB2Gun to have both on-screen and off-screen shots register as button 1?

--- End quote ---

There is no way to do that to my knowledge.  There is only 1 jumper on it and it's to set the resolution, which I have set to CGA since I'm using a standard monitor.

As for the button 1 and 2 press, I explained how it's supposed to work under the hood of MAME based on my research the past 2 days and looking at the code (and comments in code) in my other reply. 
Navigation
Message Index
Next page
Previous page

Go to full version