sarah-walker-pcem / pcem

PCem
http://pcem-emulator.co.uk
GNU General Public License v2.0
1.47k stars 204 forks source link

Cannot exit the emulation normally on macOS #185

Closed TomoshibiAkira closed 1 year ago

TomoshibiAkira commented 1 year ago

Describe the bug The emulation window will hang upon closing instead of exiting back to the config selector normally.

To Reproduce Steps to reproduce the behavior:

  1. Create any config and run the emulation.
  2. Close the emulation window.
  3. The window will hang for a few seconds and then exit back to the config selection UI.

Expected behavior The emulation window should close normally.

Host machine

Additional context I did some initial digging and found out the problem is related to renderer_stop() (L691) in wx-sdl2-display.c. Since on macOS, PCem won't use threads for rendering, it should never use renderCond to wait for the thread to quit. The line in question has a ! before the preprocessor PCEM_RENDER_TIMER_LOOP. Might be a typo. Fixing this ifdef block can fix this bug.

There are some other issues w.r.t. the cmake files while compiling for an Apple Silicon machine, I'll open a pull request for these.

barttenbrinke commented 1 year ago

@TomoshibiAkira what architecture are you compiling? I get a

  "_codegen_backend_epilogue", referenced from:
  ...
  ld: symbol(s) not found for architecture arm64

when I try to repeat your build.