Quantcast
Channel: nesdev.org
Viewing all articles
Browse latest Browse all 782

Can I force ca65 to error if a charmap character is not mapped?

$
0
0
So, let's say I have a charmap mapping like this:

Code:

.charmap $30, $00 ; 0.charmap $32, $02 ; 2
And I then write code like this:

Code:

ldy #'0'sty PPUDATAldy #'1'sty PPUDATAldy #'2'sty PPUDATA
This will cause ca65 to emit assembly like this:

Code:

8331  A0 00          LDY #$008333  8C 07 20       STY PpuData_20078336  A0 31          LDY #$318338  8C 07 20       STY PpuData_2007833B  A0 02          LDY #$02833D  8C 07 20       STY PpuData_2007
So for '1' it uses the ASCII code for the number 1. But what I would really like it to do is to throw a compilation error.

I tried .feature force_range, but that doesn't do anything (because it seems unrelated to charmaps and just be generally about restricting what goes into a .byte?).

So, I wonder if there's a way to tell ca65 to forget everything about ASCII and require every character to be charmapped?

Statistics: Posted by MenhirMike — Mon Jun 10, 2024 5:51 pm — Replies 0 — Views 47



Viewing all articles
Browse latest Browse all 782

Trending Articles