A class for emulating and debugging SNES games. More...
#include <emulator.h>
Classes | |
| struct | Bookmark |
| struct | EmulatorMetrics |
Private Member Functions | |
| void | RenderNavBar () |
| void | RenderEmulatorInterface () |
| void | RenderSnesPpu () |
| void | RenderBreakpointList () |
| void | RenderMemoryViewer () |
| void | RenderModernCpuDebugger () |
| void | RenderPerformanceMonitor () |
| void | RenderAIAgentPanel () |
| void | RenderSaveStates () |
| void | RenderKeyboardConfig () |
| void | RenderApuDebugger () |
| void | RenderCpuInstructionLog (const std::vector< InstructionEntry > &instructionLog) |
A class for emulating and debugging SNES games.
Definition at line 36 of file emulator.h.
|
default |
| yaze::emu::Emulator::~Emulator | ( | ) |
Definition at line 33 of file emulator.cc.
References running_.
| void yaze::emu::Emulator::Initialize | ( | gfx::IRenderer * | renderer, |
| const std::vector< uint8_t > & | rom_data | ||
| ) |
Definition at line 61 of file emulator.cc.
References audio_backend_, audio_stream_config_dirty_, audio_stream_env_checked_, breakpoint_manager_, yaze::emu::audio::AudioConfig::buffer_frames, yaze::emu::audio::AudioConfig::channels, yaze::emu::Snes::cpu(), yaze::emu::BreakpointManager::CPU_65816, yaze::emu::audio::AudioBackendFactory::Create(), disassembly_viewer_, yaze::emu::audio::AudioConfig::format, initialized_, yaze::emu::audio::INT16, LOG_ERROR, LOG_INFO, yaze::emu::debug::DisassemblyViewer::RecordInstruction(), renderer(), renderer_, rom_data_, running_, yaze::emu::audio::AudioConfig::sample_rate, yaze::emu::audio::AudioBackendFactory::SDL2, set_use_sdl_audio_stream(), yaze::emu::BreakpointManager::ShouldBreakOnExecute(), snes_, and snes_initialized_.
Referenced by yaze::emu::ui::RenderNavBar().
| void yaze::emu::Emulator::Run | ( | Rom * | rom | ) |
Definition at line 118 of file emulator.cc.
References yaze::emu::Snes::apu(), audio_backend_, audio_buffer_, audio_stream_active_, audio_stream_config_dirty_, audio_stream_env_checked_, yaze::emu::input::InputManager::backend(), yaze::emu::audio::AudioConfig::buffer_frames, yaze::emu::audio::AudioConfig::channels, count_frequency, yaze::emu::audio::AudioBackendFactory::Create(), yaze::gfx::IRenderer::CreateTextureWithFormat(), current_fps_, yaze::emu::audio::AudioConfig::format, fps_timer_, frame_count_, yaze::core::g_window_is_resizing, yaze::emu::input::IInputBackend::GetBackendName(), yaze::emu::Snes::Init(), yaze::emu::input::InputManager::Initialize(), input_manager_, yaze::emu::audio::INT16, yaze::Rom::is_loaded(), yaze::emu::input::InputManager::IsInitialized(), last_count, yaze::gfx::IRenderer::LockTexture(), LOG_ERROR, LOG_INFO, LOG_WARN, yaze::emu::Snes::memory(), yaze::emu::input::InputManager::Poll(), ppu_texture_, RenderEmulatorInterface(), renderer_, rom_data_, yaze::emu::Snes::RunFrame(), running_, yaze::emu::audio::AudioConfig::sample_rate, yaze::emu::audio::AudioBackendFactory::SDL2, yaze::emu::input::InputBackendFactory::SDL2, set_use_sdl_audio_stream(), yaze::emu::Snes::SetPixels(), yaze::emu::Snes::SetSamples(), snes_, snes_initialized_, time_adder, turbo_mode_, yaze::gfx::IRenderer::UnlockTexture(), use_sdl_audio_stream_, yaze::Rom::vector(), wanted_frames_, and wanted_samples_.
Referenced by yaze::editor::EditorManager::DrawMenuBar().
| void yaze::emu::Emulator::Cleanup | ( | ) |
Definition at line 39 of file emulator.cc.
References audio_stream_active_, ppu_texture_, running_, and snes_initialized_.
|
inline |
Definition at line 45 of file emulator.h.
References card_registry_.
Referenced by yaze::editor::EditorManager::Initialize().
|
inline |
Definition at line 47 of file emulator.h.
References snes_.
Referenced by yaze::agent::EmulatorServiceImpl::GetDebugStatus(), yaze::agent::EmulatorServiceImpl::GetDisassembly(), yaze::agent::EmulatorServiceImpl::GetGameState(), yaze::editor::MusicEditor::PlaySong(), yaze::agent::EmulatorServiceImpl::ReadMemory(), yaze::emu::ui::RenderApuDebugger(), yaze::emu::ui::RenderBreakpointList(), yaze::emu::ui::RenderMemoryViewer(), yaze::emu::ui::RenderModernCpuDebugger(), yaze::emu::ui::RenderNavBar(), yaze::emu::ui::RenderPerformanceMonitor(), yaze::agent::EmulatorServiceImpl::Reset(), yaze::agent::EmulatorServiceImpl::RunToBreakpoint(), yaze::agent::EmulatorServiceImpl::StepInstruction(), yaze::editor::MusicEditor::StopSong(), and yaze::agent::EmulatorServiceImpl::WriteMemory().
|
inline |
Definition at line 48 of file emulator.h.
References running_.
Referenced by yaze::agent::EmulatorServiceImpl::GetDebugStatus(), yaze::emu::ui::RenderNavBar(), and set_running().
|
inline |
Definition at line 49 of file emulator.h.
References running(), and running_.
Referenced by yaze::agent::EmulatorServiceImpl::Pause(), yaze::emu::ui::RenderModernCpuDebugger(), yaze::emu::ui::RenderNavBar(), yaze::agent::EmulatorServiceImpl::Resume(), yaze::agent::EmulatorServiceImpl::Start(), and yaze::agent::EmulatorServiceImpl::Stop().

|
inline |
Definition at line 52 of file emulator.h.
References audio_backend_.
Referenced by yaze::editor::MusicEditor::PlaySong(), yaze::emu::ui::RenderNavBar(), yaze::emu::ui::RenderPerformanceMonitor(), yaze::editor::MusicEditor::SetVolume(), and yaze::editor::MusicEditor::StopSong().
|
inline |
Definition at line 53 of file emulator.h.
References audio_buffer_.
|
inline |
Definition at line 54 of file emulator.h.
References audio_device_.
| void yaze::emu::Emulator::set_use_sdl_audio_stream | ( | bool | enabled | ) |
Definition at line 54 of file emulator.cc.
References audio_stream_config_dirty_, and use_sdl_audio_stream_.
Referenced by Initialize(), yaze::emu::ui::RenderNavBar(), and Run().
|
inline |
Definition at line 58 of file emulator.h.
References use_sdl_audio_stream_.
Referenced by yaze::emu::ui::RenderNavBar().
|
inline |
Definition at line 59 of file emulator.h.
References wanted_samples_.
|
inline |
Definition at line 60 of file emulator.h.
References renderer(), and renderer_.
Referenced by yaze::editor::EditorManager::LoadAssets().

|
inline |
Definition at line 63 of file emulator.h.
References renderer_.
Referenced by Initialize(), yaze::emu::ui::RenderNavBar(), and set_renderer().
|
inline |
Definition at line 64 of file emulator.h.
References ppu_texture_.
Referenced by yaze::emu::ui::RenderSnesPpu().
|
inline |
Definition at line 67 of file emulator.h.
References turbo_mode_.
Referenced by yaze::emu::ui::RenderNavBar().
|
inline |
Definition at line 68 of file emulator.h.
References turbo_mode_.
Referenced by yaze::emu::ui::RenderNavBar().
|
inline |
Definition at line 71 of file emulator.h.
References breakpoint_manager_.
Referenced by yaze::agent::EmulatorServiceImpl::AddBreakpoint(), yaze::agent::EmulatorServiceImpl::GetDebugStatus(), yaze::agent::EmulatorServiceImpl::ListBreakpoints(), yaze::agent::EmulatorServiceImpl::RemoveBreakpoint(), yaze::agent::EmulatorServiceImpl::RunToBreakpoint(), and yaze::agent::EmulatorServiceImpl::SetBreakpointEnabled().
|
inline |
Definition at line 72 of file emulator.h.
References disassembly_viewer_.
Referenced by yaze::emu::ui::RenderCpuInstructionLog().
|
inline |
Definition at line 73 of file emulator.h.
References input_manager_.
Referenced by yaze::agent::EmulatorServiceImpl::HoldButtons(), yaze::agent::EmulatorServiceImpl::PressButtons(), and yaze::agent::EmulatorServiceImpl::ReleaseButtons().
|
inline |
Definition at line 74 of file emulator.h.
References debugging_.
Referenced by yaze::emu::ui::RenderNavBar().
|
inline |
Definition at line 75 of file emulator.h.
References debugging_.
Referenced by yaze::agent::EmulatorServiceImpl::CreateDebugSession(), and yaze::emu::ui::RenderNavBar().
|
inline |
Definition at line 76 of file emulator.h.
References initialized_.
|
inline |
Definition at line 77 of file emulator.h.
References snes_initialized_.
Referenced by yaze::agent::EmulatorServiceImpl::GetDisassembly(), yaze::agent::EmulatorServiceImpl::GetGameState(), yaze::agent::EmulatorServiceImpl::ReadMemory(), yaze::emu::ui::RenderSnesPpu(), yaze::agent::EmulatorServiceImpl::RunToBreakpoint(), yaze::agent::EmulatorServiceImpl::StepInstruction(), and yaze::agent::EmulatorServiceImpl::WriteMemory().
|
inline |
Definition at line 80 of file emulator.h.
References rom_data_, yaze::emu::Snes::running(), and snes_.
Referenced by yaze::emu::ui::RenderAIAgentPanel().

|
inline |
Definition at line 81 of file emulator.h.
References current_fps_.
Referenced by yaze::agent::EmulatorServiceImpl::GetDebugStatus(), and yaze::emu::ui::RenderNavBar().
|
inline |
Definition at line 82 of file emulator.h.
References yaze::emu::Snes::mutable_cycles(), and snes_.
Referenced by yaze::agent::EmulatorServiceImpl::GetDebugStatus(), and yaze::agent::EmulatorServiceImpl::StepInstruction().

|
inline |
Definition at line 83 of file emulator.h.
References yaze::emu::Snes::cpu(), and snes_.

|
inline |
Definition at line 84 of file emulator.h.
References yaze::emu::Snes::cpu(), and snes_.

|
inline |
Definition at line 85 of file emulator.h.
References yaze::emu::Snes::cpu(), and snes_.
Referenced by yaze::agent::EmulatorServiceImpl::RunToBreakpoint(), and yaze::agent::EmulatorServiceImpl::StepInstruction().

|
inline |
Definition at line 86 of file emulator.h.
References yaze::emu::Snes::cpu(), and snes_.
Referenced by yaze::emu::ui::RenderModernCpuDebugger().

|
inline |
Definition at line 87 of file emulator.h.
References yaze::emu::Snes::cpu(), and snes_.
Referenced by yaze::emu::ui::RenderModernCpuDebugger().

|
inline |
Definition at line 88 of file emulator.h.
References yaze::emu::Snes::cpu(), and snes_.
Referenced by yaze::emu::ui::RenderBreakpointList(), and yaze::emu::ui::RenderModernCpuDebugger().

|
inline |
Definition at line 99 of file emulator.h.
References audio_device_, yaze::emu::Snes::cpu(), current_fps_, yaze::emu::Emulator::EmulatorMetrics::fps, yaze::emu::Snes::mutable_cycles(), running_, snes_, and wanted_samples_.
Referenced by yaze::emu::ui::RenderAIAgentPanel(), and yaze::emu::ui::RenderPerformanceMonitor().

|
private |
Definition at line 483 of file emulator.cc.
References yaze::emu::ui::RenderNavBar().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 363 of file emulator.cc.
References yaze::gui::EditorCard::Begin(), card_registry_, yaze::gui::EditorCard::End(), yaze::gui::ThemeManager::Get(), yaze::editor::EditorCardRegistry::GetVisibilityFlag(), ICON_MD_AUDIO_FILE, ICON_MD_KEYBOARD, ICON_MD_MEMORY, ICON_MD_MUSIC_NOTE, ICON_MD_SAVE, ICON_MD_SMART_TOY, ICON_MD_SPEED, ICON_MD_STOP, ICON_MD_VIDEOGAME_ASSET, RenderAIAgentPanel(), RenderApuDebugger(), RenderBreakpointList(), RenderKeyboardConfig(), RenderMemoryViewer(), RenderModernCpuDebugger(), RenderNavBar(), RenderPerformanceMonitor(), RenderSaveStates(), RenderSnesPpu(), and yaze::gui::EditorCard::SetDefaultSize().
Referenced by Run().
|
private |
Definition at line 478 of file emulator.cc.
References yaze::emu::ui::RenderSnesPpu().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 492 of file emulator.cc.
References yaze::emu::ui::RenderBreakpointList().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 497 of file emulator.cc.
References yaze::emu::ui::RenderMemoryViewer().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 502 of file emulator.cc.
References yaze::emu::BreakpointManager::AddBreakpoint(), yaze::emu::Snes::apu(), breakpoint_manager_, yaze::emu::Snes::cpu(), yaze::emu::BreakpointManager::CPU_65816, yaze::emu::BreakpointManager::EXECUTE, yaze::gui::ThemeManager::Get(), yaze::emu::BreakpointManager::GetAllBreakpoints(), ICON_MD_ADD, ICON_MD_BUG_REPORT, ICON_MD_DELETE, ICON_MD_PAUSE, ICON_MD_PLAY_ARROW, ICON_MD_REFRESH, ICON_MD_SKIP_NEXT, yaze::emu::Snes::memory(), yaze::emu::Snes::mutable_cycles(), yaze::emu::BreakpointManager::RemoveBreakpoint(), yaze::emu::Snes::Reset(), running_, yaze::emu::BreakpointManager::SetEnabled(), and snes_.
Referenced by RenderEmulatorInterface().
|
private |
Definition at line 718 of file emulator.cc.
References yaze::emu::ui::RenderPerformanceMonitor().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 723 of file emulator.cc.
References yaze::emu::ui::RenderAIAgentPanel().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 734 of file emulator.cc.
References yaze::gui::ThemeManager::Get(), and ICON_MD_SAVE.
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 744 of file emulator.cc.
References input_manager_, and yaze::emu::ui::RenderKeyboardConfig().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 749 of file emulator.cc.
References yaze::emu::ui::RenderApuDebugger().
Referenced by RenderEmulatorInterface().

|
private |
Definition at line 728 of file emulator.cc.
References yaze::emu::ui::RenderCpuInstructionLog().

|
private |
Definition at line 128 of file emulator.h.
|
private |
Definition at line 133 of file emulator.h.
|
private |
Definition at line 134 of file emulator.h.
|
private |
Definition at line 135 of file emulator.h.
|
private |
Definition at line 136 of file emulator.h.
Referenced by Cleanup(), GetMetrics(), Initialize(), RenderModernCpuDebugger(), Run(), running(), set_running(), and ~Emulator().
|
private |
Definition at line 137 of file emulator.h.
Referenced by is_turbo_mode(), Run(), and set_turbo_mode().
|
private |
Definition at line 139 of file emulator.h.
Referenced by Run().
|
private |
Definition at line 140 of file emulator.h.
Referenced by GetMetrics(), Run(), and wanted_samples().
|
private |
Definition at line 142 of file emulator.h.
|
private |
Definition at line 143 of file emulator.h.
|
private |
Definition at line 146 of file emulator.h.
Referenced by Run().
|
private |
Definition at line 147 of file emulator.h.
Referenced by Run().
|
private |
Definition at line 148 of file emulator.h.
Referenced by Run().
|
private |
Definition at line 151 of file emulator.h.
Referenced by Run().
|
private |
Definition at line 152 of file emulator.h.
Referenced by Run().
|
private |
Definition at line 153 of file emulator.h.
Referenced by GetCurrentFPS(), GetMetrics(), and Run().
|
private |
Definition at line 155 of file emulator.h.
Referenced by Run(), and set_audio_buffer().
|
private |
Definition at line 156 of file emulator.h.
Referenced by GetMetrics(), and set_audio_device_id().
|
private |
Definition at line 159 of file emulator.h.
Referenced by audio_backend(), Initialize(), and Run().
|
private |
Definition at line 161 of file emulator.h.
Referenced by ClearAllBreakpoints(), GetBreakpoints(), GetCPUB(), GetCPUPC(), GetCurrentCycle(), GetMetrics(), Initialize(), IsEmulatorReady(), RenderModernCpuDebugger(), Run(), SetBreakpoint(), snes(), and StepSingleInstruction().
|
private |
Definition at line 162 of file emulator.h.
Referenced by Initialize(), and is_initialized().
|
private |
Definition at line 163 of file emulator.h.
Referenced by Cleanup(), Initialize(), is_snes_initialized(), and Run().
|
private |
Definition at line 164 of file emulator.h.
Referenced by is_debugging(), and set_debugging().
|
private |
Definition at line 165 of file emulator.h.
Referenced by Initialize(), renderer(), Run(), and set_renderer().
|
private |
Definition at line 166 of file emulator.h.
Referenced by Cleanup(), ppu_texture(), and Run().
|
private |
Definition at line 167 of file emulator.h.
Referenced by Run(), set_use_sdl_audio_stream(), and use_sdl_audio_stream().
|
private |
Definition at line 168 of file emulator.h.
Referenced by Initialize(), Run(), and set_use_sdl_audio_stream().
|
private |
Definition at line 169 of file emulator.h.
|
private |
Definition at line 170 of file emulator.h.
Referenced by Initialize(), and Run().
|
private |
Definition at line 175 of file emulator.h.
Referenced by breakpoint_manager(), Initialize(), and RenderModernCpuDebugger().
|
private |
Definition at line 176 of file emulator.h.
Referenced by disassembly_viewer(), and Initialize().
|
private |
Definition at line 178 of file emulator.h.
Referenced by Initialize(), IsEmulatorReady(), and Run().
|
private |
Definition at line 181 of file emulator.h.
Referenced by input_manager(), RenderKeyboardConfig(), and Run().
|
private |
Definition at line 184 of file emulator.h.
Referenced by RenderEmulatorInterface(), and set_card_registry().