- [FIX] Ja s'escolta el só de nou.

- Augmentat el buffer de so per a evitar en lo posible els talls.
- Purgat del buffer si arriva al màxim.
This commit is contained in:
2024-12-01 22:10:48 +01:00
parent 7cb6ae527b
commit c6b6830c5c

View File

@@ -202,8 +202,8 @@ namespace zx_ula
void port_out(int port, int val)
{
border_color = val & 0x7;
mic = (val&0x08)==0;
ear = val&0x10;
mic = (val&0x08)?0:1;
ear = val&0x10?1:0;
//printf("EAR:%i MIC:%i\n", ear, mic);
}
@@ -264,8 +264,8 @@ namespace zx_ula
void sound_update(const uint8_t dt)
{
t_sound += dt;
if (t_sound>=318) {
t_sound-=318;
if (t_sound>=316) {
t_sound-=316;
//sound_pos = (sound_pos+1) & 0x3ff;
//sound_buffer[sound_pos] = ear*128;
@@ -274,10 +274,12 @@ namespace zx_ula
sound_buffer[sound_pos++] = ear*128;
if (ear) last_1 = sound_pos;
}
/*else
else
{
printf("WARNING! Sound buffer overflow!\n");
}*/
//for now, drop then buffer
sound_pos = last_1 = 0;
//printf("WARNING! Sound buffer overflow!\n");
}
}
}
}