Port 8bitworkshop monobitmap.c sample: UxROM mapper with CHR RAM#175
Merged
jonathanpeppers merged 4 commits intomainfrom Mar 14, 2026
Merged
Port 8bitworkshop monobitmap.c sample: UxROM mapper with CHR RAM#175jonathanpeppers merged 4 commits intomainfrom
jonathanpeppers merged 4 commits intomainfrom
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Port monobitmap.c sample from 8bitworkshop
Port 8bitworkshop monobitmap.c sample: UxROM mapper with CHR RAM
Mar 14, 2026
Copilot stopped work on behalf of
jonathanpeppers due to an error
March 14, 2026 03:21
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new monobitmap sample to the dotnes repository to demonstrate UxROM (mapper 2) with CHR RAM (NESChrBanks=0), including ROM snapshot coverage and documentation updates for the 8bitworkshop port status.
Changes:
- Add
samples/monobitmap/(Program + project settings for mapper 2 / CHR RAM). - Add transpiler snapshot coverage for
monobitmap(InlineData + verified ROM + test DLLs). - Update 8bitworkshop sample status documentation to mark
monobitmap.cas implemented (simplified).
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/dotnes.tests/TranspilerTests.cs | Adds snapshot test cases for the new monobitmap sample with mapper=2 and chrBanks=0. |
| src/dotnes.tests/TranspilerTests.Write.monobitmap.verified.bin | Adds the verified ROM output snapshot for monobitmap. |
| src/dotnes.tests/Data/monobitmap.release.dll | Adds prebuilt release test input DLL for the snapshot tests. |
| src/dotnes.tests/Data/monobitmap.debug.dll | Adds prebuilt debug test input DLL for the snapshot tests. |
| samples/monobitmap/monobitmap.csproj | New sample project configured for UxROM + CHR RAM. |
| samples/monobitmap/chr_generic.s | Placeholder CHR segment file consistent with CHR RAM builds. |
| samples/monobitmap/Program.cs | New sample program that uploads tiles to CHR RAM and draws a simple monochrome scene using VRAM ops and poke(). |
| docs/8bitworkshop-samples.md | Marks monobitmap.c as implemented (simplified) and updates summary counts. |
45c4724 to
01c89e6
Compare
The monobitmap sample had poke(PPU_CTRL, 0) and poke(PPU_MASK, 0) at startup to disable rendering during VRAM writes. However, poke(PPU_CTRL, 0) disables NMI, which causes ppu_on_all -> ppu_onoff -> ppu_wait_nmi to hang forever since NMI never fires to increment STARTUP. Fix: Remove both poke calls. Rendering is already off at startup (neslib initializes with PPU_MASK=0), so they were redundant. NMI stays enabled from the startup code, allowing ppu_wait_nmi to work correctly. Also: added peek(PPU_STATUS) before scroll writes per review feedback, added trailing newline to chr_generic.s, added monobitmap screenshot. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
01c89e6 to
674cedf
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.
Adds the
monobitmapsample demonstrating UxROM mapper (mapper 2) with CHR RAM — no transpiler changes needed, the infrastructure already supports arbitrary mapper numbers andNESChrBanks=0.Sample
Simplified port of 8bitworkshop's
monobitmap.c. Uploads custom tile patterns to CHR RAM at runtime viavram_write(), arranges them in the nametable to draw a bordered rectangle with diagonal fill, and usespoke()for direct PPU register manipulation.The original's inline assembly delay loops,
vram_read()with pointers, andabs()are not portable to dotnes — this port focuses on the core UxROM + CHR RAM + poke() demonstration.Changes
samples/monobitmap/— Program.cs, .csproj (mapper 2, chrBanks=0), chr_generic.s placeholdersrc/dotnes.tests/— Debug/release test DLLs,InlineDataentries inTranspilerTests.Write, verified ROM snapshotdocs/8bitworkshop-samples.md— monobitmap moved from 🔴 Complex → ✅ ImplementedROM verification
iNES header:
4E45531A 0200 2000— mapper 2 (UxROM), 0 CHR banks (CHR RAM), 2 PRG banks. 32,784 bytes total (16 header + 32K PRG, no CHR ROM). All 389 tests pass.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.