15 std::unique_ptr<Cartridge> dummy_cartridge;
16 std::unique_ptr<InterruptController> dummy_ic;
17 std::unique_ptr<Timer> dummy_timer;
18 std::unique_ptr<PPU> dummy_ppu;
23 Timer* timer =
nullptr;
26 std::array<u8, 0x2000> wram{};
27 std::array<u8, 0x7F> hram{};
28 std::array<u8, 0x80> io_regs{};
30 u8 joypad_select = 0x30;
31 u8 action_buttons = 0x0F;
32 u8 direction_buttons = 0x0F;
34 mutable u64 read_count = 0;
35 mutable u64 write_count = 0;
37 void perform_dma(u8 value);
44 u8 read(u16 address)
const;
45 void write(u16 address, u8 value);
47 bool map_rom(
const std::vector<u8>& rom_data);
50 void step_timer(
int cycles);
53 void set_joypad_state(u8 action, u8 direction);
54 u8 get_joypad_state()
const;
57 u64 get_read_count()
const {
return read_count; }
58 u64 get_write_count()
const {
return write_count; }
59 u8 get_current_rom_bank()
const;
62 std::vector<u8> dump_memory()
const;
63 bool load_memory(
const std::vector<u8>& dump);