SHANGHAI
========

Shanghai is a solitaire puzzle played with mahjong tiles. The
original game was designed by Brodie Lockard and published by
Activision in 1986. The SAM Coupe version was written by
Frantisek Fuka (Fuxoft) in 1990 - the graphics, the music for
the SAA 1099 sound chip and the game code are his work.

This version is a conversion of the SAM Coupe version to the
ZX Spectrum 48K/128K with the MB03+ interface, or to the
eLeMeNt ZX computer, with the esxDOS operating system. The game
code is the original one, only the SAM-specific parts have been
replaced. The colour graphics use HGFX, the extended ULA
implemented in the FPGA.

Differences from the SAM Coupe version
--------------------------------------
  - the menu is called up with the ENTER key
  - the game can be controlled with any of:
      QAOP, cursor keys, Kempston joystick, Kempston mouse
  - a game in progress can be saved to / loaded from
    the SD card (SHANGHAI.GAM)
  - background colour sets: blue, green, forest green,
      ochre, light ochre; the 4 background colours are
      saved in SHANGHAI.GAM as R,G,B (the last 12 bytes,
      they can be edited in the file)
  - keys for a new game, return to BASIC and reset
  - tiles are shuffled at 20 MHz (eZX)
  - at start the position from SHANGHAI.GAM is loaded
      (if the file exists)
  - an esxDOS error (e.g. file not found) causes
    a short red flash of the border

Starting the game
-----------------
SD card (esxDOS)
  directory SHANGHAI, GOTO *"SHANGHAI"
  file SHANGHAI.BAS from the NMI browser
       or LOAD *"SHANGHAI.BAS"

tape and PC emulators
  SHANGHAI.TAP (LOAD "")
In the TAP version the esxDOS functions are switched off.

Without MB03+/eLeMeNt ZX the game prints
"eZX/MB hardware not found. 0:1" and returns to BASIC.

Rules
-----
There are 144 tiles on the table, in several layers. Look for
pairs of identical tiles and remove them. A tile can be taken
only if nothing lies on it and it is free at least on its left
or right side. Any flower makes a pair with any other flower,
any season with any other season. You win when all the tiles
have been removed from the table.

Messages:
YOU SELECTED THE SAME TILE TWICE
  - the same tile was selected again
TILES DO NOT MATCH
  - the tiles do not make a pair

Basic controls
--------------
  Q A O P        move the cursor
  cursor keys    5 6 7 8 (with or without CAPS SHIFT),
                 0 = fire (also cursor joystick)
  Kempston joy.  move the cursor + fire
  Kempston mouse
  fire, left mouse button, other keys - select a tile
  ENTER, right mouse button - menu, 1 to 5 - menu choice

New key shortcuts
-----------------
  SYMBOL SHIFT + S   save the position to SHANGHAI.GAM
                       (in the current directory)
  SYMBOL SHIFT + L   load the position from SHANGHAI.GAM
  SYMBOL SHIFT + G   new game
                       (new shuffle, same layout)
  SYMBOL SHIFT + B   background colour: blue, green,
                       forest green, ochre, light ochre
  E + N + D          back to BASIC
  R + E + S + T      reset the computer

Menu (ENTER)
------------
PRESS 1..5:
  1 REPLAY 1 MOVE    take the last move back (onto the table)
  2 REPLAY 5 MOVES   take the last 5 moves back
  3 REPLAY ALL       take all moves back
  4 CHANGE LAYOUT    choose the tile layout (next menu)
  5 START NEW GAME   back to the title screen

SELECT LAYOUT:
  1 STANDARD         the classic "turtle"
  2 FLAT             flat layout
  3 THREE ROWS       three rows
  4 FOUR HEAPS       four heaps
  5 RETURN TO GAME   back to the game, no change
