yaze 0.2.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>

Inheritance diagram for yaze::emu::Emulator:
Collaboration diagram for yaze::emu::Emulator:

Classes

struct  Bookmark
 

Public Member Functions

 Emulator ()
 
void Run ()
 
auto snes () -> Snes &
 
auto running () const -> bool
 
void set_audio_buffer (int16_t *audio_buffer)
 
auto set_audio_device_id (SDL_AudioDeviceID audio_device)
 
auto wanted_samples () const -> int
 
- Public Member Functions inherited from yaze::SharedRom
 SharedRom ()=default
 
virtual ~SharedRom ()=default
 
std::shared_ptr< Romshared_rom ()
 
auto rom ()
 

Private Member Functions

void RenderNavBar ()
 
void HandleEvents ()
 
void RenderSnesPpu ()
 
void RenderBreakpointList ()
 
void RenderMemoryViewer ()
 
void RenderCpuInstructionLog (const std::vector< InstructionEntry > &instructionLog)
 

Private Attributes

std::vector< Bookmarkbookmarks
 
bool step_ = true
 
bool power_ = false
 
bool loading_ = false
 
bool running_ = false
 
bool turbo_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
 
float time_adder = 0.0
 
int16_t * audio_buffer_
 
SDL_AudioDeviceID audio_device_
 
Snes snes_
 
SDL_Texture * ppu_texture_
 
std::vector< uint8_t > rom_data_
 
EmulatorKeybindings keybindings_
 
gui::zeml::Node emulator_node_
 

Additional Inherited Members

- Static Public Attributes inherited from yaze::SharedRom
static std::shared_ptr< Romshared_rom_ = nullptr
 

Detailed Description

A class for emulating and debugging SNES games.

Definition at line 39 of file emulator.h.

Constructor & Destructor Documentation

◆ Emulator()

yaze::emu::Emulator::Emulator ( )
inline

Definition at line 41 of file emulator.h.

References emulator_node_, yaze::gui::zeml::Parse(), and snes_.

Here is the call graph for this function:

Member Function Documentation

◆ Run()

◆ snes()

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

Definition at line 111 of file emulator.h.

References snes_.

◆ running()

auto yaze::emu::Emulator::running ( ) const -> bool
inline

Definition at line 112 of file emulator.h.

References running_.

◆ set_audio_buffer()

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

Definition at line 113 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 114 of file emulator.h.

References audio_device_.

◆ wanted_samples()

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

Definition at line 117 of file emulator.h.

References wanted_samples_.

◆ RenderNavBar()

◆ HandleEvents()

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

Definition at line 259 of file emulator.cc.

References keybindings_, and snes_.

Referenced by Run().

◆ RenderSnesPpu()

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

Definition at line 111 of file emulator.cc.

References ppu_texture_, and snes_.

◆ RenderBreakpointList()

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

Definition at line 358 of file emulator.cc.

References yaze::gui::InputHexByte(), yaze::gui::InputHexWord(), manual_pb_, manual_pc_, and snes_.

Here is the call graph for this function:

◆ RenderMemoryViewer()

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

Definition at line 420 of file emulator.cc.

References bookmarks, ICON_MD_STAR, yaze::gui::InputHex(), and snes_.

Referenced by RenderNavBar().

Here is the call graph for this function:

◆ RenderCpuInstructionLog()

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

Definition at line 503 of file emulator.cc.

References opcode_to_mnemonic.

Member Data Documentation

◆ bookmarks

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

Definition at line 131 of file emulator.h.

Referenced by RenderMemoryViewer().

◆ step_

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

Definition at line 136 of file emulator.h.

◆ power_

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

Definition at line 137 of file emulator.h.

◆ loading_

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

Definition at line 138 of file emulator.h.

◆ running_

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

Definition at line 139 of file emulator.h.

Referenced by RenderNavBar(), Run(), and running().

◆ turbo_mode_

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

Definition at line 140 of file emulator.h.

Referenced by RenderNavBar(), and Run().

◆ wanted_frames_

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

Definition at line 142 of file emulator.h.

Referenced by Run().

◆ wanted_samples_

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

Definition at line 143 of file emulator.h.

Referenced by Run(), and wanted_samples().

◆ manual_pb_

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

Definition at line 145 of file emulator.h.

Referenced by RenderBreakpointList().

◆ manual_pc_

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

Definition at line 146 of file emulator.h.

Referenced by RenderBreakpointList().

◆ count_frequency

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

Definition at line 149 of file emulator.h.

Referenced by Run().

◆ last_count

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

Definition at line 150 of file emulator.h.

Referenced by Run().

◆ time_adder

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

Definition at line 151 of file emulator.h.

Referenced by Run().

◆ audio_buffer_

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

Definition at line 153 of file emulator.h.

Referenced by Run(), and set_audio_buffer().

◆ audio_device_

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

Definition at line 154 of file emulator.h.

Referenced by Run(), and set_audio_device_id().

◆ snes_

Snes yaze::emu::Emulator::snes_
private

◆ ppu_texture_

SDL_Texture* yaze::emu::Emulator::ppu_texture_
private

Definition at line 157 of file emulator.h.

Referenced by RenderSnesPpu(), and Run().

◆ rom_data_

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

Definition at line 159 of file emulator.h.

Referenced by RenderNavBar(), and Run().

◆ keybindings_

EmulatorKeybindings yaze::emu::Emulator::keybindings_
private

Definition at line 161 of file emulator.h.

Referenced by HandleEvents().

◆ emulator_node_

gui::zeml::Node yaze::emu::Emulator::emulator_node_
private

Definition at line 163 of file emulator.h.

Referenced by Emulator(), and Run().


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