Recommended emulator source to read for educational purpose
Moderator: Moderators
Recommended emulator source to read for educational purpose
I always like to read (when I can find the time) different ways of programming since it helps you think differently when approaching new problems for normal programming task.
Since programming an emulator is not what I would call "traditional business programming", there must be some concept or approach used that could be interesting to read or to learn from it.
There as been a surge of aspiring emulator authors these days and it got me in the mood to read some code related to this but with no intention to built an emulator myself (no time for that). Any specific emulator code that would make and interesting read? I want to see approach done procedurally or in OO, if that's can be applied for this (but cannot see how yet, one of the many reason I want to read some code).
Since programming an emulator is not what I would call "traditional business programming", there must be some concept or approach used that could be interesting to read or to learn from it.
There as been a surge of aspiring emulator authors these days and it got me in the mood to read some code related to this but with no intention to built an emulator myself (no time for that). Any specific emulator code that would make and interesting read? I want to see approach done procedurally or in OO, if that's can be applied for this (but cannot see how yet, one of the many reason I want to read some code).
If you provide your code under some kind of NDA (since it's not open source), I will be more than happy to read it 
Whenever I've needed to know what PPU events happen at which PPU cycle, I look at Nintendulator's source code first. Its PPU source code is arranged so that you can very clearly tell which cycle the scroll increments at, which cycles have memory accesses, etc.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
I would look at Sega Li/FCEU/Nintendulator/LoopyNES (/there's another I forget written entirely in assembly for Win32!) which are all light emulators and mostly straight forward. I worked on an emulator that would have been great for this because it was <1000 lines of C, but I delete things out of perfectionism :)
I find Nestopias source extremely well written, but its architecture may occasionally be rather complex. Certain parts make use of advanced C++ features, making it difficult to comprehend at first, at least for someone with my humble C++ experience.
Nintendulator, virtuanes and fceu are all pretty straight forward and should be easy to read.
It uses special asm syntax, people around here seem to be more familiar with C++
But if you prefer something other than C++, how about javascript?
http://benfirshman.com/projects/jsnes/
Nintendulator, virtuanes and fceu are all pretty straight forward and should be easy to read.
That sounds like mine: http://nessie.emubase.dekyuusaku wrote:there's another I forget written entirely in assembly for Win32
It uses special asm syntax, people around here seem to be more familiar with C++
But if you prefer something other than C++, how about javascript?
http://benfirshman.com/projects/jsnes/
Exactly! :DNessie wrote:That sounds like mine: http://nessie.emubase.de
It uses special asm syntax, people around here seem to be more familiar with C++
Little bit off-topic here: I tried your emu and it eats 100% CPU when running (50% on dual core of course). You probably want to look in to that.Nessie wrote:That sounds like mine: http://nessie.emubase.de
It uses special asm syntax, people around here seem to be more familiar with C++
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
For Nestopia, I did a quick peek in the code and it's quite overwhelming at first. I don't really know C++ but know some other language that use OOP and the sheer amount of files inside makes it hard to check were to start.Nessie wrote:I find Nestopias source extremely well written, but its architecture may occasionally be rather complex. /
The code is well write for the form but there seems to be no comment at all inside the code, just in the header files. But the no comments part seems very common to many source I saw.
@kyuusaku:
I will give them a look once I can find some time.