dingusppc/devices
Mihai Parparita 1f7edfdb3b Make Emscripten build not depend on SDL2 or cubeb
While Emscripten has an SDL compabtility layer, it assumes that the
code is executing in the main browser process (and thus has access to
them DOM). The Infinite Mac project runs emulators in a worker thread
(for better performance) and has a custom API for the display, sound,
input, etc. Similarly, it does not need the cross-platform sound support
from cubeb, there there is a sound API as well.

This commit makes SDL (*_sdl.cpp) and cubeb-based (*_cubeb.cpp) code be
skipped when targeting Emscripten, and instead *_js.cpp files are used
instead (this is the cross-platform convention used by Chromium[^1], and
could be extended for other targets).

For hostevents.cpp and soundserver.cpp the entire file was replaced,
whereas for videoctrl.cpp there was enough shared logic that it was
kept, and the platform-specific bits were moved behind a Display class
that can have per-platform implementations. For cases where we need
additional private fields in the platform-specific classes, we use
a PIMPL pattern.

The *_js.cpp files with implementations are not included in this
commit, since they are closely tied to the Infinite Mac project, and
will live in its fork of DingusPPC.

[^1]: https://www.chromium.org/developers/design-documents/conventions-and-patterns-for-multi-platform-development/
2023-10-25 22:25:53 -07:00
..
common Add assertion for valid SCSI IDs when updating control lines 2023-10-19 07:49:23 -07:00
ethernet bigmac: support more registers. 2023-09-22 00:09:17 +02:00
floppy Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
ioctrl amic: switch DMA code to mmu_map_dma_mem. 2023-10-02 14:48:25 +02:00
memctrl Grackle: implement some register reads to avoid warnings. 2023-02-15 02:36:40 +01:00
serial Fix compiler warnings: never executed. 2023-01-11 01:17:12 -08:00
sound Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
storage cdromdrive: clean-up and extend READ_TOC command. 2023-09-25 23:17:57 +02:00
video Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
CMakeLists.txt Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
deviceregistry.cpp deviceregistry: add device_registered method. 2022-08-19 18:53:05 +02:00
deviceregistry.h deviceregistry: add device_registered method. 2022-08-19 18:53:05 +02:00