Skip to content

feat(layouts): proportional 4:3 CRT aspect-ratio layouts (128x96 & multiples) - #44

Merged
red77290 merged 3 commits into
mainfrom
feat/aspect-ratio-4x3-layouts
Dec 5, 2026
Merged

red77290 merged 3 commits into
mainfrom
feat/aspect-ratio-4x3-layouts

Conversation

@red77290

@red77290 red77290 commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Upgrades all engines and animated clocks so the entire 4:3 CRT landscape aspect-ratio family (128x96 and all its multiples: 64x48, 96x72, 128x96, 192x144, 256x192, 384x288, 512x384, both via ui_scale = "auto" and manual 1x..4x) renders proportionally across the full horizontal and vertical canvas — with zero pixel impact on 128x32, 256x64, 192x32, 128x64, 64x64, or TATE portrait displays.

Highlights

  • Strict 4:3 Family Isolation (DisplayGeometry::is_landscape_4x3_family): width > height && height * 2 > width (1.0 < w / h < 2.0) isolates 4:3 landscapes cleanly from all 1:1 squares, >= 2:1 widescreens (64x32, 128x64, 128x32, 192x64, 256x64, 192x32, 256x32, 384x64), and TATE portrait sizes.
  • Weather (weather_page.rs): 3-band 4:3 CRT Weather Card (top centered header, middle 2x*s weather icon + stacked right-aligned temperatures, bottom centered condition footer, scaled by s = (h / 96).max(1)).
  • SysInfo (sysinfo.rs): Full-height proportional telemetry layouts across all 3 themes (Theme 0 4 full-width stacked HUD gauge bands, Theme 1 Cyberpunk Neon centered 2x2 + twin vertical meters, Theme 2 centered 2x2 quadrants) with integer-scaled bitmap typography (draw_bitmap_string_scaled).
  • Fighter Overlay (fighter.rs): Uses a head-safe shared ground line ground_y_screen = (matrix_height - 1).max((2 + tallest) * scale) via compute_pair_placement — sprites that fit vertically stand on the bottom edge instead of floating mid-air, while tall sprites exceeding the vertical resolution (e.g. Gouki 108px on 128x96, or fighters_64 on 96x72) keep their head pinned 2 * scale px below the top (preserving walk-bob headroom) and set an imaginary off-screen ground line shared by both fighters so overflow crops cleanly at the legs/ankles.
  • Crypto & Stock (crypto.rs, stock.rs): Full-width Top-Quote + Bottom-Sparkline split terminal layout on 4:3 panels (s = (h / 96).max(1)).
  • Spotify & Google Cast (spotify.rs, google_cast.rs): Proportional cover art (58% of h, clamped to 44% of w), balanced vertical text spacing (18%, 38%, 56% album/app line), and scaled equalizer/progress bar.
  • Dashboard (dashboard/mod.rs): 3-band 4:3 Cockpit Grid (top square analog/digital clock + weather, middle split World Clocks + SysInfo, bottom full-width Market Ticker).
  • Animated Clocks & Wide Theme Unlock (theme.rs + src/engines/clocks/*):
    • Unlocks wide themes 32 (Pocket Index), 33 (World Clock), 37 (Words Clock), and 41 (Metal Slug Clock) on 4:3 panels >= 96x72.
    • Fixes ground Y anchoring on tall landscapes (h >= 48) in CastleClock ((h - 16 - 30)) and SonicClock ((h - 16 - 39)), balances upper/middle sky bands in MarioClock and MegaManClock, adds crimson Pokédex bezels & scaled wing emblems in PokedexClock, adds integer-scaled framed WorldMapClock, auto-fitting WordsClock, and a non-overlapping Neo-Geo HUD bar in MetalSlugClock.
  • Showcase Card, GNews & Agenda (media_showcase.rs, gnews.rs, agenda.rs): Proportional 4:3 poster/card spacing, dynamic static_paged row count in GNews (8 lines on 128x96), and up to 8 agenda rows on tall 4:3 canvases.

Verification

  • test_base_128x32_and_256x64_bit_exact_zero_regression: 34/34 bit-exact FNV-1a framebuffer hashes unchanged on 128x32 and 256x64.
  • test_fighter_4x3_head_safe_overflow_vs_floor_anchor: Verifies floor-anchoring for fitting sprites (Chun-Li 57px, Haohmaru 63px), 2 * scale walk-bob-safe imaginary off-screen ground line for tall sprites (Gouki 108px, Bison 104px) across 96x72, 128x96, and 256x192, and strict zero-regression on 128x32 and 256x64.
  • test_4x3_aspect_ratio_and_multiples_coverage & weather_4x3_crt_multiples_vertical_distribution: Verified across 64x48, 96x72, 128x96, 192x144, 256x192, 384x288, 512x384.
  • Full cargo clippy -- -D warnings, cargo test, validate_docs.py, and validate_rpi_release.py passing (0 warnings, 0 errors).

@red77290
red77290 merged commit b6c8fc1 into main Dec 5, 2026
2 checks passed
@red77290
red77290 deleted the feat/aspect-ratio-4x3-layouts branch December 5, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant