GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Data Structures | Macros | Typedefs | Enumerations | Functions
ge.h File Reference
#include <stdint.h>
#include <stddef.h>
#include "opcodes.h"
#include "console.h"
#include "reader.h"
#include "channel.h"

Go to the source code of this file.

Data Structures

struct  ge_counting_network
 
struct  ge_counting_network::cmds
 
struct  ge_ua_controls
 
struct  ge_knot_no
 
struct  ge_knot_ni
 
struct  ge_options
 
struct  ge
 The entire state of the emulated system, including registers, memory, peripherals and timings. More...
 
struct  ge::ge_integrated_printer
 Integrated printer / console typewriter (channel 2) — pragmatic model. More...
 
struct  pulse_event
 
struct  ge_peri
 

Macros

#define CLOCK_PERIOD   14000 /* in usec, interval between pulse lines */
 
#define MEM_SIZE   65536
 
#define ENUMERATE_CLOCKS
 
#define X(name)   name ,
 

Typedefs

typedef void(* on_pulse_cb) (struct ge *)
 

Enumerations

enum  clock { ENUMERATE_CLOCKS }
 
enum  knot_ni_source {
  NS_ZERO , NS_CN1 , NS_CN2 , NS_CN3 ,
  NS_CN4 , NS_RO1 , NS_RO2 , NS_UA2 ,
  NS_UA1
}
 
enum  ge_pont { PONT_NONE = 0 , PONT_2N , PONT_2P }
 Backplane option connectors and the maintenance LAMPS switch. More...
 

Functions

void ge_init (struct ge *ge)
 Initialize the emulator.
 
int ge_deinit (struct ge *ge)
 Deinitialize the emulator.
 
int ge_load_image (struct ge *ge, const uint8_t *image, size_t size, uint16_t origin)
 Write a flat image into core at origin, priming the parity store.
 
void ge_enter (struct ge *ge, uint16_t entry)
 Force the sequencer into the alpha (fetch) phase at entry.
 
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 ge->mem[] directly).
 
void ge_seed_segment_bases (struct ge *ge)
 Seed the eight change/segment-base registers (mem[240+2N]) to identity bases N<<12.
 
int ge_run (struct ge *ge)
 Run the emulator.
 
int ge_run_pulse (struct ge *ge)
 Run a single pulse (i.e. a single GE "mastri" clock periods)
 
int ge_run_cycle (struct ge *ge)
 Run all GE "mastri" clock periods until next clock cycle.
 
void ge_clear (struct ge *ge)
 Emulate the press of the "clear" button in the console.
 
void ge_load (struct ge *ge)
 Emulate the press of the "load" button in the console.
 
void ge_load_1 (struct ge *ge)
 Emulate the press of the "load 1" button in the console.
 
void ge_load_2 (struct ge *ge)
 Emulate the press of the "load 2" button in the console.
 
void ge_start (struct ge *ge)
 Emulate the press of the "start" button in the console.
 
void pulse (struct ge *ge)
 
int ge_register_peri (struct ge *ge, struct ge_peri *p)
 
void fsn_last_clock (struct ge *ge)
 Commit the future state.
 
void connectors_first_clock (struct ge *ge)
 
const char * ge_clock_name (enum clock c)
 The clock period name name.
 
void ge_print_registers_verbose (struct ge *ge)
 
static uint8_t ge_halted (const struct ge *ge)
 Is the CPU stopped?
 
void ge_log_options (struct ge *ge)
 Report the strapped configuration and every level it produces (LOG_DEBUG).
 

Macro Definition Documentation

◆ CLOCK_PERIOD

#define CLOCK_PERIOD   14000 /* in usec, interval between pulse lines */

Definition at line 11 of file ge.h.

◆ ENUMERATE_CLOCKS

#define ENUMERATE_CLOCKS
Value:
X(TO00) \
X(TO10) \
X(TO11) \
X(TO15) \
X(TO19) \
X(TO20) \
X(TO25) \
X(TO30) \
X(TO40) \
X(TO50) \
X(TO50_1) \
X(TO60) \
X(TO64) \
X(TO65) \
X(TO70) \
X(TO80) \
X(TO89) \
X(TO90) \
X(TI05) \
X(TI06) \
X(TI10) \
X(END_OF_STATUS)
#define X(name)
Definition ge.h:39

Definition at line 14 of file ge.h.

◆ MEM_SIZE

#define MEM_SIZE   65536

Definition at line 12 of file ge.h.

◆ X

#define X (   name)    name ,

Definition at line 39 of file ge.h.

Typedef Documentation

◆ on_pulse_cb

typedef void(* on_pulse_cb) (struct ge *)

Definition at line 872 of file ge.h.

Enumeration Type Documentation

◆ clock

enum clock
Enumerator
ENUMERATE_CLOCKS 

Definition at line 38 of file ge.h.

◆ ge_pont

enum ge_pont

Backplane option connectors and the maintenance LAMPS switch.

cp06 chapter 002 "VARIANTI E OPZIONI / CHANGE AND OPTION" (dwg 140 130 65 6). The machine is configured at FOUR backplane connector positions – E03, E04, F03, F04 – and by one switch on the maintenance panel. The position names decode in the cp08 card-layout scheme as <ROW><CARD>, so E04 is row E card 04, and cp08 pp11-12 independently confirm which signals land on each. See docs/hardware-options.md for the tables and for what to probe on a physical machine.

Enumerator
PONT_NONE 
PONT_2N 
PONT_2P 

Definition at line 139 of file ge.h.

◆ knot_ni_source

Enumerator
NS_ZERO 
NS_CN1 
NS_CN2 
NS_CN3 
NS_CN4 
NS_RO1 
NS_RO2 
NS_UA2 
NS_UA1 

Definition at line 104 of file ge.h.

Function Documentation

◆ connectors_first_clock()

void connectors_first_clock ( struct ge ge)

Definition at line 566 of file ge.c.

◆ fsn_last_clock()

void fsn_last_clock ( struct ge ge)

Commit the future state.

Transfers the results of the future state network in the various selectors. For now it's an ad hoc behaviour, not described in detail in the currently available docs.

Definition at line 574 of file ge.c.

◆ ge_clear()

void ge_clear ( struct ge ge)

Emulate the press of the "clear" button in the console.

Definition at line 137 of file ge.c.

◆ ge_clock_name()

const char * ge_clock_name ( enum clock  c)

The clock period name name.

Returns the string destribing the clock period

Definition at line 433 of file ge.c.

◆ ge_deinit()

int ge_deinit ( struct ge ge)

Deinitialize the emulator.

Definition at line 560 of file ge.c.

◆ ge_enter()

void ge_enter ( struct ge ge,
uint16_t  entry 
)

Force the sequencer into the alpha (fetch) phase at entry.

NOT a machine operation – no console control does this. Test scaffolding for starting a fragment mid-machine without a deck.

Definition at line 355 of file ge.c.

◆ ge_halted()

static uint8_t ge_halted ( const struct ge ge)
inlinestatic

Is the CPU stopped?

ALTO is the hardware stop flip-flop (cpu fo.97/98): it gates RIA0, so while it is set the CPU is attributed no work cycles. The delay line keeps turning and the channels keep running – a halted GE-120 still drives its panel – so a front end that models the whole machine (the wasm console) should keep cycling and simply watch this; a batch front end that only cares about the program uses it to end the run.

There used to be a separate halted field alongside it. It was redundant and disagreed with ALTO in both directions: set at init while ALTO was clear, cleared by ge_clear() while ALTO was set, and – the actual bug – left clear by every operator stop (ACOV/ACON, PAPA, PATE), so the CLI run loop kept spinning against a frozen CPU.

Definition at line 929 of file ge.h.

◆ ge_init()

void ge_init ( struct ge ge)

Initialize the emulator.

Definition at line 14 of file ge.c.

◆ ge_load()

void ge_load ( struct ge ge)

Emulate the press of the "load" button in the console.

Definition at line 362 of file ge.c.

◆ ge_load_1()

void ge_load_1 ( struct ge ge)

Emulate the press of the "load 1" button in the console.

Definition at line 372 of file ge.c.

◆ ge_load_2()

void ge_load_2 ( struct ge ge)

Emulate the press of the "load 2" button in the console.

Definition at line 389 of file ge.c.

◆ ge_load_image()

int ge_load_image ( struct ge ge,
const uint8_t *  image,
size_t  size,
uint16_t  origin 
)

Write a flat image into core at origin, priming the parity store.

NOT a load path – programs reach the machine on cards. Test scaffolding, and the model behind the maintenance panel's memory key-in. Returns 0 on success, -1 on range error.

Definition at line 330 of file ge.c.

◆ ge_log_options()

void ge_log_options ( struct ge ge)

Report the strapped configuration and every level it produces (LOG_DEBUG).

Definition at line 93 of file ge.c.

◆ ge_mem_store8()

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 ge->mem[] directly).

Keeps parity coherent so a later read doesn't trip a false MEM CHECK.

Definition at line 317 of file ge.c.

◆ ge_print_registers_verbose()

void ge_print_registers_verbose ( struct ge ge)

Definition at line 459 of file ge.c.

◆ ge_register_peri()

int ge_register_peri ( struct ge ge,
struct ge_peri p 
)

Definition at line 55 of file peripherical.c.

◆ ge_run()

int ge_run ( struct ge ge)

Run the emulator.

◆ ge_run_cycle()

int ge_run_cycle ( struct ge ge)

Run all GE "mastri" clock periods until next clock cycle.

Definition at line 549 of file ge.c.

◆ ge_run_pulse()

int ge_run_pulse ( struct ge ge)

Run a single pulse (i.e. a single GE "mastri" clock periods)

Definition at line 493 of file ge.c.

◆ ge_seed_segment_bases()

void ge_seed_segment_bases ( struct ge ge)

Seed the eight change/segment-base registers (mem[240+2N]) to identity bases N<<12.

Called by ge_init at POWER-ON only – these are core cells and core retains across CLEAR. Re-apply by hand if a test image overwrote the 0x00F0-0x00FF window and wants the identity bases back.

Definition at line 294 of file ge.c.

◆ ge_start()

void ge_start ( struct ge ge)

Emulate the press of the "start" button in the console.

Definition at line 394 of file ge.c.

◆ pulse()

void pulse ( struct ge ge)

Definition at line 328 of file pulse.c.