mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-07 13:13:32 +01:00
![Pierre Bourdon](/assets/img/avatar_default.png)
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.
46 lines
943 B
C++
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
|