Subversion Repositories Kolibri OS

Rev

Rev 318 | Rev 485 | 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
32
    shl  eax,16
47 halyavin 33
    lea  ebx,[eax-110*10000h+220]
31 halyavin 34
 
35
    shr  ecx,1
36
    shl  ecx,16
341 heavyiron 37
    sub  ecx,50*10000h - 120
31 halyavin 38
 
341 heavyiron 39
    xor  eax,eax			   ; define and draw window
195 heavyiron 40
    mov  edx,[sc.work]
41
    mov  esi,edx
42
    mov  edi,edx
31 halyavin 43
    int  0x40
44
 
195 heavyiron 45
   mov edx,0x444444
47 halyavin 46
   mov al,13
195 heavyiron 47
   mcall ,18 shl 16+90,29 shl 16+27
47 halyavin 48
   push ebx
341 heavyiron 49
   mcall ,121 shl 16+90
47 halyavin 50
   xchg ebx,[esp]
195 heavyiron 51
   mcall ,,63 shl 16+27
47 halyavin 52
   pop  ebx
53
   mcall
341 heavyiron 54
   mcall ,179 shl 16+30,99 shl 16+15
31 halyavin 55
 
195 heavyiron 56
   xor edx,edx
47 halyavin 57
   mov al,8
58
   inc edx
195 heavyiron 59
   mcall ,15 shl 16+87,26 shl 16+24,,0xbb0055
47 halyavin 60
   inc edx
195 heavyiron 61
   mcall ,118 shl 16+87,,,0xaaaa   ;cccc
47 halyavin 62
   inc edx
195 heavyiron 63
   mcall ,15 shl 16+87,60 shl 16+24,,0x9900
47 halyavin 64
   inc edx
195 heavyiron 65
   mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc
341 heavyiron 66
   inc edx
67
   mcall ,175 shl 16+30,95 shl 16+15,,[sc.work_button]
31 halyavin 68
 
47 halyavin 69
    mov  al,4			   ; 0x00000004 = write text
31 halyavin 70
    mov  ebx,75*65536+10
195 heavyiron 71
    mov  ecx,[sc.work_text] ; 8b window nro - RR GG BB color
341 heavyiron 72
    or   ecx,0x90000000
31 halyavin 73
    mov  edx,label1		   ; pointer to text beginning
74
    int  0x40
75
 
341 heavyiron 76
    mov  ebx,15*65536+101
77
    mov  edx,label4
78
    int  0x40
79
 
80
    mov  ecx,0x90eeeeee            ; 8b window nro - RR GG BB color
31 halyavin 81
    mov  ebx,25*65536+30
341 heavyiron 82
    mov  edx,label2		     ; pointer to text beginning
31 halyavin 83
    int  0x40
84
 
85
    mov  ebx,20*65536+64
341 heavyiron 86
    mov  edx,label3
31 halyavin 87
    int  0x40
88
 
89
    mov  ebx,45*65536+41
341 heavyiron 90
    mov  edx,label5
31 halyavin 91
    int  0x40
92
 
93
    mov  ebx,40*65536+75
341 heavyiron 94
    mov  edx,label6
31 halyavin 95
    int  0x40
96
 
341 heavyiron 97
    mov  al,12 		   ;end of redraw
31 halyavin 98
    mov  ebx,2
99
    int  0x40
100
 
47 halyavin 101
still:
31 halyavin 102
 
47 halyavin 103
    mov  eax,10 		; wait here for event
104
    int  0x40
31 halyavin 105
 
47 halyavin 106
    dec  eax
107
    jz   do_draw
108
    dec  eax
109
    jnz  button
110
  key:
111
    mov  al,2	; now eax=2 - get key code
112
    int  40h
113
    mov  al,ah
114
     cmp  al,13
115
     jz   restart
116
     cmp  al,27
117
     jz   close_1
118
     cmp  al,180
119
     jz   restart_kernel
120
     cmp  al,181
121
     jz   power_off
122
     jmp  still
31 halyavin 123
 
47 halyavin 124
  button:
125
    mov  al,17	; now eax=17 - get pressed button id
126
    int  0x40
127
    xchg al,ah
128
    dec  eax
129
    jz   power_off
130
    dec  eax
131
    jz   restart_kernel
132
    dec  eax
133
    jz   restart
341 heavyiron 134
    dec  eax
135
    jnz   run_rdsave
47 halyavin 136
; we have only one button left, this is close button
137
;    dec  eax
138
;    jnz  still
139
close_1:
140
    or   eax,-1
141
    int  40h
31 halyavin 142
 
47 halyavin 143
 power_off:
144
    push 2
145
    jmp  mcall_and_close
146
 
147
 restart:
148
    push 3
149
    jmp  mcall_and_close
150
 
151
  restart_kernel:
152
    push 4
153
mcall_and_close:
154
    pop  ecx
155
    mcall 18,9
156
    jmp  close_1
157
 
341 heavyiron 158
run_rdsave:
159
    mov eax,70
160
    mov ebx,rdsave
161
    int 0x40
162
    jmp still
163
 
31 halyavin 164
data
165
 
166
if lang eq ru
167
  label1:
341 heavyiron 168
      db   'Ваш выбор:',0
31 halyavin 169
  label2:
341 heavyiron 170
      db   'Выключить         Ядро',0
31 halyavin 171
  label3:
341 heavyiron 172
      db   'Перезапуск       Отмена',0
173
  label4:
174
      db   'Сохранить настройки',0
31 halyavin 175
 
135 diamond 176
else if lang eq en
31 halyavin 177
  label1:
341 heavyiron 178
      db   ' SELECT:',0
31 halyavin 179
  label2:
341 heavyiron 180
      db   'POWER OFF        KERNEL',0
31 halyavin 181
  label3:
341 heavyiron 182
      db   '  RESTART         CANCEL',0
183
  label4:
184
      db   'Save settings',0
31 halyavin 185
 
274 kaitz 186
else if lang eq et
187
  label1:
341 heavyiron 188
      db   '  VALI:',0
274 kaitz 189
  label2:
341 heavyiron 190
      db   'L▄LITA V─LJA     KERNEL',0
274 kaitz 191
  label3:
341 heavyiron 192
      db   '  RESTART         T▄HISTA',0
193
  label4:
194
      db   'Save settings',0
274 kaitz 195
 
135 diamond 196
else
197
  label1:
341 heavyiron 198
      db   'WAEHLEN:',0
135 diamond 199
  label2:
341 heavyiron 200
      db   ' BEENDEN         KERNEL',0
135 diamond 201
  label3:
341 heavyiron 202
      db   '  NEUSTART     ABBRECHEN',0
203
  label4:
204
      db   'Save settings',0
135 diamond 205
 
206
end if
31 halyavin 207
  label5:
341 heavyiron 208
      db   '(End)           (Home)',0
209
  label6:
210
      db   '(Enter)          (Esc)',0
31 halyavin 211
 
341 heavyiron 212
rdsave:
213
        dd      7
214
        dd      0
215
        dd      0
216
        dd      0
217
        dd      0
218
        db      '/rd/1/rdsave',0
31 halyavin 219
udata
220
  sc  system_colors
221
 
222
meos_app_end