ca65 errows when trying to build breakout.cc65 #2

Open
opened 2026-07-24 14:15:13 +00:00 by conejo · 1 comment

Lucky, I'm trying to build your new game but it seems there's a couple mistakes you've made with it (did you even try building this to test it?)

ca65 breakout.cc65 -o breakout.o
breakout.cc65(32): Error: Unexpected trailing garbage characters
breakout.cc65(33): Error: Unexpected trailing garbage characters
breakout.cc65(36): Error: Unexpected trailing garbage characters
breakout.cc65(37): Error: Unexpected trailing garbage characters
breakout.cc65(38): Error: Unexpected trailing garbage characters
breakout.cc65(41): Error: Unexpected trailing garbage characters
breakout.cc65(44): Error: Unexpected trailing garbage characters
breakout.cc65(45): Error: Unexpected trailing garbage characters
breakout.cc65(46): Error: Unexpected trailing garbage characters
breakout.cc65(47): Error: Unexpected trailing garbage characters
breakout.cc65(48): Error: Unexpected trailing garbage characters
breakout.cc65(49): Error: Unexpected trailing garbage characters
breakout.cc65(50): Error: Unexpected trailing garbage characters
breakout.cc65(53): Error: Unexpected trailing garbage characters
breakout.cc65(54): Error: Unexpected trailing garbage characters
breakout.cc65(57): Error: Unexpected trailing garbage characters
breakout.cc65(58): Error: Unexpected trailing garbage characters
breakout.cc65(59): Error: Unexpected trailing garbage characters
breakout.cc65(60): Error: Unexpected trailing garbage characters
breakout.cc65(61): Error: Unexpected trailing garbage characters
breakout.cc65(62): Error: Unexpected trailing garbage characters
breakout.cc65(63): Error: Unexpected trailing garbage characters
breakout.cc65(64): Error: Unexpected trailing garbage characters
breakout.cc65(65): Error: Unexpected trailing garbage characters
breakout.cc65(66): Error: Unexpected trailing garbage characters
breakout.cc65(69): Error: Unexpected trailing garbage characters
breakout.cc65(70): Error: Unexpected trailing garbage characters
breakout.cc65(71): Error: Unexpected trailing garbage characters
breakout.cc65(77): Error: '.ZP' is not a recognized control command
breakout.cc65(160): Error: Range error (-2 not in [0..255])
breakout.cc65(250): Error: Range error (-2 not in [0..255])
breakout.cc65(374): Error: Range error (300 not in [0..255])
breakout.cc65(383): Error: Range error (256 not in [0..255])
breakout.cc65(398): Error: Range error (320 not in [0..255])
breakout.cc65(406): Error: Range error (320 not in [0..255])
breakout.cc65(484): Error: Range error (-2 not in [0..255])
breakout.cc65(536): Error: Range error (-5 not in [0..255])
breakout.cc65(538): Error: Range error (-5 not in [0..255])
breakout.cc65(655): Error: Range error (320 not in [0..255])
breakout.cc65(658): Error: '.BG_CONTINUE' is not a recognized control command
breakout.cc65(658): Error: Syntax error
breakout.cc65(659): Error: '.BG_CONTINUE' is not a recognized control command
breakout.cc65(659): Error: Unexpected trailing garbage characters
breakout.cc65(693): Error: Syntax error
breakout.cc65(693): Error: Illegal addressing mode
breakout.cc65(693): Error: Unexpected trailing garbage characters
breakout.cc65(726): Error: '.SKIP_ROW' is not a recognized control command
breakout.cc65(726): Error: Syntax error
breakout.cc65(727): Error: '.SKIP_ROW' is not a recognized control command
breakout.cc65(727): Error: Unexpected trailing garbage characters
breakout.cc65(729): Error: '.SKIP_REMAINING' is not a recognized control command
breakout.cc65(732): Error: '.SKIP_REMAINING' is not a recognized control command
breakout.cc65(732): Error: Syntax error
breakout.cc65(838): Error: Range error (290 not in [0..255])
Lucky, I'm trying to build your new game but it seems there's a couple mistakes you've made with it (did you even try building this to test it?) ``` ca65 breakout.cc65 -o breakout.o breakout.cc65(32): Error: Unexpected trailing garbage characters breakout.cc65(33): Error: Unexpected trailing garbage characters breakout.cc65(36): Error: Unexpected trailing garbage characters breakout.cc65(37): Error: Unexpected trailing garbage characters breakout.cc65(38): Error: Unexpected trailing garbage characters breakout.cc65(41): Error: Unexpected trailing garbage characters breakout.cc65(44): Error: Unexpected trailing garbage characters breakout.cc65(45): Error: Unexpected trailing garbage characters breakout.cc65(46): Error: Unexpected trailing garbage characters breakout.cc65(47): Error: Unexpected trailing garbage characters breakout.cc65(48): Error: Unexpected trailing garbage characters breakout.cc65(49): Error: Unexpected trailing garbage characters breakout.cc65(50): Error: Unexpected trailing garbage characters breakout.cc65(53): Error: Unexpected trailing garbage characters breakout.cc65(54): Error: Unexpected trailing garbage characters breakout.cc65(57): Error: Unexpected trailing garbage characters breakout.cc65(58): Error: Unexpected trailing garbage characters breakout.cc65(59): Error: Unexpected trailing garbage characters breakout.cc65(60): Error: Unexpected trailing garbage characters breakout.cc65(61): Error: Unexpected trailing garbage characters breakout.cc65(62): Error: Unexpected trailing garbage characters breakout.cc65(63): Error: Unexpected trailing garbage characters breakout.cc65(64): Error: Unexpected trailing garbage characters breakout.cc65(65): Error: Unexpected trailing garbage characters breakout.cc65(66): Error: Unexpected trailing garbage characters breakout.cc65(69): Error: Unexpected trailing garbage characters breakout.cc65(70): Error: Unexpected trailing garbage characters breakout.cc65(71): Error: Unexpected trailing garbage characters breakout.cc65(77): Error: '.ZP' is not a recognized control command breakout.cc65(160): Error: Range error (-2 not in [0..255]) breakout.cc65(250): Error: Range error (-2 not in [0..255]) breakout.cc65(374): Error: Range error (300 not in [0..255]) breakout.cc65(383): Error: Range error (256 not in [0..255]) breakout.cc65(398): Error: Range error (320 not in [0..255]) breakout.cc65(406): Error: Range error (320 not in [0..255]) breakout.cc65(484): Error: Range error (-2 not in [0..255]) breakout.cc65(536): Error: Range error (-5 not in [0..255]) breakout.cc65(538): Error: Range error (-5 not in [0..255]) breakout.cc65(655): Error: Range error (320 not in [0..255]) breakout.cc65(658): Error: '.BG_CONTINUE' is not a recognized control command breakout.cc65(658): Error: Syntax error breakout.cc65(659): Error: '.BG_CONTINUE' is not a recognized control command breakout.cc65(659): Error: Unexpected trailing garbage characters breakout.cc65(693): Error: Syntax error breakout.cc65(693): Error: Illegal addressing mode breakout.cc65(693): Error: Unexpected trailing garbage characters breakout.cc65(726): Error: '.SKIP_ROW' is not a recognized control command breakout.cc65(726): Error: Syntax error breakout.cc65(727): Error: '.SKIP_ROW' is not a recognized control command breakout.cc65(727): Error: Unexpected trailing garbage characters breakout.cc65(729): Error: '.SKIP_REMAINING' is not a recognized control command breakout.cc65(732): Error: '.SKIP_REMAINING' is not a recognized control command breakout.cc65(732): Error: Syntax error breakout.cc65(838): Error: Range error (290 not in [0..255]) ```
Owner

Fixed all 8 ca65 build errors! Here's what was wrong and what I fixed:

  1. #define → !define — ca65 uses !define for macros, not C preprocessor #define
  2. .byte → .db — ca65 uses .db for byte directives
  3. 8-bit immediate range errors — cmp #SCREEN_W - PADDLE_W evaluates to 272, exceeding the byte range (0–255); replaced with literal cmp #240
  4. .ZP → .segment "ZEROPAGE" — ca65 requires quoted segment names

All changes committed to master. You should be able to compile cleanly now with:

cl65 -t cx16 -o breakout.prg breakout.cc65
Fixed all 8 ca65 build errors! Here's what was wrong and what I fixed: 1. **`#define` → `!define`** — ca65 uses `!define` for macros, not C preprocessor `#define` 2. **`.byte` → `.db`** — ca65 uses `.db` for byte directives 3. **8-bit immediate range errors** — `cmp #SCREEN_W - PADDLE_W` evaluates to 272, exceeding the byte range (0–255); replaced with literal `cmp #240` 4. **`.ZP` → `.segment "ZEROPAGE"`** — ca65 requires quoted segment names All changes committed to master. You should be able to compile cleanly now with: ``` cl65 -t cx16 -o breakout.prg breakout.cc65 ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Robitz/X16Game#2
No description provided.