GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
printer.c
Go to the documentation of this file.
1/*
2 * printer.c - Integrated printer / console-typewriter peripheral (channel 2).
3 *
4 * See printer.h for the model rationale. Summary of the completion mechanism,
5 * derived empirically against the funktionalcpu report_and_end PER (0x19D0,
6 * `PER 0x00,0x19EE`) and the channel-2 / TPER flow charts:
7 *
8 * A channel-2 print/typewriter PER runs the CPU through the external-operation
9 * organisation phase (c8 d8 d9 .. a8 a9 aa ab) and parks it at state b8, the
10 * org-phase external request-wait. There the CPU suspends: RC00 drops, so the
11 * NA knot yields 0 (idle) and rSA stays 0 while rSO holds b8 pending. gemu has
12 * no channel-2 timing model to satisfy the wait, so it hangs.
13 *
14 * The faithful exit is gated on DU97 = PUC2 ^ L2.3 (signals.h). With PUC2
15 * asserted (and RC00 raised so NA_knot routes rSO=b8 into rSA), state_b8's own
16 * CU01/CU13/CU14/CU06 commands build the PER-completion future_state and the
17 * sequencer returns to alpha at the post-PER instruction with PO/registers
18 * intact (verified: it then runs the real final-verify CMC at 0x19d4 cleanly).
19 *
20 * Whose order is it? The Z character says so (CPU[4] §5.8.2/§5.8.3.1, dwg
21 * 30004122 o/A fo.72-73):
22 *
23 * PER/PERI = [OP][C][I1] C = the NAME of the peripheral unit
24 * order block at I1: TPER = Z X L L I I ; CPER/EPER/SPER/LPER = Z X
25 *
26 * "The Z character specifies the type of operation, some procedures to
27 * perform the operation itself, and the interested channel."
28 *
29 * "The bits 03 and 00 of the Z character indicate the channel to be used":
30 *
31 * 03 00
32 * 0 0 channel 1
33 * 1 0 channel 3
34 * 0 1 channel 2, not overlapped to calculation
35 * 1 1 channel 2, overlapped to calculation
36 *
37 * "The indication of the channel must be coherent with the one of the
38 * peripheral unit selected: channel 2 is reserved to the integrated
39 * parallel printer and reader; channels 1 and 3 cannot be used with the
40 * integrated parallel printer."
41 *
42 * Bit 02 of Z asks for a preliminary availability check: 1 = ignore the
43 * unit's status and go ahead, 0 = block the CPU until it is available.
44 *
45 * So this peripheral answers an order if, and only if, its Z selects channel 2
46 * -- ORDER_IS_CHANNEL2 below. The real SAT decks agree with the manual: every
47 * printer order in printermechanicaltest.cap carries Z bit 00 (Z=51 WRITE,
48 * Z=81, Z=C5 space), and the centre-card read that used to be answered here by
49 * mistake carries Z=00, channel 1.
50 *
51 * Discriminating the channel-2 print-wait from the channel-1 reader input-wait:
52 * State b8 is SHARED with the card reader, and so is the whole org phase that
53 * leads to it (c8 d8 ... ab). The machine's own answer to "whose order is
54 * this?" is the connector decode: PC121 = PUC11 . PB071 . PB06A is connector 2
55 * on channel 1 -- the integrated card reader -- being the selected peripheral.
56 * Measured at the wait itself: the reader's order shows PC121=1, a genuine
57 * channel-2 print PER shows PC121=0. So the printer keeps out of any wait
58 * PC121 claims (see channel1_reader_owns_the_order).
59 *
60 * That check has to happen at b8, not at c8 where the order is first noticed:
61 * PB06/PB07 are latched by CE02 later in the org phase, so PC121 is still 0 at
62 * c8. The claim made at c8 is therefore provisional, and is disowned at b8.
63 *
64 * Beyond that, a genuine channel-2 print-wait persists where a reader
65 * inter-byte gap does not, so a stall counter debounces the remaining cases:
66 * only after the wait has held unbroken for STALL_THRESHOLD on_clock calls do
67 * we treat it as a printer op and complete it.
68 */
69
70#include "printer.h"
71
72#include <stdlib.h>
73#include <string.h>
74
75#include "log.h"
76#include "gecode.h"
77#include "signals.h"
78
79/* Consecutive idle b8-wait cycles before we conclude it is a channel-2 print
80 * op and not a reader inter-byte gap. The reader presents within a few cycles;
81 * 256 is comfortably above any inter-byte gap yet imperceptible to the user. */
82#define STALL_THRESHOLD 256
83
85 int stall; /* consecutive idle channel-2 wait cycles */
86 int per_pending; /* a channel-2 PER org-phase is in progress */
87 uint16_t per_base; /* its order-block base (rV1 at state c8) */
88 struct ge_peri peri;
89};
90
91/* A channel-2 PER order block is {z, cmd, len_hi, len_lo, buf_hi, buf_lo}
92 * (perperi-validated). A put/print command has bit 7 set; a length beyond a
93 * print line is taken as a control PER (e.g. funktionalcpu's banner, whose
94 * 2-byte order overlaps the following code) and ignored. */
95#define PRINT_CMD_IS_PUT(cmd) ((cmd) & 0x80)
96#define PRINT_LEN_MAX 256
97#define KBD_CMD_LINE 0x40
98#define KBD_CMD_CHAR 0x41
99/* Line printer (LP/PRT, connector 2): the WRITE/print order is the same 6-byte
100 * block {z, cmd, len_hi, len_lo, buf_hi, buf_lo} as the console typewriter, but
101 * with command byte 0x42 (WRITE) instead of the typewriter's PUT (bit 7 set) —
102 * verified from printermechanicaltest.cap (order {51 42 00 9F 02 02} prints 159
103 * bytes from 0x0202) and the PRT mechanic-test listing ("X'C0',WRITE"). Unlike
104 * the typewriter output it parks the CPU at the b8 external request-wait with
105 * RC00 still set, so it is released there (like an input order) and the actual
106 * transfer is armed when the PER returns to alpha. */
107#define LP_CMD_WRITE 0x42
108#define IS_OUTPUT_CMD(cmd) (PRINT_CMD_IS_PUT(cmd) || (cmd) == LP_CMD_WRITE)
109
110/* Z bit 00: channel 2 (with bit 03 distinguishing overlapped from not). The
111 * printer is on channel 2 and nowhere else, so this is the whole test. */
112#define Z_CHANNEL2_BIT 0x01
113#define ORDER_IS_CHANNEL2(ge, base) (((ge)->mem[(uint16_t)(base)] & Z_CHANNEL2_BIT) != 0)
114
115#define STDIO_STATUS_ADDR 0x0030
116#define STDIO_COUNT_ADDR 0x0032
117#define LP_CMD_SINGLE_SPACE 0x2E
118#define LP_CMD_TRIPLE_SPACE 0x5A
119
120static void store16(struct ge *ge, uint16_t addr, uint16_t value)
121{
122 ge_mem_store8(ge, addr, (uint8_t)(value >> 8));
123 ge_mem_store8(ge, (uint16_t)(addr + 1), (uint8_t)value);
124}
125
126static void printer_capture_char(struct ge_integrated_printer *p, char c)
127{
128 if (p->out_len >= (int)sizeof(p->out) - 1)
129 return;
130 p->out[p->out_len++] = c;
131 p->out[p->out_len] = '\0';
132}
133
134static void printer_capture_breaks(struct ge_integrated_printer *p, int count)
135{
136 for (int i = 0; i < count; i++)
137 printer_capture_char(p, '\n');
138}
139
140static void printer_capture_control(struct ge_integrated_printer *p, uint8_t cmd)
141{
142 switch (cmd) {
145 break;
148 break;
149 default:
150 break;
151 }
152}
153
154static int kbd_ready(const struct ge_integrated_printer *p)
155{
156 return p->kbd_head != p->kbd_tail;
157}
158
159static int kbd_has_complete_line(const struct ge_integrated_printer *p)
160{
161 for (int i = p->kbd_head; i != p->kbd_tail; i = (i + 1) % (int)sizeof(p->kbd)) {
162 if (p->kbd[i] == '\n' || p->kbd[i] == '\r')
163 return 1;
164 }
165 return 0;
166}
167
168static uint8_t kbd_pop(struct ge_integrated_printer *p)
169{
170 uint8_t c = p->kbd[p->kbd_head];
171 p->kbd_head = (p->kbd_head + 1) % (int)sizeof(p->kbd);
172 return c;
173}
174
175static int service_input_line(struct ge *ge, uint16_t buf, int len)
176{
177 struct ge_integrated_printer *p = &ge->integrated_printer;
178 int max = (len > 0) ? len - 1 : 0;
179 int n = 0;
180
181 while (kbd_ready(p)) {
182 uint8_t c = kbd_pop(p);
183 if (c == '\r')
184 continue;
185 if (c == '\n')
186 break;
187 if (n < max)
188 ge_mem_store8(ge, (uint16_t)(buf + n++), ge_code(c));
189 }
190 if (len > 0)
191 ge_mem_store8(ge, (uint16_t)(buf + n), 0x00);
192 store16(ge, STDIO_COUNT_ADDR, (uint16_t)n);
194 return n;
195}
196
197static int service_input_char(struct ge *ge, uint16_t buf, int len)
198{
199 struct ge_integrated_printer *p = &ge->integrated_printer;
200 uint8_t c;
201
202 if (!kbd_ready(p))
203 return 0;
204 c = kbd_pop(p);
205 if (c == '\r')
206 c = '\n';
207 if (len > 0)
208 ge_mem_store8(ge, buf, ge_code(c));
209 store16(ge, STDIO_COUNT_ADDR, len > 0 ? 1 : 0);
210 store16(ge, STDIO_STATUS_ADDR, len > 0 ? 1 : 0);
211 return len > 0 ? 1 : 0;
212}
213
214static int input_order_ready(struct ge *ge, uint8_t cmd)
215{
216 if (cmd == KBD_CMD_CHAR)
218 if (cmd == KBD_CMD_LINE)
220 return 0;
221}
222
223/*
224 * Does the card reader own the order the machine is waiting on?
225 *
226 * PC121 is the machine's own decode: connector 2 on channel 1 -- the integrated
227 * card reader -- is the selected peripheral. State b8 is shared between the
228 * channel-1 reader input-wait and the channel-2 print-wait and they are
229 * otherwise indistinguishable from here (both show PUC1=1, RASI=1, and the
230 * reader's IPL order carries no order block in memory at all, so its "command"
231 * byte reads as whatever happens to be at mem[1]).
232 *
233 * Answering a reader order is not a cosmetic error: PUC2 goes up, DU97 fires,
234 * state_b8's microcode completes the PER, and the IPL falls through to alpha at
235 * address 0 having read nothing -- the machine stops at cycle 17 with a deck
236 * still in the hopper.
237 */
239{
240 /* A second, independent guard for the one order that has no order block to
241 * read: the IPL's. Its Z is whatever core happens to hold at rV1 -- and core
242 * retains, so on a machine that has run before, that byte can have bit 00
243 * set by pure accident. PC121 is the machine's own decode of "connector 2 on
244 * channel 1" (PUC11 . PB071 . PB06A), i.e. the card reader is the selected
245 * peripheral, and LESAB says a reader is physically there to answer. It is
246 * only meaningful once the org phase has latched the connector select, so
247 * it is checked at the wait, not at c8. */
248 return PC121(ge) && ge->integrated_reader.lesab;
249}
250
251/* Is the machine parked in the channel-2 org-phase external request-wait?
252 * rSO=b8 pending, rSA=0 (CPU suspended/idle), CPU-active request not raised,
253 * and the integrated reader is not presenting a byte (so this is not a reader
254 * inter-byte gap that the reader is about to break). */
255static int in_channel2_print_wait(struct ge *ge)
256{
257 return ge->rSO == 0xb8 &&
258 ge->rSA == 0x00 &&
259 !ge->RC00 &&
261}
262
263/*
264 * on_clock: called at TO00, the first clock of every machine cycle, before the
265 * MSL chart for the cycle runs. We watch for the channel-2 print-wait; once it
266 * has stalled past the debounce threshold we capture the line and assert the
267 * unit-ready / CPU-active conditions so the machine's own state_b8 microcode
268 * completes the PER (B8 -> alpha) on the next cycle.
269 */
270static int printer_on_clock(struct ge *ge, void *opaque)
271{
272 struct printer_ctx *ctx = (struct printer_ctx *)opaque;
273 struct ge_integrated_printer *p = &ge->integrated_printer;
274
275 if (!p->present)
276 return 0;
277
278 /* Channel-2 OUTPUT transfer engine: drive one character per cycle. While
279 * bytes remain, hold the channel-2 request (RC02) and the rSI output state
280 * so NA_knot routes this cycle to state_02 (mem[V4] -> RO -> CE16 -> sink).
281 * RC02 is asserted at TO00, before pulse() latches RIA2 = RC02. When the
282 * count is exhausted, drop the request and end the line. */
283 if (p->out_active) {
284 if (p->out_remaining > 0) {
285 ge->RC02 = 1;
286 ge->rSI = 0x02;
287 p->out_remaining--;
288 } else {
289 /* Transfer done: drop the request (so this cycle is no longer a
290 * channel-2 cycle and the CPU resumes), restore the CPU sequencer
291 * the stolen cycles clobbered, and end the line. */
292 ge->RC02 = 0;
293 ge->rSO = p->out_saved_so;
294 if (p->out_line_mode)
296 store16(ge, STDIO_COUNT_ADDR, (uint16_t)p->out_total);
298 p->out_active = 0;
299 p->out_line_mode = 0;
300 }
301 return 0;
302 }
303
304 /* Arm an output transfer from a channel-2 print PER. At the org-phase entry
305 * (SO=0xc8) rV1 is the order-block base; when the PER returns to alpha (e2),
306 * decode the order and, for a put command with a plausible length, start the
307 * transfer engine (which then drains the buffer over channel 2). */
308 if (ge->rSO == 0xc8) {
309 /* Claim the order only if its Z names channel 2. State c8 is the org
310 * phase of EVERY peripheral order -- the channel-1 card reader walks
311 * through it too -- and answering one that is not ours puts PUC2 up,
312 * fires DU97 and completes the READER's PER on its behalf. */
314 ctx->per_base = ge->rV1;
315 /* Start each PER's org phase with a clean channel-2 handshake. PUC2 is
316 * a flip-flop the real machine clears via the L2.3 toggle; the model
317 * never toggles L2.3, so an input completion that asserted PUC2 would
318 * otherwise leave it stuck and make DU97 fire prematurely in the next
319 * PER (jamming its org phase). Clear it here. */
320 ge->PUC2 = 0;
321 } else if (ctx->per_pending && ge->rSO == 0xe2) {
322 uint16_t base = ctx->per_base;
323 uint8_t cmd = ge->mem[(uint16_t)(base + 1)];
324 int len = (ge->mem[(uint16_t)(base + 2)] << 8) |
325 ge->mem[(uint16_t)(base + 3)];
326 uint16_t buf = (ge->mem[(uint16_t)(base + 4)] << 8) |
327 ge->mem[(uint16_t)(base + 5)];
328 ctx->per_pending = 0;
329 if (IS_OUTPUT_CMD(cmd) && len >= 1 && len <= PRINT_LEN_MAX)
330 printer_begin_output(ge, buf, len, cmd == LP_CMD_WRITE);
331 else if (cmd == KBD_CMD_LINE && len >= 1 && len <= PRINT_LEN_MAX)
332 service_input_line(ge, buf, len);
333 else if (cmd == KBD_CMD_CHAR && len >= 1 && len <= PRINT_LEN_MAX)
334 service_input_char(ge, buf, len);
335 }
336
337 /* Whose wait is this? PC121 is only meaningful once the org phase has
338 * latched the connector select, which is why the claim at c8 above is
339 * provisional: disown it here if the order turns out to be the reader's,
340 * and take no further part in this cycle. */
341 if (ge->rSO == 0xb8 && channel1_reader_owns_the_order(ge)) {
342 ctx->per_pending = 0;
343 ctx->stall = 0;
344 return 0;
345 }
346
347 /* Input orders (read line / read char) park the CPU at the channel-2
348 * external request-wait (rSO=b8) with RC00 still asserted: unlike an
349 * output/control PER, no transfer cycles ran to reset it via CE18, so the
350 * print-wait detector below (which requires !RC00) never fires. Complete
351 * the read here, independent of RC00, as soon as the requested input is
352 * available (a full line for KBD_CMD_LINE, any key for KBD_CMD_CHAR). */
353 if (ctx->per_pending && ge->rSO == 0xb8) {
354 uint8_t cmd = ge->mem[(uint16_t)(ctx->per_base + 1)];
355 int len = (ge->mem[(uint16_t)(ctx->per_base + 2)] << 8) |
356 ge->mem[(uint16_t)(ctx->per_base + 3)];
357 /* A line-printer WRITE parks here with RC00 set; release it so the PER
358 * returns to alpha, where the e2 arm starts the buffer transfer. */
359 int write_ready = (cmd == LP_CMD_WRITE && len >= 1 && len <= PRINT_LEN_MAX);
360 int input_ready = (cmd == KBD_CMD_LINE || cmd == KBD_CMD_CHAR) &&
361 input_order_ready(ge, cmd);
362 /* Any OTHER channel-2 order parked here with RC00 still set is a printer
363 * control op (paper spacing, jump-to-channel, drum/ribbon select) that
364 * transfers no data: the device accepts it immediately. Complete it here
365 * — the RC00=0 path below (stall debounce vs the card reader's b8 gap)
366 * cannot, because RC00 never dropped. Gated on RC00 so a reader inter-byte
367 * gap (RC00=0) and funktionalcpu's RC00=0 control PER are left to it. */
368 int control_ready = ge->RC00 &&
369 cmd != KBD_CMD_LINE &&
370 cmd != KBD_CMD_CHAR &&
371 !write_ready;
372 if (write_ready || input_ready || control_ready) {
373 if (control_ready)
375 ge->PUC2 = 1; /* channel-2 unit ready -> DU97 completes the PER */
376 ge->RC00 = 1; /* CPU-active request -> rSO=b8 routed into rSA */
377 ctx->stall = 0;
378 return 0;
379 }
380 }
381
383 ctx->stall = 0;
384 return 0;
385 }
386
387 if (ctx->per_pending) {
388 uint8_t cmd = ge->mem[(uint16_t)(ctx->per_base + 1)];
389 if ((cmd == KBD_CMD_LINE || cmd == KBD_CMD_CHAR) &&
390 input_order_ready(ge, cmd)) {
391 ge->PUC2 = 1;
392 ge->RC00 = 1;
393 ctx->stall = 0;
394 return 0;
395 }
396 }
397
398 if (++ctx->stall < STALL_THRESHOLD)
399 return 0;
400
401 /* A channel-2 PER parked at the b8 external request-wait that is NOT a data
402 * print (no order-block transfer was armed above) — e.g. a control/order PER
403 * such as funktionalcpu's banner/report. Complete it via the native path so
404 * the CPU resumes, but emit nothing: real printed text comes only from an
405 * armed output transfer, not from heuristically scraping the order block. */
406 if (ctx->per_pending) {
407 uint8_t cmd = ge->mem[(uint16_t)(ctx->per_base + 1)];
409 }
410 ge->PUC2 = 1; /* channel-2 unit ready -> DU97 = 1 (PUC2 ^ L2.3) */
411 ge->RC00 = 1; /* CPU-active request -> NA_knot routes rSO=b8 into rSA */
412 ctx->stall = 0; /* one-shot; rSO leaves b8 next cycle */
413 return 0;
414}
415
416static int printer_deinit(struct ge *ge, void *opaque)
417{
418 (void)ge;
419 free(opaque);
420 return 0;
421}
422
423/* Channel-2 OUTPUT sink: the CPU's channel-2 transfer microcode hands one
424 * character to the printer here (command CE16 "Load Printer Buffer", rSI state
425 * 02/03). The byte is the machine's internal GE graphic code; render it through
426 * the GE 100-series glyph table into the paper-feed buffer (same buffer the
427 * front-ends drain). See docs/peripherals.md "CAN2 data-transfer phase". */
428static void printer_sink(struct ge *ge, struct ge_channel *ch, uint8_t c)
429{
430 struct ge_integrated_printer *p = &ge->integrated_printer;
431 (void)ch;
432
434}
435
437{
438 struct printer_ctx *ctx = calloc(1, sizeof(*ctx));
439 if (!ctx)
440 return -1;
441
445 ge->integrated_printer.out[0] = '\0';
448
449 ctx->stall = 0;
450 ctx->peri.next = NULL;
451 ctx->peri.init = NULL;
452 ctx->peri.on_pulse = NULL;
455 ctx->peri.ctx = ctx;
456
457 return ge_register_peri(ge, &ctx->peri);
458}
459
460void printer_begin_output(struct ge *ge, uint16_t buffer, int length, int line_mode)
461{
462 ge->rV4 = buffer;
467 ge->integrated_printer.out_saved_so = ge->rSO; /* resume here when done */
468}
469
470void printer_feed_key(struct ge *ge, uint8_t c)
471{
472 struct ge_integrated_printer *p = &ge->integrated_printer;
473 int next = (p->kbd_tail + 1) % (int)sizeof(p->kbd);
474 if (next == p->kbd_head)
475 return; /* queue full; drop */
476 p->kbd[p->kbd_tail] = c;
477 p->kbd_tail = next;
478}
479
481{
483}
484
485const char *printer_output(struct ge *ge)
486{
487 return ge->integrated_printer.out;
488}
489
491{
493 ge->integrated_printer.out[0] = '\0';
494}
void ge_mem_store8(struct ge *ge, uint16_t addr, uint8_t val)
Store a byte with generated odd parity + mark-written (for the hybrid ALU/SS write paths that write g...
Definition ge.c:317
int ge_register_peri(struct ge *ge, struct ge_peri *p)
char ge_glyph(uint8_t b)
Definition gecode.c:37
uint8_t ge_code(uint8_t c)
Definition gecode.c:47
static void printer_capture_control(struct ge_integrated_printer *p, uint8_t cmd)
Definition printer.c:140
#define STDIO_STATUS_ADDR
Definition printer.c:115
#define LP_CMD_WRITE
Definition printer.c:107
static int service_input_char(struct ge *ge, uint16_t buf, int len)
Definition printer.c:197
#define KBD_CMD_CHAR
Definition printer.c:98
int printer_output_len(struct ge *ge)
Definition printer.c:480
static int printer_on_clock(struct ge *ge, void *opaque)
Definition printer.c:270
static void printer_capture_breaks(struct ge_integrated_printer *p, int count)
Definition printer.c:134
#define KBD_CMD_LINE
Definition printer.c:97
static void store16(struct ge *ge, uint16_t addr, uint16_t value)
Definition printer.c:120
#define LP_CMD_SINGLE_SPACE
Definition printer.c:117
static void printer_capture_char(struct ge_integrated_printer *p, char c)
Definition printer.c:126
static int in_channel2_print_wait(struct ge *ge)
Definition printer.c:255
void printer_begin_output(struct ge *ge, uint16_t buffer, int length, int line_mode)
Definition printer.c:460
int printer_register(struct ge *ge)
Definition printer.c:436
#define PRINT_LEN_MAX
Definition printer.c:96
const char * printer_output(struct ge *ge)
Definition printer.c:485
static int input_order_ready(struct ge *ge, uint8_t cmd)
Definition printer.c:214
static int printer_deinit(struct ge *ge, void *opaque)
Definition printer.c:416
void printer_feed_key(struct ge *ge, uint8_t c)
Definition printer.c:470
static uint8_t kbd_pop(struct ge_integrated_printer *p)
Definition printer.c:168
#define ORDER_IS_CHANNEL2(ge, base)
Definition printer.c:113
#define IS_OUTPUT_CMD(cmd)
Definition printer.c:108
static int kbd_has_complete_line(const struct ge_integrated_printer *p)
Definition printer.c:159
void printer_output_clear(struct ge *ge)
Definition printer.c:490
#define STALL_THRESHOLD
Definition printer.c:82
static void printer_sink(struct ge *ge, struct ge_channel *ch, uint8_t c)
Definition printer.c:428
#define LP_CMD_TRIPLE_SPACE
Definition printer.c:118
static int kbd_ready(const struct ge_integrated_printer *p)
Definition printer.c:154
static int service_input_line(struct ge *ge, uint16_t buf, int len)
Definition printer.c:175
#define STDIO_COUNT_ADDR
Definition printer.c:116
static int channel1_reader_owns_the_order(struct ge *ge)
Definition printer.c:238
Signals.
uint8_t kbd[256]
Definition ge.h:762
char out[65536]
Definition ge.h:756
ge_channel_sink sink
Definition channel.h:54
Definition ge.h:882
int(* on_pulse)(struct ge *, void *)
Definition ge.h:885
void * ctx
Definition ge.h:888
struct ge_peri * next
Definition ge.h:883
int(* init)(struct ge *, void *)
Definition ge.h:884
int(* deinit)(struct ge *, void *)
Definition ge.h:887
int(* on_clock)(struct ge *, void *)
Definition ge.h:886
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition ge.h:172
struct ge_integrated_reader integrated_reader
The I/O interface for the integrated reader (RI)
Definition ge.h:744
uint16_t rV1
Addresser for the first operand.
Definition ge.h:201
uint8_t rSO
Main sequencer.
Definition ge.h:309
uint8_t PUC2
Channel 2 in transfer.
Definition ge.h:540
uint8_t RC00
Asynchronous CPU Cycle Request.
Definition ge.h:574
uint8_t mem[MEM_SIZE]
The memory of the emulated system.
Definition ge.h:695
struct ge_channel channel2
Integrated channel 2 (CAN2) line bundle — shared by the integrated reader (input),...
Definition ge.h:794
uint16_t rV4
Addresser for external instructions using channel 2.
Definition ge.h:204
uint8_t rSA
Future state configuration.
Definition ge.h:331
uint8_t RC02
Asynchronous Channel 2 Cycle Request.
Definition ge.h:602
uint8_t rSI
Peripheral unit sequencer.
Definition ge.h:323
struct ge::ge_integrated_printer integrated_printer
int stall
Definition printer.c:85
struct ge_peri peri
Definition printer.c:88
uint16_t per_base
Definition printer.c:87
int per_pending
Definition printer.c:86