Subversion Repositories Kolibri OS

Rev

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

Rev 1743 Rev 2676
1
;
1
;
2
; END
2
; END
3
; KolibriOS Team 2005-2010
3
; KolibriOS Team 2005-2010
4
;
4
;
5
;  note that 'mov al,xx' is shorter than 'mov eax,xx'
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
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
7
;           the same about ebx,ecx,edx
8
 
8
 
9
include "lang.inc"
9
include "lang.inc"
10
include "..\..\..\macros.inc"
10
include "..\..\..\macros.inc"
11
 
11
 
12
meos_app_start
12
meos_app_start
13
code
13
code
14
 
14
 
15
do_draw:
15
do_draw:
16
 
-
 
17
    mov  al,12 		   ; eax=12 - tell os about redraw start
-
 
18
    mov  bl,1
16
 
19
    mcall
17
    mcall 12,1
20
 
18
 
21
    mov  al,14 		   ; eax=14 - get screen max x & max y
19
    mov  al,14 		   ; eax=14 - get screen max x & max y
22
    mcall
20
    mcall
23
 
21
 
24
    movzx ecx,ax
22
    movzx ecx,ax
25
 
23
 
26
    shr  eax,17
24
    shr  eax,17
27
    shl  eax,16
25
    shl  eax,16
28
    lea  ebx,[eax-110*10000h+220]
26
    lea  ebx,[eax-110*10000h+220]
29
 
27
 
30
    shr  ecx,1
28
    shr  ecx,1
31
    shl  ecx,16
29
    shl  ecx,16
32
    sub  ecx,50*10000h - 115
30
    sub  ecx,50*10000h - 115
33
 
31
 
34
    xor  eax,eax			   ; define and draw window
32
    xor  eax,eax			   ; define and draw window
35
    mov  edx,0x00cccccc
33
    mov  edx,0x00cccccc
36
    mov  esi,edx
34
    mov  esi,edx
37
    mov  edi,edx
35
    mov  edi,edx
38
    mcall
36
    mcall
39
 
37
 
40
   sub edx,0x555555
38
   sub edx,0x555555
41
   mov al,13
39
   mov al,13
42
   mcall ,19 shl 16+87,21 shl 16+24
40
   mcall ,19 shl 16+87,21 shl 16+24
43
   push ebx
41
   push ebx
44
   mcall ,122 shl 16+87
42
   mcall ,122 shl 16+87
45
   xchg ebx,[esp]
43
   xchg ebx,[esp]
46
   mcall ,,55 shl 16+24
44
   mcall ,,55 shl 16+24
47
   pop  ebx
45
   pop  ebx
48
   mcall
46
   mcall
49
 
-
 
50
   xor edx,edx
47
 
51
   mov al,8
-
 
52
   inc edx
48
   mov al,8
53
   mcall ,15 shl 16+87,17 shl 16+24,,0xaa0044
-
 
54
   inc edx
49
   mcall ,15 shl 16+87,17 shl 16+24,4,0xaa0044
55
   mcall ,118 shl 16+87,,,0xbb7700
-
 
56
   inc edx
50
   mcall ,118 shl 16+87,,2,0xbb7700
57
   mcall ,15 shl 16+87,51 shl 16+24,,0x8800
-
 
58
   inc edx
51
   mcall ,15 shl 16+87,51 shl 16+24,3,0x8800
59
   mcall ,118 shl 16+87,,,0x999999
52
   mcall ,118 shl 16+87,,1,0x999999
60
   mcall ,10 shl 16+200,88 shl 16+15,0x40000005
53
   mcall ,10 shl 16+200,88 shl 16+15,0x40000005
61
   mcall 38,27 shl 16 +193,102 shl 16 +102,0x000000dd
54
   mcall 38,27 shl 16 +193,102 shl 16 +102,0x000000dd
62
 
55
 
63
    mov  al,4			   ; 0x00000004 = write text
56
    mov  al,4			   ; 0x00000004 = write text
64
    mov  ebx,28*65536+93
57
    mov  ebx,28*65536+93
65
    mov  ecx,0x800000dd
58
    mov  ecx,0x800000dd
66
    mov  edx,label4
59
    mov  edx,label4
67
    mcall
60
    mcall
68
 
61
 
69
    mov  ecx,0x90eeeeee            ; 8b window nro - RR GG BB color
62
    mov  ecx,0x90eeeeee            ; 8b window nro - RR GG BB color
70
    mov  ebx,24*65536+20
63
    mov  ebx,24*65536+20
71
    mov  edx,label2		     ; pointer to text beginning
64
    mov  edx,label2		     ; pointer to text beginning
72
    mcall
65
    mcall
73
 
66
 
74
    mov  ebx,19*65536+54
67
    mov  ebx,19*65536+54
75
    mov  edx,label3
68
    mov  edx,label3
76
    mcall
69
    mcall
77
 
70
 
78
    mov  ebx,44*65536+31
71
    mov  ebx,44*65536+31
79
    mov  edx,label5
72
    mov  edx,label5
80
    mcall
73
    mcall
81
 
74
 
82
    mov  ebx,39*65536+65
75
    mov  ebx,39*65536+65
83
    mov  edx,label6
76
    mov  edx,label6
84
    mcall
77
    mcall
85
 
-
 
86
    mov  al,12 		   ;end of redraw 
-
 
87
    mov  ebx,2
78
 
88
    mcall
79
    mcall 12,2
89
 
80
 
90
still:
81
still:
91
 
82
 
92
    mov  eax,10 		; wait here for event
83
    mov  eax,10 		; wait here for event
93
    mcall
84
    mcall
94
 
85
 
95
    dec  eax
86
    dec  eax
96
    jz   do_draw
87
    jz   do_draw
97
    dec  eax
88
    dec  eax
98
    jnz  button
89
    jnz  button
99
  key:
90
  key:
100
    mov  al,2	; now eax=2 - get key code
91
    mov  al,2	; now eax=2 - get key code
101
    mcall
92
    mcall
102
    mov  al,ah
93
    mov  al,ah
103
     cmp  al,13
94
     cmp  al,13
104
     jz   restart
95
     jz   restart
105
     cmp  al,19
96
     cmp  al,19
106
     jz   run_rdsave
97
     jz   run_rdsave
107
     cmp  al,27
98
     cmp  al,27
108
     jz   close_1
99
     jz   close_1
109
     cmp  al,180
100
     cmp  al,180
110
     jz   restart_kernel
101
     jz   restart_kernel
111
     cmp  al,181
102
     cmp  al,181
112
     jz   power_off
103
     jz   power_off
113
     jmp  still
104
     jmp  still
114
 
105
 
115
  button:
106
  button:
116
    mov  al,17	; now eax=17 - get pressed button id
107
    mov  al,17	; now eax=17 - get pressed button id
117
    mcall
108
    mcall
118
    xchg al,ah
109
    xchg al,ah
119
    dec  eax
110
    dec  eax
120
    jz   power_off
111
    jz   close_1
121
    dec  eax
112
    dec  eax
122
    jz   restart_kernel
113
    jz   restart_kernel
123
    dec  eax
114
    dec  eax
124
    jz   restart
115
    jz   restart
125
    dec  eax
116
    dec  eax
126
    jnz   run_rdsave
117
    jnz   run_rdsave
127
; we have only one button left, this is close button
118
; we have only one button left, this is close button
128
;    dec  eax
119
;    dec  eax
129
;    jnz  still
120
;    jnz  still
130
close_1:
-
 
131
    or   eax,-1
-
 
132
    mcall
-
 
133
 
-
 
134
 power_off:
121
power_off:
135
    push 2
122
    push 2
136
    jmp  mcall_and_close
123
    jmp  mcall_and_close
-
 
124
 
-
 
125
close_1:
-
 
126
    or   eax,-1
-
 
127
    mcall
137
 
128
 
138
 restart:
129
restart:
139
    push 3
130
    push 3
140
    jmp  mcall_and_close
131
    jmp  mcall_and_close
141
 
132
 
142
  restart_kernel:
133
  restart_kernel:
143
    push 4
134
    push 4
144
mcall_and_close:
135
mcall_and_close:
145
    pop  ecx
136
    pop  ecx
146
    mcall 18,9
137
    mcall 18,9
147
    jmp  close_1
138
    jmp  close_1
148
 
139
 
149
run_rdsave:
140
run_rdsave:
150
    mov eax,70
141
    mov eax,70
151
    mov ebx,rdsave
142
    mov ebx,rdsave
152
    mcall
143
    mcall
153
    jmp still
144
    jmp still
154
 
145
 
155
data
146
data
156
 
147
 
157
if lang eq ru
148
if lang eq ru
158
  label2:
149
  label2:
159
      db   '‚몫îç¨âì         Ÿ¤à®',0
150
      db   '‚몫îç¨âì         Ÿ¤à®',0
160
  label3:
151
  label3:
161
      db   '¥à¥§ ¯ã᪠      Žâ¬¥­ ',0
152
      db   '¥à¥§ ¯ã᪠      Žâ¬¥­ ',0
162
  label4:
153
  label4:
163
      db   '‘®åà ­¨âì ­ áâனª¨ (Ctrl-S)',0
154
      db   '‘®åà ­¨âì ­ áâனª¨ (Ctrl-S)',0
164
 
155
 
165
else if lang eq ge
156
else if lang eq ge
166
  label2:
157
  label2:
167
      db   '  Beenden         Kernel',0
158
      db   '  Beenden         Kernel',0
168
  label3:
159
  label3:
169
      db   '   Neustart      Abbrechen',0
160
      db   '   Neustart      Abbrechen',0
170
  label4:
161
  label4:
171
      db   'Save your settings (Ctrl-S)',0
162
      db   'Save your settings (Ctrl-S)',0
172
 
163
 
173
else
164
else
174
  label2:
165
  label2:
175
      db   'Power off          Kernel',0
166
      db   'Power off          Kernel',0
176
  label3:
167
  label3:
177
      db   '   Restart          Cancel',0
168
      db   '   Restart          Cancel',0
178
  label4:
169
  label4:
179
      db   'Save your settings (Ctrl-S)',0
170
      db   'Save your settings (Ctrl-S)',0
180
 
171
 
181
end if
172
end if
182
 
173
 
183
  label5:
174
  label5:
184
      db   '(End)           (Home)',0
175
      db   '(End)           (Home)',0
185
  label6:
176
  label6:
186
      db   '(Enter)          (Esc)',0
177
      db   '(Enter)          (Esc)',0
187
 
178
 
188
rdsave:
179
rdsave:
189
        dd      7
180
        dd      7
190
        dd      0
181
        dd      0
191
        dd      0
182
        dd      0
192
        dd      0
183
        dd      0
193
        dd      0
184
        dd      0
194
        db      '/sys/rdsave',0
185
        db      '/sys/rdsave',0
195
udata
186
udata
196
meos_app_end
187
meos_app_end