MCPcopy Create free account
hub / github.com/djhworld/simple-computer / newDisplayRAM

Function newDisplayRAM

io/display_ram.go:27–52  ·  view source on GitHub ↗
(inputBus, outputBus *components.Bus)

Source from the content-addressed store, hash-verified

25}
26
27func newDisplayRAM(inputBus, outputBus *components.Bus) *displayRAM {
28 m := new(displayRAM)
29 m.InputAddressRegister = *components.NewRegister("IMAR", inputBus, inputBus)
30 m.inputRowDecoder = *components.NewDecoder8x256()
31 m.inputColDecoder = *components.NewDecoder8x256()
32
33 m.OutputAddressRegister = *components.NewRegister("OMAR", outputBus, outputBus)
34 m.outputRowDecoder = *components.NewDecoder8x256()
35 m.outputColDecoder = *components.NewDecoder8x256()
36
37 m.inputBus = inputBus
38 m.outputBus = outputBus
39
40 // 0xF0 x 0xA0
41 for i := 0; i < 256; i++ {
42 for j := 0; j < 256; j++ {
43 c := memory.NewCell(inputBus, outputBus)
44 inputBus.SetValue(0x0000)
45 c.Update(true, false)
46 c.Update(false, false)
47 m.data[i][j] = *c
48 }
49 }
50
51 return m
52}
53
54func (m *displayRAM) Enable() {
55 m.enable.Update(true)

Callers 1

ConnectMethod · 0.85

Calls 5

UpdateMethod · 0.95
NewRegisterFunction · 0.92
NewDecoder8x256Function · 0.92
NewCellFunction · 0.92
SetValueMethod · 0.80

Tested by

no test coverage detected