Repository navigation
Commit d43bca9
committed
picogame: optional Framebuffer.sync hook for tear-free full repaints
Framebuffer gains a settable `sync` attribute: an optional 0-arg callable that
Scene.refresh() invokes on the framebuffer path BEFORE compositing a large
(>= half-screen) region - e.g. a camera move that repaints most of the frame.
Small sprite-only dirty rects skip it, so per-frame latency is unaffected.
This decouples the engine from any specific backend (the plan's guidance): the
platform supplies the callable - on Fruit Jam picogame_game.setup() wires it to
picodvi Framebuffer.wait_for_vblank(), so a full repaint starts at the DVI frame
boundary and races ahead of scanout instead of tearing mid-screen. None = off
(SPI panels, sim, older firmware). Addresses the reported camera-move tearing;
pairs with the picodvi wait_for_vblank() primitive.1 parent a1d06e4 commit d43bca9
3 files changed
Lines changed: 36 additions & 0 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
425 | 439 | | |
426 | 440 | | |
427 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
| 1403 | + | |
1403 | 1404 | | |
1404 | 1405 | | |
1405 | 1406 | | |
| |||
1415 | 1416 | | |
1416 | 1417 | | |
1417 | 1418 | | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1418 | 1436 | | |
1419 | 1437 | | |
1420 | 1438 | | |
| 1439 | + | |
1421 | 1440 | | |
1422 | 1441 | | |
1423 | 1442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
0 commit comments