[cc65] C64: printf() into another VIC bank, memory layout

From: Maik Merten <maikmerten1googlemail.com>
Date: 2013-08-18 12:41:53
Hello all,

I outfitted my application, which uses functions like printf() and 
cputsxy(), with a custom font. I didn't yet find a way to make those 
functions write into Screen RAM position other than 0x0400, which means 
that the font currently has to be situated in VIC bank 3.

Thus I'm currently loading the font into starting address 0x3800, the 
highest charset position available in VIC bank 3. However, this is only 
a few bytes above the end of memory segments of my compiled application. 
With a few more lines of code I expect that these segments will spill 
into the position I need for the font.

The easiest solution would be to switch VIC memory into a higher 
location. I'm already doing this for displaying bitmap graphics. However 
then I somehow need to configure printf() and friends to expect the 
Screen RAM at some other position. Is this possible?

Another solution may be to divide RAM so that the font area is left 
untouched. I'm trying something like

     RAM:      file = %O, define = yes, start = $080D, size = $2ff2;
     RAM2:     file = %O, define = yes, start = $4000, size = $4000;

where the font would thus fit into the gap between RAM and RAM2.

I can successfully assign BSS and ZPSAVE to RAM2, but those are only a 
few bytes, and assigning CODE to RAM2 will just lead to a crash on 
application startup. I'm clearly doing something very stupid there. Is 
there a promising way to move things to higher memory positions?


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 Aug 18 12:42:07 2013

This archive was generated by hypermail 2.1.8 : 2013-08-18 12:42:09 CEST