Skip to content

Minimal sound implementation take 2 #17

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jepler
Copy link

@jepler jepler commented Mar 28, 2025

I investigated various implementations of sound in other emulators, which tended to be a bit tricky. After brainstorming with @ladyada we hit upon the idea of simply assuming samples are written as bytes in order and trapping on the write to the RAM address of the final sample to collect a full 370 sample buffer.

This is good enough to play the system beep. It also works with some games (dark castle) but not others (glider) and still does not successfully play samples in hypercard. This may have to do with the incomplete implementation of the VIA timer2, because debug messages about timer2 are printed when trying to play sounds in hypercard.

Unlike the previous pull request #14 I have rebased this one to not include all the other hacks going into the Adafruit Fruit Jam edition of umac, and tried to more closely follow the ambient coding style.

jepler added 2 commits March 28, 2025 06:45
.. for nonstandard RAM sizes
I investigated various implementations of sound in other emulators,
which tended to be a bit tricky. After brainstorming with @ladyada
we hit upon the idea of simply assuming samples are written as
bytes in order and trapping on the write to the RAM address of the
final sample to collect a full 370 sample buffer.

This is good enough to play the system beep. It also works with some
games (dark castle) but not others (glider) and still does not
successfully play samples in hypercard. This may have to do with
the incomplete implementation of the VIA timer2, because debug
messages about timer2 are printed when trying to play sounds in
hypercard.
@geerlingguy
Copy link

Just an aside: Thank you for this amazing work. Now I feel like procrastinating on my Pico Micro Mac build was providential, lol... I'll be able to get (somewhat) working sound!

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

Successfully merging this pull request may close these issues.

2 participants