Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changes/b13-ui-flicker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## changelog
### 1.0.0-b14 (in progress)
- **Fixed: the screen no longer blinks when a quick menu opens or closes, or when a button changes the page.** A full redraw filled the whole screen with the background first and the new page came in over it; now each pixel goes straight from the old picture to the new one. The MIXER's LOW / MID / HIGH bands, the cards under QUICK SEQ's and PARAMETER LOCKS' step strip, the dialogs and the count-in (which blinked on every beat) are fixed the same way.
- **Fixed: a value ending in 4 no longer touches its unit** ("54ms" on VOICE 2/2's GLIDE, and on every card and cell).
- **Fixed: on WAVE ACID / ACSQ the filter pictures draw the resonance peak you hear** (they used the ordinary RES law).
2 changes: 0 additions & 2 deletions docs/KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Fixed in earlier builds: see [CHANGELOG-TIDE](../CHANGELOG-TIDE.md) (every beta'
## Open in TIDE

- **New on the unit:** the owner installed b13 on 15 November. The louder output (+8 dB at the jacks), the 303 voices, the 11 replaced sounds and the five new multis were tested on the computer before that. Whether the analog output stays clean at the new level is not checked yet.
- **VOICE 2/2 page:** the cell overlaps the text beside it when GLIDE reads "54 ms". Picture only; a drawing fix is planned.
- **ACID filter drawing:** on WAVE ACID / ACSQ the filter pictures draw the resonance peak lower than you hear it (they use the old RES law). Picture only; the sound is right.
- **Delay TIME changes sweep slowly** with the delay's wobble on: a big TIME change glides for about a second (up to five for a bar's worth). Small steps settle in about a tenth of a second.
- **Live recording on an ARP SEQ part:** a key sets one note per step (no chords), a 1- or 2-step pattern in REPLACE can split a chord across steps, and at a POLY stretch change a key can land one step off.
- **The step display can show a hit that doesn't play:** seen once in tens of thousands of look-aheads in the step test (ARC DROP under WANDER). Picture only.
Expand Down
44 changes: 22 additions & 22 deletions felucca-base/firmware/src/gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,32 @@ static uint32_t cv_w, cv_h; /* the canvas: width, the rows of this band */
static uint32_t cv_ph, cv_bpass; /* the picture's whole height (cv_begin's h); the band being drawn starts at row cv_bpass of it (CV_BANDS), 0 outside a band loop */
static int32_t cv_by; /* the picture row the canvas's row 0 is: every primitive draws at (y + cv_oy - cv_by) */
static uint16_t cv_bg; /* what cv_begin cleared the canvas to */
/* b11 (owner on rc8: "when a screen is redrawn there are still 3 vertical lines for a couple of milliseconds"): a page change within one grid layout filled the
* gutters (GUT: x 0..3, 79..81, 119..120, 158..160, 236..239 over rows 27..216, the gaps beside every column set a grid uses) BEFORE the strips, and where the old page had a
* strip over a gutter (the area page's picture, a 2 x 2 page's cards) a thin BG stripe cut through it until the new strip landed (~5 transfers). The gutters' fill now waits for
* the end of the pass (ui_draw.c: grid_fill arms it, gut_flush sends it): every transfer of the pass marks the gutter pixels it covers, and only the ones nothing covered
* get the BG. The same picture at the end (a fill under a strip was only drawn over); in between, every pixel is the old page's or the new one's. */
static const uint8_t GUT[5][2] = {{0, 4}, {79, 3}, {119, 2}, {158, 3}, {236, 4}}; /* x, width: 16 columns, bit b of a row the b-th column */
#define GUT_Y0 27u
#define GUT_H 190u
static uint16_t gut_cov[GUT_H] __attribute__((section(".pool"))); /* the gutter columns covered since gut_arm, a row */
static uint16_t gut_bg __attribute__((section(".pool"))); /* the BG to fill with */
static uint8_t gut_on __attribute__((section(".pool"))); /* armed (the pool is cleared at boot, main.c: off); all three outside .bss */
/* b13 (owner on 1.0.0-b13: "flickering on the screen when using the quick menus and pressing buttons"): a full redraw (a quick layer opened or closed, a page of
* another layout) filled the whole body with the BG first (46,320 px, ~37 ms of SPI) and the strips landed on it over the next ~40 ms: one blank body a press (b11 kept
* that fill for a change of layout; only the gutters waited). Now NO pixel is filled before the pass: every transfer of the pass marks the body pixels it covers
* (gut_cov, one bit a pixel, rows GUT_Y0 .. GUT_Y0 + GUT_H - 1 = H_HEAD .. 239: the old fill's rows and the footer's) and at the end of the pass (ui_draw.c gut_flush) only
* the pixels nothing covered get the BG: the same picture as the fill first, and in between every pixel is the old page's or the new one's. 6,912 B, in the pool */
#define GUT_Y0 24u
#define GUT_H 216u
static uint32_t gut_cov[GUT_H][8] __attribute__((section(".pool"))); /* covered since gut_arm: bit x % 32 of word x / 32, a row */
static uint16_t gut_bg __attribute__((section(".pool"))); /* the BG to fill with */
static uint8_t gut_on __attribute__((section(".pool"))); /* armed (the pool is cleared at boot, main.c: off); all three outside .bss */
static void gut_mark(uint32_t x, uint32_t y, uint32_t w, uint32_t h)
{
uint32_t i, c, b = 0, m = 0, y1 = y + h;
uint32_t y1 = y + h, x1 = x + w, r, i;
if (!gut_on)
return;
for (i = 0; i < 5u; i++)
for (c = GUT[i][0]; c < (uint32_t)GUT[i][0] + GUT[i][1]; c++, b++)
if (c >= x && c < x + w)
m |= 1u << b;
if (x1 > 240u)
x1 = 240u;
if (y < GUT_Y0)
y = GUT_Y0;
if (y1 > GUT_Y0 + GUT_H)
y1 = GUT_Y0 + GUT_H;
for (; m && y < y1; y++)
gut_cov[y - GUT_Y0] |= (uint16_t)m;
for (r = y; x < x1 && r < y1; r++)
for (i = x / 32u; i <= (x1 - 1u) / 32u; i++) /* (the bits x .. x1 - 1 of word i) */
gut_cov[r - GUT_Y0][i] |= (i > x / 32u ? ~0u : ~0u << (x % 32u)) & (i < (x1 - 1u) / 32u ? ~0u : ~0u >> (31u - (x1 - 1u) % 32u));
}
/* every transfer from here on marks the gutters: every UI file is compiled after this line (felucca.c: ui.c, ui_graph.c, ui_scope.c, ui_draw.c, ...), so none can send one
/* every transfer from here on marks the body: every UI file is compiled after this line (felucca.c: ui.c, ui_graph.c, ui_scope.c, ui_draw.c, ...), so none can send one
* unmarked (gut_flush would then paint BG over it). One wrapper a kind, not a mark at every call (flash). lcd_fill: lcd.c, the emulator and ui_test.c define it before
* this file; some host tests have none and call none, so gut_fill (which calls it) is in ui_draw.c (a test that reaches it without ui_draw.c fails to link, loudly) */
static void gut_blit(uint32_t x, uint32_t y, uint32_t w, uint32_t h, const uint16_t *p)
Expand All @@ -134,9 +132,9 @@ static void gut_fill(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint16_t c)
#define lcd_fill(x, y, w, h, c) gut_fill((x), (y), (w), (h), (c))
static void gut_arm(uint16_t bg)
{
uint32_t r;
for (r = 0; r < GUT_H; r++)
gut_cov[r] = 0;
uint32_t *p = &gut_cov[0][0];
while (p < &gut_cov[GUT_H][0])
*p++ = 0;
gut_bg = bg;
gut_on = 1;
}
Expand Down Expand Up @@ -770,6 +768,7 @@ static const uint16_t *text_rv; /* cv_text_x16: its linear
static uint8_t text_exact; /* cv_text_x16: the design pictures' placement: every glyph on the phase nearest its own pen (a tie to the even phase), no memory of the glyph before */
static int32_t text_trk; /* item 158: added to every glyph's advance, 1/16 px (0, or negative: a card label tightened to fit its card, ui_draw.c lbl_trk) */
static int32_t text_pen0; /* the pen the next text_run starts at, 1/16 px (0 .. 15: cv_text_x16's fraction; every other caller: 0) */
static int32_t text_ink1 __attribute__((section(".pool"))); /* b13 (item 156): the column after the last cv_text_flags text's ink (canvas x): a unit after a value keeps 1 px from it (ui_draw.c card_paint) */
static int32_t text_run(int32_t x, int32_t y, const aafont_t *f, const char *s, const uint16_t *rv, int32_t *bb)
{
int32_t pen = text_pen0, err = 0, x0 = 0x7FFF, y0 = 0x7FFF, x1 = -0x7FFF, y1 = -0x7FFF;
Expand Down Expand Up @@ -837,6 +836,7 @@ static int32_t cv_text_flags(int32_t x, int32_t y, const aafont_t *f, const char
uint32_t flags)
{
int32_t b[4], pen = text_run(x, y, f, s, text_rv ? text_rv : ramp(fg, bg), b);
text_ink1 = b[2];
if (GFX_HOOKS && b[2] > b[0]) {
int32_t y0 = b[1], y1 = b[3];
if (b[0] < 0 || b[2] > (int32_t)cv_w || y0 + CV_Y < cv_cy0 || y1 + CV_Y > cv_cy1)
Expand Down
4 changes: 2 additions & 2 deletions felucca-base/firmware/src/twin_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ static int32_t tg_mix(int32_t a, int32_t b, int32_t w) { return tg_db((int32_t)(
static int32_t tg_f1(const track_t *t, uint32_t hz)
{
int32_t md = clamp(t->p[P_FREEC], 0, UF_HP), res = clamp(t->p[P_FREEB], 0, 127), cut = clamp(t->p[P_FREEA], 0, UF_STEPS), s24 = t->p[P_FREED] == 2, db;
int32_t wb = md <= 64 ? md << 4 : ((UF_HP - md) * 65) >> 2, wl = md < 64 ? 1024 - wb : 0, wh = md > 64 ? 1024 - wb : 0, k1 = s24 ? UF_K24A : UF_K(res);
int32_t wb = md <= 64 ? md << 4 : ((UF_HP - md) * 65) >> 2, wl = md < 64 ? 1024 - wb : 0, wh = md > 64 ? 1024 - wb : 0, k1 = s24 ? UF_K24A : UF_K(t, res);
uint32_t fc = gf_cut_hz(40 + 396 * cut);
if (cut >= UF_STEPS && md <= 0) /* (the bypass: the filter is not run) */
return 0;
db = svf_db10(hz << 8, fc, wl, wb, wh, k1, k1);
if (s24)
db += svf_db10(hz << 8, fc, wl, wb, wh, UF_K24B(res), UF_K24B(res));
db += svf_db10(hz << 8, fc, wl, wb, wh, UF_K24B(t, res), UF_K24B(t, res));
return db * 16 / 10;
}
static int32_t tg_f2(const track_t *t, uint32_t hz)
Expand Down
1 change: 0 additions & 1 deletion felucca-base/firmware/src/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ static void rp_put(uint32_t f, uint32_t v)
* Not in a patch, a multi or the project: a load never touches them (ui_input.c sc_get / sc_put / sc_sync) */
#define ui_sc_set (&favorites.factory[15][14])
static const char *const DM_NAME[DM_N] = {"DUEL", "STEREO", "LAYER"};
static void draw_gaps(uint32_t y, uint32_t h); /* (ui_draw.c) */

static uint8_t sync_reload; /* engine / preset / project / user preset loaded: editor RELOAD push */

Expand Down
108 changes: 29 additions & 79 deletions felucca-base/firmware/src/ui_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,94 +654,41 @@ static void draw_head(void)
/* (owner V9: no rule under any title; the gradient stays on the title text, values and bars) */
cv_blit(0, Y_HEAD);
}
/* Rows y0 .. y1 - 1 across the screen: the BG */
static void gap_rows(uint32_t y0, uint32_t y1)
{
lcd_fill(0, y0, 240, y1 - y0, T_BG);
}
/* the BG beside the four columns (the cards; MIXER's strips) over rows y .. y + h - 1 */
static void draw_gaps(uint32_t y, uint32_t h)
{
uint32_t i;
lcd_fill(0, y, (uint32_t)CARD_X(0), h, T_BG);
for (i = 0; i < 4u; i++) { /* right of each column */
uint32_t x = (uint32_t)(CARD_X(i) + CARD_W), w = i < 3u ? (uint32_t)CARD_X(i + 1u) - x : 240u - x;
lcd_fill(x, y, w, h, T_BG);
}
}
/* b10 ui-a (Phase A, cost #2): a grid layout's strips (header, cards, panel, cells, footer) cover ~95 % of the body, so the whole-body fill (46,320 px, 37 ms of SPI) before them is
* almost all drawn over. Only the BG the strips leave is filled: the rows between them (GAPB: grid, first row, rows) and the gutters beside the cards (every column set any grid
* uses, x 0..3, 79..81, 119..120, 158..160, 236..239, rows 27 .. 216: a fill under a strip is only drawn over). Found with tests/gap_probe.c:
* every page of every engine and the QUICK layers redrawn on a poisoned screen end equal to the whole-body fill's picture. A grid with no row here (13, any new one) is filled whole. */
static void grid_fill(void)
{
static const uint8_t GAPB[][3] = {{1, 24, 3}, {1, 103, 3}, {1, 160, 2}, {1, 216, 1}, {2, 24, 4}, {2, 112, 4}, {2, 200, 2}, {4, 24, 4},
{5, 24, 3}, {5, 51, 3}, {5, 130, 7}, {5, 209, 8}, {6, 24, 4}, {6, 80, 6}, {6, 198, 4}, {7, 24, 3}, {7, 90, 3}, {7, 152, 3}, {7, 214, 3},
{14, 24, 3}, {14, 119, 98}, {15, 24, 3}, {15, 51, 3}, {15, 133, 4}, {15, 216, 1},
{16, 24, 3}, {16, 150, 1}, {16, 170, 4}, {16, 184, 5}, {16, 194, 8}, {16, 209, 8}, {17, 24, 3}};
uint32_t i, n = 0;
for (i = 0; i < sizeof GAPB / sizeof GAPB[0]; i++)
n += GAPB[i][0] == grid_on;
if (!n) {
gap_rows(H_HEAD, Y_FOOT + 15);
return;
}
gut_arm(T_BG); /* b11: the gutters (gfx.c GUT) at the end of the pass, only where nothing drew (ui_draw: gut_flush) */
for (i = 0; i < sizeof GAPB / sizeof GAPB[0]; i++)
if (GAPB[i][0] == grid_on)
lcd_fill(0, GAPB[i][1], 240, GAPB[i][2], T_BG);
}
/* b11: the gutter pixels nothing drew since gut_arm (gfx.c): BG, one fill a run of rows with the same uncovered columns (most passes: none or a few). Here, not in gfx.c: some host tests take gfx.c without an lcd_fill */
/* b13: the body pixels nothing drew since gut_arm (gfx.c): the BG, one fill a run of uncovered columns over the rows that have the same coverage (most passes:
* the few rows and columns between the strips). Here, not in gfx.c: some host tests take gfx.c without an lcd_fill */
static void gut_flush(void)
{
uint32_t i, b0 = 0, r, r1, m, lo, hi;
uint32_t r, r0 = 0, x, x0;
if (!gut_on)
return;
gut_on = 0;
for (i = 0; i < 5u; b0 += GUT[i][1], i++) {
const uint32_t all = (1u << GUT[i][1]) - 1u;
for (r = 0; r < GUT_H; r = r1) {
m = ~((uint32_t)gut_cov[r] >> b0) & all;
for (r1 = r + 1u; r1 < GUT_H && (~((uint32_t)gut_cov[r1] >> b0) & all) == m; r1++)
for (r = 1; r <= GUT_H; r++) {
if (r < GUT_H && !memcmp(gut_cov[r], gut_cov[r0], sizeof gut_cov[0]))
continue; /* (the same columns as the run's first row) */
for (x = 0; x < 240u; x = x0) { /* each run of uncovered columns of rows r0 .. r - 1 */
for (; x < 240u && ((gut_cov[r0][x / 32u] >> (x % 32u)) & 1u); x++)
;
for (lo = 0; lo < GUT[i][1]; lo = hi) { /* each run of uncovered columns */
for (; lo < GUT[i][1] && !((m >> lo) & 1u); lo++)
;
for (hi = lo; hi < GUT[i][1] && ((m >> hi) & 1u); hi++)
;
if (hi > lo)
lcd_fill(GUT[i][0] + lo, GUT_Y0 + r, hi - lo, r1 - r, gut_bg);
}
for (x0 = x; x0 < 240u && !((gut_cov[r0][x0 / 32u] >> (x0 % 32u)) & 1u); x0++)
;
if (x0 > x)
lcd_fill(x, GUT_Y0 + r0, x0 - x, r - r0, gut_bg);
}
r0 = r;
}
}
#ifndef GRID_PREFILL
#define GRID_PREFILL() grid_fill()
#define GRID_PREFILL() gut_arm(T_BG)
#endif
static uint8_t gap_grid; /* the grid layout of the last full redraw (0: none / a page without a grid) */
static uint16_t gap_bg; /* and the BG it was filled with */
/* full redraw: the strips (header, cards, panel, footer) cover the rest; only the BG between them is filled */
/* a full redraw (ui.force 1): nothing is filled first (b13, above gut_mark); the pass's transfers cover what they draw and gut_flush gives the rest the BG.
* item 152 A: the same page again (ui_refresh, ui.force 2): the strips and cards cover their own rows, the BG between them is already there */
static void draw_frame(void)
{
const uint32_t ch = CARD_H, gy = Y_GRAPH, gh = H_GRAPH;
if (ui.force == 2) /* item 152 A: the same page again (ui_refresh): the strips and cards cover their own rows, the BG between them is already there */
return;
if (grid_on) { /* the grid: everything under the header is drawn over the background */
if (gap_grid == grid_on && gap_bg == T_BG) /* the same layout and BG as the last full redraw: the gaps are BG already, so the prefill changes nothing the player sees */
GRID_PREFILL();
else /* another layout: its gutters and rows cut thin BG stripes through the OLD page's cards for the ~40 ms the cards take to draw (rc6: "two vertical lines, only a blink"):
* the whole body first, as before Phase A (one blank, no stripes) */
gap_rows(H_HEAD, Y_FOOT + 15);
gap_grid = (uint8_t)grid_on;
gap_bg = T_BG;
return;
}
gap_grid = 0;
gap_rows(H_HEAD, Y_LABEL);
gap_rows(Y_LABEL + ch, gy);
gap_rows(gy + gh, Y_FOOT);
draw_gaps(Y_LABEL, ch);
if (ui.force != 2)
GRID_PREFILL();
}
/* b13: a screen drawn whole over the page (a dialog, the count-in, the update countdown): the BG where it draws nothing, at the end of the pass (it filled rows 24 .. 239
* first, and the count-in did on every beat: a blank body between) */
#define body_clear() GRID_PREFILL()

#ifndef CARD_HOOK
#define CARD_HOOK(v, u) ((void)0) /* host: a card value set in S (M too wide with its unit) */
Expand Down Expand Up @@ -895,6 +842,7 @@ static void area_rect(int32_t *y, int32_t *h)
*h = MROW_WAVES_END - UT_A_GR_Y;
}
/* the card of knob c (1 .. 3) in the area card row: x, y, w, h (w = h = 0: no card in that column) */
static int foot_steps(void);
static void area_geo(uint32_t c, int32_t *x, int32_t *y, int32_t *w, int32_t *h)
{
uint32_t cols = grid_on == 5 ? 3u : area_cols;
Expand All @@ -910,6 +858,8 @@ static void area_geo(uint32_t c, int32_t *x, int32_t *y, int32_t *w, int32_t *h)
*y = LP_CARD_Y;
*h = LP_CARD_H;
}
if (foot_steps() && *y + *h > Y_FOOT) /* b13: the footer's step strip (row 1, from Y_FOOT) is drawn over the row's last rows (QUICK SEQ, PARAMETER LOCKS): the card stops there, its rows no longer flash under it */
*h = Y_FOOT - *y;
}
static void grid_geo(uint32_t c, int32_t *x, int32_t *y, int32_t *w, int32_t *h)
{
Expand Down Expand Up @@ -1178,7 +1128,7 @@ static void card_paint(const card_geo_t *g, uint32_t c, int32_t gx, int32_t gw,
} else
x = g->cut ? cv_text_on(pad, ty, vf, vb, col, T_BG) : cv_text_fit(pad, ty, vf, vb, col, T_BG, room - uw);
if (unit[0])
cv_text_on(x + ug, card_ty(uf, g->val_base), uf, unit, ucol, T_BG);
cv_text_on(x + ug > text_ink1 ? x + ug : text_ink1 + 1, card_ty(uf, g->val_base), uf, unit, ucol, T_BG); /* (item 156: a "4" ends its ink at its pen: "54ms" touched) */
}
}
if ((ratio >= 0 && !two) || (g->seg && cell_seg_n > 1u && !big)) { /* (item 156: a CHOICE's segment bar, also under a value of two lines) */
Expand Down Expand Up @@ -3266,7 +3216,7 @@ static void draw_uboot(void)
if (!ui.force && shown == ui.uboot)
return;
shown = ui.uboot;
lcd_fill(0, H_HEAD, 240, 240 - H_HEAD, T_BG);
body_clear();
ui.head_sig = ~0u;
draw_text_box(0, 76, 240, &AF_M, "STARTS IN", T_TEXT, 1); /* (the title, UPDATE MODE, is the header's) */
draw_text_box(0, 102, 240, &AF_L, d, T_THEME, 1);
Expand Down Expand Up @@ -3297,7 +3247,7 @@ static void draw_countin(void)
if (!ui.force && shown == sig)
return;
shown = sig;
lcd_fill(0, H_HEAD, 240, 240 - H_HEAD, T_BG);
body_clear();
ui.head_sig = ~0u;
if (total > 4u) {
str_cpy(sub, "BAR 1 OF 2", sizeof sub);
Expand Down Expand Up @@ -3459,7 +3409,7 @@ static void draw_confirm_erase(void)
const char *const *L = ERASE_LINES;
const int32_t H = ERASE_H, BY = ERASE_BY, W = ERASE_W;
uint32_t i, strip;
lcd_fill(0, H_HEAD, 240, 240 - H_HEAD, T_BG);
body_clear();
ui.head_sig = ~0u;
for (strip = 0; strip < 2u; strip++) {
const int32_t y0 = strip ? ERASE_STRIP : 0;
Expand Down Expand Up @@ -3500,7 +3450,7 @@ static void draw_confirm(void)
return;
}
confirm_text(a, b);
lcd_fill(0, H_HEAD, 240, 240 - H_HEAD, T_BG);
body_clear();
ui.head_sig = ~0u;
CV_BANDS(DLG_H + dh) {
cv_begin(DLG_W, DLG_H + dh, T_BG); /* a SURF card: warning, the question, the detail, two buttons */
Expand Down
Loading