meziu/ctru-rs

A Rust wrapper library for smealum's ctrulib

A Rust wrapper library for smealum's LICENSE-APACHE, COPYRIGHT for details

ctru-rs

A Rust wrapper library for smealum's ctrulib.

Structure

This repository is organized as follows:

  • ctru-rs: Safe, idiomatic wrapper around ctru-sys.
  • ctru-sys: Low-level, unsafe bindings to ctrulib

License

Copyright (C) Rust 3DS Project authors, 2015-2016

See AUTHORS.md.

As with the original ctrulib, this library is licensed under zlib. This applies to every file in the tree, unless otherwise noted.

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any
damages arising from the use of this software.

Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you
   must not claim that you wrote the original software. If you use
   this software in a product, an acknowledgment in the product
   documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
   must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
   distribution.

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

Issues

Collection of the latest Issues

Meziu

Meziu

Comment Icon45

Continuing off #56 discussions. @ian-h-chamberlain @AzureMarker

The new example in the test/rapier-physics branch doesn’t run correctly.

While the actual panic (which catches a potential ARM Exception) is situated in the thread_info::set function in std, the actual problem is only present when a specific function call from the rapier2d crate is present, and only at opt-level = 0, in either release or debug mode.

We can thus speculate it’s either an issue with optimisations during the compilation process, a stack fault, or an overflow in the thread_local storage.

FenrirWolf

FenrirWolf

Comment Icon8

Fun fact, libctru supports life before and after main in the appInit and appExit functions. You can hook into this system by defining extern "C" fn userAppInit() and extern "C" fn userAppExit() functions and putting any* library-level setup/teardown code you want in them.

*Well, some things in the Rust stdlib aren't safe to call before or after main. But 3DS service initialization and even panic hook registration should be fine to do there.

ian-h-chamberlain

ian-h-chamberlain

Comment Icon1

Obviously, this library is still in early stages, and I don't expect there to be a ton of documentation at this point, but I think having good docs will be important for users and others looking to contribute.

A couple points I can think of right off the bat:

  • Use rustdoc lints to check for missing docstrings and fix where relevant
  • Investigate removing --no-doc-comments from bindgen.sh. There seem to be a pretty decent amount of doc comments in libctru, so having these readily available in Rust might be nice, even if they're written in a different format than rustdoc expects.
  • Doctests? Unfortunately not much of a possibility for this library, although we might be able to use no_run and at least verify examples compile.
  • Simply write docstrings for new code as it comes along. This alone will probably help a lot.

Long-term, if the crates are published to crates.io and then we can get nice docs on docs.rs! I have already been using cargo 3ds doc a bit to start out, with some success.

Edit: command to check doc lints looks like

Although that is a bit heavy handed – we may not want all lints in the end.

ian-h-chamberlain

ian-h-chamberlain

Comment Icon4

I haven't figured out why, but it seems like printing to the console sometimes isn't written to whatever buffer Luma uses when it takes a screenshot. It would be nice if we can work around this, since taking screenshots is one of the few ways available to share debug state of a hardware device.

Meziu

Meziu

Comment Icon2

The crate needs to be deeply tested (some features, like Consoles, were already damaged when I forked the library, due to changes in libctru's inner workings). Testing the crate and modifying outdated modules is a priority.

Information - Updated Jul 17, 2022

Stars: 9
Forks: 2
Issues: 6

Repositories & Extras

Rust library for Self Organising Maps (SOM)

Add rusticsom as a dependency in Cargo

Rust library for Self Organising Maps (SOM)

Rust library for parsing configuration files

The 'option' can be any string with no whitespace

Rust library for parsing configuration files

Rust library for the Pimoroni Four Letter pHAT

This library aims to port ht16k33 (or rather a fork, as of right now) so credit goes to ht16k33-diet

Rust library for the Pimoroni Four Letter pHAT

Rust library for emulating 32-bit RISC-V

This library can execute instructions against any memory and register file that implements

Rust library for emulating 32-bit RISC-V

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

You can use actix-web as a backend instead of hyper

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

enabling remote control support for embedded project

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

open up an issue on this repository and let us know

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

Rust library for parsing COLLADA files

Notice: This library is built around files exported from Blender 2

Rust library for parsing COLLADA files

web-library-rust

A basic CRUD application that represents books in a library

web-library-rust
Facebook Instagram Twitter GitHub Dribbble
Privacy