GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
console.c
Go to the documentation of this file.
1 #include "console.h"
2 #include "ge.h"
3 #include "bit.h"
4 #include "log.h"
5 #include "signals.h"
6 
7 void ge_fill_console_data(struct ge* ge, struct ge_console *console)
8 {
9  /* maintenance panel lamps (cpu fo. 34) */
10 
11  console->lamps.RO = ge->rRO;
12  console->lamps.SO = ge->rSO;
13  console->lamps.FA = ge->ffFA & 0x0f;
14  console->lamps.UR = ge->URPE;
15  console->lamps.SA = ge->rSA;
16 
17  /* TODO: "selection of the four connectors"? */
18  console->lamps.B = 0;
19 
20  /* operator panel lamps (cpu fo. 33) */
21 
22  console->lamps.HALT = ge->ALTO;
23  console->lamps.OPERATOR_CALL = ge->ALAM;
24 
25  /* performance conditions (cpu fo. 31, 32) */
26 
27  console->lamps.ADD_reg = ge->rBO;
28 
29  console->lamps.OF = BIT(ge->ffFA, 4);
30  console->lamps.NZ = BIT(ge->ffFA, 5);
31  console->lamps.IM = BIT(ge->ffFA, 6);
32  console->lamps.JE = ge->JE;
33 
34  console->lamps.I = ge->INTE;
35  console->lamps.C1 = PUC1(ge);
36  console->lamps.C2 = ge->PUC2;
37  console->lamps.C3 = ge->PUC3;
38 
39  console->lamps.OP_reg = ge->rFO;
40 
41  console->rotary = ge->register_selector;
42  console->switches = ge->console_switches;
43 }
44 
45 void ge_set_console_switches(struct ge *ge, struct ge_console_switches *switches)
46 {
48  "AM: %04x - switches: "
49  "SITE: %d INCE: %d INAR: %d STOC: %d "
50  "ACON: %d ACOV: %d RICI: %d PATE: %d PAPA: %d\n",
51  switches->AM,
52  switches->SITE, switches->INCE, switches->INAR, switches->STOC,
53  switches->ACON, switches->ACOV, switches->RICI, switches->PATE, switches->PAPA);
54  ge->console_switches = *switches;
55 }
56 
57 
59 {
60  ge_log(LOG_CONSOLE, "setting rotary %d\n", rs);
61  ge->register_selector = rs;
62 }
Bit manipulation helpers.
#define BIT(V, X)
Definition: bit.h:9
void ge_fill_console_data(struct ge *ge, struct ge_console *console)
Definition: console.c:7
void ge_set_console_switches(struct ge *ge, struct ge_console_switches *switches)
Definition: console.c:45
void ge_set_console_rotary(struct ge *ge, enum ge_console_rotary rs)
Definition: console.c:58
ge_console_rotary
Definition: console.h:8
void ge_log(ge_log_type type, const char *format,...)
Log message.
Definition: log.c:31
@ LOG_CONSOLE
Console interactions.
Definition: log.h:26
Signals.
uint16_t C1
Definition: console.h:43
uint16_t SA
Definition: console.h:35
uint16_t I
Definition: console.h:44
uint16_t UR
Definition: console.h:28
uint16_t C2
Definition: console.h:42
uint16_t JE
Definition: console.h:45
uint16_t FA
Definition: console.h:33
uint16_t SO
Definition: console.h:31
uint16_t HALT
Definition: console.h:60
uint16_t RO
Definition: console.h:26
uint16_t OF
Definition: console.h:48
uint16_t IM
Definition: console.h:46
uint16_t OP_reg
Definition: console.h:40
uint16_t C3
Definition: console.h:41
uint16_t B
Definition: console.h:37
uint16_t OPERATOR_CALL
Definition: console.h:63
uint16_t NZ
Definition: console.h:47
uint16_t ADD_reg
Definition: console.h:39
Console switches.
Definition: console.h:71
uint16_t SITE
Don't wait for external unit availability.
Definition: console.h:145
uint16_t INCE
Do not error-correct external units input.
Definition: console.h:136
uint16_t PATE
Stop after a cycle.
Definition: console.h:89
uint16_t ACON
Stops on jump condition not verified.
Definition: console.h:113
uint16_t RICI
Disables next status.
Definition: console.h:97
uint16_t AM
Forcing bits.
Definition: console.h:155
uint16_t INAR
Do not stop on memory error.
Definition: console.h:121
uint16_t ACOV
Stops on jump condition verified.
Definition: console.h:105
uint16_t PAPA
Step By Step execution.
Definition: console.h:81
enum ge_console_rotary rotary
Definition: console.h:182
struct ge_console_switches switches
Definition: console.h:180
struct ge_console_lamps lamps
Definition: console.h:179
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition: ge.h:94
uint8_t ALAM
Operator Call.
Definition: ge.h:308
uint8_t INTE
Interruption present.
Definition: ge.h:334
uint8_t ALTO
Stops internal cycles.
Definition: ge.h:269
uint8_t ffFA
Special conditions register 2.
Definition: ge.h:239
enum ge_console_rotary register_selector
The current state of the console register rotary switch.
Definition: ge.h:513
uint8_t rSO
Main sequencer.
Definition: ge.h:196
uint16_t rRO
Multipurpose 8+1 bit register.
Definition: ge.h:147
struct ge_console_switches console_switches
The current state of the console switches.
Definition: ge.h:518
uint8_t PUC3
Channel 3 in transfer.
Definition: ge.h:381
uint8_t PUC2
Channel 2 in transfer.
Definition: ge.h:374
uint16_t rBO
Default operator.
Definition: ge.h:164
uint8_t rSA
Future state configuration.
Definition: ge.h:218
uint8_t JE
JE/AVER jump instruction exectuted.
Definition: ge.h:333
uint8_t URPE
Definition: ge.h:387
uint8_t rFO
Current function code.
Definition: ge.h:171