Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new sprites sample (based on the 8bitworkshop sprites.c demo) to the dotnes repo, and wires it into the existing snapshot-based transpiler test suite and sample documentation.
Changes:
- Adds
samples/sprites(C# implementation + CHR data + csproj) and registers it insamples/samples.sln. - Adds new test inputs (
sprites.debug.dll/sprites.release.dll) and a new verified ROM snapshot forTranspilerTests.Write.sprites. - Updates
docs/8bitworkshop-samples.mdto marksprites.cas implemented.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dotnes.tests/TranspilerTests.cs | Adds sprites to the snapshot test matrix (debug + release). |
| src/dotnes.tests/TranspilerTests.Write.sprites.verified.bin | New expected ROM output snapshot for the sprites sample. |
| src/dotnes.tests/Data/sprites.release.dll | New release-mode test input DLL for transpilation. |
| src/dotnes.tests/Data/sprites.debug.dll | New debug-mode test input DLL for transpilation. |
| samples/sprites/sprites.csproj | New sample project definition for sprites. |
| samples/sprites/sprites.c | Reference C source for the original demo being ported. |
| samples/sprites/chr_generic.s | CHR ROM data used by the sample. |
| samples/sprites/Program.cs | C# top-level program implementing the sprites sample behavior. |
| samples/samples.sln | Registers the new sprites sample project in the samples solution. |
| docs/8bitworkshop-samples.md | Moves sprites.c into “Already Implemented” and documents required APIs. |
35aff7a to
b343927
Compare
Implements the 8bitworkshop sprites.c demo using oam_spr to animate 32 individual hardware sprites with random positions and velocities. Reduced from 64 to 32 actors due to NES zero-page memory limits. Uses: pal_all, oam_clear, oam_spr (5 params with return value), oam_hide_rest, ppu_on_all, ppu_wait_frame, rand8(). Fix oam_spr to always use decsp4 argument passing pattern, which correctly handles runtime args from array elements (ldelem_u1) and locals (ldloc_s). The IL arg scanner now recognizes Ldloc_s and Ldelem_u1 (array + index pair) in addition to Ldloc_0..3 and Ldc. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b343927 to
5fae051
Compare
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.
Summary
Implements the 8bitworkshop sprites.c demo - 32 hardware sprites bouncing around the screen with random velocities.
Reduced from 64 to 32 actors because 4 arrays x 64 bytes = 256 bytes exceeds the NES zero-page local memory available.
APIs used
pal_all, oam_clear, oam_spr (5 params with return value), oam_hide_rest, ppu_on_all, ppu_wait_frame, rand8().
All patterns already supported - no transpiler changes needed.
Testing
All 168 tests pass (166 existing + 2 new).