--- nono/vm/mk48t02.cpp 2026/04/29 17:05:18 1.1.1.13 +++ nono/vm/mk48t02.cpp 2026/04/29 17:05:25 1.1.1.14 @@ -159,18 +159,19 @@ MK48T02Device::BCD2num(uint8 bcd) return (bcd >> 4) * 10 + (bcd & 0x0f); } -uint64 +busdata MK48T02Device::Read(uint32 offset) { - uint32 data; + busdata data; data = mem[offset]; - putlog(3, "$%08x -> $%02x", mpu->GetPaddr(), data); + putlog(3, "$%08x -> $%02x", mpu->GetPaddr(), data.Data()); + // XXX wait? return data; } -uint64 +busdata MK48T02Device::Write(uint32 offset, uint32 data) { putlog(3, "$%08x <- $%02x", mpu->GetPaddr(), data); @@ -208,26 +209,27 @@ MK48T02Device::Write(uint32 offset, uint mem[offset] = data; + // XXX wait? return 0; } -uint64 +busdata MK48T02Device::Peek(uint32 offset) { return mem[offset]; } -uint64 +bool MK48T02Device::Poke(uint32 offset, uint32 data) { // 時計部分にはコントロールレジスタもあるので書き込み不可。 if (offset >= 2040) { - return (uint64)-1; + return false; } else { if ((int32)data >= 0) { mem[offset] = data; } - return 0; + return true; } }