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
/* SPDX-FileCopyrightText: © 2022-2024 Decompollaborate */
/* SPDX-License-Identifier: MIT */

use crate::abi_enum;

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(non_camel_case_types)]
pub struct RegisterNames {
    pub named_registers: bool,
    pub gpr_abi_names: abi_enum::Abi,
    pub fpr_abi_names: abi_enum::Abi,
    pub user_fpc_csr: bool,
    pub vr4300_cop0_named_registers: bool,
    pub vr4300_rsp_cop0_named_registers: bool,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(non_camel_case_types)]
pub struct PseudoInstr {
    pub enable_pseudos: bool,
    pub pseudo_beqz: bool,
    pub pseudo_bnez: bool,
    pub pseudo_b: bool,
    pub pseudo_move: bool,
    pub pseudo_not: bool,
    pub pseudo_neg: bool,
    pub pseudo_negu: bool,
    pub pseudo_bal: bool,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(non_camel_case_types)]
pub struct ToolchainTweaks {
    pub treat_j_as_unconditional_branch: bool,
    pub sn64_div_fix: bool,
    pub gnu_mode: bool,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(non_camel_case_types)]
pub struct Misc {
    pub opcode_l_just: i32,
    pub unknown_instr_comment: bool,
    pub omit_0x_on_small_imm: bool,
    pub upper_case_imm: bool,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(non_camel_case_types)]
pub struct Config {
    pub reg_names: RegisterNames,
    pub pseudos: PseudoInstr,
    pub toolchain_tweaks: ToolchainTweaks,
    pub misc: Misc,
}

extern "C" {
    pub static mut RabbitizerConfig_Cfg: Config;
}