GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Main Page
Related Pages
Topics
Data Structures
Files
File List
Globals
transcode.h
Go to the documentation of this file.
1
#ifndef TRANSCODE_H
2
#define TRANSCODE_H
3
/*
4
* transcode.h — GE-120 card-reader column transcoder.
5
*
6
* The card reader's transcoder converts each 80-column card to 80 GE machine
7
* bytes. Each column is represented in the .cap capture format as a 13-bit
8
* value (bits 12..0; bit 12 = Hollerith row 12 / Y-zone, bit 11 = row 11 /
9
* X-zone, bits 9..0 = rows 9..0 where row 0 is the 10-punch / zone-0).
10
*
11
* TC_NORMAL applies the empirically derived Hollerith→GE mapping.
12
* TC_BINARY passes raw data through (low 8 bits of the column value).
13
*/
14
15
#include <stdint.h>
16
17
/* Read modes the GE-120 reader supports. */
18
enum
transcode_mode
{
19
TC_NORMAL
,
/* apply the Hollerith→GE table */
20
TC_BINARY
,
/* raw passthrough: return (uint8_t)(column & 0xFF) */
21
TC_HEX
,
/* loader hex-nibble: nibble = sum of set row-bit positions (0..9) */
22
TC_COLBIN
/* by-pass column-binary: 1 col->1 byte, bit i <- card row B2R[i] */
23
};
24
25
/*
26
* transcode_column - transcode one 13-bit cap column value to a GE byte.
27
*
28
* @column: 13-bit hole pattern as stored in a cap_deck (from cap_card_columns).
29
* Values above bit 12 are ignored.
30
* @mode: TC_NORMAL or TC_BINARY.
31
*
32
* TC_NORMAL:
33
* Looks up the 13-bit value (column & 0x1FFF) in the derived table.
34
* Unobserved column values (not present in the funktionalcpu oracle) return
35
* 0x20 (GE space character), which is also the blank-column value.
36
*
37
* TC_BINARY:
38
* Returns the low 8 bits of the column value unchanged, providing a raw
39
* passthrough for binary-mode reads.
40
*
41
* Returns: GE machine byte (uint8_t).
42
*/
43
uint8_t
transcode_column
(uint16_t column,
enum
transcode_mode
mode);
44
45
#endif
/* TRANSCODE_H */
transcode_mode
transcode_mode
Definition
transcode.h:18
TC_NORMAL
@ TC_NORMAL
Definition
transcode.h:19
TC_BINARY
@ TC_BINARY
Definition
transcode.h:20
TC_COLBIN
@ TC_COLBIN
Definition
transcode.h:22
TC_HEX
@ TC_HEX
Definition
transcode.h:21
transcode_column
uint8_t transcode_column(uint16_t column, enum transcode_mode mode)
Definition
transcode.c:564
Generated by
1.9.8