diff --git a/.github/workflows/voice-user-check.yml b/.github/workflows/voice-user-check.yml index 92cfa1eb..1bddef5a 100644 --- a/.github/workflows/voice-user-check.yml +++ b/.github/workflows/voice-user-check.yml @@ -47,7 +47,7 @@ jobs: mkdir -p build/song-check python3 tools/build.py > build/song-check/target.log 2>&1 || { cat build/song-check/target.log - python3 -c "import sys,pathlib;sys.path.insert(0,'tools');import build;p=pathlib.Path('build/felucca.map');r=build.map_inputs(p.read_text()) if p.exists() else [];print('Largest sections:', sorted(r,key=lambda x:x[2],reverse=True)[:35]);print('Save/GEN sections:',[(n,a,z,o) for n,a,z,o in r if n.startswith(('.text.song_', '.text.gen_', '.text.project_save', '.text.lib_scan'))]);print('Cold bank:',[l for l in p.read_text().splitlines() if '_bt_end' in l or '_bt_start' in l] if p.exists() else [])" + python3 -c "import sys,pathlib;sys.path.insert(0,'tools');import build;p=pathlib.Path('build/felucca.map');r=build.map_inputs(p.read_text()) if p.exists() else [];print('Largest sections:', sorted(r,key=lambda x:x[2],reverse=True)[:35]);print('Save/GEN sections:',[(n,a,z,o) for n,a,z,o in r if n.startswith(('.text.song_', '.text.gen_', '.text.trackgen', '.text.project_save', '.text.lib_scan'))]);print('Cold bank:',[l for l in p.read_text().splitlines() if '_bt_end' in l or '_bt_start' in l] if p.exists() else [])" exit 1 } - name: Firmware memory and reach checks diff --git a/firmware/src/gen_track.c b/firmware/src/gen_track.c index ac3f26a8..14ee9324 100644 --- a/firmware/src/gen_track.c +++ b/firmware/src/gen_track.c @@ -7,7 +7,7 @@ static const char *const TG_ROLE[] = {"BASS","CHORDS","LEAD","ARP"}; static int trackgen_ok(const track_t *t) {return eng_ok(eng_idx(t->eng_req))&&eng_idx(t->eng_req)!=ENGI_INPUT;} -static void trackgen_knob(uint32_t k,int32_t s) +static __attribute__((noinline)) void trackgen_knob(uint32_t k,int32_t s) { tg_config_t *c=&tg_config[song.sel%NTRK]; if(!k) c->genre=gen_genre_next(c->genre,s); @@ -17,7 +17,7 @@ static void trackgen_knob(uint32_t k,int32_t s) *p=(uint8_t)clamp((int32_t)*p+s*(drum_track(TSEL)?5:1),0,drum_track(TSEL)?100:3); } else c->energy=(uint8_t)clamp((int32_t)c->energy+s*5,0,100); } -static void trackgen_cards(void) +static __attribute__((noinline)) void trackgen_cards(void) { const tg_config_t *c=&tg_config[song.sel%NTRK];char b[12]; hot_text_column(0,"GENRE",c->genre==GEN_EXPLORE?"EXPLORE":c->genre?GENRE[(c->genre-1u)%NGENRE].name:"RANDOM"); @@ -25,7 +25,7 @@ static void trackgen_cards(void) fmt_int(b,c->complex);hot_text_column(2,drum_track(TSEL)?"COMPLEX":"ROLE",drum_track(TSEL)?b:TG_ROLE[c->role%4u]); fmt_int(b,c->energy);hot_unit_column(3,"ENERGY",b,"%"); } -static void trackgen_make(void) +static __attribute__((noinline)) void trackgen_make(void) { track_t *t=TSEL;uint32_t k=trk_index(t),i,j,n,len,f; const tg_config_t *c=&tg_config[k]; diff --git a/tools/gen_aa_font.py b/tools/gen_aa_font.py index c34939e3..eb8d79fb 100644 --- a/tools/gen_aa_font.py +++ b/tools/gen_aa_font.py @@ -44,9 +44,9 @@ CODE = {0x2026: 0x85} # characters outside Latin-1 -> their one PHASES, PHASES_L = 1, 1 # horizontal phases per glyph (aa_raster.raster_font): S M, L. (JIANT 0.9.9-snd4, flash) # S M 2, were 4: 12.9 KB less of the glyph tables; a glyph within 1/4 px of its # place, a gap within 1/2 px (text_spacing_test.py, as L since 0.5) -# faces stored Huffman-coded (--huff): M and L. S, the most drawn and the least compressible (-15 %), stays -# 2 px per byte, so the labels draw at full speed -HUFF = [("M", "L")] +# All UI faces use the existing lossless decoder. The four-entry cache keeps +# frequently used faces resident and shares its last slot; no new RAM table. +HUFF = [("S", "M", "L")] # L draws only "JIANT" (ABOUT), the UPDATE MODE countdown digit, the calibration's control names (panel.c # B_NAME / E_NAME) and MENU > LARGE's card values and page titles (ui_draw.c draw_column_tall, ui_graph.c # graph_title: # . / J W too; a value with another character is set in M): a sparse face of those glyphs, the @@ -213,7 +213,10 @@ def emit(face, tracking, gamma, kern_min): for byte in raw[off:off + (e[4] * e[5] + 1) // 2]: v += [byte >> 4, byte & 15] vals.append(v[:e[4] * e[5]]) - hc, packed = huff_pack(vals) + # Pick the smaller existing run alphabet per face. The firmware already + # decodes arbitrary alpha repeats (also used by keycaps). + hc, packed = min((huff_pack(vals, runs) for runs in ((0, 15), (0,), tuple(range(16)))), + key=lambda p: len(p[0]) + sum(map(len, p[1]))) data, newoff = bytearray(), {} for off, v, b in zip(offs, vals, packed): assert huff_unpack(hc, b, len(v)) == v @@ -295,3 +298,4 @@ def main(): if __name__ == "__main__": main() +