1#ifndef YAZE_APP_CORE_EMULATOR_H
2#define YAZE_APP_CORE_EMULATOR_H
4#include "imgui/imgui.h"
29 std::string emulator_layout = R
"(
30 Table id="Emulator" count="2" flags="Resizable|ScrollY" {
31 TableSetupColumn title="CPU",
32 TableSetupColumn title="PPU",
37 CollapsingHeader id="cpuState" title="Register Values" flags="DefaultOpen" {
38 BeginChild id="##CpuState" size="0,100" flags="NoMove|NoScrollbar" {
39 Columns id="registersColumns" count="2" {
40 Text text="A: 0x%04X" data="cpu.A",
41 Text text="D: 0x%04X" data="cpu.D",
42 Text text="X: 0x%04X" data="cpu.X",
43 Text text="DB: 0x%02X" data="cpu.DB",
44 Text text="Y: 0x%04X" data="cpu.Y",
45 Text text="PB: 0x%02X" data="cpu.PB",
46 Text text="PC: 0x%04X" data="cpu.PC",
47 Text text="PS: 0x%02X" data="cpu.status",
48 Text text="SP: 0x%02X" data="cpu.SP",
49 Text text="Cycle: %d" data="snes.cycle_count",
53 CollapsingHeader id="spcState" title="SPC Registers" flags="DefaultOpen" {
54 BeginChild id="##SpcState" size="0,100" flags="NoMove|NoScrollbar" {
55 Columns id="spcRegistersColumns" count="2" {
56 Text text="A: 0x%02X" data="spc.A",
57 Text text="PC: 0x%04X" data="spc.PC",
58 Text text="X: 0x%02X" data="spc.X",
59 Text text="SP: 0x%02X" data="spc.SP",
60 Text text="Y: 0x%02X" data="spc.Y",
61 Text text="PSW: 0x%02X" data="spc.PSW",
65 Function id="CpuInstructionLog",
68 Function id="SnesPpu",
69 Function id="BreakpointList"
72 const std::map<std::string, void*> data_bindings = {
86 {
"spc.PC", &
snes_.
apu().spc700().PC},
87 {
"spc.SP", &
snes_.
apu().spc700().SP},
88 {
"spc.PSW", &
snes_.
apu().spc700().PSW}};
91 [&]() { RenderCpuInstructionLog(snes_.cpu().instruction_log_); });
94 [&]() { RenderBreakpointList(); });
121 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)
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)