--- nono/vm/areaset.cpp 2026/04/29 17:05:17 1.1.1.8 +++ nono/vm/areaset.cpp 2026/04/29 17:06:00 1.1.1.13 @@ -9,7 +9,9 @@ // #include "areaset.h" -#include "mpu.h" +#include "event.h" +#include "mainbus.h" +#include "x68kio.h" // コンストラクタ AreaSetDevice::AreaSetDevice() @@ -22,58 +24,53 @@ AreaSetDevice::~AreaSetDevice() { } +// 初期化 +bool +AreaSetDevice::Init() +{ + x68kio = GetX68kIODevice(); + + return true; +} + // リセット void AreaSetDevice::ResetHard(bool poweron) { - limit = 0; + // リセットでどうなるかは分からないけど、 + // さすがに不定ではないだろう。 + x68kio->SetAreaset(0); } -uint64 -AreaSetDevice::Read8(uint32 addr) +busdata +AreaSetDevice::ReadPort(uint32 offset) { - switch (addr) { - case 0xe86001: - return limit; - } - return (uint64)-1; + putlog(2, "Read $%06x (BusErr)", GetMainbusDevice()->GetPaddr()); + return BusData::BusErr; } -uint64 -AreaSetDevice::Read16(uint32 addr) -{ - return 0xff00 | Read8(addr + 1); -} -uint64 -AreaSetDevice::Write8(uint32 addr, uint32 data) +busdata +AreaSetDevice::WritePort(uint32 offset, uint32 data) { - mpu->AddCycle(7); // InsideOut p.135 + putlog(1, "Write $%06x <- $%02x", GetMainbusDevice()->GetPaddr(), data); + x68kio->SetAreaset(data); - switch (addr) { - case 0xe86001: - putlog(0, "Write $%02x (NOT IMPLEMENTED)", data); - limit = data; - return 0; - default: - break; - } - return (uint64)-1; + const busdata wait = busdata::Wait(7 * 40_nsec); + busdata r = wait; + r |= BusData::Size1; + return r; } -uint64 -AreaSetDevice::Write16(uint32 addr, uint32 data) +busdata +AreaSetDevice::PeekPort(uint32 offset) { - return Write8(addr + 1, data); + return BusData::BusErr; } -uint64 -AreaSetDevice::Peek8(uint32 addr) +bool +AreaSetDevice::PokePort(uint32 offset, uint32 data) { - switch (addr) { - case 0xe86001: - return limit; - default: - return 0xff; - } + // とりあえず + return false; }