All Projects → elzo-d → SnesJs

elzo-d / SnesJs

Licence: MIT License
A SNES emulator, in javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to SnesJs

Provenance
iOS & tvOS multi-emulator frontend, supporting various Atari, Bandai, NEC, Nintendo, Sega, SNK and Sony console systems… Get Started: https://wiki.provenance-emu.com |
Stars: ✭ 4,732 (+16800%)
Mutual labels:  emulator, snes
ness
A work-in-progress SNES emulator written in Rust
Stars: ✭ 31 (+10.71%)
Mutual labels:  emulator, snes
breeze-emu
SNES emulator written in Rust
Stars: ✭ 40 (+42.86%)
Mutual labels:  emulator, snes
FEX
A fast usermode x86 and x86-64 emulator for Arm64
Stars: ✭ 650 (+2221.43%)
Mutual labels:  emulator
Emux
GameBoy emulator written in C#
Stars: ✭ 58 (+107.14%)
Mutual labels:  emulator
android-image-preview-docs
Docs for the preview of the Android machine image on CircleCI
Stars: ✭ 18 (-35.71%)
Mutual labels:  emulator
chip8emu
A Terminal Based Chip-8 Emulator
Stars: ✭ 28 (+0%)
Mutual labels:  emulator
emul8080r
An Intel 8080 emulator written in Swift
Stars: ✭ 17 (-39.29%)
Mutual labels:  emulator
HXCFE file selector
HxC Floppy Emulator file selector
Stars: ✭ 27 (-3.57%)
Mutual labels:  emulator
retro-computing
🤓🕹💾 This hobby project contains software implementations of old microprocessors and complete computer systems. I'm very interested in retrocomputing and this is how I learn about the inner workings of these old, classic and amazing computers and game consoles.
Stars: ✭ 15 (-46.43%)
Mutual labels:  emulator
SherwoodArch
The Sherwood Architecture is a custom 64-Bit RISC based CPU architecture.
Stars: ✭ 13 (-53.57%)
Mutual labels:  emulator
webretro
RetroArch in your browser
Stars: ✭ 38 (+35.71%)
Mutual labels:  emulator
accordion
Android accordion emulator
Stars: ✭ 23 (-17.86%)
Mutual labels:  emulator
go6502
6502 CPU emulator, assembler and disassembler written in Go
Stars: ✭ 31 (+10.71%)
Mutual labels:  emulator
i8080-Space-Invaders
Intel i8080 Space Invaders Arcade Emulator
Stars: ✭ 19 (-32.14%)
Mutual labels:  emulator
chip8
CHIP-8 emulator and (dis)assembler
Stars: ✭ 15 (-46.43%)
Mutual labels:  emulator
unity3d-super-metroid
An open-source Unity3D implementation of the SNES Super Metroid game
Stars: ✭ 25 (-10.71%)
Mutual labels:  snes
bot
Completely free and open-source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any Android device 5.0+ that can run Instagram - real or emulated.
Stars: ✭ 321 (+1046.43%)
Mutual labels:  emulator
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-35.71%)
Mutual labels:  emulator
bevm
Basic computer emulator
Stars: ✭ 20 (-28.57%)
Mutual labels:  emulator

SnesJs

A SNES emulator, in javascript

Try it online here.

Note

I don't think I will continue working on this Javascript emulator.

Although it is a nice proof of concept, not being able to run at full speed (on my hardware) makes working on it quite annoying. I originally started it because my Javascript NES emulator (here) ran full speed (on my hardware) quite easily, even though it it not really optimised at all. This made me think emulating the SNES full speed might be possible as well. This however does not seem to be the case.

I have instead decided to work on a SNES emulator in C, over here. It has better performance (although still not all that good, but at least it runs full speed) and some of the bugs and shortcomings this emulator has are not present in the C version. I might look into using Emscripten to have that core run in the browser and use it in this emulator, instead of using the current all-Javascript core.

About

This was my attempt at making a SNES emulator in Javascript. It is currently able to run some of the earlier games in the library with mostly correct audio. It is however extremely slow, on a 5th gen Core i5 it is not able to run at full speed. Even on systems where it is able to run at full speed it would still use way more CPU than a SNES emulator should really take.

The 65816 CPU is fully functional, but emulation mode is not supported. It is also not cycle-accurate.

The PPU is able to render most things fine. There are some issues with color math, mosaic and offset-per-tile, and other small things that are not quite right yet. It renders per scanline, so mid-scanline effects are not supported.

DMA, HDMA and the other misc. features are supported, but not cycle-accurate.

The SPC700 audio CPU is emulated, but is not cycle accurate.

The DSP (audio generation unit) is mostly emulated, but is missing the echo. Most games sound mostly right, but there are still some issues.

Although some games seem to run fine, quite a few games are not emulated properly. The file bugs.md contains a list of games that have been tested and the problems they have. Most of these bugs are probably caused by some known problems with the PPU and missing edge cases for (H)DMA and timing.

It can currently only load LOROM games.

Roms can be loaded from zip-files as well, which will load the first file with a .sfc or .smc extension it can find.

The spcplayer.html file, linked from the main emulator as well, contains SpcJs, an SPC player using just the APU portion of the emulator. Not all SPC files play correctly, but most seem to work.

Note that it currently assumes the AudioContext uses a sample rate of 44100, audio will sound somewhat incorrect if it's not.

Controls

Controller 1 and 2 are emulated as plugged in, but only controller 1 has controls set up.

Button Keyboard
D-pad up Up arrow key
D-pad down Down arrow key
D-pad left Left arrow key
D-pad right Right arrow key
Start Enter
Select Shift
A X
B Z
X S
Y A
L D
R C
  • Pressing L will toggle 'log-mode', where it runs a single CPU-instruction each frame and logs it in trace-log format.
  • Pressing P will toggle 'no-PPU mode', where it will not emulate the PPU rendering. This allows it to run at full speed, and makes working on / listening to the DSP easier.

Usage

The emulator can be used online here.

To run the emulator offline:

  • Clone this repository.
  • Open index.js in a browser. Messing around with the browser's autoplay policy might be required.

The SpcJs link goes to a SPC player, which simply plays SPC files (most files seem to load correctly, but a few don't sound quite right). It shows the name, game, artist, dumper and comment from the SPC file, and a visualisation of the volume L & R (red & green), gain (yellow) and pitch (blue) for each channel (1 to 8, from left to right). Pressing L toggles 'log-mode', where it runs a single SPC-instruction each frame and logs it in trace-log format.

Resources

Resources that I used for implementing this:

License

Licensed under the MIT License. See LICENSE.txt for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].