--- nono/vm/xpbus.cpp 2026/04/29 17:05:25 1.1.1.2 +++ nono/vm/xpbus.cpp 2026/04/29 17:05:29 1.1.1.3 @@ -99,67 +99,35 @@ XPbusDevice::SearchDevice(uint32 addr) c } busdata -XPbusDevice::Read8(uint32 addr) +XPbusDevice::Read1(uint32 addr) { addr &= 0x000fffff; IODevice *d = SearchDevice(addr); - return d->Read8(addr); + return d->Read1(addr); } busdata -XPbusDevice::Read16(uint32 addr) +XPbusDevice::Write1(uint32 addr, uint32 data) { addr &= 0x000fffff; IODevice *d = SearchDevice(addr); - return d->Read16(addr); + return d->Write1(addr, data); } busdata -XPbusDevice::Read32(uint32 addr) +XPbusDevice::Peek1(uint32 addr) { addr &= 0x000fffff; IODevice *d = SearchDevice(addr); - return d->Read32(addr); -} - -busdata -XPbusDevice::Write8(uint32 addr, uint32 data) -{ - addr &= 0x000fffff; - IODevice *d = SearchDevice(addr); - return d->Write8(addr, data); -} - -busdata -XPbusDevice::Write16(uint32 addr, uint32 data) -{ - addr &= 0x000fffff; - IODevice *d = SearchDevice(addr); - return d->Write16(addr, data); -} - -busdata -XPbusDevice::Write32(uint32 addr, uint32 data) -{ - addr &= 0x000fffff; - IODevice *d = SearchDevice(addr); - return d->Write32(addr, data); -} - -busdata -XPbusDevice::Peek8(uint32 addr) -{ - addr &= 0x000fffff; - IODevice *d = SearchDevice(addr); - return d->Peek8(addr); + return d->Peek1(addr); } bool -XPbusDevice::Poke8(uint32 addr, uint32 data) +XPbusDevice::Poke1(uint32 addr, uint32 data) { addr &= 0x000fffff; IODevice *d = SearchDevice(addr); - return d->Poke8(addr, data); + return d->Poke1(addr, data); } // RMCR レジスタを取得する @@ -196,57 +164,30 @@ XPRAMDevice::~XPRAMDevice() } busdata -XPRAMDevice::Read8(uint32 addr) +XPRAMDevice::Read1(uint32 addr) { - addr &= 0x1ff; - return ram[addr]; + uint32 offset = addr & 0x1ff; + busdata data = ram[offset]; + return data; } busdata -XPRAMDevice::Read16(uint32 addr) +XPRAMDevice::Write1(uint32 addr, uint32 data) { - putlog(0, "should not be called?"); - return busdata::BusErr; -} - -busdata -XPRAMDevice::Read32(uint32 addr) -{ - putlog(0, "should not be called?"); - return busdata::BusErr; -} - -busdata -XPRAMDevice::Write8(uint32 addr, uint32 data) -{ - addr &= 0x1ff; - ram[addr] = data; + uint32 offset = addr & 0x1ff; + ram[offset] = data; return 0; } busdata -XPRAMDevice::Write16(uint32 addr, uint32 data) -{ - putlog(0, "should not be called?"); - return busdata::BusErr; -} - -busdata -XPRAMDevice::Write32(uint32 addr, uint32 data) -{ - putlog(0, "should not be called?"); - return busdata::BusErr; -} - -busdata -XPRAMDevice::Peek8(uint32 addr) +XPRAMDevice::Peek1(uint32 addr) { addr &= 0x1ff; return ram[addr]; } bool -XPRAMDevice::Poke8(uint32 addr, uint32 data) +XPRAMDevice::Poke1(uint32 addr, uint32 data) { if ((int32)data >= 0) { addr &= 0x1ff;