--- nono/vm/sprite.cpp 2026/04/29 17:04:56 1.1.1.7 +++ nono/vm/sprite.cpp 2026/04/29 17:05:14 1.1.1.9 @@ -4,12 +4,17 @@ // Licensed under nono-license.txt // +// +// スプライトコントローラ +// + #include "sprite.h" #include "mpu.h" -#include -std::unique_ptr gSprite; +// グローバル参照用 +SpriteDevice *gSprite; +// コンストラクタ SpriteDevice::SpriteDevice() : inherited("Sprite") { @@ -19,11 +24,13 @@ SpriteDevice::SpriteDevice() mem.reset(new uint8[4 * 8192]); } +// デストラクタ SpriteDevice::~SpriteDevice() { + gSprite = NULL; } -// XXX PowerOn() か ResetHard() 未調査 +// XXX ResetHard() 未調査 uint64 SpriteDevice::Read8(uint32 addr) @@ -31,7 +38,7 @@ SpriteDevice::Read8(uint32 addr) if (addr >= 0xeb8000) { return mem[HB(addr - 0xeb8000)]; } - PANIC("not impl"); + VMPANIC("not impl"); } uint64 @@ -96,13 +103,13 @@ SpriteDevice::Write8(uint32 addr, uint32 // スプライトレジスタへの書き込み (InsideOut p.135) gMPU->AddCycle(20); - PANIC("not impl"); + VMPANIC("not impl"); } uint64 SpriteDevice::Write16(uint32 addr, uint32 data) { - putlog(2, "Write16 $%06x <- $%04x", addr, data); + putlog(2, "$%06x <- $%04x", addr, data); if (addr >= 0xeb8000) { *(uint16 *)&mem[addr - 0xeb8000] = data; return 0;