GB Audio: Initialize wave RAM to GBC values

This commit is contained in:
Jeffrey Pfau 2016-12-22 15:38:34 -08:00
parent 391e33de58
commit 822c38bea8
2 changed files with 18 additions and 0 deletions

View File

@ -31,6 +31,7 @@ Bugfixes:
Misc:
- PSP2: Improved controller rumble
- GB, GBA: Prevent loading null ROMs
- GB Audio: Initialize wave RAM to GBC values
0.5.1: (2016-10-05)
Bugfixes:

View File

@ -66,6 +66,23 @@ void GBAudioReset(struct GBAudio* audio) {
audio->ch1 = (struct GBAudioChannel1) { .envelope = { .dead = 2 } };
audio->ch2 = (struct GBAudioChannel2) { .envelope = { .dead = 2 } };
audio->ch3 = (struct GBAudioChannel3) { .bank = 0 };
// TODO: DMG randomness
audio->ch3.wavedata8[0] = 0x00;
audio->ch3.wavedata8[1] = 0xFF;
audio->ch3.wavedata8[2] = 0x00;
audio->ch3.wavedata8[3] = 0xFF;
audio->ch3.wavedata8[4] = 0x00;
audio->ch3.wavedata8[5] = 0xFF;
audio->ch3.wavedata8[6] = 0x00;
audio->ch3.wavedata8[7] = 0xFF;
audio->ch3.wavedata8[8] = 0x00;
audio->ch3.wavedata8[9] = 0xFF;
audio->ch3.wavedata8[10] = 0x00;
audio->ch3.wavedata8[11] = 0xFF;
audio->ch3.wavedata8[12] = 0x00;
audio->ch3.wavedata8[13] = 0xFF;
audio->ch3.wavedata8[14] = 0x00;
audio->ch3.wavedata8[15] = 0xFF;
audio->ch4 = (struct GBAudioChannel4) { .envelope = { .dead = 2 } };
audio->eventDiff = 0;
audio->nextFrame = 0;