--- nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:24 1.1.1.11 +++ nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:28 1.1.1.12 @@ -192,7 +192,7 @@ DebuggerMD_m88xx0::GetRegAddr(const char if (strcmp(name, "sr3") == 0) return cpu->reg.sr[3]; for (int i = 0; i < countof(cpu->reg.cr); i++) { - snprintf(buf, sizeof(buf), "cr%d", i); + snprintf(buf, sizeof(buf), "cr%u", i); if (strcmp(name, buf) == 0) { return cpu->reg.cr[i]; } @@ -203,7 +203,7 @@ DebuggerMD_m88xx0::GetRegAddr(const char // 通常レジスタ for (int i = 0; i < countof(cpu->reg.r); i++) { - snprintf(buf, sizeof(buf), "r%d", i); + snprintf(buf, sizeof(buf), "r%u", i); if (strcmp(name, buf) == 0) { return cpu->reg.r[i]; } @@ -408,7 +408,7 @@ r2 :0070e1a0 r10:00000000 r18:00000000 int y = 0; uint32 res = cpu->reg.r[cmp_rd]; for (int b = 11; b >= 2; b--) { - s.Print(57 + x * 7, y, "%x:%s=%d", b, cmpstr[b], + s.Print(57 + x * 7, y, "%x:%s=%u", b, cmpstr[b], (res & (1 << b)) ? 1 : 0); x++; if (x > 2) { @@ -496,7 +496,7 @@ fip:00000000 sfip(cr6 // S*IP x = 32; for (int i = 0; i < 3; i++) { - s.Print(x, y + i, TSBOLDC(cr[4 + i]), "%s(cr%d):%08x:%c%c", + s.Print(x, y + i, TSBOLDC(cr[4 + i]), "%s(cr%u):%08x:%c%c", m88100reg::sipname[i], 4 + i, (cpu->reg.cr[4 + i] & M88100::SIP_MASK), (cpu->reg.cr[4 + i] & M88100::SIP_V) ? 'V' : '-', @@ -508,7 +508,7 @@ fip:00000000 sfip(cr6 // SR* for (int i = 0; i < 4; i++) { int rn = 17 + i; - s.Print(x, y++, TSBOLDC(cr[rn]), "sr%d(cr%d):%08x", + s.Print(x, y++, TSBOLDC(cr[rn]), "sr%u(cr%u):%08x", i, rn, cpu->reg.cr[rn]); } // ssbr(cr3) @@ -593,9 +593,9 @@ DebuggerMD_m88xx0::ShowRegFPU() }; TextScreen s(80, 4); - for (int i = 0; i < 9; i++) { + for (uint i = 0; i < 9; i++) { s.Print((i / 4) * 22, i % 4, TSBOLDC(fcr[i]), - "%-5s(fcr%d):%08x", fcrname[i], i, cpu->reg.fcr[i]); + "%-5s(fcr%u):%08x", fcrname[i], i, cpu->reg.fcr[i]); } s.Print(44, 2, TSBOLDC(fpsr), "fpsr(fcr62):%08x", cpu->reg.fpsr); @@ -615,12 +615,12 @@ dmt0(cr8) :0000(B,S,D,L,Rxx,S,---B,W,V) dmt0(cr11):0000(B,U,D,L,Rxx,S,HH--,W,V) dmd0(cr9) :00000000 dma0(cr10):00000000 dmt0(cr14):0000(B, ,D,L,Rxx,S,LLLL,W,V) dmd0(cr9) :00000000 dma0(cr10):00000000 */ - for (int i = 0; i <= 2; i++) { - int dt = 8 + i * 3; - int dd = 9 + i * 3; - int da = 10 + i * 3; + for (uint i = 0; i <= 2; i++) { + uint dt = 8 + i * 3; + uint dd = 9 + i * 3; + uint da = 10 + i * 3; - s.Print(0, i, TSBOLDC(cr[dt]), "dmt%d(cr%-2d):%04x", + s.Print(0, i, TSBOLDC(cr[dt]), "dmt%u(cr%-2u):%04x", i, dt, (cpu->reg.cr[dt] & 0xffff)); s.Print(15, i, "(b,s,d,l,rx, s,en ,w,v)"); PRINT_B(16, i, cr[dt], M88100::DM_BO, "%c", _new ? 'B' : '-'); @@ -628,7 +628,7 @@ dmt0(cr14):0000(B, ,D,L,Rxx,S,LLLL,W,V) PRINT_B(20, i, cr[dt], M88100::DM_DOUB1, "%c", _new ? 'D' : '-'); PRINT_B(22, i, cr[dt], M88100::DM_LOCK, "%c", _new ? 'L' : '-'); // カンマを前詰め。かつ DREG がボールドでもカンマはボールドにしない - PRINT_B(24, i, cr[dt], M88100::DM_DREG_MASK, "r%d", _new >> 7); + PRINT_B(24, i, cr[dt], M88100::DM_DREG_MASK, "r%u", _new >> 7); s.Puts(","); PRINT_B(28, i, cr[dt], M88100::DM_SIGNED, "%c", _new ? 'S' : '-'); PRINT_B(30, i, cr[dt], M88100::DM_EN_MASK,"%s", @@ -636,9 +636,9 @@ dmt0(cr14):0000(B, ,D,L,Rxx,S,LLLL,W,V) PRINT_B(35, i, cr[dt], M88100::DM_WRITE, "%c", _new ? 'W' : '-'); PRINT_B(37, i, cr[dt], M88100::DM_VALID, "%c", _new ? 'V' : '-'); - s.Print(40, i, TSBOLDC(cr[dd]), "dmd%d(cr%-2d):%08x", + s.Print(40, i, TSBOLDC(cr[dd]), "dmd%u(cr%-2u):%08x", i, dd, cpu->reg.cr[dd]); - s.Print(60, i, TSBOLDC(cr[dd]), "dma%d(cr%2d):%08x", + s.Print(60, i, TSBOLDC(cr[dd]), "dma%u(cr%2u):%08x", i, da, cpu->reg.cr[da]); } @@ -659,11 +659,7 @@ DebuggerMD_m88xx0::Disassemble(DebuggerM // 別名追加 if (!dis.alttext.empty()) { int len = mnemonic.length() % 8; - if (len < 8) { - mnemonic += std::string(8 - len, ' '); - } else { - mnemonic += ' '; - } + mnemonic += std::string(8 - len, ' '); mnemonic += dis.alttext; }