Fix MASM errors (Width became a reserved symbol at some point)
This commit is contained in:
parent
db108d4973
commit
88afea02e6
1 changed files with 14 additions and 14 deletions
|
|
@ -26,10 +26,10 @@ PageBase dw ? ;base offset in display memory of page in
|
||||||
Color dw ? ;color in which to draw pixel
|
Color dw ? ;color in which to draw pixel
|
||||||
parms ends
|
parms ends
|
||||||
|
|
||||||
StartOffset equ -2 ;local storage for start offset of rectangle
|
_StartOffset equ -2 ;local storage for start offset of rectangle
|
||||||
Width equ -4 ;local storage for address width of rectangle
|
_Width equ -4 ;local storage for address width of rectangle
|
||||||
Height equ -6 ;local storage for height of rectangle
|
_Height equ -6 ;local storage for height of rectangle
|
||||||
PlaneInfo equ -8 ;local storage for plane # and plane mask
|
_PlaneInfo equ -8 ;local storage for plane # and plane mask
|
||||||
STACK_FRAME_SIZE equ 8
|
STACK_FRAME_SIZE equ 8
|
||||||
|
|
||||||
.model small
|
.model small
|
||||||
|
|
@ -54,14 +54,14 @@ _FillRectangleX proc near
|
||||||
; display memory
|
; display memory
|
||||||
mov ax,SCREEN_SEG
|
mov ax,SCREEN_SEG
|
||||||
mov es,ax ;point ES:DI to the first rectangle pixel's
|
mov es,ax ;point ES:DI to the first rectangle pixel's
|
||||||
mov [bp+StartOffset],di ; address
|
mov [bp+_StartOffset],di ; address
|
||||||
mov dx,SC_INDEX ;set the Sequence Controller Index to
|
mov dx,SC_INDEX ;set the Sequence Controller Index to
|
||||||
mov al,MAP_MASK ; point to the Map Mask register
|
mov al,MAP_MASK ; point to the Map Mask register
|
||||||
out dx,al
|
out dx,al
|
||||||
mov bx,[bp+EndY]
|
mov bx,[bp+EndY]
|
||||||
sub bx,[bp+StartY] ;BX = height of rectangle
|
sub bx,[bp+StartY] ;BX = height of rectangle
|
||||||
jle FillDone ;skip if 0 or negative height
|
jle FillDone ;skip if 0 or negative height
|
||||||
mov [bp+Height],bx
|
mov [bp+_Height],bx
|
||||||
mov dx,[bp+EndX]
|
mov dx,[bp+EndX]
|
||||||
mov cx,[bp+StartX]
|
mov cx,[bp+StartX]
|
||||||
cmp dx,cx
|
cmp dx,cx
|
||||||
|
|
@ -72,16 +72,16 @@ _FillRectangleX proc near
|
||||||
shr dx,1
|
shr dx,1
|
||||||
shr dx,1
|
shr dx,1
|
||||||
inc dx ;# of addresses across rectangle to fill
|
inc dx ;# of addresses across rectangle to fill
|
||||||
mov [bp+Width],dx
|
mov [bp+_Width],dx
|
||||||
mov word ptr [bp+PlaneInfo],0001h
|
mov word ptr [bp+_PlaneInfo],0001h
|
||||||
;lower byte = plane mask for plane 0,
|
;lower byte = plane mask for plane 0,
|
||||||
; upper byte = plane # for plane 0
|
; upper byte = plane # for plane 0
|
||||||
FillPlanesLoop:
|
FillPlanesLoop:
|
||||||
mov ax,word ptr [bp+PlaneInfo]
|
mov ax,word ptr [bp+_PlaneInfo]
|
||||||
mov dx,SC_INDEX+1 ;point DX to the SC Data register
|
mov dx,SC_INDEX+1 ;point DX to the SC Data register
|
||||||
out dx,al ;set the plane for this pixel
|
out dx,al ;set the plane for this pixel
|
||||||
mov di,[bp+StartOffset] ;point ES:DI to rectangle start
|
mov di,[bp+_StartOffset] ;point ES:DI to rectangle start
|
||||||
mov dx,[bp+Width]
|
mov dx,[bp+_Width]
|
||||||
mov cl,byte ptr [bp+StartX]
|
mov cl,byte ptr [bp+StartX]
|
||||||
and cl,011b ;plane # of first pixel in initial byte
|
and cl,011b ;plane # of first pixel in initial byte
|
||||||
cmp ah,cl ;do we draw this plane in the initial byte?
|
cmp ah,cl ;do we draw this plane in the initial byte?
|
||||||
|
|
@ -101,7 +101,7 @@ WidthSet:
|
||||||
mov si,SCREEN_WIDTH
|
mov si,SCREEN_WIDTH
|
||||||
sub si,dx ;distance from end of one scan line to start
|
sub si,dx ;distance from end of one scan line to start
|
||||||
; of next
|
; of next
|
||||||
mov bx,[bp+Height] ;# of lines to fill
|
mov bx,[bp+_Height] ;# of lines to fill
|
||||||
mov al,byte ptr [bp+Color] ;color with which to fill
|
mov al,byte ptr [bp+Color] ;color with which to fill
|
||||||
FillRowsLoop:
|
FillRowsLoop:
|
||||||
mov cx,dx ;# of bytes across scan line
|
mov cx,dx ;# of bytes across scan line
|
||||||
|
|
@ -111,10 +111,10 @@ FillRowsLoop:
|
||||||
dec bx ;count down scan lines
|
dec bx ;count down scan lines
|
||||||
jnz FillRowsLoop
|
jnz FillRowsLoop
|
||||||
FillLoopBottom:
|
FillLoopBottom:
|
||||||
mov ax,word ptr [bp+PlaneInfo]
|
mov ax,word ptr [bp+_PlaneInfo]
|
||||||
shl al,1 ;set the plane bit to the next plane
|
shl al,1 ;set the plane bit to the next plane
|
||||||
inc ah ;increment the plane #
|
inc ah ;increment the plane #
|
||||||
mov word ptr [bp+PlaneInfo],ax
|
mov word ptr [bp+_PlaneInfo],ax
|
||||||
cmp ah,4 ;have we done all planes?
|
cmp ah,4 ;have we done all planes?
|
||||||
jnz FillPlanesLoop ;continue if any more planes
|
jnz FillPlanesLoop ;continue if any more planes
|
||||||
FillDone:
|
FillDone:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue