Emulate PSG in SN76489 mode for pre-SMS consoles - #150
Open
maxim-zhao wants to merge 3 commits into
Open
Conversation
Collaborator
Author
|
Internally it was trying to say SN76489AN = SMS/GG, SN79489 = SG/SC (Sound Type in drivers.h) so I felt I had to rename this. I also introduced a different enum for this in the PSG emulator. Overall I also want to throw away this PSG emulator because it's kind of inaccurate compared to modern ones. But that's for another time. |
maxim-zhao
commented
May 12, 2026
| #define NoiseWhiteFeedback_SMSGG 0x0009 // Bits 0 and 3 | ||
| #define NoiseWhiteFeedback_SGSC 0x0006 // Bits 1 and 2 | ||
|
|
||
| #define NoiseWhiteFeedback NoiseWhiteFeedback_SMSGG |
Collaborator
Author
There was a problem hiding this comment.
None of these were used
maxim-zhao
commented
May 12, 2026
| for (int i = 0; i < 4; i++) // FIXME: to be done in sound.c ? | ||
| PSG.Channels[i].Active = TRUE; | ||
| SN76489_Reset (Z80_DEFAULT_CPU_CLOCK, Sound.SampleRate); | ||
| SN76489_Reset (Z80_DEFAULT_CPU_CLOCK, Sound.SampleRate, NOISE_MODE_SEGA); |
Collaborator
Author
There was a problem hiding this comment.
It gets reset later anyway so the noise mode doesn't matter
maxim-zhao
commented
May 12, 2026
|
|
||
| #define TECHINFO_LINES (14) | ||
| #define TECHINFO_COLUMNS (90) | ||
| #define TECHINFO_COLUMNS (100) |
Collaborator
Author
There was a problem hiding this comment.
Need more space...
maxim-zhao
commented
May 12, 2026
| // resume_fm(); | ||
| FM_Reset(); | ||
| SN76489_Reset (g_machine.TV->CPU_clock, Sound.SampleRate); | ||
| SN76489_Reset (g_machine.TV->CPU_clock, Sound.SampleRate, g_driver->snd == SND_SN76489 ? NOISE_MODE_SEGA : NOISE_MODE_SN76489); |
Collaborator
Author
There was a problem hiding this comment.
Here's where we actually set the chip type into the PSG emulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Somehow Meka was always emulating in SMS mode. The difference is barely noticeable for white noise, but very noticeable for periodic - but then SG games hardly ever use that.