Description

The IDevice interface is the primary interface which exposes devices, such as processors, memory, peripherals, etc, to the emulation environment. A device must implement this interface in order to be compatible, although it is better to derive from the Device base class instead, which contains a default implementation of this interface. Many devices only need to implement a few of these methods in order to actually perform the tasks they need to do, so it is better to use this base class and override just the methods that need to be defined for a given device.

Note that this interface is designed to be passed across DLL boundaries, so it must meet the requirements of a Shared Interface.

Initialization functions

Name Description
Public member BindToSystemInterface
Called by the system to bind the device to the ISystemDeviceInterface object
Public member BindToDeviceContext
Called by the system to bind the device to its IDeviceContext object
Public member Construct
Allows a device to load additional parameters which control its construction, as they have been specified in the module file which has created this device instance.
Public member BuildDevice
Allows devices to perform additional one-time construction tasks during the module load process.
Public member ValidateDevice
Allows a device to validate its current state and connection to other devices, as a final check before the device is considered successfully loaded.
Public member Initialize
Is called to instruct a device to initialize its internal state back to a state consistent with a cold-boot.

Reference functions

Name Description
Public member AddReference
Allows a device to reference another element in the system. References are the means by which devices are able to be associated with other system components. Objects of type IDevice, IExtension, IBusInterface, and IClockSource can be referenced.
Public member RemoveReference
Removes a reference previously accepted by a successful call to the AddReference method

Device context functions

Name Description
Public member GetDeviceContext
Returns the IDeviceContext object associated with this device
Public member GetCurrentTimesliceProgress
Returns the progress this device has made through the current timeslice, in nanoseconds.

Suspend functions

Name Description
Public member UsesExecuteSuspend
Reports whether this device ever calls the SuspendTimesliceExecution method on the IDeviceContext object associated with this device.
Public member UsesTransientExecution
Reports whether this device ever calls the SetTransientExecutionActive method on the IDeviceContext object associated with this device.

Execute functions

Name Description
Public member BeginExecution
Called by the system on each device when before system execution starts
Public member SuspendExecution
Called by the system on each device when system execution is paused
Public member ExecuteStep
Called by the system to advance execution on devices that return "Step" as the execution method from GetUpdateMethod
Public member ExecuteTimeslice
Called by the system to advance execution on devices that return "Timeslice" as the execution method from GetUpdateMethod
Public member ExecuteTimesliceTimingPointStep
Called by the system to step through a timing point for devices that return "Timeslice" as the execution method from GetUpdateMethod
Public member GetNextTimingPointInDeviceTime
Called by the system to request a device to report when its next known timing point will occur
Public member ExecuteRollback
Called by the system to request a device to rollback its execution state to the point it was at when the last call to ExecuteCommit occurred
Public member ExecuteCommit
Called by the system to request a device to commit its current execution state, so that it can be restored if the ExecuteRollback is called.
Public member GetUpdateMethod
Returns the update method the device uses to advance execution
Public member SendNotifyUpcomingTimeslice
Reports whether the device wants the system to call the NotifyUpcomingTimeslice method before each system timeslice begins execution
Public member NotifyUpcomingTimeslice
Called before each system timeslice begins execution, if this device returned true from the SendNotifyUpcomingTimeslice method.
Public member SendNotifyBeforeExecuteCalled
Reports whether the device wants the system to call the NotifyBeforeExecuteCalled method before any devices execute the upcoming timeslice
Public member NotifyBeforeExecuteCalled
Called before each device executes the upcoming timeslice, if this device returned true from the SendNotifyBeforeExecuteCalled method.
Public member SendNotifyAfterExecuteCalled
Reports whether the device wants the system to call the NotifyAfterExecuteCalled method after all devices finish executing the last timeslice
Public member NotifyAfterExecuteCalled
Called after all devices finish executing the last timeslice, if this device returned true from the SendNotifyAfterExecuteCalled method.
Public member NotifyAfterExecuteStepFinishedTimeslice
Called on this device after it finishes executing the current timeslice

Name functions

Name Description
Public member GetDeviceImplementationName
Public member GetDeviceInstanceName
Public member GetFullyQualifiedDeviceInstanceName
Public member GetModuleDisplayName
Public member GetModuleInstanceName
Public member GetDeviceModuleID

Savestate functions

Name Description
Public member GetScreenshot
Public member LoadState
Public member SaveState
Public member LoadPersistentState
Public member SavePersistentState
Public member LoadSettingsState
Public member SaveSettingsState
Public member LoadDebuggerState
Public member SaveDebuggerState

CE line state functions

Name Description
Public member GetCELineID
Public member SetCELineInput
Public member SetCELineOutput
Public member CalculateCELineStateMemory
Public member CalculateCELineStateMemoryTransparent
Public member CalculateCELineStatePort
Public member CalculateCELineStatePortTransparent

Memory functions

Name Description
Public member ReadInterface
Public member WriteInterface
Public member TransparentReadInterface
Public member TransparentWriteInterface

Port functions

Name Description
Deprecated memberPublic member ReadPort
Deprecated memberPublic member WritePort
Deprecated memberPublic member TransparentReadPort
Deprecated memberPublic member TransparentWritePort

Line functions

Name Description
Public member GetLineID
Public member GetLineName
Public member GetLineWidth
Public member SetLineState
Public member TransparentSetLineState
Public member RevokeSetLineState
Public member AdvanceToLineState
Public member AssertCurrentOutputLineState
Public member NegateCurrentOutputLineState

Clock source functions

Name Description
Public member GetClockSourceID
Public member GetClockSourceName
Public member SetClockSourceRate
Public member TransparentSetClockSourceRate

Input functions

Name Description
Public member GetKeyCodeID
Public member GetKeyCodeName
Public member HandleInputKeyDown
Public member HandleInputKeyUp

See also