1#ifndef YAZE_APP_CORE_EMULATOR_H
2#define YAZE_APP_CORE_EMULATOR_H
10#include "imgui/imgui.h"
68 std::string emulator_layout = R
"(
69 Table id="Emulator" count="2" flags="Resizable|ScrollY" {
70 TableSetupColumn title="CPU",
71 TableSetupColumn title="PPU",
76 CollapsingHeader id="cpuState" title="Register Values" flags="DefaultOpen" {
77 BeginChild id="##CpuState" size="0,100" flags="NoMove|NoScrollbar" {
78 Columns id="registersColumns" count="2" {
79 Text text="A: 0x%04X" data="cpu.A",
80 Text text="D: 0x%04X" data="cpu.D",
81 Text text="X: 0x%04X" data="cpu.X",
82 Text text="DB: 0x%02X" data="cpu.DB",
83 Text text="Y: 0x%04X" data="cpu.Y",
84 Text text="PB: 0x%02X" data="cpu.PB",
85 Text text="PC: 0x%04X" data="cpu.PC",
86 Text text="PS: 0x%02X" data="cpu.status",
87 Text text="SP: 0x%02X" data="cpu.SP",
88 Text text="Cycle: %d" data="snes.cycle_count",
92 CollapsingHeader id="spcState" title="SPC Registers" flags="DefaultOpen" {
93 BeginChild id="##SpcState" size="0,100" flags="NoMove|NoScrollbar" {
94 Columns id="spcRegistersColumns" count="2" {
95 Text text="A: 0x%02X" data="spc.A",
96 Text text="PC: 0x%04X" data="spc.PC",
97 Text text="X: 0x%02X" data="spc.X",
98 Text text="SP: 0x%02X" data="spc.SP",
99 Text text="Y: 0x%02X" data="spc.Y",
100 Text text="PSW: 0x%02X" data="spc.PSW",
104 Function id="CpuInstructionLog",
107 Function id="SnesPpu",
108 Function id="BreakpointList"
111 const std::map<std::string, void*> data_bindings = {
119 {
"cpu.status", &
snes_.
cpu().status},
125 {
"spc.PC", &
snes_.
apu().spc700().PC},
126 {
"spc.SP", &
snes_.
apu().spc700().SP},
127 {
"spc.PSW", &
snes_.
apu().spc700().PSW}};
130 [&]() { RenderCpuInstructionLog(snes_.cpu().instruction_log_); });
133 [&]() { RenderBreakpointList(); });
160 const std::vector<InstructionEntry>& instructionLog);
A class to hold a shared pointer to a Rom object.
A class for emulating and debugging SNES games.
SDL_AudioDeviceID audio_device_
std::vector< uint8_t > rom_data_
std::vector< Bookmark > bookmarks
void RenderBreakpointList()
void RenderCpuInstructionLog(const std::vector< InstructionEntry > &instructionLog)
void set_audio_buffer(int16_t *audio_buffer)
auto set_audio_device_id(SDL_AudioDeviceID audio_device)
EmulatorKeybindings keybindings_
gui::zeml::Node emulator_node_
SDL_Texture * ppu_texture_
void RenderMemoryViewer()
auto running() const -> bool
auto wanted_samples() const -> int
auto apu() -> audio::Apu &
auto Memory() -> memory::MemoryImpl &
auto mutable_cycles() -> uint64_t &
Node Parse(const std::string &yazon_input, const std::map< std::string, void * > &data_bindings)
Parse a zeml string.
Node * GetNode(const std::string &searchId)