Subversion Repositories Kolibri OS

Rev

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

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