Rev 7659 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7600 | dunkaist | 1 | use32 |
2 | org 0 |
||
3 | db 'MENUET01' |
||
4 | dd 0x01,start,i_end,e_end,e_end,0,0 |
||
5 | |||
6 | include 'proc32.inc' |
||
7 | include 'macros.inc' |
||
8 | include 'dll.inc' |
||
9 | include 'debug-fdo.inc' |
||
10 | |||
11 | __DEBUG__ = 1 |
||
12 | __DEBUG_LEVEL__ = 1 |
||
13 | |||
14 | DEFAULT_TIMEOUT_MINS = 15 |
||
15 | |||
16 | start: |
||
17 | mcall 68, 11 |
||
18 | mcall 40, EVM_KEY + EVM_BACKGROUND + EVM_MOUSE |
||
19 | |||
20 | stdcall dll.Load,@IMPORT |
||
21 | test eax, eax |
||
22 | jnz exit |
||
23 | |||
24 | invoke ini.get_int, ini_file, ini_section, ini_key_timeout, DEFAULT_TIMEOUT_MINS |
||
25 | imul eax, 60*100 ; cs |
||
26 | mov [timeout], eax |
||
27 | |||
28 | ; r1647 by Nasarus |
||
29 | mcall 66, 4, 57, 0 ; hot key for {Space} |
||
30 | mcall 66, 4, 28, 0 ; hot key for {Enter} |
||
31 | |||
32 | still: |
||
33 | mcall 23, [timeout] |
||
34 | test eax, eax |
||
35 | jz run_saver |
||
36 | cmp eax, 2 ; key |
||
37 | jnz still |
||
38 | mcall |
||
39 | ; r1647 by Nasarus |
||
40 | cmp al, 2 ; hot key? |
||
41 | jnz still ; no hotkey, evenets handling go on |
||
42 | movzx edx, ah |
||
43 | mcall 72, 1, 2 ; transfer key code to active window after interception |
||
44 | jmp still |
||
45 | run_saver: |
||
46 | invoke ini.get_str, ini_file, ini_section, ini_key_program, ini_program_buf, ini_program_buf.size, ini_program_default |
||
47 | ; run actual screensaver |
||
48 | mcall 70, f70 |
||
49 | cmp eax, 0 |
||
50 | jg exit |
||
51 | neg eax |
||
52 | DEBUGF 1, 'Screen saver not found: %d: %s\n', eax, ini_program_buf |
||
53 | exit: |
||
54 | mcall -1 |
||
55 | |||
56 | |||
57 | sz ini_file, '/sys/settings/system.ini',0 |
||
58 | sz ini_section, 'screensaver',0 |
||
59 | sz ini_key_timeout, 'timeout',0 |
||
60 | timeout dd ? |
||
61 | sz ini_key_program, 'program',0 |
||
62 | sz ini_program_default, '/sys/demos/spiral',0 |
||
63 | sz program_params, '@ss',0 |
||
64 | |||
65 | f70: ; run |
||
66 | dd 7, 0, program_params, 0, 0 |
||
67 | db 0 |
||
68 | dd ini_program_buf |
||
69 | |||
70 | align 4 |
||
71 | @IMPORT: |
||
72 | |||
73 | library \ |
||
74 | libini , 'libini.obj' |
||
75 | |||
76 | import libini, \ |
||
77 | ini.get_str, 'ini_get_str', \ |
||
78 | ini.get_int, 'ini_get_int' |
||
79 | |||
80 | include_debug_strings |
||
81 | i_end: |
||
82 | |||
83 | align 4 |
||
84 | sz ini_program_buf, 1024 dup(?) |
||
85 | rb 0x100 |
||
86 | e_end: |