Software Support > GroovyMAME
Lightgun flasher over groovymame in fullscreen
phasermaniac:
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: ---#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
--- End code ---
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:
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.
psakhis:
Yes, i think a LUA plugin seems more compatible, no need for external programs, less latency, ...
phasermaniac:
--- Quote from: Calamity 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.
--- End quote ---
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.
--- Quote from: psakhis on August 25, 2022, 03:24:18 pm ---Yes, i think a LUA plugin seems more compatible, no need for external programs, less latency, ...
--- End quote ---
I don't know about this. Should it work only on mame?
psakhis:
Just try new lua plugin for it.
https://github.com/psakhis/gunlight/tree/main/gunlight
Navigation
[0] Message Index
[#] Next page
Go to full version