Advertisement
Guest User

Untitled

a guest
May 26th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. diff --git a/src/emu/machine.c b/src/emu/machine.c
  2. index d70161c..1ebb609 100644
  3. --- a/src/emu/machine.c
  4. +++ b/src/emu/machine.c
  5. @@ -387,7 +387,7 @@ int running_machine::run(bool firstrun)
  6.  
  7. #ifdef SDLMAME_EMSCRIPTEN
  8. //break out to our async javascript loop and halt
  9. - js_set_main_loop(this);
  10. + //js_set_main_loop(this);
  11. #endif
  12.  
  13. manager().web()->serve();
  14. diff --git a/src/osd/modules/lib/osdlib_unix.c b/src/osd/modules/lib/osdlib_unix.c
  15. index 7fe3c37..0ce6653 100644
  16. --- a/src/osd/modules/lib/osdlib_unix.c
  17. +++ b/src/osd/modules/lib/osdlib_unix.c
  18. @@ -198,6 +198,10 @@ void osd_sleep(osd_ticks_t duration)
  19. {
  20. // take a couple of msecs off the top for good measure
  21. msec -= 2;
  22. +#ifdef SDLMAME_EMSCRIPTEN
  23. + emscripten_sleep(msec);
  24. +#else
  25. usleep(msec*1000);
  26. +#endif
  27. }
  28. }
  29. diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c
  30. index a5e5669..fe207b7 100644
  31. --- a/src/osd/sdl/video.c
  32. +++ b/src/osd/sdl/video.c
  33. @@ -318,6 +318,12 @@ void sdl_osd_interface::update(bool skip_redraw)
  34.  
  35. if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
  36. debugger_update();
  37. +
  38. +#ifdef SDLMAME_EMSCRIPTEN
  39. + //must sleep from time to time even if we are unthrottled or running behind
  40. + //so that the browser does not hang
  41. + osd_sleep(3000);
  42. +#endif
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement