Class System

Inheritance Relationships

Derived Types

Class Documentation

class System

This class is an abstraction of an emulated system. Components are placed and interconnected here to create a functioning system.

Subclassed by Bare6502, NES

Public Functions

System()
virtual ~System() = default
virtual void init()

Initialize a System to a power-on state. Default implementation just calls init on all components in m_components.

Note

For System developer: If there is any other operation except initializing all the components, you can override the method and implement the initialization yourself.

virtual void doClocks(unsigned int count) = 0

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) = 0

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) = 0

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) = 0

Run system in real-time.

Note

For System developer:

Parameters

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

virtual void onRefresh()

Callback that is called on every new frame.

virtual std::vector<EmulatorWindow> getGUIs()

Get all the GUI elements created by the System and underlying Component(s).

Returns

Vector of dockable windows.

virtual unsigned long getClockRate() const

Get main clock rate.

Returns

Clock rate.

virtual size_t soundOutputCount() const

Get a count of sound outputs. Used to correctly construct nodes in Sound.h.

Returns

Count of all sound outputs.

virtual const SoundSampleSources &getSampleSources() const

Get sample sources.

Returns

Audio sample getters.

virtual std::vector<ImInputBinder::action_t> getInputs()

Get inputs of all components in the System.

Returns

Required inputs.

virtual std::string getName() const final

Get system’s name.

Protected Attributes

std::string m_systemName = "Default System"
std::vector<Component*> m_components
unsigned long m_systemClockRate = 0
SoundSampleSources m_sampleSources