mirror of
https://github.com/simh/simh.git
synced 2026-01-25 19:56:25 +00:00
DISPLAY: Latest version of display code from Phil Budne and Doug Gwyn including initial pdp1_dpy and pdp11_vt
This commit is contained in:
52
PDP11/lunar11/README.txt
Normal file
52
PDP11/lunar11/README.txt
Normal file
@@ -0,0 +1,52 @@
|
||||
VT11/GT40 Lunar Lander files
|
||||
preliminary README phil
|
||||
|
||||
Phil Budne
|
||||
February 9, 2004
|
||||
|
||||
Lunar lander startup can take forever (lander uses spin loop to count
|
||||
down time for display of starting screen. This may be due to the fact
|
||||
that SIMH only tracks cycles in terms of instructions, not execution
|
||||
time). To speed up display of the startup screen, deposit a 1 in
|
||||
location 32530 after loading the lander program, and before starting
|
||||
it;
|
||||
|
||||
sim> ! Set CPU to a Unibus system type
|
||||
sim> set cpu 11/70
|
||||
sim> ! Enable DLI device so VT device autoconfigures
|
||||
sim> ! with a starting vector of 320
|
||||
sim> set dli enable
|
||||
sim> set dli line=2
|
||||
sim> ! Enable VT device
|
||||
sim> set vt enable
|
||||
sim> load lunar.lda
|
||||
sim> dep 32530 1
|
||||
sim> run
|
||||
|
||||
Lunar lander only needs a small screen area, and can run using a
|
||||
simulated "VR14" display, which can fit on many computer screens
|
||||
without scaling:
|
||||
|
||||
sim> set vt crt=vr14
|
||||
sim> set vt scale=1
|
||||
|
||||
For more information on the VT11/GT40 see
|
||||
http://www.brouhaha.com/~eric/retrocomputing/dec/gt40/
|
||||
|
||||
lunar.txt
|
||||
Lunar lander instructions
|
||||
(from ???)
|
||||
|
||||
lunar.lda
|
||||
PDP-11 Paper Tape (LDA) format
|
||||
http://www.brouhaha.com/~eric/retrocomputing/dec/gt40/software/moonlander/lunar.lda
|
||||
|
||||
lunar.dag
|
||||
PDP-11 Paper Tape (LDA) format
|
||||
above(?) as patched by Doug Gwyn to fix a spelling error?
|
||||
load fails with bad checksum under 3.2-preview2?
|
||||
|
||||
gtlem.mac
|
||||
Does not match above binaries??
|
||||
http://www.brouhaha.com/~eric/retrocomputing/dec/gt40/software/moonlander/gtlem.mac
|
||||
|
||||
5102
PDP11/lunar11/gtlem.mac
Normal file
5102
PDP11/lunar11/gtlem.mac
Normal file
File diff suppressed because it is too large
Load Diff
BIN
PDP11/lunar11/lunar.dag
Normal file
BIN
PDP11/lunar11/lunar.dag
Normal file
Binary file not shown.
BIN
PDP11/lunar11/lunar.lda
Normal file
BIN
PDP11/lunar11/lunar.lda
Normal file
Binary file not shown.
114
PDP11/lunar11/lunar.txt
Normal file
114
PDP11/lunar11/lunar.txt
Normal file
@@ -0,0 +1,114 @@
|
||||
PLAYING MOONLANDER (LEM)
|
||||
|
||||
|
||||
The object of moonlander is to land a lunar module on the
|
||||
surface of the moon. The program will run on any 8K GT40
|
||||
with a light pen and a clock. If you are attached to a PDP-10
|
||||
you may use the ROM bootstrap to bring over the assembled
|
||||
binary. If you are not "talking" to a PDP-10, you may load
|
||||
in the binary loader (absolute loader) and load in the paper
|
||||
tape version of the program. Note: the program will destroy
|
||||
the binary loader when it starts running.
|
||||
|
||||
When the program is loaded, it will automatically start and
|
||||
display an "introductory message" on the screen. Future
|
||||
restart of the program will not cause this message to be
|
||||
displayed. Should any problems occur, the program may be
|
||||
restarted at any time at location zero (000000). Power fail
|
||||
protection is also provided. After starting (or restarting),
|
||||
you then start playing the actual game. All numbers, speeds,
|
||||
weights, etc., are actual numbers. They are for real. To
|
||||
make the game more possible for an average person to play, I
|
||||
have given him about 25 to 50% more fuel in the final stages
|
||||
of landing than he would actually have.
|
||||
|
||||
What the user sees on the screen is a broad and extremely
|
||||
mountainous view of the moon. On the right is a list of data
|
||||
parameters which the user may examine. They are height,
|
||||
altitude, angle, fuel left, thrust, weight, horizontal velocity,
|
||||
vertical velocity, horizontal acceleration, vertical accelera-
|
||||
tion, distance and seconds. At the top of the screen, any
|
||||
four of the values may be displayed. To display an item, the
|
||||
user points the light pen at the item he wishes to display.
|
||||
The item will then start blinking, to indicate that this is the
|
||||
item to be displayed. The user then points the light pen at
|
||||
one of the previously displayed items at the top of the screen.
|
||||
The old item disappears and is replaced by the new item.
|
||||
Note that it is possible to display any item anywhere, and even
|
||||
possible to display one item four times at the top. Anyway,
|
||||
the parameters mean the following. Height is the height in
|
||||
feet above the surface (terrain) of the moon. It is the "radar"
|
||||
height. Altitude is the height above the "mean" height of the
|
||||
moon ( I guess you would call it "mare" level). Thus altitude
|
||||
is not affected by terrain. Angle is the angle of the ship in
|
||||
relationship to the vertical. 10 degrees, -70 degrees, etc.
|
||||
Fuel left is the amount of fuel left in pounds. Thrust is the
|
||||
amount of thrust (pounds) currently being produced by the engine.
|
||||
Weight is the current earth weight of the ship. As fuel is
|
||||
burned off, the acceleration will increase due to a lessening of
|
||||
weight. The horizontal velocity is the current horizontal speed
|
||||
of the ship, in feet per second. It is necessary to land at
|
||||
under 10 fps horizontal, or else the ship will tip over.
|
||||
Vertical velocity is the downward speed of the ship. Try to
|
||||
keep it under 30 for the first few landings, until you get
|
||||
better. A perfect landing is under 8 fps. The horizontal
|
||||
and vertical accelerations are just those, in f/sec/sec.
|
||||
With no power, the vertical acceleration is about 5 fp/s/s
|
||||
down (-5). Distance is the horizontal distance (X direction)
|
||||
you are from the projected landing site. Try to stay within
|
||||
500 feet of this distance, because there are not too many
|
||||
spots suitable for landing on the moon. Seconds is just the
|
||||
time since you started trying to land. Thus you now know how
|
||||
to display information and what they mean.
|
||||
|
||||
To control the ship, two controls are provided. The first
|
||||
controls the rolling or turning of the ship. This is accom-
|
||||
plished by four arrows just above the display menu. Two point
|
||||
left and two point right. The two pointing left mean rotate
|
||||
left and the two pointing right mean rotate right. There is
|
||||
a big and a little one in each direction. The big one means
|
||||
to rotate "fast" and the small one means to rotate "slow".
|
||||
Thus to rotate fast left, you point the light pen at
|
||||
left arrow. To rotate slow right, you point the light pen at
|
||||
the small arrow pointing to the right. The arrow will get
|
||||
slightly brighter to indicate you have chosen it. Above the
|
||||
arrow there is a bright, solid bar. This bar is your throttle
|
||||
bar. To its left there is a number in percent (say 50%). This
|
||||
number indicates the percentage of full thrust your rocket
|
||||
engine is developing. The engine can develop anywhere from
|
||||
10% to 100% thrust - full thrust is 10,500 pounds. The
|
||||
engine thrust cannot fall below 10%. That is the way Grumman
|
||||
built it (actually the subcontractor). To increase or decrease
|
||||
your thrust, you merely slide the light pen up and down the bar.
|
||||
The indicated percentage thrust will change accordingly.
|
||||
|
||||
Now we come to actually flying the beast. The module appears
|
||||
in the upper left hand corner of the screen and is traveling
|
||||
down and to the right. Your job is to land at the correct
|
||||
spot (for the time being, we will say this is when the
|
||||
distance and height both reach zero). The first picture you
|
||||
see, with the module in the upper left hand corner, is not
|
||||
drawn to scale (the module appears too big in relationship
|
||||
to the mountains). Should you successfully get below around
|
||||
400 feet altitude, the view will now change to a closeup
|
||||
view of the landing site, and everything will be in scale.
|
||||
Remember, it is not easy to land the first few times, but
|
||||
don't be disappointed, you'll do it. Be careful, the game
|
||||
is extremely addictive. It is also quite dynamic.
|
||||
|
||||
Incorporated in the game are just about everything the GT40
|
||||
can do. Letters, italics, light pen letters, a light bar,
|
||||
dynamic motion, various line types and intensities (the moon
|
||||
is not all the same brightness you know). It also shows that
|
||||
the GT40 can do a lot of calculations while maintaining a
|
||||
reasonable display.
|
||||
|
||||
There are three possible landing sites on the Moon:
|
||||
|
||||
1. On the extreme left of the landscape
|
||||
|
||||
2. A small flat area to the right of the mountains
|
||||
|
||||
3. In the large "flat" area on the right
|
||||
|
||||
Good Luck!
|
||||
@@ -620,6 +620,14 @@ typedef struct pdp_dib DIB;
|
||||
#define INT_V_DLO 10
|
||||
#define INT_V_DCI 11
|
||||
#define INT_V_DCO 12
|
||||
/* VT simulation is sequential, so only
|
||||
one interrupt is posted at a time. */
|
||||
#define INT_V_VTLP 13 /* XXX - Manual says VTLP, VTST have opposite */
|
||||
#define INT_V_VTST 14 /* XXX precedence, but that breaks LUNAR! */
|
||||
/* XXX How this happens is an utter mystery. */
|
||||
#define INT_V_VTCH 15
|
||||
#define INT_V_VTNM 16
|
||||
#define INT_V_LK 17
|
||||
|
||||
#define INT_V_PIR3 0 /* BR3 */
|
||||
#define INT_V_PIR2 0 /* BR2 */
|
||||
@@ -667,6 +675,11 @@ typedef struct pdp_dib DIB;
|
||||
#define INT_DLO (1u << INT_V_DLO)
|
||||
#define INT_DCI (1u << INT_V_DCI)
|
||||
#define INT_DCO (1u << INT_V_DCO)
|
||||
#define INT_VTLP (1u << INT_V_VTLP)
|
||||
#define INT_VTST (1u << INT_V_VTST)
|
||||
#define INT_VTCH (1u << INT_V_VTCH)
|
||||
#define INT_VTNM (1u << INT_V_VTNM)
|
||||
#define INT_LK (1u << INT_V_LK)
|
||||
#define INT_PIR3 (1u << INT_V_PIR3)
|
||||
#define INT_PIR2 (1u << INT_V_PIR2)
|
||||
#define INT_PIR1 (1u << INT_V_PIR1)
|
||||
@@ -717,6 +730,11 @@ typedef struct pdp_dib DIB;
|
||||
#define IPL_DLO 4
|
||||
#define IPL_DCI 4
|
||||
#define IPL_DCO 4
|
||||
#define IPL_VTLP 4
|
||||
#define IPL_VTST 4
|
||||
#define IPL_VTCH 4
|
||||
#define IPL_VTNM 4
|
||||
#define IPL_LK 4 /* XXX just a guess */
|
||||
|
||||
#define IPL_PIR7 7
|
||||
#define IPL_PIR6 6
|
||||
|
||||
@@ -528,8 +528,8 @@ AUTO_CON auto_tab[] = {/*c #v am vm fxa fxv */
|
||||
{ { NULL }, 1, 2, 0, 8, { 0 } }, /* DLV11J - fx CSRs */
|
||||
{ { NULL }, 1, 2, 8, 8 }, /* DJ11 */
|
||||
{ { NULL }, 1, 2, 16, 8 }, /* DH11 */
|
||||
{ { NULL }, 1, 4, 0, 8,
|
||||
{012000, 012010, 012020, 012030} }, /* GT40 */
|
||||
{ { "VT" }, 1, 4, 0, 8,
|
||||
{012000, 012010, 012020, 012030} }, /* VT11/GT40 - fx CSRs */
|
||||
{ { NULL }, 1, 2, 0, 8,
|
||||
{010400} }, /* LPS11 */
|
||||
{ { NULL }, 1, 2, 8, 8 }, /* DQ11 */
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
22-Jul-05 RMS Fixed missing , in initializer (Doug Gwyn)
|
||||
22-Dec-03 RMS Added second DEUNA/DELUA support
|
||||
18-Oct-03 RMS Added DECtape off reel message
|
||||
14-Sep-03 PLB Added VT11 support
|
||||
06-May-03 RMS Added support for second DEQNA/DELQA
|
||||
09-Jan-03 RMS Added DELUA/DEUNA support
|
||||
17-Oct-02 RMS Fixed bugs in branch, SOB address parsing
|
||||
@@ -100,6 +101,9 @@ extern DEVICE tq_dev;
|
||||
extern DEVICE ts_dev;
|
||||
extern DEVICE tu_dev;
|
||||
extern DEVICE ta_dev;
|
||||
#ifdef USE_DISPLAY
|
||||
extern DEVICE vt_dev;
|
||||
#endif
|
||||
extern DEVICE xq_dev, xqb_dev;
|
||||
extern DEVICE xu_dev, xub_dev;
|
||||
extern DEVICE ke_dev;
|
||||
@@ -167,6 +171,9 @@ DEVICE *sim_devices[] = {
|
||||
&tq_dev,
|
||||
&tu_dev,
|
||||
&ta_dev,
|
||||
#ifdef USE_DISPLAY
|
||||
&vt_dev,
|
||||
#endif
|
||||
&xq_dev,
|
||||
&xqb_dev,
|
||||
&xu_dev,
|
||||
|
||||
433
PDP11/pdp11_vt.c
Normal file
433
PDP11/pdp11_vt.c
Normal file
@@ -0,0 +1,433 @@
|
||||
#ifdef USE_DISPLAY
|
||||
/* pdp11_vt.c: PDP-11 VT11/VS60 Display Processor Simulation
|
||||
|
||||
Copyright (c) 2003-2004, Philip L. Budne, Douglas A. Gwyn
|
||||
Copyright (c) 1993-2003, Robert M Supnik
|
||||
|
||||
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.
|
||||
|
||||
vt VT11/VS60 Display Processor
|
||||
|
||||
05-Feb-04 DAG Improved VT11 emulation
|
||||
Added VS60 support
|
||||
14-Sep-03 PLB Start from pdp11_lp.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* this file is just a thin layer of glue to the simulator-
|
||||
* independent XY Display simulation
|
||||
*/
|
||||
|
||||
#if defined (VM_VAX) /* VAX version */
|
||||
#include "vax_defs.h"
|
||||
#elif defined(VM_PDP11) /* PDP-11 version */
|
||||
#include "pdp11_defs.h"
|
||||
#else
|
||||
#error "VT11/VS60 is supported only on the PDP-11 and VAX"
|
||||
#endif
|
||||
|
||||
#include "display/display.h"
|
||||
#include "display/vt11.h"
|
||||
|
||||
/*
|
||||
* Timing parameters. Should allow some runtime adjustment,
|
||||
* since several different configurations were shipped, including:
|
||||
*
|
||||
* GT40: PDP-11/05 with VT11 display processor
|
||||
* GT44: PDP-11/40 with VT11 display processor
|
||||
* GT46: PDP-11/34 with VT11 display processor
|
||||
* GT62: PDP-11/34a with VS60 display system
|
||||
*/
|
||||
|
||||
/*
|
||||
* run a VT11/VS60 cycle every this many PDP-11 "cycle" times;
|
||||
*
|
||||
* Under the X Window System (X11), this includes polling
|
||||
* for events (mouse movement)!
|
||||
*/
|
||||
#define VT11_DELAY 1
|
||||
|
||||
/*
|
||||
* memory cycle time
|
||||
*/
|
||||
#define MEMORY_CYCLE 1 /* either .98 or 1.2 us? */
|
||||
|
||||
/*
|
||||
* delay in microseconds between VT11/VS60 cycles:
|
||||
* VT11/VS60 and PDP-11 CPU's share the same memory bus,
|
||||
* and each VT11/VS60 instruction requires a memory reference;
|
||||
* figure each PDP11 instruction requires two memory references
|
||||
*/
|
||||
#define CYCLE_US (MEMORY_CYCLE*(VT11_DELAY*2+1))
|
||||
|
||||
extern int32 int_req[IPL_HLVL];
|
||||
extern int32 int_vec[IPL_HLVL][32];
|
||||
|
||||
DEVICE vt_dev;
|
||||
t_stat vt_rd(int32 *data, int32 PA, int32 access);
|
||||
t_stat vt_wr(int32 data, int32 PA, int32 access);
|
||||
t_stat vt_svc(UNIT *uptr);
|
||||
t_stat vt_reset(DEVICE *dptr);
|
||||
t_stat vt_boot(int32 unit, DEVICE *dptr);
|
||||
t_stat vt_set_crt(UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat vt_show_crt(FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat vt_set_scale(UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat vt_show_scale(FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat vt_set_hspace(UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat vt_show_hspace(FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat vt_set_vspace(UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat vt_show_vspace(FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat vt_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
||||
char *vt_description (DEVICE *dptr);
|
||||
|
||||
/* VT11/VS60 data structures
|
||||
|
||||
vt_dev VT11 device descriptor
|
||||
vt_unit VT11 unit descriptor
|
||||
vt_reg VT11 register list
|
||||
vt_mod VT11 modifier list
|
||||
*/
|
||||
#define IOLN_VT11 010 /* VT11 */
|
||||
#define IOLN_VS60 040 /* VS60 */
|
||||
DIB vt_dib = { IOBA_AUTO, IOLN_VT11, &vt_rd, &vt_wr,
|
||||
4, IVCL(VTST), VEC_AUTO, {NULL} };
|
||||
/* (VT11 uses only the first 3 interrupt vectors) */
|
||||
|
||||
UNIT vt_unit = {
|
||||
UDATA (&vt_svc, UNIT_SEQ, 0), VT11_DELAY};
|
||||
|
||||
REG vt_reg[] = {
|
||||
{ GRDATA (DEVADDR, vt_dib.ba, DEV_RDX, 32, 0), REG_HRO },
|
||||
{ GRDATA (DEVVEC, vt_dib.vec, DEV_RDX, 16, 0), REG_HRO },
|
||||
{ NULL } };
|
||||
|
||||
MTAB vt_mod[] = {
|
||||
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "CRT", "CRT={VR14|VR17|VR48}",
|
||||
&vt_set_crt, &vt_show_crt, NULL, "CRT Type" },
|
||||
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "SCALE", "SCALE={1|2|4|8}",
|
||||
&vt_set_scale, &vt_show_scale, NULL, "Pixel Scale Factor" },
|
||||
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "HSPACE", "HSPACE={NARROW|NORMAL}",
|
||||
&vt_set_hspace, &vt_show_hspace, NULL, "Horizontal Spacing" },
|
||||
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "VSPACE", "VSPACE={TALL|NORMAL}",
|
||||
&vt_set_vspace, &vt_show_vspace, NULL, "Vertical Spacing" },
|
||||
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 020, "ADDRESS", "ADDRESS",
|
||||
&set_addr, &show_addr, NULL, "Bus address" },
|
||||
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "VECTOR", "VECTOR",
|
||||
&set_vec, &show_vec, NULL, "Interrupt vector" },
|
||||
{ MTAB_XTD|MTAB_VDV, 0, NULL, "AUTOCONFIGURE",
|
||||
&set_addr_flt, NULL, NULL, "Enable autoconfiguration of address & vector" },
|
||||
{ 0 } };
|
||||
|
||||
DEVICE vt_dev = {
|
||||
"VT", &vt_unit, vt_reg, vt_mod,
|
||||
1, 8, 31, 1, DEV_RDX, 16,
|
||||
NULL, NULL, &vt_reset,
|
||||
&vt_boot, NULL, NULL,
|
||||
&vt_dib, DEV_DIS | DEV_DISABLE | DEV_UBUS | DEV_Q18,
|
||||
0, 0, NULL, NULL, NULL, NULL, NULL,
|
||||
&vt_description
|
||||
};
|
||||
|
||||
/* VT11/VS60 routines
|
||||
|
||||
vt_rd I/O page read
|
||||
vt_wr I/O page write
|
||||
vt_svc process event
|
||||
vt_reset process reset
|
||||
vt_boot bootstrap device
|
||||
*/
|
||||
|
||||
t_stat
|
||||
vt_rd(int32 *data, int32 PA, int32 access)
|
||||
{
|
||||
switch (PA & 036) {
|
||||
case 000: *data = vt11_get_dpc(); return SCPE_OK;
|
||||
case 002: *data = vt11_get_mpr(); return SCPE_OK;
|
||||
case 004: *data = vt11_get_xpr(); return SCPE_OK;
|
||||
case 006: *data = vt11_get_ypr(); return SCPE_OK;
|
||||
case 010: if (!VS60) break; *data = vt11_get_rr(); return SCPE_OK;
|
||||
case 012: if (!VS60) break; *data = vt11_get_spr(); return SCPE_OK;
|
||||
case 014: if (!VS60) break; *data = vt11_get_xor(); return SCPE_OK;
|
||||
case 016: if (!VS60) break; *data = vt11_get_yor(); return SCPE_OK;
|
||||
case 020: if (!VS60) break; *data = vt11_get_anr(); return SCPE_OK;
|
||||
case 022: if (!VS60) break; *data = vt11_get_scr(); return SCPE_OK;
|
||||
case 024: if (!VS60) break; *data = vt11_get_nr(); return SCPE_OK;
|
||||
case 026: if (!VS60) break; *data = vt11_get_sdr(); return SCPE_OK;
|
||||
case 030: if (!VS60) break; *data = vt11_get_str(); return SCPE_OK;
|
||||
case 032: if (!VS60) break; *data = vt11_get_sar(); return SCPE_OK;
|
||||
case 034: if (!VS60) break; *data = vt11_get_zpr(); return SCPE_OK;
|
||||
case 036: if (!VS60) break; *data = vt11_get_zor(); return SCPE_OK;
|
||||
}
|
||||
return SCPE_NXM;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_wr(int32 data, int32 PA, int32 access)
|
||||
{
|
||||
uint16 d = data & 0177777; /* mask just in case */
|
||||
|
||||
switch (PA & 037) {
|
||||
case 000: /* DPC */
|
||||
/* set the simulator PC */
|
||||
vt11_set_dpc(d);
|
||||
|
||||
/* clear interrupt request (only one will be simulated at a time) */
|
||||
CLR_INT (VTST);
|
||||
CLR_INT (VTLP);
|
||||
CLR_INT (VTCH);
|
||||
CLR_INT (VTNM);
|
||||
|
||||
/* start the display processor by running a cycle */
|
||||
return vt_svc(&vt_unit);
|
||||
|
||||
case 002: vt11_set_mpr(d); return SCPE_OK;
|
||||
case 004: vt11_set_xpr(d); return SCPE_OK;
|
||||
case 006: vt11_set_ypr(d); return SCPE_OK;
|
||||
case 010: if (!VS60) break; vt11_set_rr(d); return SCPE_OK;
|
||||
case 012: if (!VS60) break; vt11_set_spr(d); return SCPE_OK;
|
||||
case 014: if (!VS60) break; vt11_set_xor(d); return SCPE_OK;
|
||||
case 016: if (!VS60) break; vt11_set_yor(d); return SCPE_OK;
|
||||
case 020: if (!VS60) break; vt11_set_anr(d); return SCPE_OK;
|
||||
case 022: if (!VS60) break; vt11_set_scr(d); return SCPE_OK;
|
||||
case 024: if (!VS60) break; vt11_set_nr(d); return SCPE_OK;
|
||||
case 026: if (!VS60) break; vt11_set_sdr(d); return SCPE_OK;
|
||||
case 030: if (!VS60) break; vt11_set_str(d); return SCPE_OK;
|
||||
case 032: if (!VS60) break; vt11_set_sar(d); return SCPE_OK;
|
||||
case 034: if (!VS60) break; vt11_set_zpr(d); return SCPE_OK;
|
||||
case 036: if (!VS60) break; vt11_set_zor(d); return SCPE_OK;
|
||||
}
|
||||
return SCPE_NXM;
|
||||
}
|
||||
|
||||
/*
|
||||
* here to run a display processor cycle, called as a SIMH
|
||||
* "device service routine".
|
||||
*
|
||||
* Under X11 this includes polling for events, so it can't be
|
||||
* call TOO infrequently...
|
||||
*/
|
||||
t_stat
|
||||
vt_svc(UNIT *uptr)
|
||||
{
|
||||
if (vt11_cycle(CYCLE_US, 1))
|
||||
sim_activate (&vt_unit, vt_unit.wait); /* running; reschedule */
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_reset(DEVICE *dptr)
|
||||
{
|
||||
if (!(dptr->flags & DEV_DIS))
|
||||
vt11_reset();
|
||||
CLR_INT (VTST);
|
||||
CLR_INT (VTLP);
|
||||
CLR_INT (VTCH);
|
||||
CLR_INT (VTNM);
|
||||
sim_cancel (&vt_unit); /* deactivate unit */
|
||||
return auto_config ("VT", (dptr->flags & DEV_DIS) ? 0 : 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* GT4x/GT62 bootstrap (acts as remote terminal)
|
||||
*/
|
||||
t_stat
|
||||
vt_boot(int32 unit, DEVICE *dptr)
|
||||
{
|
||||
/* XXX should do something like vt11_set_dpc(&appropriate_ROM_image) */
|
||||
return SCPE_NOFNC; /* not yet implemented */
|
||||
}
|
||||
|
||||
/* SET/SHOW VT options: */
|
||||
|
||||
t_stat
|
||||
vt_set_crt(UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
{
|
||||
char gbuf[CBUFSIZE];
|
||||
if (vt11_init)
|
||||
return SCPE_ALATT; /* should be "changes locked out" */
|
||||
if (cptr == NULL)
|
||||
return SCPE_ARG;
|
||||
get_glyph(cptr, gbuf, 0);
|
||||
if (strcmp(gbuf, "VR14") == 0)
|
||||
vt11_display = DIS_VR14;
|
||||
else if (strcmp(gbuf, "VR17") == 0)
|
||||
vt11_display = DIS_VR17;
|
||||
else if (strcmp(gbuf, "VR48") == 0)
|
||||
vt11_display = DIS_VR48;
|
||||
else
|
||||
return SCPE_ARG;
|
||||
vt_dib.lnt = (VS60) ? IOLN_VS60 : IOLN_VT11;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_show_crt(FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
{
|
||||
fprintf(st, "crt=VR%d", (int)vt11_display);
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_set_scale(UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
{
|
||||
t_stat r;
|
||||
t_value v;
|
||||
if (vt11_init)
|
||||
return SCPE_ALATT; /* should be "changes locked out" */
|
||||
if (cptr == NULL)
|
||||
return SCPE_ARG;
|
||||
v = get_uint(cptr, 10, 8, &r);
|
||||
if (r != SCPE_OK)
|
||||
return r;
|
||||
if (v != 1 && v != 2 && v != 4 && v != 8)
|
||||
return SCPE_ARG;
|
||||
vt11_scale = v;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_show_scale(FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
{
|
||||
fprintf(st, "scale=%d", (int)vt11_scale);
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_set_hspace(UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
{
|
||||
char gbuf[CBUFSIZE];
|
||||
if (vt11_init)
|
||||
return SCPE_ALATT; /* should be "changes locked out" */
|
||||
if (cptr == NULL)
|
||||
return SCPE_ARG;
|
||||
get_glyph(cptr, gbuf, 0);
|
||||
if (strcmp(gbuf, "NARROW") == 0)
|
||||
vt11_csp_w = 12;
|
||||
else if (strcmp(gbuf, "NORMAL") == 0)
|
||||
vt11_csp_w = 14;
|
||||
else
|
||||
return SCPE_ARG;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_show_hspace(FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
{
|
||||
fprintf(st, "hspace=%s", vt11_csp_w==12 ? "narrow" : "normal");
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_set_vspace(UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
{
|
||||
char gbuf[CBUFSIZE];
|
||||
if (vt11_init)
|
||||
return SCPE_ALATT; /* should be "changes locked out" */
|
||||
if (cptr == NULL)
|
||||
return SCPE_ARG;
|
||||
get_glyph(cptr, gbuf, 0);
|
||||
if (strcmp(gbuf, "TALL") == 0)
|
||||
vt11_csp_h = 26;
|
||||
else if (strcmp(gbuf, "NORMAL") == 0)
|
||||
vt11_csp_h = 24;
|
||||
else
|
||||
return SCPE_ARG;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat
|
||||
vt_show_vspace(FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
{
|
||||
fprintf(st, "vspace=%s", vt11_csp_h==26 ? "tall" : "normal");
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
/* interface routines (called from display simulator) */
|
||||
|
||||
void
|
||||
vt_stop_intr(void)
|
||||
{
|
||||
SET_INT (VTST);
|
||||
}
|
||||
|
||||
void
|
||||
vt_lpen_intr(void)
|
||||
{
|
||||
SET_INT (VTLP);
|
||||
}
|
||||
|
||||
void
|
||||
vt_char_intr(void)
|
||||
{
|
||||
SET_INT (VTCH);
|
||||
}
|
||||
|
||||
void
|
||||
vt_name_intr(void)
|
||||
{
|
||||
SET_INT (VTNM);
|
||||
}
|
||||
|
||||
/* fetch memory */
|
||||
int
|
||||
vt_fetch(uint32 addr, vt11word *wp)
|
||||
{
|
||||
/* On PDP-11 Unibus 22-bit systems, the VT11/VS60 behaves as
|
||||
an 18-bit Unibus peripheral and must go through the I/O map. */
|
||||
|
||||
/* apply Unibus map, when appropriate */
|
||||
if (Map_ReadW(addr, 2, wp) == 0)
|
||||
return 0; /* no problem */
|
||||
/* else mapped address lies outside configured memory range */
|
||||
|
||||
*wp = 0164000; /* DNOP; just updates DPC if used */
|
||||
/* which shouldn't happen */
|
||||
return 1; /* used to set "time_out" flag */
|
||||
}
|
||||
|
||||
char *vt_description (DEVICE *dptr)
|
||||
{
|
||||
return (VS60) ? "VS60 Display processor"
|
||||
: "VT11 Display processor";
|
||||
}
|
||||
|
||||
#ifdef VM_PDP11
|
||||
/* PDP-11 simulation provides this */
|
||||
extern int32 SR; /* switch register */
|
||||
#else
|
||||
int32 SR; /* switch register */
|
||||
#endif
|
||||
|
||||
void
|
||||
cpu_set_switches(unsigned long val)
|
||||
{
|
||||
SR = val;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
cpu_get_switches(void)
|
||||
{
|
||||
return SR;
|
||||
}
|
||||
#else /* USE_DISPLAY not defined */
|
||||
char pdp11_vt_unused; /* sometimes empty object modules cause problems */
|
||||
#endif /* USE_DISPLAY not defined */
|
||||
Reference in New Issue
Block a user