RE: [cc65] Creating a Cartridge Program with cc65

From: Bill Katsak <bill1katsak.com>
Date: 2007-05-02 00:11:27
Hi,
     Thanks for the quick reply. You are correct about the composition of the header. My issue now is the composition of the startup code. Do I need to do initialization in my main method? Or is this something that I need to write a separate function to do? I have a feeling that I need to replace the default C64 startup code with code that either adds the necessary header or even maybe just does the copydata stuff. Maybe I should be linking it manually and omitting the c64.o file? Do you (or anyone for that matter) have any example code doing this sort of thing that I can look at?
 
I guess what I really am grasping for is something concrete that can help me understand how this whole process works.
 
Thank you,
Bill
 

________________________________

From: owner-cc65@musoftware.de on behalf of Ullrich von Bassewitz
Sent: Tue 5/1/2007 5:40 PM
To: cc65@musoftware.de
Subject: Re: [cc65] Creating a Cartridge Program with cc65




Hi!

On Tue, May 01, 2007 at 08:04:39AM -0400, Bill Katsak wrote:
> I have changed around the linker configuration to try to get something
> that works. If I compile a hello world program into a binary, load it
> like a prg file and do a SYS command to start the code from the $8000
> range location, it runs fine. However, if I change the headers around,
> adjust the offsets, and load the same program as a cartridge ROM, it
> just comes back to READY and never runs.

If I remember correctly, you need to add a header to the generated binary,
something like "CBM80" + a warm and a cold start vector.

> Am I going about this all wrong? Has anyone had some experience with
> this? I also know that I will have a problem once I get my real program
> going because I will need to copy my DATA segment from ROM to RAM, and I
> am not sure how to modify my startup code to do this.

If you're using the standard segments, all you need to do is to call a routine
named "copydata" from your startup code. It exists in the copydata.s module in
the lib/common directory.

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.



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed May 2 00:11:46 2007

This archive was generated by hypermail 2.1.8 : 2007-05-02 00:11:49 CEST