Skip to content

Commit

Permalink
Merge pull request #31 from YushiOMOTE/gamepad-support
Browse files Browse the repository at this point in the history
Add gamepad support
  • Loading branch information
YushiOMOTE authored Jul 14, 2024
2 parents 3adf051 + 127df3e commit ae8fea9
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libasound2-dev libxcursor-dev
sudo apt install libasound2-dev libxcursor-dev libudev-dev
- run: cargo fmt --check
- run: cargo clippy --workspace --examples --tests --benches
- run: cargo build --verbose
Expand Down
188 changes: 185 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,29 @@ No-std cross-platform Rust GameBoy emulator library. Rust GameboY (RGY, or Real
$ cargo run --example pc <a ROM file>
```

The example runs the GameBoy emulator in Mac/Linux.
It depends on `libasound2-dev` and `libxcursor-dev`.
The example runs the GameBoy emulator in Mac/Linux/Windows.

### Dependencies

On Ubuntu, you need to install these packages:

```
$ sudo apt install libasound2-dev libxcursor-dev libudev-dev
```

### Key bindings

| Keyboard | GameBoy |
|----------|---------|
| Right | Right |
| Left | Left |
| Up | Up |
| Down | Down |
| Z | A |
| X | B |
| Space | Select |
| Enter | Start |
| Escape | Close |
| Keyboard | Gamepad | GameBoy |
|-----------|--------------|---------|
| Up / W | DPad Up | Up |
| Left / A | DPad Left | Left |
| Down / S | DPad Down | Down |
| Right / D | DPad Right | Right |
| K / X | South / East | A |
| J / Z | West / North | B |
| Space | Select | Select |
| Enter | Start | Start |
| Escape | - | Close |

## Port it to a new environment

Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cpal = "0.9"
signal-hook = "0.3"
core_affinity = "0.8"
utils = { path = "../utils" }
gilrs = "0.10.8"


[features]
Expand Down
Loading

0 comments on commit ae8fea9

Please sign in to comment.