ca65 Memory Management using nes.cfg?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
RetroDad
Posts: 6
Joined: Thu Oct 17, 2019 10:22 am

ca65 Memory Management using nes.cfg?

Post by RetroDad » Thu Oct 17, 2019 10:50 am

I am somewhat new to NES Development. I worked my way through the Nerdy nights and I am currently starting to work on my own game. First thing I did was switch over to the ca65 assembler. I am currently working on compression for my MetaTiles. I need lookup tables that start with a lowbyte $00. To achieve this I have been creating segments in my nes.cfg file.

Is this the best way to do this?

Is there a way to reserve a set of address in memory at specified location? .org caused me some issues

Does anyone know of some documentation/tutorial that takes a comprehensive look at the .cfg file in ca65?

any help would be awesome, thanks!

calima
Posts: 1018
Joined: Tue Oct 06, 2015 10:16 am

Re: ca65 Memory Management using nes.cfg?

Post by calima » Thu Oct 17, 2019 11:36 am

Segments and the .align directive both work.

User avatar
gauauu
Posts: 659
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: ca65 Memory Management using nes.cfg?

Post by gauauu » Thu Oct 17, 2019 11:38 am

The answer the first half -- you can use the .align command to align data/code to arbitrary alignments, which is perfect for the sort of thing you're talking about.

Also, the docs for the linker config are here. I don't know of any more tutorial-like descriptions of the config format. It's definitely a bit of a learning curve, but it's a great flexible system once you understand how it works.

RetroDad
Posts: 6
Joined: Thu Oct 17, 2019 10:22 am

Re: ca65 Memory Management using nes.cfg?

Post by RetroDad » Thu Oct 17, 2019 12:58 pm

Thanks for the help! I got me some docs to read

Post Reply