stabilize scope more

This commit is contained in:
Wirlaburla 2024-03-21 19:05:27 -05:00
parent f8b286e169
commit cac554cc1c

View File

@ -641,13 +641,15 @@ void displayScope(xmp_module_info *mi, xmp_frame_info *fi) {
int horzInc = 1;
for (int s = 0; s < fi->buffer_size; s++) {
if (nxcol >= COLS-2) break;
int l = lerp(bufbuf[s], xbuf[s], 0.5f);
int l = lerp(bufbuf[s], lerp(xbuf[s-rate], xbuf[s], 0.5f), 0.5f);
int newpos = ((l+0x80) * (LINES - 4)) / 0xFF;
horzInc = (newpos < midLine)?-1:1;
for (int j = midLine; j != newpos; j+=horzInc) {
wmove(dis, j, (int)nxcol);
waddch(dis, '|');
}
wmove(dis, newpos, (int)nxcol);
waddch(dis, '|');
nxcol+=(1.0*(COLS-2)/fi->buffer_size);
bufbuf[s] = l;
}