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

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

#include <emulator.h>

Inheritance diagram for yaze::app::emu::Emulator:
Collaboration diagram for yaze::app::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::app::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::app::SharedRom
static std::shared_ptr< Romshared_rom_ = nullptr
 

Detailed Description

A class for emulating and debugging SNES games.

Definition at line 65 of file emulator.h.

Constructor & Destructor Documentation

◆ Emulator()

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

Member Function Documentation

◆ Run()

◆ snes()

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

Definition at line 137 of file emulator.h.

References snes_.

◆ running()

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

Definition at line 138 of file emulator.h.

References running_.

◆ set_audio_buffer()

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

Definition at line 139 of file emulator.h.

References audio_buffer_.

◆ set_audio_device_id()

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

Definition at line 140 of file emulator.h.

References audio_device_.

◆ wanted_samples()

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

Definition at line 143 of file emulator.h.

References wanted_samples_.

◆ RenderNavBar()

◆ HandleEvents()

◆ RenderSnesPpu()

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

Definition at line 114 of file emulator.cc.

References ppu_texture_, yaze::app::emu::SNES::running(), and snes_.

Here is the call graph for this function:

◆ RenderBreakpointList()

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

Definition at line 361 of file emulator.cc.

References yaze::app::emu::SNES::apu(), yaze::app::emu::SNES::cpu(), yaze::app::gui::InputHexByte(), yaze::app::gui::InputHexWord(), manual_pb_, manual_pc_, and snes_.

Here is the call graph for this function:

◆ RenderMemoryViewer()

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

Definition at line 423 of file emulator.cc.

References yaze::app::emu::SNES::apu(), bookmarks, yaze::app::emu::SNES::get_ram(), ICON_MD_STAR, yaze::app::gui::InputHex(), yaze::app::emu::SNES::Memory(), and snes_.

Referenced by RenderNavBar().

Here is the call graph for this function:

◆ RenderCpuInstructionLog()

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

Definition at line 506 of file emulator.cc.

References opcode_to_mnemonic.

Member Data Documentation

◆ bookmarks

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

Definition at line 157 of file emulator.h.

Referenced by RenderMemoryViewer().

◆ step_

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

Definition at line 162 of file emulator.h.

◆ power_

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

Definition at line 163 of file emulator.h.

◆ loading_

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

Definition at line 164 of file emulator.h.

◆ running_

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

Definition at line 165 of file emulator.h.

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

◆ turbo_mode_

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

Definition at line 166 of file emulator.h.

Referenced by RenderNavBar(), and Run().

◆ wanted_frames_

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

Definition at line 168 of file emulator.h.

Referenced by Run().

◆ wanted_samples_

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

Definition at line 169 of file emulator.h.

Referenced by Run(), and wanted_samples().

◆ manual_pb_

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

Definition at line 171 of file emulator.h.

Referenced by RenderBreakpointList().

◆ manual_pc_

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

Definition at line 172 of file emulator.h.

Referenced by RenderBreakpointList().

◆ count_frequency

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

Definition at line 175 of file emulator.h.

Referenced by Run().

◆ last_count

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

Definition at line 176 of file emulator.h.

Referenced by Run().

◆ time_adder

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

Definition at line 177 of file emulator.h.

Referenced by Run().

◆ audio_buffer_

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

Definition at line 179 of file emulator.h.

Referenced by Run(), and set_audio_buffer().

◆ audio_device_

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

Definition at line 180 of file emulator.h.

Referenced by Run(), and set_audio_device_id().

◆ snes_

SNES yaze::app::emu::Emulator::snes_
private

◆ ppu_texture_

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

Definition at line 183 of file emulator.h.

Referenced by RenderSnesPpu(), and Run().

◆ rom_data_

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

Definition at line 185 of file emulator.h.

Referenced by RenderNavBar(), and Run().

◆ keybindings_

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

Definition at line 187 of file emulator.h.

Referenced by HandleEvents().

◆ emulator_node_

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

Definition at line 189 of file emulator.h.

Referenced by Emulator(), and Run().


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