ComSquare
Public Member Functions | Private Attributes | List of all members
ComSquare::Debugger::MemoryBusDebug Class Reference

window that allow the user to view all data going through the memory bus. More...

#include <MemoryBusDebug.hpp>

Inheritance diagram for ComSquare::Debugger::MemoryBusDebug:
Collaboration diagram for ComSquare::Debugger::MemoryBusDebug:

Public Member Functions

 MemoryBusDebug (SNES &snes, Memory::IMemoryBus &bus)
 
 MemoryBusDebug (const MemoryBusDebug &)=delete
 
MemoryBusDebugoperator= (const MemoryBusDebug &)=delete
 
 ~MemoryBusDebug () override=default
 
uint8_t read (uint24_t addr) override
 Read data at a global address. This form allow read to be silenced. More...
 
std::optional< uint8_t > peek (uint24_t addr) override
 This as the same purpose as a read but it does not change the open bus and won't throw an exception. More...
 
uint8_t peek_v (uint24_t addr) override
 This as the same purpose as a read but it does not change the open bus and won't throw an exception. More...
 
void write (uint24_t addr, uint8_t data) override
 Write a data to a global address. More...
 
Memory::IMemorygetAccessor (uint24_t addr) override
 Helper function to get the components that is responsible of read/write at an address. More...
 
void focus ()
 Focus the debugger's window. More...
 
- Public Member Functions inherited from ComSquare::Memory::IMemoryBus
virtual ~IMemoryBus ()=default
 A virtual default destructor. More...
 

Private Attributes

ClosableWindow_window
 The QT window for this debugger. More...
 
Memory::IMemoryBus_bus
 A reference to the underlying bus.. More...
 
Ui::BusView _ui
 A widget that contain the whole UI. More...
 
BusLogModel _model
 The Log visualizer model for QT. More...
 
BusLoggerProxy _proxy
 A QT proxy to filter the logs. More...
 

Detailed Description

window that allow the user to view all data going through the memory bus.

Constructor & Destructor Documentation

◆ MemoryBusDebug() [1/2]

ComSquare::Debugger::MemoryBusDebug::MemoryBusDebug ( SNES snes,
Memory::IMemoryBus bus 
)
explicit

◆ MemoryBusDebug() [2/2]

ComSquare::Debugger::MemoryBusDebug::MemoryBusDebug ( const MemoryBusDebug )
delete

◆ ~MemoryBusDebug()

ComSquare::Debugger::MemoryBusDebug::~MemoryBusDebug ( )
overridedefault

Member Function Documentation

◆ focus()

void ComSquare::Debugger::MemoryBusDebug::focus ( )

Focus the debugger's window.

◆ getAccessor()

Memory::IMemory * ComSquare::Debugger::MemoryBusDebug::getAccessor ( uint24_t  addr)
overridevirtual

Helper function to get the components that is responsible of read/write at an address.

Parameters
addrThe address you want to look for.
Returns
The components responsible for the address param or nullptr if none was found.

Implements ComSquare::Memory::IMemoryBus.

◆ operator=()

MemoryBusDebug& ComSquare::Debugger::MemoryBusDebug::operator= ( const MemoryBusDebug )
delete

◆ peek()

std::optional< uint8_t > ComSquare::Debugger::MemoryBusDebug::peek ( uint24_t  addr)
overridevirtual

This as the same purpose as a read but it does not change the open bus and won't throw an exception.

Parameters
addrThe address to read from.
Returns
The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.

Implements ComSquare::Memory::IMemoryBus.

◆ peek_v()

uint8_t ComSquare::Debugger::MemoryBusDebug::peek_v ( uint24_t  addr)
overridevirtual

This as the same purpose as a read but it does not change the open bus and won't throw an exception.

Parameters
addrThe address to read from.
Returns
The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.
Note
If the value address is not mapped, 0 is returned instead of nullopt.

Implements ComSquare::Memory::IMemoryBus.

◆ read()

uint8_t ComSquare::Debugger::MemoryBusDebug::read ( uint24_t  addr)
overridevirtual

Read data at a global address. This form allow read to be silenced.

Parameters
addrThe address to read from.
Exceptions
InvalidAddressIf the address is not mapped to the bus, this exception is thrown.
Returns
The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.

Implements ComSquare::Memory::IMemoryBus.

◆ write()

void ComSquare::Debugger::MemoryBusDebug::write ( uint24_t  addr,
uint8_t  data 
)
overridevirtual

Write a data to a global address.

Parameters
addrThe address to write to.
dataThe data to write.

Implements ComSquare::Memory::IMemoryBus.

Member Data Documentation

◆ _bus

Memory::IMemoryBus& ComSquare::Debugger::MemoryBusDebug::_bus
private

A reference to the underlying bus..

◆ _model

BusLogModel ComSquare::Debugger::MemoryBusDebug::_model
private

The Log visualizer model for QT.

◆ _proxy

BusLoggerProxy ComSquare::Debugger::MemoryBusDebug::_proxy
private

A QT proxy to filter the logs.

◆ _ui

Ui::BusView ComSquare::Debugger::MemoryBusDebug::_ui
private

A widget that contain the whole UI.

◆ _window

ClosableWindow* ComSquare::Debugger::MemoryBusDebug::_window
private

The QT window for this debugger.


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