2009-09-17 15:55:38 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2012-04-02 19:18:46 +04:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
2009-09-17 15:55:38 +04:00
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
;-------------------------------------------------------------------------
|
|
|
|
|
;Loading configuration from ini file
|
|
|
|
|
; {SPraid.simba}
|
|
|
|
|
;-------------------------------------------------------------------------
|
|
|
|
|
|
2012-04-02 19:18:46 +04:00
|
|
|
|
$Revision $
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
2010-01-15 14:54:11 +03:00
|
|
|
|
iglobal
|
2012-02-22 20:06:05 +04:00
|
|
|
|
conf_path_sect:
|
|
|
|
|
db 'path',0
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
conf_fname db '/sys/sys.conf',0
|
2010-01-15 14:54:11 +03:00
|
|
|
|
endg
|
2009-09-17 15:55:38 +04:00
|
|
|
|
; set soke kernel configuration
|
|
|
|
|
proc set_kernel_conf
|
2010-01-15 14:54:11 +03:00
|
|
|
|
locals
|
|
|
|
|
par db 30 dup(?)
|
|
|
|
|
endl
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
2010-01-15 14:54:11 +03:00
|
|
|
|
pushad
|
2009-09-17 15:55:38 +04:00
|
|
|
|
;[gui]
|
|
|
|
|
;mouse_speed
|
|
|
|
|
|
2012-02-22 20:06:05 +04:00
|
|
|
|
lea eax, [par]
|
|
|
|
|
push eax
|
|
|
|
|
invoke ini.get_str, conf_fname, ugui, ugui_mouse_speed, \
|
|
|
|
|
eax,30, ugui_mouse_speed_def
|
|
|
|
|
pop eax
|
|
|
|
|
stdcall strtoint, eax
|
2010-01-15 14:54:11 +03:00
|
|
|
|
mov [mouse_speed_factor], ax
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
;mouse_delay
|
2012-02-22 20:06:05 +04:00
|
|
|
|
lea eax, [par]
|
|
|
|
|
push eax
|
|
|
|
|
invoke ini.get_str, conf_fname, ugui, ugui_mouse_delay, \
|
|
|
|
|
eax,30, ugui_mouse_delay_def
|
|
|
|
|
pop eax
|
|
|
|
|
stdcall strtoint, eax
|
2010-01-15 14:54:11 +03:00
|
|
|
|
mov [mouse_delay], eax
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;midibase
|
2012-02-22 20:06:05 +04:00
|
|
|
|
lea eax, [par]
|
|
|
|
|
push eax
|
|
|
|
|
invoke ini.get_str, conf_fname, udev, udev_midibase, eax, 30, udev_midibase_def
|
|
|
|
|
pop eax
|
|
|
|
|
stdcall strtoint, eax
|
2010-01-15 14:54:11 +03:00
|
|
|
|
|
|
|
|
|
cmp eax, 0x100
|
|
|
|
|
jb @f
|
|
|
|
|
cmp eax, 0x10000
|
|
|
|
|
jae @f
|
|
|
|
|
mov [midi_base], ax
|
|
|
|
|
mov [mididp], eax
|
|
|
|
|
inc eax
|
|
|
|
|
mov [midisp], eax
|
2009-09-17 15:55:38 +04:00
|
|
|
|
@@:
|
2010-01-15 14:54:11 +03:00
|
|
|
|
popad
|
|
|
|
|
ret
|
2009-09-17 15:55:38 +04:00
|
|
|
|
endp
|
2010-01-15 14:54:11 +03:00
|
|
|
|
iglobal
|
2009-09-17 15:55:38 +04:00
|
|
|
|
ugui db 'gui',0
|
|
|
|
|
ugui_mouse_speed db 'mouse_speed',0
|
|
|
|
|
ugui_mouse_speed_def db '2',0
|
|
|
|
|
ugui_mouse_delay db 'mouse_delay',0
|
|
|
|
|
ugui_mouse_delay_def db '0x00A',0
|
|
|
|
|
|
|
|
|
|
udev db 'dev',0
|
|
|
|
|
udev_midibase db 'midibase',0
|
|
|
|
|
udev_midibase_def db '0x320',0
|
2010-01-15 14:54:11 +03:00
|
|
|
|
endg
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
; convert string to DWord
|
|
|
|
|
proc strtoint stdcall,strs
|
2012-02-22 20:06:05 +04:00
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
mov eax, [strs]
|
|
|
|
|
inc eax
|
|
|
|
|
mov bl, [eax]
|
|
|
|
|
cmp bl, 'x'
|
|
|
|
|
je .hex
|
|
|
|
|
cmp bl, 'X'
|
|
|
|
|
je .hex
|
|
|
|
|
jmp .dec
|
2009-09-17 15:55:38 +04:00
|
|
|
|
.hex:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
inc eax
|
|
|
|
|
stdcall strtoint_hex, eax
|
|
|
|
|
jmp .exit
|
2009-09-17 15:55:38 +04:00
|
|
|
|
.dec:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
dec eax
|
|
|
|
|
stdcall strtoint_dec, eax
|
2009-09-17 15:55:38 +04:00
|
|
|
|
.exit:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
mov [esp+28], eax
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2009-09-17 15:55:38 +04:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
; convert string to DWord for decimal value
|
|
|
|
|
proc strtoint_dec stdcall,strs
|
2012-02-22 20:06:05 +04:00
|
|
|
|
pushad
|
|
|
|
|
xor edx, edx
|
2009-09-17 15:55:38 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-02-22 20:06:05 +04:00
|
|
|
|
mov esi, [strs]
|
2009-09-17 15:55:38 +04:00
|
|
|
|
@@:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
lodsb
|
|
|
|
|
or al, al
|
|
|
|
|
jnz @b
|
|
|
|
|
mov ebx, esi
|
|
|
|
|
mov esi, [strs]
|
|
|
|
|
dec ebx
|
|
|
|
|
sub ebx, esi
|
|
|
|
|
mov ecx, 1
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
@@:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
dec ebx
|
|
|
|
|
or ebx, ebx
|
|
|
|
|
jz @f
|
|
|
|
|
imul ecx, ecx, 10; <EFBFBD><EFBFBD><EFBFBD>冷<EFBFBD>
|
|
|
|
|
jmp @b
|
2009-09-17 15:55:38 +04:00
|
|
|
|
@@:
|
|
|
|
|
|
2012-02-22 20:06:05 +04:00
|
|
|
|
xchg ebx, ecx
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
|
2012-02-22 20:06:05 +04:00
|
|
|
|
xor ecx, ecx
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
xor eax, eax
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al, 0
|
|
|
|
|
je .eend
|
|
|
|
|
|
|
|
|
|
sub al, 30h
|
|
|
|
|
imul ebx
|
|
|
|
|
add ecx, eax
|
|
|
|
|
push ecx
|
|
|
|
|
xchg eax, ebx
|
|
|
|
|
mov ecx, 10
|
|
|
|
|
div ecx
|
|
|
|
|
xchg eax, ebx
|
|
|
|
|
pop ecx
|
|
|
|
|
jmp @b
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
.eend:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
mov [esp+28], ecx
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2009-09-17 15:55:38 +04:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;convert string to DWord for hex value
|
|
|
|
|
proc strtoint_hex stdcall,strs
|
2012-02-22 20:06:05 +04:00
|
|
|
|
pushad
|
|
|
|
|
xor edx, edx
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
2012-02-22 20:06:05 +04:00
|
|
|
|
mov esi, [strs]
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
add esi, 1
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
@@:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
lodsb
|
|
|
|
|
or al, al
|
|
|
|
|
jz @f
|
|
|
|
|
shl ebx, 4
|
|
|
|
|
jmp @b
|
2009-09-17 15:55:38 +04:00
|
|
|
|
@@:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
xor ecx, ecx
|
|
|
|
|
mov esi, [strs]
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
@@:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
xor eax, eax
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al, 0
|
|
|
|
|
je .eend
|
|
|
|
|
|
|
|
|
|
cmp al, 'a'
|
|
|
|
|
jae .bm
|
|
|
|
|
cmp al, 'A'
|
|
|
|
|
jae .bb
|
|
|
|
|
jmp .cc
|
2010-01-15 14:54:11 +03:00
|
|
|
|
.bm: ; 57h
|
2012-02-22 20:06:05 +04:00
|
|
|
|
sub al, 57h
|
|
|
|
|
jmp .do
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
2010-01-15 14:54:11 +03:00
|
|
|
|
.bb: ; 37h
|
2012-02-22 20:06:05 +04:00
|
|
|
|
sub al, 37h
|
|
|
|
|
jmp .do
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
2010-01-15 14:54:11 +03:00
|
|
|
|
.cc: ; 30h
|
2012-02-22 20:06:05 +04:00
|
|
|
|
sub al, 30h
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
.do:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
imul ebx
|
|
|
|
|
add ecx, eax
|
|
|
|
|
shr ebx, 4
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
2012-02-22 20:06:05 +04:00
|
|
|
|
jmp @b
|
2009-09-17 15:55:38 +04:00
|
|
|
|
|
|
|
|
|
.eend:
|
2012-02-22 20:06:05 +04:00
|
|
|
|
mov [esp+28], ecx
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2009-09-17 15:55:38 +04:00
|
|
|
|
endp
|