Rev 1161 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1161 | Rev 1206 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | 7 | ||
8 | ;------------------------------------------------------------------------- |
8 | ;------------------------------------------------------------------------- |
9 | ;Loading configuration from ini file |
9 | ;Loading configuration from ini file |
10 | ; {SPraid.simba} |
10 | ; {SPraid.simba} |
11 | ;------------------------------------------------------------------------- |
11 | ;------------------------------------------------------------------------- |
12 | 12 | ||
13 | $Revision: 802 $ |
13 | $Revision: 1206 $ |
14 | 14 | ||
15 | 15 | ||
16 | conf_path_sect: db 'path',0 |
16 | conf_path_sect: db 'path',0 |
17 | 17 | ||
18 | conf_fname db '/sys/sys.conf',0 |
18 | conf_fname db '/sys/sys.conf',0 |
19 | 19 | ||
20 | ; set soke kernel configuration |
20 | ; set soke kernel configuration |
21 | proc set_kernel_conf |
21 | proc set_kernel_conf |
22 | locals |
22 | locals |
23 | par db 30 dup(?) |
23 | par db 30 dup(?) |
24 | endl |
24 | endl |
25 | 25 | ||
26 | pushad |
26 | pushad |
27 | ;[gui] |
27 | ;[gui] |
28 | ;mouse_speed |
28 | ;mouse_speed |
29 | 29 | ||
30 | lea eax,[par] |
30 | lea eax,[par] |
31 | push eax |
31 | push eax |
32 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed,\ |
32 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed,\ |
33 | eax,30, ugui_mouse_speed_def |
33 | eax,30, ugui_mouse_speed_def |
34 | pop eax |
34 | pop eax |
35 | stdcall strtoint,eax |
35 | stdcall strtoint,eax |
36 | mov [mouse_speed_factor], ax |
36 | mov [mouse_speed_factor], ax |
37 | 37 | ||
38 | ;mouse_delay |
38 | ;mouse_delay |
39 | lea eax,[par] |
39 | lea eax,[par] |
40 | push eax |
40 | push eax |
41 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay,\ |
41 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay,\ |
42 | eax,30, ugui_mouse_delay_def |
42 | eax,30, ugui_mouse_delay_def |
43 | pop eax |
43 | pop eax |
44 | stdcall strtoint,eax |
44 | stdcall strtoint,eax |
45 | mov [mouse_delay], eax |
45 | mov [mouse_delay], eax |
46 | 46 | ||
47 | 47 | ||
48 | ;midibase |
48 | ;midibase |
49 | lea eax,[par] |
49 | lea eax,[par] |
50 | push eax |
50 | push eax |
51 | invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def |
51 | invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def |
52 | pop eax |
52 | pop eax |
53 | stdcall strtoint,eax |
53 | stdcall strtoint,eax |
54 | 54 | ||
55 | cmp eax, 0x100 |
55 | cmp eax, 0x100 |
56 | jb @f |
56 | jb @f |
57 | cmp eax, 0x10000 |
57 | cmp eax, 0x10000 |
58 | jae @f |
58 | jae @f |
59 | mov [midi_base], ax |
59 | mov [midi_base], ax |
60 | mov [mididp], eax |
60 | mov [mididp], eax |
61 | inc eax |
61 | inc eax |
62 | mov [midisp], eax |
62 | mov [midisp], eax |
63 | @@: |
63 | @@: |
64 | popad |
64 | popad |
65 | ret |
65 | ret |
66 | endp |
66 | endp |
67 | 67 | ||
68 | ugui db 'gui',0 |
68 | ugui db 'gui',0 |
69 | ugui_mouse_speed db 'mouse_speed',0 |
69 | ugui_mouse_speed db 'mouse_speed',0 |
70 | ugui_mouse_speed_def db '2',0 |
70 | ugui_mouse_speed_def db '2',0 |
71 | ugui_mouse_delay db 'mouse_delay',0 |
71 | ugui_mouse_delay db 'mouse_delay',0 |
72 | ugui_mouse_delay_def db '0x00A',0 |
72 | ugui_mouse_delay_def db '0x00A',0 |
73 | 73 | ||
74 | udev db 'dev',0 |
74 | udev db 'dev',0 |
75 | udev_midibase db 'midibase',0 |
75 | udev_midibase db 'midibase',0 |
76 | udev_midibase_def db '0x320',0 |
76 | udev_midibase_def db '0x320',0 |
77 | 77 | ||
78 | 78 | ||
79 | ; convert string to DWord |
79 | ; convert string to DWord |
80 | proc strtoint stdcall,strs |
80 | proc strtoint stdcall,strs |
81 | pushad |
81 | pushad |
82 | 82 | ||
83 | mov eax,[strs] |
83 | mov eax,[strs] |
84 | inc eax |
84 | inc eax |
85 | mov bl,[eax] |
85 | mov bl,[eax] |
86 | cmp bl,'x' |
86 | cmp bl,'x' |
87 | je .hex |
87 | je .hex |
88 | cmp bl,'X' |
88 | cmp bl,'X' |
89 | je .hex |
89 | je .hex |
90 | jmp .dec |
90 | jmp .dec |
91 | .hex: |
91 | .hex: |
92 | inc eax |
92 | inc eax |
93 | stdcall strtoint_hex,eax |
93 | stdcall strtoint_hex,eax |
94 | jmp .exit |
94 | jmp .exit |
95 | .dec: |
95 | .dec: |
96 | dec eax |
96 | dec eax |
97 | stdcall strtoint_dec,eax |
97 | stdcall strtoint_dec,eax |
98 | .exit: |
98 | .exit: |
99 | mov [esp+28],eax |
99 | mov [esp+28],eax |
100 | popad |
100 | popad |
101 | ret |
101 | ret |
102 | endp |
102 | endp |
103 | 103 | ||
104 | ; convert string to DWord for decimal value |
104 | ; convert string to DWord for decimal value |
105 | proc strtoint_dec stdcall,strs |
105 | proc strtoint_dec stdcall,strs |
106 | pushad |
106 | pushad |
107 | xor edx,edx |
107 | xor edx,edx |
108 | ; ¯®¨áª ª®æ |
108 | ; ¯®¨áª ª®æ |
109 | mov esi,[strs] |
109 | mov esi,[strs] |
110 | @@: |
110 | @@: |
111 | lodsb |
111 | lodsb |
112 | or al,al |
112 | or al,al |
113 | jnz @b |
113 | jnz @b |
114 | mov ebx,esi |
114 | mov ebx,esi |
115 | mov esi,[strs] |
115 | mov esi,[strs] |
116 | dec ebx |
116 | dec ebx |
117 | sub ebx,esi |
117 | sub ebx,esi |
118 | mov ecx,1 |
118 | mov ecx,1 |
119 | 119 | ||
120 | @@: |
120 | @@: |
121 | dec ebx |
121 | dec ebx |
122 | or ebx,ebx |
122 | or ebx,ebx |
123 | jz @f |
123 | jz @f |
124 | imul ecx,ecx,10 ; ¯®à冷ª |
124 | imul ecx,ecx,10 ; ¯®à冷ª |
125 | jmp @b |
125 | jmp @b |
126 | @@: |
126 | @@: |
127 | 127 | ||
128 | xchg ebx,ecx |
128 | xchg ebx,ecx |
129 | 129 | ||
130 | 130 | ||
131 | xor ecx,ecx |
131 | xor ecx,ecx |
132 | 132 | ||
133 | 133 | ||
134 | @@: |
134 | @@: |
135 | xor eax,eax |
135 | xor eax,eax |
136 | lodsb |
136 | lodsb |
137 | cmp al,0 |
137 | cmp al,0 |
138 | je .eend |
138 | je .eend |
139 | 139 | ||
140 | sub al,30h |
140 | sub al,30h |
141 | imul ebx |
141 | imul ebx |
142 | add ecx,eax |
142 | add ecx,eax |
143 | push ecx |
143 | push ecx |
144 | xchg eax,ebx |
144 | xchg eax,ebx |
145 | mov ecx,10 |
145 | mov ecx,10 |
146 | div ecx |
146 | div ecx |
147 | xchg eax,ebx |
147 | xchg eax,ebx |
148 | pop ecx |
148 | pop ecx |
149 | jmp @b |
149 | jmp @b |
150 | 150 | ||
151 | .eend: |
151 | .eend: |
152 | mov [esp+28],ecx |
152 | mov [esp+28],ecx |
153 | popad |
153 | popad |
154 | ret |
154 | ret |
155 | endp |
155 | endp |
156 | 156 | ||
157 | ;convert string to DWord for hex value |
157 | ;convert string to DWord for hex value |
158 | proc strtoint_hex stdcall,strs |
158 | proc strtoint_hex stdcall,strs |
159 | pushad |
159 | pushad |
160 | xor edx,edx |
160 | xor edx,edx |
161 | 161 | ||
162 | mov esi,[strs] |
162 | mov esi,[strs] |
163 | mov ebx,1 |
163 | mov ebx,1 |
164 | add esi,1 |
164 | add esi,1 |
165 | 165 | ||
166 | @@: |
166 | @@: |
167 | lodsb |
167 | lodsb |
168 | or al,al |
168 | or al,al |
169 | jz @f |
169 | jz @f |
170 | shl ebx,4 |
170 | shl ebx,4 |
171 | jmp @b |
171 | jmp @b |
172 | @@: |
172 | @@: |
173 | xor ecx,ecx |
173 | xor ecx,ecx |
174 | mov esi,[strs] |
174 | mov esi,[strs] |
175 | 175 | ||
176 | @@: |
176 | @@: |
177 | xor eax,eax |
177 | xor eax,eax |
178 | lodsb |
178 | lodsb |
179 | cmp al,0 |
179 | cmp al,0 |
180 | je .eend |
180 | je .eend |
181 | 181 | ||
182 | cmp al,'a' |
182 | cmp al,'a' |
183 | jae .bm |
183 | jae .bm |
184 | cmp al,'A' |
184 | cmp al,'A' |
185 | jae .bb |
185 | jae .bb |
186 | jmp .cc |
186 | jmp .cc |
187 | .bm: ; 57h |
187 | .bm: ; 57h |
188 | sub al,57h |
188 | sub al,57h |
189 | jmp .do |
189 | jmp .do |
190 | 190 | ||
191 | .bb: ; 37h |
191 | .bb: ; 37h |
192 | sub al,37h |
192 | sub al,37h |
193 | jmp .do |
193 | jmp .do |
194 | 194 | ||
195 | .cc: ; 30h |
195 | .cc: ; 30h |
196 | sub al,30h |
196 | sub al,30h |
197 | 197 | ||
198 | .do: |
198 | .do: |
199 | imul ebx |
199 | imul ebx |
200 | add ecx,eax |
200 | add ecx,eax |
201 | shr ebx,4 |
201 | shr ebx,4 |
202 | 202 | ||
203 | jmp @b |
203 | jmp @b |
204 | 204 | ||
205 | .eend: |
205 | .eend: |
206 | mov [esp+28],ecx |
206 | mov [esp+28],ecx |
207 | popad |
207 | popad |
208 | ret |
208 | ret |
209 | endp |
209 | endp |
210 | 210 | ||
211 | 211 | ||
212 | ; convert string to DWord for IP addres |
212 | ; convert string to DWord for IP addres |
213 | proc do_inet_adr stdcall,strs |
213 | proc do_inet_adr stdcall,strs |
214 | pushad |
214 | pushad |
215 | 215 | ||
216 | mov esi,[strs] |
216 | mov esi,[strs] |
217 | mov ebx,0 |
217 | mov ebx,0 |
218 | .next: |
218 | .next: |
219 | push esi |
219 | push esi |
220 | @@: |
220 | @@: |
221 | lodsb |
221 | lodsb |
222 | or al,al |
222 | or al,al |
223 | jz @f |
223 | jz @f |
224 | cmp al,'.' |
224 | cmp al,'.' |
225 | jz @f |
225 | jz @f |
226 | jmp @b |
226 | jmp @b |
227 | @@: |
227 | @@: |
228 | mov cl, al |
228 | mov cl, al |
229 | mov [esi-1],byte 0 |
229 | mov [esi-1],byte 0 |
230 | ;pop eax |
230 | ;pop eax |
231 | call strtoint_dec |
231 | call strtoint_dec |
232 | rol eax,24 |
232 | rol eax,24 |
233 | ror ebx,8 |
233 | ror ebx,8 |
234 | add ebx,eax |
234 | add ebx,eax |
235 | or cl,cl |
235 | or cl,cl |
236 | jz @f |
236 | jz @f |
237 | jmp .next |
237 | jmp .next |
238 | @@: |
238 | @@: |
239 | mov [esp+28],ebx |
239 | mov [esp+28],ebx |
240 | popad |
240 | popad |
241 | ret |
241 | ret |
242 | endp |
242 | endp |