Skip to content

DMG envelop change without retriggering sounds wrong #3067

@copyrat90

Description

@copyrat90

In the hardware, the envelop starts as expected, but in mGBA the envelop never starts.

Hardware -> mGBA recording

hardware_mgba.mp4

Test ROM

F0_F7_no_retrig.zip

Code

#include <tonc.h>

int main(void) {
    irq_init(NULL);
    irq_enable(II_VBLANK);

    REG_SNDSTAT = SSTAT_ENABLE;
    REG_SNDDSCNT = SDS_DMG100;
    REG_SNDDMGCNT = SDMG_LVOL(7) | SDMG_RVOL(7) | SDMG_LSQR1 | SDMG_RSQR1;

    REG_SND1CNT = SSQR_IVOL(15) | SSQR_TIME(0);
    REG_SND1FREQ = SFREQ_RESET | SFREQ_RATE(416);

    int wait = 45;
    while (1) {
        if (--wait == 0)
            REG_SND1CNT = SSQR_IVOL(15) | SSQR_TIME(7);
        VBlankIntrWait();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    hardware:audioIssues in the audio subsystem

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions