

- Snes javascript emulator code how to#
- Snes javascript emulator code Pc#
- Snes javascript emulator code series#

Just don’t go crazy creating new objects and trigger GC, if you are using a language that has one.ĭo find a good library for your language that supports rendering 2D graphics, controllers, and audio. It’s a 8-bit processor, so emulation performance on today’s powerful machines is usually not an issue. People have written NES emulators using all kinds of languages - C/C++, JavaScript, Go, C#, etc. Language choice probably doesn’t matter that much. But most of those work are incremental and you can decide to stop at any time. If you want to support most of the games out there, prepare for a lot of work (implementing mappers and debugging). It took me about a week and half to add CPU, PPU, and a few mappers in order to get some of the major commercial games to work perfectly (Super Contra, Super Mario Bros, Shadow of the Ninja, etc). Different mappers have different capabilities.
Snes javascript emulator code how to#
Snes javascript emulator code Pc#
It has 3 general purpose register A/X/Y, and 3 special register P (status) /SP (stack pointer) /PC (program counter, or instruction pointer), all of them being 8-bit except PC which is 16-bit. NES Hardware Capabilitiesīeing a 8-bit system in 80s, it has hilariously limited spec comparing to today’s standard:Ĩ-bit 6502 CPU running at 1.79 MHZ. More detailed technical writeup of emulating different components would come later as separate posts. This post is intended as a high-level overview of what it would take to write a NES emulator so that if you are interested to write your own you’d be prepared to know what is involved, or simply just to understand some of the interesting problems involved in writing one. Those 8-bit style games are also making a come back in indie games such as Shovel Knight and Stardew Valley. Many people growing up in the 80s probably have fond memory of playing 8-bit NES games - those games are surprisingly fun (and many of them challenging).
Snes javascript emulator code series#
I had a lot of fun building this emulator and is planning to write a series of post documenting my experience and maybe help anyone who also want to write one. I’ve recently wrote a NES Emulator NesChan. How to write your own NES emulator - overview
