What's new

Developing NES Emulator.. need help

R45512

New member
I'm developing an NES Emulator for Windows (98-XP), I have the ROM Loaded in memory, and variables defined for my registers, I have already read the ROM Header, and I have coded a partial debuggeer.. I want to replace the Debugger with emulation code.. which I have done for LDA, LDX, and LDY.

I wish to inquire about these things:

1: What do you do when you encounter a JMP then an ABSOLUTE? do you jump to that location in PRG_ROM? (&H8000+LOC) or do you just jump to that ABSOLUTE location? Does the same thing exist for RAM? or other absolutes? or is absolute ABSOLUTE?

2: How would I emulate the PPU? Where do I write? What are it's interrupts? How does the 2A03 (or 6502) write to the PPU Registers? What is the format for a tile (in better description)

3: I cant find much documentation on the APU... How does that work? What is the format? How do I convert it to WAV?

4: How would I add mapper support?


I APPRICIATE ANY.. I REPEAT ANY ANSWER to ANY OF THESE QUESTION WITH UTMOST THANKS!
 
Last edited:

conkerman

conkerman
um... i dont know too much about emulating the nes, but it's microprocessor is the 6502, and you might be able to get some questions answered at www.6502.org
i havent searched that site that extensively, but it could help you, or one of their links could help you. also, try looking at sources to other new emulators.
conkerman
 

Teamz

J'aime tes seins
all your questions are covered in different docs at http://nesdev.parodius.com/

for question 1:

JMP+ABSOLUTE let the rom JUMP to a new location in the program code using a 2 bytes address

so if the rom is not using a memory mapper, absolute addressing let you jump to any place in the rom
 

Jsr

New member
1. You jump to the given address in the two bytes, its for the whole CPU address space.

2. The PPU draws the graphics, how you emulate it is up to you. The CPU communicates with the PPU through the registers in memory between $2000 - $2007, and it can do a NMI interrupt at the end of each frame.

3 and 4. The NES produces analog sound, and mappers is a way to get around the 64k memory limit.
See http://nesdev.parodius.com as Teamz said, most things about the NES is covered there.
But remember that a NES is complex, even if its old. I suggest you learn to program it before you start to write an emulator.
 
OP
R

R45512

New member
Thanks

Thanks, those were most helpful...
I love the NES.. I was thinking about writing an OS for it.. but never got around to it.

THE OS WOULD HAVE HAD a lot of RAM and allowed you to load a rom into it... of course.. unloading the OS first!

BUT.. I decided to finish my rumored EMULATOR Project...
 
OP
R

R45512

New member
OK.. so basically, it jumps to anywhere in the CPU Address space?

so.. at PRG ROM..

Hmm.. MAPPERZ are difficult :mad:
 

Teamz

J'aime tes seins
R45512 said:
OK.. so basically, it jumps to anywhere in the CPU Address space?

so.. at PRG ROM..

Hmm.. MAPPERZ are difficult :mad:

yeah ABSOLUTE JMP jumps anywhere in the CPU Address (Prg-rom)

for the mappers I can't help you ATM cuz i'm still writing the debugger part but I'm pretty sure it's not that hard
 

Jsr

New member
R45512 said:
OK.. so basically, it jumps to anywhere in the CPU Address space?

so.. at PRG ROM..

Hmm.. MAPPERZ are difficult :mad:

It can jump anywere: ROM, RAM, or to unmapped memory, but that will crash.

Mappers tells what memory bank that should be loaded into the PRG/CHR space by writing a value to the PRG rom space ($8000-$FFFF).
 

Cyberman

Moderator
Moderator
R45512 said:
Ahh... IC...

Indirect may read from any location too? Or Just RAM?
Umm this is really a function of the CPU.. IE 6502 (too bad it wasn't the 6809 I liked it a lot better better stack handling and had a really cool memory maping allocation scheme too). Since this is a CPU function you should just break down (hehehe) and READ up on the processor. This is really important because the core of the emulator will be an emulated 6502! :)

PLEASE try this web page for more information. There should be quite a bit on the NES memory map on many web pages. The SNES used the 65C816 by the way which is a different animal (bigger memory space).

Cyb
 

Top