Mesen-X/Core/DisassemblyInfo.h
Sour 2c9d6aabd7 Debugger: Improved CA/CC65 integration
-Auto-detect all function entry points
-Auto-detect all jump targets
-Fixed a bug where jump targets were being disassembled when loading a CDL file, potentially causing data to be shown as code
-Fixed some valid data block being shown as unidentified data
2019-01-02 23:26:54 -05:00

47 lines
1.3 KiB
C++

#pragma once
#include "stdafx.h"
#include <unordered_map>
class MemoryManager;
class LabelManager;
struct State;
enum class AddrMode;
class DisassemblyInfo
{
public:
static string OPName[256];
static AddrMode OPMode[256];
static uint8_t OPSize[256];
static bool IsUnofficialCode[256];
private:
uint8_t _byteCode[3];
bool _isSubEntryPoint = false;
bool _isSubExitPoint = false;
uint32_t _opSize = 0;
AddrMode _opMode;
public:
DisassemblyInfo();
DisassemblyInfo(uint8_t* opPointer, bool isSubEntryPoint);
void Initialize(uint8_t * opPointer, bool isSubEntryPoint);
void SetSubEntryPoint();
int32_t GetEffectiveAddress(State& cpuState, MemoryManager* memoryManager);
void GetEffectiveAddressString(string &out, State& cpuState, MemoryManager* memoryManager, LabelManager* labelManager);
int32_t GetMemoryValue(State& cpuState, MemoryManager* memoryManager);
int32_t GetJumpDestination(uint16_t pc, MemoryManager* memoryManager);
uint16_t GetIndirectJumpDestination(MemoryManager* memoryManager);
void ToString(string &out, uint32_t memoryAddr, MemoryManager* memoryManager, LabelManager* labelManager, bool extendZeroPage);
void GetByteCode(string &out);
uint32_t GetSize();
uint16_t GetOpAddr(uint16_t memoryAddr);
bool IsSubEntryPoint();
bool IsSubExitPoint();
};