GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
channel.c
Go to the documentation of this file.
1/*
2 * channel.c - generic CPU<->peripheral line bundle (see channel.h).
3 *
4 * Pure line-level state: these ops only set/read the lines of a ge_channel.
5 * The CPU microcode reads the lines (request -> RC0x, data -> NE_knot, fini ->
6 * RIG1) and drives output via channel_accept_output -> the peripheral sink. No
7 * CPU flip-flops are forced here; the machine's own sequencer moves the data.
8 */
9
10#include "channel.h"
11
12void channel_offer_input(struct ge *ge, struct ge_channel *ch,
13 uint8_t data, uint8_t end)
14{
15 (void)ge;
16 ch->data = data;
17 ch->data_valid = 1;
18 ch->fini = end ? 1 : 0;
19 ch->req = 1; /* raise the cycle request (OR-source for RC02) */
20}
21
22void channel_clear_input(struct ge *ge, struct ge_channel *ch)
23{
24 (void)ge;
25 ch->data = 0;
26 ch->data_valid = 0;
27 ch->fini = 0;
28 ch->req = 0;
29}
30
31void channel_accept_output(struct ge *ge, struct ge_channel *ch, uint8_t c)
32{
33 if (ch->sink)
34 ch->sink(ge, ch, c);
35}
36
37uint8_t channel_get_req(struct ge_channel *ch) { return ch->req; }
38uint8_t channel_get_data(struct ge_channel *ch) { return ch->data; }
39uint8_t channel_get_fini(struct ge_channel *ch) { return ch->fini; }
void channel_offer_input(struct ge *ge, struct ge_channel *ch, uint8_t data, uint8_t end)
Definition channel.c:12
uint8_t channel_get_data(struct ge_channel *ch)
Definition channel.c:38
uint8_t channel_get_fini(struct ge_channel *ch)
Definition channel.c:39
void channel_accept_output(struct ge *ge, struct ge_channel *ch, uint8_t c)
Definition channel.c:31
uint8_t channel_get_req(struct ge_channel *ch)
Definition channel.c:37
void channel_clear_input(struct ge *ge, struct ge_channel *ch)
Definition channel.c:22
uint8_t data
Definition channel.h:44
uint8_t data_valid
Definition channel.h:45
ge_channel_sink sink
Definition channel.h:54
uint8_t req
Definition channel.h:42
uint8_t fini
Definition channel.h:47
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition ge.h:96