Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from dosbox-staging:main #46

Open
wants to merge 1,359 commits into
base: main
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 28, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Feb 28, 2024
@johnnovak johnnovak force-pushed the main branch 2 times, most recently from 3149989 to 1eff25a Compare September 25, 2024 07:05
interloper98 and others added 27 commits November 16, 2024 22:42
This fixes playback in games and demos that setup a small single-frame
DMA transfer and write to the memory address at the playback rate.

One example is Crystal Dream by Triton, July 1992.
Regression from 9579fb2

LPT DAC was left out of a refactor that modified the mixer lock
Added back the check to stop the LPT DAC queue
Regression from 4f4bfa2

Conditional was accidently inverted during a refactor
This caused a clicking noise in Worms
The constructed state of a bind object has a nullptr event member,
so this is technically safer however in practice most bind objects
are immediately assigned an event.

This is a pre-requisite to displacing conflicting bind events
for a given host button.
These common APIs will let us compare them against other binds
to see if they originate from the same host button. This is a
prerequisite to displacing prior binds for a given button.
(This function is currently unused, but will be used in subsequent
commits)
FeralChild64 and others added 30 commits February 16, 2025 09:13
This reverts commit 42830cf.

No longer needed as GUS has been moved to the main thread.
This variable is used inside the CPU core and could have performance implications as atomic.
This reverts commit cbb70ca.

No longer needed as GUS has been moved to the main thread.
This reverts commit 03994a6.

No longer needed as GUS has been moved to the main thread.
This was made atomic in a previous commit so this declaration is invalid.
If this was used, it would have been a compile error.
The mixer thread is making calls to PIC_FullIndex()
To avoid thread sanitizer warnings, we had previously made the gloabls that calculate this index atomic.

While this stoppped the warnings, it is not entirely correct.
It uses multiple variables and multiple instructions to calculate the index.
Calculating the index as a whole is still not atomic.

The globals that were made atomic are also performance critical.
There was a notable performance regression in Nethack - Falcon's Eye due to this change.
The regression caused audio stutters at high cycle counts.

This commit has the main thread periodically update a pre-calculated FullIndex()
This will allow us to revert the commit causing the performance regressions.

Callers not on the main thread should use this new function.
Callers on the main thread should prefer the old PIC_FullIndex() where precision is required.

PIC_AtomicIndex() is less precisice than PIC_FullIndex() and caused timing issues in VGA code while testing so it won't be used there.
This is only used for fast-forward mode.
There are other uses of PIC_FullIndex() in opl.cpp but they all happen on the main thread.
Leaving those as-is as they update internal timers and may require extra precision.
IMFC spins up its own internal threads and one of the calls is made there.
That has been non thread-safe since before the mixer rework.
The other usage gets called from the mixer thread.
This reverts commit b97cbaf.

This commit caused a performance regression in Nethack — Falcon's Eye.
This lead to audio stutters when using a high cycle count.

The mixer and audio devices running on the mixer thread now use PIC_AtomicIndex()
This lets us remove atomic operations from these performance sensitive globals.
This generates the compile_commands.json file for use with LSPs.
Meson generates this file by default so this brings us to parity.
There's not any downside to having this on other than using 247KB of disk space.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants