1

Closed

ZXMak2.exe will stay in memory

description

The task ZXMak2.exe won't be killed on exit. Multiple copies will stay active in memory.
Windows 10 x64 14393.576
Closed Mar 5 at 3:53 PM by atsidaev

comments

hexaae wrote Jan 5 at 12:35 AM

Sometimes on startup I can also read the error:
System.ArgumentException - Value does not fall within the expected range

this was the content of VMZ file:
<VirtualMachine>
  <Info />
  <Bus name="PENTAGON 128K" modelId="Pentagon128">
    <Device type="ZXMAK2.Hardware.Pentagon.UlaPentagon, ZXMAK2.Hardware" />
    <Device type="ZXMAK2.Hardware.General.BetaDiskInterface, ZXMAK2.Hardware" noDelay="False" logIo="False" />
    <Device type="ZXMAK2.Hardware.General.AY8910, ZXMAK2.Hardware" volume="100" frequency="1750000" ampType="Ay8910" panType="Abc" maskAddrReg="57346" maskDataReg="57346" portAddrReg="65533" portDataReg="49149" />
    <Device type="ZXMAK2.Hardware.General.BeeperDevice, ZXMAK2.Hardware" volume="40" noDos="True" mask="1" port="254" bitEar="4" bitMic="-1" />
    <Device type="ZXMAK2.Hardware.General.TapeDevice, ZXMAK2.Hardware" volume="5" useTraps="True" useAutoPlay="True" noDos="True" mask="1" port="254" bit="6" />
    <Device type="ZXMAK2.Hardware.General.KeyboardDevice, ZXMAK2.Hardware" />
    <Device type="ZXMAK2.Hardware.General.KempstonJoystick, ZXMAK2.Hardware" hostId="c5d25bd0-c9c7-11e4-8001-444553540000" />
    <Device type="ZXMAK2.Hardware.Spectrum.MemorySpectrum128, ZXMAK2.Hardware" romSet="ZX128" />
  </Bus>
</VirtualMachine>
I've opened the VMZ with a text-editor and removed the Kempston joystick string: no more System.ArgumentException errors and ZXMAK2.exe quits correctly on exit. Seems a (random?) problem with joystick configured as Kempston.
I use a "Competition Pro USB arcade joystick SpeedLink SL-6603-SPORTS-EU"
HID\VID_040B&PID_6533\6&3A58FE52&6&0000 and often put system in standby/hibernation. Never had problems with this peripheral and Windows, no drivers required.

hexaae wrote Jan 5 at 12:48 AM

Quick news: even with Joystick string (and Kempston emu working with my joystick), if I FIRST PAUSE the emulation and THEN QUIT, then ZXMAK2.exe task gets killed correctly on exit. No differences found in VMZ files before and after...

hexaae wrote Jan 7 at 9:20 AM

After many other tests I can confirm the JOYSTICK plugin has some issues and can also cause startup errors (sometimes window won't open and you can just hear a repeating sound... or you see strange exception errors reported in the emulator window). Seems also to corrupt VMZ.
Removing JOYSTICK hw completely solves all issues on boot or when quitting.

hexaae wrote Jan 18 at 10:49 AM

Is this project dead?
Was one of the best ZX Spectrum emulators available on modern Windows systems... :(

wrote Mar 5 at 3:53 PM

Resolved with changeset 40437: Fix for DirectInput hanging on joystick dispose.

Issue was with disposal chain that starts with MainForm.Closing. If Joystick is disposed before this event, app exits correctly. But if it disposes later, this thread hangs and app stays in memory. Unbinding joystick from the main window had fixed the issue.

hexaae wrote Mar 5 at 4:28 PM

Great!
Hope to see a new binary to download soon :)