GB Audio: Initialize wave RAM to GBC values

This commit is contained in:
Jeffrey Pfau 2016-12-22 15:38:34 -08:00
parent 8ac6f83bc5
commit 974c41e8cf
2 changed files with 18 additions and 0 deletions

View File

@ -59,6 +59,7 @@ Misc:
- 3DS, PSP2, Wii: Last directory loaded is saved
- GB Audio: Simplify envelope code
- GB Audio: Improve initial envelope samples
- GB Audio: Initialize wave RAM to GBC values
0.5.1: (2016-10-05)
Bugfixes:

View File

@ -73,6 +73,23 @@ void GBAudioReset(struct GBAudio* audio) {
audio->ch1 = (struct GBAudioSquareChannel) { .envelope = { .dead = 2 } };
audio->ch2 = (struct GBAudioSquareChannel) { .envelope = { .dead = 2 } };
audio->ch3 = (struct GBAudioWaveChannel) { .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 GBAudioNoiseChannel) { .envelope = { .dead = 2 } };
audio->eventDiff = 0;
audio->nextFrame = 0;