#c64 #commodore #emulator #resid #sid

resid-rs

Port of reSID, a MOS6581 SID emulator engine, to Rust

15 releases (4 stable)

✓ Uses Rust 2018 edition

1.0.3 Jul 5, 2019
1.0.1 Jan 6, 2019
0.9.0 Dec 28, 2018
0.8.0 Aug 31, 2018
0.4.2 Dec 28, 2017

#2 in Emulators

Download history 16/week @ 2019-04-20 16/week @ 2019-04-27 35/week @ 2019-05-04 23/week @ 2019-05-11 37/week @ 2019-05-18 56/week @ 2019-05-25 14/week @ 2019-06-01 88/week @ 2019-06-08 6/week @ 2019-06-15 116/week @ 2019-06-22 56/week @ 2019-06-29 66/week @ 2019-07-06 3/week @ 2019-07-13 7/week @ 2019-07-20 9/week @ 2019-07-27

157 downloads per month
Used in 5 crates (1 directly)

GPL-3.0+

390KB
2.5K SLoC

resid-rs

Build Status Crates.io

Overview

Port of reSID, a MOS6581 SID emulator engine, to Rust.

Story

This project originated from zinc64, a Commodore 64 emulator, around Jan 2017. It evolved to the point where it can be useful to others working on C64 sound/emulation so it is packaged and shipped as a standalone crate.

Usage

Once SID register read/writes are wired up to resid, all that is left to do is to generate audio samples and push them to audio output buffer.

while delta > 0 {
    let (samples, next_delta) = self.resid.sample(delta, &mut buffer[..], 1);
    let mut output = self.sound_buffer.lock().unwrap();
    for i in 0..samples {
        output.write(buffer[i]);
    }
    delta = next_delta;
}

Components

Component Status
Envelope Done
ExternalFilter Done
Filter Done
Sampler Done
Spline Done
Wave Done
Sid Done

Changelog

  • 0.3 - compliance with the original resid
  • 0.4 - full sampler support
  • 0.5 - closed performance gap largely due to resampling
  • 0.6 - SIMD optimization
  • 0.7 - continuous integration and GPLv3
  • 0.8 - documentation and api refinements/internal cleanup
  • 0.9 - migration to Rust 2018
  • 1.0 - no_std support

Credits

  • Thanks to Dag Lem for his reSID implementation
  • Thanks to Daniel Collin for motivating me to put this out and helping out with code optimization
  • Commodore folks for building an iconic 8-bit machine
  • Rust developers for providing an incredible language to develop in

Dependencies