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

MEGA65: increase number of SIDs to four, to match the current hardware implementation #277

Closed
lgblgblgb opened this issue Jun 8, 2021 · 4 comments

Comments

@lgblgblgb
Copy link
Owner

lgblgblgb commented Jun 8, 2021

mega65-core has four SIDs implemented. Xemu/MEGA65 still has the "C65 legacy" using the dual-SID solution. So the task is to fix the situation, and having four SIDs emulated. Note, that it's unrelated that we have the MEGA65 MIXER implemented or not (ie: #272).

$D400, $D420 on the left and $D440, $D460 on the right

@lgblgblgb lgblgblgb self-assigned this Jun 8, 2021
lgblgblgb added a commit that referenced this issue Jun 8, 2021
@lgblgblgb lgblgblgb added the WIP label Jun 8, 2021
@lgblgblgb
Copy link
Owner Author

First ugly try.

@lgblgblgb
Copy link
Owner Author

lgblgblgb commented Jun 8, 2021

basic BASIC :) POKEs seems to OK to make some sound using either of the four SIDs at least. Unfortunately I am not aware to have some good example to utilizing 4 SIDs to really test it out. LUMA intended to use SIDs at $D400 and $D420 but still I cannot hear difference (as before this commit there was only two SIDs emulated at $D400 and $D440, so this change should bring back the "half" of the music)

lgblgblgb referenced this issue Jun 9, 2021
Using spinlocks to try to avoid race conditions between OPL3 and SIDs in
the "sample renderer" phase (called by SDL2 as thread) and the "register
write" phase, done by the emulation core via the I/O space from the main
thread.

Log to #29 as well.
@lgblgblgb
Copy link
Owner Author

lgblgblgb commented Jun 9, 2021

Note: it seems increasing the number of SIDs to four triggered some race-conditions between the audio callback thread of SDL and the main thread of emulation. I try to "decorate" things with spinlocks to avoid it, hitting another strange bug meanwhile, may be workarounded ...

@lgblgblgb
Copy link
Owner Author

Still unsure about LUMA does not have proper "two SID" sound. I have the suspect, that the SID emulation (I borrowed from project WebSID) has some problems. Since I modified it heavily to allow more SIDs to be emulated, but probably, some data structures are still shared, so there is an anomaly that SID instances can have effect on the others. This must be checked and fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant