No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Krzysztof Krystian Jankowski 4fb74925bb Delete about.jpg
2026-08-02 19:38:31 +02:00
builds Delete about.jpg 2026-08-02 19:38:31 +02:00
.gitignore Update .gitignore 2026-08-02 19:37:08 +02:00
about.jpg about 2026-07-30 03:31:41 +02:00
about.rc about 2026-07-30 03:31:41 +02:00
about.res icon 2026-07-30 03:42:09 +02:00
AGENTS.md refactor 2026-07-31 01:50:27 +02:00
downloader.pas cross platform 2026-07-31 02:14:15 +02:00
exporter.md alpha of v4 2026-07-30 02:17:16 +02:00
icon.ico icon 2026-07-30 03:52:21 +02:00
LICENSE Upload files to "/" 2026-07-09 20:00:10 +02:00
main cross platform 2026-07-31 02:14:15 +02:00
main.ico icon 2026-07-30 03:52:21 +02:00
main.lpi win 2026-07-31 03:35:26 +02:00
main.lpr cross platform 2026-07-31 02:14:15 +02:00
main.manifest upd 2026-07-30 03:59:32 +02:00
main.rc upd 2026-07-30 03:59:32 +02:00
main_window.lfm cross platform 2026-07-31 02:14:15 +02:00
main_window.pas linux img 2026-07-31 03:00:31 +02:00
project.p1x cross platform 2026-07-31 02:14:15 +02:00
README.md refactor 2026-07-31 01:50:27 +02:00
wizard.pas native 2 2026-07-31 02:19:50 +02:00

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:

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 080 128208 $8800$8D00
Background 81255 209383 $8D10$97F0
Sprites 256383 0127 $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 128208, background tiles by 209255 and 0127.

License

See LICENSE.