| Z88 Developers' Notes | ||
|---|---|---|
| Contents | Contents of System Calls | |
OS_Map, PipeDream map control
RST 20H, DEFW $F406
IN:
BC = reason codeOUT, if call successful:
MP_WR ($01) write a line to the map
MP_DEF ($02) define a map using the Panel default width
MP_GRA ($03) define a map of specific width
MP_DEL ($04) no functionality
MP_MEM ($05) define a map of specific width and associate to application segment
Fc = 0OUT, if call failed:
Fc = 1Registers changed after return:
A = error code:
RC_BAD ($04), bad parameters (errors are generally ignored)
RC_UNK ($03), value of BC is not valid
defined by MP_ reason code.MP_WR ($01), write a line to the map
IN:
A = window ID number (ASCII digit '1' to '6')OUT:
DE = row of the map to be written (0 to 63, 0 = top of screen)
HL = points to bytes to be written
-Registers changed after return:
..BCDEHL/IXIY sameNotes:
AF....../.... different
HL points to a series of bytes, where each byte represents 8 pixels on the map. Bit 7 is the left most pixel and the bytes are written onto the map from left to right. The number of bytes read from HL depends on the width of the map.MP_DEF ($02), define a map using the Panel width
IN:
A = window ID number (ASCII digit '1' to '6')OUT:
B = width of map in pixelsRegisters changed after return:
C = width of map in 6 bit characters
A...DEHL/IXIY sameNotes:
.FBC..../.... different
This call simply reads the value of the map size entry in the Panel and attempts to define a map of that width.MP_GRA ($03), define a map of specific width
IN:
A = window ID number (ASCII digit '1' to '6')OUT:
HL = width of map to set up (0 to 255)
as for MP_DEFMP_DEL ($04), delete a map
IN:
A = window ID number (ASCII digit '1' to '6')OUT:
-Notes: This call executes no functionality.
IN:
A = window ID number (ASCII digit '1' to '6')Notes:
B = MS_Sx segment for returned map memory as extended address
HL = width of map to set up (0 to 255), modulus 8
OUT:
D = width of map in pixels
E = width of map in 6 bit characters
C = MS_Sx segment for returned map memory as extended address
BHL = extended address of base of map area (for MS_Sx segment), upper left (0,0) coordinate
(size of map area is D * 64 pixels = size/8 bytes)
Registers changed after return:
A......./IXIY same
.FBCDEHL/.... different
A map has always 64 pixels height (depth of screen). When the map is created, just use OS_Mpb (or RST OZ_MPB in OZ 4.2) ) to bind returned BHL pointer into C = MS_Sx segment. An example:
ld a,'4' ; use window '4' for graphics
ld B, MS_S2
ld C, MP_MEM
ld hl,64
oz OS_Map ; create a map of 64 pixels
rst OZ_Mpb ; and bind map memory to segment 2
ld (hl),@10101010 ; write first 8 pixels to the map area, which is automatically displayed on screen