The Screen Pack


&BBFFSCR INITIALISE
ActionInitialises the Screen Pack to the default values used when the computer is first switched on
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and all others are preserved
NotesAll screen indirections are restored to their default settings, as are inks and flashing speeds; the mode is switched to MODE 1 and the screen is cleared with PEN 0; the screen address is moved to &C000 and the screen offset is set to zero
&BC02SCR RESET
ActionResets the Screen Pack's indirections, flashing speeds and inks to their default values
EntryNo entry conditions
ExitAF, BC, DE r1nd HL are corrupt, and all other registers are preserved
&BC05SCR SET OFFSET
ActionSets the screen offset to the specified values - this can cause the screen to scroll
EntryHL contains the required offset, which should be even
ExitAF and HL are corrupt, and alI others are preserved
NotesThe screen offset is reset to 0 whenever its mode is set, or it is cleared by SCR CLEAR (but not BASIC's CLS)
&BC08SCR SET BASE
ActionSets the location in memory of the screen - effectively can only be &C000 or &4000
EntryA contains the most significant byte of the screen address required
ExitAF and HL are corrupt, and all other registers are preserved
NotesThe screen memory can only be set at 16K intervals (ie &0000, &4000, &8000, &C000) and when the computer is first switched on the 16K of screen memory is located at &C000)
&BC0BSCR GET LOCATION
ActionGets the location of the screen memory and also the screen offset
EntryNo entry conditions
ExitA holds the most significant byte of the screen address, HL holds the current offset, and all others are preserved
&BC0ESCR SET MODE
ActionSets the screen mode
EntryA contains the mode number - it has the same value and characteristics as in BASIC
ExitAF, BC, DE and HL are corrupt, and all others are preserved
NotesThe windows are set to cover the whole screen and the graphics origin is set to the bottom left corner of the screen; in addition, the current stream is set to zero, and the screen offset is zeroed
&BC11SCR GET MODE
ActionGets the current screen mode
EntlyNo entry conditions
ExitIf the mode is 0, then Carry is true, Zero is false, and A contains 0; if the mode is 1, then Carry is false, Zero is true, and A contains 1; if the mode is 2, then Carry is false, Zero is false, and A contains 2; in all cases the other flags are corrupt and all the other registers are preserved
&BC14SCR CLEAR
ActionClears the whole of the screen
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and all others are preserved
&BC17SCR CHAR LIMITS
ActionGets the size of the whole screen in terms of the numbers of characters that can be displayed
EntryNo entry conditions
ExitB contains the number of characters across the screen, C contains the number of characters down the screen, AF is corrupt, and all other registers are preserved
&BC1ASCR CHAR POSITION
ActionGets the memory address of the top left corner of a specified character position
EntryH contains the character physical column and L contains the character physical row
ExitHL contains the memory address of the top left comer of the character, B holds the width in bytes of a character in the present mode, AF is corrupt, and all other registers are preserved
&BC1DSCR DOT POSITION
ActionGets the memory address of a pixel at a specified screen position
EntryDE contains the base X-coordinate of the pixel, and HL contains the base Y-coordinate
ExitHL contains the memory address of the pixel, C contains the bit mask for this pixel, B contains the number of pixels stored in a byte minus 1, AF and DE are corrupt, and all others are preserved
&BC20SCR NEXT BYTE
ActionCalculates the screen address of the byte to the right of the specified screen address (may be on the next line)
EntryHL contains the screen address
ExitHL holds the screen address of the byte to the right of the original screen address, AF is corrupt, all others are preserved
&BC23SCR PREV BYTE
ActionCalculates the screen address of the byte to the left of the specified screen address (this address may actually be on the previous line)
EntryHL contains the screen address
ExitHL holds the screen address of the byte to the left of the original address, AF is corrupt, all others are preserved
&BC26SCR NEXT LINE
ActionCalculates the screen address of the byte below the specified screen address
EntryHL contains the screen address
ExitHL contains the screen address of the byte below the original screen address, AF is corrupt, and all the other registers are preserved
&BC29SCR PREV LINE
ActionCalculates the screen address of the byte above the specified screen address
EntryHL contains the screen address
ExitHL holds the screen address of the byte above the original address, AF is corrupt, and all others are preserved
&BC2CSCR INK ENCODE
ActionConverts a PEN to provide a mask which, if applied to a screen byte, will convert all of the pixels in the byte to the appropriate PEN
EntryA contains a PEN number
ExitA contains the encoded value of the PEN, the flags are corrupt, and all other registers are preserved
NotesThe mask returned is different in each of the screen modes
&BC2FSCR INK DECODE
ActionConverts a PEN mask into the PEN number (see SCR INK ENCODE for the re~ erse process)
EntryA contains the encoded value of the PEN
ExitA contains the PEN number, the flags are corrupt, and all others are preserved
&BC32SCR SET INK
ActionSets the colours of a PEN - if the two values supplied are different then the colours will alternate (flash)
Entrycontains the PEN number, B contains the first colour, and C holds the second colour
ExitAF, BC, DE and HL are corrupt, and all others are preserved
&BC35SCR GET INK
ActionGets the colours of a PEN
EntryA contains the PEN nurnber
ExitB contains the first colour, C holds the second colour, and AF, DE and HL are corrupt, and all others are preserved
&BC38SCR SET BORDER
ActionSets the colours of the border - again if two different values are supplied, the border will flash
EntryB contains the first colour, and C contains the second colour
ExitAF, BC, DE and HL are corrupt, and all others are preserved
&BC3BSCR GET BORDER
ActionGets the colours of the border
EntryNo entry conditions
ExitB contains the first colour, C holds the second colour, and AF, DE and HL are corrupt, and all others are preserved
&BC3ESCR SET FLASHING
ActionSets the speed with which the border's and PENs' colours flash
EntryH holds the time that the first colour is displayed, L holds the time the second colour is displayed for
ExitAF and HL are corrupt, and all other registers are preserved
NotesThe length of time that each colour is shown is measured in 1/5Oths of a second, and a value of 0 is taken to mean 256 * 1/50 seconds - the default value is 10 * 1/50 seconds
&BC41SCR GET FLASHING
ActionGets the periods with which the colours of the border and PENs flash
EntryNo entry conditions
ExitH holds the duration of the first colour, L holds the duration of the second colour, AF is corrupt, and all other registers are preserved - see SCR SET FLASHING for the units of time used
&BC44SCR FILL BOX
ActionFills an area of the screen with an ink - this only works for `character-sized' blocks of screen
EntryA contains the mask for the ink that is to be used, H contains the left hand colurnn of the area to fill, D contains the right hand column, L holds the top line, and E holds the bottom line of the area (using physical coordinates)
ExitAF, BC, DE and HL are corrupt, and all others are preserved
&BC17SCR FLOOD BOX
ActionFills an area of the screen with an ink - this only works for `byte-sized' blocks of screen
EntryC contains the encoded PEN that is to be used, HL contains the screen address of the top left hand corner of the area to fill, D contains the width of the area to be filled in bytes, and E contains the height of the area to be filled in screen lines
ExitAF, BC, DE and HL are corrupt, and all other registers are preserved
NotesThe whole of the area to be filled must lie on the screen otherwise unpredictable results may occur
&BC4ASCR CHAR INVERT
ActionInverts a character's colours; all pixels in one PEN's colour are printed in another PEN's colour, and vice versa
EntryB contains one encoded PEN, C contains the other encoded PEN, H contains the physical column number, and L contains the physical line number of the character that is to be inverted
ExitAF, BC, DE and HL are corrupt, and alI the other registers are preserved
&BC4DSCR HW ROLL
ActionScrolls the entire screen up or down by eight pixel rows (ie one character line)
EntryB holds the direction that the screen will roll, A holds the encoded PAPER which the new line will appear in
ExitAF, BC, DE and HL are corrupt, and all others are preserved
NotesThis alters the screen offset; to roll down, B must hold zero, and to roll upwards B must be non-zero
&BCS0SCR SW ROLL
ActionScrolls part of the screen up or down by eight pixel lines - only for `character-sized' blocks of the screen
EntryB holds the direction to roll the screen, A holds the encoded PAPER which the new line will appear in, H holds the left column of the area to scroll, D holds the right colurnn, L holds the top line, E holds the bottom line
ExitAF, BC, DE and HL are corrupt, and all other registers are preserved
NotesThe area of the screen is moved by copying it; to roll down, B must hold zero, and to roll upwards B must be non-zero; this routine uses physical roordinates
&BC53SCR UNPACK
ActionChanges a character matrix from its eight byte standard form into a set of pixel masks which are suitable for the current mode - four *8 bytes are needed in mode 0, two *8 bytes in mode l, and 8 bytes in mode 2
EntryHL contains the address of the matrix, and DE contains the address where the masks are to be stored
ExitAF. BC, DE and HL are corrupt, and all other registers are preserved
&BC56SCR REPACK
ActionChanges a set of pixel masks (for the current mode) into a standard eight byte character matrix
EntryA contains the encoded foreground PEN to be matched against (ie the PEN that is to be regarded as being set in the character), H holds the physical column of the character to be `repacked', L holds the physical line of the character, and DE contains the address of the area where the character matrix will be built
ExitAF, BC, DE amd HL are corrupt, and all the others are preserved
&BC59 SCR ACCESS
ActionSets the screen write mode for graphics
EntryA contains the write mode (0=Fill, 1=XOR, 2=AND, 3=OR)
ExitAF. BC, DE and HL are corrupt, amd all other registers are preserved
NotesThe fill mode means that the ink that plotting was requested in is the ink that appears on the screen; in XOR mode, the specified ink is XORed with ink that is at that point on the screen already before plotting; a simiIar situation occurs with the AND and OR modes
&BC5CSCR PIXELS
ActionPuts a pixel or pixels on the screen regardless of the write mode specified by SCR ACCESS above
EntryB contains the mask of the PEN to be drawn with, C contains the pixel mask, and HL holds the screen address of the pixel
ExitAF is corrupt, amd all others are preserved
&BC5FSCR HORIZONTAL
ActionDraws a honzontal line on the screen using the current graphics write mode
EntryA contains the encoded PEN to be drawn with, DE contains the base X-coordinate of the start of the line, BC contains the end base X-coordinate, and HL contains the base Y-coordinate
ExitAF, BC, DE and HL are conupt, and all other registers are preserved
NotesThe start X-coordinate must be less than the end X- coordmate
&BC62SCR VERTICAL
ActionDraws a vertical line on the screen using the current graphics write mode
EntryA contains the encoded PEN to be drawn with, DE contains the base X-coordinate of the line, HL holds the start base Y-coordinate, and BC contains the end base Y-coordinate - the start coordinate must be less than the end coordinate
ExitAF, BC, DE and HL are corrupt, and all the other registers are preserved


David Cantrell, March 1996