ZX81 Resources

See all articles from Sinc-Link v4 n6
Author(s): Peter McMullin
Publication: Sinc-Link
Pub Details: Sinc-Link v4 n6 (Volume 4, Issue 6)
Date: November/December 1986
Pages: 3-4

Here once again is a column which has something for the owner of every model of Sinclair or Timex-Sinclair computer, from ZX81 to QL. (Note: My use of the term “ZX81” shall refer equally to TS1000 and TS1500 computers, unless noted otherwise.)

ZX81 DISK UPDATE

I’ve been promising a full review of the Larken Disk controller and LDOS for some time now. Hopefully it will fall together for our next issue. Part of the reason for the delay is the fact that a new DOS has been developed for the AERCO, and I wish to include it in presenting a (hopefully) balanced appraisal of current ZX81 disk options.

BBDOS is a fully automatic, BASIC-transparent DOS for the AERCO FD-ZX and ZX81. BBDOS locates in the 8-16K region of RAM, and is claimed to be compatible with all printer interfaces. BBDOS is available for U.S.$29.95, from Bill Bell, 596 Cherrington Road, Westerville, OH 43081, (614)-882-3883.

Further reports on BBDOS will appear as soon as I get a copy to play around with. The AERCO sure needs it. My current opinion is that the Larken system is by far the best deal for the ZX81. This is mainly because of the excellent LDOS. I’m not advocating that AERCO owners all run out and buy a Larken, (especially with the availability of BBDOS), but for the new buyer, the Larken is the obvious choice. The initial cost is nearly $100.00 less than either the AERCO or the Compusa, and you don’t have to spend an extra $30 to get an excellent DOS.

DUNGEON OF YMIR (TS1500)

Brief Description: Dungeon of Ymir is a multi-level maze adventure game written completely in machine code. Ymir requires 24K of RAM, and versions are available for the 1500 with a Hunter Board or other 8-16K RAM, OR for the 32K 1500 (with 16k Rampack). Ymir is true HI-RES, using a HI-RES technique which works only with the 1500 (NOT the 1000 or ZX81). A version for the ZX81/TS1000 is scheduled for release in the near future.

Dungeon of Ymir is available for $24.95 from FRED NACHBAUR, C-12, MTN. STN. GROUP BOX, NELSON, BC, CANADA V1L 5P1. Fred also has many other fine hardware and software products for the ZX81 family. Write for details.

WHAT IS THIS YMIR??

Upon loading (in 2 parts), a 64 column cover screen displays the Cast of Characters, and control keys. The object of the game is to successfully make it to the 9th level of the maze, retrieve the SWORD OF KASLO, and return it to your village. The game operates in the traditional form of the genre: you have a certain number of Hit Points (damage you can sustain), based on your Experience level, healing rate, and on what spells and potions you have at your disposal. On your journey, you will encounter 16 different types of monsters, lamps, mystery chests (which can be either very good or very bad), pits, ceiling holes, stairs up and down, gold (which is “cashed in” for Experience Points at the Temple of Asylum on each level), and an Oracle, who can hand out useful gifts, make suggestions, and punish impudence.

There are also several types of Spell Vials, which may be simply found in the maze, or in a mystery box, or handed out by the Oracle. These include Teleport spells, Rejuvenation spells, Healing potions, Drift spells, Shield spells, etc.

The playing screen is very impressive, with hi-res UDGs for all the monsters and objects. The maze is revealed only as you travel through it. As you proceed to lower levels, monsters become more difficult to cope with. Monsters are in constant motion, which starts randomly and takes on more evil intent as the game progresses! Critical information is displayed throughout the game on the bottom line of the screen. A FAST-SAVE with autoboot reloading permits the game to be saved in progress at any time, and reloaded in 70 seconds. I have found the fast save/load to be very reliable.

Conclusions: I must confess that I was very skeptical when I first loaded YMIR, since I’ve never been a D&D-type game afficionado. (“OK, I’ll load Fred’s new game, just to be polite…”) My skepticism quickly turned to interest, curiosity, frustration, fascination, addiction. The graphics and animation are excellent (the little man bends over when you pick something up!), and the presentation of auxiliary screens (progress reports, etc.) is snappy and eye-catching. Dungeon of Ymir is, in the words of its author, “easy to play, difficult to master”. I’m hooked, and I have yet to live past the 3rd level. This game has even made me late for work. Dungeon of Ymir is five-star software: a MUST-HAVE. You’ve really done it this time, Fred!

MORE MODified Shapes

A tiny error crept into the program listing in ZX81 Resources #8: Line 730 should read: LET ARG=C, rather than LET C=ARG, as it appeared. This error doesn’t cause a serious problem, but it affects the colour mapping of the pattern and looks better when corrected.

More MODULO math: last time, we discussed the use of the MOD operator in IBM BASIC, and its mathematical derivation. In the MODified Triangles program, we used a one-line subroutine to replace the MOD command, which looked like this:

5 REM MODULO SUBROUTINE
6 LET RES=ARG-INT (ARG/MOD)*MOD
7 RETURN

The variables used are:

RES: The result
ARG: The numeric argument
MOD: The MODULO divisor.

Thus, the program lines:

100 LET ARG=X
110 LET MOD=Y
120 GOSUB 5

Would yield the same result as the IBM BASICA line:

100 (LET) RES= X MOD Y

The MOD operator is commonly used to check for perfect integer divisions, and to generate number sequences. For example, any number taken MOD 5 will result in 0 if the number is evenly divisible by 5, or the integer remainder if it is not evenly divisible.

Further, if one wrote a short loop:

10 LET N=0
20 LET N=N+1
30 LET C= N MOD 5 (or equivalent-see above)
40 GOTO 20

You will see that as N increases linearly towards infinity, the variable C will repeat endlessly through the sequence 0,1,2,3,4,0,1,2,3,4,0,1,…

These properties of the MOD operator lend it to a wide variety of uses in many different types of programs.

The program presented this issue is adapted from “MODified Shapes for IBM”, by Paul W. Carlson, in COMPUTE! magazine, May 1986 issue. The result is similar to the MODified Triangles program printed last time.

To further quote Mr. Carlson: “MOD is also useful when arrays must be treated as circular rather than linear. For example, say you have a numeric array X composed of three elements, and that elements X(1), X(2), and X(3) contain the X coordinates for the vertices (corners) of a triangle. In this case, if X(n) is the X coordinate for the beginning of a side, then the expression X(n MOD 3+1) gives the X coordinate for the end of that side. This sort of expression appears in Programs 1, 2, and 3 which compute the variable NJ with MOD. The result becomes an index into the arrays containing the vertex coordinates whenever the program needs to know the values for the end of a side.”

In these programs, “The variable SU selects the spot on the side of a figure where the figure’s corner will land after it is rotated and redrawn. If you’re not sure what that means, try changing SU to a slightly different value and rerunning the program… “The variables I and J represent the column and row of the current figure. The arrays X and Y contain the relative vertex coordinates for the current rotation. The arrays Z and T contain relative vertex coordinates for the next rotation. N is the current rotation, M is the current side of the polygon, and NJ performs the function described above.”

Here’s the listing for program 2, MODified Squares. For T/S2068, ZX81 with JLO Video System and JOBASIC or PIXL-ATR, or with any software hi-res package which provides a DRAW or LINE command.

   2 REM For ZX81: INITIALIZE JOBASIC OR PIXL-ATR ETC.
3 GOTO 40
5 REM MODULO SUBROUTINE
6 LET RES=ARG-INT (ARG/MOD)*MOD
7 RETURN
10 REM IBM>SINCLAIR PLOT SCALING
15 LET XX1=(X1/1.25)+XSET
20 LET XX2=(X2/1.25)+XSET 2068: USE
25 LET YY1=191-(Y1/1.1) YY1=175-(Y1/1.3)
30 LET YY2=191-(Y2/1.1) YY2=175-(Y2/1.3)
35 RETURN
40 DIM X(4)
50 DIM Y(4)
60 DIM Z(4)
70 DIM T(4)
80 LET XSET=-3
100 LET SU=.12
110 LET RU=1-SU
200 FOR I=0 TO 3
210 FOR J=0 TO 3
220 LET ARG=I
230 LET MOD=2
240 GOSUB 5
250 LET RI=RES
260 LET ARG=J
270 GOSUB 5
280 IF RI=RES THEN GOTO 400
300 LET Y(1)=49
310 LET Y(2)=0
320 LET Y(3)=0
330 LET Y(4)=49
340 GOTO 500
400 LET Y(1)=0
410 LET Y(2)=49
420 LET Y(3)=49
430 LET Y(4)=0
500 LET X(1)=20
510 LET X(2)=20
520 LET X(3)=89
530 LET X(4)=89
600 FOR N=0 TO 17
610 LET X1=X(4)+I*69
620 LET Y1=Y(4)+J*49
700 FOR M=1 TO 4
710 LET X2=X(M)+I*69
720 LET Y2=Y(M)+J*49
800 LET ARG=M
810 LET MOD=2
820 GOSUB 5
830 LET C=RES+1
835 REM SET INK COLOUR BY C
840 GOSUB 10
850 REM DRAW SIDE (JOBASIC)
855 IF USR V THEN LPRINT D;XX1,YY1;XX2,YY2
860 REM DRAW SIDE (2068)
865 PLOT XX1,YY1: DRAW XX2-XX1,YY2-YY1
870 LET X1=X2
875 LET Y1=Y2
880 LET ARG=M
885 LET MOD=4
890 GOSUB 5
895 LET NJ=RES+1
900 LET Z(M)=RU*X(M)+SU*X(NJ)
910 LET T(M)=RU*Y(M)+SU*Y(NJ)
920 NEXT M
1000 FOR P=1 TO 4
1010 LET X(P)=Z(P)
1020 LET Y(P)=T(P)
1030 NEXT P
1040 NEXT N
1050 NEXT J
1060 NEXT I
1070 IF INKEY$="" THEN GOTO 1070
1080 STOP

Note that JOBASIC and PIXL-ATR use ABSOLUTE coordinates for the DRAW command, while the 2068 uses DRAW coordinates which are RELATIVE to the last point plotted. More on this, and another neat listing in the next ZX81 Resources.

MODified Squares output pattern
MODified Squares output pattern

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.