Rust wrapper for libctru
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andor Uhlár abd30e5e4b No need for implicit core imports anymore 9 years ago
src No need for implicit core imports anymore 9 years ago
.gitignore Initial commit. 10 years ago
3ds.json Initial commit. 10 years ago
Cargo.toml Initial commit. 10 years ago
README.md Initial commit. 10 years ago
build.rs Initial commit. 10 years ago
rawunused.rs Add linkage for a large number of ctrulib stuff. 10 years ago

README.md

ctru-rs

A Rust wrapper library for smealum's ctrulib. Intended for use only when targeting CTR.

How to build

  1. Install the devkitARM toolchain for your system. Make sure DEVKITPRO is set in your environment.
  2. Modify ~/.cargo/config and add the following lines:
    [target.3ds]
    ar = "/path/to/arm-none-eabi-ar"
  1. Build with cargo build --target 3ds.json.
  2. A dkA linkable .rlib (static library) will be generated. Read below for instructions on using.

How to use

You can build your homebrew projects through Cargo just as easily as any other platform. Add this to your Cargo.toml:

    [dependencies.core]
    git="https://github.com/hackndev/rust-libcore"

    [dependencies.ctru-rs]
    git="https://github.com/Furyhunter/ctru-rs"

Copy the 3ds.json target file to your project root and pass --target 3ds.json whenever building. The instructions above for cargo configuration and environment still apply. It's recommended that you put the bin dir in your dkA root to your path.

Your homebrew's crate must specify that it does not use std, because std is not available for the 3ds. core is a small subset of std's functionality that is platform agnostic. You can use core::prelude::* to recover much of std's prelude, after extern crate core. This library makes use of core only.

Contributing

This is a thin wrapper library only, any additional Rust-centric support code for the 3DS will be put into another package. However, the wrapper is incomplete, so PR's to finish it are helpful.