cc65 - 32KiB PRG banks and segments

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

User avatar
rainwarrior
Posts: 7818
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: cc65 - 32KiB PRG banks and segments

Post by rainwarrior » Tue Oct 16, 2018 6:22 pm

NOOPr wrote:But it have a drawback: each bank will going to have data from segment "CODE" from every other bank
Use #pragma code-name, data-name, bss-name, and you can decide what segment each goes in.

User avatar
NOOPr
Posts: 68
Joined: Tue Feb 27, 2018 10:41 am
Location: Brazil
Contact:

Re: cc65 - 32KiB PRG banks and segments

Post by NOOPr » Wed Oct 17, 2018 4:11 am

rainwarrior wrote:
NOOPr wrote:But it have a drawback: each bank will going to have data from segment "CODE" from every other bank
Use #pragma code-name, data-name, bss-name, and you can decide what segment each goes in.
You cannot do this for data imported from runtime.lib

User avatar
rainwarrior
Posts: 7818
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: cc65 - 32KiB PRG banks and segments

Post by rainwarrior » Wed Oct 17, 2018 9:48 am

That's true but it is the only thing that has to use those segments, so you can place the runtime where it is needed in your .cfg and for all other code send it to other segments.

Post Reply