This commit is contained in:
Lokathor 2018-12-08 01:53:37 -07:00
parent 6e89a16bbf
commit 9c547a62b1
3 changed files with 20 additions and 12 deletions

View file

@ -16,7 +16,7 @@ before_script:
- cargo install-update -a
script:
# Obtain the devkitPro tools, using target as a temp directory
# Obtain the devkitPro tools, using `target/` as a temp directory
- mkdir -p target
- cd target
- wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb

View file

@ -1,12 +1,16 @@
# Rust GBA Guide
* Introduction
* Goals Of This Book
* Prerequisites
* Reader Requirements
* Book Goals and Style
* Getting Outside Help
* Development Setup
* Hello Magic
* Volatile
* GBA Limitations
* No Floats
* Core Only
* Volatile Destination
* Broad Concepts
* BIOS
* Working RAM
@ -16,13 +20,13 @@
* Object Attribute Memory
* Game Pak ROM / Flash ROM
* Save RAM
* Video Modes
* Video
* RBG15 Color
* Bitmap Modes
* Tiled Modes
* Affine Math
* Special Effects
* Non-Video Hardware
* Non-Video
* Buttons
* Timers
* Direct Memory Access
@ -31,4 +35,7 @@
* Network
* Game Pak
* Examples
* for example in example_list
* hello_magic
* hello_world
* light_cycle
* bg_demo

View file

@ -2,6 +2,7 @@
#![cfg_attr(not(test), feature(asm))]
#![warn(missing_docs)]
#![allow(clippy::cast_lossless)]
#![deny(clippy::float_arithmetic)]
//! This crate helps you write GBA ROMs.
//!
@ -77,11 +78,11 @@ pub fn div_modulus(numerator: i32, denominator: i32) -> (i32, i32) {
let mod_out: i32;
unsafe {
asm!(/* assembly template */ "swi 0x06"
:/* output operands */ "={r0}"(div_out), "={r1}"(mod_out)
:/* input operands */ "{r0}"(numerator), "{r1}"(denominator)
:/* clobbers */ "r3"
:/* options */
);
:/* output operands */ "={r0}"(div_out), "={r1}"(mod_out)
:/* input operands */ "{r0}"(numerator), "{r1}"(denominator)
:/* clobbers */ "r3"
:/* options */
);
}
(div_out, mod_out)
}