Here's something I want to know for CC65 and Board Types

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
scythe&gengames
Posts: 6
Joined: Wed Dec 12, 2018 11:29 am

Here's something I want to know for CC65 and Board Types

Post by scythe&gengames »

Okay let's say I made a iNes mapper to be SLROM 256 with 128K of CHR and PRG and how does CC65 know what type of board you did on the header like SLROMs and compile it into the .nes rom file?

This may be left unanswered due to thinking this is a dumb question to ask - I'm basically try my hand of learning 6502 ASM to get into the retro days of NES Programming so I can use the Board type I'll need for my games and have fun learning many types of boards.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Here's something I want to know for CC65 and Board Types

Post by tepples »

The first of two things you will need is a mapper support library to handle basic initialization, bank switching, interbank subroutine calls, and the like. This is one or more assembly language source code files.

The second is a linker script for the combination of bank count, bank size, and pseudo-fixed banks (such as MMC1 reset code). In addition to the MEMORY areas for ROM, it'll need to have forty MEMORY areas for ROM, one for each of eight 16 KiB PRG banks and one for each of thirty-two 4 KiB CHR banks. It'll also need SEGMENTs to put things in those MEMORY areas: at least two per PRG bank, one to place most of the data and a roughly 16-byte stub at the end of all banks to hold the beginning of the initialization code before the first bankswitch.

I've made most of this for SNROM, which should cover everything but CHR ROM banking. Has someone else adapted it to SLROM?
User avatar
scythe&gengames
Posts: 6
Joined: Wed Dec 12, 2018 11:29 am

Re: Here's something I want to know for CC65 and Board Types

Post by scythe&gengames »

tepples wrote:The first of two things you will need is a mapper support library to handle basic initialization, bank switching, interbank subroutine calls, and the like. This is one or more assembly language source code files.

The second is a linker script for the combination of bank count, bank size, and pseudo-fixed banks (such as MMC1 reset code). In addition to the MEMORY areas for ROM, it'll need to have forty MEMORY areas for ROM, one for each of eight 16 KiB PRG banks and one for each of thirty-two 4 KiB CHR banks. It'll also need SEGMENTs to put things in those MEMORY areas: at least two per PRG bank, one to place most of the data and a roughly 16-byte stub at the end of all banks to hold the beginning of the initialization code before the first bankswitch.

I've made most of this for SNROM, which should cover everything but CHR ROM banking. Has someone else adapted it to SLROM?
So where CC65 keeps the library of these Mappers so I can try out using SLROM or a good board without the MMC chip- I just wish to use the Remaining PRG banks if I have plenty to add in a complex soundtrack if not I'll go for a larger mapper
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Here's something I want to know for CC65 and Board Types

Post by tepples »

If a comprehensive set of already-made mapper libraries for each combination of mapper, PRG ROM size, and CHR ROM size exists, I am not aware of it. I doubt one exists. You will need to make one yourself or request that one be made for you.

In order that I may gauge how much you would need to learn before attempting this project: Have you completed any cc65 or ca65 based projects previously?
User avatar
scythe&gengames
Posts: 6
Joined: Wed Dec 12, 2018 11:29 am

Re: Here's something I want to know for CC65 and Board Types

Post by scythe&gengames »

tepples wrote:If a comprehensive set of already-made mapper libraries for each combination of mapper, PRG ROM size, and CHR ROM size exists, I am not aware of it. I doubt one exists. You will need to make one yourself or request that one be made for you.

In order that I may gauge how much you would need to learn before attempting this project: Have you completed any cc65 or ca65 based projects previously?
just installed it as I'll have to find ASM on Youtube for nes may be my chance to create a NES game using pure ASM once I know how it's done
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Here's something I want to know for CC65 and Board Types

Post by tepples »

If you haven't done any assembly language programming for the NES, I encourage you to make your first project without a mapper, for the NROM board.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Here's something I want to know for CC65 and Board Types

Post by dougeff »

I wrote some cfg files for ca65 for various mappers, but I can't recall which ones (away from computer).

http://dl.dropboxusercontent.com/s/0m4p ... xm/CFG.zip

One of these might be SLROM.
Last edited by dougeff on Thu Dec 13, 2018 3:09 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Here's something I want to know for CC65 and Board Types

Post by Banshaku »

Like mentioned, mappers is hardware and the compiler doesn't know about that. The header will define which mapper you targetted so the emulator will know how to parse your rom.

This mean you need to understand how to rom data need to be prepared for this mapper and create a memory map for it.

It's sound difficult at first but it will get clearer the more you play with it. Since you are started, like mentioned, the first tests should be to program without mapper and see how it work. Once this is fine, you can start with simple ones.
User avatar
scythe&gengames
Posts: 6
Joined: Wed Dec 12, 2018 11:29 am

Re: Here's something I want to know for CC65 and Board Types

Post by scythe&gengames »

dougeff wrote:I wrote some cfg files for ca65 for various mappers, but I can't recall which ones (away from computer).

http://dl.dropboxusercontent.com/s/0m4p ... xm/CFG.zip

One of the might be SLROM.
I see MMC1_128_128.cfg which could mean SLROM
Banshaku wrote:Like mentioned, mappers is hardware and the compiler doesn't know about that. The header will define which mapper you targetted so the emulator will know how to parse your rom.

This mean you need to understand how to rom data need to be prepared for this mapper and create a memory map for it.

It's sound difficult at first but it will get clearer the more you play with it. Since you are started, like mentioned, the first tests should be to program without mapper and see how it work. Once this is fine, you can start with simple ones.
What about using Easy 6502 site? that can help a lot too to understand 6502 and boom NES programming
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Here's something I want to know for CC65 and Board Types

Post by Banshaku »

Yes, this site is very interesting if you want to learn how the 6502 works. From that, it should be easier to work with the nes ;)
Post Reply