Widescreen: experimento 288px + fixes de crackle/overflow (Half A) - #2
Merged
Conversation
Set -DMODE1_GBA_WIDTH=288 (~16:9 at 160px tall) and render BG across the full width (MODE1_GBA_BG_CLIP_X = MODE1_GBA_WIDTH). OAM stays clipped at 240 to avoid leaking engine-parked off-screen sprites. Expected on HW: the view is visibly wider, BUT the right ~32px strip GLITCHES — the engine still fills only a 256px (32-tile) BG tilemap, so columns past ~256 wrap to the left edge. This is the visible proof of what Half B must fix: teach the engine to fill a 512px (64-tile) BG buffer (scroll.c / screenTileMap.c bake the 32-tile assumption into hard-coded constants — a pervasive change). Full clean rebuild required (DEFINES change isn't tracked by make). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ption + audio crackle) The xBRZ/hi-res path used fixed dimensions (kHiResW=960, kHiResH=640, sUpscale2xBuf=480x320 = all 240*N) while the upscaler is parameterized by srcW/srcH. At width=288 the 4x pass wrote 1152px into the 960px buffers, overflowing the heap → shredded frame (incl. the overlay) + crackling audio. Derive kHiResW/kHiResH and sUpscale2xBuf from MODE1_GBA_WIDTH/HEIGHT so they scale with the widescreen frame. Nearest/linear modes were already width-aware and rendered the 288px frame correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e SDL callback) The persistent render pool spawned 2 workers (cores 1+2); with the main thread that put all 3 Application cores on rendering, starving the SDL audio callback thread at the heavier 288px render width → crackling even on static screens. Drop to 1 worker (core 1) so core 2 stays free for audio. Costs ~no fps since the PPU render isn't the bottleneck (game logic is). xBRZ corruption already fixed; this is the remaining widescreen-build regression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-clock crackle Audio crackled/slowed at the 288px render width on a stock Switch — CPU/memory starvation (an overclock nearly removes it). The render worker threads competed with the SDL audio thread for cores 1/2. Since threading the PPU render did NOT improve fps (game logic is the bottleneck), drop to serial render (POOL_MAX_WORKERS=0) so cores 1-2 are entirely free for the audio thread, and double the audio device buffer (1024 -> 2048 samples) to ride out hiccups. TODO.md: record the analog-stick-moves-Link request and the stock-clock audio finding/mitigations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuação do PR #1. Traz os 4 commits mais novos da branch
widescreenque ainda não estão noswitch-port.Commits
9d44bf34widescreen: EXPERIMENT — render 288px wide (iteration 1)a71d1ab1widescreen: fix xBRZ buffer overflow at width>240 (corrupção da tela inteira)87e0c0b5widescreen: 1 render worker pra parar o crackle de áudio18f4900dwidescreen: render serial do PPU + buffer de áudio de 2048 samples (fix do crackle em clock padrão)Arquivos tocados (6)
platforms/switch/Makefile(-DMODE1_GBA_WIDTH=288)platforms/switch/switch_render_pool.cplatforms/switch/TODO.mdport/port_audio.cport/port_ppu.cppport/patches/switch-parallel-render.patchConflitos
Nenhum — testado localmente com
git merge-tree, faz merge limpo noswitch-port.Tela mais larga (~16:9), porém a faixa de ~32px na direita ainda bugada (a engine preenche só um fundo de 256px/32 tiles). O "Half B" — ensinar a engine a preencher 512px (64 tiles) — é o próximo passo. Áudio roda em modo serial pra não estourar em clock padrão.
Build correspondente publicado na release
switch-v0.2.3(pre-release).