Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
5665 Pathoswith 1
 
1742 mario79 2
; KolibriOS Team 2005-2015
5665 Pathoswith 3
4
 
4266 heavyiron 5
1742 mario79 6
 
5665 Pathoswith 7
org 0x0      ; адресация с нуля
4266 heavyiron 8
1742 mario79 9
 
5665 Pathoswith 10
dd 0x01 	 ; версия заголовка (всегда 1)
11
dd START	 ; адрес первой команды
12
dd IM_END	 ; размер программы
13
dd I_END	 ; количество памяти
14
dd stacktop	 ; адрес вершины стека
15
dd 0x0		 ; адрес буфера для параметров
16
dd cur_dir_path
4213 heavyiron 17
1742 mario79 18
 
4213 heavyiron 19
include '../../../macros.inc'
20
include '../../../proc32.inc'
21
include '../../../dll.inc'
22
include '../../../develop/libraries/box_lib/load_lib.mac'
23
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
24
include '../../../gui_patterns.inc'
6215 leency 25
1742 mario79 26
 
6190 leency 27
1742 mario79 28
 
6190 leency 29
 
4213 heavyiron 30
START:
31
1742 mario79 32
 
6190 leency 33
 
4213 heavyiron 34
	inc	eax
5665 Pathoswith 35
	test	eax,eax
36
	jz	close
37
1742 mario79 38
 
5665 Pathoswith 39
call	[init_checkbox2]
40
1742 mario79 41
 
4213 heavyiron 42
43
 
5665 Pathoswith 44
	mov   [autosave],eax
45
	dec   eax
46
	jnz   @f
47
	bts   dword [check1.flags],1
48
@@:
4213 heavyiron 49
	mcall	40,0x80000027
5665 Pathoswith 50
redraw:
4213 heavyiron 51
    call draw_window
52
still:
1742 mario79 53
    mov  al,10
4051 heavyiron 54
    mcall				     ;wait here for event
5665 Pathoswith 55
    dec  eax
1742 mario79 56
    jz	 redraw
5665 Pathoswith 57
    dec  eax
1742 mario79 58
    jz	 key
5665 Pathoswith 59
    dec  eax
4213 heavyiron 60
    jz	 button
5665 Pathoswith 61
4044 heavyiron 62
 
4213 heavyiron 63
    call [check_box_mouse2]
64
    bt	 dword [check1.flags],1
5665 Pathoswith 65
    jnc  @f
4213 heavyiron 66
    mov  [autosave],1
67
    jmp  still
68
@@:
69
    mov  [autosave],0
70
    jmp  still
71
4266 heavyiron 72
 
4213 heavyiron 73
    mov  al,2
4051 heavyiron 74
    mcall				     ;eax=2 - get key code
5665 Pathoswith 75
    mov  al,ah
1742 mario79 76
     cmp  al,13
77
     je   restart
4215 heavyiron 78
     cmp  al,19
1742 mario79 79
     je   checkbox
4215 heavyiron 80
     cmp  al,180
1742 mario79 81
     je   restart_kernel
4215 heavyiron 82
     cmp  al,181
1742 mario79 83
     je   power_off
4215 heavyiron 84
     cmp  al,27
85
     jne   still
86
1742 mario79 87
 
4215 heavyiron 88
    mcall -1
89
90
 
4044 heavyiron 91
    mcall 17				     ;eax=17 - get pressed button id
5665 Pathoswith 92
    xchg al,ah
1742 mario79 93
    dec  eax
94
    jz	 close
5665 Pathoswith 95
    dec  eax
1742 mario79 96
    jz	 restart_kernel
5665 Pathoswith 97
    dec  eax
1742 mario79 98
    jz	 restart
5665 Pathoswith 99
    dec  eax
1742 mario79 100
    jnz  checkbox
4213 heavyiron 101
4044 heavyiron 102
 
2676 leency 103
    push 2
104
    jmp  mcall_and_close
105
4213 heavyiron 106
 
2676 leency 107
    push 3
1742 mario79 108
    jmp  mcall_and_close
109
4213 heavyiron 110
 
4044 heavyiron 111
    push 4
1742 mario79 112
4213 heavyiron 113
 
1742 mario79 114
if fade=1
4266 heavyiron 115
 ; === FADE IN ===
116
    mov eax, color1
117
  @@:
118
    mov ebx, [eax + 32]
119
    mov [eax], ebx
120
    add eax, 4
121
    cmp eax, color21
122
    jne @b
123
124
 
125
end if
126
127
 
4213 heavyiron 128
    cmp  [autosave],1
129
    jne   no_save
130
4284 heavyiron 131
 
132
    mov   al,4
133
    mcall   ,<50,120> ,0x800000cc,label7	;eax=4 - write text
5665 Pathoswith 134
end if
4284 heavyiron 135
136
 
4213 heavyiron 137
    test  eax,eax
138
    js	  no_save
5665 Pathoswith 139
    mov   ecx,eax
4213 heavyiron 140
    mcall 18,21
141
    mov   ecx,eax
142
@@:
143
    push ecx
144
    mcall 23,100
4215 heavyiron 145
    dec   eax
4213 heavyiron 146
    jnz   no_red
147
    call draw_window
148
no_red:
4266 heavyiron 149
    pop   ecx
4213 heavyiron 150
    mcall 9,proc_info
151
    cmp   [proc_info+50],9
152
    je	  no_save
5665 Pathoswith 153
    jmp   @b
4213 heavyiron 154
no_save:
155
    pop  ecx
1742 mario79 156
  mcall 18,9
4266 heavyiron 157
ret
4268 heavyiron 158
1742 mario79 159
 
4213 heavyiron 160
    btc   dword [check1.flags],1
161
    jc	  .1
5665 Pathoswith 162
    mov   [autosave],1
4213 heavyiron 163
    jmp   .draw
164
.1:
165
    mov   [autosave],0
166
.draw:
167
    push  dword check1
168
    call  [check_box_draw2]
169
    jmp    still
170
4266 heavyiron 171
 
4213 heavyiron 172
    mcall 12,1
6190 leency 173
1742 mario79 174
 
4215 heavyiron 175
    mcall				     ;eax=14 - get screen max x & max y
5665 Pathoswith 176
    movzx ecx,ax
4213 heavyiron 177
    shr   eax,17
4215 heavyiron 178
    shl   eax,16
179
    lea   ebx,[eax-165 shl 16+332]
5665 Pathoswith 180
    shr   ecx,1
4215 heavyiron 181
    shl   ecx,16
182
    lea   ecx,[ecx-70 shl 16+132]
5665 Pathoswith 183
4213 heavyiron 184
 
4215 heavyiron 185
	mov edx, 0x01000000
6190 leency 186
	mcall ;define and draw window
187
4213 heavyiron 188
 
6190 leency 189
    mov   al,13
4213 heavyiron 190
    mcall   ,<1,331>,<1,1>,[color2]
6190 leency 191
	mcall   ,<1,1>,<1,131>
192
    mcall   ,<2,330>,<2,130>, [color3]
5665 Pathoswith 193
4213 heavyiron 194
 
4215 heavyiron 195
    mcall   ,<16,144> ,<16,36>,4,[color4]     ;eax=8 - draw buttons
5665 Pathoswith 196
    mcall   ,<170,144>,       ,2,[color5]
197
    mcall   ,	      ,<62,36>,1,[color6]
198
    mcall   ,<16,144> ,       ,3,[color7]
199
4213 heavyiron 200
 
4215 heavyiron 201
    mcall   ,<28,19> ,[color8],label2	     ;eax=4 - write text
5665 Pathoswith 202
    mcall   ,<28,65> ,	      ,label3
203
    mcall   ,<64,40> ,[color9],label5
204
    mcall   ,<64,86> ,	     ,label6
205
4215 heavyiron 206
 
4213 heavyiron 207
    call  [check_box_draw2]
208
209
 
210
    mcall   ,2
211
    ret
212
;---------------------------------------------------------------------
4215 heavyiron 213
;data
214
include 'data.inc'
4044 heavyiron 215
;---------------------------------------------------------------------
4213 heavyiron 216
IM_END:
217
;---------------------------------------------------------------------
218
align 4
219
1742 mario79 220
 
4213 heavyiron 221
222
 
223
;---------------------------------------------------------------------
224
cur_dir_path:
225
	rb 4096
5665 Pathoswith 226
;---------------------------------------------------------------------
4213 heavyiron 227
library_path:
228
	rb 4096
5665 Pathoswith 229
;---------------------------------------------------------------------
4213 heavyiron 230
align 32
231
	rb 4096
5665 Pathoswith 232
stacktop:
4213 heavyiron 233
I_END:	; метка конца программы
5665 Pathoswith 234