Micro­power

  

Volume 1 · Number 2 · September 1981

Page 18 of 33

RESET (D,E)

8007CD1680RESETCALL CSPOSCalculate screen posn.
800ACD58FFCALL BRESETUse Basic ROM
800DC9 RET

All registers corrupted (except alternate set)

POINT (D,E)

800EPOINTCALL CSPOSCalculate screen posn.
801146LD B, (HL)Pick up char. on screen
8012CDEDFFCALL BPOINTUse Basic ROM
8015C9RET

NZ if point set, Z if reset
All registers corrupted (except alternate set)

CALCULATE SCREEN POSITION

80166ACSPOSLD L, DLow byte of x co-ord
80172600LD H, 0High byte set to zero
8019E5PUSH HLPut on stack for ROM
801A1600LD D, 0Set high of y to zero
801CC331FFJP BCSPOSBasic ROM does rest

On exitHL = Screen Address
A = Pixel information
All other registers corrupted

CHECK CO-ORDS AREWITHIN RANGE AND CONVERT THE
Y CO-ORDS SO (0,0) IS AT THE BOTTOM LEFT CORNER

801F7ACHECKLD A, DX Co-ordinate
8020FE60CP 96Screen width
80223FCCF
8023D8RET CEnd if D > 95
80247BLD A, EY co-ordinate
8025FE30CP 48Screenheight
80273FCCF
8028D8RET CEnd if E > 47
8029FE2DCP 45
802B3005JR NC,CH2Jump if 44 < E < 48
802D3E2CLD A, 44
802F93SUB ECarry will not be set
80305FLD E, ANew y co-ord in E
8031C9RET
80323E5CCH2LD A, 92Sort out top line
803493SUB ECarry will not be set
80355FLD E, ACarry will not be set
8036C9RET

On exit D and E contain new co-ords.
Carry set if out of range

..   ..   ..   ..   ..   ..   ..   ..

Page 18 of 33