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() uint8
- 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) Resume()
- func (e *Event) Schedule(delay int, value uint8)
- func (e *Event) Tick() (uint8, bool)
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 something that will occur in the future.
func (*Event) AboutToEnd ¶
AboutToEnd returns true if the event expires on the next call to Tick().
func (*Event) Drop ¶
func (e *Event) Drop()
Drop or cancel an event. Used by ball and player sprites.
func (*Event) Force ¶
Force an event to end now, returning the value. Used by missile and player sprites.
func (*Event) IsActive ¶
IsActive returns true if the event is still active. 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.