--- nono/m680x0/m68030disasm.cpp 2026/04/29 17:04:40 1.1.1.4 +++ nono/m680x0/m68030disasm.cpp 2026/04/29 17:05:22 1.1.1.8 @@ -5,12 +5,10 @@ // #include "m68030disasm.h" -#include "bus.h" -#include "mystring.h" +#include "debugger_memory.h" // コンストラクタ -m680x0disasm::m680x0disasm(DebuggerMD *md_) - : inherited(md_) +m680x0disasm::m680x0disasm() { } @@ -21,9 +19,9 @@ m680x0disasm::~m680x0disasm() // 逆アセンブルを実行 bool -m680x0disasm::Exec(saddr_t addr) +m680x0disasm::Exec(DebuggerMemoryStream *mem_) { - ExecInit(); + ExecInit(mem_); ir.clear(); name.clear(); @@ -31,8 +29,7 @@ m680x0disasm::Exec(saddr_t addr) src.clear(); dst.clear(); - pc = addr; - pc0 = pc.addr; + pc0 = (uint32)mem->laddr; switch (fetch16() >> 6) { #include "m68030switch.h" @@ -87,17 +84,16 @@ m680x0disasm::Exec(saddr_t addr) uint32 m680x0disasm::peek16() { - return md->PeekFetch(pc); + return mem->Peek(2); } // ワードフェッチ uint32 m680x0disasm::fetch16() { - uint16 data = peek16(); - // IR に入れて PC を進める + uint16 data = mem->Read(2); + // IR にも入れる ir.push_back(data); - pc.addr += 2; return data; } @@ -214,7 +210,7 @@ m680x0disasm::make_ea(uint mmrr) s = addr32(); break; case 0x3a: // d16(pc) - s = addr32(pc.addr + (int32)(int16)fetch16()) + + s = addr32((uint32)mem->laddr + (int32)(int16)fetch16()) + "(" + make_reg(Reg::PC) + ")"; break; case 0x3b: // d8(pc,IX) @@ -602,7 +598,7 @@ m680x0disasm::make_reglist_half(std::str if (top < 0) { // 非表示中ならこのレジスタを出力する。 // 初回以外は区切りを先に出力する。 - if (s.length() != 0) { + if (s.empty() == false) { s += '/'; } s += reg; @@ -657,7 +653,7 @@ m680x0disasm::make_bf() if (width < 8) { s += make_dn(width); } else { - s += string_format("", width); + s += string_format("", width); } } else { // 幅は 0 なら 32 を意味する @@ -2983,9 +2979,13 @@ OP_DEF(addq_l) dst = make_ea(); } -// Scc/SF のメイン部分。 -void -m680x0disasm::ops_scc() +// %0101_cccc11_mmmrrr Scc.B +// %0101_cccc11_001yyy DBcc.W Dy,