Rev 512 | Rev 525 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 512 | Rev 521 | ||
---|---|---|---|
1 | ;------------------------------------------------------------------------- |
1 | ;------------------------------------------------------------------------- |
2 | ; |
2 | ; |
3 | ; ©« ª®ä¨£ãà 樨 |
3 | ; ©« ª®ä¨£ãà 樨 |
4 | ; |
4 | ; |
5 | ; |
5 | ; |
6 | ; SPraid |
6 | ; SPraid |
7 | ; |
7 | ; |
8 | ;------------------------------------------------------------------------- |
8 | ;------------------------------------------------------------------------- |
9 | 9 | ||
10 | conf_file_loaded: db 0 ; ä« £ § £à㧪¨ ª®ä¨£ |
10 | conf_file_loaded: db 0 ; ä« £ § £à㧪¨ ª®ä¨£ |
11 | conf_path_sect: db 'path',0 |
11 | conf_path_sect: db 'path',0 |
12 | 12 | ||
13 | conf_fname db '%sys%/sys.conf',0 |
13 | conf_fname db '/%sys%/sys.conf',0 |
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | proc set_kernel_conf |
17 | proc set_kernel_conf |
18 | locals |
18 | locals |
19 | par db 30 dup(?) |
19 | par db 30 dup(?) |
20 | endl |
20 | endl |
21 | pushad |
21 | pushad |
22 | ;[gui] |
22 | ;[gui] |
23 | ;mouse_speed |
23 | ;mouse_speed |
24 | lea eax,[par] |
24 | lea eax,[par] |
25 | push eax |
25 | push eax |
26 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def |
26 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def |
27 | pop eax |
27 | pop eax |
28 | stdcall strtoint,eax |
28 | stdcall strtoint,eax |
29 | push eax |
29 | push eax |
30 | pop edx |
30 | pop edx |
31 | call _mouse_speed |
31 | call _mouse_speed |
32 | 32 | ||
33 | popad |
33 | popad |
34 | ret |
34 | ret |
35 | 35 | ||
36 | ;mouse_delay |
36 | ;mouse_delay |
37 | lea eax,[par] |
37 | lea eax,[par] |
38 | push eax |
38 | push eax |
39 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def |
39 | invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def |
40 | pop eax |
40 | pop eax |
41 | stdcall strtoint,eax |
41 | stdcall strtoint,eax |
42 | push eax |
42 | push eax |
43 | pop edx |
43 | pop edx |
44 | call _mouse_delay |
44 | call _mouse_delay |
45 | 45 | ||
46 | ;[dev] |
46 | ;[dev] |
47 | ;sb16 |
47 | ;sb16 |
48 | lea eax,[par] |
48 | lea eax,[par] |
49 | push eax |
49 | push eax |
50 | invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def |
50 | invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def |
51 | pop eax |
51 | pop eax |
52 | stdcall strtoint,eax |
52 | stdcall strtoint,eax |
53 | push eax |
53 | push eax |
54 | pop ecx |
54 | pop ecx |
55 | call _sb16 |
55 | call _sb16 |
56 | 56 | ||
57 | ;sound_dma |
57 | ;sound_dma |
58 | lea eax,[par] |
58 | lea eax,[par] |
59 | push eax |
59 | push eax |
60 | invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def |
60 | invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def |
61 | pop eax |
61 | pop eax |
62 | stdcall strtoint,eax |
62 | stdcall strtoint,eax |
63 | push eax |
63 | push eax |
64 | pop ecx |
64 | pop ecx |
65 | call _sound_dma |
65 | call _sound_dma |
66 | 66 | ||
67 | 67 | ||
68 | ;midibase |
68 | ;midibase |
69 | lea eax,[par] |
69 | lea eax,[par] |
70 | push eax |
70 | push eax |
71 | invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def |
71 | invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def |
72 | pop eax |
72 | pop eax |
73 | stdcall strtoint,eax |
73 | stdcall strtoint,eax |
74 | push eax |
74 | push eax |
75 | pop ecx |
75 | pop ecx |
76 | call _midibase |
76 | call _midibase |
77 | 77 | ||
78 | 78 | ||
79 | popad |
79 | popad |
80 | ret |
80 | ret |
81 | endp |
81 | endp |
82 | 82 | ||
83 | ugui db 'gui',0 |
83 | ugui db 'gui',0 |
84 | ugui_mouse_speed db 'mouse_speed',0 |
84 | ugui_mouse_speed db 'mouse_speed',0 |
85 | ugui_mouse_speed_def db '2',0 |
85 | ugui_mouse_speed_def db '2',0 |
86 | ugui_mouse_delay db 'mouse_delay',0 |
86 | ugui_mouse_delay db 'mouse_delay',0 |
87 | ugui_mouse_delay_def db '0x00A',0 |
87 | ugui_mouse_delay_def db '0x00A',0 |
88 | 88 | ||
89 | udev db 'dev',0 |
89 | udev db 'dev',0 |
90 | udev_sb16 db 'sb16',0 |
90 | udev_sb16 db 'sb16',0 |
91 | udev_sb16_def db '0x220',0 |
91 | udev_sb16_def db '0x220',0 |
92 | udev_sound_dma db 'sound_dma',0 |
92 | udev_sound_dma db 'sound_dma',0 |
93 | udev_sound_dma_def db '1',0 |
93 | udev_sound_dma_def db '1',0 |
94 | udev_midibase db 'midibase',0 |
94 | udev_midibase db 'midibase',0 |
95 | udev_midibase_def db '0x320',0 |
95 | udev_midibase_def db '0x320',0 |
96 | 96 | ||
97 | proc set_network_conf |
97 | proc set_network_conf |
98 | locals |
98 | locals |
99 | par db 30 dup(?) |
99 | par db 30 dup(?) |
100 | endl |
100 | endl |
101 | pushad |
101 | pushad |
102 | 102 | ||
103 | ;[net] |
103 | ;[net] |
104 | ;active |
104 | ;active |
105 | lea eax,[par] |
105 | lea eax,[par] |
106 | invoke ini.get_int,conf_fname, unet, unet_active, 0 |
106 | invoke ini.get_int,conf_fname, unet, unet_active, 0 |
107 | or eax,eax |
107 | or eax,eax |
108 | jz .do_not_set_net |
108 | jz .do_not_set_net |
109 | call _net_up |
109 | call _net_up |
110 | 110 | ||
111 | ;addr |
111 | ;addr |
112 | lea eax,[par] |
112 | lea eax,[par] |
113 | push eax |
113 | push eax |
114 | invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def |
114 | invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def |
115 | pop eax |
115 | pop eax |
116 | stdcall do_inet_adr,eax |
116 | stdcall do_inet_adr,eax |
117 | push eax |
117 | push eax |
118 | pop ecx |
118 | pop ecx |
119 | call _net_addr |
119 | call _net_addr |
120 | 120 | ||
121 | ;mask |
121 | ;mask |
122 | lea eax,[par] |
122 | lea eax,[par] |
123 | push eax |
123 | push eax |
124 | invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def |
124 | invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def |
125 | pop eax |
125 | pop eax |
126 | stdcall do_inet_adr,eax |
126 | stdcall do_inet_adr,eax |
127 | push eax |
127 | push eax |
128 | pop ecx |
128 | pop ecx |
129 | call _net_mask |
129 | call _net_mask |
130 | 130 | ||
131 | ;gate |
131 | ;gate |
132 | lea eax,[par] |
132 | lea eax,[par] |
133 | push eax |
133 | push eax |
134 | invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def |
134 | invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def |
135 | pop eax |
135 | pop eax |
136 | stdcall do_inet_adr,eax |
136 | stdcall do_inet_adr,eax |
137 | push eax |
137 | push eax |
138 | pop ecx |
138 | pop ecx |
139 | call _net_gate |
139 | call _net_gate |
140 | .do_not_set_net: |
140 | .do_not_set_net: |
141 | popad |
141 | popad |
142 | ret |
142 | ret |
143 | 143 | ||
144 | 144 | ||
145 | endp |
145 | endp |
146 | 146 | ||
147 | unet db 'net',0 |
147 | unet db 'net',0 |
148 | unet_active db 'active',0 |
148 | unet_active db 'active',0 |
149 | unet_addr db 'addr',0 |
149 | unet_addr db 'addr',0 |
150 | unet_mask db 'mask',0 |
150 | unet_mask db 'mask',0 |
151 | unet_gate db 'gate',0 |
151 | unet_gate db 'gate',0 |
152 | unet_def db 0 |
152 | unet_def db 0 |
153 | 153 | ||
154 | ; ª®¢¥à票¥ áâப¨ ¢ DWord ¢ eax (¯® ¢â®à®¬ã ᨬ¢®«ã ®¯à¥¤¥«ï¥â á¨á⥬ã áç¨á«¥¨ï) |
154 | ; ª®¢¥à票¥ áâப¨ ¢ DWord ¢ eax (¯® ¢â®à®¬ã ᨬ¢®«ã ®¯à¥¤¥«ï¥â á¨á⥬ã áç¨á«¥¨ï) |
155 | 155 | ||
156 | proc strtoint stdcall,strs |
156 | proc strtoint stdcall,strs |
157 | pushad |
157 | pushad |
158 | 158 | ||
159 | mov eax,[strs] |
159 | mov eax,[strs] |
160 | inc eax |
160 | inc eax |
161 | mov bl,[eax] |
161 | mov bl,[eax] |
162 | cmp bl,'x' |
162 | cmp bl,'x' |
163 | je .hex |
163 | je .hex |
164 | cmp bl,'X' |
164 | cmp bl,'X' |
165 | je .hex |
165 | je .hex |
166 | jmp .dec |
166 | jmp .dec |
167 | .hex: |
167 | .hex: |
168 | inc eax |
168 | inc eax |
169 | stdcall strtoint_hex,eax |
169 | stdcall strtoint_hex,eax |
170 | jmp .exit |
170 | jmp .exit |
171 | .dec: |
171 | .dec: |
172 | dec eax |
172 | dec eax |
173 | stdcall strtoint_dec,eax |
173 | stdcall strtoint_dec,eax |
174 | .exit: |
174 | .exit: |
175 | mov [esp+28],eax |
175 | mov [esp+28],eax |
176 | popad |
176 | popad |
177 | ret |
177 | ret |
178 | endp |
178 | endp |
179 | 179 | ||
180 | ; ª®¢¥à票¥ áâப¨ ¢ DWord ¢ eax ¤«ï ¤¥áïâ¨ç®£® |
180 | ; ª®¢¥à票¥ áâப¨ ¢ DWord ¢ eax ¤«ï ¤¥áïâ¨ç®£® |
181 | proc strtoint_dec stdcall,strs |
181 | proc strtoint_dec stdcall,strs |
182 | pushad |
182 | pushad |
183 | xor edx,edx |
183 | xor edx,edx |
184 | ; ¯®¨áª ª®æ |
184 | ; ¯®¨áª ª®æ |
185 | mov esi,[strs] |
185 | mov esi,[strs] |
186 | @@: |
186 | @@: |
187 | lodsb |
187 | lodsb |
188 | or al,al |
188 | or al,al |
189 | jnz @b |
189 | jnz @b |
190 | mov ebx,esi |
190 | mov ebx,esi |
191 | mov esi,[strs] |
191 | mov esi,[strs] |
192 | dec ebx |
192 | dec ebx |
193 | sub ebx,esi |
193 | sub ebx,esi |
194 | mov ecx,1 |
194 | mov ecx,1 |
195 | 195 | ||
196 | @@: |
196 | @@: |
197 | dec ebx |
197 | dec ebx |
198 | or ebx,ebx |
198 | or ebx,ebx |
199 | jz @f |
199 | jz @f |
200 | imul ecx,ecx,10 ; ¯®à冷ª |
200 | imul ecx,ecx,10 ; ¯®à冷ª |
201 | jmp @b |
201 | jmp @b |
202 | @@: |
202 | @@: |
203 | 203 | ||
204 | xchg ebx,ecx |
204 | xchg ebx,ecx |
205 | 205 | ||
206 | 206 | ||
207 | xor ecx,ecx |
207 | xor ecx,ecx |
208 | 208 | ||
209 | 209 | ||
210 | @@: |
210 | @@: |
211 | xor eax,eax |
211 | xor eax,eax |
212 | lodsb |
212 | lodsb |
213 | cmp al,0 |
213 | cmp al,0 |
214 | je .eend |
214 | je .eend |
215 | 215 | ||
216 | sub al,30h |
216 | sub al,30h |
217 | imul ebx |
217 | imul ebx |
218 | add ecx,eax |
218 | add ecx,eax |
219 | push ecx |
219 | push ecx |
220 | xchg eax,ebx |
220 | xchg eax,ebx |
221 | mov ecx,10 |
221 | mov ecx,10 |
222 | div ecx |
222 | div ecx |
223 | xchg eax,ebx |
223 | xchg eax,ebx |
224 | pop ecx |
224 | pop ecx |
225 | jmp @b |
225 | jmp @b |
226 | 226 | ||
227 | .eend: |
227 | .eend: |
228 | mov [esp+28],ecx |
228 | mov [esp+28],ecx |
229 | popad |
229 | popad |
230 | ret |
230 | ret |
231 | endp |
231 | endp |
232 | 232 | ||
233 | ; ª®¢¥à票¥ áâப¨ ¢ DWord ¢ eax ¤«ï è¥á ¤æ â¨à¨ç®£® |
233 | ; ª®¢¥à票¥ áâப¨ ¢ DWord ¢ eax ¤«ï è¥á ¤æ â¨à¨ç®£® |
234 | proc strtoint_hex stdcall,strs |
234 | proc strtoint_hex stdcall,strs |
235 | pushad |
235 | pushad |
236 | xor edx,edx |
236 | xor edx,edx |
237 | 237 | ||
238 | mov esi,[strs] |
238 | mov esi,[strs] |
239 | mov ebx,1 |
239 | mov ebx,1 |
240 | add esi,1 |
240 | add esi,1 |
241 | 241 | ||
242 | @@: |
242 | @@: |
243 | lodsb |
243 | lodsb |
244 | or al,al |
244 | or al,al |
245 | jz @f |
245 | jz @f |
246 | shl ebx,4 |
246 | shl ebx,4 |
247 | jmp @b |
247 | jmp @b |
248 | @@: |
248 | @@: |
249 | xor ecx,ecx |
249 | xor ecx,ecx |
250 | mov esi,[strs] |
250 | mov esi,[strs] |
251 | 251 | ||
252 | @@: |
252 | @@: |
253 | xor eax,eax |
253 | xor eax,eax |
254 | lodsb |
254 | lodsb |
255 | cmp al,0 |
255 | cmp al,0 |
256 | je .eend |
256 | je .eend |
257 | 257 | ||
258 | cmp al,'a' |
258 | cmp al,'a' |
259 | jae .bm |
259 | jae .bm |
260 | cmp al,'A' |
260 | cmp al,'A' |
261 | jae .bb |
261 | jae .bb |
262 | jmp .cc |
262 | jmp .cc |
263 | .bm: ; 57h |
263 | .bm: ; 57h |
264 | sub al,57h |
264 | sub al,57h |
265 | jmp .do |
265 | jmp .do |
266 | 266 | ||
267 | .bb: ; 37h |
267 | .bb: ; 37h |
268 | sub al,37h |
268 | sub al,37h |
269 | jmp .do |
269 | jmp .do |
270 | 270 | ||
271 | .cc: ; 30h |
271 | .cc: ; 30h |
272 | sub al,30h |
272 | sub al,30h |
273 | 273 | ||
274 | .do: |
274 | .do: |
275 | imul ebx |
275 | imul ebx |
276 | add ecx,eax |
276 | add ecx,eax |
277 | shr ebx,4 |
277 | shr ebx,4 |
278 | 278 | ||
279 | jmp @b |
279 | jmp @b |
280 | 280 | ||
281 | .eend: |
281 | .eend: |
282 | mov [esp+28],ecx |
282 | mov [esp+28],ecx |
283 | popad |
283 | popad |
284 | ret |
284 | ret |
285 | endp |
285 | endp |
286 | 286 | ||
287 | 287 | ||
288 | ; ¯à¥®¡à §®¢ âì ¤à¥á ¢ â® çâ® ¤ , ¥á«¨ ¯ãáâ® â® ¢¥àãâì 0 |
288 | ; ¯à¥®¡à §®¢ âì ¤à¥á ¢ â® çâ® ¤ , ¥á«¨ ¯ãáâ® â® ¢¥àãâì 0 |
289 | proc do_inet_adr stdcall,strs |
289 | proc do_inet_adr stdcall,strs |
290 | pushad |
290 | pushad |
291 | 291 | ||
292 | mov esi,[strs] |
292 | mov esi,[strs] |
293 | mov ebx,0 |
293 | mov ebx,0 |
294 | .next: |
294 | .next: |
295 | push esi |
295 | push esi |
296 | @@: |
296 | @@: |
297 | lodsb |
297 | lodsb |
298 | or al,al |
298 | or al,al |
299 | jz @f |
299 | jz @f |
300 | cmp al,'.' |
300 | cmp al,'.' |
301 | jz @f |
301 | jz @f |
302 | jmp @b |
302 | jmp @b |
303 | @@: |
303 | @@: |
304 | mov cl, al |
304 | mov cl, al |
305 | mov [esi-1],byte 0 |
305 | mov [esi-1],byte 0 |
306 | ;pop eax |
306 | ;pop eax |
307 | call strtoint_dec |
307 | call strtoint_dec |
308 | rol eax,24 |
308 | rol eax,24 |
309 | ror ebx,8 |
309 | ror ebx,8 |
310 | add ebx,eax |
310 | add ebx,eax |
311 | or cl,cl |
311 | or cl,cl |
312 | jz @f |
312 | jz @f |
313 | jmp .next |
313 | jmp .next |
314 | @@: |
314 | @@: |
315 | mov [esp+28],ebx |
315 | mov [esp+28],ebx |
316 | popad |
316 | popad |
317 | ret |
317 | ret |
318 | endp |
318 | endp |
319 | 319 | ||
320 | 320 | ||
321 | ; ãáâ ®¢ª¨ ¨§ setup |
321 | ; ãáâ ®¢ª¨ ¨§ setup |
322 | 322 | ||
323 | _mouse_speed: |
323 | _mouse_speed: |
324 | mov eax,18 |
324 | mov eax,18 |
325 | mov ebx,19 |
325 | mov ebx,19 |
326 | mov ecx,1 |
326 | mov ecx,1 |
327 | int 0x40 |
327 | int 0x40 |
328 | ret |
328 | ret |
329 | 329 | ||
330 | _mouse_delay: |
330 | _mouse_delay: |
331 | mov eax,18 |
331 | mov eax,18 |
332 | mov ebx,19 |
332 | mov ebx,19 |
333 | mov ecx,3 |
333 | mov ecx,3 |
334 | int 0x40 |
334 | int 0x40 |
335 | ret |
335 | ret |
336 | 336 | ||
337 | _sb16: |
337 | _sb16: |
338 | mov eax,21 |
338 | mov eax,21 |
339 | mov ebx,4 |
339 | mov ebx,4 |
340 | int 0x40 |
340 | int 0x40 |
341 | ret |
341 | ret |
342 | 342 | ||
343 | _sound_dma: |
343 | _sound_dma: |
344 | mov eax,21 |
344 | mov eax,21 |
345 | mov ebx,10 |
345 | mov ebx,10 |
346 | int 0x40 |
346 | int 0x40 |
347 | ret |
347 | ret |
348 | 348 | ||
349 | 349 | ||
350 | _midibase: |
350 | _midibase: |
351 | mov eax,21 |
351 | mov eax,21 |
352 | mov ebx,1 |
352 | mov ebx,1 |
353 | int 0x40 |
353 | int 0x40 |
354 | ret |
354 | ret |
355 | 355 | ||
356 | _net_addr: |
356 | _net_addr: |
357 | mov eax,52 |
357 | mov eax,52 |
358 | mov ebx,3 |
358 | mov ebx,3 |
359 | int 0x40 |
359 | int 0x40 |
360 | ret |
360 | ret |
361 | 361 | ||
362 | _net_mask: |
362 | _net_mask: |
363 | mov eax,52 |
363 | mov eax,52 |
364 | mov ebx,12 |
364 | mov ebx,12 |
365 | int 0x40 |
365 | int 0x40 |
366 | ret |
366 | ret |
367 | 367 | ||
368 | _net_gate: |
368 | _net_gate: |
369 | mov eax,52 |
369 | mov eax,52 |
370 | mov ebx,11 |
370 | mov ebx,11 |
371 | int 0x40 |
371 | int 0x40 |
372 | ret |
372 | ret |
373 | 373 | ||
374 | _net_up: |
374 | _net_up: |
375 | mov eax,52 |
375 | mov eax,52 |
376 | mov ebx,0 |
376 | mov ebx,0 |
377 | int 0x40 |
377 | int 0x40 |
378 | and eax,0xFFFFFF80 |
378 | and eax,0xFFFFFF80 |
379 | add eax,3 |
379 | add eax,3 |
380 | mov ecx,eax |
380 | mov ecx,eax |
381 | 381 | ||
382 | mov eax,52 |
382 | mov eax,52 |
383 | mov ebx,2 |
383 | mov ebx,2 |
384 | int 0x40 |
384 | int 0x40 |
385 | ret |
385 | ret |