forked from KolibriOS/kolibrios
acpi: merge trank
git-svn-id: svn://kolibrios.org@2987 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
8a78e14dc9
commit
9ebd3255c3
@ -350,8 +350,10 @@ disk_add:
|
||||
inc eax
|
||||
cmp byte [ebx+eax-1], 0
|
||||
jnz @b
|
||||
; 2b. Call the heap manager.
|
||||
; 2b. Call the heap manager. Note that it can change ebx.
|
||||
push ebx
|
||||
call malloc
|
||||
pop ebx
|
||||
; 2c. Check the result. If allocation failed, go to 7.
|
||||
pop esi ; restore allocated pointer to DISK
|
||||
test eax, eax
|
||||
@ -418,7 +420,7 @@ disk_del:
|
||||
push esi ; save used registers to be stdcall
|
||||
; 1. Force media to be removed. If the media is already removed, the
|
||||
; call does nothing.
|
||||
mov esi, [esp+4+8] ; esi = handle of the disk
|
||||
mov esi, [esp+4+4] ; esi = handle of the disk
|
||||
stdcall disk_media_changed, esi, 0
|
||||
; 2. Delete the structure from the global list.
|
||||
; 2a. Acquire the mutex.
|
||||
@ -975,15 +977,33 @@ virtual at ebp+8
|
||||
.start dq ?
|
||||
.length dq ?
|
||||
end virtual
|
||||
; Currently no file systems are supported, so just allocate the PARTITION
|
||||
; When disk_add_partition is called, ebx contains a pointer to
|
||||
; a two-sectors-sized buffer. This function saves ebx in the stack
|
||||
; immediately before ebp.
|
||||
virtual at ebp-4
|
||||
.buffer dd ?
|
||||
end virtual
|
||||
; 1. Read the bootsector to the buffer.
|
||||
mov al, DISKFUNC.read
|
||||
mov ebx, [.buffer]
|
||||
add ebx, 512
|
||||
push 1
|
||||
stdcall disk_call_driver, ebx, dword [.start], dword [.start+4], esp
|
||||
; 2. Run tests for all supported filesystems. If at least one test succeeded,
|
||||
; go to 4.
|
||||
; For tests: qword [ebp+8] = partition start, qword [ebp+10h] = partition
|
||||
; length, [esp] = 0 if reading bootsector failed or 1 if succeeded,
|
||||
; ebx points to the buffer for bootsector.
|
||||
call fat_create_partition
|
||||
test eax, eax
|
||||
jnz .success
|
||||
; 3. No file system has recognized the volume, so just allocate the PARTITION
|
||||
; structure without extra fields.
|
||||
; 1. Allocate and check result.
|
||||
push sizeof.PARTITION
|
||||
pop eax
|
||||
call malloc
|
||||
test eax, eax
|
||||
jz .nothing
|
||||
; 2. Fill the common fields: copy .start and .length.
|
||||
mov edx, dword [.start]
|
||||
mov dword [eax+PARTITION.FirstSector], edx
|
||||
mov edx, dword [.start+4]
|
||||
@ -992,8 +1012,12 @@ end virtual
|
||||
mov dword [eax+PARTITION.Length], edx
|
||||
mov edx, dword [.length+4]
|
||||
mov dword [eax+PARTITION.Length+4], edx
|
||||
mov [eax+PARTITION.Disk], esi
|
||||
and [eax+PARTITION.FSUserFunctions], 0
|
||||
.success:
|
||||
.nothing:
|
||||
; 3. Return with eax = pointer to PARTITION or NULL.
|
||||
; 4. Return with eax = pointer to PARTITION or NULL.
|
||||
pop ecx
|
||||
ret
|
||||
|
||||
; This function is called from file_system_lfn.
|
||||
@ -1061,6 +1085,7 @@ dyndisk_handler:
|
||||
; 6. Now we are sure that the DISK structure is not going to die at least
|
||||
; while we are working with it, so release the global mutex.
|
||||
call mutex_unlock
|
||||
pop ecx ; pop from the stack saved value of esi
|
||||
; 7. Acquire the mutex for media object.
|
||||
pop edi ; restore edi
|
||||
lea ecx, [ebx+DISK.MediaLock]
|
||||
@ -1175,15 +1200,36 @@ fs_dyndisk:
|
||||
.main:
|
||||
cmp ecx, [edx+DISK.NumPartitions]
|
||||
jae .notfound
|
||||
mov dword [esp+32], ERROR_UNKNOWN_FS
|
||||
mov eax, [edx+DISK.Partitions]
|
||||
mov eax, [eax+ecx*4]
|
||||
mov edi, [eax+PARTITION.FSUserFunctions]
|
||||
test edi, edi
|
||||
jz .nofs
|
||||
mov ecx, [ebx]
|
||||
cmp [edi], ecx
|
||||
jbe .unsupported
|
||||
push edx
|
||||
push ebp
|
||||
mov ebp, eax
|
||||
call dword [edi+4+ecx*4]
|
||||
pop ebp
|
||||
pop edx
|
||||
mov dword [esp+32], eax
|
||||
mov dword [esp+20], ebx
|
||||
.cleanup:
|
||||
mov esi, edx
|
||||
call disk_media_dereference
|
||||
call disk_dereference
|
||||
ret
|
||||
.nofs:
|
||||
mov dword [esp+32], ERROR_UNKNOWN_FS
|
||||
jmp .cleanup
|
||||
.notfound:
|
||||
mov dword [esp+32], ERROR_FILE_NOT_FOUND
|
||||
jmp .cleanup
|
||||
.unsupported:
|
||||
mov dword [esp+32], ERROR_UNSUPPORTED_FS
|
||||
jmp .cleanup
|
||||
.nomedia:
|
||||
test ecx, ecx
|
||||
jnz .notfound
|
||||
@ -1192,7 +1238,6 @@ fs_dyndisk:
|
||||
; if the driver does not support insert notifications and we are the only fs
|
||||
; operation with this disk, issue the fake insert notification; if media is
|
||||
; still not inserted, 'disk_media_changed' will detect this and do nothing
|
||||
;;; push ebx
|
||||
lea ecx, [edx+DISK.MediaLock]
|
||||
call mutex_lock
|
||||
cmp [edx+DISK.MediaRefCount], 1
|
||||
|
@ -18,9 +18,11 @@ fs_read32_sys:
|
||||
; this request should be processed by hd_read.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 0
|
||||
call hd_read
|
||||
mov [hdd_appl_data], 1 ; restore to default state
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to SysCache and let the common part
|
||||
@ -41,8 +43,11 @@ fs_read32_app:
|
||||
; this request should be processed by hd_read.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 1
|
||||
jmp hd_read
|
||||
call hd_read
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to AppCache and let the common part
|
||||
; do its work.
|
||||
@ -63,7 +68,7 @@ fs_read32_common:
|
||||
ret
|
||||
@@:
|
||||
; 2. Get the absolute sector on the disk.
|
||||
push edx
|
||||
push edx esi
|
||||
xor edx, edx
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
adc edx, dword [ebp+PARTITION.FirstSector+4]
|
||||
@ -75,15 +80,16 @@ fs_read32_common:
|
||||
push edx ; startsector
|
||||
push eax ; startsector
|
||||
push ebx ; buffer
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.read
|
||||
call disk_call_driver
|
||||
pop ecx
|
||||
pop edx
|
||||
pop esi edx
|
||||
pop ecx
|
||||
ret
|
||||
.scancache:
|
||||
; 4. Scan the cache.
|
||||
push esi edi ecx ; scan cache
|
||||
push edi ecx ; scan cache
|
||||
push edx eax
|
||||
virtual at esp
|
||||
.sector_lo dd ?
|
||||
@ -183,9 +189,11 @@ fs_write32_sys:
|
||||
; this request should be processed by hd_write.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 0
|
||||
call hd_write
|
||||
mov [hdd_appl_data], 1 ; restore to default state
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to SysCache and let the common part
|
||||
@ -206,8 +214,11 @@ fs_write32_app:
|
||||
; this request should be processed by hd_write.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 1
|
||||
jmp hd_write
|
||||
call hd_write
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to AppCache and let the common part
|
||||
; do its work.
|
||||
@ -227,7 +238,7 @@ fs_write32_common:
|
||||
pop ecx
|
||||
ret
|
||||
@@:
|
||||
push edx
|
||||
push edx esi
|
||||
; 2. Get the absolute sector on the disk.
|
||||
xor edx, edx
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
@ -240,15 +251,16 @@ fs_write32_common:
|
||||
push edx ; startsector
|
||||
push eax ; startsector
|
||||
push ebx ; buffer
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.write
|
||||
call disk_call_driver
|
||||
pop ecx
|
||||
pop edx
|
||||
pop esi edx
|
||||
pop ecx
|
||||
ret
|
||||
.scancache:
|
||||
; 4. Scan the cache.
|
||||
push esi edi ecx ; scan cache
|
||||
push edi ecx ; scan cache
|
||||
push edx eax
|
||||
virtual at esp
|
||||
.sector_lo dd ?
|
||||
@ -348,7 +360,7 @@ find_empty_slot64:
|
||||
jb .found_slot ; it's empty or read
|
||||
dec ecx
|
||||
jnz .search_for_empty
|
||||
call write_cache64 ; no empty slots found, write all
|
||||
stdcall write_cache64, [ebp+PARTITION.Disk] ; no empty slots found, write all
|
||||
test eax, eax
|
||||
jne .found_slot_access_denied
|
||||
jmp .search_again ; and start again
|
||||
@ -359,7 +371,7 @@ find_empty_slot64:
|
||||
ret
|
||||
|
||||
; This function is intended to replace the old 'write_cache' function.
|
||||
proc write_cache64 uses ecx edx esi edi
|
||||
proc write_cache64 uses ecx edx esi edi, disk:dword
|
||||
locals
|
||||
cache_chain_started dd ?
|
||||
cache_chain_size dd ?
|
||||
@ -432,8 +444,7 @@ endl
|
||||
test eax, eax
|
||||
jnz .nothing
|
||||
.flush:
|
||||
mov esi, [ebp]
|
||||
mov esi, [esi+PARTITION.Disk]
|
||||
mov esi, [disk]
|
||||
mov al, DISKFUNC.flush
|
||||
call disk_call_driver
|
||||
.nothing:
|
||||
@ -590,3 +601,26 @@ disk_free_cache:
|
||||
stdcall kernel_free, eax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
; This function flushes all modified data from both caches for the given DISK.
|
||||
; esi = pointer to DISK
|
||||
disk_sync:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by write_cache.
|
||||
cmp esi, 'old'
|
||||
jnz @f
|
||||
mov [hdd_appl_data], 0
|
||||
call write_cache
|
||||
mov [hdd_appl_data], 1
|
||||
jmp write_cache
|
||||
@@:
|
||||
; The algorithm is straightforward.
|
||||
push esi
|
||||
push esi ; for second write_cache64
|
||||
push esi ; for first write_cache64
|
||||
add esi, DISK.SysCache
|
||||
call write_cache64
|
||||
add esi, DISK.AppCache - DISK.SysCache
|
||||
call write_cache64
|
||||
pop esi
|
||||
ret
|
||||
|
@ -945,3 +945,83 @@ int13_call:
|
||||
@@:
|
||||
ret
|
||||
; \end{diamond}
|
||||
|
||||
reserve_hd1:
|
||||
|
||||
cli
|
||||
cmp [hd1_status], 0
|
||||
je reserve_ok1
|
||||
|
||||
sti
|
||||
call change_task
|
||||
jmp reserve_hd1
|
||||
|
||||
reserve_ok1:
|
||||
|
||||
push eax
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 5
|
||||
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
||||
mov [hd1_status], eax
|
||||
pop eax
|
||||
sti
|
||||
ret
|
||||
;********************************************
|
||||
|
||||
uglobal
|
||||
hd_in_cache db ?
|
||||
endg
|
||||
|
||||
reserve_hd_channel:
|
||||
; BIOS disk accesses are protected with common mutex hd1_status
|
||||
; This must be modified when hd1_status will not be valid!
|
||||
cmp [hdpos], 0x80
|
||||
jae .ret
|
||||
cmp [hdbase], 0x1F0
|
||||
jne .IDE_Channel_2
|
||||
.IDE_Channel_1:
|
||||
cli
|
||||
cmp [IDE_Channel_1], 0
|
||||
je .reserve_ok_1
|
||||
sti
|
||||
call change_task
|
||||
jmp .IDE_Channel_1
|
||||
.IDE_Channel_2:
|
||||
cli
|
||||
cmp [IDE_Channel_2], 0
|
||||
je .reserve_ok_2
|
||||
sti
|
||||
call change_task
|
||||
jmp .IDE_Channel_2
|
||||
.reserve_ok_1:
|
||||
mov [IDE_Channel_1], 1
|
||||
push eax
|
||||
mov al, 1
|
||||
jmp @f
|
||||
.reserve_ok_2:
|
||||
mov [IDE_Channel_2], 1
|
||||
push eax
|
||||
mov al, 3
|
||||
@@:
|
||||
cmp [hdid], 1
|
||||
sbb al, -1
|
||||
mov [hd_in_cache], al
|
||||
pop eax
|
||||
sti
|
||||
.ret:
|
||||
ret
|
||||
|
||||
free_hd_channel:
|
||||
; see comment at reserve_hd_channel
|
||||
cmp [hdpos], 0x80
|
||||
jae .ret
|
||||
cmp [hdbase], 0x1F0
|
||||
jne .IDE_Channel_2
|
||||
.IDE_Channel_1:
|
||||
mov [IDE_Channel_1], 0
|
||||
.ret:
|
||||
ret
|
||||
.IDE_Channel_2:
|
||||
mov [IDE_Channel_2], 0
|
||||
ret
|
||||
;********************************************
|
||||
|
@ -137,8 +137,6 @@ found_slot_access_denied:
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
clear_hd_cache:
|
||||
mov [fat_in_cache], -1
|
||||
mov [fat_change], 0
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
|
@ -38,5 +38,5 @@ end if
|
||||
ERROR:
|
||||
prebooting parameters must fit in first sector!!!
|
||||
end if
|
||||
hdsysimage db 'KOLIBRI IMG' ; load from
|
||||
image_save db 'KOLIBRI IMG' ; save to
|
||||
hdsysimage db 'KOLIBRI.IMG',0 ; load from
|
||||
image_save db 'KOLIBRI.IMG',0 ; save to
|
||||
|
@ -89,13 +89,22 @@ $Revision$
|
||||
mov [image_retrieved], 1
|
||||
ret
|
||||
|
||||
iglobal
|
||||
align 4
|
||||
read_image_fsinfo:
|
||||
dd 0 ; function: read
|
||||
dq 0 ; offset: zero
|
||||
dd 1474560/512 ; size
|
||||
dd RAMDISK ; buffer
|
||||
db 0
|
||||
dd hdsysimage+OS_BASE+0x10000
|
||||
endg
|
||||
|
||||
read_image:
|
||||
mov eax, hdsysimage+OS_BASE+0x10000
|
||||
mov ebx, 1474560/512
|
||||
mov ecx, RAMDISK
|
||||
mov esi, 0
|
||||
mov edi, 12
|
||||
call file_read
|
||||
mov ebx, read_image_fsinfo
|
||||
pushad
|
||||
call file_system_lfn
|
||||
popad
|
||||
ret
|
||||
|
||||
image_retrieved db 0
|
||||
|
@ -189,7 +189,6 @@ TASK_BASE equ (OS_BASE+0x0003010)
|
||||
TASK_DATA equ (OS_BASE+0x0003020)
|
||||
TASK_EVENT equ (OS_BASE+0x0003020)
|
||||
|
||||
d_width_calc_area equ (OS_BASE+0x0005000)
|
||||
mouseunder equ (OS_BASE+0x0006900)
|
||||
CDDataBuf equ (OS_BASE+0x0007000)
|
||||
FLOPPY_BUFF equ (OS_BASE+0x0008000)
|
||||
@ -256,7 +255,7 @@ SYS_SHUTDOWN equ (OS_BASE+0x000FF00)
|
||||
TASK_ACTIVATE equ (OS_BASE+0x000FF01)
|
||||
|
||||
REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0)
|
||||
BACKGROUND_CHANGED equ (OS_BASE+0x000FFF1)
|
||||
|
||||
BANK_RW equ (OS_BASE+0x000FFF2)
|
||||
MOUSE_BACKGROUND equ (OS_BASE+0x000FFF4)
|
||||
DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5)
|
||||
@ -264,9 +263,6 @@ DONT_SWITCH equ (OS_BASE+0x000FFFF)
|
||||
|
||||
TMP_STACK_TOP equ 0x006CC00
|
||||
|
||||
FONT_II equ (OS_BASE+0x006DC00)
|
||||
FONT_I equ (OS_BASE+0x006E600)
|
||||
|
||||
sys_pgdir equ (OS_BASE+0x006F000)
|
||||
|
||||
DRIVE_DATA equ (OS_BASE+0x0070000)
|
||||
@ -290,7 +286,11 @@ BgrAuxTable equ (OS_BASE+0x0298000)
|
||||
SB16Buffer equ (OS_BASE+0x02A0000)
|
||||
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)
|
||||
BOOT_VAR equ (OS_BASE+0x02E0000)
|
||||
|
||||
|
@ -437,10 +437,19 @@ proc load_file stdcall, file_name:dword
|
||||
jz .cleanup
|
||||
|
||||
mov [file2], eax
|
||||
pushfd
|
||||
cli
|
||||
|
||||
pushad
|
||||
mov ecx, unpack_mutex
|
||||
call mutex_lock
|
||||
popad
|
||||
|
||||
stdcall unpack, [file], eax
|
||||
popfd
|
||||
|
||||
pushad
|
||||
mov ecx, unpack_mutex
|
||||
call mutex_unlock
|
||||
popad
|
||||
|
||||
stdcall kernel_free, [file]
|
||||
mov eax, [file2]
|
||||
mov ebx, [file_size]
|
||||
@ -470,6 +479,11 @@ proc load_file stdcall, file_name:dword
|
||||
ret
|
||||
endp
|
||||
|
||||
uglobal
|
||||
align 4
|
||||
unpack_mutex MUTEX
|
||||
endg
|
||||
|
||||
align 4
|
||||
proc get_proc_ex stdcall, proc_name:dword, imports:dword
|
||||
|
||||
|
@ -72,6 +72,9 @@ iglobal
|
||||
szLoadFile db 'LoadFile',0
|
||||
szSendEvent db 'SendEvent',0
|
||||
szSetMouseData db 'SetMouseData',0
|
||||
szSetKeyboardData db 'SetKeyboardData',0
|
||||
szRegKeyboard db 'RegKeyboard',0
|
||||
szDelKeyboard db 'DelKeyboard',0
|
||||
szSleep db 'Sleep',0
|
||||
szGetTimerTicks db 'GetTimerTicks',0
|
||||
|
||||
@ -154,6 +157,9 @@ kernel_export:
|
||||
dd szLoadFile , load_file ;retval eax, ebx
|
||||
dd szSendEvent , send_event ;see EVENT.inc for specification
|
||||
dd szSetMouseData , set_mouse_data ;stdcall
|
||||
dd szSetKeyboardData , set_keyboard_data
|
||||
dd szRegKeyboard , register_keyboard
|
||||
dd szDelKeyboard , delete_keyboard
|
||||
dd szSleep , delay_ms
|
||||
dd szGetTimerTicks , get_timer_ticks
|
||||
|
||||
|
@ -442,72 +442,83 @@ endp
|
||||
align 4
|
||||
proc new_mem_resize stdcall, new_size:dword
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
mov edx, [current_slot]
|
||||
cmp [edx+APPDATA.heap_base], 0
|
||||
jne .exit
|
||||
|
||||
mov edi, [new_size]
|
||||
add edi, 4095
|
||||
and edi, not 4095
|
||||
mov [new_size], edi
|
||||
|
||||
mov edx, [current_slot]
|
||||
cmp [edx+APPDATA.heap_base], 0
|
||||
jne .exit
|
||||
|
||||
mov esi, [edx+APPDATA.mem_size]
|
||||
add esi, 4095
|
||||
and esi, not 4095
|
||||
|
||||
cmp edi, esi
|
||||
jae .expand
|
||||
ja .expand
|
||||
je .exit
|
||||
|
||||
mov ebx, edi
|
||||
shr edi, 12
|
||||
shr esi, 12
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
@@:
|
||||
mov eax, [app_page_tabs+edi*4]
|
||||
test eax, 1
|
||||
jz .next
|
||||
mov dword [app_page_tabs+edi*4], 2
|
||||
mov ebx, edi
|
||||
shl ebx, 12
|
||||
push eax
|
||||
|
||||
mov dword [app_page_tabs+edi*4], 0
|
||||
invlpg [ebx]
|
||||
pop eax
|
||||
call free_page
|
||||
|
||||
.next:
|
||||
add edi, 1
|
||||
inc edi
|
||||
add ebx, 0x1000
|
||||
cmp edi, esi
|
||||
jb @B
|
||||
|
||||
.update_size:
|
||||
mov ebx, [new_size]
|
||||
call update_mem_size
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
.update_size:
|
||||
mov edx, [current_slot]
|
||||
mov ebx, [new_size]
|
||||
call update_mem_size
|
||||
.exit:
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.expand:
|
||||
|
||||
push esi
|
||||
push edi
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
|
||||
xchg esi, edi
|
||||
|
||||
push esi ;new size
|
||||
push edi ;old size
|
||||
|
||||
add edi, 0x3FFFFF
|
||||
and edi, not(0x3FFFFF)
|
||||
add esi, 0x3FFFFF
|
||||
and esi, not(0x3FFFFF)
|
||||
|
||||
cmp esi, edi
|
||||
cmp edi, esi
|
||||
jae .grow
|
||||
|
||||
xchg esi, edi
|
||||
|
||||
@@:
|
||||
@@:
|
||||
call alloc_page
|
||||
test eax, eax
|
||||
jz .exit_pop
|
||||
jz .exit_fail
|
||||
|
||||
stdcall map_page_table, edi, eax
|
||||
|
||||
@ -524,51 +535,38 @@ proc new_mem_resize stdcall, new_size:dword
|
||||
cmp edi, esi
|
||||
jb @B
|
||||
.grow:
|
||||
;//-
|
||||
pop edi
|
||||
push edi
|
||||
mov esi, [pg_data.pages_free]
|
||||
sub esi, 1
|
||||
shr edi, 12
|
||||
cmp esi, edi
|
||||
jle .out_of_memory
|
||||
;//-
|
||||
pop edi
|
||||
pop esi
|
||||
@@:
|
||||
call alloc_page
|
||||
test eax, eax
|
||||
jz .exit
|
||||
stdcall map_page, esi, eax, dword PG_UW
|
||||
pop edi ;old size
|
||||
pop ecx ;new size
|
||||
|
||||
push edi
|
||||
mov edi, esi
|
||||
xor eax, eax
|
||||
mov ecx, 1024
|
||||
cld
|
||||
shr edi, 10
|
||||
shr ecx, 10
|
||||
sub ecx, edi
|
||||
shr ecx, 2 ;pages count
|
||||
mov eax, 2
|
||||
|
||||
add edi, app_page_tabs
|
||||
rep stosd
|
||||
pop edi
|
||||
|
||||
add esi, 0x1000
|
||||
cmp esi, edi
|
||||
jb @B
|
||||
|
||||
jmp .update_size
|
||||
;//-
|
||||
.exit_pop:
|
||||
.out_of_memory:
|
||||
;//-
|
||||
pop edi
|
||||
pop esi
|
||||
.exit:
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
jmp .update_size
|
||||
|
||||
.exit_fail:
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
add esp, 8
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
inc eax
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
align 4
|
||||
update_mem_size:
|
||||
; in: edx = slot base
|
||||
; ebx = new memory size
|
||||
@ -1253,7 +1251,7 @@ f68:
|
||||
cmp ecx, OS_BASE
|
||||
jae .fail
|
||||
|
||||
cmp ebx, OS_BASE
|
||||
cmp edx, OS_BASE
|
||||
jae .fail
|
||||
|
||||
mov edi, edx
|
||||
@ -1459,7 +1457,7 @@ proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword
|
||||
mov ebx, [size]
|
||||
dec ebx
|
||||
mov eax, 0xFFFFFFFF
|
||||
mov edx, 0x00000000
|
||||
mov edx, 0x0000000F
|
||||
sub eax, ebx
|
||||
sbb edx, 0
|
||||
or eax, 0x800
|
||||
|
@ -425,6 +425,17 @@ term9:
|
||||
add eax, 16
|
||||
cmp eax, hotkey_list+256*16
|
||||
jb .loop
|
||||
; get process PID
|
||||
mov eax, esi
|
||||
shl eax, 5
|
||||
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
||||
; compare current lock input with process PID
|
||||
cmp eax, [PID_lock_input]
|
||||
jne @f
|
||||
|
||||
xor eax, eax
|
||||
mov [PID_lock_input], eax
|
||||
@@:
|
||||
; remove hotkeys in buffer
|
||||
mov eax, hotkey_buffer
|
||||
.loop2:
|
||||
@ -677,24 +688,22 @@ term9:
|
||||
ret
|
||||
restore .slot
|
||||
|
||||
iglobal
|
||||
if lang eq ru
|
||||
boot_sched_1 db '‘®§¤ ¨¥ GDT TSS 㪠§ ⥫ï',0
|
||||
boot_sched_2 db '‘®§¤ ¨¥ IDT â ¡«¨æë',0
|
||||
else
|
||||
boot_sched_1 db 'Building gdt tss pointer',0
|
||||
boot_sched_2 db 'Building IDT table',0
|
||||
end if
|
||||
endg
|
||||
;iglobal
|
||||
;if lang eq ru
|
||||
; boot_sched_1 db '‘®§¤ ¨¥ GDT TSS 㪠§ ⥫ï',0
|
||||
; boot_sched_2 db '‘®§¤ ¨¥ IDT â ¡«¨æë',0
|
||||
;else
|
||||
; boot_sched_1 db 'Building gdt tss pointer',0
|
||||
; boot_sched_2 db 'Building IDT table',0
|
||||
;end if
|
||||
;endg
|
||||
|
||||
|
||||
build_scheduler:
|
||||
;build_scheduler:
|
||||
; mov esi, boot_sched_1
|
||||
; call boot_log
|
||||
; call build_process_gdt_tss_pointer
|
||||
|
||||
mov esi, boot_sched_1
|
||||
call boot_log
|
||||
; call build_process_gdt_tss_pointer
|
||||
|
||||
; mov esi,boot_sched_2
|
||||
; call boot_log
|
||||
|
||||
ret
|
||||
; mov esi,boot_sched_2
|
||||
; call boot_log
|
||||
; ret
|
||||
|
@ -145,7 +145,7 @@ iglobal
|
||||
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
||||
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
||||
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 undefined_syscall ; 27-reserved
|
||||
dd undefined_syscall ; 28-reserved
|
||||
@ -154,7 +154,7 @@ iglobal
|
||||
dd undefined_syscall ; 31-reserved
|
||||
dd undefined_syscall ; 32-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_getarea ; 36-GetArea
|
||||
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
||||
|
@ -72,6 +72,7 @@ proc fs_execute
|
||||
slot_base dd ?
|
||||
file_base dd ?
|
||||
file_size dd ?
|
||||
handle dd ? ;temp. for default cursor handle for curr. thread
|
||||
;app header data
|
||||
hdr_cmdline dd ? ;0x00
|
||||
hdr_path dd ? ;0x04
|
||||
@ -83,6 +84,15 @@ proc fs_execute
|
||||
|
||||
pushad
|
||||
|
||||
cmp [SCR_MODE], word 0x13
|
||||
jbe @f
|
||||
pushad
|
||||
stdcall set_cursor, [def_cursor_clock]
|
||||
mov [handle], eax
|
||||
mov [redrawmouse_unconditional], 1
|
||||
call __sys_draw_pointer
|
||||
popad
|
||||
@@:
|
||||
mov [flags], edx
|
||||
|
||||
; [ebp] pointer to filename
|
||||
@ -113,7 +123,8 @@ proc fs_execute
|
||||
.bigfilename:
|
||||
popad
|
||||
mov eax, -ERROR_FILE_NOT_FOUND
|
||||
ret
|
||||
|
||||
jmp .final
|
||||
|
||||
.namecopied:
|
||||
|
||||
@ -127,6 +138,7 @@ proc fs_execute
|
||||
@@:
|
||||
lea eax, [filename]
|
||||
stdcall load_file, eax
|
||||
|
||||
mov esi, -ERROR_FILE_NOT_FOUND
|
||||
test eax, eax
|
||||
jz .err_file
|
||||
@ -175,7 +187,7 @@ proc fs_execute
|
||||
jnz @F
|
||||
lea esi, [filename]
|
||||
@@:
|
||||
mov ecx, 8; 8 chars for name
|
||||
mov ecx, 11 ; 11 chars for name! 8 - is old value!
|
||||
mov edi, [slot_base]
|
||||
.copy_process_name_loop:
|
||||
lodsb
|
||||
@ -237,7 +249,9 @@ end if
|
||||
xor ebx, ebx
|
||||
mov [application_table_status], ebx;unlock application_table_status mutex
|
||||
mov eax, [process_number];set result
|
||||
ret
|
||||
|
||||
jmp .final
|
||||
|
||||
.failed:
|
||||
mov eax, [save_cr3]
|
||||
call set_cr3
|
||||
@ -248,6 +262,15 @@ end if
|
||||
xor eax, eax
|
||||
mov [application_table_status], eax
|
||||
mov eax, esi
|
||||
.final:
|
||||
cmp [SCR_MODE], word 0x13
|
||||
jbe @f
|
||||
pushad
|
||||
stdcall set_cursor, [handle]
|
||||
mov [redrawmouse_unconditional], 1
|
||||
call __sys_draw_pointer
|
||||
popad
|
||||
@@:
|
||||
ret
|
||||
endp
|
||||
|
||||
|
@ -49,11 +49,23 @@ keymap_alt:
|
||||
|
||||
|
||||
if lang eq ru
|
||||
boot_fonts db '˜à¨äâë § £à㦥ë',0
|
||||
boot_initirq db 'ˆ¨æ¨ «¨§ æ¨ï IRQ',0
|
||||
boot_picinit db 'ˆ¨æ¨ «¨§ æ¨ï PIC',0
|
||||
boot_v86machine db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬ë V86 ¬ è¨ë',0
|
||||
boot_inittimer db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬®£® â ©¬¥à (IRQ0)',0
|
||||
boot_initapic db '<27>®¯ë⪠¨¨æ¨ «¨§ 樨 APIC',0
|
||||
boot_enableirq db '‚ª«îç¨âì ¯à¥àë¢ ¨ï 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db '<27> §à¥è¥¨¥ ¯à¥àë¢ ¨© ¢ ª®â஫«¥à¥ IDE',0
|
||||
boot_detectfloppy db '<27>®¨áª floppy ¤¨áª®¢®¤®¢',0
|
||||
boot_detecthdcd db '<27>®¨áª ¦¥áâª¨å ¤¨áª®¢ ¨ ATAPI ¯à¨¢®¤®¢',0
|
||||
boot_getcache db '<27>®«ã票¥ ¯ ¬ï⨠¤«ï ªíè ',0
|
||||
boot_detectpart db '<27>®¨áª à §¤¥«®¢ ¤¨áª®¢ëå ãáâனá⢠å',0
|
||||
boot_init_sys db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬®£® ª â «®£ /sys',0
|
||||
boot_loadlibs db '‡ £à㧪 ¡¨¡«¨®â¥ª (.obj)',0
|
||||
boot_memdetect db 'Š®«¨ç¥á⢮ ®¯¥à ⨢®© ¯ ¬ïâ¨',' ',' Œ¡',0
|
||||
boot_tss db '“áâ ®¢ª TSSs',0
|
||||
boot_cpuid db '—⥨¥ CPUIDs',0
|
||||
boot_devices db '<27>®¨áª ãáâனáâ¢',0
|
||||
; boot_devices db '<27>®¨áª ãáâனáâ¢',0
|
||||
boot_timer db '“áâ ®¢ª â ©¬¥à ',0
|
||||
boot_irqs db '<27>¥à¥®¯à¥¤¥«¥¨¥ IRQ',0
|
||||
boot_setmouse db '“áâ ®¢ª ¬ëè¨',0
|
||||
@ -69,15 +81,30 @@ if lang eq ru
|
||||
boot_pal_vga db '“áâ ®¢ª VGA 640x480 ¯ «¨âàë',0
|
||||
boot_failed db '‡ £à㧪 ¯¥à¢®£® ¯à¨«®¦¥¨ï ¥ 㤠« áì',0
|
||||
boot_mtrr db '“áâ ®¢ª MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC ¢ª«îç¥', 0
|
||||
boot_APIC_nfound db 'APIC ¥ ©¤¥', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db '‚ᥠ£®â®¢® ¤«ï § ¯ã᪠, ¦¬¨âॠESC ¤«ï áâ àâ ',0
|
||||
end if
|
||||
else
|
||||
boot_fonts db 'Fonts loaded',0
|
||||
boot_initirq db 'Initialize IRQ',0
|
||||
boot_picinit db 'Initialize PIC',0
|
||||
boot_v86machine db 'Initialize system V86 machine',0
|
||||
boot_inittimer db 'Initialize system timer (IRQ0)',0
|
||||
boot_initapic db 'Try to initialize APIC',0
|
||||
boot_enableirq db 'Enable interrupts 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db 'Enable interrupts in IDE controller',0
|
||||
boot_detectfloppy db 'Search floppy drives',0
|
||||
boot_detecthdcd db 'Search hard drives and ATAPI drives',0
|
||||
boot_getcache db 'Get memory for cache',0
|
||||
boot_detectpart db 'Search partitions on disk devices',0
|
||||
boot_init_sys db 'Initialize system directory /sys',0
|
||||
boot_loadlibs db 'Loading librares (.obj)',0
|
||||
boot_memdetect db 'Determining amount of memory',0
|
||||
boot_tss db 'Setting TSSs',0
|
||||
boot_cpuid db 'Reading CPUIDs',0
|
||||
boot_devices db 'Detecting devices',0
|
||||
; boot_devices db 'Detecting devices',0
|
||||
boot_setmouse db 'Setting mouse',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
@ -90,14 +117,14 @@ else
|
||||
boot_pal_vga db 'Setting VGA 640x480 palette',0
|
||||
boot_failed db 'Failed to start first app',0
|
||||
boot_mtrr db 'Setting MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC enabled', 0
|
||||
boot_APIC_nfound db 'APIC not found', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db 'All set - press ESC to start',0
|
||||
end if
|
||||
end if
|
||||
|
||||
boot_APIC_found db 'APIC enabled', 0
|
||||
boot_APIC_nfound db 'APIC not found', 0
|
||||
|
||||
;new_process_loading db 'K : New Process - loading',13,10,0
|
||||
;new_process_running db 'K : New Process - done',13,10,0
|
||||
start_not_enough_memory db 'K : New Process - not enough memory',13,10,0
|
||||
@ -135,9 +162,6 @@ else
|
||||
ud_user_message db 'Error: unsupported processor instruction',0
|
||||
end if
|
||||
|
||||
char db '/sys/FONTS/CHAR.MT',0
|
||||
char2 db '/sys/FONTS/CHAR2.MT',0
|
||||
|
||||
bootpath db '/KOLIBRI '
|
||||
bootpath2 db 0
|
||||
vmode db '/sys/drivers/VMODE.MDR',0
|
||||
@ -333,6 +357,7 @@ _WinMapAddress rd 1
|
||||
_WinMapSize rd 1
|
||||
|
||||
def_cursor rd 1
|
||||
def_cursor_clock rd 1
|
||||
current_cursor rd 1
|
||||
hw_cursor rd 1
|
||||
cur_saved_base rd 1
|
||||
|
@ -133,6 +133,10 @@ end_search_partitions_bd:
|
||||
loop start_search_partitions_bd
|
||||
jmp end_search_partitions
|
||||
|
||||
problem_partition db 0 ; used for partitions search
|
||||
|
||||
include '../fs/part_set.inc'
|
||||
|
||||
partition_data_transfer:
|
||||
mov edi, [transfer_adress]
|
||||
mov esi, PARTITION_START ;start of file_system_data
|
||||
|
@ -197,16 +197,21 @@
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 4 - ®¬¥à äãªæ¨¨
|
||||
* ebx = [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||||
* ecx = 0xX0RRGGBB, £¤¥
|
||||
* ecx = 0xXYRRGGBB, £¤¥
|
||||
* RR, GG, BB § ¤ îâ 梥â ⥪áâ
|
||||
* X=ABnn (¡¨âë):
|
||||
* nn § ¤ ¥â ¨á¯®«ì§ã¥¬ë© èà¨äâ: 0=á¨áâ¥¬ë© ¬®®è¨à¨ë©,
|
||||
1=á¨áâ¥¬ë© èà¨äâ ¯¥à¥¬¥®© è¨à¨ë
|
||||
* A=0 - ¢ë¢®¤¨âì esi ᨬ¢®«®¢, A=1 - ¢ë¢®¤¨âì ASCIIZ-áâபã
|
||||
* B=1 - § ªà 訢 âì ä® æ¢¥â®¬ edi
|
||||
* Y=Cnnn (¡¨âë):
|
||||
* C=1 ¯¥à¥ ¯à ¢¨âì ¢ë¢®¤ ¢ ®¡« áâì ¯®«ì§®¢ ⥫ï, § ¤ ® ¢ edi
|
||||
* nnn - ¥ ¨á¯®«ì§ã¥âáï ¢ ⥪ã饬 ¢¨¤¥, ¤®«¦® ¡ëâì 0 (zero)
|
||||
* edx = 㪠§ ⥫ì ç «® áâப¨
|
||||
* esi = ¤«ï A=0 ¤«¨ áâப¨, ¤®«¦ ¡ëâì ¥ ¡®«ìè¥ 255;
|
||||
¤«ï A=1 ¨£®à¨àã¥âáï
|
||||
* edi = 梥⠤«ï § ªà ᪨ ä® , ¥á«¨ B=1
|
||||
* edi = 㪠§ â¥«ì ®¡« áâì ¯®«ì§®¢ ⥫ï, ¥á«¨ C=1
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
@ -214,7 +219,12 @@
|
||||
¢â®à®© - ¨§ char2.mt.
|
||||
* Ž¡ èà¨äâ ¨¬¥îâ ¢ëá®âã 9 ¯¨ªá¥«¥©, è¨à¨ ¬®®è¨à¨®£® èà¨äâ
|
||||
à ¢ 6 ¯¨ªá¥«¥©.
|
||||
|
||||
* C=1, £«ã¡¨ â®çª¨ = 32 ¡¨â , ®¡« áâì ¯®«ì§®¢ â¥«ï ¢ë£«ï¤¨â â ª:
|
||||
dword Xsize
|
||||
dword Ysize
|
||||
®áâ ⮪ ®¡« á⨠= Xsize * Y size * 4
|
||||
* <20>¥«ì§ï ®¤®¢à¥¬¥® ¨á¯®«ì§®¢ âì B=1 ¨ C=1, ¯®áª®«ìªã ¢ ®¡®¨å
|
||||
á«ãç ïå ¨á¯®«ì§®¢ ॣ¨áâà edi ¤«ï à §ëå 楫¥©.
|
||||
======================================================================
|
||||
========================= ”ãªæ¨ï 5 - ¯ 㧠. =========================
|
||||
======================================================================
|
||||
@ -330,7 +340,7 @@
|
||||
¢ ¯®§¨æ¨¨ ecx
|
||||
* +8: word: § १¥à¢¨à®¢ ®
|
||||
* +10 = +0xA: 11 ¡ ©â: ¨¬ï ¯à®æ¥áá
|
||||
(¨¬ï ᮮ⢥âáâ¢ãî饣® ¨á¯®«ï¥¬®£® ä ©« ¢ ä®à¬ ⥠8+3)
|
||||
(¨¬ï § ¯ã饮£® ä ©« - ¨á¯®«ï¥¬ë© ä ©« ¡¥§ à áè¨à¥¨ï)
|
||||
* +21 = +0x15: byte: § १¥à¢¨à®¢ ®, íâ®â ¡ ©â ¥ ¨§¬¥ï¥âáï
|
||||
* +22 = +0x16: dword: ¤à¥á ¯à®æ¥áá ¢ ¯ ¬ïâ¨
|
||||
* +26 = +0x1A: dword: à §¬¥à ¨á¯®«ì§ã¥¬®© ¯ ¬ï⨠- 1
|
||||
@ -608,6 +618,39 @@
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 1 ¯à¨ ãᯥå¥, 0 ¯à¨ ®è¨¡ª¥
|
||||
|
||||
======================================================================
|
||||
====================== ”ãªæ¨ï 15, ¯®¤äãªæ¨ï 8 ======================
|
||||
=========== <20>®«ãç¨âì ª®®à¤¨ âë ¯®á«¥¤¥© ®âà¨á®¢ª¨ ä® . ============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 15 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 8 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = [left]*65536 + [right]
|
||||
* ebx = [top]*65536 + [bottom]
|
||||
‡ ¬¥ç ¨ï:
|
||||
* (left,top) - ª®®à¤¨ âë «¥¢®£® ¢¥à奣® 㣫 ,
|
||||
(right,bottom) - ª®®à¤¨ âë ¯à ¢®£® ¨¦¥£®.
|
||||
* „«ï ¯®«ãç¥¨ï ¡®«¥¥ ¤®á⮢¥àëå ᢥ¤¥¨©, ¥®¡å®¤¨¬® ¢ë§¢ âì
|
||||
äãªæ¨î áà §ã ¯®á«¥ ¯®«ã票ï ᮡëâ¨ï:
|
||||
5 = § ¢¥à訫 áì ¯¥à¥à¨á®¢ª ä® à ¡®ç¥£® á⮫
|
||||
|
||||
======================================================================
|
||||
====================== ”ãªæ¨ï 15, ¯®¤äãªæ¨ï 9 ======================
|
||||
=============== <20>¥à¥à¨á®¢ âì ¯àאַ㣮«ìãî ç áâì ä® . ===============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 15 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 9 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = [left]*65536 + [right]
|
||||
* edx = [top]*65536 + [bottom]
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* (left,top) - ª®®à¤¨ âë «¥¢®£® ¢¥à奣® 㣫 ,
|
||||
(right,bottom) - ª®®à¤¨ âë ¯à ¢®£® ¨¦¥£®.
|
||||
* …᫨ ¯ à ¬¥âàë ãáâ ®¢«¥ë ¥ª®à४⮠- ä® ¥ ¯¥à¥à¨á®¢ë¢ ¥âáï.
|
||||
|
||||
======================================================================
|
||||
============= ”ãªæ¨ï 16 - á®åà ¨âì à ¬¤¨áª ¤¨áª¥âã. =============
|
||||
======================================================================
|
||||
@ -1065,6 +1108,34 @@ dd 1675
|
||||
* ‚®ááâ ®¢«¥¨¥ ®ª á ®¤®¢à¥¬¥®© ªâ¨¢¨§ 樥© ®áãé¥á⢫ï¥âáï
|
||||
¯®¤äãªæ¨¨ 3 (¯à¨¨¬ î饩 ®¬¥à á«®â ).
|
||||
|
||||
======================================================================
|
||||
======= ”ãªæ¨ï 18, ¯®¤äãªæ¨ï 23 - ¬¨¨¬¨§¨à®¢ âì ¢á¥ ®ª . =========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 18 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 23 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0 - ¢á¥ ®ª ¡ë«¨ ¬¨¨¬¨§¨à®¢ ë ¤® ¢ë§®¢ äãªæ¨¨
|
||||
* eax = N - ª®«¨ç¥á⢮ ®ª® ᢥàãâëå äãªæ¨¥©
|
||||
‡ ¬¥ç ¨ï:
|
||||
* Žª ᯥæ. ¯®â®ª®¢ (¨¬ï ç¨ ¥âáï á ᨬ¢®« @) ¥ ᢮à 稢 îâáï.
|
||||
|
||||
======================================================================
|
||||
===== ”ãªæ¨ï 18, ¯®¤äãªæ¨ï 24 - ãáâ ®¢¨âì ¯à¥¤¥«ë ®âà¨á®¢ª¨. ======
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 18 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 24 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = ®¢ë© à §¬¥à ¯® X
|
||||
* edx = ®¢ë© à §¬¥à ¯® Y
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ”ãªæ¨ï ¥ ¬¥ï¥â 䨧¨ç¥áª¨© à §¬¥à ¢¨¤¥®à¥¦¨¬ . Ž ¯à¥¤ § ç¥
|
||||
¤«ï ¥áâ ¤ àâëå ¤¨á¯«¥¥¢, ®â®¡à ¦ îé¨å ¨§®¡à ¦¥¨¥ ç áâ¨ç®.
|
||||
* <20> §¬¥àë 㪠§ë¢ ¥¬ë¥ ¢ äãªæ¨¨ ¥ ¤®«¦ë ¯à¥¢ëè âì à §¬¥àë ⥪ã饣®
|
||||
¢¨¤¥®à¥¦¨¬ , ¨ ç¥ äãªæ¨ï ¨ç¥£® ¥ ¨§¬¥¨â.
|
||||
|
||||
======================================================================
|
||||
==================== ”ãªæ¨ï 20 - ¨â¥à䥩á MIDI. ====================
|
||||
======================================================================
|
||||
@ -1506,6 +1577,26 @@ dd 1675
|
||||
* ”ãªæ¨ï ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 ¤«ï ATAPI-ãáâனá⢠(CD ¨ DVD).
|
||||
* <20>ਬ¥à®¬ ¨á¯®«ì§®¢ ¨ï äãªæ¨¨ ï¥âáï ¯à¨«®¦¥¨¥ CD_tray.
|
||||
|
||||
======================================================================
|
||||
========== ”ãªæ¨ï 25 - § ¯¨á âì ®¡« áâì á«®© ä® . ===============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 25 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 㪠§ â¥«ì ¯à¥¤¢ à¨â¥«ì® ¢ë¤¥«¥ãî ®¡« áâì ¯ ¬ïâ¨,
|
||||
£¤¥ à §¬¥é¥® ¨á室®¥ ¨§®¡à ¦¥¨¥ ¢ ä®à¬ ⥠BBGGRRTTBBGGRRTT...
|
||||
* ecx = [à §¬¥à ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ y]
|
||||
* edx = [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* Š®®à¤¨ âë ®¡« á⨠- íâ® ª®®à¤¨ âë ¢¥à奣® «¥¢®£® 㣫
|
||||
®¡« á⨠®â®á¨â¥«ì® íªà .
|
||||
* <20> §¬¥à ¨§®¡à ¦¥¨ï ¢ ¡ ©â å ¥áâì 4*xsize*ysize.
|
||||
* TT - ¡ ©â 㪠§ â¥«ì ¯à®§à ç®áâ¨, ¢ áâ®ï饥 ¢à¥¬ï:
|
||||
®â 1 ¤® FF - ¥¯à®§à ç®, ®â 0 - ¯à®§à ç®.
|
||||
* ”ãªæ¨ï à §¬¥é ¥â ¨§®¡à ¦¥¨¥ ¥ ä®®¢®¥ ¨§®¡à ¦¥¨¥ (ä.15),
|
||||
¯àï¬ãî ¢ LFB. Ž¯æ¨¨ ä.15 ¤«ï ä. 25 ¥ ¨¬¥îâ á¬ëá« .
|
||||
|
||||
======================================================================
|
||||
===== ”ãªæ¨ï 26, ¯®¤äãªæ¨ï 1 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ MPU MIDI. =====
|
||||
======================================================================
|
||||
@ -1703,6 +1794,19 @@ dd 1675
|
||||
* <20>ਠᮧ¤ ¨¨ ¯à®æ¥áá /¯®â®ª ⥪ãé ï ¯ ¯ª á«¥¤ã¥âáï ®â
|
||||
த¨â¥«ï.
|
||||
|
||||
======================================================================
|
||||
========= ”ãªæ¨ï 34 - 㧠âì ª®¬ã ¯à¨ ¤«¥¦¨â â®çª íªà . =========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 34 - ®¬¥à äãªæ¨¨
|
||||
* ebx = x-ª®®à¤¨ â (®â®á¨â¥«ì® íªà )
|
||||
* ecx = y-ª®®à¤¨ â (®â®á¨â¥«ì® íªà )
|
||||
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0x000000XX - â®çª ¯à¨ ¤«¥¦¨â á«®âã ®ª N
|
||||
<20>ਠ¥ª®à४âëå § 票ïå ebx ¨ ecx äãªæ¨ï ¢®§¢à é ¥â 0
|
||||
* ”ãªæ¨ï ¡¥à¥â § ç¥¨ï ¨§ ®¡« á⨠[_WinMapAddress]
|
||||
|
||||
======================================================================
|
||||
============ ”ãªæ¨ï 35 - ¯à®ç¨â âì 梥â â®çª¨ íªà ¥. ============
|
||||
======================================================================
|
||||
@ -3241,7 +3345,7 @@ IPC
|
||||
* ebx = 㪠§ â¥«ì ¨§®¡à ¦¥¨¥
|
||||
* ecx = [à §¬¥à ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ y]
|
||||
* edx = [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||||
* esi = ç¨á«® ¡¨â ¯¨ªá¥«ì, ¤®«¦® ¡ëâì 1,2,4,8,15,16,24 ¨«¨ 32
|
||||
* esi = ç¨á«® ¡¨â ¯¨ªá¥«ì, ¤®«¦® ¡ëâì 1,2,4,8,9,15,16,24 ¨«¨ 32
|
||||
* edi = 㪠§ â¥«ì ¯ «¨âàã (2 ¢ á⥯¥¨ esi 梥⮢ 0x00RRGGBB);
|
||||
¨£®à¨àã¥âáï ¯à¨ esi > 8
|
||||
* ebp = ᬥ饨¥ ¤ ëå ª ¦¤®© á«¥¤ãî饩 áâப¨ ¨§®¡à ¦¥¨ï
|
||||
@ -3265,6 +3369,9 @@ IPC
|
||||
ᮮ⢥âáâ¢ã¥â ¯¥à¢®¬ã ¯¨ªá¥«î.
|
||||
* ”®à¬ â ¨§®¡à ¦¥¨ï á 8 ¡¨â ¬¨ ¯¨ªá¥«ì: ª ¦¤ë© ¡ ©â ¨§®¡à ¦¥¨ï
|
||||
à áᬠâਢ ¥âáï ª ª ¨¤¥ªá ¢ ¯ «¨âà¥.
|
||||
* ”®à¬ â ¨§®¡à ¦¥¨ï á 9 ¡¨â ¬¨ ¯¨ªá¥«ì: ª ¦¤ë© ¡ ©â ¨§®¡à ¦¥¨ï
|
||||
(8 ¡¨â) ®¡®§ ç ¥â ¨â¥á¨¢®áâì á¥à®£® ¤«ï ®¤®£® ¯¨ªá¥«ï, â.®.
|
||||
íâ®â ⨯ ¨§®¡à ¦¥¨ï ¨¤¥â¨ç¥ 8 ¡¨â ¯¨ªá¥«ì ¡¥§ ¯ «¨âàë.
|
||||
* ”®à¬ â ¨§®¡à ¦¥¨ï á 15 ¡¨â ¬¨ ¯¨ªá¥«ì: 梥⠪ ¦¤®£® ¯¨ªá¥«ï
|
||||
ª®¤¨àã¥âáï ª ª (¢ ¡¨â®¢®¬ ¯à¥¤áâ ¢«¥¨¨) 0RRRRRGGGGGBBBBB -
|
||||
¯® 5 ¯¨ªá¥«¥© ª ¦¤ë© 梥â.
|
||||
@ -3364,6 +3471,27 @@ IPC
|
||||
…᫨ ¤à㣮¥ ¯à¨«®¦¥¨¥ ®¯à¥¤¥«¨«® íâã ¦¥ ª®¬¡¨ æ¨î,
|
||||
®® ¯®-¯à¥¦¥¬ã ¡ã¤¥â ¯®«ãç âì 㢥¤®¬«¥¨ï.
|
||||
|
||||
------------- <20>®¤äãªæ¨ï 6 - § ¡«®ª¨à®¢ âì ®¡ëçë© ¢¢®¤. -------------
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 66 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 6 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20>«®ª¨àã¥âáï ®¡ëçë© ¢¢®¤ ¤ ëå á ª« ¢¨ âãàë ¤«ï ãáâ ®¢«¥ëå
|
||||
"£®àïç¨å" ª« ¢¨è
|
||||
* „«ï í¬ã«ï樨 ¬ëè¨ ç¥à¥§ ª« ¢¨ âãàã, ¯à¨«®¦¥¨¥ MOUSEMUL
|
||||
|
||||
--------- <20>®¤äãªæ¨ï 7 - à §¡«®ª¨à®¢ âì ®¡ëçë© ¢¢®¤. ----------------
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 66 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 7 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20> §¡«®ª¨à®¢ ¨¥ १ã«ìâ ⮢ ä. 66.6
|
||||
* „«ï í¬ã«ï樨 ¬ëè¨ ç¥à¥§ ª« ¢¨ âãàã, ¯à¨«®¦¥¨¥ MOUSEMUL
|
||||
|
||||
======================================================================
|
||||
============ ”ãªæ¨ï 67 - ¨§¬¥¨âì ¯®«®¦¥¨¥/à §¬¥àë ®ª . ===========
|
||||
======================================================================
|
||||
@ -3616,6 +3744,21 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
||||
* ‘®¤¥à¦¨¬®¥ ¯ ¬ï⨠¢¯«®âì ¤® ¨¬¥ì襣® ¨§ áâ ண® ¨ ®¢®£®
|
||||
à §¬¥à®¢ á®åà ï¥âáï.
|
||||
|
||||
======================================================================
|
||||
========= ”ãªæ¨ï 68, ¯®¤äãªæ¨ï 21 - § £à㧨âì ¤à ©¢¥à PE. ==========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 68 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 21 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = 㪠§ ⥫ì ASCIIZ-áâபã á ¨¬¥¥¬ ¤à ©¢¥à
|
||||
* edx = 㪠§ â¥«ì ª®¬ ¤ãî áâபã
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* eax = 0 - ¥ã¤ ç
|
||||
* ¨ ç¥ eax = åí¤« ¤à ©¢¥à
|
||||
‡ ¬¥ç ¨ï:
|
||||
* …᫨ ¤à ©¢¥à ¥éñ ¥ § £à㦥, ® § £à㦠¥âáï;
|
||||
¥á«¨ ¤à ©¢¥à 㦥 § £à㦥, ¨ç¥£® ¥ ¬¥ï¥âáï.
|
||||
|
||||
======================================================================
|
||||
=== ”ãªæ¨ï 68, ¯®¤äãªæ¨ï 22 - ®âªàëâì ¨¬¥®¢ ãî ®¡« áâì ¯ ¬ïâ¨. ==
|
||||
======================================================================
|
||||
@ -4464,10 +4607,7 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
||||
ª®¯ª¨ ¨§ ¡ãä¥à áç¨â ë äãªæ¨¥© 17)
|
||||
* 4 = § १¥à¢¨à®¢ ® (¢ ⥪ã饩 ॠ«¨§ 樨 ¨ª®£¤ ¥ ¯à¨å®¤¨â ¤ ¦¥
|
||||
¯à¨ à §¬ ᪨஢ª¥ äãªæ¨¥© 40)
|
||||
* 5 = ¯¥à¥à¨á®¢ë¢ ¥âáï ä® à ¡®ç¥£® á⮫ (á¡à áë¢ ¥âáï
|
||||
¢â®¬ â¨ç¥áª¨ ¯®á«¥ ¯¥à¥à¨á®¢ª¨, â ª çâ® ¥á«¨ ¢® ¢à¥¬ï ¯¥à¥à¨á®¢ª¨
|
||||
ä® ¯à®£à ¬¬ ¥ ¦¤ñâ ¨ ¥ ¯à®¢¥àï¥â ᮡëâ¨ï, â® í⮣® ᮡëâ¨ï
|
||||
® ¥ § ¬¥â¨â)
|
||||
* 5 = § ¢¥à訫 áì ¯¥à¥à¨á®¢ª ä® à ¡®ç¥£® á⮫
|
||||
* 6 = ᮡë⨥ ®â ¬ëè¨ (çâ®-â® á«ã稫®áì - ¦ ⨥ ª®¯ªã ¬ëè¨
|
||||
¨«¨ ¯¥à¥¬¥é¥¨¥; á¡à áë¢ ¥âáï ¯à¨ ¯à®ç⥨¨)
|
||||
* 7 = ¯à®¨§®è«® ᮡë⨥ IPC (ᬮâਠäãªæ¨î 60 - Inter Process
|
||||
|
@ -194,16 +194,22 @@ Remarks:
|
||||
Parameters:
|
||||
* eax = 4 - function number
|
||||
* ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
||||
* ecx = 0xX0RRGGBB, where
|
||||
* ecx = 0xXYRRGGBB, where
|
||||
* RR, GG, BB specify text color
|
||||
* X=ABnn (bits):
|
||||
* nn specifies the used font: 0=system monospaced,
|
||||
1=system font of variable width
|
||||
* A=0 - output esi characters, A=1 - output ASCIIZ-string
|
||||
* B=1 - fill background with the color edi
|
||||
* Y = Cnnn
|
||||
* C=1 redirect the output to the user area, specified in edi
|
||||
* nnn - not used in the current, must be 0 (zero)
|
||||
* edx = pointer to the beginning of the string
|
||||
* esi = for A=0 length of the string, must not exceed 255;
|
||||
for A=1 is ignored
|
||||
* edi = color to fill background, if B=1
|
||||
* edi = pointer to user area, for redirect, if C=1
|
||||
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
@ -211,6 +217,12 @@ Remarks:
|
||||
second - from char2.mt.
|
||||
* Both fonts have height 9 pixels, width of the monospaced font
|
||||
is equal to 6 pixels.
|
||||
* C=1, pixel depth = 32 bits, user area is as follows:
|
||||
dword Xsize
|
||||
dword Ysize
|
||||
rest of the area = Xsize * Y size * 4
|
||||
* You can not use B = 1 and C = 1, at the same time. Since in both
|
||||
cases, the register edi is used for different purposes.
|
||||
|
||||
======================================================================
|
||||
========================= Function 5 - delay. ========================
|
||||
@ -325,7 +337,7 @@ Returned value:
|
||||
position ecx
|
||||
* +8: word: reserved
|
||||
* +10 = +0xA: 11 bytes: name of the process
|
||||
(name of corresponding executable file in the format 8+3)
|
||||
(name of the started file - executable file without extension)
|
||||
* +21 = +0x15: byte: reserved, this byte is not changed
|
||||
* +22 = +0x16: dword: address of the process in memory
|
||||
* +26 = +0x1A: dword: size of used memory - 1
|
||||
@ -600,6 +612,39 @@ Parameters:
|
||||
Returned value:
|
||||
* eax = 1 - success, 0 - error
|
||||
|
||||
======================================================================
|
||||
===================== Function 15, subfunction 8 =====================
|
||||
============= Get coordinates of last draw the background ============
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 15 - function number
|
||||
* ebx = 8 - subfunction number
|
||||
Returned value:
|
||||
* eax = [left]*65536 + [right]
|
||||
* ebx = [top]*65536 + [bottom]
|
||||
Remarks:
|
||||
* (left,top) are coordinates of the left upper corner,
|
||||
(right,bottom) are coordinates of the right lower one.
|
||||
* For receiving more reliable information, call the function
|
||||
immediately after the event:
|
||||
5 = kernel finished redrawing of the desktop background
|
||||
|
||||
======================================================================
|
||||
===================== Function 15, subfunction 9 =====================
|
||||
============= Redraws a rectangular part of the background ===========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 15 - function number
|
||||
* ebx = 9 - subfunction number
|
||||
* ecx = [left]*65536 + [right]
|
||||
* edx = [top]*65536 + [bottom]
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
* (left,top) are coordinates of the left upper corner,
|
||||
(right,bottom) are coordinates of the right lower one.
|
||||
* If parameters are set incorrectly then background is not redrawn.
|
||||
|
||||
======================================================================
|
||||
=============== Function 16 - save ramdisk on a floppy. ==============
|
||||
======================================================================
|
||||
@ -1063,6 +1108,36 @@ Remarks:
|
||||
* One can restore and activate window simultaneously with
|
||||
subfunction 3 (which requires slot number).
|
||||
|
||||
======================================================================
|
||||
======== Function 18, subfunction 23 - minimize all windows. ==========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 18 - function number
|
||||
* ebx = 23 - subfunction number
|
||||
Returned value:
|
||||
* eax = 0 - all windows have been minimized before a function call
|
||||
* eax = N - number of windows minimized from function
|
||||
Remarks:
|
||||
* Window of special thread (name begin to symbol @) is not minimize.
|
||||
|
||||
======================================================================
|
||||
======= Function 18, subfunction 24 - set limits of screen. ==========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 18 - function number
|
||||
* ebx = 24 - subfunction number
|
||||
* ecx = new X size
|
||||
* edx = new Y size
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
* The function does not change the physical size of the video mode.
|
||||
It is designed for non-standard displays which display the image
|
||||
partially.
|
||||
* The sizes specified in the function should not exceed the sizes
|
||||
of the current video mode, otherwise the function will not change
|
||||
anything.
|
||||
|
||||
======================================================================
|
||||
==================== Function 20 - MIDI interface. ===================
|
||||
======================================================================
|
||||
@ -1492,6 +1567,26 @@ Remarks:
|
||||
* The function is supported only for ATAPI devices (CD and DVD).
|
||||
* An example of usage of the function is the application CD_tray.
|
||||
|
||||
======================================================================
|
||||
======= Function 25 - put image area on the background layer. ========
|
||||
======================================================================
|
||||
Paramters:
|
||||
* eax = 25 - function number
|
||||
* ebx = pointer to the previously allocated memory area,
|
||||
where placed the source images in a format BBGGRRTTBBGGRRTT...
|
||||
* ecx = [size on axis x]*65536 + [size on axis y]
|
||||
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
* Coordinates of the image are coordinates of the upper left corner
|
||||
of the image relative to the screen.
|
||||
* Size of the image in bytes is 4*xsize*ysize
|
||||
* TT - byte pointer of transparency, at current version:
|
||||
1 to FF - opaque, 0 - transparent.
|
||||
* The function places the image directly to LFB. It is not for
|
||||
background image f.15. Options f.15 to f.25 does not make sense.
|
||||
|
||||
======================================================================
|
||||
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
|
||||
======================================================================
|
||||
@ -1681,6 +1776,19 @@ Remarks:
|
||||
* At process/thread creation the current folder will be inherited
|
||||
from the parent.
|
||||
|
||||
======================================================================
|
||||
========= Function 34 - who owner the pixel on the screen. ===========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 34 - function number
|
||||
* ebx = x-coordinate (relative to the display)
|
||||
* ecx = y-coordinate (relative to the display)
|
||||
|
||||
Returned value:
|
||||
* eax = 0x000000XX - owner of pixel the slot window N
|
||||
If incorrect values ebx and ecx then function returns 0
|
||||
* The function takes the value from the area [_WinMapAddress]
|
||||
|
||||
======================================================================
|
||||
======= Function 35 - read the color of a pixel on the screen. =======
|
||||
======================================================================
|
||||
@ -3221,7 +3329,7 @@ Parameters:
|
||||
* ebx = pointer to the image
|
||||
* ecx = [size on axis x]*65536 + [size on axis y]
|
||||
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
||||
* esi = number of bits per pixel, must be 1,2,4,8,15,16,24 or 32
|
||||
* esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
|
||||
* edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
|
||||
ignored when esi > 8
|
||||
* ebp = offset of next row data relative to previous row data
|
||||
@ -3242,6 +3350,9 @@ Remarks:
|
||||
corresponds to first pixel.
|
||||
* Format of image with 8 bits per pixel: each byte of image is
|
||||
index in the palette.
|
||||
* Format of image with 9 bits per pixel: array of one byte values;
|
||||
each byte (8 bit) represents the intensity of gray for one pixel;
|
||||
this format is equal to 8bpp without palette.
|
||||
* Format of image with 15 bits per pixel: the color of each pixel
|
||||
is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
|
||||
each color.
|
||||
@ -3340,6 +3451,26 @@ Remarks:
|
||||
If other application has defined the same combination, it will
|
||||
still receive notices.
|
||||
|
||||
--------------- Subfunction 6 - block the normal input. --------------
|
||||
Parameters:
|
||||
* eax = 66 - function number
|
||||
* ebx = 6 - subfunction number
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
* Blocking the normal keyboard input for installed hotkeys
|
||||
* To emulate a mouse via the keyboard, the application MOUSEMUL
|
||||
|
||||
------------ Subfunction 7 - unlock the normal input. ----------------
|
||||
Parameters:
|
||||
* eax = 66 - function number
|
||||
* ebx = 7 - subfunction number
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
* Unlocking the results of the f. 66.6
|
||||
* To emulate a mouse via the keyboard, the application MOUSEMUL
|
||||
|
||||
======================================================================
|
||||
========= Function 67 - change position/sizes of the window. =========
|
||||
======================================================================
|
||||
@ -3595,6 +3726,21 @@ Remarks:
|
||||
* The contents of the block are unchanged up to the shorter of
|
||||
the new and old sizes.
|
||||
|
||||
======================================================================
|
||||
=========== Function 68, subfunction 21 - load driver PE. ============
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 68 - function number
|
||||
* ebx = 21 - subfunction number
|
||||
* ecx = pointer to ASCIIZ-string with driver name
|
||||
* edx = pointer to command line
|
||||
Returned value:
|
||||
* eax = 0 - failed
|
||||
* otherwise eax = driver handle
|
||||
Remarks:
|
||||
* If the driver was not loaded yet, it is loaded;
|
||||
if the driver was loaded yet, nothing happens.
|
||||
|
||||
======================================================================
|
||||
======== Function 68, subfunction 22 - open named memory area. =======
|
||||
======================================================================
|
||||
@ -4430,9 +4576,7 @@ Codes of events:
|
||||
are read out by function 17)
|
||||
* 4 = reserved (in current implementation never comes even after
|
||||
unmasking by function 40)
|
||||
* 5 = the desktop background is redrawed (is reset automatically
|
||||
after redraw, so if in redraw time program does not wait and
|
||||
does not check events, it will not remark this event)
|
||||
* 5 = kernel finished redrawing of the desktop background
|
||||
* 6 = mouse event (something happened - button pressing or moving;
|
||||
is reset at reading)
|
||||
* 7 = IPC event (see function 60 -
|
||||
|
@ -80,6 +80,9 @@ kernel_export \
|
||||
LoadFile,\
|
||||
SendEvent,\
|
||||
SetMouseData,\
|
||||
SetKeyboardData,\
|
||||
RegKeyboard,\
|
||||
DelKeyboard,\
|
||||
Sleep,\
|
||||
GetTimerTicks,\
|
||||
\
|
||||
@ -92,4 +95,8 @@ kernel_export \
|
||||
\
|
||||
LFBAddress,\
|
||||
GetDisplay,\
|
||||
SetScreen
|
||||
SetScreen,\
|
||||
\
|
||||
DiskAdd,\
|
||||
DiskMediaChanged,\
|
||||
DiskDel
|
||||
|
@ -348,11 +348,18 @@ align 4
|
||||
cmp [edi+inp_size], 12
|
||||
jne .fail
|
||||
|
||||
mov eax, [ebx]
|
||||
mov ebx, [ebx+4]
|
||||
mov eax, [ebx+4]
|
||||
mov ebx, [ebx+8]
|
||||
|
||||
pushfd
|
||||
cli
|
||||
mov dword [edx+STREAM.time_base], eax
|
||||
mov dword [edx+STREAM.time_base+4], ebx
|
||||
xor eax, eax
|
||||
mov dword [edx+STREAM.time_stamp], eax
|
||||
mov dword [edx+STREAM.time_stamp+4], eax
|
||||
popfd
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
|
@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; 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 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@ -93,8 +93,8 @@ if DEBUG
|
||||
mov esi, msgErrAtchIRQ
|
||||
call SysMsgBoardStr
|
||||
|
||||
stdcall GetIntHandler, sb_irq_num
|
||||
call SysMsgBoardNum
|
||||
; stdcall GetIntHandler, sb_irq_num
|
||||
; call SysMsgBoardNum
|
||||
|
||||
jmp .stop
|
||||
@@:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -634,31 +634,34 @@ fat_find_lfn:
|
||||
; [esp+4] = next
|
||||
; [esp+8] = first
|
||||
; [esp+C]... - possibly parameters for first and next
|
||||
; out: CF=1 - file not found
|
||||
; out: CF=1 - file not found, eax=error code
|
||||
; else CF=0, esi->next name component, edi->direntry
|
||||
pusha
|
||||
lea eax, [esp+0Ch+20h]
|
||||
call dword [eax-4]
|
||||
jc .reterr
|
||||
sub esp, 262*2 ; reserve place for LFN
|
||||
mov ebp, esp
|
||||
push 0 ; for fat_get_name: read ASCII name
|
||||
.l1:
|
||||
lea ebp, [esp+4]
|
||||
call fat_get_name
|
||||
jc .l2
|
||||
call fat_compare_name
|
||||
jz .found
|
||||
.l2:
|
||||
mov ebp, [esp+8+262*2+4]
|
||||
lea eax, [esp+0Ch+20h+262*2+4]
|
||||
call dword [eax-8]
|
||||
jnc .l1
|
||||
add esp, 262*2+4
|
||||
.reterr:
|
||||
mov [esp+28], eax
|
||||
stc
|
||||
popa
|
||||
ret
|
||||
.found:
|
||||
add esp, 262*2+4
|
||||
mov ebp, [esp+8]
|
||||
; if this is LFN entry, advance to true entry
|
||||
cmp byte [edi+11], 0xF
|
||||
jnz @f
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -169,10 +169,6 @@ endg
|
||||
|
||||
fs_info: ;start of code - Mihasik
|
||||
push eax
|
||||
cmp [eax+21], byte 'h'
|
||||
je fs_info_h
|
||||
cmp [eax+21], byte 'H'
|
||||
je fs_info_h
|
||||
cmp [eax+21], byte 'r'
|
||||
je fs_info_r
|
||||
cmp [eax+21], byte 'R'
|
||||
@ -189,9 +185,6 @@ endg
|
||||
mov ebx, 2847 ;total clusters
|
||||
mov edx, 512 ;cluster size
|
||||
xor eax, eax ;always 0
|
||||
jmp fs_info1
|
||||
fs_info_h: ;if harddisk
|
||||
call get_hd_info
|
||||
fs_info1:
|
||||
pop edi
|
||||
mov [esp+36], eax
|
||||
@ -437,32 +430,6 @@ hd_err_return:
|
||||
jmp file_system_return
|
||||
@@:
|
||||
|
||||
cmp dword [esp+20], 0; READ
|
||||
jne fs_noharddisk_read
|
||||
|
||||
mov eax, [esp+0] ; /fname
|
||||
lea edi, [eax+12]
|
||||
mov byte [eax], 0 ; path to asciiz
|
||||
inc eax ; filename start
|
||||
|
||||
mov ebx, [esp+12] ; count to read
|
||||
mov ecx, [esp+8] ; buffer
|
||||
mov edx, [esp+4]
|
||||
add edx, 12*2 ; dir start
|
||||
sub edi, edx ; path length
|
||||
mov esi, [esp+16] ; blocks to read
|
||||
|
||||
call file_read
|
||||
|
||||
mov edi, [esp+0]
|
||||
mov byte [edi], '/'
|
||||
|
||||
call free_hd_channel
|
||||
and [hd1_status], 0
|
||||
jmp file_system_return
|
||||
|
||||
fs_noharddisk_read:
|
||||
|
||||
call free_hd_channel
|
||||
and [hd1_status], 0
|
||||
|
||||
|
@ -7,6 +7,19 @@
|
||||
|
||||
$Revision$
|
||||
|
||||
ERROR_SUCCESS = 0
|
||||
ERROR_DISK_BASE = 1
|
||||
ERROR_UNSUPPORTED_FS = 2
|
||||
ERROR_UNKNOWN_FS = 3
|
||||
ERROR_PARTITION = 4
|
||||
ERROR_FILE_NOT_FOUND = 5
|
||||
ERROR_END_OF_FILE = 6
|
||||
ERROR_MEMORY_POINTER = 7
|
||||
ERROR_DISK_FULL = 8
|
||||
ERROR_FAT_TABLE = 9 ;deprecated
|
||||
ERROR_FS_FAIL = 9
|
||||
ERROR_ACCESS_DENIED = 10
|
||||
ERROR_DEVICE = 11
|
||||
|
||||
image_of_eax EQU esp+32
|
||||
image_of_ebx EQU esp+20
|
||||
|
@ -33,24 +33,8 @@ align 4
|
||||
fs_dependent_data_start:
|
||||
; FATxx data
|
||||
|
||||
SECTORS_PER_FAT dd 0x1f3a
|
||||
NUMBER_OF_FATS dd 0x2
|
||||
SECTORS_PER_CLUSTER dd 0x8
|
||||
BYTES_PER_SECTOR dd 0x200 ; Note: if BPS <> 512 need lots of changes
|
||||
ROOT_CLUSTER dd 2 ; first rootdir cluster
|
||||
FAT_START dd 0 ; start of fat table
|
||||
ROOT_START dd 0 ; start of rootdir (only fat16)
|
||||
ROOT_SECTORS dd 0 ; count of rootdir sectors (only fat16)
|
||||
DATA_START dd 0 ; start of data area (=first cluster 2)
|
||||
LAST_CLUSTER dd 0 ; last availabe cluster
|
||||
ADR_FSINFO dd 0 ; used only by fat32
|
||||
|
||||
fatRESERVED dd 0x0FFFFFF6
|
||||
fatBAD dd 0x0FFFFFF7
|
||||
fatEND dd 0x0FFFFFF8
|
||||
fatMASK dd 0x0FFFFFFF
|
||||
|
||||
fatStartScan dd 2
|
||||
.partition dd ?
|
||||
rb 80
|
||||
|
||||
fs_dependent_data_end:
|
||||
file_system_data_size = $ - PARTITION_START
|
||||
@ -88,7 +72,6 @@ ext2_data:
|
||||
.block_size dd ?
|
||||
.count_block_in_block dd ?
|
||||
.blocks_per_group dd ?
|
||||
.inodes_per_group dd ?
|
||||
.global_desc_table dd ?
|
||||
.root_inode dd ? ; pointer to root inode in memory
|
||||
.inode_size dd ?
|
||||
@ -427,108 +410,27 @@ boot_read_ok:
|
||||
cmp [hd_error], 0
|
||||
jnz problem_fat_dec_count
|
||||
|
||||
cmp word [ebx+0x1fe], 0xaa55; is it valid boot sector?
|
||||
jnz problem_fat_dec_count
|
||||
|
||||
movzx eax, word [ebx+0xe]; sectors reserved
|
||||
add eax, [PARTITION_START]
|
||||
mov [FAT_START], eax; fat_start = partition_start + reserved
|
||||
|
||||
movzx eax, byte [ebx+0xd]; sectors per cluster
|
||||
push 0
|
||||
mov eax, [PARTITION_END]
|
||||
sub eax, [PARTITION_START]
|
||||
inc eax
|
||||
push eax
|
||||
push 0
|
||||
push [PARTITION_START]
|
||||
push ebp
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
mov esi, 'old' ; special value: there is no DISK structure
|
||||
push 1 ; bootsector read successfully
|
||||
call fat_create_partition
|
||||
add esp, 4*7
|
||||
test eax, eax
|
||||
jz problem_fat_dec_count
|
||||
mov [SECTORS_PER_CLUSTER], eax
|
||||
|
||||
movzx ecx, word [ebx+0xb]; bytes per sector
|
||||
cmp ecx, 0x200
|
||||
jnz problem_fat_dec_count
|
||||
mov [BYTES_PER_SECTOR], ecx
|
||||
|
||||
movzx eax, word [ebx+0x11]; count of rootdir entries (=0 fat32)
|
||||
mov edx, 32
|
||||
mul edx
|
||||
dec ecx
|
||||
add eax, ecx ; round up if not equal count
|
||||
inc ecx ; bytes per sector
|
||||
div ecx
|
||||
mov [ROOT_SECTORS], eax; count of rootdir sectors
|
||||
|
||||
movzx eax, word [ebx+0x16]; sectors per fat <65536
|
||||
test eax, eax
|
||||
jnz fat16_fatsize
|
||||
mov eax, [ebx+0x24] ; sectors per fat
|
||||
fat16_fatsize:
|
||||
mov [SECTORS_PER_FAT], eax
|
||||
|
||||
movzx eax, byte [ebx+0x10]; number of fats
|
||||
test eax, eax ; if 0 it's not fat partition
|
||||
jz problem_fat_dec_count
|
||||
mov [NUMBER_OF_FATS], eax
|
||||
imul eax, [SECTORS_PER_FAT]
|
||||
add eax, [FAT_START]
|
||||
mov [ROOT_START], eax; rootdir = fat_start + fat_size * fat_count
|
||||
add eax, [ROOT_SECTORS]; rootdir sectors should be 0 on fat32
|
||||
mov [DATA_START], eax; data area = rootdir + rootdir_size
|
||||
|
||||
movzx eax, word [ebx+0x13]; total sector count <65536
|
||||
test eax, eax
|
||||
jnz fat16_total
|
||||
mov eax, [ebx+0x20] ; total sector count
|
||||
fat16_total:
|
||||
add eax, [PARTITION_START]
|
||||
dec eax
|
||||
mov [PARTITION_END], eax
|
||||
inc eax
|
||||
sub eax, [DATA_START]; eax = count of data sectors
|
||||
xor edx, edx
|
||||
div dword [SECTORS_PER_CLUSTER]
|
||||
inc eax
|
||||
mov [LAST_CLUSTER], eax
|
||||
dec eax ; cluster count
|
||||
mov [fatStartScan], 2
|
||||
|
||||
; limits by Microsoft Hardware White Paper v1.03
|
||||
cmp eax, 4085 ; 0xff5
|
||||
jb problem_fat_dec_count; fat12 not supported
|
||||
cmp eax, 65525 ; 0xfff5
|
||||
jb fat16_partition
|
||||
|
||||
fat32_partition:
|
||||
mov eax, [ebx+0x2c] ; rootdir cluster
|
||||
mov [ROOT_CLUSTER], eax
|
||||
movzx eax, word [ebx+0x30]; fs info sector
|
||||
add eax, [PARTITION_START]
|
||||
mov [ADR_FSINFO], eax
|
||||
call hd_read
|
||||
mov eax, [ebx+0x1ec]
|
||||
cmp eax, -1
|
||||
jz @f
|
||||
mov [fatStartScan], eax
|
||||
@@:
|
||||
mov [fs_dependent_data_start.partition], eax
|
||||
mov al, [eax+FAT.fs_type]
|
||||
mov [fs_type], al
|
||||
|
||||
popad
|
||||
|
||||
mov [fatRESERVED], 0x0FFFFFF6
|
||||
mov [fatBAD], 0x0FFFFFF7
|
||||
mov [fatEND], 0x0FFFFFF8
|
||||
mov [fatMASK], 0x0FFFFFFF
|
||||
mov [fs_type], 32 ; Fat32
|
||||
call free_hd_channel
|
||||
mov [hd1_status], 0 ; free
|
||||
ret
|
||||
|
||||
fat16_partition:
|
||||
xor eax, eax
|
||||
mov [ROOT_CLUSTER], eax
|
||||
|
||||
popad
|
||||
|
||||
mov [fatRESERVED], 0x0000FFF6
|
||||
mov [fatBAD], 0x0000FFF7
|
||||
mov [fatEND], 0x0000FFF8
|
||||
mov [fatMASK], 0x0000FFFF
|
||||
mov [fs_type], 16 ; Fat16
|
||||
call free_hd_channel
|
||||
mov [hd1_status], 0 ; free
|
||||
ret
|
||||
|
||||
|
@ -23,6 +23,7 @@ endg
|
||||
EV_SPACE = 512
|
||||
FreeEvents = event_start-EVENT.fd ; "âèðòóàëüíûé" event, èñïîëüçóþòñÿ òîëüêî ïîëÿ:
|
||||
; FreeEvents.fd=event_start è FreeEvents.bk=event_end
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
init_events: ;; used from kernel.asm
|
||||
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
|
||||
@ -32,7 +33,9 @@ init_events: ;; used from kernel.asm
|
||||
mov ecx, EV_SPACE ; current - in allocated space
|
||||
mov ebx, FreeEvents ; previos - íà÷àëî ñïèñêà
|
||||
push ebx ; îíî æå è êîíåö ïîòîì áóäåò
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov [ebx+EVENT.fd], eax
|
||||
mov [eax+EVENT.bk], ebx
|
||||
mov ebx, eax ; previos <- current
|
||||
@ -41,14 +44,16 @@ init_events: ;; used from kernel.asm
|
||||
pop eax ; âîò îíî êîíöîì è ñòàëî
|
||||
mov [ebx+EVENT.fd], eax
|
||||
mov [eax+EVENT.bk], ebx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.fail:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
EVENT_WATCHED equ 0x10000000 ;áèò 28
|
||||
EVENT_SIGNALED equ 0x20000000 ;áèò 29
|
||||
MANUAL_RESET equ 0x40000000 ;áèò 30
|
||||
MANUAL_DESTROY equ 0x80000000 ;áèò 31
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
create_event: ;; EXPORT use
|
||||
;info:
|
||||
@ -67,7 +72,8 @@ create_event: ;; EXPORT use
|
||||
mov edx, [edx+TASKDATA.pid]
|
||||
pushfd
|
||||
cli
|
||||
|
||||
;--------------------------------------
|
||||
align 4
|
||||
set_event: ;; INTERNAL use !!! don't use for Call
|
||||
;info:
|
||||
; Áåðåì íîâûé event èç FreeEvents, çàïîëíÿåì åãî ïîëÿ, êàê óêàçàíî â ecx,edx,esi
|
||||
@ -89,7 +95,9 @@ set_event: ;; INTERNAL use !!! don't use
|
||||
call init_events
|
||||
popad
|
||||
jz RemoveEventTo.break ; POPF+RET
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov eax, [eax+EVENT.fd]
|
||||
mov [eax+EVENT.magic], 'EVNT'
|
||||
mov [eax+EVENT.destroy], destroy_event.internal
|
||||
@ -103,7 +111,8 @@ set_event: ;; INTERNAL use !!! don't use
|
||||
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
|
||||
;--------------------------------------
|
||||
align 4
|
||||
RemoveEventTo: ;; INTERNAL use !!! don't use for Call
|
||||
;param:
|
||||
; eax - óêàçàòåëü íà event, ÊÎÒÎÐÛÉ âñòàâëÿåì
|
||||
@ -118,10 +127,12 @@ RemoveEventTo: ;; INTERNAL use !!! don't use
|
||||
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight
|
||||
mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight
|
||||
mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.break:
|
||||
popfd
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
NotDummyTest: ;; INTERNAL use (not returned for fail !!!)
|
||||
pop edi
|
||||
@ -129,6 +140,8 @@ NotDummyTest: ;; INTERNAL use (not returned
|
||||
mov ebx, eax
|
||||
mov eax, [ebx+EVENT.pid]
|
||||
push edi
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.small: ; êðèâî êàê-òî...
|
||||
pop edi
|
||||
pushfd
|
||||
@ -137,7 +150,7 @@ NotDummyTest: ;; INTERNAL use (not returned
|
||||
shl eax, 8
|
||||
jz RemoveEventTo.break ; POPF+RET
|
||||
jmp edi ; øòàòíûé âîçâðàò
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
raise_event: ;; EXPORT use
|
||||
;info:
|
||||
@ -158,19 +171,23 @@ raise_event: ;; EXPORT use
|
||||
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
||||
cld
|
||||
rep movsd
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
|
||||
jnz RemoveEventTo.break ; POPF+RET
|
||||
bt edx, 28 ;EVENT_WATCHED
|
||||
jnc @f
|
||||
test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24
|
||||
jz RemoveEventTo.break ; POPF+RET
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
|
||||
add eax, SLOT_BASE+APP_EV_OFFSET
|
||||
xchg eax, ebx
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
clear_event: ;; EXPORT use
|
||||
;info:
|
||||
@ -184,7 +201,7 @@ clear_event: ;; EXPORT use
|
||||
and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
|
||||
xchg eax, ebx
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
send_event: ;; EXPORT use
|
||||
;info:
|
||||
@ -207,7 +224,7 @@ send_event: ;; EXPORT use
|
||||
lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET]
|
||||
mov ecx, EVENT_SIGNALED
|
||||
jmp set_event
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
DummyTest: ;; INTERNAL use (not returned for fail !!!)
|
||||
;param:
|
||||
@ -217,16 +234,21 @@ DummyTest: ;; INTERNAL use (not returned
|
||||
jne @f
|
||||
cmp [eax+EVENT.id], ebx
|
||||
je .ret
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop eax
|
||||
xor eax, eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
Wait_events:
|
||||
or ebx, -1; infinite timeout
|
||||
;--------------------------------------
|
||||
align 4
|
||||
Wait_events_ex:
|
||||
;info:
|
||||
; Îæèäàíèå "àáñòðàêòíîãî" ñîáûòèÿ ÷åðåç ïåðåâîä ñëîòà â 5-þ ïîçèöèþ.
|
||||
@ -260,9 +282,11 @@ Wait_events_ex:
|
||||
mov [eax+TASKDATA.state], 5
|
||||
call change_task
|
||||
mov eax, [esi+APPDATA.wait_param]
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
wait_event: ;; EXPORT use
|
||||
;info:
|
||||
@ -281,7 +305,7 @@ wait_event: ;; EXPORT use
|
||||
mov edx, get_event_alone ; wait_test
|
||||
call Wait_events ; timeout ignored
|
||||
jmp wait_finish
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_ex: ;; f68:14
|
||||
;info:
|
||||
@ -303,6 +327,8 @@ get_event_ex: ;; f68:14
|
||||
cld
|
||||
rep movsd
|
||||
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field
|
||||
;--------------------------------------
|
||||
align 4
|
||||
wait_finish:
|
||||
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24
|
||||
jnz get_event_queue.ret ; RET
|
||||
@ -314,7 +340,7 @@ wait_finish:
|
||||
pushfd
|
||||
cli
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
destroy_event: ;; EXPORT use
|
||||
;info:
|
||||
@ -326,6 +352,8 @@ destroy_event: ;; EXPORT use
|
||||
; eax - àäðåñ îáúåêòà EVENT (=0 => fail)
|
||||
;scratched: ebx,ecx
|
||||
call DummyTest ; not returned for fail !!!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.internal:
|
||||
xor ecx, ecx ; clear common header
|
||||
pushfd
|
||||
@ -336,7 +364,7 @@ destroy_event: ;; EXPORT use
|
||||
mov [eax+EVENT.id], ecx
|
||||
mov ebx, FreeEvents
|
||||
jmp RemoveEventTo
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_queue:
|
||||
;info:
|
||||
@ -353,9 +381,11 @@ get_event_queue:
|
||||
mov eax, [ebx+APPOBJ.bk] ; âûáèðàåì ñ êîíöà, ïî ïðèíöèïó FIFO
|
||||
cmp eax, ebx ; empty ???
|
||||
je get_event_alone.ret0
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_alone:
|
||||
;info:
|
||||
@ -372,21 +402,27 @@ get_event_alone:
|
||||
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24
|
||||
jnz .ret
|
||||
or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret0:
|
||||
xor eax, eax; NO event!!!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
sys_sendwindowmsg: ;; f72
|
||||
dec ebx
|
||||
jnz .ret ;subfunction==1 ?
|
||||
;pushfd ;à íàôèãà?
|
||||
pushfd
|
||||
cli
|
||||
sub ecx, 2
|
||||
je .sendkey
|
||||
dec ecx
|
||||
jnz .retf
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sendbtn:
|
||||
cmp byte[BTN_COUNT], 1
|
||||
jae .result ;overflow
|
||||
@ -394,18 +430,27 @@ sys_sendwindowmsg: ;; f72
|
||||
shl edx, 8
|
||||
mov [BTN_BUFF], edx
|
||||
jmp .result
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sendkey:
|
||||
movzx eax, byte[KEY_COUNT]
|
||||
cmp al, 120
|
||||
jae .result ;overflow
|
||||
inc byte[KEY_COUNT]
|
||||
mov [KEY_COUNT+1+eax], dl
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.result:
|
||||
setae byte[esp+32] ;ñ÷èòàåì, ÷òî èñõîäíî: dword[esp+32]==72
|
||||
.retf: ;popfd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.retf:
|
||||
popfd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ret:
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
sys_getevent: ;; f11
|
||||
mov ebx, [current_slot];ïîêà ýòî âîïðîñ, ÷åãî êóäû ñóâàòü..........
|
||||
@ -415,16 +460,18 @@ sys_getevent: ;; f11
|
||||
popfd
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
sys_waitforevent: ;; f10
|
||||
or ebx, -1; infinite timeout
|
||||
;--------------------------------------
|
||||
align 4
|
||||
sys_wait_event_timeout: ;; f23
|
||||
mov edx, get_event_for_app; wait_test
|
||||
call Wait_events_ex ; ebx - timeout
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
get_event_for_app: ;; used from f10,f11,f23
|
||||
;info:
|
||||
@ -442,36 +489,52 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE]
|
||||
mov ecx, [edi+TASKDATA.event_mask]
|
||||
and ecx, 0x7FFFFFFF
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.loop: ; ïîêà íå èñ÷åðïàåì âñå áèòû ìàñêè
|
||||
bsr eax, ecx ; íàõîäèì íåíóëåâîé áèò ìàñêè (31 -> 0)
|
||||
jz .no_events ; èñ÷åðïàëè âñå áèòû ìàñêè, íî íè÷åãî íå íàøëè ???
|
||||
btr ecx, eax ; ñáðàñûâàåì ïðîâåðÿåìûé áèò ìàñêè
|
||||
; ïåðåõîäèì íà îáðàáîò÷èê ýòîãî (eax) áèòà
|
||||
cmp eax, 9
|
||||
jae .loop ; eax=[9..31], ignored
|
||||
jae .loop ; eax=[9..31], ignored (event 10...32)
|
||||
|
||||
cmp eax, 3
|
||||
je .loop ; eax=3, ignored
|
||||
ja .FlagAutoReset ; eax=[4..8], retvals=eax+1
|
||||
je .loop ; eax=3, ignored (event 4)
|
||||
|
||||
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
|
||||
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
|
||||
cmp [edi-twdw+WDATA.fl_redraw], al;al==0
|
||||
jne .result
|
||||
jmp .loop
|
||||
.no_events:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_events:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.FlagAutoReset: ; retvals: BgrRedraw=5, Mouse=6, IPC=7, Stack=8, Debug=9
|
||||
cmp eax, 5; Mouse 5+1=6
|
||||
jne .no_mouse_check
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.mouse_check: ; Mouse 5+1=6
|
||||
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 .no_mouse_check
|
||||
jmp .FlagAutoReset
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; If the window is captured and moved by the user, then no mouse events!!!
|
||||
mov al, [mouse.active_sys_window.action]
|
||||
@ -479,16 +542,24 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
test al, al
|
||||
pop eax
|
||||
jnz .loop
|
||||
.no_mouse_check:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.FlagAutoReset: ; retvals: BgrRedraw=5, IPC=7, Stack=8, Debug=9
|
||||
btr [ebx+APPDATA.event_mask], eax
|
||||
jnc .loop
|
||||
.result: ; retval = eax+1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.result: ; retval = eax+1
|
||||
inc eax
|
||||
ret
|
||||
.BtKy:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.BtKy:
|
||||
movzx edx, bh
|
||||
movzx edx, word[WIN_STACK+edx*2]
|
||||
je .Keys ; eax=1, retval Keys=2
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.Buttons: ; eax=2, retval Buttons=3
|
||||
cmp byte[BTN_COUNT], 0
|
||||
je .loop ; empty ???
|
||||
@ -501,14 +572,20 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
mov [window_minimize], 1
|
||||
dec byte[BTN_COUNT]
|
||||
jmp .loop
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.Keys: ; eax==1
|
||||
cmp edx, [TASK_COUNT]
|
||||
jne @f ; not Top ???
|
||||
cmp [KEY_COUNT], al; al==1
|
||||
jae .result ; not empty ???
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov edx, hotkey_buffer
|
||||
@@:
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
cmp [edx], bh ; bh - slot for testing
|
||||
je .result
|
||||
add edx, 8
|
||||
@ -516,3 +593,4 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
jb @b
|
||||
jmp .loop
|
||||
;end.
|
||||
;-----------------------------------------------------------------------------
|
@ -16,15 +16,15 @@ dtext_asciiz_esi: ; for skins title out
|
||||
jmp dtext.1
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
||||
; ebx x & y
|
||||
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
|
||||
; X = ABnnb:
|
||||
; nn = font
|
||||
; A = 0 <=> output esi characters; otherwise output ASCIIZ string
|
||||
; B = 1 <=> fill background with color eax
|
||||
; edx start of text
|
||||
; edi 1 force
|
||||
dtext:
|
||||
; ebx x & y
|
||||
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
|
||||
; X = ABnnb:
|
||||
; nn = font
|
||||
; A = 0 <=> output esi characters; otherwise output ASCIIZ string
|
||||
; B = 1 <=> fill background with color eax
|
||||
; edx start of text
|
||||
; edi 1 force or user area for redirect
|
||||
push eax
|
||||
xor eax, eax
|
||||
;--------------------------------------
|
||||
@ -36,14 +36,17 @@ align 4
|
||||
xchg eax, ebx ; eax=x, ebx=y
|
||||
cmp esi, 255
|
||||
jb .loop
|
||||
|
||||
mov esi, 255
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.loop:
|
||||
test ecx, ecx
|
||||
js .test_asciiz
|
||||
|
||||
dec esi
|
||||
js .end
|
||||
|
||||
jmp @f
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@ -53,6 +56,7 @@ align 4
|
||||
|
||||
cmp byte [esp+28], 1
|
||||
jne @f
|
||||
|
||||
dec esi
|
||||
js .end
|
||||
;--------------------------------------
|
||||
@ -63,6 +67,7 @@ align 4
|
||||
movzx edx, byte [edx-1]
|
||||
test ecx, 0x10000000
|
||||
jnz .font2
|
||||
|
||||
mov esi, 9
|
||||
lea ebp, [FONT_I+8*edx+edx]
|
||||
;--------------------------------------
|
||||
@ -75,7 +80,17 @@ align 4
|
||||
.pixloop1:
|
||||
shr dl, 1
|
||||
jz .pixloop1end
|
||||
|
||||
jnc .nopix
|
||||
|
||||
test ecx, 0x08000000 ; redirect the output to the user area
|
||||
jz @f
|
||||
|
||||
call draw_text_to_user_area
|
||||
jmp .pixloop1cont
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
||||
; call [putpixel]
|
||||
call __sys_putpixel
|
||||
@ -85,8 +100,19 @@ align 4
|
||||
.nopix:
|
||||
test ecx, 0x40000000
|
||||
jz .pixloop1cont
|
||||
|
||||
push ecx
|
||||
mov ecx, [esp+4+20h+20h]
|
||||
|
||||
test ecx, 0x08000000 ; redirect the output to the user area
|
||||
jz @f
|
||||
|
||||
call draw_text_to_user_area
|
||||
pop ecx
|
||||
jmp .pixloop1cont
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
||||
; call [putpixel]
|
||||
call __sys_putpixel
|
||||
@ -104,6 +130,7 @@ align 4
|
||||
inc ebp
|
||||
dec esi
|
||||
jnz .symloop1
|
||||
|
||||
popad
|
||||
add eax, 6
|
||||
jmp .loop
|
||||
@ -124,6 +151,15 @@ align 4
|
||||
.pixloop2:
|
||||
shr dl, 1
|
||||
jnc .nopix2
|
||||
|
||||
test ecx, 0x08000000 ; redirect the output to the user area
|
||||
jz @f
|
||||
|
||||
call draw_text_to_user_area
|
||||
jmp .pixloop2cont
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
||||
; call [putpixel]
|
||||
call __sys_putpixel
|
||||
@ -133,8 +169,19 @@ align 4
|
||||
.nopix2:
|
||||
test ecx, 0x40000000
|
||||
jz .pixloop2cont
|
||||
|
||||
push ecx
|
||||
mov ecx, [esp+12+20h+20h]
|
||||
|
||||
test ecx, 0x08000000 ; redirect the output to the user area
|
||||
jz @f
|
||||
|
||||
call draw_text_to_user_area
|
||||
pop ecx
|
||||
jmp .pixloop2cont
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
||||
; call [putpixel]
|
||||
call __sys_putpixel
|
||||
@ -145,12 +192,14 @@ align 4
|
||||
inc eax
|
||||
dec esi
|
||||
jnz .pixloop2
|
||||
|
||||
pop esi
|
||||
sub eax, esi
|
||||
inc ebx
|
||||
inc ebp
|
||||
dec dword [esp]
|
||||
jnz .symloop2
|
||||
|
||||
pop eax
|
||||
add dword [esp+28], esi
|
||||
popad
|
||||
@ -162,3 +211,29 @@ align 4
|
||||
pop eax
|
||||
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
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
FONT_I:
|
||||
file 'char.mt'
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
FONT_II:
|
||||
file 'char2.mt'
|
||||
;------------------------------------------------------------------------------
|
@ -258,8 +258,8 @@ mouse._.left_button_press_handler: ;///////////////////////////////////////////
|
||||
call .calculate_e_delta
|
||||
|
||||
.call_window_handler:
|
||||
mov eax, mouse.active_sys_window.old_box
|
||||
call sys_window_start_moving_handler
|
||||
; mov eax, mouse.active_sys_window.old_box
|
||||
; call sys_window_start_moving_handler
|
||||
|
||||
.exit:
|
||||
ret
|
||||
|
@ -1026,6 +1026,55 @@ align 4
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
minimize_all_window:
|
||||
push ebx ecx edx esi edi
|
||||
pushfd
|
||||
cli
|
||||
xor edx, edx
|
||||
mov eax, 2 ; we do not minimize the kernel thread N1
|
||||
mov ebx, [TASK_COUNT]
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.loop:
|
||||
movzx edi, word[WIN_POS + eax * 2]
|
||||
shl edi, 5
|
||||
; it is a unused slot?
|
||||
cmp dword [edi+CURRENT_TASK+TASKDATA.state], 9
|
||||
je @f
|
||||
; it is a hidden thread?
|
||||
lea esi, [edi*8+SLOT_BASE+APPDATA.app_name]
|
||||
cmp [esi], byte '@'
|
||||
je @f
|
||||
; is it already minimized?
|
||||
test [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
jnz @f
|
||||
; no it's not, let's do that
|
||||
or [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
inc edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
inc eax
|
||||
cmp eax, ebx
|
||||
jbe .loop
|
||||
; If nothing has changed
|
||||
test edx, edx
|
||||
jz @f
|
||||
|
||||
push edx
|
||||
call syscall_display_settings._.calculate_whole_screen
|
||||
call syscall_display_settings._.redraw_whole_screen
|
||||
pop edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov eax, edx
|
||||
popfd
|
||||
pop edi esi edx ecx ebx
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
minimize_window: ;/////////////////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = window number on screen
|
||||
@ -1047,6 +1096,13 @@ minimize_window: ;/////////////////////////////////////////////////////////////
|
||||
|
||||
; no it's not, let's do that
|
||||
or [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
; If the window width is 0, then the action is not needed.
|
||||
cmp [edi + WDATA.box.width], dword 0
|
||||
je @f
|
||||
; If the window height is 0, then the action is not needed.
|
||||
cmp [edi + WDATA.box.height], dword 0
|
||||
je @f
|
||||
|
||||
mov eax, [edi + WDATA.box.left]
|
||||
mov [draw_limits.left], eax
|
||||
mov ecx, eax
|
||||
@ -1057,11 +1113,20 @@ minimize_window: ;/////////////////////////////////////////////////////////////
|
||||
mov edx, ebx
|
||||
add edx, [edi + WDATA.box.height]
|
||||
mov [draw_limits.bottom], edx
|
||||
call calculatescreen
|
||||
xor esi, esi
|
||||
xor eax, eax
|
||||
call redrawscreen
|
||||
|
||||
; DEBUGF 1, "K : minimize_window\n"
|
||||
; DEBUGF 1, "K : dl_left %x\n",[draw_limits.left]
|
||||
; DEBUGF 1, "K : dl_right %x\n",[draw_limits.right]
|
||||
; DEBUGF 1, "K : dl_top %x\n",[draw_limits.top]
|
||||
; DEBUGF 1, "K : dl_bottom %x\n",[draw_limits.bottom]
|
||||
call calculatescreen
|
||||
; xor esi, esi
|
||||
; xor eax, eax
|
||||
mov eax, edi
|
||||
call redrawscreen
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop esi edx ecx ebx eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@ -1266,16 +1331,16 @@ align 4
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
sys_window_start_moving_handler: ;/////////////////////////////////////////////
|
||||
;sys_window_start_moving_handler: ;/////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? <description>
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = old (original) window box
|
||||
;> esi = process slot
|
||||
;------------------------------------------------------------------------------
|
||||
mov edi, eax
|
||||
call window._.draw_negative_box
|
||||
ret
|
||||
; mov edi, eax
|
||||
; call window._.draw_negative_box
|
||||
; ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
@ -1287,8 +1352,8 @@ sys_window_end_moving_handler: ;///////////////////////////////////////////////
|
||||
;> ebx = new (final) window box
|
||||
;> esi = process slot
|
||||
;------------------------------------------------------------------------------
|
||||
mov edi, ebx
|
||||
call window._.end_moving__box
|
||||
; mov edi, ebx
|
||||
; call window._.end_moving__box
|
||||
|
||||
mov edi, esi
|
||||
shl edi, 5
|
||||
@ -1351,45 +1416,17 @@ window._.invalidate_screen: ;//////////////////////////////////////////////////
|
||||
|
||||
; TODO: do we really need `draw_limits`?
|
||||
; Yes, they are used by background drawing code.
|
||||
mov ecx, [eax + BOX.left]
|
||||
mov edx, [ebx + BOX.left]
|
||||
cmp ecx, edx
|
||||
jle @f
|
||||
mov ecx, edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
|
||||
; we need only to restore the background windows at the old place!
|
||||
mov ecx, [ebx + BOX.left]
|
||||
mov [draw_limits.left], ecx
|
||||
mov ecx, [eax + BOX.left]
|
||||
add ecx, [eax + BOX.width]
|
||||
add edx, [ebx + BOX.width]
|
||||
cmp ecx, edx
|
||||
jae @f
|
||||
mov ecx, edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
add ecx, [ebx + BOX.width]
|
||||
mov [draw_limits.right], ecx
|
||||
mov ecx, [eax + BOX.top]
|
||||
mov edx, [ebx + BOX.top]
|
||||
cmp ecx, edx
|
||||
jle @f
|
||||
mov ecx, edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov ecx, [ebx + BOX.top]
|
||||
mov [draw_limits.top], ecx
|
||||
mov ecx, [eax + BOX.top]
|
||||
add ecx, [eax + BOX.height]
|
||||
add edx, [ebx + BOX.height]
|
||||
cmp ecx, edx
|
||||
jae @f
|
||||
mov ecx, edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
add ecx, [ebx + BOX.height]
|
||||
mov [draw_limits.bottom], ecx
|
||||
; recalculate screen buffer at old position
|
||||
; recalculate screen buffer at old position
|
||||
push ebx
|
||||
mov edx, [eax + BOX.height]
|
||||
mov ecx, [eax + BOX.width]
|
||||
@ -1399,7 +1436,7 @@ align 4
|
||||
add edx, ebx
|
||||
call calculatescreen
|
||||
pop eax
|
||||
; recalculate screen buffer at new position
|
||||
; recalculate screen buffer at new position
|
||||
mov edx, [eax + BOX.height]
|
||||
mov ecx, [eax + BOX.width]
|
||||
mov ebx, [eax + BOX.top]
|
||||
@ -1578,7 +1615,10 @@ window._.sys_set_window: ;/////////////////////////////////////////////////////
|
||||
test [edi + WDATA.fl_wdrawn], 1
|
||||
jnz .set_client_box
|
||||
or [edi + WDATA.fl_wdrawn], 1
|
||||
|
||||
; After first draw_window we need redraw mouse necessarily!
|
||||
; Otherwise the user can see cursor specified by f.37.5 from another window.
|
||||
; He will be really unhappy! He is terrible in rage - usually he throws stones!
|
||||
mov [redrawmouse_unconditional], 1
|
||||
; NOTE: commented out since doesn't provide necessary functionality
|
||||
; anyway, to be reworked
|
||||
; mov eax, [timer_ticks] ; [0xfdf0]
|
||||
@ -2344,17 +2384,17 @@ align 4
|
||||
pop esi ebx eax
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;align 4
|
||||
;------------------------------------------------------------------------------
|
||||
window._.end_moving__box: ;//////////////////////////////////////////////////
|
||||
;window._.end_moving__box: ;//////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? Draw positive box
|
||||
;------------------------------------------------------------------------------
|
||||
;> edi = pointer to BOX struct
|
||||
;------------------------------------------------------------------------------
|
||||
push eax ebx esi
|
||||
xor esi, esi
|
||||
jmp window._.draw_negative_box.1
|
||||
; push eax ebx esi
|
||||
; xor esi, esi
|
||||
; jmp window._.draw_negative_box.1
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
|
@ -34,6 +34,7 @@ uglobal
|
||||
ctrl_alt_del db 0
|
||||
|
||||
kb_lights db 0
|
||||
old_kb_lights db 0
|
||||
|
||||
align 4
|
||||
hotkey_scancodes rd 256 ; we have 256 scancodes
|
||||
@ -113,6 +114,83 @@ set_keyboard_data:
|
||||
pop ebp edi esi ebx
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
struct KEYBOARD
|
||||
next dd ?
|
||||
prev dd ?
|
||||
functions dd ?
|
||||
userdata dd ?
|
||||
ends
|
||||
struct KBDFUNC
|
||||
strucsize dd ?
|
||||
close dd ?
|
||||
setlights dd ?
|
||||
ends
|
||||
|
||||
iglobal
|
||||
keyboards:
|
||||
dd keyboards
|
||||
dd keyboards
|
||||
endg
|
||||
uglobal
|
||||
keyboard_list_mutex MUTEX
|
||||
endg
|
||||
|
||||
register_keyboard:
|
||||
push ebx
|
||||
push sizeof.KEYBOARD
|
||||
pop eax
|
||||
call malloc
|
||||
test eax, eax
|
||||
jz .nothing
|
||||
mov ecx, [esp+4+4]
|
||||
mov [eax+KEYBOARD.functions], ecx
|
||||
mov ecx, [esp+8+4]
|
||||
mov [eax+KEYBOARD.userdata], ecx
|
||||
xchg eax, ebx
|
||||
mov ecx, keyboard_list_mutex
|
||||
call mutex_lock
|
||||
mov ecx, keyboards
|
||||
mov edx, [ecx+KEYBOARD.prev]
|
||||
mov [ebx+KEYBOARD.next], ecx
|
||||
mov [ebx+KEYBOARD.prev], edx
|
||||
mov [edx+KEYBOARD.next], ebx
|
||||
mov [ecx+KEYBOARD.prev], ebx
|
||||
mov ecx, [ebx+KEYBOARD.functions]
|
||||
cmp [ecx+KBDFUNC.strucsize], KBDFUNC.setlights
|
||||
jbe .unlock
|
||||
mov ecx, [ecx+KBDFUNC.setlights]
|
||||
test ecx, ecx
|
||||
jz .unlock
|
||||
stdcall ecx, [ebx+KEYBOARD.userdata], dword [kb_lights]
|
||||
.unlock:
|
||||
mov ecx, keyboard_list_mutex
|
||||
call mutex_unlock
|
||||
xchg eax, ebx
|
||||
.nothing:
|
||||
pop ebx
|
||||
ret 8
|
||||
|
||||
delete_keyboard:
|
||||
push ebx
|
||||
mov ebx, [esp+4+4]
|
||||
mov ecx, keyboard_list_mutex
|
||||
call mutex_lock
|
||||
mov eax, [ebx+KEYBOARD.next]
|
||||
mov edx, [ebx+KEYBOARD.prev]
|
||||
mov [eax+KEYBOARD.prev], edx
|
||||
mov [edx+KEYBOARD.next], eax
|
||||
call mutex_unlock
|
||||
mov ecx, [ebx+KEYBOARD.functions]
|
||||
cmp [ecx+KBDFUNC.strucsize], KBDFUNC.close
|
||||
jbe .nothing
|
||||
mov ecx, [ecx+KBDFUNC.close]
|
||||
test ecx, ecx
|
||||
jz .nothing
|
||||
stdcall ecx, [ebx+KEYBOARD.userdata]
|
||||
.nothing:
|
||||
pop ebx
|
||||
ret 4
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
irq1:
|
||||
movzx eax, word[TASK_COUNT]; top window process
|
||||
@ -281,8 +359,11 @@ send_scancode:
|
||||
|
||||
xor [kb_state], eax
|
||||
xor [kb_lights], bl
|
||||
push ecx
|
||||
call set_lights
|
||||
pop ecx
|
||||
.writekey:
|
||||
pushad
|
||||
; test for system hotkeys
|
||||
movzx eax, ch
|
||||
cmp bh, 1
|
||||
@ -335,9 +416,16 @@ send_scancode:
|
||||
mov [edi+4], ax
|
||||
mov eax, [kb_state]
|
||||
mov [edi+6], ax
|
||||
|
||||
cmp [PID_lock_input], dword 0
|
||||
je .nohotkey
|
||||
|
||||
popad
|
||||
jmp .exit.irq1
|
||||
;--------------------------------------
|
||||
.nohotkey:
|
||||
popad
|
||||
|
||||
cmp [keyboard_mode], 0; return from keymap
|
||||
jne .scancode
|
||||
|
||||
@ -384,10 +472,43 @@ send_scancode:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
set_lights:
|
||||
push ebx esi
|
||||
mov ecx, keyboard_list_mutex
|
||||
call mutex_lock
|
||||
mov esi, keyboards
|
||||
.loop:
|
||||
mov esi, [esi+KEYBOARD.next]
|
||||
cmp esi, keyboards
|
||||
jz .done
|
||||
mov eax, [esi+KEYBOARD.functions]
|
||||
cmp dword [eax], KBDFUNC.setlights
|
||||
jbe .loop
|
||||
mov eax, [eax+KBDFUNC.setlights]
|
||||
test eax, eax
|
||||
jz .loop
|
||||
stdcall eax, [esi+KEYBOARD.userdata], dword [kb_lights]
|
||||
jmp .loop
|
||||
.done:
|
||||
mov ecx, keyboard_list_mutex
|
||||
call mutex_unlock
|
||||
pop esi ebx
|
||||
ret
|
||||
|
||||
ps2_set_lights:
|
||||
mov al, 0xED
|
||||
call kb_write
|
||||
mov al, [kb_lights]
|
||||
mov al, [esp+8]
|
||||
call kb_write
|
||||
ret 8
|
||||
|
||||
;// mike.dld ]
|
||||
check_lights_state:
|
||||
mov al, [kb_lights]
|
||||
cmp al, [old_kb_lights]
|
||||
jz .nothing
|
||||
mov [old_kb_lights], al
|
||||
call set_lights
|
||||
.nothing:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
numlock_map:
|
||||
|
@ -26,14 +26,14 @@ uglobal
|
||||
align 4
|
||||
mousecount 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
|
||||
dw 0
|
||||
Y_UNDER_subtraction_CUR_hot_y:
|
||||
dw 0
|
||||
X_UNDER_sub_CUR_hot_x_add_curh:
|
||||
dd 0
|
||||
dw 0
|
||||
X_UNDER_subtraction_CUR_hot_x:
|
||||
dw 0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
@ -447,15 +447,15 @@ redrawmouse:
|
||||
|
||||
mov ax, [Y_UNDER]
|
||||
sub eax, [esi+CURSOR.hot_y]
|
||||
mov [Y_UNDER_subtraction_CUR_hot_y], eax
|
||||
mov [Y_UNDER_subtraction_CUR_hot_y], ax
|
||||
add eax, [cur.h]
|
||||
mov [Y_UNDER_sub_CUR_hot_y_add_curh], eax
|
||||
mov [Y_UNDER_sub_CUR_hot_y_add_curh], ax
|
||||
|
||||
mov ax, [X_UNDER]
|
||||
sub eax, [esi+CURSOR.hot_x]
|
||||
mov [X_UNDER_subtraction_CUR_hot_x], eax
|
||||
mov [X_UNDER_subtraction_CUR_hot_x], ax
|
||||
add eax, [cur.w]
|
||||
mov [X_UNDER_sub_CUR_hot_x_add_curh], eax
|
||||
mov [X_UNDER_sub_CUR_hot_x_add_curh], ax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -68,7 +68,7 @@
|
||||
; 3c dword cpu usage in cpu timer tics
|
||||
;
|
||||
;
|
||||
; 5000 -> 68FF display width fast calc area (6k6)
|
||||
; 5000 -> 68FF free (6k6)
|
||||
; 6900 -> 6EFF saved picture under mouse pointer (1k5)
|
||||
;
|
||||
; 6F00 -> 6FFF free (256)
|
||||
@ -137,7 +137,7 @@
|
||||
; FF00 byte 1 = system shutdown request
|
||||
; FF01 byte task activation request?
|
||||
; 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
|
||||
; FFF4 byte 0 if first mouse draw & do not return picture under
|
||||
; FFF5 byte 1 do not draw pointer
|
||||
@ -147,8 +147,8 @@
|
||||
|
||||
; 0x8006CC00 -> 6DBFF stack at boot time (4Kb)
|
||||
;
|
||||
; 0x8006DC00 -> 6E5FF basic text font II
|
||||
; 0x8006E600 -> 6Efff basic text font I
|
||||
; 0x8006DC00 -> 6E5FF free (2560)
|
||||
; 0x8006E600 -> 6Efff free (2560)
|
||||
; 0x8006F000 -> 6FFFF main page directory
|
||||
|
||||
; 0x80070000 -> 7FFFF data of retrieved disks and partitions (Mario79)
|
||||
@ -204,15 +204,18 @@
|
||||
; 0x80284000 -> 28BFFF HDD DMA AREA (32k)
|
||||
; 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 status (256)
|
||||
; 0x802B0100 -> 2Bffff free (63k8)
|
||||
; 0x802C0000 -> 2C3fff button info (8k)
|
||||
; 0x802A0000 -> 2B00FF wav device buffer (64k)
|
||||
; 0x802A0000 -> 2B00FF wav device status (256)
|
||||
;
|
||||
; 0000 word number of buttons
|
||||
; first button entry at 0x10
|
||||
; 0x802B0100 -> 2B3FFD free (15k7)
|
||||
;
|
||||
; 0x802B3FEE -> 2B3FEF button info (64K+ 16 + 2 byte)
|
||||
; 2B3FEE 0000 word number of buttons
|
||||
; 2B3FF0 first button entry
|
||||
;
|
||||
; button entry at 0x10
|
||||
; +0000 word process number
|
||||
; +0002 word button id number : bits 00-15
|
||||
; +0004 word x start
|
||||
@ -221,7 +224,10 @@
|
||||
; +000A word y size
|
||||
; +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
|
||||
; 0x802CA000 -> 2CFFFF area for fast getting offset to _WinMapAddress (24k)
|
||||
; d_width_calc_area
|
||||
;
|
||||
; 0x802D0000 -> 2DFFFF reserved port area (64k)
|
||||
;
|
||||
@ -231,25 +237,29 @@
|
||||
; dword end port
|
||||
; dword 0
|
||||
;
|
||||
; 0x802E0000 -> 2EFFFF irq data area (64k)
|
||||
; 0x802F0000 -> 2FFFFF low memory save (64k)
|
||||
; 0x802E0000 -> 2EFFFF irq data area (64k) ;BOOT_VAR
|
||||
;
|
||||
; 0x80300000 -> 31FFFF tcp memory (128k)
|
||||
; 0x80320000 -> 327FFF tcp memory (32k)
|
||||
; 0x802F0000 -> 2F3FFF tcp memory stack_data_start eth_data_start (16k)
|
||||
;
|
||||
; 0x80328000 -> 32FFFF !vrr driver (32k)
|
||||
|
||||
; 0x80330000 -> 377FFF skin data (32k)
|
||||
|
||||
; 0x80338000 -> 338FFF draw data - 256 entries (4k)
|
||||
; 0x802F4000 -> 30ffff stack_data | stack_data_end (112k)
|
||||
;
|
||||
; 0x80310000 -> 317fff resendQ (32k)
|
||||
;
|
||||
; 0x80318000 -> 31ffff skin_data (32k)
|
||||
;
|
||||
; 0x80320000 -> 323FF3 draw data - 256 entries (4k)
|
||||
; 00 dword draw limit - x start
|
||||
; 04 dword draw limit - y start
|
||||
; 08 dword draw limit - x end
|
||||
; 0C dword draw limit - y end
|
||||
; 0x80339000 -> 3BFFF3 free (12k)
|
||||
; 0x8033BFF4 -> 33BFFF background info
|
||||
; 0x8033C000 page map (length b = memsize shr 15)
|
||||
; 0x8033C000 + b start of static pagetables
|
||||
;
|
||||
; 0x8032BFF4 -> 32BFFF background info
|
||||
; 0x80323FF4 BgrDrawMode
|
||||
; 0x80323FF8 BgrDataWidth
|
||||
; 0x80323FFC BgrDataHeight
|
||||
;
|
||||
; 0x80324000 page map (length b = memsize shr 15)
|
||||
; 0x80324000 + b start of static pagetables
|
||||
|
||||
; 0x803FFFFF <- no direct address translation beyond this point
|
||||
; =============================================================
|
||||
|
@ -242,7 +242,7 @@ endg
|
||||
pcnet32_dwio_read_csr:
|
||||
push edx
|
||||
lea edx, [ebp+PCNET32_DWIO_RAP]
|
||||
mov ebx, eax
|
||||
mov eax, ebx
|
||||
out dx, eax
|
||||
lea edx, [ebp+PCNET32_DWIO_RDP]
|
||||
in eax, dx
|
||||
@ -267,7 +267,7 @@ pcnet32_dwio_write_csr:
|
||||
pcnet32_dwio_read_bcr:
|
||||
push edx
|
||||
lea edx, [ebp+PCNET32_DWIO_RAP]
|
||||
mov ebx, eax
|
||||
mov eax, ebx
|
||||
out dx, eax
|
||||
lea edx, [ebp+PCNET32_DWIO_BDP]
|
||||
in eax, dx
|
||||
@ -709,10 +709,10 @@ pcnet32_probe:
|
||||
mov eax, 2
|
||||
call dword [pcnet32_access.write_bcr]
|
||||
mov ebx, 1
|
||||
mov eax, (pcnet32_private and 0xffff)
|
||||
mov eax, ((pcnet32_private - OS_BASE) and 0xffff)
|
||||
call dword [pcnet32_access.write_csr]
|
||||
mov ebx, 2
|
||||
mov eax, (pcnet32_private shr 16) and 0xffff
|
||||
mov eax, ((pcnet32_private - OS_BASE) shr 16) and 0xffff
|
||||
call dword [pcnet32_access.write_csr]
|
||||
mov ebx, 0
|
||||
mov eax, 1
|
||||
|
@ -202,6 +202,7 @@ purge .dy1
|
||||
|
||||
align 4
|
||||
blit_32:
|
||||
xchg bx, bx
|
||||
push ebp
|
||||
push edi
|
||||
push esi
|
||||
@ -270,9 +271,10 @@ blit_32:
|
||||
|
||||
mov edi, ebp
|
||||
|
||||
imul edi, [_display.pitch]
|
||||
; imul edi, [_display.pitch]
|
||||
mov edi, [BPSLine_calc_area+edi*4]
|
||||
; imul ebp, [_display.width]
|
||||
mov ebp, [d_width_calc_area + ebp*4]
|
||||
mov ebp, [d_width_calc_area+ebp*4]
|
||||
|
||||
add ebp, ebx
|
||||
add ebp, [_WinMapAddress]
|
||||
@ -298,7 +300,13 @@ blit_32:
|
||||
|
||||
lea edi, [edi+ebx*4]
|
||||
|
||||
mov ebx, 1
|
||||
test [esp+72], dword 0x10
|
||||
jnz @F
|
||||
|
||||
mov ebx, [CURRENT_TASK]
|
||||
@@:
|
||||
|
||||
align 4
|
||||
.outer32:
|
||||
xor ecx, ecx
|
||||
@ -365,7 +373,12 @@ align 4
|
||||
.core_24:
|
||||
lea ebx, [ebx+ebx*2]
|
||||
lea edi, [LFB_BASE+edi+ebx]
|
||||
mov ebx, 1
|
||||
test [esp+72], dword 0x10
|
||||
jnz @F
|
||||
|
||||
mov ebx, [CURRENT_TASK]
|
||||
@@:
|
||||
|
||||
align 4
|
||||
.outer24:
|
||||
|
@ -353,6 +353,8 @@ create_cursor:
|
||||
|
||||
stdcall init_cursor, eax, esi
|
||||
|
||||
align 4
|
||||
.add_cursor:
|
||||
mov ecx, [.hcursor]
|
||||
lea ecx, [ecx+CURSOR.list_next]
|
||||
lea edx, [_display.cr_list.next]
|
||||
@ -363,9 +365,6 @@ create_cursor:
|
||||
popfd
|
||||
|
||||
mov eax, [.hcursor]
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.check_hw:
|
||||
cmp [_display.init_cursor], 0
|
||||
je .fail
|
||||
|
||||
@ -385,14 +384,14 @@ align 4
|
||||
shr ebx, 16
|
||||
movzx ecx, bh
|
||||
movzx edx, bl
|
||||
mov [eax+CURSOR.hot_x], ecx
|
||||
mov [eax+CURSOR.hot_y], edx
|
||||
mov [edi+CURSOR.hot_x], ecx
|
||||
mov [edi+CURSOR.hot_y], edx
|
||||
|
||||
xchg edi, eax
|
||||
mov ecx, 1024
|
||||
cld
|
||||
rep movsd
|
||||
jmp .check_hw
|
||||
jmp .add_cursor
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
proc load_cursor stdcall, src:dword, flags:dword
|
||||
@ -619,9 +618,7 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
|
||||
mov [_dy], edx
|
||||
|
||||
; mul dword [BytesPerScanLine]
|
||||
mov eax, [d_width_calc_area + eax*4]
|
||||
lea eax, [eax + eax*2]
|
||||
|
||||
mov eax, [BPSLine_calc_area+eax*4]
|
||||
lea edx, [LFB_BASE+ecx*3]
|
||||
add edx, eax
|
||||
mov [cur_saved_base], edx
|
||||
@ -645,6 +642,8 @@ align 4
|
||||
sub edi, [y]
|
||||
inc ebx
|
||||
inc edi
|
||||
sub ebx, [_dx]
|
||||
sub edi, [_dy]
|
||||
|
||||
mov [cur.w], ebx
|
||||
mov [cur.h], edi
|
||||
@ -738,9 +737,7 @@ proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
|
||||
mov [_dy], edx
|
||||
|
||||
; mul dword [BytesPerScanLine]
|
||||
mov eax, [d_width_calc_area + eax*4]
|
||||
shl eax, 2
|
||||
|
||||
mov eax, [BPSLine_calc_area+eax*4]
|
||||
lea edx, [LFB_BASE+eax+ecx*4]
|
||||
mov [cur_saved_base], edx
|
||||
|
||||
@ -763,6 +760,8 @@ align 4
|
||||
sub edi, [y]
|
||||
inc ebx
|
||||
inc edi
|
||||
sub ebx, [_dx]
|
||||
sub edi, [_dy]
|
||||
|
||||
mov [cur.w], ebx
|
||||
mov [cur.h], edi
|
||||
@ -840,10 +839,10 @@ check_mouse_area_for_getpixel_new:
|
||||
;--------------------------------------
|
||||
push eax ebx
|
||||
; offset X
|
||||
mov ecx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
movzx ecx, word [X_UNDER_subtraction_CUR_hot_x]
|
||||
sub eax, ecx ; x1
|
||||
; offset Y
|
||||
mov ecx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
movzx ecx, word [Y_UNDER_subtraction_CUR_hot_y]
|
||||
sub ebx, ecx ; y1
|
||||
;--------------------------------------
|
||||
; ebx = offset y
|
||||
@ -879,41 +878,49 @@ check_mouse_area_for_putpixel_new:
|
||||
; 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
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .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
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
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
|
||||
|
||||
cmp ecx, [cur.h]
|
||||
jae @f
|
||||
|
||||
cmp ebx, [cur.w]
|
||||
jb .ok
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; DEBUGF 1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
|
||||
pop ebx
|
||||
jmp .sh ; SORRY! SHIT HAPPENS!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ok:
|
||||
; ecx = offset y
|
||||
; ebx = offset x
|
||||
mov eax, [esp + 4]
|
||||
|
||||
push ebx ecx
|
||||
imul ecx, [cur.w] ;y
|
||||
add ecx, ebx
|
||||
@ -949,10 +956,14 @@ align 4
|
||||
test eax, 0xFF000000
|
||||
jz @f
|
||||
|
||||
pop ecx
|
||||
add esp, 4
|
||||
ret
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
mov ecx, -1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
@ -1019,6 +1030,8 @@ align 4
|
||||
;--------------------------------------
|
||||
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
|
||||
mov [def_cursor], eax
|
||||
ret
|
||||
@ -1034,4 +1047,8 @@ align 4
|
||||
def_arrow:
|
||||
file 'arrow.cur'
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
clock_arrow:
|
||||
file 'arrow_clock.cur'
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
|
@ -72,8 +72,7 @@ align 4
|
||||
.no_mouseunder:
|
||||
;--------------------------------------
|
||||
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||
mov ebx, [d_width_calc_area + ebx*4]
|
||||
lea ebx, [ebx + ebx*2]
|
||||
mov ebx, [BPSLine_calc_area+ebx*4]
|
||||
lea edi, [eax+eax*2]; edi = x*3
|
||||
add edi, ebx ; edi = x*3+(y*y multiplier)
|
||||
mov ecx, [LFB_BASE+edi]
|
||||
@ -105,8 +104,7 @@ align 4
|
||||
.no_mouseunder:
|
||||
;--------------------------------------
|
||||
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||
mov ebx, [d_width_calc_area + ebx*4]
|
||||
shl ebx, 2
|
||||
mov ebx, [BPSLine_calc_area+ebx*4]
|
||||
lea edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
|
||||
mov ecx, [LFB_BASE+edi]
|
||||
;--------------------------------------
|
||||
@ -243,19 +241,7 @@ align 4
|
||||
; pointer to screen
|
||||
mov edx, [putimg.abs_cy]
|
||||
; imul edx, [BytesPerScanLine]
|
||||
|
||||
mov edx, [d_width_calc_area + edx*4]
|
||||
cmp bl, 4
|
||||
je .32
|
||||
lea edx, [edx+edx*2]
|
||||
jmp @f
|
||||
;-------------------------------------
|
||||
align 4
|
||||
.32:
|
||||
shl edx, 2
|
||||
;-------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov edx, [BPSLine_calc_area+edx*4]
|
||||
mov eax, [putimg.abs_cx]
|
||||
; movzx ebx, byte [ScreenBPP]
|
||||
; shr ebx, 3
|
||||
@ -420,29 +406,38 @@ align 4
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push ecx
|
||||
mov ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
neg ecx
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
shl ecx, 16
|
||||
|
||||
add ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; 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
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
sub ecx, [esp]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
cmp ecx, -1 ;SHIT HAPPENS?
|
||||
jne .no_mouse_area
|
||||
|
||||
mov ecx, [esp]
|
||||
jmp .sh
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
@ -622,29 +617,38 @@ align 4
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push ecx
|
||||
mov ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
neg ecx
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
shl ecx, 16
|
||||
|
||||
add ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; 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
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
sub ecx, [esp]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
cmp ecx, -1 ;SHIT HAPPENS?
|
||||
jne .no_mouse_area
|
||||
|
||||
mov ecx, [esp]
|
||||
jmp .sh
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
@ -740,9 +744,7 @@ Vesa20_putpixel24:
|
||||
mov cx, bx
|
||||
|
||||
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||
mov ebx, [d_width_calc_area + ebx*4]
|
||||
lea ebx, [ebx + ebx*2]
|
||||
|
||||
mov ebx, [BPSLine_calc_area+ebx*4]
|
||||
lea edi, [eax+eax*2]; edi = x*3
|
||||
mov eax, [esp+32-8+4]
|
||||
;--------------------------------------
|
||||
@ -771,9 +773,7 @@ Vesa20_putpixel24_new:
|
||||
mov cx, bx
|
||||
|
||||
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||
mov ebx, [d_width_calc_area + ebx*4]
|
||||
lea ebx, [ebx + ebx*2]
|
||||
|
||||
mov ebx, [BPSLine_calc_area+ebx*4]
|
||||
lea edi, [eax+eax*2]; edi = x*3
|
||||
mov eax, [esp+32-8+4]
|
||||
;--------------------------------------
|
||||
@ -785,21 +785,23 @@ Vesa20_putpixel24_new:
|
||||
jnz @f
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
ror ecx, 16
|
||||
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@ -819,9 +821,7 @@ Vesa20_putpixel32:
|
||||
mov cx, bx
|
||||
|
||||
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||
mov ebx, [d_width_calc_area + ebx*4]
|
||||
shl ebx, 2
|
||||
|
||||
mov ebx, [BPSLine_calc_area+ebx*4]
|
||||
lea edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
|
||||
mov eax, [esp+32-8+4]; eax = color
|
||||
;--------------------------------------
|
||||
@ -849,9 +849,7 @@ Vesa20_putpixel32_new:
|
||||
mov cx, bx
|
||||
|
||||
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||
mov ebx, [d_width_calc_area + ebx*4]
|
||||
shl ebx, 2
|
||||
|
||||
mov ebx, [BPSLine_calc_area+ebx*4]
|
||||
lea edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
|
||||
mov eax, [esp+32-8+4]; eax = color
|
||||
;--------------------------------------
|
||||
@ -863,21 +861,23 @@ Vesa20_putpixel32_new:
|
||||
jnz @f
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
ror ecx, 16
|
||||
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@ -1238,19 +1238,7 @@ align 4
|
||||
; pointer to screen
|
||||
mov edx, [drbar.abs_cy]
|
||||
; imul edx, [BytesPerScanLine]
|
||||
|
||||
mov edx, [d_width_calc_area + edx*4]
|
||||
cmp bl, 4
|
||||
je .32
|
||||
lea edx, [edx+edx*2]
|
||||
jmp @f
|
||||
;-------------------------------------
|
||||
align 4
|
||||
.32:
|
||||
shl edx, 2
|
||||
;-------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov edx, [BPSLine_calc_area+edx*4]
|
||||
mov eax, [drbar.abs_cx]
|
||||
imul eax, ebx
|
||||
add edx, eax
|
||||
@ -1406,29 +1394,32 @@ align 4
|
||||
sub ecx, esi
|
||||
;--------------------------------------
|
||||
; 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
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
add ecx, [drbar.real_sx_and_abs_cx]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; 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
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
push eax
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
mov [edx], ax
|
||||
shr eax, 16
|
||||
mov [edx + 2], al
|
||||
mov eax, [drbar.color]
|
||||
pop eax
|
||||
jmp .skip
|
||||
; store to real LFB
|
||||
;--------------------------------------
|
||||
@ -1590,27 +1581,30 @@ align 4
|
||||
sub ecx, esi
|
||||
;--------------------------------------
|
||||
; 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
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
add ecx, [drbar.real_sx_and_abs_cx]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; 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
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
push eax
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
mov [edx], eax
|
||||
mov eax, [drbar.color]
|
||||
pop eax
|
||||
jmp .skip
|
||||
; store to real LFB
|
||||
;--------------------------------------
|
||||
@ -1654,18 +1648,7 @@ dp2:
|
||||
; and LFB data (output for our function) [edi]
|
||||
; mov eax, [BytesPerScanLine]
|
||||
; mul ebx
|
||||
mov eax, [d_width_calc_area + ebx*4]
|
||||
cmp [ScreenBPP], byte 32
|
||||
je .32
|
||||
lea eax, [eax+eax*2]
|
||||
jmp @f
|
||||
;-------------------------------------
|
||||
align 4
|
||||
.32:
|
||||
shl eax, 2
|
||||
;-------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov eax, [BPSLine_calc_area+ebx*4]
|
||||
xchg ebp, eax
|
||||
add ebp, eax
|
||||
add ebp, eax
|
||||
@ -1811,19 +1794,7 @@ vesa20_drawbackground_stretch:
|
||||
; and LFB data (output for our function) [edi]
|
||||
; mov eax, [BytesPerScanLine]
|
||||
; mul ebx
|
||||
mov eax, [d_width_calc_area + ebx*4]
|
||||
cmp [ScreenBPP], byte 32
|
||||
je .32
|
||||
lea eax, [eax+eax*2]
|
||||
jmp @f
|
||||
;-------------------------------------
|
||||
align 4
|
||||
.32:
|
||||
shl eax, 2
|
||||
;-------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
|
||||
mov eax, [BPSLine_calc_area+ebx*4]
|
||||
xchg ebp, eax
|
||||
add ebp, eax
|
||||
add ebp, eax
|
||||
|
Loading…
Reference in New Issue
Block a user