From cdb7e4550075f124b9aab8e42396bbb64865fc83 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 7 May 2022 16:13:49 -0400 Subject: [PATCH] Add doc comment for usage + clear screen --- ctru-rs/examples/output-3dslink.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ctru-rs/examples/output-3dslink.rs b/ctru-rs/examples/output-3dslink.rs index fd5a526..36ae187 100644 --- a/ctru-rs/examples/output-3dslink.rs +++ b/ctru-rs/examples/output-3dslink.rs @@ -1,3 +1,13 @@ +//! Use the `3dslink --server` option for redirecting output from the 3DS back +//! to the device that sent the executable. +//! +//! For now, `cargo 3ds run` does not support this flag, so to run this example +//! it must be sent manually, like this: +//! ```sh +//! cargo 3ds build --example output-3dslink +//! 3dslink --server target/armv6k-nintendo-3ds/debug/examples/output-3dslink.3dsx +//! ``` + use ctru::gfx::Gfx; use ctru::services::apt::Apt; use ctru::services::hid::{Hid, KeyPad}; @@ -14,6 +24,8 @@ fn main() { soc.redirect_to_3dslink(true, true) .expect("unable to redirect stdout/err to 3dslink server"); + print!("\x1b[2J\x1b[0;0H"); // Clear screen + move to 0,0 + println!("Hello 3dslink!"); eprintln!("Press Start on the device to disconnect and exit.");