mirror of
https://github.com/simh/simh.git
synced 2026-01-13 15:27:14 +00:00
PDP8: Add Type 34 display support.
This commit is contained in:
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
|
||||
@ -34,6 +34,9 @@
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
@ -41,7 +44,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../PDP8/;./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/include;;../../windows-build/include/SDL2"
|
||||
PreprocessorDefinitions="_CRT_NONSTDC_NO_WARNINGS;SIM_BUILD_TOOL=simh-Visual-Studio-Project;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCRE_H;PCRE_STATIC;HAVE_LIBEDIT"
|
||||
PreprocessorDefinitions="USE_DISPLAY;USE_SIM_VIDEO;_CRT_NONSTDC_NO_WARNINGS;SIM_BUILD_TOOL=simh-Visual-Studio-Project;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCRE_H;PCRE_STATIC;HAVE_LIBSDL;HAVE_LIBPNG;HAVE_LIBEDIT"
|
||||
KeepComments="false"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="1"
|
||||
@ -117,6 +120,9 @@
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
@ -127,7 +133,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../PDP8/;./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/include;;../../windows-build/include/SDL2"
|
||||
PreprocessorDefinitions="_CRT_NONSTDC_NO_WARNINGS;SIM_BUILD_TOOL=simh-Visual-Studio-Project;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCRE_H;PCRE_STATIC;HAVE_LIBEDIT"
|
||||
PreprocessorDefinitions="USE_DISPLAY;USE_SIM_VIDEO;_CRT_NONSTDC_NO_WARNINGS;SIM_BUILD_TOOL=simh-Visual-Studio-Project;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCRE_H;PCRE_STATIC;HAVE_LIBSDL;HAVE_LIBPNG;HAVE_LIBEDIT"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
@ -195,6 +201,10 @@
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\display\display.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\PDP8\pdp8_clk.c"
|
||||
>
|
||||
@ -211,6 +221,10 @@
|
||||
RelativePath="..\PDP8\pdp8_df.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\PDP8\pdp8_dpy.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\PDP8\pdp8_dt.c"
|
||||
>
|
||||
@ -311,11 +325,19 @@
|
||||
RelativePath="..\sim_video.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\display\sim_ws.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\display\display.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\PDP8\pdp8_defs.h"
|
||||
>
|
||||
@ -372,6 +394,10 @@
|
||||
RelativePath="..\sim_video.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\display\ws.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
|
||||
9
makefile
9
makefile
@ -221,6 +221,10 @@ endif
|
||||
ifneq (,$(findstring pdp7,${MAKECMDGOALS}))
|
||||
VIDEO_USEFUL = true
|
||||
endif
|
||||
# building the PDP-8 could use video support
|
||||
ifneq (,$(findstring pdp8,${MAKECMDGOALS}))
|
||||
VIDEO_USEFUL = true
|
||||
endif
|
||||
# building the pdp11, any pdp10, any 3b2, or any vax simulator could use networking support
|
||||
ifneq (,$(findstring pdp11,${MAKECMDGOALS})$(findstring pdp10,${MAKECMDGOALS})$(findstring vax,${MAKECMDGOALS})$(findstring frontpaneltest,${MAKECMDGOALS})$(findstring infoserver,${MAKECMDGOALS})$(findstring 3b2,${MAKECMDGOALS})$(findstring all,${MAKECMDGOALS}))
|
||||
NETWORK_USEFUL = true
|
||||
@ -1978,8 +1982,9 @@ PDP8 = ${PDP8D}/pdp8_cpu.c ${PDP8D}/pdp8_clk.c ${PDP8D}/pdp8_df.c \
|
||||
${PDP8D}/pdp8_pt.c ${PDP8D}/pdp8_rf.c ${PDP8D}/pdp8_rk.c \
|
||||
${PDP8D}/pdp8_rx.c ${PDP8D}/pdp8_sys.c ${PDP8D}/pdp8_tt.c \
|
||||
${PDP8D}/pdp8_ttx.c ${PDP8D}/pdp8_rl.c ${PDP8D}/pdp8_tsc.c \
|
||||
${PDP8D}/pdp8_td.c ${PDP8D}/pdp8_ct.c ${PDP8D}/pdp8_fpp.c
|
||||
PDP8_OPT = -I ${PDP8D}
|
||||
${PDP8D}/pdp8_td.c ${PDP8D}/pdp8_ct.c ${PDP8D}/pdp8_fpp.c \
|
||||
${PDP8D}/pdp8_dpy.c ${DISPLAYL}
|
||||
PDP8_OPT = -I ${PDP8D} ${DISPLAY_OPT}
|
||||
|
||||
|
||||
H316D = ${SIMHD}/H316
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user