A mock implementation of the Memory class. More...
#include <mock_memory.h>
Public Member Functions | |
MOCK_CONST_METHOD1 (ReadByte, uint8_t(uint32_t address)) | |
MOCK_CONST_METHOD1 (ReadWord, uint16_t(uint32_t address)) | |
MOCK_CONST_METHOD1 (ReadWordLong, uint32_t(uint32_t address)) | |
MOCK_METHOD (std::vector< uint8_t >, ReadByteVector,(uint32_t address, uint16_t length),(const, override)) | |
MOCK_METHOD2 (WriteByte, void(uint32_t address, uint8_t value)) | |
MOCK_METHOD2 (WriteWord, void(uint32_t address, uint16_t value)) | |
MOCK_METHOD2 (WriteLong, void(uint32_t address, uint32_t value)) | |
MOCK_METHOD1 (PushByte, void(uint8_t value)) | |
MOCK_METHOD0 (PopByte, uint8_t()) | |
MOCK_METHOD1 (PushWord, void(uint16_t value)) | |
MOCK_METHOD0 (PopWord, uint16_t()) | |
MOCK_METHOD1 (PushLong, void(uint32_t value)) | |
MOCK_METHOD0 (PopLong, uint32_t()) | |
MOCK_CONST_METHOD0 (SP, uint16_t()) | |
MOCK_METHOD1 (SetSP, void(uint16_t value)) | |
MOCK_METHOD1 (SetMemory, void(const std::vector< uint8_t > &data)) | |
MOCK_METHOD1 (LoadData, void(const std::vector< uint8_t > &data)) | |
MOCK_METHOD0 (ClearMemory, void()) | |
MOCK_CONST_METHOD1 (at, uint8_t(int i)) | |
uint8_t | operator[] (int i) const override |
MOCK_METHOD0 (init_hdma_request, void()) | |
MOCK_METHOD0 (run_hdma_request, void()) | |
MOCK_METHOD1 (set_hdma_run_requested, void(bool value)) | |
MOCK_METHOD1 (set_hdma_init_requested, void(bool value)) | |
MOCK_CONST_METHOD0 (hdma_init_requested, bool()) | |
MOCK_CONST_METHOD0 (hdma_run_requested, bool()) | |
MOCK_METHOD1 (set_pal_timing, void(bool value)) | |
MOCK_CONST_METHOD0 (pal_timing, bool()) | |
MOCK_CONST_METHOD0 (h_pos, uint16_t()) | |
MOCK_CONST_METHOD0 (v_pos, uint16_t()) | |
MOCK_METHOD1 (set_h_pos, void(uint16_t value)) | |
MOCK_METHOD1 (set_v_pos, void(uint16_t value)) | |
MOCK_METHOD1 (set_open_bus, void(uint8_t value)) | |
MOCK_CONST_METHOD0 (open_bus, uint8_t()) | |
void | SetMemoryContents (const std::vector< uint8_t > &data) |
void | SetMemoryContents (const std::vector< uint16_t > &data) |
void | InsertMemory (const uint64_t address, const std::vector< uint8_t > &data) |
void | Initialize (const std::vector< uint8_t > &romData) |
void | Init () |
Public Member Functions inherited from yaze::app::emu::memory::Memory | |
virtual | ~Memory ()=default |
virtual uint8_t | ReadByte (uint32_t address) const =0 |
virtual uint16_t | ReadWord (uint32_t address) const =0 |
virtual uint32_t | ReadWordLong (uint32_t address) const =0 |
virtual std::vector< uint8_t > | ReadByteVector (uint32_t address, uint16_t length) const =0 |
virtual void | WriteByte (uint32_t address, uint8_t value)=0 |
virtual void | WriteWord (uint32_t address, uint16_t value)=0 |
virtual void | WriteLong (uint32_t address, uint32_t value)=0 |
virtual void | PushByte (uint8_t value)=0 |
virtual uint8_t | PopByte ()=0 |
virtual void | PushWord (uint16_t value)=0 |
virtual uint16_t | PopWord ()=0 |
virtual void | PushLong (uint32_t value)=0 |
virtual uint32_t | PopLong ()=0 |
virtual uint16_t | SP () const =0 |
virtual void | SetSP (uint16_t value)=0 |
virtual void | ClearMemory ()=0 |
virtual uint8_t | at (int i) const =0 |
virtual uint8_t | open_bus () const =0 |
virtual void | set_open_bus (uint8_t value)=0 |
virtual bool | hdma_init_requested () const =0 |
virtual bool | hdma_run_requested () const =0 |
virtual void | init_hdma_request ()=0 |
virtual void | run_hdma_request ()=0 |
virtual void | set_hdma_run_requested (bool value)=0 |
virtual void | set_hdma_init_requested (bool value)=0 |
virtual void | set_pal_timing (bool value)=0 |
virtual void | set_h_pos (uint16_t value)=0 |
virtual void | set_v_pos (uint16_t value)=0 |
virtual auto | h_pos () const -> uint16_t=0 |
virtual auto | v_pos () const -> uint16_t=0 |
virtual auto | pal_timing () const -> bool=0 |
Public Attributes | |
std::vector< uint8_t > | memory_ |
uint16_t | SP_ = 0x01FF |
A mock implementation of the Memory class.
This class is used for testing purposes and provides a mock implementation of the Memory class. It allows for reading and writing bytes, words, and longs to memory, as well as pushing and popping values onto and from the stack. It also provides methods for setting and getting the stack pointer, initializing memory with ROM data, and clearing memory.
The mock memory is represented by a vector of uint8_t values, where each element represents a byte of memory. The memory can be accessed using the [] operator, and its contents can be set using the SetMemoryContents() method.
Definition at line 45 of file mock_memory.h.
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD1 | ( | ReadByte | , |
uint8_t(uint32_t address) | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD1 | ( | ReadWord | , |
uint16_t(uint32_t address) | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD1 | ( | ReadWordLong | , |
uint32_t(uint32_t address) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD | ( | std::vector< uint8_t > | , |
ReadByteVector | , | ||
(uint32_t address, uint16_t length) | , | ||
(const, override) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD2 | ( | WriteByte | , |
void(uint32_t address, uint8_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD2 | ( | WriteWord | , |
void(uint32_t address, uint16_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD2 | ( | WriteLong | , |
void(uint32_t address, uint32_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | PushByte | , |
void(uint8_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD0 | ( | PopByte | , |
uint8_t() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | PushWord | , |
void(uint16_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD0 | ( | PopWord | , |
uint16_t() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | PushLong | , |
void(uint32_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD0 | ( | PopLong | , |
uint32_t() | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | SP | , |
uint16_t() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | SetSP | , |
void(uint16_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | SetMemory | , |
void(const std::vector< uint8_t > &data) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | LoadData | , |
void(const std::vector< uint8_t > &data) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD0 | ( | ClearMemory | , |
void() | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD1 | ( | at | , |
uint8_t(int i) | ) |
|
inlineoverridevirtual |
Implements yaze::app::emu::memory::Memory.
Definition at line 73 of file mock_memory.h.
References memory_.
yaze::app::emu::memory::MockMemory::MOCK_METHOD0 | ( | init_hdma_request | , |
void() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD0 | ( | run_hdma_request | , |
void() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | set_hdma_run_requested | , |
void(bool value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | set_hdma_init_requested | , |
void(bool value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | hdma_init_requested | , |
bool() | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | hdma_run_requested | , |
bool() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | set_pal_timing | , |
void(bool value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | pal_timing | , |
bool() | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | h_pos | , |
uint16_t() | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | v_pos | , |
uint16_t() | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | set_h_pos | , |
void(uint16_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | set_v_pos | , |
void(uint16_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_METHOD1 | ( | set_open_bus | , |
void(uint8_t value) | ) |
yaze::app::emu::memory::MockMemory::MOCK_CONST_METHOD0 | ( | open_bus | , |
uint8_t() | ) |
|
inline |
Definition at line 90 of file mock_memory.h.
References memory_.
Referenced by yaze::test::emu::TEST_F().
|
inline |
Definition at line 97 of file mock_memory.h.
References memory_.
|
inline |
Definition at line 109 of file mock_memory.h.
References memory_.
|
inline |
Definition at line 123 of file mock_memory.h.
References memory_.
|
inline |
Definition at line 146 of file mock_memory.h.
References yaze::app::emu::memory::Memory::ClearMemory(), memory_, yaze::app::emu::memory::Memory::PopByte(), yaze::app::emu::memory::Memory::PopLong(), yaze::app::emu::memory::Memory::PopWord(), yaze::app::emu::memory::Memory::PushByte(), yaze::app::emu::memory::Memory::PushLong(), yaze::app::emu::memory::Memory::PushWord(), yaze::app::emu::memory::Memory::ReadByte(), yaze::app::emu::memory::Memory::ReadByteVector(), yaze::app::emu::memory::Memory::ReadWord(), yaze::app::emu::memory::Memory::ReadWordLong(), yaze::app::emu::memory::Memory::SetSP(), yaze::app::emu::memory::Memory::SP(), SP_, yaze::app::emu::memory::Memory::WriteByte(), and yaze::app::emu::memory::Memory::WriteWord().
Referenced by yaze::test::emu::CpuTest::SetUp().
std::vector<uint8_t> yaze::app::emu::memory::MockMemory::memory_ |
Definition at line 220 of file mock_memory.h.
Referenced by Init(), Initialize(), InsertMemory(), operator[](), SetMemoryContents(), and SetMemoryContents().
uint16_t yaze::app::emu::memory::MockMemory::SP_ = 0x01FF |
Definition at line 221 of file mock_memory.h.
Referenced by Init().