@ -2206,12 +2213,13 @@ pub type DebugThreadParameter = ::libc::c_uint;
#[doc = " Information on address space for process. All sizes are in pages (0x1000 bytes)"]
#[doc = " Information on address space for process. All sizes are in pages (0x1000 bytes)"]
#[repr(C)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pubstructCodeSetInfo{
pubstructCodeSetHeader{
#[doc = "< ASCII name of codeset"]
#[doc = "< ASCII name of codeset"]
pubname: [u8_;8usize],
pubname: [u8_;8usize],
pubunk1: u16_,
#[doc = "< Version field of codeset (unused)"]
pubunk2: u16_,
pubversion: u16_,
pubunk3: u32_,
#[doc = "< Padding"]
pubpadding: [u16_;3usize],
#[doc = "< .text start address"]
#[doc = "< .text start address"]
pubtext_addr: u32_,
pubtext_addr: u32_,
#[doc = "< .text number of pages"]
#[doc = "< .text number of pages"]
@ -2230,7 +2238,8 @@ pub struct CodeSetInfo {
pubro_size_total: u32_,
pubro_size_total: u32_,
#[doc = "< total pages for .data, .bss (aligned)"]
#[doc = "< total pages for .data, .bss (aligned)"]
pubrw_size_total: u32_,
pubrw_size_total: u32_,
pubunk4: u32_,
#[doc = "< Padding"]
pubpadding2: u32_,
#[doc = "< Program ID"]
#[doc = "< Program ID"]
pubprogram_id: u64_,
pubprogram_id: u64_,
}
}
@ -2393,23 +2402,23 @@ extern "C" {
}
}
extern"C"{
extern"C"{
#[must_use]
#[must_use]
#[doc = " Sets up virtual address space for a new process\n # Arguments\n\n* `out` (direction out) - Pointer to output the codeset handle to.\n * `info` - Description for setting up the addresses\n * `code_ptr` - Pointer to .text in shared memory\n * `ro_ptr` - Pointer to .rodata in shared memory\n * `data_ptr` - Pointer to .data in shared memory"]
#[doc = " Sets up virtual address space for a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the codeset handle to.\n * `info` - Codeset header, contains process name, titleId and segment info.\n * `textSegmentLma` - Address of executable segment in caller's address space.\n * `roSegmentLma` - Address of read-only segment in caller's address space.\n * `dataSegmentLma` - Address of read-write segment in caller's address space.\n > **Note:** On success, the provided segments are unmapped from the caller's address space."]
pubfnsvcCreateCodeSet(
pubfnsvcCreateCodeSet(
out: *mutHandle,
out: *mutHandle,
info: *constCodeSetInfo,
info: *constCodeSetHeader,
code_ptr: *mut::libc::c_void,
textSegmentLma: u32_,
ro_ptr: *mut::libc::c_void,
roSegmentLma: u32_,
data_ptr: *mut::libc::c_void,
dataSegmentLma: u32_,
)-> Result;
)-> Result;
}
}
extern"C"{
extern"C"{
#[must_use]
#[must_use]
#[doc = "Sets up virtual address space for a new process\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process\n * `arm11kernelcaps` - ARM11 Kernel Capabilities from exheader\n * `arm11kernelcaps_num` - Number of kernel capabilities"]
#[doc = "Create a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process.\n * `arm11KernelCaps` - Arm11 Kernel Capabilities from exheader.\n * `numArm11KernelCaps` - Number of kernel capabilities."]
pubfnsvcCreateProcess(
pubfnsvcCreateProcess(
out: *mutHandle,
out: *mutHandle,
codeset: Handle,
codeset: Handle,
arm11kernelcaps: *constu32_,
arm11KernelCaps: *constu32_,
arm11kernelcaps_num: u32_,
numArm11KernelCaps: s32,
)-> Result;
)-> Result;
}
}
extern"C"{
extern"C"{
@ -3602,18 +3611,18 @@ extern "C" {
#[doc = " Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."]
#[doc = " Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."]
#[doc = "< The different types of data for errors."]
#[doc = "< The different types of data for errors."]
pubdata: ERRF_FatalErrInfo__bindgen_ty_1,
pubdata: ERRF_FatalErrInfo__bindgen_ty_1,
@ -3729,19 +3738,29 @@ extern "C" {
}
}
extern"C"{
extern"C"{
#[must_use]
#[must_use]
#[doc = " Throws a system error and possibly results in ErrDisp triggering.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\nAfter performing this, the system may panic and need to be rebooted. Extra information will be displayed on the\n top screen with a developer console or the proper patches in a CFW applied.\n\n The error may not be shown and execution aborted until errfExit(void) is called.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."]
#[doc = " Throws a system error and possibly logs it.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\nErrDisp may convert the error info to ERRF_ERRTYPE_NAND_DAMAGED or ERRF_ERRTYPE_CARD_REMOVED\n depending on the error code.\n\n Except with ERRF_ERRTYPE_LOG_ONLY, the system will panic and will need to be rebooted.\n Fatal error information will also be logged into a file, unless the type either ERRF_ERRTYPE_NAND_DAMAGED\n or ERRF_ERRTYPE_CARD_REMOVED.\n\n No error will be shown if the system is asleep.\n\n On retail units with vanilla firmware, no detailed information will be displayed on screen.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."]
#[doc = " Throws a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw() with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from.\n\n See https://3dbrew.org/wiki/ERR:Throw#Generic for expected top screen output\n on development units/patched ErrDisp."]
#[doc = " Throws (and logs) a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from."]
pubfnERRF_ThrowResult(failure: Result)-> Result;
pubfnERRF_ThrowResult(failure: Result)-> Result;
}
}
extern"C"{
extern"C"{
#[must_use]
#[must_use]
#[doc = " Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw() with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed.\n\n The message is only displayed on development units/patched ErrDisp.\n\n See https://3dbrew.org/wiki/ERR:Throw#Result_Failure for expected top screen output\n on development units/patched ErrDisp."]
#[doc = " Logs a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to log.\n\n Similar to ERRF_Throw, except that it does not display anything on the screen,\n nor does it force the system to reboot.\n\n This function _does_ fill in the address where this function was called from."]
pubfnERRF_LogResult(failure: Result)-> Result;
}
extern"C"{
#[must_use]
#[doc = " Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed."]
#[doc = " Specify an additional user string to use for error reporting.\n # Arguments\n\n* `user_string` (direction in) - User string (up to 256 bytes, not including NUL byte)"]
#[doc = " Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"]
#[doc = " Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"]
#[doc = " Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."]
#[doc = " Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."]
#[doc = " Configures the chainloader to launch the previous application."]
pubfnaptSetChainloaderToCaller();
}
extern"C"{
extern"C"{
#[doc = " Configures the chainloader to relaunch the current application (i.e. soft-reset)"]
#[doc = " Configures the chainloader to relaunch the current application (i.e. soft-reset)"]
pubfnaptSetChainloaderToSelf();
pubfnaptSetChainloaderToSelf();
}
}
extern"C"{
#[doc = " Sets the \"deliver arg\" and HMAC for the chainloader, which will\n be passed to the target 3DS/DS(i) application. The meaning of each\n parameter varies on a per-application basis.\n # Arguments\n\n* `deliverArg` - Deliver arg to pass to the target application.\n * `deliverArgSize` - Size of the deliver arg, maximum 0x300 bytes.\n * `hmac` - HMAC buffer, 32 bytes. Use NULL to pass an all-zero dummy HMAC."]
pubfnaptSetChainloaderArgs(
deliverArg: *const::libc::c_void,
deliverArgSize: usize,
hmac: *const::libc::c_void,
);
}
extern"C"{
extern"C"{
#[must_use]
#[must_use]
#[doc = " Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."]
#[doc = " Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."]
@ -7468,9 +7608,9 @@ extern "C" {
#[must_use]
#[must_use]
#[doc = " Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."]
#[doc = " Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."]
pubfnAPT_ReceiveDeliverArg(
pubfnAPT_ReceiveDeliverArg(
param: *const::libc::c_void,
param: *mut::libc::c_void,
paramSize: usize,
paramSize: usize,
hmac: *const::libc::c_void,
hmac: *mut::libc::c_void,
sender: *mutu64_,
sender: *mutu64_,
received: *mutbool,
received: *mutbool,
)-> Result;
)-> Result;
@ -13280,6 +13420,16 @@ extern "C" {
#[doc = " Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."]
#[doc = " Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."]
#[doc = " Gets the current mcuHwc session handle.\n # Returns\n\nA pointer to the current mcuHwc session handle."]
pubfnmcuHwcGetSessionHandle()-> *mutHandle;
}
extern"C"{
extern"C"{
#[must_use]
#[must_use]
#[doc = " Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"]
#[doc = " Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"]
@ -15619,6 +15773,80 @@ extern "C" {
#[doc = " Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."]
#[doc = " Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."]
pubfnMCUHWC_GetFwVerLow(out: *mutu8_)-> Result;
pubfnMCUHWC_GetFwVerLow(out: *mutu8_)-> Result;
}
}
#[doc = "< Primary I2S line, used by DSP/Mic (configurable)/GBA sound controller."]
pubconstCODEC_I2S_LINE_1: CodecI2sLine=0;
#[doc = "< Secondary I2S line, used by CSND hardware."]
pubconstCODEC_I2S_LINE_2: CodecI2sLine=1;
#[doc = " I2S line enumeration"]
pubtypeCodecI2sLine=::libc::c_uint;
extern"C"{
#[must_use]
#[doc = " Initializes CDCCHK."]
pubfncdcChkInit()-> Result;
}
extern"C"{
#[doc = " Exits CDCCHK."]
pubfncdcChkExit();
}
extern"C"{
#[doc = " Gets a pointer to the current cdc:CHK session handle.\n # Returns\n\nA pointer to the current cdc:CHK session handle."]
pubfncdcChkGetSessionHandle()-> *mutHandle;
}
extern"C"{
#[must_use]
#[doc = " Reads multiple registers from the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to write the read data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."]
pubfnCDCCHK_ReadRegisters1(
pageId: u8_,
initialRegAddr: u8_,
outData: *mut::libc::c_void,
size: usize,
)-> Result;
}
extern"C"{
#[must_use]
#[doc = " Reads multiple registers from the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to read the data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."]
pubfnCDCCHK_ReadRegisters2(
pageId: u8_,
initialRegAddr: u8_,
outData: *mut::libc::c_void,
size: usize,
)-> Result;
}
extern"C"{
#[must_use]
#[doc = " Writes multiple registers to the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."]
pubfnCDCCHK_WriteRegisters1(
pageId: u8_,
initialRegAddr: u8_,
data: *const::libc::c_void,
size: usize,
)-> Result;
}
extern"C"{
#[must_use]
#[doc = " Writes multiple registers to the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."]
pubfnCDCCHK_WriteRegisters2(
pageId: u8_,
initialRegAddr: u8_,
data: *const::libc::c_void,
size: usize,
)-> Result;
}
extern"C"{
#[must_use]
#[doc = " Reads a single register from the NTR PMIC.\n # Arguments\n\n* `outData` (direction out) - Where to read the data to (1 byte).\n * `regAddr` - Register address.\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."]
#[doc = " Writes a single register from the NTR PMIC.\n # Arguments\n\n* `regAddr` - Register address.\n * `data` - Data to write (1 byte).\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."]
#[doc = " Sets the DAC volume level for the specified I2S line.\n # Arguments\n\n* `i2sLine` - I2S line to set the volume for.\n * `volume` - Volume level (-128 to 0)."]
#[doc = "Auxiliary output\n# **\n* Configures whether an auxiliary output is enabled.\n* # Arguments\n\n* `id` - ID of the auxiliary output.\n* * `enable` - Whether to enable the auxiliary output.\n*/"]
#[doc = "Auxiliary output\n# **\n* Configures whether an auxiliary output is enabled.\n* # Arguments\n\n* `id` - ID of the auxiliary output.\n* * `enable` - Whether to enable the auxiliary output.\n*/"]
#[doc = " Gets whether auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output is enabled."]
pubfnndspAuxIsEnabled(id: ::libc::c_int)-> bool;
}
extern"C"{
extern"C"{
#[doc = " Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."]
#[doc = " Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."]
#[doc = " Gets whether auxiliary output front bypass is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output front bypass is enabled."]
#[doc = " Gets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nVolume of the auxiliary output."]
pubfnndspAuxGetVolume(id: ::libc::c_int)-> f32;
}
extern"C"{
extern"C"{
#[doc = " Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."]
#[doc = " Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."]
pubfnndspAuxSetCallback(
pubfnndspAuxSetCallback(
@ -16978,18 +17246,34 @@ extern "C" {
#[doc = "Configuration\n# **\n* Sets the format of a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `format` - Format to use.\n*/"]
#[doc = "Configuration\n# **\n* Sets the format of a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `format` - Format to use.\n*/"]
#[doc = " Gets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe interpolation type of the channel."]
#[doc = " Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."]
#[doc = " Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."]
pubfnndspChnSetRate(id: ::libc::c_int,rate: f32);
pubfnndspChnSetRate(id: ::libc::c_int,rate: f32);
}
}
extern"C"{
#[doc = " Gets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sample rate of the channel."]
pubfnndspChnGetRate(id: ::libc::c_int)-> f32;
}
extern"C"{
extern"C"{
#[doc = " Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."]
#[doc = " Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."]
#[doc = " Gets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)\n * `mix` - Mix parameters to write out to. See ndspChnSetMix."]
#[doc = " Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."]
#[doc = " Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."]