argonlefou / DemulShooter

Enable dual lightgun play in arcade games and emulator
116 stars 16 forks source link

MAME Hooker 'Dll Error 6' Issue when exiting after DemulShooter #158

Closed chef-wally closed 11 months ago

chef-wally commented 1 year ago

Edit: The below issue isn't present with the public available MAME Hooker. However, this version of MAME Hooker does not work with the Ultimarc Ultimate I/O, I can provide you the two files to see if you can make support for it?

Issue: When exiting MAME Hooker after DemulShooter MAME Hooker gives the error "Dll Error 6" Also, when exiting MAME Hooker after DemulShooter and TeknoParrot have closed MAME Hooker gives the this error "Dll Error 6". Might this be because MAME Hooker isn't registering the close of DemulShooter properly? Issue does not occur when using the MAME emulator.

Does not occur if I disable DemulShooter Outputs.

Game Tested: Elevator Action Death Parade (might be all DemulShooter games with output enabled) Software: TeknoParrot, DemulShooter, MAME Hooker (requires a modified mamehook.exe and PacDrive32.dll to work with the Ultimate I/O board) LED Hardware: Ultimarc Ultimate I/O

Steps to reproduce the issue:

  1. Open MAME Hooker
  2. Open DemulShooter
  3. Open the game from TeknoParrot
  4. Exit MAME Hooker

image

https://github.com/argonlefou/DemulShooter/assets/22541984/8a86d56a-55e8-4078-bb6e-1e738a55bf1c

https://github.com/argonlefou/DemulShooter/assets/22541984/b5b46126-edf8-4843-a93d-e5e5bf708e8f

Steps to not reproduce the issue:

  1. Open MAME Hooker
  2. Open DemulShooter
  3. Open the game from TeknoParrot
  4. Maximise MAME Hooker go to SysTray -> Test -> Exit
  5. Exit MAME Hooker

Steps to not reproduce the issue using the MAME emulator:

  1. Open MAME Hooker
  2. Open MAME and open a game
  3. Exit the game
  4. Exit MAME
  5. Exit MAME Hooker

Steps to not reproduce the issue using the MAME Hooker and DemulShooter with Outputs Disabled:

  1. Open MAME Hooker
  2. Open DemulShooter
  3. Open the game from TeknoParrot
  4. Exit MAME Hooker

MAME Hooker game setting: [General] MameStart=ulk 1 MameStop=ulk 1 StateChange= OnRotate= OnPause= [KeyStates] RefreshTime= [Output] LmpSide_R= LmpSide_G= LmpSide_B= LmpUpBtn=uls 1 2 %s% LmpDownBtn= LmpCloseBtn= P1_GunMotor= P2_GunMotor= P1_Ammo= P2_Ammo= P1_CtmRecoil= P2_CtmRecoil= P1_Life= P2_Life= P1_Damaged= P2_Damaged=

Thanks

argonlefou commented 1 year ago

Hello, thanks for the detailed ticket.

I never ran i to any error using the public version of MameHooker, which is the only one I got.

So yes, I would need your modified version to test. Knowing that I have no documentation at all about MameHooker and that I only tried to reproduced what I found in Mame source code....based on what was modified with your dll it may be impossible to know what is happening on my side

chef-wally commented 1 year ago

I tried on another Windows 10 PC and got the same messages. image

argonlefou commented 1 year ago

I got your modded MameHooker file

I'll have a look at it

argonlefou commented 1 year ago

Steps to reproduce the issue:

1. Open MAME Hooker

2. Open DemulShooter

3. Open the game from TeknoParrot

4. Exit MAME Hooker

So I followed the exact same procedure with TP + Elevator Action, and MameHooker is closing without any error message. Tried with a few other games too, it's working as good as the "original public" MameHooker version

The only difference I can imagine, is that I don't have any Ultimarc Ultimate I/O device to plug to the computer and so MameHooker is not using that to work during gameplay (which could cause a buggy dll closure maybe ?)

Did you try with an empty MameHooker game ini file ? (at least without any command to hook Ultimarc Ultimate I/O) ?

chef-wally commented 1 year ago

Thanks for testing, it seems the issue is when a command is added to an output that changes state. I wonder if something in the ESC process isn't reaching MAME Hooker, because if I run the Test in MAME Hooker after returning from a game it seems the messaging system is sending another exit command to allow for test commands and then when exiting no issue or if I use the MAME emulator with the steps below I don't get the DLL Error 6.

  1. Connect Ultimarc I/O
  2. Open MAME Hooker with empty eadp.ini (default.ini empty as well), open DemulShooter, open game
  3. Esc game, Exit MAME Hooker
  4. No issue
  5. Add command to eadp.ini MameStart to kill all Ultimarc LEDs
  6. Open MAME Hooker, open DemulShooter, open game
  7. Esc game, Exit MAME Hooker
  8. No issue
  9. Add command to eadp.ini LmpUpBtn= to set state of Ultimarc LEDs
  10. Open MAME Hooker, open DemulShooter, open game
  11. Esc game, Exit MAME Hooker
  12. DLL Error 6
  13. Open MAME Hooker, open DemulShooter, open game
  14. Esc game
  15. Go to MAME Hooker Test
  16. Exit MAME Hooker
  17. No issue

Video: https://mega.nz/file/BpIhXALa#lUOPl73S9TgL6zfopxzTQ222CwjNFHq1z2s6QbZPVvQ

argonlefou commented 1 year ago

The tests I've done in my last reply were with non-empty ini files : but they do only contain serial commands to Gun4IR gun (recoil and rumble).

So this seem to narrow down the issue to the very use of the Ultimarc I/O board commands. I don't know if you have any other device you can control with MameHooker (gun4ir ?) but it would be nice to be able to test if the error message is still coming if you're using MameHooker with non-empty ini file to control something else than your LEDs

chef-wally commented 1 year ago

The tests I've done in my last reply were with non-empty ini files : but they do only contain serial commands to Gun4IR gun (recoil and rumble).

So this seem to narrow down the issue to the very use of the Ultimarc I/O board commands. I don't know if you have any other device you can control with MameHooker (gun4ir ?) but it would be nice to be able to test if the error message is still coming if you're using MameHooker with non-empty ini file to control something else than your LEDs

Just tested GUN4IR by itself and no issue, then tried GUN4IR with Ultimarc I/O and issue.

https://github.com/argonlefou/DemulShooter/assets/22541984/f269ff20-cedc-4ace-a45c-a57814d9d1c8

chef-wally commented 1 year ago

I'll try another game and see what happens, just trying to think what is different to the MAME emulator for it to work.

Debug_2023-08-18_01-14-03.txt MAME_Hooker_log.txt

Edit: tried Aliens - Extermination same thing

argonlefou commented 1 year ago

Just tested GUN4IR by itself and no issue, then tried GUN4IR with Ultimarc I/O and issue.

So this confirming that the issue is caused by the use of ultimark i/o dll coming with this non-official version of MameHooker. No need to check with other games or any other setup....if it is crashing because of some unfinished business between mamehooker and the dll at the time you want to exit, it will happen anyways. We found the "what"

Now....for the "why".... I'm affraid I won't be able to dig more as I do not own that ultimark board and there is no way for me to reproduce that error.

Based on what I understood of Mame source code, I'm doing the same. But there has to be a sneaky thing hidden somewhere in those billions line of code....the question is what and where

argonlefou commented 11 months ago

Fixed in v11.2 release

Cheesmaker commented 10 months ago

It's not a great place for this but could someone share this mamehook.exe and pacdrive32.dll version. I'm on complex stuff with mamehook and I want to try this version wich could have a better support of nanoled by exemple (I do test for boomslangz outputblaster.dll) Thanks