It is currently Sun Jan 20, 2019 11:50 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Wed Dec 12, 2018 11:39 am 
Offline
User avatar

Joined: Wed Dec 12, 2018 11:29 am
Posts: 4
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.


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 11:51 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21004
Location: NE Indiana, USA (NTSC)
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?


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 11:57 am 
Offline
User avatar

Joined: Wed Dec 12, 2018 11:29 am
Posts: 4
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


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 12:17 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21004
Location: NE Indiana, USA (NTSC)
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?


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 12:23 pm 
Offline

Joined: Tue Aug 28, 2018 8:54 am
Posts: 117
Location: Edmonton, Canada
scythe&gengames wrote:
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


CC65 doesn't know anything about mappers. In tepples example linker config file lets the linker know about memory layout
https://github.com/pinobatch/snrom-temp ... m2mbit.cfg
And in unrom.s segment "INESHDR" tells _emulator_ what mapper is used and what prg/chr size is.


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 12:31 pm 
Offline
User avatar

Joined: Wed Dec 12, 2018 11:29 am
Posts: 4
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


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 12:37 pm 
Offline

Joined: Tue Aug 28, 2018 8:54 am
Posts: 117
Location: Edmonton, Canada
scythe&gengames wrote:
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

I doubt you will find a lot on youtube. This is the only channel I know that does developing on NES, but it is also stream recording, and they are quite long. You will find way more information on wiki or this forum that in video format.


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 2:41 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21004
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 4:51 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2390
Location: DIGDUG
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.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Last edited by dougeff on Thu Dec 13, 2018 3:09 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 7:07 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2177
Location: Fukuoka, Japan
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.


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 7:23 pm 
Offline
User avatar

Joined: Wed Dec 12, 2018 11:29 am
Posts: 4
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


Top
 Profile  
 
PostPosted: Wed Dec 12, 2018 7:53 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2177
Location: Fukuoka, Japan
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 ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group