Skip to content

Commit

Permalink
feat: android port (#4)
Browse files Browse the repository at this point in the history
* wip: initial app

* update: gitignore

* feat: implement audio playback

* update: refactor & UI improvements

* update: add back handler & button effects

* refactor: remove trailing new lines

* feat: menu, settings & UI updates

* update: improve UI

* wip: metadata

* update: improve ui

* refactor: json as feature

* fix: compilation

* update: refactor, floating settings

* update: ui, themes

* fix: libs

* feat: shortcut

* feat: push reload, tags

* refactor: cleanup

* feat: custom palette

* wip: info screen

* feat: open source license

* fix: license

* update: README.md
  • Loading branch information
luckasRanarison authored Nov 29, 2024
1 parent 9095777 commit 7368726
Show file tree
Hide file tree
Showing 113 changed files with 3,673 additions and 23 deletions.
48 changes: 48 additions & 0 deletions Cargo.lock

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

72 changes: 66 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@

# Mes

A decent NES emulator built for the Web using Rust and WebAssembly. Try it [now](https://luckasranarison.github.io/mes/).
A decent multiplatform NES emulator built using Rust. Try it [now](https://luckasranarison.github.io/mes/) in your browser.

## Contents
- [Supported platforms](#supported-platforms)
- [Features](#features)
- [Mappers](#mappers)
- [Build](#build)
- [Resources](#resources)

## Supported platforms

- [x] Web
- [x] Android
- [ ] Desktop
- [ ] Embedded (ESP32)

## Features

- Almost cycle accurate emulation
- Supports [iNES 1.0](https://www.nesdev.org/wiki/INES) file format
- Supports basic [mappers](#mappers)
- Fairly decent audio quality
Expand All @@ -21,12 +34,59 @@ A decent NES emulator built for the Web using Rust and WebAssembly. Try it [now]
- [UXROM](https://nesdir.github.io/mapper2.html) (2)
- [CNROM](https://nesdir.github.io/mapper2.html) (3)

## TODOs
## Build

> [!IMPORTANT]
> The Rust [toolchain](https://rustup.rs/) is required to build the main library.
### Web

![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=for-the-badge&logo=vite&logoColor=white)
![WebAssembly](https://img.shields.io/badge/WebAssembly-654FF0?logo=webassembly&logoColor=fff&style=for-the-badge)

**Requirements**:

- [NodeJS](https://nodejs.org/en)
- [wasmpack](https://rustwasm.github.io/wasm-pack/)

**Scripts**:

```bash
npm run wasm # build the WASM artifacts using wasmpack
npm run dev # run the dev server
npm run build # build the website
```

### Android

![Kotlin](https://img.shields.io/badge/kotlin-%237F52FF.svg?style=for-the-badge&logo=kotlin&logoColor=white)

**Requirements**:

- [Android studio](https://developer.android.com/studio)
- [NDK](https://developer.android.com/ndk)
- `aarch64-linux-android` and `x86_64-linux-android` Rust targets

**Setup**:

Edit your global cargo config in `~/.cargo/cargo.toml` and use linkers from NDK:

```toml
[target.aarch64-linux-android]
linker = "your-ndk-pah/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang"

[target.x86_64-linux-android]
linker = "your-ndk-pah/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android34-clang"
```

**Gradle scripts**:

- [ ] Settings interface (controllers, palette, ...)
- [ ] Versions for other platforms (mobile, desktop, ...)
- `buildRustArm64`: Build the shared library for arm64
- `buildRustx86_64`: Build the shared library for x86_64
- `buildRs`: Runs both

## References
## Resources

This project wouldn't have been possible without the help of the following ressources:

Expand Down
17 changes: 17 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
*.so
app/release
3 changes: 3 additions & 0 deletions android/.idea/.gitignore

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

1 change: 1 addition & 0 deletions android/.idea/.name

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

26 changes: 26 additions & 0 deletions android/.idea/appInsightsSettings.xml

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

123 changes: 123 additions & 0 deletions android/.idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions android/.idea/codeStyles/codeStyleConfig.xml

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

6 changes: 6 additions & 0 deletions android/.idea/compiler.xml

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

18 changes: 18 additions & 0 deletions android/.idea/deploymentTargetSelector.xml

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

Loading

0 comments on commit 7368726

Please sign in to comment.