mirror of
https://github.com/simh/simh.git
synced 2026-01-28 04:48:05 +00:00
PDP8: Add Type 34 display support.
This commit is contained in:
committed by
Mark Pizzolato
parent
b305252bff
commit
02ebdd38d5
@@ -107,6 +107,7 @@ typedef struct {
|
||||
#define DEV_PTP 002 /* paper tape punch */
|
||||
#define DEV_TTI 003 /* console input */
|
||||
#define DEV_TTO 004 /* console output */
|
||||
#define DEV_DPY 005 /* Type 34 display */
|
||||
#define DEV_CLK 013 /* clock */
|
||||
#define DEV_TSC 036
|
||||
#define DEV_KJ8 040 /* extra terminals */
|
||||
|
||||
153
PDP8/pdp8_dpy.c
Normal file
153
PDP8/pdp8_dpy.c
Normal file
@@ -0,0 +1,153 @@
|
||||
#ifdef USE_DISPLAY
|
||||
/* pdp8_dpy.c: Type 34 point-plotting display
|
||||
|
||||
Copyright (c) 2025, 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
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "pdp8_defs.h"
|
||||
#include "display/display.h"
|
||||
#include "sim_video.h"
|
||||
|
||||
/* Run a Type 34 cycle every this many PDP-8 "cycle" times. */
|
||||
#define DPY_DELAY 1
|
||||
|
||||
/* Memory cycle time. */
|
||||
#define MEMORY_CYCLE 1
|
||||
|
||||
#define CYCLE_US (MEMORY_CYCLE*(DPY_DELAY*2+1))
|
||||
|
||||
t_stat dpy_svc(UNIT *uptr);
|
||||
int32 dpy_iot (int32 IR, int32 AC);
|
||||
t_stat dpy_reset(DEVICE *dptr);
|
||||
t_stat dpy_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
|
||||
const char *dpy_description (DEVICE *dptr);
|
||||
|
||||
DIB dpy_dib = { DEV_DPY, 2, { &dpy_iot, &dpy_iot } };
|
||||
|
||||
UNIT dpy_unit = {
|
||||
UDATA (&dpy_svc, UNIT_IDLE, 0), 0
|
||||
};
|
||||
|
||||
static t_bool dpy_quit = FALSE;
|
||||
static uint16 dpy_x, dpy_y;
|
||||
|
||||
static void dpy_quit_callback (void)
|
||||
{
|
||||
dpy_quit = TRUE;
|
||||
}
|
||||
|
||||
DEVICE dpy_dev = {
|
||||
"DPY", &dpy_unit, NULL, NULL,
|
||||
1, 8, 16, 1, 8, 16,
|
||||
NULL, NULL, &dpy_reset,
|
||||
NULL, NULL, NULL,
|
||||
&dpy_dib, DEV_DIS | DEV_DISABLE, 0,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
&dpy_description
|
||||
};
|
||||
|
||||
t_stat
|
||||
dpy_svc(UNIT *uptr)
|
||||
{
|
||||
#ifdef USE_DISPLAY
|
||||
display_age (100, 0);
|
||||
sim_activate_after (uptr, 100);
|
||||
if (dpy_quit) {
|
||||
dpy_quit = FALSE;
|
||||
return SCPE_STOP;
|
||||
}
|
||||
#endif
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
/* Type 34: IOT routine */
|
||||
|
||||
int32 dpy_iot (int32 IR, int32 AC)
|
||||
{
|
||||
switch (IR & 071) {
|
||||
case 051: /* DCX */
|
||||
dpy_x = 0;
|
||||
break;
|
||||
case 061: /* DCY */
|
||||
dpy_y = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (IR & 072) {
|
||||
case 052: /* DXL */
|
||||
dpy_x |= AC & 01777;
|
||||
break;
|
||||
case 062: /* DYL */
|
||||
dpy_y |= AC & 01777;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (IR & 004) {
|
||||
case 004: /* DIX, DIY */
|
||||
#ifdef USE_DISPLAY
|
||||
if (dpy_dev.flags & DEV_DIS)
|
||||
break;
|
||||
display_point (dpy_x, dpy_y, DISPLAY_INT_MAX, 0);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
return AC;
|
||||
}
|
||||
|
||||
t_stat
|
||||
dpy_reset(DEVICE *dptr)
|
||||
{
|
||||
#ifdef USE_DISPLAY
|
||||
if (dptr->flags & DEV_DIS || (sim_switches & SWMASK('P')) != 0) {
|
||||
display_close (dptr);
|
||||
sim_cancel (&dpy_unit);
|
||||
} else {
|
||||
display_reset ();
|
||||
display_init (DIS_TYPE30, 1, dptr);
|
||||
vid_register_quit_callback (&dpy_quit_callback);
|
||||
sim_activate_abs (&dpy_unit, 0);
|
||||
}
|
||||
#endif
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
const char *dpy_description (DEVICE *dptr)
|
||||
{
|
||||
return "Type 34 vector display controller";
|
||||
}
|
||||
|
||||
void
|
||||
cpu_get_switches(unsigned long *p1, unsigned long *p2)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
cpu_set_switches(unsigned long w1, unsigned long w2)
|
||||
{
|
||||
}
|
||||
|
||||
#else /* USE_DISPLAY not defined */
|
||||
char pdp8_dpy_unused; /* sometimes empty object modules cause problems */
|
||||
#endif /* USE_DISPLAY not defined */
|
||||
@@ -67,6 +67,9 @@ extern DEVICE df_dev, rf_dev;
|
||||
extern DEVICE dt_dev, td_dev;
|
||||
extern DEVICE mt_dev, ct_dev;
|
||||
extern DEVICE ttix_dev, ttox_dev;
|
||||
#ifdef USE_DISPLAY
|
||||
extern DEVICE dpy_dev;
|
||||
#endif
|
||||
extern REG cpu_reg[];
|
||||
extern uint16 M[];
|
||||
|
||||
@@ -114,6 +117,10 @@ DEVICE *sim_devices[] = {
|
||||
&td_dev,
|
||||
&mt_dev,
|
||||
&ct_dev,
|
||||
&ct_dev,
|
||||
#ifdef USE_DISPLAY
|
||||
&dpy_dev,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -332,6 +339,8 @@ static const char *opcode[] = {
|
||||
"PCE", "PSF", "PCF", "PPC", "PLS",
|
||||
"KCF", "KSF", "KCC", "KRS", "KIE", "KRB", /* console */
|
||||
"TLF", "TSF", "TCF", "TPC", "SPI", "TLS",
|
||||
"DCX", "DXL", "DIX", "DXS",
|
||||
"DCY", "DYL", "DIY", "DYS",
|
||||
"SBE", "SPL", "CAL", /* power fail */
|
||||
"CLEI", "CLDI", "CLSC", "CLLE", "CLCL", "CLSK", /* clock */
|
||||
"CINT", "RDF", "RIF", "RIB", /* mem mmgt */
|
||||
@@ -400,6 +409,8 @@ static const int32 opc_val[] = {
|
||||
06020+I_NPN, 06021+I_NPN, 06022+I_NPN, 06024+I_NPN, 06026+I_NPN,
|
||||
06030+I_NPN, 06031+I_NPN, 06032+I_NPN, 06034+I_NPN, 06035+I_NPN, 06036+I_NPN,
|
||||
06040+I_NPN, 06041+I_NPN, 06042+I_NPN, 06044+I_NPN, 06045+I_NPN, 06046+I_NPN,
|
||||
06051+I_NPN, 06053+I_NPN, 06054+I_NPN, 06057+I_NPN,
|
||||
06061+I_NPN, 06063+I_NPN, 06064+I_NPN, 06067+I_NPN,
|
||||
06101+I_NPN, 06102+I_NPN, 06103+I_NPN,
|
||||
06131+I_NPN, 06132+I_NPN, 06133+I_NPN, 06135+I_NPN, 06136+I_NPN, 06137+I_NPN,
|
||||
06204+I_NPN, 06214+I_NPN, 06224+I_NPN, 06234+I_NPN,
|
||||
|
||||
14
PDP8/tests/dpy_test.do
Normal file
14
PDP8/tests/dpy_test.do
Normal file
@@ -0,0 +1,14 @@
|
||||
DEPOSIT 200 CLA
|
||||
DEPOSIT 201 TAD 207
|
||||
;Display one point in the center: (1000,1000)
|
||||
DEPOSIT 202 DXL
|
||||
DEPOSIT 203 DYS
|
||||
DEPOSIT 204 TAD 210
|
||||
;Display another point mid-way to the right: (1400,1000)
|
||||
DEPOSIT 205 DXS
|
||||
DEPOSIT 206 JMP 200
|
||||
DEPOSIT 207 1000
|
||||
DEPOSIT 210 400
|
||||
|
||||
SET DPY ENABLED
|
||||
GO 200
|
||||
Reference in New Issue
Block a user