caching

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package caching is used for copying gopher2600 data so it can be used by the GUI goroutine safely.

To update the cache the following form should be used:

PushFunction(func() {
    cache.Update(img.vcs)
})

if !cache.Resolve() {
    return
}

The PushFunction() function indicates that the cache.Snapshot() function is run in the gopher2600 emulation goroutine. The PushFunction() function itself is run in the GUI routine.

The cache.Resolve() function is run in the GUI goroutine. A return value of false indicates that the cache is not ready to be used.

History

The caching package is a development of the now removed lazy package. The lazy package worked on a similar principle but was inflexible. It predated the development of the rewind package and performed much of the functionality of the rewind "Snapshot" concept in an adhoc manner. Now that the rewind package exists the caching pacakge repurposes the Snapshot() implementations for its own needs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache contains the copied/snapshotting compenents of the emulated system

func NewCache

func NewCache() Cache

NewCache is the preferred method of initialisation of the Cache type

func (*Cache) Resolve

func (c *Cache) Resolve() bool

Resolve a previous call to Update(). Fine to call if there has been on previous call to Update()

func (*Cache) Update

func (c *Cache) Update(vcs *hardware.VCS, rewind *rewind.Rewind, dbg *debugger.Debugger)

Update the cache. The update will complete on a future call to Resolve()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL