Re: [cc65] using screen codes instead of PETSCII

From: thefox xofeht <thefox1aspekt.fi>
Date: 2011-11-27 05:39:56
On Sun, Nov 27, 2011 at 2:43 AM, Gábor Lénárt <lgb@lgb.hu> wrote:
> I do direct screen access (writing into the video RAM) to display text using
> only ca65 (no C code). Text itself is ASCII (as I am coding on PC, for sure,
> since cc65 suite is a cross-platform compiler solution). Can I have any easy
> was to do the translation (at least for "normal" characters) by the
> compiler? Specifying a -t option does ASCII->PETSCII translation, I would
> like something similar for ASCII->screen codes. Or should I specify dozens
> of .CHARMAP statements to do it myself because no "built-in" feature for
> this? If it's the situation, has somebody got an already written mapping for
> this I can use in my own works, or should I create one by myself?

I'm not sure what exactly you mean by "screen codes", but .repeat
comes in handy when using .charmap. You could do this to override the
ASCII->PETSCII translation:

.repeat 255, i
  .charmap i + 1, i + 1
.endrepeat

Or if you want to do some other kind of mapping you can do stuff like this...

.repeat 26, i
  .charmap $41 + i, i
.endrepeat

...to map ASCII A-Z to 0..25, and so on.

-thefox
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Nov 27 06:41:37 2011

This archive was generated by hypermail 2.1.8 : 2011-11-27 06:41:42 CET