Adopt fade_in / fade_out helpers in samples#543
Conversation
Agent-Logs-Url: https://github.com/jonathanpeppers/dotnes/sessions/d90c1440-7299-4c20-96d4-9a811a163ac6 Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates several samples to exercise the fade_in(byte delay) / fade_out(byte delay) NESLib helpers (added in #450) by replacing immediate brightness setup with a dark start plus a fade once rendering is enabled, and adding a fade-out at the climber end-of-run transition.
Changes:
- slideshow: Start at
pal_bright(0)and callfade_in(4)afterppu_on_all()to fade up the title screen. - scoreboard: Replace
pal_bright(4)withpal_bright(0)+fade_in(4)afterppu_on_all(). - climber: End
setup_graphics()atpal_bright(0),fade_in(4)after the stage is drawn, andfade_out(4)when reaching the top floor; test DLLs/snapshots refreshed for the affected samples.
Reviewed changes
Copilot reviewed 3 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/slideshow/Program.cs | Fade in from black after enabling rendering to demonstrate fade_in(4). |
| samples/scoreboard/Program.cs | Start dark and fade in after ppu_on_all() using fade_in(4). |
| samples/climber/Program.cs | Start dark in graphics setup; fade in after world draw; fade out on run completion. |
| src/dotnes.tests/Data/slideshow.debug.dll | Rebuilt test input assembly for updated slideshow sample (Debug). |
| src/dotnes.tests/Data/slideshow.release.dll | Rebuilt test input assembly for updated slideshow sample (Release). |
| src/dotnes.tests/Data/scoreboard.debug.dll | Rebuilt test input assembly for updated scoreboard sample (Debug). |
| src/dotnes.tests/Data/scoreboard.release.dll | Rebuilt test input assembly for updated scoreboard sample (Release). |
| src/dotnes.tests/Data/climber.debug.dll | Rebuilt test input assembly for updated climber sample (Debug). |
| src/dotnes.tests/Data/climber.release.dll | Rebuilt test input assembly for updated climber sample (Release). |
| src/dotnes.tests/TranspilerTests.Write.slideshow.verified.bin | Updated verified ROM snapshot for slideshow due to fade-in behavior change. |
| src/dotnes.tests/TranspilerTests.Write.scoreboard.verified.bin | Updated verified ROM snapshot for scoreboard due to fade-in behavior change. |
| src/dotnes.tests/TranspilerTests.Write.climber.verified.bin | Updated verified ROM snapshot for climber due to fade-in/out behavior change. |
| Sets the iNES header to mapper 3 with 2 CHR banks (16 KB total). | ||
| Pressing A on the controller toggles between CHR bank 0 and CHR bank 1, | ||
| showing different tile graphics on screen. | ||
| Also uses fade_in() to smoothly fade in the title screen. |
| /* | ||
| Scoreboard - press A to increment BCD score. | ||
| Demonstrates vrambuf_put(), pad_trigger(), ppu_wait_nmi(). | ||
| Demonstrates vrambuf_put(), pad_trigger(), ppu_wait_nmi(), and fade_in(). |
| bank_bg(0); | ||
| vrambuf_clear(); | ||
| set_vram_update(updbuf); | ||
| // Start dark; the main flow calls fade_in() once the world is drawn. |
Address code review feedback to use fade_in(4) instead of fade_in() in header comments, since the helper API takes a delay parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Closing — after review, this PR was adding
The only samples with the manual |
The 0.3.1-beta
fade_in()/fade_out()helpers (#450) weren't exercised by any sample. Adopt them in the samples called out by the issue, where appropriate.Sample changes
pal_bright(0)andfade_in(4)afterppu_on_all()so the CNROM title fades up.pal_bright(4)forpal_bright(0)+fade_in(4)afterppu_on_all().setup_graphics()now ends atpal_bright(0); main flow callsfade_in(4)once the level is drawn andfade_out(4)when the player reaches the top floor. The per-frame hit-flash (pal_bright(vbright)decrementing from 8 → 4) is left alone — it's a flash, not a fade ramp.Already done, no change
fade_in(4)/fade_out(4). Thebg_fade_in/spr_fade_inhelpers ramppal_bg_bright/pal_spr_bright, for which there is no built-in equivalent, so they stay.pal_bright(0)+fade_in(4)pattern.Example (scoreboard)
Test data
Rebuilt the three changed samples (Debug + Release), refreshed the embedded
src/dotnes.tests/Data/*.{debug,release}.dll, and regenerated the correspondingTranspilerTests.Write.*.verified.binsnapshots.