--- nono/hd64180/hd64180disasm.cpp 2026/04/29 17:05:18 1.1 +++ nono/hd64180/hd64180disasm.cpp 2026/04/29 17:05:30 1.1.1.2 @@ -34,11 +34,11 @@ hd64180disasm::Exec(DebuggerMemoryStream arg1.clear(); arg2.clear(); - ppc = (uint32)mem->laddr; + ppc = mem->laddr.Addr(); ixiy = USE_HL; ixd = (uint32)-1; // 1バイト目処理 - op = fetch8(); + op = fetch1(); switch (op) { #include "hd64180switch_00.inc" default: @@ -66,7 +66,7 @@ hd64180disasm::Exec(DebuggerMemoryStream // arg1 があればインデントして追加 if (!arg1.empty()) { - int len = text.length(); + uint len = text.length(); if (len < 8) { text += std::string(8 - len, ' '); } else { @@ -87,7 +87,7 @@ hd64180disasm::Exec(DebuggerMemoryStream // バイトフェッチ uint8 -hd64180disasm::fetch8() +hd64180disasm::fetch1() { uint8 data = mem->Read(1); bin.push_back(data); @@ -96,12 +96,12 @@ hd64180disasm::fetch8() // ワードフェッチ uint16 -hd64180disasm::fetch16() +hd64180disasm::fetch2() { uint16 data; - data = fetch8(); - data |= fetch8() << 8; + data = fetch1(); + data |= fetch1() << 8; return data; } @@ -116,7 +116,7 @@ hd64180disasm::HL() "IX", "IY", }; - return name[(int)ixiy]; + return name[(uint)ixiy]; } // (HL)/(IX+d)/(IY+d) を出力する。 @@ -126,7 +126,7 @@ hd64180disasm::HLin() if (ixiy) { // ixd を読むタイミングが DD CB の時だけ違う。 if ((int32)ixd < 0) { - ixd = fetch8(); + ixd = fetch1(); } if (ixd < 0x80) { return string_format("(%s+%02XH)", HL().c_str(), ixd); @@ -255,7 +255,7 @@ hd64180disasm::bbb() const std::string hd64180disasm::imm8() { - uint8 imm = fetch8(); + uint8 imm = fetch1(); if (imm < 0xa0) { return string_format("%02XH", imm); } else { @@ -266,7 +266,7 @@ hd64180disasm::imm8() std::string hd64180disasm::imm16() { - uint16 imm = fetch16(); + uint16 imm = fetch2(); if (imm < 0xa000) { return string_format("%04XH", imm); } else { @@ -277,10 +277,10 @@ hd64180disasm::imm16() std::string hd64180disasm::disp8() { - int8 disp = (int8)fetch8(); + int8 disp = (int8)fetch1(); // 外部的な表記はこの命令位置 + 2 となっているが、実際には // disp をフェッチした後の PC が起点になっているということのはず。 - uint32 pc = (uint32)mem->laddr; + uint32 pc = mem->laddr.Addr(); uint32 addr = pc + disp; if (addr < 0xa000) { return string_format("%04XH", addr); @@ -769,7 +769,7 @@ OP_DEF(ret) // 11001011: op_CB OP_DEF(cb) { - op = fetch8(); + op = fetch1(); switch (op) { #include "hd64180switch_cb.inc" default: @@ -829,7 +829,7 @@ hd64180disasm::ops_ddfd(ixiy_t xy) ixiy = xy; // 2バイト目をフェッチ - op = fetch8(); + op = fetch1(); // で分岐 switch (op) { #include "hd64180switch_dd.inc" @@ -889,7 +889,7 @@ OP_DEF(ex_de_hl) // 11101101: op_ED OP_DEF(ed) { - op = fetch8(); + op = fetch1(); switch (op) { #include "hd64180switch_ed.inc" default: @@ -1541,9 +1541,9 @@ OP_DEF(dd_cb) { // DD/FD CB の場合は 3バイト目が で 4バイト目が命令語の順。 // どうして…。 - ixd = fetch8(); + ixd = fetch1(); - op = fetch8(); + op = fetch1(); switch (op) { #include "hd64180switch_dd_cb.inc" default: