mirror of https://github.com/mgba-emu/mgba.git
GBA Audio: Fix audio channels being silenced at the wrong time
This commit is contained in:
parent
57bdbcd91e
commit
98529063ba
1
CHANGES
1
CHANGES
|
@ -9,6 +9,7 @@ Bugfixes:
|
||||||
- GBA: Fix BIOS check on big endian
|
- GBA: Fix BIOS check on big endian
|
||||||
- Libretro: Fix a memory leak with the render buffer
|
- Libretro: Fix a memory leak with the render buffer
|
||||||
- GBA Audio: Fix 8-bit writes to audio channel 3 and 4 registers
|
- GBA Audio: Fix 8-bit writes to audio channel 3 and 4 registers
|
||||||
|
- GBA Audio: Fix audio channels being silenced at the wrong time
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Window size command line options are now supported
|
- Qt: Window size command line options are now supported
|
||||||
- Qt: Increase usability of key mapper
|
- Qt: Increase usability of key mapper
|
||||||
|
|
|
@ -345,12 +345,10 @@ void GBAAudioWriteSOUND1CNT_X(struct GBAAudio* audio, uint16_t value) {
|
||||||
audio->nextCh1 = 0;
|
audio->nextCh1 = 0;
|
||||||
}
|
}
|
||||||
audio->playingCh1 = 1;
|
audio->playingCh1 = 1;
|
||||||
if (audio->ch1.envelope.stepTime) {
|
|
||||||
audio->ch1.envelope.nextStep = 0;
|
|
||||||
} else {
|
|
||||||
audio->ch1.envelope.nextStep = INT_MAX;
|
|
||||||
}
|
|
||||||
audio->ch1.envelope.currentVolume = audio->ch1.envelope.initialVolume;
|
audio->ch1.envelope.currentVolume = audio->ch1.envelope.initialVolume;
|
||||||
|
if (audio->ch1.envelope.currentVolume > 0) {
|
||||||
|
audio->ch1.envelope.dead = 0;
|
||||||
|
}
|
||||||
if (audio->ch1.envelope.stepTime) {
|
if (audio->ch1.envelope.stepTime) {
|
||||||
audio->ch1.envelope.nextStep = 0;
|
audio->ch1.envelope.nextStep = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -372,6 +370,9 @@ void GBAAudioWriteSOUND2CNT_HI(struct GBAAudio* audio, uint16_t value) {
|
||||||
if (GBAAudioRegisterControlIsRestart(value)) {
|
if (GBAAudioRegisterControlIsRestart(value)) {
|
||||||
audio->playingCh2 = 1;
|
audio->playingCh2 = 1;
|
||||||
audio->ch2.envelope.currentVolume = audio->ch2.envelope.initialVolume;
|
audio->ch2.envelope.currentVolume = audio->ch2.envelope.initialVolume;
|
||||||
|
if (audio->ch2.envelope.currentVolume > 0) {
|
||||||
|
audio->ch2.envelope.dead = 0;
|
||||||
|
}
|
||||||
if (audio->ch2.envelope.stepTime) {
|
if (audio->ch2.envelope.stepTime) {
|
||||||
audio->ch2.envelope.nextStep = 0;
|
audio->ch2.envelope.nextStep = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -419,6 +420,9 @@ void GBAAudioWriteSOUND4CNT_HI(struct GBAAudio* audio, uint16_t value) {
|
||||||
if (GBAAudioRegisterCh4ControlIsRestart(value)) {
|
if (GBAAudioRegisterCh4ControlIsRestart(value)) {
|
||||||
audio->playingCh4 = 1;
|
audio->playingCh4 = 1;
|
||||||
audio->ch4.envelope.currentVolume = audio->ch4.envelope.initialVolume;
|
audio->ch4.envelope.currentVolume = audio->ch4.envelope.initialVolume;
|
||||||
|
if (audio->ch4.envelope.currentVolume > 0) {
|
||||||
|
audio->ch4.envelope.dead = 0;
|
||||||
|
}
|
||||||
if (audio->ch4.envelope.stepTime) {
|
if (audio->ch4.envelope.stepTime) {
|
||||||
audio->ch4.envelope.nextStep = 0;
|
audio->ch4.envelope.nextStep = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue