X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=16%2Fxlib%2Fxpoint.asm;h=7b7dc910d9ab70d2c5ad9eaad41be603f8d523a1;hb=4418da90a98a3a8fa1c306da33a35ca4338ea9c0;hp=a2be8bfe5dcbc3b04a3c08e73af787d0f31e09b9;hpb=8a4b836c5347897d1a8279a46310fc79fd555574;p=16.git diff --git a/16/xlib/xpoint.asm b/16/xlib/xpoint.asm index a2be8bfe..7b7dc910 100755 --- a/16/xlib/xpoint.asm +++ b/16/xlib/xpoint.asm @@ -33,21 +33,22 @@ include xpoint.inc ; ; -_x_put_pix proc - ARG X:word,Y:word,PgOfs:word,Color:word +_x_put_pix proc + ;ARG X:word,Y:word,PgOfs:word,Color:word push bp ;preserve caller's stack frame mov bp,sp ;point to local stack frame mov ax,[_ScrnLogicalByteWidth] - mul [Y] ;offset of pixel's scan line in page - mov bx,[X] - shr bx,2 ;X/4 = offset of pixel in scan line + mul [BP+6] ;offset of pixel's scan line in page + mov bx,[BP+4] + shr bx,1 ;X/4 = offset of pixel in scan line + shr bx,1 ;X/4 = offset of pixel in scan line add bx,ax ;offset of pixel in page - add bx,[PgOfs] ;offset of pixel in display memory + add bx,[BP+8] ;offset of pixel in display memory mov ax,SCREEN_SEG mov es,ax ;point ES:BX to the pixel's address - mov cl,byte ptr [X] + mov cl,byte ptr [BP+4] and cl,011b ;CL = pixel's plane mov ax,0100h + MAP_MASK ;AL = index in SC of Map Mask reg shl ah,cl ;set only the bit for the pixel's @@ -55,7 +56,7 @@ _x_put_pix proc mov dx,SC_INDEX ;set the Map Mask to enable only the out dx,ax ; pixel's plane - mov al,byte ptr [Color] + mov al,byte ptr [BP+10] mov es:[bx],al ;draw the pixel in the desired color pop bp ;restore caller's stack frame @@ -73,21 +74,21 @@ _x_put_pix endp _x_get_pix proc - ARG x:word,y:word,PageBase:word + ;ARG x:word,y:word,PageBase:word push bp ;preserve caller's stack frame mov bp,sp ;point to local stack frame mov ax,[_ScrnLogicalByteWidth] - mul [Y] ;offset of pixel's scan line in page - mov bx,[X] + mul [bp+6] ;offset of pixel's scan line in page + mov bx,[bp+4] shr bx,1 shr bx,1 ;X/4 = offset of pixel in scan line add bx,ax ;offset of pixel in page - add bx,[PageBase] ;offset of pixel in display memory + add bx,[bp+8] ;offset of pixel in display memory mov ax,SCREEN_SEG mov es,ax ;point ES:BX to the pixel's address - mov ah,byte ptr [X] + mov ah,byte ptr [bp+4] and ah,011b ;AH = pixel's plane mov al,READ_MAP ;AL = index in GC of the Read Map reg mov dx,GC_INDEX ;set the Read Map to read the pixel's @@ -100,8 +101,3 @@ _x_get_pix proc ret _x_get_pix endp end - - - end - - \ No newline at end of file