Subversion Repositories Kolibri OS

Rev

Rev 5892 | Rev 6832 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5892 Rev 5900
1
use32
1
use32
2
    org     0
2
    org     0
3
    db	    'MENUET01'
3
    db	    'MENUET01'
4
    dd	    1, @entry, @end, @memory, @stack, 0, 0
4
    dd	    1, @entry, @end, @memory, @stack, 0, 0
5
 
5
 
6
    include "../../macros.inc"
6
    include "../../macros.inc"
7
    include "../../proc32.inc"
7
    include "../../proc32.inc"
8
;    include "../../debug.inc"
8
;    include "../../debug.inc"
9
    include "../../notify.inc"
9
    include "../../notify.inc"
10
    include "../../string.inc"
10
    include "../../string.inc"
11
    include "../../cmp.inc"
11
    include "../../cmp.inc"
12
 
12
 
13
 @entry:
13
 @entry:
14
    mcall   68, 11
14
    mcall   68, 11
15
 
15
 
16
 ;; RUN NOTIFY
16
 ;; RUN NOTIFY
17
    call    make_param
17
    call    make_param
18
    mcall   70, fi_launch
18
    mcall   70, fi_launch
19
 
19
 
20
 ;; CONVERT PID TO STR
20
 ;; CONVERT PID TO STR
21
    mov     ebx, 10
21
    mov     ebx, 10
22
    mov     ecx, 0
22
    mov     ecx, 0
23
  @@:
23
  @@:
24
    mov     edx, 0
24
    mov     edx, 0
25
    div     ebx
25
    div     ebx
26
    push    edx
26
    push    edx
27
    inc     ecx
27
    inc     ecx
28
    cmpne   eax, 0, @b
28
    cmpne   eax, 0, @b
29
 
29
 
30
    mov     ebx, ctrl.name
30
    mov     ebx, ctrl.name
31
  @@:
31
  @@:
32
    pop     eax
32
    pop     eax
33
    add     al, "0"
33
    add     al, "0"
34
    mov     [ebx], al
34
    mov     [ebx], al
35
    inc     ebx
35
    inc     ebx
36
    loop    @b
36
    loop    @b
37
 
37
 
38
 ;; ADD POSTFIX TO STR
38
 ;; ADD POSTFIX TO STR
39
    mov     dword [ebx + 0], "-NOT"
39
    mov     dword [ebx + 0], "-NOT"
40
    mov     dword [ebx + 4], "IFY"
40
    mov     dword [ebx + 4], "IFY"
41
 
41
 
42
 ;; OPEN CONTROLLER (0x08 + 0x01 -- CREATE AND READ/WRITE)
42
 ;; OPEN CONTROLLER (0x08 + 0x01 -- CREATE AND READ/WRITE)
43
    mcall   68, 22, ctrl.name, 2048, 0x09
43
    mcall   68, 22, ctrl.name, 2048, 0x09
44
    mov     [ctrl.addr], eax
44
    mov     [ctrl.addr], eax
45
 
45
 
46
 ;; WAIT UNTIL CONTROLLER BECOMES READY TO USE
46
 ;; WAIT UNTIL CONTROLLER BECOMES READY TO USE
47
    add     eax, NTCTRL_READY
47
    add     eax, NTCTRL_READY
48
  @@:
48
  @@:
49
    mcall   5, 1
49
    mcall   5, 1
50
    cmpe    byte [eax], 0, @b
50
    cmpe    byte [eax], 0, @b
-
 
51
 
-
 
52
 ;; CONFIG PBAR
-
 
53
    mov     eax, [ctrl.addr]
-
 
54
    add     eax, NTCTRL_PBAR_MAX
-
 
55
    mov     dword [eax], 9
-
 
56
 
-
 
57
    mov     eax, [ctrl.addr]
-
 
58
    add     eax, NTCTRL_PBAR_CUR
-
 
59
    mov     dword [eax], 9
-
 
60
 
-
 
61
    mov     eax, [ctrl.addr]
-
 
62
    add     eax, NTCTRL_APPLY_PBAR
-
 
63
    mov     byte [eax], 1
51
 
64
 
52
 ;; LOOP OF NOTIFIES CHANGES
65
 ;; LOOP OF NOTIFIES CHANGES
53
  @@:
66
  @@:
54
  ;; SHIFT TEXT
67
  ;; SHIFT TEXT
55
    call    shift
68
    call    shift
56
  ;; ADD UNSHIFTABLE TEXT
69
  ;; ADD UNSHIFTABLE TEXT
57
    mov     byte [params], 0
70
    mov     byte [params], 0
58
    call    make_text
71
    call    make_text
59
 
72
 
60
  ;; SEND TEXT TO NOTIFY
73
  ;; SEND TEXT TO NOTIFY
61
    mov     eax, [ctrl.addr]
74
    mov     eax, [ctrl.addr]
62
    add     eax, NTCTRL_TEXT
75
    add     eax, NTCTRL_TEXT
63
    stdcall string.copy, params, eax
76
    stdcall string.copy, params, eax
64
 
77
 
65
  ;; APPLY NEW TEXT
78
  ;; APPLY NEW TEXT
66
    mov     eax, [ctrl.addr]
79
    mov     eax, [ctrl.addr]
67
    add     eax, NTCTRL_APPLY_TEXT
80
    add     eax, NTCTRL_APPLY_TEXT
68
    mov     byte [eax], 1
81
    mov     byte [eax], 1
69
 
82
 
70
  ;; CLOSE NOTIFY IF TIME IS END
83
  ;; CLOSE NOTIFY IF TIME IS END
71
    cmpe    byte [sz_time], "0" - 1, .exit
84
    cmpe    byte [sz_time], "0", .exit
72
 
85
 
73
  ;; WAIT AND DO NEXT ITERATION
86
  ;; WAIT AND DO NEXT ITERATION
74
    mcall   5, 10
87
    mcall   5, 20
75
    jmp     @b
88
    jmp     @b
76
 
89
 
77
 .exit:
90
 .exit:
78
  ;; CLOSE NOTIFY
91
  ;; CLOSE NOTIFY
79
    mov     eax, [ctrl.addr]
92
    mov     eax, [ctrl.addr]
80
    add     eax, NTCTRL_CLOSE
93
    add     eax, NTCTRL_CLOSE
81
    mov     byte [eax], 1
94
    mov     byte [eax], 1
82
 
95
 
83
    mcall   -1
96
    mcall   -1
84
 
97
 
85
;-------------------------------------------------------------------------------
98
;-------------------------------------------------------------------------------
86
 shift:
99
 shift:
87
 ;; SHIFT TEXT
100
 ;; SHIFT TEXT
88
    mov     eax, sz_text
101
    mov     eax, sz_text
89
    mov     dh, [eax]
102
    mov     dh, [eax]
90
  @@:
103
  @@:
91
    mov     dl, [eax + 1]
104
    mov     dl, [eax + 1]
92
    mov     [eax], dl
105
    mov     [eax], dl
93
    inc     eax
106
    inc     eax
94
    cmpne   byte [eax + 1], 0, @b
107
    cmpne   byte [eax + 1], 0, @b
95
    mov     [eax], dh
108
    mov     [eax], dh
96
 
109
 
97
    inc     byte [timer]
110
    inc     byte [timer]
98
    cmpne   byte [timer], 10, .skip_changes
111
    cmpne   byte [timer], 5, .skip_changes
99
    sub     byte [timer], 10
112
    sub     byte [timer], 5
100
 
113
 
101
 ;; CHANGE TIMER TEXT
114
 ;; CHANGE TIMER TEXT
102
    dec     byte [sz_time]
115
    dec     byte [sz_time]
103
 
116
 
104
 ;; CHANGE ICON
117
 ;; CHANGE ICON
105
    mov     eax, [ctrl.addr]
118
    mov     eax, [ctrl.addr]
106
    add     eax, NTCTRL_ICON
119
    add     eax, NTCTRL_ICON
107
    inc     byte [eax]
120
    inc     byte [eax]
108
    cmpne   byte [eax], 12, @f
121
    cmpne   byte [eax], 12, @f
109
    sub     byte [eax], 11
122
    sub     byte [eax], 11
110
  @@:
123
  @@:
111
 
124
 
112
 ;; APPLY NEW ICON
125
 ;; APPLY NEW ICON
113
    mov     eax, [ctrl.addr]
126
    mov     eax, [ctrl.addr]
114
    add     eax, NTCTRL_APPLY_ICON
127
    add     eax, NTCTRL_APPLY_ICON
115
    mov     byte [eax], 1
128
    mov     byte [eax], 1
116
 
129
 
117
 ;; CHANGE TITLE
130
 ;; CHANGE TITLE
118
    mov     eax, [ctrl.addr]
131
    mov     eax, [ctrl.addr]
119
    add     eax, NTCTRL_TITLE
132
    add     eax, NTCTRL_TITLE
120
    mov     dl, 1
133
    mov     dl, 1
121
    sub     dl, [eax]
134
    sub     dl, [eax]
122
    mov     [eax], dl
135
    mov     [eax], dl
123
 
136
 
124
 ;; APPLY NEW TITLE
137
 ;; APPLY NEW TITLE
125
    mov     eax, [ctrl.addr]
138
    mov     eax, [ctrl.addr]
126
    add     eax, NTCTRL_APPLY_TITLE
139
    add     eax, NTCTRL_APPLY_TITLE
127
    mov     byte [eax], 1
140
    mov     byte [eax], 1
-
 
141
 
-
 
142
 ;; CHANGE PBAR
-
 
143
    mov     eax, [ctrl.addr]
-
 
144
    add     eax, NTCTRL_PBAR_CUR
-
 
145
    dec     dword [eax]
-
 
146
 
-
 
147
 ;; APPLY PBAR
-
 
148
    mov     eax, [ctrl.addr]
-
 
149
    add     eax, NTCTRL_APPLY_PBAR
-
 
150
    mov     byte [eax], 1
128
 
151
 
129
 .skip_changes:
152
 .skip_changes:
130
 
153
 
131
    ret
154
    ret
132
;-------------------------------------------------------------------------------
155
;-------------------------------------------------------------------------------
133
 make_text:
156
 make_text:
134
    stdcall string.concatenate, sz_text, params
157
    stdcall string.concatenate, sz_text, params
135
    stdcall string.concatenate, sz_sec_line_start, params
158
    stdcall string.concatenate, sz_sec_line_start, params
136
    stdcall string.concatenate, sz_time, params
159
    stdcall string.concatenate, sz_time, params
137
    stdcall string.concatenate, sz_sec_line_end, params
160
    stdcall string.concatenate, sz_sec_line_end, params
138
 
161
 
139
    ret
162
    ret
140
;-------------------------------------------------------------------------------
163
;-------------------------------------------------------------------------------
141
 make_param:
164
 make_param:
142
    stdcall string.copy, sz_quote, params
165
    stdcall string.copy, sz_quote, params
143
    call    make_text
166
    call    make_text
144
    stdcall string.concatenate, sz_quote, params
167
    stdcall string.concatenate, sz_quote, params
145
    stdcall string.concatenate, sz_flags, params
168
    stdcall string.concatenate, sz_flags, params
146
 
169
 
147
    ret
170
    ret
148
;-------------------------------------------------------------------------------
171
;-------------------------------------------------------------------------------
149
 
172
 
150
 sz_time:
173
 sz_time:
151
    db "5", 0
174
    db "9", 0
152
 sz_text:
175
 sz_text:
153
    db "Hello, World!!! It is a marquee!    ", 0
176
    db "Hello, World!!! It is a marquee!    ", 0
154
 sz_quote:
177
 sz_quote:
155
    db "'", 0
178
    db "'", 0
156
 sz_sec_line_start:
179
 sz_sec_line_start:
157
    db 10, "Will close after ", 0
180
    db 10, "Will close after ", 0
158
 sz_sec_line_end:
181
 sz_sec_line_end:
159
    db " seconds", 0
182
    db " seconds", 0
160
 sz_flags:
183
 sz_flags:
161
    db "Idc", 0
184
    db "Idcp", 0
162
 
185
 
163
 fi_launch:
186
 fi_launch:
164
    dd	    7, 0, params, 0, 0
187
    dd	    7, 0, params, 0, 0
-
 
188
    ;db      "/usbhd0/2/svn/programs/system/notify3/notify", 0
165
    db	    "@notify", 0
189
    db	    "@notify", 0
166
 
190
 
167
 @end:
191
 @end:
168
;=====================================================================
192
;=====================================================================
169
 timer	rb 1
193
 timer	rb 1
170
 params rb 256
194
 params rb 256
171
 ctrl:
195
 ctrl:
172
  .name rb 32
196
  .name rb 32
173
  .addr rd 1
197
  .addr rd 1
174
	rb 2048
198
	rb 2048
175
 @stack:
199
 @stack:
176
 
200
 
177
 @memory:
201
 @memory: