creating CC65 config files for homebrew with mappers

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
lexicobob
Posts: 6
Joined: Tue Jan 19, 2016 10:18 am

creating CC65 config files for homebrew with mappers

Post by lexicobob »

Hey,

I want to flash my homebrew to a cartridge, and have successfully run it on a NES-NROM-04 board (hurrah! ^^)
I now want to transplant my program into more NES carts. I am using Shiru's C library https://shiru.untergrund.net/articles/p ... s_in_c.htm, and CC65.

Basically, do I HAVE to stick to NROM boards?

Is there more to changing the game for boards/mappers than editing the .cfg?

Finally, re mirroring, I noticed when I changed the mirroring variables, the game didn't work on emulators. So I'm guessing there is more to that than the config too?

I read that I would have to change crt0.s for both these things, but I haven't been able to find more information than that.

Thank you for any advice you are able to give!
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: creating CC65 config files for homebrew with mappers

Post by rainwarrior »

lexicobob wrote:Basically, do I HAVE to stick to NROM boards?
No.
lexicobob wrote:Is there more to changing the game for boards/mappers than editing the .cfg?
Yes. Much more.

The linker CFG is not equivalent to an NES board. It is merely a ROM layout and memory organization tool.

What you want to do in the CFG has to do with what your program needs, and how it needs to be laid out in memory. The mapper is a big part of this, but so are a lot of other factors that are specific to your own program.

Lastly, there is no CC65 language support for banking. The easiest thing to do is have C code appear in only one bank, and anything that runs in another bank can just be handled with assembly code.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: creating CC65 config files for homebrew with mappers

Post by lidnariq »

As long as you stick with a mapper that only supports with 32 KiB of PRG, using CC65 with it is very easy (for reasons that Rainwarrior pointed out)

Unfortunately, there are only a few that natively work like that: NROM, CNROM (mapper 3), CPROM (mapper 13), Sunsoft 1 (mapper 184)

There's a few more that have a trivially constant and unambiguous definitions when only given 32 KiB of PRG, such as NINA-001 (mapper 34), Napoleon Senki (mapper 77), and Oeka Kids. (mapper 96).


As long as you stick with 32 KiB of PRG, and you modify crt0, you could easily use almost any mapper. This same technique will even let you use 40 KiB of PRG on FME-7 (mapper 69).

Finally, there's the NROM-368 proposal, which will give you 46 KiB of PRG space without having to do anything.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: creating CC65 config files for homebrew with mappers

Post by tepples »

Anything with a 32K bankswitching mode has an unambiguous definition when only 32K of PRG ROM is available. This includes A*ROM, if you want two separate planes of 1-screen mirroring, and MMC1, if you want switchable mirroring (and are comfortable with early init code being in asm).
Post Reply