MCPcopy Create free account
hub / github.com/fogleman/nes / Read

Method Read

nes/controller.go:28–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28func (c *Controller) Read() byte {
29 value := byte(0)
30 if c.index < 8 && c.buttons[c.index] {
31 value = 1
32 }
33 c.index++
34 if c.strobe&1 == 1 {
35 c.index = 0
36 }
37 return value
38}
39
40func (c *Controller) Write(value byte) {
41 c.strobe = value

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected