summaryrefslogtreecommitdiff
path: root/src/psp/umd.rs
blob: 1fe24a2e059195f5734d1f4b67b09e7fa787054c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
pub type UmdCallback = fn(unknown: i32, event: i32) -> i32;

#[repr(C)]
#[derive(Copy, Clone)]
pub struct UmdInfo {
    pub size: u32,
    pub type_: UmdType,
}

#[repr(u32)]
#[derive(Copy, Clone)]
pub enum UmdType {
    Game = 0x10,
    Video = 0x20,
    Audio = 0x40,
}

pub const UMD_NOT_PRESENT: i32 = 0x01;
pub const UMD_PRESENT: i32 = 0x02;
pub const UMD_CHANGED: i32 = 0x04;
pub const UMD_INITING: i32 = 0x08;
pub const UMD_INITED: i32 = 0x10;
pub const UMD_READY: i32 = 0x20;

extern "C" {
    pub fn sceUmdCheckMedium() -> i32;
    pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32;
    pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32;
    pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32;
    pub fn sceUmdWaitDriveStat(state: i32) -> i32;
    pub fn sceUmdWaitDriveStatWithTimer(
        state: i32,
        timeout: u32,
    ) -> i32;
    pub fn sceUmdWaitDriveStatCB(
        state: i32,
        timeout: u32,
    ) -> i32;
    pub fn sceUmdCancelWaitDriveStat() -> i32;
    pub fn sceUmdGetDriveStat() -> i32;
    pub fn sceUmdGetErrorStat() -> i32;
    pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32;
    pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32;
    pub fn sceUmdReplacePermit() -> i32;
    pub fn sceUmdReplaceProhibit() -> i32;
}