kos-acpi: update

git-svn-id: svn://kolibrios.org@6311 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2016-03-07 19:07:20 +00:00
parent cb71952b3c
commit b50e632506
10 changed files with 1097 additions and 1096 deletions

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Shutdown for Menuet ;; ;; Shutdown for Menuet ;;

View File

@ -173,7 +173,6 @@ end if
vmode db '/sys/drivers/VMODE.MDR',0 vmode db '/sys/drivers/VMODE.MDR',0
;vrr_m db 'VRR_M',0 ;vrr_m db 'VRR_M',0
kernel_file_load: kernel_file_load:
; load kernel.mnt to _CLEAN_ZONE ; load kernel.mnt to _CLEAN_ZONE
dd 0 ; subfunction dd 0 ; subfunction
dq 0 ; offset in file dq 0 ; offset in file

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2104,12 +2104,16 @@ dir_path1 db 'HD0/1',0
* бит 31 установлен = не выводить ведущие нули числа * бит 31 установлен = не выводить ведущие нули числа
* ecx = число (при bl=0) или указатель (при bl=1) * ecx = число (при bl=0) или указатель (при bl=1)
* edx = [координата по оси x]*65536 + [координата по оси y] * edx = [координата по оси x]*65536 + [координата по оси y]
* esi = 0xX0RRGGBB: * esi = 0xXXRRGGBB, где
* RR, GG, BB задают цвет * RR, GG, BB задают цвет текста
* X = ABnn (биты) * XX=0B0FCSSS (биты):
* nn = шрифт (0/1) * B=1 - закрашивать фон (цвет = edi)
* A игнорируется * F задает шрифт:
* B=1 - закрашивать фон цветом edi 0 = 6x9
1 = 8x16
* C=0 - рисовать в окно,
С=1 - рисовать в буфер (edi)
* SSS = (множитель размера)-1, то-есть 0 = x1, 7 = x8
Возвращаемое значение: Возвращаемое значение:
* функция не возвращает значения * функция не возвращает значения
Замечания: Замечания:
@ -2118,7 +2122,6 @@ dir_path1 db 'HD0/1',0
может быть записано меньшим количеством цифр, оно дополняется может быть записано меньшим количеством цифр, оно дополняется
ведущими нулями; если число велико и не может быть записано ведущими нулями; если число велико и не может быть записано
таким количеством цифр, "лишние" ведущие цифры обрезаются. таким количеством цифр, "лишние" ведущие цифры обрезаются.
* Параметры шрифтов указаны в описании функции 4 (вывода текста).
---------------------- Константы для регистров: ---------------------- ---------------------- Константы для регистров: ----------------------
eax - SF_DRAW_NUMBER (47) eax - SF_DRAW_NUMBER (47)

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2081,12 +2081,16 @@ Parameters:
* bit 31 set = do not display leading zeroes of the number * bit 31 set = do not display leading zeroes of the number
* ecx = number (if bl=0) or pointer (if bl=1) * ecx = number (if bl=0) or pointer (if bl=1)
* edx = [coordinate on axis x]*65536 + [coordinate on axis y] * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
* esi = 0xX0RRGGBB: * esi = 0xXXRRGGBB, where
* RR, GG, BB specify the color * RR, GG, BB specify text color
* X = ABnn (bits) * XX = 0B0FCSSS (bits):
* nn = font (0/1) * B=1 - fill background (color = edi)
* A is ignored * F specifies the font:
* B=1 - fill background with the color edi 0 = 6x9
1 = 8x16
* C=0 - draw to the window,
C=1 - draw to the user buffer (edi)
* SSS = (size multiplier)-1, so 0 = x1, 7 = x8
Returned value: Returned value:
* function does not return value * function does not return value
Remarks: Remarks:
@ -2095,8 +2099,6 @@ Remarks:
and can be written by smaller amount of digits, it is supplemented and can be written by smaller amount of digits, it is supplemented
by leading zeroes; if the number is big and can not be written by by leading zeroes; if the number is big and can not be written by
given amount of digits, extra digits are not drawn. given amount of digits, extra digits are not drawn.
* Parameters of fonts are shown in the description of function 4
(text output).
---------------------- Constants for registers: ---------------------- ---------------------- Constants for registers: ----------------------
eax - SF_DRAW_NUMBER (47) eax - SF_DRAW_NUMBER (47)

View File

@ -1228,116 +1228,6 @@ fat_unlock:
lea ecx, [ebp+FAT.Lock] lea ecx, [ebp+FAT.Lock]
jmp mutex_unlock jmp mutex_unlock
; \begin{diamond}
uni2ansi_str:
; convert UNICODE zero-terminated string to ASCII-string (codepage 866)
; in: esi->source, edi->buffer (may be esi=edi)
; destroys: eax,esi,edi
lodsw
test ax, ax
jz .done
cmp ax, 0x80
jb .ascii
cmp ax, 0x401
jz .yo1
cmp ax, 0x451
jz .yo2
cmp ax, 0x410
jb .unk
cmp ax, 0x440
jb .rus1
cmp ax, 0x450
jb .rus2
.unk:
mov al, '_'
jmp .doit
.yo1:
mov al, 0xF0 ; 'Ё'
jmp .doit
.yo2:
mov al, 0xF1 ; 'ё'
jmp .doit
.rus1:
; 0x410-0x43F -> 0x80-0xAF
add al, 0x70
jmp .doit
.rus2:
; 0x440-0x44F -> 0xE0-0xEF
add al, 0xA0
.ascii:
.doit:
stosb
jmp uni2ansi_str
.done:
mov byte [edi], 0
ret
ansi2uni_char:
; convert ANSI character in al to UNICODE character in ax, using cp866 encoding
mov ah, 0
; 0x00-0x7F - trivial map
cmp al, 0x80
jb .ret
; 0x80-0xAF -> 0x410-0x43F
cmp al, 0xB0
jae @f
add ax, 0x410-0x80
.ret:
ret
@@:
; 0xE0-0xEF -> 0x440-0x44F
cmp al, 0xE0
jb .unk
cmp al, 0xF0
jae @f
add ax, 0x440-0xE0
ret
; 0xF0 -> 0x401
; 0xF1 -> 0x451
@@:
cmp al, 0xF0 ; 'Ё'
jz .yo1
cmp al, 0xF1 ; 'ё'
jz .yo2
.unk:
mov al, '_' ; ah=0
ret
.yo1:
mov ax, 0x401
ret
.yo2:
mov ax, 0x451
ret
char_toupper:
; convert character to uppercase, using cp866 encoding
; in: al=symbol
; out: al=converted symbol
cmp al, 'a'
jb .ret
cmp al, 'z'
jbe .az
cmp al, 0xF1 ; 'ё'
jz .yo1
cmp al, 0xA0 ; 'а'
jb .ret
cmp al, 0xE0 ; 'р'
jb .rus1
cmp al, 0xEF ; 'я'
ja .ret
; 0xE0-0xEF -> 0x90-0x9F
sub al, 0xE0-0x90
.ret:
ret
.rus1:
; 0xA0-0xAF -> 0x80-0x8F
.az:
and al, not 0x20
ret
.yo1:
; 0xF1 -> 0xF0
dec ax
ret
fat_get_name: fat_get_name:
; in: edi->FAT entry ; in: edi->FAT entry
@ -3751,5 +3641,3 @@ fat_Delete:
pop edi pop edi
xor eax, eax xor eax, eax
ret ret
; \end{diamond}

View File

@ -831,81 +831,3 @@ cd_compare_name:
inc esi inc esi
clc clc
ret ret
;-----------------------------------------------------------------------------
char_todown:
; convert character to uppercase, using cp866 encoding
; in: al=symbol
; out: al=converted symbol
cmp al, 'A'
jb .ret
cmp al, 'Z'
jbe .az
cmp al, 0x80 ; 'А'
jb .ret
cmp al, 0x90 ; 'Р'
jb .rus1
cmp al, 0x9F ; 'Я'
ja .ret
; 0x90-0x9F -> 0xE0-0xEF
add al, 0xE0-0x90
;--------------------------------------
.ret:
ret
;--------------------------------------
.rus1:
; 0x80-0x8F -> 0xA0-0xAF
.az:
add al, 0x20
ret
;-----------------------------------------------------------------------------
uni2ansi_char:
; convert UNICODE character in al to ANSI character in ax, using cp866 encoding
; in: ax=UNICODE character
; out: al=converted ANSI character
cmp ax, 0x80
jb .ascii
cmp ax, 0x401
jz .yo1
cmp ax, 0x451
jz .yo2
cmp ax, 0x410
jb .unk
cmp ax, 0x440
jb .rus1
cmp ax, 0x450
jb .rus2
;--------------------------------------
.unk:
mov al, '_'
jmp .doit
;--------------------------------------
.yo1:
mov al, 0xF0 ; 'Ё' in cp866
jmp .doit
;--------------------------------------
.yo2:
mov al, 0xF1 ; 'ё' in cp866
jmp .doit
;--------------------------------------
.rus1:
; 0x410-0x43F -> 0x80-0xAF
add al, 0x70
jmp .doit
;--------------------------------------
.rus2:
; 0x440-0x44F -> 0xE0-0xEF
add al, 0xA0
;--------------------------------------
.ascii:
.doit:
ret
;-----------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -5,15 +5,6 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;-------------------------------------------------------------------------
;
; File path partial substitution (according to configuration)
;
;
; SPraid
;
;-------------------------------------------------------------------------
$Revision$ $Revision$
@ -245,3 +236,158 @@ proc get_every_key.replace
stc stc
ret ret
endp endp
char_todown:
; convert character in al to downcase, using cp866 encoding
cmp al, 'A'
jb .ret
cmp al, 'Z'
jbe .az
cmp al, 0x80 ; 'А'
jb .ret
cmp al, 0x90 ; 'Р'
jb .rus
cmp al, 0xF0 ; 'Ё'
jz .yo
cmp al, 0x9F ; 'Я'
ja .ret
; 0x90-0x9F -> 0xE0-0xEF
add al, 0xE0-0x90
.ret:
ret
.az:
.rus: ; 0x80-0x8F -> 0xA0-0xAF
add al, 0x20
ret
.yo:
inc al
ret
char_toupper:
; convert character in al to uppercase, using cp866 encoding
cmp al, 'a'
jb .ret
cmp al, 'z'
jbe .az
cmp al, 0xA0 ; 'а'
jb .ret
cmp al, 0xE0 ; 'р'
jb .rus
cmp al, 0xF1 ; 'ё'
jz .yo
cmp al, 0xEF ; 'я'
ja .ret
; 0xE0-0xEF -> 0x90-0x9F
sub al, 0xE0-0x90
.ret:
ret
.az:
.rus: ; 0xA0-0xAF -> 0x80-0x8F
and al, not 0x20
ret
.yo:
dec al
ret
uni2ansi_str:
; convert UNICODE zero-terminated string to ASCII-string (codepage 866)
; in: esi->source, edi->buffer (may be esi=edi)
; destroys: eax,esi,edi
lodsw
call uni2ansi_char
stosb
test al, al
jnz uni2ansi_str
ret
uni2ansi_char:
; convert UNICODE character in ax to ANSI character in al using cp866 encoding
cmp ax, 0x80
jb .ret
cmp ax, 0xB6
jz .B6
cmp ax, 0x400
jb .unk
cmp ax, 0x410
jb @f
cmp ax, 0x440
jb .rus1
cmp ax, 0x450
jb .rus2
cmp ax, 0x460
jb @f
.unk:
mov al, '_'
.ret:
ret
.B6:
mov al, 20
ret
.rus1: ; 0x410-0x43F -> 0x80-0xAF
add al, 0x70
ret
.rus2: ; 0x440-0x44F -> 0xE0-0xEF
add al, 0xA0
ret
@@:
push ecx edi
mov ecx, 8
mov edi, .table
repnz scasb
mov ah, cl
pop edi ecx
jnz .unk
mov al, 0xF7
sub al, ah
ret
.table db 1, 51h, 4, 54h, 7, 57h, 0Eh, 5Eh
ansi2uni_char:
; convert ANSI character in al to UNICODE character in ax, using cp866 encoding
movzx eax, al
cmp al, 0x80
jb @f ; 0x00-0x7F - trivial map
cmp al, 0xB0
jb .rus ; 0x80-0xAF -> 0x410-0x43F
cmp al, 0xE0
jb .unk
cmp al, 0xF0
jb .rus2 ; 0xE0-0xEF -> 0x440-0x44F
cmp al, 0xF8
jnc .unk
mov al, [eax+uni2ansi_char.table-0xF0]
add ax, 400h
ret
@@:
cmp al, 20
jnz .ret
mov al, 0xB6
.ret:
ret
.rus:
add ax, 0x410-0x80
ret
.rus2:
add ax, 0x440-0xE0
ret
.unk:
mov al, '_'
ret

View File

@ -1100,9 +1100,6 @@ endg
first_app_found: first_app_found:
mov ecx, bios_fb
call set_framebuffer
; START MULTITASKING ; START MULTITASKING
; A 'All set - press ESC to start' messages if need ; A 'All set - press ESC to start' messages if need
@ -1632,9 +1629,13 @@ draw_num_text:
add eax, [edi+SLOT_BASE+APPDATA.wnd_clientbox.top] add eax, [edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
add ebx, eax add ebx, eax
mov ecx, [esp+64+32-12+4] mov ecx, [esp+64+32-12+4]
and ecx, not 0x80000000 ; force counted string
mov eax, [esp+64+8] ; background color (if given) mov eax, [esp+64+8] ; background color (if given)
mov edi, [esp+64+4] mov edi, [esp+64+4]
and ecx, 5FFFFFFFh
bt ecx, 27
jnc @f
mov edi, eax
@@:
jmp dtext jmp dtext
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
iglobal iglobal

View File

@ -28,7 +28,7 @@ create_framebuffer:
mov ecx, sizeof.FRB mov ecx, sizeof.FRB
call create_object call create_object
test eax, eax test eax, eax
jz .fail jz .fail
mov [eax+FRB.magic], 'FRMB' mov [eax+FRB.magic], 'FRMB'
mov [eax+FRB.destroy], 0 mov [eax+FRB.destroy], 0
@ -127,8 +127,9 @@ init_video:
jnc .create_page_tables jnc .create_page_tables
mov edx, 0x00400000 mov edx, 0x00400000
or esi, PG_GLOBAL+PDE_LARGE+PAT_WC+PG_UWR or esi, PG_GLOBAL+PAT_WC+PG_UWR
and esi, [pte_valid_mask] and esi, [pte_valid_mask]
or esi, PDE_LARGE
mov [ebp+FRB.pde], esi mov [ebp+FRB.pde], esi
add esi, edx add esi, edx
mov [ebp+FRB.pde+4], esi mov [ebp+FRB.pde+4], esi
@ -188,6 +189,8 @@ init_video:
lea edx, [eax+PG_UWR] lea edx, [eax+PG_UWR]
mov [ebp+FRB.pde], edx mov [ebp+FRB.pde], edx
stdcall map_page, edi, eax, PG_SWR
; max VGA=640*480*4=1228800 bytes ; max VGA=640*480*4=1228800 bytes
; + 32*640*4=81920 bytes for mouse pointer ; + 32*640*4=81920 bytes for mouse pointer
stdcall alloc_pages, ((1228800+81920)/4096) stdcall alloc_pages, ((1228800+81920)/4096)