Hi all!
I can make NES games using cc65 or NESASM, but totally new to hardware.
I've been trying to understand how the cartridge send instructions to CPU, or write data to memory (e.g. make some noise
by writing data to APU through $400C-400F), but failed, I just don't know where to start!
I studied
http://wiki.nesdev.com/w/index.php/Cartridge_connector, and still no idea where to start.
What are those A0..A10, and D0 , all I need is write a value to a register.
So, please tell me where and how to get start, thank you guys!
You're not supposed to control the system by directly manipulating the cartridge connector's lines. Those signals are there mostly to read and write from/to memory. To access a memory chip, the NES needs to tell it which address it want to access (this is done through the Axx lines, one for each bit of the address) and then, depending on whether it's reading or writing (this is also signaled in one of the lines), the chip will put 8 bits of data in the data lines (Dxx) for the NES to read or the NES will put 8 bits there for the chip to "absorb".
There are at least 2 memory chips inside an NES cartridge, one for the program and one for tiles/patterns/characters, which is why there are two sets of Axx/Dxx lines in the cartridge connector.
Anyway, a cartridge is basically just memory, that can (some times) be written to or read from, but it can't directly do anything to the system. Memories are passive components. A cartridge is like an instruction book: it tells you how to do things, but the book itself can't do anything, it's just information, YOU have to do what the book tells you to. It's the same with a cartridge: the cart feeds the CPU with instructions, but the CPU is the one responsible for carrying out all the tasks, like writing to registers.
If you want to give direct instructions to the CPU, without reading them from memory, you'll have to simulate memory by encoding the instructions in 6502 format and feeding them to the CPU one byte at a time when requested. You'll be generating commands on the fly, but the CPU will think it's reading from memory.
Start with
NROM. It's the most basic board, and directly reflects the NES' intended capabilities. There's basically three important things:
1. PRG-ROM chip, connected to and controlled by the NES CPU.
2. CHR-ROM chip, connected to and controlled by the NES PPU.
3.
Nametable mirroring, chosen by redirecting one of the PPU address lines.
I wouldn't bother looking at any other type of mapper until you understand NROM.
Thanks !
From tokumaru's information, now I (probably) know how they work,but still lots of works and studies to be done.
And thanks to rainwarrior, i know
where to start, i'll try start from here.
Thank you guys!