Sync net branch with trunk

git-svn-id: svn://kolibrios.org@2540 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr
2012-04-02 15:18:46 +00:00
parent f28853c51d
commit dd88d5bff6
93 changed files with 5279 additions and 2893 deletions

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;********************************************************** ;**********************************************************

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
sys_cd_audio: sys_cd_audio:

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2011. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision: 2381 $ $Revision: 2381 $

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2011. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision: 2381 $ $Revision: 2381 $

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
iglobal iglobal

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;********************************************************** ;**********************************************************

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; Low-level driver for HDD access ; Low-level driver for HDD access
@@ -888,14 +888,14 @@ bd_write_cache_chain:
.writeerr: .writeerr:
popa popa
mov [hd_error], 1 mov [hd_error], 1
jmp hd_write_error jmp hd_write_error
uglobal uglobal
int13_regs_in rb sizeof.v86_regs int13_regs_in rb sizeof.v86_regs
int13_regs_out rb sizeof.v86_regs int13_regs_out rb sizeof.v86_regs
endg endg
int13_call: int13_call:
; Because this code uses fixed addresses, ; Because this code uses fixed addresses,
; it can not be run simultaniously by many threads. ; it can not be run simultaniously by many threads.
; In current implementation it is protected by common mutex 'hd1_status' ; In current implementation it is protected by common mutex 'hd1_status'
@@ -904,13 +904,13 @@ int13_call:
mov dword [OS_BASE + 514h], 9A000000h ; buffer 9A00:0000 mov dword [OS_BASE + 514h], 9A000000h ; buffer 9A00:0000
mov dword [OS_BASE + 518h], eax mov dword [OS_BASE + 518h], eax
and dword [OS_BASE + 51Ch], 0 and dword [OS_BASE + 51Ch], 0
push ebx ecx esi edi push ebx ecx esi edi
mov ebx, int13_regs_in mov ebx, int13_regs_in
mov edi, ebx mov edi, ebx
mov ecx, sizeof.v86_regs/4 mov ecx, sizeof.v86_regs/4
xor eax, eax xor eax, eax
rep stosd rep stosd
mov byte [ebx+v86_regs.eax+1], dl mov byte [ebx+v86_regs.eax+1], dl
mov eax, [hdpos] mov eax, [hdpos]
lea eax, [BiosDisksData+(eax-80h)*4] lea eax, [BiosDisksData+(eax-80h)*4]
mov dl, [eax] mov dl, [eax]

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -21,7 +21,7 @@
; ;
;************************************************************************** ;**************************************************************************
$Revision$ $Revision $
align 4 align 4

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; RAMDISK functions ;; ;; RAMDISK functions ;;
@@ -9,7 +9,7 @@
;; LFN support by diamond ;; ;; LFN support by diamond ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; calculate fat chain ; calculate fat chain

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
iglobal iglobal

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
@@ -11,7 +11,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;========================================================================== ;==========================================================================
@@ -274,7 +274,7 @@ sayerr:
push 0 push 0
pop es pop es
and word [es:0x9031], 0 and word [es:BOOT_IDE_BASE_ADDR], 0
; \begin{Mario79} ; \begin{Mario79}
; find HDD IDE DMA PCI device ; find HDD IDE DMA PCI device
; check for PCI BIOS ; check for PCI BIOS
@@ -311,7 +311,7 @@ sayerr:
int 0x1A int 0x1A
jc .nopci jc .nopci
and cx, 0xFFF0 ; clear address decode type and cx, 0xFFF0 ; clear address decode type
mov [es:0x9031], cx mov [es:BOOT_IDE_BASE_ADDR], cx
.nopci: .nopci:
; \end{Mario79} ; \end{Mario79}
@@ -343,15 +343,15 @@ wait_loop: ; variant 2
loopnz @b loopnz @b
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; --------------- APM --------------------- ; --------------- APM ---------------------
and word [es:0x9044], 0 ; ver = 0.0 (APM not found) and word [es:BOOT_APM_VERSION], 0 ; ver = 0.0 (APM not found)
mov ax, 0x5300 mov ax, 0x5300
xor bx, bx xor bx, bx
int 0x15 int 0x15
jc apm_end ; APM not found jc apm_end ; APM not found
test cx, 2 test cx, 2
jz apm_end ; APM 32-bit protected-mode interface not supported jz apm_end ; APM 32-bit protected-mode interface not supported
mov [es:0x9044], ax ; Save APM Version mov [es:BOOT_APM_VERSION], ax ; Save APM Version
mov [es:0x9046], cx ; Save APM flags mov [es:BOOT_APM_FLAGS], cx ; Save APM flags
; Write APM ver ---- ; Write APM ver ----
and ax, 0xf0f and ax, 0xf0f
@@ -370,10 +370,10 @@ wait_loop: ; variant 2
xor bx, bx xor bx, bx
int 0x15 int 0x15
mov [es:0x9040], ebx mov [es:BOOT_APM_ENTRY], ebx
mov [es:0x9050], ax mov [es:BOOT_APM_CODE_32], ax
mov [es:0x9052], cx mov [es:BOOT_APM_CODE_16], cx
mov [es:0x9054], dx mov [es:BOOT_APM_DATA_16], dx
apm_end: apm_end:
_setcursor d80x25_top_num, 0 _setcursor d80x25_top_num, 0
@@ -1151,7 +1151,7 @@ no_sys_on_floppy:
xor ax, ax xor ax, ax
mov es, ax mov es, ax
mov ax, [es:0x9008] ; vga & 320x200 mov ax, [es:BOOT_VESA_MODE] ; vga & 320x200
mov bx, ax mov bx, ax
cmp ax, 0x13 cmp ax, 0x13
je setgr je setgr

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -11,7 +11,7 @@
; ;
;====================================================================== ;======================================================================
$Revision$ $Revision $
d80x25_bottom: d80x25_bottom:

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;====================================================================== ;======================================================================
; ;

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;====================================================================== ;======================================================================
; ;

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;================================================================= ;=================================================================
; ;

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; boot data: common strings (for all languages) ; boot data: common strings (for all languages)
@@ -30,7 +30,7 @@ macro line_space {
db 186 db 186
} }
d80x25_top: d80x25_top:
line_full_top line_full_top
cur_line_pos = 75 cur_line_pos = 75
store byte ' ' at d80x25_top+cur_line_pos+1 store byte ' ' at d80x25_top+cur_line_pos+1
rev_var = __REV__ rev_var = __REV__
@@ -42,21 +42,21 @@ end while
store byte ' ' at d80x25_top+cur_line_pos store byte ' ' at d80x25_top+cur_line_pos
store dword ' SVN' at d80x25_top+cur_line_pos-4 store dword ' SVN' at d80x25_top+cur_line_pos-4
space_msg: line_space space_msg: line_space
verstr: verstr:
; line_space ; line_space
; version string ; version string
db 186,32 db 186,32
repeat 78 repeat 78
load a byte from version+%-1 load a byte from version+%-1
if a = 13 if a = 13
break break
end if end if
db a db a
end repeat end repeat
repeat 78 - ($-verstr) repeat 78 - ($-verstr)
db ' ' db ' '
end repeat end repeat
db 32,186 db 32,186
line_half line_half
d80x25_top_num = 4 d80x25_top_num = 4

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
struc VBE_VGAInfo { struc VBE_VGAInfo {
.VESASignature dd ? ; char .VESASignature dd ? ; char
@@ -215,7 +215,7 @@ calc_vmodes_table:
test [es:mi.ModeAttributes],10000000b ;LFB ? test [es:mi.ModeAttributes],10000000b ;LFB ?
jz @f jz @f
cmp [es:mi.BitsPerPixel], 24 ;It show only videomodes to have support 24 and 32 bpp cmp [es:mi.BitsPerPixel], 24 ;It show only videomodes to have support 24 and 32 bpp
jb @f jb @f
; cmp [es:mi.BitsPerPixel],16 ; cmp [es:mi.BitsPerPixel],16
@@ -240,11 +240,12 @@ calc_vmodes_table:
mov ax,[es:mi.ModeAttributes] mov ax,[es:mi.ModeAttributes]
mov [es:bx+4],ax ; +4[2] : attributes mov [es:bx+4],ax ; +4[2] : attributes
cmp [s_vesa.ver],'2' cmp [s_vesa.ver], '2'
jb .lp1 ; jb .lp1
jb @f ; We do not use Vesa 1.2 mode is now
or cx,0x4000 ; use LFB or cx, 0x4000 ; use LFB
.lp1: mov [es:bx+6],cx ; +6 : mode number .lp1: mov [es:bx+6],cx ; +6 : mode number
movzx ax,byte [es:mi.BitsPerPixel] movzx ax,byte [es:mi.BitsPerPixel]
mov word [es:bx+8],ax ; +8 : bits per pixel mov word [es:bx+8],ax ; +8 : bits per pixel
add bx,size_of_step ; size of record add bx,size_of_step ; size of record
@@ -379,7 +380,7 @@ check_first_parm:
.no_zero: .no_zero:
mov bp,word [number_vm] mov bp,word [number_vm]
cmp bp,word [es:si+6] cmp bp,word [es:si+6]
jz .ok_found_mode jz .ok_found_mode
mov ax,word [x_save] mov ax,word [x_save]
@@ -389,7 +390,7 @@ check_first_parm:
test ax,ax test ax,ax
jz .ok_found_mode jz .ok_found_mode
mov si,modes_table mov si,modes_table
; cmp ax,modes_table ; cmp ax,modes_table
; jb .zerro ;check on correct if bellow ; jb .zerro ;check on correct if bellow
; cmp ax,word [end_cursor] ; cmp ax,word [end_cursor]
@@ -415,7 +416,7 @@ check_first_parm:
@@: @@:
mov word [home_cursor],ax mov word [home_cursor],ax
mov si,[preboot_graph] mov si,[preboot_graph]
mov word [cursor_pos],si mov word [cursor_pos],si
push word [es:si] push word [es:si]
@@ -441,9 +442,9 @@ check_first_parm:
je .exit je .exit
jmp .loops jmp .loops
.ok: xor ax,ax .ok: xor ax,ax
ret ret
.exit: or ax,-1 .exit: or ax,-1
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@@ -542,7 +543,7 @@ draw_vmodes_table:
mov bp,long_v_table ;show rows mov bp,long_v_table ;show rows
.@@_next_bit: .@@_next_bit:
;clear cursor ;clear cursor
mov ax,' ' mov ax,' '
mov word[ds:_r1+21],ax mov word[ds:_r1+21],ax
mov word[ds:_r1+50],ax mov word[ds:_r1+50],ax
@@ -662,7 +663,7 @@ clear_vmodes_table:
mov cx,70 mov cx,70
add di,20 add di,20
dec bp dec bp
jns .loop_start jns .loop_start
pop es pop es
popa popa
ret ret
@@ -678,21 +679,21 @@ set_vmode:
mov ax,word [es:si+0] ; resolution X mov ax,word [es:si+0] ; resolution X
mov bx,word [es:si+2] ; resolution Y mov bx, word [es:si+2] ; resolution Y
mov word [es:0x900A],ax ; resolution X mov word [es:BOOT_X_RES], ax ; resolution X
mov word [es:0x900C],bx ; resolution Y mov word [es:BOOT_Y_RES], bx ; resolution Y
mov word [es:0x9008],cx ; number of mode mov word [es:BOOT_VESA_MODE], cx ; number of mode
cmp cx,0x12 cmp cx, 0x12
je .mode0x12_0x13 je .mode0x12_0x13
cmp cx,0x13 cmp cx,0x13
je .mode0x12_0x13 je .mode0x12_0x13
cmp byte [s_vesa.ver],'2' ; cmp byte [s_vesa.ver], '2'
jb .vesa12 ; jb .vesa12
; VESA 2 and Vesa 3 ; VESA 2 and Vesa 3
@@ -701,54 +702,48 @@ set_vmode:
mov di,mi;0xa000 mov di,mi;0xa000
int 0x10 int 0x10
; LFB ; LFB
mov eax,[es:mi.PhysBasePtr];di+0x28] mov eax, [es:mi.PhysBasePtr];di+0x28]
mov [es:0x9018],eax mov [es:BOOT_LFB], eax
; ---- vbe voodoo ; ---- vbe voodoo
BytesPerLine equ 0x10 BytesPerLine equ 0x10
mov ax, [es:di+BytesPerLine] mov ax, [es:di+BytesPerLine]
mov [es:0x9001], ax mov [es:BOOT_PITCH], ax
; BPP ; BPP
cmp [es:mi.BitsPerPixel],16 cmp [es:mi.BitsPerPixel], 16
jne .l0 jne .l0
cmp [es:mi.GreenMaskSize],5 cmp [es:mi.GreenMaskSize],5
jne .l0 jne .l0
mov [es:mi.BitsPerPixel],15 mov [es:mi.BitsPerPixel], 15
.l0: .l0:
mov al, byte [es:di+0x19] mov al, byte [es:di+0x19]
mov [es:0x9000], al mov [es:BOOT_BPP], al
jmp .exit jmp .exit
.mode0x12_0x13: .mode0x12_0x13:
mov byte [es:0x9000], 32 mov byte [es:BOOT_BPP], 32
or dword [es:0x9018], 0xFFFFFFFF; 0x800000 or dword [es:BOOT_LFB], 0xFFFFFFFF; 0x800000
; VESA 1.2 PM BANK SWITCH ADDRESS ; VESA 1.2 PM BANK SWITCH ADDRESS
.vesa12: ;.vesa12:
; mov ax, 0x4f0A
; xor bx, bx
mov ax,0x4f0A ; int 0x10
xor bx,bx ; xor eax, eax
int 0x10 ; xor ebx, ebx
xor eax,eax ; mov ax, es
xor ebx,ebx ; shl eax, 4
mov ax,es ; mov bx, di
shl eax,4 ; add eax, ebx
mov bx,di ; movzx ebx, word[es:di]
add eax,ebx ; add eax, ebx
movzx ebx,word[es:di] ; push 0x0000
add eax,ebx ; pop es
push 0x0000 ; mov [es:0x9014], eax
pop es
mov [es:0x9014],eax
.exit: .exit:
ret ret
; mov dword[es:0x9018],0x000A0000
; ret
;============================================================================= ;=============================================================================
;============================================================================= ;=============================================================================
;============================================================================= ;=============================================================================

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision$

View File

@@ -1,38 +1,38 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
display_modechg db 0 ; display mode change for text, yes/no (0 or 2) display_modechg db 0 ; display mode change for text, yes/no (0 or 2)
; ;
; !! Important note !! ; !! Important note !!
; ;
; Must be set to 2, to avoid two screenmode ; Must be set to 2, to avoid two screenmode
; changes within a very short period of time. ; changes within a very short period of time.
display_atboot db 0 ; show boot screen messages ( 2-no ) display_atboot db 0 ; show boot screen messages ( 2-no )
preboot_graph dw 0 ; graph mode preboot_graph dw 0 ; graph mode
x_save dw 0 ; x x_save dw 0 ; x
y_save dw 0 ; y y_save dw 0 ; y
number_vm dw 0 ; number_vm dw 0 ;
;pixel_save dw 0 ; per to pixel ;pixel_save dw 0 ; per to pixel
preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes) preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes)
preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no) preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no)
preboot_dma db 0 ; use DMA for access to HDD (1-always, 2-only for read, 3-never) preboot_dma db 0 ; use DMA for access to HDD (1-always, 2-only for read, 3-never)
preboot_device db 0 ; boot device preboot_device db 0 ; boot device
; (1-floppy 2-harddisk 3-kernel restart 4-format ram disk) ; (1-floppy 2-harddisk 3-kernel restart 4-format ram disk)
;!!!! 0 - autodetect !!!! ;!!!! 0 - autodetect !!!!
preboot_blogesc = 0 ; start immediately after bootlog preboot_blogesc = 0 ; start immediately after bootlog
preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no) preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no)
if $>0x200 if $>0x200
ERROR: prebooting parameters must fit in first sector!!! ERROR: prebooting parameters must fit in first sector!!!
end if end if
hdsysimage db 'KOLIBRI IMG' ; load from hdsysimage db 'KOLIBRI IMG' ; load from
image_save db 'KOLIBRI IMG' ; save to image_save db 'KOLIBRI IMG' ; save to

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; READ RAMDISK IMAGE FROM HD ; READ RAMDISK IMAGE FROM HD
@@ -108,17 +108,17 @@ no_sys_on_hd:
mov edi, RAMDISK mov edi, RAMDISK
mov ecx, 0x1080 mov ecx, 0x1080
xor eax,eax xor eax,eax
@@: @@:
stosd stosd
loop @b loop @b
mov ecx, 0x58F7F mov ecx, 0x58F7F
mov eax,0xF6F6F6F6 mov eax,0xF6F6F6F6
@@: @@:
stosd stosd
loop @b loop @b
mov [RAMDISK+0x200],dword 0xFFFFF0 ; fat table mov [RAMDISK+0x200],dword 0xFFFFF0 ; fat table
mov [RAMDISK+0x4200],dword 0xFFFFF0 mov [RAMDISK+0x4200],dword 0xFFFFF0
not_format_ram_disk: not_format_ram_disk:

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision$

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Shutdown for Menuet ;; ;; Shutdown for Menuet ;;
@@ -11,7 +11,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
align 4 align 4

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) 2010 KolibriOS team. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2010-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; ;; ;; ;;
;; PCIe.INC ;; ;; PCIe.INC ;;
;; ;; ;; ;;
;; Extended PCI express services ;; ;; Extended PCI express services ;;

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; PCI16.INC ;; ;; PCI16.INC ;;
@@ -15,7 +15,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
init_pci_16: init_pci_16:

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; ;; ;; ;;
@@ -21,7 +21,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;*************************************************************************** ;***************************************************************************
; Function ; Function

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
dpl0 equ 10010000b ; data read dpl0 dpl0 equ 10010000b ; data read dpl0
@@ -176,12 +176,12 @@ struct TSS
_io rw 1 _io rw 1
rb 24 rb 24
_io_map_0 rb 4096 _io_map_0 rb 4096
_io_map_1 rb 4096 _io_map_1 rb 4096
ends ends
OS_BASE equ 0x80000000 OS_BASE equ 0x80000000
window_data equ (OS_BASE+0x0001000) window_data equ (OS_BASE+0x0001000)
CURRENT_TASK equ (OS_BASE+0x0003000) CURRENT_TASK equ (OS_BASE+0x0003000)
TASK_COUNT equ (OS_BASE+0x0003004) TASK_COUNT equ (OS_BASE+0x0003004)
@@ -210,7 +210,7 @@ BANK_SWITCH equ (OS_BASE+0x000E030)
;unused ? store mousepointer ;unused ? store mousepointer
MOUSE_PICTURE equ (OS_BASE+0x000F200) MOUSE_PICTURE equ (OS_BASE+0x000F200)
MOUSE_VISIBLE equ (OS_BASE+0x000F204) ;MOUSE_VISIBLE equ (OS_BASE+0x000F204)
WIN_TEMP_XY equ (OS_BASE+0x000F300) WIN_TEMP_XY equ (OS_BASE+0x000F300)
KEY_COUNT equ (OS_BASE+0x000F400) KEY_COUNT equ (OS_BASE+0x000F400)
KEY_BUFF equ (OS_BASE+0x000F401) KEY_BUFF equ (OS_BASE+0x000F401)
@@ -255,7 +255,7 @@ SYS_SHUTDOWN equ (OS_BASE+0x000FF00)
TASK_ACTIVATE equ (OS_BASE+0x000FF01) TASK_ACTIVATE equ (OS_BASE+0x000FF01)
REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0) REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0)
BACKGROUND_CHANGED equ (OS_BASE+0x000FFF1)
BANK_RW equ (OS_BASE+0x000FFF2) BANK_RW equ (OS_BASE+0x000FFF2)
MOUSE_BACKGROUND equ (OS_BASE+0x000FFF4) MOUSE_BACKGROUND equ (OS_BASE+0x000FFF4)
DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5) DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5)
@@ -289,7 +289,11 @@ BgrAuxTable equ (OS_BASE+0x0298000)
SB16Buffer equ (OS_BASE+0x02A0000) SB16Buffer equ (OS_BASE+0x02A0000)
SB16_Status equ (OS_BASE+0x02B0000) SB16_Status equ (OS_BASE+0x02B0000)
BUTTON_INFO equ (OS_BASE+0x02C0000) BUTTON_INFO equ (OS_BASE+0x02B3FEE)
BPSLine_calc_area equ (OS_BASE+0x02C4000)
d_width_calc_area equ (OS_BASE+0x02CA000)
RESERVED_PORTS equ (OS_BASE+0x02D0000) RESERVED_PORTS equ (OS_BASE+0x02D0000)
BOOT_VAR equ (OS_BASE+0x02E0000) BOOT_VAR equ (OS_BASE+0x02E0000)
@@ -362,22 +366,30 @@ PG_SHARED equ 0x200
;;;;;;;;;;;boot time variables ;;;;;;;;;;;boot time variables
;BOOT_BPP equ 0x9000 ;byte bits per pixel BOOT_BPP equ 0x9000 ;byte bits per pixel
BOOT_SCANLINE equ 0x9001 ;word scanline length BOOT_PITCH equ 0x9001 ;word scanline length
BOOT_VESA_MODE equ 0x9008 ;word vesa video mode BOOT_VESA_MODE equ 0x9008 ;word vesa video mode
;;BOOT_X_RES equ 0x900A ;word X res BOOT_X_RES equ 0x900A ;word X res
;;BOOT_Y_RES equ 0x900C ;word Y res BOOT_Y_RES equ 0x900C ;word Y res
;;BOOT_MOUSE_PORT equ 0x9010 ;byte mouse port - not used ;;BOOT_MOUSE_PORT equ 0x9010 ;byte mouse port - not used
BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch
BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address
BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration
BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display) BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display)
BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled ;BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled
BOOT_DMA equ 0x901F ;
BOOT_PCI_DATA equ 0x9020 ;8bytes pci data BOOT_PCI_DATA equ 0x9020 ;8bytes pci data
BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no
BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr
BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount
BOOT_APM_ENTRY equ 0x9040
BOOT_APM_VERSION equ 0x9044
BOOT_APM_FLAGS equ 0x9046 ;unused
BOOT_APM_CODE_32 equ 0x9050
BOOT_APM_CODE_16 equ 0x9052
BOOT_APM_DATA_16 equ 0x9054
TMP_FILE_NAME equ 0 TMP_FILE_NAME equ 0
TMP_CMD_LINE equ 1024 TMP_CMD_LINE equ 1024
TMP_ICON_OFFS equ 1280 TMP_ICON_OFFS equ 1280
@@ -392,259 +404,262 @@ EVENT_IPC equ 0x00000040
EVENT_NETWORK equ 0x00000080 EVENT_NETWORK equ 0x00000080
EVENT_DEBUG equ 0x00000100 EVENT_DEBUG equ 0x00000100
EVENT_EXTENDED equ 0x00000200 EVENT_EXTENDED equ 0x00000200
EV_INTR equ 1 EV_INTR equ 1
struct THR_DATA struct THR_DATA
rb (8192-512) rb (8192-512)
; pl0_stack ; pl0_stack
fpu_state rb 512 fpu_state rb 512
tls_page rb 4096 tls_page rb 4096
pdbr rb 4096 pdbr rb 4096
ends ends
virtual at (OS_BASE-sizeof.THR_DATA) virtual at (OS_BASE-sizeof.THR_DATA)
thr_data THR_DATA thr_data THR_DATA
end virtual end virtual
struct SYS_VARS struct SYS_VARS
bpp dd ? bpp dd ?
scanline dd ? scanline dd ?
vesa_mode dd ? vesa_mode dd ?
x_res dd ? x_res dd ?
y_res dd ? y_res dd ?
ends ends
struct APPOBJ ; common object header struct APPOBJ ; common object header
magic dd ? ; magic dd ? ;
destroy dd ? ; internal destructor destroy dd ? ; internal destructor
fd dd ? ; next object in list fd dd ? ; next object in list
bk dd ? ; prev object in list bk dd ? ; prev object in list
pid dd ? ; owner id pid dd ? ; owner id
ends ends
APP_OBJ_OFFSET equ 48 APP_OBJ_OFFSET equ 48
APP_EV_OFFSET equ 40 APP_EV_OFFSET equ 40
struct CURSOR APPOBJ struct CURSOR APPOBJ
base dd ? ;allocated memory base dd ? ;allocated memory
hot_x dd ? ;hotspot coords hot_x dd ? ;hotspot coords
hot_y dd ? hot_y dd ?
list_next dd ? ;next cursor in cursor list list_next dd ? ;next cursor in cursor list
list_prev dd ? ;prev cursor in cursor list list_prev dd ? ;prev cursor in cursor list
dev_obj dd ? ;device depended data dev_obj dd ? ;device depended data
ends ends
struct EVENT APPOBJ struct EVENT APPOBJ
id dd ? ;event uid id dd ? ;event uid
state dd ? ;internal flags state dd ? ;internal flags
code dd ? code dd ?
rd 5 rd 5
ends ends
struct SMEM struct SMEM
bk dd ? bk dd ?
fd dd ? ;+4 fd dd ? ;+4
base dd ? ;+8 base dd ? ;+8
size dd ? ;+12 size dd ? ;+12
access dd ? ;+16 access dd ? ;+16
refcount dd ? ;+20 refcount dd ? ;+20
name rb 32 ;+24 name rb 32 ;+24
ends ends
struct SMAP APPOBJ struct SMAP APPOBJ
base dd ? ;mapped base base dd ? ;mapped base
parent dd ? ;SMEM parent dd ? ;SMEM
ends ends
struct DLLDESCR struct DLLDESCR
bk dd ? bk dd ?
fd dd ? ;+4 fd dd ? ;+4
data dd ? ;+8 data dd ? ;+8
size dd ? ;+12 size dd ? ;+12
timestamp dq ? timestamp dq ?
refcount dd ? refcount dd ?
defaultbase dd ? defaultbase dd ?
coff_hdr dd ? coff_hdr dd ?
symbols_ptr dd ? symbols_ptr dd ?
symbols_num dd ? symbols_num dd ?
symbols_lim dd ? symbols_lim dd ?
exports dd ? ;export table exports dd ? ;export table
name rb 260 name rb 260
ends ends
struct HDLL struct HDLL
fd dd ? ;next object in list fd dd ? ;next object in list
bk dd ? ;prev object in list bk dd ? ;prev object in list
pid dd ? ;owner id pid dd ? ;owner id
base dd ? ;mapped base base dd ? ;mapped base
size dd ? ;mapped size size dd ? ;mapped size
refcount dd ? ;reference counter for this process and this lib refcount dd ? ;reference counter for this process and this lib
parent dd ? ;DLLDESCR parent dd ? ;DLLDESCR
ends ends
struct display_t struct display_t
x dd ? x dd ?
y dd ? y dd ?
width dd ? width dd ?
height dd ? height dd ?
bpp dd ? bpp dd ?
vrefresh dd ? vrefresh dd ?
pitch dd ? pitch dd ?
lfb dd ? lfb dd ?
modes dd ? modes dd ?
ddev dd ? ddev dd ?
connector dd ? connector dd ?
crtc dd ? crtc dd ?
cr_list.next dd ? cr_list.next dd ?
cr_list.prev dd ? cr_list.prev dd ?
cursor dd ? cursor dd ?
init_cursor dd ? init_cursor dd ?
select_cursor dd ? select_cursor dd ?
show_cursor dd ? show_cursor dd ?
move_cursor dd ? move_cursor dd ?
restore_cursor dd ? restore_cursor dd ?
disable_mouse dd ? disable_mouse dd ?
ends mask_seqno dd ?
check_mouse dd ?
struct BOOT_DATA check_m_pixel dd ?
bpp dd ? ends
scanline dd ?
vesa_mode dd ? struct BOOT_DATA
x_res dd ? bpp dd ?
y_res dd ? scanline dd ?
mouse_port dd ? vesa_mode dd ?
bank_switch dd ? x_res dd ?
lfb dd ? y_res dd ?
vesa_mem dd ? mouse_port dd ?
log dd ? bank_switch dd ?
direct_lfb dd ? lfb dd ?
pci_data dd ? vesa_mem dd ?
dd ? log dd ?
vrr dd ? direct_lfb dd ?
ide_base dd ? pci_data dd ?
mem_amount dd ? dd ?
pages_count dd ? vrr dd ?
pagemap_size dd ? ide_base dd ?
kernel_max dd ? mem_amount dd ?
kernel_pages dd ? pages_count dd ?
kernel_tables dd ? pagemap_size dd ?
kernel_max dd ?
cpu_vendor dd ? kernel_pages dd ?
dd ? kernel_tables dd ?
dd ?
cpu_sign dd ? cpu_vendor dd ?
cpu_info dd ? dd ?
cpu_caps dd ? dd ?
dd ? cpu_sign dd ?
dd ? cpu_info dd ?
ends cpu_caps dd ?
dd ?
struct LHEAD dd ?
next dd ? ;next object in list ends
prev dd ? ;prev object in list
ends struct LHEAD
next dd ? ;next object in list
struct MUTEX prev dd ? ;prev object in list
lhead LHEAD ends
count dd ?
ends struct MUTEX
lhead LHEAD
struct MEM_STATE count dd ?
mutex MUTEX ends
smallmap dd ?
treemap dd ? struct MEM_STATE
topsize dd ? mutex MUTEX
top dd ? smallmap dd ?
smallbins rd 4*32 treemap dd ?
treebins rd 32 topsize dd ?
ends top dd ?
smallbins rd 4*32
struct PG_DATA treebins rd 32
mem_amount dd ? ends
vesa_mem dd ?
pages_count dd ? struct PG_DATA
pages_free dd ? mem_amount dd ?
pages_faults dd ? vesa_mem dd ?
pagemap_size dd ? pages_count dd ?
kernel_pages dd ? pages_free dd ?
kernel_tables dd ? pages_faults dd ?
sys_page_dir dd ? pagemap_size dd ?
mutex MUTEX kernel_pages dd ?
ends kernel_tables dd ?
sys_page_dir dd ?
struct SRV mutex MUTEX
srv_name rb 16 ;ASCIIZ string ends
magic dd ? ;+0x10 ;'SRV '
size dd ? ;+0x14 ;size of structure SRV struct SRV
fd dd ? ;+0x18 ;next SRV descriptor srv_name rb 16 ;ASCIIZ string
bk dd ? ;+0x1C ;prev SRV descriptor magic dd ? ;+0x10 ;'SRV '
base dd ? ;+0x20 ;service base address size dd ? ;+0x14 ;size of structure SRV
entry dd ? ;+0x24 ;service START function fd dd ? ;+0x18 ;next SRV descriptor
srv_proc dd ? ;+0x28 ;user mode service handler bk dd ? ;+0x1C ;prev SRV descriptor
srv_proc_ex dd ? ;+0x2C ;kernel mode service handler base dd ? ;+0x20 ;service base address
ends entry dd ? ;+0x24 ;service START function
srv_proc dd ? ;+0x28 ;user mode service handler
DRV_ENTRY equ 1 srv_proc_ex dd ? ;+0x2C ;kernel mode service handler
DRV_EXIT equ -1 ends
struct COFF_HEADER DRV_ENTRY equ 1
machine dw ? DRV_EXIT equ -1
nSections dw ?
DataTime dd ? struct COFF_HEADER
pSymTable dd ? machine dw ?
nSymbols dd ? nSections dw ?
optHeader dw ? DataTime dd ?
flags dw ? pSymTable dd ?
ends nSymbols dd ?
optHeader dw ?
struct COFF_SECTION flags dw ?
Name rb 8 ends
VirtualSize dd ?
VirtualAddress dd ? struct COFF_SECTION
SizeOfRawData dd ? Name rb 8
PtrRawData dd ? VirtualSize dd ?
PtrReloc dd ? VirtualAddress dd ?
PtrLinenumbers dd ? SizeOfRawData dd ?
NumReloc dw ? PtrRawData dd ?
NumLinenum dw ? PtrReloc dd ?
Characteristics dd ? PtrLinenumbers dd ?
ends NumReloc dw ?
NumLinenum dw ?
struct COFF_RELOC Characteristics dd ?
VirtualAddress dd ? ends
SymIndex dd ?
Type dw ? struct COFF_RELOC
ends VirtualAddress dd ?
SymIndex dd ?
struct COFF_SYM Type dw ?
Name rb 8 ends
Value dd ?
SectionNumber dw ? struct COFF_SYM
Type dw ? Name rb 8
StorageClass db ? Value dd ?
NumAuxSymbols db ? SectionNumber dw ?
ends Type dw ?
StorageClass db ?
struct IOCTL NumAuxSymbols db ?
handle dd ? ends
io_code dd ?
input dd ? struct IOCTL
inp_size dd ? handle dd ?
output dd ? io_code dd ?
out_size dd ? input dd ?
ends inp_size dd ?
output dd ?
struct IRQH out_size dd ?
list LHEAD ends
handler dd ? ;handler roututine
data dd ? ;user-specific data struct IRQH
ends list LHEAD
handler dd ? ;handler roututine
data dd ? ;user-specific data
ends

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
iglobal iglobal
@@ -58,13 +58,13 @@ APIC_init:
mov [acpi_dev_data], eax mov [acpi_dev_data], eax
mov [acpi_dev_size], ebx mov [acpi_dev_size], ebx
call IRQ_mask_all call IRQ_mask_all
; IOAPIC init ; IOAPIC init
stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW+PG_NOCACHE
mov [IOAPIC_base], eax mov [IOAPIC_base], eax
mov eax, IOAPIC_VER mov eax, IOAPIC_VER
call IOAPIC_read call IOAPIC_read
shr eax, 16 shr eax, 16
inc al inc al
@@ -118,20 +118,17 @@ APIC_init:
ret ret
;=========================================================== ;===========================================================
align 4 align 4
LAPIC_init: LAPIC_init:
; Check MSR support
;.... cmp [LAPIC_BASE], 0
; Get LAPIC base address jne .done
; mov ecx, 0x1b
; rdmsr ; it may be replaced to stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW+PG_NOCACHE
; and ax, 0xf000 ; mov eax, 0xfee00000 mov [LAPIC_BASE], eax
mov esi, eax
stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW
mov [LAPIC_BASE], eax
mov esi, eax
; Program Destination Format Register for Flat mode. ; Program Destination Format Register for Flat mode.
mov eax, [esi + APIC_DFR] mov eax, [esi + APIC_DFR]
or eax, 0xf0000000 or eax, 0xf0000000
@@ -197,12 +194,14 @@ LAPIC_init:
xor eax, 0xffffffff ; eax = 0xffffffff - eax xor eax, 0xffffffff ; eax = 0xffffffff - eax
shr eax, 6 ; eax /= 64; APIC ticks per 0.01 sec shr eax, 6 ; eax /= 64; APIC ticks per 0.01 sec
; Start (every 0.01 sec) ; Start (every 0.01 sec)
mov dword[esi + APIC_LVT_timer], 0x30020; periodic int 0x20 mov dword[esi + APIC_LVT_timer], 0x30020; periodic int 0x20
mov dword[esi + APIC_timer_init], eax mov dword[esi + APIC_timer_init], eax
ret
.done:
;=========================================================== ret
;===========================================================
; IOAPIC implementation ; IOAPIC implementation
align 4 align 4
IOAPIC_read: IOAPIC_read:

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -10,7 +10,7 @@
; {SPraid.simba} ; {SPraid.simba}
;------------------------------------------------------------------------- ;-------------------------------------------------------------------------
$Revision$ $Revision $
iglobal iglobal
conf_path_sect: conf_path_sect:

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; diamond, 2006 ; diamond, 2006

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
DRV_COMPAT equ 5 ;minimal required drivers version DRV_COMPAT equ 5 ;minimal required drivers version
@@ -136,13 +136,13 @@ proc srv_handler stdcall, ioctl:dword
jz .err jz .err
mov edi, [esi+handle] mov edi, [esi+handle]
cmp [edi+SRV.magic], ' SRV' cmp [edi+SRV.magic], ' SRV'
jne .fail jne .fail
cmp [edi+SRV.size], sizeof.SRV cmp [edi+SRV.size], sizeof.SRV
jne .fail jne .fail
stdcall [edi+SRV.srv_proc], esi stdcall [edi+SRV.srv_proc], esi
ret ret
.fail: .fail:
xor eax, eax xor eax, eax
@@ -168,13 +168,13 @@ srv_handlerEx:
jae .fail jae .fail
mov eax, [ecx+handle] mov eax, [ecx+handle]
cmp [eax+SRV.magic], ' SRV' cmp [eax+SRV.magic], ' SRV'
jne .fail jne .fail
cmp [eax+SRV.size], sizeof.SRV cmp [eax+SRV.size], sizeof.SRV
jne .fail jne .fail
stdcall [eax+SRV.srv_proc], ecx stdcall [eax+SRV.srv_proc], ecx
ret ret
.fail: .fail:
or eax, -1 or eax, -1
@@ -193,13 +193,13 @@ proc get_service stdcall, sz_name:dword
test eax, eax test eax, eax
jnz @F jnz @F
ret ret
@@: @@:
mov edx, [srv.fd] mov edx, [srv.fd]
@@: @@:
cmp edx, srv.fd-SRV.fd cmp edx, srv.fd-SRV.fd
je .not_load je .not_load
stdcall strncmp, edx, [sz_name], 16 stdcall strncmp, edx, [sz_name], 16
test eax, eax test eax, eax
je .ok je .ok
@@ -223,13 +223,13 @@ proc reg_service stdcall, name:dword, handler:dword
cmp [name], eax cmp [name], eax
je .fail je .fail
cmp [handler], eax cmp [handler], eax
je .fail je .fail
mov eax, sizeof.SRV mov eax, sizeof.SRV
call malloc call malloc
test eax, eax test eax, eax
jz .fail jz .fail
push esi push esi
push edi push edi
@@ -240,15 +240,15 @@ proc reg_service stdcall, name:dword, handler:dword
movsd movsd
movsd movsd
pop edi pop edi
pop esi pop esi
mov [eax+SRV.magic], ' SRV' mov [eax+SRV.magic], ' SRV'
mov [eax+SRV.size], sizeof.SRV mov [eax+SRV.size], sizeof.SRV
mov ebx, srv.fd-SRV.fd mov ebx, srv.fd-SRV.fd
mov edx, [ebx+SRV.fd] mov edx, [ebx+SRV.fd]
mov [eax+SRV.fd], edx mov [eax+SRV.fd], edx
mov [eax+SRV.bk], ebx mov [eax+SRV.bk], ebx
mov [ebx+SRV.fd], eax mov [ebx+SRV.fd], eax
mov [edx+SRV.bk], eax mov [edx+SRV.bk], eax
@@ -437,10 +437,19 @@ proc load_file stdcall, file_name:dword
jz .cleanup jz .cleanup
mov [file2], eax mov [file2], eax
pushfd
cli pushad
mov ecx, unpack_mutex
call mutex_lock
popad
stdcall unpack, [file], eax stdcall unpack, [file], eax
popfd
pushad
mov ecx, unpack_mutex
call mutex_unlock
popad
stdcall kernel_free, [file] stdcall kernel_free, [file]
mov eax, [file2] mov eax, [file2]
mov ebx, [file_size] mov ebx, [file_size]
@@ -470,6 +479,11 @@ proc load_file stdcall, file_name:dword
ret ret
endp endp
uglobal
align 4
unpack_mutex MUTEX
endg
align 4 align 4
proc get_proc_ex stdcall, proc_name:dword, imports:dword proc get_proc_ex stdcall, proc_name:dword, imports:dword
@@ -511,16 +525,16 @@ proc fix_coff_symbols stdcall uses ebx esi, sec:dword, symbols:dword,\
retval dd ? retval dd ?
endl endl
mov edi, [symbols] mov edi, [symbols]
mov [retval], 1 mov [retval], 1
.fix: .fix:
movzx ebx, [edi+COFF_SYM.SectionNumber] movzx ebx, [edi+COFF_SYM.SectionNumber]
test ebx, ebx test ebx, ebx
jnz .internal jnz .internal
mov eax, dword [edi+COFF_SYM.Name] mov eax, dword [edi+COFF_SYM.Name]
test eax, eax test eax, eax
jnz @F jnz @F
mov edi, [edi+4] mov edi, [edi+4]
add edi, [strings] add edi, [strings]
@@: @@:
@@ -539,29 +553,29 @@ proc fix_coff_symbols stdcall uses ebx esi, sec:dword, symbols:dword,\
mov esi, msg_CR mov esi, msg_CR
call sys_msg_board_str call sys_msg_board_str
mov [retval], 0 mov [retval], 0
@@: @@:
mov edi, [symbols] mov edi, [symbols]
mov [edi+COFF_SYM.Value], eax mov [edi+COFF_SYM.Value], eax
jmp .next jmp .next
.internal: .internal:
cmp bx, -1 cmp bx, -1
je .next je .next
cmp bx, -2 cmp bx, -2
je .next je .next
dec ebx dec ebx
shl ebx, 3 shl ebx, 3
lea ebx, [ebx+ebx*4] lea ebx, [ebx+ebx*4]
add ebx, [sec] add ebx, [sec]
mov eax, [ebx+COFF_SECTION.VirtualAddress] mov eax, [ebx+COFF_SECTION.VirtualAddress]
add [edi+COFF_SYM.Value], eax add [edi+COFF_SYM.Value], eax
.next: .next:
add edi, sizeof.COFF_SYM add edi, sizeof.COFF_SYM
mov [symbols], edi mov [symbols], edi
dec [sym_count] dec [sym_count]
jnz .fix jnz .fix
mov eax, [retval] mov eax, [retval]
ret ret
endp endp
@@ -571,53 +585,53 @@ proc fix_coff_relocs stdcall uses ebx esi, coff:dword, sym:dword, \
delta:dword delta:dword
locals locals
n_sec dd ? n_sec dd ?
endl endl
mov eax, [coff] mov eax, [coff]
movzx ebx, [eax+COFF_HEADER.nSections] movzx ebx, [eax+COFF_HEADER.nSections]
mov [n_sec], ebx mov [n_sec], ebx
lea esi, [eax+20] lea esi, [eax+20]
.fix_sec: .fix_sec:
mov edi, [esi+COFF_SECTION.PtrReloc] mov edi, [esi+COFF_SECTION.PtrReloc]
add edi, [coff] add edi, [coff]
movzx ecx, [esi+COFF_SECTION.NumReloc] movzx ecx, [esi+COFF_SECTION.NumReloc]
test ecx, ecx test ecx, ecx
jz .next jz .next
.reloc_loop: .reloc_loop:
mov ebx, [edi+COFF_RELOC.SymIndex] mov ebx, [edi+COFF_RELOC.SymIndex]
add ebx, ebx add ebx, ebx
lea ebx, [ebx+ebx*8] lea ebx, [ebx+ebx*8]
add ebx, [sym] add ebx, [sym]
mov edx, [ebx+COFF_SYM.Value] mov edx, [ebx+COFF_SYM.Value]
cmp [edi+COFF_RELOC.Type], 6 cmp [edi+COFF_RELOC.Type], 6
je .dir_32 je .dir_32
cmp [edi+COFF_RELOC.Type], 20 cmp [edi+COFF_RELOC.Type], 20
jne .next_reloc jne .next_reloc
.rel_32: .rel_32:
mov eax, [edi+COFF_RELOC.VirtualAddress] mov eax, [edi+COFF_RELOC.VirtualAddress]
add eax, [esi+COFF_SECTION.VirtualAddress] add eax, [esi+COFF_SECTION.VirtualAddress]
sub edx, eax sub edx, eax
sub edx, 4 sub edx, 4
jmp .fix jmp .fix
.dir_32: .dir_32:
mov eax, [edi+COFF_RELOC.VirtualAddress] mov eax, [edi+COFF_RELOC.VirtualAddress]
add eax, [esi+COFF_SECTION.VirtualAddress] add eax, [esi+COFF_SECTION.VirtualAddress]
.fix: .fix:
add eax, [delta] add eax, [delta]
add [eax], edx add [eax], edx
.next_reloc: .next_reloc:
add edi, 10 add edi, 10
dec ecx dec ecx
jnz .reloc_loop jnz .reloc_loop
.next: .next:
add esi, sizeof.COFF_SECTION add esi, sizeof.COFF_SECTION
dec [n_sec] dec [n_sec]
jnz .fix_sec jnz .fix_sec
.exit: .exit:
ret ret
endp endp
@@ -626,36 +640,36 @@ proc rebase_coff stdcall uses ebx esi, coff:dword, sym:dword, \
delta:dword delta:dword
locals locals
n_sec dd ? n_sec dd ?
endl endl
mov eax, [coff] mov eax, [coff]
movzx ebx, [eax+COFF_HEADER.nSections] movzx ebx, [eax+COFF_HEADER.nSections]
mov [n_sec], ebx mov [n_sec], ebx
lea esi, [eax+20] lea esi, [eax+20]
mov edx, [delta] mov edx, [delta]
.fix_sec: .fix_sec:
mov edi, [esi+COFF_SECTION.PtrReloc] mov edi, [esi+COFF_SECTION.PtrReloc]
add edi, [coff] add edi, [coff]
movzx ecx, [esi+COFF_SECTION.NumReloc] movzx ecx, [esi+COFF_SECTION.NumReloc]
test ecx, ecx test ecx, ecx
jz .next jz .next
.reloc_loop: .reloc_loop:
cmp [edi+COFF_RELOC.Type], 6 cmp [edi+COFF_RELOC.Type], 6
jne .next_reloc jne .next_reloc
.dir_32: .dir_32:
mov eax, [edi+COFF_RELOC.VirtualAddress] mov eax, [edi+COFF_RELOC.VirtualAddress]
add eax, [esi+COFF_SECTION.VirtualAddress] add eax, [esi+COFF_SECTION.VirtualAddress]
add [eax+edx], edx add [eax+edx], edx
.next_reloc: .next_reloc:
add edi, 10 add edi, 10
dec ecx dec ecx
jnz .reloc_loop jnz .reloc_loop
.next: .next:
add esi, sizeof.COFF_SECTION add esi, sizeof.COFF_SECTION
dec [n_sec] dec [n_sec]
jnz .fix_sec jnz .fix_sec
.exit: .exit:
ret ret
endp endp
@@ -697,21 +711,21 @@ proc load_driver stdcall, driver_name:dword
test eax, eax test eax, eax
jz .exit jz .exit
mov [coff], eax mov [coff], eax
movzx ecx, [eax+COFF_HEADER.nSections] movzx ecx, [eax+COFF_HEADER.nSections]
xor ebx, ebx xor ebx, ebx
lea edx, [eax+20] lea edx, [eax+20]
@@: @@:
add ebx, [edx+COFF_SECTION.SizeOfRawData] add ebx, [edx+COFF_SECTION.SizeOfRawData]
add ebx, 15 add ebx, 15
and ebx, not 15 and ebx, not 15
add edx, sizeof.COFF_SECTION add edx, sizeof.COFF_SECTION
dec ecx dec ecx
jnz @B jnz @B
mov [img_size], ebx mov [img_size], ebx
stdcall kernel_alloc, ebx stdcall kernel_alloc, ebx
test eax, eax test eax, eax
@@ -725,70 +739,70 @@ proc load_driver stdcall, driver_name:dword
and ecx, not 4095 and ecx, not 4095
shr ecx, 2 shr ecx, 2
cld cld
rep stosd rep stosd
mov edx, [coff] mov edx, [coff]
movzx ebx, [edx+COFF_HEADER.nSections] movzx ebx, [edx+COFF_HEADER.nSections]
mov edi, [img_base] mov edi, [img_base]
lea eax, [edx+20] lea eax, [edx+20]
@@: @@:
mov [eax+COFF_SECTION.VirtualAddress], edi mov [eax+COFF_SECTION.VirtualAddress], edi
mov esi, [eax+COFF_SECTION.PtrRawData] mov esi, [eax+COFF_SECTION.PtrRawData]
test esi, esi test esi, esi
jnz .copy jnz .copy
add edi, [eax+COFF_SECTION.SizeOfRawData] add edi, [eax+COFF_SECTION.SizeOfRawData]
jmp .next jmp .next
.copy: .copy:
add esi, edx add esi, edx
mov ecx, [eax+COFF_SECTION.SizeOfRawData] mov ecx, [eax+COFF_SECTION.SizeOfRawData]
cld cld
rep movsb rep movsb
.next: .next:
add edi, 15 add edi, 15
and edi, not 15 and edi, not 15
add eax, sizeof.COFF_SECTION add eax, sizeof.COFF_SECTION
dec ebx dec ebx
jnz @B jnz @B
mov ebx, [edx+COFF_HEADER.pSymTable] mov ebx, [edx+COFF_HEADER.pSymTable]
add ebx, edx add ebx, edx
mov [sym], ebx mov [sym], ebx
mov ecx, [edx+COFF_HEADER.nSymbols] mov ecx, [edx+COFF_HEADER.nSymbols]
add ecx, ecx add ecx, ecx
lea ecx, [ecx+ecx*8];ecx*=18 = nSymbols*CSYM_SIZE lea ecx, [ecx+ecx*8];ecx*=18 = nSymbols*CSYM_SIZE
add ecx, [sym] add ecx, [sym]
mov [strings], ecx mov [strings], ecx
lea ebx, [exports] lea ebx, [exports]
mov dword [ebx], kernel_export mov dword [ebx], kernel_export
mov dword [ebx+4], 0 mov dword [ebx+4], 0
lea eax, [edx+20] lea eax, [edx+20]
stdcall fix_coff_symbols, eax, [sym], [edx+COFF_HEADER.nSymbols], \ stdcall fix_coff_symbols, eax, [sym], [edx+COFF_HEADER.nSymbols], \
[strings], ebx [strings], ebx
test eax, eax test eax, eax
jz .link_fail jz .link_fail
mov ebx, [coff]
stdcall fix_coff_relocs, ebx, [sym], 0
stdcall get_coff_sym, [sym], [ebx+COFF_HEADER.nSymbols], szVersion
test eax, eax
jz .link_fail
mov ebx, [coff]
stdcall fix_coff_relocs, ebx, [sym], 0
stdcall get_coff_sym, [sym], [ebx+COFF_HEADER.nSymbols], szVersion
test eax, eax
jz .link_fail
mov eax, [eax] mov eax, [eax]
shr eax, 16 shr eax, 16
cmp eax, DRV_COMPAT cmp eax, DRV_COMPAT
jb .ver_fail jb .ver_fail
cmp eax, DRV_CURRENT cmp eax, DRV_CURRENT
ja .ver_fail ja .ver_fail
mov ebx, [coff] mov ebx, [coff]
stdcall get_coff_sym, [sym], [ebx+COFF_HEADER.nSymbols], szSTART stdcall get_coff_sym, [sym], [ebx+COFF_HEADER.nSymbols], szSTART
mov [start], eax mov [start], eax
stdcall kernel_free, [coff] stdcall kernel_free, [coff]
mov ebx, [start] mov ebx, [start]
stdcall ebx, DRV_ENTRY stdcall ebx, DRV_ENTRY
@@ -802,7 +816,7 @@ proc load_driver stdcall, driver_name:dword
jnz @f jnz @f
cmp word [file_name+21], 'j' cmp word [file_name+21], 'j'
jnz @f jnz @f
mov esi, aSis mov esi, aHDA
jmp .redo jmp .redo
@@: @@:
xor eax, eax xor eax, eax
@@ -848,13 +862,13 @@ endp
coff_get_align: coff_get_align:
; Rules: ; Rules:
; - if alignment is not given, use default = 4K; ; - if alignment is not given, use default = 4K;
; - if alignment is given and is no more than 4K, use it; ; - if alignment is given and is no more than 4K, use it;
; - if alignment is more than 4K, revert to 4K. ; - if alignment is more than 4K, revert to 4K.
push ecx push ecx
mov cl, byte [edx+COFF_SECTION.Characteristics+2] mov cl, byte [edx+COFF_SECTION.Characteristics+2]
mov eax, 1 mov eax, 1
shr cl, 4 shr cl, 4
dec cl dec cl
js .default js .default
cmp cl, 12 cmp cl, 12
jbe @f jbe @f
@@ -952,13 +966,13 @@ proc load_library stdcall, file_name:dword
; allocate DLLDESCR struct; size is DLLDESCR.sizeof plus size of DLL name ; allocate DLLDESCR struct; size is DLLDESCR.sizeof plus size of DLL name
mov esi, edi mov esi, edi
mov ecx, -1 mov ecx, -1
xor eax, eax xor eax, eax
repnz scasb repnz scasb
not ecx not ecx
lea eax, [ecx+sizeof.DLLDESCR] lea eax, [ecx+sizeof.DLLDESCR]
push ecx push ecx
call malloc call malloc
pop ecx pop ecx
test eax, eax test eax, eax
jz .fail_and_free_coff jz .fail_and_free_coff
; save timestamp ; save timestamp
@@ -976,23 +990,23 @@ proc load_library stdcall, file_name:dword
mov [dll_list.bk], esi mov [dll_list.bk], esi
mov [esi+DLLDESCR.bk], eax mov [esi+DLLDESCR.bk], eax
mov [eax+DLLDESCR.fd], esi mov [eax+DLLDESCR.fd], esi
; calculate size of loaded DLL ; calculate size of loaded DLL
mov edx, [coff] mov edx, [coff]
movzx ecx, [edx+COFF_HEADER.nSections] movzx ecx, [edx+COFF_HEADER.nSections]
xor ebx, ebx xor ebx, ebx
add edx, 20 add edx, 20
@@: @@:
call coff_get_align call coff_get_align
add ebx, eax add ebx, eax
not eax not eax
and ebx, eax and ebx, eax
add ebx, [edx+COFF_SECTION.SizeOfRawData] add ebx, [edx+COFF_SECTION.SizeOfRawData]
add edx, sizeof.COFF_SECTION add edx, sizeof.COFF_SECTION
dec ecx dec ecx
jnz @B jnz @B
; it must be nonzero and not too big ; it must be nonzero and not too big
mov [esi+DLLDESCR.size], ebx mov [esi+DLLDESCR.size], ebx
test ebx, ebx test ebx, ebx
jz .fail_and_free_dll jz .fail_and_free_dll
@@ -1016,108 +1030,108 @@ proc load_library stdcall, file_name:dword
mov [esi+DLLDESCR.defaultbase], ecx mov [esi+DLLDESCR.defaultbase], ecx
mov [dll_cur_addr], edx mov [dll_cur_addr], edx
; copy sections and set correct values for VirtualAddress'es in headers ; copy sections and set correct values for VirtualAddress'es in headers
push esi push esi
mov edx, [coff] mov edx, [coff]
movzx ebx, [edx+COFF_HEADER.nSections] movzx ebx, [edx+COFF_HEADER.nSections]
mov edi, eax mov edi, eax
add edx, 20 add edx, 20
cld cld
@@: @@:
call coff_get_align call coff_get_align
add ecx, eax add ecx, eax
add edi, eax add edi, eax
not eax not eax
and ecx, eax and ecx, eax
and edi, eax and edi, eax
mov [edx+COFF_SECTION.VirtualAddress], ecx mov [edx+COFF_SECTION.VirtualAddress], ecx
add ecx, [edx+COFF_SECTION.SizeOfRawData] add ecx, [edx+COFF_SECTION.SizeOfRawData]
mov esi, [edx+COFF_SECTION.PtrRawData] mov esi, [edx+COFF_SECTION.PtrRawData]
push ecx push ecx
mov ecx, [edx+COFF_SECTION.SizeOfRawData] mov ecx, [edx+COFF_SECTION.SizeOfRawData]
test esi, esi test esi, esi
jnz .copy jnz .copy
xor eax, eax xor eax, eax
rep stosb rep stosb
jmp .next jmp .next
.copy: .copy:
add esi, [coff] add esi, [coff]
rep movsb rep movsb
.next: .next:
pop ecx pop ecx
add edx, sizeof.COFF_SECTION add edx, sizeof.COFF_SECTION
dec ebx dec ebx
jnz @B jnz @B
pop esi pop esi
; save some additional data from COFF file ; save some additional data from COFF file
; later we will use COFF header, headers for sections and symbol table ; later we will use COFF header, headers for sections and symbol table
; and also relocations table for all sections ; and also relocations table for all sections
mov edx, [coff] mov edx, [coff]
mov ebx, [edx+COFF_HEADER.pSymTable] mov ebx, [edx+COFF_HEADER.pSymTable]
mov edi, dword [fileinfo+32] mov edi, dword [fileinfo+32]
sub edi, ebx sub edi, ebx
jc .fail_and_free_data jc .fail_and_free_data
mov [esi+DLLDESCR.symbols_lim], edi mov [esi+DLLDESCR.symbols_lim], edi
add ebx, edx add ebx, edx
movzx ecx, [edx+COFF_HEADER.nSections] movzx ecx, [edx+COFF_HEADER.nSections]
lea ecx, [ecx*5] lea ecx, [ecx*5]
lea edi, [edi+ecx*8+20] lea edi, [edi+ecx*8+20]
add edx, 20 add edx, 20
@@: @@:
movzx eax, [edx+COFF_SECTION.NumReloc] movzx eax, [edx+COFF_SECTION.NumReloc]
lea eax, [eax*5] lea eax, [eax*5]
lea edi, [edi+eax*2] lea edi, [edi+eax*2]
add edx, sizeof.COFF_SECTION add edx, sizeof.COFF_SECTION
sub ecx, 5 sub ecx, 5
jnz @b jnz @b
stdcall kernel_alloc, edi stdcall kernel_alloc, edi
test eax, eax test eax, eax
jz .fail_and_free_data jz .fail_and_free_data
mov edx, [coff] mov edx, [coff]
movzx ecx, [edx+COFF_HEADER.nSections] movzx ecx, [edx+COFF_HEADER.nSections]
lea ecx, [ecx*5] lea ecx, [ecx*5]
lea ecx, [ecx*2+5] lea ecx, [ecx*2+5]
mov [esi+DLLDESCR.coff_hdr], eax mov [esi+DLLDESCR.coff_hdr], eax
push esi push esi
mov esi, edx mov esi, edx
mov edi, eax mov edi, eax
rep movsd rep movsd
pop esi pop esi
mov [esi+DLLDESCR.symbols_ptr], edi mov [esi+DLLDESCR.symbols_ptr], edi
push esi push esi
mov ecx, [edx+COFF_HEADER.nSymbols] mov ecx, [edx+COFF_HEADER.nSymbols]
mov [esi+DLLDESCR.symbols_num], ecx mov [esi+DLLDESCR.symbols_num], ecx
mov ecx, [esi+DLLDESCR.symbols_lim] mov ecx, [esi+DLLDESCR.symbols_lim]
mov esi, ebx mov esi, ebx
rep movsb rep movsb
pop esi pop esi
mov ebx, [esi+DLLDESCR.coff_hdr] mov ebx, [esi+DLLDESCR.coff_hdr]
push esi push esi
movzx eax, [edx+COFF_HEADER.nSections] movzx eax, [edx+COFF_HEADER.nSections]
lea edx, [ebx+20] lea edx, [ebx+20]
@@: @@:
movzx ecx, [edx+COFF_SECTION.NumReloc] movzx ecx, [edx+COFF_SECTION.NumReloc]
lea ecx, [ecx*5] lea ecx, [ecx*5]
mov esi, [edx+COFF_SECTION.PtrReloc] mov esi, [edx+COFF_SECTION.PtrReloc]
mov [edx+COFF_SECTION.PtrReloc], edi mov [edx+COFF_SECTION.PtrReloc], edi
sub [edx+COFF_SECTION.PtrReloc], ebx sub [edx+COFF_SECTION.PtrReloc], ebx
add esi, [coff] add esi, [coff]
shr ecx, 1 shr ecx, 1
rep movsd rep movsd
adc ecx, ecx adc ecx, ecx
rep movsw rep movsw
add edx, sizeof.COFF_SECTION add edx, sizeof.COFF_SECTION
dec eax dec eax
jnz @b jnz @b
pop esi pop esi
; fixup symbols ; fixup symbols
mov edx, ebx mov edx, ebx
mov eax, [ebx+COFF_HEADER.nSymbols] mov eax, [ebx+COFF_HEADER.nSymbols]
add edx, 20 add edx, 20
mov ecx, [esi+DLLDESCR.symbols_num] mov ecx, [esi+DLLDESCR.symbols_num]
lea ecx, [ecx*9] lea ecx, [ecx*9]
add ecx, ecx add ecx, ecx
add ecx, [esi+DLLDESCR.symbols_ptr] add ecx, [esi+DLLDESCR.symbols_ptr]
@@ -1125,17 +1139,17 @@ proc load_library stdcall, file_name:dword
ecx, 0 ecx, 0
; test eax, eax ; test eax, eax
; jnz @F ; jnz @F
; ;
;@@: ;@@:
stdcall get_coff_sym, [esi+DLLDESCR.symbols_ptr], [ebx+COFF_HEADER.nSymbols], szEXPORTS stdcall get_coff_sym, [esi+DLLDESCR.symbols_ptr], [ebx+COFF_HEADER.nSymbols], szEXPORTS
test eax, eax test eax, eax
jnz @F jnz @F
stdcall get_coff_sym, [esi+DLLDESCR.symbols_ptr], [ebx+COFF_HEADER.nSymbols], sz_EXPORTS stdcall get_coff_sym, [esi+DLLDESCR.symbols_ptr], [ebx+COFF_HEADER.nSymbols], sz_EXPORTS
@@: @@:
mov [esi+DLLDESCR.exports], eax mov [esi+DLLDESCR.exports], eax
; fix relocs in the hidden copy in kernel memory to default address ; fix relocs in the hidden copy in kernel memory to default address
; it is first fix; usually this will be enough, but second fix ; it is first fix; usually this will be enough, but second fix
; can be necessary if real load address will not equal assumption ; can be necessary if real load address will not equal assumption
@@ -1157,13 +1171,13 @@ proc load_library stdcall, file_name:dword
jnz @f jnz @f
stdcall user_alloc, edi stdcall user_alloc, edi
test eax, eax test eax, eax
jz .fail_and_dereference jz .fail_and_dereference
@@: @@:
mov [img_base], eax mov [img_base], eax
mov eax, sizeof.HDLL mov eax, sizeof.HDLL
call malloc call malloc
test eax, eax test eax, eax
jz .fail_and_free_user jz .fail_and_free_user
mov ebx, [CURRENT_TASK] mov ebx, [CURRENT_TASK]
shl ebx, 5 shl ebx, 5
mov edx, [CURRENT_TASK+ebx+TASKDATA.pid] mov edx, [CURRENT_TASK+ebx+TASKDATA.pid]
@@ -1366,17 +1380,17 @@ destroy_all_hdlls:
align 4 align 4
stop_all_services: stop_all_services:
push ebp push ebp
mov edx, [srv.fd] mov edx, [srv.fd]
.next: .next:
cmp edx, srv.fd-SRV.fd cmp edx, srv.fd-SRV.fd
je .done je .done
cmp [edx+SRV.magic], ' SRV' cmp [edx+SRV.magic], ' SRV'
jne .next jne .next
cmp [edx+SRV.size], sizeof.SRV cmp [edx+SRV.size], sizeof.SRV
jne .next jne .next
mov ebx, [edx+SRV.entry] mov ebx, [edx+SRV.entry]
mov edx, [edx+SRV.fd] mov edx, [edx+SRV.fd]
test ebx, ebx test ebx, ebx
jz .next jz .next

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; Macroinstruction for making export section ; Macroinstruction for making export section

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
iglobal iglobal

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -11,7 +11,7 @@
; ;
;============================================================================ ;============================================================================
$Revision$ $Revision $
if 0 if 0
; The code currently does not work. Kill "if 0/end if" only after correcting ; The code currently does not work. Kill "if 0/end if" only after correcting

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
init_fpu: init_fpu:

View File

@@ -1,31 +1,31 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
struct MEM_BLOCK struct MEM_BLOCK
list LHEAD list LHEAD
next_block dd ? ;+8 next_block dd ? ;+8
prev_block dd ? ;+4 prev_block dd ? ;+4
base dd ? ;+16 base dd ? ;+16
size dd ? ;+20 size dd ? ;+20
flags dd ? ;+24 flags dd ? ;+24
handle dd ? ;+28 handle dd ? ;+28
ends ends
FREE_BLOCK equ 4 FREE_BLOCK equ 4
USED_BLOCK equ 8 USED_BLOCK equ 8
DONT_FREE_BLOCK equ 10h DONT_FREE_BLOCK equ 10h
block_next equ MEM_BLOCK.next_block block_next equ MEM_BLOCK.next_block
block_prev equ MEM_BLOCK.prev_block block_prev equ MEM_BLOCK.prev_block
list_fd equ MEM_BLOCK.list.next list_fd equ MEM_BLOCK.list.next
list_bk equ MEM_BLOCK.list.prev list_bk equ MEM_BLOCK.list.prev
block_base equ MEM_BLOCK.base block_base equ MEM_BLOCK.base
block_size equ MEM_BLOCK.size block_size equ MEM_BLOCK.size
@@ -137,60 +137,60 @@ proc init_kernel_heap
add edi, 0x1000 add edi, 0x1000
add edx, 0x1000 add edx, 0x1000
dec ecx dec ecx
jnz .l1 jnz .l1
mov edi, HEAP_BASE ;descriptors mov edi, HEAP_BASE ;descriptors
mov ebx, HEAP_BASE+sizeof.MEM_BLOCK ;free space mov ebx, HEAP_BASE+sizeof.MEM_BLOCK ;free space
mov ecx, HEAP_BASE+sizeof.MEM_BLOCK*2 ;terminator mov ecx, HEAP_BASE+sizeof.MEM_BLOCK*2 ;terminator
xor eax, eax xor eax, eax
mov [edi+block_next], ebx mov [edi+block_next], ebx
mov [edi+block_prev], eax mov [edi+block_prev], eax
mov [edi+list_fd], eax mov [edi+list_fd], eax
mov [edi+list_bk], eax mov [edi+list_bk], eax
mov [edi+block_base], HEAP_BASE mov [edi+block_base], HEAP_BASE
mov [edi+block_size], 4096*sizeof.MEM_BLOCK mov [edi+block_size], 4096*sizeof.MEM_BLOCK
mov [edi+block_flags], USED_BLOCK mov [edi+block_flags], USED_BLOCK
mov [ecx+block_next], eax mov [ecx+block_next], eax
mov [ecx+block_prev], ebx mov [ecx+block_prev], ebx
mov [edi+list_fd], eax mov [edi+list_fd], eax
mov [edi+list_bk], eax mov [edi+list_bk], eax
mov [edi+block_base], eax mov [edi+block_base], eax
mov [edi+block_size], eax mov [edi+block_size], eax
mov [edi+block_flags], USED_BLOCK mov [edi+block_flags], USED_BLOCK
mov [ebx+block_next], ecx mov [ebx+block_next], ecx
mov [ebx+block_prev], edi mov [ebx+block_prev], edi
mov [ebx+block_base], HEAP_BASE+4096*sizeof.MEM_BLOCK mov [ebx+block_base], HEAP_BASE+4096*sizeof.MEM_BLOCK
mov ecx, [pg_data.kernel_pages] mov ecx, [pg_data.kernel_pages]
shl ecx, 12 shl ecx, 12
sub ecx, HEAP_BASE-OS_BASE+4096*sizeof.MEM_BLOCK sub ecx, HEAP_BASE-OS_BASE+4096*sizeof.MEM_BLOCK
mov [heap_size], ecx mov [heap_size], ecx
mov [heap_free], ecx mov [heap_free], ecx
mov [ebx+block_size], ecx mov [ebx+block_size], ecx
mov [ebx+block_flags], FREE_BLOCK mov [ebx+block_flags], FREE_BLOCK
mov [mem_block_mask], eax mov [mem_block_mask], eax
mov [mem_block_mask+4], 0x80000000 mov [mem_block_mask+4], 0x80000000
mov ecx, mem_block_list+63*8 mov ecx, mem_block_list+63*8
list_add ebx, ecx list_add ebx, ecx
mov ecx, 4096-3-1 mov ecx, 4096-3-1
mov eax, HEAP_BASE+sizeof.MEM_BLOCK*4 mov eax, HEAP_BASE+sizeof.MEM_BLOCK*4
mov [next_memblock], HEAP_BASE+sizeof.MEM_BLOCK *3 mov [next_memblock], HEAP_BASE+sizeof.MEM_BLOCK *3
@@: @@:
mov [eax-sizeof.MEM_BLOCK], eax mov [eax-sizeof.MEM_BLOCK], eax
add eax, sizeof.MEM_BLOCK add eax, sizeof.MEM_BLOCK
loop @B loop @B
mov [eax-sizeof.MEM_BLOCK], dword 0 mov [eax-sizeof.MEM_BLOCK], dword 0
mov ecx, heap_mutex mov ecx, heap_mutex
call mutex_init call mutex_init
mov [heap_blocks], 4094 mov [heap_blocks], 4094
mov [free_blocks], 4093 mov [free_blocks], 4093
ret ret
@@ -578,7 +578,7 @@ restore block_flags
;;;;;;;;;;;;;; USER ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;; USER ;;;;;;;;;;;;;;;;;
HEAP_TOP equ 0x5FC00000 HEAP_TOP equ 0x80000000
align 4 align 4
proc init_heap proc init_heap
@@ -848,6 +848,71 @@ proc user_free stdcall, base:dword
ret ret
endp endp
align 4
proc user_unmap stdcall, base:dword, offset:dword, size:dword
push ebx
mov ebx, [base] ; must be valid pointer
test ebx, ebx
jz .error
mov edx, [offset] ; check offset
add edx, ebx ; must be below 2Gb app limit
js .error
shr ebx, 12 ; chek block attributes
lea ebx, [page_tabs+ebx*4]
mov eax, [ebx-4] ; block attributes
test al, USED_BLOCK
jz .error
test al, DONT_FREE_BLOCK
jnz .error
shr edx, 12
lea edx, [page_tabs+edx*4] ; unmap offset
mov ecx, [size]
add ecx, 4095
shr ecx, 12 ; unmap size in pages
shr eax, 12 ; block size + 1 page
lea ebx, [ebx+eax*4-4] ; block end ptr
lea eax, [edx+ecx*4] ; unmap end ptr
cmp eax, ebx ; check for overflow
ja .error
mov ebx, [offset]
and ebx, not 4095 ; is it required ?
.unmap:
mov eax, [edx] ; get page addres
test al, 1 ; page mapped ?
jz @F
test eax, PG_SHARED ; page shared ?
jnz @F
mov [page_tabs+edx*4], dword 2
; mark page as reserved
invlpg [ebx] ; when we start using
call free_page ; empty c-o-w page instead this ?
@@:
add ebx, 4096
add edx, 4
dec ecx
jnz .unmap
pop ebx
or al, 1 ; return non zero on success
ret
.error:
pop ebx
xor eax, eax ; something wrong
ret
endp
align 4
user_normalize: user_normalize:
; in: esi=heap_base, edi=heap_top ; in: esi=heap_base, edi=heap_top
; out: eax=0 <=> OK ; out: eax=0 <=> OK
@@ -1283,13 +1348,13 @@ align 4
jz .fail jz .fail
add ecx, 4095 add ecx, 4095
and ecx, -4096 and ecx, -4096
mov [size], ecx mov [size], ecx
mov eax, sizeof.SMEM mov eax, sizeof.SMEM
call malloc call malloc
test eax, eax test eax, eax
mov esi, eax mov esi, eax
mov edx, E_NOMEM mov edx, E_NOMEM
jz .fail jz .fail
@@ -1345,13 +1410,13 @@ align 4
mov edx, E_ACCESS mov edx, E_ACCESS
ja .fail ja .fail
mov ebx, [CURRENT_TASK] mov ebx, [CURRENT_TASK]
shl ebx, 5 shl ebx, 5
mov ebx, [CURRENT_TASK+ebx+4] mov ebx, [CURRENT_TASK+ebx+4]
mov eax, sizeof.SMAP mov eax, sizeof.SMAP
call create_kernel_object call create_kernel_object
test eax, eax test eax, eax
mov edi, eax mov edi, eax
mov edx, E_NOMEM mov edx, E_NOMEM
jz .fail jz .fail

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IRQ_RESERVED equ 24 IRQ_RESERVED equ 24

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; Small heap based on malloc/free/realloc written by Doug Lea ; Small heap based on malloc/free/realloc written by Doug Lea

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
align 4 align 4
@@ -166,6 +166,7 @@ proc free_page
ret ret
endp endp
align 4
proc map_io_mem stdcall, base:dword, size:dword, flags:dword proc map_io_mem stdcall, base:dword, size:dword, flags:dword
push ebx push ebx
@@ -357,8 +358,10 @@ proc init_LFB
cmp dword [LFBAddress], -1 cmp dword [LFBAddress], -1
jne @f jne @f
mov [BOOT_VAR+0x901c], byte 2 mov [BOOT_VAR+BOOT_MTRR], byte 2
stdcall alloc_pages, (0x280000 / 4096) ; max VGA=640*480*4=1228800 bytes
; + 32*640*4=81920 bytes for mouse pointer
stdcall alloc_pages, ((1228800+81920)/4096)
push eax push eax
call alloc_page call alloc_page
@@ -366,14 +369,16 @@ proc init_LFB
pop eax pop eax
or eax, PG_UW or eax, PG_UW
mov ebx, LFB_BASE mov ebx, LFB_BASE
mov ecx, 0x280000 / 4096 ; max VGA=640*480*4=1228800 bytes
; + 32*640*4=81920 bytes for mouse pointer
mov ecx, (1228800+81920)/4096
call commit_pages call commit_pages
mov [LFBAddress], dword LFB_BASE mov [LFBAddress], dword LFB_BASE
ret ret
@@: @@:
test [SCR_MODE], word 0100000000000000b test [SCR_MODE], word 0100000000000000b
jnz @f jnz @f
mov [BOOT_VAR+0x901c], byte 2 mov [BOOT_VAR+BOOT_MTRR], byte 2
ret ret
@@: @@:
call init_mtrr call init_mtrr
@@ -1303,6 +1308,11 @@ f68:
@@: @@:
ret ret
.26:
stdcall user_unmap, ecx, edx, esi
mov [esp+32], eax
ret
.fail: .fail:
xor eax, eax xor eax, eax
mov [esp+32], eax mov [esp+32], eax
@@ -1325,8 +1335,9 @@ f68call: ; keep this table closer to main code
dd f68.21 ; load_driver dd f68.21 ; load_driver
dd f68.22 ; shmem_open dd f68.22 ; shmem_open
dd f68.23 ; shmem_close dd f68.23 ; shmem_close
dd f68.24 dd f68.24 ; set exception handler
dd f68.25 dd f68.25 ; unmask exception
dd f68.26 ; user_unmap
align 4 align 4
@@ -1353,7 +1364,7 @@ endp
align 4 align 4
proc init_mtrr proc init_mtrr
cmp [BOOT_VAR+0x901c], byte 2 cmp [BOOT_VAR+BOOT_MTRR], byte 2
je .exit je .exit
bt [cpu_caps], CAPS_MTRR bt [cpu_caps], CAPS_MTRR
@@ -1543,3 +1554,27 @@ proc create_ring_buffer stdcall, size:dword, flags:dword
.fail: .fail:
ret ret
endp endp
align 4
proc print_mem
mov edi, BOOT_VAR + 0x9104
mov ecx, [edi-4]
test ecx, ecx
jz .done
@@:
mov eax, [edi]
mov edx, [edi+4]
add eax, [edi+8]
adc edx, [edi+12]
DEBUGF 1, "K : E820 %x%x - %x%x type %d\n", \
[edi+4], [edi],\
edx, eax, [edi+16]
add edi, 20
dec ecx
jnz @b
.done:
ret
endp

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
include 'export.inc' include 'export.inc'

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; Author: Kees J. Bot 1 Jan 1994 ;; ;; Author: Kees J. Bot 1 Jan 1994 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; size_t strncat(char *s1, const char *s2, size_t n) ; size_t strncat(char *s1, const char *s2, size_t n)

View File

@@ -1,13 +1,13 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Synhronization for MenuetOS. ;; ;; Synhronization for MenuetOS. ;;
;; Author: Halyavin Andrey, halyavin@land.ru ;; ;; Author: Halyavin Andrey, halyavin@land.ru ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
if ~defined sync_inc if ~defined sync_inc

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; ;; ;; ;;
@@ -11,7 +11,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
align 4 ;3A08 align 4 ;3A08

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; Old style system call converter ; Old style system call converter
align 16 align 16
@@ -145,7 +145,7 @@ iglobal
dd sys_settime ; 22-setting date,time,clock and alarm-clock dd sys_settime ; 22-setting date,time,clock and alarm-clock
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
dd undefined_syscall ; 25-reserved dd syscall_putarea_backgr ; 25-Put Area to background
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,. dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
dd undefined_syscall ; 27-reserved dd undefined_syscall ; 27-reserved
dd undefined_syscall ; 28-reserved dd undefined_syscall ; 28-reserved
@@ -154,7 +154,7 @@ iglobal
dd undefined_syscall ; 31-reserved dd undefined_syscall ; 31-reserved
dd undefined_syscall ; 32-reserved dd undefined_syscall ; 32-reserved
dd undefined_syscall ; 33-reserved dd undefined_syscall ; 33-reserved
dd undefined_syscall ; 34-reserved dd syscall_getpixel_WinMap ; 34-GetPixel WinMap
dd syscall_getpixel ; 35-GetPixel dd syscall_getpixel ; 35-GetPixel
dd syscall_getarea ; 36-GetArea dd syscall_getarea ; 36-GetArea
dd readmousepos ; 37-GetMousePosition_ScreenRelative,. dd readmousepos ; 37-GetMousePosition_ScreenRelative,.

View File

@@ -1,46 +1,46 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
GREEDY_KERNEL equ 0 GREEDY_KERNEL equ 0
struct APP_HEADER_00_ struct APP_HEADER_00_
banner dq ? banner dq ?
version dd ? ;+8 version dd ? ;+8
start dd ? ;+12 start dd ? ;+12
i_end dd ? ;+16 i_end dd ? ;+16
mem_size dd ? ;+20 mem_size dd ? ;+20
i_param dd ? ;+24 i_param dd ? ;+24
ends ends
struct APP_HEADER_01_ struct APP_HEADER_01_
banner dq ? banner dq ?
version dd ? ;+8 version dd ? ;+8
start dd ? ;+12 start dd ? ;+12
i_end dd ? ;+16 i_end dd ? ;+16
mem_size dd ? ;+20 mem_size dd ? ;+20
stack_top dd ? ;+24 stack_top dd ? ;+24
i_param dd ? ;+28 i_param dd ? ;+28
i_icon dd ? ;+32 i_icon dd ? ;+32
ends ends
struct APP_PARAMS struct APP_PARAMS
app_cmdline dd ? ;0x00 app_cmdline dd ? ;0x00
app_path dd ? ;0x04 app_path dd ? ;0x04
app_eip dd ? ;0x08 app_eip dd ? ;0x08
app_esp dd ? ;0x0C app_esp dd ? ;0x0C
app_mem dd ? ;0x10 app_mem dd ? ;0x10
ends ends
macro _clear_ op macro _clear_ op
{ mov ecx, op/4 { mov ecx, op/4
xor eax, eax xor eax, eax
cld cld
rep stosd rep stosd
@@ -72,6 +72,7 @@ proc fs_execute
slot_base dd ? slot_base dd ?
file_base dd ? file_base dd ?
file_size dd ? file_size dd ?
handle dd ? ;temp. for default cursor handle for curr. thread
;app header data ;app header data
hdr_cmdline dd ? ;0x00 hdr_cmdline dd ? ;0x00
hdr_path dd ? ;0x04 hdr_path dd ? ;0x04
@@ -83,6 +84,13 @@ proc fs_execute
pushad pushad
pushad
stdcall set_cursor, [def_cursor_clock]
mov [handle], eax
mov [redrawmouse_unconditional], 1
call __sys_draw_pointer
popad
mov [flags], edx mov [flags], edx
; [ebp] pointer to filename ; [ebp] pointer to filename
@@ -113,7 +121,8 @@ proc fs_execute
.bigfilename: .bigfilename:
popad popad
mov eax, -ERROR_FILE_NOT_FOUND mov eax, -ERROR_FILE_NOT_FOUND
ret
jmp .final
.namecopied: .namecopied:
@@ -127,6 +136,7 @@ proc fs_execute
@@: @@:
lea eax, [filename] lea eax, [filename]
stdcall load_file, eax stdcall load_file, eax
mov esi, -ERROR_FILE_NOT_FOUND mov esi, -ERROR_FILE_NOT_FOUND
test eax, eax test eax, eax
jz .err_file jz .err_file
@@ -237,7 +247,9 @@ end if
xor ebx, ebx xor ebx, ebx
mov [application_table_status], ebx;unlock application_table_status mutex mov [application_table_status], ebx;unlock application_table_status mutex
mov eax, [process_number];set result mov eax, [process_number];set result
ret
jmp .final
.failed: .failed:
mov eax, [save_cr3] mov eax, [save_cr3]
call set_cr3 call set_cr3
@@ -248,19 +260,25 @@ end if
xor eax, eax xor eax, eax
mov [application_table_status], eax mov [application_table_status], eax
mov eax, esi mov eax, esi
.final:
pushad
stdcall set_cursor, [handle]
mov [redrawmouse_unconditional], 1
call __sys_draw_pointer
popad
ret ret
endp endp
align 4 align 4
test_app_header: test_app_header:
virtual at eax virtual at eax
APP_HEADER_00 APP_HEADER_00_ APP_HEADER_00 APP_HEADER_00_
end virtual end virtual
virtual at eax virtual at eax
APP_HEADER_01 APP_HEADER_01_ APP_HEADER_01 APP_HEADER_01_
end virtual end virtual
cmp dword [eax], 'MENU' cmp dword [eax], 'MENU'
jne .fail jne .fail
cmp word [eax+4], 'ET' cmp word [eax+4], 'ET'
jne .fail jne .fail

View File

@@ -1,6 +1,13 @@
; Tests of malloc()/free() from the kernel heap. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This file is not included in the kernel, it is just test application. ;; ;;
use32 ;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Tests of malloc()/free() from the kernel heap.
; This file is not included in the kernel, it is just test application.
use32
db 'MENUET01' db 'MENUET01'
dd 1, start, i_end, mem, mem, 0, 0 dd 1, start, i_end, mem, mem, 0, 0

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2011. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision: 2381 $ $Revision: 2381 $

View File

@@ -1,39 +1,39 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2007-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2007-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; Virtual-8086 mode manager ; Virtual-8086 mode manager
; diamond, 2007, 2008 ; diamond, 2007, 2008
DEBUG_SHOW_IO = 0 DEBUG_SHOW_IO = 0
struct V86_machine struct V86_machine
; page directory ; page directory
pagedir dd ? pagedir dd ?
; translation table: V86 address -> flat linear address ; translation table: V86 address -> flat linear address
pages dd ? pages dd ?
; mutex to protect all data from writing by multiple threads at one time ; mutex to protect all data from writing by multiple threads at one time
mutex dd ? mutex dd ?
; i/o permission map ; i/o permission map
iopm dd ? iopm dd ?
ends ends
; Create V86 machine ; Create V86 machine
; in: nothing ; in: nothing
; out: eax = handle (pointer to struc V86_machine) ; out: eax = handle (pointer to struc V86_machine)
; eax = NULL => failure ; eax = NULL => failure
; destroys: ebx, ecx, edx (due to malloc) ; destroys: ebx, ecx, edx (due to malloc)
v86_create: v86_create:
; allocate V86_machine structure ; allocate V86_machine structure
mov eax, sizeof.V86_machine mov eax, sizeof.V86_machine
call malloc call malloc
test eax, eax test eax, eax
jz .fail jz .fail
; initialize mutex ; initialize mutex
and dword [eax+V86_machine.mutex], 0 and dword [eax+V86_machine.mutex], 0
; allocate tables ; allocate tables
@@ -237,32 +237,32 @@ if ~DEBUG_SHOW_IO
mov ecx, 10000h/8/4 mov ecx, 10000h/8/4
rep stosd rep stosd
end if end if
.ret: .ret:
ret ret
struct v86_regs struct v86_regs
; don't change the order, it is important ; don't change the order, it is important
edi dd ? edi dd ?
esi dd ? esi dd ?
ebp dd ? ebp dd ?
dd ? ; ignored dd ? ; ignored
ebx dd ? ebx dd ?
edx dd ? edx dd ?
ecx dd ? ecx dd ?
eax dd ? eax dd ?
eip dd ? eip dd ?
cs dd ? cs dd ?
eflags dd ? ; VM flag must be set! eflags dd ? ; VM flag must be set!
esp dd ? esp dd ?
ss dd ? ss dd ?
es dd ? es dd ?
ds dd ? ds dd ?
fs dd ? fs dd ?
gs dd ? gs dd ?
ends ends
; Run V86 machine ; Run V86 machine
; in: ebx -> registers for V86 (two structures: in and out) ; in: ebx -> registers for V86 (two structures: in and out)
; esi = handle ; esi = handle
; ecx = expected end address (CS:IP) ; ecx = expected end address (CS:IP)
; edx = IRQ to hook or -1 if not required ; edx = IRQ to hook or -1 if not required
@@ -306,16 +306,16 @@ v86_start:
; We do not enable interrupts, because V86 IRQ redirector assumes that ; We do not enable interrupts, because V86 IRQ redirector assumes that
; machine is running ; machine is running
; They will be enabled by IRET. ; They will be enabled by IRET.
; sti ; sti
mov eax, esi mov eax, esi
sub esp, sizeof.v86_regs sub esp, sizeof.v86_regs
mov esi, ebx mov esi, ebx
mov edi, esp mov edi, esp
mov ecx, sizeof.v86_regs/4 mov ecx, sizeof.v86_regs/4
rep movsd rep movsd
cmp edx, -1 cmp edx, -1
jz .noirqhook jz .noirqhook
uglobal uglobal
v86_irqhooks rd IRQ_RESERVED * 2 v86_irqhooks rd IRQ_RESERVED * 2
@@ -359,13 +359,13 @@ v86_exc_c:
; Did we all that we have wanted to do? ; Did we all that we have wanted to do?
cmp bl, 1 cmp bl, 1
jne @f jne @f
xor eax, eax xor eax, eax
mov dr6, eax mov dr6, eax
@@: @@:
mov eax, [esp+sizeof.v86_regs+10h+18h] mov eax, [esp+sizeof.v86_regs+10h+18h]
cmp word [esp+v86_regs.eip], ax cmp word [esp+v86_regs.eip], ax
jnz @f jnz @f
shr eax, 16 shr eax, 16
cmp word [esp+v86_regs.cs], ax cmp word [esp+v86_regs.cs], ax
jz .done jz .done
@@: @@:
@@ -431,13 +431,13 @@ v86_exc_c:
shl edx, 4 shl edx, 4
push eax push eax
movzx eax, word [esp+4+v86_regs.esp] movzx eax, word [esp+4+v86_regs.esp]
sub eax, 6 sub eax, 6
add edx, eax add edx, eax
mov eax, edx mov eax, edx
mov esi, [esp+4+sizeof.v86_regs+10h+4] mov esi, [esp+4+sizeof.v86_regs+10h+4]
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jae @f jae @f
mov bl, 14 ; #PF exception mov bl, 14 ; #PF exception
jmp .nogp jmp .nogp
@@: @@:
@@ -479,13 +479,13 @@ v86_exc_c:
@@: @@:
movzx edx, word [esp+v86_regs.ss] movzx edx, word [esp+v86_regs.ss]
shl edx, 4 shl edx, 4
movzx eax, word [esp+v86_regs.esp] movzx eax, word [esp+v86_regs.esp]
add edx, eax add edx, eax
mov eax, edx mov eax, edx
mov esi, [esp+sizeof.v86_regs+10h+4] mov esi, [esp+sizeof.v86_regs+10h+4]
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jae @f jae @f
mov bl, 14 mov bl, 14
jmp .nogp jmp .nogp
@@: @@:
@@ -515,13 +515,13 @@ v86_exc_c:
shl edx, 4 shl edx, 4
mov eax, [esp+v86_regs.esp] mov eax, [esp+v86_regs.esp]
sub eax, 2 sub eax, 2
movzx eax, ax movzx eax, ax
add edx, eax add edx, eax
mov eax, edx mov eax, edx
mov esi, [esp+sizeof.v86_regs+10h+4] mov esi, [esp+sizeof.v86_regs+10h+4]
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jae @f jae @f
mov bl, 14 ; #PF exception mov bl, 14 ; #PF exception
jmp .nogp jmp .nogp
@@: @@:
@@ -547,13 +547,13 @@ v86_exc_c:
movzx edx, word [esp+v86_regs.ss] movzx edx, word [esp+v86_regs.ss]
shl edx, 4 shl edx, 4
movzx eax, word [esp+v86_regs.esp] movzx eax, word [esp+v86_regs.esp]
sub eax, 4 sub eax, 4
add edx, eax add edx, eax
mov eax, edx mov eax, edx
mov esi, [esp+sizeof.v86_regs+10h+4] mov esi, [esp+sizeof.v86_regs+10h+4]
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jae @f jae @f
mov bl, 14 ; #PF exception mov bl, 14 ; #PF exception
jmp .nogp jmp .nogp
@@: @@:
@@ -578,13 +578,13 @@ v86_exc_c:
@@: @@:
movzx edx, word [esp+v86_regs.ss] movzx edx, word [esp+v86_regs.ss]
shl edx, 4 shl edx, 4
movzx eax, word [esp+v86_regs.esp] movzx eax, word [esp+v86_regs.esp]
add edx, eax add edx, eax
mov eax, edx mov eax, edx
mov esi, [esp+sizeof.v86_regs+10h+4] mov esi, [esp+sizeof.v86_regs+10h+4]
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jae @f jae @f
mov bl, 14 ; #PF exception mov bl, 14 ; #PF exception
jmp .nogp jmp .nogp
@@: @@:
@@ -609,13 +609,13 @@ v86_exc_c:
@@: @@:
movzx edx, word [esp+v86_regs.ss] movzx edx, word [esp+v86_regs.ss]
shl edx, 4 shl edx, 4
movzx eax, word [esp+v86_regs.esp] movzx eax, word [esp+v86_regs.esp]
add edx, eax add edx, eax
mov eax, edx mov eax, edx
mov esi, [esp+sizeof.v86_regs+10h+4] mov esi, [esp+sizeof.v86_regs+10h+4]
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jae @f jae @f
mov bl, 14 mov bl, 14
jmp .nogp jmp .nogp
@@: @@:
@@ -735,13 +735,13 @@ end if
call sys_msg_board_str call sys_msg_board_str
mov ecx, 8 mov ecx, 8
movzx edx, word [esp+32+4] movzx edx, word [esp+32+4]
shl edx, 4 shl edx, 4
add edx, [esp+32] add edx, [esp+32]
@@: @@:
mov esi, [esp+sizeof.v86_regs+10h+4] mov esi, [esp+sizeof.v86_regs+10h+4]
mov eax, edx mov eax, edx
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jb .nopage jb .nopage
mov esi, v86_exc_str3-2 mov esi, v86_exc_str3-2
call sys_msg_board_str call sys_msg_board_str
@@ -760,27 +760,27 @@ end if
jmp .exit jmp .exit
.done: .done:
xor eax, eax xor eax, eax
.exit: .exit:
mov [esp+sizeof.v86_regs+10h+1Ch], eax mov [esp+sizeof.v86_regs+10h+1Ch], eax
mov [esp+sizeof.v86_regs+10h+18h], ebx mov [esp+sizeof.v86_regs+10h+18h], ebx
mov edx, [esp+sizeof.v86_regs+10h+14h] mov edx, [esp+sizeof.v86_regs+10h+14h]
cmp edx, -1 cmp edx, -1
jz @f jz @f
dec [v86_irqhooks+edx*8+4] dec [v86_irqhooks+edx*8+4]
jnz @f jnz @f
and [v86_irqhooks+edx*8], 0 and [v86_irqhooks+edx*8], 0
@@: @@:
mov esi, esp mov esi, esp
mov edi, [esi+sizeof.v86_regs+10h+10h] mov edi, [esi+sizeof.v86_regs+10h+10h]
add edi, sizeof.v86_regs add edi, sizeof.v86_regs
mov ecx, sizeof.v86_regs/4 mov ecx, sizeof.v86_regs/4
rep movsd rep movsd
mov esp, esi mov esp, esi
cli cli
mov ecx, [CURRENT_TASK] mov ecx, [CURRENT_TASK]
shl ecx, 8 shl ecx, 8
@@ -861,18 +861,18 @@ v86_irq2:
mov ecx, [TASK_COUNT] mov ecx, [TASK_COUNT]
.scan: .scan:
cmp [ebx+APPDATA.dir_table], eax cmp [ebx+APPDATA.dir_table], eax
jnz .cont jnz .cont
push ecx push ecx
mov ecx, [ebx+APPDATA.saved_esp0] mov ecx, [ebx+APPDATA.saved_esp0]
cmp word [ecx-sizeof.v86_regs+v86_regs.esp], 6 cmp word [ecx-sizeof.v86_regs+v86_regs.esp], 6
jb .cont2 jb .cont2
movzx edx, word [ecx-sizeof.v86_regs+v86_regs.ss] movzx edx, word [ecx-sizeof.v86_regs+v86_regs.ss]
shl edx, 4 shl edx, 4
push eax push eax
movzx eax, word [ecx-sizeof.v86_regs+v86_regs.esp] movzx eax, word [ecx-sizeof.v86_regs+v86_regs.esp]
sub eax, 6 sub eax, 6
add edx, eax add edx, eax
mov eax, edx mov eax, edx
call v86_get_lin_addr call v86_get_lin_addr
cmp eax, 0x1000 cmp eax, 0x1000
jb .cont3 jb .cont3
@@ -892,29 +892,29 @@ v86_irq2:
mov ecx, edi mov ecx, edi
call irq_eoi call irq_eoi
popad popad
iretd iretd
.found: .found:
mov cr3, eax mov cr3, eax
sub word [esi-sizeof.v86_regs+v86_regs.esp], 6 sub word [esi-sizeof.v86_regs+v86_regs.esp], 6
mov ecx, [esi-sizeof.v86_regs+v86_regs.eip] mov ecx, [esi-sizeof.v86_regs+v86_regs.eip]
mov word [edx], cx mov word [edx], cx
mov ecx, [esi-sizeof.v86_regs+v86_regs.cs] mov ecx, [esi-sizeof.v86_regs+v86_regs.cs]
mov word [edx+2], cx mov word [edx+2], cx
mov ecx, [esi-sizeof.v86_regs+v86_regs.eflags] mov ecx, [esi-sizeof.v86_regs+v86_regs.eflags]
mov word [edx+4], cx mov word [edx+4], cx
lea eax, [edi+8] lea eax, [edi+8]
cmp al, 10h cmp al, 10h
jb @f jb @f
add al, 60h add al, 60h
@@: @@:
mov cx, [eax*4] mov cx, [eax*4]
mov word [esi-sizeof.v86_regs+v86_regs.eip], cx mov word [esi-sizeof.v86_regs+v86_regs.eip], cx
mov cx, [eax*4+2] mov cx, [eax*4+2]
mov word [esi-sizeof.v86_regs+v86_regs.cs], cx mov word [esi-sizeof.v86_regs+v86_regs.cs], cx
and byte [esi-sizeof.v86_regs+v86_regs.eflags+1], not 3 and byte [esi-sizeof.v86_regs+v86_regs.eflags+1], not 3
call update_counters call update_counters
lea edi, [ebx + 0x100000000 - SLOT_BASE] lea edi, [ebx + 0x100000000 - SLOT_BASE]
shr edi, 3 shr edi, 3
add edi, TASK_DATA add edi, TASK_DATA
call find_next_task.found call find_next_task.found
call do_change_task call do_change_task

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
flm db 0 flm db 0

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
keymap: keymap:
@@ -107,7 +107,7 @@ msg_module db 'in module ',0
msg_version db 'incompatible driver version',13,10,0 msg_version db 'incompatible driver version',13,10,0
msg_www db 'please visit www.kolibrios.org',13,10,0 msg_www db 'please visit www.kolibrios.org',13,10,0
msg_CR db 13,10,0 msg_CR db 13,10,0
aSis db 'SIS',0 aHDA db 'INTEL_HDA',0
intel_str db "GenuineIntel",0 intel_str db "GenuineIntel",0
AMD_str db "AuthenticAMD",0 AMD_str db "AuthenticAMD",0
@@ -156,23 +156,25 @@ dll_list:
.bk dd dll_list .bk dd dll_list
.fd dd dll_list .fd dd dll_list
MAX_DEFAULT_DLL_ADDR = 0x20000000 MAX_DEFAULT_DLL_ADDR = 0x80000000
MIN_DEFAULT_DLL_ADDR = 0x10000000 MIN_DEFAULT_DLL_ADDR = 0x70000000
dll_cur_addr dd MIN_DEFAULT_DLL_ADDR dll_cur_addr dd MIN_DEFAULT_DLL_ADDR
; supported videomodes ; supported videomodes
; mike.dld { ; mike.dld {
db 0 ;db 0
dd servetable-0x10000 ;dd servetable-0x10000
draw_line dd __sys_draw_line ;align 4
draw_pointer dd __sys_draw_pointer ;draw_line dd __sys_draw_line
;draw_pointer dd __sys_draw_pointer
;//mike.dld, 2006-08-02 [ ;//mike.dld, 2006-08-02 [
;drawbar dd __sys_drawbar ;;drawbar dd __sys_drawbar
drawbar dd __sys_drawbar.forced ;;drawbar dd __sys_drawbar.forced
;drawbar dd vesa20_drawbar
;//mike.dld, 2006-08-02 ] ;//mike.dld, 2006-08-02 ]
putpixel dd __sys_putpixel ;putpixel dd __sys_putpixel
; } mike.dld ; } mike.dld
@@ -272,13 +274,13 @@ graph_data_l:
dw 0x7ff dw 0x7ff
dw 0x0000 dw 0x0000
db 0x00 db 0x00
dw 11010000b *256 +11110010b dw 11010000b *256 +11110010b
db 0x00 db 0x00
tss0_l: tss0_l:
dw sizeof.TSS-1 dw sizeof.TSS-1
dw tss and 0xFFFF dw tss and 0xFFFF
db (tss shr 16) and 0xFF db (tss shr 16) and 0xFF
db 10001001b db 10001001b
dw (tss shr 16) and 0xFF00 dw (tss shr 16) and 0xFF00
tls_data_l: tls_data_l:
@@ -292,7 +294,8 @@ endofcode:
gdte: gdte:
align 16 align 16
cur_saved_data rb 4096 cur_saved_data:
rb 4096
fpu_data: fpu_data:
rb 512 rb 512
@@ -330,6 +333,7 @@ _WinMapAddress rd 1
_WinMapSize rd 1 _WinMapSize rd 1
def_cursor rd 1 def_cursor rd 1
def_cursor_clock rd 1
current_cursor rd 1 current_cursor rd 1
hw_cursor rd 1 hw_cursor rd 1
cur_saved_base rd 1 cur_saved_base rd 1
@@ -393,13 +397,10 @@ windowtypechanged rd 1
hd_entries rd 1 ;unused ? 0xfe10 hd_entries rd 1 ;unused ? 0xfe10
;* start code - Mario79
mouse_active rd 1 mouse_active rd 1
mouse_pause rd 1 mouse_pause rd 1
MouseTickCounter rd 1
;* end code - Mario79 redrawmouse_unconditional rd 1
img_background rd 1 img_background rd 1
mem_BACKGROUND rd 1 mem_BACKGROUND rd 1

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2008-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Detect all BIOS hard drives. ; Detect all BIOS hard drives.
; diamond, 2008 ; diamond, 2008

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Query physical memory map from BIOS. ; Query physical memory map from BIOS.
; diamond, 2009 ; diamond, 2009
@@ -20,14 +20,14 @@
mov edx, 0x534D4150 mov edx, 0x534D4150
int 15h int 15h
jc no_E820 jc no_E820
cmp eax, 0x534D4150 cmp eax, 0x534D4150
jnz no_E820 jnz no_E820
e820_mem_loop: e820_mem_loop:
cmp byte [di+16], 1 ; ignore non-free areas ; cmp byte [di+16], 1 ; ignore non-free areas
jnz e820_mem_next ; jnz e820_mem_next
inc byte [0x9100] inc byte [0x9100]
add di, 20 add di, 20
e820_mem_next: e820_mem_next:
; consequent calls to fn E820 ; consequent calls to fn E820
test ebx, ebx test ebx, ebx
jz e820_test_done jz e820_test_done

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;*************************************************** ;***************************************************

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;****************************************************** ;******************************************************

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
include 'dev_fd.inc' include 'dev_fd.inc'

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
pusha pusha

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;**************************************************** ;****************************************************

View File

@@ -1,177 +1,173 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;driver sceletone ;driver sceletone
format MS COFF format MS COFF
DEBUG equ 1 DEBUG equ 1
API_VERSION equ 0 ;debug API_VERSION equ 0 ;debug
include 'proc32.inc' include 'proc32.inc'
include 'imports.inc' include 'imports.inc'
OS_BASE equ 0; struc IOCTL
new_app_base equ 0x60400000 { .handle dd ?
PROC_BASE equ OS_BASE+0x0080000 .io_code dd ?
.input dd ?
struc IOCTL .inp_size dd ?
{ .handle dd ? .output dd ?
.io_code dd ? .out_size dd ?
.input dd ? }
.inp_size dd ?
.output dd ? virtual at 0
.out_size dd ? IOCTL IOCTL
} end virtual
virtual at 0 public START
IOCTL IOCTL public service_proc
end virtual public version
public START DRV_ENTRY equ 1
public service_proc DRV_EXIT equ -1
public version STRIDE equ 4 ;size of row in devices table
DRV_ENTRY equ 1 SRV_GETVERSION equ 0
DRV_EXIT equ -1
STRIDE equ 4 ;size of row in devices table section '.flat' code readable align 16
SRV_GETVERSION equ 0 proc START stdcall, state:dword
section '.flat' code readable align 16 cmp [state], 1
jne .exit
proc START stdcall, state:dword .entry:
cmp [state], 1 if DEBUG
jne .exit mov esi, msgInit
.entry: call SysMsgBoardStr
end if
if DEBUG
mov esi, msgInit stdcall RegService, my_service, service_proc
call SysMsgBoardStr ret
end if .fail:
.exit:
stdcall RegService, my_service, service_proc xor eax, eax
ret ret
.fail: endp
.exit:
xor eax, eax handle equ IOCTL.handle
ret io_code equ IOCTL.io_code
endp input equ IOCTL.input
inp_size equ IOCTL.inp_size
handle equ IOCTL.handle output equ IOCTL.output
io_code equ IOCTL.io_code out_size equ IOCTL.out_size
input equ IOCTL.input
inp_size equ IOCTL.inp_size align 4
output equ IOCTL.output proc service_proc stdcall, ioctl:dword
out_size equ IOCTL.out_size
mov ebx, [ioctl]
align 4 mov eax, [ebx+io_code]
proc service_proc stdcall, ioctl:dword cmp eax, SRV_GETVERSION
jne @F
mov ebx, [ioctl]
mov eax, [ebx+io_code] mov eax, [ebx+output]
cmp eax, SRV_GETVERSION cmp [ebx+out_size], 4
jne @F jne .fail
mov [eax], dword API_VERSION
mov eax, [ebx+output] xor eax, eax
cmp [ebx+out_size], 4 ret
jne .fail @@:
mov [eax], dword API_VERSION .fail:
xor eax, eax or eax, -1
ret ret
@@: endp
.fail:
or eax, -1 restore handle
ret restore io_code
endp restore input
restore inp_size
restore handle restore output
restore io_code restore out_size
restore input
restore inp_size align 4
restore output proc detect
restore out_size locals
last_bus dd ?
align 4 endl
proc detect
locals xor eax, eax
last_bus dd ? mov [bus], eax
endl inc eax
call PciApi
xor eax, eax cmp eax, -1
mov [bus], eax je .err
inc eax
call PciApi mov [last_bus], eax
cmp eax, -1
je .err .next_bus:
and [devfn], 0
mov [last_bus], eax .next_dev:
stdcall PciRead32, [bus], [devfn], dword 0
.next_bus: test eax, eax
and [devfn], 0 jz .next
.next_dev: cmp eax, -1
stdcall PciRead32, [bus], [devfn], dword 0 je .next
test eax, eax
jz .next mov edi, devices
cmp eax, -1 @@:
je .next mov ebx, [edi]
test ebx, ebx
mov edi, devices jz .next
@@:
mov ebx, [edi] cmp eax, ebx
test ebx, ebx je .found
jz .next
add edi, STRIDE
cmp eax, ebx jmp @B
je .found .next:
inc [devfn]
add edi, STRIDE cmp [devfn], 256
jmp @B jb .next_dev
.next: mov eax, [bus]
inc [devfn] inc eax
cmp [devfn], 256 mov [bus], eax
jb .next_dev cmp eax, [last_bus]
mov eax, [bus] jna .next_bus
inc eax xor eax, eax
mov [bus], eax ret
cmp eax, [last_bus] .found:
jna .next_bus xor eax, eax
xor eax, eax inc eax
ret ret
.found: .err:
xor eax, eax xor eax, eax
inc eax ret
ret endp
.err:
xor eax, eax DEVICE_ID equ 1234; pci device id
ret VENDOR_ID equ 5678; device vendor id
endp
DEVICE_ID equ 1234; pci device id ;all initialized data place here
VENDOR_ID equ 5678; device vendor id
align 4
devices dd (DEVICE_ID shl 16)+VENDOR_ID
;all initialized data place here dd 0 ;terminator
align 4 version dd (5 shl 16) or (API_VERSION and 0xFFFF)
devices dd (DEVICE_ID shl 16)+VENDOR_ID
dd 0 ;terminator my_service db 'MY_SERVICE',0 ;max 16 chars include zero
version dd (5 shl 16) or (API_VERSION and 0xFFFF) msgInit db 'detect hardware...',13,10,0
msgPCI db 'PCI accsess not supported',13,10,0
my_service db 'MY_SERVICE',0 ;max 16 chars include zero msgFail db 'device not found',13,10,0
msgInit db 'detect hardware...',13,10,0 section '.data' data readable writable align 16
msgPCI db 'PCI accsess not supported',13,10,0
msgFail db 'device not found',13,10,0 ;all uninitialized data place here
section '.data' data readable writable align 16
;all uninitialized data place here

View File

@@ -1,10 +1,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
_esp equ esp _esp equ esp

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; 02.02.2010 turbanoff - support 70.5 ;; ;; 02.02.2010 turbanoff - support 70.5 ;;
;; 23.01.2010 turbanoff - support 70.0 70.1 ;; ;; 23.01.2010 turbanoff - support 70.0 70.1 ;;
;; ;; ;; ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; FAT12.INC ;; ;; FAT12.INC ;;
@@ -8,7 +8,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
n_sector dd 0 ; temporary save for sector value n_sector dd 0 ; temporary save for sector value

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; FAT32.INC ;; ;; FAT32.INC ;;
@@ -44,7 +44,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
cache_max equ 1919 ; max. is 1919*512+0x610000=0x6ffe00 cache_max equ 1919 ; max. is 1919*512+0x610000=0x6ffe00

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; ;; ;; ;;
@@ -17,7 +17,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
iglobal iglobal

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
image_of_eax EQU esp+32 image_of_eax EQU esp+32

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
uglobal uglobal

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
ntfs_test_bootsec: ntfs_test_bootsec:

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -14,7 +14,7 @@
; ;
;------------------------------------------------------------------------- ;-------------------------------------------------------------------------
$Revision$ $Revision $
iglobal iglobal

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;************************************************************* ;*************************************************************

View File

@@ -1,12 +1,12 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;============================================================================== ;==============================================================================
;///// public functions /////////////////////////////////////////////////////// ;///// public functions ///////////////////////////////////////////////////////
@@ -133,7 +133,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
call button._.button_dececx call button._.button_dececx
push edi push edi
xor edi, edi xor edi, edi
call [draw_line] ; call [draw_line]
call __sys_draw_line
pop edi pop edi
add ebx, 0x00010001 add ebx, 0x00010001
dec edx dec edx
@@ -164,7 +165,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
xor edi, edi xor edi, edi
mov ecx, esi mov ecx, esi
call button._.incecx call button._.incecx
call [draw_line] ; call [draw_line]
call __sys_draw_line
; bottom border ; bottom border
movzx edx, word[esp + 4 + 0] movzx edx, word[esp + 4 + 0]
@@ -173,7 +175,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
add ebx, edx add ebx, edx
mov ecx, esi mov ecx, esi
call button._.dececx call button._.dececx
call [draw_line] ; call [draw_line]
call __sys_draw_line
; left border ; left border
pop ebx pop ebx
@@ -188,7 +191,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
pop edx pop edx
mov ecx, esi mov ecx, esi
call button._.incecx call button._.incecx
call [draw_line] ; call [draw_line]
call __sys_draw_line
; right border ; right border
mov dx, [esp + 4] mov dx, [esp + 4]
@@ -198,7 +202,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
add ebx, 0x00010000 add ebx, 0x00010000
mov ecx, esi mov ecx, esi
call button._.dececx call button._.dececx
call [draw_line] ; call [draw_line]
call __sys_draw_line
pop ecx ebx pop ecx ebx

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
WINDOW_MOVE_AND_RESIZE_FLAGS = \ WINDOW_MOVE_AND_RESIZE_FLAGS = \
mouse.WINDOW_RESIZE_N_FLAG + \ mouse.WINDOW_RESIZE_N_FLAG + \
@@ -22,33 +22,38 @@ align 4
endg endg
EV_SPACE = 512 EV_SPACE = 512
FreeEvents = event_start-EVENT.fd ; "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: FreeEvents = event_start-EVENT.fd ; "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
; FreeEvents.fd=event_start <EFBFBD> FreeEvents.bk=event_end ; FreeEvents.fd=event_start <EFBFBD> FreeEvents.bk=event_end
align 4 ;-----------------------------------------------------------------------------
init_events: ;; used from kernel.asm align 4
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT init_events: ;; used from kernel.asm
or eax, eax stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
jz .fail or eax, eax
; eax - current event, ebx - previos event below jz .fail
; eax - current event, ebx - previos event below
mov ecx, EV_SPACE ; current - in allocated space mov ecx, EV_SPACE ; current - in allocated space
mov ebx, FreeEvents ; previos - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mov ebx, FreeEvents ; previos - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
push ebx ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> push ebx ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@: ;--------------------------------------
mov [ebx+EVENT.fd], eax align 4
mov [eax+EVENT.bk], ebx @@:
mov ebx, eax ; previos <- current mov [ebx+EVENT.fd], eax
add eax, sizeof.EVENT ; new current
loop @b
pop eax ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [ebx+EVENT.fd], eax
mov [eax+EVENT.bk], ebx mov [eax+EVENT.bk], ebx
mov ebx, eax ; previos <- current
add eax, sizeof.EVENT ; new current
loop @b
pop eax ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [ebx+EVENT.fd], eax
mov [eax+EVENT.bk], ebx
;--------------------------------------
align 4
.fail: .fail:
ret ret
;-----------------------------------------------------------------------------
EVENT_WATCHED equ 0x10000000 ;<EFBFBD><EFBFBD><EFBFBD> 28 EVENT_WATCHED equ 0x10000000 ;<EFBFBD><EFBFBD><EFBFBD> 28
EVENT_SIGNALED equ 0x20000000 ;<EFBFBD><EFBFBD><EFBFBD> 29 EVENT_SIGNALED equ 0x20000000 ;<EFBFBD><EFBFBD><EFBFBD> 29
MANUAL_RESET equ 0x40000000 ;<EFBFBD><EFBFBD><EFBFBD> 30 MANUAL_RESET equ 0x40000000 ;<EFBFBD><EFBFBD><EFBFBD> 30
MANUAL_DESTROY equ 0x80000000 ;<EFBFBD><EFBFBD><EFBFBD> 31 MANUAL_DESTROY equ 0x80000000 ;<EFBFBD><EFBFBD><EFBFBD> 31
;-----------------------------------------------------------------------------
align 4 align 4
create_event: ;; EXPORT use create_event: ;; EXPORT use
;info: ;info:
@@ -67,7 +72,8 @@ create_event: ;; EXPORT use
mov edx, [edx+TASKDATA.pid] mov edx, [edx+TASKDATA.pid]
pushfd pushfd
cli cli
;--------------------------------------
align 4
set_event: ;; INTERNAL use !!! don't use for Call set_event: ;; INTERNAL use !!! don't use for Call
;info: ;info:
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> event <20><> FreeEvents, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ecx,edx,esi ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> event <20><> FreeEvents, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ecx,edx,esi
@@ -89,7 +95,9 @@ set_event: ;; INTERNAL use !!! don't use
call init_events call init_events
popad popad
jz RemoveEventTo.break ; POPF+RET jz RemoveEventTo.break ; POPF+RET
@@: ;--------------------------------------
align 4
@@:
mov eax, [eax+EVENT.fd] mov eax, [eax+EVENT.fd]
mov [eax+EVENT.magic], 'EVNT' mov [eax+EVENT.magic], 'EVNT'
mov [eax+EVENT.destroy], destroy_event.internal mov [eax+EVENT.destroy], destroy_event.internal
@@ -97,13 +105,14 @@ set_event: ;; INTERNAL use !!! don't use
mov [eax+EVENT.pid], edx mov [eax+EVENT.pid], edx
inc [event_uid] inc [event_uid]
Mov [eax+EVENT.id],edx,[event_uid] Mov [eax+EVENT.id],edx,[event_uid]
or esi, esi or esi, esi
jz RemoveEventTo jz RemoveEventTo
lea edi, [eax+EVENT.code] lea edi, [eax+EVENT.code]
mov ecx, (sizeof.EVENT -EVENT.code)/4 mov ecx, (sizeof.EVENT -EVENT.code)/4
cld cld
rep movsd rep movsd
;--------------------------------------
align 4
RemoveEventTo: ;; INTERNAL use !!! don't use for Call RemoveEventTo: ;; INTERNAL use !!! don't use for Call
;param: ;param:
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -118,10 +127,12 @@ RemoveEventTo: ;; INTERNAL use !!! don't use
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight
mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight
mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft
;--------------------------------------
align 4
.break: .break:
popfd popfd
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
NotDummyTest: ;; INTERNAL use (not returned for fail !!!) NotDummyTest: ;; INTERNAL use (not returned for fail !!!)
pop edi pop edi
@@ -129,6 +140,8 @@ NotDummyTest: ;; INTERNAL use (not returned
mov ebx, eax mov ebx, eax
mov eax, [ebx+EVENT.pid] mov eax, [ebx+EVENT.pid]
push edi push edi
;--------------------------------------
align 4
.small: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD>... .small: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD>...
pop edi pop edi
pushfd pushfd
@@ -137,7 +150,7 @@ NotDummyTest: ;; INTERNAL use (not returned
shl eax, 8 shl eax, 8
jz RemoveEventTo.break ; POPF+RET jz RemoveEventTo.break ; POPF+RET
jmp edi ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> jmp edi ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;-----------------------------------------------------------------------------
align 4 align 4
raise_event: ;; EXPORT use raise_event: ;; EXPORT use
;info: ;info:
@@ -152,25 +165,29 @@ raise_event: ;; EXPORT use
; esi - event data (=0 => skip) ; esi - event data (=0 => skip)
;scratched: ebx,ecx,esi,edi ;scratched: ebx,ecx,esi,edi
call NotDummyTest ; not returned for fail !!! call NotDummyTest ; not returned for fail !!!
or esi, esi or esi, esi
jz @f jz @f
lea edi, [ebx+EVENT.code] lea edi, [ebx+EVENT.code]
mov ecx, (sizeof.EVENT -EVENT.code)/4 mov ecx, (sizeof.EVENT -EVENT.code)/4
cld cld
rep movsd rep movsd
@@: ;--------------------------------------
align 4
@@:
test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24 test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
jnz RemoveEventTo.break ; POPF+RET jnz RemoveEventTo.break ; POPF+RET
bt edx, 28 ;EVENT_WATCHED bt edx, 28 ;EVENT_WATCHED
jnc @f jnc @f
test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24 test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24
jz RemoveEventTo.break ; POPF+RET jz RemoveEventTo.break ; POPF+RET
@@: ;--------------------------------------
align 4
@@:
or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24 or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
add eax, SLOT_BASE+APP_EV_OFFSET add eax, SLOT_BASE+APP_EV_OFFSET
xchg eax, ebx xchg eax, ebx
jmp RemoveEventTo jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4 align 4
clear_event: ;; EXPORT use clear_event: ;; EXPORT use
;info: ;info:
@@ -184,7 +201,7 @@ clear_event: ;; EXPORT use
and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24) and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
xchg eax, ebx xchg eax, ebx
jmp RemoveEventTo jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4 align 4
send_event: ;; EXPORT use send_event: ;; EXPORT use
;info: ;info:
@@ -207,7 +224,7 @@ send_event: ;; EXPORT use
lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET] lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET]
mov ecx, EVENT_SIGNALED mov ecx, EVENT_SIGNALED
jmp set_event jmp set_event
;-----------------------------------------------------------------------------
align 4 align 4
DummyTest: ;; INTERNAL use (not returned for fail !!!) DummyTest: ;; INTERNAL use (not returned for fail !!!)
;param: ;param:
@@ -217,16 +234,21 @@ DummyTest: ;; INTERNAL use (not returned
jne @f jne @f
cmp [eax+EVENT.id], ebx cmp [eax+EVENT.id], ebx
je .ret je .ret
@@: ;--------------------------------------
align 4
@@:
pop eax pop eax
xor eax, eax xor eax, eax
;--------------------------------------
align 4
.ret: .ret:
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
Wait_events: Wait_events:
or ebx, -1; infinite timeout or ebx, -1; infinite timeout
;--------------------------------------
align 4
Wait_events_ex: Wait_events_ex:
;info: ;info:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 5-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 5-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
@@ -260,9 +282,11 @@ Wait_events_ex:
mov [eax+TASKDATA.state], 5 mov [eax+TASKDATA.state], 5
call change_task call change_task
mov eax, [esi+APPDATA.wait_param] mov eax, [esi+APPDATA.wait_param]
@@: ;--------------------------------------
align 4
@@:
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
wait_event: ;; EXPORT use wait_event: ;; EXPORT use
;info: ;info:
@@ -281,7 +305,7 @@ wait_event: ;; EXPORT use
mov edx, get_event_alone ; wait_test mov edx, get_event_alone ; wait_test
call Wait_events ; timeout ignored call Wait_events ; timeout ignored
jmp wait_finish jmp wait_finish
;-----------------------------------------------------------------------------
align 4 align 4
get_event_ex: ;; f68:14 get_event_ex: ;; f68:14
;info: ;info:
@@ -296,16 +320,18 @@ get_event_ex: ;; f68:14
;retval: ;retval:
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
;scratched: ebx,ecx,edx,esi,edi ;scratched: ebx,ecx,edx,esi,edi
mov edx, get_event_queue ; wait_test mov edx, get_event_queue ; wait_test
call Wait_events ; timeout ignored call Wait_events ; timeout ignored
lea esi, [eax+EVENT.code] lea esi, [eax+EVENT.code]
mov ecx, (sizeof.EVENT-EVENT.code)/4 mov ecx, (sizeof.EVENT-EVENT.code)/4
cld cld
rep movsd rep movsd
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field
wait_finish: ;--------------------------------------
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24 align 4
jnz get_event_queue.ret ; RET wait_finish:
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24
jnz get_event_queue.ret ; RET
and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24) and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24 test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24
jz destroy_event.internal jz destroy_event.internal
@@ -314,7 +340,7 @@ wait_finish:
pushfd pushfd
cli cli
jmp RemoveEventTo jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4 align 4
destroy_event: ;; EXPORT use destroy_event: ;; EXPORT use
;info: ;info:
@@ -326,6 +352,8 @@ destroy_event: ;; EXPORT use
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail) ; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail)
;scratched: ebx,ecx ;scratched: ebx,ecx
call DummyTest ; not returned for fail !!! call DummyTest ; not returned for fail !!!
;--------------------------------------
align 4
.internal: .internal:
xor ecx, ecx ; clear common header xor ecx, ecx ; clear common header
pushfd pushfd
@@ -336,7 +364,7 @@ destroy_event: ;; EXPORT use
mov [eax+EVENT.id], ecx mov [eax+EVENT.id], ecx
mov ebx, FreeEvents mov ebx, FreeEvents
jmp RemoveEventTo jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4 align 4
get_event_queue: get_event_queue:
;info: ;info:
@@ -353,9 +381,11 @@ get_event_queue:
mov eax, [ebx+APPOBJ.bk] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FIFO mov eax, [ebx+APPOBJ.bk] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FIFO
cmp eax, ebx ; empty ??? cmp eax, ebx ; empty ???
je get_event_alone.ret0 je get_event_alone.ret0
;--------------------------------------
align 4
.ret: .ret:
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
get_event_alone: get_event_alone:
;info: ;info:
@@ -372,21 +402,27 @@ get_event_alone:
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24 test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24
jnz .ret jnz .ret
or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24 or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24
;--------------------------------------
align 4
.ret0: .ret0:
xor eax, eax; NO event!!! xor eax, eax; NO event!!!
;--------------------------------------
align 4
.ret: .ret:
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
sys_sendwindowmsg: ;; f72 sys_sendwindowmsg: ;; f72
dec ebx dec ebx
jnz .ret ;subfunction==1 ? jnz .ret ;subfunction==1 ?
;pushfd ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? pushfd
cli cli
sub ecx, 2 sub ecx, 2
je .sendkey je .sendkey
dec ecx dec ecx
jnz .retf jnz .retf
;--------------------------------------
align 4
.sendbtn: .sendbtn:
cmp byte[BTN_COUNT], 1 cmp byte[BTN_COUNT], 1
jae .result ;overflow jae .result ;overflow
@@ -394,18 +430,27 @@ sys_sendwindowmsg: ;; f72
shl edx, 8 shl edx, 8
mov [BTN_BUFF], edx mov [BTN_BUFF], edx
jmp .result jmp .result
;--------------------------------------
align 4
.sendkey: .sendkey:
movzx eax, byte[KEY_COUNT] movzx eax, byte[KEY_COUNT]
cmp al, 120 cmp al, 120
jae .result ;overflow jae .result ;overflow
inc byte[KEY_COUNT] inc byte[KEY_COUNT]
mov [KEY_COUNT+1+eax], dl mov [KEY_COUNT+1+eax], dl
;--------------------------------------
align 4
.result: .result:
setae byte[esp+32] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: dword[esp+32]==72 setae byte[esp+32] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: dword[esp+32]==72
.retf: ;popfd ;--------------------------------------
align 4
.retf:
popfd
;--------------------------------------
align 4
.ret: .ret:
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
sys_getevent: ;; f11 sys_getevent: ;; f11
mov ebx, [current_slot];<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.......... mov ebx, [current_slot];<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..........
@@ -415,16 +460,18 @@ sys_getevent: ;; f11
popfd popfd
mov [esp+32], eax mov [esp+32], eax
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
sys_waitforevent: ;; f10 sys_waitforevent: ;; f10
or ebx, -1; infinite timeout or ebx, -1; infinite timeout
;--------------------------------------
align 4
sys_wait_event_timeout: ;; f23 sys_wait_event_timeout: ;; f23
mov edx, get_event_for_app; wait_test mov edx, get_event_for_app; wait_test
call Wait_events_ex ; ebx - timeout call Wait_events_ex ; ebx - timeout
mov [esp+32], eax mov [esp+32], eax
ret ret
;-----------------------------------------------------------------------------
align 4 align 4
get_event_for_app: ;; used from f10,f11,f23 get_event_for_app: ;; used from f10,f11,f23
;info: ;info:
@@ -441,46 +488,78 @@ get_event_for_app: ;; used from f10,f11,f23
shl edi, 5 shl edi, 5
add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE] add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE]
mov ecx, [edi+TASKDATA.event_mask] mov ecx, [edi+TASKDATA.event_mask]
and ecx, 0x7FFFFFFF
;--------------------------------------
align 4
.loop: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> .loop: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bsr eax, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (31 -> 0) bsr eax, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (31 -> 0)
jz .no_events ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ??? jz .no_events ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ???
btr ecx, eax ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> btr ecx, eax ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (eax) <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (eax) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cmp eax, 9 cmp eax, 9
jae .loop ; eax=[9..31], ignored jae .loop ; eax=[9..31], ignored (event 10...32)
cmp eax, 3 cmp eax, 3
je .loop ; eax=3, ignored je .loop ; eax=3, ignored (event 4)
ja .FlagAutoReset ; eax=[4..8], retvals=eax+1
cmp eax, 4
je .FlagAutoReset ; eax=4, retvals=eax+1 (event 5)
cmp eax, 5
je .mouse_check ; eax=5, retvals=eax+1 (event 6)
ja .FlagAutoReset ; eax=[6..8], retvals=eax+1 (event 7...9)
cmp eax, 1 cmp eax, 1
jae .BtKy ; eax=[1,2], retvals=eax+1 jae .BtKy ; eax=[1,2], retvals=eax+1 (event 2,3)
;--------------------------------------
align 4
.WndRedraw: ; eax=0, retval WndRedraw=1 .WndRedraw: ; eax=0, retval WndRedraw=1
cmp [edi-twdw+WDATA.fl_redraw], al;al==0 cmp [edi-twdw+WDATA.fl_redraw], al;al==0
jne .result jne .result
jmp .loop jmp .loop
.no_events: ;--------------------------------------
align 4
.no_events:
xor eax, eax xor eax, eax
ret ret
;--------------------------------------
.FlagAutoReset: ; retvals: BgrRedraw=5, Mouse=6, IPC=7, Stack=8, Debug=9 align 4
cmp eax, 5; Mouse 5+1=6 .mouse_check: ; Mouse 5+1=6
jne @f
push eax push eax
mov eax, [TASK_BASE]
mov eax, [eax + TASKDATA.event_mask]
test eax, 0x80000000 ; bit 31: active/inactive filter f.40
jz @f
pop eax
jmp .FlagAutoReset
;--------------------------------------
align 4
@@:
; If the window is captured and moved by the user, then no mouse events!!! ; If the window is captured and moved by the user, then no mouse events!!!
mov al, [mouse.active_sys_window.action] mov al, [mouse.active_sys_window.action]
and al, WINDOW_MOVE_AND_RESIZE_FLAGS and al, WINDOW_MOVE_AND_RESIZE_FLAGS
test al, al test al, al
pop eax pop eax
jnz .loop jnz .loop
@@: ;--------------------------------------
align 4
.FlagAutoReset: ; retvals: BgrRedraw=5, IPC=7, Stack=8, Debug=9
btr [ebx+APPDATA.event_mask], eax btr [ebx+APPDATA.event_mask], eax
jnc .loop jnc .loop
.result: ; retval = eax+1 ;--------------------------------------
align 4
.result: ; retval = eax+1
inc eax inc eax
ret ret
.BtKy: ;--------------------------------------
align 4
.BtKy:
movzx edx, bh movzx edx, bh
movzx edx, word[WIN_STACK+edx*2] movzx edx, word[WIN_STACK+edx*2]
je .Keys ; eax=1, retval Keys=2 je .Keys ; eax=1, retval Keys=2
;--------------------------------------
align 4
.Buttons: ; eax=2, retval Buttons=3 .Buttons: ; eax=2, retval Buttons=3
cmp byte[BTN_COUNT], 0 cmp byte[BTN_COUNT], 0
je .loop ; empty ??? je .loop ; empty ???
@@ -493,14 +572,20 @@ get_event_for_app: ;; used from f10,f11,f23
mov [window_minimize], 1 mov [window_minimize], 1
dec byte[BTN_COUNT] dec byte[BTN_COUNT]
jmp .loop jmp .loop
;--------------------------------------
align 4
.Keys: ; eax==1 .Keys: ; eax==1
cmp edx, [TASK_COUNT] cmp edx, [TASK_COUNT]
jne @f ; not Top ??? jne @f ; not Top ???
cmp [KEY_COUNT], al; al==1 cmp [KEY_COUNT], al; al==1
jae .result ; not empty ??? jae .result ; not empty ???
@@: ;--------------------------------------
align 4
@@:
mov edx, hotkey_buffer mov edx, hotkey_buffer
@@: ;--------------------------------------
align 4
@@:
cmp [edx], bh ; bh - slot for testing cmp [edx], bh ; bh - slot for testing
je .result je .result
add edx, 8 add edx, 8
@@ -508,3 +593,4 @@ get_event_for_app: ;; used from f10,f11,f23
jb @b jb @b
jmp .loop jmp .loop
;end. ;end.
;-----------------------------------------------------------------------------

View File

@@ -1,132 +1,231 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; // Alver 22.06.2008 // { ;------------------------------------------------------------------------------
align 4 align 4
dtext_asciiz_esi: ; for skins title out dtext_asciiz_esi: ; for skins title out
push eax push eax
xor eax, eax xor eax, eax
inc eax inc eax
jmp dtext.1 jmp dtext.1
; } \\ Alver \\ ;------------------------------------------------------------------------------
align 4 align 4
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) dtext:
; ebx x & y ; ebx x & y
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) ; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
; X = ABnnb: ; X = ABnnb:
; nn = font ; nn = font
; A = 0 <=> output esi characters; otherwise output ASCIIZ string ; A = 0 <=> output esi characters; otherwise output ASCIIZ string
; B = 1 <=> fill background with color eax ; B = 1 <=> fill background with color eax
; edx start of text ; edx start of text
; edi 1 force ; edi 1 force or user area for redirect
; // Alver 22.06.2008 // {
push eax push eax
xor eax, eax xor eax, eax
;--------------------------------------
align 4
.1: .1:
; } \\ Alver \\
pushad pushad
call [_display.disable_mouse]
movsx eax, bx ; eax=y movsx eax, bx ; eax=y
sar ebx, 16 ; ebx=x sar ebx, 16 ; ebx=x
xchg eax, ebx ; eax=x, ebx=y xchg eax, ebx ; eax=x, ebx=y
cmp esi, 255 cmp esi, 255
jb .loop jb .loop
mov esi, 255 mov esi, 255
;--------------------------------------
align 4
.loop: .loop:
test ecx, ecx test ecx, ecx
js .test_asciiz js .test_asciiz
dec esi dec esi
js .end js .end
jmp @f jmp @f
;--------------------------------------
align 4
.test_asciiz: .test_asciiz:
cmp byte [edx], 0 cmp byte [edx], 0
jz .end jz .end
; // Alver 22.06.2008 // {
cmp byte [esp+28], 1 cmp byte [esp+28], 1
jne @f jne @f
dec esi dec esi
js .end js .end
; } \\ Alver \\ ;--------------------------------------
align 4
@@: @@:
inc edx inc edx
pushad pushad
movzx edx, byte [edx-1] movzx edx, byte [edx-1]
test ecx, 0x10000000 test ecx, 0x10000000
jnz .font2 jnz .font2
mov esi, 9 mov esi, 9
lea ebp, [FONT_I+8*edx+edx] lea ebp, [FONT_I+8*edx+edx]
;--------------------------------------
align 4
.symloop1: .symloop1:
mov dl, byte [ebp] mov dl, byte [ebp]
or dl, 1 shl 6 or dl, 1 shl 6
;--------------------------------------
align 4
.pixloop1: .pixloop1:
shr dl, 1 shr dl, 1
jz .pixloop1end jz .pixloop1end
jnc .nopix jnc .nopix
call [putpixel]
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
jmp .pixloop1cont jmp .pixloop1cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel]
call __sys_putpixel
jmp .pixloop1cont
;--------------------------------------
align 4
.nopix: .nopix:
test ecx, 0x40000000 test ecx, 0x40000000
jz .pixloop1cont jz .pixloop1cont
push ecx push ecx
mov ecx, [esp+4+20h+20h] mov ecx, [esp+4+20h+20h]
call [putpixel]
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
pop ecx pop ecx
jmp .pixloop1cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop ecx
;--------------------------------------
align 4
.pixloop1cont: .pixloop1cont:
inc eax inc eax
jmp .pixloop1 jmp .pixloop1
;--------------------------------------
align 4
.pixloop1end: .pixloop1end:
sub eax, 6 sub eax, 6
inc ebx inc ebx
inc ebp inc ebp
dec esi dec esi
jnz .symloop1 jnz .symloop1
popad popad
add eax, 6 add eax, 6
jmp .loop jmp .loop
;--------------------------------------
align 4
.font2: .font2:
add edx, edx add edx, edx
lea ebp, [FONT_II+4*edx+edx+1] lea ebp, [FONT_II+4*edx+edx+1]
push 9 push 9
movzx esi, byte [ebp-1] movzx esi, byte [ebp-1]
;--------------------------------------
align 4
.symloop2: .symloop2:
mov dl, byte [ebp] mov dl, byte [ebp]
push esi push esi
;--------------------------------------
align 4
.pixloop2: .pixloop2:
shr dl, 1 shr dl, 1
jnc .nopix2 jnc .nopix2
call [putpixel]
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
jmp .pixloop2cont jmp .pixloop2cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel]
call __sys_putpixel
jmp .pixloop2cont
;--------------------------------------
align 4
.nopix2: .nopix2:
test ecx, 0x40000000 test ecx, 0x40000000
jz .pixloop2cont jz .pixloop2cont
push ecx push ecx
mov ecx, [esp+12+20h+20h] mov ecx, [esp+12+20h+20h]
call [putpixel]
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
pop ecx pop ecx
jmp .pixloop2cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop ecx
;--------------------------------------
align 4
.pixloop2cont: .pixloop2cont:
inc eax inc eax
dec esi dec esi
jnz .pixloop2 jnz .pixloop2
pop esi pop esi
sub eax, esi sub eax, esi
inc ebx inc ebx
inc ebp inc ebp
dec dword [esp] dec dword [esp]
jnz .symloop2 jnz .symloop2
pop eax pop eax
add dword [esp+28], esi add dword [esp+28], esi
popad popad
jmp .loop jmp .loop
;--------------------------------------
align 4
.end: .end:
popad popad
pop eax ; << // Alver 22.06.2008 // << pop eax
ret ret
;------------------------------------------------------------------------------
; eax = x coordinate
; ebx = y coordinate
; ecx = ?? RR GG BB
; edi = user area
align 4
draw_text_to_user_area:
pushad
imul ebx, [edi+0]
add eax, ebx
shl eax, 2
add eax, edi
add eax, 8
and ecx, 0xffffff
or ecx, 0xff000000 ; not transparent
mov [eax], ecx ; store pixel
popad
ret
;------------------------------------------------------------------------------

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2010. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2010-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
include 'mousepointer.inc' include 'mousepointer.inc'
@@ -527,9 +527,12 @@ mouse._.find_sys_window_under_cursor: ;////////////////////////////////////////
;< esi = process slot ;< esi = process slot
;< edi = pointer to WDATA struct ;< edi = pointer to WDATA struct
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
mov esi, [Screen_Max_X] ; mov esi, [Screen_Max_X]
inc esi ; inc esi
imul esi, [mouse.state.pos.y] ; imul esi, [mouse.state.pos.y]
mov esi, [mouse.state.pos.y]
mov esi, [d_width_calc_area + esi*4]
add esi, [_WinMapAddress] add esi, [_WinMapAddress]
add esi, [mouse.state.pos.x] add esi, [mouse.state.pos.x]
movzx esi, byte[esi] movzx esi, byte[esi]
@@ -565,22 +568,22 @@ mouse._.find_sys_button_under_cursor: ;////////////////////////////////////////
call mouse._.find_sys_window_under_cursor call mouse._.find_sys_window_under_cursor
mov edx, esi mov edx, esi
; check if any process button contains cursor ; check if any process button contains cursor
mov eax, [BTN_ADDR] mov eax, [BTN_ADDR]
mov ecx, [eax] mov ecx, [eax]
imul esi, ecx, sizeof.SYS_BUTTON imul esi, ecx, sizeof.SYS_BUTTON
add esi, eax add esi, eax
inc ecx inc ecx
add esi, sizeof.SYS_BUTTON add esi, sizeof.SYS_BUTTON
.next_button: .next_button:
dec ecx dec ecx
jz .not_found jz .not_found
add esi, -sizeof.SYS_BUTTON add esi, -sizeof.SYS_BUTTON
; does it belong to our process? ; does it belong to our process?
cmp dx, [esi + SYS_BUTTON.pslot] cmp dx, [esi + SYS_BUTTON.pslot]
jne .next_button jne .next_button
; does it contain cursor coordinates? ; does it contain cursor coordinates?

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision: 2288 $ $Revision: 2288 $

View File

@@ -1,17 +1,18 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
include "skindata.inc" include "skindata.inc"
;skin_data = 0x00778000 ;skin_data = 0x00778000
;------------------------------------------------------------------------------
align 4
read_skin_file: read_skin_file:
stdcall load_file, ebx stdcall load_file, ebx
test eax, eax test eax, eax
@@ -21,6 +22,8 @@ read_skin_file:
cmp ebx, 32*1024 cmp ebx, 32*1024
jb @f jb @f
mov ebx, 32*1024 mov ebx, 32*1024
;--------------------------------------
align 4
@@: @@:
lea ecx, [ebx+3] lea ecx, [ebx+3]
shr ecx, 2 shr ecx, 2
@@ -32,16 +35,20 @@ read_skin_file:
call parse_skin_data call parse_skin_data
xor eax, eax xor eax, eax
ret ret
;--------------------------------------
align 4
.notfound: .notfound:
xor eax, eax xor eax, eax
inc eax inc eax
ret ret
;--------------------------------------
align 4
.noskin: .noskin:
stdcall kernel_free, eax stdcall kernel_free, eax
push 2 push 2
pop eax pop eax
ret ret
;------------------------------------------------------------------------------
struct SKIN_HEADER struct SKIN_HEADER
ident dd ? ident dd ?
version dd ? version dd ?
@@ -81,13 +88,15 @@ struct SKIN_BITMAPS
type dw ? type dw ?
data dd ? data dd ?
ends ends
;------------------------------------------------------------------------------
align 4
load_default_skin: load_default_skin:
mov [_skinh], 22 mov [_skinh], 22
mov ebx, _skin_file_default mov ebx, _skin_file_default
call read_skin_file call read_skin_file
ret ret
;------------------------------------------------------------------------------
align 4
parse_skin_data: parse_skin_data:
mov ebp, skin_data mov ebp, skin_data
cmp [ebp+SKIN_HEADER.ident], 'SKIN' cmp [ebp+SKIN_HEADER.ident], 'SKIN'
@@ -127,7 +136,9 @@ parse_skin_data:
mov ebx, [ebp+SKIN_HEADER.bitmaps] mov ebx, [ebp+SKIN_HEADER.bitmaps]
add ebx, skin_data add ebx, skin_data
.lp1: ;--------------------------------------
align 4
.lp1:
cmp dword[ebx], 0 cmp dword[ebx], 0
je .end_bitmaps je .end_bitmaps
movzx eax, [ebx+SKIN_BITMAPS.kind] movzx eax, [ebx+SKIN_BITMAPS.kind]
@@ -139,9 +150,13 @@ parse_skin_data:
or ecx, ecx or ecx, ecx
jnz @f jnz @f
mov edx, skin_inactive.left.data mov edx, skin_inactive.left.data
@@: ;--------------------------------------
align 4
@@:
jmp .next_bitmap jmp .next_bitmap
.not_left: ;--------------------------------------
align 4
.not_left:
dec eax dec eax
jnz .not_oper jnz .not_oper
mov esi, [ebx+SKIN_BITMAPS.data] mov esi, [ebx+SKIN_BITMAPS.data]
@@ -152,9 +167,13 @@ parse_skin_data:
or ecx, ecx or ecx, ecx
jnz @f jnz @f
mov edx, skin_inactive.oper.data mov edx, skin_inactive.oper.data
@@: ;--------------------------------------
align 4
@@:
jmp .next_bitmap jmp .next_bitmap
.not_oper: ;--------------------------------------
align 4
.not_oper:
dec eax dec eax
jnz .not_base jnz .not_base
mov eax, [skin_active.left.width] mov eax, [skin_active.left.width]
@@ -163,12 +182,18 @@ parse_skin_data:
jnz @f jnz @f
mov eax, [skin_inactive.left.width] mov eax, [skin_inactive.left.width]
mov edx, skin_inactive.base.data mov edx, skin_inactive.base.data
@@: ;--------------------------------------
align 4
@@:
jmp .next_bitmap jmp .next_bitmap
.not_base: ;--------------------------------------
align 4
.not_base:
add ebx, 8 add ebx, 8
jmp .lp1 jmp .lp1
.next_bitmap: ;--------------------------------------
align 4
.next_bitmap:
mov ecx, [ebx+SKIN_BITMAPS.data] mov ecx, [ebx+SKIN_BITMAPS.data]
add ecx, skin_data add ecx, skin_data
mov [edx+4], eax mov [edx+4], eax
@@ -178,11 +203,14 @@ parse_skin_data:
mov [edx+0], ecx mov [edx+0], ecx
add ebx, 8 add ebx, 8
jmp .lp1 jmp .lp1
.end_bitmaps: ;--------------------------------------
align 4
.end_bitmaps:
mov ebx, [ebp+SKIN_HEADER.buttons] mov ebx, [ebp+SKIN_HEADER.buttons]
add ebx, skin_data add ebx, skin_data
.lp2: ;--------------------------------------
align 4
.lp2:
cmp dword[ebx], 0 cmp dword[ebx], 0
je .end_buttons je .end_buttons
mov eax, [ebx+SKIN_BUTTONS.type] mov eax, [ebx+SKIN_BUTTONS.type]
@@ -190,15 +218,21 @@ parse_skin_data:
jnz .not_close jnz .not_close
mov edx, skin_btn_close mov edx, skin_btn_close
jmp .next_button jmp .next_button
.not_close: ;--------------------------------------
align 4
.not_close:
dec eax dec eax
jnz .not_minimize jnz .not_minimize
mov edx, skin_btn_minimize mov edx, skin_btn_minimize
jmp .next_button jmp .next_button
.not_minimize: ;--------------------------------------
align 4
.not_minimize:
add ebx, 12 add ebx, 12
jmp .lp2 jmp .lp2
.next_button: ;--------------------------------------
align 4
.next_button:
movsx eax, [ebx+SKIN_BUTTONS.left] movsx eax, [ebx+SKIN_BUTTONS.left]
mov [edx+SKIN_BUTTON.left], eax mov [edx+SKIN_BUTTON.left], eax
movsx eax, [ebx+SKIN_BUTTONS.top] movsx eax, [ebx+SKIN_BUTTONS.top]
@@ -209,26 +243,22 @@ parse_skin_data:
mov [edx+SKIN_BUTTON.height], eax mov [edx+SKIN_BUTTON.height], eax
add ebx, 12 add ebx, 12
jmp .lp2 jmp .lp2
.end_buttons: ;--------------------------------------
align 4
.exit: .end_buttons:
.exit:
ret ret
;------------------------------------------------------------------------------
sys_putimage_with_check: align 4
or ebx, ebx
jz @f
call sys_putimage.forced
@@:
ret
drawwindow_IV_caption: drawwindow_IV_caption:
mov ebp, skin_active mov ebp, skin_active
or al, al or al, al
jnz @f jnz @f
mov ebp, skin_inactive mov ebp, skin_inactive
@@: ;--------------------------------------
align 4
@@:
mov esi, [esp+4] mov esi, [esp+4]
mov eax, [esi+WDATA.box.width] ; window width mov eax, [esi+WDATA.box.width] ; window width
mov edx, [ebp+SKIN_DATA.left.left] mov edx, [ebp+SKIN_DATA.left.left]
@@ -238,8 +268,12 @@ drawwindow_IV_caption:
add ecx, [_skinh] add ecx, [_skinh]
mov ebx, [ebp+SKIN_DATA.left.data] mov ebx, [ebp+SKIN_DATA.left.data]
call sys_putimage_with_check or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
mov esi, [esp+4] mov esi, [esp+4]
mov eax, [esi+WDATA.box.width] mov eax, [esi+WDATA.box.width]
sub eax, [ebp+SKIN_DATA.left.width] sub eax, [ebp+SKIN_DATA.left.width]
@@ -260,18 +294,28 @@ drawwindow_IV_caption:
mov edx, [ebp+SKIN_DATA.base.left] mov edx, [ebp+SKIN_DATA.base.left]
sub edx, [ebp+SKIN_DATA.base.width] sub edx, [ebp+SKIN_DATA.base.width]
shl edx, 16 shl edx, 16
.baseskinloop: ;--------------------------------------
align 4
.baseskinloop:
shr edx, 16 shr edx, 16
add edx, [ebp+SKIN_DATA.base.width] add edx, [ebp+SKIN_DATA.base.width]
shl edx, 16 shl edx, 16
push eax ebx ecx edx push eax ebx ecx edx
call sys_putimage_with_check
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
pop edx ecx ebx eax pop edx ecx ebx eax
dec eax dec eax
jnz .baseskinloop jnz .baseskinloop
.non_base: ;--------------------------------------
align 4
.non_base:
mov esi, [esp+4] mov esi, [esp+4]
mov edx, [esi+WDATA.box.width] mov edx, [esi+WDATA.box.width]
@@ -283,16 +327,18 @@ drawwindow_IV_caption:
mov ecx, [ebp+SKIN_DATA.oper.width] mov ecx, [ebp+SKIN_DATA.oper.width]
shl ecx, 16 shl ecx, 16
add ecx, [_skinh] add ecx, [_skinh]
call sys_putimage_with_check
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
ret ret
;------------------------------------------------------------------------------
;//mike.dld, 2006-08-02 ] align 4
drawwindow_IV: drawwindow_IV:
;param1 - aw_yes ;param1 - aw_yes
pusha pusha
push edx push edx
@@ -303,8 +349,9 @@ drawwindow_IV:
cmp byte [esp+32+4+4], 0 cmp byte [esp+32+4+4], 0
jne @f jne @f
mov ebp, skin_inactive mov ebp, skin_inactive
@@: ;--------------------------------------
align 4
@@:
mov eax, [edi+WDATA.box.left] mov eax, [edi+WDATA.box.left]
shl eax, 16 shl eax, 16
mov ax, word [edi+WDATA.box.left] mov ax, word [edi+WDATA.box.left]
@@ -313,32 +360,42 @@ drawwindow_IV:
shl ebx, 16 shl ebx, 16
mov bx, word [edi+WDATA.box.top] mov bx, word [edi+WDATA.box.top]
add bx, word [edi+WDATA.box.height] add bx, word [edi+WDATA.box.height]
; mov esi,[edi+24]
; shr esi,1
; and esi,0x007f7f7f
mov esi, [ebp+SKIN_DATA.colors.outer] mov esi, [ebp+SKIN_DATA.colors.outer]
or esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
ror ebx, 16
add ebx, [_skinh]
sub bx, 1
rol ebx, 16
call draw_rectangle call draw_rectangle
mov ecx, 3 mov ecx, 3
_dw3l: ;--------------------------------------
align 4
_dw3l:
add eax, 1*65536-1 add eax, 1*65536-1
add ebx, 1*65536-1 add ebx, 0*65536-1
test ax, ax test ax, ax
js no_skin_add_button js no_skin_add_button
test bx, bx test bx, bx
js no_skin_add_button js no_skin_add_button
mov esi, [ebp+SKIN_DATA.colors.frame];[edi+24] mov esi, [ebp+SKIN_DATA.colors.frame];[edi+24]
or esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
call draw_rectangle call draw_rectangle
dec ecx dec ecx
jnz _dw3l jnz _dw3l
mov esi, [ebp+SKIN_DATA.colors.inner] mov esi, [ebp+SKIN_DATA.colors.inner]
or esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
add eax, 1*65536-1 add eax, 1*65536-1
add ebx, 1*65536-1 add ebx, 0*65536-1
test ax, ax test ax, ax
js no_skin_add_button js no_skin_add_button
test bx, bx test bx, bx
js no_skin_add_button js no_skin_add_button
test [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP
jnz @f
call draw_rectangle call draw_rectangle
;--------------------------------------
align 4
@@:
cmp dword[skin_data], 'SKIN' cmp dword[skin_data], 'SKIN'
je @f je @f
xor eax, eax xor eax, eax
@@ -348,15 +405,17 @@ drawwindow_IV:
inc ecx inc ecx
mov edx, [_skinh] mov edx, [_skinh]
mov edi, [common_colours+4]; standard grab color mov edi, [common_colours+4]; standard grab color
call [drawbar] ; call [drawbar]
call vesa20_drawbar
jmp draw_clientbar jmp draw_clientbar
@@: ;--------------------------------------
align 4
@@:
mov al, [esp+32+4+4] mov al, [esp+32+4+4]
call drawwindow_IV_caption call drawwindow_IV_caption
;--------------------------------------
draw_clientbar: align 4
draw_clientbar:
mov esi, [esp] mov esi, [esp]
mov edx, [esi+WDATA.box.top] ; WORK AREA mov edx, [esi+WDATA.box.top] ; WORK AREA
@@ -374,12 +433,13 @@ drawwindow_IV:
mov edi, [esi+WDATA.cl_workarea] mov edi, [esi+WDATA.cl_workarea]
test edi, 0x40000000 test edi, 0x40000000
jnz _noinside2 jnz _noinside2
call [drawbar] ; call [drawbar]
_noinside2: call vesa20_drawbar
;--------------------------------------
align 4
_noinside2:
cmp dword[skin_data], 'SKIN' cmp dword[skin_data], 'SKIN'
jne no_skin_add_button jne no_skin_add_button
;* close button ;* close button
mov edi, [BTN_ADDR] mov edi, [BTN_ADDR]
movzx eax, word [edi] movzx eax, word [edi]
@@ -404,7 +464,9 @@ drawwindow_IV:
mov ebx, [esp] mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width] mov ebx, [ebx+WDATA.box.width]
inc ebx inc ebx
_bCx_at_right: ;--------------------------------------
align 4
_bCx_at_right:
add ebx, [skin_btn_close.left] add ebx, [skin_btn_close.left]
mov [eax], bx mov [eax], bx
add eax, 2 ; x size add eax, 2 ; x size
@@ -418,7 +480,6 @@ drawwindow_IV:
mov ebx, [skin_btn_close.height] mov ebx, [skin_btn_close.height]
dec ebx dec ebx
mov [eax], bx mov [eax], bx
;* minimize button ;* minimize button
mov edi, [BTN_ADDR] mov edi, [BTN_ADDR]
movzx eax, word [edi] movzx eax, word [edi]
@@ -443,7 +504,9 @@ drawwindow_IV:
mov ebx, [esp] mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width] mov ebx, [ebx+WDATA.box.width]
inc ebx inc ebx
_bMx_at_right: ;--------------------------------------
align 4
_bMx_at_right:
add ebx, [skin_btn_minimize.left] add ebx, [skin_btn_minimize.left]
mov [eax], bx mov [eax], bx
add eax, 2 ; x size add eax, 2 ; x size
@@ -457,10 +520,10 @@ drawwindow_IV:
mov ebx, [skin_btn_minimize.height] mov ebx, [skin_btn_minimize.height]
dec ebx dec ebx
mov [eax], bx mov [eax], bx
;--------------------------------------
no_skin_add_button: align 4
no_skin_add_button:
pop edi pop edi
popa popa
ret 4 ret 4
;------------------------------------------------------------------------------

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; ;

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; check mouse ; check mouse
@@ -22,36 +22,32 @@ $Revision$
; FCFF com1/ps2 buffer count starting from FC00 ; FCFF com1/ps2 buffer count starting from FC00
uglobal uglobal
;--------------------------------------
align 4
mousecount dd 0x0 mousecount dd 0x0
mousedata dd 0x0 mousedata dd 0x0
Y_UNDER_subtraction_CUR_hot_y:
dd 0
X_UNDER_subtraction_CUR_hot_x:
dd 0
Y_UNDER_sub_CUR_hot_y_add_curh:
dd 0
X_UNDER_sub_CUR_hot_x_add_curh:
dd 0
endg endg
iglobal iglobal
;--------------------------------------
align 4
mouse_delay dd 10 mouse_delay dd 10
mouse_speed_factor: mouse_speed_factor:
dd 3 dd 3
mouse_timer_ticks dd 0 mouse_timer_ticks dd 0
endg endg
;-----------------------------------------------------------------------------
;include 'm_com.inc' align 4
;test_mario79:
; push esi
; push eax
; mov [write_error_to],process_test_m79+43
; movzx eax,al ;[DevErrorCode]
; call writehex
; mov esi,process_test_m79
; call sys_msg_board_str
; pop eax
; pop esi
; ret
;process_test_m79 db 'K : Process - test Mario79 error 00000000',13,10,0
draw_mouse_under: draw_mouse_under:
; return old picture ; return old picture
cmp [_display.restore_cursor], 0 cmp [_display.restore_cursor], 0
je @F je @F
@@ -61,11 +57,14 @@ draw_mouse_under:
stdcall [_display.restore_cursor], eax, ebx stdcall [_display.restore_cursor], eax, ebx
popad popad
ret ret
;--------------------------------------
align 4
@@: @@:
pushad pushad
xor ecx, ecx xor ecx, ecx
xor edx, edx xor edx, edx
align 4 ;--------------------------------------
align 4
mres: mres:
movzx eax, word [X_UNDER] movzx eax, word [X_UNDER]
movzx ebx, word [Y_UNDER] movzx ebx, word [Y_UNDER]
@@ -83,8 +82,10 @@ mres:
mov ecx, [eax] mov ecx, [eax]
pop ebx pop ebx
pop eax pop eax
mov edi, 1;force mov edi, 1 ; force
call [putpixel] or ecx, 0x04000000 ; don't save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop edx pop edx
pop ecx pop ecx
inc ecx inc ecx
@@ -96,9 +97,9 @@ mres:
jnz mres jnz mres
popad popad
ret ret
;-----------------------------------------------------------------------------
align 4
save_draw_mouse: save_draw_mouse:
cmp [_display.move_cursor], 0 cmp [_display.move_cursor], 0
je .no_hw_cursor je .no_hw_cursor
pushad pushad
@@ -110,9 +111,11 @@ save_draw_mouse:
push eax push eax
push ebx push ebx
mov ecx, [Screen_Max_X] ; mov ecx, [Screen_Max_X]
inc ecx ; inc ecx
mul ecx ; mul ecx
mov eax, [d_width_calc_area + eax*4]
add eax, [_WinMapAddress] add eax, [_WinMapAddress]
movzx edx, byte [ebx+eax] movzx edx, byte [ebx+eax]
shl edx, 8 shl edx, 8
@@ -124,17 +127,22 @@ save_draw_mouse:
push esi push esi
call [_display.select_cursor] call [_display.select_cursor]
mov [current_cursor], esi mov [current_cursor], esi
;--------------------------------------
align 4
.draw: .draw:
stdcall [_display.move_cursor], esi stdcall [_display.move_cursor], esi
popad popad
ret ret
.fail: ;--------------------------------------
mov ecx, [def_cursor] ;align 4
mov [edx+SLOT_BASE+APPDATA.cursor], ecx ;.fail:
stdcall [_display.move_cursor], ecx ; stdcall: [esp]=ebx,eax ; mov ecx, [def_cursor]
popad ; mov [edx+SLOT_BASE+APPDATA.cursor], ecx
ret ; stdcall [_display.move_cursor], ecx ; stdcall: [esp]=ebx,eax
; popad
; ret
;--------------------------------------
align 4
.no_hw_cursor: .no_hw_cursor:
pushad pushad
; save & draw ; save & draw
@@ -144,7 +152,8 @@ save_draw_mouse:
push ebx push ebx
mov ecx, 0 mov ecx, 0
mov edx, 0 mov edx, 0
align 4 ;--------------------------------------
align 4
drm: drm:
push eax push eax
push ebx push ebx
@@ -155,6 +164,7 @@ drm:
add eax, ecx; save picture under mouse add eax, ecx; save picture under mouse
add ebx, edx add ebx, edx
push ecx push ecx
or ecx, 0x04000000 ; don't load to mouseunder area
call getpixel call getpixel
mov [COLOR_TEMP], ecx mov [COLOR_TEMP], ecx
pop ecx pop ecx
@@ -164,6 +174,7 @@ drm:
add eax, ecx add eax, ecx
add eax, mouseunder add eax, mouseunder
mov ebx, [COLOR_TEMP] mov ebx, [COLOR_TEMP]
and ebx, 0xffffff
mov [eax], ebx mov [eax], ebx
pop ecx pop ecx
mov edi, edx ; y cycle mov edi, edx ; y cycle
@@ -178,6 +189,7 @@ drm:
push ecx push ecx
mov ecx, [COLOR_TEMP] mov ecx, [COLOR_TEMP]
call combine_colors call combine_colors
and ecx, 0xffffff
mov [MOUSE_COLOR_MEM], ecx mov [MOUSE_COLOR_MEM], ecx
pop ecx pop ecx
pop edx pop edx
@@ -188,8 +200,10 @@ drm:
add ebx, edx ; and y coord+cycle add ebx, edx ; and y coord+cycle
push ecx push ecx
mov ecx, [MOUSE_COLOR_MEM] mov ecx, [MOUSE_COLOR_MEM]
mov edi, 1 mov edi, 1 ; force
call [putpixel] or ecx, 0x04000000 ; don't save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop ecx pop ecx
mov ebx, [esp+0] ; pure y coord again mov ebx, [esp+0] ; pure y coord again
mov eax, [esp+4] ; and x mov eax, [esp+4] ; and x
@@ -203,8 +217,8 @@ drm:
add esp, 8 add esp, 8
popad popad
ret ret
;-----------------------------------------------------------------------------
align 4
combine_colors: combine_colors:
; in ; in
; ecx - color ( 00 RR GG BB ) ; ecx - color ( 00 RR GG BB )
@@ -272,126 +286,187 @@ combine_colors:
pop ebx pop ebx
pop eax pop eax
ret 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]
__sys_disable_mouse:
cmp dword [MOUSE_VISIBLE], dword 0
je @f
ret
@@:
pushad
cmp [CURRENT_TASK], dword 1
je disable_m
mov edx, [CURRENT_TASK]
shl edx, 5
add edx, window_data
movzx eax, word [MOUSE_X]
movzx ebx, word [MOUSE_Y]
mov ecx, [Screen_Max_X]
inc ecx
imul ecx, ebx
add ecx, eax
add ecx, [_WinMapAddress]
mov eax, [CURRENT_TASK]
cmp al, [ecx]
je yes_mouse_disable
cmp al, [ecx+16]
je yes_mouse_disable
add ebx, 10
cmp ebx, [Screen_Max_Y]
jae no_mouse_disable
mov ebx, [Screen_Max_X]
inc ebx
imul ebx, 10
add ecx, ebx
cmp al, [ecx]
je yes_mouse_disable
cmp al, [ecx+16]
je yes_mouse_disable
jmp no_mouse_disable
yes_mouse_disable:
mov edx, [CURRENT_TASK]
shl edx, 5
add edx, window_data
movzx eax, word [MOUSE_X]
movzx ebx, word [MOUSE_Y]
mov ecx, [edx+0]; mouse inside the area ?
add eax, 10
cmp eax, ecx
jb no_mouse_disable
sub eax, 10
add ecx, [edx+8]
cmp eax, ecx
jg no_mouse_disable
mov ecx, [edx+4]
add ebx, 14
cmp ebx, ecx cmp ebx, ecx
jb no_mouse_disable jb .no_mouse_area
sub ebx, 14 add ecx, 23 ; mouse cursor Y size
add ecx, [edx+12]
cmp ebx, ecx cmp ebx, ecx
jg no_mouse_disable ja .no_mouse_area
disable_m: ; offset Y
cmp dword [MOUSE_VISIBLE], dword 0 sub bx, [Y_UNDER] ;[MOUSE_Y]
jne no_mouse_disable ;--------------------------------------
pushf ; check for X
cli xor ecx, ecx
call draw_mouse_under mov cx, [X_UNDER] ;[MOUSE_X]
popf cmp eax, ecx
mov [MOUSE_VISIBLE], dword 1 jb .no_mouse_area
no_mouse_disable: add ecx, 15 ; mouse cursor X size
popad 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 ret
;--------------------------------------
__sys_draw_pointer: align 4
cmp [mouse_pause], 0 .no_mouse_area:
je @f xor ecx, ecx
pop ebx eax
ret ret
@@: ;-----------------------------------------------------------------------------
align 4
check_mouse_area_for_putpixel:
; in:
; ecx = x shl 16 + y
; eax = color
; out:
; eax = new color
push eax push eax
mov eax, [timer_ticks] ; check for Y
sub eax, [MouseTickCounter] mov ax, [Y_UNDER] ; [MOUSE_Y]
cmp eax, 1 cmp cx, ax
ja @f 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
;--------------------------------------
align 4
.end:
mov eax, ecx
ret
;--------------------------------------
align 4
.no_mouse_area:
pop eax pop eax
ret ret
@@: ;-----------------------------------------------------------------------------
mov eax, [timer_ticks] align 4
mov [MouseTickCounter], eax __sys_draw_pointer:
pop eax
pushad pushad
cmp dword [MOUSE_VISIBLE], dword 0; mouse visible ?
je chms00
mov [MOUSE_VISIBLE], dword 0
movzx ebx, word [MOUSE_Y]
movzx eax, word [MOUSE_X]
pushfd
cli
call save_draw_mouse
popfd
nodmu2:
popad
ret
chms00:
movzx ecx, word [X_UNDER] movzx ecx, word [X_UNDER]
movzx edx, word [Y_UNDER] movzx edx, word [Y_UNDER]
movzx ebx, word [MOUSE_Y] movzx ebx, word [MOUSE_Y]
movzx eax, word [MOUSE_X] movzx eax, word [MOUSE_X]
cmp [redrawmouse_unconditional], 0
je @f
mov [redrawmouse_unconditional], 0
jmp redrawmouse
;--------------------------------------
align 4
@@:
cmp eax, ecx cmp eax, ecx
jne redrawmouse jne redrawmouse
cmp ebx, edx cmp ebx, edx
jne redrawmouse je nodmp
jmp nodmp ;--------------------------------------
align 4
redrawmouse: redrawmouse:
pushfd pushfd
cli cli
call draw_mouse_under call draw_mouse_under
call save_draw_mouse call save_draw_mouse
; mov eax, [_display.select_cursor]
; test eax, eax
; jz @f
cmp [_display.select_cursor], select_cursor
jne @f
xor eax, eax
mov esi, [current_cursor]
mov ax, [Y_UNDER]
sub eax, [esi+CURSOR.hot_y]
mov [Y_UNDER_subtraction_CUR_hot_y], eax
add eax, [cur.h]
mov [Y_UNDER_sub_CUR_hot_y_add_curh], eax
mov ax, [X_UNDER]
sub eax, [esi+CURSOR.hot_x]
mov [X_UNDER_subtraction_CUR_hot_x], eax
add eax, [cur.w]
mov [X_UNDER_sub_CUR_hot_x_add_curh], eax
;--------------------------------------
align 4
@@:
popfd popfd
;--------------------------------------
align 4
nodmp: nodmp:
popad popad
ret ret
;-----------------------------------------------------------------------------
align 4
proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword
mov eax, [BtnState] mov eax, [BtnState]
@@ -404,11 +479,14 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro
jge @@M1 jge @@M1
mov eax, 0 mov eax, 0
jmp @@M2 jmp @@M2
;--------------------------------------
align 4
@@M1: @@M1:
cmp ax, [Screen_Max_X];ScreenLength cmp ax, [Screen_Max_X];ScreenLength
jl @@M2 jl @@M2
mov ax, [Screen_Max_X];ScreenLength-1 mov ax, [Screen_Max_X];ScreenLength-1
;--------------------------------------
align 4
@@M2: @@M2:
mov [MOUSE_X], ax;[XCoordinate] mov [MOUSE_X], ax;[XCoordinate]
@@ -421,11 +499,14 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro
jge @@M3 jge @@M3
mov ax, 0 mov ax, 0
jmp @@M4 jmp @@M4
;--------------------------------------
align 4
@@M3: @@M3:
cmp ax, [Screen_Max_Y];ScreenHeigth cmp ax, [Screen_Max_Y];ScreenHeigth
jl @@M4 jl @@M4
mov ax, [Screen_Max_Y];ScreenHeigth-1 mov ax, [Screen_Max_Y];ScreenHeigth-1
;--------------------------------------
align 4
@@M4: @@M4:
mov [MOUSE_Y], ax;[YCoordinate] mov [MOUSE_Y], ax;[YCoordinate]
@@ -440,7 +521,8 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro
mov [mouse_timer_ticks], eax mov [mouse_timer_ticks], eax
ret ret
endp endp
;-----------------------------------------------------------------------------
align 4
mouse_acceleration: mouse_acceleration:
push eax push eax
mov eax, [timer_ticks] mov eax, [timer_ticks]
@@ -451,6 +533,8 @@ mouse_acceleration:
;push edx ;push edx
imul eax, [mouse_speed_factor] imul eax, [mouse_speed_factor]
;pop edx ;pop edx
;--------------------------------------
align 4
@@: @@:
ret ret
;-----------------------------------------------------------------------------

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;setting date,time,clock and alarm-clock ;setting date,time,clock and alarm-clock

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -11,7 +11,7 @@
; ;
;============================================================================ ;============================================================================
$Revision$ $Revision $
align 4 align 4

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
MEM_WB equ 6 ;write-back memory MEM_WB equ 6 ;write-back memory
@@ -55,6 +55,9 @@ proc init_mem
.calcmax: .calcmax:
; round all to pages ; round all to pages
mov eax, [edi] mov eax, [edi]
cmp [edi+16], byte 1
jne .unusable
test eax, 0xFFF test eax, 0xFFF
jz @f jz @f
neg eax neg eax
@@ -87,7 +90,7 @@ proc init_mem
add esi, eax add esi, eax
jmp .usable jmp .usable
.unusable: .unusable:
and dword [edi+8], 0 ; and dword [edi+8], 0
.usable: .usable:
add edi, 20 add edi, 20
loop .calcmax loop .calcmax
@@ -195,6 +198,9 @@ proc init_page_map
mov ebx, BOOT_VAR-OS_BASE + 0x9104 mov ebx, BOOT_VAR-OS_BASE + 0x9104
mov edx, [ebx-4] mov edx, [ebx-4]
.scanmap: .scanmap:
cmp [ebx+16], byte 1
jne .next
mov ecx, [ebx+8] mov ecx, [ebx+8]
shr ecx, 12; ecx = number of pages shr ecx, 12; ecx = number of pages
jz .next jz .next
@@ -432,6 +438,11 @@ proc test_cpu
ret ret
endp endp
iglobal
align 4
acpi_lapic_base dd 0xfee00000 ; default local apic base
endg
uglobal uglobal
align 4 align 4
acpi_rsdp rd 1 acpi_rsdp rd 1
@@ -443,8 +454,10 @@ acpi_dev_size rd 1
acpi_rsdt_base rd 1 acpi_rsdt_base rd 1
acpi_madt_base rd 1 acpi_madt_base rd 1
acpi_lapic_base rd 1
acpi_ioapic_base rd 1 acpi_ioapic_base rd 1
cpu_count rd 1
smpt rd 16
endg endg
ACPI_HI_RSDP_WINDOW_START equ 0x000E0000 ACPI_HI_RSDP_WINDOW_START equ 0x000E0000
@@ -493,6 +506,7 @@ rsdt_find: ;ecx= rsdt edx= SIG
lea ebx, [ecx+36] lea ebx, [ecx+36]
mov esi, [ecx+4] mov esi, [ecx+4]
add esi, ecx add esi, ecx
align 4
.next: .next:
mov eax, [ebx] mov eax, [ebx]
cmp [eax], edx cmp [eax], edx
@@ -513,9 +527,7 @@ rsdt_find: ;ecx= rsdt edx= SIG
pop ebx pop ebx
ret ret
align 4 align 4
check_acpi: check_acpi:
call acpi_locate call acpi_locate
@@ -533,22 +545,47 @@ check_acpi:
mov ecx, [eax+36] mov ecx, [eax+36]
mov [acpi_lapic_base-OS_BASE], ecx mov [acpi_lapic_base-OS_BASE], ecx
mov edi, smpt-OS_BASE
mov ebx, [ecx+0x20]
shr ebx, 24 ; read APIC ID
mov [edi], ebx ; bootstrap always first
inc [cpu_count-OS_BASE]
add edi, 4
lea edx, [eax+44] lea edx, [eax+44]
mov ecx, [eax+4] mov ecx, [eax+4]
add ecx, eax add ecx, eax
.check: .check:
mov eax, [edx] mov eax, [edx]
cmp al, 1 cmp al, 0
je .ioapic jne .io_apic
shr eax, 24 ; get APIC ID
cmp eax, ebx ; skip self
je .next
test [edx+4], byte 1 ; is enabled ?
jz .next
cmp [cpu_count-OS_BASE], 16
jae .next
stosd ; store APIC ID
inc [cpu_count-OS_BASE]
.next: .next:
mov eax, [edx]
movzx eax, ah movzx eax, ah
add edx, eax add edx, eax
cmp edx, ecx cmp edx, ecx
jb .check jb .check
.done: .done:
ret ret
.ioapic:
.io_apic:
cmp al, 1
jne .next
mov eax, [edx+4] mov eax, [edx+4]
mov [acpi_ioapic_base-OS_BASE], eax mov [acpi_ioapic_base-OS_BASE], eax
ret jmp .next

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; KERNEL32.INC ;; ;; KERNEL32.INC ;;
@@ -13,7 +13,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
struct POINT struct POINT
x dd ? x dd ?
@@ -125,7 +125,8 @@ struct APPDATA
wait_param dd ? ;+100 +++ wait_param dd ? ;+100 +++
tls_base dd ? ;+104 tls_base dd ? ;+104
dlls_list_ptr dd ? ;+108 dlls_list_ptr dd ? ;+108
rb 16 ;+112 event_filter dd ? ;+112
rb 12 ;+116
wnd_shape dd ? ;+128 wnd_shape dd ? ;+128
wnd_shape_scale dd ? ;+132 wnd_shape_scale dd ? ;+132
@@ -145,12 +146,12 @@ struct APPDATA
wnd_caption dd ? wnd_caption dd ?
wnd_clientbox BOX wnd_clientbox BOX
ends ends
; Core functions ; Core functions
include "core/sync.inc" ; macros for synhronization objects include "core/sync.inc" ; macros for synhronization objects
include "core/sys32.inc" ; process management include "core/sys32.inc" ; process management
include "core/sched.inc" ; process scheduling include "core/sched.inc" ; process scheduling
include "core/syscall.inc" ; system call include "core/syscall.inc" ; system call
include "core/fpu.inc" ; all fpu/sse support include "core/fpu.inc" ; all fpu/sse support
@@ -194,7 +195,7 @@ include "sound/playnote.inc" ; player Note for Speaker PC
; display ; display
include "video/vesa12.inc" ; Vesa 1.2 functions ;include "video/vesa12.inc" ; Vesa 1.2 functions
include "video/vesa20.inc" ; Vesa 2.0 functions include "video/vesa20.inc" ; Vesa 2.0 functions
include "video/blitter.inc" ; include "video/blitter.inc" ;
include "video/vga.inc" ; VGA 16 color functions include "video/vga.inc" ; VGA 16 color functions

View File

@@ -1,11 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;------------------------------------------------------------------ ;------------------------------------------------------------------

View File

@@ -1,3 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
__REV = 0 __REV = 0
@@ -9,7 +15,7 @@ macro $Revision a {
\} \}
} }
$Revision$ $Revision $
;// mike.dld, 2006-29-01 [ ;// mike.dld, 2006-29-01 [

View File

@@ -1,6 +1,12 @@
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MEMORY MAP ;; ;;
; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; MEMORY MAP
;
; Boot: ; Boot:
; ;
; 0:9000 byte bits per pixel ; 0:9000 byte bits per pixel
@@ -128,13 +134,13 @@
; FE88 dword address of button list ; FE88 dword address of button list
; FE8C dword memory to use ; FE8C dword memory to use
; FE90 -> FEFF free (112) ; FE90 -> FEFF free (112)
; FF00 byte 1 = system shutdown request ; FF00 byte 1 = system shutdown request
; FF01 byte task activation request? ; FF01 byte task activation request?
; FFF0 byte >0 if redraw background request from app ; FFF0 byte >0 if redraw background request from app
; FFF1 byte >0 if background changed ; FFF1 byte free
; FFF2 write and read bank in screen ; FFF2 write and read bank in screen
; FFF4 byte 0 if first mouse draw & do not return picture under ; FFF4 byte 0 if first mouse draw & do not return picture under
; FFF5 byte 1 do not draw pointer ; FFF5 byte 1 do not draw pointer
; FFFF byte do not change task for 1/100 sec. ; FFFF byte do not change task for 1/100 sec.
; ;
; 0x80010000 -> 6CBFF kernel, 32-bit run-time code (up to 371 Kb) ; 0x80010000 -> 6CBFF kernel, 32-bit run-time code (up to 371 Kb)
@@ -195,58 +201,68 @@
; 0x80280000 -> 281FFF ramdisk fat (8k) ; 0x80280000 -> 281FFF ramdisk fat (8k)
; 0x80282000 -> 283FFF floppy fat (8k) ; 0x80282000 -> 283FFF floppy fat (8k)
; ;
; 0x80284000 -> 28BFFF HDD DMA AREA (32k) ; 0x80284000 -> 28BFFF HDD DMA AREA (32k)
; 0x8028C000 -> 297FFF free (48k) ; 0x8028C000 -> 297FFF free (48k)
; ;
; 0x80298000 -> 29ffff auxiliary table for background smoothing code (32k) ; 0x80298000 -> 29FFFF auxiliary table for background smoothing code (32k)
; ;
; 0x802A0000 -> 2B00ff wav device buffer (64k) ; 0x802A0000 -> 2B00FF wav device buffer (64k)
; 0x802A0000 -> 2B00ff wav device status (256) ; 0x802A0000 -> 2B00FF wav device status (256)
; 0x802B0100 -> 2Bffff free (63k8) ;
; 0x802C0000 -> 2C3fff button info (8k) ; 0x802B0100 -> 2B3FFD free (15k7)
; ;
; 0000 word number of buttons ; 0x802B3FEE -> 2B3FEF button info (64K+ 16 + 2 byte)
; first button entry at 0x10 ; 2B3FEE 0000 word number of buttons
; +0000 word process number ; 2B3FF0 first button entry
; +0002 word button id number : bits 00-15 ;
; +0004 word x start ; button entry at 0x10
; +0000 word process number
; +0002 word button id number : bits 00-15
; +0004 word x start
; +0006 word x size ; +0006 word x size
; +0008 word y start ; +0008 word y start
; +000A word y size ; +000A word y size
; +000C word button id number : bits 16-31 ; +000C word button id number : bits 16-31
; ;
; 0x802C4000 -> 2CFFFF free (48k) ; 0x802C4000 -> 2C9FFF area for fast getting offset to LFB (24k)
; ; BPSLine_calc_area
; 0x802D0000 -> 2DFFFF reserved port area (64k) ; 0x802CA000 -> 2CFFFF area for fast getting offset to _WinMapAddress (24k)
; ; d_width_calc_area
;
; 0x802D0000 -> 2DFFFF reserved port area (64k)
;
; 0000 dword no of port areas reserved ; 0000 dword no of port areas reserved
; 0010 dword process id ; 0010 dword process id
; dword start port ; dword start port
; dword end port ; dword end port
; dword 0 ; dword 0
; ;
; 0x802E0000 -> 2EFFFF irq data area (64k) ; 0x802E0000 -> 2EFFFF irq data area (64k) ;BOOT_VAR
; 0x802F0000 -> 2FFFFF low memory save (64k) ;
; ; 0x802F0000 -> 2F3FFF tcp memory stack_data_start eth_data_start (16k)
; 0x80300000 -> 31FFFF tcp memory (128k) ;
; 0x80320000 -> 327FFF tcp memory (32k) ; 0x802F4000 -> 30ffff stack_data | stack_data_end (112k)
; ;
; 0x80328000 -> 32FFFF !vrr driver (32k) ; 0x80310000 -> 317fff resendQ (32k)
;
; 0x80330000 -> 377FFF skin data (32k) ; 0x80318000 -> 31ffff skin_data (32k)
;
; 0x80338000 -> 338FFF draw data - 256 entries (4k) ; 0x80320000 -> 323FF3 draw data - 256 entries (4k)
; 00 dword draw limit - x start ; 00 dword draw limit - x start
; 04 dword draw limit - y start ; 04 dword draw limit - y start
; 08 dword draw limit - x end ; 08 dword draw limit - x end
; 0C dword draw limit - y end ; 0C dword draw limit - y end
; 0x80339000 -> 3BFFF3 free (12k) ;
; 0x8033BFF4 -> 33BFFF background info ; 0x8032BFF4 -> 32BFFF background info
; 0x8033C000 page map (length b = memsize shr 15) ; 0x80323FF4 BgrDrawMode
; 0x8033C000 + b start of static pagetables ; 0x80323FF8 BgrDataWidth
; 0x80323FFC BgrDataHeight
; 0x803FFFFF <- no direct address translation beyond this point ;
; ============================================================= ; 0x80324000 page map (length b = memsize shr 15)
; 0x80324000 + b start of static pagetables
; 0x803FFFFF <- no direct address translation beyond this point
; =============================================================
; 0x805FF000 -> 5FFF80 TSS ; 0x805FF000 -> 5FFF80 TSS
; 0x80600000 -> 601FFF i/o maps ; 0x80600000 -> 601FFF i/o maps

View File

@@ -1,5 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
; Macroinstructions for defining and calling procedures ; Macroinstructions for defining and calling procedures

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; PLAYNOTE.INC version 1.1 22 November 2003 ;; ;; PLAYNOTE.INC version 1.1 22 November 2003 ;;
@@ -16,7 +16,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
align 4 align 4
sound_interface: sound_interface:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,3 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
struct BLITTER_BLOCK struct BLITTER_BLOCK
xmin dd ? xmin dd ?
@@ -321,34 +327,42 @@ blit_32:
mov ecx, esp mov ecx, esp
call blit_clip call blit_clip
test eax, eax test eax, eax
jne .L57 jne .L57
inc [mouse_pause] mov eax, [TASK_BASE]
call [_display.disable_mouse]
mov ebx, [esp+BLITTER.dst_x]
mov eax, [TASK_BASE] mov ebp, [esp+BLITTER.dst_y]
add ebx, [eax-twdw + WDATA.box.left]
mov ebx, [esp+BLITTER.dst_x] add ebp, [eax-twdw + WDATA.box.top]
mov ebp, [esp+BLITTER.dst_y]
add ebx, [eax-twdw + WDATA.box.left] mov ecx, ebx
add ebp, [eax-twdw + WDATA.box.top] add ecx, [esp+BLITTER.w]
mov edi, ebp shl ecx, 16
mov cx, bp
imul edi, [_display.pitch] add ecx, [esp+BLITTER.h]
imul ebp, [_display.width]
add ebp, ebx mov edi, ebp
add ebp, [_WinMapAddress]
; imul edi, [_display.pitch]
mov edi, [BPSLine_calc_area+edi*4]
; imul ebp, [_display.width]
mov ebp, [d_width_calc_area+ebp*4]
add ebp, ebx
add ebp, [_WinMapAddress]
mov eax, [esp+BLITTER.src_y] mov eax, [esp+BLITTER.src_y]
imul eax, [esp+BLITTER.stride] imul eax, [esp+BLITTER.stride]
mov esi, [esp+BLITTER.src_x] mov esi, [esp+BLITTER.src_x]
lea esi, [eax+esi*4] lea esi, [eax+esi*4]
add esi, [esp+BLITTER.bitmap] add esi, [esp+BLITTER.bitmap]
mov ecx, [esp+BLITTER.h] mov eax, ecx
mov edx, [esp+BLITTER.w] mov ecx, [esp+BLITTER.h]
mov edx, [esp+BLITTER.w]
test ecx, ecx ;FIXME check clipping test ecx, ecx ;FIXME check clipping
jz .L57 jz .L57
@@ -358,25 +372,52 @@ blit_32:
cmp [_display.bpp], 32 cmp [_display.bpp], 32
jne .core_24 jne .core_24
lea edi, [edi+ebx*4] lea edi, [edi+ebx*4]
mov ebx, [CURRENT_TASK]
align 4
.outer32:
xor ecx, ecx
mov ebx, [CURRENT_TASK] align 4
.inner32:
align 4 cmp [ebp+ecx], bl
.outer32: jne .skip
xor ecx, ecx ;--------------------------------------
push eax
align 4 mov eax, [esi+ecx*4]
.inner32:
cmp [ebp+ecx], bl ; check for hardware cursor
jne @F cmp [_display.select_cursor], select_cursor
je @f
mov eax, [esi+ecx*4] cmp [_display.select_cursor], 0
mov [LFB_BASE+edi+ecx*4], eax jne .no_mouseunder
@@: ;--------------------------------------
inc ecx align 4
dec edx @@:
jnz .inner32 push ecx
mov ecx, [esp+4]
ror ecx, 16
sub ecx, edx
rol ecx, 16
sub ecx, [esp+BLITTER.h + 8]
; check mouse area for putpixel
call [_display.check_mouse]
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edi+ecx*4], eax
pop eax
;--------------------------------------
align 4
.skip:
inc ecx
dec edx
jnz .inner32
add esi, [esp+BLITTER.stride] add esi, [esp+BLITTER.stride]
add edi, [_display.pitch] add edi, [_display.pitch]
@@ -384,14 +425,14 @@ align 4
mov edx, [esp+BLITTER.w] mov edx, [esp+BLITTER.w]
dec [esp+BLITTER.h] dec [esp+BLITTER.h]
jnz .outer32 jnz .outer32
.done: .done:
dec [mouse_pause] ; call [draw_pointer]
call [draw_pointer] call __sys_draw_pointer
.L57: .L57:
add esp, 72 add esp, 72
pop ebx pop ebx
pop esi pop esi
pop edi pop edi
pop ebp pop ebp
@@ -407,21 +448,49 @@ align 4
mov [esp+64], edi mov [esp+64], edi
xor ecx, ecx xor ecx, ecx
align 4 align 4
.inner24: .inner24:
cmp [ebp+ecx], bl cmp [ebp+ecx], bl
jne @F jne .skip_1
;--------------------------------------
mov eax, [esi+ecx*4] push eax
mov eax, [esi+ecx*4]
lea edi, [edi+ecx*2]
mov [edi+ecx], ax lea edi, [edi+ecx*2]
shr eax, 16
mov [edi+ecx+2], al ; check for hardware cursor
@@: cmp [_display.select_cursor], select_cursor
mov edi, [esp+64] je @f
inc ecx cmp [_display.select_cursor], 0
dec edx jne .no_mouseunder_1
;--------------------------------------
align 4
@@:
push ecx
mov ecx, [esp+4]
ror ecx, 16
sub ecx, edx
rol ecx, 16
sub ecx, [esp+BLITTER.h + 8]
; check mouse area for putpixel
call [_display.check_mouse]
pop ecx
;--------------------------------------
align 4
.no_mouseunder_1:
mov [edi+ecx], ax
shr eax, 16
mov [edi+ecx+2], al
pop eax
;--------------------------------------
align 4
.skip_1:
mov edi, [esp+64]
inc ecx
dec edx
jnz .inner24 jnz .inner24
add esi, [esp+BLITTER.stride] add esi, [esp+BLITTER.stride]

View File

@@ -1,35 +1,35 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
LOAD_FROM_FILE equ 0 LOAD_FROM_FILE equ 0
LOAD_FROM_MEM equ 1 LOAD_FROM_MEM equ 1
LOAD_INDIRECT equ 2 LOAD_INDIRECT equ 2
LOAD_SYSTEM equ 3 LOAD_SYSTEM equ 3
struct BITMAPINFOHEADER struct BITMAPINFOHEADER
Size dd ? Size dd ?
Width dd ? Width dd ?
Height dd ? Height dd ?
Planes dw ? Planes dw ?
BitCount dw ? BitCount dw ?
Compression dd ? Compression dd ?
SizeImage dd ? SizeImage dd ?
XPelsPerMeter dd ? XPelsPerMeter dd ?
YPelsPerMeter dd ? YPelsPerMeter dd ?
ClrUsed dd ? ClrUsed dd ?
ClrImportant dd ? ClrImportant dd ?
ends ends
;------------------------------------------------------------------------------
align 4 align 4
proc init_cursor stdcall, dst:dword, src:dword proc init_cursor stdcall, dst:dword, src:dword
locals locals
rBase dd ? rBase dd ?
pQuad dd ? pQuad dd ?
pBits dd ? pBits dd ?
@@ -40,17 +40,18 @@ proc init_cursor stdcall, dst:dword, src:dword
endl endl
mov esi, [src] mov esi, [src]
add esi, [esi+18] add esi, [esi+18]
mov eax, esi mov eax, esi
cmp [esi+BITMAPINFOHEADER.BitCount], 24 cmp [esi+BITMAPINFOHEADER.BitCount], 24
je .img_24 je .img_24
cmp [esi+BITMAPINFOHEADER.BitCount], 8 cmp [esi+BITMAPINFOHEADER.BitCount], 8
je .img_8 je .img_8
cmp [esi+BITMAPINFOHEADER.BitCount], 4 cmp [esi+BITMAPINFOHEADER.BitCount], 4
je .img_4 je .img_4
;--------------------------------------
.img_2: align 4
.img_2:
add eax, [esi] add eax, [esi]
mov [pQuad], eax mov [pQuad], eax
add eax, 8 add eax, 8
@@ -68,6 +69,8 @@ proc init_cursor stdcall, dst:dword, src:dword
mov [rBase], edi mov [rBase], edi
mov esi, [pQuad] mov esi, [pQuad]
;--------------------------------------
align 4
.l21: .l21:
mov ebx, [pBits] mov ebx, [pBits]
mov ebx, [ebx] mov ebx, [ebx]
@@ -76,6 +79,8 @@ proc init_cursor stdcall, dst:dword, src:dword
mov eax, [eax] mov eax, [eax]
bswap eax bswap eax
mov [counter], 32 mov [counter], 32
;--------------------------------------
align 4
@@: @@:
xor edx, edx xor edx, edx
shl eax, 1 shl eax, 1
@@ -103,7 +108,8 @@ proc init_cursor stdcall, dst:dword, src:dword
sub [height], 1 sub [height], 1
jnz .l21 jnz .l21
ret ret
;--------------------------------------
align 4
.img_4: .img_4:
add eax, [esi] add eax, [esi]
mov [pQuad], eax mov [pQuad], eax
@@ -123,11 +129,15 @@ proc init_cursor stdcall, dst:dword, src:dword
mov esi, [pQuad] mov esi, [pQuad]
mov ebx, [pBits] mov ebx, [pBits]
;--------------------------------------
align 4
.l4: .l4:
mov eax, [pAnd] mov eax, [pAnd]
mov eax, [eax] mov eax, [eax]
bswap eax bswap eax
mov [counter], 16 mov [counter], 16
;--------------------------------------
align 4
@@: @@:
xor edx, edx xor edx, edx
shl eax, 1 shl eax, 1
@@ -168,6 +178,8 @@ proc init_cursor stdcall, dst:dword, src:dword
sub [height], 1 sub [height], 1
jnz .l4 jnz .l4
ret ret
;--------------------------------------
align 4
.img_8: .img_8:
add eax, [esi] add eax, [esi]
mov [pQuad], eax mov [pQuad], eax
@@ -187,11 +199,15 @@ proc init_cursor stdcall, dst:dword, src:dword
mov esi, [pQuad] mov esi, [pQuad]
mov ebx, [pBits] mov ebx, [pBits]
;--------------------------------------
align 4
.l81: .l81:
mov eax, [pAnd] mov eax, [pAnd]
mov eax, [eax] mov eax, [eax]
bswap eax bswap eax
mov [counter], 32 mov [counter], 32
;--------------------------------------
align 4
@@: @@:
xor edx, edx xor edx, edx
shl eax, 1 shl eax, 1
@@ -217,27 +233,33 @@ proc init_cursor stdcall, dst:dword, src:dword
sub [height], 1 sub [height], 1
jnz .l81 jnz .l81
ret ret
;--------------------------------------
align 4
.img_24: .img_24:
add eax, [esi] add eax, [esi]
mov [pQuad], eax mov [pQuad], eax
add eax, 0xC00 add eax, 0xC00
mov [pAnd], eax mov [pAnd], eax
mov eax, [esi+BITMAPINFOHEADER.Width] mov eax, [esi+BITMAPINFOHEADER.Width]
mov [width], eax mov [width], eax
mov ebx, [esi+BITMAPINFOHEADER.Height] mov ebx, [esi+BITMAPINFOHEADER.Height]
shr ebx, 1 shr ebx, 1
mov [height], ebx mov [height], ebx
mov edi, [dst] mov edi, [dst]
add edi, 32*31*4 add edi, 32*31*4
mov [rBase], edi mov [rBase], edi
mov esi, [pAnd] mov esi, [pAnd]
mov ebx, [pQuad] mov ebx, [pQuad]
;--------------------------------------
align 4
.row_24: .row_24:
mov eax, [esi] mov eax, [esi]
bswap eax bswap eax
mov [counter], 32 mov [counter], 32
;--------------------------------------
align 4
@@: @@:
xor edx, edx xor edx, edx
shl eax, 1 shl eax, 1
@@ -263,7 +285,7 @@ proc init_cursor stdcall, dst:dword, src:dword
jnz .row_24 jnz .row_24
ret ret
endp endp
;------------------------------------------------------------------------------
align 4 align 4
proc set_cursor stdcall, hcursor:dword proc set_cursor stdcall, hcursor:dword
mov eax, [hcursor] mov eax, [hcursor]
@@ -274,13 +296,16 @@ proc set_cursor stdcall, hcursor:dword
mov ebx, [current_slot] mov ebx, [current_slot]
xchg eax, [ebx+APPDATA.cursor] xchg eax, [ebx+APPDATA.cursor]
ret ret
;--------------------------------------
align 4
.fail: .fail:
mov eax, [def_cursor] mov eax, [def_cursor]
mov ebx, [current_slot] mov ebx, [current_slot]
xchg eax, [ebx+APPDATA.cursor] xchg eax, [ebx+APPDATA.cursor]
ret ret
endp endp
;------------------------------------------------------------------------------
align 4
; param ; param
; eax= pid ; eax= pid
; ebx= src ; ebx= src
@@ -293,13 +318,13 @@ create_cursor:
sub esp, 4 ;space for .hcursor sub esp, 4 ;space for .hcursor
push ecx push ecx
push ebx push ebx
mov ebx, eax mov ebx, eax
mov eax, sizeof.CURSOR mov eax, sizeof.CURSOR
call create_kernel_object call create_kernel_object
test eax, eax test eax, eax
jz .fail jz .fail
mov [.hcursor], eax mov [.hcursor], eax
@@ -328,6 +353,8 @@ create_cursor:
stdcall init_cursor, eax, esi stdcall init_cursor, eax, esi
align 4
.add_cursor:
mov ecx, [.hcursor] mov ecx, [.hcursor]
lea ecx, [ecx+CURSOR.list_next] lea ecx, [ecx+CURSOR.list_next]
lea edx, [_display.cr_list.next] lea edx, [_display.cr_list.next]
@@ -338,7 +365,6 @@ create_cursor:
popfd popfd
mov eax, [.hcursor] mov eax, [.hcursor]
.check_hw:
cmp [_display.init_cursor], 0 cmp [_display.init_cursor], 0
je .fail je .fail
@@ -347,22 +373,26 @@ create_cursor:
add esp, 4 add esp, 4
mov eax, [.hcursor] mov eax, [.hcursor]
;--------------------------------------
align 4
.fail: .fail:
add esp, 12 add esp, 12
ret ret
;--------------------------------------
align 4
.indirect: .indirect:
shr ebx, 16 shr ebx, 16
movzx ecx, bh movzx ecx, bh
movzx edx, bl movzx edx, bl
mov [eax+CURSOR.hot_x], ecx mov [edi+CURSOR.hot_x], ecx
mov [eax+CURSOR.hot_y], edx mov [edi+CURSOR.hot_y], edx
xchg edi, eax xchg edi, eax
mov ecx, 1024 mov ecx, 1024
cld cld
rep movsd rep movsd
jmp .check_hw jmp .add_cursor
;------------------------------------------------------------------------------
align 4 align 4
proc load_cursor stdcall, src:dword, flags:dword proc load_cursor stdcall, src:dword, flags:dword
locals locals
@@ -381,6 +411,8 @@ proc load_cursor stdcall, src:dword, flags:dword
test eax, eax test eax, eax
jz .fail jz .fail
mov [src], eax mov [src], eax
;--------------------------------------
align 4
@@: @@:
push ebx push ebx
push esi push esi
@@ -397,16 +429,22 @@ proc load_cursor stdcall, src:dword, flags:dword
cmp word [flags], LOAD_FROM_FILE cmp word [flags], LOAD_FROM_FILE
jne .exit jne .exit
stdcall kernel_free, [src] stdcall kernel_free, [src]
;--------------------------------------
align 4
.exit: .exit:
pop edi pop edi
pop esi pop esi
pop ebx pop ebx
;--------------------------------------
align 4
.fail: .fail:
mov eax, [handle] mov eax, [handle]
;--------------------------------------
align 4
.fail2: .fail2:
ret ret
endp endp
;------------------------------------------------------------------------------
align 4 align 4
proc delete_cursor stdcall, hcursor:dword proc delete_cursor stdcall, hcursor:dword
locals locals
@@ -433,17 +471,20 @@ proc delete_cursor stdcall, hcursor:dword
jne @F jne @F
mov eax, [def_cursor] mov eax, [def_cursor]
mov [ebx+APPDATA.cursor], eax mov [ebx+APPDATA.cursor], eax
;--------------------------------------
align 4
@@: @@:
mov eax, [hcursor] mov eax, [hcursor]
call [eax+APPOBJ.destroy] call [eax+APPOBJ.destroy]
;--------------------------------------
align 4
.fail: .fail:
ret ret
endp endp
;------------------------------------------------------------------------------
align 4
; param ; param
; eax= cursor ; eax= cursor
align 4
destroy_cursor: destroy_cursor:
push eax push eax
@@ -460,13 +501,13 @@ destroy_cursor:
pop eax pop eax
call destroy_kernel_object call destroy_kernel_object
ret ret
;------------------------------------------------------------------------------
align 4 align 4
select_cursor: select_cursor:
mov eax, [esp+4] mov eax, [esp+4]
mov [_display.cursor], eax mov [_display.cursor], eax
ret 4 ret 4
;------------------------------------------------------------------------------
align 4 align 4
proc restore_24 stdcall, x:dword, y:dword proc restore_24 stdcall, x:dword, y:dword
@@ -484,6 +525,8 @@ proc restore_24 stdcall, x:dword, y:dword
mov ecx, [cur.w] mov ecx, [cur.w]
lea ecx, [ecx+ecx*2] lea ecx, [ecx+ecx*2]
push ecx push ecx
;--------------------------------------
align 4
@@: @@:
mov edi, ebx mov edi, ebx
add ebx, [BytesPerScanLine] add ebx, [BytesPerScanLine]
@@ -496,11 +539,13 @@ proc restore_24 stdcall, x:dword, y:dword
pop ecx pop ecx
pop edi pop edi
pop esi pop esi
;--------------------------------------
align 4
.ret: .ret:
pop ebx pop ebx
ret ret
endp endp
;------------------------------------------------------------------------------
align 4 align 4
proc restore_32 stdcall, x:dword, y:dword proc restore_32 stdcall, x:dword, y:dword
@@ -515,6 +560,8 @@ proc restore_32 stdcall, x:dword, y:dword
push edi push edi
mov esi, cur_saved_data mov esi, cur_saved_data
;--------------------------------------
align 4
@@: @@:
mov edi, ebx mov edi, ebx
add ebx, [BytesPerScanLine] add ebx, [BytesPerScanLine]
@@ -525,12 +572,14 @@ proc restore_32 stdcall, x:dword, y:dword
jnz @B jnz @B
pop edi pop edi
;--------------------------------------
align 4
.ret: .ret:
pop esi pop esi
pop ebx pop ebx
ret ret
endp endp
;------------------------------------------------------------------------------
align 4 align 4
proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
locals locals
@@ -542,7 +591,7 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
mov esi, [hcursor] mov esi, [hcursor]
mov ecx, [x] mov ecx, [x]
mov eax, [y] mov eax, [y]
mov ebx, [BytesPerScanLine] ; mov ebx, [BytesPerScanLine]
xor edx, edx xor edx, edx
sub ecx, [esi+CURSOR.hot_x] sub ecx, [esi+CURSOR.hot_x]
@@ -568,7 +617,8 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
sub edx, [y] sub edx, [y]
mov [_dy], edx mov [_dy], edx
mul dword [BytesPerScanLine] ; mul dword [BytesPerScanLine]
mov eax, [BPSLine_calc_area+eax*4]
lea edx, [LFB_BASE+ecx*3] lea edx, [LFB_BASE+ecx*3]
add edx, eax add edx, eax
mov [cur_saved_base], edx mov [cur_saved_base], edx
@@ -576,10 +626,14 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
cmp ebx, [Screen_Max_X] cmp ebx, [Screen_Max_X]
jbe @F jbe @F
mov ebx, [Screen_Max_X] mov ebx, [Screen_Max_X]
;--------------------------------------
align 4
@@: @@:
cmp edi, [Screen_Max_Y] cmp edi, [Screen_Max_Y]
jbe @F jbe @F
mov edi, [Screen_Max_Y] mov edi, [Screen_Max_Y]
;--------------------------------------
align 4
@@: @@:
mov [cur.right], ebx mov [cur.right], ebx
mov [cur.bottom], edi mov [cur.bottom], edi
@@ -595,6 +649,8 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
mov eax, edi mov eax, edi
mov edi, cur_saved_data mov edi, cur_saved_data
;--------------------------------------
align 4
@@: @@:
mov esi, edx mov esi, edx
add edx, [BytesPerScanLine] add edx, [BytesPerScanLine]
@@ -613,12 +669,16 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
mov esi, [hcursor] mov esi, [hcursor]
mov esi, [esi+CURSOR.base] mov esi, [esi+CURSOR.base]
lea edx, [esi+eax*4] lea edx, [esi+eax*4]
;--------------------------------------
align 4
.row: .row:
mov ecx, [cur.w] mov ecx, [cur.w]
mov esi, edx mov esi, edx
mov edi, ebx mov edi, ebx
add edx, 32*4 add edx, 32*4
add ebx, [BytesPerScanLine] add ebx, [BytesPerScanLine]
;--------------------------------------
align 4
.pix: .pix:
lodsd lodsd
test eax, 0xFF000000 test eax, 0xFF000000
@@ -626,6 +686,8 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
mov [edi], ax mov [edi], ax
shr eax, 16 shr eax, 16
mov [edi+2], al mov [edi+2], al
;--------------------------------------
align 4
@@: @@:
add edi, 3 add edi, 3
dec ecx dec ecx
@@ -635,8 +697,7 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
jnz .row jnz .row
ret ret
endp endp
;------------------------------------------------------------------------------
align 4 align 4
proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
locals locals
@@ -673,17 +734,22 @@ proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
sub edx, [y] sub edx, [y]
mov [_dy], edx mov [_dy], edx
mul dword [BytesPerScanLine] ; mul dword [BytesPerScanLine]
mov eax, [BPSLine_calc_area+eax*4]
lea edx, [LFB_BASE+eax+ecx*4] lea edx, [LFB_BASE+eax+ecx*4]
mov [cur_saved_base], edx mov [cur_saved_base], edx
cmp ebx, [Screen_Max_X] cmp ebx, [Screen_Max_X]
jbe @F jbe @F
mov ebx, [Screen_Max_X] mov ebx, [Screen_Max_X]
;--------------------------------------
align 4
@@: @@:
cmp edi, [Screen_Max_Y] cmp edi, [Screen_Max_Y]
jbe @F jbe @F
mov edi, [Screen_Max_Y] mov edi, [Screen_Max_Y]
;--------------------------------------
align 4
@@: @@:
mov [cur.right], ebx mov [cur.right], ebx
mov [cur.bottom], edi mov [cur.bottom], edi
@@ -699,6 +765,8 @@ proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
mov eax, edi mov eax, edi
mov edi, cur_saved_data mov edi, cur_saved_data
;--------------------------------------
align 4
@@: @@:
mov esi, edx mov esi, edx
add edx, [BytesPerScanLine] add edx, [BytesPerScanLine]
@@ -716,17 +784,23 @@ proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
mov esi, [hcursor] mov esi, [hcursor]
mov esi, [esi+CURSOR.base] mov esi, [esi+CURSOR.base]
lea edx, [esi+eax*4] lea edx, [esi+eax*4]
;--------------------------------------
align 4
.row: .row:
mov ecx, [cur.w] mov ecx, [cur.w]
mov esi, edx mov esi, edx
mov edi, ebx mov edi, ebx
add edx, 32*4 add edx, 32*4
add ebx, [BytesPerScanLine] add ebx, [BytesPerScanLine]
;--------------------------------------
align 4
.pix: .pix:
lodsd lodsd
test eax, 0xFF000000 test eax, 0xFF000000
jz @F jz @F
mov [edi], eax mov [edi], eax
;--------------------------------------
align 4
@@: @@:
add edi, 4 add edi, 4
dec ecx dec ecx
@@ -736,16 +810,158 @@ proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
jnz .row jnz .row
ret ret
endp endp
;------------------------------------------------------------------------------
align 4
check_mouse_area_for_getpixel_new:
; in:
; eax = x
; ebx = y
; out:
; ecx = new color
;--------------------------------------
; check for Y
cmp bx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
cmp bx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
;--------------------------------------
; check for X
cmp ax, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
cmp ax, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
push eax ebx
; offset X
mov ecx, [X_UNDER_subtraction_CUR_hot_x]
sub eax, ecx ; x1
; offset Y
mov ecx, [Y_UNDER_subtraction_CUR_hot_y]
sub ebx, ecx ; y1
;--------------------------------------
; ebx = offset y
; eax = offset x
imul ebx, [cur.w] ;y
add eax, ebx
mov ebx, eax
shl eax, 2
cmp [ScreenBPP], byte 32
je @f
sub eax, ebx
;--------------------------------------
align 4
@@:
add eax, cur_saved_data
mov ecx, [eax]
and ecx, 0xffffff
add ecx, 0xff000000
pop ebx eax
ret
;--------------------------------------
align 4
.no_mouse_area:
xor ecx, ecx
ret
;-----------------------------------------------------------------------------
align 4
check_mouse_area_for_putpixel_new:
; in:
; ecx = x shl 16 + y
; eax = color
; out:
; eax = new color
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
rol ecx, 16
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
align 4
.1:
push eax
; offset X
mov ax, [X_UNDER_subtraction_CUR_hot_x]
sub cx, ax ; x1
ror ecx, 16
; offset Y
mov ax, [Y_UNDER_subtraction_CUR_hot_y]
sub cx, ax ; y1
;--------------------------------------
; ecx = (offset x) shl 16 + (offset y)
push ebx
mov ebx, ecx
shr ebx, 16 ; x
and ecx, 0xffff ; y
; ecx = offset y
; ebx = offset x
mov eax, [esp + 4]
push ebx ecx
imul ecx, [cur.w] ;y
add ecx, ebx
mov ebx, ecx
shl ecx, 2
cmp [ScreenBPP], byte 24
je .24
and eax, 0xFFFFFF
mov [ecx + cur_saved_data], eax ;store new color to
jmp @f
;--------------------------------------
align 4
.24:
sub ecx, ebx
mov [ecx + cur_saved_data], ax ;store new color to
shr eax, 16
mov [ecx + cur_saved_data + 2], al ;store new color to
;--------------------------------------
align 4
@@:
pop ecx ebx
shl ecx, 5
add ecx, ebx
mov eax, [current_cursor]
mov eax, [eax+CURSOR.base]
lea eax, [eax+ecx*4]
mov eax, [eax]
pop ebx
test eax, 0xFF000000
jz @f
pop ecx
ret
;--------------------------------------
align 4
@@:
pop eax
;--------------------------------------
align 4
.no_mouse_area:
ret
;------------------------------------------------------------------------------
align 4 align 4
get_display: get_display:
mov eax, _display mov eax, _display
ret ret
;------------------------------------------------------------------------------
align 4 align 4
init_display: init_display:
xor eax, eax xor eax, eax
mov edi, _display mov edi, _display
@@ -764,6 +980,7 @@ init_display:
test word [SCR_MODE], 0x4000 test word [SCR_MODE], 0x4000
jz .fail jz .fail
; jmp .fail
mov ebx, restore_32 mov ebx, restore_32
mov ecx, move_cursor_32 mov ecx, move_cursor_32
@@ -775,22 +992,47 @@ init_display:
mov ecx, move_cursor_24 mov ecx, move_cursor_24
cmp eax, 24 cmp eax, 24
jne .fail jne .fail
;--------------------------------------
align 4
@@: @@:
mov [_display.select_cursor], select_cursor mov [_display.select_cursor], select_cursor
mov [_display.move_cursor], ecx mov [_display.move_cursor], ecx
mov [_display.restore_cursor], ebx 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
cmp [PUTPIXEL], dword VGA_putpixel
je @f
cmp [ScreenBPP], byte 32
je .32
mov [PUTPIXEL], dword Vesa20_putpixel24_new
jmp @f
;--------------------------------------
align 4
.32:
mov [PUTPIXEL], dword Vesa20_putpixel32_new
;--------------------------------------
align 4
@@:
stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM
mov [def_cursor_clock], eax
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
mov [def_cursor], eax mov [def_cursor], eax
ret ret
;--------------------------------------
align 4
.fail: .fail:
xor eax, eax xor eax, eax
mov [_display.select_cursor], eax mov [_display.select_cursor], eax
mov [_display.move_cursor], eax mov [_display.move_cursor], eax
ret ret
;------------------------------------------------------------------------------
align 4 align 4
def_arrow: def_arrow:
file 'arrow.cur' file 'arrow.cur'
;------------------------------------------------------------------------------
align 4
clock_arrow:
file 'arrow_clock.cur'
;------------------------------------------------------------------------------

View File

@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; VESA12.INC ;; ;; VESA12.INC ;;
;; ;; ;; ;;
;; Vesa 1.2 functions for MenuetOS ;; ;; Vesa 1.2 functions for MenuetOS ;;
;; ;; ;; ;;

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; VGA.INC ;; ;; VGA.INC ;;
@@ -11,9 +11,10 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Revision$ $Revision $
;------------------------------------------------------------------------------
align 4
paletteVGA: paletteVGA:
;16 colour palette ;16 colour palette
@@ -24,9 +25,9 @@ paletteVGA:
mov ecx, 16 mov ecx, 16
mov dx, 0x3c9 mov dx, 0x3c9
xor eax, eax xor eax, eax
;--------------------------------------
palvganew: align 4
palvganew:
mov al, 0 mov al, 0
test ah, 4 test ah, 4
jz palvgalbl1 jz palvgalbl1
@@ -34,7 +35,9 @@ paletteVGA:
test ah, 8 test ah, 8
jz palvgalbl1 jz palvgalbl1
add al, 32 add al, 32
palvgalbl1: ;--------------------------------------
align 4
palvgalbl1:
out dx, al; red 0,31 or 63 out dx, al; red 0,31 or 63
mov al, 0 mov al, 0
test ah, 2 test ah, 2
@@ -43,7 +46,9 @@ paletteVGA:
test ah, 8 test ah, 8
jz palvgalbl2 jz palvgalbl2
add al, 32 add al, 32
palvgalbl2: ;--------------------------------------
align 4
palvgalbl2:
out dx, al; blue 0,31 or 63 out dx, al; blue 0,31 or 63
mov al, 0 mov al, 0
test ah, 1 test ah, 1
@@ -52,7 +57,9 @@ paletteVGA:
test ah, 8 test ah, 8
jz palvgalbl3 jz palvgalbl3
add al, 32 add al, 32
palvgalbl3: ;--------------------------------------
align 4
palvgalbl3:
out dx, al; green 0,31 or 63 out dx, al; green 0,31 or 63
add ah, 1 add ah, 1
loop palvganew loop palvganew
@@ -60,59 +67,76 @@ paletteVGA:
; mov ax, 0005h ; mov ax, 0005h
; out dx, ax ; out dx, ax
ret ret
;------------------------------------------------------------------------------
align 4
palette320x200: palette320x200:
mov edx, 0x3c8 mov edx, 0x3c8
xor eax, eax xor eax, eax
out dx, al out dx, al
mov ecx, 256 mov ecx, 256
mov edx, 0x3c9 mov edx, 0x3c9
xor eax, eax xor eax, eax
;--------------------------------------
palnew: align 4
palnew:
mov al, 0 mov al, 0
test ah, 64 test ah, 64
jz pallbl1 jz pallbl1
add al, 21 add al, 21
pallbl1: ;--------------------------------------
align 4
pallbl1:
test ah, 128 test ah, 128
jz pallbl2 jz pallbl2
add al, 42 add al, 42
pallbl2: ;--------------------------------------
align 4
pallbl2:
out dx, al out dx, al
mov al, 0 mov al, 0
test ah, 8 test ah, 8
jz pallbl3 jz pallbl3
add al, 8 add al, 8
pallbl3: ;--------------------------------------
align 4
pallbl3:
test ah, 16 test ah, 16
jz pallbl4 jz pallbl4
add al, 15 add al, 15
pallbl4: ;--------------------------------------
align 4
pallbl4:
test ah, 32 test ah, 32
jz pallbl5 jz pallbl5
add al, 40 add al, 40
pallbl5: ;--------------------------------------
align 4
pallbl5:
out dx, al out dx, al
mov al, 0 mov al, 0
test ah, 1 test ah, 1
jz pallbl6 jz pallbl6
add al, 8 add al, 8
pallbl6: ;--------------------------------------
align 4
pallbl6:
test ah, 2 test ah, 2
jz pallbl7 jz pallbl7
add al, 15 add al, 15
pallbl7: ;--------------------------------------
align 4
pallbl7:
test ah, 4 test ah, 4
jz pallbl8 jz pallbl8
add al, 40 add al, 40
pallbl8: ;--------------------------------------
align 4
pallbl8:
out dx, al out dx, al
add ah, 1 add ah, 1
loop palnew loop palnew
ret ret
;------------------------------------------------------------------------------
align 4 align 4
uglobal uglobal
novesachecksum dd 0x0 novesachecksum dd 0x0
@@ -123,13 +147,12 @@ uglobal
temp: temp:
.cx dd 0 .cx dd 0
endg endg
;------------------------------------------------------------------------------
align 4 align 4
checkVga_N13: checkVga_N13:
cmp [SCR_MODE], dword 0x13 cmp [SCR_MODE], dword 0x13
jne @f jne @f
; cnvl:
pushad pushad
cmp [EGA_counter], 1 cmp [EGA_counter], 1
je novesal je novesal
@@ -137,21 +160,28 @@ checkVga_N13:
cmp ecx, [novesachecksum] cmp ecx, [novesachecksum]
jne novesal jne novesal
popad popad
@@: ;--------------------------------------
align 4
@@:
ret ret
;--------------------------------------
novesal: align 4
novesal:
mov [novesachecksum], ecx mov [novesachecksum], ecx
mov ecx, 0 mov ecx, 0
movzx eax, word [MOUSE_Y] movzx eax, word [MOUSE_Y]
cmp eax, 100 cmp eax, 100
jge m13l3 jge m13l3
mov eax, 100 mov eax, 100
m13l3: ;--------------------------------------
align 4
m13l3:
cmp eax, 480-100 cmp eax, 480-100
jbe m13l4 jbe m13l4
mov eax, 480-100 mov eax, 480-100
m13l4: ;--------------------------------------
align 4
m13l4:
sub eax, 100 sub eax, 100
imul eax, 640*4 imul eax, 640*4
add ecx, eax add ecx, eax
@@ -159,11 +189,15 @@ checkVga_N13:
cmp eax, 160 cmp eax, 160
jge m13l1 jge m13l1
mov eax, 160 mov eax, 160
m13l1: ;--------------------------------------
align 4
m13l1:
cmp eax, 640-160 cmp eax, 640-160
jbe m13l2 jbe m13l2
mov eax, 640-160 mov eax, 640-160
m13l2: ;--------------------------------------
align 4
m13l2:
sub eax, 160 sub eax, 160
shl eax, 2 shl eax, 2
add ecx, eax add ecx, eax
@@ -173,7 +207,9 @@ checkVga_N13:
mov edx, 200 mov edx, 200
mov ecx, 320 mov ecx, 320
cld cld
m13pix: ;--------------------------------------
align 4
m13pix:
lodsd lodsd
test eax, eax test eax, eax
jz .save_pixel jz .save_pixel
@@ -188,7 +224,9 @@ checkVga_N13:
and ebx, (128+64)*256*256; red and ebx, (128+64)*256*256; red
shr ebx, 8+8 shr ebx, 8+8
add eax, ebx add eax, ebx
.save_pixel: ;--------------------------------------
align 4
.save_pixel:
stosb stosb
loop m13pix loop m13pix
mov ecx, 320 mov ecx, 320
@@ -198,17 +236,18 @@ checkVga_N13:
mov [EGA_counter], 0 mov [EGA_counter], 0
popad popad
ret ret
;------------------------------------------------------------------------------
align 4
VGA_drawbackground: VGA_drawbackground:
; draw all ; draw all
cmp [SCR_MODE], dword 0x12
jne .end
pushad pushad
mov esi, [LFBAddress] mov esi, [LFBAddress]
mov edi, VGABasePtr mov edi, VGABasePtr
mov ebx, 640/32; 640*480/(8*4) mov ebx, 640/32; 640*480/(8*4)
mov edx, 480 mov edx, 480
@@: ;--------------------------------------
align 4
@@:
push ebx edx esi edi push ebx edx esi edi
shl edx, 9 shl edx, 9
lea edx, [edx+edx*4] lea edx, [edx+edx*4]
@@ -221,9 +260,9 @@ VGA_drawbackground:
jnz @r jnz @r
call VGA_draw_long_line_1 call VGA_draw_long_line_1
popad popad
.end:
ret ret
;------------------------------------------------------------------------------
align 4
VGA_draw_long_line: VGA_draw_long_line:
mov dx, 3ceh mov dx, 3ceh
mov ax, 0ff08h mov ax, 0ff08h
@@ -231,7 +270,9 @@ VGA_draw_long_line:
out dx, ax out dx, ax
mov ax, 0005h mov ax, 0005h
out dx, ax out dx, ax
m12pix: ;--------------------------------------
align 4
m12pix:
call VGA_draw_32_pixels call VGA_draw_32_pixels
dec ebx dec ebx
jnz m12pix jnz m12pix
@@ -246,7 +287,8 @@ VGA_draw_long_line:
out dx, al out dx, al
sti sti
ret ret
;------------------------------------------------------------------------------
align 4
VGA_draw_32_pixels: VGA_draw_32_pixels:
xor eax, eax xor eax, eax
mov ebp, VGA_8_pixels mov ebp, VGA_8_pixels
@@ -255,9 +297,13 @@ VGA_draw_32_pixels:
mov [ebp+8], eax mov [ebp+8], eax
mov [ebp+12], eax mov [ebp+12], eax
mov ch, 4 mov ch, 4
.main_loop: ;--------------------------------------
align 4
.main_loop:
mov cl, 8 mov cl, 8
.convert_pixels_to_VGA: ;--------------------------------------
align 4
.convert_pixels_to_VGA:
lodsd ; eax = 24bit colour lodsd ; eax = 24bit colour
test eax, eax test eax, eax
jz .end jz .end
@@ -273,14 +319,18 @@ VGA_draw_32_pixels:
cmp al, 170 cmp al, 170
jbe .p13green jbe .p13green
or [ebp+12], ch or [ebp+12], ch
.p13green: ;--------------------------------------
align 4
.p13green:
cmp ah, 85 cmp ah, 85
jbe .p13red jbe .p13red
or [ebp+4], ch or [ebp+4], ch
cmp ah, 170 cmp ah, 170
jbe .p13red jbe .p13red
or [ebp+12], ch or [ebp+12], ch
.p13red: ;--------------------------------------
align 4
.p13red:
shr eax, 8 shr eax, 8
cmp ah, 85 cmp ah, 85
jbe .p13cont jbe .p13cont
@@ -288,11 +338,15 @@ VGA_draw_32_pixels:
cmp ah, 170 cmp ah, 170
jbe .p13cont jbe .p13cont
or [ebp+12], ch or [ebp+12], ch
.p13cont: ;--------------------------------------
align 4
.p13cont:
ror eax, 8 ror eax, 8
mov ch, ah mov ch, ah
inc cl inc cl
.end: ;--------------------------------------
align 4
.end:
dec cl dec cl
jnz .convert_pixels_to_VGA jnz .convert_pixels_to_VGA
inc ebp inc ebp
@@ -303,7 +357,9 @@ VGA_draw_32_pixels:
mov esi, ebp mov esi, ebp
mov dx, 3c4h mov dx, 3c4h
mov ah, 1h mov ah, 1h
@@: ;--------------------------------------
align 4
@@:
mov al, 02h mov al, 02h
out dx, ax out dx, ax
xchg ax, bp xchg ax, bp
@@ -316,12 +372,36 @@ VGA_draw_32_pixels:
add edi, 4 add edi, 4
pop esi pop esi
ret ret
;------------------------------------------------------------------------------
align 4
VGA_putpixel: VGA_putpixel:
; eax = x ; eax = x
; ebx = y ; ebx = y
mov ecx, eax mov ecx, eax
mov eax, [esp+32-8+4] ; color mov eax, [esp+32-8+4] ; color
;--------------------------------------
; 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
@@:
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
shl ebx, 9 shl ebx, 9
lea ebx, [ebx+ebx*4] ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 5 lea ebx, [ebx+ebx*4] ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 5
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32) lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
@@ -343,6 +423,8 @@ VGA_putpixel:
cmp al, 170 cmp al, 170
jbe .p13green jbe .p13green
or dl, 0x08 or dl, 0x08
;--------------------------------------
align 4
.p13green: .p13green:
cmp ah, 85 cmp ah, 85
jbe .p13red jbe .p13red
@@ -350,6 +432,8 @@ VGA_putpixel:
cmp ah, 170 cmp ah, 170
jbe .p13red jbe .p13red
or dl, 0x08 or dl, 0x08
;--------------------------------------
align 4
.p13red: .p13red:
shr eax, 8 shr eax, 8
cmp ah, 85 cmp ah, 85
@@ -358,6 +442,8 @@ VGA_putpixel:
cmp ah, 170 cmp ah, 170
jbe .p13cont jbe .p13cont
or dl, 0x08 or dl, 0x08
;--------------------------------------
align 4
.p13cont: .p13cont:
ror edx, 8 ror edx, 8
inc cl inc cl
@@ -371,14 +457,12 @@ VGA_putpixel:
rol edx, 8 rol edx, 8
mov [edi], dl mov [edi], dl
popfd popfd
;.end:
ret ret
;------------------------------------------------------------------------------
align 4
VGA__putimage: VGA__putimage:
; ecx = size [x|y] ; ecx = size [x|y]
; edx = coordinates [x|y] ; edx = coordinates [x|y]
cmp [SCR_MODE], dword 0x12
jne @f
pushad pushad
rol edx, 16 rol edx, 16
movzx eax, dx movzx eax, dx
@@ -389,16 +473,14 @@ VGA__putimage:
movzx ecx, cx movzx ecx, cx
call VGA_draw_bar_1 call VGA_draw_bar_1
popad popad
@@:
ret ret
;------------------------------------------------------------------------------
align 4
VGA_draw_bar: VGA_draw_bar:
; eax cx ; eax cx
; ebx cy ; ebx cy
; ecx xe ; ecx xe
; edx ye ; edx ye
cmp [SCR_MODE], dword 0x12
jne @f
pushad pushad
sub ecx, eax sub ecx, eax
sub edx, ebx sub edx, ebx
@@ -408,9 +490,9 @@ VGA_draw_bar:
and edx, 0xffff and edx, 0xffff
call VGA_draw_bar_1 call VGA_draw_bar_1
popad popad
@@:
ret ret
;------------------------------------------------------------------------------
align 4
VGA_draw_bar_1: VGA_draw_bar_1:
mov [temp.cx], eax mov [temp.cx], eax
mov eax, [TASK_BASE] mov eax, [TASK_BASE]
@@ -429,13 +511,16 @@ VGA_draw_bar_1:
mov ebx, ecx mov ebx, ecx
shr ebx, 5 shr ebx, 5
inc ebx inc ebx
;--------------------------------------
align 4
.main_loop: .main_loop:
call VGA_draw_long_line_1 call VGA_draw_long_line_1
dec edx dec edx
jnz .main_loop jnz .main_loop
call VGA_draw_long_line_1 call VGA_draw_long_line_1
ret ret
;------------------------------------------------------------------------------
align 4
VGA_draw_long_line_1: VGA_draw_long_line_1:
push ebx edx esi edi push ebx edx esi edi
shl edx, 9 shl edx, 9
@@ -446,5 +531,4 @@ VGA_draw_long_line_1:
call VGA_draw_long_line call VGA_draw_long_line
pop edi esi edx ebx pop edi esi edx ebx
ret ret
;------------------------------------------------------------------------------