GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Data Structures | Macros | Functions
cap.c File Reference
#include "cap.h"
#include "transcode.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

Go to the source code of this file.

Data Structures

struct  cap_card
 
struct  cap_deck
 

Macros

#define CAP_MIN_SCATTER_PREFIX_CARDS   4
 
#define CAP_MIN_ISOLATION_CARDS   8
 

Functions

static int deck_add_card (struct cap_deck *d)
 
static int card_add_col (struct cap_card *c, uint16_t val)
 
static int is_hex4 (const char *s)
 
static int parse_card_header (const char *line, int *card_num)
 
struct cap_deckcap_load (const char *path)
 
struct cap_deckcap_create (void)
 
int cap_num_cards (const struct cap_deck *d)
 
int cap_card_ncols (const struct cap_deck *d, int i)
 
const uint16_t * cap_card_columns (const struct cap_deck *d, int i)
 
int cap_append_card (struct cap_deck *d, const uint16_t *cols, int ncols)
 
int cap_save (const struct cap_deck *d, const char *path)
 
void cap_free (struct cap_deck *d)
 
static int scat_decode_card (const uint16_t *cols, int ncols, int mode, uint8_t out[80])
 
static char isolation_ident_char (uint16_t col)
 
static int isolation_ident_value (char a, char b, char c)
 
static int scat_detect_prefix (const struct cap_deck *d, int mode, uint8_t out[8], int *eligible_cards)
 
const char * cap_family_name (enum cap_deck_family family)
 
enum cap_deck_family cap_detect_family (const struct cap_deck *d, int mode, struct cap_deck_info *info)
 
int cap_load_scattered (const char *path, int mode, unsigned char *image, unsigned *lo, unsigned *hi)
 
int cap_load_isolation_stream (const char *path, unsigned char *image, unsigned org, unsigned *lo, unsigned *hi)
 

Macro Definition Documentation

◆ CAP_MIN_ISOLATION_CARDS

#define CAP_MIN_ISOLATION_CARDS   8

Definition at line 23 of file cap.c.

◆ CAP_MIN_SCATTER_PREFIX_CARDS

#define CAP_MIN_SCATTER_PREFIX_CARDS   4

Definition at line 22 of file cap.c.

Function Documentation

◆ cap_append_card()

int cap_append_card ( struct cap_deck d,
const uint16_t *  cols,
int  ncols 
)

Definition at line 221 of file cap.c.

◆ cap_card_columns()

const uint16_t * cap_card_columns ( const struct cap_deck d,
int  i 
)

Definition at line 214 of file cap.c.

◆ cap_card_ncols()

int cap_card_ncols ( const struct cap_deck d,
int  i 
)

Definition at line 207 of file cap.c.

◆ cap_create()

struct cap_deck * cap_create ( void  )

Definition at line 195 of file cap.c.

◆ cap_detect_family()

enum cap_deck_family cap_detect_family ( const struct cap_deck d,
int  mode,
struct cap_deck_info info 
)

Definition at line 386 of file cap.c.

◆ cap_family_name()

const char * cap_family_name ( enum cap_deck_family  family)

Definition at line 374 of file cap.c.

◆ cap_free()

void cap_free ( struct cap_deck d)

Definition at line 263 of file cap.c.

◆ cap_load()

struct cap_deck * cap_load ( const char *  path)

Definition at line 124 of file cap.c.

◆ cap_load_isolation_stream()

int cap_load_isolation_stream ( const char *  path,
unsigned char *  image,
unsigned  org,
unsigned *  lo,
unsigned *  hi 
)

Definition at line 505 of file cap.c.

◆ cap_load_scattered()

int cap_load_scattered ( const char *  path,
int  mode,
unsigned char *  image,
unsigned *  lo,
unsigned *  hi 
)

Definition at line 442 of file cap.c.

◆ cap_num_cards()

int cap_num_cards ( const struct cap_deck d)

Definition at line 200 of file cap.c.

◆ cap_save()

int cap_save ( const struct cap_deck d,
const char *  path 
)

Definition at line 238 of file cap.c.

◆ card_add_col()

static int card_add_col ( struct cap_card c,
uint16_t  val 
)
static

Definition at line 65 of file cap.c.

◆ deck_add_card()

static int deck_add_card ( struct cap_deck d)
static

Definition at line 46 of file cap.c.

◆ is_hex4()

static int is_hex4 ( const char *  s)
static

Definition at line 83 of file cap.c.

◆ isolation_ident_char()

static char isolation_ident_char ( uint16_t  col)
static

Definition at line 288 of file cap.c.

◆ isolation_ident_value()

static int isolation_ident_value ( char  a,
char  b,
char  c 
)
static

Definition at line 310 of file cap.c.

◆ parse_card_header()

static int parse_card_header ( const char *  line,
int *  card_num 
)
static

Definition at line 97 of file cap.c.

◆ scat_decode_card()

static int scat_decode_card ( const uint16_t *  cols,
int  ncols,
int  mode,
uint8_t  out[80] 
)
static

Definition at line 277 of file cap.c.

◆ scat_detect_prefix()

static int scat_detect_prefix ( const struct cap_deck d,
int  mode,
uint8_t  out[8],
int *  eligible_cards 
)
static

Definition at line 329 of file cap.c.