--- nono/vm/sprite.cpp 2026/04/29 17:05:11 1.1.1.8 +++ nono/vm/sprite.cpp 2026/04/29 17:05:18 1.1.1.10 @@ -11,23 +11,16 @@ #include "sprite.h" #include "mpu.h" -// グローバル参照用 -SpriteDevice *gSprite; - // コンストラクタ SpriteDevice::SpriteDevice() - : inherited("Sprite") + : inherited(OBJ_SPRITE) { - devaddr = baseaddr; - devlen = 0x010000; - mem.reset(new uint8[4 * 8192]); } // デストラクタ SpriteDevice::~SpriteDevice() { - gSprite = NULL; } // XXX ResetHard() 未調査 @@ -46,7 +39,7 @@ SpriteDevice::Read16(uint32 addr) { // スプライトの Read はレジスタ、VRAM とも 17 ウェイト。 // InsideOut p.135 - gMPU->AddCycle(17); + mpu->AddCycle(17); if (addr >= 0xeb8000) { return *(uint16 *)&mem[addr - 0xeb8000]; @@ -95,13 +88,13 @@ SpriteDevice::Write8(uint32 addr, uint32 { if (addr >= 0xeb8000) { // スプライト VRAM への書き込み (InsideOut p.135) - gMPU->AddCycle(18); + mpu->AddCycle(18); mem[HB(addr - 0xeb8000)] = data; return 0; } // スプライトレジスタへの書き込み (InsideOut p.135) - gMPU->AddCycle(20); + mpu->AddCycle(20); VMPANIC("not impl"); } @@ -109,7 +102,7 @@ SpriteDevice::Write8(uint32 addr, uint32 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;