Subversion Repositories Kolibri OS

Rev

Rev 497 | Rev 521 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
488 spraid 1
;-------------------------------------------------------------------------
2
;
3
;    Файл конфигурации
4
;
5
;
6
;     SPraid
7
;
8
;-------------------------------------------------------------------------
9
 
10
conf_file_loaded: db 0			; флаг загрузки конфига
512 spraid 11
conf_path_sect: db 'path',0
488 spraid 12
 
512 spraid 13
conf_fname db '%sys%/sys.conf',0
494 spraid 14
 
15
 
512 spraid 16
 
497 spraid 17
proc set_kernel_conf
494 spraid 18
locals
19
  par db 30 dup(?)
20
endl
497 spraid 21
  pushad
494 spraid 22
  ;[gui]
23
  ;mouse_speed
512 spraid 24
  lea eax,[par]
494 spraid 25
  push eax
512 spraid 26
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def
497 spraid 27
  pop eax
28
  stdcall strtoint,eax
29
  push eax
494 spraid 30
  pop edx
31
  call _mouse_speed
497 spraid 32
 
33
  popad
34
  ret
494 spraid 35
 
36
  ;mouse_delay
512 spraid 37
  lea eax,[par]
497 spraid 38
  push eax
512 spraid 39
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def
497 spraid 40
  pop eax
494 spraid 41
  stdcall strtoint,eax
42
  push eax
43
  pop edx
44
  call _mouse_delay
45
 
46
  ;[dev]
47
  ;sb16
512 spraid 48
  lea eax,[par]
497 spraid 49
  push eax
512 spraid 50
  invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def
497 spraid 51
  pop eax
494 spraid 52
  stdcall strtoint,eax
53
  push eax
54
  pop ecx
55
  call _sb16
56
 
57
  ;sound_dma
512 spraid 58
  lea eax,[par]
497 spraid 59
  push eax
512 spraid 60
  invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def
497 spraid 61
  pop eax
494 spraid 62
  stdcall strtoint,eax
63
  push eax
64
  pop ecx
65
  call _sound_dma
66
 
67
 
68
  ;midibase
512 spraid 69
  lea eax,[par]
497 spraid 70
  push eax
512 spraid 71
  invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
497 spraid 72
  pop eax
494 spraid 73
  stdcall strtoint,eax
74
  push eax
75
  pop ecx
76
  call _midibase
512 spraid 77
 
78
 
497 spraid 79
  popad
80
  ret
494 spraid 81
endp
82
 
83
ugui db 'gui',0
84
ugui_mouse_speed db 'mouse_speed',0
497 spraid 85
ugui_mouse_speed_def db '2',0
494 spraid 86
ugui_mouse_delay db 'mouse_delay',0
497 spraid 87
ugui_mouse_delay_def db '0x00A',0
494 spraid 88
 
89
udev db 'dev',0
90
udev_sb16 db 'sb16',0
497 spraid 91
udev_sb16_def db '0x220',0
494 spraid 92
udev_sound_dma db 'sound_dma',0
497 spraid 93
udev_sound_dma_def db '1',0
494 spraid 94
udev_midibase db 'midibase',0
497 spraid 95
udev_midibase_def db '0x320',0
494 spraid 96
 
512 spraid 97
proc set_network_conf
98
locals
99
  par db 30 dup(?)
100
endl
101
  pushad
102
 
103
  ;[net]
104
  ;active
105
  lea eax,[par]
106
  invoke ini.get_int,conf_fname, unet, unet_active, 0
107
  or eax,eax
108
  jz .do_not_set_net
109
  call _net_up
110
 
111
  ;addr
112
  lea eax,[par]
113
  push eax
114
  invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def
115
  pop eax
116
  stdcall do_inet_adr,eax
117
  push eax
118
  pop ecx
119
  call _net_addr
120
 
121
  ;mask
122
  lea eax,[par]
123
  push eax
124
  invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def
125
  pop eax
126
  stdcall do_inet_adr,eax
127
  push eax
128
  pop ecx
129
  call _net_mask
130
 
131
  ;gate
132
  lea eax,[par]
133
  push eax
134
  invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def
135
  pop eax
136
  stdcall do_inet_adr,eax
137
  push eax
138
  pop ecx
139
  call _net_gate
140
.do_not_set_net:
141
  popad
142
  ret
143
 
144
 
145
endp
146
 
147
unet db 'net',0
148
unet_active db 'active',0
149
unet_addr db 'addr',0
150
unet_mask db 'mask',0
151
unet_gate db 'gate',0
152
unet_def db 0
153
 
494 spraid 154
; конверчение строки в DWord в eax (по второму символу определяет систему счисления)
497 spraid 155
 
494 spraid 156
proc strtoint stdcall,strs
157
  pushad
158
 
159
  mov eax,[strs]
160
  inc eax
161
  mov bl,[eax]
162
  cmp bl,'x'
163
  je .hex
164
  cmp bl,'X'
165
  je .hex
166
  jmp .dec
167
.hex:
168
  inc eax
169
  stdcall strtoint_hex,eax
170
  jmp .exit
171
.dec:
172
  dec eax
173
  stdcall strtoint_dec,eax
174
.exit:
497 spraid 175
  mov [esp+28],eax
494 spraid 176
  popad
177
  ret
178
endp
179
 
180
; конверчение строки в DWord в eax для десятичного
181
proc strtoint_dec stdcall,strs
182
  pushad
497 spraid 183
  xor edx,edx
184
  ; поиск конца
185
  mov esi,[strs]
186
@@:
187
  lodsb
188
  or al,al
189
  jnz @b
190
  mov ebx,esi
191
  mov esi,[strs]
192
  dec ebx
193
  sub ebx,esi
194
  mov ecx,1
195
 
196
@@:
197
  dec ebx
198
  or ebx,ebx
199
  jz @f
200
  imul ecx,ecx,10  ; порядок
201
  jmp @b
202
@@:
203
 
204
 xchg ebx,ecx
205
 
494 spraid 206
 
207
  xor ecx,ecx
497 spraid 208
 
494 spraid 209
 
210
@@:
211
  xor eax,eax
212
  lodsb
213
  cmp al,0
497 spraid 214
  je .eend
494 spraid 215
 
216
  sub al,30h
217
  imul ebx
218
  add ecx,eax
497 spraid 219
  push ecx
220
  xchg eax,ebx
221
  mov ecx,10
222
  div ecx
223
  xchg eax,ebx
224
  pop ecx
494 spraid 225
  jmp @b
226
 
497