Integrating an example

This commit is contained in:
Conando 2024-02-26 00:27:18 +01:00
parent 3f315a25c9
commit b419d1f7ef
7 changed files with 90 additions and 34 deletions

26
Cargo.lock generated
View File

@ -2,35 +2,9 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "libc"
version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "libc-print"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c17f111e2175c779daaf5e89fe3a3b0776b0adec218bc1159c56e4d3f58032f5"
dependencies = [
"libc",
]
[[package]]
name = "libc_alloc"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a835c038b748123287f9fb1743d565e7c635879997f43c345a18a026690364e"
[[package]] [[package]]
name = "nitro-rs" name = "nitro-rs"
version = "0.0.1" version = "0.0.1"
dependencies = [
"libc",
"libc-print",
"libc_alloc",
]
[[package]] [[package]]
name = "nitro-rs_examples" name = "nitro-rs_examples"

View File

@ -1,3 +1,7 @@
# Shameless ripoff # Shameless ripoff
This is copying the work of <https://github.com/devkitPro/libnds> that therefore also just disregards the copyright This is copying the work of <https://github.com/devkitPro/libnds> to Rust
## Example
To run the examples cargo-nds is used

42
armv5te-nintendo-ds.json Normal file
View File

@ -0,0 +1,42 @@
{
"abi": "eabi",
"arch": "arm",
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
"env" : "newlib",
"exe-suffix" : ".arm9_elf",
"is-builtin": false,
"linker": "arm-none-eabi-gcc",
"llvm-target": "armv5te-none-gnu",
"relocation-model": "static",
"target-pointer-width": "32",
"max-atomic-width": 32,
"disable-redzone": true,
"emit-debug-gdb-scripts": false,
"features" : "+soft-float,+strict-align,+atomics-32",
"panic-strategy" : "abort",
"linker-is-gnu": true,
"target-family": [
"unix"
],
"no-default-libraries": false,
"main-needs-argc-argv":"false",
"pre-link-args": {
"gcc": [
"-specs=ds_arm9.specs",
"-g",
"-mthumb",
"-mthumb-interwork",
"-mtune=arm946e-s",
"-fomit-frame-pointer",
"-ffast-math"
]
},
"post-link-args" : {
"gcc": [
"-Wl,--allow-multiple-definition"
]
},
"vendor" : "nintendo",
"os" : "nintendo_ds_arm9"
}

1
devkitpro_tools Normal file
View File

@ -0,0 +1 @@
export PATH="/opt/devkitpro/tools/bin:/opt/devkitpro/devkitARM/bin:$PATH"

View File

@ -1,10 +1,11 @@
[package] [package]
name = "nitro-rs_examples" name = "nitro-rs_examples"
version = "0.0.1" version = "0.0.1"
edition = "2021"
[[bin]] [[bin]]
name = "mvp" name = "mvp"
path = "mpv/main.rs" path = "mvp/main.rs"
[dependencies] [dependencies]
nitro-rs = { path = "../lib" } nitro-rs = { path = "../lib" }

View File

@ -4,8 +4,3 @@ version = "0.0.1"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
libc = {version = "0.2.121", default-features = true}
libc_alloc = "1.0.4"
libc-print = "0.1.20"

39
thumbv4t-nintendo-ds.json Normal file
View File

@ -0,0 +1,39 @@
{
"abi": "eabi",
"arch": "arm",
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
"env" : "newlib",
"exe-suffix" : ".arm7_elf",
"is-builtin": false,
"linker": "arm-none-eabi-gcc",
"llvm-target": "thumbv4t-none-eabi",
"relocation-model": "static",
"target-pointer-width": "32",
"max-atomic-width": 32,
"features" :"+soft-float,+strict-align,+atomics-32",
"panic-strategy" : "abort",
"emit-debug-gdb-scripts": false,
"disable-redzone" : true,
"function-sections": true,
"target-family": [
"unix"
],
"no-default-libraries": false,
"pre-link-args": {
"gcc": [
"-specs=ds_arm7.specs",
"-g",
"-march=armv4t",
"-mthumb-interwork",
"-mcpu=arm7tdmi",
"-mthumb",
"-mtune=arm7tdmi",
"-fomit-frame-pointer",
"-ffast-math"
]
},
"main-needs-argc-argv":"false",
"vendor" : "nintendo",
"os" : "nintendo_ds_arm7"
}