mirror of
https://github.com/XorTroll/emuiibo.git
synced 2024-11-26 19:10:30 +00:00
Update for latest libs
This commit is contained in:
parent
550e5c8634
commit
4cb95fbc01
46
emuiibo/Cargo.lock
generated
46
emuiibo/Cargo.lock
generated
@ -4,9 +4,9 @@ version = 3
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.5.2"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
||||
|
||||
[[package]]
|
||||
name = "emuiibo"
|
||||
@ -21,15 +21,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.9"
|
||||
version = "1.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
||||
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
||||
|
||||
[[package]]
|
||||
name = "linked_list_allocator"
|
||||
version = "0.9.1"
|
||||
version = "0.10.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "549ce1740e46b291953c4340adcd74c59bcf4308f4cac050fd33ba91b7168f4a"
|
||||
checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286"
|
||||
|
||||
[[package]]
|
||||
name = "logpacket"
|
||||
@ -39,7 +39,7 @@ source = "git+https://github.com/aarch64-switch-rs/logpacket#d807c993fb4578e3809
|
||||
[[package]]
|
||||
name = "nx"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/aarch64-switch-rs/nx#6fdf0deb0261fd927313ad2f6e6e3d47ce481cde"
|
||||
source = "git+https://github.com/aarch64-switch-rs/nx#6a667357275a7700ee98c89fe2e27227261c0fb0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"linked_list_allocator",
|
||||
@ -56,42 +56,42 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.66"
|
||||
version = "1.0.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
|
||||
checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.33"
|
||||
version = "1.0.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.15"
|
||||
version = "1.0.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
||||
checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.188"
|
||||
version = "1.0.197"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
|
||||
checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.188"
|
||||
version = "1.0.197"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
|
||||
checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -100,9 +100,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.105"
|
||||
version = "1.0.115"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360"
|
||||
checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
@ -117,9 +117,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.29"
|
||||
version = "2.0.58"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"
|
||||
checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -128,6 +128,6 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.11"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
@ -1,3 +1,4 @@
|
||||
use nx::ipc::sf::ncm;
|
||||
use nx::result::*;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use alloc::string::String;
|
||||
@ -132,8 +133,8 @@ pub struct VirtualAmiiboAreaEntry {
|
||||
pub access_id: nfp::AccessId
|
||||
}
|
||||
|
||||
// Retail Interactive Display Menu (a quite symbolic ID)
|
||||
pub const DEFAULY_EMPTY_AREA_PROGRAM_ID: u64 = 0x0100069000078000;
|
||||
// Retail Interactive Display Menu (quite a symbolic ID)
|
||||
pub const DEFAULY_EMPTY_AREA_PROGRAM_ID: ncm::ProgramId = ncm::ProgramId(0x0100069000078000);
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct VirtualAmiiboAreaInfo {
|
||||
@ -177,7 +178,7 @@ pub fn generate_areas_json(path: String) -> Result<Option<nfp::AccessId>> {
|
||||
let mut areas = VirtualAmiiboAreaInfo::empty();
|
||||
for access_id in &access_ids {
|
||||
let area_entry = VirtualAmiiboAreaEntry {
|
||||
program_id: DEFAULY_EMPTY_AREA_PROGRAM_ID,
|
||||
program_id: DEFAULY_EMPTY_AREA_PROGRAM_ID.0,
|
||||
access_id: *access_id
|
||||
};
|
||||
areas.areas.push(area_entry);
|
||||
@ -234,7 +235,7 @@ impl VirtualAmiibo {
|
||||
Ok(mii_charinfo_file.read_val()?)
|
||||
}
|
||||
else {
|
||||
let mut random_mii = miiext::generate_random_mii()?;
|
||||
let random_mii = miiext::generate_random_mii()?;
|
||||
let mut mii_charinfo_file = fs::open_file(mii_charinfo_path, fs::FileOpenOption::Create() | fs::FileOpenOption::Write() | fs::FileOpenOption::Append())?;
|
||||
mii_charinfo_file.write_val(&random_mii)?;
|
||||
Ok(random_mii)
|
||||
@ -257,18 +258,18 @@ impl VirtualAmiibo {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn register_area(&mut self, access_id: nfp::AccessId, program_id: u64) -> bool {
|
||||
pub fn register_area(&mut self, access_id: nfp::AccessId, program_id: ncm::ProgramId) -> bool {
|
||||
if self.has_application_area(access_id) {
|
||||
false
|
||||
}
|
||||
else {
|
||||
self.areas.areas.push(VirtualAmiiboAreaEntry { program_id, access_id });
|
||||
self.areas.areas.push(VirtualAmiiboAreaEntry { program_id: program_id.0, access_id });
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn ensure_area_registered(&mut self, access_id: nfp::AccessId, program_id: u64) {
|
||||
pub fn ensure_area_registered(&mut self, access_id: nfp::AccessId, program_id: ncm::ProgramId) {
|
||||
self.register_area(access_id, program_id);
|
||||
}
|
||||
|
||||
@ -317,12 +318,12 @@ impl VirtualAmiibo {
|
||||
self.notify_written()
|
||||
}
|
||||
|
||||
pub fn update_area_program_id(&mut self, access_id: nfp::AccessId, program_id: u64) -> Result<()> {
|
||||
pub fn update_area_program_id(&mut self, access_id: nfp::AccessId, program_id: ncm::ProgramId) -> Result<()> {
|
||||
self.ensure_area_registered(access_id, DEFAULY_EMPTY_AREA_PROGRAM_ID);
|
||||
|
||||
for area_entry in &mut self.areas.areas {
|
||||
if area_entry.access_id == access_id {
|
||||
area_entry.program_id = program_id;
|
||||
area_entry.program_id = program_id.0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -422,12 +423,12 @@ impl VirtualAmiibo {
|
||||
let cur_area = self.get_current_area();
|
||||
|
||||
let program_id = match cur_area {
|
||||
Some(ref area_entry) => area_entry.program_id,
|
||||
Some(ref area_entry) => ncm::ProgramId(area_entry.program_id),
|
||||
None => DEFAULY_EMPTY_AREA_PROGRAM_ID
|
||||
};
|
||||
let console_family = {
|
||||
// 0x0100 for Switch, 0x0004 for 3DS, 0x0005 for Wii U
|
||||
match program_id >> 48 {
|
||||
match program_id.0 >> 48 {
|
||||
0x0100 => nfp::ConsoleFamily::NintendoSwitch,
|
||||
0x0004 => nfp::ConsoleFamily::Nintendo3DS,
|
||||
0x0005 => nfp::ConsoleFamily::NintendoWiiU,
|
||||
|
@ -4,6 +4,7 @@ use crate::fsext;
|
||||
use super::{bin, compat, fmt};
|
||||
use alloc::string::ToString;
|
||||
use nx::fs;
|
||||
use nx::ipc::sf::ncm;
|
||||
use nx::result::*;
|
||||
use alloc::string::String;
|
||||
|
||||
@ -45,7 +46,7 @@ impl compat::DeprecatedVirtualAmiiboFormat for VirtualAmiibo {
|
||||
// Save application area if present
|
||||
if plain_bin.dec_data.settings.flags.contains(bin::Flags::ApplicationAreaUsed()) {
|
||||
let access_id = plain_bin.dec_data.settings.access_id_be.swap_bytes();
|
||||
let program_id = plain_bin.dec_data.settings.program_id_be.swap_bytes();
|
||||
let program_id = ncm::ProgramId(plain_bin.dec_data.settings.program_id_be.swap_bytes());
|
||||
let bin_area = area::ApplicationArea::from(&amiibo, access_id);
|
||||
bin_area.create(plain_bin.dec_data.app_area.as_ptr(), plain_bin.dec_data.app_area.len(), false)?;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use alloc::{string::{String, ToString}, vec::Vec};
|
||||
use serde::{Serialize, Deserialize};
|
||||
use nx::{result::*, service::mii, fs};
|
||||
use nx::{fs, ipc::sf::ncm, result::*, service::mii};
|
||||
use crate::{area, fsext, miiext};
|
||||
use super::{bin, compat, fmt};
|
||||
|
||||
@ -112,7 +112,7 @@ impl compat::DeprecatedVirtualAmiiboFormat for VirtualAmiibo {
|
||||
// Save application area if present
|
||||
if plain_bin.dec_data.settings.flags.contains(bin::Flags::ApplicationAreaUsed()) {
|
||||
let access_id = plain_bin.dec_data.settings.access_id_be.swap_bytes();
|
||||
let program_id = plain_bin.dec_data.settings.program_id_be.swap_bytes();
|
||||
let program_id = ncm::ProgramId(plain_bin.dec_data.settings.program_id_be.swap_bytes());
|
||||
let existing_id = existing_access_id.unwrap_or(0);
|
||||
|
||||
if existing_access_id.is_none() || (existing_id != access_id) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
use nx::sync;
|
||||
use nx::ipc::sf::ncm;
|
||||
use alloc::vec::Vec;
|
||||
use crate::amiibo;
|
||||
use crate::fsext;
|
||||
@ -88,21 +89,21 @@ pub fn set_active_virtual_amiibo_status(status: VirtualAmiiboStatus) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn register_intercepted_application_id(application_id: u64) {
|
||||
pub fn register_intercepted_application_id(application_id: ncm::ProgramId) {
|
||||
unsafe {
|
||||
G_INTERCEPTED_APPLICATION_IDS.get().push(application_id);
|
||||
G_INTERCEPTED_APPLICATION_IDS.get().push(application_id.0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn unregister_intercepted_application_id(application_id: u64) {
|
||||
pub fn unregister_intercepted_application_id(application_id: ncm::ProgramId) {
|
||||
unsafe {
|
||||
G_INTERCEPTED_APPLICATION_IDS.get().retain(|&id| id != application_id);
|
||||
G_INTERCEPTED_APPLICATION_IDS.get().retain(|&id| id != application_id.0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_application_id_intercepted(application_id: u64) -> bool {
|
||||
pub fn is_application_id_intercepted(application_id: ncm::ProgramId) -> bool {
|
||||
unsafe {
|
||||
G_INTERCEPTED_APPLICATION_IDS.get().contains(&application_id)
|
||||
G_INTERCEPTED_APPLICATION_IDS.get().contains(&application_id.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
use alloc::string::ToString;
|
||||
use nx::ipc::sf::ncm;
|
||||
use nx::ipc::sf::sm;
|
||||
use nx::result::*;
|
||||
use nx::ipc::sf;
|
||||
@ -21,7 +22,7 @@ ipc_sf_define_interface_trait! {
|
||||
reset_active_virtual_amiibo [6, version::VersionInterval::all()]: () => ();
|
||||
get_active_virtual_amiibo_status [7, version::VersionInterval::all()]: () => (status: emu::VirtualAmiiboStatus);
|
||||
set_active_virtual_amiibo_status [8, version::VersionInterval::all()]: (status: emu::VirtualAmiiboStatus) => ();
|
||||
is_application_id_intercepted [9, version::VersionInterval::all()]: (application_id: u64) => (is_intercepted: bool);
|
||||
is_application_id_intercepted [9, version::VersionInterval::all()]: (application_id: ncm::ProgramId) => (is_intercepted: bool);
|
||||
try_parse_virtual_amiibo [10, version::VersionInterval::all()]: (path: sf::InMapAliasBuffer<u8>) => (virtual_amiibo: amiibo::fmt::VirtualAmiiboData);
|
||||
get_active_virtual_amiibo_areas [11, version::VersionInterval::all()]: (out_areas: sf::OutMapAliasBuffer<amiibo::fmt::VirtualAmiiboAreaEntry>) => (count: u32);
|
||||
get_active_virtual_amiibo_current_area [12, version::VersionInterval::all()]: () => (access_id: nfp::AccessId);
|
||||
@ -104,8 +105,8 @@ impl IEmulationService for EmulationService {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn is_application_id_intercepted(&mut self, application_id: u64) -> Result<bool> {
|
||||
log!("IsApplicationIdIntercepted -- app_id: {:#X}\n", application_id);
|
||||
fn is_application_id_intercepted(&mut self, application_id: ncm::ProgramId) -> Result<bool> {
|
||||
log!("IsApplicationIdIntercepted -- app_id: {:#X}\n", application_id.0);
|
||||
Ok(emu::is_application_id_intercepted(application_id))
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
use nx::result::*;
|
||||
use nx::ipc::sf;
|
||||
use nx::ipc::sf::nfp;
|
||||
use nx::ipc::sf::ncm;
|
||||
use nx::ipc::sf::applet;
|
||||
use nx::wait;
|
||||
use nx::sync;
|
||||
@ -28,7 +29,7 @@ pub fn get_input_context() -> &'static input::Context {
|
||||
}
|
||||
|
||||
pub struct EmulationHandler {
|
||||
application_id: u64,
|
||||
application_id: ncm::ProgramId,
|
||||
activate_event: wait::SystemEvent,
|
||||
deactivate_event: wait::SystemEvent,
|
||||
availability_change_event: wait::SystemEvent,
|
||||
@ -40,13 +41,13 @@ pub struct EmulationHandler {
|
||||
}
|
||||
|
||||
impl EmulationHandler {
|
||||
pub fn new(application_id: u64) -> Result<Self> {
|
||||
log!("\n[{:#X}] New handler!\n", application_id);
|
||||
pub fn new(application_id: ncm::ProgramId) -> Result<Self> {
|
||||
log!("\n[{:#X}] New handler!\n", application_id.0);
|
||||
Ok(Self { application_id, activate_event: wait::SystemEvent::new()?, deactivate_event: wait::SystemEvent::new()?, availability_change_event: wait::SystemEvent::new()?, state: sync::Locked::new(false, nfp::State::NonInitialized), device_state: sync::Locked::new(false, nfp::DeviceState::Unavailable), should_end_thread: sync::Locked::new(false, false), emu_handler_thread: thread::Thread::empty(), current_opened_area: area::ApplicationArea::new() })
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_application_id(&self) -> u64 {
|
||||
pub fn get_application_id(&self) -> ncm::ProgramId {
|
||||
self.application_id
|
||||
}
|
||||
|
||||
@ -95,10 +96,10 @@ impl EmulationHandler {
|
||||
pub fn initialize(&mut self, aruid: applet::AppletResourceUserId, process_id: sf::ProcessId, mcu_data: sf::InMapAliasBuffer<nfp::McuVersionData>) -> Result<()> {
|
||||
// TODO: make use of aruid or mcu data?
|
||||
result_return_unless!(self.is_state(nfp::State::NonInitialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] Initialize -- aruid: {}, process_id: {}, mcu_version_data: (count: {})\n", self.application_id, aruid, process_id.process_id, mcu_data.get_count());
|
||||
log!("[{:#X}] Initialize -- aruid: {}, process_id: {}, mcu_version_data: (count: {})\n", self.application_id.0, aruid, process_id.process_id, mcu_data.get_count());
|
||||
let mcu_ver_datas = mcu_data.get_slice();
|
||||
for mcu_ver_data in mcu_ver_datas {
|
||||
log!("[{:#X}] Initialize -- mcu version: {}\n", self.application_id, mcu_ver_data.version);
|
||||
log!("[{:#X}] Initialize -- mcu version: {}\n", self.application_id.0, mcu_ver_data.version);
|
||||
}
|
||||
|
||||
self.state.set(nfp::State::Initialized);
|
||||
@ -113,7 +114,7 @@ impl EmulationHandler {
|
||||
|
||||
pub fn finalize(&mut self) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] Finalize -- (...)\n", self.application_id);
|
||||
log!("[{:#X}] Finalize -- (...)\n", self.application_id.0);
|
||||
|
||||
self.state.set(nfp::State::NonInitialized);
|
||||
self.device_state.set(nfp::DeviceState::Finalized);
|
||||
@ -122,7 +123,7 @@ impl EmulationHandler {
|
||||
|
||||
pub fn list_devices(&mut self, out_devices: sf::OutPointerBuffer<nfp::DeviceHandle>) -> Result<u32> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] ListDevices -- out_devices: (count: {})\n", self.application_id, out_devices.get_count());
|
||||
log!("[{:#X}] ListDevices -- out_devices: (count: {})\n", self.application_id.0, out_devices.get_count());
|
||||
|
||||
// Note: a DeviceHandle's id != npad_id on official nfp, but we treat them as the same thing since we don't care about it
|
||||
// Official nfp would store the npad_id somewhere else for the command below which retrieves it
|
||||
@ -149,7 +150,7 @@ impl EmulationHandler {
|
||||
pub fn start_detection(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::Initialized) || self.is_device_state(nfp::DeviceState::TagRemoved), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] StartDetection -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] StartDetection -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
self.device_state.set(nfp::DeviceState::SearchingForTag);
|
||||
Ok(())
|
||||
@ -157,7 +158,7 @@ impl EmulationHandler {
|
||||
|
||||
pub fn stop_detection(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] StopDetection -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] StopDetection -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
self.device_state.set(nfp::DeviceState::Initialized);
|
||||
Ok(())
|
||||
@ -165,7 +166,7 @@ impl EmulationHandler {
|
||||
|
||||
pub fn mount(&mut self, device_handle: nfp::DeviceHandle, model_type: nfp::ModelType, mount_target: nfp::MountTarget) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] Mount -- device_handle: (fake id: {}), model_type: {:?}, mount_target: {:?}\n", self.application_id, device_handle.id, model_type, mount_target);
|
||||
log!("[{:#X}] Mount -- device_handle: (fake id: {}), model_type: {:?}, mount_target: {:?}\n", self.application_id.0, device_handle.id, model_type, mount_target);
|
||||
|
||||
self.device_state.set(nfp::DeviceState::TagMounted);
|
||||
Ok(())
|
||||
@ -173,7 +174,7 @@ impl EmulationHandler {
|
||||
|
||||
pub fn unmount(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] Unmount -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] Unmount -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
self.device_state.set(nfp::DeviceState::TagFound);
|
||||
Ok(())
|
||||
@ -182,12 +183,12 @@ impl EmulationHandler {
|
||||
pub fn open_application_area(&mut self, device_handle: nfp::DeviceHandle, access_id: nfp::AccessId) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] OpenApplicationArea -- device_handle: (fake id: {}), access_id: {:#X}\n", self.application_id, device_handle.id, access_id);
|
||||
log!("[{:#X}] OpenApplicationArea -- device_handle: (fake id: {}), access_id: {:#X}\n", self.application_id.0, device_handle.id, access_id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
|
||||
let application_area = area::ApplicationArea::from_id(&amiibo, self.application_id, access_id);
|
||||
let application_area = area::ApplicationArea::from_id(&amiibo, self.application_id.0, access_id);
|
||||
result_return_unless!(application_area.exists(), nfp::rc::ResultAreaNeedsToBeCreated);
|
||||
|
||||
amiibo.update_area_program_id(access_id, self.application_id)?;
|
||||
@ -199,7 +200,7 @@ impl EmulationHandler {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.current_opened_area.exists(), nfp::rc::ResultAreaNeedsToBeCreated);
|
||||
log!("[{:#X}] GetApplicationArea -- device_handle: (fake id: {}), out_data: (buf_size: {:#X})\n", self.application_id, device_handle.id, out_data.get_size());
|
||||
log!("[{:#X}] GetApplicationArea -- device_handle: (fake id: {}), out_data: (buf_size: {:#X})\n", self.application_id.0, device_handle.id, out_data.get_size());
|
||||
|
||||
let area_size = self.current_opened_area.get_size()?;
|
||||
let size = core::cmp::min(area_size, out_data.get_size());
|
||||
@ -212,7 +213,7 @@ impl EmulationHandler {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.current_opened_area.exists(), nfp::rc::ResultAreaNeedsToBeCreated);
|
||||
log!("[{:#X}] SetApplicationArea -- device_handle: (fake id: {}), data: (buf_size: {:#X})\n", self.application_id, device_handle.id, data.get_size());
|
||||
log!("[{:#X}] SetApplicationArea -- device_handle: (fake id: {}), data: (buf_size: {:#X})\n", self.application_id.0, device_handle.id, data.get_size());
|
||||
|
||||
let area_size = self.current_opened_area.get_size()?;
|
||||
let size = core::cmp::min(area_size, data.get_size());
|
||||
@ -225,14 +226,14 @@ impl EmulationHandler {
|
||||
|
||||
pub fn flush(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] Flush -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] Flush -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn restore(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] Restore -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] Restore -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -240,12 +241,12 @@ impl EmulationHandler {
|
||||
pub fn create_application_area(&mut self, device_handle: nfp::DeviceHandle, access_id: nfp::AccessId, data: sf::InMapAliasBuffer<u8>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] CreateApplicationArea -- device_handle: (fake id: {}), access_id: {:#X}, data: (buf_size: {:#X})\n", self.application_id, device_handle.id, access_id, data.get_size());
|
||||
log!("[{:#X}] CreateApplicationArea -- device_handle: (fake id: {}), access_id: {:#X}, data: (buf_size: {:#X})\n", self.application_id.0, device_handle.id, access_id, data.get_size());
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
|
||||
let application_area = area::ApplicationArea::from_id(&amiibo, self.application_id, access_id);
|
||||
let application_area = area::ApplicationArea::from_id(&amiibo, self.application_id.0, access_id);
|
||||
result_return_if!(application_area.exists(), nfp::rc::ResultAreaNeedsToBeCreated);
|
||||
|
||||
application_area.create(data.get_address(), data.get_size(), false)?;
|
||||
@ -256,7 +257,7 @@ impl EmulationHandler {
|
||||
pub fn get_tag_info(&mut self, device_handle: nfp::DeviceHandle, mut out_tag_info: sf::OutFixedPointerBuffer<nfp::TagInfo>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagFound) || self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetTagInfo -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetTagInfo -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -269,7 +270,7 @@ impl EmulationHandler {
|
||||
pub fn get_register_info(&mut self, device_handle: nfp::DeviceHandle, mut out_register_info: sf::OutFixedPointerBuffer<nfp::RegisterInfo>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetRegisterInfo -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetRegisterInfo -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -282,7 +283,7 @@ impl EmulationHandler {
|
||||
pub fn get_common_info(&mut self, device_handle: nfp::DeviceHandle, mut out_common_info: sf::OutFixedPointerBuffer<nfp::CommonInfo>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetCommonInfo -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetCommonInfo -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -295,7 +296,7 @@ impl EmulationHandler {
|
||||
pub fn get_model_info(&mut self, device_handle: nfp::DeviceHandle, mut out_model_info: sf::OutFixedPointerBuffer<nfp::ModelInfo>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetModelInfo -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetModelInfo -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -307,31 +308,31 @@ impl EmulationHandler {
|
||||
|
||||
pub fn attach_activate_event(&mut self, device_handle: nfp::DeviceHandle) -> Result<sf::CopyHandle> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] AttachActivateEvent -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] AttachActivateEvent -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
Ok(sf::Handle::from(self.activate_event.client_handle))
|
||||
}
|
||||
|
||||
pub fn attach_deactivate_event(&mut self, device_handle: nfp::DeviceHandle) -> Result<sf::CopyHandle> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] AttachDeactivateEvent -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] AttachDeactivateEvent -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
Ok(sf::Handle::from(self.deactivate_event.client_handle))
|
||||
}
|
||||
|
||||
pub fn get_state(&mut self) -> Result<nfp::State> {
|
||||
log!("[{:#X}] GetState -- (...)\n", self.application_id);
|
||||
log!("[{:#X}] GetState -- (...)\n", self.application_id.0);
|
||||
Ok(self.state.get_val())
|
||||
}
|
||||
|
||||
pub fn get_device_state(&mut self, device_handle: nfp::DeviceHandle) -> Result<nfp::DeviceState> {
|
||||
log!("[{:#X}] GetDeviceState -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetDeviceState -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
Ok(self.device_state.get_val())
|
||||
}
|
||||
|
||||
pub fn get_npad_id(&mut self, device_handle: nfp::DeviceHandle) -> Result<hid::NpadIdType> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetNpadId -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetNpadId -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
Ok(unsafe { core::mem::transmute(device_handle.id) })
|
||||
}
|
||||
@ -340,7 +341,7 @@ impl EmulationHandler {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.current_opened_area.exists(), nfp::rc::ResultAreaNeedsToBeCreated);
|
||||
log!("[{:#X}] GetApplicationAreaSize -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetApplicationAreaSize -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let area_size = self.current_opened_area.get_size()?;
|
||||
Ok(area_size as u32)
|
||||
@ -348,7 +349,7 @@ impl EmulationHandler {
|
||||
|
||||
pub fn attach_availability_change_event(&mut self) -> Result<sf::CopyHandle> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] AttachAvailabilityChangeEvent -- (...)\n", self.application_id);
|
||||
log!("[{:#X}] AttachAvailabilityChangeEvent -- (...)\n", self.application_id.0);
|
||||
|
||||
Ok(sf::Handle::from(self.availability_change_event.client_handle))
|
||||
}
|
||||
@ -356,19 +357,19 @@ impl EmulationHandler {
|
||||
pub fn recreate_application_area(&mut self, device_handle: nfp::DeviceHandle, access_id: nfp::AccessId, data: sf::InMapAliasBuffer<u8>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] RecreateApplicationArea -- device_handle: (fake id: {}), access_id: {:#X}, data: (buf_size: {:#X})\n", self.application_id, device_handle.id, access_id, data.get_size());
|
||||
log!("[{:#X}] RecreateApplicationArea -- device_handle: (fake id: {}), access_id: {:#X}, data: (buf_size: {:#X})\n", self.application_id.0, device_handle.id, access_id, data.get_size());
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
|
||||
let application_area = area::ApplicationArea::from_id(&amiibo, self.application_id, access_id);
|
||||
let application_area = area::ApplicationArea::from_id(&amiibo, self.application_id.0, access_id);
|
||||
application_area.create(data.get_address(), data.get_size(), true)?;
|
||||
amiibo.notify_written()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn format(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
log!("[{:#X}] Format -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] Format -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -376,7 +377,7 @@ impl EmulationHandler {
|
||||
pub fn get_admin_info(&mut self, device_handle: nfp::DeviceHandle, mut out_admin_info: sf::OutFixedPointerBuffer<nfp::AdminInfo>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetAdminInfo -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetAdminInfo -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -389,7 +390,7 @@ impl EmulationHandler {
|
||||
pub fn get_register_info_private(&mut self, device_handle: nfp::DeviceHandle, mut out_register_info_private: sf::OutFixedPointerBuffer<nfp::RegisterInfoPrivate>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] GetRegisterInfoPrivate -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] GetRegisterInfoPrivate -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -402,7 +403,7 @@ impl EmulationHandler {
|
||||
pub fn set_register_info_private(&mut self, device_handle: nfp::DeviceHandle, register_info_private: sf::InFixedPointerBuffer<nfp::RegisterInfoPrivate>) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] SetRegisterInfoPrivate -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] SetRegisterInfoPrivate -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -414,7 +415,7 @@ impl EmulationHandler {
|
||||
pub fn delete_register_info(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] DeleteRegisterInfo -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] DeleteRegisterInfo -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -426,7 +427,7 @@ impl EmulationHandler {
|
||||
pub fn delete_application_area(&mut self, device_handle: nfp::DeviceHandle) -> Result<()> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] DeleteApplicationArea -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] DeleteApplicationArea -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -438,7 +439,7 @@ impl EmulationHandler {
|
||||
pub fn exists_application_area(&mut self, device_handle: nfp::DeviceHandle) -> Result<bool> {
|
||||
result_return_unless!(self.is_state(nfp::State::Initialized), nfp::rc::ResultDeviceNotFound);
|
||||
result_return_unless!(self.is_device_state(nfp::DeviceState::TagMounted), nfp::rc::ResultDeviceNotFound);
|
||||
log!("[{:#X}] ExistsApplicationArea -- device_handle: (fake id: {})\n", self.application_id, device_handle.id);
|
||||
log!("[{:#X}] ExistsApplicationArea -- device_handle: (fake id: {})\n", self.application_id.0, device_handle.id);
|
||||
|
||||
let amiibo = emu::get_active_virtual_amiibo();
|
||||
result_return_unless!(amiibo.is_valid(), nfp::rc::ResultDeviceNotFound);
|
||||
@ -448,7 +449,7 @@ impl EmulationHandler {
|
||||
|
||||
impl Drop for EmulationHandler {
|
||||
fn drop(&mut self) {
|
||||
log!("[{:#X}] Dropping handler...\n", self.application_id);
|
||||
log!("[{:#X}] Dropping handler...\n", self.application_id.0);
|
||||
self.should_end_thread.set(true);
|
||||
self.emu_handler_thread.join().unwrap();
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
use nx::ipc::sf::hid;
|
||||
use nx::ipc::sf::ncm;
|
||||
use nx::result::*;
|
||||
use nx::mem;
|
||||
use nx::ipc::sf;
|
||||
@ -18,7 +19,7 @@ pub struct System {
|
||||
}
|
||||
|
||||
impl System {
|
||||
pub fn new(application_id: u64) -> Result<Self> {
|
||||
pub fn new(application_id: ncm::ProgramId) -> Result<Self> {
|
||||
Ok(Self {
|
||||
handler: EmulationHandler::new(application_id)?,
|
||||
dummy_session: sf::Session::new()
|
||||
|
@ -4,6 +4,7 @@ use nx::mem;
|
||||
use nx::ipc::sf;
|
||||
use nx::ipc::server;
|
||||
use nx::ipc::sf::applet;
|
||||
use nx::ipc::sf::ncm;
|
||||
use nx::ipc::sf::nfp;
|
||||
use nx::ipc::sf::nfp::IUser;
|
||||
use nx::ipc::sf::nfp::IUserManager;
|
||||
@ -18,7 +19,7 @@ pub struct User {
|
||||
}
|
||||
|
||||
impl User {
|
||||
pub fn new(application_id: u64) -> Result<Self> {
|
||||
pub fn new(application_id: ncm::ProgramId) -> Result<Self> {
|
||||
emu::register_intercepted_application_id(application_id);
|
||||
|
||||
Ok(Self {
|
||||
|
@ -1,7 +1,5 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(const_maybe_uninit_zeroed)]
|
||||
#![feature(const_trait_impl)]
|
||||
|
||||
#[macro_use]
|
||||
|
@ -21,9 +21,6 @@
|
||||
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
|
||||
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
|
||||
<kotlin.version>1.7.10</kotlin.version>
|
||||
|
||||
<javafx.plugin.version>0.0.5</javafx.plugin.version>
|
||||
<javafx.version>17</javafx.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
Loading…
Reference in New Issue
Block a user