Micropower |
Volume 1 · Number 2 · September 1981 |
| Page 18 of 33 |
|---|
RESET (D,E) | ||||
| 8007 | CD1680 | RESET | CALL CSPOS | Calculate screen posn. |
| 800A | CD58FF | CALL BRESET | Use Basic ROM | |
| 800D | C9 RET | |||
All registers corrupted (except alternate set) | ||||
POINT (D,E) | ||||
| 800E | POINT | CALL CSPOS | Calculate screen posn. | |
| 8011 | 46 | LD B, (HL) | Pick up char. on screen | |
| 8012 | CDEDFF | CALL BPOINT | Use Basic ROM | |
| 8015 | C9 | RET | ||
NZ if point set, Z if reset All registers corrupted (except alternate set) | ||||
CALCULATE SCREEN POSITION | ||||
| 8016 | 6A | CSPOS | LD L, D | Low byte of x co-ord |
| 8017 | 2600 | LD H, 0 | High byte set to zero | |
| 8019 | E5 | PUSH HL | Put on stack for ROM | |
| 801A | 1600 | LD D, 0 | Set high of y to zero | |
| 801C | C331FF | JP BCSPOS | Basic ROM does rest | |
| On exit | HL = Screen Address | |||
| A = Pixel information | ||||
| All other registers corrupted | ||||
CHECK CO-ORDS AREWITHIN RANGE AND CONVERT THE | ||||
| 801F | 7A | CHECK | LD A, D | X Co-ordinate |
| 8020 | FE60 | CP 96 | Screen width | |
| 8022 | 3F | CCF | ||
| 8023 | D8 | RET C | End if D > 95 | |
| 8024 | 7B | LD A, E | Y co-ordinate | |
| 8025 | FE30 | CP 48 | Screenheight | |
| 8027 | 3F | CCF | ||
| 8028 | D8 | RET C | End if E > 47 | |
| 8029 | FE2D | CP 45 | ||
| 802B | 3005 | JR NC,CH2 | Jump if 44 < E < 48 | |
| 802D | 3E2C | LD A, 44 | ||
| 802F | 93 | SUB E | Carry will not be set | |
| 8030 | 5F | LD E, A | New y co-ord in E | |
| 8031 | C9 | RET | ||
| 8032 | 3E5C | CH2 | LD A, 92 | Sort out top line |
| 8034 | 93 | SUB E | Carry will not be set | |
| 8035 | 5F | LD E, A | Carry will not be set | |
| 8036 | C9 | RET | ||
On exit D and E contain new co-ords. Carry set if out of range | ||||
| Page 18 of 33 |
|---|