]> 4ch.mooo.com Git - 16.git/commitdiff
modified: src/lib/modex16.c
authorsparky4 <sparky4@cock.li>
Mon, 13 Jul 2015 17:14:43 +0000 (12:14 -0500)
committersparky4 <sparky4@cock.li>
Mon, 13 Jul 2015 17:14:43 +0000 (12:14 -0500)
src/lib/modex16.c

index 4717b444a39eaf1a9459d5a7a8ed317ede1102ef..1534ed560faaa8d727f5c71985b01d8a10ec3f0c 100644 (file)
@@ -941,6 +941,38 @@ no... wait.... no wwww
                printf("chkcolor end~\n");
                free(pal);
 }
+/*
+; on entry X,Y = location and C = color (0-15)
+putpixel   proc near uses ax bx cx dx
+
+; byte offset = Y * (horz_res / 8) + int(X / 8)
+
+           mov  ax,Y                    ; calculate offset
+           mov  dx,80                   ;
+           mul  dx                      ; ax = y * 80
+           mov  bx,X                    ;
+           mov  cl,bl                   ; save low byte for below
+           shr  bx,03                   ; div by 8
+           add  bx,ax                   ; bx = offset this group of 8 pixels
+
+           mov  dx,03CEh                ; set to video hardware controller
+
+           and  cl,07h                  ; Compute bit mask from X-coordinates
+           xor  cl,07h                  ;  and put in ah
+           mov  ah,01h                  ;
+           shl  ah,cl                   ;
+           mov  al,08h                  ; bit mask register
+           out  dx,ax                   ;
+
+           mov  ax,0205h                ; read mode 0, write mode 2
+           out  dx,ax                   ;
+
+           mov  al,es:[bx]              ; load to latch register
+           mov  al,Color
+           mov  es:[bx],al              ; write to register
+
+           ret
+putpixel   endp*/
 
 void bputs(/*bmp_t *bmp, */unsigned x, unsigned y, const char *s)\r
 {\r