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: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?  (Read 2834 times)

0 Members and 1 Guest are viewing this topic.

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1532
  • Last login:August 10, 2022, 08:30:36 am
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else? Baically i need as stated a Jaguar emu that will exit when i hit the ESC key any clues as to where I can snag this ? :blah:
2,370,650 Gun.Smoke

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #1 on: September 25, 2006, 09:48:57 pm »
Try this AutoIt script. I just wrote it so it's untested but it should work okay. Just replace emu.exe with the executable name of the Jaguar emulator, compile the script and place it into your emu's folder and run it instead of your emu's exe.

Code: [Select]
; Basic AutoIt script to close an emulator using ESC

; Run the Emulator
Run(@ScriptDir & "\emu.exe");

; Define Kill Key
HotKeySet ("{ESCAPE}", "close_emu")

; Kill the Emulator
Func close_emu ()
ProcessClose ("emu.exe")
Exit
EndFunc

; Main Loop
While 1
Sleep (500)
If ProcessExists ('emu.exe') = 0 Then Exit
WEnd

Exit

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #2 on: September 26, 2006, 12:05:57 am »
I can tell you from my wrapper coding experience.  It'll work but it's sloppy. 

You want to try to avoid "hard" termination if possible. 

The auto setting in my command line wrapper basically does the following:

Try pressing alt+f4... wait a sec.
If the process still exists post a close message to the window... wait a sec.
If the process still exists close the process. 

Of course this is a generic solution, for specific emus you can use the one that works best.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #3 on: September 26, 2006, 08:25:39 am »
I can tell you from my wrapper coding experience.  It'll work but it's sloppy. 

You want to try to avoid "hard" termination if possible. 

The auto setting in my command line wrapper basically does the following:

Try pressing alt+f4... wait a sec.
If the process still exists post a close message to the window... wait a sec.
If the process still exists close the process. 

Of course this is a generic solution, for specific emus you can use the one that works best.

Thats a good point using SendMessage with WM_CLOSE is much cleaner. AutoIt probably supports it.

biron

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 60
  • Last login:August 20, 2007, 05:09:14 pm
  • Biron
    • my cab
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #4 on: September 26, 2006, 09:44:07 am »
Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else? Baically i need as stated a Jaguar emu that will exit when i hit the ESC key any clues as to where I can snag this ? :blah:

i use project tempest in my cab. doesn't work perfect, but ok.

http://pt.emuunlim.com/
you may try an old version, the new versions doesn't use esc to exit..
Uppsala University.

Havok

  • Keeper of the __Blue_Stars___
  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4530
  • Last login:July 11, 2025, 01:29:48 am
  • Insufficient facts always invite danger.
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #5 on: September 26, 2006, 10:40:35 am »
Try this AutoIt script. I just wrote it so it's untested but it should work okay. Just replace emu.exe with the executable name of the Jaguar emulator, compile the script and place it into your emu's folder and run it instead of your emu's exe.

Code: [Select]
; Basic AutoIt script to close an emulator using ESC

; Run the Emulator
Run(@ScriptDir & "\emu.exe");

; Define Kill Key
HotKeySet ("{ESCAPE}", "close_emu")

; Kill the Emulator
Func close_emu ()
ProcessClose ("emu.exe")
Exit
EndFunc

; Main Loop
While 1
Sleep (500)
If ProcessExists ('emu.exe') = 0 Then Exit
WEnd

Exit

AutoIT - love it, use it all the time. Once I switched over to a company that wouldn't buy Winbatch for me, I switched over...

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #6 on: September 27, 2006, 07:49:19 am »
Ok thanks to our resident AutoIt expert Nologic over at the GameEx forums, he has revised my script to include a safer way of killing the emulator using the methods described by Howard as well as making use of variables to make it more readable. Thanks Nologic! :)

Code: [Select]
; Basic AutoIt script to close an emulator using ESC

$Emu = 'Emu.exe'    ; EMU Executable
$Key = '{ESCAPE}'    ; Kill Key

; Run the Emulator
$pid = Run( @ScriptDir & '\' & $emu )

HotKeySet ( $Key , 'close_emu' )

; Kill the Emulator
Func close_emu ()
    If ProcessExists ( $pid ) = 0 Then Exit
    Send ( '{ALTDOWN}{F4}{ALTUP}' )
    Sleep (500)
    If ProcessExists ( $pid ) = 0 Then Exit
    WinClose ( $title )
    Sleep (500)
    If ProcessExists ( $pid ) = 0 Then Exit
    ProcessClose ( $pid )
    Exit
EndFunc

; Main Loop
While 1
    $title = WinGetTitle('')
    If ProcessExists ( $pid ) = 0 Then Exit
    Sleep (500)
WEnd

; EOF
« Last Edit: September 27, 2006, 08:50:57 am by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #7 on: September 27, 2006, 06:51:31 pm »
Nice....

If I can figure out how to get autoit/ahk to read settings from text files I might start writing my wrappers in script form.  They can be compiled to exes and they don't need any dependancies, meaning they are a lot slimmer than anything you can do in a visual studio language.

Nologic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 54
  • Last login:November 21, 2008, 03:22:57 pm
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #8 on: September 27, 2006, 10:08:33 pm »
Howard AutoIt can read from text files with no problem...tho I tend to use INI files. Any ways here is an old ZiNc wrapper that shows the basic reading from an INI file, and the reading of an INI thats been passed via commandline.

Code: [Select]
#include <process.au3>

; Read ROM Pathing
$roms = IniRead( @ScriptDir & "\settings.ini", "ROMS", "PATH", @ScriptDir & "\ROMS\" )

; Read Game Related Settings
$ini_01 = IniRead( $CmdLine[1] , "GAM" , "Number" , "1" )
$ini_02 = IniRead( $CmdLine[1] , "CFG" , "Config" , "./Zinc.cfg" )
$ini_03 = IniRead( $CmdLine[1] , "CFG" , "Renderer" , "./renderer.cfg" )
$ini_04 = IniRead( $CmdLine[1] , "CFG" , "Controller" , "./controller.cfg" )
$ini_05 = IniRead( $CmdLine[1] , "GFX" , "Rotate" , "0" )
$ini_06 = IniRead( $CmdLine[1] , "GFX" , "Geometry" , "yes" )
$ini_07 = IniRead( $CmdLine[1] , "PLG" , "Controller" , "./controller.znc" )
$ini_08 = IniRead( $CmdLine[1] , "PLG" , "Renderer" , "./renderer.znc" )
$ini_09 = IniRead( $CmdLine[1] , "SND" , "Use" , "yes" )
$ini_10 = IniRead( $CmdLine[1] , "SND" , "Filter-Enable" , "yes" )
$ini_11 = IniRead( $CmdLine[1] , "SND" , "Filter-CutOff" , "44100" )
$ini_12 = IniRead( $CmdLine[1] , "SND" , "Lite-Enable" , "yes" )
$ini_13 = IniRead( $CmdLine[1] , "SND" , "Lite-Multiplier" , "40" )
$ini_14 = IniRead( $CmdLine[1] , "SND" , "Stereo-Exciter" , "yes" )
               

; Kill Emulator
Func end_session ()
ProcessClose( "ZiNc.exe" )
Exit
EndFunc

$game = @ScriptDir & '\ZiNc.exe ' & $ini_01 & _
' --roms-directory=' & $roms & _
' --controller=' & $ini_07 & _
' --renderer=' & $ini_08 & _
' --use-config-file=' & $ini_02 & _
' --use-renderer-cfg-file=' & $ini_03 & _
' --use-controller-cfg-file=' & $ini_04 & _
' --rotate=' & $ini_05 & _
' --use-slow-geometry=' & $ini_06 & _
' --use-sound=' & $ini_09 & _
' --sound-filter-enable=' & $ini_10 & _
' --sound-filter-cutoff=' & $ini_11 & _
' --sound-surround-lite-enable=' & $ini_12 & _
' --sound-surround-lite-multiplier=' & $ini_13 & _
' --sound-stereo-exciter=' & $ini_14

; Define Kill Key
HotKeySet( "{BACKSPACE}" , "end_session" )

; Launch Emulator
_RunDos ( $game )

; Time just keeps on slipping into the future :)
While 1
If ProcessExists ( 'ZiNc.exe' ) = 0 Then Exit
Sleep ( 500 )
WEnd

; EOF
"Pinky, you've left the lens cap of your mind on again." - The Brain

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #9 on: September 28, 2006, 07:57:06 pm »
I use ini files myself, so that works better actually.  Thanks for the snippet. 

Nologic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 54
  • Last login:November 21, 2008, 03:22:57 pm
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #10 on: September 28, 2006, 08:03:59 pm »
Your welcome
"Pinky, you've left the lens cap of your mind on again." - The Brain

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1532
  • Last login:August 10, 2022, 08:30:36 am
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #11 on: September 28, 2006, 08:11:00 pm »
at the end of the day im retarded when it comes to creating just about anything and would appreciate it if someone has the actual hacked emu they can just upload and last time i used one of the jag's it had no sound.
2,370,650 Gun.Smoke

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #12 on: September 28, 2006, 08:24:08 pm »
Is it possible for AutoIt scripts to read parameters passed to the exe? If it can use variables like %1% and %2% can in batch files then someone could compile the script for him so he can use it with any emu.

Ie. SetKillEsc.exe myemu.exe

or even add another variable so you can set the actual key via command line argument

Ie. SetKillKey.exe myemu.exe {ESCAPE}

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #13 on: September 28, 2006, 08:26:57 pm »
You don't have to create anything... headkaze gave you a script that'll work.  Save it to a file, download autoit and you are good to go.  

I don't think you realize how hard it is to hack an emu, it's far easier to make a wrapper.  Any of the "hacked" emus out there weren't hacked, they either had their source code modified or their cfg file was altered using a hex editor.  

If you don't even know of a working jaguar emulator then why did you even ask?  We can't magically get sound emulation working for you ya know.  

headkaze the easiest solution is to just download my generic command line wrapper,  it does the same thing.  But yes ahk does support command line parameters.  They are stored as numbers, with %0% being the number of commands passed. 

Nologic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 54
  • Last login:November 21, 2008, 03:22:57 pm
Re: Atari Jaguar I need an ESC Cab friendly emu hack Jcrouse or any one else?
« Reply #14 on: September 28, 2006, 08:55:35 pm »
Two command lines options...first the Emu...then the Button...both are required.

Code: [Select]
; Basic AutoIt script to close an emulator using ESC

$Emu = $CmdLine[1]    ; EMU Executable
$Key = $CmdLine[2]    ; Kill Key

; Run the Emulator
$pid = Run( @ScriptDir & '\' & $emu )

HotKeySet ( $Key , 'close_emu' )

; Kill the Emulator
Func close_emu ()
    If ProcessExists ( $pid ) = 0 Then Exit
    Send ( '{ALTDOWN}{F4}{ALTUP}' )
    Sleep (500)
    If ProcessExists ( $pid ) = 0 Then Exit
    WinClose ( $title )
    Sleep (500)
    If ProcessExists ( $pid ) = 0 Then Exit
    ProcessClose ( $pid )
    Exit
EndFunc

; Main Loop
While 1
    $title = WinGetTitle('')
    If ProcessExists ( $pid ) = 0 Then Exit
    Sleep (500)
WEnd

; EOF
"Pinky, you've left the lens cap of your mind on again." - The Brain