--- nono/vm/sio.cpp 2026/04/29 17:04:32 1.1.1.3 +++ nono/vm/sio.cpp 2026/04/29 17:04:50 1.1.1.6 @@ -1,10 +1,11 @@ // // nono -// Copyright (C) 2018 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #include "sio.h" -#include "mpu.h" +#include "interrupt.h" // IODevice // | @@ -32,20 +33,12 @@ SIODevice::~SIODevice() { } -// 本体リセットスイッチによるリセット -void -SIODevice::ResetHard() -{ - // チップリセット - Reset(); -} - uint64 -SIODevice::Read(uint32 addr) +SIODevice::Read(uint32 offset) { uint32 data; - switch (addr) { + switch (offset) { case 0: data = ReadData(&cr.chan[0]); break; @@ -65,9 +58,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; @@ -88,9 +81,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]); @@ -111,5 +104,5 @@ void SIODevice::Interrupt() { putlog(2, "Interrupt"); - gMPU->Interrupt(6); + gInterrupt->AssertINT(this); }