Skip to content

Minimal sound implementation take 2#17

Open
jepler wants to merge 2 commits intoevansm7:mainfrom
jepler:soundemu2
Open

Minimal sound implementation take 2#17
jepler wants to merge 2 commits intoevansm7:mainfrom
jepler:soundemu2

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

Comments