/kernel/trunk/video/cursors.inc |
---|
656,21 → 656,25 |
add edx, eax |
mov [cur_saved_base], edx |
cmp ebx, [_display.width] |
jb @F |
mov ebx, [_display.width] |
cmp ebx, [Screen_Max_X] |
jbe @F |
mov ebx, [Screen_Max_X] |
;-------------------------------------- |
align 4 |
@@: |
cmp edi, [_display.height] |
jb @F |
mov edi, [_display.height] |
cmp edi, [Screen_Max_Y] |
jbe @F |
mov edi, [Screen_Max_Y] |
;-------------------------------------- |
align 4 |
@@: |
mov [cur.right], ebx |
mov [cur.bottom], edi |
sub ebx, [x] |
sub edi, [y] |
inc ebx |
inc edi |
sub ebx, [_dx] |
sub edi, [_dy] |
770,20 → 774,25 |
lea edx, [LFB_BASE+eax+ecx*4] |
mov [cur_saved_base], edx |
cmp ebx, [_display.width] |
jb @F |
mov ebx, [_display.width] |
cmp ebx, [Screen_Max_X] |
jbe @F |
mov ebx, [Screen_Max_X] |
;-------------------------------------- |
align 4 |
@@: |
cmp edi, [_display.height] |
jb @F |
mov edi, [_display.height] |
cmp edi, [Screen_Max_Y] |
jbe @F |
mov edi, [Screen_Max_Y] |
;-------------------------------------- |
align 4 |
@@: |
mov [cur.right], ebx |
mov [cur.bottom], edi |
sub ebx, [x] |
sub edi, [y] |
inc ebx |
inc edi |
sub ebx, [_dx] |
sub edi, [_dy] |
880,20 → 889,25 |
lea edx, [LFB_BASE+eax+ecx*2] |
mov [cur_saved_base], edx |
cmp ebx, [_display.width] |
jb @F |
mov ebx, [_display.width] |
cmp ebx, [Screen_Max_X] |
jbe @F |
mov ebx, [Screen_Max_X] |
;-------------------------------------- |
align 4 |
@@: |
cmp edi, [_display.height] |
jb @F |
mov edi, [_display.height] |
cmp edi, [Screen_Max_Y] |
jbe @F |
mov edi, [Screen_Max_Y] |
;-------------------------------------- |
align 4 |
@@: |
mov [cur.right], ebx |
mov [cur.bottom], edi |
sub ebx, [x] |
sub edi, [y] |
inc ebx |
inc edi |
sub ebx, [_dx] |
sub edi, [_dy] |
/kernel/trunk/video/vesa20.inc |
---|
236,7 → 236,8 |
add eax, [putimg.arg_0] |
mov [putimg.line_increment], eax |
; winmap new line increment |
mov eax, [_display.width] |
mov eax, [Screen_Max_X] |
inc eax |
sub eax, [putimg.real_sx] |
mov [putimg.winmap_newline], eax |
; screen new line increment |
875,10 → 876,10 |
__sys_putpixel: |
pushad |
cmp eax, [_display.width] |
jge .exit |
cmp ebx, [_display.height] |
jge .exit |
cmp [Screen_Max_X], eax |
jb .exit |
cmp [Screen_Max_Y], ebx |
jb .exit |
test edi, 1 ; force ? |
jnz .forced |
1440,8 → 1441,9 |
.end_y: |
mov [drbar.real_sy], ebx |
; line_inc_map |
mov eax, [_display.width] |
mov eax, [Screen_Max_X] |
sub eax, [drbar.real_sx] |
inc eax |
mov [drbar.line_inc_map], eax |
; line_inc_scr |
mov eax, [drbar.real_sx] |
2147,10 → 2149,10 |
mov eax, [BgrDataWidth] |
dec eax |
xor edx, edx |
div dword [screen_workarea.right] |
div dword [Screen_Max_X] |
push eax ; high |
xor eax, eax |
div dword [screen_workarea.right] |
div dword [Screen_Max_X] |
push eax ; low |
; the same for height |
2157,10 → 2159,10 |
mov eax, [BgrDataHeight] |
dec eax |
xor edx, edx |
div dword [screen_workarea.bottom] |
div dword [Screen_Max_Y] |
push eax ; high |
xor eax, eax |
div dword [screen_workarea.bottom] |
div dword [Screen_Max_Y] |
push eax ; low |
; External loop for all y from start to end |
2321,7 → 2323,8 |
; advance edi, ebp to next scan line |
sub eax, [draw_data+32+RECT.left] |
sub ebp, eax |
add ebp, [_display.width] |
add ebp, [Screen_Max_X] |
add ebp, 1 |
sub edi, eax |
sub edi, eax |
cmp byte [_display.bytes_per_pixel], 2 |
2353,7 → 2356,8 |
push edi |
mov esi, bgr_next_line |
mov edi, bgr_cur_line |
mov ecx, [_display.width] |
mov ecx, [Screen_Max_X] |
inc ecx |
rep movsd |
jmp bgr_resmooth1 |
/kernel/trunk/core/taskman.inc |
---|
1141,9 → 1141,9 |
xor eax, eax |
mov [ecx+0], dword eax |
mov [ecx+4], dword eax |
mov eax, [screen_workarea.right] |
mov eax, [Screen_Max_X] |
mov [ecx+8], eax |
mov eax, [screen_workarea.bottom] |
mov eax, [Screen_Max_Y] |
mov [ecx+12], eax |
mov ebx, [pl0_stack] |
/kernel/trunk/gui/window.inc |
---|
215,8 → 215,7 |
syscall_display_settings.06: |
xor esi, esi |
mov edi, [_display.width] |
dec edi |
mov edi, [Screen_Max_X] |
mov eax, ecx |
movsx ebx, ax |
sar eax, 16 |
240,8 → 239,7 |
;-------------------------------------- |
align 4 |
.check_horizontal: |
mov edi, [_display.height] |
dec edi |
mov edi, [Screen_Max_Y] |
mov eax, edx |
movsx ebx, ax |
sar eax, 16 |
302,10 → 300,8 |
syscall_display_settings._.calculate_whole_screen: |
xor eax, eax |
xor ebx, ebx |
mov ecx, [_display.width] |
mov edx, [_display.height] |
dec ecx |
dec edx |
mov ecx, [Screen_Max_X] |
mov edx, [Screen_Max_Y] |
jmp calculatescreen |
;------------------------------------------------------------------------------ |
align 4 |
313,11 → 309,9 |
xor eax, eax |
mov [draw_limits.left], eax |
mov [draw_limits.top], eax |
mov eax, [_display.width] |
dec eax |
mov eax, [Screen_Max_X] |
mov [draw_limits.right], eax |
mov eax, [_display.height] |
dec eax |
mov eax, [Screen_Max_Y] |
mov [draw_limits.bottom], eax |
mov eax, window_data |
jmp redrawscreen |
596,12 → 590,12 |
mov eax, [edi + WDATA.box.left] |
add eax, [edi + WDATA.box.width] |
mov ebx, [_display.width] |
mov ebx, [Screen_Max_X] |
cmp eax, ebx |
jl .fix_vertical |
jle .fix_vertical |
mov eax, [edi + WDATA.box.width] |
sub eax, ebx |
jl @f |
jle @f |
mov [edi + WDATA.box.width], ebx |
;-------------------------------------- |
align 4 |
613,12 → 607,12 |
.fix_vertical: |
mov eax, [edi + WDATA.box.top] |
add eax, [edi + WDATA.box.height] |
mov ebx, [_display.height] |
mov ebx, [Screen_Max_Y] |
cmp eax, ebx |
jl .fix_client_box |
jle .fix_client_box |
mov eax, [edi + WDATA.box.height] |
sub eax, ebx |
jl @f |
jle @f |
mov [edi + WDATA.box.height], ebx |
;-------------------------------------- |
align 4 |
1724,9 → 1718,9 |
mov ecx, [edi + WDATA.box.width] |
mov edx, [edi + WDATA.box.height] |
mov esi, [_display.width] |
mov esi, [Screen_Max_X] |
cmp ecx, esi |
jae .fix_width_high |
ja .fix_width_high |
;-------------------------------------- |
align 4 |
.check_left: |
1734,13 → 1728,13 |
jl .fix_left_low |
add eax, ecx |
cmp eax, esi |
jge .fix_left_high |
jg .fix_left_high |
;-------------------------------------- |
align 4 |
.check_height: |
mov esi, [_display.height] |
mov esi, [Screen_Max_Y] |
cmp edx, esi |
jae .fix_height_high |
ja .fix_height_high |
;-------------------------------------- |
align 4 |
.check_top: |
1748,7 → 1742,7 |
jl .fix_top_low |
add ebx, edx |
cmp ebx, esi |
jge .fix_top_high |
jg .fix_top_high |
;-------------------------------------- |
align 4 |
.exit: |
1998,7 → 1992,8 |
sub ebp, [ff_xsz] |
add ebp, [ff_x] |
add ebp, [_display.width] ; screen.x |
add ebp, [Screen_Max_X] ; screen.x |
inc ebp |
inc ebx |
cmp ebx, [ff_ysz] |
jb .ff_new_y |
/kernel/trunk/gui/mouse.inc |
---|
394,9 → 394,9 |
mov [mouse.active_sys_window.new_box.left], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.width] |
cmp eax, [_display.width] |
cmp eax, [Screen_Max_X] |
jl @f |
sub eax, [_display.width] |
sub eax, [Screen_Max_X] |
sub [mouse.active_sys_window.new_box.left], eax |
@@: |
mov eax, [mouse.active_sys_window.new_box.top] |
406,9 → 406,9 |
mov [mouse.active_sys_window.new_box.top], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.height] |
cmp eax, [_display.height] |
jl .call_window_handler |
sub eax, [_display.height] |
cmp eax, [Screen_Max_Y] |
jle .call_window_handler |
sub eax, [Screen_Max_Y] |
sub [mouse.active_sys_window.new_box.top], eax |
jmp .call_window_handler |
458,14 → 458,14 |
mov [mouse.active_sys_window.new_box.height], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.top] |
cmp eax, [_display.height] |
jl .check_resize_e |
sub eax, [_display.height] |
cmp eax, [Screen_Max_Y] |
jle .check_resize_e |
sub eax, [Screen_Max_Y] |
neg eax |
add [mouse.active_sys_window.new_box.height], eax |
mov ecx, [_display.height] |
mov ecx, [Screen_Max_Y] |
cmp ecx, eax |
jg .check_resize_e |
jge .check_resize_e |
mov [mouse.active_sys_window.new_box.height], ecx |
.check_resize_e: |
484,14 → 484,14 |
mov [mouse.active_sys_window.new_box.width], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.left] |
cmp eax, [_display.width] |
jl .call_window_handler |
sub eax, [_display.width] |
cmp eax, [Screen_Max_X] |
jle .call_window_handler |
sub eax, [Screen_Max_X] |
neg eax |
add [mouse.active_sys_window.new_box.width], eax |
mov ecx, [_display.width] |
mov ecx, [Screen_Max_X] |
cmp ecx, eax |
jg .call_window_handler |
jge .call_window_handler |
mov [mouse.active_sys_window.new_box.width], ecx |
.call_window_handler: |
/kernel/trunk/data32.inc |
---|
379,6 → 379,8 |
_WinMapSize rd 1 |
LFBAddress dd ? |
Screen_Max_X dd ? |
Screen_Max_Y dd ? |
SCR_MODE rw 2 |
423,8 → 425,8 |
cur.lock rd 1 ;1 - lock update, 2- hide |
cur.left rd 1 ;cursor clip box |
cur.top rd 1 |
;cur.right rd 1 |
;cur.bottom rd 1 |
cur.right rd 1 |
cur.bottom rd 1 |
cur.w rd 1 |
cur.h rd 1 |
/kernel/trunk/hid/mousedrv.inc |
---|
501,10 → 501,9 |
mul edx |
shr eax, 15 |
.check_x: |
cmp ax, word[_display.width] |
cmp ax, word[Screen_Max_X] |
jl .set_x |
mov ax, word[_display.width] |
dec ax |
mov ax, word[Screen_Max_X] |
.set_x: |
mov [MOUSE_X], ax |
;-------------------------------------- |
523,10 → 522,9 |
mul edx |
shr eax, 15 |
.check_y: |
cmp ax, word[_display.height] |
cmp ax, word[Screen_Max_Y] |
jl .set_y |
mov ax, word[_display.height] |
dec ax |
mov ax, word[Screen_Max_Y] |
.set_y: |
mov [MOUSE_Y], ax |
;-------------------------------------- |
/kernel/trunk/kernel.asm |
---|
444,11 → 444,13 |
mov [_display.width], eax |
mov [display_width_standard], eax |
dec eax |
mov [Screen_Max_X], eax |
mov [screen_workarea.right], eax |
movzx eax, word [BOOT_VARS+BOOT_Y_RES]; Y max |
mov [_display.height], eax |
mov [display_height_standard], eax |
dec eax |
mov [Screen_Max_Y], eax |
mov [screen_workarea.bottom], eax |
movzx eax, word [BOOT_VARS+BOOT_VESA_MODE] ; screen mode |
mov dword [SCR_MODE], eax |
2404,10 → 2406,10 |
;* mouse centered - start code- Mario79 |
;mouse_centered: |
; push eax |
mov eax, [_display.width] |
mov eax, [Screen_Max_X] |
shr eax, 1 |
mov [MOUSE_X], ax |
mov eax, [_display.height] |
mov eax, [Screen_Max_Y] |
shr eax, 1 |
mov [MOUSE_Y], ax |
call wakeup_osloop |
2449,11 → 2451,11 |
; cmp ecx,4 ; set mouse pointer position |
dec ecx |
jnz .set_mouse_button |
cmp dx, word[_display.height] |
jae .end |
cmp dx, word[Screen_Max_Y] |
ja .end |
rol edx, 16 |
cmp dx, word[_display.width] |
jae .end |
cmp dx, word[Screen_Max_X] |
ja .end |
mov [MOUSE_X], edx |
mov [mouse_active], 1 |
call wakeup_osloop |
2880,10 → 2882,8 |
jnz nosb9 |
; ecx = [left]*65536 + [right] |
; edx = [top]*65536 + [bottom] |
mov eax, [_display.width] |
mov ebx, [_display.height] |
dec eax |
dec ebx |
mov eax, [Screen_Max_X] |
mov ebx, [Screen_Max_Y] |
; check [right] |
cmp cx, ax |
ja .exit |
2935,10 → 2935,8 |
and [draw_data+32 + RECT.left], 0 |
and [draw_data+32 + RECT.top], 0 |
push eax ebx |
mov eax, [_display.width] |
mov ebx, [_display.height] |
dec eax |
dec ebx |
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 |
3300,11 → 3298,9 |
add edx, draw_data - CURRENT_TASK |
mov [edx + RECT.left], 0 |
mov [edx + RECT.top], 0 |
mov eax, [_display.width] |
dec eax |
mov eax, [Screen_Max_X] |
mov [edx + RECT.right], eax |
mov eax, [_display.height] |
dec eax |
mov eax, [Screen_Max_Y] |
mov [edx + RECT.bottom], eax |
srl1: |
4797,9 → 4793,9 |
jnz @f |
mov word [msg_board_pos+2], (42*6) |
add word [msg_board_pos], 10 |
mov ax, word [_display.width] |
mov ax, word [Screen_Max_Y] |
cmp word [msg_board_pos], ax |
jb @f |
jbe @f |
mov word [msg_board_pos], 10 |
@@: |
; // end if |
5016,9 → 5012,10 |
.1: ; resolution |
mov eax, [_display.width] |
mov eax, [Screen_Max_X] |
shl eax, 16 |
mov ax, word [_display.height] |
mov ax, word [Screen_Max_Y] |
add eax, 0x00010001 |
mov [esp+32], eax |
ret |
.2: ; bits per pixel |
5103,11 → 5100,9 |
align 4 |
syscall_getscreensize: ; GetScreenSize |
mov ax, word [_display.width] |
dec ax |
mov ax, word [Screen_Max_X] |
shl eax, 16 |
mov ax, word [_display.height] |
dec ax |
mov ax, word [Screen_Max_Y] |
mov [esp + 32], eax |
ret |
;----------------------------------------------------------------------------- |
5183,10 → 5178,10 |
;----------------------------------------------------------------------------- |
align 4 |
syscall_getpixel_WinMap: ; GetPixel WinMap |
cmp ebx, [_display.width] |
jb @f |
cmp ecx, [_display.height] |
jb @f |
cmp ebx, [Screen_Max_X] |
jbe @f |
cmp ecx, [Screen_Max_Y] |
jbe @f |
xor eax, eax |
jmp .store |
;-------------------------------------- |
5203,7 → 5198,8 |
;----------------------------------------------------------------------------- |
align 4 |
syscall_getpixel: ; GetPixel |
mov ecx, [_display.width] |
mov ecx, [Screen_Max_X] |
inc ecx |
xor edx, edx |
mov eax, ebx |
div ecx |
5448,6 → 5444,8 |
pushfd |
cli |
mov [Screen_Max_X], eax |
mov [Screen_Max_Y], edx |
mov [_display.pitch], ecx |
mov [screen_workarea.right], eax |
5489,10 → 5487,8 |
call repos_windows |
xor eax, eax |
xor ebx, ebx |
mov ecx, [_display.width] |
mov edx, [_display.height] |
dec ecx |
dec edx |
mov ecx, [Screen_Max_X] |
mov edx, [Screen_Max_Y] |
call calculatescreen |
pop edi |
pop esi |