yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::emu::Emulator Class Reference

A class for emulating and debugging SNES games. More...

#include <emulator.h>

Classes

struct  Bookmark
 
struct  EmulatorMetrics
 

Public Member Functions

 Emulator ()=default
 
 ~Emulator ()
 
void Initialize (gfx::IRenderer *renderer, const std::vector< uint8_t > &rom_data)
 
void Run (Rom *rom)
 
void Cleanup ()
 
void set_window_manager (editor::WorkspaceWindowManager *manager)
 
void SetInputConfig (const input::InputConfig &config)
 
void set_input_config_changed_callback (std::function< void(const input::InputConfig &)> callback)
 
auto snes () -> Snes &
 
auto running () const -> bool
 
void set_running (bool running)
 
bool EnsureInitialized (Rom *rom)
 
absl::Status ReloadRuntimeRom (const std::vector< uint8_t > &rom_data)
 
void RunFrameOnly ()
 
void RunAudioFrame ()
 
void ResetFrameTiming ()
 
audio::IAudioBackendaudio_backend ()
 
void ResumeAudio ()
 
void SetExternalAudioBackend (audio::IAudioBackend *backend)
 
void set_audio_buffer (int16_t *audio_buffer)
 
auto set_audio_device_id (SDL_AudioDeviceID audio_device)
 
void set_use_sdl_audio_stream (bool enabled)
 
bool use_sdl_audio_stream () const
 
void mark_audio_stream_configured ()
 
auto wanted_samples () const -> int
 
auto wanted_frames () const -> float
 
void set_renderer (gfx::IRenderer *renderer)
 
gfx::IRendererrenderer ()
 
void * ppu_texture ()
 
bool is_turbo_mode () const
 
void set_turbo_mode (bool turbo)
 
bool is_audio_focus_mode () const
 
void set_audio_focus_mode (bool focus)
 
void set_interpolation_type (int type)
 
int get_interpolation_type () const
 
BreakpointManagerbreakpoint_manager ()
 
debug::SymbolProvidersymbol_provider ()
 
const debug::SymbolProvidersymbol_provider () const
 
debug::DisassemblyViewerdisassembly_viewer ()
 
input::InputManagerinput_manager ()
 
bool is_debugging () const
 
void set_debugging (bool debugging)
 
bool is_initialized () const
 
bool is_snes_initialized () const
 
bool IsEmulatorReady () const
 
double GetCurrentFPS () const
 
uint64_t GetCurrentCycle ()
 
uint16_t GetCPUPC ()
 
uint8_t GetCPUB ()
 
void StepSingleInstruction ()
 
void SetBreakpoint (uint32_t address)
 
void ClearAllBreakpoints ()
 
std::vector< uint32_t > GetBreakpoints ()
 
EmulatorMetrics GetMetrics ()
 
std::vector< float > FrameTimeHistory () const
 
std::vector< float > FpsHistory () const
 
std::vector< float > AudioQueueHistory () const
 
std::vector< float > DmaBytesHistory () const
 
std::vector< float > VramBytesHistory () const
 
std::vector< float > AudioRmsLeftHistory () const
 
std::vector< float > AudioRmsRightHistory () const
 
std::vector< float > RomBankFreeBytes () const
 

Static Public Attributes

static constexpr int kMetricHistorySize = 240
 

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 RenderAudioMixer ()
 
void RenderCpuInstructionLog (const std::vector< InstructionEntry > &instructionLog)
 
void PushFrameMetrics (float frame_ms, uint32_t audio_frames, uint64_t dma_bytes, uint64_t vram_bytes, float audio_rms_left, float audio_rms_right)
 

Private Attributes

std::vector< Bookmarkbookmarks
 
bool step_ = true
 
bool power_ = false
 
bool loading_ = false
 
bool running_ = false
 
bool turbo_mode_ = false
 
bool audio_focus_mode_ = false
 
float wanted_frames_
 
int wanted_samples_
 
uint8_t manual_pb_ = 0
 
uint16_t manual_pc_ = 0
 
uint64_t count_frequency
 
uint64_t last_count
 
double time_adder = 0.0
 
int frame_count_ = 0
 
double fps_timer_ = 0.0
 
double current_fps_ = 0.0
 
std::array< float, kMetricHistorySizeframe_time_history_ {}
 
std::array< float, kMetricHistorySizefps_history_ {}
 
std::array< float, kMetricHistorySizeaudio_queue_history_ {}
 
std::array< float, kMetricHistorySizedma_bytes_history_ {}
 
std::array< float, kMetricHistorySizevram_bytes_history_ {}
 
std::array< float, kMetricHistorySizeaudio_rms_left_history_ {}
 
std::array< float, kMetricHistorySizeaudio_rms_right_history_ {}
 
int metric_history_head_ = 0
 
int metric_history_count_ = 0
 
int16_t * audio_buffer_
 
SDL_AudioDeviceID audio_device_
 
std::unique_ptr< audio::IAudioBackendaudio_backend_
 
audio::IAudioBackendexternal_audio_backend_ = nullptr
 
Snes snes_
 
bool initialized_ = false
 
bool snes_initialized_ = false
 
bool debugging_ = false
 
gfx::IRendererrenderer_ = nullptr
 
void * ppu_texture_ = nullptr
 
bool use_sdl_audio_stream_ = true
 
bool audio_stream_config_dirty_ = true
 
bool audio_stream_active_ = false
 
bool audio_stream_env_checked_ = false
 
BreakpointManager breakpoint_manager_
 
debug::SymbolProvider symbol_provider_
 
debug::DisassemblyViewer disassembly_viewer_
 
std::vector< uint8_t > rom_data_
 
input::InputManager input_manager_
 
input::InputConfig input_config_
 
std::function< void(const input::InputConfig &) input_config_changed_callback_ )
 
editor::WorkspaceWindowManagerwindow_manager_ = nullptr
 

Detailed Description

A class for emulating and debugging SNES games.

Definition at line 41 of file emulator.h.

Constructor & Destructor Documentation

◆ Emulator()

yaze::emu::Emulator::Emulator ( )
default

◆ ~Emulator()

yaze::emu::Emulator::~Emulator ( )

Definition at line 55 of file emulator.cc.

References running_.

Member Function Documentation

◆ Initialize()

◆ Run()

void yaze::emu::Emulator::Run ( Rom * rom)

Definition at line 462 of file emulator.cc.

References 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::Snes::dma_bytes_frame(), yaze::emu::audio::AudioConfig::format, fps_timer_, frame_count_, yaze::core::g_window_is_resizing, yaze::emu::input::IInputBackend::GetBackendName(), yaze::emu::input::InputManager::GetConfig(), yaze::emu::Snes::Init(), yaze::emu::input::InputManager::Initialize(), input_config_, 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(), metric_history_count_, metric_history_head_, yaze::emu::input::InputManager::Poll(), ppu_texture_, PushFrameMetrics(), RenderEmulatorInterface(), renderer_, yaze::emu::Snes::ResetFrameMetrics(), 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::input::InputManager::SetConfig(), 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(), yaze::emu::Snes::vram_bytes_frame(), wanted_frames_, wanted_samples_, and yaze::emu::audio::AudioBackendFactory::WASM.

Referenced by yaze::editor::EditorManager::RunEmulator().

◆ Cleanup()

void yaze::emu::Emulator::Cleanup ( )

Definition at line 61 of file emulator.cc.

References audio_stream_active_, ppu_texture_, running_, and snes_initialized_.

◆ set_window_manager()

void yaze::emu::Emulator::set_window_manager ( editor::WorkspaceWindowManager * manager)
inline

Definition at line 51 of file emulator.h.

References window_manager_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetInputConfig()

void yaze::emu::Emulator::SetInputConfig ( const input::InputConfig & config)

Definition at line 76 of file emulator.cc.

References input_config_, input_manager_, and yaze::emu::input::InputManager::SetConfig().

Referenced by yaze::emu::ui::RenderNavBar().

Here is the call graph for this function:

◆ set_input_config_changed_callback()

void yaze::emu::Emulator::set_input_config_changed_callback ( std::function< void(const input::InputConfig &)> callback)
inline

Definition at line 55 of file emulator.h.

References input_config_changed_callback_.

◆ snes()

auto yaze::emu::Emulator::snes ( ) -> Snes&
inline

Definition at line 60 of file emulator.h.

References snes_.

Referenced by yaze::emu::InternalEmulatorAdapter::CaptureCPUState(), yaze::editor::MusicEditor::DrawToolset(), yaze::editor::music::MusicPlayer::ForceNewFrame(), yaze::editor::music::MusicPlayer::GetApuStatus(), yaze::editor::music::MusicPlayer::GetChannelState(), yaze::editor::music::MusicPlayer::GetChannelStates(), yaze::editor::music::MusicPlayer::GetDspStatus(), yaze::emu::InternalEmulatorAdapter::GetGameState(), yaze::editor::music::MusicPlayer::InitializeDirectSpc(), yaze::editor::music::MusicPlayer::InitializePreviewMode(), yaze::emu::InternalEmulatorAdapter::InitializeStepController(), yaze::editor::music::MusicPlayer::PlaySong(), yaze::editor::music::MusicPlayer::PlaySongDirect(), yaze::editor::music::MusicPlayer::PrepareAudioPlayback(), yaze::editor::music::MusicPlayer::PreviewCustomSong(), yaze::editor::music::MusicPlayer::PreviewInstrument(), yaze::editor::music::MusicPlayer::PreviewNote(), yaze::editor::music::MusicPlayer::PreviewSample(), yaze::editor::music::MusicPlayer::PreviewSegment(), yaze::emu::InternalEmulatorAdapter::ReadBlock(), yaze::emu::InternalEmulatorAdapter::ReadByte(), 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::emu::ui::RenderVirtualController(), yaze::emu::InternalEmulatorAdapter::Reset(), yaze::editor::music::MusicPlayer::ResetDspBuffer(), yaze::emu::InternalEmulatorAdapter::RunToBreakpoint(), yaze::editor::music::MusicPlayer::Stop(), yaze::editor::music::MusicPlayer::Update(), yaze::editor::music::MusicPlayer::UploadSongToAram(), yaze::editor::music::MusicPlayer::UploadSoundBankFromRom(), yaze::emu::InternalEmulatorAdapter::WriteBlock(), and yaze::emu::InternalEmulatorAdapter::WriteByte().

◆ running()

◆ set_running()

◆ EnsureInitialized()

◆ ReloadRuntimeRom()

◆ RunFrameOnly()

◆ RunAudioFrame()

◆ ResetFrameTiming()

void yaze::emu::Emulator::ResetFrameTiming ( )

◆ audio_backend()

◆ ResumeAudio()

void yaze::emu::Emulator::ResumeAudio ( )

Definition at line 88 of file emulator.cc.

References audio_backend_.

◆ SetExternalAudioBackend()

void yaze::emu::Emulator::SetExternalAudioBackend ( audio::IAudioBackend * backend)
inline

◆ set_audio_buffer()

void yaze::emu::Emulator::set_audio_buffer ( int16_t * audio_buffer)
inline

Definition at line 87 of file emulator.h.

References audio_buffer_.

◆ set_audio_device_id()

auto yaze::emu::Emulator::set_audio_device_id ( SDL_AudioDeviceID audio_device)
inline

Definition at line 88 of file emulator.h.

References audio_device_.

◆ set_use_sdl_audio_stream()

void yaze::emu::Emulator::set_use_sdl_audio_stream ( bool enabled)

◆ use_sdl_audio_stream()

bool yaze::emu::Emulator::use_sdl_audio_stream ( ) const
inline

Definition at line 92 of file emulator.h.

References use_sdl_audio_stream_.

Referenced by yaze::emu::ui::RenderNavBar().

◆ mark_audio_stream_configured()

void yaze::emu::Emulator::mark_audio_stream_configured ( )
inline

◆ wanted_samples()

auto yaze::emu::Emulator::wanted_samples ( ) const -> int
inline

Definition at line 98 of file emulator.h.

References wanted_samples_.

Referenced by yaze::editor::music::MusicPlayer::EnsureAudioReady().

◆ wanted_frames()

auto yaze::emu::Emulator::wanted_frames ( ) const -> float
inline

Definition at line 99 of file emulator.h.

References wanted_frames_.

Referenced by yaze::editor::music::MusicPlayer::Update().

◆ set_renderer()

void yaze::emu::Emulator::set_renderer ( gfx::IRenderer * renderer)
inline

Definition at line 100 of file emulator.h.

References renderer(), and renderer_.

Referenced by yaze::editor::EditorManager::LoadAssets(), and yaze::editor::EditorManager::LoadAssetsLazy().

Here is the call graph for this function:

◆ renderer()

gfx::IRenderer * yaze::emu::Emulator::renderer ( )
inline

Definition at line 103 of file emulator.h.

References renderer_.

Referenced by Initialize(), yaze::emu::ui::RenderNavBar(), and set_renderer().

◆ ppu_texture()

void * yaze::emu::Emulator::ppu_texture ( )
inline

Definition at line 104 of file emulator.h.

References ppu_texture_.

Referenced by yaze::emu::ui::RenderSnesPpu().

◆ is_turbo_mode()

bool yaze::emu::Emulator::is_turbo_mode ( ) const
inline

Definition at line 107 of file emulator.h.

References turbo_mode_.

Referenced by yaze::emu::ui::RenderNavBar().

◆ set_turbo_mode()

void yaze::emu::Emulator::set_turbo_mode ( bool turbo)
inline

Definition at line 108 of file emulator.h.

References turbo_mode_.

Referenced by yaze::emu::ui::RenderEmulatorInterface(), and yaze::emu::ui::RenderNavBar().

◆ is_audio_focus_mode()

bool yaze::emu::Emulator::is_audio_focus_mode ( ) const
inline

◆ set_audio_focus_mode()

void yaze::emu::Emulator::set_audio_focus_mode ( bool focus)
inline

◆ set_interpolation_type()

void yaze::emu::Emulator::set_interpolation_type ( int type)

◆ get_interpolation_type()

int yaze::emu::Emulator::get_interpolation_type ( ) const

Definition at line 108 of file emulator.cc.

References yaze::emu::Snes::apu(), snes_, and snes_initialized_.

Here is the call graph for this function:

◆ breakpoint_manager()

◆ symbol_provider() [1/2]

debug::SymbolProvider & yaze::emu::Emulator::symbol_provider ( )
inline

Definition at line 120 of file emulator.h.

References symbol_provider_.

◆ symbol_provider() [2/2]

const debug::SymbolProvider & yaze::emu::Emulator::symbol_provider ( ) const
inline

Definition at line 121 of file emulator.h.

References symbol_provider_.

◆ disassembly_viewer()

debug::DisassemblyViewer & yaze::emu::Emulator::disassembly_viewer ( )
inline

Definition at line 124 of file emulator.h.

References disassembly_viewer_.

Referenced by yaze::emu::ui::RenderCpuInstructionLog().

◆ input_manager()

◆ is_debugging()

bool yaze::emu::Emulator::is_debugging ( ) const
inline

Definition at line 126 of file emulator.h.

References debugging_.

Referenced by yaze::emu::ui::RenderNavBar().

◆ set_debugging()

void yaze::emu::Emulator::set_debugging ( bool debugging)
inline

◆ is_initialized()

bool yaze::emu::Emulator::is_initialized ( ) const
inline

Definition at line 128 of file emulator.h.

References initialized_.

◆ is_snes_initialized()

◆ IsEmulatorReady()

bool yaze::emu::Emulator::IsEmulatorReady ( ) const
inline

Definition at line 132 of file emulator.h.

References rom_data_, yaze::emu::Snes::running(), and snes_.

Referenced by yaze::emu::ui::RenderAIAgentPanel().

Here is the call graph for this function:

◆ GetCurrentFPS()

double yaze::emu::Emulator::GetCurrentFPS ( ) const
inline

Definition at line 133 of file emulator.h.

References current_fps_.

Referenced by yaze::emu::ui::RenderNavBar().

◆ GetCurrentCycle()

uint64_t yaze::emu::Emulator::GetCurrentCycle ( )
inline

Definition at line 134 of file emulator.h.

References yaze::emu::Snes::mutable_cycles(), and snes_.

Referenced by yaze::emu::InternalEmulatorAdapter::CaptureCPUState().

Here is the call graph for this function:

◆ GetCPUPC()

uint16_t yaze::emu::Emulator::GetCPUPC ( )
inline

Definition at line 135 of file emulator.h.

References yaze::emu::Snes::cpu(), and snes_.

Here is the call graph for this function:

◆ GetCPUB()

uint8_t yaze::emu::Emulator::GetCPUB ( )
inline

Definition at line 136 of file emulator.h.

References yaze::emu::Snes::cpu(), and snes_.

Here is the call graph for this function:

◆ StepSingleInstruction()

void yaze::emu::Emulator::StepSingleInstruction ( )
inline

◆ SetBreakpoint()

void yaze::emu::Emulator::SetBreakpoint ( uint32_t address)
inline

Definition at line 138 of file emulator.h.

References yaze::emu::Snes::cpu(), and snes_.

Referenced by yaze::emu::ui::RenderModernCpuDebugger().

Here is the call graph for this function:

◆ ClearAllBreakpoints()

void yaze::emu::Emulator::ClearAllBreakpoints ( )
inline

Definition at line 139 of file emulator.h.

References yaze::emu::Snes::cpu(), and snes_.

Referenced by yaze::emu::ui::RenderModernCpuDebugger().

Here is the call graph for this function:

◆ GetBreakpoints()

std::vector< uint32_t > yaze::emu::Emulator::GetBreakpoints ( )
inline

Definition at line 140 of file emulator.h.

References yaze::emu::Snes::cpu(), and snes_.

Referenced by yaze::emu::ui::RenderBreakpointList(), and yaze::emu::ui::RenderModernCpuDebugger().

Here is the call graph for this function:

◆ GetMetrics()

EmulatorMetrics yaze::emu::Emulator::GetMetrics ( )
inline

◆ FrameTimeHistory()

std::vector< float > yaze::emu::Emulator::FrameTimeHistory ( ) const

◆ FpsHistory()

std::vector< float > yaze::emu::Emulator::FpsHistory ( ) const

◆ AudioQueueHistory()

std::vector< float > yaze::emu::Emulator::AudioQueueHistory ( ) const

◆ DmaBytesHistory()

std::vector< float > yaze::emu::Emulator::DmaBytesHistory ( ) const

◆ VramBytesHistory()

std::vector< float > yaze::emu::Emulator::VramBytesHistory ( ) const

◆ AudioRmsLeftHistory()

std::vector< float > yaze::emu::Emulator::AudioRmsLeftHistory ( ) const

◆ AudioRmsRightHistory()

std::vector< float > yaze::emu::Emulator::AudioRmsRightHistory ( ) const

◆ RomBankFreeBytes()

std::vector< float > yaze::emu::Emulator::RomBankFreeBytes ( ) const

Definition at line 879 of file emulator.cc.

References rom_data_.

Referenced by yaze::emu::ui::RenderPerformanceMonitor().

◆ RenderNavBar()

void yaze::emu::Emulator::RenderNavBar ( )
private

Definition at line 1044 of file emulator.cc.

References yaze::emu::ui::RenderNavBar().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderEmulatorInterface()

◆ RenderSnesPpu()

void yaze::emu::Emulator::RenderSnesPpu ( )
private

Definition at line 1039 of file emulator.cc.

References yaze::emu::ui::RenderSnesPpu().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderBreakpointList()

void yaze::emu::Emulator::RenderBreakpointList ( )
private

Definition at line 1054 of file emulator.cc.

References yaze::emu::ui::RenderBreakpointList().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderMemoryViewer()

void yaze::emu::Emulator::RenderMemoryViewer ( )
private

Definition at line 1059 of file emulator.cc.

References yaze::emu::ui::RenderMemoryViewer().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderModernCpuDebugger()

◆ RenderPerformanceMonitor()

void yaze::emu::Emulator::RenderPerformanceMonitor ( )
private

Definition at line 1290 of file emulator.cc.

References yaze::emu::ui::RenderPerformanceMonitor().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderAIAgentPanel()

void yaze::emu::Emulator::RenderAIAgentPanel ( )
private

Definition at line 1295 of file emulator.cc.

References yaze::emu::ui::RenderAIAgentPanel().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderSaveStates()

void yaze::emu::Emulator::RenderSaveStates ( )
private
Todo
Create ui::RenderSaveStates() when save state system is implemented

Definition at line 1306 of file emulator.cc.

References yaze::gui::ThemeManager::Get(), and ICON_MD_SAVE.

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderKeyboardConfig()

void yaze::emu::Emulator::RenderKeyboardConfig ( )
private

Definition at line 1316 of file emulator.cc.

References input_config_, input_config_changed_callback_, input_manager_, and yaze::emu::ui::RenderKeyboardConfig().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderApuDebugger()

void yaze::emu::Emulator::RenderApuDebugger ( )
private

Definition at line 1327 of file emulator.cc.

References yaze::emu::ui::RenderApuDebugger().

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderAudioMixer()

void yaze::emu::Emulator::RenderAudioMixer ( )
private

Definition at line 1332 of file emulator.cc.

References yaze::emu::Snes::apu(), audio_backend_, and snes_.

Referenced by RenderEmulatorInterface().

Here is the call graph for this function:

◆ RenderCpuInstructionLog()

void yaze::emu::Emulator::RenderCpuInstructionLog ( const std::vector< InstructionEntry > & instructionLog)
private

Definition at line 1300 of file emulator.cc.

References yaze::emu::ui::RenderCpuInstructionLog().

Here is the call graph for this function:

◆ PushFrameMetrics()

void yaze::emu::Emulator::PushFrameMetrics ( float frame_ms,
uint32_t audio_frames,
uint64_t dma_bytes,
uint64_t vram_bytes,
float audio_rms_left,
float audio_rms_right )
private

Member Data Documentation

◆ bookmarks

std::vector<Bookmark> yaze::emu::Emulator::bookmarks
private

Definition at line 192 of file emulator.h.

◆ step_

bool yaze::emu::Emulator::step_ = true
private

Definition at line 197 of file emulator.h.

◆ power_

bool yaze::emu::Emulator::power_ = false
private

Definition at line 198 of file emulator.h.

◆ loading_

bool yaze::emu::Emulator::loading_ = false
private

Definition at line 199 of file emulator.h.

◆ running_

bool yaze::emu::Emulator::running_ = false
private

◆ turbo_mode_

bool yaze::emu::Emulator::turbo_mode_ = false
private

Definition at line 201 of file emulator.h.

Referenced by is_turbo_mode(), Run(), and set_turbo_mode().

◆ audio_focus_mode_

bool yaze::emu::Emulator::audio_focus_mode_ = false
private

Definition at line 202 of file emulator.h.

Referenced by is_audio_focus_mode(), RunFrameOnly(), and set_audio_focus_mode().

◆ wanted_frames_

float yaze::emu::Emulator::wanted_frames_
private

Definition at line 204 of file emulator.h.

Referenced by EnsureInitialized(), ReloadRuntimeRom(), Run(), RunFrameOnly(), and wanted_frames().

◆ wanted_samples_

int yaze::emu::Emulator::wanted_samples_
private

◆ manual_pb_

uint8_t yaze::emu::Emulator::manual_pb_ = 0
private

Definition at line 207 of file emulator.h.

◆ manual_pc_

uint16_t yaze::emu::Emulator::manual_pc_ = 0
private

Definition at line 208 of file emulator.h.

◆ count_frequency

uint64_t yaze::emu::Emulator::count_frequency
private

Definition at line 211 of file emulator.h.

Referenced by EnsureInitialized(), ReloadRuntimeRom(), ResetFrameTiming(), Run(), and RunFrameOnly().

◆ last_count

uint64_t yaze::emu::Emulator::last_count
private

Definition at line 212 of file emulator.h.

Referenced by EnsureInitialized(), ReloadRuntimeRom(), ResetFrameTiming(), Run(), and RunFrameOnly().

◆ time_adder

double yaze::emu::Emulator::time_adder = 0.0
private

Definition at line 213 of file emulator.h.

Referenced by EnsureInitialized(), ReloadRuntimeRom(), ResetFrameTiming(), Run(), and RunFrameOnly().

◆ frame_count_

int yaze::emu::Emulator::frame_count_ = 0
private

Definition at line 216 of file emulator.h.

Referenced by ReloadRuntimeRom(), and Run().

◆ fps_timer_

double yaze::emu::Emulator::fps_timer_ = 0.0
private

Definition at line 217 of file emulator.h.

Referenced by ReloadRuntimeRom(), and Run().

◆ current_fps_

double yaze::emu::Emulator::current_fps_ = 0.0
private

Definition at line 218 of file emulator.h.

Referenced by GetCurrentFPS(), GetMetrics(), PushFrameMetrics(), ReloadRuntimeRom(), and Run().

◆ kMetricHistorySize

constexpr int yaze::emu::Emulator::kMetricHistorySize = 240
staticconstexpr

◆ frame_time_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::frame_time_history_ {}
private

Definition at line 224 of file emulator.h.

Referenced by FrameTimeHistory(), and PushFrameMetrics().

◆ fps_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::fps_history_ {}
private

Definition at line 225 of file emulator.h.

Referenced by FpsHistory(), and PushFrameMetrics().

◆ audio_queue_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::audio_queue_history_ {}
private

Definition at line 226 of file emulator.h.

Referenced by AudioQueueHistory(), and PushFrameMetrics().

◆ dma_bytes_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::dma_bytes_history_ {}
private

Definition at line 227 of file emulator.h.

Referenced by DmaBytesHistory(), and PushFrameMetrics().

◆ vram_bytes_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::vram_bytes_history_ {}
private

Definition at line 228 of file emulator.h.

Referenced by PushFrameMetrics(), and VramBytesHistory().

◆ audio_rms_left_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::audio_rms_left_history_ {}
private

Definition at line 229 of file emulator.h.

Referenced by AudioRmsLeftHistory(), and PushFrameMetrics().

◆ audio_rms_right_history_

std::array<float, kMetricHistorySize> yaze::emu::Emulator::audio_rms_right_history_ {}
private

Definition at line 230 of file emulator.h.

Referenced by AudioRmsRightHistory(), and PushFrameMetrics().

◆ metric_history_head_

int yaze::emu::Emulator::metric_history_head_ = 0
private

◆ metric_history_count_

int yaze::emu::Emulator::metric_history_count_ = 0
private

◆ audio_buffer_

int16_t* yaze::emu::Emulator::audio_buffer_
private

Definition at line 237 of file emulator.h.

Referenced by Run(), and set_audio_buffer().

◆ audio_device_

SDL_AudioDeviceID yaze::emu::Emulator::audio_device_
private

Definition at line 238 of file emulator.h.

Referenced by set_audio_device_id().

◆ audio_backend_

std::unique_ptr<audio::IAudioBackend> yaze::emu::Emulator::audio_backend_
private

◆ external_audio_backend_

audio::IAudioBackend* yaze::emu::Emulator::external_audio_backend_ = nullptr
private

◆ snes_

◆ initialized_

bool yaze::emu::Emulator::initialized_ = false
private

Definition at line 245 of file emulator.h.

Referenced by Initialize(), and is_initialized().

◆ snes_initialized_

bool yaze::emu::Emulator::snes_initialized_ = false
private

◆ debugging_

bool yaze::emu::Emulator::debugging_ = false
private

Definition at line 247 of file emulator.h.

Referenced by is_debugging(), and set_debugging().

◆ renderer_

gfx::IRenderer* yaze::emu::Emulator::renderer_ = nullptr
private

Definition at line 248 of file emulator.h.

Referenced by Initialize(), renderer(), Run(), and set_renderer().

◆ ppu_texture_

void* yaze::emu::Emulator::ppu_texture_ = nullptr
private

Definition at line 249 of file emulator.h.

Referenced by Cleanup(), ppu_texture(), and Run().

◆ use_sdl_audio_stream_

bool yaze::emu::Emulator::use_sdl_audio_stream_ = true
private

◆ audio_stream_config_dirty_

bool yaze::emu::Emulator::audio_stream_config_dirty_ = true
private

◆ audio_stream_active_

bool yaze::emu::Emulator::audio_stream_active_ = false
private

Definition at line 252 of file emulator.h.

Referenced by Cleanup(), mark_audio_stream_configured(), Run(), RunAudioFrame(), and RunFrameOnly().

◆ audio_stream_env_checked_

bool yaze::emu::Emulator::audio_stream_env_checked_ = false
private

Definition at line 253 of file emulator.h.

Referenced by Initialize(), and Run().

◆ breakpoint_manager_

BreakpointManager yaze::emu::Emulator::breakpoint_manager_
private

◆ symbol_provider_

debug::SymbolProvider yaze::emu::Emulator::symbol_provider_
private

Definition at line 259 of file emulator.h.

Referenced by symbol_provider(), and symbol_provider().

◆ disassembly_viewer_

debug::DisassemblyViewer yaze::emu::Emulator::disassembly_viewer_
private

Definition at line 260 of file emulator.h.

Referenced by disassembly_viewer(), Initialize(), and ReloadRuntimeRom().

◆ rom_data_

std::vector<uint8_t> yaze::emu::Emulator::rom_data_
private

◆ input_manager_

input::InputManager yaze::emu::Emulator::input_manager_
private

Definition at line 265 of file emulator.h.

Referenced by input_manager(), RenderKeyboardConfig(), Run(), and SetInputConfig().

◆ input_config_

input::InputConfig yaze::emu::Emulator::input_config_
private

Definition at line 266 of file emulator.h.

Referenced by RenderKeyboardConfig(), Run(), and SetInputConfig().

◆ input_config_changed_callback_

std::function<void(const input::InputConfig&) yaze::emu::Emulator::input_config_changed_callback_)
private

Definition at line 267 of file emulator.h.

Referenced by RenderKeyboardConfig(), and set_input_config_changed_callback().

◆ window_manager_

editor::WorkspaceWindowManager* yaze::emu::Emulator::window_manager_ = nullptr
private

Definition at line 270 of file emulator.h.

Referenced by RenderEmulatorInterface(), and set_window_manager().


The documentation for this class was generated from the following files: