No description
- Pascal 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| builds | ||
| .gitignore | ||
| about.jpg | ||
| about.rc | ||
| about.res | ||
| AGENTS.md | ||
| downloader.pas | ||
| exporter.md | ||
| icon.ico | ||
| LICENSE | ||
| main | ||
| main.ico | ||
| main.lpi | ||
| main.lpr | ||
| main.manifest | ||
| main.rc | ||
| main_window.lfm | ||
| main_window.pas | ||
| project.p1x | ||
| README.md | ||
| wizard.pas | ||
P1Xel Editor
Desktop tile editor and toolchain for Game Boy development, built with Lazarus/Free Pascal.
Features
- Tile Editor — 8x8 pixel art editor with draw, fill, and line tools
- Font Editor — manage character glyphs mapped to Game Boy VRAM tiles
- Screen Designer — place tiles, sprites, and text on 32x32 map grids
- VRAM Tile Viewer — browse the 384-tile VRAM layout (sprites, font, background)
- CHR Export — export 6144-byte 2bpp tileset files (384 tiles)
- TLM Export — export 1024-byte tilemap files with signed $8800 BG addressing
- OAM Export — export 160-byte sprite attribute tables
- RGBDS Integration — build ROMs directly (rgbasm + rgblink + rgbfix)
- BGB Emulator Launch — run and watch ROMs in BGB
- ROM Statistics — inspect GB ROM headers (title, cart type, sizes)
- DMG/CGB Toggle — default DMG mode with optional CGB flag
- Screen Proofer — preview tilemaps with DMG shading and sprite overlay
- GIF Import — import sprite sheets and tile sets from GIF images
- Undo/Redo — 20-level snapshot history
Prerequisites
- Lazarus 4.8 with Free Pascal Compiler 3.2.2
- Target: i386-win32 (32-bit Windows)
- The first-run wizard automatically downloads:
- RGBDS v0.8.0 — assembler toolchain
- BGB — Game Boy emulator
- the-game-boy-engine — sample project
Build
C:\lazarus\lazbuild.exe --build-all main.lpi
The compiled binary lands in builds\P1XelEditor.exe. The project uses UPX compression in its post-build step (requires ..\upx\upx.exe relative to the project root).
Project Structure
p1xel-editor/
main.lpr # Program entry point
main.lpi # Lazarus project file
main_window.pas # TForm1 — main editor (5400+ lines)
main_window.lfm # Form layout
wizard.pas # First-run toolchain setup wizard
downloader.pas # HTTP download + ZIP extraction
exporter.md # CHR/TLM/OAM binary format specification
tools/ # Runtime toolchain (auto-downloaded on first run)
rgbds/
bgb/
toolchain.ini
projects/ # Game Boy project directories
Architecture
The editor maintains an internal 384-tile data buffer (FRomData) organized as:
| Zone | Source Tiles | CHR Position | VRAM Address |
|---|---|---|---|
| Font | 0–80 | 128–208 | $8800–$8D00 |
| Background | 81–255 | 209–383 | $8D10–$97F0 |
| Sprites | 256–383 | 0–127 | $8000–$87FF |
The engine uses LCDCF_BG8800 (signed $8800 addressing), where TLM values are
signed bytes added to base $9000. Font glyphs are referenced by TLM values
128–208, background tiles by 209–255 and 0–127.
License
See LICENSE.