;\r
;\r
\r
-_x_put_pix proc \r
- ARG X:word,Y:word,PgOfs:word,Color:word\r
+_x_put_pix proc\r
+ ;ARG X:word,Y:word,PgOfs:word,Color:word\r
push bp ;preserve caller's stack frame\r
mov bp,sp ;point to local stack frame\r
\r
mov ax,[_ScrnLogicalByteWidth]\r
- mul [Y] ;offset of pixel's scan line in page\r
- mov bx,[X]\r
- shr bx,2 ;X/4 = offset of pixel in scan line\r
+ mul [BP+6] ;offset of pixel's scan line in page\r
+ mov bx,[BP+4]\r
+ shr bx,1 ;X/4 = offset of pixel in scan line\r
+ shr bx,1 ;X/4 = offset of pixel in scan line\r
add bx,ax ;offset of pixel in page\r
- add bx,[PgOfs] ;offset of pixel in display memory\r
+ add bx,[BP+8] ;offset of pixel in display memory\r
mov ax,SCREEN_SEG\r
mov es,ax ;point ES:BX to the pixel's address\r
\r
- mov cl,byte ptr [X]\r
+ mov cl,byte ptr [BP+4]\r
and cl,011b ;CL = pixel's plane\r
mov ax,0100h + MAP_MASK ;AL = index in SC of Map Mask reg\r
shl ah,cl ;set only the bit for the pixel's\r
mov dx,SC_INDEX ;set the Map Mask to enable only the\r
out dx,ax ; pixel's plane\r
\r
- mov al,byte ptr [Color]\r
+ mov al,byte ptr [BP+10]\r
mov es:[bx],al ;draw the pixel in the desired color\r
\r
pop bp ;restore caller's stack frame\r
\r
\r
_x_get_pix proc\r
- ARG x:word,y:word,PageBase:word\r
+ ;ARG x:word,y:word,PageBase:word\r
push bp ;preserve caller's stack frame\r
mov bp,sp ;point to local stack frame\r
\r
mov ax,[_ScrnLogicalByteWidth]\r
- mul [Y] ;offset of pixel's scan line in page\r
- mov bx,[X]\r
+ mul [bp+6] ;offset of pixel's scan line in page\r
+ mov bx,[bp+4]\r
shr bx,1\r
shr bx,1 ;X/4 = offset of pixel in scan line\r
add bx,ax ;offset of pixel in page\r
- add bx,[PageBase] ;offset of pixel in display memory\r
+ add bx,[bp+8] ;offset of pixel in display memory\r
mov ax,SCREEN_SEG\r
mov es,ax ;point ES:BX to the pixel's address\r
\r
- mov ah,byte ptr [X]\r
+ mov ah,byte ptr [bp+4]\r
and ah,011b ;AH = pixel's plane\r
mov al,READ_MAP ;AL = index in GC of the Read Map reg\r
mov dx,GC_INDEX ;set the Read Map to read the pixel's\r
ret\r
_x_get_pix endp\r
end\r
-\r
-\r
- end\r
-\r
-\1a
\ No newline at end of file