mirror of
https://github.com/simh/simh.git
synced 2026-01-25 19:56:25 +00:00
IMLAC: Simulator for Imlac PDS-1.
This commit is contained in:
@@ -125,7 +125,7 @@ struct color color_p29 = { p29, ELEMENTS(p29), 25000 };
|
||||
|
||||
/* green phosphor for Tek 611 */
|
||||
static struct phosphor p31[] = {{0.0, 1.0, 0.77, 0.5, .1}};
|
||||
struct color color_p31 = { p31, ELEMENTS(p31), 25000 };
|
||||
struct color color_p31 = { p31, ELEMENTS(p31), 100000 };
|
||||
|
||||
/* green phosphor for III */
|
||||
static struct phosphor p39[] = {{0.2, 1.0, 0.0, 0.5, 0.01}};
|
||||
@@ -251,7 +251,15 @@ static struct display displays[] = {
|
||||
* III display
|
||||
* on PDP-10
|
||||
*/
|
||||
{ DIS_III, "III Display", &color_p39, NULL, 1024, 1024 }
|
||||
{ DIS_III, "III Display", &color_p39, NULL, 1024, 1024 },
|
||||
|
||||
/*
|
||||
* Imlac display
|
||||
* 1024x1024 addressable points.
|
||||
* P31 phosphor according to "Heads-Up Display for Flight
|
||||
* Simulator for Advanced Aircraft"
|
||||
*/
|
||||
{ DIS_IMLAC, "Imlac Display", &color_p31, NULL, 1024, 1024 }
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -42,6 +42,7 @@ enum display_type {
|
||||
* of the PDP-1, and thus all DEC machines.
|
||||
*/
|
||||
DIS_TX0 = 0,
|
||||
DIS_IMLAC = 1,
|
||||
DIS_VR14 = 14,
|
||||
DIS_VR17 = 17,
|
||||
DIS_VR20 = 20,
|
||||
|
||||
114
display/imlac.c
Normal file
114
display/imlac.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/* imlac.c: Imlac display interface.
|
||||
|
||||
Copyright (c) 2020, Lars Brinkhoff
|
||||
|
||||
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
|
||||
LARS BRINKHOFF 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 name of Lars Brinkhoff shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from Lars Brinkhoff
|
||||
|
||||
*/
|
||||
|
||||
#include "display.h"
|
||||
#include "imlac.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int imlac_init(void *dev, int debug)
|
||||
{
|
||||
return display_init (DIS_IMLAC, 1, dev);
|
||||
}
|
||||
|
||||
void imlac_point (int x, int y)
|
||||
{
|
||||
display_point (x, y, DISPLAY_INT_MAX, 0);
|
||||
}
|
||||
|
||||
int imlac_cycle(int us, int slowdown)
|
||||
{
|
||||
return display_age (us, slowdown);
|
||||
}
|
||||
|
||||
#define ABS(_X) ((_X) >= 0 ? (_X) : -(_X))
|
||||
#define SIGN(_X) ((_X) >= 0 ? 1 : -1)
|
||||
|
||||
static void
|
||||
xline (int x, int y, int x2, int dx, int dy)
|
||||
{
|
||||
int ix = SIGN(dx);
|
||||
int iy = SIGN(dy);
|
||||
int ay;
|
||||
|
||||
dx = ABS(dx);
|
||||
dy = ABS(dy);
|
||||
|
||||
ay = dy/2;
|
||||
for (;;) {
|
||||
imlac_point (x, y);
|
||||
if (x == x2)
|
||||
break;
|
||||
if (ay > 0) {
|
||||
y += iy;
|
||||
ay -= dx;
|
||||
}
|
||||
ay += dy;
|
||||
x += ix;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
yline (int x, int y, int y2, int dx, int dy)
|
||||
{
|
||||
int ix = SIGN(dx);
|
||||
int iy = SIGN(dy);
|
||||
int ax;
|
||||
|
||||
dx = ABS(dx);
|
||||
dy = ABS(dy);
|
||||
|
||||
ax = dx/2;
|
||||
for (;;) {
|
||||
imlac_point (x, y);
|
||||
if (y == y2)
|
||||
break;
|
||||
if (ax > 0) {
|
||||
x += ix;
|
||||
ax -= dy;
|
||||
}
|
||||
ax += dx;
|
||||
y += iy;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
imlac_line (int x1, int y1, int x2, int y2)
|
||||
{
|
||||
int dx = x2 - x1;
|
||||
int dy = y2 - y1;
|
||||
if (ABS (dx) > ABS(dy))
|
||||
xline (x1, y1, x2, dx, dy);
|
||||
else
|
||||
yline (x1, y1, y2, dx, dy);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
38
display/imlac.h
Normal file
38
display/imlac.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* imlac.h: Imlac display interface.
|
||||
|
||||
Copyright (c) 2020, Lars Brinkhoff.
|
||||
|
||||
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
|
||||
LARS BRINKHOFF 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 name of Lars Brinkhoff shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from Lars Brinkhoff
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int imlac_init(void *, int);
|
||||
extern int imlac_cycle(int, int);
|
||||
extern void imlac_point(int, int);
|
||||
extern void imlac_line(int x1, int y1, int x2, int y2);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user