# unit PMG

### Player/missile graphics library

author: Bostjan Gorisek (Gury)
Tebe - Core, supporting routines, modifications
Initial release date: 6.10.2015

## Constants:

name: | value: | description:
--- | --- | ---
_P_MAX | 14 | Number of player data values
_M0_MAX | 2 | Number of missile 0 data values
_M1_MAX | 0 | Number of missile 1 data values
_M2_MAX | 3 | Number of missile 2 data values
_M3_MAX | 4 | Number of missile 3 data values
_PM_NORMAL_SIZE | 0 | PM normal size
_PM_DOUBLE_SIZE | 1 | PM double size
_PM_QUAD_SIZE | 3 | PM quadruple size
_PM_SHOW_ON | 3 | Show PM graphics
_PM_SHOW_OFF | 0 | Hide/reset PM graphics
_PM_DOUBLE_RES | 1 | PM double-line resolution
_PM_SINGLE_RES | 2 | PM single-line resolution

## Global Variables:

name: | type: | description:
--- | --- | ---
p_data | array [0..3] of pointer | Player data graphics address
m_data | array [0..3] of pointer | Missile data graphics address
pm_mem | word | P/M graphics supporting variables
pm_offset | word = 512 | P/M graphics supporting variables
pm_top | byte = 8 | P/M graphics supporting variables
pm_size | word = 128 | P/M graphics supporting variables

## Interface:

name: | description:
--- | ---
SetPM | #### procedure SetPM (res : byte); Set P/M variables ##### parameters: res (byte) - P/M graphics resolution type _PM_SINGLE_RES _PM_DOUBLE_RES
ClearPM | #### procedure ClearPM; Clear player/missile memory
MoveP | #### procedure MoveP (p : byte; x : word; y : byte); Draw and move selected player ##### parameters: p (byte) - selected player x (word) - player horizontal coordinate y (byte) - player vertical coordinate
MoveM | #### procedure MoveM (m : byte; x : word; y : byte); Draw and move selected missile ##### parameters: m (byte) - selected missile x (word) - missile horizontal coordinate y (byte) - missile vertical coordinate
ColorPM | #### procedure ColorPM (pm, col : byte); Player/missile color ##### parameters: pm (byte) - selected player col (byte) - player color
SizeP | #### procedure SizeP (p, value : byte); Player size ##### parameters: p (byte) - selected player value (byte) - player size _PM_NORMAL_SIZE (0 = normal) _PM_DOUBLE_SIZE (1 = double) _PM_QUAD_SIZE (3 = quadruple)
SizeMx | #### function SizeMx(m, value : byte) : byte; Calculate bit numbers for selected missile size ##### parameters: m (shortint) - selected missile value (byte) - missile size _PM_NORMAL_SIZE (0 = normal) _PM_DOUBLE_SIZE (1 = double) _PM_QUAD_SIZE (3 = quadruple) ##### returns: (byte) Calculated bit number for selected missile size
SizeM | #### procedure SizeM (m0, m1, m2, m3 : byte); Set missile sizes ##### parameters: m0 (byte) - size for missile 0 m1 (byte) - size for missile 1 m2 (byte) - size for missile 2 m3 (byte) - size for missile 3
ShowPM | #### procedure ShowPM (show : byte); P/M graphics visibility ##### parameters: show (byte) - flag for selecting P/M visibility _PM_SHOW_ON _PM_SHOW_OFF
InitPM | #### procedure InitPM (res : byte); Initialize P/M graphics ##### parameters: res (byte) - P/M graphics resolution type _PM_DOUBLE_RES _PM_SINGLE_RES