From c6b6830c5c4bb67d547a709827af417329550fc6 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sun, 1 Dec 2024 22:10:48 +0100 Subject: [PATCH] =?UTF-8?q?-=20[FIX]=20Ja=20s'escolta=20el=20s=C3=B3=20de?= =?UTF-8?q?=20nou.=20-=20Augmentat=20el=20buffer=20de=20so=20per=20a=20evi?= =?UTF-8?q?tar=20en=20lo=20posible=20els=20talls.=20-=20Purgat=20del=20buf?= =?UTF-8?q?fer=20si=20arriva=20al=20m=C3=A0xim.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zx_ula.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/zx_ula.cpp b/zx_ula.cpp index 877f12b..5b3d25b 100644 --- a/zx_ula.cpp +++ b/zx_ula.cpp @@ -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"); + } } } } \ No newline at end of file