Re: [Simh] 101 Basic Games for RSTS/E (was Re: PDP11 on Simh for public access)

2019-01-25 Thread Bailey, Scott
Fascinating, as Mr. Spock would say. ;-)

I’m not sure where my copy is now, but 101 Basic Computer Games really 
jump-started my programming, and in my opinion the Star Trek game was the best 
game in the book. I ended up adapting it to run on my [okay, my Dad’s LOL] 
TRS-80 (Model 1, Level II, eventually a whopping 32KB of memory), and of course 
it wasn’t big enough so it got expanded, adding more features like persistent 
galaxy state (saved between sessions) and multiplayer capability. (Not 
simultaneously, of course, but the concept of multiple ships of which one was 
actively in use by the current player.)

This abused several interesting features of the TRS-80’s Radio Shack Level II 
BASIC… One (that I’ve never encountered anywhere else) was that you didn’t have 
to put spaces in the code, and eliminating each space saved a byte of memory. 
The following was perfectly legal and readable if your eye was practiced:

100 FORI=1TO10
110 PRINTI
120 NEXTI

Now imagine more complex lines. After all, running them all together eliminates 
unneeded line numbers and saves even more memory:

100 FORI=1TO10:PRINTI:NEXTI

Then you eliminate all of the comments, because they’re pure overhead… When I 
still ran out of room, I started converting some functions into machine code 
(by hand, using a Z80 reference book) and POKEing them into memory…

Luckily, I went to college and encountered a VAX-11/780, at which point I 
recoded the whole mess in VAX-11 BASIC, took advantage of the expansive VT100 
display real estate, and began abusing (as they became available) indexed 
files, shared global sections, and the lock manager to make real multiplayer 
gaming workable.

Despite all of that, the heredity of the game is evident, including the 
coordinate system: (see the compass in the upper right corner!)

[cid:image001.jpg@01D4B4AA.9B972180]

That brings me back around to the point of this note. In VAX BASIC, 
fundamentally unchanged since some point prior to 1985, my course logic looks 
like this:

!
! Return a real course from point (x1,y1) to point (x2,y2)
! using Star Trek course notation.
!
function single course(long x1,y1,x2,y2)
declare long x,y
declare single temp
on error go back
x = x2-x1   ! Calculate offset P1 -> P2
y = y2-y1   ! Std. Cartesian system
if x='0'L then
  if y>'0'L then
course = 3.0! Straight up
exit function
  else
course = 7.0! Straight down
exit function
  end if
else
  temp = atn(real(y)/real(x))*57.2958   ! Calculate angle in degrees
  if x<='0'L then
temp = temp+180.0   ! Correct for quadrant
  else
if y<'0'L then
  temp = temp+360.0
end if
  end if
end if
course = temp/45.0+1.0  ! Convert to proper notation
end function

My guess is that this algorithm is more or less what you expected to find 
before you started digging into the code. (Originally this used bytes, but as 
memory became cheaper and access more convoluted, I promoted things to improve 
alignment.)

But here’s the punchline: I realized, as I was reading through your excerpt, 
that the algorithm used by the original game is EXACTLY the same that I used in 
my head to “estimate” courses when I was playing my game and I didn’t have the 
time to ask the computer for the course before getting shot myself. I don’t 
remember learning it from the original code, but I’m sure that’s where it came 
from.

If I had to guess – and I am – I’d say the original implementation might not 
have had trig functions available (when did BASIC acquire them?), and this is a 
pretty decent approximation. At least for the limited size and high granularity 
of a 64-sector quadrant. Certainly I could do it rapidly in my head, and I can 
testify that the results pretty much always match the “obvious” calculation, if 
you can aim and shoot fast enough that the target hasn’t moved!

Those were the days,

Scott


From: Simh 
mailto:simh-boun...@trailing-edge.com>> On 
Behalf Of Will Senn
Sent: Wednesday, January 23, 2019 10:22 AM
To: Clem Cole mailto:cl...@ccc.com>>
Cc: Simh mailto:simh@trailing-edge.com>>; Bryan Davies 
mailto:bryan.e.dav...@gmail.com>>
Subject: Re: [Simh] 101 Basic Games for RSTS/E (was Re: PDP11 on Simh for 
public access)

On 1/21/19 3:55 PM, Clem Cole wrote:
Anyway, the point is that simple computer games in BASIC were being passed 
around between people (as paper tapes), particularly if you had acccess to 
multiple different brands of computers.You always had the source code, in 
those days so it was really not big deal.  In fact, my memory is that one of 
the new things that you could do on the PDP-10 was >>compile<< your basic 
program, or at least leave it in

Re: [Simh] Transferring the licence file to the VAX emulator

2018-12-17 Thread Bailey, Scott
FWIW,

I've been running simh for ages and periodically I forget to renew my hobbyist 
licenses before they expire. It happened again just last week. I usually go 
through the following song and dance routine in this scenario:

1. Get new hobbyist licenses in attached .COM file
2. Transfer from Windows (where my mail lives) to Linux (where everything fun 
occurs)
3. Run "dos2unix" to replace DOS line endings with Unix line endings
4. Working on side-by-side windows, find the "VAX-VMS" and "UCX" licenses in 
the file ...
5. ... and manually enter the LICENSE REGISTER and LICENSE LOAD commands on the 
VAX console
6. Use FTP to transfer the file from Linux to VMS (remember to use ASCII mode!!)
7. Execute the full script to load all of the other licenses (and harmlessly 
barf on the two you did manually)

Cheers,
Scott

DXC Technology Company - Headquarters: 1775 Tysons Boulevard, Tysons, Virginia 
22102, USA.
DXC Technology Company -- This message is transmitted to you by or on behalf of 
DXC Technology Company or one of its affiliates.  It is intended exclusively 
for the addressee.  The substance of this message, along with any attachments, 
may contain proprietary, confidential or privileged information or information 
that is otherwise legally exempt from disclosure. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended recipient 
of this message, you are not authorized to read, print, retain, copy or 
disseminate any part of this message. If you have received this message in 
error, please destroy and delete all copies and notify the sender by return 
e-mail. Regardless of content, this e-mail shall not operate to bind DXC 
Technology Company or any of its affiliates to any order or other contract 
unless pursuant to explicit written agreement or government initiative 
expressly permitting the use of e-mail for such purpose. --.
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] CI750 tech docs and VAX firmware

2017-03-08 Thread Bailey, Scott
>Yes. Although there are some slight differences between ethernet and CI,
>but from a practical point of view, for cluster networking, ethernet
>works just as well.

"Practical" has very little to do with my interest in this subject, LOL, but I 
have
a definite fondness for the old "classic" VAXcluster with a star coupler and 
an
HSC (or two - dual-ported disks, anyone?) for storage.

For no good reason, I fret over my inability to map the same "shared disk" 
image
to multiple emulated VAXen and have at it. Yeah, I could just MSCP-serve it 
from
one node to another, but the kewlness of having a virtual HSC50 own all my 
disks
and running a completely symmetrical shared-storage cluster cannot be 
overlooked.

Daydreaming,

Scott Bailey
scott.bai...@hpe.com


smime.p7s
Description: S/MIME cryptographic signature
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] running on Debian

2016-03-04 Thread Bailey, Scott
Sigh. No matter how many times I re-read before sending, it doesn't matter. 
Let me expand on this:

>1. in /etc/rc.local, I have this snippet to make sure the network tap device 
>I
>need is ready to go:
>
>if ! ip link show tap0 ; then
>  tunctl -t tap0
>  ifconfig tap0 up
>  brctl addif br0 tap0
>fi
>
>Here, tap0 is the device I am setting up for my virtual VAX and br0 is my
>physical interface. (As a reminder, going through this rather than putting
>simh directly on the physical interface is what enables your virtual VAX and
>your Debian host to talk to each other.)

Actually, of course, br0 is a bridge device that lets me connect tap0 to my 
physical interface. I have this in /etc/network/interfaces:

# The bridge interface

auto br0
iface br0 inet static
bridge_ports eth1
address X.Y.Z.3
broadcast X.Y.Z.255
netmask 255.255.255.0
gateway X.Y.Z.1

That is, if you current specify a device (like eth1) directly, transfer its 
settings to br0 and attach the original NIC as a bridge port. [Or change 
instances of "eth1" to "br0", then add the "bridge_ports eth1" line.] Then 
continue as I originally described...

Cheers,
Scott


smime.p7s
Description: S/MIME cryptographic signature
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] running on Debian

2016-03-04 Thread Bailey, Scott
I agree with everything Mark said. (Particularly installing libpcap-dev...)

I'm running a simh VAX 8650 on Debian stretch (although nothing has changed 
appreciably of late except maybe systemd); here are some additional 
operational notes that you might or might not find useful -- these are about 
using the executable once you've built it successfully.

1. in /etc/rc.local, I have this snippet to make sure the network tap device I 
need is ready to go:

if ! ip link show tap0 ; then
  tunctl -t tap0
  ifconfig tap0 up
  brctl addif br0 tap0
fi

Here, tap0 is the device I am setting up for my virtual VAX and br0 is my 
physical interface. (As a reminder, going through this rather than putting 
simh directly on the physical interface is what enables your virtual VAX and 
your Debian host to talk to each other.) Run this manually the first time 
(since of course it wasn't there when your system last booted, lol).

2. In my vax8600.ini file, I attach the network device like so:

set xu enable
set xu type=delua
attach xu tap:tap0

Obviously (?) if you're using an emulated Q-bus system, you'd use xq instead 
of xu (and I believe the set xu type can just be deleted).

3. I do this to my simh vax8600 executable (each time I build a new one) so 
that I can run it as a non-root user and still bind to the network device:

sudo /sbin/setcap cap_net_raw,cap_net_admin=eip /vax/vax8600

4. I use a script called "screen-vax" to start the VAX with the console 
attached to a screen session, so I generally can ignore it but have the option 
of attaching (via "screen -dr") when I actually want to do something on the 
console -- like enter a new VMS license PAK. ;-)

#!/bin/sh
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
cd /vax

# Start the simulator...

if [ "$1" = service ] ; then
  # "detach" process but do not fork (so systemd can track it)
  FLAG="-D"
else
  # detach and fork so we can go on about our business
  FLAG="-d"
fi

screen $FLAG -mh 500 /vax/vax8600

echo "Simulator terminated."
exit 0

5. If you want systemd to start your VAX automatically when your host boots, 
you can use something like this, which sits in 
/etc/systemd/system/oasis.service: (OASIS:: is the emulated VAX 8650)

[Unit]
Description=Emulated VAX OASIS::
After=network.target auditd.service
Requires=network.target
RequiresMountsFor=/vax

[Service]
Type=simple
User=sbailey
ExecStart=/vax/screen-vax service
#ExecStop=
KillMode=process

[Install]
WantedBy=multi-user.target
Alias=simh.service

A few notes about this:

- I can't remember why I put auditd.service into the "After=" directive;
- Don't forget to do "systemctl daemon-reload" after creating or editing this 
file;
- This does *NOT* do a clean shutdown of the system; luckily VMS is very 
forgiving... ;-)

Happy computing,
Scott


smime.p7s
Description: S/MIME cryptographic signature
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] Sounds

2016-02-11 Thread Bailey, Scott
I was fortunate to have gotten "on the inside" quite early in my career, and
reading this thread really has brought back a wave of nostalgia for the
sights, sounds, and feel of old machine rooms.

And that's scratching the surface (pardon the pun). I managed a lonely trio of
Xerox 8010 servers that lasted into the late 1990s, and of course there was
really no hardware or software support of any kind for those dinosaurs. They
had huge (by today's standards) internal disks that were rotated by an
external motor and drive belt. I recall vividly that following power outages
(for whatever reason), one of the servers required you to remove the side
panel and "jump start" the disk by rotating the spindle manually -- the belt
was a little too worn/loose for the system to spin up the disk from a standing
start!

When I started at Xerox in 1985, there were 6085s all over the place and we
used them for everything. Well, everything that didn't involve the VT100
sitting next to mine. ;-)

Actually (he says plaintively) a 8010 or 6085 emulator would be a great SimH
fodder -- certainly they were important computing artifacts, and I regret in
hindsight that the systems I supported -- with their accompanying materials --
were long ago consigned to the dumpster. :-(

(shakes head and returns to the real world)

Scott


smime.p7s
Description: S/MIME cryptographic signature
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] Unable to build on NetBSD

2015-04-29 Thread Bailey, Scott
I don't know if this comment represents scope creep or not, but I recently 
browsed the
VAX MP Technical Overview:

http://www.oboguev.net/vax_mp/VAX%20MP%20Technical%20Overview.pdf

and it has an eye-opening dissection of the pitfalls associated with threaded 
emulation
when the memory consistency model of the emulated hardware is not the same as
the host hardware.

It's easy to spout off from the back seat :-) but it seems like we collectively 
would want
to give serious thought to any general simh API that might wander into this 
territory so
it is possible to guarantee correctness (while hopefully not punishing 
performance any
more than is necessary).

Regards,
Scott
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

[Simh] ALTAIR thinko?

2015-02-02 Thread Bailey, Scott
I've never seen an ALTAIR (beyond the Popular Science cover!) or used the 
emulated simh version, but I was reading code for edification and came across 
this statement in altair_cpu.c:

   3. Non-existent memory.  On the 8080, reads to non-existent memory
  return 0377, and writes are ignored.  In the simulator, the
  largest possible memory is instantiated and initialized to zero.
  Thus, only writes need be checked against actual memory size.

This looks like boilerplate copied from other simulators. Sure enough, later 
on, I find:

for (i = MEMSIZE; i < MAXMEMSIZE; i++) M[i] = 0;

However, if the statement above regarding 8080 behavior is correct, and I have 
no idea if it is, shouldn't that line be:

for (i = MEMSIZE; i < MAXMEMSIZE; i++) M[i] = 0377;

to preserve accuracy of the simulator?

FWIW,
Scott Bailey
scott.bai...@hp.com
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

[Simh] Relative efficiency of (simulated) VAX architectures?

2014-10-17 Thread Bailey, Scott (Global Midrange Server Services)
It's Friday afternoon, so it seems like a perfect chance to ask a weird
question that's been bobbing around in the back of my mind:

Which model of SIMH VAX is the fastest? (or most efficient, if there's a
difference)

I ask because I am a pure hobbyist looking to get the most mileage out of the
nostalgia-inducing VMS installation running on my Linux host (which is a Core
i7-based system running 64-bit Debian). I used all of the real VAXen back in
the day and have much more attachment to the operating system than any specific
[virtual] hardware model.

That is, do I get faster execution if I run a VAX-11/780 and let SIMH emulate
the full VAX instruction set, or if I run a MicroVAX 3900 and let SIMH emulate
the architectural subset of commands (and then emulate the software emulation
of the missing instructions)? Does the VAX 8600 end up running at the same speed
as the 780? Obviously this is likely to be workload dependent, but frankly most
of my workload is booting VMS and playing old games written in BASIC or FORTRAN.

:-)

Yeah, I could break down and figure out some sort of benchmark and investigate 
it
myself, but I'm curious if anybody has done any of this work already, or if the
learned members of the list have theoretical understanding that would illuminate
the matter.

TGIF,
Scott
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh