Subversion Repositories Kolibri OS

Rev

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

Rev 6190 Rev 6215
1
; END
1
; END
2
; KolibriOS Team 2005-2015
2
; KolibriOS Team 2005-2015
3
 
3
 
4
fade equ 0
4
fade equ 0
5
 
5
 
6
use32	     ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
6
use32	     ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
7
org 0x0      ;  ¤à¥á æ¨ï á ­ã«ï
7
org 0x0      ;  ¤à¥á æ¨ï á ­ã«ï
8
 
8
 
9
db 'MENUET01'	 ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
9
db 'MENUET01'	 ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
10
dd 0x01 	 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
10
dd 0x01 	 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
11
dd START	 ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
11
dd START	 ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
12
dd IM_END	 ; à §¬¥à ¯à®£à ¬¬ë
12
dd IM_END	 ; à §¬¥à ¯à®£à ¬¬ë
13
dd I_END	 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
13
dd I_END	 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
14
dd stacktop	 ;  ¤à¥á ¢¥à設ë á⥪ 
14
dd stacktop	 ;  ¤à¥á ¢¥à設ë á⥪ 
15
dd 0x0		 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
15
dd 0x0		 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
16
dd cur_dir_path
16
dd cur_dir_path
17
 
17
 
18
include 'lang.inc'
18
include 'lang.inc'
19
include '../../../macros.inc'
19
include '../../../macros.inc'
20
include '../../../proc32.inc'
20
include '../../../proc32.inc'
21
include '../../../dll.inc'
21
include '../../../dll.inc'
22
include '../../../develop/libraries/box_lib/load_lib.mac'
22
include '../../../develop/libraries/box_lib/load_lib.mac'
23
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
23
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
24
 
24
include '../../../gui_patterns.inc'
-
 
25
 
25
@use_library
26
@use_library
26
 
27
 
27
macro DrawBar  x, y, width, height, color 
-
 
28
{
-
 
29
	mcall 13, (x) shl 16 + (width), (y) shl 16 + (height), color
-
 
30
}
-
 
31
 
-
 
32
macro DrawRectangle  x, y, w, h, color 
-
 
33
{
-
 
34
	DrawBar x,y,w,1,color
-
 
35
	DrawBar x,y+h,w,1
-
 
36
	DrawBar x,y,1,h
-
 
37
	DrawBar x+w,y,1,h+1
-
 
38
}
-
 
39
 
-
 
40
	
28
	
41
align 4
29
align 4
42
START:
30
START:
43
 
31
 
44
 
32
 
45
load_libraries l_libs_start,end_l_libs
33
load_libraries l_libs_start,end_l_libs
46
	inc	eax
34
	inc	eax
47
	test	eax,eax
35
	test	eax,eax
48
	jz	close
36
	jz	close
49
 
37
 
50
push	dword check1
38
push	dword check1
51
call	[init_checkbox2]
39
call	[init_checkbox2]
52
 
40
 
53
stdcall dll.Init,[init_lib]
41
stdcall dll.Init,[init_lib]
54
 
42
 
55
invoke	ini_get_int,ini_file,asettings,aautosave,0
43
invoke	ini_get_int,ini_file,asettings,aautosave,0
56
	mov   [autosave],eax
44
	mov   [autosave],eax
57
	dec   eax
45
	dec   eax
58
	jnz   @f
46
	jnz   @f
59
	bts   dword [check1.flags],1
47
	bts   dword [check1.flags],1
60
@@:
48
@@:
61
	mcall	40,0x80000027
49
	mcall	40,0x80000027
62
redraw:
50
redraw:
63
    call draw_window
51
    call draw_window
64
still:
52
still:
65
    mov  al,10
53
    mov  al,10
66
    mcall				     ;wait here for event
54
    mcall				     ;wait here for event
67
    dec  eax
55
    dec  eax
68
    jz	 redraw
56
    jz	 redraw
69
    dec  eax
57
    dec  eax
70
    jz	 key
58
    jz	 key
71
    dec  eax
59
    dec  eax
72
    jz	 button
60
    jz	 button
73
 
61
 
74
    push dword check1
62
    push dword check1
75
    call [check_box_mouse2]
63
    call [check_box_mouse2]
76
    bt	 dword [check1.flags],1
64
    bt	 dword [check1.flags],1
77
    jnc  @f
65
    jnc  @f
78
    mov  [autosave],1
66
    mov  [autosave],1
79
    jmp  still
67
    jmp  still
80
@@:
68
@@:
81
    mov  [autosave],0
69
    mov  [autosave],0
82
    jmp  still
70
    jmp  still
83
 
71
 
84
key:
72
key:
85
    mov  al,2
73
    mov  al,2
86
    mcall				     ;eax=2 - get key code
74
    mcall				     ;eax=2 - get key code
87
    mov  al,ah
75
    mov  al,ah
88
     cmp  al,13
76
     cmp  al,13
89
     je   restart
77
     je   restart
90
     cmp  al,19
78
     cmp  al,19
91
     je   checkbox
79
     je   checkbox
92
     cmp  al,180
80
     cmp  al,180
93
     je   restart_kernel
81
     je   restart_kernel
94
     cmp  al,181
82
     cmp  al,181
95
     je   power_off
83
     je   power_off
96
     cmp  al,27
84
     cmp  al,27
97
     jne   still
85
     jne   still
98
 
86
 
99
close:
87
close:
100
    mcall -1
88
    mcall -1
101
 
89
 
102
button:
90
button:
103
    mcall 17				     ;eax=17 - get pressed button id
91
    mcall 17				     ;eax=17 - get pressed button id
104
    xchg al,ah
92
    xchg al,ah
105
    dec  eax
93
    dec  eax
106
    jz	 close
94
    jz	 close
107
    dec  eax
95
    dec  eax
108
    jz	 restart_kernel
96
    jz	 restart_kernel
109
    dec  eax
97
    dec  eax
110
    jz	 restart
98
    jz	 restart
111
    dec  eax
99
    dec  eax
112
    jnz  checkbox
100
    jnz  checkbox
113
 
101
 
114
power_off:
102
power_off:
115
    push 2
103
    push 2
116
    jmp  mcall_and_close
104
    jmp  mcall_and_close
117
 
105
 
118
restart:
106
restart:
119
    push 3
107
    push 3
120
    jmp  mcall_and_close
108
    jmp  mcall_and_close
121
 
109
 
122
restart_kernel:
110
restart_kernel:
123
    push 4
111
    push 4
124
 
112
 
125
mcall_and_close:
113
mcall_and_close:
126
if fade=1
114
if fade=1
127
 ; === FADE IN ===
115
 ; === FADE IN ===
128
    mov eax, color1
116
    mov eax, color1
129
  @@:
117
  @@:
130
    mov ebx, [eax + 32]
118
    mov ebx, [eax + 32]
131
    mov [eax], ebx
119
    mov [eax], ebx
132
    add eax, 4
120
    add eax, 4
133
    cmp eax, color21
121
    cmp eax, color21
134
    jne @b
122
    jne @b
135
 
123
 
136
    call    draw_window
124
    call    draw_window
137
end if
125
end if
138
 
126
 
139
    invoke  ini_set_int,ini_file,asettings,aautosave,[autosave]
127
    invoke  ini_set_int,ini_file,asettings,aautosave,[autosave]
140
    cmp  [autosave],1
128
    cmp  [autosave],1
141
    jne   no_save
129
    jne   no_save
142
 
130
 
143
if fade=0
131
if fade=0
144
    mov   al,4
132
    mov   al,4
145
    mcall   ,<50,120> ,0x800000cc,label7	;eax=4 - write text
133
    mcall   ,<50,120> ,0x800000cc,label7	;eax=4 - write text
146
end if
134
end if
147
 
135
 
148
    mcall 70,rdsave
136
    mcall 70,rdsave
149
    test  eax,eax
137
    test  eax,eax
150
    js	  no_save
138
    js	  no_save
151
    mov   ecx,eax
139
    mov   ecx,eax
152
    mcall 18,21
140
    mcall 18,21
153
    mov   ecx,eax
141
    mov   ecx,eax
154
@@:
142
@@:
155
    push ecx
143
    push ecx
156
    mcall 23,100
144
    mcall 23,100
157
    dec   eax
145
    dec   eax
158
    jnz   no_red
146
    jnz   no_red
159
    call draw_window
147
    call draw_window
160
no_red:
148
no_red:
161
    pop   ecx
149
    pop   ecx
162
    mcall 9,proc_info
150
    mcall 9,proc_info
163
    cmp   [proc_info+50],9
151
    cmp   [proc_info+50],9
164
    je	  no_save
152
    je	  no_save
165
    jmp   @b
153
    jmp   @b
166
no_save:
154
no_save:
167
    pop  ecx
155
    pop  ecx
168
  mcall 18,9
156
  mcall 18,9
169
ret
157
ret
170
 
158
 
171
checkbox:
159
checkbox:
172
    btc   dword [check1.flags],1
160
    btc   dword [check1.flags],1
173
    jc	  .1
161
    jc	  .1
174
    mov   [autosave],1
162
    mov   [autosave],1
175
    jmp   .draw
163
    jmp   .draw
176
.1:
164
.1:
177
    mov   [autosave],0
165
    mov   [autosave],0
178
.draw:
166
.draw:
179
    push  dword check1
167
    push  dword check1
180
    call  [check_box_draw2]
168
    call  [check_box_draw2]
181
    jmp    still
169
    jmp    still
182
 
170
 
183
draw_window:
171
draw_window:
184
    mcall 12,1
172
    mcall 12,1
185
 
173
 
186
    mov   al,14
174
    mov   al,14
187
    mcall				     ;eax=14 - get screen max x & max y
175
    mcall				     ;eax=14 - get screen max x & max y
188
    movzx ecx,ax
176
    movzx ecx,ax
189
    shr   eax,17
177
    shr   eax,17
190
    shl   eax,16
178
    shl   eax,16
191
    lea   ebx,[eax-165 shl 16+332]
179
    lea   ebx,[eax-165 shl 16+332]
192
    shr   ecx,1
180
    shr   ecx,1
193
    shl   ecx,16
181
    shl   ecx,16
194
    lea   ecx,[ecx-70 shl 16+132]
182
    lea   ecx,[ecx-70 shl 16+132]
195
 
183
 
196
    xor   eax,eax
184
    xor   eax,eax
197
	mov edx, 0x01000000
185
	mov edx, 0x01000000
198
	mcall ;define and draw window  
186
	mcall ;define and draw window  
199
 
187
 
200
	DrawRectangle 0,0,332,132,[color1]
188
	DrawRectangle 0,0,332,132,[color1]
201
    mov   al,13
189
    mov   al,13
202
    mcall   ,<1,331>,<1,1>,[color2]
190
    mcall   ,<1,331>,<1,1>,[color2]
203
	mcall   ,<1,1>,<1,131>
191
	mcall   ,<1,1>,<1,131>
204
    mcall   ,<2,330>,<2,130>, [color3]
192
    mcall   ,<2,330>,<2,130>, [color3]
205
 
193
 
206
    mov   al,8
194
    mov   al,8
207
    mcall   ,<16,144> ,<16,36>,4,[color4]     ;eax=8 - draw buttons
195
    mcall   ,<16,144> ,<16,36>,4,[color4]     ;eax=8 - draw buttons
208
    mcall   ,<170,144>,       ,2,[color5]
196
    mcall   ,<170,144>,       ,2,[color5]
209
    mcall   ,	      ,<62,36>,1,[color6]
197
    mcall   ,	      ,<62,36>,1,[color6]
210
    mcall   ,<16,144> ,       ,3,[color7]
198
    mcall   ,<16,144> ,       ,3,[color7]
211
 
199
 
212
    mov   al,4
200
    mov   al,4
213
    mcall   ,<28,19> ,[color8],label2	     ;eax=4 - write text
201
    mcall   ,<28,19> ,[color8],label2	     ;eax=4 - write text
214
    mcall   ,<28,65> ,	      ,label3
202
    mcall   ,<28,65> ,	      ,label3
215
    mcall   ,<64,40> ,[color9],label5
203
    mcall   ,<64,40> ,[color9],label5
216
    mcall   ,<64,86> ,	     ,label6
204
    mcall   ,<64,86> ,	     ,label6
217
 
205
 
218
    push  dword check1
206
    push  dword check1
219
    call  [check_box_draw2]
207
    call  [check_box_draw2]
220
 
208
 
221
    mov   al,12
209
    mov   al,12
222
    mcall   ,2
210
    mcall   ,2
223
    ret
211
    ret
224
;---------------------------------------------------------------------
212
;---------------------------------------------------------------------
225
;data
213
;data
226
include 'data.inc'
214
include 'data.inc'
227
;---------------------------------------------------------------------
215
;---------------------------------------------------------------------
228
IM_END:
216
IM_END:
229
;---------------------------------------------------------------------
217
;---------------------------------------------------------------------
230
align 4
218
align 4
231
 
219
 
232
proc_info  rb 1024
220
proc_info  rb 1024
233
 
221
 
234
autosave rd 1
222
autosave rd 1
235
;---------------------------------------------------------------------
223
;---------------------------------------------------------------------
236
cur_dir_path:
224
cur_dir_path:
237
	rb 4096
225
	rb 4096
238
;---------------------------------------------------------------------
226
;---------------------------------------------------------------------
239
library_path:
227
library_path:
240
	rb 4096
228
	rb 4096
241
;---------------------------------------------------------------------
229
;---------------------------------------------------------------------
242
align 32
230
align 32
243
	rb 4096
231
	rb 4096
244
stacktop:
232
stacktop:
245
I_END:	; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
233
I_END:	; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë