How to import shared code from banks with ca65?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
pubby
Posts: 583
Joined: Thu Mar 31, 2016 11:15 am

Re: How to import shared code from banks with ca65?

Post by pubby »

Dunno, but try removing ".export lib_SwitchBank" from boot_shared.inc and moving it to boot.asm at top-level scope.
User avatar
Sumez
Posts: 919
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: How to import shared code from banks with ca65?

Post by Sumez »

Instead of including the same code multiple times in your source, shouldn't it be possible to do this with the linker config? Just define a segment that's included multiple times in the ROM image.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How to import shared code from banks with ca65?

Post by tepples »

I don't think the ld65 configuration language allows a single SEGMENT to be copied into multiple MEMORY areas.
Post Reply