Commit Graph

26 Commits

Author SHA1 Message Date
joevt
86d8ae0911 soundserver_cubeb: Verify buffer is not null. 2024-05-05 06:52:59 -07:00
Maxim Poliakovski
d7749e0a2c awacs: small cosmetic improvements. 2024-04-07 18:48:52 +02:00
joevt
fd961f9ff9 Fix Analyzer warnings.
In Xcode, type Command-Shift-B to analyze every source file or Command-Shift-Control-B to analyze the current source file.

For pseudo_dma_read report FIFO underrun and init data_word in that case.
2024-03-24 12:56:11 -07:00
joevt
50fcb45b88 awacs: Add dma input stub. 2024-03-09 06:20:24 -07:00
joevt
29d13aef09 dma: Add is_active method for input channels.
Since DBDMA contains an input and output channel, rename the existing is_active method to is_out_active.
2024-03-09 06:20:13 -07:00
Maxim Poliakovski
be633d3872 soundserver_cubeb: remove soundio code. 2023-11-15 19:01:54 +01:00
Maxim Poliakovski
453930ff75 awacs: pausing sound output DMA channel. 2023-11-15 19:01:54 +01:00
Maxim Poliakovski
c3f2c9e84c awac-pdm: improve read_stat(). 2023-11-15 19:01:54 +01:00
Mihai Parparita
35c86ad6bf Clean up #includes
Result of running IWYU (https://include-what-you-use.org/) and
applying most of the suggestions about unncessary includes and
forward declarations.

Was motivated by observing that <thread> was being included in
ppcopcodes.cpp even though it was unused (found while researching
the use of threads), but seems generally good to help with build
times and correctness.
2023-11-03 00:33:47 -07:00
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
Maxim Poliakovski
cfb1999caf soundserver: fix double freeing. 2023-10-18 16:18:54 +02:00
Maxim Poliakovski
daca3a27d6 soundserver: silence some logging messages. 2023-04-23 21:40:21 +02:00
Maxim Poliakovski
26374366c7 awacs: minor improvements (proper initialization). 2023-04-23 21:32:41 +02:00
Maxim Poliakovski
22798fe14e Fix compilation of the audio codec classes. 2023-04-23 21:04:24 +02:00
Maxim Poliakovski
422639411d Initial Burgundy sound codec emulation. 2023-02-25 18:14:42 +01:00
Maxim Poliakovski
3234f21cab Overhaul audio codec classes. 2023-02-25 18:14:42 +01:00
Maxim Poliakovski
71b2e6c1fa dbdma: implement optional command branching.
This feature is used by New World BootROMs for producing
error beeps with different duration and count.
2023-02-15 02:36:40 +01:00
joevt
64fec88436 Fix compiler warnings: cast loses precision.
Use explicit cast when converting large integer types to smaller integer types when it is known that the most significant bytes are not required.
For pcidevice, check the ROM file size before casting to int. We'll allow expansion ROM sizes up to 4MB but usually they are 64K, sometimes 128K, rarely 256K.
for machinefactory, change the type to size_t so that it can correctly get the size of files that are larger than 4GB; it already checks the file size is 4MB before we need to cast to uint32_t.
For floppyimg, check the image size before casting to int. For raw images, only allow files up to 2MB. For DiskCopy42 images, it already checks the file size, so do the cast after that.
2023-01-11 01:17:12 -08:00
joevt
93fae1ee68 Merge remote-tracking branch 'upstream/master' 2022-08-14 16:38:51 -07:00
Maxim Poliakovski
3f3af68582 machinegossamer: add Whisper ID PROM. 2022-08-14 23:01:55 +02:00
joevt
b76bfedf4b Remove unnecessary linefeeds from log
To remove blank lines in the dingusppc.log file or in the console output when -d is used.
2022-08-14 05:26:56 -07:00
Maxim Poliakovski
5e6f3a51b5 soundserver: shut-down safely. 2022-07-18 20:27:34 +02:00
Maxim Poliakovski
5c177cc50f Simplify registration of HW component types. 2022-01-26 16:45:21 +01:00
Maxim Poliakovski
3f20d0a700 heathrow: use unique_ptr with internal objects. 2021-10-25 22:19:45 +02:00
Maxim Poliakovski
c0cd6eb38f Add missing licence headers, update license date. 2021-10-23 21:00:31 +02:00
Maxim Poliakovski
9329d56d83 Move devices into dedicated subdirectories. 2021-10-23 20:17:47 +02:00