From 90625598dd495d9d6828fc7a94c1888c21f8f043 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 10 Dec 2023 02:14:43 -0500 Subject: [PATCH] Update ConfigureObject for RoomObjects --- src/app/zelda3/dungeon/room_object.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/zelda3/dungeon/room_object.h b/src/app/zelda3/dungeon/room_object.h index 6233dc48..308d6d0e 100644 --- a/src/app/zelda3/dungeon/room_object.h +++ b/src/app/zelda3/dungeon/room_object.h @@ -93,12 +93,16 @@ class DungeonObjectRenderer : public SharedROM { } void ConfigureObject(const SubtypeInfo& info) { - cpu.A = 0x00; - cpu.X = 0x00; + cpu.A = 0x03D8; + cpu.X = 0x03D8; + cpu.DB = 0x7E; + // VRAM target destinations + cpu.WriteLong(0xBF, 0x7E2000); + cpu.WriteLong(0xCB, 0x7E2080); + cpu.WriteLong(0xC2, 0x7E2002); + cpu.WriteLong(0xCE, 0x7E2082); cpu.SetAccumulatorSize(false); cpu.SetIndexSize(false); - - // Might need to set the height and width manually? } /** @@ -147,7 +151,7 @@ class DungeonObjectRenderer : public SharedROM { int i = 0; while (true) { - uint8_t opcode = cpu.ReadByte(cpu.PC); + uint8_t opcode = cpu.ReadByte(cpu.PB << 16 | cpu.PC); cpu.ExecuteInstruction(opcode); cpu.HandleInterrupts();