cursor

ZXNet echo conference «code.zx»

From 812/03.00 To All 9 January 1998

Hi All ! Вот подпросранки работы с курсором: MAIN_CURSOR CALL RESTORE_CURSOR ART_CURSOR EXX LD DE,BUFFER EXX LD BC,(COOR_1) LD (COOR_0),BC CALL COORDS ADD A,A ADD A,A ADD A,A ADD A,A ADD A,A LD L,A LD H,0 ADD HL,HL LD DE,CURSOR ADD HL,DE LD LX,16 LOOP_1 EX DE,HL CALL COORDS LD A,H EXX LD H,A EXX LD A,L EXX LD L,A LDI LD A,(HL) LD (DE),A INC DE EXX EX DE,HL LD A,(DE) AND (HL) INC HL OR (HL) LD (DE),A INC HL INC DE LD A,(DE) AND (HL) INC HL OR (HL) LD (DE),A INC HL INC B DEC LX JR NZ,LOOP_1 RET RESTORE_CURSOR LD DE,BUFFER LD BC,(COOR_0) LD LX,16 LOOP_0 CALL COORDS LD A,(DE) LD (HL),A INC HL INC E LD A,(DE) LD (HL),A INC E INC B DEC LXJR NZ,LOOP_0 RET COORDS LD A,B CP 192 JR NC,NULL_HL RRCA RRCA RRCA LD L,A AND #18 OR#40 LD H,A LD A,B AND 7 ORH LD H,A LD A,L LD L,C RRA RR L RRA RR L RRA RR L LD A,C AND 7 RET NULL_HL LD H,0 RET COOR_0 DEFW 0 COOR_1 DEFW 0 BUFFER DEFS 48 CURSOR LCODE "CURSOR" And so, the main_cursor subroutine, main, it is called at the interruption, or when changing coordinates. art_cursor called once when we start draw cursor. restore_cursor that would remove the cursor from the screen. The cursor is contained in the following format 2x2 familiar spaces, that is 16 by 16 pixels and the second familiarity horizontally beaten #ff. for convenience, cursor mask and the cursor itself are mixed, that is, code block "CURSOR" mask_byte+cursor_byte+ mask_byte+cursor_byte... and so on I think the procedures are clear. the only thing this is a COORD procedure, it helps easily calculate the desired address from the coordinates. ▌▌║▌█▐│▌▌▐▐ WiTh The BeST wIsheS fROM CREATOR product ▌812/03.00▐ Powered by Cyrix 6x86L 200+/16DIMM/S3TrV2 2MB/1.6GB -+- SMM version 1.05