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
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* automatically generated by rust-bindgen 0.58.1 */
/* cleaned up by AlexApps99 */
#![allow(non_camel_case_types, non_upper_case_globals)]

pub const RDRAM_MAX_SIZE: u32 = 0x800000;
pub const CORE_BASE_NAME: &str = "angrylion's RDP Plus";
pub const CORE_NAME: &str = "angrylion's RDP Plus";
pub const CORE_SIMPLE_NAME: &str = "angrylion-plus";
pub const dp_register_DP_START: dp_register = 0;
pub const dp_register_DP_END: dp_register = 1;
pub const dp_register_DP_CURRENT: dp_register = 2;
pub const dp_register_DP_STATUS: dp_register = 3;
pub const dp_register_DP_CLOCK: dp_register = 4;
pub const dp_register_DP_BUFBUSY: dp_register = 5;
pub const dp_register_DP_PIPEBUSY: dp_register = 6;
pub const dp_register_DP_TMEM: dp_register = 7;
pub const dp_register_DP_NUM_REG: dp_register = 8;
pub type dp_register = ::std::os::raw::c_uint;
/// aka VI_CONTROL
pub const vi_register_VI_STATUS: vi_register = 0;
/// aka VI_DRAM_ADDR
pub const vi_register_VI_ORIGIN: vi_register = 1;
pub const vi_register_VI_WIDTH: vi_register = 2;
pub const vi_register_VI_INTR: vi_register = 3;
pub const vi_register_VI_V_CURRENT_LINE: vi_register = 4;
pub const vi_register_VI_TIMING: vi_register = 5;
pub const vi_register_VI_V_SYNC: vi_register = 6;
pub const vi_register_VI_H_SYNC: vi_register = 7;
/// aka VI_H_SYNC_LEAP
pub const vi_register_VI_LEAP: vi_register = 8;
/// aka VI_H_VIDEO
pub const vi_register_VI_H_START: vi_register = 9;
/// aka VI_V_VIDEO
pub const vi_register_VI_V_START: vi_register = 10;
pub const vi_register_VI_V_BURST: vi_register = 11;
pub const vi_register_VI_X_SCALE: vi_register = 12;
pub const vi_register_VI_Y_SCALE: vi_register = 13;
pub const vi_register_VI_NUM_REG: vi_register = 14;
pub type vi_register = ::std::os::raw::c_uint;
/// color buffer with VI filter
pub const vi_mode_VI_MODE_NORMAL: vi_mode = 0;
/// direct color buffer, unfiltered
pub const vi_mode_VI_MODE_COLOR: vi_mode = 1;
/// depth buffer as grayscale
pub const vi_mode_VI_MODE_DEPTH: vi_mode = 2;
/// coverage as grayscale
pub const vi_mode_VI_MODE_COVERAGE: vi_mode = 3;
pub const vi_mode_VI_MODE_NUM: vi_mode = 4;
pub type vi_mode = ::std::os::raw::c_uint;
pub const vi_interp_VI_INTERP_NEAREST: vi_interp = 0;
pub const vi_interp_VI_INTERP_LINEAR: vi_interp = 1;
pub const vi_interp_VI_INTERP_HYBRID: vi_interp = 2;
pub const vi_interp_VI_INTERP_NUM: vi_interp = 3;
pub type vi_interp = ::std::os::raw::c_uint;
pub const dp_compat_profile_DP_COMPAT_LOW: dp_compat_profile = 0;
pub const dp_compat_profile_DP_COMPAT_MEDIUM: dp_compat_profile = 1;
pub const dp_compat_profile_DP_COMPAT_HIGH: dp_compat_profile = 2;
pub const dp_compat_profile_DP_COMPAT_NUM: dp_compat_profile = 3;
pub type dp_compat_profile = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct n64video_pixel {
    pub r: u8,
    pub g: u8,
    pub b: u8,
    pub a: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct n64video_frame_buffer {
    pub pixels: *mut n64video_pixel,
    pub width: u32,
    pub height: u32,
    pub height_out: u32,
    pub pitch: u32,
    pub valid: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct n64video_config {
    pub gfx: n64video_config_gfx,
    pub vi: n64video_config_vi,
    pub dp: n64video_config_dp,
    /// use multithreaded renderer if true
    pub parallel: bool,
    /// use a busyloop while waiting for work
    pub busyloop: bool,
    /// number of rendering workers
    pub num_workers: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct n64video_config_gfx {
    /// RDRAM pointer
    pub rdram: *mut u8,
    /// size of RDRAM, typically 4 or 8 MiB
    pub rdram_size: u32,
    /// RSP data memory pointer
    pub dmem: *mut u8,
    /// video interface registers
    pub vi_reg: *mut *mut u32,
    /// display processor registers
    pub dp_reg: *mut *mut u32,
    /// MIPS interface interrupt register
    pub mi_intr_reg: *mut u32,
    /// interrupt callback function
    pub mi_intr_cb: ::std::option::Option<unsafe extern "C" fn()>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct n64video_config_vi {
    /// output mode
    pub mode: vi_mode,
    /// output interpolation method
    pub interp: vi_interp,
    /// force 16:9 aspect ratio if true
    pub widescreen: bool,
    /// crop to visible area if true
    pub hide_overscan: bool,
    /// enable vsync if true
    pub vsync: bool,
    /// run in exclusive mode when in fullscreen if true
    pub exclusive: bool,
    /// one native pixel is displayed as a multiple of a screen pixel if true
    pub integer_scaling: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct n64video_config_dp {
    /// multithreading compatibility mode
    pub compat: dp_compat_profile,
}

extern "C" {
    pub fn n64video_config_init(config: *mut n64video_config);

    pub fn n64video_init(config: *mut n64video_config);

    pub fn n64video_update_screen(fb: *mut n64video_frame_buffer);

    pub fn n64video_process_list();

    pub fn n64video_close();
}