A Super Nintendo audio unit emulator.
This is a highly-accurate emulator for the audio portion of the Super Nintendo.
Included is an example that can play SPC files:
cargo run --release --example spc_player -- test/ferris-nu.spc test/smashit.spc
The audio unit is made up of a few major parts: - A CPU (SPC700 core), which is 100% cycle-accurate and shouldn't contain any bugs (unless some slipped in during the port) - A DSP, which is accurate to the nearest audio sample - 64kb RAM - 3 timers, which are 100% accurate - And some extra glue here and there :)
Originally written in C++, this emulator serves as a pilot for porting all of my emulator infrastructure to Rust, and it's been a rather successful project thus far.
Currently, the code uses some unsafe code in a few places for internal mutability without runtime checks. Proper wrapping types are also not currently used, so the emu can only run properly if built in the release config. Both of these issues will be addressed at some point.
Additional issues can be found in the issue tracker on Github.
Included in the test
directory are a couple of test SPC files:
- ferris-nu.spc
- soundtrack for "nu" by elix
- smashit.spc
- soundtrack for "Smash It" by elix
Much of the core SMP code was baked from byuu's higan source code: http://byuu.org/emulation/higan/ Linewise, some of the DSP code (envelopes in particular) was deep-fried from blargg's snesspc code: http://blargg.8bitalley.com/libs/audio.html#snesspc
Without their awesome work, this project wouldn't exist!
This code is licensed under the BSD2 license (see LICENSE).