Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
1742 mario79 1
;
2
; END
3443 leency 3
; KolibriOS Team 2005-2013
1742 mario79 4
;
5
;  note that 'mov al,xx' is shorter than 'mov eax,xx'
6
;           and if we know that high 24 bits of eax are zero, we can use 1st form
7
;           the same about ebx,ecx,edx
8
 
9
include "lang.inc"
10
include "..\..\..\macros.inc"
11
 
12
meos_app_start
13
code
14
 
15
do_draw:
16
 
2676 leency 17
    mcall 12,1
1742 mario79 18
 
19
    mov  al,14 		   ; eax=14 - get screen max x & max y
20
    mcall
21
 
22
    movzx ecx,ax
23
 
24
    shr  eax,17
25
    shl  eax,16
3443 leency 26
    lea  ebx,[eax-110*10000h+222]
1742 mario79 27
 
28
    shr  ecx,1
29
    shl  ecx,16
30
    sub  ecx,50*10000h - 115
31
 
32
    xor  eax,eax			   ; define and draw window
3443 leency 33
    mov  edx,0x01cccccc
1742 mario79 34
    mov  esi,edx
35
    mov  edi,edx
36
    mcall
37
 
3443 leency 38
   mcall 13,0 shl 16+222,0 shl 16+230, 0xcccccc
39
   mcall ,19 shl 16+87,21 shl 16+24, 0x555555
1742 mario79 40
   push ebx
41
   mcall ,122 shl 16+87
42
   xchg ebx,[esp]
43
   mcall ,,55 shl 16+24
44
   pop  ebx
45
   mcall
46
 
47
   mov al,8
2676 leency 48
   mcall ,15 shl 16+87,17 shl 16+24,4,0xaa0044
49
   mcall ,118 shl 16+87,,2,0xbb7700
50
   mcall ,15 shl 16+87,51 shl 16+24,3,0x8800
51
   mcall ,118 shl 16+87,,1,0x999999
1742 mario79 52
   mcall ,10 shl 16+200,88 shl 16+15,0x40000005
53
   mcall 38,27 shl 16 +193,102 shl 16 +102,0x000000dd
54
 
55
    mov  al,4			   ; 0x00000004 = write text
56
    mov  ebx,28*65536+93
57
    mov  ecx,0x800000dd
58
    mov  edx,label4
59
    mcall
60
 
61
    mov  ecx,0x90eeeeee            ; 8b window nro - RR GG BB color
62
    mov  ebx,24*65536+20
63
    mov  edx,label2		     ; pointer to text beginning
64
    mcall
65
 
66
    mov  ebx,19*65536+54
67
    mov  edx,label3
68
    mcall
69
 
70
    mov  ebx,44*65536+31
71
    mov  edx,label5
72
    mcall
73
 
74
    mov  ebx,39*65536+65
75
    mov  edx,label6
76
    mcall
77
 
2676 leency 78
    mcall 12,2
1742 mario79 79
 
80
still:
81
 
82
    mov  eax,10 		; wait here for event
83
    mcall
84
 
85
    dec  eax
86
    jz   do_draw
87
    dec  eax
88
    jnz  button
89
  key:
90
    mov  al,2	; now eax=2 - get key code
91
    mcall
92
    mov  al,ah
93
     cmp  al,13
94
     jz   restart
95
     cmp  al,19
96
     jz   run_rdsave
97
     cmp  al,27
98
     jz   close_1
99
     cmp  al,180
100
     jz   restart_kernel
101
     cmp  al,181
102
     jz   power_off
103
     jmp  still
104
 
105
  button:
106
    mov  al,17	; now eax=17 - get pressed button id
107
    mcall
108
    xchg al,ah
109
    dec  eax
2676 leency 110
    jz   close_1
1742 mario79 111
    dec  eax
112
    jz   restart_kernel
113
    dec  eax
114
    jz   restart
115
    dec  eax
116
    jnz   run_rdsave
117
; we have only one button left, this is close button
118
;    dec  eax
119
;    jnz  still
2676 leency 120
power_off:
121
    push 2
122
    jmp  mcall_and_close
123
 
1742 mario79 124
close_1:
125
    or   eax,-1
126
    mcall
127
 
2676 leency 128
restart:
1742 mario79 129
    push 3
130
    jmp  mcall_and_close
131
 
132
  restart_kernel:
133
    push 4
134
mcall_and_close:
135
    pop  ecx
136
    mcall 18,9
137
    jmp  close_1
138
 
139
run_rdsave:
140
    mov eax,70
141
    mov ebx,rdsave
142
    mcall
143
    jmp still
144
 
145
data
146
 
147
if lang eq ru
148
  label2:
149
      db   'Выключить         Ядро',0
150
  label3:
151
      db   'Перезапуск       Отмена',0
152
  label4:
153
      db   'Сохранить настройки (Ctrl-S)',0
154
 
155
else if lang eq ge
156
  label2:
157
      db   '  Beenden         Kernel',0
158
  label3:
159
      db   '   Neustart      Abbrechen',0
160
  label4:
161
      db   'Save your settings (Ctrl-S)',0
162
 
3587 fedesco 163
else if lang eq it
164
  label2:
165
      db   '  Spegni         Kernel',0
166
  label3:
167
      db   '   Riavvio        Annulla',0
168
  label4:
169
      db   'Salva impostazioni (Ctrl-S)',0
170
 
1742 mario79 171
else
172
  label2:
173
      db   'Power off          Kernel',0
174
  label3:
175
      db   '   Restart          Cancel',0
176
  label4:
177
      db   'Save your settings (Ctrl-S)',0
178
 
179
end if
180
 
181
  label5:
182
      db   '(End)           (Home)',0
183
  label6:
184
      db   '(Enter)          (Esc)',0
185
 
186
rdsave:
187
        dd      7
188
        dd      0
189
        dd      0
190
        dd      0
191
        dd      0
192
        db      '/sys/rdsave',0
193
udata
194
meos_app_end