You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Bugfix: the smaller MAX_SIMULTANEOUS_NOTES define, when used, can lead to silence on audio init
This commit is contained in:
@@ -1313,6 +1313,16 @@ void audio_reset_session(void) {
|
||||
gAudioBufferParameters.minAiBufferLength *= gAudioBufferParameters.presetUnk4;
|
||||
gAudioBufferParameters.updatesPerFrame *= gAudioBufferParameters.presetUnk4;
|
||||
|
||||
if (gIsConsole)
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES_CONSOLE;
|
||||
else
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES_EMULATOR;
|
||||
|
||||
if (gMaxSimultaneousNotes > MAX_SIMULTANEOUS_NOTES)
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES;
|
||||
else if (gMaxSimultaneousNotes < 0)
|
||||
gMaxSimultaneousNotes = 0;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
if (gAudioBufferParameters.presetUnk4 >= 2) {
|
||||
gAudioBufferParameters.maxAiBufferLength -= 0x10;
|
||||
@@ -1330,6 +1340,16 @@ void audio_reset_session(void) {
|
||||
gMinAiBufferLength = gSamplesPerFrameTarget - 0x10;
|
||||
gAudioUpdatesPerFrame = updatesPerFrame = gSamplesPerFrameTarget / 160 + 1;
|
||||
|
||||
if (gIsConsole)
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES_CONSOLE;
|
||||
else
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES_EMULATOR;
|
||||
|
||||
if (gMaxSimultaneousNotes > MAX_SIMULTANEOUS_NOTES)
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES;
|
||||
else if (gMaxSimultaneousNotes < 0)
|
||||
gMaxSimultaneousNotes = 0;
|
||||
|
||||
// Compute conversion ratio from the internal unit tatums/tick to the
|
||||
// external beats/minute (JP) or tatums/minute (US). In practice this is
|
||||
// 300 on JP and 14360 on US.
|
||||
@@ -1426,16 +1446,6 @@ void audio_reset_session(void) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (gIsConsole)
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES_CONSOLE;
|
||||
else
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES_EMULATOR;
|
||||
|
||||
if (gMaxSimultaneousNotes > MAX_SIMULTANEOUS_NOTES)
|
||||
gMaxSimultaneousNotes = MAX_SIMULTANEOUS_NOTES;
|
||||
else if (gMaxSimultaneousNotes < 0)
|
||||
gMaxSimultaneousNotes = 0;
|
||||
|
||||
sAudioFirstBoot = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user