8000 Plus / PCW Plus typeins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  In general I have transcribed listings from the 'Listings' section. Listings
in other sections of the magazine, such as 'Tipoffs' or one-off articles, 
haven't always been transcribed; though I've done a few that caught my eye.

  In issues 10-106 (plus one Tipoff in issue 110), programs were printed with 
checksum figures against each line, making it much easier to catch typos. The 
'Checker' directory contains the three checksum programs used over the 
magazine's run, plus C versions which were used as my main aid when keying 
these programs.

  Bug fixes published in later issues have been applied where appropriate. I
have also made one or two bug fixes of my own, where the error was obvious,
and some portability fixes, in places where code specific to the PCW or to a 
particular version of Mallard BASIC could easily be replaced.

  If programs were supplied wholly or partly as machine code, I've included a
disassembly.

Known bugs and issues
~~~~~~~~~~~~~~~~~~~~~

  My testing of the programs has been on the cursory side. Some bugs I have
spotted are:

* 027/sol.bas does not draw numbers on the marbles, though a screenshot in
 the magazine suggests it should.

* The programs generated by 060/designer.bas appear to be a little shaky.

* File copy programs have a common tendency to append stray bytes, or whole
 stray records, to the file they're copying.

Personal comments, from my experience typing these listings:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- The per-line listing checksum is a brilliant concept -- a simple algorithm
 which catches typos, missed letters and transpositions. It's saved me no end
 of time keying listings, and it's a great pity such a facility wasn't native
 to all 1980s microcomputer BASICs; in an era when software distribution by
 magazine listing was so common, it would have been a major boon.

- It would have been nice to have the listings printed in a font where the 
 digit '1' and the letter 'l' didn't have such a similar appearance. 

- One place where Sinclair BASIC has the edge over Mallard BASIC is that the
 screen and printer are standard streams, and it's possible to divert output
 to one or the other using PRINT # commands. Mallard's PRINT # doesn't support
 device special files, so programs either have to include up to three separate
 output routines (screen with PRINT, printer with LPRINT, file with PRINT #) 
 or resort to POKEing the internals of the BASIC interpreter.
   For screen/printer switching, a better solution than POKEing would have 
 been to do this:

	conout=UNT(256*PEEK(2)+12)
        lstout=UNT(256*PEEK(2)+15)

 and use OPTION PRINT=lstout or OPTION LPRINT=conout. But it seems that 
 no-one who sent listings in to PCW Plus was aware of this technique. When
 transcribing these listings, I've used it where possible to replace the 
 interpreter-specific POKEs.

- I'd prefer not to have to type any more variations on 
    DEF FNat$(x,y)=CHR$(27)+"Y"+CHR$(x+32)+CHR$(y+32)  if I can help it.

Notes on portability:
~~~~~~~~~~~~~~~~~~~~~

  The programs were all originally intended for Mallard BASIC on the Amstrad
PCW. Some of them, such as the listing checker CHECK3, will work unmodified 
under Mallard BASIC on other systems (maybe even Mallard-86 BASIC under DOS). 
However, some modifications may be necessary.

  As an example, I have included a port of 024/ethernet.bas to Spectrum +3 
CP/M. Load and run ether1p3.bas.

* A few programs, more common in the early days when all PCWs shipped with 
 Mallard 1.29 or 1.39, make POKEs to the internals of the BASIC interpreter. 
 I've tried to correct these where possible, but 039/fireworx.bas and 
 055/triple.bas still require version 1.29 or 1.39.

* It's common for a PCW program to initialise the random number generator from 
 the system clock with a variant of RANDOMIZE PEEK (64504!). When typing in 
 these listings, I've replaced such calls with the slightly more portable 

    clock=256*PEEK(2)-10: RANDOMIZE PEEK(clock+2))

  which additionally works on the CPC and Spectrum+3. However, it still 
  assumes the program is running on a CP/M Plus system with an 
  interrupt-driven clock. If your computer doesn't match this description, 
  you'll need to find some other source of entropy.

* Many programs assume a 90-column screen, and will need layout changes for
 a smaller screen.

* Any program that does screen effects uses escape codes aimed at the PCW's 
 VT52 terminal emulation (which is shared by the CPC and Spectrum +3). When 
 targeting computers that use a different terminal emulation, appropriate 
 alternative escape codes will be needed.

* Programs that print will mostly assume Epson FX-80 escape sequences are in
 use.

* Some programs assume that drive M: exists and should be used to hold 
 temporary files. The following:

    tdrive=256*PEEK(2)-20: tdrive$=CHR$(64+PEEK(tdrive))

 will retrieve the letter of the CP/M 3 temporary drive, or "@" to use 
the current drive.

* Machine-code subroutines (for such functions as pixel graphics or redefining
 the character set) tend to manipulate hardware registers directly, and would
 need wholesale rewriting.
   (024/ether1p3.bas includes an improved font loader that works on the CPC,
 PCW, Spectrum +3 in 32x24 mode and PCW16 in 30x80 mode; so for programs 
 targeting these machines, fonts should not be a problem).

  It may also be possible to load programs that do not use Mallard-specific 
functions under other interpreters, such as Microsoft MBASIC. However, the use
of the Mallard-specific helper functions UPPER$ and LOWER$ is very common; and
any program that uses Jetsam would need a complete rewrite.


