From beb37839bdc7850fc0cef733a94458214c927fac Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Sun, 18 Oct 2026 18:56:54 -0500 Subject: [PATCH] video: allocate the video tile before the BSP The 64 KB conversion tile needs one contiguous block of internal RAM. It was allocated in initialize_video(), after the BSP had set up the display, audio DMA and USB; with espp #738's rotation tile (16-32 KB of internal RAM in the BSP) no 64 KB block was left and the tile fell back to PSRAM, slowing every game's video path. initialize_tab5() now allocates it first. Co-Authored-By: Claude Opus 5.5 (1M context) --- components/tab5-emu/src/tab5-emu.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/tab5-emu/src/tab5-emu.cpp b/components/tab5-emu/src/tab5-emu.cpp index 2ca6a8f..91d5714 100644 --- a/components/tab5-emu/src/tab5-emu.cpp +++ b/components/tab5-emu/src/tab5-emu.cpp @@ -47,6 +47,9 @@ Tab5Emu::Tab5Emu() ///////////////////////////////////////////////////////////////////////////// bool Tab5Emu::initialize_tab5() { + // the video tile first: it needs one 64 KB block of internal RAM, which the + // BSP's own allocations (its rotation tile, audio DMA) can otherwise split + ensure_tile_buffer(); auto &bsp = Bsp::get(); if (!bsp.initialize_io_expanders()) { logger_.error("Failed to initialize IO expanders"); @@ -526,9 +529,10 @@ bool Tab5Emu::initialize_video() { logger_.error("Could not register a PPA client: {}", esp_err_to_name(err)); return false; } - // the conversion tile (internal RAM) is allocated now, before the GUI - // fragments the internal heap, and kept for the life of the app: every - // cart needs it and the cores' own hot data lives in PSRAM + // the conversion tile (internal RAM), normally already allocated at the top + // of initialize_tab5(), before the BSP and the GUI fragment the internal + // heap, and kept for the life of the app: every cart needs it and the + // cores' own hot data lives in PSRAM if (!ensure_tile_buffer()) { return false; }