Documentation ¶
Overview ¶
Package delay is a replacement for the future package, which has now been removed. This package (and the package it replaces) helps emulate the latching delays of the TIA.
The future package served it's purpose during early, exploratory phases of the emulator's development. I wasn't sure at first what was needed and the future package developed as a way of supporting experimentation with the various elements of the TIA system.
The delay package is a lot simpler and consequently a lot more efficient.
The only element in the package is the Event type. An Event type instance represents a single future change to the TIA system, which will take place after the stated number of cycles.
To effectively emulate the electronics of the TIA these Events can be dropped, rescheduled or premepted almost at will.
Ordering of Events is rarely significant but in the instances where it is comments are included in the code.
Index ¶
- type Event
- func (e *Event) AboutToEnd() bool
- func (e *Event) Drop()
- func (e *Event) Force()
- func (e *Event) IsActive() bool
- func (e *Event) JustStarted() bool
- func (e *Event) Pause()
- func (e *Event) Push()
- func (e *Event) Remaining() int
- func (e *Event) Schedule(delay int, payload func(interface{}), arg interface{})
- func (e *Event) Tick()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event represents an event that will occur in the future
func (*Event) AboutToEnd ¶
AboutToEnd returns true if the event concludes (and the payload run) on the next call to Tikc()
func (*Event) Drop ¶
func (e *Event) Drop()
Drop will cancel a event. Payload will not be run. Used by ball and player sprites.
func (*Event) Force ¶
func (e *Event) Force()
Force an event to run the payload now. Cancels the future event. Used by missile and player sprites.
func (*Event) IsActive ¶
IsActive returns true if the event is "running" (is yet to drop the payload). Note that paused event will still report as being active.
func (*Event) JustStarted ¶
JustStarted returns true if Tick() has not yet been called.
func (*Event) Pause ¶
func (e *Event) Pause()
Pause the ticking of the event. Tick() will have no effect. There is no Resume() function because it is not needed. However, a paused event can be Forced() (missile and player sprites) or Dropped() (ball and player sprites)
func (*Event) Push ¶
func (e *Event) Push()
Push event so that it starts again. Same as dropping and rescheduling although JustStarted() will not return true for a pushed event. Used by player, missile and ball sprites