Added 640x400 video mode variants to the DOS port.

This commit is contained in:
stainless
2001-10-09 21:46:56 +00:00
parent 7d148b4a73
commit be5e9d4f32
6 changed files with 296 additions and 33 deletions

View File

@@ -626,8 +626,9 @@ db '; 4 = 320x240x8B (MODEX) 5 = 320x256x8B (MODEX)',13,10
db '; 6 = 640x480x16B (VESA1) 7 = 320x240x8B (VESA2)',13,10
db '; 8 = 320x240x16B (VESA2) 9 = 320x480x8B (VESA2)',13,10
db '; 10 = 320x480x16B (VESA2) 11 = 512x384x8B (VESA2)',13,10
db '; 12 = 512x384x16B (VESA2) 13 = 640x480x8B (VESA2)',13,10
db '; 14 = 640x480x16B (VESA2)',13,10
db '; 12 = 512x384x16B (VESA2) 13 = 640x400x8B (VESA2)',13,10
db '; 14 = 640x400x16B (VESA2) 15 = 640x480x8B (VESA2)',13,10
db '; 16 = 640x480x16B (VESA2)',13,10
db '',13,10
db 'VideoModeDos = %U',13,10
db '',13,10

View File

@@ -1032,29 +1032,31 @@ db '320X480X8B VESA2',0 ; 9
db '320X480X16B VESA2',0 ; 10
db '512X384X8B VESA2',0 ; 11
db '512X384X16B VESA2',0 ; 12
db '640X480X8B VESA2',0 ; 13
db '640X480X16B VESA2',0 ; 14
db '640X400X8B VESA2',0 ; 13
db '640X400X16B VESA2',0 ; 14
db '640X480X8B VESA2',0 ; 15
db '640X480X16B VESA2',0 ; 16
db ' ',0
; Video Mode Feature Availability (1 = Available, 0 = Not Available)
; Left side starts with Video Mode 0
NEWSYM GUI16VID, db 0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0 ; 16-bit mode
NEWSYM GUINGVID, db 1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0 ; New Graphics Mode Available
NEWSYM GUISLVID, db 0,0,1,0,0,1,1,0,0,1,1,0,0,1,1,0 ; Scanlines
NEWSYM GUIINVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; Interpolation
NEWSYM GUIEAVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 ; Eagle
NEWSYM GUIIEVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0 ; (Interp | Eagle)
NEWSYM GUIFSVID, db 0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0 ; Full Screen
NEWSYM GUIWSVID, db 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0 ; (Full Scr. | Wide Scr.)
NEWSYM GUISSVID, db 0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0 ; Small Screen
NEWSYM GUITBVID, db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0 ; Triple Buffering
NEWSYM GUIHSVID, db 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0 ; Half/Quarter Scanlines
NEWSYM GUI2xVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; 2xSaI/Super Eagle Engines
NEWSYM GUIWFVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; If Windows Full Screen
NEWSYM GUII2VID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Super 2xSAI Engine
NEWSYM GUIM7VID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; Hi-Resolution Mode 7
NEWSYM GUIBIFIL, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Bilinear Filtering
NEWSYM GUITBWVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Triple Buffering (Win)
NEWSYM GUI16VID, db 0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0 ; 16-bit mode
NEWSYM GUINGVID, db 1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0 ; New Graphics Mode Available
NEWSYM GUISLVID, db 0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0 ; Scanlines
NEWSYM GUIINVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; Interpolation
NEWSYM GUIEAVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 ; Eagle
NEWSYM GUIIEVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0 ; (Interp | Eagle)
NEWSYM GUIFSVID, db 0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,0 ; Full Screen
NEWSYM GUIWSVID, db 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0 ; (Full Scr. | Wide Scr.)
NEWSYM GUISSVID, db 0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,0 ; Small Screen
NEWSYM GUITBVID, db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0 ; Triple Buffering
NEWSYM GUIHSVID, db 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0 ; Half/Quarter Scanlines
NEWSYM GUI2xVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; 2xSaI/Super Eagle Engines
NEWSYM GUIWFVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; If Windows Full Screen
NEWSYM GUII2VID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Super 2xSAI Engine
NEWSYM GUIM7VID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; Hi-Resolution Mode 7
NEWSYM GUIBIFIL, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Bilinear Filtering
NEWSYM GUITBWVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Triple Buffering (Win)
SECTION .text
; ****************************

View File

@@ -82,8 +82,12 @@ NEWSYM dosinitvideo
cmp byte[cvidmode],12
je near .initvesa2512x384x16
cmp byte[cvidmode],13
je near .initvesa2640x480x8
je near .initvesa2640x400x8
cmp byte[cvidmode],14
je near .initvesa2640x400x16
cmp byte[cvidmode],15
je near .initvesa2640x480x8
cmp byte[cvidmode],16
je near .initvesa2640x480x16
ret
@@ -411,6 +415,63 @@ NEWSYM dosinitvideo
pop es
ret
;*******************************************************
; InitVESA2 640x400x8 Set up Linear 640x400x8b
;*******************************************************
.initvesa2640x400x8
mov byte[res640],2
mov word[vesa2_x],640
mov word[vesa2_y],400
mov byte[vesa2_bits],8
call InitVesa2
cmp byte[videotroub],1
jne .notrouble9
ret
.notrouble9
call makepal
; clear screen (640*400 bytes)
push es
mov ax,[vesa2selec]
mov es,ax
mov edi,0
mov ecx,640*400
.loopg
mov byte[es:edi],0
inc edi
dec ecx
jnz .loopg
pop es
ret
;*******************************************************
; InitVESA2 640x400x16 Set up Linear 640x400x16b
;*******************************************************
.initvesa2640x400x16
mov byte[res640],2
mov byte[cbitmode],1
mov word[vesa2_x],640
mov word[vesa2_y],400
mov byte[vesa2_bits],16
call InitVesa2
cmp byte[videotroub],1
jne .notrouble10
ret
.notrouble10
; clear screen (640*400*2 bytes)
push es
mov ax,[vesa2selec]
mov es,ax
mov edi,0
mov ecx,640*400*2
.looph
mov byte[es:edi],0
inc edi
dec ecx
jnz .looph
pop es
ret
;*******************************************************
; InitVESA1.2 640x480x16 Set up 640x480x16b
@@ -435,11 +496,11 @@ NEWSYM dosinitvideo
xor edi,edi
mov ecx,16384
.loopg
.loopi
mov byte[es:edi],0
inc edi
dec ecx
jnz .loopg
jnz .loopi
dec ebx
jnz .loopbanks

View File

@@ -1495,8 +1495,9 @@ SECTION .data
db ' 6 = 640x480x16B (VESA1) 7 = 320x240x8B (VESA2)',13,10
db ' 8 = 320x240x16B (VESA2) 9 = 320x480x8B (VESA2)',13,10
db ' 10 = 320x480x16B (VESA2) 11 = 512x384x8B (VESA2)',13,10
db ' 12 = 512x384x16B (VESA2) 13 = 640x480x8B (VESA2)',13,10
db ' 14 = 640x480x16B (VESA2)',13,10
db ' 12 = 512x384x16B (VESA2) 13 = 640x400x8B (VESA2)',13,10
db ' 14 = 640x400x16B (VESA2) 15 = 640x480x8B (VESA2)',13,10
db ' 16 = 640x480x16B (VESA2)',13,10
%endif
db ' -w Enable VSync (disables Triple Buffering)',13,10
db 'Press any key to continue.',0

View File

@@ -274,7 +274,7 @@ NEWSYM cachevideo
je .nohires
cmp byte[cvidmode],9
je .yeshires
cmp byte[cvidmode],13
cmp byte[cvidmode],15
jne .nohires
.yeshires
mov byte[Mode7HiRes],1

View File

@@ -227,10 +227,10 @@ PreTripleBuffer:
SECTION .data
; Please don't break this again. :)
VidModeSize dd 0,0,0,0,0,0,0,320*240,320*240*2,320*480,320*480*2
dd 512*384,512*384*2,640*480,640*480*2
VidModeLine dd 0,0,0,0,0,0,0,240,240,480,480,384,384,480,480
dd 512*384,512*384*2,640*400,640*400*2,640*480,640*480*2
VidModeLine dd 0,0,0,0,0,0,0,240,240,480,480,384,384,400,400,480,480
NEWSYM VidStartDraw, dd 0
VidModeComp db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1
VidModeComp db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1
CVidStartAd db 0
ApplyStart db 4
@@ -291,8 +291,12 @@ ScreenShow:
cmp byte[cvidmode],12
je near copyvesa2512x384x16b
cmp byte[cvidmode],13
je near copyvesa2640x480x8b
je near copyvesa2640x400x8b
cmp byte[cvidmode],14
je near copyvesa2640x400x16b
cmp byte[cvidmode],15
je near copyvesa2640x480x8b
cmp byte[cvidmode],16
je near copyvesa2640x480x16b
cmp byte[curblank],40h
je .startcopy
@@ -338,8 +342,12 @@ ScreenShowGUI:
cmp byte[cvidmode],12
je near copyvesa2512x384x16bgui
cmp byte[cvidmode],13
je near copyvesa2640x480x8bgui
je near copyvesa2640x400x8b
cmp byte[cvidmode],14
je near copyvesa2640x400x16b
cmp byte[cvidmode],15
je near copyvesa2640x480x8bgui
cmp byte[cvidmode],16
je near copyvesa2640x480x16bgui
jmp copymodeq256
%endif
@@ -1259,6 +1267,162 @@ copyvesa2320x480x8ng:
.bi
jmp .returnloop
;*******************************************************
; Copy VESA2 640x400x8b Copies buffer to 640x400x8bVBE2
;*******************************************************
NEWSYM copyvesa2640x400x8b
cmp byte[curblank],40h
jne .startcopy
ret
.startcopy
push es
mov ax,[vesa2selec]
mov es,ax
mov esi,[vidbuffer]
mov edi,20*640+64
cmp word[resolutn],224
jne .res239
mov edi,32*640+64
.res239
add edi,[VidStartDraw]
add esi,16+256+32
xor eax,eax
mov dl,[resolutn]
dec dl
dec dl
cmp byte[smallscreenon],1
je .smallscreen
.loopa
mov ecx,256
call .loopa2
add esi,32
add edi,64*2
mov ecx,256
call .loopa2
sub esi,256
add edi,64*2
mov ecx,256
call .loopa2
add esi,32
add edi,64*2
dec dl
dec dl
jnz .loopa
jmp .done
.loopa2
mov al,[esi]
mov [es:edi],al
inc edi
mov [es:edi],al
inc esi
inc edi
dec ecx
jnz .loopa2
ret
.smallscreen
add edi,60*640+128
cmp byte[MMXSupport],1
je .ssloopb
.ssloopa
mov ecx,64
rep movsd
add esi,32
add edi,192*2
dec dl
jnz .ssloopa
jmp .done
.ssloopb
mov ecx,16
MMXStuff
add esi,32
add edi,192*2
dec dl
jnz .ssloopb
emms
.done
pop es
ret
NEWSYM copyvesa2640x400x16b
cmp byte[curblank],40h
jne .startcopy
ret
.startcopy
push es
mov ax,[vesa2selec]
mov es,ax
mov esi,[vidbuffer]
mov edi,20*640*2+64*2
cmp word[resolutn],224
jne .res239
mov edi,32*640*2+64*2
.res239
add edi,[VidStartDraw]
add esi,16*2+256*2+32*2
xor eax,eax
mov dl,[resolutn]
dec dl
dec dl
cmp byte[smallscreenon],1
je .smallscreen
.loopa
mov ecx,256
call .loopa2
add esi,32*2
add edi,64*2*2
mov ecx,256
call .loopa2
sub esi,256*2
add edi,64*2*2
mov ecx,256
call .loopa2
add esi,32*2
add edi,64*2*2
dec dl
dec dl
jnz .loopa
jmp .done
.loopa2
mov ax,[esi]
mov [es:edi],ax
add edi,2
mov [es:edi],ax
add esi,2
add edi,2
dec ecx
jnz .loopa2
ret
.smallscreen
add edi,60*640*2+128*2
cmp byte[MMXSupport],1
je .ssloopb
.ssloopa
mov ecx,64*2
rep movsd
add esi,32*2
add edi,192*2*2
dec dl
jnz .ssloopa
jmp .done
.ssloopb
mov ecx,16*2
MMXStuff
add esi,32*2
add edi,192*2*2
dec dl
jnz .ssloopb
emms
.done
pop es
ret
;*******************************************************
; Copy VESA2 640x480x8b Copies buffer to 640x480x8bVBE2
;*******************************************************
@@ -5966,8 +6130,12 @@ NEWSYM DOSClearScreen
cmp byte[cvidmode],12
je near cscopyvesa2512x384x16b
cmp byte[cvidmode],13
je near cscopyvesa2640x480x8b
je near cscopyvesa2640x400x8b
cmp byte[cvidmode],14
je near cscopyvesa2640x400x16b
cmp byte[cvidmode],15
je near cscopyvesa2640x480x8b
cmp byte[cvidmode],16
je near cscopyvesa2640x480x16b
%endif
ret
@@ -6070,6 +6238,36 @@ NEWSYM cscopyvesa2640x480x16b
pop es
ret
NEWSYM cscopyvesa2640x400x8b
push es
mov ax,[vesa2selec]
mov es,ax
mov edi,[VidStartDraw]
mov ecx,640*400
TripleBufferClear
.loopb
mov byte[es:edi],0
inc edi
dec ecx
jnz .loopb
pop es
ret
NEWSYM cscopyvesa2640x400x16b
push es
mov ax,[vesa2selec]
mov es,ax
mov edi,[VidStartDraw]
mov ecx,640*400*2
TripleBufferClear
.loopb
mov byte[es:edi],0
inc edi
dec ecx
jnz .loopb
pop es
ret
NEWSYM cscopyvesa2320x480x8b
push es
mov ax,[vesa2selec]