blob: 5510abf5b4548cac2e91c5d971d78f0c1e1eb3cc [file] [log] [blame] [raw]
Mark Pizzolato1e3586e2013-10-16 01:02:12 -07001/*
2 * $Id: vt11.h,v 1.8 2005/01/14 18:58:02 phil Exp $
3 * interface to VT11 simulator
4 * Phil Budne <phil@ultimate.com>
5 * September 16, 2003
6 * Substantially revised by Douglas A. Gwyn, 14 Jan. 2004
7 *
Mark Pizzolato94a06292016-02-08 16:43:36 -08008 * prerequisite: display.h
Mark Pizzolato1e3586e2013-10-16 01:02:12 -07009 */
10
11/*
12 * Copyright (c) 2003-2004, Philip L. Budne and Douglas A. Gwyn
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a
15 * copy of this software and associated documentation files (the "Software"),
16 * to deal in the Software without restriction, including without limitation
17 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 * and/or sell copies of the Software, and to permit persons to whom the
19 * Software is furnished to do so, subject to the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
28 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 *
31 * Except as contained in this notice, the names of the authors shall
32 * not be used in advertising or otherwise to promote the sale, use or
33 * other dealings in this Software without prior written authorization
34 * from the authors.
35 */
36
37#ifndef SIM_DEFS_H_
38typedef unsigned short uint16;
39typedef long int32;
40typedef unsigned long uint32;
41#endif /* SIM_DEFS_H_ */
42
43/*
44 * VT11 jumpers control character spacing; VS60 always uses VT11 normal.
45 * The VT11_CSP_{W,H} #defines establish the initial default character
46 * spacing; to change the VT11 simulation from these default values,
47 * set vt11_csp_{w,h} before calling any function named vt11_*.
48 */
49extern unsigned char vt11_csp_w; /* horizontal character spacing */
50#ifdef VT11_NARROW_OPT /* W3 or W6 installed */
51#define VT11_CSP_W 12
52#else /* VT11 normal; W4 or W5 installed */
53#define VT11_CSP_W 14
54#endif
55extern unsigned char vt11_csp_h; /* vertical character spacing */
56#ifdef VT11_TALL_OPT /* W3 or W4 installed */
57#define VT11_CSP_H 26
58#else /* VT11 normal; W5 or W6 installed */
59#define VT11_CSP_H 24
60#endif
61
62/*
63 * The DISPLAY_TYPE #define establishes the initial default display
64 * type; to change from the default display type, set vt11_display
65 * before calling any function named vt11_* (other than vt11_reset()).
66 */
67#ifndef DISPLAY_TYPE
68#define DISPLAY_TYPE DIS_VR17 /* default display type */
69#endif
70extern enum display_type vt11_display; /* DIS_VR{14,17,48} */
71/*
72 * The PIX_SCALE #define establishes the initial default display scale
73 * factor; to change from the default scale factor, set vt11_scale
74 * before calling any function named vt11_* (other than vt11_reset()).
75 */
76#ifndef PIX_SCALE
77#define PIX_SCALE RES_HALF /* default display scale factor */
78#endif
79extern int vt11_scale; /* RES_{FULL,HALF,QUARTER,EIGHTH} */
80/*
81 * When vt11_init (READONLY) is nonzero, it indicates that it is too late
82 * to change display parameters (type, scale, character spacing, etc.).
83 */
84extern unsigned char vt11_init; /* set after display_init() called */
85
86/* vt11.c simulates either a VT11 or a VT48(VS60), according to display type: */
87#define VS60 (vt11_display == DIS_VR48)
88#define VT11 (!VS60)
89
90/* The display file is an array of 16-bit words. */
91typedef uint16 vt11word;
92
93extern int32 vt11_get_dpc(void); /* read Display PC */
94extern int32 vt11_get_mpr(void); /* read mode parameter register */
95extern int32 vt11_get_xpr(void); /* read graphplot incr/X pos register */
96extern int32 vt11_get_ypr(void); /* read char code/Y pos register */
97extern int32 vt11_get_rr(void); /* read relocate register */
98extern int32 vt11_get_spr(void); /* read status parameter register */
99extern int32 vt11_get_xor(void); /* read X offset register */
100extern int32 vt11_get_yor(void); /* read Y offset register */
101extern int32 vt11_get_anr(void); /* read associative name register */
102extern int32 vt11_get_scr(void); /* read slave console/color register */
103extern int32 vt11_get_nr(void); /* read name register */
104extern int32 vt11_get_sdr(void); /* read stack data register */
105extern int32 vt11_get_str(void); /* read char string term register */
106extern int32 vt11_get_sar(void); /* read stack address/maint register */
107extern int32 vt11_get_zpr(void); /* read Z position register */
108extern int32 vt11_get_zor(void); /* read Z offset register */
109
110extern void vt11_set_dpc(uint16); /* write Display PC */
111extern void vt11_set_mpr(uint16); /* write mode parameter register */
112extern void vt11_set_xpr(uint16); /* write graphplot inc/X pos register */
113extern void vt11_set_ypr(uint16); /* write char code/Y pos register */
114extern void vt11_set_rr(uint16); /* write relocate register */
115extern void vt11_set_spr(uint16); /* write status parameter register */
116extern void vt11_set_xor(uint16); /* write X offset register */
117extern void vt11_set_yor(uint16); /* write Y offset register */
118extern void vt11_set_anr(uint16); /* write associative name register */
119extern void vt11_set_scr(uint16); /* write slave console/color register */
120extern void vt11_set_nr(uint16); /* write name register */
121extern void vt11_set_sdr(uint16); /* write stack data register */
122extern void vt11_set_str(uint16); /* write char string term register */
123extern void vt11_set_sar(uint16); /* write stack address/maint register */
124extern void vt11_set_zpr(uint16); /* write Z position register */
125extern void vt11_set_zor(uint16); /* write Z offset register */
126
Mark Pizzolatob8049642016-01-29 10:16:30 -0800127extern void vt11_reset(void *, int); /* reset the display processor */
128extern int vt11_cycle(int, int); /* perform a display processor cycle */
Mark Pizzolato1e3586e2013-10-16 01:02:12 -0700129
130/*
131 * callbacks from VT11/VS60 simulator (to SIMH PDP-11 VT driver, for example)
132 */
133extern int vt_fetch(uint32, vt11word *); /* get a display-file word */
134extern void vt_stop_intr(void); /* post a display-stop interrupt */
135extern void vt_lpen_intr(void); /* post a surface-related interrupt */
136extern void vt_char_intr(void); /* post a bad-char./timeout interrupt */
137extern void vt_name_intr(void); /* post a name-match interrupt */