This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Easy to understand NES emulator source-code

Easy to understand NES emulator source-code
by on (#93932)
I'm trying to understand a little better how interpreting the NES works and i'm looking for an emulator with a clean and easy to understand code. Most sources that i found are full of hacks and whistles. I'm looking for something quite simple. Do you guys recommend anything? It doesn't have to be perfect or anything, just basic emulation that works!

by on (#93964)
No matter what emulator you look at it is going to be pretty complex. The best way to understand it is to write you own. The basic operation of emulation can be this.

Write a CPU Core for the 65xx variant in the NES. Basically a 6502 but no decimal mode. Create your memory handlers and implement some sort of PPU, then alternate running the CPU and PPU.

It would be more helpful if you said what specifically you are looking to do.

by on (#93966)
Emulators are inherently complicated, so I doubt you'll find any decent emulators coded the way you you're looking for. There might be some bare bones emulator out there coded in a simple way, probably without sound, without mappers, doing tile-based rendering at best, and complete lack of timing accuracy, but would you really find such a program useful in any way?

When you emulate a machine at such a low level, there are so many little things to worry about... different things that have to run in parallel and can interrupt each other, functions that are triggered by accessing specific memory areas, the huge number of different ways to interface with cartridges (i.e. mappers)... all of that causes emulators to be hard to understand, and there's no way to avoid that.

by on (#94032)
DRRNES is an NES emulator made in QBASIC.

Maybe simple enough to get a general idea?

by on (#94038)
I would say, if you want to learn how emulators work, start from SIDE and PIE. They aren't NES emulators, but they'll show you basic things that will help you with understanding NES emulators.