https://github.com/dbalsom/opl3-rs
Rust bindings for the Nuked-OPL3 C Library
https://github.com/dbalsom/opl3-rs
Last synced: 4 months ago
JSON representation
Rust bindings for the Nuked-OPL3 C Library
- Host: GitHub
- URL: https://github.com/dbalsom/opl3-rs
- Owner: dbalsom
- License: lgpl-2.1
- Created: 2024-06-27T21:52:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-01T21:36:30.000Z (over 1 year ago)
- Last Synced: 2026-01-03T03:17:36.994Z (7 months ago)
- Language: Rust
- Size: 281 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
opl3-rs
=======
A small library to provide bindings for the [Nuked-OPL3 library](https://github.com/nukeykt/Nuked-OPL3).
[![Crates.io version][crate-img]][crate]
[![Changelog][changelog-img]](CHANGELOG.md)
[![Documentation][docs-img]][docs]
# Usage
Nuked-OPL3 is not a turn-key implementation of the OPL3 chip - functions such as the status register, timers and
interrupts are left as implementation details.
You can access the Nuked-OPL3 API via the `Opl3Chip` struct, if needed, but with the caveat that directly writing
registers to Nuked-OPL3 will prevent you from reading the OPL registers correctly.
If you intend to utilize `opl3-rs` in an emulator, you will probably want to use the `Opl3Device` wrapper which provides
a full, device-oriented OPL3 implementation including the status, address and data registers, plus the OPL3 timers.
# Docs
Documentation can be found on [docs.rs](https://docs.rs/opl3-rs/latest/opl3_rs/)
# Examples
An example of music playback is provided in the play_tune directory under /examples.
This example uses the rodio library for audio playback and crossbeam channels for inter-thread communication.
opl3-rs was primarily built for use with the [MartyPC PC emulator](https://github.com/dbalsom/martypc). It is used to
implement an AdLib Music Card device.
https://github.com/dbalsom/opl3-rs/assets/7229541/d78d4e90-71ed-4841-a963-9b09f25974c1
# Credits
[Nuked-OPL3](https://github.com/nukeykt/Nuked-OPL3) is (C) 2013-2020 Nuke.YKT and licensed under LGPL 2.1
play_tune example based off code by Maarten Janssen and Peter De Wachter.
[crate]: https://crates.io/crates/opl3-rs
[crate-img]: https://img.shields.io/crates/v/opl3-rs.svg
[changelog-img]: https://img.shields.io/badge/changelog-online-blue.svg
[docs]: https://docs.rs/opl3-rs
[docs-img]: https://img.shields.io/badge/docs-online-blue.svg