| 42 | } |
| 43 | |
| 44 | func (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 | |
| 65 | func (k *KeyboardAdapter) Update() { |
| 66 | k.updateKeycodeReg() |