--- nono/vm/sprite.cpp 2026/04/29 17:04:32 1.1.1.2 +++ nono/vm/sprite.cpp 2026/04/29 17:04:50 1.1.1.5 @@ -1,11 +1,15 @@ // // nono -// Copyright (C) 2017 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #include "sprite.h" +#include "mpu.h" #include +std::unique_ptr gSprite; + SpriteDevice::SpriteDevice() { logname = "sprite"; @@ -32,6 +36,10 @@ SpriteDevice::Read8(uint32 addr) uint64 SpriteDevice::Read16(uint32 addr) { + // スプライトの Read はレジスタ、VRAM とも 17 ウェイト。 + // InsideOut p.135 + gMPU->AddCycle(17); + if (addr >= 0xeb8000) { return *(uint16 *)&mem[addr - 0xeb8000]; } @@ -78,9 +86,15 @@ uint64 SpriteDevice::Write8(uint32 addr, uint32 data) { if (addr >= 0xeb8000) { + // スプライト VRAM への書き込み (InsideOut p.135) + gMPU->AddCycle(18); mem[HB(addr - 0xeb8000)] = data; return 0; } + + // スプライトレジスタへの書き込み (InsideOut p.135) + gMPU->AddCycle(20); + PANIC("not impl"); }