diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index 4d4666a..1f11b6c 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -8,12 +8,14 @@ pub struct Soc { impl Soc { pub fn init() -> ::Result { - const SOC_MEM_SIZE: usize = 0x100000; + Soc::init_with_buffer_size(0x100000) + } + pub fn init_with_buffer_size(num_bytes: usize) -> ::Result { unsafe { - let soc_mem = memalign(0x1000, SOC_MEM_SIZE) as *mut u32; + let soc_mem = memalign(0x1000, num_bytes) as *mut u32; - let r = socInit(soc_mem, SOC_MEM_SIZE as u32); + let r = socInit(soc_mem, num_bytes as u32); if r < 0 { Err(r.into()) } else {