Re: [cc65] bank switching/retro replay?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-11-10 13:05:11
On Mon, Nov 09, 2009 at 04:24:33PM -0800, SHAWN JEFFERSON wrote:
> I could see something like that being useful.  How does it deal with the
> library runtime code?  Do you have to load it into a portion of memory that
> doesn't get banked out?

I wouldn't bank out the runtime library, since that leads to all sorts of
problems. Many runtime library routine call each otheror do other things that
interfer with banking.

> Ullrich, Is there currently any way at compile time to output what segment a
> piece of code is in, that could be used in a function to automate the banking?
> ie. so I could write a function that takes this argument and then switches to
> the correct bank without having to rebuild the banking table all the time...

No, there is not. And, while I see that having an interface for bank switching
routines would be useful, I cannot currently see how it could be implemented
without too much overhead. What would be possible is some additional function
attribute like

        __attribute__ ((banked, 0x01))

where 0x01 is the bank number or some other information related to the target
bank. It would then be the problem of the bank switching code to make proper
use of the information. But writing such code that covers all cases is rather
difficult. Especially if the caller needs to get banked out, before the callee
is invoked.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Nov 10 13:05:19 2009

This archive was generated by hypermail 2.1.8 : 2009-11-10 13:05:21 CET