ballz 9f086c3a4f Phase 3: score bar (HARE/SCOOT labels + 5 pips per side)
Draws a score bar across the top 8 rows of the multicolor bitmap at
$E000-$E13F (320 bytes), with HARE on the far left, SCOOT on the far
right, and 5 pips for each player between them.

A pip is 8x8 pixels (2 cells wide x 1 cell tall = 16 bitmap bytes):
filled = 1-pixel white border around a 6x6 black block; empty = an 8x8
white square (the border alone).  Pips are packed 2 cells each with
no gap, so adjacent pip borders merge into a 2-px white vertical
divider.

Labels use a hand-built 4x8 font (1 byte per row, top 4 bits = 4
pixels) for the 8 chars H/A/R/E/S/C/O/T (64 bytes total).  Each font
row is expanded 1bpp -> 2bpp via a 16-byte lookup table (expand4):
each '1' becomes '11' (white, from color RAM), each '0' becomes '00'
(background black, from $D021).

score_render() also rewrites the top 40 cells' attributes
(screen memory = 0, color RAM = 1) so the score bar's palette is
exactly 2 colors.  Scores are clamped to 0..5 on render to defend
against double-tap bugs in Phase 4.
2026-07-17 01:35:40 +02:00

nyuller

A C64 programming project using Oscar64 as the cross-compiler. Oscar64 is checked in as a git submodule under ./oscar64/.

Layout

.
├── oscar64/        # Oscar64 cross-compiler (git submodule)
├── docs/c64/       # Low-level C64 reference (memory map, VIC, CIA, SID, …)
├── src/            # Your C code
│   ├── helloworld.c
│   └── build.sh    # Compile + run helper
├── OSCAR64.md      # Notes on the Oscar64 compiler internals
└── PROG_C64.md     # Notes on programming the C64 hardware

First-time setup

# 1. Clone with submodules:
git clone --recurse-submodules <this-repo-url>

# Or, if you already cloned without --recurse-submodules:
git submodule update --init --recursive

Building

cd src
./build.sh            # compile helloworld.c → src/build/helloworld.prg
./build.sh -e         # run in oscar64's built-in emulator (headless, fast)
./build.sh -v         # run in VICE x64 (interactive, needs a real display)
./build.sh -V         # run in VICE x64sc (interactive, cycle-exact)
./build.sh -c         # just compile

build.sh will build the oscar64 compiler automatically the first time (it runs make -C make compiler inside ./oscar64/ if ./oscar64/bin/oscar64 doesn't exist yet).

Default test tool is the oscar64 built-in emulator (-e): it runs headless, needs no ROMs, no display, and is fast. Every Verify step in tasks.md uses this.

VICE 3.9 is installed at /usr/bin/ (x64, x64sc, x128, xvic, xpet) and is available via -v / -V. It is a GUI emulator and needs a real X11 / Wayland display to render — it won't produce useful screenshots in this headless environment. Use it from a real terminal session for interactive play-testing and cycle-exact validation of raster IRQ and SID timing; don't expect to script it.

Documentation

  • PROG_C64.md — how the C64 hardware actually works, from a low-level programming perspective. Start here if you want to understand what's going on under the hood.
  • OSCAR64.md — how the Oscar64 compiler works internally, plus a C64- specific section on how to use it well (memory model, bank switching, raster IRQs, common mistakes).
  • docs/c64/ — downloaded reference material: the full Commodore 64 Programmer's Reference Guide text, Christian Bauer's canonical VIC-II paper, and per-chip reference notes.
S
Description
No description provided
Readme
14 MiB
Languages
C 74.6%
Python 16%
Makefile 9.4%