The Apu class represents the Audio Processing Unit (APU) of a system. More...
#include <apu.h>
Public Member Functions | |
Apu (MemoryImpl &memory) | |
void | Init () |
void | Reset () |
void | RunCycles (uint64_t cycles) |
uint8_t | SpcRead (uint16_t address) |
void | SpcWrite (uint16_t address, uint8_t data) |
void | SpcIdle (bool waiting) |
void | Cycle () |
uint8_t | Read (uint16_t address) |
void | Write (uint16_t address, uint8_t data) |
auto | dsp () -> Dsp & |
auto | spc700 () -> Spc700 & |
Public Attributes | |
std::array< uint8_t, 6 > | in_ports_ |
std::array< uint8_t, 4 > | out_ports_ |
std::vector< uint8_t > | ram = std::vector<uint8_t>(0x10000, 0) |
Private Attributes | |
bool | rom_readable_ = false |
uint8_t | dsp_adr_ = 0 |
uint32_t | cycles_ = 0 |
MemoryImpl & | memory_ |
std::array< Timer, 3 > | timer_ |
ApuCallbacks | callbacks_ |
Dsp | dsp_ {ram} |
Spc700 | spc700_ {callbacks_} |
The Apu class represents the Audio Processing Unit (APU) of a system.
The Apu class is responsible for generating audio samples and managing the APU state. It interacts with the Memory, AudioRam, and Clock classes to read/write data and update the clock. The class also implements the Observer interface to receive notifications from the system.
The region at $FFC0-FFFF will normally read from the 64-byte IPL ROM, but the underlying RAM can always be written to, and the high bit of the Control register $F1 can be cleared to unmap the IPL ROM and allow read access to this RAM.
|
inline |
void yaze::app::emu::audio::Apu::Init | ( | ) |
void yaze::app::emu::audio::Apu::Reset | ( | ) |
Definition at line 42 of file apu.cc.
References cycles_, dsp_, dsp_adr_, in_ports_, out_ports_, ram, yaze::app::emu::audio::Dsp::Reset(), yaze::app::emu::audio::Spc700::Reset(), rom_readable_, spc700_, and timer_.
Referenced by yaze::app::emu::SNES::Reset().
void yaze::app::emu::audio::Apu::RunCycles | ( | uint64_t | cycles | ) |
Definition at line 66 of file apu.cc.
References cycles_, memory_, yaze::app::emu::memory::MemoryImpl::pal_timing(), yaze::app::emu::audio::Spc700::RunOpcode(), and spc700_.
Referenced by yaze::app::emu::SNES::CatchUpApu().
uint8_t yaze::app::emu::audio::Apu::SpcRead | ( | uint16_t | address | ) |
void yaze::app::emu::audio::Apu::SpcWrite | ( | uint16_t | address, |
uint8_t | data ) |
void yaze::app::emu::audio::Apu::SpcIdle | ( | bool | waiting | ) |
void yaze::app::emu::audio::Apu::Cycle | ( | ) |
Definition at line 76 of file apu.cc.
References yaze::app::emu::audio::Dsp::Cycle(), cycles_, dsp_, and timer_.
Referenced by SpcIdle(), SpcRead(), and SpcWrite().
uint8_t yaze::app::emu::audio::Apu::Read | ( | uint16_t | address | ) |
Definition at line 101 of file apu.cc.
References dsp_, dsp_adr_, in_ports_, ram, yaze::app::emu::audio::Dsp::Read(), rom_readable_, and timer_.
Referenced by SpcRead().
void yaze::app::emu::audio::Apu::Write | ( | uint16_t | address, |
uint8_t | data ) |
Definition at line 138 of file apu.cc.
References dsp_, dsp_adr_, in_ports_, out_ports_, ram, rom_readable_, timer_, and yaze::app::emu::audio::Dsp::Write().
Referenced by SpcWrite().
|
inline |
Definition at line 70 of file apu.h.
References dsp_.
Referenced by yaze::app::emu::SNES::RunCycle(), and yaze::app::emu::SNES::SetSamples().
|
inline |
std::array<uint8_t, 6> yaze::app::emu::audio::Apu::in_ports_ |
std::array<uint8_t, 4> yaze::app::emu::audio::Apu::out_ports_ |
Definition at line 75 of file apu.h.
Referenced by yaze::app::emu::SNES::ReadBBus(), Reset(), and Write().
std::vector<uint8_t> yaze::app::emu::audio::Apu::ram = std::vector<uint8_t>(0x10000, 0) |
|
private |
|
private |
|
private |
Definition at line 82 of file apu.h.
Referenced by Cycle(), Reset(), and RunCycles().
|
private |
Definition at line 84 of file apu.h.
Referenced by RunCycles().
|
private |
|
private |
|
private |
Definition at line 93 of file apu.h.
Referenced by Reset(), RunCycles(), and spc700().