supported videomodes

git-svn-id: svn://kolibrios.org@753 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2008-02-22 12:38:59 +00:00
parent bda889fba8
commit 89e64cc63e
13 changed files with 135 additions and 103 deletions

View File

@ -250,8 +250,8 @@ MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF)
LFBAddress equ (OS_BASE+0x000FE80) LFBAddress equ (OS_BASE+0x000FE80)
MEM_AMOUNT equ (OS_BASE+0x000FE8C) MEM_AMOUNT equ (OS_BASE+0x000FE8C)
ScreenWidth equ (OS_BASE+0x000FE00) Screen_Max_X equ (OS_BASE+0x000FE00)
ScreenHeight equ (OS_BASE+0x000FE04) Screen_Max_Y equ (OS_BASE+0x000FE04)
BytesPerScanLine equ (OS_BASE+0x000FE08) BytesPerScanLine equ (OS_BASE+0x000FE08)
SCR_MODE equ (OS_BASE+0x000FE0C) SCR_MODE equ (OS_BASE+0x000FE0C)

View File

@ -983,7 +983,7 @@ malloc_large:
align 4 align 4
init_malloc: init_malloc:
stdcall kernel_alloc, 0x30000 stdcall kernel_alloc, 0x40000
mov [mst.top], eax mov [mst.top], eax
mov [mst.topsize], 128*1024 mov [mst.topsize], 128*1024

View File

@ -1063,9 +1063,9 @@ proc set_app_params stdcall,slot:dword, params:dword,\
mov [ecx+0],dword 0 mov [ecx+0],dword 0
mov [ecx+4],dword 0 mov [ecx+4],dword 0
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
mov [ecx+8],eax mov [ecx+8],eax
mov eax,[ScreenHeight] mov eax,[Screen_Max_Y]
mov [ecx+12],eax mov [ecx+12],eax
mov ebx, [pl0_stack] mov ebx, [pl0_stack]

View File

@ -104,6 +104,28 @@ vmode db '/sys/drivers/VMODE.MDR',0
vrr_m db 'VRR_M',0 vrr_m db 'VRR_M',0
kernel_file db 'KERNEL MNT' kernel_file db 'KERNEL MNT'
align 4
;supported videomodes
mode_1280_1024_32:
dw 1280,1024,32,60
mode_1280_1024_24:
dw 1280,1024,24,60
mode_1024_768_32:
dw 1024,768,32,60
mode_1024_768_24:
dw 1024,768,24,60
mode_800_600_32
dw 800,600,32,60
mode_800_600_24
dw 800,600,24,60
mode_640_480_32
dw 640,480,32,60
mode_640_480_24
dw 640,480,24,60
mode_640_480_16
dw 640,480,16,60
mode 320_240_8
dw 320,240,8,60
; mike.dld { ; mike.dld {
db 0 db 0

View File

@ -179,7 +179,7 @@ pushad
inc edx inc edx
; get WinMap start ; get WinMap start
mov edi, [ScreenWidth] ; screen_sx mov edi, [Screen_Max_X] ; screen_sx
inc edi inc edi
imul edi, ebx imul edi, ebx
add edi, eax add edi, eax
@ -199,7 +199,7 @@ pushad
pop edx pop edx
pop ecx pop ecx
add edi, [ScreenWidth] add edi, [Screen_Max_X]
inc edi inc edi
sub edi, ecx sub edi, ecx
dec edx dec edx
@ -240,7 +240,7 @@ pushad
; get WinMap start -> ebp ; get WinMap start -> ebp
push eax push eax
mov eax, [ScreenWidth] ; screen_sx mov eax, [Screen_Max_X] ; screen_sx
inc eax inc eax
imul eax, ebx imul eax, ebx
add eax, [esp] add eax, [esp]
@ -302,7 +302,7 @@ pushad
jb .ff_new_x jb .ff_new_x
sub ebp, [ff_xsz] sub ebp, [ff_xsz]
add ebp, [ff_x] add ebp, [ff_x]
add ebp, [ScreenWidth] ; screen.x add ebp, [Screen_Max_X] ; screen.x
inc ebp inc ebp
inc ebx inc ebx
cmp ebx, [ff_ysz] cmp ebx, [ff_ysz]
@ -359,9 +359,9 @@ display_settings:
redraw_screen_direct: redraw_screen_direct:
mov [dlx],dword 0 mov [dlx],dword 0
mov [dly],dword 0 mov [dly],dword 0
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
mov [dlxe],eax mov [dlxe],eax
mov eax,[ScreenHeight] mov eax,[Screen_Max_Y]
mov [dlye],eax mov [dlye],eax
mov eax,window_data mov eax,window_data
call redrawscreen call redrawscreen
@ -437,10 +437,10 @@ display_settings:
movsx ebx,word[esp+16] movsx ebx,word[esp+16]
cmp eax,ebx cmp eax,ebx
jge .lp1 jge .lp1
or eax,eax;[ScreenWidth] or eax,eax;[Screen_Max_X]
jl @f jl @f
mov [screen_workarea.left],eax mov [screen_workarea.left],eax
@@: cmp ebx,[ScreenWidth] @@: cmp ebx,[Screen_Max_X]
jg .lp1 jg .lp1
mov [screen_workarea.right],ebx mov [screen_workarea.right],ebx
.lp1: movsx eax,word[esp+24+2] .lp1: movsx eax,word[esp+24+2]
@ -450,14 +450,14 @@ display_settings:
or eax,eax;[0xFE04] or eax,eax;[0xFE04]
jl @f jl @f
mov [screen_workarea.top],eax mov [screen_workarea.top],eax
@@: cmp ebx,[ScreenHeight] @@: cmp ebx,[Screen_Max_Y]
jg .lp2 jg .lp2
mov [screen_workarea.bottom],ebx mov [screen_workarea.bottom],ebx
.lp2: call repos_windows .lp2: call repos_windows
mov eax, 0 mov eax, 0
mov ebx, 0 mov ebx, 0
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
mov edx, [ScreenHeight] mov edx, [Screen_Max_Y]
call calculatescreen call calculatescreen
; jmp redraw_screen_direct ; jmp redraw_screen_direct
.exit: .exit:
@ -483,8 +483,8 @@ display_settings:
jnz .ret jnz .ret
xor eax, eax xor eax, eax
xor ebx, ebx xor ebx, ebx
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
mov edx, [ScreenHeight] mov edx, [Screen_Max_Y]
call calculatescreen call calculatescreen
jmp redraw_screen_direct jmp redraw_screen_direct
.ret: .ret:
@ -526,7 +526,7 @@ repos_windows:
ret ret
.lp2: mov eax,[edi+WDATA.box.left] .lp2: mov eax,[edi+WDATA.box.left]
add eax,[edi+WDATA.box.width] add eax,[edi+WDATA.box.width]
mov ebx,[ScreenWidth] mov ebx,[Screen_Max_X]
; inc ebx ; inc ebx
cmp eax,ebx cmp eax,ebx
jle .lp4 jle .lp4
@ -538,7 +538,7 @@ repos_windows:
mov [edi+WDATA.box.left],ebx mov [edi+WDATA.box.left],ebx
.lp4: mov eax,[edi+WDATA.box.top] .lp4: mov eax,[edi+WDATA.box.top]
add eax,[edi+WDATA.box.height] add eax,[edi+WDATA.box.height]
mov ebx,[ScreenHeight] mov ebx,[Screen_Max_Y]
; inc ebx ; inc ebx
cmp eax,ebx cmp eax,ebx
jle .lp6 jle .lp6
@ -569,7 +569,7 @@ check_window_position:
mov esi,ecx ; check x pos mov esi,ecx ; check x pos
add esi,eax add esi,eax
cmp esi,[ScreenWidth] cmp esi,[Screen_Max_X]
jbe x_pos_ok jbe x_pos_ok
mov [edi+WDATA.box.left],dword 0 mov [edi+WDATA.box.left],dword 0
xor eax, eax xor eax, eax
@ -577,7 +577,7 @@ check_window_position:
mov esi,edx ; check y pos mov esi,edx ; check y pos
add esi,ebx add esi,ebx
cmp esi,[ScreenHeight] cmp esi,[Screen_Max_Y]
jbe y_pos_ok jbe y_pos_ok
mov [edi+WDATA.box.top],dword 0 mov [edi+WDATA.box.top],dword 0
mov ebx,0 mov ebx,0
@ -585,17 +585,17 @@ check_window_position:
mov esi,ecx ; check x size mov esi,ecx ; check x size
add esi,eax add esi,eax
cmp esi,[ScreenWidth] cmp esi,[Screen_Max_X]
jbe x_size_ok jbe x_size_ok
mov ecx,[ScreenWidth] mov ecx,[Screen_Max_X]
mov [edi+WDATA.box.width],ecx mov [edi+WDATA.box.width],ecx
x_size_ok: x_size_ok:
mov esi,edx ; check y size mov esi,edx ; check y size
add esi,ebx add esi,ebx
cmp esi,[ScreenHeight] cmp esi,[Screen_Max_Y]
jbe y_size_ok jbe y_size_ok
mov edx,[ScreenHeight] mov edx,[Screen_Max_Y]
mov [edi+WDATA.box.height],edx mov [edi+WDATA.box.height],edx
y_size_ok: y_size_ok:
@ -1391,8 +1391,8 @@ checkwindows:
call drawwindowframes call drawwindowframes
mov ax,[ScreenWidth] mov ax,[Screen_Max_X]
mov bx,[ScreenHeight] mov bx,[Screen_Max_Y]
cmp [do_resize_from_corner],1 cmp [do_resize_from_corner],1
je no_new_position je no_new_position
@ -1545,9 +1545,9 @@ checkwindows:
sub eax,[screen_workarea.top] sub eax,[screen_workarea.top]
@@: mov [edi+WDATA.box.height],eax @@: mov [edi+WDATA.box.height],eax
add eax, [edi+WDATA.box.top] add eax, [edi+WDATA.box.top]
cmp eax, [ScreenHeight] cmp eax, [Screen_Max_Y]
jbe @f jbe @f
mov eax, [ScreenHeight] mov eax, [Screen_Max_Y]
sub eax, [edi+WDATA.box.height] sub eax, [edi+WDATA.box.height]
mov [edi+WDATA.box.top], eax mov [edi+WDATA.box.top], eax
@@: call check_window_position @@: call check_window_position
@ -1605,16 +1605,16 @@ checkwindows:
mov eax,[edi+WDATA.box.top] ; check Y inside screen mov eax,[edi+WDATA.box.top] ; check Y inside screen
add eax,[edi+WDATA.box.height] add eax,[edi+WDATA.box.height]
cmp eax,[ScreenHeight] cmp eax,[Screen_Max_Y]
jbe no_window_sizing jbe no_window_sizing
mov eax,[edi+WDATA.box.left] ; check X inside screen mov eax,[edi+WDATA.box.left] ; check X inside screen
add eax,[edi+WDATA.box.width] add eax,[edi+WDATA.box.width]
cmp eax,[ScreenWidth] cmp eax,[Screen_Max_X]
jbe no_window_sizing jbe no_window_sizing
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
sub eax,[edi+WDATA.box.width] sub eax,[edi+WDATA.box.width]
mov [edi+WDATA.box.left],eax mov [edi+WDATA.box.left],eax
mov eax,[ScreenHeight] mov eax,[Screen_Max_Y]
sub eax,[edi+WDATA.box.height] sub eax,[edi+WDATA.box.height]
mov [edi+WDATA.box.top],eax mov [edi+WDATA.box.top],eax
call set_window_clientbox call set_window_clientbox

View File

@ -92,10 +92,10 @@ check_mouse_data_com:
add ax, [MOUSE_X] add ax, [MOUSE_X]
; Курсор не должен выходить за левую или правую границу экрана ; Курсор не должен выходить за левую или правую границу экрана
js .x1 js .x1
cmp ax, [ScreenWidth] cmp ax, [Screen_Max_X]
jb .x2 jb .x2
; Установить координату X по правой границе ; Установить координату X по правой границе
mov ax, [ScreenWidth] mov ax, [Screen_Max_X]
jmp .x2 jmp .x2
.x1: .x1:
; Установить координату X по левой границе ; Установить координату X по левой границе
@ -111,10 +111,10 @@ check_mouse_data_com:
add ax, [MOUSE_Y] add ax, [MOUSE_Y]
; Курсор не должен выходить за верхнюю или нижнюю границу экрана ; Курсор не должен выходить за верхнюю или нижнюю границу экрана
js .y1 js .y1
cmp ax, [ScreenHeight] cmp ax, [Screen_Max_Y]
jb .y2 jb .y2
; Установить координату Y по нижней границе ; Установить координату Y по нижней границе
mov ax, [ScreenHeight] mov ax, [Screen_Max_Y]
jmp .y2 jmp .y2
.y1: .y1:
; Установить координату Y по верхней границе ; Установить координату Y по верхней границе

View File

@ -108,7 +108,7 @@ save_draw_mouse:
push eax push eax
push ebx push ebx
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
inc ecx inc ecx
mul ecx mul ecx
@ -292,7 +292,7 @@ __sys_disable_mouse:
add edx,window_data add edx,window_data
movzx eax, word [MOUSE_X] movzx eax, word [MOUSE_X]
movzx ebx, word [MOUSE_Y] movzx ebx, word [MOUSE_Y]
mov ecx,[ScreenWidth] mov ecx,[Screen_Max_X]
inc ecx inc ecx
imul ecx,ebx imul ecx,ebx
add ecx,eax add ecx,eax
@ -304,7 +304,7 @@ __sys_disable_mouse:
movzx ebx, byte [ecx+16] movzx ebx, byte [ecx+16]
cmp eax,ebx cmp eax,ebx
je yes_mouse_disable je yes_mouse_disable
mov ebx,[ScreenWidth] mov ebx,[Screen_Max_X]
inc ebx inc ebx
imul ebx,10 imul ebx,10
add ecx,ebx add ecx,ebx
@ -411,9 +411,9 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro
mov eax,0 mov eax,0
jmp @@M2 jmp @@M2
@@M1: @@M1:
cmp ax,[ScreenWidth] ;ScreenLength cmp ax,[Screen_Max_X] ;ScreenLength
jl @@M2 jl @@M2
mov ax,[ScreenWidth] ;ScreenLength-1 mov ax,[Screen_Max_X] ;ScreenLength-1
@@M2: @@M2:
mov [MOUSE_X],ax ;[XCoordinate] mov [MOUSE_X],ax ;[XCoordinate]
@ -428,9 +428,9 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro
mov ax,0 mov ax,0
jmp @@M4 jmp @@M4
@@M3: @@M3:
cmp ax,[ScreenHeight] ;ScreenHeigth cmp ax,[Screen_Max_Y] ;ScreenHeigth
jl @@M4 jl @@M4
mov ax,[ScreenHeight] ;ScreenHeigth-1 mov ax,[Screen_Max_Y] ;ScreenHeigth-1
@@M4: @@M4:
mov [MOUSE_Y],ax ;[YCoordinate] mov [MOUSE_Y],ax ;[YCoordinate]

View File

@ -344,13 +344,16 @@ high_code:
mov [allow_dma_access], al mov [allow_dma_access], al
mov al,[BOOT_VAR+0x9000] ; bpp mov al,[BOOT_VAR+0x9000] ; bpp
mov [ScreenBPP],al mov [ScreenBPP],al
xchg bx, bx
movzx eax,word [BOOT_VAR+0x900A] ; X max movzx eax,word [BOOT_VAR+0x900A] ; X max
dec eax dec eax
mov [ScreenWidth],eax mov [Screen_Max_X],eax
mov [screen_workarea.right],eax mov [screen_workarea.right],eax
movzx eax,word [BOOT_VAR+0x900C] ; Y max movzx eax,word [BOOT_VAR+0x900C] ; Y max
dec eax dec eax
mov [ScreenHeight],eax mov [Screen_Max_Y],eax
mov [screen_workarea.bottom],eax mov [screen_workarea.bottom],eax
movzx eax,word [BOOT_VAR+0x9008] ; screen mode movzx eax,word [BOOT_VAR+0x9008] ; screen mode
mov [SCR_MODE],eax mov [SCR_MODE],eax
@ -1126,10 +1129,10 @@ set_variables:
;* mouse centered - start code- Mario79 ;* mouse centered - start code- Mario79
mouse_centered: mouse_centered:
push eax push eax
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
shr eax,1 shr eax,1
mov [MOUSE_X],ax mov [MOUSE_X],ax
mov eax,[ScreenHeight] mov eax,[Screen_Max_Y]
shr eax,1 shr eax,1
mov [MOUSE_Y],ax mov [MOUSE_Y],ax
pop eax pop eax
@ -2559,8 +2562,8 @@ force_redraw_background:
mov [draw_data+32 + RECT.left],dword 0 mov [draw_data+32 + RECT.left],dword 0
mov [draw_data+32 + RECT.top],dword 0 mov [draw_data+32 + RECT.top],dword 0
push eax ebx push eax ebx
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
mov ebx,[ScreenHeight] mov ebx,[Screen_Max_Y]
mov [draw_data+32 + RECT.right],eax mov [draw_data+32 + RECT.right],eax
mov [draw_data+32 + RECT.bottom],ebx mov [draw_data+32 + RECT.bottom],ebx
pop ebx eax pop ebx eax
@ -2880,9 +2883,9 @@ sys_redrawstat:
add edx, draw_data - CURRENT_TASK add edx, draw_data - CURRENT_TASK
mov [edx + RECT.left], 0 mov [edx + RECT.left], 0
mov [edx + RECT.top], 0 mov [edx + RECT.top], 0
mov eax, [ScreenWidth] mov eax, [Screen_Max_X]
mov [edx + RECT.right], eax mov [edx + RECT.right], eax
mov eax, [ScreenHeight] mov eax, [Screen_Max_Y]
mov [edx + RECT.bottom], eax mov [edx + RECT.bottom], eax
mov edi, [TASK_BASE] mov edi, [TASK_BASE]
@ -3483,7 +3486,7 @@ ret
checkpixel: checkpixel:
push eax edx push eax edx
mov edx,[ScreenWidth] ; screen x size mov edx,[Screen_Max_X] ; screen x size
inc edx inc edx
imul edx, ebx imul edx, ebx
mov dl, [eax+edx+display_data] ; lea eax, [...] mov dl, [eax+edx+display_data] ; lea eax, [...]
@ -3544,8 +3547,8 @@ set_bgr_event:
no_set_bgr_event: no_set_bgr_event:
; mov [draw_data+32 + RECT.left],dword 0 ; mov [draw_data+32 + RECT.left],dword 0
; mov [draw_data+32 + RECT.top],dword 0 ; mov [draw_data+32 + RECT.top],dword 0
; mov eax,[ScreenWidth] ; mov eax,[Screen_Max_X]
; mov ebx,[ScreenHeight] ; mov ebx,[Screen_Max_Y]
; mov [draw_data+32 + RECT.right],eax ; mov [draw_data+32 + RECT.right],eax
; mov [draw_data+32 + RECT.bottom],ebx ; mov [draw_data+32 + RECT.bottom],ebx
call drawbackground call drawbackground
@ -4856,9 +4859,9 @@ sys_gs: ; direct screen access
cmp eax,1 ; resolution cmp eax,1 ; resolution
jne no_gs1 jne no_gs1
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
shl eax,16 shl eax,16
mov ax,[ScreenHeight] mov ax,[Screen_Max_Y]
add eax,0x00010001 add eax,0x00010001
mov [esp+36],eax mov [esp+36],eax
ret ret
@ -4970,9 +4973,9 @@ syscall_drawrect: ; DrawRect
align 4 align 4
syscall_getscreensize: ; GetScreenSize syscall_getscreensize: ; GetScreenSize
mov ax, [ScreenWidth] mov ax, [Screen_Max_X]
shl eax, 16 shl eax, 16
mov ax, [ScreenHeight] mov ax, [Screen_Max_Y]
mov [esp + 32], eax mov [esp + 32], eax
ret ret
@ -5060,7 +5063,7 @@ syscall_writeramdiskfile: ; WriteRamdiskFile
align 4 align 4
syscall_getpixel: ; GetPixel syscall_getpixel: ; GetPixel
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
inc ecx inc ecx
xor edx, edx xor edx, edx
mov eax, ebx mov eax, ebx

View File

@ -61,6 +61,13 @@ virtual at 0
BOX BOX BOX BOX
end virtual end virtual
struc DISPMODE {
.width rw 1
.height rw 1
.bpp rw 1
.freq rw 1
}
; constants definition ; constants definition
WSTATE_NORMAL = 00000000b WSTATE_NORMAL = 00000000b
WSTATE_MAXIMIZED = 00000001b WSTATE_MAXIMIZED = 00000001b

View File

@ -478,8 +478,8 @@ proc init_cursors
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
mov [def_cursor], eax mov [def_cursor], eax
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
mov edx, [ScreenHeight] mov edx, [Screen_Max_Y]
inc ecx inc ecx
inc edx inc edx
mov [scr_width], ecx mov [scr_width], ecx

View File

@ -290,14 +290,14 @@ vesa12_drawbackground:
push edx push edx
mul dword [BgrDataWidth] mul dword [BgrDataWidth]
mov ecx,[ScreenWidth] mov ecx,[Screen_Max_X]
inc ecx inc ecx
div ecx div ecx
push eax push eax
mov eax,ebx mov eax,ebx
mul dword [BgrDataHeight] mul dword [BgrDataHeight]
mov ecx,[ScreenHeight] mov ecx,[Screen_Max_Y]
inc ecx inc ecx
div ecx div ecx
mov ebx,eax mov ebx,eax
@ -324,7 +324,7 @@ vesa12_drawbackground:
pusha pusha
mov esi,eax mov esi,eax
mov edi,ebx mov edi,ebx
mov eax,[ScreenWidth] mov eax,[Screen_Max_X]
add eax,1 add eax,1
mul ebx mul ebx
cmp [eax+esi+WinMapAddress],byte 1 cmp [eax+esi+WinMapAddress],byte 1
@ -443,10 +443,10 @@ vesa12_drawbar:
cmp ecx,0 cmp ecx,0
jnz dbcblimitlset12 jnz dbcblimitlset12
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
cmp ecx,[ScreenWidth] cmp ecx,[Screen_Max_X]
jnz dbcblimitlset12 jnz dbcblimitlset12
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
cmp ecx,[ScreenHeight] cmp ecx,[Screen_Max_Y]
jnz dbcblimitlset12 jnz dbcblimitlset12
pop ecx pop ecx
pop eax pop eax
@ -799,10 +799,10 @@ vesa12_putimage:
cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0 cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0
jnz dbcblimitlset212 jnz dbcblimitlset212
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
cmp ecx,[ScreenWidth] cmp ecx,[Screen_Max_X]
jnz dbcblimitlset212 jnz dbcblimitlset212
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
cmp ecx,[ScreenHeight] cmp ecx,[Screen_Max_Y]
jnz dbcblimitlset212 jnz dbcblimitlset212
pop ecx pop ecx
push 0 push 0

View File

@ -23,8 +23,8 @@ $Revision$
; If you're planning to write your own video driver I suggest ; If you're planning to write your own video driver I suggest
; you replace the VESA12.INC file and see those instructions. ; you replace the VESA12.INC file and see those instructions.
;ScreenWidth equ 0xfe00 ;Screen_Max_X equ 0xfe00
;ScreenHeight equ 0xfe04 ;Screen_Max_Y equ 0xfe04
;BytesPerScanLine equ 0xfe08 ;BytesPerScanLine equ 0xfe08
;LFBAddress equ 0xfe80 ;LFBAddress equ 0xfe80
;ScreenBPP equ 0xfbf1 ;ScreenBPP equ 0xfbf1
@ -172,7 +172,7 @@ vesa20_putimage:
add eax, [putimg.arg_0] add eax, [putimg.arg_0]
mov [putimg.line_increment], eax mov [putimg.line_increment], eax
; winmap new line increment ; winmap new line increment
mov eax, [ScreenWidth] mov eax, [Screen_Max_X]
inc eax inc eax
sub eax, [putimg.real_sx] sub eax, [putimg.real_sx]
mov [putimg.winmap_newline], eax mov [putimg.winmap_newline], eax
@ -197,7 +197,7 @@ vesa20_putimage:
add edx, [LFBAddress] add edx, [LFBAddress]
; pointer to pixel map ; pointer to pixel map
mov eax, [putimg.abs_cy] mov eax, [putimg.abs_cy]
imul eax, [ScreenWidth] imul eax, [Screen_Max_X]
add eax, [putimg.abs_cy] add eax, [putimg.abs_cy]
add eax, [putimg.abs_cx] add eax, [putimg.abs_cx]
add eax, WinMapAddress add eax, WinMapAddress
@ -232,7 +232,7 @@ align 4
; pop edx ebp ; pop edx ebp
add esi, [putimg.line_increment] add esi, [putimg.line_increment]
add edx, [putimg.screen_newline] ;[BytesPerScanLine] add edx, [putimg.screen_newline] ;[BytesPerScanLine]
add ebp, [putimg.winmap_newline] ;[ScreenWidth] add ebp, [putimg.winmap_newline] ;[Screen_Max_X]
; inc ebp ; inc ebp
dec edi dec edi
jnz .new_line jnz .new_line
@ -265,7 +265,7 @@ align 4
; pop edx ebp ; pop edx ebp
add esi, [putimg.line_increment] add esi, [putimg.line_increment]
add edx, [putimg.screen_newline] ;[BytesPerScanLine] add edx, [putimg.screen_newline] ;[BytesPerScanLine]
add ebp, [putimg.winmap_newline] ;[ScreenWidth] add ebp, [putimg.winmap_newline] ;[Screen_Max_X]
; inc ebp ; inc ebp
dec edi dec edi
jnz .new_line jnz .new_line
@ -297,9 +297,9 @@ __sys_putpixel:
pop ecx pop ecx
jnz .exit jnz .exit
.forced: .forced:
cmp [ScreenWidth], eax cmp [Screen_Max_X], eax
jb .exit jb .exit
cmp [ScreenHeight], ebx cmp [Screen_Max_Y], ebx
jb .exit jb .exit
.ok: .ok:
; check if negation ; check if negation
@ -346,7 +346,7 @@ Vesa20_putpixel32:
;align 4 ;align 4
calculate_edi: calculate_edi:
mov edi, ebx mov edi, ebx
imul edi, [ScreenWidth] imul edi, [Screen_Max_X]
add edi, ebx add edi, ebx
add edi, eax add edi, eax
ret ret
@ -603,7 +603,7 @@ vesa20_drawbar:
.end_y: .end_y:
mov [drbar.real_sy], ebx mov [drbar.real_sy], ebx
; line_inc_map ; line_inc_map
mov eax, [ScreenWidth] mov eax, [Screen_Max_X]
sub eax, [drbar.real_sx] sub eax, [drbar.real_sx]
inc eax inc eax
mov [drbar.line_inc_map], eax mov [drbar.line_inc_map], eax
@ -626,7 +626,7 @@ vesa20_drawbar:
add edx, [LFBAddress] add edx, [LFBAddress]
; pointer to pixel map ; pointer to pixel map
mov eax, [drbar.abs_cy] mov eax, [drbar.abs_cy]
imul eax, [ScreenWidth] imul eax, [Screen_Max_X]
add eax, [drbar.abs_cy] add eax, [drbar.abs_cy]
add eax, [drbar.abs_cx] add eax, [drbar.abs_cx]
add eax, WinMapAddress add eax, WinMapAddress
@ -726,7 +726,7 @@ align 4
; xor edx,edx ; xor edx,edx
; mov eax,ebp ; mov eax,ebp
; mov ebx,[ScreenWidth] ; Screen_X_size ; mov ebx,[Screen_Max_X] ; Screen_X_size
; inc ebx ; +1 ; inc ebx ; +1
; sub eax,WinMapAddress ; -AddrBuffer ; sub eax,WinMapAddress ; -AddrBuffer
; div ebx ; ; div ebx ;
@ -752,7 +752,7 @@ align 4
; pusha ; pusha
; xor edx,edx ; xor edx,edx
; mov ebx,[ScreenWidth] ; mov ebx,[Screen_Max_X]
; inc ebx ; inc ebx
; sub eax,WinMapAddress ; sub eax,WinMapAddress
; div ebx ; div ebx
@ -864,23 +864,23 @@ vesa20_drawbackground_stretch:
call [disable_mouse] call [disable_mouse]
pushad pushad
; Helper variables ; Helper variables
; calculate 2^32*(BgrDataWidth-1) mod (ScreenWidth-1) ; calculate 2^32*(BgrDataWidth-1) mod (Screen_Max_X-1)
mov eax, [BgrDataWidth] mov eax, [BgrDataWidth]
dec eax dec eax
xor edx, edx xor edx, edx
div dword [ScreenWidth] div dword [Screen_Max_X]
push eax ; high push eax ; high
xor eax, eax xor eax, eax
div dword [ScreenWidth] div dword [Screen_Max_X]
push eax ; low push eax ; low
; the same for height ; the same for height
mov eax, [BgrDataHeight] mov eax, [BgrDataHeight]
dec eax dec eax
xor edx, edx xor edx, edx
div dword [ScreenHeight] div dword [Screen_Max_Y]
push eax ; high push eax ; high
xor eax, eax xor eax, eax
div dword [ScreenHeight] div dword [Screen_Max_Y]
push eax ; low push eax ; low
; External loop for all y from start to end ; External loop for all y from start to end
mov ebx, [draw_data+32+RECT.top] ; y start mov ebx, [draw_data+32+RECT.top] ; y start
@ -908,7 +908,7 @@ vesa20_drawbackground_stretch:
mov eax, ebx mov eax, ebx
imul ebx, dword [esp+12] imul ebx, dword [esp+12]
mul dword [esp+8] mul dword [esp+8]
add edx, ebx ; edx:eax = y * 2^32*(BgrDataHeight-1)/(ScreenHeight-1) add edx, ebx ; edx:eax = y * 2^32*(BgrDataHeight-1)/(Screen_Max_Y-1)
mov esi, edx mov esi, edx
imul esi, [BgrDataWidth] imul esi, [BgrDataWidth]
push edx push edx
@ -919,7 +919,7 @@ vesa20_drawbackground_stretch:
mov eax, [esp+12] mov eax, [esp+12]
mul dword [esp+28] mul dword [esp+28]
add [esp], edx add [esp], edx
pop edx ; edx:eax = x * 2^32*(BgrDataWidth-1)/(ScreenWidth-1) pop edx ; edx:eax = x * 2^32*(BgrDataWidth-1)/(Screen_Max_X-1)
add esi, edx add esi, edx
lea esi, [esi*3] lea esi, [esi*3]
add esi, [img_background] add esi, [img_background]
@ -957,13 +957,13 @@ sdp3:
; esi = offset in current line, edi -> output ; esi = offset in current line, edi -> output
; ebp = offset in WinMapAddress ; ebp = offset in WinMapAddress
; dword [esp] = offset in bgr data ; dword [esp] = offset in bgr data
; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (ScreenWidth-1) ; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (Screen_Max_X-1)
; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (ScreenHeight-1) ; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (Screen_Max_Y-1)
; dword [esp+20] = x ; dword [esp+20] = x
; dword [esp+24] = y ; dword [esp+24] = y
; precalculated constants: ; precalculated constants:
; qword [esp+28] = 2^32*(BgrDataHeight-1)/(ScreenHeight-1) ; qword [esp+28] = 2^32*(BgrDataHeight-1)/(Screen_Max_Y-1)
; qword [esp+36] = 2^32*(BgrDataWidth-1)/(ScreenWidth-1) ; qword [esp+36] = 2^32*(BgrDataWidth-1)/(Screen_Max_X-1)
sdp3a: sdp3a:
cmp [ebp+WinMapAddress], byte 1 cmp [ebp+WinMapAddress], byte 1
jnz snbgp jnz snbgp
@ -996,7 +996,7 @@ sdp4:
; advance edi, ebp to next scan line ; advance edi, ebp to next scan line
sub eax, [draw_data+32+RECT.left] sub eax, [draw_data+32+RECT.left]
sub ebp, eax sub ebp, eax
add ebp, [ScreenWidth] add ebp, [Screen_Max_X]
add ebp, 1 add ebp, 1
sub edi, eax sub edi, eax
sub edi, eax sub edi, eax
@ -1026,7 +1026,7 @@ sdp4:
push edi push edi
mov esi, bgr_next_line mov esi, bgr_next_line
mov edi, bgr_cur_line mov edi, bgr_cur_line
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
inc ecx inc ecx
rep movsd rep movsd
jmp bgr_resmooth1 jmp bgr_resmooth1

View File

@ -26,7 +26,7 @@ endg
cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
jne .no_vmode_drv_access jne .no_vmode_drv_access
pushd [ScreenWidth] [ScreenHeight] pushd [Screen_Max_X] [Screen_Max_Y]
popd [old_screen_height] [old_screen_width] popd [old_screen_height] [old_screen_width]
or eax,-1 ; If driver is absent then eax does not change or eax,-1 ; If driver is absent then eax does not change
call (VMODE_BASE+0x100) ; Entry point of video driver call (VMODE_BASE+0x100) ; Entry point of video driver
@ -36,20 +36,20 @@ endg
; mov [esp+28],edx ; mov [esp+28],edx
mov eax,[old_screen_width] mov eax,[old_screen_width]
mov ebx,[old_screen_height] mov ebx,[old_screen_height]
sub eax,[ScreenWidth] sub eax,[Screen_Max_X]
jnz @f jnz @f
sub ebx,[ScreenHeight] sub ebx,[Screen_Max_Y]
jz .resolution_wasnt_changed jz .resolution_wasnt_changed
jmp .lp1 jmp .lp1
@@: sub ebx,[ScreenHeight] @@: sub ebx,[Screen_Max_Y]
.lp1: sub [screen_workarea.right],eax .lp1: sub [screen_workarea.right],eax
sub [screen_workarea.bottom],ebx sub [screen_workarea.bottom],ebx
call repos_windows call repos_windows
mov eax, 0 mov eax, 0
mov ebx, 0 mov ebx, 0
mov ecx, [ScreenWidth] mov ecx, [Screen_Max_X]
mov edx, [ScreenHeight] mov edx, [Screen_Max_Y]
call calculatescreen call calculatescreen
.resolution_wasnt_changed: .resolution_wasnt_changed: