GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Data Structures | Macros | Enumerations | Functions
tape.c File Reference
#include "tape.h"
#include "ge.h"
#include "connector34.h"
#include "log.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  tape_ctx
 

Macros

#define TAPE_IMAGE_MAX   (1u << 20) /* 1 MiB reel image cap */
 

Enumerations

enum  tape_order {
  TAPE_ORD_READ = 0x40 , TAPE_ORD_WRITE = 0x42 , TAPE_ORD_REWIND = 0x20 , TAPE_ORD_BACKSPACE = 0x24 ,
  TAPE_ORD_FORWARD = 0x28 , TAPE_ORD_ERASE = 0x2C , TAPE_ORD_WTM = 0x30
}
 

Functions

static int tape_claims (void *opaque, struct std_unitname un)
 
static long record_len (struct tape_ctx *t, size_t pos)
 
static std_reaction tape_command (struct ge *ge, void *opaque, struct std_unitname un, uint8_t order)
 
static std_reaction tape_transfer (struct ge *ge, void *opaque, struct std_unitname un, int dir, uint8_t *buf, uint16_t *len, uint16_t cap)
 
int tape_register (struct ge *ge, const char *image_path, uint8_t connector, uint8_t unit)
 

Macro Definition Documentation

◆ TAPE_IMAGE_MAX

#define TAPE_IMAGE_MAX   (1u << 20) /* 1 MiB reel image cap */

Definition at line 28 of file tape.c.

Enumeration Type Documentation

◆ tape_order

enum tape_order
Enumerator
TAPE_ORD_READ 
TAPE_ORD_WRITE 
TAPE_ORD_REWIND 
TAPE_ORD_BACKSPACE 
TAPE_ORD_FORWARD 
TAPE_ORD_ERASE 
TAPE_ORD_WTM 

Definition at line 31 of file tape.c.

Function Documentation

◆ record_len()

static long record_len ( struct tape_ctx t,
size_t  pos 
)
static

Definition at line 58 of file tape.c.

◆ tape_claims()

static int tape_claims ( void *  opaque,
struct std_unitname  un 
)
static

Definition at line 51 of file tape.c.

◆ tape_command()

static std_reaction tape_command ( struct ge ge,
void *  opaque,
struct std_unitname  un,
uint8_t  order 
)
static

Definition at line 65 of file tape.c.

◆ tape_register()

int tape_register ( struct ge ge,
const char *  image_path,
uint8_t  connector,
uint8_t  unit 
)

Definition at line 138 of file tape.c.

◆ tape_transfer()

static std_reaction tape_transfer ( struct ge ge,
void *  opaque,
struct std_unitname  un,
int  dir,
uint8_t *  buf,
uint16_t *  len,
uint16_t  cap 
)
static

Definition at line 98 of file tape.c.