[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re-engineered: Wizardry III, Legacy of Llylgamyn



Differences in versions of Wizardry III (Part 2 of xx)
------------------------------------------------------

WIZARDRY.CODE differences

Starting at Block 6 (T$0 S$3) is WIZARDRY.CODE.  The first part of
this file is the Segment Dictionary.  Starting at address $40 you can
see the segment names:  WIZARDRY, UTILITIE, SHOPS, SPECIALS, …RUNNER.
Above these names are 4 byte records for up to 16 segments.  The first
4 bytes are for WIZARDRY, the next 4 bytes are for UTILITIE, etc.  The
4 bytes are the length and relative offset to the segments procedure
table.  The length and offset are in "little-endian" notation.

In the segment dictionary we notice differences in the lengths for
WIZARDRY, SHOPS, SPECIALS, CUTIL, ROLLER, REWARDS, and RUNNER.  I will
now describe the changes to these segments.

WIZARDRY segment
================

One odd thing about the WIZARDRY.CODE file is that the WIZARDRY
segment is found at the beginning of the file and not at the end.
Since this is the ML for the file I would expect to find it at the end
of the file similar to the WIZUTIL.CODE mainline segment.  Because of
this a binary comparison of the released Wizardry III with my compiled
version generates a lot of differences even though the actual
executable code is identical.

OVERUNDR subroutine
-------------------

In my source code you can find a routine called OVERUNDR that is
called from ADDLONGS and SUBLONGS.  This subroutine was added to the
code in the Aug version.  It is number $29, so all references to
procecures (and functions) with larger values are now different
between the two versions.  For example, INT2BCD was $29 in the May
version and is now $2A.

DRAWSCR subroutine
------------------

The code in DRAWSCR  (6502 code) has been altered.   Following the
label L4EDF is a test and BEQ L4F15.  This is new code in the Aug
version.  This code has something to do with painting the HiRes screen
based on the values found in the staging area (the Lo-Res screen).
The Aug version seems to now process values 0 and 64 differently than
before.  For 0 and 64, the values stored at the Hi-Res screen location
are cleared to 0 for the 8 bytes that represent the "character".

DRAWLINE subroutine
-------------------

The code in DRAWLINE is nearly identical in both versions, except for
one instruction near the top where the May version had "ORA #$80" to
ALWAYS set the value, but the Aug version has an "ADD #$80" to TOGGLE
the value.


SHOPS segment
=============

TRANSACT subroutine
-------------------

A fix was added to TRANSACT.  If a new "back room" object is sold to
Boltac's, instead of setting the inventory count to 1 (as in May), it
is now set to the "back room" value + 1.  By "back room" value I am
referring to those items that are added to the list of objects for
sell after another item has "sold out".

  2325 8   22:5   562   IF OBJECT.BOLTACXX < - 1 THEN
  2326 8   22:6   570     OBJECT.BOLTACXX := 1 - OBJECT.BOLTACXX
  2327 8   22:5   571   ELSE

ENTMAZE subroutine
------------------

In ENTMAZE three global variables are now initialized to 0:
  SAVEX, SAVEY, SAVELEV.

CONGRATS subroutine
-------------------

Messages in CONGRATS have been altered.  An extraneous blank character
has been inserted into a message:

  2719  CENTSTR( MAINWIN, 'WILL YOU SURRENDER  THE ORB TO');
    old:  WILL YOU SURRENDER THE ORB TO
    new:  WILL YOU SURRENDER  THE ORB TO

Since messages in Pascal are on EVEN word boundaries, this change has
a ripple effect on the next few lines of P-code that are generated.

Other messages in CONGRATS have also been changed:

  YOUR PARTY THE STAR OF LLYLGAMN (*),
  YOUR PARTY THE STAR OF LLYLGAMYN (*)

  INVITE YOU  TO SELECT
  AND INVITE  YOU  TO SELECT

   OTHERS  WHO
   OTHERS

  ALSO DESERVE THIS AUGUST TITLE!
  WHO ALSO DESERVE THIS AUGUST TITLE!


SPECIALS segment
================
  53 procedures in May 1983
  49 procedures in Aug 1983

INSPECT subroutine
------------------

In INSPECT before calling EXITPICK a call to DELWIN is made to release
TEMPWIN memory.

DOSEARCH subroutine
-------------------

In DOSEARCH, the variable ENCB4RUN (encounter before run) is now set
to FALSE.  This is after "Search" was answered "Y" and is before
entering combat.

SWITCHLOC subroutine
--------------------

SWITCHLOC has been completely rewritten.
  1. The local variables are removed (MP01 and MP2C).
  2. A test is now performed to see if we should go to
     RUNNER or NEWMAZE
      3849   9   43:1     4         IF SAVELEV = MAZELEV THEN
      3850   9   43:2    11           XGOTO := XRUNNER
      3851   9   43:1    11         ELSE
      3852   9   43:2    17           XGOTO := XNEWMAZE;
  3. Calls to SWITCH are made for 3 items:
      3853   9   43:1    21         SWITCH( MAZEX,   SAVEX);
      3854   9   43:1    28         SWITCH( MAZEY,   SAVEY);
      3855   9   43:1    35         SWITCH( MAZELEV, SAVELEV);

  Old code looks like it used RANDOM to determine new direction
  you are facing.

  Old code always went to RUNNER.

In the old code, routines $2D to $30 have been removed.  These are all
related to the change with SWITCHLOC.


CUTIL segment
=============

CACTION routine
---------------

This code was modified to build up the response string (FDSUPRT) as
the menu option string is being built.  This was done to increase
performance.  Later in the code the input buffer is checked to see if
a character is available and if it is a valid one.  If it is, then the
menu is not displayed.  There are many times when you know you are
going to type "F F F P P P" during an encounter.  This speeds up the
process by not re-displaying the option menu every time.

  5099  12    2:7   518   FDSUPRT := CONCAT( FDSUPRT, 'UPRT');
  5100  12    2:7   548   IF CHKKEYBD THEN
  5101  12    2:8   555     BEGIN
  5102  12    2:9   555       GETKEY;
  5103  12    2:9   558       BASE04 := -1;
  5104  12    2:9   562       FOR CHX := 1 TO LENGTH( FDSUPRT) DO
  5105  12    2:0   577         IF INCHAR = FDSUPRT[ CHX] THEN
  5106  12    2:1   585           BASE04 := CHX - 1
  5107  12    2:8   586     END

  5113  12    2:7   603   IF BASE04 = -1 THEN
  5114  12    2:8   609     BEGIN
  5115  12    2:9   609       UNITCLEAR( 1);
  5116  12    2:9   612       BASE04 := MENU( COMB1WIN,
  5117  12    2:9   615         CONCAT( FDSUPRT1, 'U)SE/P)ARRY
                                        /R)UN/T)AKE BACK'))
  5118  12    2:8   664     END;


CASTCHK routine
---------------

The old code was testing both conditions in one IF statement.  The new
code has them split into 2 IF statements.

  4858  12   14:3    16 IF SPELLI < 22 THEN
  4859  12   14:4    21   BEGIN
  4860  12   14:5    21     IF CHARACTR[ MYCHARX].MAGESP[ SPELLGR]
                               > 0 THEN

ROLLER segment
==============

RITEPASS subroutine
-------------------
There was a grammatical error with the word "it's" that has been
corrected.
  old:
       THE TEMPLE PRIESTS LINK UP THIS
       ANCESTRAL SPIRIT WITH IT'S
       DESCENDANT...

  new:
       THE TEMPLE PRIESTS LINK UP THIS
       ANCESTRAL SPIRIT WITH ITS
       DESCENDANT...

NOCHANGE subroutine
-------------------

An "EXIT()" was inserted at the end of this routine to return back a
couple of levels.
  8310  17   22:1    89             EXIT( CHGCLASS)

The problem they are trying to fix is the following:
  If you are one class and you can only change to one class then
  don’t solicit to "change class".

In the May 1983 code, it would still fall into the "change into xxx"
code, which is kind of silly if you are one class and can only change
into that one class.

There is still an interesting bug that they perhaps did not think of.
It is possible that you are currently one class of character (say
FIGHTER), but you do not have the attributes for a FIGHTER, but you do
qualify to change to another character class (MAGE).  The Aug code
will not allow you to change from FIGHTER to MAGE in this case.


REWARDS segment
===============

In DISARMTR a bug was fixed.  If TRAPTYP was 3 for a chest, and you
typed the wrong trap name, then there was no damage done.  To fix this
a DOTRAPDM call was inserted following the case statement.
   10169  19   25:5   296                 DOTRAPDM


RUNNER segment
==============
  The May code had 62 procedures.
  The Aug code has 70 procedures.

DRAWMAZE subroutine
-------------------

Calls to new routines were added after STEP2 (STEPFRWD, STEP3,
STEPFRWD, and STEP4):

 11504  20    2:1    99         STEP2;
 11505  20    2:1   101         STEPFRWD;
 11506  20    2:1   103         STEP3;
 11507  20    2:1   105         STEPFRWD;
 11508  20    2:1   107         STEP4;

MAZELINB subroutine
-------------------
  This subroutine was added in Aug.

In the May version, all the calls to DRAWLINE were directly made with
9 parameters, the first 3 always being the same.

In the Aug version, the call to DRAWLINE is now in MAZELINB with the
first 3 parameters always the same, and the other 6 parameters passed
in.

The net effect is a reduction in the overall amount of P-code
generated.

Since MAZELINB was inserted as procedure $C (12), references to all
procedures later in the code are now different.

RUNMAIN subroutine
------------------
  A call to PRSTATS was inserted when toggling the stats screen
  with "O".

RUNINIT subroutine
------------------

A call to PRSTATS was inserted when starting RUNNER.


Next up is WIZUTIL.CODE changes....

--Tommy