Class NES

Inheritance Relationships

Base Type

Class Documentation

class NES : public System

Nintendo Entertainment System emulation (NTSC version).

Public Functions

NES()
~NES() override = default
virtual void doClocks(unsigned int count) override

Proceed specified number of system clocks.

Note

For System developer: implement a reaction to a main clock signal. Normally whole emulation is driven by this function.

Parameters

count – Number of clock to process.

virtual void doSteps(unsigned int count) override

Proceed specified number of CPU instructions.

Note

For System developer: You can for example proceed by single clocks until the CPU processes specified number of instructions. If there is no CPU, provide dummy method.

Parameters

count – Number of instructions to process.

virtual void doFrames(unsigned int count) override

Proceed specified number of rendered frames.

Note

For System developer: If there is neither GPU or any definition of frame, provide dummy method.

Parameters

count – Number of frames to process.

virtual void doRun(unsigned int updateFrequency) override

Run system in real-time.

Note

For System developer:

Parameters

updateFrequency – Frequency in which the function is called to match the clock speed.

Protected Functions

void clock()

Protected Attributes

const unsigned int MASTER_CLOCK_HZ = 21477272
const unsigned int PPU_CLOCK_HZ = MASTER_CLOCK_HZ / 4
RP2A03 m_cpu
APU m_apu
R2C02 m_ppu
Memory m_RAM   = {0x800, {.from = 0x0000, .to = 0x1FFF}, 0xFF}
Gamepak m_cart
Bus m_cpuBus = {5, 16, 8}
Bus m_ppuBus = {1, 14, 8}
NESPeripherals m_peripherals
std::shared_ptr<Connector> m_apuPeripheralConnector
SignalPort m_cpuClock
SignalPort m_ppuClock
SignalPort m_apuClock
unsigned long long m_clockCount = 0