From 89e64cc63e0a3bab1e71a7f5d2ae8f5256f060a4 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Fri, 22 Feb 2008 12:38:59 +0000 Subject: [PATCH] supported videomodes git-svn-id: svn://kolibrios.org@753 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/const.inc | 4 +-- kernel/trunk/core/malloc.inc | 2 +- kernel/trunk/core/taskman.inc | 4 +-- kernel/trunk/data32.inc | 22 +++++++++++++ kernel/trunk/gui/window.inc | 60 +++++++++++++++++----------------- kernel/trunk/hid/m_com.inc | 8 ++--- kernel/trunk/hid/mousedrv.inc | 14 ++++---- kernel/trunk/kernel.asm | 35 +++++++++++--------- kernel/trunk/kernel32.inc | 7 ++++ kernel/trunk/video/cursors.inc | 4 +-- kernel/trunk/video/vesa12.inc | 14 ++++---- kernel/trunk/video/vesa20.inc | 52 ++++++++++++++--------------- kernel/trunk/vmodeint.inc | 12 +++---- 13 files changed, 135 insertions(+), 103 deletions(-) diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index 9d5c72360d..f3eaf4cf94 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -250,8 +250,8 @@ MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF) LFBAddress equ (OS_BASE+0x000FE80) MEM_AMOUNT equ (OS_BASE+0x000FE8C) -ScreenWidth equ (OS_BASE+0x000FE00) -ScreenHeight equ (OS_BASE+0x000FE04) +Screen_Max_X equ (OS_BASE+0x000FE00) +Screen_Max_Y equ (OS_BASE+0x000FE04) BytesPerScanLine equ (OS_BASE+0x000FE08) SCR_MODE equ (OS_BASE+0x000FE0C) diff --git a/kernel/trunk/core/malloc.inc b/kernel/trunk/core/malloc.inc index 0a4e49eb05..0b9bfd3b8b 100644 --- a/kernel/trunk/core/malloc.inc +++ b/kernel/trunk/core/malloc.inc @@ -983,7 +983,7 @@ malloc_large: align 4 init_malloc: - stdcall kernel_alloc, 0x30000 + stdcall kernel_alloc, 0x40000 mov [mst.top], eax mov [mst.topsize], 128*1024 diff --git a/kernel/trunk/core/taskman.inc b/kernel/trunk/core/taskman.inc index 9749223b57..8ed18b3b00 100644 --- a/kernel/trunk/core/taskman.inc +++ b/kernel/trunk/core/taskman.inc @@ -1063,9 +1063,9 @@ proc set_app_params stdcall,slot:dword, params:dword,\ mov [ecx+0],dword 0 mov [ecx+4],dword 0 - mov eax,[ScreenWidth] + mov eax,[Screen_Max_X] mov [ecx+8],eax - mov eax,[ScreenHeight] + mov eax,[Screen_Max_Y] mov [ecx+12],eax mov ebx, [pl0_stack] diff --git a/kernel/trunk/data32.inc b/kernel/trunk/data32.inc index 71966e085f..4cd7573529 100644 --- a/kernel/trunk/data32.inc +++ b/kernel/trunk/data32.inc @@ -104,6 +104,28 @@ vmode db '/sys/drivers/VMODE.MDR',0 vrr_m db 'VRR_M',0 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 { db 0 diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index 29e088991b..61871e0b27 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -179,7 +179,7 @@ pushad inc edx ; get WinMap start - mov edi, [ScreenWidth] ; screen_sx + mov edi, [Screen_Max_X] ; screen_sx inc edi imul edi, ebx add edi, eax @@ -199,7 +199,7 @@ pushad pop edx pop ecx - add edi, [ScreenWidth] + add edi, [Screen_Max_X] inc edi sub edi, ecx dec edx @@ -240,7 +240,7 @@ pushad ; get WinMap start -> ebp push eax - mov eax, [ScreenWidth] ; screen_sx + mov eax, [Screen_Max_X] ; screen_sx inc eax imul eax, ebx add eax, [esp] @@ -302,7 +302,7 @@ pushad jb .ff_new_x sub ebp, [ff_xsz] add ebp, [ff_x] - add ebp, [ScreenWidth] ; screen.x + add ebp, [Screen_Max_X] ; screen.x inc ebp inc ebx cmp ebx, [ff_ysz] @@ -359,9 +359,9 @@ display_settings: redraw_screen_direct: mov [dlx],dword 0 mov [dly],dword 0 - mov eax,[ScreenWidth] + mov eax,[Screen_Max_X] mov [dlxe],eax - mov eax,[ScreenHeight] + mov eax,[Screen_Max_Y] mov [dlye],eax mov eax,window_data call redrawscreen @@ -437,10 +437,10 @@ display_settings: movsx ebx,word[esp+16] cmp eax,ebx jge .lp1 - or eax,eax;[ScreenWidth] + or eax,eax;[Screen_Max_X] jl @f mov [screen_workarea.left],eax - @@: cmp ebx,[ScreenWidth] + @@: cmp ebx,[Screen_Max_X] jg .lp1 mov [screen_workarea.right],ebx .lp1: movsx eax,word[esp+24+2] @@ -450,14 +450,14 @@ display_settings: or eax,eax;[0xFE04] jl @f mov [screen_workarea.top],eax - @@: cmp ebx,[ScreenHeight] + @@: cmp ebx,[Screen_Max_Y] jg .lp2 mov [screen_workarea.bottom],ebx .lp2: call repos_windows mov eax, 0 mov ebx, 0 - mov ecx, [ScreenWidth] - mov edx, [ScreenHeight] + mov ecx, [Screen_Max_X] + mov edx, [Screen_Max_Y] call calculatescreen ; jmp redraw_screen_direct .exit: @@ -483,8 +483,8 @@ display_settings: jnz .ret xor eax, eax xor ebx, ebx - mov ecx, [ScreenWidth] - mov edx, [ScreenHeight] + mov ecx, [Screen_Max_X] + mov edx, [Screen_Max_Y] call calculatescreen jmp redraw_screen_direct .ret: @@ -526,7 +526,7 @@ repos_windows: ret .lp2: mov eax,[edi+WDATA.box.left] add eax,[edi+WDATA.box.width] - mov ebx,[ScreenWidth] + mov ebx,[Screen_Max_X] ; inc ebx cmp eax,ebx jle .lp4 @@ -538,7 +538,7 @@ repos_windows: mov [edi+WDATA.box.left],ebx .lp4: mov eax,[edi+WDATA.box.top] add eax,[edi+WDATA.box.height] - mov ebx,[ScreenHeight] + mov ebx,[Screen_Max_Y] ; inc ebx cmp eax,ebx jle .lp6 @@ -569,7 +569,7 @@ check_window_position: mov esi,ecx ; check x pos add esi,eax - cmp esi,[ScreenWidth] + cmp esi,[Screen_Max_X] jbe x_pos_ok mov [edi+WDATA.box.left],dword 0 xor eax, eax @@ -577,7 +577,7 @@ check_window_position: mov esi,edx ; check y pos add esi,ebx - cmp esi,[ScreenHeight] + cmp esi,[Screen_Max_Y] jbe y_pos_ok mov [edi+WDATA.box.top],dword 0 mov ebx,0 @@ -585,17 +585,17 @@ check_window_position: mov esi,ecx ; check x size add esi,eax - cmp esi,[ScreenWidth] + cmp esi,[Screen_Max_X] jbe x_size_ok - mov ecx,[ScreenWidth] + mov ecx,[Screen_Max_X] mov [edi+WDATA.box.width],ecx x_size_ok: mov esi,edx ; check y size add esi,ebx - cmp esi,[ScreenHeight] + cmp esi,[Screen_Max_Y] jbe y_size_ok - mov edx,[ScreenHeight] + mov edx,[Screen_Max_Y] mov [edi+WDATA.box.height],edx y_size_ok: @@ -1276,7 +1276,7 @@ checkwindows: je .no_resize_2 cmp edx, 0x01000000 ;{test for resized} je .no_resize_2 - cmp edx, 0x04000000 ;{test for resized} + cmp edx, 0x04000000 ;{test for resized} je .no_resize_2 ; jb .no_resize_2 ; not type 2 wnd @@ -1391,8 +1391,8 @@ checkwindows: call drawwindowframes - mov ax,[ScreenWidth] - mov bx,[ScreenHeight] + mov ax,[Screen_Max_X] + mov bx,[Screen_Max_Y] cmp [do_resize_from_corner],1 je no_new_position @@ -1545,9 +1545,9 @@ checkwindows: sub eax,[screen_workarea.top] @@: mov [edi+WDATA.box.height],eax add eax, [edi+WDATA.box.top] - cmp eax, [ScreenHeight] + cmp eax, [Screen_Max_Y] jbe @f - mov eax, [ScreenHeight] + mov eax, [Screen_Max_Y] sub eax, [edi+WDATA.box.height] mov [edi+WDATA.box.top], eax @@: call check_window_position @@ -1605,16 +1605,16 @@ checkwindows: mov eax,[edi+WDATA.box.top] ; check Y inside screen add eax,[edi+WDATA.box.height] - cmp eax,[ScreenHeight] + cmp eax,[Screen_Max_Y] jbe no_window_sizing mov eax,[edi+WDATA.box.left] ; check X inside screen add eax,[edi+WDATA.box.width] - cmp eax,[ScreenWidth] + cmp eax,[Screen_Max_X] jbe no_window_sizing - mov eax,[ScreenWidth] + mov eax,[Screen_Max_X] sub eax,[edi+WDATA.box.width] mov [edi+WDATA.box.left],eax - mov eax,[ScreenHeight] + mov eax,[Screen_Max_Y] sub eax,[edi+WDATA.box.height] mov [edi+WDATA.box.top],eax call set_window_clientbox diff --git a/kernel/trunk/hid/m_com.inc b/kernel/trunk/hid/m_com.inc index 2b59269b95..f1a91aa997 100644 --- a/kernel/trunk/hid/m_com.inc +++ b/kernel/trunk/hid/m_com.inc @@ -92,10 +92,10 @@ check_mouse_data_com: add ax, [MOUSE_X] ; Курсор не должен выходить за левую или правую границу экрана js .x1 - cmp ax, [ScreenWidth] + cmp ax, [Screen_Max_X] jb .x2 ; Установить координату X по правой границе - mov ax, [ScreenWidth] + mov ax, [Screen_Max_X] jmp .x2 .x1: ; Установить координату X по левой границе @@ -111,10 +111,10 @@ check_mouse_data_com: add ax, [MOUSE_Y] ; Курсор не должен выходить за верхнюю или нижнюю границу экрана js .y1 - cmp ax, [ScreenHeight] + cmp ax, [Screen_Max_Y] jb .y2 ; Установить координату Y по нижней границе - mov ax, [ScreenHeight] + mov ax, [Screen_Max_Y] jmp .y2 .y1: ; Установить координату Y по верхней границе diff --git a/kernel/trunk/hid/mousedrv.inc b/kernel/trunk/hid/mousedrv.inc index 1468dfc870..389c4c0dd2 100644 --- a/kernel/trunk/hid/mousedrv.inc +++ b/kernel/trunk/hid/mousedrv.inc @@ -108,7 +108,7 @@ save_draw_mouse: push eax push ebx - mov ecx, [ScreenWidth] + mov ecx, [Screen_Max_X] inc ecx mul ecx @@ -292,7 +292,7 @@ __sys_disable_mouse: add edx,window_data movzx eax, word [MOUSE_X] movzx ebx, word [MOUSE_Y] - mov ecx,[ScreenWidth] + mov ecx,[Screen_Max_X] inc ecx imul ecx,ebx add ecx,eax @@ -304,7 +304,7 @@ __sys_disable_mouse: movzx ebx, byte [ecx+16] cmp eax,ebx je yes_mouse_disable - mov ebx,[ScreenWidth] + mov ebx,[Screen_Max_X] inc ebx imul ebx,10 add ecx,ebx @@ -411,9 +411,9 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro mov eax,0 jmp @@M2 @@M1: - cmp ax,[ScreenWidth] ;ScreenLength + cmp ax,[Screen_Max_X] ;ScreenLength jl @@M2 - mov ax,[ScreenWidth] ;ScreenLength-1 + mov ax,[Screen_Max_X] ;ScreenLength-1 @@M2: mov [MOUSE_X],ax ;[XCoordinate] @@ -428,9 +428,9 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro mov ax,0 jmp @@M4 @@M3: - cmp ax,[ScreenHeight] ;ScreenHeigth + cmp ax,[Screen_Max_Y] ;ScreenHeigth jl @@M4 - mov ax,[ScreenHeight] ;ScreenHeigth-1 + mov ax,[Screen_Max_Y] ;ScreenHeigth-1 @@M4: mov [MOUSE_Y],ax ;[YCoordinate] diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index b79ccc4921..d08c678000 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -344,13 +344,16 @@ high_code: mov [allow_dma_access], al mov al,[BOOT_VAR+0x9000] ; bpp mov [ScreenBPP],al + + xchg bx, bx + movzx eax,word [BOOT_VAR+0x900A] ; X max dec eax - mov [ScreenWidth],eax + mov [Screen_Max_X],eax mov [screen_workarea.right],eax movzx eax,word [BOOT_VAR+0x900C] ; Y max dec eax - mov [ScreenHeight],eax + mov [Screen_Max_Y],eax mov [screen_workarea.bottom],eax movzx eax,word [BOOT_VAR+0x9008] ; screen mode mov [SCR_MODE],eax @@ -1126,10 +1129,10 @@ set_variables: ;* mouse centered - start code- Mario79 mouse_centered: push eax - mov eax,[ScreenWidth] + mov eax,[Screen_Max_X] shr eax,1 mov [MOUSE_X],ax - mov eax,[ScreenHeight] + mov eax,[Screen_Max_Y] shr eax,1 mov [MOUSE_Y],ax pop eax @@ -2559,8 +2562,8 @@ force_redraw_background: mov [draw_data+32 + RECT.left],dword 0 mov [draw_data+32 + RECT.top],dword 0 push eax ebx - mov eax,[ScreenWidth] - mov ebx,[ScreenHeight] + mov eax,[Screen_Max_X] + mov ebx,[Screen_Max_Y] mov [draw_data+32 + RECT.right],eax mov [draw_data+32 + RECT.bottom],ebx pop ebx eax @@ -2880,9 +2883,9 @@ sys_redrawstat: add edx, draw_data - CURRENT_TASK mov [edx + RECT.left], 0 mov [edx + RECT.top], 0 - mov eax, [ScreenWidth] + mov eax, [Screen_Max_X] mov [edx + RECT.right], eax - mov eax, [ScreenHeight] + mov eax, [Screen_Max_Y] mov [edx + RECT.bottom], eax mov edi, [TASK_BASE] @@ -3483,7 +3486,7 @@ ret checkpixel: push eax edx - mov edx,[ScreenWidth] ; screen x size + mov edx,[Screen_Max_X] ; screen x size inc edx imul edx, ebx mov dl, [eax+edx+display_data] ; lea eax, [...] @@ -3544,8 +3547,8 @@ set_bgr_event: no_set_bgr_event: ; mov [draw_data+32 + RECT.left],dword 0 ; mov [draw_data+32 + RECT.top],dword 0 -; mov eax,[ScreenWidth] -; mov ebx,[ScreenHeight] +; mov eax,[Screen_Max_X] +; mov ebx,[Screen_Max_Y] ; mov [draw_data+32 + RECT.right],eax ; mov [draw_data+32 + RECT.bottom],ebx call drawbackground @@ -4856,9 +4859,9 @@ sys_gs: ; direct screen access cmp eax,1 ; resolution jne no_gs1 - mov eax,[ScreenWidth] + mov eax,[Screen_Max_X] shl eax,16 - mov ax,[ScreenHeight] + mov ax,[Screen_Max_Y] add eax,0x00010001 mov [esp+36],eax ret @@ -4970,9 +4973,9 @@ syscall_drawrect: ; DrawRect align 4 syscall_getscreensize: ; GetScreenSize - mov ax, [ScreenWidth] + mov ax, [Screen_Max_X] shl eax, 16 - mov ax, [ScreenHeight] + mov ax, [Screen_Max_Y] mov [esp + 32], eax ret @@ -5060,7 +5063,7 @@ syscall_writeramdiskfile: ; WriteRamdiskFile align 4 syscall_getpixel: ; GetPixel - mov ecx, [ScreenWidth] + mov ecx, [Screen_Max_X] inc ecx xor edx, edx mov eax, ebx diff --git a/kernel/trunk/kernel32.inc b/kernel/trunk/kernel32.inc index 1833a26ecf..0eadb4240e 100644 --- a/kernel/trunk/kernel32.inc +++ b/kernel/trunk/kernel32.inc @@ -61,6 +61,13 @@ virtual at 0 BOX BOX end virtual +struc DISPMODE { + .width rw 1 + .height rw 1 + .bpp rw 1 + .freq rw 1 +} + ; constants definition WSTATE_NORMAL = 00000000b WSTATE_MAXIMIZED = 00000001b diff --git a/kernel/trunk/video/cursors.inc b/kernel/trunk/video/cursors.inc index 5a6f7c2058..40d014d9c4 100644 --- a/kernel/trunk/video/cursors.inc +++ b/kernel/trunk/video/cursors.inc @@ -478,8 +478,8 @@ proc init_cursors stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM mov [def_cursor], eax - mov ecx, [ScreenWidth] - mov edx, [ScreenHeight] + mov ecx, [Screen_Max_X] + mov edx, [Screen_Max_Y] inc ecx inc edx mov [scr_width], ecx diff --git a/kernel/trunk/video/vesa12.inc b/kernel/trunk/video/vesa12.inc index 24eef6402d..b44488ebe6 100644 --- a/kernel/trunk/video/vesa12.inc +++ b/kernel/trunk/video/vesa12.inc @@ -290,14 +290,14 @@ vesa12_drawbackground: push edx mul dword [BgrDataWidth] - mov ecx,[ScreenWidth] + mov ecx,[Screen_Max_X] inc ecx div ecx push eax mov eax,ebx mul dword [BgrDataHeight] - mov ecx,[ScreenHeight] + mov ecx,[Screen_Max_Y] inc ecx div ecx mov ebx,eax @@ -324,7 +324,7 @@ vesa12_drawbackground: pusha mov esi,eax mov edi,ebx - mov eax,[ScreenWidth] + mov eax,[Screen_Max_X] add eax,1 mul ebx cmp [eax+esi+WinMapAddress],byte 1 @@ -443,10 +443,10 @@ vesa12_drawbar: cmp ecx,0 jnz dbcblimitlset12 mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] - cmp ecx,[ScreenWidth] + cmp ecx,[Screen_Max_X] jnz dbcblimitlset12 mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] - cmp ecx,[ScreenHeight] + cmp ecx,[Screen_Max_Y] jnz dbcblimitlset12 pop ecx pop eax @@ -799,10 +799,10 @@ vesa12_putimage: cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0 jnz dbcblimitlset212 mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] - cmp ecx,[ScreenWidth] + cmp ecx,[Screen_Max_X] jnz dbcblimitlset212 mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] - cmp ecx,[ScreenHeight] + cmp ecx,[Screen_Max_Y] jnz dbcblimitlset212 pop ecx push 0 diff --git a/kernel/trunk/video/vesa20.inc b/kernel/trunk/video/vesa20.inc index 4a79a75888..1709468355 100644 --- a/kernel/trunk/video/vesa20.inc +++ b/kernel/trunk/video/vesa20.inc @@ -23,8 +23,8 @@ $Revision$ ; If you're planning to write your own video driver I suggest ; you replace the VESA12.INC file and see those instructions. -;ScreenWidth equ 0xfe00 -;ScreenHeight equ 0xfe04 +;Screen_Max_X equ 0xfe00 +;Screen_Max_Y equ 0xfe04 ;BytesPerScanLine equ 0xfe08 ;LFBAddress equ 0xfe80 ;ScreenBPP equ 0xfbf1 @@ -172,7 +172,7 @@ vesa20_putimage: add eax, [putimg.arg_0] mov [putimg.line_increment], eax ; winmap new line increment - mov eax, [ScreenWidth] + mov eax, [Screen_Max_X] inc eax sub eax, [putimg.real_sx] mov [putimg.winmap_newline], eax @@ -197,7 +197,7 @@ vesa20_putimage: add edx, [LFBAddress] ; pointer to pixel map mov eax, [putimg.abs_cy] - imul eax, [ScreenWidth] + imul eax, [Screen_Max_X] add eax, [putimg.abs_cy] add eax, [putimg.abs_cx] add eax, WinMapAddress @@ -232,7 +232,7 @@ align 4 ; pop edx ebp add esi, [putimg.line_increment] add edx, [putimg.screen_newline] ;[BytesPerScanLine] - add ebp, [putimg.winmap_newline] ;[ScreenWidth] + add ebp, [putimg.winmap_newline] ;[Screen_Max_X] ; inc ebp dec edi jnz .new_line @@ -265,7 +265,7 @@ align 4 ; pop edx ebp add esi, [putimg.line_increment] add edx, [putimg.screen_newline] ;[BytesPerScanLine] - add ebp, [putimg.winmap_newline] ;[ScreenWidth] + add ebp, [putimg.winmap_newline] ;[Screen_Max_X] ; inc ebp dec edi jnz .new_line @@ -297,9 +297,9 @@ __sys_putpixel: pop ecx jnz .exit .forced: - cmp [ScreenWidth], eax + cmp [Screen_Max_X], eax jb .exit - cmp [ScreenHeight], ebx + cmp [Screen_Max_Y], ebx jb .exit .ok: ; check if negation @@ -346,7 +346,7 @@ Vesa20_putpixel32: ;align 4 calculate_edi: mov edi, ebx - imul edi, [ScreenWidth] + imul edi, [Screen_Max_X] add edi, ebx add edi, eax ret @@ -603,7 +603,7 @@ vesa20_drawbar: .end_y: mov [drbar.real_sy], ebx ; line_inc_map - mov eax, [ScreenWidth] + mov eax, [Screen_Max_X] sub eax, [drbar.real_sx] inc eax mov [drbar.line_inc_map], eax @@ -626,7 +626,7 @@ vesa20_drawbar: add edx, [LFBAddress] ; pointer to pixel map mov eax, [drbar.abs_cy] - imul eax, [ScreenWidth] + imul eax, [Screen_Max_X] add eax, [drbar.abs_cy] add eax, [drbar.abs_cx] add eax, WinMapAddress @@ -726,7 +726,7 @@ align 4 ; xor edx,edx ; mov eax,ebp -; mov ebx,[ScreenWidth] ; Screen_X_size +; mov ebx,[Screen_Max_X] ; Screen_X_size ; inc ebx ; +1 ; sub eax,WinMapAddress ; -AddrBuffer ; div ebx ; @@ -752,7 +752,7 @@ align 4 ; pusha ; xor edx,edx -; mov ebx,[ScreenWidth] +; mov ebx,[Screen_Max_X] ; inc ebx ; sub eax,WinMapAddress ; div ebx @@ -864,23 +864,23 @@ vesa20_drawbackground_stretch: call [disable_mouse] pushad ; Helper variables -; calculate 2^32*(BgrDataWidth-1) mod (ScreenWidth-1) +; calculate 2^32*(BgrDataWidth-1) mod (Screen_Max_X-1) mov eax, [BgrDataWidth] dec eax xor edx, edx - div dword [ScreenWidth] + div dword [Screen_Max_X] push eax ; high xor eax, eax - div dword [ScreenWidth] + div dword [Screen_Max_X] push eax ; low ; the same for height mov eax, [BgrDataHeight] dec eax xor edx, edx - div dword [ScreenHeight] + div dword [Screen_Max_Y] push eax ; high xor eax, eax - div dword [ScreenHeight] + div dword [Screen_Max_Y] push eax ; low ; External loop for all y from start to end mov ebx, [draw_data+32+RECT.top] ; y start @@ -908,7 +908,7 @@ vesa20_drawbackground_stretch: mov eax, ebx imul ebx, dword [esp+12] 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 imul esi, [BgrDataWidth] push edx @@ -919,7 +919,7 @@ vesa20_drawbackground_stretch: mov eax, [esp+12] mul dword [esp+28] 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 lea esi, [esi*3] add esi, [img_background] @@ -957,13 +957,13 @@ sdp3: ; esi = offset in current line, edi -> output ; ebp = offset in WinMapAddress ; dword [esp] = offset in bgr data -; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (ScreenWidth-1) -; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (ScreenHeight-1) +; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (Screen_Max_X-1) +; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (Screen_Max_Y-1) ; dword [esp+20] = x ; dword [esp+24] = y ; precalculated constants: -; qword [esp+28] = 2^32*(BgrDataHeight-1)/(ScreenHeight-1) -; qword [esp+36] = 2^32*(BgrDataWidth-1)/(ScreenWidth-1) +; qword [esp+28] = 2^32*(BgrDataHeight-1)/(Screen_Max_Y-1) +; qword [esp+36] = 2^32*(BgrDataWidth-1)/(Screen_Max_X-1) sdp3a: cmp [ebp+WinMapAddress], byte 1 jnz snbgp @@ -996,7 +996,7 @@ sdp4: ; advance edi, ebp to next scan line sub eax, [draw_data+32+RECT.left] sub ebp, eax - add ebp, [ScreenWidth] + add ebp, [Screen_Max_X] add ebp, 1 sub edi, eax sub edi, eax @@ -1026,7 +1026,7 @@ sdp4: push edi mov esi, bgr_next_line mov edi, bgr_cur_line - mov ecx, [ScreenWidth] + mov ecx, [Screen_Max_X] inc ecx rep movsd jmp bgr_resmooth1 diff --git a/kernel/trunk/vmodeint.inc b/kernel/trunk/vmodeint.inc index 4a7f829875..3cb0a1c56e 100644 --- a/kernel/trunk/vmodeint.inc +++ b/kernel/trunk/vmodeint.inc @@ -26,7 +26,7 @@ endg cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS jne .no_vmode_drv_access - pushd [ScreenWidth] [ScreenHeight] + pushd [Screen_Max_X] [Screen_Max_Y] popd [old_screen_height] [old_screen_width] or eax,-1 ; If driver is absent then eax does not change call (VMODE_BASE+0x100) ; Entry point of video driver @@ -36,20 +36,20 @@ endg ; mov [esp+28],edx mov eax,[old_screen_width] mov ebx,[old_screen_height] - sub eax,[ScreenWidth] + sub eax,[Screen_Max_X] jnz @f - sub ebx,[ScreenHeight] + sub ebx,[Screen_Max_Y] jz .resolution_wasnt_changed jmp .lp1 - @@: sub ebx,[ScreenHeight] + @@: sub ebx,[Screen_Max_Y] .lp1: sub [screen_workarea.right],eax sub [screen_workarea.bottom],ebx call repos_windows mov eax, 0 mov ebx, 0 - mov ecx, [ScreenWidth] - mov edx, [ScreenHeight] + mov ecx, [Screen_Max_X] + mov edx, [Screen_Max_Y] call calculatescreen .resolution_wasnt_changed: