dolphin/Source/Core/Core/DSP/DSPDisassembler.h
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00

46 lines
943 B
C++

// Copyright 2008 Dolphin Emulator Project
// Copyright 2005 Duddie
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <string>
#include <vector>
#include "Common/CommonTypes.h"
namespace DSP
{
struct DSPOPCTemplate;
struct AssemblerSettings
{
bool print_tabs = false;
bool show_hex = false;
bool show_pc = false;
bool force = false;
bool decode_names = true;
bool decode_registers = true;
char ext_separator = '\'';
bool lower_case_ops = true;
u16 pc = 0;
};
class DSPDisassembler
{
public:
explicit DSPDisassembler(const AssemblerSettings& settings);
bool Disassemble(const std::vector<u16>& code, std::string& text);
// Warning - this one is trickier to use right.
bool DisassembleOpcode(const u16* binbuf, u16* pc, std::string& dest);
private:
std::string DisassembleParameters(const DSPOPCTemplate& opc, u16 op1, u16 op2);
const AssemblerSettings settings_;
};
} // namespace DSP