Rev 5888 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5888 | Rev 9450 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | dd I_END ; memory for app |
22 | dd I_END ; memory for app |
23 | dd stack_top ; esp |
23 | dd stack_top ; esp |
24 | dd I_Param ; boot parameters |
24 | dd I_Param ; boot parameters |
25 | dd 0x0 ; path |
25 | dd 0x0 ; path |
26 | ;------------------------------------------------------------------------------ |
26 | ;------------------------------------------------------------------------------ |
27 | include 'lang.inc' |
- | |
28 | include '..\..\..\macros.inc' |
27 | include '..\..\..\macros.inc' |
29 | ;include 'debug.inc' |
28 | ;include 'debug.inc' |
30 | ;------------------------------------------------------------------------------ |
29 | ;------------------------------------------------------------------------------ |
31 | align 4 |
30 | align 4 |
32 | START: |
31 | START: |
33 | mcall 68,11 |
32 | mcall 68,11 |
34 | mcall 40,110010b |
33 | mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE |
35 | ; boot parameters |
34 | ; boot parameters |
- | 35 | cmp [I_Param], dword '@ss' |
|
- | 36 | setz [screensaver] |
|
36 | cmp [I_Param],dword 'ZERO' |
37 | cmp [I_Param],dword 'ZERO' |
37 | jne @f |
38 | jne @f |
38 | mov [type],dword 0 |
39 | mov [type],dword 0 |
39 | ;-------------------------------------- |
40 | ;-------------------------------------- |
40 | align 4 |
41 | align 4 |
Line 50... | Line 51... | ||
50 | mov [y_max],ax |
51 | mov [y_max],ax |
51 | shr eax,16 |
52 | shr eax,16 |
52 | mov [x_max],ax |
53 | mov [x_max],ax |
53 | shl eax,16 |
54 | shl eax,16 |
54 | mov [top_right_corner],eax |
55 | mov [top_right_corner],eax |
- | 56 | ||
- | 57 | call create_ss |
|
55 | ;------------------------------------------------------------------------------ |
58 | ;------------------------------------------------------------------------------ |
56 | align 4 |
59 | align 4 |
57 | still: |
60 | still: |
58 | movzx ebx,[time] |
- | |
59 | imul ebx,60*100 |
- | |
60 | mcall 23 ; ¦¤ñ¬ ᮡëâ¨ï ¢ â¥ç¥¨¥ [time] ¬¨ãâ |
- | |
61 | test eax,eax |
- | |
62 | jz create_ss_thread |
- | |
63 | - | ||
64 | cmp al,2 ; key in buffer? |
61 | cmp al,2 ; key in buffer? |
65 | jz key |
62 | jz key |
Line 66... | Line 63... | ||
66 | 63 | ||
67 | cmp al,5 ; background redraw? |
64 | cmp al,5 ; background redraw? |
Line 75... | Line 72... | ||
75 | mcall 37,0 ; ¯à®¢¥à¨¬ ª®®à¤¨ âë |
72 | mcall 37,0 ; ¯à®¢¥à¨¬ ª®®à¤¨ âë |
76 | cmp [top_right_corner],eax |
73 | cmp [top_right_corner],eax |
77 | jnz still |
74 | jnz still |
78 | ;------------------------------------------------------------------------------ |
75 | ;------------------------------------------------------------------------------ |
79 | align 4 |
76 | align 4 |
80 | create_setup: |
- | |
81 | test [params],2 |
- | |
82 | jnz still ; ®ª® áâ஥ª 㦥 ᮧ¤ ® |
- | |
83 | mcall 51,1,sthread,sthread_stack_top |
- | |
84 | or [params],2 |
- | |
85 | jmp still |
- | |
86 | ;------------------------------------------------------------------------------ |
- | |
87 | align 4 |
- | |
88 | key: |
77 | key: |
89 | mcall ; eax = 2 |
78 | mcall ; eax = 2 |
90 | jmp still |
79 | jmp still |
91 | ;------------------------------------------------------------------------------ |
80 | ;------------------------------------------------------------------------------ |
92 | align 4 |
81 | align 4 |
93 | create_ss_thread: |
- | |
94 | test [params],3 |
- | |
95 | jnz still |
- | |
96 | call create_ss |
- | |
97 | jmp still |
- | |
98 | ;------------------------------------------------------------------------------ |
- | |
99 | align 4 |
- | |
100 | create_ss: |
82 | create_ss: |
101 | mcall 51,1,thread,thread_stack_top |
- | |
102 | or [params],1 |
- | |
103 | ret |
- | |
104 | ;------------------------------------------------------------------------------ |
- | |
105 | align 4 |
- | |
106 | thread: |
- | |
107 | mcall 40,100010b |
83 | mcall 40,100010b |
108 | ;set_new_cursor_skin - transparent cursor |
84 | ;set_new_cursor_skin - transparent cursor |
109 | mcall 68,12,32*32*4 ; get memory for own cursor area |
85 | mcall 68,12,32*32*4 ; get memory for own cursor area |
Line 110... | Line 86... | ||
110 | 86 | ||
Line 201... | Line 177... | ||
201 | call draw_line |
177 | call draw_line |
202 | jmp tstill |
178 | jmp tstill |
203 | ;-------------------------------------- |
179 | ;-------------------------------------- |
204 | align 4 |
180 | align 4 |
205 | thr_end: |
181 | thr_end: |
- | 182 | cmp [screensaver], 0 |
|
- | 183 | jz @f |
|
- | 184 | mcall 70, f70 |
|
- | 185 | @@: |
|
206 | cmp [type],dword 24 |
186 | cmp [type],dword 24 |
207 | jne @f |
187 | jne @f |
208 | mcall 68,13,[fileinfo.point] |
188 | mcall 68,13,[fileinfo.point] |
209 | ;-------------------------------------- |
- | |
210 | align 4 |
- | |
211 | @@: |
189 | @@: |
212 | and [params], not 1 |
190 | and [params], not 1 |
213 | or eax,-1 |
191 | or eax,-1 |
214 | mcall |
192 | mcall |
215 | ;------------------------------------------------------------------------------ |
193 | ;------------------------------------------------------------------------------ |
Line 346... | Line 324... | ||
346 | align 4 |
324 | align 4 |
347 | dnol: |
325 | dnol: |
348 | add [lcolor],0x010201 |
326 | add [lcolor],0x010201 |
349 | ret |
327 | ret |
350 | ;------------------------------------------------------------------------------ |
328 | ;------------------------------------------------------------------------------ |
351 | align 4 |
- | |
352 | sthread: ; start of execution |
- | |
353 | call sdraw_window |
- | |
354 | ;-------------------------------------- |
- | |
355 | align 4 |
- | |
356 | sstill: |
- | |
357 | mcall 10 ; wait here for event |
- | |
358 | dec eax ; redraw request ? |
- | |
359 | je sthread |
- | |
360 | - | ||
361 | dec eax ; key in buffer ? |
- | |
362 | jne sbutton |
- | |
363 | - | ||
364 | mcall 2 |
- | |
365 | jmp snoclose ;sstill |
- | |
366 | ;------------------------------------------------------------------------------ |
- | |
367 | align 4 |
- | |
368 | sbutton: ; button |
- | |
369 | mcall 17 ; get id |
- | |
370 | - | ||
371 | cmp ah,1 ; button id=1 ? |
- | |
372 | jne snoclose |
- | |
373 | - | ||
374 | and [params],not 2 |
- | |
375 | mov eax,-1 ; close this program |
- | |
376 | mcall |
- | |
377 | ;-------------------------------------- |
- | |
378 | align 4 |
- | |
379 | snoclose: |
- | |
380 | cmp ah,7 |
- | |
381 | jne nosetfl |
- | |
382 | - | ||
383 | xor [params],1 |
- | |
384 | call drawflag |
- | |
385 | call drawtype |
- | |
386 | call drawtime |
- | |
387 | jmp sstill |
- | |
388 | ;-------------------------------------- |
- | |
389 | align 4 |
- | |
390 | nosetfl: |
- | |
391 | test [params],1 |
- | |
392 | jnz sstill |
- | |
393 | - | ||
394 | cmp ah,2 |
- | |
395 | jne notypedown |
- | |
396 | - | ||
397 | mov eax,[type] |
- | |
398 | test eax,eax |
- | |
399 | je sstill |
- | |
400 | - | ||
401 | sub eax,12 |
- | |
402 | jmp typeupdn |
- | |
403 | ;-------------------------------------- |
- | |
404 | align 4 |
- | |
405 | notypedown: |
- | |
406 | cmp ah,3 |
- | |
407 | jne notypeup |
- | |
408 | - | ||
409 | mov eax,[type] |
- | |
410 | cmp eax,24 |
- | |
411 | jae sstill |
- | |
412 | - | ||
413 | add eax,12 |
- | |
414 | jmp typeupdn |
- | |
415 | ;-------------------------------------- |
- | |
416 | align 4 |
- | |
417 | notypeup: |
- | |
418 | cmp ah,4 |
- | |
419 | jne notimedown |
- | |
420 | - | ||
421 | mov al,[time] |
- | |
422 | cmp al,1 |
- | |
423 | jbe sstill |
- | |
424 | - | ||
425 | dec eax |
- | |
426 | ; das |
- | |
427 | jmp timeupdn |
- | |
428 | ;-------------------------------------- |
- | |
429 | align 4 |
- | |
430 | notimedown: |
- | |
431 | cmp ah,5 |
- | |
432 | jne notimeup |
- | |
433 | - | ||
434 | mov al,[time] |
- | |
435 | cmp al,59 ; 0x59 |
- | |
436 | jae sstill |
- | |
437 | - | ||
438 | inc eax |
- | |
439 | ; daa |
- | |
440 | jmp timeupdn |
- | |
441 | ;-------------------------------------- |
- | |
442 | align 4 |
- | |
443 | notimeup: |
- | |
444 | cmp ah,6 |
- | |
445 | jne noshow |
- | |
446 | - | ||
447 | mcall 5,10 |
- | |
448 | call create_ss |
- | |
449 | ;-------------------------------------- |
- | |
450 | align 4 |
- | |
451 | noshow: |
- | |
452 | jmp sstill |
- | |
453 | ;-------------------------------------- |
- | |
454 | align 4 |
- | |
455 | timeupdn: |
- | |
456 | mov [time],al |
- | |
457 | call drawtime |
- | |
458 | jmp sstill |
- | |
459 | ;-------------------------------------- |
- | |
460 | align 4 |
- | |
461 | typeupdn: |
- | |
462 | mov [type],eax |
- | |
463 | call drawtype |
- | |
464 | jmp sstill |
- | |
465 | ;------------------------------------------------------------------------------ |
- | |
466 | ; ********************************************* |
- | |
467 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
- | |
468 | ; ********************************************* |
- | |
469 | align 4 |
- | |
470 | sdraw_window: |
- | |
471 | mcall 12,1 |
- | |
472 | - | ||
473 | xor eax,eax ; function 0 : define and draw window |
- | |
474 | xor esi,esi |
- | |
475 | mcall ,<100,215>,<100,70>,0x13400088,,title |
- | |
476 | - | ||
477 | mcall 8,<47,10>,<31,10>,2,0x702050 |
- | |
478 | - | ||
479 | push ebx |
- | |
480 | add ebx,13*65536 |
- | |
481 | mov edi,ebx |
- | |
482 | inc edx |
- | |
483 | mcall |
- | |
484 | pop ebx |
- | |
485 | - | ||
486 | add ecx,15*65536 |
- | |
487 | inc edx |
- | |
488 | mcall |
- | |
489 | - | ||
490 | mov ebx,edi |
- | |
491 | inc edx |
- | |
492 | mcall |
- | |
493 | - | ||
494 | inc edx |
- | |
495 | mcall ,<160,40>,<28,14> |
- | |
496 | - | ||
497 | mcall 4,<15,33>,0x80ffffff,setuptext ; write text to window |
- | |
498 | - | ||
499 | add ebx,15 |
- | |
500 | add edx,10 |
- | |
501 | mcall |
- | |
502 | - | ||
503 | mcall ,<169,32>,,buttext |
- | |
504 | - | ||
505 | call drawtype |
- | |
506 | call drawtime |
- | |
507 | call drawflag |
- | |
508 | - | ||
509 | mcall 12,2 |
- | |
510 | ret |
- | |
511 | ;------------------------------------------------------------------------------ |
- | |
512 | align 4 |
- | |
513 | drawtype: |
- | |
514 | mov edx,0xffffff |
- | |
515 | test [params], 1 |
- | |
516 | jz noblue |
- | |
517 | - | ||
518 | mov edx,0x4e00e7 |
- | |
519 | ;-------------------------------------- |
- | |
520 | align 4 |
- | |
521 | noblue: |
- | |
522 | mcall 13,<80,75>,<30,12> |
- | |
523 | xor ecx,ecx |
- | |
524 | mov edx,typetext |
- | |
525 | add edx,[type] |
- | |
526 | mcall 4,<82,32>,,,12 |
- | |
527 | ret |
- | |
528 | ;------------------------------------------------------------------------------ |
- | |
529 | align 4 |
- | |
530 | drawtime: |
- | |
531 | mov edx,0xffffff |
- | |
532 | test [params], 1 |
- | |
533 | jz noblue1 |
- | |
534 | - | ||
535 | mov edx,0x4e00e7 |
- | |
536 | ;-------------------------------------- |
- | |
537 | align 4 |
- | |
538 | noblue1: |
- | |
539 | mcall 13,<80,15>,<45,12> |
- | |
540 | xor esi,esi |
- | |
541 | movzx ecx,byte [time] |
- | |
542 | mcall 47,0x00020000,,<82,47> |
- | |
543 | ret |
- | |
544 | ;------------------------------------------------------------------------------ |
- | |
545 | align 4 |
- | |
546 | drawflag: |
- | |
547 | mcall 8,,,0x80000007 ; before we need delete button |
- | |
548 | ; otherwise, a few hours later the application will spend all buttons of system |
- | |
549 | mcall ,<150,10>,<45,10>,7,0xe0e0e0 ; then create button |
- | |
550 | - | ||
551 | mov edx,flag |
- | |
552 | bt dword [params],0 |
- | |
553 | jc setf |
- | |
554 | - | ||
555 | inc edx |
- | |
556 | ;-------------------------------------- |
- | |
557 | align 4 |
- | |
558 | setf: |
- | |
559 | xor ecx,ecx |
- | |
560 | mcall 4,<153,47>,,,1 |
- | |
561 | ret |
- | |
562 | ;------------------------------------------------------------------------------ |
- | |
563 | align 4 ; DATA AREA |
329 | align 4 ; DATA AREA |
564 | type dd 12 |
330 | type dd 12 |
565 | delay dd 100 |
331 | delay dd 100 |
566 | lx1 dd 10 |
332 | lx1 dd 10 |
567 | lx2 dd 40 |
333 | lx2 dd 40 |
Line 573... | Line 339... | ||
573 | addy2 dd 1 |
339 | addy2 dd 1 |
574 | stringlen dd 1 |
340 | stringlen dd 1 |
575 | stringstart dd 0 |
341 | stringstart dd 0 |
Line 576... | Line 342... | ||
576 | 342 | ||
577 | stringpos dw 16 |
- | |
578 | time db 15 ; ¢à¥¬ï ¤® § ¯ã᪠§ áâ ¢ª¨ ¢ ¬¨ãâ å |
343 | stringpos dw 16 |
Line 579... | Line 344... | ||
579 | params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works |
344 | params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works |
580 | 345 | ||
581 | fileinfo: |
346 | fileinfo: |
582 | dd 0 |
347 | dd 0 |
583 | dd 0 |
348 | dd 0 |
584 | dd 0 |
349 | dd 0 |
585 | .size: dd 0 |
350 | .size: dd 0 |
Line 586... | Line -... | ||
586 | .point: dd 0 |
- | |
587 | db '/sys/macros.inc',0 |
351 | .point: dd 0 |
588 | 352 | db '/sys/macros.inc',0 |
|
589 | buttext db 'SHOW',0 |
353 | |
- | 354 | f70: ; run |
|
590 | flag db 'V ' |
355 | dd 7, 0, 0, 0, 0 |
591 | title db 'SCREENSAVER SETUP',0 |
- | |
- | 356 | db '/sys/@SS',0 |
|
592 | setuptext db 'TYPE: < >',0 |
357 | |
593 | db 'TIME: < > MINUTES NEVER',0 |
358 | screensaver db ? |
594 | typetext db 'BLACK SCREENCOLOR LINES ASSEMBLER ' |
359 | |
595 | ;------------------------------- |
360 | ;------------------------------- |
596 | IM_END: ; UNINITIALIZED DATA |
361 | IM_END: ; UNINITIALIZED DATA |
Line 602... | Line 367... | ||
602 | I_Param: |
367 | I_Param: |
603 | fileinfo_buffer: |
368 | fileinfo_buffer: |
604 | rb 40 |
369 | rb 40 |
605 | ;------------------------------- |
370 | ;------------------------------- |
606 | rb 512 |
371 | rb 512 |
607 | sthread_stack_top: |
- | |
608 | rb 512 |
- | |
609 | thread_stack_top: |
- | |
610 | rb 512 |
- | |
611 | stack_top: |
372 | stack_top: |
612 | I_END:>>153,47>45,10>150,10>82,47>45,12>80,15>82,32>30,12>80,75>169,32>15,33>28,14>160,40>31,10>47,10>100,70>100,215> |
373 | I_END: |