mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
b2ed9313bd
* decompile 90% of shrubbery * some more progress * some more * big function decompiled * went through `draw-prototype-inline-array-shrub` and made more notes * shrub: start implementing extract_shrub * read through current notes and add the info to current decomp * decomp: allow skipping inline-asm from output * add code to BspHeader to get GOAL types for shrubs * add doc * wip * fix bad merge Co-authored-by: Tyler Wilding <xtvaser@gmail.com> Co-authored-by: Tyler Wilding <xTVaser@users.noreply.github.com>
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <optional>
|
|
#include <utility>
|
|
#include <map>
|
|
#include "common/goos/Object.h"
|
|
#include "decompiler/Disasm/Register.h"
|
|
#include "decompiler/Disasm/Instruction.h"
|
|
#include "decompiler/IR2/IR2_common.h"
|
|
#include "Env.h"
|
|
#include "AtomicOp.h"
|
|
#include "common/util/Assert.h"
|
|
|
|
namespace decompiler {
|
|
|
|
struct OpenGOALAsm {
|
|
enum class InstructionModifiers {
|
|
BROADCAST,
|
|
DEST_MASK,
|
|
FTF,
|
|
FSF,
|
|
OFFSET,
|
|
SWAP_FIRST_TWO_SOURCE_ARGS,
|
|
ACC_THIRD_SRC_ARG,
|
|
QWORD_CAST,
|
|
SKIP_IT
|
|
};
|
|
|
|
struct Function {
|
|
std::string funcTemplate = "";
|
|
std::vector<InstructionModifiers> modifiers = {};
|
|
|
|
bool allows_modifier(InstructionModifiers);
|
|
};
|
|
|
|
OpenGOALAsm(Instruction _instr);
|
|
|
|
OpenGOALAsm(Instruction _instr,
|
|
std::optional<RegisterAccess> _dst,
|
|
const std::vector<std::optional<RegisterAccess>>& _src);
|
|
|
|
bool valid = true;
|
|
bool todo = false;
|
|
bool skip = false;
|
|
Instruction m_instr;
|
|
std::optional<RegisterAccess> m_dst;
|
|
std::vector<std::optional<RegisterAccess>> m_src;
|
|
OpenGOALAsm::Function func;
|
|
|
|
std::string full_function_name();
|
|
std::vector<goos::Object> get_args(const std::vector<DecompilerLabel>& labels, const Env& env);
|
|
};
|
|
extern const std::map<InstructionKind, OpenGOALAsm::Function> MIPS_ASM_TO_OPEN_GOAL_FUNCS;
|
|
} // namespace decompiler
|