Re: [cc65] Banking out ROM (was: TGI preview)

From: Fatih Aygün <cyco1301yahoo.com>
Date: 2009-11-15 18:24:57
Hi



Ullrich von Bassewitz wrote:

> There's an "official" list of kernal entry points. They are used by the
> platform dependent, and also by the common Commodore code. For most platforms,
> these entries point to the ROM itself. Banked systems have a small function in
> low memory that has the label of the kernal entry point, banks in the ROM,
> calls it and switches back to RAM on return. See the kxxx.s function in the
> plus4 directory for examples.

No problem with that. My solution was a little more complicated but it works. Atari
has a table that consists of 23 JMP instructions between in the ROM. These are the 
official OS entry points. I just put there another table that points to the low memory stub
routines that do the banking and call the real fuctions.

> For kernal functions just using register values this is straight forward. For
> functions that get passed a buffer, the wrapper hast to check if the buffer is
> in low memory and create a copy if not. Fortunately, the only case this is
> used is for filenames, which are of limited size. See ksetnam.s function for
> an example.

I see. Won't work for Atari because most routines expect a buffer address. You can read
or write as many bytes as you want with just one call. So copying is not an option I think :(

I'll just go with a HIGHCODE segment similar to apple. It should work for most cases and it's 
better than nothing :)

Regards,
Fatih.


      
----------------------------------------------------------------------
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 15 18:25:05 2009

This archive was generated by hypermail 2.1.8 : 2009-11-15 18:25:07 CET