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

Method Connect

io/keyboard.go:44–63  ·  view source on GitHub ↗
(ioBus *components.IOBus, mainBus *components.Bus)

Source from the content-addressed store, hash-verified

42}
43
44func (k *KeyboardAdapter) Connect(ioBus *components.IOBus, mainBus *components.Bus) {
45 k.ioBus = ioBus
46 k.mainBus = mainBus
47 k.memoryBit = components.NewBit()
48 k.memoryBit.Update(false, true)
49 k.memoryBit.Update(false, false)
50 k.andGate1 = *components.NewANDGate8()
51 k.andGate2 = *components.NewANDGate3()
52 k.andGate3 = *components.NewANDGate3()
53 k.andGate4 = *circuit.NewANDGate()
54 k.keycodeRegister = *components.NewRegister("KCR", k.KeyboardInBus, k.mainBus)
55
56 for i := range k.notGatesForAndGate1 {
57 k.notGatesForAndGate1[i] = *circuit.NewNOTGate()
58 }
59
60 for i := range k.notGatesForAndGate3 {
61 k.notGatesForAndGate3[i] = *circuit.NewNOTGate()
62 }
63}
64
65func (k *KeyboardAdapter) Update() {
66 k.updateKeycodeReg()

Calls 7

NewBitFunction · 0.92
NewANDGate8Function · 0.92
NewANDGate3Function · 0.92
NewANDGateFunction · 0.92
NewRegisterFunction · 0.92
NewNOTGateFunction · 0.92
UpdateMethod · 0.65