General video blitter clean-up in the DOS port.

This commit is contained in:
stainless
2001-11-06 02:03:50 +00:00
parent da9fa0b207
commit 81a51b4e2f

View File

@@ -1051,6 +1051,7 @@ NEWSYM copyvesa2320x240x8b
;******************************************************* ;*******************************************************
NEWSYM copyvesa2320x480x8bgui NEWSYM copyvesa2320x480x8bgui
jmp copyvesa2320x480x8b
; mov byte[CurrentGUIOn],1 ; mov byte[CurrentGUIOn],1
; jmp copyvesa2320x480x8b.nogui ; jmp copyvesa2320x480x8b.nogui
@@ -2564,6 +2565,7 @@ SECTION .text
copyvesa2320x240x16bgui: copyvesa2320x240x16bgui:
jmp copyvesa2320x240x16b
; cmp byte[curblank],40h ; cmp byte[curblank],40h
; jne .startcopy ; jne .startcopy
; ret ; ret
@@ -3430,113 +3432,114 @@ NEWSYM copyvesa2320x480x16b
%endmacro %endmacro
NEWSYM copyvesa12640x480x16bgui NEWSYM copyvesa12640x480x16bgui
cmp byte[curblank],40h jmp copyvesa12640x480x16b
jne .startcopy ; cmp byte[curblank],40h
ret ; jne .startcopy
.startcopy ; ret
push es ;.startcopy
mov word[bankpos],0 ; push es
call VESA12Bankswitch ; mov word[bankpos],0
mov ax,[selcA000] ; call VESA12Bankswitch
mov es,ax ; mov ax,[selcA000]
mov esi,[vidbuffer] ; mov es,ax
mov edi,32*2*2 ; Draw @ Y from 9 to 247 ; mov esi,[vidbuffer]
cmp word[resolutn],224 ; mov edi,32*2*2 ; Draw @ Y from 9 to 247
jne .res239 ; cmp word[resolutn],224
mov edi,8*320*2*2+32*2*2 ; jne .res239
.res239 ; mov edi,8*320*2*2+32*2*2
add esi,16+256+32 ;.res239
xor eax,eax ; add esi,16+256+32
mov dl,[resolutn] ; xor eax,eax
dec dl ; mov dl,[resolutn]
dec dl ; dec dl
mov [lineleft],dl ; dec dl
mov edx,65536 ; mov [lineleft],dl
sub edx,edi ; mov edx,65536
shr edx,2 ; sub edx,edi
cmp byte[smallscreenon],1 ; shr edx,2
je near .smallscreen ; cmp byte[smallscreenon],1
cmp byte[scanlines],1 ; je near .smallscreen
je near .scanlines ; cmp byte[scanlines],1
.loopa ; je near .scanlines
mov ecx,256 ;.loopa
xor eax,eax ; mov ecx,256
precheckvesa12 256 ; xor eax,eax
.a ; precheckvesa12 256
mov al,[esi] ;.a
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .a ; dec ecx
postcheckvesa12 .a,64,256,16384 ; jnz .a
sub esi,256 ; postcheckvesa12 .a,64,256,16384
add edi,128*2 ; sub esi,256
mov ecx,256 ; add edi,128*2
xor eax,eax ; mov ecx,256
precheckvesa12 256 ; xor eax,eax
.a2 ; precheckvesa12 256
mov al,[esi] ;.a2
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .a2 ; dec ecx
postcheckvesa12 .a2,64,256,16384 ; jnz .a2
add esi,32 ; postcheckvesa12 .a2,64,256,16384
add edi,128*2 ; add esi,32
dec byte[lineleft] ; add edi,128*2
jnz near .loopa ; dec byte[lineleft]
pop es ; jnz near .loopa
ret ; pop es
; ret
.scanlines ;
.loopa2 ;.scanlines
mov ecx,256 ;.loopa2
xor eax,eax ; mov ecx,256
precheckvesa12 256 ; xor eax,eax
.ab ; precheckvesa12 256
mov al,[esi] ;.ab
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .ab ; dec ecx
postcheckvesa12 .ab,64+320,256,16384 ; jnz .ab
add esi,32 ; postcheckvesa12 .ab,64+320,256,16384
add edi,128*2+640*2 ; add esi,32
dec byte[lineleft] ; add edi,128*2+640*2
jnz near .loopa2 ; dec byte[lineleft]
pop es ; jnz near .loopa2
ret ; pop es
; ret
.smallscreen ;
add edx,edx ;.smallscreen
.loopa3 ; add edx,edx
mov ecx,256 ;.loopa3
xor eax,eax ; mov ecx,256
precheckvesa12 256 ; xor eax,eax
.ac ; precheckvesa12 256
mov al,[esi] ;.ac
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
inc esi ; mov [es:edi],bx
add edi,2 ; inc esi
dec ecx ; add edi,2
jnz .ac ; dec ecx
postcheckvesa12 .ac,128+256,256,32768 ; jnz .ac
add esi,32 ; postcheckvesa12 .ac,128+256,256,32768
add edi,128*2+256*2 ; add esi,32
dec byte[lineleft] ; add edi,128*2+256*2
jnz near .loopa3 ; dec byte[lineleft]
pop es ; jnz near .loopa3
ret ; pop es
; ret
VESA12Bankswitch: VESA12Bankswitch:
@@ -3552,286 +3555,287 @@ VESA12Bankswitch:
ret ret
NEWSYM copyvesa2640x480x16bgui NEWSYM copyvesa2640x480x16bgui
je near smallscreen640x480x16bgui.fullscreen jmp copyvesa2640x480x16b
cmp byte[curblank],40h ; je near smallscreen640x480x16bgui.fullscreen
jne .startcopy ; cmp byte[curblank],40h
ret ; jne .startcopy
.startcopy ; ret
push es ;.startcopy
mov ax,[vesa2selec] ; push es
mov es,ax ; mov ax,[vesa2selec]
mov esi,[vidbuffer] ; mov es,ax
mov edi,32*2*2 ; Draw @ Y from 9 to 247 ; mov esi,[vidbuffer]
cmp word[resolutn],224 ; mov edi,32*2*2 ; Draw @ Y from 9 to 247
jne .res239 ; cmp word[resolutn],224
mov edi,8*320*2*2+32*2*2 ; jne .res239
.res239 ; mov edi,8*320*2*2+32*2*2
add edi,[VidStartDraw] ;.res239
add esi,16+256+32 ; add edi,[VidStartDraw]
xor eax,eax ; add esi,16+256+32
mov dl,[resolutn] ; xor eax,eax
dec dl ; mov dl,[resolutn]
dec dl ; dec dl
cmp byte[scanlines],3 ; dec dl
je near .halfscanlines ; cmp byte[scanlines],3
cmp byte[scanlines],2 ; je near .halfscanlines
je near .quarterscanlines ; cmp byte[scanlines],2
cmp byte[scanlines],1 ; je near .quarterscanlines
je near .scanlines ; cmp byte[scanlines],1
.loopa ; je near .scanlines
mov ecx,256 ;.loopa
xor eax,eax ; mov ecx,256
.a ; xor eax,eax
mov al,[esi] ;.a
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .a ; dec ecx
sub esi,256 ; jnz .a
add edi,128*2 ; sub esi,256
mov ecx,256 ; add edi,128*2
xor eax,eax ; mov ecx,256
.a2 ; xor eax,eax
mov al,[esi] ;.a2
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .a2 ; dec ecx
add esi,32 ; jnz .a2
add edi,128*2 ; add esi,32
dec dl ; add edi,128*2
jnz .loopa ; dec dl
pop es ; jnz .loopa
ret ; pop es
; ret
.scanlines ;
.loopab ;.scanlines
mov ecx,256 ;.loopab
xor eax,eax ; mov ecx,256
.ab ; xor eax,eax
mov al,[esi] ;.ab
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .ab ; dec ecx
.returnb ; jnz .ab
add esi,32 ;.returnb
add edi,128*2+640*2 ; add esi,32
dec dl ; add edi,128*2+640*2
jnz .loopab ; dec dl
pop es ; jnz .loopab
ret ; pop es
; ret
.halfscanlines ;
.loopabh ;.halfscanlines
mov ecx,256 ;.loopabh
xor eax,eax ; mov ecx,256
.abh ; xor eax,eax
mov al,[esi] ;.abh
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .abh ; dec ecx
add edi,128*2 ; jnz .abh
mov ecx,256 ; add edi,128*2
sub esi,256 ; mov ecx,256
.abh2 ; sub esi,256
mov al,[esi] ;.abh2
mov bx,[GUICPC+eax*2] ; mov al,[esi]
shl ebx,16 ; mov bx,[GUICPC+eax*2]
mov bx,[GUICPC+eax*2] ; shl ebx,16
and ebx,[vesa2_clbitng2] ; mov bx,[GUICPC+eax*2]
shr ebx,1 ; and ebx,[vesa2_clbitng2]
mov [es:edi],ebx ; shr ebx,1
inc esi ; mov [es:edi],ebx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .abh2 ; dec ecx
add esi,32 ; jnz .abh2
add edi,128*2 ; add esi,32
dec dl ; add edi,128*2
jnz .loopabh ; dec dl
pop es ; jnz .loopabh
ret ; pop es
; ret
.quarterscanlines ;
.loopabhq ;.quarterscanlines
mov ecx,256 ;.loopabhq
xor eax,eax ; mov ecx,256
.abhq ; xor eax,eax
mov al,[esi] ;.abhq
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
inc esi ; mov [es:edi+2],bx
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .abhq ; dec ecx
add edi,128*2 ; jnz .abhq
mov ecx,256 ; add edi,128*2
sub esi,256 ; mov ecx,256
.abh2q ; sub esi,256
mov al,[esi] ;.abh2q
mov bx,[GUICPC+eax*2] ; mov al,[esi]
shl ebx,16 ; mov bx,[GUICPC+eax*2]
mov bx,[GUICPC+eax*2] ; shl ebx,16
and ebx,[vesa2_clbitng2] ; mov bx,[GUICPC+eax*2]
shr ebx,1 ; and ebx,[vesa2_clbitng2]
mov eax,ebx ; shr ebx,1
and eax,[vesa2_clbitng2] ; mov eax,ebx
shr eax,1 ; and eax,[vesa2_clbitng2]
add ebx,eax ; shr eax,1
mov [es:edi],ebx ; add ebx,eax
xor eax,eax ; mov [es:edi],ebx
inc esi ; xor eax,eax
add edi,4 ; inc esi
dec ecx ; add edi,4
jnz .abh2q ; dec ecx
add esi,32 ; jnz .abh2q
add edi,128*2 ; add esi,32
dec dl ; add edi,128*2
jnz .loopabhq ; dec dl
pop es ; jnz .loopabhq
ret ; pop es
; ret
NEWSYM smallscreen640x480x16bgui ;
cmp byte[curblank],40h ;NEWSYM smallscreen640x480x16bgui
jne .startcopy ; cmp byte[curblank],40h
ret ; jne .startcopy
.startcopy ; ret
push es ;.startcopy
mov ax,[vesa2selec] ; push es
mov es,ax ; mov ax,[vesa2selec]
mov esi,[vidbuffer] ; mov es,ax
mov edi,32*2*2 ; Draw @ Y from 9 to 247 ; mov esi,[vidbuffer]
cmp word[resolutn],224 ; mov edi,32*2*2 ; Draw @ Y from 9 to 247
jne .res239 ; cmp word[resolutn],224
mov edi,8*640*2+32*2*2 ; jne .res239
.res239 ; mov edi,8*640*2+32*2*2
add edi,[VidStartDraw] ;.res239
add edi,128*2+120*640*2 ; add edi,[VidStartDraw]
add esi,16+256+32 ; add edi,128*2+120*640*2
xor eax,eax ; add esi,16+256+32
mov ebx,hirestiledat+1 ; xor eax,eax
mov dl,[resolutn] ; mov ebx,hirestiledat+1
dec dl ; mov dl,[resolutn]
dec dl ; dec dl
.loopa ; dec dl
mov ecx,256 ;.loopa
xor eax,eax ; mov ecx,256
.a3 ; xor eax,eax
mov al,[esi] ;.a3
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
inc esi ; mov [es:edi],bx
add edi,2 ; inc esi
dec ecx ; add edi,2
jnz .a3 ; dec ecx
add esi,32 ; jnz .a3
add edi,640*2-256*2 ; add esi,32
inc ebx ; add edi,640*2-256*2
dec dl ; inc ebx
jnz .loopa ; dec dl
pop es ; jnz .loopa
ret ; pop es
; ret
.fullscreen ;
cmp byte[curblank],40h ;.fullscreen
jne .startcopy2 ; cmp byte[curblank],40h
ret ; jne .startcopy2
.startcopy2 ; ret
push es ;.startcopy2
mov ax,[vesa2selec] ; push es
mov es,ax ; mov ax,[vesa2selec]
mov esi,[vidbuffer] ; mov es,ax
xor edi,edi ; mov esi,[vidbuffer]
cmp word[resolutn],224 ; xor edi,edi
jne .res239b ; cmp word[resolutn],224
mov edi,8*320*2*2 ; jne .res239b
.res239b ; mov edi,8*320*2*2
add edi,[VidStartDraw] ;.res239b
add esi,16+256+32 ; add edi,[VidStartDraw]
xor eax,eax ; add esi,16+256+32
mov dl,[resolutn] ; xor eax,eax
dec dl ; mov dl,[resolutn]
dec dl ; dec dl
cmp byte[scanlines],1 ; dec dl
je near .scanlines ; cmp byte[scanlines],1
.loopa2 ; je near .scanlines
mov ecx,128 ;.loopa2
xor eax,eax ; mov ecx,128
.a ; xor eax,eax
mov al,[esi] ;.a
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
mov al,[esi+1] ; mov [es:edi+2],bx
mov bx,[GUICPC+eax*2] ; mov al,[esi+1]
mov [es:edi+4],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+6],bx ; mov [es:edi+4],bx
mov [es:edi+8],bx ; mov [es:edi+6],bx
add esi,2 ; mov [es:edi+8],bx
add edi,10 ; add esi,2
dec ecx ; add edi,10
jnz .a ; dec ecx
sub esi,256 ; jnz .a
mov ecx,128 ; sub esi,256
.a2 ; mov ecx,128
mov al,[esi] ;.a2
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
mov al,[esi+1] ; mov [es:edi+2],bx
mov bx,[GUICPC+eax*2] ; mov al,[esi+1]
mov [es:edi+4],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+6],bx ; mov [es:edi+4],bx
mov [es:edi+8],bx ; mov [es:edi+6],bx
add esi,2 ; mov [es:edi+8],bx
add edi,10 ; add esi,2
dec ecx ; add edi,10
jnz .a2 ; dec ecx
add esi,32 ; jnz .a2
dec dl ; add esi,32
jnz near .loopa2 ; dec dl
pop es ; jnz near .loopa2
ret ; pop es
; ret
.scanlines ;
.loopab ;.scanlines
mov ecx,128 ;.loopab
xor eax,eax ; mov ecx,128
.ab ; xor eax,eax
mov al,[esi] ;.ab
mov bx,[GUICPC+eax*2] ; mov al,[esi]
mov [es:edi],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+2],bx ; mov [es:edi],bx
mov al,[esi+1] ; mov [es:edi+2],bx
mov bx,[GUICPC+eax*2] ; mov al,[esi+1]
mov [es:edi+4],bx ; mov bx,[GUICPC+eax*2]
mov [es:edi+6],bx ; mov [es:edi+4],bx
mov [es:edi+8],bx ; mov [es:edi+6],bx
add esi,2 ; mov [es:edi+8],bx
add edi,10 ; add esi,2
dec ecx ; add edi,10
jnz .ab ; dec ecx
add esi,32 ; jnz .ab
add edi,640*2 ; add esi,32
dec dl ; add edi,640*2
jnz .loopab ; dec dl
pop es ; jnz .loopab
ret ; pop es
; ret
NEWSYM copyvesa2640x480x16b NEWSYM copyvesa2640x480x16b
; cmp byte[vesa2red10],1 ; cmp byte[vesa2red10],1
@@ -5723,6 +5727,7 @@ SECTION .text
;******************************************************* ;*******************************************************
NEWSYM copyvesa2512x384x16bgui NEWSYM copyvesa2512x384x16bgui
jmp copyvesa2512x384x16b
; cmp byte[curblank],40h ; cmp byte[curblank],40h
; jne .startcopy ; jne .startcopy
; ret ; ret