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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ ArcadeMatrix supports instant **Pixelcade-style** marquees while browsing menus,
1. **Menu Browsing (`0 ms` Instant Marquee)**: As you browse your game lists, the Raspberry Pi downloads official Pixelcade marquees in the background, caches them on your SD card, and displays them instantly on your LED matrix.
2. **Launching a Game (Seamless In-Game Showcase)**:
- The moment you launch a game, the **classic marquee appears immediately** (zero black screen or `"Waiting for content"` screen).
- If **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** is enabled on your network and **In-Game Showcase** is turned on, `FrontendSync` requests the game's presentation on a dedicated `{dmd_id}_sync` slot (sending both the ROM basename and console display title as `fallback_query` without disturbing Showcase rotation queues), prepares the **Animated Info Card** + **Boxart/Marquee/Screenshot Panoramas** + **Gameplay Video** in the background, and smoothly takes over the screen once ready.
- **Offline In-Game Showcase (`0 ms`, Zero Server Needed)**: If you placed an Offline Recalbox/Batocera pack generated by **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** Tab #7 into `data/showcase/<system>/<rom>.gif` (`data/showcase_tate/<system>/<rom>.gif` in TATE), `FrontendSync` decodes and plays the 24-bit `RGB888` `.gif` presentation locally with **`0` network calls** — even without a running Showcase server!
- **Live Remote Fallback**: Otherwise, if **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** is enabled on your network and **In-Game Showcase** is turned on, `FrontendSync` requests the game's presentation on a dedicated `{dmd_id}_sync` slot (sending both the ROM basename and console display title as `fallback_query` without disturbing Showcase rotation queues), prepares the **Animated Info Card** + **Boxart/Marquee/Screenshot Panoramas** + **Gameplay Video** in the background, and smoothly takes over the screen once ready.
- Configurable **Playback Cycle** while playing:
- **Alternate Marquee & Showcase** *(default)*: Alternates between the Showcase presentation and a configurable pause on the classic marquee (e.g. `45s`).
- **Play Once then Keep Marquee**: Plays the Showcase presentation once, then leaves the game's marquee on screen.
Expand Down
3 changes: 2 additions & 1 deletion README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ ArcadeMatrix es compatible con marquees instantáneos **estilo Pixelcade** al na
1. **Navegación por Menús (`0 ms` — Marquesina Instantánea)**: Mientras navegas por tus listas de juegos, la Raspberry Pi descarga las marquees oficiales de Pixelcade en segundo plano, las almacena en caché en la tarjeta SD y las muestra al instante en tu matriz LED.
2. **Al Iniciar un Juego (Showcase en Juego Fluido)**:
- En cuanto lanzas un juego, la **marquesina clásica aparece de inmediato** (sin pantalla negra ni mensaje de espera).
- Si **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** está activo en tu red local y **Showcase en Juego** está habilitado, `FrontendSync` solicita la secuencia en una ranura dedicada `{dmd_id}_sync` (enviando tanto el nombre de la ROM como el título de consola como `fallback_query`, sin alterar las colas de rotación de Showcase), prepara en segundo plano la **Ficha Informativa Animada** + **Panoramas de Carátula/Marquee/Capturas** + **Vídeo de Gameplay** y toma el relevo suavemente cuando está lista.
- **Showcase en Juego Offline (`0 ms`, Sin Servidor)**: Si colocaste un paquete Offline de Recalbox/Batocera generado desde la pestaña #7 de **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** en `data/showcase/<system>/<rom>.gif` (`data/showcase_tate/<system>/<rom>.gif` en TATE), `FrontendSync` decodifica y reproduce directamente el `.gif` `RGB888` de 24 bits en local con **`0` llamadas de red**, ¡incluso sin servidor Showcase encendido!
- **Respaldo en Vivo por Red**: En caso contrario, si **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** está activo en tu red local y **Showcase en Juego** está habilitado, `FrontendSync` solicita la secuencia en una ranura dedicada `{dmd_id}_sync` (enviando tanto el nombre de la ROM como el título de consola como `fallback_query`, sin alterar las colas de rotación de Showcase), prepara en segundo plano la **Ficha Informativa Animada** + **Panoramas de Carátula/Marquee/Capturas** + **Vídeo de Gameplay** y toma el relevo suavemente cuando está lista.
- **Ciclo de Reproducción** configurable durante la partida:
- **Alternar Marquesina y Showcase** *(por defecto)*: alterna entre la secuencia Showcase y una pausa configurable en la marquesina clásica (ej. `45s`).
- **Reproducir una vez y mantener Marquesina**: reproduce Showcase una vez y mantiene la marquesina fija del juego.
Expand Down
3 changes: 2 additions & 1 deletion README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ ArcadeMatrix prend en charge les marquees instantanés **style Pixelcade** penda
1. **Navigation dans les Menus (`0 ms` — Marquee Instantané)** : Quand vous parcourez vos listes de jeux, le Raspberry Pi télécharge les marquees officielles Pixelcade en arrière-plan, les met en cache sur votre carte SD et les affiche instantanément sur votre matrice LED.
2. **Lancement d'un Jeu (Showcase en Jeu Transparent)** :
- Dès le lancement d'un jeu, le **marquee classique s'affiche immédiatement** (aucun écran noir ni message d'attente).
- Si **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** est actif sur votre réseau et que **Showcase en Jeu** est activé, `FrontendSync` demande la séquence sur un slot dédié `{dmd_id}_sync` (en transmettant le nom de la ROM ainsi que le titre console en `fallback_query`, sans perturber les files de rotation Showcase), prépare en tâche de fond la **Fiche Info Animée** + **Panoramas Jaquette/Marquee/Screenshots** + **Vidéo de Gameplay**, et prend la main en douceur dès qu'elle est prête.
- **Showcase en Jeu Offline (`0 ms`, Sans Serveur)** : Si vous avez déposé un pack Offline Recalbox/Batocera généré depuis l'onglet #7 de **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** dans `data/showcase/<system>/<rom>.gif` (`data/showcase_tate/<system>/<rom>.gif` en TATE), `FrontendSync` décode et lit directement le `.gif` `RGB888` 24 bits en local avec **`0` appel réseau** — même sans serveur Showcase actif !
- **Repli Serveur Live** : Sinon, si **[dmd_media_showcase](https://github.com/red77290/dmd_media_showcase)** est actif sur votre réseau et que **Showcase en Jeu** est activé, `FrontendSync` demande la séquence sur un slot dédié `{dmd_id}_sync` (en transmettant le nom de la ROM ainsi que le titre console en `fallback_query`, sans perturber les files de rotation Showcase), prépare en tâche de fond la **Fiche Info Animée** + **Panoramas Jaquette/Marquee/Screenshots** + **Vidéo de Gameplay**, et prend la main en douceur dès qu'elle est prête.
- Choix du **Cycle d'Affichage** pendant la partie :
- **Alterner Marquee & Showcase** *(par défaut)* : alterne entre la présentation Showcase et une pause configurable sur le marquee classique (ex. `45s`).
- **Lire une fois puis garder le Marquee** : joue la séquence Showcase une fois, puis laisse le marquee du jeu affiché.
Expand Down
24 changes: 24 additions & 0 deletions api/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,30 @@ <h3 data-i18n="hw_matrix_title">Matrix Hardware Configuration</h3>
</div>
</div>
</div>
<div class="form-grid col-2" style="margin-top: 1rem;">
<div class="form-group">
<label><span data-i18n="hw_pixel_mapper">Pixel Mapper (Multi-Panel)</span> <span class="tooltip-icon" data-i18n-tooltip="tt_hw_pixel_mapper">?</span></label>
<input type="text" id="hw-pixel-mapper" list="hw-pixel-mapper-presets" class="input" value="" placeholder="None (e.g. U-mapper)" data-i18n-placeholder="ph_hw_pixel_mapper">
<datalist id="hw-pixel-mapper-presets">
<option value="U-mapper"></option>
<option value="V-mapper"></option>
<option value="V-mapper:Z"></option>
<option value="U-mapper;Rotate:180"></option>
<option value="Mirror:H"></option>
<option value="Mirror:V"></option>
</datalist>
</div>
<div class="form-group">
<label><span data-i18n="hw_ui_scale">UI Integer Scale (Giant LED Walls)</span> <span class="tooltip-icon" data-i18n-tooltip="tt_hw_ui_scale">?</span></label>
<select id="hw-ui-scale" class="input">
<option value="auto" data-i18n="hw_ui_scale_auto" selected>✨ Auto (1x up to 256x64, 2x–4x on Giant Walls)</option>
<option value="1" data-i18n="hw_ui_scale_1x">1x — Native Pixel-Perfect (No Upscaling)</option>
<option value="2" data-i18n="hw_ui_scale_2x">2x — Nearest-Neighbor (256x192 → 128x96)</option>
<option value="3" data-i18n="hw_ui_scale_3x">3x — Nearest-Neighbor (384x288 → 128x96)</option>
<option value="4" data-i18n="hw_ui_scale_4x">4x — Nearest-Neighbor (512x384 → 128x96)</option>
</select>
</div>
</div>
<div class="form-grid col-1" style="margin-top: 1rem;">
<div class="form-group">
<label><span data-i18n="hw_pipeline_label">Rendering & Buffering Pipeline</span> <span class="tooltip-icon tooltip-lg" data-tooltip="Choose buffering strategy. Canvas Single + Dirty Draw is recommended for Wi-Fi stability.">?</span></label>
Expand Down
13 changes: 11 additions & 2 deletions api/www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,9 @@ async function initSettings() {
setVal('hw-pwm-lsb', matrix.pwm_lsb_nanoseconds ?? 130);
setVal('hw-limit-refresh', matrix.limit_refresh_rate_hz ?? 0);
setChk('hw-disable-pulsing', matrix.disable_hardware_pulsing ?? false);
setVal('hw-pixel-mapper', matrix.pixel_mapper || '');
const normUiScale = String(matrix.ui_scale ?? 'auto').trim().toLowerCase().replace(/x$/, '');
setVal('hw-ui-scale', ['1', '2', '3', '4'].includes(normUiScale) ? normUiScale : 'auto');
setVal('hw-render-pipeline', matrix.render_pipeline || 'canvas_single');

// MQTT (nested mqtt.*)
Expand Down Expand Up @@ -1520,6 +1523,7 @@ async function initSettings() {
parallel: numOr('hw-parallel', 1),
driver_chip: document.getElementById('hw-driver-chip')?.value || 'SHIFTREG',
mapping: document.getElementById('hw-mapping')?.value || 'regular',
pixel_mapper: (document.getElementById('hw-pixel-mapper')?.value || '').trim(),
rgb_sequence: document.getElementById('hw-rgb')?.value || 'RGB',
row_address_mode: numOr('hw-row-addr-type', 0),
multiplexing: numOr('hw-multiplexing', 0),
Expand All @@ -1529,13 +1533,18 @@ async function initSettings() {
limit_refresh_rate_hz: numOr('hw-limit-refresh', 0),
disable_hardware_pulsing: document.getElementById('hw-disable-pulsing')?.checked || false,
render_pipeline: document.getElementById('hw-render-pipeline')?.value || 'canvas_single',
ui_scale: document.getElementById('hw-ui-scale')?.value || 'auto',
};

try {
await API.post('/api/system', { matrix });
const res = await API.post('/api/system', { matrix });
if (window.__sysConfig) window.__sysConfig.matrix = matrix;
window.invalidateCachedEndpoint?.('/api/themes');
window.showToast('Hardware settings saved! The panel will restart to apply physical bus changes.', 'success');
if (res && res.status === 'rebooting') {
window.showToast('Hardware settings saved! The panel will restart to apply physical bus changes.', 'success');
} else {
window.showToast('Display settings saved and applied live!', 'success');
}
} catch (e) {
window.showToast('Failed to save HW settings', 'error');
}
Expand Down
30 changes: 30 additions & 0 deletions api/www/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,16 @@ export const translations = {
hw_pipeline_canvas_double: "🚀 Canvas + Double Buffer (Max Smoothness)",
hw_pipeline_direct_double: "⚙️ Direct Double Buffer (No Canvas)",
hw_pipeline_direct_single: "🪶 Direct Single Buffer (Ultra-Low RAM)",
hw_pixel_mapper: "Pixel Mapper (Multi-Panel)",
ph_hw_pixel_mapper: "None (e.g. U-mapper)",
tt_hw_pixel_mapper: "Optional hzeller pixel-mapper chain for folded multi-panel walls (e.g. 'U-mapper', 'V-mapper', 'V-mapper:Z', 'U-mapper;Rotate:180'). Leave empty for a linear chain.",
hw_ui_scale: "UI Integer Scale (Giant Walls)",
tt_hw_ui_scale: "Auto keeps 1x on all standard YOKO/TATE panels (64x32 to 256x64) and applies 2x/3x/4x Nearest-Neighbor upscaling on giant walls (256x192, 512x384), while keeping GIFs and Showcase videos/panoramas at native 1x.",
hw_ui_scale_auto: "✨ Auto (1x up to 256x64, 2x–4x on Giant Walls)",
hw_ui_scale_1x: "1x — Native Pixel-Perfect (No Upscaling)",
hw_ui_scale_2x: "2x — Nearest-Neighbor (256x192 → 128x96)",
hw_ui_scale_3x: "3x — Nearest-Neighbor (384x288 → 128x96)",
hw_ui_scale_4x: "4x — Nearest-Neighbor (512x384 → 128x96)",
hw_trans_vortex: "✨ Particle Vortex",
hw_trans_glitch: "⚡ Cyberpunk Glitch",
hw_trans_slide: "💫 Smooth Slide",
Expand Down Expand Up @@ -1381,6 +1391,16 @@ export const translations = {
hw_pipeline_canvas_double: "🚀 Canevas + Double Buffer (Fluidité maximale)",
hw_pipeline_direct_double: "⚙️ Double Buffer Direct (Sans canevas)",
hw_pipeline_direct_single: "🪶 Simple Buffer Direct (RAM ultra-basse)",
hw_pixel_mapper: "Pixel Mapper (Multi-Panneaux)",
ph_hw_pixel_mapper: "Aucun (ex. U-mapper)",
tt_hw_pixel_mapper: "Chaîne pixel-mapper hzeller optionnelle pour murs multi-panneaux repliés (ex. 'U-mapper', 'V-mapper', 'V-mapper:Z', 'U-mapper;Rotate:180'). Laisser vide pour une chaîne linéaire.",
hw_ui_scale: "Échelle Entière UI (Murs Géants)",
tt_hw_ui_scale: "Auto conserve 1x sur toutes les dalles YOKO/TATE standard (64x32 à 256x64) et active l'upscaling entier Nearest-Neighbor 2x/3x/4x sur les très grands murs (256x192, 512x384), tout en gardant les GIFs et vidéos/panoramas Showcase en 1x natif.",
hw_ui_scale_auto: "✨ Auto (1x jusqu'à 256x64, 2x–4x sur Murs Géants)",
hw_ui_scale_1x: "1x — Natif Pixel-Perfect (Sans Upscaling)",
hw_ui_scale_2x: "2x — Nearest-Neighbor (256x192 → 128x96)",
hw_ui_scale_3x: "3x — Nearest-Neighbor (384x288 → 128x96)",
hw_ui_scale_4x: "4x — Nearest-Neighbor (512x384 → 128x96)",
hw_trans_vortex: "✨ Vortex de Particules",
hw_trans_glitch: "⚡ Glitch Cyberpunk",
hw_trans_slide: "💫 Glissement Fluide",
Expand Down Expand Up @@ -2356,6 +2376,16 @@ export const translations = {
hw_pipeline_canvas_double: "🚀 Lienzo + Doble Buffer (Máxima fluidez)",
hw_pipeline_direct_double: "⚙️ Doble Buffer Directo (Sin lienzo)",
hw_pipeline_direct_single: "🪶 Buffer Simple Directo (RAM ultra-baja)",
hw_pixel_mapper: "Pixel Mapper (Multi-Panel)",
ph_hw_pixel_mapper: "Ninguno (ej. U-mapper)",
tt_hw_pixel_mapper: "Cadena opcional pixel-mapper de hzeller para muros multipanel plegados (ej. 'U-mapper', 'V-mapper', 'V-mapper:Z', 'U-mapper;Rotate:180'). Dejar vacío para cadena lineal.",
hw_ui_scale: "Escala Entera UI (Muros Gigantes)",
tt_hw_ui_scale: "Auto mantiene 1x en todos los paneles YOKO/TATE estándar (64x32 a 256x64) y aplica escalado entero Nearest-Neighbor 2x/3x/4x en muros gigantes (256x192, 512x384), manteniendo los GIFs y vídeos/panoramas de Showcase en 1x nativo.",
hw_ui_scale_auto: "✨ Auto (1x hasta 256x64, 2x–4x en Muros Gigantes)",
hw_ui_scale_1x: "1x — Nativo Pixel-Perfect (Sin Escalado)",
hw_ui_scale_2x: "2x — Nearest-Neighbor (256x192 → 128x96)",
hw_ui_scale_3x: "3x — Nearest-Neighbor (384x288 → 128x96)",
hw_ui_scale_4x: "4x — Nearest-Neighbor (512x384 → 128x96)",
hw_trans_vortex: "✨ Vórtice de Partículas",
hw_trans_glitch: "⚡ Glitch Cyberpunk",
hw_trans_slide: "💫 Deslizamiento Suave",
Expand Down
4 changes: 3 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"pwm_lsb_nanoseconds": 130,
"disable_hardware_pulsing": false,
"mapping": "regular",
"pixel_mapper": "",
"rotation": 0,
"transition_effect": "vortex",
"transition_duration_ms": 400,
"slot_transition": "none",
"slot_transition_duration_ms": 500,
"render_pipeline": "canvas_single"
"render_pipeline": "canvas_single",
"ui_scale": "auto"
},
"wifi": {
"ssid": "",
Expand Down
14 changes: 14 additions & 0 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,14 @@ pub trait IDrawingSurface: Send + Sync {
fn height(&self) -> u32;
fn physical_width(&self) -> u32;
fn physical_height(&self) -> u32;
fn native_width(&self) -> u32 { self.width() }
fn native_height(&self) -> u32 { self.height() }
fn ui_scale(&self) -> u32 { 1 }
fn set_ui_scale(&mut self, _scale: u32) {}
fn set_rotation(&mut self, rotation: u8);
fn rotation(&self) -> u8;
fn set_pixel(&mut self, x: i32, y: i32, red: u8, green: u8, blue: u8);
fn fill_rect(&mut self, x: i32, y: i32, w: i32, h: i32, red: u8, green: u8, blue: u8);
fn clear(&mut self);
fn present(&mut self);
fn set_brightness(&mut self, brightness: u8);
Expand All @@ -664,6 +669,7 @@ pub trait IDrawingSurface: Send + Sync {
fn draw_image(&mut self, img: &RgbImage, offset_x: i32, offset_y: i32);
fn blit565(&mut self, src: &[u16], x: i32, y: i32, w: u32, h: u32, stride_pixels: Option<usize>);
fn acquire_canvas(&mut self) -> Option<CanvasView<'_>>;
fn unscaled(&mut self) -> &mut dyn IDrawingSurface;
}
```

Expand All @@ -687,6 +693,14 @@ Under `canvas_single`, the `DirtyBounds` tracker monitors which scanlines have a
2. `present()` completes in $O(1)$ without calling the C FFI or writing to the physical LED matrix memory.
3. The Broadcom memory bus and CPU remain completely free for Wi-Fi, MQTT, and HTTP traffic.

### 13.3 Multi-Panel Pixel Mapping (`pixel_mapper`) & Integer UI Upscaling (`ScaledDrawingSurface`)

- **Hardware Pixel Mapper (`matrix.pixel_mapper`)**: Forwarded to hzeller `LedMatrixOptions::set_pixel_mapper_config` (e.g. `"U-mapper"`, `"V-mapper"`, `"U-mapper;Rotate:180"`), allowing multi-panel HUB75 chains to fold into tall multi-row physical walls (such as `256×192` or `512×384`). Off-hardware surfaces (`MockSurface`, E2E inspection, and API layout previews) compute identical folded physical dimensions via `MatrixConfig::effective_physical_dimensions()`.
- **Zero-Allocation `ScaledDrawingSurface` (`matrix.ui_scale`)**: Wraps the hardware or mock `IDrawingSurface` transparently with zero heap allocations on the H-Core hot path:
- In `"auto"` mode (default), `UiScale::resolve` returns **`1x`** strictly across all standard and TATE resolutions (`64×32`, `32×64`, `64×64`, `128×32`, `32×128`, `128×64`, `64×128`, `256×64`, `64×256`), acting as a pure 1:1 passthrough (preserving `acquire_canvas()` and `DirtyBounds` untouched).
- Only when `min(width, height) >= 128` and `max(width, height) >= 192` does `"auto"` engage `2x`/`3x`/`4x` Nearest-Neighbor integer block expansion (`256×192` → `2x` `128×96`, `512×384` → `4x` `128×96`), expanding each logical pixel into an exact `N×N` sharp LED block while propagating exact scanline `DirtyBounds` to the inner surface.
- Full-screen media streams (`gifs`, plus `DMD Media Showcase` Phase 2 `LiveStream` video/panoramas and `FrontendSync` `ShowcaseStream`) bypass UI scaling via `surface.unscaled()` (`native_width()` × `native_height()`), while UI engines and Showcase Phase 1 Intro Cards render crisply on the upscaled logical grid.

---

## 14. Runtime Isolation & Threading Model
Expand Down
Loading
Loading