Skip to content

Commit 5408510

Browse files
committed
Bumped ctru-sys to latest libctru version
1 parent 2ed36b9 commit 5408510

File tree

3 files changed

+109
-9
lines changed

3 files changed

+109
-9
lines changed

ctru-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ctru-sys"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
authors = ["Ronald Kinard <furyhunter600@gmail.com>"]
55
license = "https://en.wikipedia.org/wiki/Zlib_License"
66
links = "ctru"

ctru-sys/bindgen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ bindgen "$DEVKITPRO/libctru/include/3ds.h" \
2626
-mtune=mpcore \
2727
-mfpu=vfp \
2828
-DARM11 \
29-
-D_3DS \
29+
-D__3DS__ \
3030
> src/bindings.rs

ctru-sys/src/bindings.rs

Lines changed: 107 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,12 @@ pub const CUR_PROCESS_HANDLE: u32 = 4294934529;
215215
pub const ARBITRATION_SIGNAL_ALL: i32 = -1;
216216
pub const CUR_THREAD_HANDLE: u32 = 4294934528;
217217
pub const SYSCLOCK_SOC: u32 = 16756991;
218+
pub const SYSCLOCK_SYS: u32 = 33513982;
219+
pub const SYSCLOCK_SDMMC: u32 = 67027964;
218220
pub const SYSCLOCK_ARM9: u32 = 134055928;
219221
pub const SYSCLOCK_ARM11: u32 = 268111856;
222+
pub const SYSCLOCK_ARM11_LGR1: u32 = 536223712;
223+
pub const SYSCLOCK_ARM11_LGR2: u32 = 804335568;
220224
pub const SYSCLOCK_ARM11_NEW: u32 = 804335568;
221225
pub const CPU_TICKS_PER_MSEC: f64 = 268111.856;
222226
pub const CPU_TICKS_PER_USEC: f64 = 268.111856;
@@ -277,6 +281,8 @@ pub const CONSOLE_BLINK_FAST: u32 = 32;
277281
pub const CONSOLE_COLOR_REVERSE: u32 = 64;
278282
pub const CONSOLE_CONCEAL: u32 = 128;
279283
pub const CONSOLE_CROSSED_OUT: u32 = 256;
284+
pub const CONSOLE_FG_CUSTOM: u32 = 512;
285+
pub const CONSOLE_BG_CUSTOM: u32 = 1024;
280286
pub const __GNUCLIKE_ASM: u32 = 3;
281287
pub const __GNUCLIKE___TYPEOF: u32 = 1;
282288
pub const __GNUCLIKE___OFFSETOF: u32 = 1;
@@ -1216,6 +1222,7 @@ pub const MIISELECTOR_GUESTMII_SLOTS: u32 = 6;
12161222
pub const MIISELECTOR_USERMII_SLOTS: u32 = 100;
12171223
pub const MIISELECTOR_GUESTMII_NAME_LEN: u32 = 12;
12181224
pub const ARCHIVE_DIRITER_MAGIC: u32 = 1751347809;
1225+
pub const LINK3DS_COMM_PORT: u32 = 17491;
12191226
pub type __int8_t = ::libc::c_schar;
12201227
pub type __uint8_t = ::libc::c_uchar;
12211228
pub type __int16_t = ::libc::c_short;
@@ -3446,7 +3453,10 @@ extern "C" {
34463453
fb_b: *const ::libc::c_void,
34473454
stride: u32_,
34483455
mode: u32_,
3449-
);
3456+
) -> bool;
3457+
}
3458+
extern "C" {
3459+
pub fn gspIsPresentPending(screen: ::libc::c_uint) -> bool;
34503460
}
34513461
extern "C" {
34523462
pub fn gspSetEventCallback(
@@ -3628,8 +3638,8 @@ pub struct PrintConsole {
36283638
pub windowWidth: ::libc::c_int,
36293639
pub windowHeight: ::libc::c_int,
36303640
pub tabSize: ::libc::c_int,
3631-
pub fg: ::libc::c_int,
3632-
pub bg: ::libc::c_int,
3641+
pub fg: u16_,
3642+
pub bg: u16_,
36333643
pub flags: ::libc::c_int,
36343644
pub PrintChar: ConsolePrint,
36353645
pub consoleInitialised: bool,
@@ -4040,12 +4050,26 @@ extern "C" {
40404050
extern "C" {
40414051
pub fn mappableFree(mem: *mut ::libc::c_void);
40424052
}
4053+
pub const VRAM_ALLOC_A: vramAllocPos = 1;
4054+
pub const VRAM_ALLOC_B: vramAllocPos = 2;
4055+
pub const VRAM_ALLOC_ANY: vramAllocPos = 3;
4056+
pub type vramAllocPos = ::libc::c_uint;
40434057
extern "C" {
40444058
pub fn vramAlloc(size: size_t) -> *mut ::libc::c_void;
40454059
}
4060+
extern "C" {
4061+
pub fn vramAllocAt(size: size_t, pos: vramAllocPos) -> *mut ::libc::c_void;
4062+
}
40464063
extern "C" {
40474064
pub fn vramMemAlign(size: size_t, alignment: size_t) -> *mut ::libc::c_void;
40484065
}
4066+
extern "C" {
4067+
pub fn vramMemAlignAt(
4068+
size: size_t,
4069+
alignment: size_t,
4070+
pos: vramAllocPos,
4071+
) -> *mut ::libc::c_void;
4072+
}
40494073
extern "C" {
40504074
pub fn vramRealloc(mem: *mut ::libc::c_void, size: size_t) -> *mut ::libc::c_void;
40514075
}
@@ -4414,6 +4438,13 @@ impl Default for FS_Path {
44144438
}
44154439
}
44164440
}
4441+
#[repr(C)]
4442+
#[derive(Debug, Default, Copy, Clone)]
4443+
pub struct FS_SdMmcSpeedInfo {
4444+
pub highSpeedModeEnabled: bool,
4445+
pub usesHighestClockRate: bool,
4446+
pub sdClkCtrl: u16_,
4447+
}
44174448
pub type FS_Archive = u64_;
44184449
extern "C" {
44194450
pub fn fsInit() -> Result;
@@ -4553,10 +4584,10 @@ extern "C" {
45534584
pub fn FSUSER_GetNandCid(out: *mut u8_, length: u32_) -> Result;
45544585
}
45554586
extern "C" {
4556-
pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut u32_) -> Result;
4587+
pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result;
45574588
}
45584589
extern "C" {
4559-
pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut u32_) -> Result;
4590+
pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result;
45604591
}
45614592
extern "C" {
45624593
pub fn FSUSER_GetSdmcLog(out: *mut u8_, length: u32_) -> Result;
@@ -5027,6 +5058,19 @@ pub struct AM_TWLPartitionInfo {
50275058
pub titlesCapacity: u64_,
50285059
pub titlesFreeSpace: u64_,
50295060
}
5061+
#[repr(C)]
5062+
#[derive(Debug, Default, Copy, Clone)]
5063+
pub struct AM_ContentInfo {
5064+
pub index: u16_,
5065+
pub type_: u16_,
5066+
pub contentId: u32_,
5067+
pub size: u64_,
5068+
pub flags: u8_,
5069+
pub padding: [u8_; 7usize],
5070+
}
5071+
pub const AM_CONTENT_DOWNLOADED: AM_ContentInfoFlags = 1;
5072+
pub const AM_CONTENT_OWNED: AM_ContentInfoFlags = 2;
5073+
pub type AM_ContentInfoFlags = ::libc::c_uint;
50305074
extern "C" {
50315075
pub fn amInit() -> Result;
50325076
}
@@ -5325,6 +5369,23 @@ extern "C" {
53255369
extern "C" {
53265370
pub fn AM_DeleteAllTwlTitles() -> Result;
53275371
}
5372+
extern "C" {
5373+
pub fn AMAPP_GetDLCContentInfoCount(
5374+
count: *mut u32_,
5375+
mediatype: FS_MediaType,
5376+
titleID: u64_,
5377+
) -> Result;
5378+
}
5379+
extern "C" {
5380+
pub fn AMAPP_ListDLCContentInfos(
5381+
contentInfoRead: *mut u32_,
5382+
mediatype: FS_MediaType,
5383+
titleID: u64_,
5384+
contentInfoCount: u32_,
5385+
offset: u32_,
5386+
contentInfos: *mut AM_ContentInfo,
5387+
) -> Result;
5388+
}
53285389
extern "C" {
53295390
pub fn ampxiInit(servhandle: Handle) -> Result;
53305391
}
@@ -7305,10 +7366,10 @@ extern "C" {
73057366
pub fn FSPXI_GetNandCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result;
73067367
}
73077368
extern "C" {
7308-
pub fn FSPXI_GetSdmcSpeedInfo(serviceHandle: Handle, out: *mut u32_) -> Result;
7369+
pub fn FSPXI_GetSdmcSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result;
73097370
}
73107371
extern "C" {
7311-
pub fn FSPXI_GetNandSpeedInfo(serviceHandle: Handle, out: *mut u32_) -> Result;
7372+
pub fn FSPXI_GetNandSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result;
73127373
}
73137374
extern "C" {
73147375
pub fn FSPXI_GetSdmcLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result;
@@ -10314,6 +10375,9 @@ extern "C" {
1031410375
extern "C" {
1031510376
pub fn ptmuExit();
1031610377
}
10378+
extern "C" {
10379+
pub fn ptmuGetSessionHandle() -> *mut Handle;
10380+
}
1031710381
extern "C" {
1031810382
pub fn PTMU_GetShellState(out: *mut u8_) -> Result;
1031910383
}
@@ -10361,6 +10425,9 @@ extern "C" {
1036110425
extern "C" {
1036210426
pub fn ptmSysmExit();
1036310427
}
10428+
extern "C" {
10429+
pub fn ptmSysmGetSessionHandle() -> *mut Handle;
10430+
}
1036410431
extern "C" {
1036510432
pub fn PTMSYSM_RequestSleep() -> Result;
1036610433
}
@@ -10379,6 +10446,9 @@ extern "C" {
1037910446
extern "C" {
1038010447
pub fn PTMSYSM_Awaken() -> Result;
1038110448
}
10449+
extern "C" {
10450+
pub fn PTMSYSM_SetUserTime(msY2k: s64) -> Result;
10451+
}
1038210452
extern "C" {
1038310453
pub fn PTMSYSM_InvalidateSystemTime() -> Result;
1038410454
}
@@ -10400,6 +10470,30 @@ extern "C" {
1040010470
extern "C" {
1040110471
pub fn PTMSYSM_RebootAsync(timeout: u64_) -> Result;
1040210472
}
10473+
extern "C" {
10474+
pub fn ptmGetsInit() -> Result;
10475+
}
10476+
extern "C" {
10477+
pub fn ptmGetsExit();
10478+
}
10479+
extern "C" {
10480+
pub fn ptmGetsGetSessionHandle() -> *mut Handle;
10481+
}
10482+
extern "C" {
10483+
pub fn PTMGETS_GetSystemTime(outMsY2k: *mut s64) -> Result;
10484+
}
10485+
extern "C" {
10486+
pub fn ptmSetsInit() -> Result;
10487+
}
10488+
extern "C" {
10489+
pub fn ptmSetsExit();
10490+
}
10491+
extern "C" {
10492+
pub fn ptmSetsGetSessionHandle() -> *mut Handle;
10493+
}
10494+
extern "C" {
10495+
pub fn PTMSETS_SetSystemTime(msY2k: s64) -> Result;
10496+
}
1040310497
pub const WAIT_NONE: PXIDEV_WaitType = 0;
1040410498
pub const WAIT_SLEEP: PXIDEV_WaitType = 1;
1040510499
pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2;
@@ -13543,3 +13637,9 @@ extern "C" {
1354313637
extern "C" {
1354413638
pub fn gdbHioDevSystem(command: *const ::libc::c_char) -> ::libc::c_int;
1354513639
}
13640+
extern "C" {
13641+
pub static mut __3dslink_host: in_addr;
13642+
}
13643+
extern "C" {
13644+
pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int;
13645+
}

0 commit comments

Comments
 (0)