Skip to content

Add tileset1 sample with custom CHR ROM tileset#85

Merged
jonathanpeppers merged 2 commits intomainfrom
tileset1
Feb 14, 2026
Merged

Add tileset1 sample with custom CHR ROM tileset#85
jonathanpeppers merged 2 commits intomainfrom
tileset1

Conversation

@jonathanpeppers
Copy link
Owner

  • Custom CHR tileset from 8bitworkshop's tileset1.c preset
  • Font data padded to ASCII positions (tile 0x41 = 'A', etc.)
  • Uses pal_bg, vram_adr, vram_write, ppu_on_all
  • Added chr_tileset1.s for per-sample CHR ROM in tests
  • Python script to generate CHR from tileset data
  • All 166 tests passing

jonathanpeppers and others added 2 commits February 14, 2026 16:02
- Custom CHR tileset from 8bitworkshop's tileset1.c preset
- Font data padded to ASCII positions (tile 0x41 = 'A', etc.)
- Uses pal_bg, vram_adr, vram_write, ppu_on_all
- Added chr_tileset1.s for per-sample CHR ROM in tests
- Python script to generate CHR from tileset data
- All 166 tests passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 14, 2026 22:06
@jonathanpeppers jonathanpeppers merged commit fa0f3e7 into main Feb 14, 2026
5 checks passed
@jonathanpeppers jonathanpeppers deleted the tileset1 branch February 14, 2026 22:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new "tileset1" sample demonstrating custom CHR ROM tileset usage, based on 8bitworkshop's tileset1.c preset. The implementation replaces the original's CHR RAM approach with CHR ROM, padding the tileset so ASCII character codes map directly to tile indices (tiles 0x00-0x1F are blank, 0x20+ contain the font).

Changes:

  • New tileset1 sample using pal_bg, vram_adr, vram_write, and ppu_on_all NES APIs
  • Custom CHR ROM tileset with 8KB padding and ASCII-aligned character data
  • Python script (gen_chr_tileset1.py) to generate CHR .s files from tileset hex data
  • Test coverage for both debug and release builds with per-sample chr_tileset1.s file
  • Documentation updates showing tileset1 moved from "Feasible" to "Already Implemented" status

Reviewed changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
samples/tileset1/Program.cs Main C# sample code displaying text with custom tileset
samples/tileset1/tileset1.csproj Sample project configuration
samples/tileset1/tileset1.c Reference C code for comparison (has issues)
samples/tileset1/chr_generic.s Custom 8KB CHR ROM data (1025 lines)
scripts/gen_chr_tileset1.py Python script generating CHR .s files from hex data
src/dotnes.tests/TranspilerTests.cs Added test cases for tileset1 debug/release
src/dotnes.tests/TranspilerTests.Write.tileset1.verified.bin Verified ROM output (binary)
src/dotnes.tests/Data/tileset1.debug.dll Debug build test DLL
src/dotnes.tests/Data/tileset1.release.dll Release build test DLL
src/dotnes.tests/Data/chr_tileset1.s Per-sample CHR data for tests
samples/samples.sln Added tileset1 project to solution
docs/8bitworkshop-samples.md Updated documentation marking tileset1 as implemented
tileset1.nes Sample ROM output (root directory, should be in samples/tileset1/)

void main(void)
{
// set palette colors (from tileset1.c palSprites)
pal_bg(palSprites);
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference to 'palSprites' is undefined. The palette data should be defined as a byte array (e.g., const unsigned char palSprites[] = {...}) to match the usage in the C# Program.cs where it's defined as byte[] palette. This reference file won't compile as-is on 8bitworkshop.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +8
// Include the tileset data
#include "tileset1.c"
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The include directive on line 8 is recursive - it includes the file itself. This should probably include a separate header file with the tileset data (e.g., "tileset1_data.c" or similar), or remove this include entirely if the palette data is supposed to be defined elsewhere. As written, this would cause a compilation error.

Suggested change
// Include the tileset data
#include "tileset1.c"
// Tileset / palette data is defined elsewhere (e.g., in CHR ROM or another module)
extern const unsigned char palSprites[];

Copilot uses AI. Check for mistakes.
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