[Reduction] #399: grc_setclip

This commit is contained in:
nmlgc 2014-08-31 08:36:33 +02:00
parent 2ed0225877
commit 1546628658
8 changed files with 186 additions and 622 deletions

View File

@ -0,0 +1,148 @@
; graphics - clipping
;
; DESCRIPTION:
; 描画クリップ枠の設定処理
;
; FUNCTION(in C):
; int far _pascal grc_setclip( int xl, int yt, int xr, int yb ) ;
;
; FUNCTION(in Pascal):
; function grc_setclip( xl,yt,xr,yb : integer ) : integer ;
;
; PARAMETERS:
; int xl 左端のx座標
; int yt 上端のy座標
; int xr 右端のx座標
; int yb 下端のy座標
;
; RETURNS:
; 0 = 失敗。実画面(640x400)の外にクリップ領域を設定しようとした
; 1 = 成功。
;
; NOTES:
; ・入力は、まず画面枠(0,0)-(639,399)でクリップしている。
; ・入力の対は、大小関係が逆でも揃えてから処理している。
;
; GLOBAL VARIABLES:
; int ClipXL, ClipXW, ClipXR 左端x, 枠の横幅(xr-xl), 右端x
; int ClipYT, ClipYH, ClipYB 上端y, 枠の高さ(yb-yt), 下端y
; unsigned ClipYB_adr 下端の左端のVRAMオフセット
; unsigned ClipYT_seg 上端のVRAMセグメント(青プレーン)
;
; REFER:
; ・対応関数
; grcg_polygon_convex()
; grcg_trapezoid()
;
; COMPILER/ASSEMBLER:
; TASM 3.0
; OPTASM 1.6
;
; AUTHOR:
; 恋塚昭彦
;
; HISTORY:
; 92/5/20 Initial
; 92/6/5 _pascal化したが、バグ出た。ひー。直した。ぶう
; 92/6/5 ClipYB_adr追加。
; 92/6/6 ClipYT_seg, GRamStart追加。
; 92/6/16 データ部分をclip.asmに分離
; 93/3/27 master.libに合併
; 93/12/28 [M0.22] 横の制限はgraph_VramWidth*8ドットにした
;
; int far _pascal grc_setclip( int xl, int yt, int xr, int yb ) ;
func GRC_SETCLIP
push BP
mov BP,SP
; 引数
@@xl = (RETSIZE+4)*2
@@yt = (RETSIZE+3)*2
@@xr = (RETSIZE+2)*2
@@yb = (RETSIZE+1)*2
;------------------------- X座標
mov AX,[BP+@@xl]
mov BX,[BP+@@xr]
test AX,BX ; AX < 0 && BX < 0 ならエラー
js short @@ERROR
cmp AX,BX
jl short @@A
xchg AX,BX ; AX <= BXにする
@@A:
cmp AX,8000h ;
sbb DX,DX ;
and AX,DX ; AXが負数ならゼロにする
mov CX,graph_VramWidth
shl CX,3
dec CX
sub BX,CX ;
sbb DX,DX ;
and BX,DX ;
add BX,CX ; BXが639以上なら639にする
sub BX,AX
jl short @@ERROR
mov ClipXL,AX
mov ClipXW,BX
add AX,BX
mov ClipXR,AX
;------------------------- Y座標
mov AX,[BP+@@yt]
mov BX,[BP+@@yb]
test AX,BX ; AX < 0 && BX < 0 ならエラー
js short @@ERROR
cmp AX,BX
jl short @@B
xchg AX,BX ; AX <= BXにする
@@B:
cmp AX,8000h ;
sbb DX,DX ;
and AX,DX ; AXが負数ならゼロにする
mov CX,graph_VramLines
dec CX
sub BX,CX ;
sbb DX,DX ;
and BX,DX ;
add BX,CX ; BXが399以上なら399にする
sub BX,AX
jl short @@ERROR
mov ClipYT,AX
mov CX,AX
mov ClipYH,BX
add AX,BX
mov ClipYB,AX
mov AX,graph_VramWidth
xchg AX,BX
mul BX
mov ClipYB_adr,AX ; 下端yの左端のVRAMオフセット
; (ClipYT_segセグメント上)
mov AX,BX
shr AX,4
mul CX
add AX,graph_VramSeg ; 開始セグメント = graph_VramSeg
mov ClipYT_seg,AX ; + yt * graph_VramWidth/16
mov AX,1
pop BP
ret 8
@@ERROR:
xor AX,AX
pop BP
ret 8
endfunc

View File

@ -72,7 +72,7 @@ sub_384 proc near
push 64h
push 21Fh
push 12Bh
call sub_139C
call grc_setclip
call graph_hide
push 21CEh
call super_entry_bfnt
@ -937,90 +937,7 @@ loc_1398:
retn
sub_136A endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_139C proc near
arg_0 = word ptr 4
arg_2 = word ptr 6
arg_4 = word ptr 8
arg_6 = word ptr 0Ah
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_1428
cmp ax, bx
jl short loc_13AE
xchg ax, bx
loc_13AE:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_1428
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_1428
cmp ax, bx
jl short loc_13E4
xchg ax, bx
loc_13E4:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_1428
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retn 8
; ---------------------------------------------------------------------------
loc_1428:
xor ax, ax
pop bp
retn 8
sub_139C endp
include libs/master.lib/grc_setclip.asm
include libs/master.lib/grcg_hline.asm
include libs/master.lib/grcg_setcolor.asm
include libs/master.lib/grcg_pset.asm

View File

@ -60,91 +60,7 @@ include libs/master.lib/grcg_byteboxfill_x.asm
include libs/master.lib/grcg_circlefill.asm
include libs/master.lib/grcg_circle.asm
include libs/master.lib/grcg_circle_x.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_F1E proc far
; sub_13671+A1P ...
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
arg_6 = word ptr 0Ch
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_FAA
cmp ax, bx
jl short loc_F30
xchg ax, bx
loc_F30:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_FAA
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_FAA
cmp ax, bx
jl short loc_F66
xchg ax, bx
loc_F66:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_FAA
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retf 8
; ---------------------------------------------------------------------------
loc_FAA:
xor ax, ax
pop bp
retf 8
sub_F1E endp
include libs/master.lib/grc_setclip.asm
; =============== S U B R O U T I N E =======================================
@ -7467,7 +7383,7 @@ loc_B8B5:
loc_B922:
push large 0
push large 27F018Fh
call sub_F1E
call grc_setclip
push large 0C0000Bh
call grcg_setcolor
mov dx, 0A6h ; '¦'
@ -23893,7 +23809,7 @@ var_2 = byte ptr -2
mov word_1ED94, 3E8h
push large 200000h
push large 1A0018Fh
call sub_F1E
call grc_setclip
mov Palettes+42, 0E0h ; 'à'
mov Palettes+43, 0C0h ; 'À'
mov Palettes+44, 0B0h ; '°'
@ -25022,7 +24938,7 @@ sub_140AE proc far
jz short loc_140D4
push large 200000h
push large 1A0018Fh
call sub_F1E
call grc_setclip
mov byte_1EDA6, 0
mov word_1EB0A, 0FFFFh
@ -29893,7 +29809,7 @@ sub_1696B proc far
call super_entry_bfnt
push large 200000h
push large 1A0018Fh
call sub_F1E
call grc_setclip
call sub_134A0
mov word_20652, 0A0h ; ' '
mov word_20654, 0A0h ; ' '
@ -35459,7 +35375,7 @@ sub_199B3 proc far
call palette_white_out
push large 200000h
push large 1A0018Fh
call sub_F1E
call grc_setclip
push large 0C00000h
call grcg_setcolor
call sub_FB0
@ -35578,7 +35494,7 @@ sub_199B3 proc far
call grcg_setcolor
push large 1A00000h
push large 27F018Fh
call sub_F1E
call grc_setclip
mov dx, 0A6h ; '¦'
mov al, byte_20619
out dx, al ; Interrupt Controller #2, 8259A
@ -35590,7 +35506,7 @@ sub_199B3 proc far
call grcg_off
push large 200000h
push large 1A0018Fh
call sub_F1E
call grc_setclip
mov word_26C6A, 0
xor si, si
jmp short loc_19C0D
@ -36716,7 +36632,7 @@ sub_1A529 proc near
push si
push large 200010h
push large 1A00140h
call sub_F1E
call grc_setclip
push 9
call sub_FA52
add sp, 2
@ -37000,7 +36916,7 @@ sub_1A7D5 proc far
call grcg_off
push large 200000h
push large 1A0018Fh
call sub_F1E
call grc_setclip
push word_26D76
push word_26D78
push word_2064E

View File

@ -54,90 +54,7 @@ include libs/master.lib/file_write.asm
include libs/master.lib/dos_close.asm
include libs/master.lib/dos_ropen.asm
include libs/master.lib/grcg_boxfill.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_AFE proc far
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
arg_6 = word ptr 0Ch
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_B8A
cmp ax, bx
jl short loc_B10
xchg ax, bx
loc_B10:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_B8A
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_B8A
cmp ax, bx
jl short loc_B46
xchg ax, bx
loc_B46:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_B8A
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retf 8
; ---------------------------------------------------------------------------
loc_B8A:
xor ax, ax
pop bp
retf 8
sub_AFE endp
include libs/master.lib/grc_setclip.asm
; =============== S U B R O U T I N E =======================================
@ -8156,7 +8073,7 @@ loc_B7B7:
push 60h ; '`'
push 200h
push 130h
call sub_AFE
call grc_setclip
push 0C0h ; 'À'
push 0Ah
call grcg_setcolor
@ -8215,7 +8132,7 @@ loc_B84F:
push 0
push 27Fh
push 18Fh
call sub_AFE
call grc_setclip
pop si
leave
retf

View File

@ -52,91 +52,7 @@ include libs/master.lib/dos_ropen.asm
include libs/master.lib/grcg_boxfill.asm
include libs/master.lib/grcg_circle.asm
include libs/master.lib/grcg_circle_x.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_C40 proc far
; sub_A21F+17P ...
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
arg_6 = word ptr 0Ch
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_CCC
cmp ax, bx
jl short loc_C52
xchg ax, bx
loc_C52:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_CCC
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_CCC
cmp ax, bx
jl short loc_C88
xchg ax, bx
loc_C88:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_CCC
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retf 8
; ---------------------------------------------------------------------------
loc_CCC:
xor ax, ax
pop bp
retf 8
sub_C40 endp
include libs/master.lib/grc_setclip.asm
; =============== S U B R O U T I N E =======================================
@ -5411,7 +5327,7 @@ loc_9E24:
call near ptr sub_BAE0
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
push 0
call sub_ECB2
pop di
@ -5793,7 +5709,7 @@ sub_A21F proc near
call grcg_setcolor
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
mov dx, 0A6h ; '¦'
mov al, 1
out dx, al ; Interrupt Controller #2, 8259A
@ -7388,7 +7304,7 @@ sub_B4A8 proc near
loc_B4E3:
push large 80000h
push large 26F00BFh
call sub_C40
call grc_setclip
sub word_1FBC4, 12h
sub word_1FBCA, 17h
add word_1FBCC, 12h
@ -7497,7 +7413,7 @@ loc_B5EE:
call grcg_off
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
pop si
pop bp
retn
@ -7526,7 +7442,7 @@ sub_B60A proc near
loc_B645:
push large 100000h
push large 26F00BFh
call sub_C40
call grc_setclip
add word_1FBC6, 17h
sub word_1FBC8, 12h
sub word_1FBCE, 17h
@ -7613,7 +7529,7 @@ loc_B724:
call grcg_off
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
pop si
pop bp
retn
@ -10896,7 +10812,7 @@ loc_CF15:
loc_CF1E:
push 0BFh ; '¿'
call sub_C40
call grc_setclip
cmp byte ptr [si], 1
jnz short loc_CF42
push word ptr [si+2]
@ -11008,7 +10924,7 @@ loc_D013:
out 7Ch, ax
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
pop di
pop si
leave
@ -18439,7 +18355,7 @@ loc_10981:
loc_1098A:
push 0BFh ; '¿'
call sub_C40
call grc_setclip
call egc_off
push large 0C0000Ah
call grcg_setcolor
@ -18484,7 +18400,7 @@ loc_109FB:
call egc_on
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
loc_10A13:
pop di
@ -28381,7 +28297,7 @@ loc_15A53:
jnz short loc_15A77
push large 100008h
push large 12F00BFh
call sub_C40
call grc_setclip
mov [bp+var_2], 10h
jmp short loc_15A8D
; ---------------------------------------------------------------------------
@ -28389,7 +28305,7 @@ loc_15A53:
loc_15A77:
push large 1500008h
push large 26F00BFh
call sub_C40
call grc_setclip
mov [bp+var_2], 150h
loc_15A8D:
@ -28505,7 +28421,7 @@ loc_15B7E:
loc_15B9A:
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
call grcg_off
mov al, [bp+var_F]
shl al, 2
@ -38627,7 +38543,7 @@ loc_1AA1B:
loc_1AA24:
push 0BFh ; '¿'
call sub_C40
call grc_setclip
mov bx, [bp+var_A]
cmp byte ptr [bx+1], 10h
ja loc_1AB7B
@ -38941,7 +38857,7 @@ loc_1ACCF:
call egc_on
push large 0
push large 27F00C7h
call sub_C40
call grc_setclip
sub di, 10h
mov byte_1F2EA, 2
mov word_1F2E8, 8

View File

@ -69,90 +69,7 @@ include libs/master.lib/grcg_boxfill.asm
include libs/master.lib/grcg_circlefill.asm
include libs/master.lib/grcg_circle.asm
include libs/master.lib/grcg_circle_x.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_144A proc far
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
arg_6 = word ptr 0Ch
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_14D6
cmp ax, bx
jl short loc_145C
xchg ax, bx
loc_145C:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_14D6
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_14D6
cmp ax, bx
jl short loc_1492
xchg ax, bx
loc_1492:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_14D6
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retf 8
; ---------------------------------------------------------------------------
loc_14D6:
xor ax, ax
pop bp
retf 8
sub_144A endp
include libs/master.lib/grc_setclip.asm
include libs/master.lib/grcg_hline.asm
; =============== S U B R O U T I N E =======================================
@ -20456,7 +20373,7 @@ sub_11ECB proc near
mov byte_25592, 0Dh
push large 200010h
push large 19F017Fh
call sub_144A
call grc_setclip
push 0B55Eh
push 132h
call sub_C34E

View File

@ -62,90 +62,7 @@ include libs/master.lib/grcg_byteboxfill_x.asm
include libs/master.lib/grcg_circlefill.asm
include libs/master.lib/grcg_circle.asm
include libs/master.lib/grcg_circle_x.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_130C proc far
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
arg_6 = word ptr 0Ch
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_1398
cmp ax, bx
jl short loc_131E
xchg ax, bx
loc_131E:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_1398
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_1398
cmp ax, bx
jl short loc_1354
xchg ax, bx
loc_1354:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_1398
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retf 8
; ---------------------------------------------------------------------------
loc_1398:
xor ax, ax
pop bp
retf 8
sub_130C endp
include libs/master.lib/grc_setclip.asm
; =============== S U B R O U T I N E =======================================
@ -13705,7 +13622,7 @@ sub_EACE proc near
mov byte_2C92C, 0Dh
push large 200010h
push large 19F017Fh
call sub_130C
call grc_setclip
push 0BDF2h
push 54h ; 'T'
call sub_E708

View File

@ -62,91 +62,7 @@ include libs/master.lib/dos_ropen.asm
include libs/master.lib/grcg_boxfill.asm
include libs/master.lib/grcg_byteboxfill_x.asm
include libs/master.lib/grcg_circlefill.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_DCC proc far
; sub_E41D+3D6P
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
arg_6 = word ptr 0Ch
push bp
mov bp, sp
mov ax, [bp+arg_6]
mov bx, [bp+arg_2]
test ax, bx
js short loc_E58
cmp ax, bx
jl short loc_DDE
xchg ax, bx
loc_DDE:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramWidth
shl cx, 3
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_E58
mov ClipXL, ax
mov ClipXW, bx
add ax, bx
mov ClipXR, ax
mov ax, [bp+arg_4]
mov bx, [bp+arg_0]
test ax, bx
js short loc_E58
cmp ax, bx
jl short loc_E14
xchg ax, bx
loc_E14:
cmp ax, 8000h
sbb dx, dx
and ax, dx
mov cx, graph_VramLines
dec cx
sub bx, cx
sbb dx, dx
and bx, dx
add bx, cx
sub bx, ax
jl short loc_E58
mov ClipYT, ax
mov cx, ax
mov ClipYH, bx
add ax, bx
mov ClipYB, ax
mov ax, graph_VramWidth
xchg ax, bx
mul bx
mov ClipYB_adr, ax
mov ax, bx
shr ax, 4
mul cx
add ax, graph_VramSeg
mov ClipYT_seg, ax
mov ax, 1
pop bp
retf 8
; ---------------------------------------------------------------------------
loc_E58:
xor ax, ax
pop bp
retf 8
sub_DCC endp
include libs/master.lib/grc_setclip.asm
include libs/master.lib/grcg_hline.asm
include libs/master.lib/grcg_pset.asm
include libs/master.lib/grcg_setcolor.asm
@ -9803,7 +9719,7 @@ arg_6 = word ptr 0Ah
add ax, word_151D8
add ax, 7
push ax
call sub_DCC
call grc_setclip
pop bp
retn 8
sub_D31F endp
@ -12316,7 +12232,7 @@ loc_E7CC:
call super_free
push large 0
push large 27F018Fh
call sub_DCC
call grc_setclip
pop di
pop si
leave