Implementation of the Memory interface for emulating memory in a SNES system. More...
#include <memory.h>
Public Member Functions | |
void | Initialize (const std::vector< uint8_t > &romData, bool verbose=false) |
uint16_t | GetHeaderOffset () |
uint8_t | cart_read (uint8_t bank, uint16_t adr) |
void | cart_write (uint8_t bank, uint16_t adr, uint8_t val) |
uint8_t | cart_readLorom (uint8_t bank, uint16_t adr) |
void | cart_writeLorom (uint8_t bank, uint16_t adr, uint8_t val) |
uint8_t | cart_readHirom (uint8_t bank, uint16_t adr) |
uint8_t | cart_readExHirom (uint8_t bank, uint16_t adr) |
void | cart_writeHirom (uint8_t bank, uint16_t adr, uint8_t val) |
uint8_t | ReadByte (uint32_t address) const override |
uint16_t | ReadWord (uint32_t address) const override |
uint32_t | ReadWordLong (uint32_t address) const override |
std::vector< uint8_t > | ReadByteVector (uint32_t address, uint16_t length) const override |
void | WriteByte (uint32_t address, uint8_t value) override |
void | WriteWord (uint32_t address, uint16_t value) override |
void | WriteLong (uint32_t address, uint32_t value) override |
void | PushByte (uint8_t value) override |
uint8_t | PopByte () override |
void | PushWord (uint16_t value) override |
uint16_t | PopWord () override |
void | PushLong (uint32_t value) override |
uint32_t | PopLong () override |
uint16_t | SP () const override |
auto | mutable_sp () -> uint16_t & |
void | SetSP (uint16_t value) override |
void | ClearMemory () override |
uint8_t | at (int i) const override |
uint8_t | operator[] (int i) const override |
auto | size () const |
auto | begin () const |
auto | end () const |
auto | data () const |
void | set_open_bus (uint8_t value) override |
auto | open_bus () const -> uint8_t override |
auto | hdma_init_requested () const -> bool override |
auto | hdma_run_requested () const -> bool override |
void | init_hdma_request () override |
void | run_hdma_request () override |
void | set_hdma_run_requested (bool value) override |
void | set_hdma_init_requested (bool value) override |
void | set_pal_timing (bool value) override |
void | set_h_pos (uint16_t value) override |
void | set_v_pos (uint16_t value) override |
auto | h_pos () const -> uint16_t override |
auto | v_pos () const -> uint16_t override |
auto | pal_timing () const -> bool override |
auto | dma_state () -> uint8_t & |
void | set_dma_state (uint8_t value) |
auto | dma_channels () -> DmaChannel * |
Public Member Functions inherited from yaze::app::emu::memory::Memory | |
virtual | ~Memory ()=default |
Public Attributes | |
std::vector< uint8_t > | rom_ |
std::vector< uint8_t > | ram_ |
Private Member Functions | |
uint32_t | GetMappedAddress (uint32_t address) const |
Private Attributes | |
bool | verbose_ = false |
bool | hdma_run_requested_ = false |
bool | hdma_init_requested_ = false |
bool | pal_timing_ = false |
uint32_t | rom_size_ |
uint32_t | sram_size_ |
uint16_t | h_pos_ = 0 |
uint16_t | v_pos_ = 0 |
uint8_t | dma_state_ = 0 |
uint8_t | open_bus_ = 0 |
uint16_t | SP_ = 0 |
uint8_t | type_ = 1 |
DmaChannel | channel [8] |
std::vector< uint8_t > | memory_ |
void yaze::app::emu::memory::MemoryImpl::Initialize | ( | const std::vector< uint8_t > & | romData, |
bool | verbose = false ) |
Definition at line 15 of file memory.cc.
References memory_, ram_, rom_, rom_size_, sram_size_, type_, and verbose_.
Referenced by yaze::app::emu::SNES::Init(), and yaze::app::zelda3::dungeon::DungeonObjectRenderer::LoadObject().
|
inline |
uint8_t yaze::app::emu::memory::MemoryImpl::cart_read | ( | uint8_t | bank, |
uint16_t | adr ) |
Definition at line 54 of file memory.cc.
References cart_readExHirom(), cart_readHirom(), cart_readLorom(), open_bus_, and type_.
Referenced by yaze::app::emu::SNES::Rread().
void yaze::app::emu::memory::MemoryImpl::cart_write | ( | uint8_t | bank, |
uint16_t | adr, | ||
uint8_t | val ) |
Definition at line 68 of file memory.cc.
References cart_writeHirom(), cart_writeLorom(), and type_.
Referenced by yaze::app::emu::SNES::Write().
uint8_t yaze::app::emu::memory::MemoryImpl::cart_readLorom | ( | uint8_t | bank, |
uint16_t | adr ) |
Definition at line 84 of file memory.cc.
References open_bus_, ram_, rom_, rom_size_, and sram_size_.
Referenced by cart_read().
void yaze::app::emu::memory::MemoryImpl::cart_writeLorom | ( | uint8_t | bank, |
uint16_t | adr, | ||
uint8_t | val ) |
Definition at line 98 of file memory.cc.
References ram_, and sram_size_.
Referenced by cart_write().
uint8_t yaze::app::emu::memory::MemoryImpl::cart_readHirom | ( | uint8_t | bank, |
uint16_t | adr ) |
Definition at line 106 of file memory.cc.
References open_bus_, ram_, rom_, rom_size_, and sram_size_.
Referenced by cart_read().
uint8_t yaze::app::emu::memory::MemoryImpl::cart_readExHirom | ( | uint8_t | bank, |
uint16_t | adr ) |
Definition at line 119 of file memory.cc.
References open_bus_, ram_, rom_, rom_size_, and sram_size_.
Referenced by cart_read().
void yaze::app::emu::memory::MemoryImpl::cart_writeHirom | ( | uint8_t | bank, |
uint16_t | adr, | ||
uint8_t | val ) |
Definition at line 134 of file memory.cc.
References ram_, and sram_size_.
Referenced by cart_write().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 142 of file memory.h.
Referenced by yaze::app::zelda3::dungeon::DungeonObjectRenderer::UpdateObjectBitmap().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 197 of file memory.h.
References yaze::app::emu::memory::Memory::PushByte().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 202 of file memory.h.
References yaze::app::emu::memory::Memory::PopByte().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 208 of file memory.h.
References yaze::app::emu::memory::Memory::PushByte().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 214 of file memory.h.
References yaze::app::emu::memory::Memory::PopByte().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inline |
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 241 of file memory.h.
Referenced by yaze::app::emu::SNES::Read(), yaze::app::emu::SNES::Reset(), and yaze::app::emu::SNES::Write().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 242 of file memory.h.
Referenced by yaze::app::emu::memory::dma::Read(), yaze::app::emu::SNES::ReadBBus(), yaze::app::emu::SNES::ReadReg(), yaze::app::emu::SNES::Rread(), and yaze::app::emu::memory::dma::TransferByte().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 243 of file memory.h.
Referenced by yaze::app::emu::memory::dma::HandleDma(), and yaze::app::emu::memory::dma::WaitCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 246 of file memory.h.
Referenced by yaze::app::emu::memory::dma::HandleDma(), and yaze::app::emu::memory::dma::WaitCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 249 of file memory.h.
Referenced by yaze::app::emu::SNES::RunCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 250 of file memory.h.
Referenced by yaze::app::emu::SNES::RunCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 251 of file memory.h.
Referenced by yaze::app::emu::memory::dma::DoHdma(), and yaze::app::emu::memory::dma::Reset().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 254 of file memory.h.
Referenced by yaze::app::emu::memory::dma::InitHdma(), and yaze::app::emu::memory::dma::Reset().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 258 of file memory.h.
Referenced by yaze::app::emu::SNES::Reset(), and yaze::app::emu::SNES::RunCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 259 of file memory.h.
Referenced by yaze::app::emu::SNES::Reset(), and yaze::app::emu::SNES::RunCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 260 of file memory.h.
Referenced by yaze::app::emu::SNES::ReadReg(), yaze::app::emu::SNES::RunCycle(), and yaze::app::emu::SNES::RunCycles().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 261 of file memory.h.
Referenced by yaze::app::emu::SNES::RunCycle().
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 262 of file memory.h.
Referenced by yaze::app::emu::SNES::RunCycle(), yaze::app::emu::audio::Apu::RunCycles(), and yaze::app::emu::SNES::SetSamples().
|
inline |
Definition at line 264 of file memory.h.
Referenced by yaze::app::emu::memory::dma::HandleDma().
|
inline |
Definition at line 265 of file memory.h.
Referenced by yaze::app::emu::memory::dma::HandleDma(), yaze::app::emu::memory::dma::Reset(), and yaze::app::emu::memory::dma::StartDma().
|
inline |
Definition at line 266 of file memory.h.
Referenced by yaze::app::emu::memory::dma::DoDma(), yaze::app::emu::memory::dma::DoHdma(), yaze::app::emu::memory::dma::InitHdma(), yaze::app::emu::memory::dma::Read(), yaze::app::emu::memory::dma::Reset(), yaze::app::emu::memory::dma::StartDma(), and yaze::app::emu::memory::dma::Write().
|
private |
std::vector<uint8_t> yaze::app::emu::memory::MemoryImpl::rom_ |
Definition at line 269 of file memory.h.
Referenced by cart_readExHirom(), cart_readHirom(), cart_readLorom(), and Initialize().
std::vector<uint8_t> yaze::app::emu::memory::MemoryImpl::ram_ |
Definition at line 270 of file memory.h.
Referenced by cart_readExHirom(), cart_readHirom(), cart_readLorom(), cart_writeHirom(), cart_writeLorom(), and Initialize().
|
private |
Definition at line 275 of file memory.h.
Referenced by Initialize().
|
private |
|
private |
|
private |
|
private |
Definition at line 284 of file memory.h.
Referenced by cart_readExHirom(), cart_readHirom(), cart_readLorom(), and Initialize().
|
private |
Definition at line 285 of file memory.h.
Referenced by cart_readExHirom(), cart_readHirom(), cart_readLorom(), cart_writeHirom(), cart_writeLorom(), and Initialize().
|
private |
|
private |
|
private |
|
private |
Definition at line 295 of file memory.h.
Referenced by cart_read(), cart_readExHirom(), cart_readHirom(), and cart_readLorom().
|
private |
|
private |
Definition at line 301 of file memory.h.
Referenced by cart_read(), cart_write(), and Initialize().
|
private |
|
private |
Definition at line 307 of file memory.h.
Referenced by Initialize().