Switch DungeonObjectRenderer to SharedROM
This commit is contained in:
@@ -19,7 +19,7 @@ namespace app {
|
|||||||
namespace zelda3 {
|
namespace zelda3 {
|
||||||
namespace dungeon {
|
namespace dungeon {
|
||||||
|
|
||||||
class DungeonObjectRenderer {
|
class DungeonObjectRenderer : public SharedROM {
|
||||||
public:
|
public:
|
||||||
struct PseudoVram {
|
struct PseudoVram {
|
||||||
std::vector<gfx::Bitmap> sheets;
|
std::vector<gfx::Bitmap> sheets;
|
||||||
@@ -36,15 +36,16 @@ class DungeonObjectRenderer {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderObjectsAsBitmaps(ROM& rom) {
|
void RenderObjectsAsBitmaps() {
|
||||||
memory_.Initialize(rom.vector());
|
rom_data_ = rom()->vector();
|
||||||
|
memory_.Initialize(rom_data_);
|
||||||
cpu.Init();
|
cpu.Init();
|
||||||
|
|
||||||
auto subtype1_ptr = core::subtype1_tiles;
|
auto subtype1_ptr = core::subtype1_tiles;
|
||||||
auto subtype1_routine_ptr = core::subtype1_tiles + 0x200;
|
auto subtype1_routine_ptr = core::subtype1_tiles + 0x200;
|
||||||
std::array<uint16_t, 256> routine_ptrs;
|
std::array<uint16_t, 256> routine_ptrs;
|
||||||
for (int i = 0; i < 256; i++) {
|
for (int i = 0; i < 256; i++) {
|
||||||
uint16_t actual_ptr = rom.toint16(subtype1_routine_ptr + (i * 2));
|
uint16_t actual_ptr = rom()->toint16(subtype1_routine_ptr + (i * 2));
|
||||||
routine_ptrs[i] = actual_ptr;
|
routine_ptrs[i] = actual_ptr;
|
||||||
std::cout << std::hex << routine_ptrs[i] << std::endl;
|
std::cout << std::hex << routine_ptrs[i] << std::endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user