; DOTS.MAC starts here ... ; .XOFF: ; offset vectors into the buffer BAND = 0 ; .REPT MAXNX + 1 ; repeat for each nib in the band (+1) .WORD BAND * MBYTEY + .BUFFR ; pointer to a band of nibs BAND = BAND + 1 ; .ENDM ; .BUFFR: .BLKB * MBYTEY ; the buffer itself ; ; subroutine to turn a dot on ; CALL DOTON(X,Y) ; note that no range chacking is done for speed ; .PSECT DOTS DOTS: .BYTE 1,2,4,10,20,40,100,200 ; bit mask ; DOTON:: MOV @2(R5),R0 ; get the X coordinate ASL R0 ; make it a word pointer MOV .XOFF(R0),R0 ; get pointer to first byte of line MOV @4(R5),R1 ; get the Y coordinate MOV R1,R2 ; and save a copy .REPT 3 ASR R1 ; divide Y by 8 bits/byte .ENDM ADD R1,R0 ; point to the byte in question BIC #177770,R2 ; bag all but the low 3 bits BISB DOTS(R2),(R0) ; and turn the dot on RETURN ; now go on home ; ; subroutine to turn a dot off ; CALL DOTOFF(X,Y) ; note that no range chacking is done for speed ; DOTOFF::MOV @2(R5),R0 ; get the X coordinate ASL R0 ; make it a word pointer MOV .XOFF(R0),R0 ; get pointer to first byte of line MOV @4(R5),R1 ; get the Y coordinate MOV R1,R2 ; and save a copy .REPT 3 ASR R1 ; divide Y by 8 bits/byte .ENDM ADD R1,R0 ; point to the byte in question BIC #177770,R2 ; bag all but the low 3 bits BICB DOTS(R2),(R0) ; and turn the dot off RETURN ; now go on home ; ; function subroutine to check if a dot is on or not ; I = IDOT(X,Y) ; I==0 if the dot was off ; I==1 if the dot was on ; note that no range chacking is done for speed ; IDOT:: MOV @2(R5),R0 ; get the X coordinate ASL R0 ; make it a word pointer MOV .XOFF(R0),R0 ; get pointer to first byte of line MOV @4(R5),R1 ; get the Y coordinate MOV R1,R2 ; and save a copy .REPT 3 ASR R1 ; divide Y by 8 bits/byte .ENDM ADD R1,R0 ; point to the byte in question BIC #177770,R2 ; bag all but the low 3 bits BITB DOTS(R2),(R0) ; and test the dot BNE 10$ ; not zero = bit set CLR R0 ; it wasn't set - tell us RETURN ; now go on home 10$: MOV #1,R0 ; the bit was set - tell us RETURN ; go on home ; ; subroutine CLRDOT clears the entire raster window ; CLRDOT::MOV #.BUFFR,R0 ; get the start of the buffer MOV #*MBYTEY,R1 ; get the length of the buffer 10$: CLRB (R0)+ ; clear out a byte SOB R1,10$ ; and continue until all done RETURN ; and go on home .END