Skip to content

Fix NES PPU VRAM rendering corruption in ui_nes.c - #11

Merged
ClausValcaTD merged 3 commits into
mainfrom
fix/nes-ppu-vram-rendering-corruption-11923287775186962025
Oct 21, 2026
Merged

ClausValcaTD merged 3 commits into
mainfrom
fix/nes-ppu-vram-rendering-corruption-11923287775186962025

Conversation

@ClausValcaTD

Copy link
Copy Markdown
Collaborator

Refactor targets/nes/src/ui_nes.c to draw the static UI layout and grid once during ui_init() with screen rendering disabled (PPU_MASK = 0x00). Replace sprintf/strcat standard library calls with lightweight custom formatting routines (hex_char, get_note_name, format_status_str, format_row_str) and limit VRAM writes in ui_render() to at most one updated line slice (<= 28 bytes) per frame immediately following VBlank wait. Always conclude VRAM writes by resetting PPU_STATUS and PPU_SCROLL registers to zero.


PR created automatically by Jules for task 11923287775186962025 started by @ClausValcaTD

Refactor targets/nes/src/ui_nes.c to draw the static layout once during ui_init() while PPU_MASK = 0x00 (rendering disabled). Replace heavy sprintf/strcat standard library calls with lightweight non-allocating string formatters (hex_char, get_note_name, format_status_str, format_row_str) and limit VRAM writes in ui_render() during VBlank to a single updated string slice (<= 28 bytes per frame). Finish VRAM transfers by resetting PPU_STATUS and PPU_SCROLL to 0.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 2 commits October 21, 2026 15:54
… object files

Refactor targets/nes/src/ui_nes.c to draw the static layout once during ui_init() while PPU_MASK = 0x00 (rendering disabled). Replace heavy sprintf/strcat standard library calls with lightweight non-allocating string formatters (hex_char, get_note_name, format_status_str, format_row_str) and limit VRAM writes in ui_render() during VBlank to a single updated string slice (<= 28 bytes per frame). Finish VRAM transfers by resetting PPU_STATUS and PPU_SCROLL to 0. Remove accidentally tracked build artifacts in targets/genesis/src/ that caused CI compilation failures.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
Refactor targets/nes/src/ui_nes.c to draw the static layout once during ui_init() while PPU_MASK = 0x00 (rendering disabled). Replace heavy sprintf/strcat standard library calls with lightweight non-allocating string formatters (hex_char, get_note_name, format_status_str, format_row_str) and limit VRAM writes in ui_render() during VBlank to a single updated string slice (<= 28 bytes per frame). Finish VRAM transfers by resetting PPU_STATUS and PPU_SCROLL to 0. Add .gitignore so build outputs and copied sources are excluded from tracking.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
@ClausValcaTD
ClausValcaTD merged commit edd3d43 into main Oct 21, 2026
3 checks passed
@ClausValcaTD
ClausValcaTD deleted the fix/nes-ppu-vram-rendering-corruption-11923287775186962025 branch October 21, 2026 16:29
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