Jump to content
IGNORED

Cartridge coding using CC65


Recommended Posts

After discussions in the normal A8 forum, I've put together a little example

of using C code and arranging it across banks in a cartridge (in this example XEGS)

such that functions can be called via a Jump Table that handles the bank switching.

 

We can use this thread to expand upon (or completely replace) ideas about how

to go about this. One thing I'm not too happy about is the dependencies that

I should really setup in the makefile as a change (such as a newly exported function)

would mean that the jmptable files change. Also you have to declare the bank

that the function resides in - not too much effort required there - but maybe a

dynamic way of doing this can be done.

 

It requires modifications to the atari.o (effectively crt0.s) in order to prep some

of the data (r/w and read-only segements), copying them to RAM, but I did leave

in an example where the RODATA section of one codebank was left in that bank

(and so available to the bank when it was switched in). The atari.lib however can

be used 'as-is' and for now I've left that in the always loaded bank at $A000->$BFFF.

 

I hope this can help someone get going on ideas they have. Post here or PM me

if you have something specific you are trying but can't quite pull off under CC65.

 

Regards,

Mark

XegsBanking.zip

  • Like 1
Link to comment
Share on other sites

Does CC65 store compiled code in contiguous memory addresses without interruption? Or does it create compound files?

In the linker config file you can pretty much configure how you want it (how you want everything laid out in the output file).

In fact, if you need headers like on 8-bit binary load files, it is up to you to define those too.

Link to comment
Share on other sites

To add to that, the compiled (from C) object file (.o) doesn't hold the destination address,

that is assigned during linking. This is true too of the objects created from assembler

sources (.s), hence you can inter-mix them in your final program.

 

The .c to .o compilation actually goes via a temporary .s file which is assembled.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...