# BUZZ RUN A one-button flying game for the Commodore 64, written in 6502 assembly (ca65/ld65). Steer a bumblebee through the gaps in an endless row of hedge pillars. ## Controls | Input | Action | |-------|--------| | Fire (joystick port 1 or 2) or SPACE | Flap / start / retry | ## Build and run ``` build.bat :: assembles buzzrun.prg build.bat -run :: build, then launch in VICE x64sc run.bat :: launch (builds first if needed) ``` `ca65`/`ld65` must be on `PATH`. `run.bat` expects VICE 3.10 at `C:\Program Files\GTK3VICE-3.10-win64\bin\x64sc.exe`. ## Test builds | Define | Effect | |--------|--------| | `-D AUTOTEST` | Starts immediately and flaps automatically (for screenshots in VICE) | | `-D INVINCIBLE` | Ignores pillar collisions | Example: `ca65 -D AUTOTEST -D INVINCIBLE buzzrun.asm -o t.o && ld65 t.o -C buzzrun.cfg -o test.prg` ## How it works - **Display:** multicolor text mode in 38-column mode. The pillars and ground use custom characters; the ROM font is copied to `$3000` and the custom characters are placed over codes `$40`–`$4C`. - **Scrolling:** the playfield moves 1 pixel per frame using `$D016` fine scroll. Every 8 pixels, rows 1–24 are copied one column left, starting in the lower border. The copy runs top to bottom ahead of the raster beam, so the screen doesn't tear. New world columns are drawn into the hidden column 39. - **Raster IRQs:** line 251 resets the scroll for the HUD row, updates the sprite, and signals the main loop. Line 58 applies the playfield fine scroll. - **Collision:** the sprite-to-background register `$D01F` detects hits at pixel level. The light-green highlight pixels (`%01`) don't count as hits, which makes the edges slightly forgiving. - **Scoring:** after each coarse scroll, if a pillar's right-edge character is in column 7 of row 1, the bee has passed it. - **Random gaps:** an 8-bit Galois LFSR, seeded from the frame counter when the player presses fire. - **Sound:** SID voice 1 plays the flap chirp and the crash noise. Voice 2 plays the score ding. ## Memory map | Range | Use | |-------|-----| | `$0002`–`$001D` | Zero-page variables | | `$0801`–`$0FFF` | Program (BASIC `SYS 2061` stub) | | `$2000`–`$207F` | Bee sprite frames (copied at start-up) | | `$3000`–`$37FF` | Character set |