Subversion Repositories Kolibri OS

Rev

Rev 195 | Rev 318 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 halyavin 1
;
2
; END
3
;
47 halyavin 4
;  note that 'mov al,xx' is shorter than 'mov eax,xx'
5
;           and if we know that high 24 bits of eax are zero, we can use 1st form
6
;           the same about ebx,ecx,edx
31 halyavin 7
 
59 halyavin 8
include "lang.inc"
31 halyavin 9
include "macros.inc"
10
 
11
meos_app_start
12
code
13
 
47 halyavin 14
do_draw:
31 halyavin 15
 
16
    mov  eax,48
17
    mov  ebx,3
18
    mov  ecx,sc
19
    mov  edx,sizeof.system_colors
20
    int  0x40
21
 
47 halyavin 22
    mov  al,12 		   ; eax=12 - tell os about redraw start
23
    mov  bl,1
31 halyavin 24
    int  0x40
25
 
47 halyavin 26
    mov  al,14 		   ; eax=14 - get screen max x & max y
31 halyavin 27
    int  0x40
28
 
47 halyavin 29
    movzx ecx,ax
31 halyavin 30
 
31
    shr  eax,17
47 halyavin 32
;    sub  eax,110
31 halyavin 33
    shl  eax,16
47 halyavin 34
;    mov  ebx,eax
35
;    add  ebx,220
36
    lea  ebx,[eax-110*10000h+220]
31 halyavin 37
 
38
    shr  ecx,1
47 halyavin 39
;    sub  ecx,50
31 halyavin 40
    shl  ecx,16
47 halyavin 41
;    add  ecx,100
42
    sub  ecx,50*10000h - 100
31 halyavin 43
 
44
    mov  eax,0			   ; define and draw window
195 heavyiron 45
    mov  edx,[sc.work]
46
    mov  esi,edx
47
    mov  edi,edx
31 halyavin 48
    int  0x40
49
 
195 heavyiron 50
   mov edx,0x444444
47 halyavin 51
   mov al,13
195 heavyiron 52
   mcall ,18 shl 16+90,29 shl 16+27
47 halyavin 53
   push ebx
195 heavyiron 54
   mcall ,121 shl 16+90,
47 halyavin 55
   xchg ebx,[esp]
195 heavyiron 56
   mcall ,,63 shl 16+27
47 halyavin 57
   pop  ebx
58
   mcall
31 halyavin 59
 
195 heavyiron 60
   xor edx,edx
47 halyavin 61
   mov al,8
62
   inc edx
195 heavyiron 63
   mcall ,15 shl 16+87,26 shl 16+24,,0xbb0055
47 halyavin 64
   inc edx
195 heavyiron 65
   mcall ,118 shl 16+87,,,0xaaaa   ;cccc
47 halyavin 66
   inc edx
195 heavyiron 67
   mcall ,15 shl 16+87,60 shl 16+24,,0x9900
47 halyavin 68
   inc edx
195 heavyiron 69
   mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc
31 halyavin 70
 
47 halyavin 71
    mov  al,4			   ; 0x00000004 = write text
31 halyavin 72
    mov  ebx,75*65536+10
195 heavyiron 73
    mov  ecx,[sc.work_text] ; 8b window nro - RR GG BB color
74
    or   ecx,0x10000000
31 halyavin 75
    mov  edx,label1		   ; pointer to text beginning
76
    mov  esi,label1_len 	   ; text length
77
    int  0x40
78
 
195 heavyiron 79
    mov  ecx,[sc.work_button_text] ; 8b window nro - RR GG BB color
80
    or   ecx,0x10000000
31 halyavin 81
    mov  ebx,25*65536+30
82
    mov  edx,label2		   ; pointer to text beginning
83
    mov  esi,label2_len 	   ; text length
84
    int  0x40
85
 
86
    mov  ebx,20*65536+64
87
    mov  edx,label3		   ; pointer to text beginning
88
    mov  esi,label3_len 	   ; text length
89
    int  0x40
90
 
91
    mov  ecx,0xffffff
92
    mov  ebx,45*65536+41
93
    mov  edx,label4		   ; pointer to text beginning
94
    mov  esi,label4_len 	   ; text length
95
    int  0x40
96
 
97
    mov  ebx,40*65536+75
98
    mov  edx,label5		   ; pointer to text beginning
99
    mov  esi,label5_len 	   ; text length
100
    int  0x40
101
 
47 halyavin 102
    mov  al,12 		   ; tell os about redraw end
31 halyavin 103
    mov  ebx,2
104
    int  0x40
105
 
47 halyavin 106
still:
31 halyavin 107
 
47 halyavin 108
    mov  eax,10 		; wait here for event
109
    int  0x40
31 halyavin 110
 
47 halyavin 111
    dec  eax
112
    jz   do_draw
113
    dec  eax
114
    jnz  button
115
  key:
116
    mov  al,2	; now eax=2 - get key code
117
    int  40h
118
    mov  al,ah
119
     cmp  al,13
120
     jz   restart
121
     cmp  al,27
122
     jz   close_1
123
     cmp  al,180
124
     jz   restart_kernel
125
     cmp  al,181
126
     jz   power_off
127
     jmp  still
31 halyavin 128
 
47 halyavin 129
  button:
130
    mov  al,17	; now eax=17 - get pressed button id
131
    int  0x40
132
    xchg al,ah
133
    dec  eax
134
    jz   power_off
135
    dec  eax
136
    jz   restart_kernel
137
    dec  eax
138
    jz   restart
139
; we have only one button left, this is close button
140
;    dec  eax
141
;    jnz  still
142
close_1:
143
    or   eax,-1
144
    int  40h
31 halyavin 145
 
47 halyavin 146
 power_off:
147
    push 2
148
    jmp  mcall_and_close
149
 
150
 restart:
151
    push 3
152
    jmp  mcall_and_close
153
 
154
  restart_kernel:
155
    push 4
156
mcall_and_close:
157
    pop  ecx
158
    mcall 18,9
159
    jmp  close_1
160
 
31 halyavin 161
data
162
 
163
if lang eq ru
164
 
165
  label1:
166
      db   '‚€˜ ‚›Ž:'
167
  label1_len = $ - label1
168
 
169
  label2:
170
      db   '‚›Š‹ž—ˆ’œ         Ÿ„Ž'
171
  label2_len = $ - label2
172
 
173
  label3:
174
      db   '……‡€“‘Š       Ž’Œ…€'
175
  label3_len = $ - label3
176
 
135 diamond 177
else if lang eq en
31 halyavin 178
 
179
  label1:
180
      db   ' SELECT:'
181
  label1_len = $ - label1
182
 
183
  label2:
184
      db   'POWER OFF        KERNEL'
185
  label2_len = $ - label2
186
 
187
  label3:
188
      db   '  RESTART         CANCEL'
189
  label3_len = $ - label3
190
 
274 kaitz 191
else if lang eq et
192
 
193
  label1:
194
      db   '  VALI:'
195
  label1_len = $ - label1
196
 
197
  label2:
198
      db   'LάLITA VΔLJA     KERNEL'
199
  label2_len = $ - label2
200
 
201
  label3:
202
      db   '  RESTART         TάHISTA'
203
  label3_len = $ - label3
204
 
135 diamond 205
else
206
 
207
  label1:
208
      db   'WAEHLEN:'
209
  label1_len = $ - label1
210
 
211
  label2:
195 heavyiron 212
      db   ' BEENDEN         KERNEL'
135 diamond 213
  label2_len = $ - label2
214
 
215
  label3:
216
      db   '  NEUSTART     ABBRECHEN'
217
  label3_len = $ - label3
218
 
219
end if
220
 
31 halyavin 221
  label4:
222
      db   '(End)            (Home)'
223
  label4_len = $ - label4
224
 
225
  label5:
226
      db   '(Enter)           (Esc)'
227
  label5_len = $ - label5
228
 
229
 
230
udata
231
  sc  system_colors
232
 
233
meos_app_end