Author Topic: Model 2 + DemulShooter + ESC working!  (Read 505 times)

monstervfx

  • Newbie
  • *
  • Posts: 1
    • View Profile
Model 2 + DemulShooter + ESC working!
« on: January 04, 2026, 10:23:25 PM »
Hi.

I was struggling with attract mode + DemulShooter + Model2 and the ESC key not closing the emulator (it minimized it)...
so after reading around here I found a working solution for my CRT cab setup.

Maybe it helps you too! 

I used only 2 files. You will have to change the paths for sure.

1=> Model2Launcher.au3 compiled to Model2Launcher.exe (with "AutoIt v3") Very simple, my first time. Right button on the .au3 file, compile to x86. That's it. It created an .exe file from the .au3 text file that runs demulshooter and model 2.

Code: [Select]
#include <Misc.au3>
#NoTrayIcon

; --- CONFIGURACIÓN ---
$emuPath = "E:\Emus\SegaModel2 (Lightguns)"
$emuExe  = "emulator_multicpu.exe"
$dsPath  = "E:\Emus\DemulShooter_v16.4"
$dsExe   = "DemulShooter.exe"

If $CmdLine[0] < 1 Then Exit
$rom = $CmdLine[1]

; --- 1. LANZAR ---
Run('"' & $dsPath & "\" & $dsExe & '" -target=model2 -rom=' & $rom, "", @SW_HIDE)
FileChangeDir($emuPath)
$pidEmu = Run('"' & $emuPath & "\" & $emuExe & '" ' & $rom)

; --- 2. VIGILAR ---
While ProcessExists($pidEmu)
    If _IsPressed("1B") Then
        ProcessClose($emuExe)
        ProcessClose($dsExe)
       
        ; Espera de 300ms para que Windows recupere la resolución del escritorio
        Sleep(300)
       
        ; REDIBUJADO UNIVERSAL (Funciona en cualquier resolución)
        If WinExists("[CLASS:SFML_Window]") Then
            $hWnd = WinGetHandle("[CLASS:SFML_Window]")
            WinActivate($hWnd)
            ; WinMove(ventana, texto, x, y, ancho, alto)
            WinMove($hWnd, "", 0, 0, @DesktopWidth, @DesktopHeight)
        EndIf
       
        Exit
    EndIf
    Sleep(10)
WEnd

ProcessClose($dsExe)
Exit

2=> .cfg file for the Model 2 emulator that will use the lightguns. This cfg launches the exe file with the rom. You will have to change the paths.

Code: [Select]
# Generated by Attract-Mode v2.7.0
#
executable           "E:\Emus\SegaModel2 (Lightguns)\Model2Launcher.exe"
args                 [name]
rompath              R:\Sega\SegaModel2\roms\
romext               .zip
system               Arcade
info_source          listxml

# Importante: Anulo el exit hotkey ya que lo maneja el .exe
#exit_hotkey          Escape


and.. that's it!  it's working and closing.  The ESC is controlled by the .exe file.

Hope this helps!
Hugs,
« Last Edit: January 05, 2026, 05:44:53 AM by monstervfx »