--- nono/vm/sio.cpp 2026/04/29 17:04:36 1.1.1.4 +++ nono/vm/sio.cpp 2026/04/29 17:04:56 1.1.1.7 @@ -5,7 +5,7 @@ // #include "sio.h" -#include "mpu.h" +#include "interrupt.h" // IODevice // | @@ -20,33 +20,27 @@ std::unique_ptr gSIO; SIODevice::SIODevice() + : inherited("SIO") { - logname = "sio"; - devname = "SIO"; devaddr = 0x51000000; cr.chan[0].desc = "Serial Console"; cr.chan[1].desc = "Keyboard"; -} -SIODevice::~SIODevice() -{ + // LUNA では SIO と呼ぶほうが通りがいい。 + monitor.Regist(ID_MONITOR_SIO); } -// 本体リセットスイッチによるリセット -void -SIODevice::ResetHard() +SIODevice::~SIODevice() { - // チップリセット - Reset(); } uint64 -SIODevice::Read(uint32 addr) +SIODevice::Read(uint32 offset) { uint32 data; - switch (addr) { + switch (offset) { case 0: data = ReadData(&cr.chan[0]); break; @@ -66,9 +60,9 @@ SIODevice::Read(uint32 addr) } uint64 -SIODevice::Write(uint32 addr, uint32 data) +SIODevice::Write(uint32 offset, uint32 data) { - switch (addr) { + switch (offset) { case 0: WriteData(&cr.chan[0], data); return 0; @@ -89,9 +83,9 @@ SIODevice::Write(uint32 addr, uint32 dat } uint64 -SIODevice::Peek(uint32 addr) +SIODevice::Peek(uint32 offset) { - switch (addr) { + switch (offset) { case 0: return PeekData(&cr.chan[0]); @@ -112,5 +106,5 @@ void SIODevice::Interrupt() { putlog(2, "Interrupt"); - gMPU->Interrupt(this, 6); + gInterrupt->AssertINT(this); }