Skip to content

Commit

Permalink
Merge pull request #11 from YushiOMOTE/readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
YushiOMOTE authored Dec 14, 2019
2 parents 0c3d6e5 + b4d483e commit 4a99436
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 17 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ jobs:
toolchain: nightly
override: true
- name: Build (nightly)
run: |
cd core
cargo build --verbose --features readme
run: cargo build --verbose
- name: Build examples (nightly)
run: |
cd core
cargo build --verbose --examples --features readme
run: cargo build --verbose --examples
- name: Test (nightly)
run: |
cd core
cargo test --verbose --features readme
run: cargo test --verbose
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,42 @@ No-std cross-platform Rust GameBoy emulator library. Rust GameboY (RGY, or Real
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Actions Status](https://github.com/YushiOMOTE/rgy/workflows/Rust/badge.svg)](https://github.com/YushiOMOTE/rgy/actions)

![demo](https://raw.github.com/wiki/YushiOMOTE/gbr/media/demo.gif)
![screens](https://raw.github.com/wiki/YushiOMOTE/gbr/media/demo_screens.jpg)
<img src="https://raw.github.com/wiki/YushiOMOTE/gbr/media/demo.gif" width="450" />
<img src="https://raw.github.com/wiki/YushiOMOTE/gbr/media/demo_screens_2.jpg" width="450" />

### Usage

Once you implement OS-specific part, i.e. `Hardware` trait, you will get a GameBoy emulator for your environment.

```rust
struct Hardware;

// 1. Implement `rgy::Hardware`.
impl rgy::Hardware for Hardware {
...
}

// 2. Call `rgy::run`.
fn main() {
let cfg = Config::new();
let rom = include_bytes!("rom,gb");
rgy::run(cfg, &rom, Hardware);
}
```

### Example

```
$ cargo run --example pc <a ROM file>
```

The example runs the GameBoy emulator in UNIX environment. It depends on `libasound2-dev` and `libxcursor-dev`.
The ROM files can be easily downloaded from the Internet.

### Projects

The following projects use this library to run a GameBoy emulator.

* [stickboy](https://github.com/yushiomote/stickboy) runs a GameBoy emulator on Macbook Pro (UEFI).
* [biboy](https://github.com/yushiomote/biboy) runs a GameBoy emulator on BIOS PC.
* [waboy](https://github.com/yushiomote/waboy) runs a GameBoy emulator on web browsers (wasm).
3 changes: 1 addition & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://github.com/yushiomote/rgy"
repository = "https://github.com/yushiomote/rgy"
documentation = "https://docs.rs/rgy"
license = "MIT"
readme = "README.md"
readme = "../README.md"

[dependencies]
lazy_static = { version = "1.2", features = ["spin_no_std"] }
Expand All @@ -29,4 +29,3 @@ core_affinity = "0.5"
[features]
default = []
color = []
readme = []
4 changes: 0 additions & 4 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,8 @@
//! ```

#![no_std]
#![cfg_attr(feature = "readme", feature(external_doc))]
#![warn(missing_docs)]

#[cfg_attr(feature = "readme", doc(include = "../../README.md"))]
type _Doctest = ();

extern crate alloc;

mod alu;
Expand Down

0 comments on commit 4a99436

Please sign in to comment.