(screenChannel chan *[160][240]byte, quitChannel chan bool)
| 33 | } |
| 34 | |
| 35 | func NewComputer(screenChannel chan *[160][240]byte, quitChannel chan bool) *SimpleComputer { |
| 36 | c := new(SimpleComputer) |
| 37 | |
| 38 | c.screenChannel = screenChannel |
| 39 | c.quitChannel = quitChannel |
| 40 | |
| 41 | c.mainBus = components.NewBus(arch.BUS_WIDTH) |
| 42 | c.memory = memory.NewMemory64K(c.mainBus) |
| 43 | c.cpu = cpu.NewCPU(c.mainBus, c.memory) |
| 44 | |
| 45 | c.keyboardAdapter = io.NewKeyboardAdapter() |
| 46 | c.cpu.ConnectPeripheral(c.keyboardAdapter) |
| 47 | |
| 48 | c.displayAdapter = io.NewDisplaydAdapter() |
| 49 | c.screenControl = io.NewScreenControl(c.displayAdapter, c.screenChannel, c.quitChannel) |
| 50 | c.cpu.ConnectPeripheral(c.displayAdapter) |
| 51 | |
| 52 | return c |
| 53 | } |
| 54 | |
| 55 | func (c *SimpleComputer) ConnectKeyboard(keyboard *io.Keyboard) { |
| 56 | keyboard.ConnectTo(c.keyboardAdapter.KeyboardInBus) |
no test coverage detected