GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Macros | Functions
ge.c File Reference
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include "ge.h"
#include "signals.h"
#include "msl.h"
#include "console_socket.h"
#include "peripherical.h"
#include "log.h"

Go to the source code of this file.

Macros

#define MAX_PROGRAM_STORAGE_WORDS   129
 
#define X(name)
 

Functions

void ge_init (struct ge *ge)
 Initialize the emulator.
 
void ge_clear (struct ge *ge)
 Emulate the press of the "clear" button in the console.
 
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_load_program (struct ge *ge, uint8_t *program, uint8_t size)
 Copy a program at the start of memory.
 
static uint8_t ge_odd_parity (uint8_t data)
 
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).
 
int ge_load_image (struct ge *ge, const uint8_t *image, size_t size, uint16_t origin)
 Load a flat image at origin (unified-format payload); origin-aware, not size-capped, primes the parity store.
 
void ge_enter (struct ge *ge, uint16_t entry)
 Enter execution at entry: seed PO and drop into the alpha (fetch) phase, bypassing the peripheral LOAD bootstrap (direct binary-load path).
 
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.
 
static void ge_print_well_known_states (uint8_t state)
 
const char * ge_clock_name (enum clock c)
 The clock period name name.
 
void ge_print_registers_nonverbose (struct ge *ge)
 
void ge_print_registers_verbose (struct ge *ge)
 
void ge_clock_increment (struct ge *ge)
 
uint8_t ge_clock_is_first (struct ge *ge)
 
uint8_t ge_clock_is_last (struct ge *ge)
 
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.
 
int ge_deinit (struct ge *ge)
 Deinitialize the emulator.
 
void connectors_first_clock (struct ge *ge)
 
void fsn_last_clock (struct ge *ge)
 Commit the future state.
 

Macro Definition Documentation

◆ MAX_PROGRAM_STORAGE_WORDS

#define MAX_PROGRAM_STORAGE_WORDS   129

Definition at line 12 of file ge.c.

◆ X

#define X (   name)
Value:
case name : \
return #name ;

Function Documentation

◆ connectors_first_clock()

void connectors_first_clock ( struct ge ge)

Definition at line 366 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 374 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 27 of file ge.c.

◆ ge_clock_increment()

void ge_clock_increment ( struct ge ge)

Definition at line 276 of file ge.c.

◆ ge_clock_is_first()

uint8_t ge_clock_is_first ( struct ge ge)

Definition at line 283 of file ge.c.

◆ ge_clock_is_last()

uint8_t ge_clock_is_last ( struct ge ge)

Definition at line 288 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 233 of file ge.c.

◆ ge_deinit()

int ge_deinit ( struct ge ge)

Deinitialize the emulator.

Definition at line 360 of file ge.c.

◆ ge_enter()

void ge_enter ( struct ge ge,
uint16_t  entry 
)

Enter execution at entry: seed PO and drop into the alpha (fetch) phase, bypassing the peripheral LOAD bootstrap (direct binary-load path).

Definition at line 155 of file ge.c.

◆ 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 162 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 172 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 189 of file ge.c.

◆ ge_load_image()

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

Load a flat image at origin (unified-format payload); origin-aware, not size-capped, primes the parity store.

Returns 0 on success, -1 on range error.

Definition at line 131 of file ge.c.

◆ ge_load_program()

int ge_load_program ( struct ge ge,
uint8_t *  program,
uint8_t  size 
)

Copy a program at the start of memory.

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 119 of file ge.c.

◆ ge_odd_parity()

static uint8_t ge_odd_parity ( uint8_t  data)
inlinestatic

Definition at line 108 of file ge.c.

◆ ge_print_registers_nonverbose()

void ge_print_registers_nonverbose ( struct ge ge)

Definition at line 246 of file ge.c.

◆ ge_print_registers_verbose()

void ge_print_registers_verbose ( struct ge ge)

Definition at line 259 of file ge.c.

◆ ge_print_well_known_states()

static void ge_print_well_known_states ( uint8_t  state)
static

Definition at line 203 of file ge.c.

◆ ge_run_cycle()

int ge_run_cycle ( struct ge ge)

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

Definition at line 349 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 293 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_clear; re-apply after a direct image load that may have overwritten the 0x00F0-0x00FF window.

Definition at line 83 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 194 of file ge.c.