--- nono/debugger/debugger_m88xx0.h 2026/04/29 17:05:09 1.1.1.7 +++ nono/debugger/debugger_m88xx0.h 2026/04/29 17:05:16 1.1.1.8 @@ -12,25 +12,21 @@ #include "debugger_private.h" #include "mpu88xx0.h" -#include "m88100.h" #include "m88100disasm.h" class DebuggerMD_m88xx0 : public DebuggerMD { using inherited = DebuggerMD; public: - DebuggerMD_m88xx0(Debugger *parent_, m88kcpu *cpu_); + DebuggerMD_m88xx0(Debugger *parent_); ~DebuggerMD_m88xx0() override; - void ReqSet(uint32 flag) override { cpu->atomic_reqflag |= flag; } - void ReqClr(uint32 flag) override { cpu->atomic_reqflag &= ~flag; } - - bool IsSuper() const override { return (cpu->psr & m88100reg::PSR_SUPER); } + CPUState GetCPUState() const override { return (CPUState)cpu->GetState(); } + bool IsSuper() const override { return cpu->IsSuper(); } bool MMUEnabled() const override; uint64 TranslateAddr(saddr_t laddr, bool lookup) const override; - // XXX ? - uint32 GetPC() const override { return cpu->GetXIP(); } + uint32 GetPC() const override { return cpu->GetPPC(); } void SetStepOut() override; bool IsStepOut() const override; @@ -41,24 +37,18 @@ class DebuggerMD_m88xx0 : public Debugge const HelpMessages& GetHelpListReg() const override; const HelpMessages& GetHelpReg() const override; - BranchHistory& GetBrHist() const override { return cpu->brhist; } - BranchHistory& GetExHist() const override { return cpu->exhist; } - bool CheckLEA(uint32 laddr) override { bool rv = cpu->lastaddr == laddr; - cpu->lastaddr = 0; // XXX: ていうかここでクリアはおかしい + cpu->lastaddr = (uint64)-1; // XXX: ていうかここでクリアはおかしい return rv; } - bool Disassemble(DebuggerMemoryStream& mem, - std::string& mnemonic, std::vector& bin) override; - std::string FormatDisasm(const std::string& mnemonic, - const std::vector& bin) override; - std::string FormatDisasmLive(const std::string& mnemonic, - const std::vector& bin) override; + std::string Disassemble(DebuggerMemoryStream& mem) override; private: - m88kcpu *cpu {}; // CPU コア + MPU88xx0Device *cpu {}; // MPU デバイス + m88200 *cmmu0 {}; // 命令 CMMU + m88200 *cmmu1 {}; // データ CMMU m88100reg prev {}; // 前回のレジスタセットのコピー static bool IsBB0(uint32 op); @@ -85,5 +75,7 @@ class DebuggerMD_m88xx0 : public Debugge // -1 なら該当しないの意。 int cmp_rd {}; + const BranchHistory *brhist {}; + uint32 so_r1 {}; // ステップアウト判定用 };