mirror of
https://github.com/simh/simh.git
synced 2026-01-25 11:46:37 +00:00
PDP11, PDP1, TX-0: Added SDL based graphics support using sim_video.
Both VT11 and VS60 properly autoconfigure on the PDP11. PDP11 now runs Lunar Lander on all SDL supported platforms. Reworked refresh logic to not require internal delays in the display library
This commit is contained in:
@@ -151,7 +151,8 @@ static pascal OSStatus doKbdEvent ( EventHandlerCallRef handlerRef,
|
||||
int ws_init ( char *crtname, /* crt type name */
|
||||
int xp, /* screen size in pixels */
|
||||
int yp,
|
||||
int colors ) /* colors to support (not used) */
|
||||
int colors, /* colors to support (not used) */
|
||||
void *dptr)
|
||||
{
|
||||
WindowAttributes windowAttrs;
|
||||
Rect r;
|
||||
@@ -217,6 +218,10 @@ int ws_init ( char *crtname, /* crt type name */
|
||||
return (1);
|
||||
}
|
||||
|
||||
void ws_shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
void *ws_color_black (void)
|
||||
{
|
||||
return (&blckColor);
|
||||
|
||||
@@ -589,12 +589,14 @@ display_age(int t, /* simulated us since last call */
|
||||
{
|
||||
struct point *p;
|
||||
static int elapsed = 0;
|
||||
static int refresh_elapsed = 0; /* in units of DELAY_UNIT bounded by refresh_interval */
|
||||
int changed;
|
||||
|
||||
if (!initialized && !display_init(DISPLAY_TYPE, PIX_SCALE))
|
||||
if (!initialized && !display_init(DISPLAY_TYPE, PIX_SCALE, NULL))
|
||||
return 0;
|
||||
|
||||
display_delay(t, slowdown);
|
||||
if (slowdown)
|
||||
display_delay(t, slowdown);
|
||||
|
||||
changed = 0;
|
||||
|
||||
@@ -605,6 +607,12 @@ display_age(int t, /* simulated us since last call */
|
||||
t = elapsed / DELAY_UNIT;
|
||||
elapsed %= DELAY_UNIT;
|
||||
|
||||
++refresh_elapsed;
|
||||
if (refresh_elapsed >= refresh_interval) {
|
||||
display_sync ();
|
||||
refresh_elapsed = 0;
|
||||
}
|
||||
|
||||
while ((p = head->next) != head) {
|
||||
int x, y;
|
||||
|
||||
@@ -717,7 +725,7 @@ display_point(int x, /* 0..xpixels (unscaled) */
|
||||
{
|
||||
long lx, ly;
|
||||
|
||||
if (!initialized && !display_init(DISPLAY_TYPE, PIX_SCALE))
|
||||
if (!initialized && !display_init(DISPLAY_TYPE, PIX_SCALE, NULL))
|
||||
return 0;
|
||||
|
||||
/* scale x and y to the displayed number of pixels */
|
||||
@@ -828,7 +836,7 @@ find_type(enum display_type type)
|
||||
}
|
||||
|
||||
int
|
||||
display_init(enum display_type type, int sf)
|
||||
display_init(enum display_type type, int sf, void *dptr)
|
||||
{
|
||||
static int init_failed = 0;
|
||||
struct display *dp;
|
||||
@@ -924,7 +932,7 @@ display_init(enum display_type type, int sf)
|
||||
if (!points)
|
||||
goto failed;
|
||||
|
||||
if (!ws_init(dp->name, xpixels, ypixels, ncolors))
|
||||
if (!ws_init(dp->name, xpixels, ypixels, ncolors, dptr))
|
||||
goto failed;
|
||||
|
||||
phosphor_init(dp->color0->phosphors, dp->color0->nphosphors, 0);
|
||||
@@ -950,7 +958,8 @@ display_reset(void)
|
||||
void
|
||||
display_sync(void)
|
||||
{
|
||||
ws_sync();
|
||||
ws_poll (NULL, 0);
|
||||
ws_sync ();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -58,7 +58,7 @@ enum display_type {
|
||||
* must be called before first call to display_age()
|
||||
* (but called implicitly by display_point())
|
||||
*/
|
||||
extern int display_init(enum display_type, int scale);
|
||||
extern int display_init(enum display_type, int scale, void *dptr);
|
||||
|
||||
/* return size of virtual display */
|
||||
extern int display_xpoints(void);
|
||||
@@ -97,6 +97,7 @@ extern int display_point(int,int,int,int);
|
||||
/*
|
||||
* force window system to output bits to screen;
|
||||
* call after adding points, or aging the screen
|
||||
* collect any window system input (mouse or keyboard)
|
||||
*/
|
||||
extern void display_sync(void);
|
||||
|
||||
|
||||
422
display/sim_ws.c
Normal file
422
display/sim_ws.c
Normal file
@@ -0,0 +1,422 @@
|
||||
/*
|
||||
* simh sim_video support for XY display simulator
|
||||
* Mark Pizzolato <mark@infocomm.com>
|
||||
* January 2016
|
||||
* Based on win32.c module by Phil Budne
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016, Mark Pizzolato
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the names of the authors shall
|
||||
* not be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in this Software without prior written authorization
|
||||
* from the authors.
|
||||
*/
|
||||
|
||||
/*
|
||||
* BUGS:
|
||||
* Does not allow you to close display window;
|
||||
* would need to tear down both system, and system independent data.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sim_video.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ws.h"
|
||||
#include "xy.h"
|
||||
|
||||
#ifndef PIX_SIZE
|
||||
#define PIX_SIZE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* light pen location
|
||||
* see ws.h for full description
|
||||
*/
|
||||
int ws_lp_x = -1;
|
||||
int ws_lp_y = -1;
|
||||
|
||||
static int xpixels, ypixels;
|
||||
static int pix_size = PIX_SIZE;
|
||||
static char *window_name;
|
||||
static uint32 *colors = NULL;
|
||||
static uint32 ncolors = 0, size_colors = 0;
|
||||
static uint32 *surface = NULL;
|
||||
typedef struct cursor {
|
||||
Uint8 *data;
|
||||
Uint8 *mask;
|
||||
int width;
|
||||
int height;
|
||||
int hot_x;
|
||||
int hot_y;
|
||||
} CURSOR;
|
||||
|
||||
static CURSOR *arrow_cursor;
|
||||
static CURSOR *cross_cursor;
|
||||
|
||||
|
||||
static int
|
||||
map_key(int k)
|
||||
{
|
||||
switch (k) {
|
||||
case SIM_KEY_0: return '0';
|
||||
case SIM_KEY_1: return '1';
|
||||
case SIM_KEY_2: return '2';
|
||||
case SIM_KEY_3: return '3';
|
||||
case SIM_KEY_4: return '4';
|
||||
case SIM_KEY_5: return '5';
|
||||
case SIM_KEY_6: return '6';
|
||||
case SIM_KEY_7: return '7';
|
||||
case SIM_KEY_8: return '8';
|
||||
case SIM_KEY_9: return '9';
|
||||
case SIM_KEY_A: return 'a';
|
||||
case SIM_KEY_B: return 'b';
|
||||
case SIM_KEY_C: return 'c';
|
||||
case SIM_KEY_D: return 'd';
|
||||
case SIM_KEY_E: return 'e';
|
||||
case SIM_KEY_F: return 'f';
|
||||
case SIM_KEY_G: return 'g';
|
||||
case SIM_KEY_H: return 'h';
|
||||
case SIM_KEY_I: return 'i';
|
||||
case SIM_KEY_J: return 'j';
|
||||
case SIM_KEY_K: return 'k';
|
||||
case SIM_KEY_L: return 'l';
|
||||
case SIM_KEY_M: return 'm';
|
||||
case SIM_KEY_N: return 'n';
|
||||
case SIM_KEY_O: return 'o';
|
||||
case SIM_KEY_P: return 'p';
|
||||
case SIM_KEY_Q: return 'q';
|
||||
case SIM_KEY_R: return 'r';
|
||||
case SIM_KEY_S: return 's';
|
||||
case SIM_KEY_T: return 't';
|
||||
case SIM_KEY_U: return 'u';
|
||||
case SIM_KEY_V: return 'v';
|
||||
case SIM_KEY_W: return 'w';
|
||||
case SIM_KEY_X: return 'x';
|
||||
case SIM_KEY_Y: return 'y';
|
||||
case SIM_KEY_Z: return 'z';
|
||||
case SIM_KEY_BACKQUOTE: return '`';
|
||||
case SIM_KEY_MINUS: return '-';
|
||||
case SIM_KEY_EQUALS: return '=';
|
||||
case SIM_KEY_LEFT_BRACKET: return '[';
|
||||
case SIM_KEY_RIGHT_BRACKET: return ']';
|
||||
case SIM_KEY_SEMICOLON: return ';';
|
||||
case SIM_KEY_SINGLE_QUOTE: return '\'';
|
||||
case SIM_KEY_BACKSLASH: return '\\';
|
||||
case SIM_KEY_LEFT_BACKSLASH: return '\\';
|
||||
case SIM_KEY_COMMA: return ',';
|
||||
case SIM_KEY_PERIOD: return '.';
|
||||
case SIM_KEY_SLASH: return '/';
|
||||
case SIM_KEY_BACKSPACE: return '\b';
|
||||
case SIM_KEY_TAB: return '\t';
|
||||
case SIM_KEY_ENTER: return '\r';
|
||||
case SIM_KEY_SPACE: return ' ';
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
int
|
||||
ws_poll(int *valp, int maxus)
|
||||
{
|
||||
SIM_MOUSE_EVENT mev;
|
||||
SIM_KEY_EVENT kev;
|
||||
|
||||
if (maxus > 1000)
|
||||
sim_os_ms_sleep (maxus/1000);
|
||||
|
||||
if (SCPE_OK == vid_poll_mouse (&mev)) {
|
||||
unsigned char old_lp_sw = display_lp_sw;
|
||||
|
||||
if (display_lp_sw = mev.b1_state) {
|
||||
ws_lp_x = mev.x_pos;
|
||||
ws_lp_y = (ypixels - 1) - mev.y_pos; /* range 0 - (ypixels-1) */
|
||||
/* convert to display coordinates */
|
||||
ws_lp_x /= pix_size;
|
||||
ws_lp_y /= pix_size;
|
||||
if (!old_lp_sw && !display_tablet)
|
||||
vid_set_cursor (1, cross_cursor->width, cross_cursor->height, cross_cursor->data, cross_cursor->mask, cross_cursor->hot_x, cross_cursor->hot_y);
|
||||
}
|
||||
else {
|
||||
ws_lp_x = ws_lp_y = -1;
|
||||
if (old_lp_sw && !display_tablet)
|
||||
vid_set_cursor (1, arrow_cursor->width, arrow_cursor->height, arrow_cursor->data, arrow_cursor->mask, arrow_cursor->hot_x, arrow_cursor->hot_y);
|
||||
}
|
||||
vid_set_cursor_position (mev.x_pos, mev.y_pos);
|
||||
}
|
||||
if (SCPE_OK == vid_poll_kb (&kev)) {
|
||||
switch (kev.state) {
|
||||
case SIM_KEYPRESS_DOWN:
|
||||
case SIM_KEYPRESS_REPEAT:
|
||||
display_keydown(map_key(kev.key));
|
||||
break;
|
||||
case SIM_KEYPRESS_UP:
|
||||
display_keyup(map_key(kev.key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* XPM */
|
||||
static const char *arrow[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 16 16 3 1",
|
||||
/* colors */
|
||||
"X c #000000", /* black */
|
||||
". c #ffffff", /* white */
|
||||
" c None",
|
||||
/* pixels */
|
||||
"X ",
|
||||
"XX ",
|
||||
"X.X ",
|
||||
"X..X ",
|
||||
"X...X ",
|
||||
"X....X ",
|
||||
"X.....X ",
|
||||
"X......X ",
|
||||
"X.......X ",
|
||||
"X........X ",
|
||||
"X.....XXXXX ",
|
||||
"X..X..X ",
|
||||
"X.X X..X ",
|
||||
"XX X..X ",
|
||||
"X X..X ",
|
||||
" XX ",
|
||||
};
|
||||
|
||||
/* XPM */
|
||||
static const char *cross[] = {
|
||||
/* width height num_colors chars_per_pixel hot_x hot_y*/
|
||||
" 16 16 3 1 7 7",
|
||||
/* colors */
|
||||
"X c #000000", /* black */
|
||||
". c #ffffff", /* white */
|
||||
" c None",
|
||||
/* pixels */
|
||||
" XXXX ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
"XXXXXXX..XXXXXXX",
|
||||
"X..............X",
|
||||
"X..............X",
|
||||
"XXXXXXX..XXXXXXX",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" X..X ",
|
||||
" XXXX ",
|
||||
"7,7"
|
||||
};
|
||||
|
||||
static CURSOR *ws_create_cursor(const char *image[])
|
||||
{
|
||||
int byte, bit, row, col;
|
||||
Uint8 *data = NULL;
|
||||
Uint8 *mask = NULL;
|
||||
char black, white, transparent;
|
||||
CURSOR *result = NULL;
|
||||
int width, height, colors, cpp;
|
||||
int hot_x = 0, hot_y = 0;
|
||||
|
||||
if (4 > sscanf(image[0], "%d %d %d %d %d %d",
|
||||
&width, &height, &colors, &cpp, &hot_x, &hot_y))
|
||||
return result;
|
||||
if ((cpp != 1) || (0 != width%8) || (colors != 3))
|
||||
return result;
|
||||
black = image[1][0];
|
||||
white = image[2][0];
|
||||
transparent = image[3][0];
|
||||
data = (Uint8 *)calloc (1, (width / 8) * height);
|
||||
mask = (Uint8 *)calloc (1, (width / 8) * height);
|
||||
if (!data || !mask) {
|
||||
free (data);
|
||||
free (mask);
|
||||
return result;
|
||||
}
|
||||
bit = 7;
|
||||
byte = 0;
|
||||
for (row=0; row<height; ++row) {
|
||||
for (col=0; col<width; ++col) {
|
||||
if (image[colors+1+row][col] == black) {
|
||||
data[byte] |= (1 << bit);
|
||||
mask[byte] |= (1 << bit);
|
||||
}
|
||||
else
|
||||
if (image[colors+1+row][col] == white) {
|
||||
mask[byte] |= (1 << bit);
|
||||
}
|
||||
else
|
||||
if (image[colors+1+row][col] != transparent) {
|
||||
free (data);
|
||||
free (mask);
|
||||
return result;
|
||||
}
|
||||
--bit;
|
||||
if (bit < 0) {
|
||||
++byte;
|
||||
bit = 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
result = calloc (1, sizeof(*result));
|
||||
if (result) {
|
||||
result->data = data;
|
||||
result->mask = mask;
|
||||
result->width = width;
|
||||
result->height = height;
|
||||
result->hot_x = hot_x;
|
||||
result->hot_y = hot_y;
|
||||
}
|
||||
else {
|
||||
free (data);
|
||||
free (mask);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void ws_free_cursor (CURSOR *cursor)
|
||||
{
|
||||
if (!cursor)
|
||||
return;
|
||||
free (cursor->data);
|
||||
free (cursor->mask);
|
||||
free (cursor);
|
||||
}
|
||||
|
||||
/* called from display layer on first display op */
|
||||
int
|
||||
ws_init(char *name, int xp, int yp, int colors, void *dptr)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
arrow_cursor = ws_create_cursor (arrow);
|
||||
cross_cursor = ws_create_cursor (cross);
|
||||
xpixels = xp;
|
||||
ypixels = yp;
|
||||
window_name = name;
|
||||
surface = realloc (surface, xpixels*ypixels*sizeof(*surface));
|
||||
for (i=0; i<xpixels*ypixels; i++)
|
||||
surface[i] = vid_mono_palette[0];
|
||||
ret = (0 == vid_open (dptr, name, xp*pix_size, yp*pix_size, 0));
|
||||
if (ret)
|
||||
vid_set_cursor (1, arrow_cursor->width, arrow_cursor->height, arrow_cursor->data, arrow_cursor->mask, arrow_cursor->hot_x, arrow_cursor->hot_y);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
ws_shutdown(void)
|
||||
{
|
||||
ws_free_cursor(arrow_cursor);
|
||||
ws_free_cursor(cross_cursor);
|
||||
vid_close();
|
||||
}
|
||||
|
||||
void *
|
||||
ws_color_rgb(int r, int g, int b)
|
||||
{
|
||||
uint32 color, i;
|
||||
|
||||
color = sim_end ? (0xFF000000 | ((r & 0xFF00) << 8) | (g & 0xFF00) | ((b & 0xFF00) >> 8)) : (0x000000FF | (r & 0xFF00) | ((g & 0xFF00) << 8) | ((b & 0xFF00) << 16));
|
||||
for (i=0; i<ncolors; i++) {
|
||||
if (colors[i] == color)
|
||||
return &colors[i];
|
||||
}
|
||||
if (ncolors == size_colors) {
|
||||
colors = realloc (colors, (ncolors + 1000) * sizeof (*colors));
|
||||
size_colors += 1000;
|
||||
if (size_colors == 1000) {
|
||||
colors[0] = vid_mono_palette[0];
|
||||
colors[1] = vid_mono_palette[1];
|
||||
ncolors = 2;
|
||||
}
|
||||
}
|
||||
colors[ncolors] = color;
|
||||
++ncolors;
|
||||
return (void *)&colors[ncolors-1];
|
||||
}
|
||||
|
||||
void *
|
||||
ws_color_black(void)
|
||||
{
|
||||
return (void *)&vid_mono_palette[0];
|
||||
}
|
||||
|
||||
void *
|
||||
ws_color_white(void)
|
||||
{
|
||||
return (void *)&vid_mono_palette[1];
|
||||
}
|
||||
|
||||
void
|
||||
ws_display_point(int x, int y, void *color)
|
||||
{
|
||||
uint32 *brush = (uint32 *)color;
|
||||
|
||||
if (x > xpixels || y > ypixels)
|
||||
return;
|
||||
|
||||
y = ypixels - 1 - y; /* invert y, top left origin */
|
||||
|
||||
if (brush == NULL)
|
||||
brush = ws_color_black ();
|
||||
if (pix_size > 1) {
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<pix_size; i++)
|
||||
for (j=0; j<pix_size; j++)
|
||||
surface[(y + i)*xpixels + x + j] = *brush;
|
||||
}
|
||||
else
|
||||
surface[y*xpixels + x] = *brush;
|
||||
}
|
||||
|
||||
void
|
||||
ws_sync(void) {
|
||||
vid_draw (0, 0, xpixels, ypixels, surface);
|
||||
vid_refresh ();
|
||||
}
|
||||
|
||||
void
|
||||
ws_beep(void) {
|
||||
vid_beep ();
|
||||
}
|
||||
|
||||
unsigned long
|
||||
os_elapsed(void)
|
||||
{
|
||||
static int new;
|
||||
unsigned long ret;
|
||||
static uint32 t[2];
|
||||
|
||||
t[new] = sim_os_msec();
|
||||
if (t[!new] == 0)
|
||||
ret = ~0L; /* +INF */
|
||||
else
|
||||
ret = (t[new] - t[!new]) * 1000;/* usecs */
|
||||
new = !new; /* Ecclesiastes III */
|
||||
return ret;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void
|
||||
t2(void) {
|
||||
int x, y;
|
||||
|
||||
display_init(TEST_DIS, TEST_RES);
|
||||
display_init(TEST_DIS, TEST_RES, NULL);
|
||||
for (x = INTENSITIES-1; x >= 0; x--) {
|
||||
for (y = 0; y < 20; y++) {
|
||||
ws_display_point(x*4, y, x, 0);
|
||||
@@ -160,7 +160,7 @@ void
|
||||
t3(void) {
|
||||
int x, y;
|
||||
|
||||
display_init(TEST_DIS, TEST_RES);
|
||||
display_init(TEST_DIS, TEST_RES, NULL);
|
||||
for (x = DISPLAY_INT_MAX; x >= 0; x--) {
|
||||
for (y = 0; y < 20; y++) {
|
||||
display_point(x*2, y*2, x, 0);
|
||||
@@ -175,7 +175,7 @@ t3(void) {
|
||||
|
||||
int
|
||||
main(void) {
|
||||
if (!display_init(TEST_DIS, TEST_RES))
|
||||
if (!display_init(TEST_DIS, TEST_RES, NULL))
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
cpu_set_switches(04000UL); /* classic starting value */
|
||||
|
||||
176
display/vt11.c
176
display/vt11.c
@@ -128,10 +128,26 @@
|
||||
/* extract a 1-bit field */
|
||||
#define TESTBIT(W,B) (((W) & BITMASK(B)) != 0)
|
||||
|
||||
static void *vt11_dptr;
|
||||
static int vt11_dbit;
|
||||
|
||||
#ifdef DEBUG_VT11
|
||||
#define DEBUGF(X) do { printf X; fflush(stdout); } while (0)
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define DEVICE void
|
||||
|
||||
#define DBG_CALL 1
|
||||
int vt11_debug;
|
||||
|
||||
extern void _sim_debug (int dbits, DEVICE* dptr, const char* fmt, ...);
|
||||
|
||||
#define DEBUGF(...) do {if (vt11_debug & DBG_CALL) { _sim_debug (vt11_dbit, vt11_dptr, ## __VA_ARGS__); };} while (0)
|
||||
|
||||
#else
|
||||
#define DEBUGF(X)
|
||||
|
||||
#define DEBUGF(...)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -194,8 +210,8 @@
|
||||
enum display_type vt11_display = DISPLAY_TYPE; /* DIS_VR{14,17,48} */
|
||||
int vt11_scale = PIX_SCALE; /* RES_{FULL,HALF,QUARTER,EIGHTH} */
|
||||
unsigned char vt11_init = 0; /* set after display_init() called */
|
||||
#define INIT { if (!vt11_init) { display_init(vt11_display, vt11_scale); \
|
||||
vt11_init = 1; vt11_reset(); } }
|
||||
#define INIT { if (!vt11_init) { display_init(vt11_display, vt11_scale, vt11_dptr); \
|
||||
vt11_init = 1; vt11_reset(vt11_dptr, vt11_dbit); } }
|
||||
|
||||
/* state visible to host */
|
||||
|
||||
@@ -638,7 +654,7 @@ void
|
||||
vt11_set_dpc(uint16 d)
|
||||
{ INIT
|
||||
bdb = d; /* save all bits in case maint1 used */
|
||||
DEBUGF(("set DPC 0%06o\r\n", (unsigned)d));
|
||||
DEBUGF("set DPC 0%06o\r\n", (unsigned)d);
|
||||
/* Stack level is unaffected, except that stack_sel==037 goes to 040; this
|
||||
fudge is necessary to pass DZVSC test 3, which misleadingly calls it
|
||||
setting top-of-stack upon START (vt11_set_dpc(even)). If one instead
|
||||
@@ -728,7 +744,7 @@ vt11_get_xpr(void)
|
||||
void
|
||||
vt11_set_xpr(uint16 d)
|
||||
{ INIT
|
||||
DEBUGF(("set XPR: no effect\r\n"));
|
||||
DEBUGF("set XPR: no effect\r\n");
|
||||
}
|
||||
|
||||
int32
|
||||
@@ -743,7 +759,7 @@ vt11_get_ypr(void)
|
||||
void
|
||||
vt11_set_ypr(uint16 d)
|
||||
{ INIT
|
||||
DEBUGF(("set YPR: no effect\r\n"));
|
||||
DEBUGF("set YPR: no effect\r\n");
|
||||
}
|
||||
|
||||
/* All the remaining registers pertain to the VS60 only. */
|
||||
@@ -820,7 +836,7 @@ vt11_set_yor(uint16 d)
|
||||
int32
|
||||
vt11_get_anr(void)
|
||||
{ INIT
|
||||
DEBUGF(("get ANR: no effect\r\n"));
|
||||
DEBUGF("get ANR: no effect\r\n");
|
||||
return (search << 12) | assoc_name; /* [garbage] */
|
||||
}
|
||||
|
||||
@@ -896,7 +912,7 @@ vt11_get_nr(void)
|
||||
void
|
||||
vt11_set_nr(uint16 d)
|
||||
{ INIT
|
||||
DEBUGF(("set NR: no effect\r\n"));
|
||||
DEBUGF("set NR: no effect\r\n");
|
||||
}
|
||||
|
||||
int32
|
||||
@@ -932,7 +948,7 @@ vt11_get_sdr(void)
|
||||
void
|
||||
vt11_set_sdr(uint16 d)
|
||||
{ INIT
|
||||
DEBUGF(("set SDR: no effect\r\n"));
|
||||
DEBUGF("set SDR: no effect\r\n");
|
||||
}
|
||||
|
||||
int32
|
||||
@@ -1010,7 +1026,7 @@ vt11_get_zpr(void)
|
||||
void
|
||||
vt11_set_zpr(uint16 d)
|
||||
{ INIT
|
||||
DEBUGF(("set ZPR: no effect\r\n"));
|
||||
DEBUGF("set ZPR: no effect\r\n");
|
||||
}
|
||||
|
||||
int32
|
||||
@@ -1039,8 +1055,13 @@ vt11_set_zor(uint16 d)
|
||||
}
|
||||
|
||||
void
|
||||
vt11_reset(void)
|
||||
vt11_reset(void *dev, int debug)
|
||||
{
|
||||
if (dev) {
|
||||
vt11_dptr = dev;
|
||||
vt11_dbit = debug;
|
||||
}
|
||||
|
||||
/* make sure display code has been initialized */
|
||||
if (!vt11_init) /* (SIMH invokes before display type is set) */
|
||||
return; /* wait until last moment */
|
||||
@@ -2021,7 +2042,7 @@ vector3(int i, int32 dx, int32 dy, int32 dz) /* unscaled display-file units */
|
||||
xpos = 010000L * adx / ady + 1; /* truncates */
|
||||
ypos = ady; /* according to DZVSC test 100 */
|
||||
}
|
||||
DEBUGF(("delta=0%o, tangent=0%o\r\n", xpos, ypos));
|
||||
DEBUGF("delta=0%o, tangent=0%o\r\n", xpos, ypos);
|
||||
xpos = PSCALE(xpos); /* compensates for eventual PNORM */
|
||||
ypos = PSCALE(ypos); /* compensates for eventual PNORM */
|
||||
}
|
||||
@@ -2078,7 +2099,7 @@ vector3(int i, int32 dx, int32 dy, int32 dz) /* unscaled display-file units */
|
||||
case 0: /* invisible */
|
||||
return;
|
||||
default:
|
||||
DEBUGF(("clip() bad return: %d\n", clip_vect));
|
||||
DEBUGF("clip() bad return: %d\n", clip_vect);
|
||||
case -1: /* visible, not clipped */
|
||||
clip_vect = 0;
|
||||
break; /* draw immediately */
|
||||
@@ -2174,10 +2195,10 @@ basic_vector(int i, int dir, int len) /* unscaled display-file units */
|
||||
dy = -len;
|
||||
break;
|
||||
default: /* "can't happen" */
|
||||
DEBUGF(("BUG: basic vector: illegal direction %d\r\n", dir));
|
||||
DEBUGF("BUG: basic vector: illegal direction %d\r\n", dir);
|
||||
return;
|
||||
}
|
||||
DEBUGF(("basic "));
|
||||
DEBUGF("basic ");
|
||||
vector2(i, dx, dy);
|
||||
}
|
||||
|
||||
@@ -3120,7 +3141,7 @@ vt11_cycle(int us, int slowdown)
|
||||
/*FALLTHRU*/
|
||||
case 010: /* Set Graphic Mode 1000 */
|
||||
if (VT11) {
|
||||
DEBUGF(("SGM 1000 IGNORED\r\n"));
|
||||
DEBUGF("SGM 1000 IGNORED\r\n");
|
||||
break;
|
||||
}
|
||||
/*FALLTHRU*/
|
||||
@@ -3131,34 +3152,34 @@ vt11_cycle(int us, int slowdown)
|
||||
case 4: /* Set Graphic Mode 0100 */
|
||||
case 5: /* Set Graphic Mode 0101 */
|
||||
case 6: /* Set Graphic Mode 0110 */
|
||||
DEBUGF(("Set Graphic Mode %u", (unsigned)mode_field));
|
||||
DEBUGF("Set Graphic Mode %u", (unsigned)mode_field);
|
||||
graphic_mode = mode_field;
|
||||
offset = 0;
|
||||
shift_out = 0; /* seems to be right */
|
||||
if (TESTBIT(inst,10)) {
|
||||
intensity = GETFIELD(inst,9,7);
|
||||
DEBUGF((" intensity=%d", (int)intensity));
|
||||
DEBUGF(" intensity=%d", (int)intensity);
|
||||
}
|
||||
if (TESTBIT(inst,6)) {
|
||||
lp0_intr_ena = TESTBIT(inst,5);
|
||||
DEBUGF((" lp0_intr_ena=%d", (int)lp0_intr_ena));
|
||||
DEBUGF(" lp0_intr_ena=%d", (int)lp0_intr_ena);
|
||||
}
|
||||
if (TESTBIT(inst,4)) {
|
||||
blink_ena = TESTBIT(inst,3);
|
||||
DEBUGF((" blink=%d", (int)blink_ena));
|
||||
DEBUGF(" blink=%d", (int)blink_ena);
|
||||
}
|
||||
if (TESTBIT(inst,2)) {
|
||||
line_type = GETFIELD(inst,1,0);
|
||||
DEBUGF((" line_type=%d", (int)line_type));
|
||||
DEBUGF(" line_type=%d", (int)line_type);
|
||||
}
|
||||
DEBUGF(("\r\n"));
|
||||
DEBUGF("\r\n");
|
||||
break;
|
||||
|
||||
case 012: /* 1010: Load Name Register */
|
||||
if (VT11)
|
||||
goto bad_ins;
|
||||
name = GETFIELD(inst,10,0);
|
||||
DEBUGF(("Load Name Register name=0%o\r\n", name));
|
||||
DEBUGF("Load Name Register name=0%o\r\n", name);
|
||||
{ static unsigned nmask[4] = { 0, 03777, 03770, 03600 };
|
||||
|
||||
if (search != 0 && ((name^assoc_name) & nmask[search]) == 0)
|
||||
@@ -3169,21 +3190,21 @@ vt11_cycle(int us, int slowdown)
|
||||
case 013: /* 1011: Load Status C */
|
||||
if (VT11)
|
||||
goto bad_ins;
|
||||
DEBUGF(("Load Status C"));
|
||||
DEBUGF("Load Status C");
|
||||
if (TESTBIT(inst,9)) {
|
||||
char_rotate = TESTBIT(inst,8);
|
||||
DEBUGF((" char_rotate=d", (int)char_rotate));
|
||||
DEBUGF(" char_rotate=d", (int)char_rotate);
|
||||
}
|
||||
if (TESTBIT(inst,7)) {
|
||||
cs_index = GETFIELD(inst,6,5); /* 0, 1, 2, 3 */
|
||||
char_scale = csi2csf[cs_index]; /* for faster CSCALE macro */
|
||||
DEBUGF((" cs_index=%d(x%d/4)", (int)cs_index, (int)char_scale));
|
||||
DEBUGF(" cs_index=%d(x%d/4)", (int)cs_index, (int)char_scale);
|
||||
}
|
||||
if (TESTBIT(inst,4)) {
|
||||
vector_scale = GETFIELD(inst,3,0);
|
||||
DEBUGF((" vector_scale=%d/4", (int)vector_scale));
|
||||
DEBUGF(" vector_scale=%d/4", (int)vector_scale);
|
||||
}
|
||||
DEBUGF(("\r\n"));
|
||||
DEBUGF("\r\n");
|
||||
break;
|
||||
|
||||
case 014: /* 1100__ */
|
||||
@@ -3199,7 +3220,7 @@ vt11_cycle(int us, int slowdown)
|
||||
jmpa:
|
||||
finish_jmpa = 0;
|
||||
DPC = inst & ~1;
|
||||
DEBUGF(("Display Jump Absolute 0%06o\r\n", (unsigned)inst));
|
||||
DEBUGF("Display Jump Absolute 0%06o\r\n", (unsigned)inst);
|
||||
break;
|
||||
|
||||
case 1: /* 110001: Display Jump Relative */
|
||||
@@ -3264,19 +3285,19 @@ vt11_cycle(int us, int slowdown)
|
||||
|
||||
case 015: /* 1101__ */
|
||||
if (VT11)
|
||||
DEBUGF(("Display NOP\r\n"));
|
||||
DEBUGF("Display NOP\r\n");
|
||||
else {
|
||||
op = GETFIELD(inst,10,9);
|
||||
switch (op) {
|
||||
|
||||
case 0: /* 110100: Load Scope Selection */
|
||||
/* also used as Display NOP */
|
||||
DEBUGF(("Load Scope Selection"));
|
||||
DEBUGF("Load Scope Selection");
|
||||
c = TESTBIT(inst,8);
|
||||
DEBUGF((" console=%d", c));
|
||||
DEBUGF(" console=%d", c);
|
||||
if (TESTBIT(inst,7)) {
|
||||
ez = TESTBIT(inst,6);
|
||||
DEBUGF((" blank=%d", (int)!ez));
|
||||
DEBUGF(" blank=%d", (int)!ez);
|
||||
if (c)
|
||||
int1_scope = (unsigned char)(ez & 0xFF);
|
||||
else
|
||||
@@ -3284,7 +3305,7 @@ vt11_cycle(int us, int slowdown)
|
||||
}
|
||||
if (TESTBIT(inst,5)) {
|
||||
ez = TESTBIT(inst,4);
|
||||
DEBUGF((" lp_intr_ena=%d", (int)ez));
|
||||
DEBUGF(" lp_intr_ena=%d", (int)ez);
|
||||
if (c)
|
||||
lp1_intr_ena = (unsigned char)(ez & 0xFF);
|
||||
else
|
||||
@@ -3292,52 +3313,54 @@ vt11_cycle(int us, int slowdown)
|
||||
}
|
||||
if (TESTBIT(inst,3)) {
|
||||
ez = TESTBIT(inst,2);
|
||||
DEBUGF((" lp_sw_intr_ena=%d", (int)ez));
|
||||
DEBUGF(" lp_sw_intr_ena=%d", (int)ez);
|
||||
if (c)
|
||||
lp1_sw_intr_ena = (unsigned char)(ez & 0xFF);
|
||||
else
|
||||
lp0_sw_intr_ena = (unsigned char)(ez & 0xFF);
|
||||
}
|
||||
DEBUGF(("\r\n"));
|
||||
DEBUGF("\r\n");
|
||||
break;
|
||||
|
||||
case 1: /* 110101: Display POP Not Restore */
|
||||
DEBUGF(("Display POP Not Restore\r\n"));
|
||||
DEBUGF("Display POP Not Restore\r\n");
|
||||
pop(0); /* sets new DPC as side effect */
|
||||
break;
|
||||
|
||||
case 2: /* 110110: Display POP Restore */
|
||||
DEBUGF(("Display POP Restore\r\n"));
|
||||
DEBUGF("Display POP Restore\r\n");
|
||||
pop(1); /* sets new DPC as side effect */
|
||||
break;
|
||||
|
||||
default: /* 110111: undocumented -- ignored? */
|
||||
DEBUGF(("Display NOP?\r\n"));
|
||||
DEBUGF("Display NOP?\r\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 016: /* 1110: Load Status A */
|
||||
DEBUGF(("Load Status A"));
|
||||
DEBUGF("Load Status A");
|
||||
internal_stop = TESTBIT(inst,10); /* 11101 Display Stop */
|
||||
if (internal_stop) {
|
||||
stopped = 1; /* (synchronous with display cycle) */
|
||||
DEBUGF((" stop"));
|
||||
DEBUGF(" stop");
|
||||
}
|
||||
if (TESTBIT(inst,9)) {
|
||||
stop_intr_ena = TESTBIT(inst,8);
|
||||
DEBUGF((" stop_intr_ena=%d", (int)stop_intr_ena));
|
||||
DEBUGF(" stop_intr_ena=%d", (int)stop_intr_ena);
|
||||
}
|
||||
if (TESTBIT(inst,7)) {
|
||||
lp_intensify = !TESTBIT(inst,6);
|
||||
DEBUGF((" lp_intensify=%d", (int)lp_intensify));
|
||||
DEBUGF(" lp_intensify=%d", (int)lp_intensify);
|
||||
}
|
||||
if (TESTBIT(inst,5)) {
|
||||
italics = TESTBIT(inst,4);
|
||||
DEBUGF((" italics=%d", (int)italics));
|
||||
DEBUGF(" italics=%d", (int)italics);
|
||||
}
|
||||
refresh_rate = GETFIELD(inst,VS60?3:2,2);
|
||||
DEBUGF((" refresh=%d", refresh_rate));
|
||||
DEBUGF(" refresh=%d", refresh_rate);
|
||||
if (sync_period != refresh_rate)
|
||||
DEBUGF("old sync_period=%d, new refresh=%d", sync_period, refresh_rate);
|
||||
switch (refresh_rate) {
|
||||
case 0: /* continuous */
|
||||
sync_period = 0;
|
||||
@@ -3357,46 +3380,46 @@ vt11_cycle(int us, int slowdown)
|
||||
}
|
||||
if (VS60 && TESTBIT(inst,1)) {
|
||||
menu = TESTBIT(inst,0);
|
||||
DEBUGF((" menu=%d", (int)menu));
|
||||
DEBUGF(" menu=%d", (int)menu);
|
||||
}
|
||||
DEBUGF(("\r\n"));
|
||||
DEBUGF("\r\n");
|
||||
break;
|
||||
|
||||
case 017: /* 1111_ */
|
||||
if (VS60 && TESTBIT(inst,10)) { /* 11111: Load Status BB */
|
||||
DEBUGF(("Load Status BB"));
|
||||
DEBUGF("Load Status BB");
|
||||
if (TESTBIT(inst,7)) {
|
||||
depth_cue_proc = TESTBIT(inst,6);
|
||||
DEBUGF((" depth_cue_proc=%d", (int)depth_cue_proc));
|
||||
DEBUGF(" depth_cue_proc=%d", (int)depth_cue_proc);
|
||||
}
|
||||
if (TESTBIT(inst,5)) {
|
||||
edge_intr_ena = TESTBIT(inst,4);
|
||||
DEBUGF((" edge_intr_ena=%d", (int)edge_intr_ena));
|
||||
DEBUGF(" edge_intr_ena=%d", (int)edge_intr_ena);
|
||||
}
|
||||
if (TESTBIT(inst,3)) {
|
||||
file_z_data = TESTBIT(inst,2);
|
||||
DEBUGF((" file_z_data=%d", (int)file_z_data));
|
||||
DEBUGF(" file_z_data=%d", (int)file_z_data);
|
||||
}
|
||||
if (TESTBIT(inst,1)) {
|
||||
char_escape = TESTBIT(inst,0);
|
||||
DEBUGF((" char_escape=%d", (int)char_escape));
|
||||
DEBUGF(" char_escape=%d", (int)char_escape);
|
||||
}
|
||||
} else { /* 11110: Load Status B */
|
||||
DEBUGF(("Load Status B"));
|
||||
DEBUGF("Load Status B");
|
||||
if (VS60 && TESTBIT(inst,9)) {
|
||||
color = GETFIELD(inst,8,7);
|
||||
DEBUGF((" color=%d", (int)color));
|
||||
DEBUGF(" color=%d", (int)color);
|
||||
}
|
||||
if (TESTBIT(inst,6)) {
|
||||
graphplot_step = GETFIELD(inst,5,0);
|
||||
DEBUGF((" graphplot_step=%d", (int)graphplot_step));
|
||||
DEBUGF(" graphplot_step=%d", (int)graphplot_step);
|
||||
}
|
||||
}
|
||||
DEBUGF(("\r\n"));
|
||||
DEBUGF("\r\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
bad_ins: DEBUGF(("SPARE COMMAND 0%o\r\n", mode_field));
|
||||
bad_ins: DEBUGF("SPARE COMMAND 0%o\r\n", mode_field);
|
||||
/* "display processor hangs" */
|
||||
DPC -= 2; /* hang around scene of crime */
|
||||
break;
|
||||
@@ -3423,17 +3446,17 @@ vt11_cycle(int us, int slowdown)
|
||||
word_number = 0;
|
||||
if (word_number == 0) {
|
||||
c = GETFIELD(inst,6,0);
|
||||
DEBUGF(("char1 %d (", c));
|
||||
DEBUGF((040 <= c && c < 0177 ? "'%c'" : "0%o", c));
|
||||
DEBUGF((")\r\n"));
|
||||
DEBUGF("char1 %d (", c);
|
||||
DEBUGF(040 <= c && c < 0177 ? "'%c'" : "0%o", c);
|
||||
DEBUGF(")\r\n");
|
||||
if (character(c)) /* POPR was done; end chars */
|
||||
break;
|
||||
MORE_DATA /* post any intrs now */
|
||||
}
|
||||
c = GETFIELD(inst,15,8);
|
||||
DEBUGF(("char2 %d (", c));
|
||||
DEBUGF((040 <= c && c < 0177 ? "'%c'" : "0%o", c));
|
||||
DEBUGF((")\r\n"));
|
||||
DEBUGF("char2 %d (", c);
|
||||
DEBUGF(040 <= c && c < 0177 ? "'%c'" : "0%o", c);
|
||||
DEBUGF(")\r\n");
|
||||
(void)character(c);
|
||||
break;
|
||||
|
||||
@@ -3459,7 +3482,7 @@ vt11_cycle(int us, int slowdown)
|
||||
i, (int)x, (int)y, (int)z));
|
||||
vector3(i, x, y, z);
|
||||
} else {
|
||||
DEBUGF(("short vector i%d (%d,%d)\r\n", i, (int)x, (int)y));
|
||||
DEBUGF("short vector i%d (%d,%d)\r\n", i, (int)x, (int)y);
|
||||
vector2(i, x, y);
|
||||
}
|
||||
break;
|
||||
@@ -3494,9 +3517,9 @@ vt11_cycle(int us, int slowdown)
|
||||
} else {
|
||||
if (ex)
|
||||
norot: /* undocumented and probably nonfunctional */
|
||||
DEBUGF(("ROTATE NOT SUPPORTED\r\n"));
|
||||
DEBUGF("ROTATE NOT SUPPORTED\r\n");
|
||||
else {
|
||||
DEBUGF(("long vector i%d (%d,%d)\r\n", i, (int)x, (int)y));
|
||||
DEBUGF("long vector i%d (%d,%d)\r\n", i, (int)x, (int)y);
|
||||
vector2(i, x, y);
|
||||
}
|
||||
}
|
||||
@@ -3535,7 +3558,7 @@ vt11_cycle(int us, int slowdown)
|
||||
if (szo)
|
||||
ez = -ez;
|
||||
if (offset) { /* OFFSET rather than POINT */
|
||||
DEBUGF(("offset (%d,%d,%d)\r\n", (int)ex,(int)ey,(int)ez));
|
||||
DEBUGF("offset (%d,%d,%d)\r\n", (int)ex,(int)ey,(int)ez);
|
||||
xoff = PSCALE(ex);
|
||||
yoff = PSCALE(ey);
|
||||
zoff = PSCALE(ez * 4); /* XXX include bits 1:0 ? */
|
||||
@@ -3550,13 +3573,13 @@ vt11_cycle(int us, int slowdown)
|
||||
}
|
||||
} else {
|
||||
if (offset) { /* (VS60) OFFSET rather than POINT */
|
||||
DEBUGF(("offset (%d,%d)\r\n", (int)ex, (int)ey));
|
||||
DEBUGF("offset (%d,%d)\r\n", (int)ex, (int)ey);
|
||||
xoff = PSCALE(ex);
|
||||
yoff = PSCALE(ey);
|
||||
s_xoff = (unsigned char)(sxo & 0xFF);
|
||||
s_yoff = (unsigned char)(syo & 0xFF);
|
||||
} else {
|
||||
DEBUGF(("point i%d (%d,%d)\r\n", i, (int)ex, (int)ey));
|
||||
DEBUGF("point i%d (%d,%d)\r\n", i, (int)ex, (int)ey);
|
||||
point2(i, VSCALE(ex) + xoff, VSCALE(ey) + yoff, VS60);
|
||||
}
|
||||
}
|
||||
@@ -3569,7 +3592,7 @@ vt11_cycle(int us, int slowdown)
|
||||
goto blv; /* (VS60) BLVECT rather than GRAPHX */
|
||||
else {
|
||||
ex = GETFIELD(inst,9,0);
|
||||
DEBUGF(("graphplot x (%d) i%d\r\n", (int)ex, i));
|
||||
DEBUGF("graphplot x (%d) i%d\r\n", (int)ex, i);
|
||||
ey = ypos + VSCALE(graphplot_step);
|
||||
/* VT48 ES says first datum doesn't increment Y; that's wrong */
|
||||
/* diagnostic DZVSD shows that "i" bit is ignored! */
|
||||
@@ -3589,7 +3612,7 @@ vt11_cycle(int us, int slowdown)
|
||||
basic_vector(i, (int)x, (int)y);
|
||||
} else {
|
||||
ey = GETFIELD(inst,9,0);
|
||||
DEBUGF(("graphplot y (%d) i%d\r\n", (int)ey, i));
|
||||
DEBUGF("graphplot y (%d) i%d\r\n", (int)ey, i);
|
||||
ex = xpos + VSCALE(graphplot_step);
|
||||
/* VT48 ES says first datum doesn't increment X; that's wrong */
|
||||
/* diagnostic DZVSD shows that "i" bit is ignored! */
|
||||
@@ -3620,7 +3643,7 @@ vt11_cycle(int us, int slowdown)
|
||||
point3(i, xpos + VSCALE(ex), ypos + VSCALE(ey),
|
||||
zpos + VSCALE(ez * 4), 1);
|
||||
} else {
|
||||
DEBUGF(("relative point i%d (%d,%d)\r\n", i, (int)ex, (int)ey));
|
||||
DEBUGF("relative point i%d (%d,%d)\r\n", i, (int)ex, (int)ey);
|
||||
point2(i, xpos + VSCALE(ex), ypos + VSCALE(ey), 1);
|
||||
}
|
||||
break;
|
||||
@@ -3643,7 +3666,7 @@ vt11_cycle(int us, int slowdown)
|
||||
vt_lpen_intr(); /* post graphic interrupt to host */
|
||||
MORE_DATA
|
||||
}
|
||||
DEBUGF(("basic short vector2 i%d d%d l%d\r\n", i, (int)ex,(int)ey));
|
||||
DEBUGF("basic short vector2 i%d d%d l%d\r\n", i, (int)ex,(int)ey);
|
||||
basic_vector(i, (int)ex, (int)ey);
|
||||
break;
|
||||
|
||||
@@ -3678,7 +3701,7 @@ vt11_cycle(int us, int slowdown)
|
||||
PNORM(ez - zpos) / 4); /* approx. */
|
||||
zpos = ez; /* more precise, if PSCALEF > 1 */
|
||||
} else {
|
||||
DEBUGF(("absolute vector i%d (%d,%d)\r\n", i, (int)x, (int)y));
|
||||
DEBUGF("absolute vector i%d (%d,%d)\r\n", i, (int)x, (int)y);
|
||||
ex = VSCALE(x) + xoff;
|
||||
ey = VSCALE(y) + yoff;
|
||||
vector2(i, PNORM(ex - xpos), PNORM(ey - ypos)); /* approx. */
|
||||
@@ -3753,7 +3776,7 @@ vt11_cycle(int us, int slowdown)
|
||||
goto check;
|
||||
|
||||
bus_timeout:
|
||||
DEBUGF(("TIMEOUT\r\n"));
|
||||
DEBUGF("TIMEOUT\r\n");
|
||||
/* fall through to check (time_out has already been set) */
|
||||
|
||||
check:
|
||||
@@ -3788,4 +3811,3 @@ vt11_cycle(int us, int slowdown)
|
||||
display_age(us, slowdown);
|
||||
return !maint1 && !maint2 && busy;
|
||||
} /* vt11_cycle */
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ extern void vt11_set_sar(uint16); /* write stack address/maint register */
|
||||
extern void vt11_set_zpr(uint16); /* write Z position register */
|
||||
extern void vt11_set_zor(uint16); /* write Z offset register */
|
||||
|
||||
extern void vt11_reset(void); /* reset the display processor */
|
||||
extern int vt11_cycle(int,int); /* perform a display processor cycle */
|
||||
extern void vt11_reset(void *, int); /* reset the display processor */
|
||||
extern int vt11_cycle(int, int); /* perform a display processor cycle */
|
||||
|
||||
/*
|
||||
* callbacks from VT11/VS60 simulator (to SIMH PDP-11 VT driver, for example)
|
||||
|
||||
@@ -317,7 +317,7 @@ ws_thread_init(void)
|
||||
|
||||
/* called from display layer on first display op */
|
||||
int
|
||||
ws_init(char *name, int xp, int yp, int colors)
|
||||
ws_init(char *name, int xp, int yp, int colors, void *dptr)
|
||||
{
|
||||
xpixels = xp;
|
||||
ypixels = yp;
|
||||
@@ -331,6 +331,10 @@ ws_init(char *name, int xp, int yp, int colors)
|
||||
return 1; /* XXX return errors!! */
|
||||
}
|
||||
|
||||
void ws_shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
void *
|
||||
ws_color_rgb(int r, int g, int b)
|
||||
{
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
|
||||
/* unless you're writing a new driver, you shouldn't be looking here! */
|
||||
|
||||
extern int ws_init(char *, int, int, int);
|
||||
extern int ws_init(char *, int, int, int, void *);
|
||||
void ws_shutdown(void);
|
||||
extern void *ws_color_rgb(int, int, int);
|
||||
extern void *ws_color_black(void);
|
||||
extern void *ws_color_white(void);
|
||||
extern void ws_display_point(int, int, void *);
|
||||
extern void ws_sync(void);
|
||||
extern int ws_loop(void (*)(void *), void *);
|
||||
extern int ws_poll(int *, int);
|
||||
extern void ws_beep(void);
|
||||
|
||||
|
||||
@@ -207,7 +207,8 @@ handle_exposure(w, d, e, b)
|
||||
int
|
||||
ws_init(char *crtname, /* crt type name */
|
||||
int xp, int yp, /* screen size in pixels */
|
||||
int colors) /* colors to support (not used) */
|
||||
int colors, /* colors to support (not used) */
|
||||
void *dptr)
|
||||
{
|
||||
Arg arg[25];
|
||||
XGCValues gcvalues;
|
||||
@@ -298,6 +299,10 @@ ws_init(char *crtname, /* crt type name */
|
||||
return 1;
|
||||
} /* ws_init */
|
||||
|
||||
void ws_shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
void *
|
||||
ws_color_black(void)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ enum display_type {
|
||||
* must be called before first call to display_age()
|
||||
* (but called implicitly by display_point())
|
||||
*/
|
||||
extern int display_init(enum display_type, int scale);
|
||||
extern int display_init(enum display_type, int scale, void *dptr);
|
||||
|
||||
/* return size of virtual display */
|
||||
extern int display_xpoints(void);
|
||||
|
||||
Reference in New Issue
Block a user