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

#include <APU.hpp>

Inheritance diagram for ComSquare::APU::APU:
Inheritance graph
Collaboration diagram for ComSquare::APU::APU:
Collaboration graph

Public Member Functions

 APU ()
 
uint8_t read (uint24_t addr) override
 Read from the internal APU register. More...
 
void write (uint24_t addr, uint8_t data) override
 Write data to the internal APU register. More...
 
bool update ()
 
- Public Member Functions inherited from ComSquare::Memory::IMemory
void setMemoryRegion (uint24_t start, uint24_t end)
 Change starting and ending points of this mapped memory. More...
 
virtual bool hasMemoryAt (uint24_t addr)
 Return true if this component has mapped the address. More...
 
virtual uint24_t getStart ()
 Get the first address mapped to this component. More...
 

Private Attributes

Registers _registers {}
 All the registers of the APU CPU. More...
 
InternalRegisters _internalRegisters {}
 Internal registers of the CPU (accessible from the bus via addr $4200 to $421F). More...
 
std::shared_ptr< DSP::DSP_dsp
 The DSP component used to produce sound. More...
 

Constructor & Destructor Documentation

◆ APU()

ComSquare::APU::APU::APU ( )
explicit

Member Function Documentation

◆ read()

uint8_t ComSquare::APU::APU::read ( uint24_t  addr)
overridevirtual

Read from the internal APU register.

Parameters
addrThe address to read from. The address 0xF0 should refer to the first byte of the register.
Exceptions
InvalidAddresswill be thrown if the address is more than $FF (the number of register).
Returns
Return the value of the register.

Implements ComSquare::Memory::IMemory.

◆ update()

bool ComSquare::APU::APU::update ( )

◆ write()

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

Write data to the internal APU register.

Parameters
addrThe address to write to. The address 0xF0 should refer to the first byte of register.
dataThe new value of the register.
Exceptions
InvalidAddresswill be thrown if the address is more than $FF (the number of register).

Implements ComSquare::Memory::IMemory.

Member Data Documentation

◆ _dsp

std::shared_ptr<DSP::DSP> ComSquare::APU::APU::_dsp
private

The DSP component used to produce sound.

◆ _internalRegisters

InternalRegisters ComSquare::APU::APU::_internalRegisters {}
private

Internal registers of the CPU (accessible from the bus via addr $4200 to $421F).

◆ _registers

Registers ComSquare::APU::APU::_registers {}
private

All the registers of the APU CPU.


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