mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-02 06:40:05 +01:00
move module initialization into a module manager, still has some issues like stopping not working and debug crashing add #idef 0 to modules that aren't in the windows project don't double initialize and don't de-initialize for now, since many modules don't expect it and it leads to many errors remove duplicate module lists for empty modules and implemented ones, make Module non-copyable but movable add secondary project, no real use for it now add some memleak config to the emucore and add asmjit path to rpcs3 small rebase error fixed to get it to compile again add filters for emucore re-add the module manager and static file WIP commit, linker errors abound some more abstraction layer stuff fix the remaining linker errors, re-enable platform specific mouse, pad and keyboard handlers rebasing fix memset undefined and re() usage of se_t before declaration Add wxGUI define by default for cmake builds fix copy constructors of Datetime header fix copy constructors of other wx interface classes remove static declarations of global variables make wxGLCanvas constructor non-ambiguous even with wx2.8. compat mode, fix wrong std::exception constructor calls remove duplicate definition for FromUTF8 and ToUTF8 temp changes
96 lines
1.7 KiB
C++
96 lines
1.7 KiB
C++
#pragma once
|
|
#include "Emu/ARMv7/ARMv7Opcodes.h"
|
|
#include "Emu/CPU/CPUDisAsm.h"
|
|
#include "Emu/Memory/Memory.h"
|
|
|
|
static const char* g_arm_cond_name[16] =
|
|
{
|
|
"eq", "ne", "cs", "cc",
|
|
"mi", "pl", "vs", "vc",
|
|
"hi", "ls", "ge", "lt",
|
|
"gt", "le", "al", "al",
|
|
};
|
|
|
|
class ARMv7DisAsm
|
|
: public CPUDisAsm
|
|
, public ARMv7Opcodes
|
|
{
|
|
public:
|
|
ARMv7DisAsm(CPUDisAsmMode mode) : CPUDisAsm(mode)
|
|
{
|
|
}
|
|
|
|
protected:
|
|
virtual u32 DisAsmBranchTarget(const s32 imm)
|
|
{
|
|
return dump_pc + imm;
|
|
}
|
|
|
|
std::string GetRegsListString(u16 regs_list)
|
|
{
|
|
std::string regs_str;
|
|
|
|
for(u16 mask=0x1, i=0; mask; mask <<= 1, i++)
|
|
{
|
|
if(regs_list & mask)
|
|
{
|
|
if(!regs_str.empty())
|
|
{
|
|
regs_str += ", ";
|
|
}
|
|
|
|
regs_str += g_arm_reg_name[i];
|
|
}
|
|
}
|
|
|
|
return regs_str;
|
|
}
|
|
|
|
void NULL_OP()
|
|
{
|
|
Write("null");
|
|
}
|
|
|
|
void PUSH(u16 regs_list)
|
|
{
|
|
Write(fmt::Format("push {%s}", GetRegsListString(regs_list).c_str()));
|
|
}
|
|
|
|
void POP(u16 regs_list)
|
|
{
|
|
Write(fmt::Format("pop {%s}", GetRegsListString(regs_list).c_str()));
|
|
}
|
|
|
|
void NOP()
|
|
{
|
|
Write("nop");
|
|
}
|
|
|
|
void B(u8 cond, u32 imm, u8 intstr_size)
|
|
{
|
|
if((cond & 0xe) == 0xe)
|
|
{
|
|
Write(fmt::Format("b 0x%x", DisAsmBranchTarget(imm) + intstr_size));
|
|
}
|
|
else
|
|
{
|
|
Write(fmt::Format("b[%s] 0x%x", g_arm_cond_name[cond], DisAsmBranchTarget(imm) + intstr_size));
|
|
}
|
|
}
|
|
|
|
virtual void CBZ(u8 op, u32 imm, u8 rn, u8 intstr_size)
|
|
{
|
|
Write(fmt::Format("cb%sz 0x%x,%s", (op ? "n" : ""), DisAsmBranchTarget(imm) + intstr_size, g_arm_reg_name[rn]));
|
|
}
|
|
|
|
void BL(u32 imm, u8 intstr_size)
|
|
{
|
|
Write(fmt::Format("bl 0x%x", DisAsmBranchTarget(imm) + intstr_size));
|
|
}
|
|
|
|
void UNK(const u16 code0, const u16 code1)
|
|
{
|
|
Write(fmt::Format("Unknown/Illegal opcode! (0x%04x : 0x%04x)", code0, code1));
|
|
}
|
|
};
|