angrylion_rdp_plus_sys/
lib.rs

1/* automatically generated by rust-bindgen 0.58.1 */
2/* cleaned up by AlexApps99 */
3#![allow(non_camel_case_types, non_upper_case_globals)]
4
5pub const RDRAM_MAX_SIZE: u32 = 0x800000;
6pub const CORE_BASE_NAME: &str = "angrylion's RDP Plus";
7pub const CORE_NAME: &str = "angrylion's RDP Plus";
8pub const CORE_SIMPLE_NAME: &str = "angrylion-plus";
9pub const dp_register_DP_START: dp_register = 0;
10pub const dp_register_DP_END: dp_register = 1;
11pub const dp_register_DP_CURRENT: dp_register = 2;
12pub const dp_register_DP_STATUS: dp_register = 3;
13pub const dp_register_DP_CLOCK: dp_register = 4;
14pub const dp_register_DP_BUFBUSY: dp_register = 5;
15pub const dp_register_DP_PIPEBUSY: dp_register = 6;
16pub const dp_register_DP_TMEM: dp_register = 7;
17pub const dp_register_DP_NUM_REG: dp_register = 8;
18pub type dp_register = ::std::os::raw::c_uint;
19/// aka VI_CONTROL
20pub const vi_register_VI_STATUS: vi_register = 0;
21/// aka VI_DRAM_ADDR
22pub const vi_register_VI_ORIGIN: vi_register = 1;
23pub const vi_register_VI_WIDTH: vi_register = 2;
24pub const vi_register_VI_INTR: vi_register = 3;
25pub const vi_register_VI_V_CURRENT_LINE: vi_register = 4;
26pub const vi_register_VI_TIMING: vi_register = 5;
27pub const vi_register_VI_V_SYNC: vi_register = 6;
28pub const vi_register_VI_H_SYNC: vi_register = 7;
29/// aka VI_H_SYNC_LEAP
30pub const vi_register_VI_LEAP: vi_register = 8;
31/// aka VI_H_VIDEO
32pub const vi_register_VI_H_START: vi_register = 9;
33/// aka VI_V_VIDEO
34pub const vi_register_VI_V_START: vi_register = 10;
35pub const vi_register_VI_V_BURST: vi_register = 11;
36pub const vi_register_VI_X_SCALE: vi_register = 12;
37pub const vi_register_VI_Y_SCALE: vi_register = 13;
38pub const vi_register_VI_NUM_REG: vi_register = 14;
39pub type vi_register = ::std::os::raw::c_uint;
40/// color buffer with VI filter
41pub const vi_mode_VI_MODE_NORMAL: vi_mode = 0;
42/// direct color buffer, unfiltered
43pub const vi_mode_VI_MODE_COLOR: vi_mode = 1;
44/// depth buffer as grayscale
45pub const vi_mode_VI_MODE_DEPTH: vi_mode = 2;
46/// coverage as grayscale
47pub const vi_mode_VI_MODE_COVERAGE: vi_mode = 3;
48pub const vi_mode_VI_MODE_NUM: vi_mode = 4;
49pub type vi_mode = ::std::os::raw::c_uint;
50pub const vi_interp_VI_INTERP_NEAREST: vi_interp = 0;
51pub const vi_interp_VI_INTERP_LINEAR: vi_interp = 1;
52pub const vi_interp_VI_INTERP_HYBRID: vi_interp = 2;
53pub const vi_interp_VI_INTERP_NUM: vi_interp = 3;
54pub type vi_interp = ::std::os::raw::c_uint;
55pub const dp_compat_profile_DP_COMPAT_LOW: dp_compat_profile = 0;
56pub const dp_compat_profile_DP_COMPAT_MEDIUM: dp_compat_profile = 1;
57pub const dp_compat_profile_DP_COMPAT_HIGH: dp_compat_profile = 2;
58pub const dp_compat_profile_DP_COMPAT_NUM: dp_compat_profile = 3;
59pub type dp_compat_profile = ::std::os::raw::c_uint;
60#[repr(C)]
61#[derive(Debug, Copy, Clone)]
62pub struct n64video_pixel {
63    pub r: u8,
64    pub g: u8,
65    pub b: u8,
66    pub a: u8,
67}
68#[repr(C)]
69#[derive(Debug, Copy, Clone)]
70pub struct n64video_frame_buffer {
71    pub pixels: *mut n64video_pixel,
72    pub width: u32,
73    pub height: u32,
74    pub height_out: u32,
75    pub pitch: u32,
76    pub valid: bool,
77}
78#[repr(C)]
79#[derive(Debug, Copy, Clone)]
80pub struct n64video_config {
81    pub gfx: n64video_config_gfx,
82    pub vi: n64video_config_vi,
83    pub dp: n64video_config_dp,
84    /// use multithreaded renderer if true
85    pub parallel: bool,
86    /// use a busyloop while waiting for work
87    pub busyloop: bool,
88    /// number of rendering workers
89    pub num_workers: u32,
90}
91#[repr(C)]
92#[derive(Debug, Copy, Clone)]
93pub struct n64video_config_gfx {
94    /// RDRAM pointer
95    pub rdram: *mut u8,
96    /// size of RDRAM, typically 4 or 8 MiB
97    pub rdram_size: u32,
98    /// RSP data memory pointer
99    pub dmem: *mut u8,
100    /// video interface registers
101    pub vi_reg: *mut *mut u32,
102    /// display processor registers
103    pub dp_reg: *mut *mut u32,
104    /// MIPS interface interrupt register
105    pub mi_intr_reg: *mut u32,
106    /// interrupt callback function
107    pub mi_intr_cb: ::std::option::Option<unsafe extern "C" fn()>,
108}
109#[repr(C)]
110#[derive(Debug, Copy, Clone)]
111pub struct n64video_config_vi {
112    /// output mode
113    pub mode: vi_mode,
114    /// output interpolation method
115    pub interp: vi_interp,
116    /// force 16:9 aspect ratio if true
117    pub widescreen: bool,
118    /// crop to visible area if true
119    pub hide_overscan: bool,
120    /// enable vsync if true
121    pub vsync: bool,
122    /// run in exclusive mode when in fullscreen if true
123    pub exclusive: bool,
124    /// one native pixel is displayed as a multiple of a screen pixel if true
125    pub integer_scaling: bool,
126}
127#[repr(C)]
128#[derive(Debug, Copy, Clone)]
129pub struct n64video_config_dp {
130    /// multithreading compatibility mode
131    pub compat: dp_compat_profile,
132}
133
134extern "C" {
135    pub fn n64video_config_init(config: *mut n64video_config);
136
137    pub fn n64video_init(config: *mut n64video_config);
138
139    pub fn n64video_update_screen(fb: *mut n64video_frame_buffer);
140
141    pub fn n64video_process_list();
142
143    pub fn n64video_close();
144}