; ********** DRAW A GRID HERE ********** ; ENTRY FIELDS IN GRIDTB: ; POSITION 0: GRAPHICS CHARACTER (PROB'LY X OR O). ; POSITION 1: 0 = HORIZONTAL LINE, 1 = VERTICAL LINE. ; POSITION 2: NUMBER OF CHARACTER POSITIONS. ; POSITIONS 3 & 4: STARTING SCREEN ADDRESS. ; TERMINATOR IS -1. ; ************************************************************* .org 0000h LD SP, 00FEh ; ADDED FOR TESTING PURPOSES. CALL GRID ; ADDED FOR TESTING PURPOSES. HALT ; ADDED FOR TESTING PURPOSES. GRID: LD IX, GRIDTB ; TABLE FOR GRID. ART005: LD A, (IX +0) ; GET CHARACTER. CP 0FFh ; TEST FOR -1 TERMINATOR. JP Z, ART008 ; GO IF DONE. LD C, (IX +1) ; LOAD HORIZONTAL/VERTICAL. LD B, (IX +2) ; LOAD NUMBER OF CHARACTER POSITIONS. LD L, (IX +3) ; START OF LINE, LSB. LD H, (IX +4) ; START OF LINE, MSB. ; CALL DRAWL ; DRAW LINE. LD BC, 5 ; 5 BYTES PER LINE. ADD IX, BC ; POINT TO NEXT LINE. JP ART005 ; GO FOR NEXT LINE. ART008: RET ; RETURN. .ORG 0050h GRIDTB: .DB 58h ; X = 0058h, 0 = HORIZONTAL LINE, 2 = CHARACTER POSITIONS, 1234 = SCREEN ADDRESS. .DB 0 .DB 2 .DW 1234h .DB 58h .DB 0 .DB 2 .DW 1239h .DB 0FFh ; TERMINATOR = -1. .END