|
CLRS
|
Sets the palette for county number in &72, an index numbred 0-39 into nybble CIDX1 (Colour InDeX 1). There are 20 bytes or 40 nybbles for the 40 counties. Each nybble is an index numbered 0-8 into CIDX2 (Colour InDeX 2), which holds the four actual colours for the nine palettes used. CIDX2 has nine entries of two bytes (four nybbles) each - four actual colour numbers are held in four nybbles. OSWORD 12 is used to change the palette to save lots of VDU 19s |
|
COUNTY
|
This is called from Basic A% (A register) set to the county whose fill point on the map, colours, name and coat of arms is required |
LOGO
|
Sets up the memory locations to print the logo, stored at &3E00, at &5D00
|
|
MAP
|
*LOADs the black and white image onto the bottom of the Mode 5 screen and decompresses it. The map is stored in two sections - north (expands to 20 columns by 17 character rows), and south (expands to 31 columns by 15 character rows). EXPAND is called for each section. The leftover garbage down the righthand side of the screen is blanked out (See lines 400 to 480)
|
|
EXPAND
|
Requires X/Y to be set to te address of the compacted data (X=lo byte, Y=hi byte), A=number of character rows in decompacted picture &70/71 the address of the top left of the expanded image, &72=number of bytes in one row of compacted data (i.e. number of bytes in decompacted image divided by two). Each byte of data is split into high and low nybble. Nybbles are converted into the corresponding pixel codes for the Mode 5 screen by duplicating the low nybble in the high nybble position, 0 - &00, 1 -> &11, 2 -> &22 etc. PUT writes the code to the screen after ANDING with with 245 and 250 alternately. This gives a yellow/white dithered effect
|
|
FNDNM
|
Places the name of county number in &72 into the text buffer. County names are stored at CNAMES as followed by . 128 is used as a token, represented by the plus sign in
the DATA statements (lines 1920-1930), for the "shire". For instance, Befordshire is stored as EQUB 8:EQUS "BEDFORD":EQUB 128
|
|
SPRITE
|
prints the coat of arms, whose number is held in A and must be 0-39 corresponding to county numbers 0-39. Each coat of arms comprises 8 columns by 4 character rows, plus 4 columns by 1
character row at the bottom. The top section is printed at &5D00, the bottom part at &5D00 + 8*&140 = &6700 (not 4*&140, remember it is double height on the screen)
|
|
SPRITE2
|
prints number of character rows in &71 times the number of columns in &72 double height at address in &74/75. Note that the code is 'self-altering' so the address held in LDA &1100,X (at SDATA) can vary
|
|
SRCH
|
Locates the start of the flood-fill data for fill county in &72 and stores the address in &80/81 and the number of fill points in &82 ready for use by procedure PROCfill in program CQGAME. The
data is stored at FLLPNTS as the number of fill points, N, followed by N pairs of coordinates. For compactness the X points are stored divided by eight and Y points divided by four so they
can fit into one byte each
|
|
TYPN
|
Attempts to match the typed-in string, stored in text buffer BF, to the county names by comparing the first Y-1 characters. Usually only three letters are checked (Y=4) but in the case of HEREfordshire and HERTfordshire Y=5, and similarly Y=6 for NORFolk, NORTHAmptonshire, and NORTHUmberland, i.e. the sixth letter of Northumberland distinguishes it from Northamptonshire.
If matched successfully, the full county name, else a CR (null string), is placed in BF
|