Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Lightgun flasher over groovymame in fullscreen  (Read 7382 times)

0 Members and 1 Guest are viewing this topic.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Lightgun flasher over groovymame in fullscreen
« on: August 22, 2022, 03:20:06 pm »
Hi!
I wanted to do a flasher for crt lightguns using ahk.
A method to do this would be creating a white gui that shows for some ms. This works in windowed or false fullscreen, but not in real fullscreen games.
So I found another way that seems to work in fullscreen games:

Code: [Select]
#Include lib/Gdip_All.ahk ; https://autohotkey.com/board/topic/29449-gdi-standard-library-145-by-tic/
;OnExit, Exit

x := 0, y := 0, w := A_ScreenWidth, h := A_ScreenHeight    ; Dimensions of rectangle
color := 0x55ffffff                      ; Transparency (FF = solid) + RGB (black in this case = 000000)


Gui, Flashing: -Caption +E0x80000 +E0x20 +LastFound +AlwaysOnTop +ToolWindow ; Layered window
Gui, Flashing: Show, NA
hwnd1 := WinExist() ; The created window's handle
Gui, Flashing: Hide

pToken := Gdip_Startup()
hbm    := CreateDIBSection(w, h)  ; The GDI bitmap
hdc    := CreateCompatibleDC()                         ; Device context compatible with screen
obm    := SelectObject(hdc, hbm)                       ; Select bitmap into device context
G      := Gdip_GraphicsFromHDC(hdc)                    ; Get pointer to graphics of bitmap

hBrush := Gdip_BrushCreateSolid(color) ; For the fill
Gdip_FillRectangle(G, hBrush, x, y, w, h)
UpdateLayeredWindow(hwnd1, hdc, 0, 0, w, h)

; Clean up the paint
Gdip_DeleteBrush(hBrush)
SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc), Gdip_DeleteGraphics(G)
Return

~LButton::
Gui, Flashing: Show, NA
Sleep, 60
Gui, Flashing: Hide
return

F12::
ExitApp

And this works for the fullscreen games I tried but groovymame:
In a pc with a Flat screen without crt emudriver, if I launch a game fullscreen with normal mame, the flashing is shown over the game. No mathers if opengl or d3d, it works.
In my arcade pc with crt and groovymame, I launch a game, switchres works and set it to its resolution, but the flashing won't show over the game.

Any idea why? do anyone  know how to achieve it?

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7414
  • Last login:April 10, 2024, 02:02:31 pm
  • Quote me with care
Re: Lightgun flasher over groovymame in fullscreen
« Reply #1 on: August 25, 2022, 02:55:10 pm »
I'm surprised that the flash works at all on baseline MAME. Fullscreen exclusive is just that: exclusive, only the app that owns Direct3D can draw. But anyway, my knowledge could be obsolete on this too.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #2 on: August 25, 2022, 03:24:18 pm »
Yes, i think a LUA plugin seems more compatible, no need for external programs, less latency, ...

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #3 on: August 27, 2022, 12:57:46 pm »
I'm surprised that the flash works at all on baseline MAME. Fullscreen exclusive is just that: exclusive, only the app that owns Direct3D can draw. But anyway, my knowledge could be obsolete on this too.
Yes, me too. My first tought was to use screen brightness, so it should work with any game. But I can't find any function in ahk that let me increase it over the windows maximum, as I need the screen to be near total white for a moment.
Yes, i think a LUA plugin seems more compatible, no need for external programs, less latency, ...
I don't know about this. Should it work only on mame?

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #4 on: September 11, 2022, 12:32:00 pm »

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #5 on: September 12, 2022, 03:02:39 am »
Thnaks Psakhis!
I tired, but I never used plugins in Mame and don't know how to use it.
Placed gunlight folder in plugins folder, activated Gunlight plugin in Plugins menu...
whats next? 

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #6 on: September 12, 2022, 04:54:43 am »
Ah sorry, i explain.

1. Create folder "gunlight" inside plugins directory
2. Edit plugin.ini and add "gunlight 1" for activate it
3. When mame is running, on UI menu -> plugins you can set
4. Input -> This is 1P player button for fire 
    Gun button -> This is your gun button, you need to quit from 1P input settings, this is a overloard config
    Brightness gain -> Level of brightness to add when gun button is pressed
    Brightness frames -> Brightness is applied when gun button is pressed (default=1), but you can add more frames of brightness
« Last Edit: September 12, 2022, 04:57:35 am by psakhis »

Rion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:April 25, 2024, 11:07:28 am
  • 240p, 480i
Re: Lightgun flasher over groovymame in fullscreen
« Reply #7 on: September 12, 2022, 11:59:26 am »
I have been testing and using this for some weeks now. The new update for brightness control really makes a difference.
Looking forward to contrast and gamma controls 👍

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #8 on: September 12, 2022, 12:37:31 pm »
Plugin updated with contrast and gamma adjustment.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #9 on: September 12, 2022, 01:01:42 pm »
Thanks Psakhis, this is very nice. I could test it a little on my crt:
Overall it works perfect. No missing shots.
I was looking your  code but couldn't figure out: do you raise brighness and then the button press instantly? without any delay between them?
Though, I'm experiencing two problems:
1. "Brightness frames" is appied on release, but I think it would be better on press, as games like time crisis, pointblank... doesn't need the flashing while the whole button press, and so it would be far less noticeable.
2. I have not tested this with two guns (absolute mice, rawinput), but I tested a little more in my normal pc with a mouse, and when mapped two flashers, they seens to conflict as one of them does nothing and the other sets the new brightness but won't return to normal level.
2b. What would happen if a flasher button is press while another is flashing? I couldn't test this because of the problem described above, but I think It should not add brightness level, but reinitialize the timer.


Rion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:April 25, 2024, 11:07:28 am
  • 240p, 480i
Re: Lightgun flasher over groovymame in fullscreen
« Reply #10 on: September 12, 2022, 01:52:51 pm »
Thanks Psakhis, this is very nice. I could test it a little on my crt:
Overall it works perfect. No missing shots.
I was looking your  code but couldn't figure out: do you raise brighness and then the button press instantly? without any delay between them?
Though, I'm experiencing two problems:
1. "Brightness frames" is appied on release, but I think it would be better on press, as games like time crisis, pointblank... doesn't need the flashing while the whole button press, and so it would be far less noticeable.
2. I have not tested this with two guns (absolute mice, rawinput), but I tested a little more in my normal pc with a mouse, and when mapped two flashers, they seens to conflict as one of them does nothing and the other sets the new brightness but won't return to normal level.
2b. What would happen if a flasher button is press while another is flashing? I couldn't test this because of the problem described above, but I think It should not add brightness level, but reinitialize the timer.

All of these are very good points. 👍
There is always room for improvements.
Thanks Psakhis for the update to gamma and contrast 👍

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #11 on: September 12, 2022, 04:24:16 pm »
1. "Brightness frames" is appied on release, but I think it would be better on press, as games like time crisis, pointblank... doesn't need the flashing while the whole button press, and so it would be far less noticeable.
2. I have not tested this with two guns (absolute mice, rawinput), but I tested a little more in my normal pc with a mouse, and when mapped two flashers, they seens to conflict as one of them does nothing and the other sets the new brightness but won't return to normal level.
2b. What would happen if a flasher button is press while another is flashing? I couldn't test this because of the problem described above, but I think It should not add brightness level, but reinitialize the timer.

By default gain is applied only on frames where button is pressed; for apply gain on release, you need to set frames > 1.

Interesting behaviour of two guns, i hadn't even considered it, i think about it!

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #12 on: September 13, 2022, 07:20:28 am »
Quote
By default gain is applied only on frames where button is pressed; for apply gain on release, you need to set frames > 1.
Yes, I understand that.
What I mean is this way the flashing is very annoying. Bear in mind there are games where you do rapid fire, or in 2p games, many shots are fired.
I think it would be better that you can set an fixed amound of brighten frames from the press, and before this, return to default brightness, regardless if button is still pressed or released
I have been messing with your code to change this myself but I can't. Any advice to achieve it? so I can test and tell if it works?
Thanks
« Last Edit: September 13, 2022, 07:24:39 am by phasermaniac »

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #13 on: September 13, 2022, 07:40:24 am »
For example, if you set 32 frames, will be more than 25 frames with gain applied after button is pressed regardless if button is released.

The "counter" of this frames is set to 0 when button is pressed, i understand you want a fixed number of frames regardless button is pressed or released?

This is posible and easy to add to plugin.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #14 on: September 13, 2022, 07:48:51 am »
yes thats it.
I tired but I don't understand the whole code.

Rion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:April 25, 2024, 11:07:28 am
  • 240p, 480i
Re: Lightgun flasher over groovymame in fullscreen
« Reply #15 on: September 13, 2022, 08:32:16 am »
For example, if you set 32 frames, will be more than 25 frames with gain applied after button is pressed regardless if button is released.

The "counter" of this frames is set to 0 when button is pressed, i understand you want a fixed number of frames regardless button is pressed or released?

This is posible and easy to add to plugin.

Yeah that's a great idea.
Perfect for games like Operation Wolf, Terminal 2, Alien 3 etcetera.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #16 on: September 13, 2022, 01:03:26 pm »
So, this way I get the short flash effect I talked about:
Code: [Select]

local function process_button(button)
local pressed = input:seq_pressed(button.key)
if pressed then          
if num_frames < button.off_frames then              
        gunlight_frames = 1
        gunlight_brightness_gain = button.brightness_gain
gunlight_contrast_gain = button.contrast_gain
gunlight_gamma_gain = button.gamma_gain
        end
return 1
else
        if num_frames < button.off_frames and (init_user_set.brightness < gunlight_user_set.brightness or
                                               init_user_set.contrast < gunlight_user_set.contrast or
                                               init_user_set.gamma < gunlight_user_set.gamma) then              
        gunlight_frames = 1
        gunlight_brightness_gain = button.brightness_gain
        gunlight_contrast_gain = button.contrast_gain
        gunlight_gamma_gain = button.gamma_gain
        else
        gunlight_frames = 0
        num_frames = 0
        end
button.counter = 0
return 0
end
end
Try it, it would show the flashing the shorter possible. You would have to mess with "frames to apply gain" that would vary depending on the game. (>2 and set the minimum that let fire shots in dark places)

On another hand I tested deeper to set 2 flasher buttons, and no way. I tried in the crt arcade with 2 guns but you can also test with two buttons of mouse, same buggy results, test yourself.

Finally, are you sure contrast and gamma does something? I mean they lighten light and medium colors, but not dark, which is what we need. Maybe an "inverted gamma" would be the less noticeable thing that would work, I mean lighten only dark colors. But anyway, for me brightness_gain works nice

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #17 on: September 13, 2022, 01:47:42 pm »
Now:
When "frames to apply gain" = 1 --> Apply gain when button is pressed on frame, normally are 3 or 4 frames.
Every number X > 1 is applying gain on the next x-1 frames when button is released

Your approach:
When "fixed frames to apply gain" = 1 --> Apply gain only if pushed button in the frame (no difference of actual solution)
Every number X > 1  --> Apply gain on the frame and next X frames. Considerations here:
    - If frame has button pushed -> i understand always is needed apply gain
    - If frame has button released -> which frame counter do you consider? I assume the first one, the last one is the actual solution.

Probably for 2 players is needed 2 buttons configuration on plugin...


phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #18 on: September 13, 2022, 02:40:32 pm »
I don't understand your explanation, what I wanted to do is:
Press button -> apply X frames of gain. No matter when you release the button.

Quote
Probably for 2 players is needed 2 buttons configuration on plugin...
Ok can it be done? Or some clue to make it work?
It seems to be contemplated, you can add two different buttons in menu, it detects gun1 and gun2 buttons independently...
In the ini.lua code these loops seems to handle this, true?
for i, button in ipairs(buttons) do...
for i, state in pairs(button_states) do...
the problem might be there, or am I wrong?

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #19 on: September 13, 2022, 03:55:39 pm »
I don't understand your explanation, what I wanted to do is:
Press button -> apply X frames of gain. No matter when you release the button.
It's just then plugin does. I think the problem is only on multi button setup, this needs rewrite of some parts for be treated in a common way..

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #20 on: September 14, 2022, 02:30:58 pm »
Updated plugin simplifying code, i think multi gun/button is resolved.


phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #21 on: September 14, 2022, 05:02:48 pm »
Yes, tested with lbutton and rbutton of mouse and now seems to work. Very nice!
But I return to the press/release topic, let's see if we can comunicate properly, because I think we were missunderstanding. Maybe my engrish:

Now, for me, it works this way:
When I press the button "gain" applies until I release the button. If I set "frames to apply gain", it seems to apply them once I release the button.
I think this is the best for games that uses a machine gun, with constant fire (beast busters, operation wolf, etc). Those games used actually analog joysticks, not crt guns. Those would benefit with a gain on the whole button press, but there's no need of any extra gain frame on release.

What I think it would be the best for crt guns:
When I press the button gain applies just "frames to apply gain", disable gain even if the button is still pressed. No matter when you release the button.
This I think would be the best for actual crt gun games like Time crisis, Point Blank, Lethal enforcers.... As they plays as a normal gun, only one bullet fires and you don't need to bright the screen the whole button press.
Maybe the user will have to investigate how many gain frames each game needs to work properly.
This way, the flashing is gonna be the shorter possible, and so the less anoying to the eyes. Bear in mind there are games you have to do rapid fire, or in 2p games, lots of shots per minute are fired.

So what would I do?
I think the best would be:
0 "frames to apply gain": apply gain until release (for machine gun games)
X "frames to apply gain": apply gain X frames from the beggining of the press

Thanks

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #22 on: September 15, 2022, 03:10:36 am »
Now, for me, it works this way:
When I press the button "gain" applies until I release the button. If I set "frames to apply gain", it seems to apply them once I release the button.
I think this is the best for games that uses a machine gun, with constant fire (beast busters, operation wolf, etc). Those games used actually analog joysticks, not crt guns. Those would benefit with a gain on the whole button press, but there's no need of any extra gain frame on release.
Exactly that's it, i always test plugin with opwolf.

What I think it would be the best for crt guns:
When I press the button gain applies just "frames to apply gain", disable gain even if the button is still pressed. No matter when you release the button.
This I think would be the best for actual crt gun games like Time crisis, Point Blank, Lethal enforcers.... As they plays as a normal gun, only one bullet fires and you don't need to bright the screen the whole button press.
Maybe the user will have to investigate how many gain frames each game needs to work properly.
This way, the flashing is gonna be the shorter possible, and so the less anoying to the eyes. Bear in mind there are games you have to do rapid fire, or in 2p games, lots of shots per minute are fired.
Ok i finally got it. Isn't necessary refresh gain frames while button is pressed, only when isn't gain applied and is detected a new cycle of pressed button.

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #23 on: September 15, 2022, 01:31:24 pm »
Updated plugin with new method "Fixed frames".

I hope I have succeeded this time.

EDIT: if you exit with gain applied it will affect brightness settings of mame. I need to check if i can avoid this.
« Last Edit: September 15, 2022, 01:43:35 pm by psakhis »

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #24 on: September 15, 2022, 02:08:02 pm »
Yes, that's the concept.
The only drawback I see is that now, if you use "gain method=fixed frames", you press one gunlight button while the other is still pressed it doesn't flash, and it should.
This is working perfect in "gain method=until release"

Thanks.

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #25 on: September 15, 2022, 03:12:31 pm »
You are right! It's code issue!

EDIT: fixed
« Last Edit: September 16, 2022, 09:43:13 am by psakhis »

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #26 on: September 16, 2022, 02:58:49 pm »
thanks!
Yesterday I tested two games:
Time crisis: perfect with 0,3 brightness and 2 fixed frames
Carnevil: Couldn't make it work, erased the 1P input settings for trigger, and even with 1 brightness and 10 fixed frames, shots won't place in dark zones.
My guess is maybe some games needs a custom delay between the begin of the flash and the faked button press, but I'm not sure
I will test moregames this weekend.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #27 on: November 01, 2022, 08:44:03 am »
Hi psakhis.
I can say Time Crisis and lots of games works perfect with this.
I have been testing Carnevil a bit more, and I as I said in the first testing I can't make it work properly. Have you tested it?
Would it be possible to add an option to delay the button press? I mean, on trigger press: Apply gain - wait X frames - send PX Fire
thanks

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #28 on: November 01, 2022, 04:10:22 pm »
Hi @phasermaniac,

I uploaded a new version with this feature, waiting for your feedback.

You can set any number of frames (input lag frames)

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #29 on: November 01, 2022, 06:43:45 pm »
Thanks! So fast
It works. I tested Carnevil and Zombieraid.
The only problem its that when you use this option, 2 shoots are fired. It seems that the brightness has no effect for the first but the second gets correctly positioned on dark areas

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #30 on: November 02, 2022, 03:49:27 am »
Do you disabled the same button on input settings?

Here i tested with operation wolf and only have 1 fire.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #31 on: November 02, 2022, 06:41:53 am »
Yes I did.
Strange, i'll retest layer. Tested it yesterday and noticed it in The two games I tested this option.

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #32 on: November 02, 2022, 07:30:57 am »
A test can be set a lot of frames for see how many fires are sent.

For example, when i set 32 it's more obvious

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #33 on: November 02, 2022, 01:46:49 pm »
Tested in another pc:
You have reason in Operation wolf ther is no problem.
But in Carnevil and Zombieraid I keep having the two shots problem. If I set a lot of frames as you said they seem to be fired at once

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #34 on: November 02, 2022, 03:31:51 pm »
Ok, here too with Zombie Raid.

I'll check it.

EDIT: I think now it's fixed.
« Last Edit: November 02, 2022, 04:20:19 pm by psakhis »

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #35 on: November 03, 2022, 02:05:45 pm »
Yes, working nice on my side. Tested yesterday and its amazing, thanks!
0 missing shots, and the flashing is far less noticealbe than the external option I used before.

But now I notice have lost a feature I had with my old external flasher method: Offscreen shoot send reload button.
Would it be possible to make an option to send reload button if the shot is offscreen (0,0 coords)?
So games that originally used a button to reload (like Carnevil or Zombieraid) could reload aiming offscreen
Now I know this is maybe complicated as involve reading coords in a specific moment.

Mame already have the opposite feature: "offscreen_reload" that overrides reload button with a shoot in 0,0.
Thanks anyway, for this amazing plugin

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #36 on: November 03, 2022, 03:22:33 pm »
I believe Mame works as original machine if you disable offscreen_reload.

If game reloads with shot on (0,0) it's how it works. I'm not an expert of lightgun games...

EDIT: I updated plugin for Alien 3. This game renders on other screen of lua object.
« Last Edit: November 03, 2022, 05:00:48 pm by psakhis »

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #37 on: November 04, 2022, 05:35:50 am »
Im not an expert either, Mame work right with most games that originally reloaded with an offscreen shot, but not all of them (loked ' loaded, Invasion...)
Also there are some games that originally couldn't reload with an offscreen shot, but with a pump mechanism (Carnevil, Zombieraid...). This was cool with the original shotguns with pump action, but playing with standard guns, reloading with a button is not fun, would be better offscreen reload.
That's why I ask to add this feature to your plugin. But I don't know how to do this in lua
I suppose that once the flashing is launched, just before inserting the pXtrigger, you would have to read coords and if they are 0,0, send pXreload instead of pXtrigger

psakhis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 453
  • Last login:Yesterday at 05:22:43 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #38 on: November 04, 2022, 08:33:28 am »
I'll ask to mame developers if i can read lightgun coords with lua classes.

phasermaniac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:January 24, 2024, 05:40:47 am
  • I want to build my own arcade controls!
Re: Lightgun flasher over groovymame in fullscreen
« Reply #39 on: November 04, 2022, 01:49:44 pm »
thanks for trying!