Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Muddle 56 with MIDAS 73 #1928

Merged
merged 10 commits into from
Aug 26, 2020
Merged

Build Muddle 56 with MIDAS 73 #1928

merged 10 commits into from
Aug 26, 2020

Conversation

atsampson
Copy link
Contributor

@atsampson atsampson commented Aug 25, 2020

This does two things:

  • Add a reconstructed MIDAS 73, and use it to build Muddle. We've had a non-MOBY binary of it for a while, but we need a MOBY version (bigger symbol table) to build Muddle with. Doing the reconstruction reveals why it was kept around - the relocatable output code was completely rewritten in later versions, so this was the last version to support some STINK features. 73 also has different IO code, and if you run it as MIDASD it has a different symbol table for E&S display code.

  • Use different versions of the Tenex <mdl.int> sources to build Muddle. Previously we were using the latest version of each file (some of which were from 1983); we're now using the versions dated immediately before mdl106.exe was built in 1981, so they should correspond better to Muddle 106. They seem to have fewer dubious-looking hacks and no use of XMOVEI, at least.

The resulting Muddle binary now builds and initialises with the pure section starting correctly at 700000 (previously I'd hacked it to be 600000 since it ran out of space during initialisation). Zork still runs out of space if you try to load the whole game - but at least it now produces a sensible error rather than crashing.

If non-mangled versions of the <mdl.int> files become available in the future (PDP-10/muddle#5), we could check that the Tenex binaries for MIDAS and Muddle match the sources used here, and add the Tenex code to MIDAS 73. Similarly, our Muddle 56 is still missing DISPL, the display interface that was present in Muddle 54 (#1916); that file could be added in if it becomes available.

(Related to #681 Early MIDAS, #826 MIDAS bugfixes, #830 Muddle.)

This matches names recorded in MUDSYS; from 1977. Using BIN rather than
REL is a characteristic of early MIDAS.
This matches TS MUD54 from 1977, and makes debugging easier.
This matches a TS MUD from 1977, and is the same as TS MUD54 with the
addition of SGC. It's nearly the same as the Tenex order we had already.

There are a few differences between 54 and 56:

- CONST is new in 56;
- Three source files in 54 were merged into others in 56: TENTAB into
  READER, FLOATB into PRINT, and CHAN into FOPEN;
- DISPLA, which went between CREATE and SAVE in 54, is missing in 56.
This was edited from later versions of the source to match MUDDLE; TS
MIDAS circa 1973, which was built with MOBY==0. The program itself dates
from no later than 1971. Comments, and results when built with other
options, are probably not historically accurate.

MIDAS 73 is useful because 74 and all later versions have completely
rewritten code for relocatable output (and for IO), and they don't
support some of STINK's features correctly (or at all). A ported version
of MIDAS 73 was still being used to build Muddle in the 1980s, going by
<mdl.int>midas.exe.5.
Older versions of MIDAS expect you to type a command at them, which
makes them hard to automate with :x or XFILEs. This patch backports the
JCLINI code from later versions of MIDAS, which pre-stuffs the command
buffer with the JCL string if available.
The 1973 MUDDLE; TS MIDAS binary has these four instruction aliases with
SI at the end (and they weren't used in the 1973 Muddle at all). All
later versions of MIDAS use RI names, as does more recent Muddle source,
so this must have been patched in later.
This is the version of MIDAS that was being used at the time of Muddle
106 in 1980.
Looking at the backup dates for files in <mdl.int>, mdl106.exe is from
20th January 1981, whereas some of the source files are from a couple of
years later. Revert to the last version prior to 20th January 1981 -- in
every case, this was the earliest revision that was kept in <mdl.int>.

This undoes the changes that we'd previously made to these files, many
of which are no longer necessary now that we're using MIDAS 73.
Most of these are the same as before. For UUOH, I've taken the fixed ITS
conditionals from uuoh.mid.181 (16th March 1981). For MAPPUR, I've put
the Tenex conditional around the whole of the segment-switching code
since none of it is needed on ITS.

Note in particular that the BOT patch is no longer needed -- this
version of Muddle works happily with the pure region at 700000.
@larsbrinkhoff
Copy link
Member

I have noticed this too: ;XXX CONSTANTS emits two extra 0s It makes it harder to make bit-for-bit identical binaries.

@larsbrinkhoff
Copy link
Member

I believe the DISPLA code was removed because the E&E display was in disrepair by ~1977. But chances are it will make a return!

src/mudsys/main.351 Outdated Show resolved Hide resolved
Copy link
Member

@larsbrinkhoff larsbrinkhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work!

@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Aug 26, 2020

The 1971 TS MUDDLE prints MUDDLE ^?^?^?^?^? IN OPERATION. Perhaps it's only half baked?

@ZoBoRf
Copy link
Member

ZoBoRf commented Aug 26, 2020

The 1971 TS MUDDLE prints MUDDLE ^?^?^?^?^? IN OPERATION. Perhaps it's only half baked?

Perhaps they patched the version number in after build, like yout build script
(#1928 (comment)).

@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Aug 26, 2020

The build script no longer works.

respond "*" ":start\r"
respond "..PERM/   -1" ":pdump mudsav; ts mdl56\r"

doesn't match

*:start
MUDDLE INITIALIZATION.
*
..PERM/   BUFRIN   

Perhaps rather than the somewhat random string ..PERM from DDT internals, check for MUDDLE INITIALIZATION and *?

@atsampson
Copy link
Contributor Author

atsampson commented Aug 26, 2020

That's weird - it was OK in the log of my test build (with EMULATOR=pdp10-ka) last night:

D$$
strng/'MAIN$:   -1   $1"56^?^?^?$
:pdump mudsav; ts mud56
*:start
MUDDLE INITIALIZATION.
*
..PERM/   -1   :pdump mudsav; ts mdl56
*:kill

BUFRIN is indeed -1, but it's half-killed, so DDT shouldn't be using it for typeout.

It looks for ..PERM/ to check that the somewhat fragile Muddle initialisation process has completed correctly - this is the point at which it's likely to crash or print an error if something isn't right.

DDT might choose to output -1 as a symbol instead -- matching just
..PERM/ should still catch broken Muddle initialisation.
@atsampson atsampson merged commit 6fe7d99 into master Aug 26, 2020
@atsampson atsampson deleted the ats/muddier branch August 26, 2020 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants