Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Linux is addictive, I'm hooked! -- MaDsen Wikholm's .sig


computers / comp.os.vms / Playing "The Halls of ZK" on OpenVMS x86

SubjectAuthor
o Playing "The Halls of ZK" on OpenVMS x86Jake Hamby (Solid State Jake)

1
Playing "The Halls of ZK" on OpenVMS x86

<d9aa7113-58f1-447a-83f4-8927ff21cbf0n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30996&group=comp.os.vms#30996

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:b10:b0:66c:fb09:d96b with SMTP id u16-20020a0562140b1000b0066cfb09d96bmr475285qvj.5.1699224410398;
Sun, 05 Nov 2023 14:46:50 -0800 (PST)
X-Received: by 2002:a05:6870:6190:b0:1e9:a0b3:1cce with SMTP id
a16-20020a056870619000b001e9a0b31ccemr12777999oah.2.1699224410099; Sun, 05
Nov 2023 14:46:50 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sun, 5 Nov 2023 14:46:49 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:f9cc:7d28:517c:8112;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:f9cc:7d28:517c:8112
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d9aa7113-58f1-447a-83f4-8927ff21cbf0n@googlegroups.com>
Subject: Playing "The Halls of ZK" on OpenVMS x86
From: jake.ha...@gmail.com (Jake Hamby (Solid State Jake))
Injection-Date: Sun, 05 Nov 2023 22:46:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jake Hamby (Solid St - Sun, 5 Nov 2023 22:46 UTC

I spent a number of hours getting "The Halls of ZK", a VMS text adventure from 1985, to run on x86. My diffs are at my fork of the tree here:

https://github.com/jhamby/vms-halls-of-zk

It was a very interesting learning experience, to say the least. The first hurdle was that I didn't have a BLISS compiler and there's a single source file that does an ugly hack to convert a variable-length list argument into an array pointing to the VAX argument pointer for the Pascal code to read, step through, and pass the addresses of some of its arguments along.

I posted to the VSI Forum wondering if anyone could translate the BLISS wrapper file back into MACRO-32, and I ended up doing it myself. It's amazing how much boilerplate gets generated to fake out a VAX-style argument list when user code asks for it.

With that out of the way, I had a more tricky issue with messages not printing out. "read sign" printed "The sign reads:" and then nothing. Long story short, there appears to be an optimizer bug in VSI Pascal with functions/procedures that have default parameters (the "[truncate]" attribute), and I made a simple test program using that feature and the "PRESENT()" function to test for presence of an argument, that crashes when built with optimization and works without.

I hacked around that by commenting out the "[truncate]" from the relevant file and changing the one use of it with default args to pass them all instead.

The last bug I noticed, at least from initial testing, is save and restore game weren't working. It gave an ACCVIO trying to write the game state. After looking at the object initialization code and where it was crashing, I saw that a pointer in the "context" object wasn't being properly initialized to nil. Adding a single line to do that fixed saving and restoring.

If anyone wants to play through a text adventure that you probably haven't even heard of before (or at least I hadn't, until seeing a YouTube video recommended of a walkthrough of it), try it out. It should still work on Alpha, IA64, and VAX, too. While the experience of getting it to run on x86 was frustrating, it was also very enlightening to me about how the calling standard works when VAX compatibility is needed, some of the unique features of VSI Pascal (including automatically generating string descriptors from string types to call system routines), and also some of the many ways a VAX program could misbehave when recompiled on x86 (uninitialized memory creating a stray pointer, unexpected bugs in the new compilers).

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor