This commit is contained in:
2025-02-16 10:33:06 -07:00
parent 97de875bf2
commit 5934e2e877
3 changed files with 35 additions and 17 deletions

View File

@ -413,8 +413,9 @@ void audio_tick(){
}
}
if(ctx.ch4_len_enable) {
if(ctx.ch4_len_enable && ctx.ch4_enable) {
ctx.ch4_len++;
printf("Ch4 env: %02X\n", ctx.ch4_len);
if(ctx.ch4_len >= 64) {
ctx.ch4_len = 0;
ctx.ch4_enable = false;
@ -926,6 +927,7 @@ void audio_write(u16 address, u8 value){
ctx.ch4_initial_len = value & 0b111111;
ctx.ch4_len = ctx.ch4_initial_len;
ctx.ch4_len_fz = false;
printf("ch4 len: %02X\n", ctx.ch4_len);
}
if(address == 0xFF21) {
@ -969,6 +971,7 @@ void audio_write(u16 address, u8 value){
}
}
ctx.ch4_len_enable = len_en;
printf("ch4 trigger: LenEn %d\n", len_en);
if(value & 0x80) {
enable_noise();
}