mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-01-29 21:32:45 +00:00
C++ bindings for R3000GTE
This commit is contained in:
parent
e249be9f38
commit
bf775c7351
28
cplusplus/include/instructions/InstructionR3000GTE.hpp
Normal file
28
cplusplus/include/instructions/InstructionR3000GTE.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
/* SPDX-FileCopyrightText: © 2023 Decompollaborate */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#ifndef RABBITIZER_INSTRUCTION_R3000GTE_HPP
|
||||
#define RABBITIZER_INSTRUCTION_R3000GTE_HPP
|
||||
#pragma once
|
||||
|
||||
#include "InstructionBase.hpp"
|
||||
|
||||
|
||||
namespace rabbitizer {
|
||||
class InstructionR3000GTE : public InstructionBase {
|
||||
public:
|
||||
InstructionR3000GTE(uint32_t word, uint32_t vram);
|
||||
virtual ~InstructionR3000GTE();
|
||||
|
||||
uint8_t GetR3000GTE_fakeOpcode() const;
|
||||
|
||||
uint8_t GetR3000GTE_sf() const;
|
||||
uint8_t GetR3000GTE_mx() const;
|
||||
uint8_t GetR3000GTE_v() const;
|
||||
uint8_t GetR3000GTE_cv() const;
|
||||
uint8_t GetR3000GTE_lm() const;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
|
||||
/* SPDX-FileCopyrightText: © 2022-2023 Decompollaborate */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#ifndef RABBITIZER_HPP
|
||||
@ -17,6 +17,7 @@
|
||||
#include "instructions/InstructionBase.hpp"
|
||||
#include "instructions/InstructionCpu.hpp"
|
||||
#include "instructions/InstructionRsp.hpp"
|
||||
#include "instructions/InstructionR3000GTE.hpp"
|
||||
#include "instructions/InstructionR5900.hpp"
|
||||
|
||||
#include "analysis/LoPairingInfo.hpp"
|
||||
|
39
cplusplus/src/instructions/InstructionR3000GTE.cpp
Normal file
39
cplusplus/src/instructions/InstructionR3000GTE.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
/* SPDX-FileCopyrightText: © 2023 Decompollaborate */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#include "instructions/InstructionR3000GTE.hpp"
|
||||
|
||||
#include "instructions/RabbitizerInstructionR3000GTE.h"
|
||||
|
||||
using namespace rabbitizer;
|
||||
|
||||
InstructionR3000GTE::InstructionR3000GTE(uint32_t word, uint32_t vram) : InstructionBase() {
|
||||
RabbitizerInstructionR3000GTE_init(&this->instr, word, vram);
|
||||
RabbitizerInstructionR3000GTE_processUniqueId(&this->instr);
|
||||
}
|
||||
|
||||
InstructionR3000GTE::~InstructionR3000GTE() {
|
||||
RabbitizerInstructionR3000GTE_destroy(&this->instr);
|
||||
}
|
||||
|
||||
|
||||
uint8_t InstructionR3000GTE::GetR3000GTE_fakeOpcode() const {
|
||||
return RAB_INSTR_R3000GTE_GET_FAKE_OPCODE(&this->instr);
|
||||
}
|
||||
|
||||
uint8_t InstructionR3000GTE::GetR3000GTE_sf() const {
|
||||
return RAB_INSTR_R3000GTE_GET_sf(&this->instr);
|
||||
}
|
||||
|
||||
uint8_t InstructionR3000GTE::GetR3000GTE_mx() const {
|
||||
return RAB_INSTR_R3000GTE_GET_mx(&this->instr);
|
||||
}
|
||||
uint8_t InstructionR3000GTE::GetR3000GTE_v() const {
|
||||
return RAB_INSTR_R3000GTE_GET_v(&this->instr);
|
||||
}
|
||||
uint8_t InstructionR3000GTE::GetR3000GTE_cv() const {
|
||||
return RAB_INSTR_R3000GTE_GET_cv(&this->instr);
|
||||
}
|
||||
uint8_t InstructionR3000GTE::GetR3000GTE_lm() const {
|
||||
return RAB_INSTR_R3000GTE_GET_lm(&this->instr);
|
||||
}
|
@ -23,3 +23,10 @@ pub fn shiftl(v: u32, s: u32, w: u32) -> u32 {
|
||||
pub fn shiftr(v: u32, s: u32, w: u32) -> u32 {
|
||||
mask(v >> s, w)
|
||||
}
|
||||
|
||||
pub fn convert_option_string_to_option_str(input: &Option<String>) -> Option<&str> {
|
||||
match input {
|
||||
None => None,
|
||||
Some(x) => Some(x.as_str())
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user