Load Tracker

This file is part of and Timex Sinclair Public Domain Library Tape 1004. Download the collection to get this file.
Developer(s): Tony Willing
Date: 198x
Type: Program
Platform(s): TS 1000

This program is a load-tracking utility for tabletop role-playing games, implementing the encumbrance rules from Advanced Dungeons & Dragons. It accepts a character’s Strength score (including the fractional 18/xx exceptional strength values encoded as decimals like 18.999 for 18/00), then iteratively subtracts the gold-piece weight equivalents of carried weapons, supplies, and armour from the character’s carrying capacity. The result is displayed as both a pound weight and a GP-value equivalent, and a movement rate (in inches per round) is derived from the remaining load. The program uses two subroutines at lines 5200 and 5300 to clear specific screen regions between input phases, and a decorative border routine at line 5000 uses block graphics characters to frame the display.


Program Analysis

Program Structure

The program is organised into a main sequential flow (lines 7–1450) and four subroutines:

  • 50005120: Draws the decorative border and title screen.
  • 52005230: Clears the prompt area (rows 17–20).
  • 53005330: Clears the menu area (rows 1–14).
  • 55005520: CLEAR and SAVE block (reached only if execution falls through past line 4999).

Each subroutine is followed by a STOP statement (lines 5130, 5240, 5340) as a guard against fall-through. The main loop ends with PAUSE 4E4 then RUN to restart cleanly.

Encumbrance Model

The program models the AD&D 1st-edition encumbrance system. A base weight allowance WA is initialised to 500 GP-value units, then adjusted by the character’s Strength score. Items are then subtracted from WA, and the remaining capacity is displayed in both GP-value and pound units (dividing by 10). Movement rate is derived from the total weight carried (MVT = (LC-WA)/10):

Weight Carried (lbs)Movement Rate
> 1053″ per round (O.S.)
71–1056″ per round
36–709″ per round
≤ 3512″ per round

Strength Score Encoding

AD&D exceptional Strength for fighters (scores above 18) is normally written as 18/xx. This program encodes those fractional values as decimals: 18.01–18.50 maps to +1000 GP capacity, up to 18/00 entered as 18.999 for +3000. Scores of 19–25 represent super-human strength tiers. The check IF ST=INT PI (line 150) is an idiomatic way to test ST=3 without using the literal digit, saving a byte.

Key BASIC Idioms

  • GOSUB VAL "5000" at line 10: using VAL "number" for GOSUB targets is a well-known memory optimisation that stores the target as a string rather than a floating-point number.
  • SGN PI evaluates to 1 and NOT PI evaluates to 0; these are used throughout as compact ways to write the constants 1 and 0 in PRINT AT and FOR statements.
  • CODE STR$ PI at lines 5090–5100: STR$ PI produces "3.14159...", and CODE of that string returns the character code of "3", which is 51 on the ZX81 character set — used here to position a corner graphic at column 51, which is off-screen on a 32-column display and likely a bug or miscalculation; the intended column was probably 31.
  • Inverse-video strings (e.g. "%E%N%T%E%R%...") are used for highlighted prompts and the title.

Screen Layout

The border subroutine at line 5000 prints block-graphic corner and edge characters to build a full-screen box. Lines 5010–5030 print left and right vertical edges for rows 1–20 using TAB NOT PI (column 0) and TAB 31. Lines 5050–5080 draw a horizontal divider at rows 15–16 across columns 0–30, then place corner pieces. The title “LOAD-TRACKER” is printed in inverse video at row 0, column 10.

Bugs and Anomalies

  • Line 890 validation bug: The supplies input loop at line 890 re-checks WE (weapon variable) instead of SU (supplies variable). The condition IF WE>12 OR WE<0 will never be true at this point since WE was already validated, so all supply inputs pass through unchecked for range.
  • Line 150 — INT PI: INT PI = 3, so this correctly tests for Strength 3, the minimum. This is intentional.
  • CODE STR$ PI column: On a 32-column display columns are 0–31; column 51 is out of range and will likely wrap or cause an error depending on the ROM version.
  • Line 1170 — LET WA=WA-0: A no-op for armor type 1 (none/magic), included purely for structural consistency with the other armor cases.
  • Line 620 missing: There is no line 620; the program skips from 610 to 630. This is harmless but suggests an editing deletion.
  • Weapon input loop reuse: After entering weapons (loop at 560–700), the user presses 0 to exit. The same pattern is reused for supplies and armor, but the supplies loop incorrectly re-validates WE as noted above.

REM Usage

Line 0 contains the program title and author credit (“LOAD-TRACKER BY ANTHONY WILLING, 11/84”) in inverse video within a REM statement. Line 20 contains a REM with inverse “FAST” suggesting a FAST mode directive was intended but never inserted as executable code. Line 990 labels the clothing weight deduction section.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10176 – 10210.

Related Products

Related Articles

Related Content

Image Gallery

Load Tracker

Source Code

   0 REM  % %L%O%A%D%-%T%R%A%C%K%E%R% %B%Y%                % %A%N%T%H%O%N%Y% %W%I%L%L%I%N%G%                % % % % % %(%1%1%/%8%4%)% % % % % 
   5 REM 
   7 CLS 
  10 GOSUB VAL "5000"
  20 REM   % % % % % % % % % %F%A%S%T% % % % % % % % 
  90 LET WA=VAL "500"
 100 PRINT AT 18,2;"INPUT YOUR STRENGTH"
 110 PRINT AT 19,2;"IF ABOVE 18, INPUT AS 18.00"
 115 PRINT AT 20,2;"IF 18/00, ENTER AS 18.999"
 120 INPUT ST
 130 IF ST<3 OR ST>25 THEN GOTO 120
 140 GOSUB 5200
 150 IF ST=INT PI THEN LET WA=WA-350
 160 IF ST=4 OR ST=5 THEN LET WA=WA-250
 170 IF ST=6 OR ST=7 THEN LET WA=WA-150
 180 IF ST=12 OR ST=13 THEN LET WA=WA+100
 190 IF ST=14 OR ST=15 THEN LET WA=WA+200
 200 IF ST=16 THEN LET WA=WA+350
 210 IF ST=17 THEN LET WA=WA+500
 220 IF ST=18 THEN LET WA=WA+750
 230 IF ST>18 AND ST<=18.5 THEN LET WA=WA+1000
 240 IF ST>18.5 AND ST<=18.75 THEN LET WA=WA+1250
 250 IF ST>18.75 AND ST<=18.9 THEN LET WA=WA+1500
 260 IF ST>18.9 AND ST<=18.99 THEN LET WA=WA+2000
 270 IF ST=18.999 THEN LET WA=WA+3000
 280 IF ST=19 THEN LET WA=WA+4500
 290 IF ST=20 THEN LET WA=WA+5000
 300 IF ST=21 THEN LET WA=WA+6000
 310 IF ST=22 THEN LET WA=WA+7500
 320 IF ST=23 THEN LET WA=WA+9000
 330 IF ST=24 THEN LET WA=WA+12000
 340 IF ST=25 THEN LET WA=WA+15000
 350 LET LC=WA
 360 PRINT AT 18,2;"INPUT GOLD PIECE VALUE"
 370 PRINT AT 19,2;"OF MONEY CARRIED"
 380 INPUT GO
 390 GOSUB 5200
 400 LET WA=WA-(GO/10)
 410 PRINT AT 18,2;"IDENTIFY WEAPONS CARRIED"
 420 PRINT AT 19,2;"FROM THE FOLLOWING LIST"
 430 PRINT AT 2,2;"(1) LONGSWORD"
 440 PRINT AT 3,2;"(2) 2 HANDED SWORD"
 450 PRINT AT 4,2;"(3) SHORT SWORD"
 460 PRINT AT 5,2;"(4) QUARTER STAFF"
 470 PRINT AT 6,2;"(5) SCIMITAR"
 480 PRINT AT 7,2;"(6) MACE"
 490 PRINT AT 8,2;"(7) JAVELIN"
 500 PRINT AT 9,2;"(8) HAMMER"
 510 PRINT AT 10,2;"(9) HALBERD"
 520 PRINT AT 11,2;"(10) FLAIL"
 530 PRINT AT 12,2;"(11) DAGGER"
 540 PRINT AT 13,2;"(12) BOW AND ARROWS"
 550 PRINT AT 14,5;"%E%N%T%E%R% %<%0%>% %W%H%E%N% %F%I%N%I%S%H%E%D"
 560 INPUT WE
 565 IF WE>12 OR WE<0 THEN GOTO 560
 570 IF WE=1 THEN LET WA=WA-60
 580 IF WE=2 THEN LET WA=WA-250
 590 IF WE=3 OR WE=10 THEN LET WA=WA-35
 600 IF WE=4 OR WE=6 OR WE=8 THEN LET WA=WA-50
 610 IF WE=5 THEN LET WA=WA-40
 630 IF WE=7 THEN LET WA=WA-20
 650 IF WE=9 THEN LET WA=WA-175
 670 IF WE=11 THEN LET WA=WA-10
 680 IF WE=12 THEN LET WA=WA-90
 690 IF WE=0 THEN GOTO 710
 700 GOTO 560
 710 GOSUB 5300
 720 GOSUB 5200
 730 PRINT AT 18,2;"IDENTIFY SUPPLIES CARRIED"
 740 PRINT AT 19,2;"FROM THE FOLLOWING LIST"
 750 PRINT AT 2,2;"(1) SPELL COMPONENTS/HERBS"
 760 PRINT AT 3,2;"(2) IRON SPIKE"
 770 PRINT AT 4,2;"(3) LEATHER PACK OR SACK"
 780 PRINT AT 5,2;"(4) LEATHER POUCH OR BAG"
 790 PRINT AT 6,2;"(5) LANTERN"
 800 PRINT AT 7,2;"(6) FLASK OF OIL/HOLY WATER"
 810 PRINT AT 8,2;"(7) 10 FOOT POLE"
 820 PRINT AT 9,2;"(8) 50 FEET OF ROPE"
 830 PRINT AT 10,2;"(9) WINE SKIN"
 840 PRINT AT 11,2;"(10) THIEVES TOOLS"
 850 PRINT AT 12,2;"(11) TINDER BOX"
 860 PRINT AT 13,2;"(12) 1 WEEK OF RATIONS"
 870 PRINT AT 14,5;"%E%N%T%E%R% %<%0%>% %W%H%E%N% %F%I%N%I%S%H%E%D"
 880 INPUT SU
 890 IF WE>12 OR WE<0 THEN GOTO 880
 900 IF SU=1 OR SU=2 OR SU=4 OR SU=6 THEN LET WA=WA-10
 910 IF SU=3 OR SU=9 THEN LET WA=WA-20
 920 IF SU=5 OR SU=7 THEN LET WA=WA-50
 930 IF SU=8 OR SU=10 OR SU=11 THEN LET WA=WA-40
 940 IF SU=12 THEN LET WA=WA-70
 950 IF SU=0 THEN GOTO 970
 960 GOTO 880
 970 GOSUB 5300
 980 GOSUB 5200
 990 REM %F%O%R% %C%L%O%T%H%I%N%G
 1000 LET WA=WA-40
 1010 PRINT AT 18,2;"SPECIFY ARMOR TYPE"
 1020 PRINT AT 19,2;"FROM THE FOLLOWING LIST"
 1030 PRINT AT 2,2;"(1) NONE OR MAGIC ARMOR"
 1040 PRINT AT 3,2;"(2) ANY HELMET"
 1050 PRINT AT 4,2;"(3) SMALL SHIELD/BUCKLER"
 1060 PRINT AT 5,2;"(4) MEDIUM SHIELD"
 1070 PRINT AT 6,2;"(5) LARGE SHIELD"
 1080 PRINT AT 7,2;"(6) PLATE MAIL"
 1090 PRINT AT 8,2;"(7) SPLINT/BANDED MAIL"
 1100 PRINT AT 9,2;"(8) CHAIN/SCALE MAIL"
 1110 PRINT AT 10,2;"(9) RING MAIL/STUDDED LEATHER"
 1120 PRINT AT 11,2;"(10) LEATHER/PADDED ARMOR"
 1130 PRINT AT 12,2;"(11) FIELD PLATE ARMOR"
 1140 PRINT AT 14,5;"%E%N%T%E%R% %<%0%>% %W%H%E%N% %F%I%N%I%S%H%E%D"
 1150 INPUT AR
 1160 IF AR>12 OR AR<0 THEN GOTO 1150
 1170 IF AR=1 THEN LET WA=WA-0
 1180 IF AR=2 THEN LET WA=WA-30
 1190 IF AR=3 OR AR=10 THEN LET WA=WA-50
 1200 IF AR=4 OR AR=9 THEN LET WA=WA-100
 1210 IF AR=5 OR AR=8 THEN LET WA=WA-150
 1220 IF AR=6 THEN LET WA=WA-350
 1230 IF AR=7 THEN LET WA=WA-250
 1240 IF AR=11 THEN LET WA=WA-200
 1250 IF AR=0 THEN GOTO 1270
 1260 GOTO 1150
 1270 GOSUB 5300
 1280 GOSUB 5200
 1290 PRINT AT 2,2;"YOUR LOAD CAPACITY IS"
 1300 PRINT AT 3,2;INT (LC/10);" ";"POUNDS/";INT LC;" G.P. VALUE"
 1310 PRINT AT 5,2;"YOU ARE NOW CARRYING"
 1320 PRINT AT 6,2;INT ((LC-WA)/10);" POUNDS/";INT (LC-WA);" G.P. VALUE"
 1330 PRINT AT 8,2;"YOU HAVE IN RESERVE"
 1340 PRINT AT 9,2;INT (WA/10);" POUNDS/";INT WA;" G.P. VALUE"
 1350 PRINT AT 11,2;"ENOUGH TO CARRY"
 1360 PRINT AT 12,2;INT (WA*10);" COINS"
 1370 LET MVT=(LC-WA)/10
 1380 IF MVT>105 THEN PRINT AT 18,2;"3"" MVT/ROUND MAXIMUM (O.S.)"
 1390 IF MVT>70 AND MVT<=105 THEN PRINT AT 18,2;"6"" MVT/ROUND MAXIMUM (O.S.)"
 1400 IF MVT>35 AND MVT<=70 THEN PRINT AT 18,2;"9"" MVT/ROUND MAXIMUM (O.S.)"
 1410 IF MVT<=35 THEN PRINT AT 18,2;"12"" MVT/ROUND MAXIMUM (O.S.)"
 1420 PRINT AT 20,SGN PI;"%P%R%E%S%S% %A%N%Y% %K%E%Y% %F%O%R% %A%N%O%T%H%E%R% %R%U%N% "
 1430 PAUSE 4E4
 1440 CLS 
 1450 RUN 
 4999 STOP 
 5000 PRINT ":';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;':"
 5010 FOR Z=SGN PI TO 20
 5020 PRINT TAB NOT PI;"% ";TAB 31;"% ";
 5030 NEXT Z
 5040 PRINT ":.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.:"
 5050 PRINT AT 16,NOT PI;":'"
 5051 PRINT AT 15,NOT PI;":'"
 5060 FOR Z=SGN PI TO 30
 5065 PRINT AT 15,Z;",,"
 5070 PRINT AT 16,Z;";;"
 5080 NEXT Z
 5090 PRINT AT 15,CODE STR$ PI;"':"
 5100 PRINT AT 16,CODE STR$ PI;"':"
 5110 PRINT AT NOT PI,10;"%L%O%A%D%-%T%R%A%C%K%E%R"
 5120 RETURN 
 5130 STOP 
 5200 FOR Z=17 TO 20
 5210 PRINT AT Z,SGN PI;"                              "
 5220 NEXT Z
 5230 RETURN 
 5240 STOP 
 5300 FOR Z=1 TO 14
 5310 PRINT AT Z,SGN PI;"                              "
 5320 NEXT Z
 5330 RETURN 
 5340 STOP 
 5500 CLEAR 
 5510 SAVE "1020%8"
 5520 RUN 

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

Scroll to Top