mkdir -p build
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -MMD -MP -Isrc -c src/core.c -o build/core.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -MMD -MP -Isrc -c src/app.c -o build/app.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -MMD -MP -Isrc -c src/render.c -o build/render.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -MMD -MP -Isrc -c src/audio.c -o build/audio.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -MMD -MP -Isrc -c src/fm_synth.c -o build/fm_synth.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -MMD -MP -Isrc -c src/music.c -o build/music.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -I/mnt/data/work/sdl-prefix/include  -MMD -MP -Isrc -c src/controller.c -o build/controller.o
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -I/mnt/data/work/sdl-prefix/include  -MMD -MP -Isrc -c src/main.c -o build/main.o
cc  build/core.o build/app.o build/render.o build/audio.o build/fm_synth.o build/music.o build/controller.o build/main.o -L/mnt/data/work/sdl-prefix/lib -Wl,-rpath,/mnt/data/work/sdl-prefix/lib -Wl,--enable-new-dtags -lSDL3  -lm  -o glyph-division
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -I/mnt/data/work/sdl-prefix/include  -Isrc src/core.c src/app.c src/render.c src/audio.c src/fm_synth.c src/music.c src/controller.c tests/test_controller.c -L/mnt/data/work/sdl-prefix/lib -Wl,-rpath,/mnt/data/work/sdl-prefix/lib -Wl,--enable-new-dtags -lSDL3  -lm   -o build/test-controller
SDL_VIDEODRIVER=offscreen SDL_RENDER_DRIVER=software SDL_AUDIODRIVER=dummy ./build/test-controller
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Raw A / GUID ff00cfda091200000100000000007604
Controller input: raw=yes mapped=no axes=3 buttons=8 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Raw C / GUID ff004e1b091200000300000000007604
Controller input: raw=yes mapped=no axes=3 buttons=8 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Raw B / GUID ff008fdb091200000200000000007604
Controller input: raw=yes mapped=no axes=3 buttons=8 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Raw A / GUID ff00cfda091200000100000000007604
Controller input: raw=yes mapped=no axes=3 buttons=8 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Ignoring invalid controller profile: /tmp/glyph-controllers-FFks1I/controls-ff00cfda091200000100000000007604.cfg
Controller: Raw A / GUID ff00cfda091200000100000000007604
Controller input: raw=yes mapped=no axes=3 buttons=8 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Mapped Pad / GUID ff001bc8091200000400000000007601
Controller input: raw=yes mapped=yes axes=6 buttons=16 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Mapped Pad / GUID ff001bc8091200000400000000007601
Controller input: raw=yes mapped=yes axes=6 buttons=16 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
PASS: unmapped raw hats/axes/buttons; deadzone; -32768 trigger rest; capture consumption; duplicates; held-opening press; cardinal hats
PASS: virtual-controller title/start/pause/controls/rebinding flow and raw-hat high-score initials/confirmation
PASS: focus loss pauses; background input suppressed; held input requires release on return
PASS: no control stealing; inactive-device events ignored; newest-remaining failover; unplug cancels capture/pauses; GUID profiles restored
PASS: malformed profile rejected atomically; no half-loaded mappings
PASS: mapped pad defaults and old-bindings migration; raw override authoritative; stick/D-pad; profile reload/reset; gamepad-only fallback
PASS: no-controller state and immutable keyboard rescue controls
ALL CONTROLLER TESTS PASSED: 255 assertions (SDL virtual devices, no physical hardware)
cc  -O2 -g -std=c99 -Wall -Wextra -Wpedantic -I/mnt/data/work/sdl-prefix/include  -Isrc src/core.c src/app.c src/render.c src/audio.c src/fm_synth.c src/music.c src/controller.c tests/test_rebinding.c -L/mnt/data/work/sdl-prefix/lib -Wl,-rpath,/mnt/data/work/sdl-prefix/lib -Wl,--enable-new-dtags -lSDL3  -lm   -o build/test-rebinding
SDL_VIDEODRIVER=offscreen SDL_RENDER_DRIVER=software SDL_AUDIODRIVER=dummy ./build/test-rebinding
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Legacy raw USB controls (virtual fixture) / GUID ff0072d9091200000570000000007604
Controller input: raw=yes mapped=no axes=3 buttons=10 hats=1
Controller raw button 0 down (page=0 column=0 capture=-1)
Controller raw button 0 up (page=3 column=1 capture=-1)
Controller raw button 0 down (page=3 column=1 capture=-1)
Controller capture armed: action=4 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller raw button 0 up (page=3 column=1 capture=4)
Controller raw button 9 down (page=3 column=1 capture=4)
Controller capture accepted (event): action=4 BUTTON 9 rest=0
Controller raw button 9 up (page=3 column=1 capture=-1)
Controller raw button 0 down (page=3 column=0 capture=-1)
Controller raw button 0 up (page=3 column=0 capture=4)
Controller raw button 8 down (page=3 column=0 capture=4)
Controller raw button 8 up (page=3 column=0 capture=4)
Controller capture armed: action=5 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller capture accepted (polled state): action=5 BUTTON 8 rest=0
Controller raw button 8 up (page=3 column=1 capture=-1)
Controller capture armed: action=6 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller capture accepted (polled state): action=6 BUTTON 0 rest=0
Controller raw button 0 up (page=3 column=1 capture=-1)
Controller capture armed: action=7 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller capture accepted (polled state): action=7 AXIS 2 + rest=-32768
Controller capture armed: action=0 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller capture accepted (polled state): action=0 HAT 0 UP rest=0
Controller raw hat 0 value=0
Controller capture armed: action=4 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller raw button 7 down (page=3 column=1 capture=-1)
Controller raw button 7 up (page=3 column=1 capture=-1)
Controller capture armed: action=4 device=Legacy raw USB controls (virtual fixture) raw=yes
Controller raw button 7 down (page=3 column=1 capture=4)
Controller capture accepted (event): action=4 BUTTON 7 rest=0
Controller raw button 7 up (page=3 column=1 capture=-1)
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Legacy raw USB controls (virtual fixture) / GUID ff0072d9091200000570000000007604
Controller input: raw=yes mapped=no axes=3 buttons=10 hats=1
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
Controller: Legacy raw USB controls (virtual fixture) / GUID ff0072d9091200000570000000007604
Controller input: raw=yes mapped=yes axes=3 buttons=10 hats=1
PASS: actual title-to-Controls flow selects controller; extra raw button binds; keyboard editing remains available
PASS: missing button/hat/axis edges use raw state; ignored opening release recovers; resting trigger, diagonal-hat and cancel guards preserved
PASS: press/release between fixed updates is captured once and cannot reopen the dialog
PASS: GUID profile survives restart; extra unmapped buttons bind through raw input even alongside a Gamepad handle
ALL REBINDING REGRESSIONS PASSED: 106 assertions (virtual devices only)
Controller: NO CONTROLLER - KEYBOARD AVAILABLE
SDL 3.4.18 | video=offscreen | renderer=software | audio=dummy
SDL QA: rendered=45, audio_frames=36864, music=Six Glyphs at Midnight, steps=5
