Documentation ¶
Overview ¶
Package device contains common device components like memory, video, audio, io, etc.
Index ¶
Constants ¶
View Source
const ( EventBusRead = iota // Read is a bus read event EventBusWrite // Write is a bus write event EventBusAfterRead // Read is a bus read event EventBusAfterWrite // Write is a bus write event )
Bus event types
View Source
const ( EventUndefined = iota // Undefined event EventInit // Init is a device init event EventReset // Reset is a device reset event )
Device event codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus interface { // Read reads one byte from address Read(address uint16) byte // Write writes a byte at address Write(address uint16, data byte) }
Bus is a 8 bit data bus of 16 bit address
type Clock ¶
type Clock interface { // Add increases clock tstates by value Add(value int) // Inc increases clock tstates by one Inc() // Restart restarts clock to tstates Restart(tstates int) // SetTstates sets the clock tstate SetTstates(tstate int) // Tstates obtains the clock tstate Tstates() int // Total gets total tstates since last reset Total() int64 }
Clock is the CPU clock
type ClockDevice ¶
type ClockDevice struct {
// contains filtered or unexported fields
}
ClockDevice is the default clock implementation
func (*ClockDevice) Restart ¶
func (c *ClockDevice) Restart(tstates int)
Restart restarts clock to tstates
func (*ClockDevice) SetTstates ¶
func (c *ClockDevice) SetTstates(tstates int)
SetTstates sets the clock tstates
func (*ClockDevice) Total ¶
func (c *ClockDevice) Total() int64
Total gets total tstates since last reset
type Components ¶
type Components struct {
// contains filtered or unexported fields
}
Components is a set of Devices
func (*Components) Add ¶
func (collection *Components) Add(device Device)
Add adds device at current index
func (*Components) Get ¶
func (collection *Components) Get(index int) Device
Get gets device at index
func (*Components) Set ¶
func (collection *Components) Set(index int, device Device)
Set sets device at index
type Device ¶
type Device interface { // Init initializes the device Init() // Reset resets the device Reset() }
Device is the base device component
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is the base device event
Directories ¶
Path | Synopsis |
---|---|
Package cpu contains common components for CPU emulators
|
Package cpu contains common components for CPU emulators |
z80
Package z80 a Zyxel Z80 CPU emulator
|
Package z80 a Zyxel Z80 CPU emulator |
Package io contains IO devices
|
Package io contains IO devices |
Package memory defines memory components
|
Package memory defines memory components |
Package video contains video components and devices
|
Package video contains video components and devices |
Click to show internal directories.
Click to hide internal directories.