|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
7: #pragma once
8:
9: #include "debugger_private.h"
1.1.1.2 root 10: #include "mpu680x0.h"
1.1 root 11: #include "m68030.h"
12: #include "m68030disasm.h"
13:
14: class DebuggerMD_m680x0 : public DebuggerMD
15: {
1.1.1.2 root 16: using inherited = DebuggerMD;
1.1 root 17: public:
1.1.1.2 root 18: DebuggerMD_m680x0(Debugger *parent, m68kcpu *cpu);
19: ~DebuggerMD_m680x0() override;
20:
21: void ReqSet(uint32 flag) override { cpu->atomic_reqflag |= flag; }
22: void ReqClr(uint32 flag) override { cpu->atomic_reqflag &= ~flag; }
23:
24: bool IsSuper() const override { return cpu->reg.s; }
25: bool MMUEnabled() const override { return cpu->mmu_enable; }
26: uint64 TranslateAddr(saddr_t laddr) override;
27:
28: uint32 GetPC() const override { return RegPC; }
29:
30: void SetStepOut() override;
31: bool IsStepOut() const override;
32: uint64 GetRegAddr(const char *name) const override;
33: void BackupRegs() override { prev = cpu->reg; }
34: bool ShowRegister(Console *cons, const std::vector<std::string>& args)
35: override;
36: const HelpMessages& GetRegisterHelp() const override;
1.1 root 37:
1.1.1.3 ! root 38: BranchHistory& GetBrHist() const override { return cpu->brhist; }
! 39: BranchHistory& GetExHist() const override { return cpu->exhist; }
1.1.1.2 root 40:
41: bool CheckLEA(uint32 laddr) override { return false; }
1.1 root 42:
43: bool Disassemble(saddr_t laddr,
1.1.1.2 root 44: std::string& mnemonic, std::vector<uint8>& bin) override;
1.1 root 45: std::string FormatDisasm(const std::string& mnemonic,
1.1.1.2 root 46: const std::vector<uint8>& bin) override;
1.1 root 47: std::string FormatDisasmLive(const std::string& mnemonic,
1.1.1.2 root 48: const std::vector<uint8>& bin) override;
1.1 root 49:
50: private:
51: m68kcpu *cpu = NULL; // CPU コア
52: m68kreg prev {}; // 前回のレジスタセットのコピー
53:
1.1.1.2 root 54: // 前回アクセス時の論理ページ。.addr == 0xffffffff なら無効。
55: saddr_t last_lpage;
56: uint32 last_ppage;
57:
1.1 root 58: const char *CondStr(const std::vector<uint16>& ir);
59: bool IsOPcc(uint16 op);
60: bool IsDBcc(uint16 op);
61: bool IsCond(uint16 op);
62:
1.1.1.2 root 63: static const HelpMessages HelpMsgRegister;
64: void ShowRegMain(Console *cons);
65: void ShowRegFPU(Console *cons);
66: void ShowRegMMU(Console *cons);
67: void ShowRegATC(Console *cons);
68: void ShowRegOther(Console *cons);
69:
1.1 root 70: uint32 so_a7 = 0; // ステップアウト判定用
71: uint16 so_sr = 0;
72: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.