From 69f5ec5ac7fdec49fea13de33722e4cbb6094b09 Mon Sep 17 00:00:00 2001 From: Doczom Date: Fri, 22 Sep 2023 16:31:40 +0000 Subject: [PATCH] [KERNEL] Graphics subsystem has been redesigned: - removed the old cursor and the code for its operation - minor fixes in other kernel modules - new fields have been added to the display_t structure for further refactoring of the graphics subsystem. git-svn-id: svn://kolibrios.org@9941 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/blkdev/disk.inc | 2 +- kernel/trunk/const.inc | 11 +- kernel/trunk/core/taskman.inc | 6 +- kernel/trunk/data32.inc | 4 - kernel/trunk/gui/button.inc | 16 +- kernel/trunk/gui/mouse.inc | 4 +- kernel/trunk/gui/mousepointer.inc | 250 ---------------- kernel/trunk/gui/window.inc | 78 ++--- kernel/trunk/hid/mousedrv.inc | 335 +-------------------- kernel/trunk/kernel.asm | 102 +++---- kernel/trunk/video/blitter.inc | 28 +- kernel/trunk/video/cursors.inc | 261 +++++++++++++++- kernel/trunk/video/framebuffer.inc | 13 +- kernel/trunk/video/vesa20.inc | 457 ++--------------------------- kernel/trunk/video/vga.inc | 12 +- 15 files changed, 408 insertions(+), 1171 deletions(-) delete mode 100644 kernel/trunk/gui/mousepointer.inc diff --git a/kernel/trunk/blkdev/disk.inc b/kernel/trunk/blkdev/disk.inc index 8deb4002b8..3ffdef4bee 100644 --- a/kernel/trunk/blkdev/disk.inc +++ b/kernel/trunk/blkdev/disk.inc @@ -731,7 +731,7 @@ disk_scan_partitions: ; [ecx+0x40] is shorter than [ebx+0x1fe]: one-byte offset vs 4-bytes offset. lea ecx, [ebx+0x1be] ; ecx -> partition table cmp word [ecx+0x40], 0xaa55 - jnz .mbr_failed + jnz .notmbr ; 8. The MBR is treated differently from EBRs. For MBR we additionally need to ; execute step 10 and possibly step 11. test ebp, ebp diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index abadd6be23..7d568b31a7 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -789,6 +789,15 @@ struct display_t check_m_pixel dd ? bytes_per_pixel dd ? + + put_pixel dd ? + put_rect dd ? + put_image dd ? + put_line dd ? + get_pixel dd ? + get_rect dd ? + get_image dd ? + get_line dd ? ends struct DISPMODE diff --git a/kernel/trunk/core/taskman.inc b/kernel/trunk/core/taskman.inc index 9438fcd285..5d2b3a9258 100644 --- a/kernel/trunk/core/taskman.inc +++ b/kernel/trunk/core/taskman.inc @@ -709,16 +709,16 @@ proc new_sys_threads mov [slot], eax mov esi, [current_slot] - mov ebx, esi ;ebx=esi - pointer to extended information about current thread + mov ebx, esi ;ebx=esi - pointer to information about current thread mov edi, eax shl edi, BSF sizeof.APPDATA add edi, SLOT_BASE - mov edx, edi ;edx=edi - pointer to extended infomation about new thread + mov edx, edi ;edx=edi - pointer to infomation about new thread mov ecx, sizeof.APPDATA/4 xor eax, eax cld - rep stosd ;clean extended information about new thread + rep stosd ;clean information about new thread mov esi, ebx mov edi, edx mov ecx, 11 diff --git a/kernel/trunk/data32.inc b/kernel/trunk/data32.inc index 50454317c0..71745594f2 100644 --- a/kernel/trunk/data32.inc +++ b/kernel/trunk/data32.inc @@ -353,7 +353,6 @@ fpu_data_size = $ - fpu_data BPSLine_calc_area rd MAX_SCREEN_HEIGHT d_width_calc_area rd MAX_SCREEN_HEIGHT -mouseunder rd 16*24 mem_block_list rd 64*2 mem_used_list rd 64*2 @@ -395,8 +394,6 @@ BANK_SWITCH dd ? ; reserved for vesa 1.2 BANK_RW dd ? end if -MOUSE_PICTURE dd ? - def_cursor dd ? def_cursor_clock dd ? def_cursor_hresize dd ? @@ -404,7 +401,6 @@ def_cursor_vresize dd ? def_cursor_dresize1 dd ? def_cursor_dresize2 dd ? current_cursor dd ? -hw_cursor dd ? cur_saved_base dd ? cur.lock dd ? ; 1 - lock update, 2- hide diff --git a/kernel/trunk/gui/button.inc b/kernel/trunk/gui/button.inc index 948e851cc2..f26b7c3b0a 100644 --- a/kernel/trunk/gui/button.inc +++ b/kernel/trunk/gui/button.inc @@ -95,13 +95,13 @@ syscall_button: ; make coordinates clientbox-relative push eax - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] rol ebx, 16 - add bx, word[window_data + eax + WDATA.clientbox.left] + add bx, word[eax + WDATA.clientbox.left] rol ebx, 16 rol ecx, 16 - add cx, word[window_data + eax + WDATA.clientbox.top] + add cx, word[eax + WDATA.clientbox.top] rol ecx, 16 pop eax @@ -173,10 +173,10 @@ syscall_button: dec ebp shr ebx, 16 shr ecx, 16 - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA - add ebx, [eax + window_data + WDATA.box.left] - add ecx, [eax + window_data + WDATA.box.top] + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] + add ebx, [eax + WDATA.box.left] + add ecx, [eax + WDATA.box.top] mov eax, ebx inc eax mov edx, ebx diff --git a/kernel/trunk/gui/mouse.inc b/kernel/trunk/gui/mouse.inc index 95ebef07b2..8d1fa389ba 100644 --- a/kernel/trunk/gui/mouse.inc +++ b/kernel/trunk/gui/mouse.inc @@ -1,14 +1,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2010-2023. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Revision$ -include 'mousepointer.inc' - ;================================ ;/////// public functions /////// ;================================ diff --git a/kernel/trunk/gui/mousepointer.inc b/kernel/trunk/gui/mousepointer.inc deleted file mode 100644 index 1984f97407..0000000000 --- a/kernel/trunk/gui/mousepointer.inc +++ /dev/null @@ -1,250 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;; -;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; -;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; -;; Distributed under terms of the GNU General Public License ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -$Revision$ - - -iglobal - -align 4 -mousepointer: -db 0x00,0x00,0x00,0x74,0x74,0x74,0x6e,0x6e,0x6e,0x6f -db 0x6f,0x6f,0x71,0x71,0x71,0x75,0x75,0x75,0x79,0x79 -db 0x79,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x00,0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63 -db 0x66,0x66,0x66,0x6c,0x6c,0x6c,0x72,0x72,0x72,0x78 -db 0x78,0x78,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 -db 0xc0,0xc0,0x00,0x00,0x00,0x54,0x54,0x54,0x57,0x57 -db 0x57,0x5f,0x5f,0x5f,0x68,0x68,0x68,0x71,0x71,0x71 -db 0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0x00,0x00,0x00,0x47,0x47,0x47,0x50 -db 0x50,0x50,0x5b,0x5b,0x5b,0x67,0x67,0x67,0x70,0x70 -db 0x70,0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0xff,0xff,0xff,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x3f,0x3f,0x3f -db 0x4b,0x4b,0x4b,0x59,0x59,0x59,0x66,0x66,0x66,0x70 -db 0x70,0x70,0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e,0x7e -db 0x7e,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x3a,0x3a -db 0x3a,0x49,0x49,0x49,0x59,0x59,0x59,0x66,0x66,0x66 -db 0x70,0x70,0x70,0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e -db 0x7e,0x7e,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x39 -db 0x39,0x39,0x49,0x49,0x49,0x59,0x59,0x59,0x66,0x66 -db 0x66,0x71,0x71,0x71,0x78,0x78,0x78,0x7c,0x7c,0x7c -db 0x7e,0x7e,0x7e,0x80,0x80,0x80,0x80,0x80,0x80,0xff -db 0xff,0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00 -db 0x39,0x39,0x39,0x4a,0x4a,0x4a,0x5a,0x5a,0x5a,0x68 -db 0x68,0x68,0x72,0x72,0x72,0x79,0x79,0x79,0x7d,0x7d -db 0x7d,0x7f,0x7f,0x7f,0x80,0x80,0x80,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00 -db 0x00,0x3c,0x3c,0x3c,0x4e,0x4e,0x4e,0x5e,0x5e,0x5e -db 0x6b,0x6b,0x6b,0x75,0x75,0x75,0x7a,0x7a,0x7a,0x7e -db 0x7e,0x7e,0x80,0x80,0x80,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00 -db 0x00,0x00,0x43,0x43,0x43,0x55,0x55,0x55,0x64,0x64 -db 0x64,0x70,0x70,0x70,0x78,0x78,0x78,0x7d,0x7d,0x7d -db 0x80,0x80,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xc0 -db 0xc0,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x4e,0x4e,0x4e,0x5f,0x5f,0x5f,0x6d -db 0x6d,0x6d,0x76,0x76,0x76,0x7c,0x7c,0x7c,0x80,0x80 -db 0x80,0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00 -db 0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x14 -db 0x14,0x14,0x1b,0x1b,0x1b,0x29,0x29,0x29,0x3a,0x3a -db 0x3a,0x4c,0x4c,0x4c,0x5d,0x5d,0x5d,0x6c,0x6c,0x6c -db 0x75,0x75,0x75,0x7b,0x7b,0x7b,0x80,0x80,0x80,0xc0 -db 0xc0,0xc0,0x00,0x00,0x00,0x2f,0x2f,0x2f,0x80,0x80 -db 0x80,0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00 -db 0x21,0x21,0x21,0x2e,0x2e,0x2e,0x40,0x40,0x40,0x52 -db 0x52,0x52,0x62,0x62,0x62,0x6f,0x6f,0x6f,0x77,0x77 -db 0x77,0x7c,0x7c,0x7c,0x80,0x80,0x80,0x00,0x00,0x00 -db 0x47,0x47,0x47,0x3b,0x3b,0x3b,0x80,0x80,0x80,0xff -db 0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x25,0x25 -db 0x25,0x30,0x30,0x30,0x42,0x42,0x42,0x54,0x54,0x54 -db 0x64,0x64,0x64,0x70,0x70,0x70,0x78,0x78,0x78,0x7d -db 0x7d,0x7d,0x00,0x00,0x00,0x62,0x62,0x62,0x52,0x52 -db 0x52,0x4a,0x4a,0x4a,0x43,0x43,0x43,0x80,0x80,0x80 -db 0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x33 -db 0x33,0x33,0x42,0x42,0x42,0x54,0x54,0x54,0x64,0x64 -db 0x64,0x71,0x71,0x71,0x79,0x79,0x79,0x7d,0x7d,0x7d -db 0x72,0x72,0x72,0x6b,0x6b,0x6b,0x5f,0x5f,0x5f,0x5a -db 0x5a,0x5a,0x54,0x54,0x54,0x80,0x80,0x80,0xff,0xff -db 0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x35,0x35,0x35 -db 0x41,0x41,0x41,0x53,0x53,0x53,0x63,0x63,0x63,0x70 -db 0x70,0x70,0x78,0x78,0x78,0x7d,0x7d,0x7d,0x77,0x77 -db 0x77,0x73,0x73,0x73,0x6c,0x6c,0x6c,0x68,0x68,0x68 -db 0x62,0x62,0x62,0x5a,0x5a,0x5a,0x80,0x80,0x80,0xff -db 0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x41,0x41 -db 0x41,0x52,0x52,0x52,0x62,0x62,0x62,0x6f,0x6f,0x6f -db 0x78,0x78,0x78,0x7d,0x7d,0x7d,0x7b,0x7b,0x7b,0x79 -db 0x79,0x79,0x74,0x74,0x74,0x72,0x72,0x72,0x6e,0x6e -db 0x6e,0x66,0x66,0x66,0x80,0x80,0x80,0xc0,0xc0,0xc0 -db 0xc0,0xc0,0xc0,0x00,0x00,0x00,0x44,0x44,0x44,0x52 -db 0x52,0x52,0x62,0x62,0x62,0x6e,0x6e,0x6e,0x77,0x77 -db 0x77,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x7c,0x7c,0x7c -db 0x7a,0x7a,0x7a,0x79,0x79,0x79,0x75,0x75,0x75,0x6f -db 0x6f,0x6f,0x65,0x65,0x65,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x48,0x48,0x48,0x4b,0x4b,0x4b,0x56,0x56,0x56 -db 0x65,0x65,0x65,0x70,0x70,0x70,0x78,0x78,0x78,0x7d -db 0x7d,0x7d,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e -db 0x7e,0x7d,0x7d,0x7d,0x7a,0x7a,0x7a,0x76,0x76,0x76 -db 0x6f,0x6f,0x6f,0x65,0x65,0x65,0x5c,0x5c,0x5c,0x56 -db 0x56,0x56,0x58,0x58,0x58,0x60,0x60,0x60,0x6b,0x6b -db 0x6b,0x73,0x73,0x73,0x7a,0x7a,0x7a,0x7d,0x7d,0x7d -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f -db 0x7f,0x7f,0x7d,0x7d,0x7d,0x7a,0x7a,0x7a,0x76,0x76 -db 0x76,0x70,0x70,0x70,0x6a,0x6a,0x6a,0x66,0x66,0x66 -db 0x66,0x66,0x66,0x6c,0x6c,0x6c,0x72,0x72,0x72,0x78 -db 0x78,0x78,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x7f,0x7f,0x7f,0x7d,0x7d,0x7d,0x7b,0x7b,0x7b,0x77 -db 0x77,0x77,0x73,0x73,0x73,0x71,0x71,0x71,0x71,0x71 -db 0x71,0x74,0x74,0x74,0x78,0x78,0x78,0x7b,0x7b,0x7b -db 0x7d,0x7d,0x7d,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x7f,0x7f,0x7f,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c -db 0x7a,0x7a,0x7a,0x78,0x78,0x78,0x78,0x78,0x78,0x7a -db 0x7a,0x7a,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x7f,0x7f -db 0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -db 0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e -db 0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e -db 0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80 -db 0x80,0x80 - -mousepointer1: -db 0xff,0xff,0xff,0x06,0x06,0x06,0x0a,0x0a -db 0x0a,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0xff,0xff,0xff,0xff,0xff,0xff,0x19,0x19,0x19,0x16 -db 0x16,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2e,0x2e,0x2e -db 0x23,0x23,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x3f -db 0x3f,0x29,0x29,0x29,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x47 -db 0x47,0x47,0x2c,0x2c,0x2c,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0x48,0x48,0x48,0x2c,0x2c,0x2c,0x16,0x16,0x16,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0x48,0x48,0x48,0x2c,0x2c,0x2c,0x16,0x16,0x16 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0x48,0x48,0x48,0x2c,0x2c,0x2c,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0x48,0x48,0x48,0x2c,0x2c,0x2c,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0x47,0x47,0x47,0x29,0x29,0x29 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0x40,0x40,0x40,0x23,0x23 -db 0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xaa,0xaa,0xaa,0x9f,0x9f,0x9f,0x8c,0x8c,0x8c -db 0x70,0x70,0x70,0x4f,0x4f,0x4f,0x30,0x30,0x30,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0x8f,0x8f -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0xff,0x9c,0x9c,0x9c,0x87,0x87,0x87,0x6c,0x6c -db 0x6c,0x4f,0x4f,0x4f,0x32,0x32,0x32,0x19,0x19,0x19 -db 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff -db 0xff,0xff,0x69,0x69,0x69,0x84,0x84,0x84,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0x92,0x92,0x92,0x79,0x79,0x79,0x59,0x59,0x59,0x3c -db 0x3c,0x3c,0x24,0x24,0x24,0x11,0x11,0x11,0x00,0x00 -db 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x37,0x37,0x37 -db 0x5d,0x5d,0x5d,0x70,0x70,0x70,0x76,0x76,0x76,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0xff,0x75,0x75,0x75,0x51,0x51,0x51,0x31,0x31,0x31 -db 0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x16,0x16,0x16,0x2d,0x2d,0x2d,0x49,0x49 -db 0x49,0x53,0x53,0x53,0x54,0x54,0x54,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x78 -db 0x78,0x78,0x54,0x54,0x54,0x30,0x30,0x30,0x16,0x16 -db 0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x0f,0x0f,0x0f,0x1f,0x1f,0x1f,0x30,0x30,0x30,0x33 -db 0x33,0x33,0x33,0x33,0x33,0x3b,0x3b,0x3b,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff -db 0x62,0x62,0x62,0x3b,0x3b,0x3b,0x1c,0x1c,0x1c,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08 -db 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x24,0x24,0x24,0xff,0xff,0xff,0xff -db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x6e,0x6e -db 0x6e,0x48,0x48,0x48,0x25,0x25,0x25,0x0e,0x0e,0x0e -db 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x00 -db 0x00,0x00,0x0a,0x0a,0x0a,0x09,0x09,0x09,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x29,0x29,0x29,0xff,0xff,0xff -db 0xff,0xff,0xff,0x7c,0x7c,0x7c,0x71,0x71,0x71,0x50 -db 0x50,0x50,0x2b,0x2b,0x2b,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x02,0x02,0x02,0x04,0x04,0x04,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x56,0x56 -db 0x56,0x69,0x69,0x69,0x64,0x64,0x64,0x4a,0x4a,0x4a -db 0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x05,0x05,0x05 -db 0x00,0x00,0x00,0x21,0x21,0x21,0x39,0x39,0x39,0x49 -db 0x49,0x49,0x48,0x48,0x48,0x35,0x35,0x35,0x1d,0x1d -db 0x1d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x1d,0x1d,0x1d,0x27,0x27,0x27 -db 0x27,0x27,0x27,0x1d,0x1d,0x1d,0x0f,0x0f,0x0f,0x06 -db 0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -db 0x00,0x00,0x00,0x00 - -endg diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index caeec1abdd..78acb189fc 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -186,7 +186,7 @@ syscall_drawline: align 4 ; system function 48 syscall_display_settings: - cmp ebx, 13 + cmp ebx, .ftable.size-1 ja .ret jmp dword[.ftable + ebx*4] @@ -206,6 +206,7 @@ dd .setFontSmoothing dd .getFontSize dd .setFontSize dd .setSkinUnicode +.ftable.size = ($ - .ftable)/4 .redrawWholeScreen: xor eax, eax @@ -223,7 +224,7 @@ dd .setSkinUnicode mov eax, [_display.height] dec eax mov [draw_limits.bottom], eax - mov eax, window_data + mov eax, window_data ; TODO: check pointer jmp redrawscreen .setButtonStyle: @@ -406,18 +407,18 @@ align 4 ;> ebx = 1 ;> ecx = scale power (resulting scale is 2^ebx) syscall_set_window_shape: - mov edi, [current_slot_idx] - shl edi, BSF sizeof.WDATA + mov edi, [current_slot] + mov edi, [edi + APPDATA.window] test ebx, ebx jne .shape_scale - mov [window_data + edi + WDATA.shape], ecx + mov [edi + WDATA.shape], ecx ;-------------------------------------- align 4 .shape_scale: dec ebx jnz .exit - mov [window_data + edi + WDATA.shape_scale], ecx + mov [edi + WDATA.shape_scale], ecx ;-------------------------------------- align 4 .exit: @@ -427,9 +428,8 @@ align 4 align 4 ; system function 67 syscall_move_window: - mov edi, [current_slot_idx] - shl edi, BSF sizeof.WDATA - add edi, window_data + mov edi, [current_slot] + mov edi, [edi + APPDATA.window] test [edi + WDATA.fl_wdrawn], 1 jz .exit @@ -556,11 +556,11 @@ align 4 .next_window: movzx edi, word[WIN_POS + esi * 2] shl edi, BSF sizeof.WDATA + add edi, window_data - test byte [window_data + edi + WDATA.fl_wstate], WSTATE_USED + test byte [edi + WDATA.fl_wstate], WSTATE_USED jz .skip_window - add edi, window_data test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED jnz .skip_window @@ -1245,7 +1245,7 @@ window_check_events: dec bl jnz @f call minimize_window - jmp .exit + ret ;-------------------------------------- align 4 @@: @@ -1614,9 +1614,8 @@ align 4 align 4 ;< edx = pointer to WDATA struct window._.sys_set_window: - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA - add eax, window_data + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] ; save window colors mov [eax + WDATA.cl_workarea], edx mov [eax + WDATA.cl_titlebar], esi @@ -1847,18 +1846,20 @@ end virtual mov edi, esi shl edi, BSF sizeof.WDATA + add edi, window_data cmp esi, 1 jz .check_for_shaped_window - cmp [window_data + edi + WDATA.box.width], 0 + cmp [edi + WDATA.box.width], 0 jnz .check_for_shaped_window - cmp [window_data + edi + WDATA.box.height], 0 + + cmp [edi + WDATA.box.height], 0 jz .exit ;-------------------------------------- align 4 .check_for_shaped_window: - cmp [window_data + edi + WDATA.shape], 0 + cmp [edi + WDATA.shape], 0 jne .shaped_window ; get x&y size @@ -1908,7 +1909,7 @@ align 4 inc ecx inc edx - push [window_data + edi + WDATA.shape_scale] ; push scale first -> for loop + push [edi + WDATA.shape_scale] ; push scale first -> for loop ; get WinMap start -> ebp push eax @@ -1918,7 +1919,7 @@ align 4 add eax, [_display.win_map] mov ebp, eax - mov edi, [window_data + edi + WDATA.shape] + mov edi, [edi + WDATA.shape] pop eax ; eax = x_start @@ -2227,9 +2228,8 @@ window._.draw_window_caption: ;-------------------------------------- align 4 @@: - mov edx, [current_slot_idx] - shl edx, BSF sizeof.WDATA - add edx, window_data + mov edx, [current_slot] + mov edx, [edx + APPDATA.window] movzx ebx, [edx + WDATA.fl_wstyle] and bl, 0x0F cmp bl, 3 @@ -2263,17 +2263,17 @@ align 4 ;-------------------------------------- align 4 .2: - mov edi, [current_slot_idx] - shl edi, BSF sizeof.WDATA - test [window_data + edi + WDATA.fl_wstyle], WSTYLE_HASCAPTION + mov edi, [current_slot] + mov edi, [edi + APPDATA.window] + test [edi + WDATA.fl_wstyle], WSTYLE_HASCAPTION jz .exit - mov edx, [window_data + edi + WDATA.caption] + mov edx, [edi + WDATA.caption] or edx, edx jz .exit - mov ebp, [edi + window_data + WDATA.box.left - 2] - mov bp, word[edi + window_data + WDATA.box.top] - movzx eax, [edi + window_data + WDATA.fl_wstyle] + mov ebp, [edi + WDATA.box.left - 2] + mov bp, word[edi + WDATA.box.top] + movzx eax, [edi + WDATA.fl_wstyle] and al, 0x0F cmp al, 3 je .skinned @@ -2284,7 +2284,7 @@ align 4 ;-------------------------------------- align 4 .skinned: - movzx eax, word[edi + window_data + WDATA.box.width] + movzx eax, word[edi + WDATA.box.width] sub ax, [_skinmargins.left] sub ax, [_skinmargins.right] js .exit @@ -2301,7 +2301,7 @@ align 4 .not_skinned: cmp al, 1 je .exit - movzx eax, word[edi + window_data + WDATA.box.width] + movzx eax, word[edi + WDATA.box.width] sub eax, 16 js .exit mov ebx, 80002h @@ -2310,7 +2310,7 @@ align 4 mov esi, eax add ebx, ebp mov ecx, [common_colours + 16] - mov al, [window_data + edi + WDATA.captionEncoding] + mov al, [edi + WDATA.captionEncoding] test al, al jnz @f mov al, 1 @@ -2368,19 +2368,19 @@ align 4 ; void __fastcall get_window_rect(struct RECT* rc); ; ecx = pointer to RECT window._.get_rect: - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] - mov edx, [eax + window_data + WDATA.box.left] + mov edx, [eax + WDATA.box.left] mov [ecx+RECT.left], edx - add edx, [eax + window_data + WDATA.box.width] + add edx, [eax + WDATA.box.width] mov [ecx+RECT.right], edx - mov edx, [eax +window_data + WDATA.box.top] + mov edx, [eax + WDATA.box.top] mov [ecx+RECT.top], edx - add edx, [eax + window_data + WDATA.box.height] + add edx, [eax + WDATA.box.height] mov [ecx+RECT.bottom], edx ret ;------------------------------------------------------------------------------ diff --git a/kernel/trunk/hid/mousedrv.inc b/kernel/trunk/hid/mousedrv.inc index cb01311d98..34a6fa186a 100644 --- a/kernel/trunk/hid/mousedrv.inc +++ b/kernel/trunk/hid/mousedrv.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -54,46 +54,7 @@ draw_mouse_under: movzx ebx, word [Y_UNDER] stdcall [_display.restore_cursor], eax, ebx popad - ret - - @@: - pushad - xor ecx, ecx - xor edx, edx - - .mres: - movzx eax, word [X_UNDER] - movzx ebx, word [Y_UNDER] - add eax, ecx - add ebx, edx - push ecx - push edx - push eax - push ebx - mov eax, edx - shl eax, 6 - shl ecx, 2 - add eax, ecx - add eax, mouseunder - mov ecx, [eax] - pop ebx - pop eax - mov edi, 1 ; force - or ecx, 0x04000000 ; don't save to mouseunder area -; call [putpixel] - call __sys_putpixel - pop edx - pop ecx - inc ecx - cmp ecx, 16 - jnz .mres - - xor ecx, ecx - inc edx - cmp edx, 24 - jnz .mres - - popad +@@: ret ;----------------------------------------------------------------------------- @@ -101,7 +62,7 @@ draw_mouse_under: align 4 save_draw_mouse: cmp [_display.move_cursor], 0 - je .no_hw_cursor + je .exit pushad mov [X_UNDER], ax @@ -158,8 +119,10 @@ save_draw_mouse: je .draw @@: - push esi - call [_display.select_cursor] + cmp [_display.select_cursor], 0 + jz .error + + stdcall [_display.select_cursor], esi mov [current_cursor], esi ;-------------------------------------- align 4 @@ -177,276 +140,9 @@ align 4 ; ret ;-------------------------------------- align 4 -.no_hw_cursor: - pushad - ; save & draw - mov [X_UNDER], ax - mov [Y_UNDER], bx - push eax - push ebx - mov ecx, 0 - mov edx, 0 -;-------------------------------------- -align 4 -.drm: - push eax - push ebx - push ecx - push edx - ; helloworld - push ecx - add eax, ecx ; save picture under mouse - add ebx, edx - push ecx - or ecx, 0x04000000 ; don't load to mouseunder area - push eax ebx edx edi - call [GETPIXEL] - pop edi edx ebx eax - mov [COLOR_TEMP], ecx - pop ecx - mov eax, edx - shl eax, 6 - shl ecx, 2 - add eax, ecx - add eax, mouseunder - mov ebx, [COLOR_TEMP] - and ebx, 0xffffff - mov [eax], ebx - pop ecx - mov edi, edx ; y cycle - shl edi, 4 ; *16 bytes per row - add edi, ecx ; x cycle - mov esi, edi - add edi, esi - add edi, esi ; *3 - add edi, [MOUSE_PICTURE] ; we have our str address - mov esi, edi - add esi, 16*24*3 - push ecx - mov ecx, [COLOR_TEMP] - call combine_colors - and ecx, 0xffffff - mov [MOUSE_COLOR_MEM], ecx - pop ecx - pop edx - pop ecx - pop ebx - pop eax - add eax, ecx ; we have x coord+cycle - add ebx, edx ; and y coord+cycle - push ecx - mov ecx, [MOUSE_COLOR_MEM] - mov edi, 1 ; force - or ecx, 0x04000000 ; don't save to mouseunder area -; call [putpixel] - call __sys_putpixel - pop ecx - mov ebx, [esp+0] ; pure y coord again - mov eax, [esp+4] ; and x - inc ecx ; +1 cycle - cmp ecx, 16 ; if more than 16 - jnz .drm - - xor ecx, ecx - inc edx - cmp edx, 24 - jnz .drm - - add esp, 8 +.error: popad - ret - -;----------------------------------------------------------------------------- - -align 4 -combine_colors: - ; in - ; ecx - color ( 00 RR GG BB ) - ; edi - ref to new color byte - ; esi - ref to alpha byte - ; - ; out - ; ecx - new color ( roughly (ecx*[esi]>>8)+([edi]*[esi]>>8) ) - push eax - push ebx - push edx - push ecx - xor ecx, ecx - ; byte 0 - mov eax, 0xff - sub al, [esi+0] - mov ebx, [esp] - shr ebx, 16 - and ebx, 0xff - mul ebx - shr eax, 8 - add ecx, eax - xor eax, eax - xor ebx, ebx - mov al, [edi+0] - mov bl, [esi+0] - mul ebx - shr eax, 8 - add ecx, eax - shl ecx, 8 - ; byte 1 - mov eax, 0xff - sub al, [esi+1] - mov ebx, [esp] - shr ebx, 8 - and ebx, 0xff - mul ebx - shr eax, 8 - add ecx, eax - xor eax, eax - xor ebx, ebx - mov al, [edi+1] - mov bl, [esi+1] - mul ebx - shr eax, 8 - add ecx, eax - shl ecx, 8 - ; byte 2 - mov eax, 0xff - sub al, [esi+2] - mov ebx, [esp] - and ebx, 0xff - mul ebx - shr eax, 8 - add ecx, eax - xor eax, eax - xor ebx, ebx - mov al, [edi+2] - mov bl, [esi+2] - mul ebx - shr eax, 8 - add ecx, eax - pop eax - pop edx - pop ebx - pop eax - ret - -;----------------------------------------------------------------------------- - -align 4 -check_mouse_area_for_getpixel: -; in: -; eax = x -; ebx = y -; out: -; ecx = new color - push eax ebx -; check for Y - xor ecx, ecx - mov cx, [Y_UNDER] ; [MOUSE_Y] - - cmp ebx, ecx - jb .no_mouse_area - add ecx, 23 ; mouse cursor Y size - cmp ebx, ecx - ja .no_mouse_area -; offset Y - sub bx, [Y_UNDER] ; [MOUSE_Y] -;-------------------------------------- -; check for X - xor ecx, ecx - mov cx, [X_UNDER] ; [MOUSE_X] - cmp eax, ecx - jb .no_mouse_area - add ecx, 15 ; mouse cursor X size - cmp eax, ecx - ja .no_mouse_area -; offset X - sub ax, [X_UNDER] ; [MOUSE_X] -;-------------------------------------- -; eax = offset x -; ebx = offset y - shl ebx, 6 ;y - shl eax, 2 ;x - add eax, ebx - add eax, mouseunder - mov ecx, [eax] - and ecx, 0xffffff - or ecx, 0xff000000 - pop ebx eax - ret - - .no_mouse_area: - xor ecx, ecx - pop ebx eax - ret - -;----------------------------------------------------------------------------- - -align 4 -check_mouse_area_for_putpixel: -; in: -; ecx = x shl 16 + y -; eax = color -; out: -; eax = new color - push eax -; check for Y - mov ax, [Y_UNDER] ; [MOUSE_Y] - cmp cx, ax - jb .no_mouse_area - add ax, 23 ; mouse cursor Y size - cmp cx, ax - ja .no_mouse_area -; offset Y - sub cx, [Y_UNDER] ; [MOUSE_Y] - mov ax, cx - shl eax, 16 - -; check for X - mov ax, [X_UNDER] ; [MOUSE_X] - shr ecx, 16 - cmp cx, ax - jb .no_mouse_area - add ax, 15 ; mouse cursor X size - cmp cx, ax - ja .no_mouse_area -; offset X - sub cx, [X_UNDER] ; [MOUSE_X] - mov ax, cx - -; eax = (offset y) shl 16 + (offset x) - - pop ecx - - push eax ebx - - mov ebx, eax - shr ebx, 16 ; y - and eax, 0xffff ; x - - shl ebx, 6 - shl eax, 2 - add eax, ebx - add eax, mouseunder - and ecx, 0xFFFFFF - mov [eax], ecx - - pop ebx eax - - push esi edi - rol eax, 16 - movzx edi, ax ; y cycle - shl edi, 4 ; *16 bytes per row - shr eax, 16 - add edi, eax ; x cycle - lea edi, [edi*3] - add edi, [MOUSE_PICTURE] ; we have our str address - mov esi, edi - add esi, 16*24*3 - call combine_colors - pop edi esi - mov eax, ecx - ret - - .no_mouse_area: - pop eax +.exit: ret ;----------------------------------------------------------------------------- @@ -461,25 +157,22 @@ __sys_draw_pointer: cmp [redrawmouse_unconditional], 0 je @f mov [redrawmouse_unconditional], 0 - jmp redrawmouse + jmp .redrawmouse @@: cmp eax, ecx - jne redrawmouse + jne .redrawmouse cmp ebx, edx - je nodmp + je .nodmp ;-------------------------------------- align 4 -redrawmouse: +.redrawmouse: pushfd cli call draw_mouse_under call save_draw_mouse -; mov eax, [_display.select_cursor] -; test eax, eax -; jz @f cmp [_display.select_cursor], select_cursor jne @f @@ -499,7 +192,7 @@ redrawmouse: mov [X_UNDER_sub_CUR_hot_x_add_curh], ax @@: popfd - nodmp: +.nodmp: popad ret diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index cc2ce66b49..437f718956 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1901,15 +1901,12 @@ sys_midi: ;----------------------------------------------------------------------------- sys_end: - cmp [_display.select_cursor], 0 - je @f ; restore default cursor before killing pusha mov ecx, [current_slot] mov ecx, [ecx + APPDATA.window] call restore_default_cursor_before_killing popa -@@: ;-------------------------------------- ; kill all sockets this process owns pusha @@ -1954,8 +1951,10 @@ restore_default_cursor_before_killing: cmp esi, [current_cursor] je @f - push esi - call [_display.select_cursor] + cmp [_display.select_cursor], 0 + jz @f + + stdcall [_display.select_cursor], esi mov [current_cursor], esi @@: mov [redrawmouse_unconditional], 1 @@ -2062,8 +2061,6 @@ sysfn_terminate: ; 18.2 = TERMINATE call socket_process_end popa ;-------------------------------------- - cmp [_display.select_cursor], 0 - je .restore_end ; restore default cursor before killing pusha mov ecx, [esp+32] @@ -2075,7 +2072,6 @@ sysfn_terminate: ; 18.2 = TERMINATE call restore_default_cursor_before_killing @@: popa -.restore_end: ;-------------------------------------- ;call MEM_Heap_Lock ;guarantee that process isn't working with heap mov [ecx + APPDATA.state], TSTATE_ZOMBIE; clear possible i40's @@ -2557,8 +2553,7 @@ sys_cpuusage: lea eax, [edx-1] stosd - mov edx, ecx - shr edx, (BSF sizeof.APPDATA - BSF sizeof.WDATA) + mov edx, [SLOT_BASE + ecx + APPDATA.window] ; +30: PID/TID mov eax, [SLOT_BASE + ecx + APPDATA.tid] @@ -2566,7 +2561,7 @@ sys_cpuusage: ; window position and size push esi - lea esi, [window_data + edx + WDATA.box] + lea esi, [edx + WDATA.box] movsd movsd movsd @@ -2577,14 +2572,14 @@ sys_cpuusage: stosd ; Window client area box - lea esi, [window_data + edx + WDATA.clientbox] + lea esi, [edx + WDATA.clientbox] movsd movsd movsd movsd ; Window state - mov al, [window_data + edx + WDATA.fl_wstate] + mov al, [edx + WDATA.fl_wstate] stosb ; Event mask (+71) @@ -2771,12 +2766,8 @@ cache_enable: is_cache_enabled: mov eax, cr0 - mov ebx, eax and eax, 01100000_00000000_00000000_00000000b - jz cache_disabled - mov [esp + SYSCALL_STACK.eax], ebx -cache_disabled: - mov dword [esp + SYSCALL_STACK.eax], eax;0 + mov [esp + SYSCALL_STACK.eax], eax ret modify_pce: @@ -2891,7 +2882,7 @@ backgr: ; DEBUGF 1, "K : backg y %x\n",[BG_Rect_Y_top_bottom] ;--------- set event 5 start ---------- push ecx edi - xor edi, edi + mov edi, window_data mov ecx, [thread_count] ;-------------------------------------- align 4 @@ -2899,40 +2890,38 @@ set_bgr_event: add edi, sizeof.WDATA mov eax, [BG_Rect_X_left_right] mov edx, [BG_Rect_Y_top_bottom] - cmp [window_data + edi + WDATA.draw_bgr_x], 0 + cmp [edi + WDATA.draw_bgr_x], 0 jz .set .join: - cmp word [window_data + edi + WDATA.draw_bgr_x], ax + cmp word [edi + WDATA.draw_bgr_x], ax jae @f - mov word [window_data + edi + WDATA.draw_bgr_x], ax + mov word [edi + WDATA.draw_bgr_x], ax @@: shr eax, 16 - cmp word [window_data + edi + WDATA.draw_bgr_x + 2], ax + cmp word [edi + WDATA.draw_bgr_x + 2], ax jbe @f - mov word [window_data + edi + WDATA.draw_bgr_x + 2], ax + mov word [edi + WDATA.draw_bgr_x + 2], ax @@: - cmp word [window_data + edi + WDATA.draw_bgr_y], dx + cmp word [edi + WDATA.draw_bgr_y], dx jae @f - mov word [window_data + edi + WDATA.draw_bgr_y], dx + mov word [edi + WDATA.draw_bgr_y], dx @@: shr edx, 16 - cmp word [window_data + edi + WDATA.draw_bgr_y+2], dx + cmp word [edi + WDATA.draw_bgr_y+2], dx jbe @f - mov word [window_data + edi + WDATA.draw_bgr_y+2], dx + mov word [edi + WDATA.draw_bgr_y+2], dx @@: jmp .common .set: - mov [window_data + edi + WDATA.draw_bgr_x], eax - mov [window_data + edi + WDATA.draw_bgr_y], edx + mov [edi + WDATA.draw_bgr_x], eax + mov [edi + WDATA.draw_bgr_y], edx .common: - mov eax, [window_data + edi + WDATA.thread] + mov eax, [edi + WDATA.thread] test eax, eax jz @f or [eax + APPDATA.occurred_events], EVENT_BACKGROUND @@: - sub ecx, 1 - jnz set_bgr_event - ;loop set_bgr_event + loop set_bgr_event pop edi ecx ;--------- set event 5 stop ----------- dec [REDRAW_BACKGROUND] ; got new update request? @@ -2956,7 +2945,7 @@ nobackgr: jne noshutdown lea ecx, [edx-1] - mov edx, SLOT_BASE + sizeof.APPDATA ;OS_BASE+0x3040 + mov edx, SLOT_BASE + sizeof.APPDATA*2 ;OS_BASE+0x3040 jecxz no_mark_system_shutdown ;-------------------------------------- align 4 @@ -3003,13 +2992,11 @@ newct: jnz .noterminate .terminate: pushad - mov ecx, eax - shl ecx, BSF sizeof.WDATA - add ecx, window_data + push esi + mov ecx, dword[ebx - APPDATA.state + APPDATA.window] call restore_default_cursor_before_killing - popad - pushad + pop esi call terminate popad cmp byte [SYS_SHUTDOWN], 0 @@ -3025,6 +3012,7 @@ newct: ret ;----------------------------------------------------------------------------- align 4 +; eax - ptr to WDATA redrawscreen: ; eax , if process window_data base is eax, do not set flag/limits @@ -3065,13 +3053,11 @@ newdw2: mov eax, [edi + WDATA.box.left] mov ebx, [edi + WDATA.box.top] - mov ecx, [draw_limits.bottom] ; ecx = area y end ebx = window y start - cmp ecx, ebx - jb ricino + cmp ebx, [draw_limits.bottom] ; ecx = area y end ebx = window y start + jae ricino - mov ecx, [draw_limits.right] ; ecx = area x end eax = window x start - cmp ecx, eax - jb ricino + cmp eax, [draw_limits.right] ; ecx = area x end eax = window x start + jae ricino mov eax, [edi + WDATA.box.left] mov ebx, [edi + WDATA.box.top] @@ -3090,7 +3076,7 @@ newdw2: ;-------------------------------------- align 4 bgli: - cmp dword[esp], 1 + cmp dword[esp], 1 ; check index in window_data array, 1 - idle jnz .az cmp [REDRAW_BACKGROUND], 0 @@ -3139,18 +3125,16 @@ align 4 ;-------------------------------------- align 4 .az: - mov eax, edi - mov ebx, [draw_limits.left] ; set limits - mov [eax + WDATA.draw_data.left], ebx + mov [edi + WDATA.draw_data.left], ebx mov ebx, [draw_limits.top] - mov [eax + WDATA.draw_data.top], ebx + mov [edi + WDATA.draw_data.top], ebx mov ebx, [draw_limits.right] - mov [eax + WDATA.draw_data.right], ebx + mov [edi + WDATA.draw_data.right], ebx mov ebx, [draw_limits.bottom] - mov [eax + WDATA.draw_data.bottom], ebx + mov [edi + WDATA.draw_data.bottom], ebx - cmp dword [esp], 1 + cmp dword [esp], 1 ; check idle thread jne nobgrd inc [REDRAW_BACKGROUND] call wakeup_osloop @@ -3159,8 +3143,8 @@ align 4 newdw8: nobgrd: ;-------------------------------------- - push eax edi ebp - mov edi, [esp+12] + push edi ebp + mov edi, [esp+8] cmp edi, 1 je .found @@ -3210,14 +3194,14 @@ align 4 ;-------------------------------------- align 4 .not_found: - pop ebp edi eax + pop ebp edi jmp ricino ;-------------------------------------- align 4 .found: - pop ebp edi eax + pop ebp edi - mov [eax + WDATA.fl_redraw], WSTATE_REDRAW ; mark as redraw + mov [edi + WDATA.fl_redraw], WSTATE_REDRAW ; mark as redraw ;-------------------------------------- align 4 ricino: diff --git a/kernel/trunk/video/blitter.inc b/kernel/trunk/video/blitter.inc index e89a94f31c..0bad636b1f 100644 --- a/kernel/trunk/video/blitter.inc +++ b/kernel/trunk/video/blitter.inc @@ -213,10 +213,10 @@ end virtual mov [esp + .flags], ebx - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA - mov ebx, [window_data + eax + WDATA.box.width] - mov edx, [window_data + eax + WDATA.box.height] + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] + mov ebx, [eax + WDATA.box.width] + mov edx, [eax + WDATA.box.height] inc ebx inc edx @@ -260,19 +260,19 @@ end virtual call blit_clip jc .L57 - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] mov ebx, [esp + BLITTER.dst_x] mov ebp, [esp + BLITTER.dst_y] - add ebx, [window_data + eax + WDATA.box.left] - add ebp, [window_data + eax + WDATA.box.top] + add ebx, [eax + WDATA.box.left] + add ebp, [eax + WDATA.box.top] test [esp + .flags], BLIT_CLIENT_RELATIVE jz .no_client_relative - add ebx, [window_data + eax + WDATA.clientbox.left] - add ebp, [window_data + eax + WDATA.clientbox.top] + add ebx, [eax + WDATA.clientbox.left] + add ebp, [eax + WDATA.clientbox.top] .no_client_relative: mov ecx, ebx @@ -320,8 +320,6 @@ end virtual mov ebx, [current_slot_idx] ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je .core_32.software_cursor - cmp [_display.select_cursor], 0 jne .core_32.hardware_cursor ;-------------------------------------- .core_32.software_cursor: @@ -430,12 +428,9 @@ align 4 ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder_1 ;-------------------------------------- align 4 -@@: push ecx mov ecx, [esp+4] @@ -491,11 +486,8 @@ align 4 ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder_2 ;-------------------------------------- - @@: push ecx mov ecx, [esp+4] diff --git a/kernel/trunk/video/cursors.inc b/kernel/trunk/video/cursors.inc index ed795171a2..369f849eab 100644 --- a/kernel/trunk/video/cursors.inc +++ b/kernel/trunk/video/cursors.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -617,6 +617,74 @@ align 4 endp ;------------------------------------------------------------------------------ align 4 +proc VGA_restore_32 stdcall, x:dword, y:dword + + push ebx + + mov ebx, [cur_saved_base] + mov edx, [cur.h] + test edx, edx + jz .ret + + push esi + push edi + + mov esi, cur_saved_data + mov edi, ebx + push [cur.w] + push [cur.top];[y] + push [cur.left];[x] + ;mov eax, [cur.top] + ;add [esp + 4], eax + ;mov eax, [cur.left] + ;add [esp], eax +;-------------------------------------- +align 4 +@@: + mov ecx, [esi] + add esi, 4 + + ;mov eax, [esp] + ;sub eax, [x] + ;shl eax, 2 ; *4 + ;mov [edi + eax], ecx + + mov eax, [esp] + mov ebx, [esp + 4] + + push edx edi + mov edi, 1 + or ecx, 0x04000000 + call __sys_putpixel + pop edi edx + add dword[esp], 1 + dec dword[esp + 8] + jnz @b + + mov eax, [cur.w] + mov ecx, [cur.left];[x] + ;add ecx, [cur.left] + mov [esp + 8], eax + + mov dword[esp], ecx + + inc dword[esp + 4] + ;add edi, [_display.lfb_pitch] + dec edx + jnz @b + + add esp, 4*3 + + pop edi + pop esi +;-------------------------------------- +align 4 +.ret: + pop ebx + ret +endp +;------------------------------------------------------------------------------ +align 4 proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword locals h dd ? @@ -959,6 +1027,161 @@ align 4 jnz .row ret endp + +;------------------------------------------------------------------------------ +align 4 +proc VGA_move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword + locals + h dd ? + _dx dd ? + _dy dd ? + bg_ptr dd ? + tmp_x dd ? + tmp_y dd ? + endl + + mov esi, [hcursor] + mov ecx, [x] + mov eax, [y] + + xor edx, edx + sub ecx, [esi + CURSOR.hot_x] + lea ebx, [ecx+32-1] + mov [x], ecx + sets dl + dec edx + and ecx, edx ;clip x to 0<=x + mov [cur.left], ecx + mov edi, ecx + sub edi, [x] + mov [_dx], edi + + xor edx, edx + sub eax, [esi + CURSOR.hot_y] + lea edi, [eax+32-1] + mov [y], eax + sets dl + dec edx + and eax, edx ;clip y to 0<=y + mov [cur.top], eax + mov edx, eax + sub edx, [y] + mov [_dy], edx + + mov [tmp_x], ecx + mov [tmp_y], eax + mov eax, [BPSLine_calc_area+eax*4] + lea edx, [LFB_BASE + eax + ecx*4] + mov [cur_saved_base], edx + + cmp ebx, [_display.width] + jb @F + mov ebx, [_display.width] +;-------------------------------------- +align 4 +@@: + cmp edi, [_display.height] + jb @F + mov edi, [_display.height] +;-------------------------------------- +align 4 +@@: + sub ebx, [x] + sub edi, [y] + sub ebx, [_dx] + sub edi, [_dy] + + mov [cur.w], ebx + mov [cur.h], edi + mov [h], edi + + mov eax, edi + mov edi, cur_saved_data + + xor ecx, ecx + mov eax, ecx +;-------------------------------------- +align 4 +@@: + ; get and save pixel background + push eax ecx ebx edx + add eax, [tmp_x] + mov ebx, ecx + add ebx, [tmp_y] + push edi + + or ecx, 0x04000000 + call [GETPIXEL] + + pop edi + ;and ecx, 0x00ffffff + mov [edi], ecx + add edi, 4 + + pop edx ebx ecx eax + inc eax + cmp eax, [cur.w] + jb @b + xor eax, eax + inc ecx + cmp ecx, [h] + jb @B + +;draw cursor + mov ebx, [cur_saved_base] + mov eax, [_dy] + shl eax, 5 + add eax, [_dx] + + mov esi, [hcursor] + mov esi, [esi + CURSOR.base] + lea edx, [esi+eax*4] + mov [bg_ptr], cur_saved_data + + mov [_dy], 0 +;-------------------------------------- +align 4 +.row: + mov [_dx], 0 + mov ecx, [cur.w] + mov esi, edx ; cursor image base + mov edi, ebx + add edx, 32*4 + add ebx, [_display.lfb_pitch] +;-------------------------------------- +align 4 +.pix: + ; get pixel cursor + lodsd + test eax, 0xFF000000 + jz @F + mov [edi], eax + + pusha + mov edi, 1 ; force + mov ecx, eax ; color + and ecx, 0x00ffffff + or ecx, 0x04000000 + mov eax, [x] + mov ebx, [y] + add eax, [_dx] + add ebx, [_dy] + call __sys_putpixel + popa +;-------------------------------------- +align 4 +@@: + inc [_dx] + add edi, 4 + dec ecx + jnz .pix + + inc [_dy] + dec [h] + jnz .row + ret +endp + ;------------------------------------------------------------------------------ align 4 check_mouse_area_for_getpixel_new: @@ -1167,16 +1390,31 @@ init_display: mov [edi + display_t.cr_list.prev], ecx if ~defined UEFI - cmp [SCR_MODE], word 0x13 - jbe .fail + cmp [SCR_MODE], word 0x12 + jne .not_vga + ; TODO + mov ebx, VGA_restore_32 + mov ecx, VGA_move_cursor_32 + mov edx, VGA_putpixel + jmp .set +.not_vga: test word [SCR_MODE], 0x4000 - jz .fail + jnz .not_ega + + mov ebx, restore_32 + mov ecx, move_cursor_32 + mov edx, Vesa20_putpixel32_new + mov eax, [_display.bits_per_pixel] + jmp .set + +.not_ega: end if mov ebx, restore_32 mov ecx, move_cursor_32 mov edx, Vesa20_putpixel32_new mov eax, [_display.bits_per_pixel] + cmp al, 32 jne .not_32bpp @@ -1184,13 +1422,11 @@ end if mov [_display.select_cursor], select_cursor mov [_display.move_cursor], ecx mov [_display.restore_cursor], ebx - mov [_display.check_mouse], check_mouse_area_for_putpixel_new - mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new + ;mov [_display.check_mouse], check_mouse_area_for_putpixel_new + ;mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new - cmp [PUTPIXEL], dword VGA_putpixel - je @f mov [PUTPIXEL], edx -@@: + stdcall load_cursor, def_hresize, dword LOAD_FROM_MEM mov [def_cursor_hresize], eax stdcall load_cursor, def_vresize, dword LOAD_FROM_MEM @@ -1230,11 +1466,10 @@ end if ; mov ecx, move_cursor_15 ; mov edx, Vesa20_putpixel15_new ; jmp .set - .fail: - xor eax, eax - mov [_display.select_cursor], eax - mov [_display.move_cursor], eax + ;xor eax, eax + ;mov [_display.select_cursor], eax + ;mov [_display.move_cursor], eax ret ;------------------------------------------------------------------------------ align 4 diff --git a/kernel/trunk/video/framebuffer.inc b/kernel/trunk/video/framebuffer.inc index 81d655f953..2786f3f620 100644 --- a/kernel/trunk/video/framebuffer.inc +++ b/kernel/trunk/video/framebuffer.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Synhronization for MenuetOS. ;; @@ -99,26 +99,25 @@ init_video: jmp .finish .16bpp: - mov [PUTPIXEL], Vesa20_putpixel16 + mov [PUTPIXEL], Vesa20_putpixel16_new mov [GETPIXEL], Vesa20_getpixel16 mov [_display.bytes_per_pixel], 2 jmp .finish .24bpp: - mov [PUTPIXEL], Vesa20_putpixel24 + mov [PUTPIXEL], Vesa20_putpixel24_new mov [GETPIXEL], Vesa20_getpixel24 mov [_display.bytes_per_pixel], 3 jmp .finish .32bpp: - mov [PUTPIXEL], Vesa20_putpixel32 + mov [PUTPIXEL], Vesa20_putpixel32_new mov [GETPIXEL], Vesa20_getpixel32 mov [_display.bytes_per_pixel], 4 .finish: - mov [MOUSE_PICTURE], mousepointer - mov [_display.check_mouse], check_mouse_area_for_putpixel - mov [_display.check_m_pixel], check_mouse_area_for_getpixel + mov [_display.check_mouse], check_mouse_area_for_putpixel_new + mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new mov ax, word [SCR_MODE] cmp ax, 0x0012 diff --git a/kernel/trunk/video/vesa20.inc b/kernel/trunk/video/vesa20.inc index 0abdcd5e94..e97a07bd71 100644 --- a/kernel/trunk/video/vesa20.inc +++ b/kernel/trunk/video/vesa20.inc @@ -40,10 +40,7 @@ Vesa20_getpixel16: ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder - @@: ; check mouse area for putpixel test ecx, 0x04000000 ; don't load to mouseunder area @@ -78,10 +75,7 @@ Vesa20_getpixel24: ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder - @@: ; check mouse area for putpixel test ecx, 0x04000000 ; don't load to mouseunder area @@ -110,10 +104,7 @@ Vesa20_getpixel32: ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder - @@: ; check mouse area for putpixel test ecx, 0x04000000 ; don't load to mouseunder area @@ -189,16 +180,16 @@ end virtual mov [putimg.image_cx], eax mov [putimg.image_cy], edx ; calculate absolute (i.e. screen) coordinates - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA - mov ebx, [eax + window_data + WDATA.box.left] + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] + mov ebx, [eax + WDATA.box.left] add ebx, [putimg.image_cx] mov [putimg.abs_cx], ebx - mov ebx, [eax +window_data + WDATA.box.top] + mov ebx, [eax + WDATA.box.top] add ebx, [putimg.image_cy] mov [putimg.abs_cy], ebx ; real_sx = MIN(wnd_sx-image_cx, image_sx); - mov ebx, [eax + window_data + WDATA.box.width] ; ebx = wnd_sx + mov ebx, [eax + WDATA.box.width] ; ebx = wnd_sx inc ebx ; WDATA.box.width is one pixel less than real window x-size sub ebx, [putimg.image_cx] ja @f @@ -213,7 +204,7 @@ end virtual .end_x: mov [putimg.real_sx], ebx ; init real_sy - mov ebx, [eax + window_data + WDATA.box.height] ; ebx = wnd_sy + mov ebx, [eax + WDATA.box.height] ; ebx = wnd_sy inc ebx sub ebx, [putimg.image_cy] ja @f @@ -292,8 +283,7 @@ put_image_end_16: mov ecx, [_display.select_cursor] cmp ecx, select_cursor je put_image_end_16_new - cmp ecx, 0 - je put_image_end_16_old + .new_line: mov ecx, [putimg.real_sx] .new_x: @@ -339,64 +329,6 @@ put_image_end_16: ;------------------------------------------------------------------------------ -align 4 -put_image_end_16_old: - - .new_line: - mov ecx, [putimg.real_sx] - .new_x: - push [putimg.edi] - mov eax, [putimg.ebp + 4] - call eax - cmp [ebp], bl - jne .skip - - push ecx - neg ecx - add ecx, [putimg.real_sx_and_abs_cx + 4] - shl ecx, 16 - add ecx, [putimg.real_sy_and_abs_cy + 4] - sub ecx, edi - -; check mouse area for putpixel - call check_mouse_area_for_putpixel - pop ecx - -; convert to 16 bpp and store to LFB -;; and eax, 00000000111110001111110011111000b -;; shr ah, 2 -;; shr ax, 3 -;; ror eax, 8 -;; add al, ah -;; rol eax, 8 - mov [LFB_BASE + edx], ax - .skip: - inc edx - inc edx - inc ebp - dec ecx - jnz .new_x - - add esi, [putimg.line_increment] - add edx, [putimg.screen_newline] - add ebp, [putimg.winmap_newline] - - cmp [putimg.ebp], putimage_get1bpp - jz .correct - cmp [putimg.ebp], putimage_get2bpp - jz .correct - cmp [putimg.ebp], putimage_get4bpp - jnz @f - .correct: - mov eax, [putimg.edi] - mov byte [eax], 80h - @@: - dec edi - jnz .new_line - jmp put_image_end_16.finish - -;------------------------------------------------------------------------------ - align 4 put_image_end_16_new: @@ -490,8 +422,7 @@ put_image_end_24: mov ecx, [_display.select_cursor] cmp ecx, select_cursor je put_image_end_24_new - cmp ecx, 0 - je put_image_end_24_old + .new_line: mov ecx, [putimg.real_sx] .new_x: @@ -535,63 +466,6 @@ put_image_end_24: ;------------------------------------------------------------------------------ -align 4 -put_image_end_24_old: - - .new_line: - mov ecx, [putimg.real_sx] -;-------------------------------------- -align 4 -.new_x: - push [putimg.edi] - mov eax, [putimg.ebp + 4] - call eax - cmp [ebp], bl - jne .skip - - push ecx - neg ecx - add ecx, [putimg.real_sx_and_abs_cx + 4] - shl ecx, 16 - add ecx, [putimg.real_sy_and_abs_cy + 4] - sub ecx, edi - -; check mouse area for putpixel - call check_mouse_area_for_putpixel - pop ecx -; store to LFB - mov [LFB_BASE + edx], ax - shr eax, 16 - mov [LFB_BASE + edx + 2], al - - .skip: - add edx, 3 - inc ebp - dec ecx - jnz .new_x - - add esi, [putimg.line_increment] - add edx, [putimg.screen_newline] - add ebp, [putimg.winmap_newline] - - cmp [putimg.ebp], putimage_get1bpp - jz .correct - cmp [putimg.ebp], putimage_get2bpp - jz .correct - cmp [putimg.ebp], putimage_get4bpp - jnz @f - - .correct: - mov eax, [putimg.edi] - mov byte [eax], 80h - - @@: - dec edi - jnz .new_line - jmp put_image_end_24.finish - -;------------------------------------------------------------------------------ - align 4 put_image_end_24_new: @@ -682,8 +556,6 @@ put_image_end_32: mov ecx, [_display.select_cursor] cmp ecx, select_cursor je put_image_end_32_new - cmp ecx, 0 - je put_image_end_32_old .new_line: mov ecx, [putimg.real_sx] @@ -735,59 +607,6 @@ put_image_end_32: ;------------------------------------------------------------------------------ -align 4 -put_image_end_32_old: - - .new_line: - mov ecx, [putimg.real_sx] - .new_x: - push [putimg.edi] - mov eax, [putimg.ebp + 4] - call eax - cmp [ebp], bl - jne .skip - - push ecx - neg ecx - add ecx, [putimg.real_sx_and_abs_cx + 4] - shl ecx, 16 - add ecx, [putimg.real_sy_and_abs_cy + 4] - sub ecx, edi - -; check mouse area for putpixel - call check_mouse_area_for_putpixel - pop ecx -; store to LFB - mov [LFB_BASE+edx], eax - - .skip: - add edx, 4 - inc ebp - dec ecx - jnz .new_x - - add esi, [putimg.line_increment] - add edx, [putimg.screen_newline] - add ebp, [putimg.winmap_newline] - - cmp [putimg.ebp], putimage_get1bpp - jz .correct - cmp [putimg.ebp], putimage_get2bpp - jz .correct - cmp [putimg.ebp], putimage_get4bpp - jnz @f - - .correct: - mov eax, [putimg.edi] - mov byte [eax], 80h - - @@: - dec edi - jnz .new_line - jmp put_image_end_32.finish - -;------------------------------------------------------------------------------ - align 4 put_image_end_32_new: @@ -877,9 +696,9 @@ __sys_putpixel: pushad cmp eax, [_display.width] - jge .exit + jae .exit cmp ebx, [_display.height] - jge .exit + jae .exit test edi, 1 ; force ? jnz .forced @@ -914,41 +733,6 @@ __sys_putpixel: ; eax = x ; ebx = y -align 4 -Vesa20_putpixel16: - - mov ecx, eax - shl ecx, 16 - mov cx, bx - -; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier - mov ebx, [BPSLine_calc_area + ebx*4] - lea edi, [eax*2]; edi = x*2 - mov eax, [esp + 32-8+4] - -; check for hardware cursor - cmp [_display.select_cursor], 0 - jne @f -; check mouse area for putpixel - test eax, 0x04000000 - jnz @f - call check_mouse_area_for_putpixel - @@: -; store to LFB - and eax, 00000000111110001111110011111000b - shr ah, 2 - shr ax, 3 - ror eax, 8 - add al, ah - rol eax, 8 - - mov [LFB_BASE + ebx + edi], ax - ret - -;----------------------------------------------------------------------------- -; eax = x -; ebx = y - align 4 Vesa20_putpixel16_new: @@ -999,37 +783,6 @@ Vesa20_putpixel16_new: ; eax = x ; ebx = y -align 4 -Vesa20_putpixel24: - - mov ecx, eax - shl ecx, 16 - mov cx, bx - -; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier - mov ebx, [BPSLine_calc_area + ebx*4] - lea edi, [eax + eax*2]; edi = x*3 - mov eax, [esp + 32-8+4] - -; check for hardware cursor - cmp [_display.select_cursor], 0 - jne @f -; check mouse area for putpixel - test eax, 0x04000000 - jnz @f - call check_mouse_area_for_putpixel - @@: - -; store to LFB - mov [LFB_BASE + ebx + edi], ax - shr eax, 16 - mov [LFB_BASE + ebx + edi + 2], al - ret - -;----------------------------------------------------------------------------- -; eax = x -; ebx = y - align 4 Vesa20_putpixel24_new: @@ -1075,35 +828,6 @@ Vesa20_putpixel24_new: ; eax = x ; ebx = y -align 4 -Vesa20_putpixel32: - - mov ecx, eax - shl ecx, 16 - mov cx, bx - -; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier - mov ebx, [BPSLine_calc_area+ebx*4] - lea edi, [ebx + eax*4] ; edi = x*4+(y*y multiplier) - mov eax, [esp + 32-8+4] ; eax = color - -; check for hardware cursor - cmp [_display.select_cursor], 0 - jne @f -; check mouse area for putpixel - test eax, 0x04000000 - jnz @f - call check_mouse_area_for_putpixel - @@: - and eax, 0xffffff -; store to LFB - mov [LFB_BASE + edi], eax - ret - -;----------------------------------------------------------------------------- -; eax = x -; ebx = y - align 4 Vesa20_putpixel32_new: @@ -1402,14 +1126,14 @@ end virtual mov [drbar.bar_sx], ecx mov [drbar.bar_cx], eax mov [drbar.bar_cy], ebx - mov edi, [current_slot_idx] - shl edi, BSF sizeof.WDATA - add eax, [edi + window_data + WDATA.box.left] ; win_cx - add ebx, [edi + window_data + WDATA.box.top] ; win_cy + mov edi, [current_slot] + mov edi, [edi + APPDATA.window] + add eax, [edi + WDATA.box.left] ; win_cx + add ebx, [edi + WDATA.box.top] ; win_cy mov [drbar.abs_cx], eax mov [drbar.abs_cy], ebx ; real_sx = MIN(wnd_sx-bar_cx, bar_sx); - mov ebx, [edi + window_data + WDATA.box.width] ; ebx = wnd_sx + mov ebx, [edi + WDATA.box.width] ; ebx = wnd_sx inc ebx ; WDATA.box.width is one pixel less than real window x-size sub ebx, [drbar.bar_cx] ja @f @@ -1426,7 +1150,7 @@ end virtual .end_x: mov [drbar.real_sx], ebx ; real_sy = MIN(wnd_sy-bar_cy, bar_sy); - mov ebx, [edi + window_data + WDATA.box.height] ; ebx = wnd_sy + mov ebx, [edi + WDATA.box.height] ; ebx = wnd_sy inc ebx sub ebx, [drbar.bar_cy] ja @f @@ -1508,8 +1232,7 @@ draw_bar_end_24: mov ecx, [_display.select_cursor] cmp ecx, select_cursor je draw_bar_end_24_new - cmp ecx, 0 - je draw_bar_end_24_old + .new_y: mov edi, [drbar.real_sx] .new_x: @@ -1546,49 +1269,6 @@ draw_bar_end_24: ;------------------------------------------------------------------------------ -align 4 -draw_bar_end_24_old: - - .new_y: - mov edi, [drbar.real_sx] - .new_x: - cmp byte [ebp], bl - jne .skip - - mov ecx, [drbar.real_sx_and_abs_cx] - sub ecx, edi - shl ecx, 16 - add ecx, [drbar.real_sy_and_abs_cy] - sub ecx, esi -; check mouse area for putpixel - call check_mouse_area_for_putpixel -; store to LFB - mov [edx], ax - shr eax, 16 - mov [edx + 2], al - mov eax, [drbar.color] - .skip: -; add pixel - add edx, 3 - inc ebp - dec edi - jnz .new_x -; add line - add edx, [drbar.line_inc_scr] - add ebp, [drbar.line_inc_map] -; drawing gradient bars - test bh, 0x80 - jz @f - test al, al - jz @f - dec al - @@: - dec esi - jnz .new_y - jmp draw_bar_end_24.end - -;------------------------------------------------------------------------------ - align 4 draw_bar_end_24_new: @@ -1669,8 +1349,6 @@ draw_bar_end_32: mov ecx, [_display.select_cursor] cmp ecx, select_cursor je draw_bar_end_32_new - cmp ecx, 0 - je draw_bar_end_32_old .new_y: mov edi, [drbar.real_sx] @@ -1713,45 +1391,6 @@ draw_bar_end_32: mov [EGA_counter], 1 ret -draw_bar_end_32_old: - - .new_y: - mov edi, [drbar.real_sx] - .new_x: - cmp byte [ebp], bl - jne .skip - - mov ecx, [drbar.real_sx_and_abs_cx] - sub ecx, edi - shl ecx, 16 - add ecx, [drbar.real_sy_and_abs_cy] - sub ecx, esi - -; check mouse area for putpixel - call check_mouse_area_for_putpixel -; store to LFB - mov [edx], eax - mov eax, [drbar.color] - .skip: -; add pixel - add edx, 4 - inc ebp - dec edi - jnz .new_x -; add line - add edx, [drbar.line_inc_scr] - add ebp, [drbar.line_inc_map] -; drawing gradient bars - test bh, 0x80 - jz @f - test al, al - jz @f - dec al - @@: - dec esi - jnz .new_y - jmp draw_bar_end_32.end - ;------------------------------------------------------------------------------ align 4 @@ -1830,8 +1469,7 @@ draw_bar_end_16: mov ecx, [_display.select_cursor] cmp ecx, select_cursor je draw_bar_end_16_new - cmp ecx, 0 - je draw_bar_end_16_old + .new_y: mov edi, [drbar.real_sx] .new_x: @@ -1878,57 +1516,6 @@ draw_bar_end_16: ;------------------------------------------------------------------------------ -align 4 -draw_bar_end_16_old: - - .new_y: - mov edi, [drbar.real_sx] - .new_x: - cmp byte [ebp], bl - jne .skip - - mov ecx, [drbar.real_sx_and_abs_cx] - sub ecx, edi - shl ecx, 16 - add ecx, [drbar.real_sy_and_abs_cy] - sub ecx, esi - -; check mouse area for putpixel - call check_mouse_area_for_putpixel -; convert to 16 bpp and store to LFB - and eax, 00000000111110001111110011111000b - shr ah, 2 - shr ax, 3 - ror eax, 8 - add al, ah - rol eax, 8 - mov [edx], ax - mov eax, [drbar.color] -.skip: - -; add pixel - add edx, 2 - inc ebp - dec edi - jnz .new_x - -; add line - add edx, [drbar.line_inc_scr] - add ebp, [drbar.line_inc_map] - -; drawing gradient bars - test bh, 0x80 - jz @f - test al, al - jz @f - dec al - @@: - dec esi - jnz .new_y - jmp draw_bar_end_16.end - -;------------------------------------------------------------------------------ - align 4 draw_bar_end_16_new: @@ -2077,10 +1664,8 @@ vesa20_drawbackground_tiled: ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder - @@: + and eax, 0xffffff ; check mouse area for putpixel call [_display.check_mouse] @@ -2271,10 +1856,8 @@ vesa20_drawbackground_stretch: push ecx ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder - @@: + mov ecx, [esp+20+4] ;x shl ecx, 16 add ecx, [esp+24+4] ;y diff --git a/kernel/trunk/video/vga.inc b/kernel/trunk/video/vga.inc index 756a960434..0cc93cf7d7 100644 --- a/kernel/trunk/video/vga.inc +++ b/kernel/trunk/video/vga.inc @@ -382,18 +382,16 @@ VGA_putpixel: ;-------------------------------------- ; check for hardware cursor cmp [_display.select_cursor], select_cursor - je @f - cmp [_display.select_cursor], 0 jne .no_mouseunder ;-------------------------------------- align 4 -@@: push ecx shl ecx, 16 mov cx, bx ; check mouse area for putpixel test eax, 0x04000000 jnz @f + call [_display.check_mouse] ;-------------------------------------- align 4 @@ -495,10 +493,10 @@ VGA_draw_bar: align 4 VGA_draw_bar_1: mov [temp.cx], eax - mov eax, [current_slot_idx] - shl eax, BSF sizeof.WDATA - add ebx, [window_data + eax + WDATA.box.top] - mov eax, [window_data + eax + WDATA.box.left] + mov eax, [current_slot] + mov eax, [eax + APPDATA.window] + add ebx, [eax + WDATA.box.top] + mov eax, [eax + WDATA.box.left] add eax, [temp.cx] and eax, 0xfff8 shl ebx, 9