Meziu / rust-horizon

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
3 stars 1 forks source link

Enable argv support for horizon OS #9

Closed ian-h-chamberlain closed 2 years ago

ian-h-chamberlain commented 2 years ago

With 3dslink and the hbmenu there is builtin support for passing argv directly to a 3dsx binary. This enables reading them instead of the stub implementation used by espidf.

Example, with this patch and latest version of 3dslink and hbmenu:

//...
println!("{:?}", std::env::args().collect::<Vec<_>>());
//...
3dslink target/armv6k-nintendo-3ds/debug/examples/hello-world.3dsx -0 hello-world -- --x -y z

argv-example

@Meziu @AzureMarker

AzureMarker commented 2 years ago

Oh nice, this also works towards enabling stack overflow protection in main (the stackoverflow imp module is still a no-op).