2011-01-18 15:29:19 +01:00
|
|
|
;
|
|
|
|
; END
|
2013-04-03 15:24:07 +02:00
|
|
|
; KolibriOS Team 2005-2013
|
2011-01-18 15:29:19 +01:00
|
|
|
;
|
|
|
|
include "lang.inc"
|
|
|
|
include "..\..\..\macros.inc"
|
|
|
|
|
|
|
|
meos_app_start
|
|
|
|
code
|
2013-10-17 16:31:03 +02:00
|
|
|
draw_window:
|
2012-05-25 11:21:47 +02:00
|
|
|
mcall 12,1
|
2011-01-18 15:29:19 +01:00
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
mcall 14 ;eax=14 - get screen max x & max y
|
2011-01-18 15:29:19 +01:00
|
|
|
movzx ecx,ax
|
|
|
|
shr eax,17
|
|
|
|
shl eax,16
|
2013-10-17 16:31:03 +02:00
|
|
|
lea ebx,[eax-110 shl 16+222]
|
2011-01-18 15:29:19 +01:00
|
|
|
shr ecx,1
|
|
|
|
shl ecx,16
|
2013-10-17 16:31:03 +02:00
|
|
|
lea ecx,[ecx-70 shl 16+137]
|
2011-01-18 15:29:19 +01:00
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
mcall 0, , ,0x01ffffff ;define and draw window
|
2011-01-18 15:29:19 +01:00
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
mcall 13, 223 , 138 ,0x9098b0
|
|
|
|
mcall ,<1,221>,<1,136>,0xffffff
|
|
|
|
mcall ,<2,220>,<2,135>,0xe4dfe1
|
|
|
|
mcall ,<16,189>,<97,23>,0x9098b0
|
|
|
|
|
|
|
|
mcall 8,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons
|
|
|
|
mcall ,<113,90>, ,2,0xaa7700
|
|
|
|
mcall , ,<54,27>,1,0x777777
|
|
|
|
mcall ,<16,90> , ,3,0x007700
|
|
|
|
mcall ,<17,186>,<98,20>,5,0xe4dfe1
|
2011-01-18 15:29:19 +01:00
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
mcall 4,<28,105>,0x80000000,label4 ;eax=4 - write text
|
|
|
|
mcall ,<35,24> ,0x80ffffff,label2
|
|
|
|
mcall ,<34,58> , ,label3
|
|
|
|
mcall ,<47,37> , ,label5
|
|
|
|
mcall ,<43,71> , ,label6
|
|
|
|
|
|
|
|
mcall 12,2
|
2011-01-18 15:29:19 +01:00
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
still:
|
|
|
|
mcall 10 ;wait here for event
|
2011-01-18 15:29:19 +01:00
|
|
|
dec eax
|
2013-10-17 16:31:03 +02:00
|
|
|
jz draw_window
|
2011-01-18 15:29:19 +01:00
|
|
|
dec eax
|
|
|
|
jnz button
|
2013-10-17 16:31:03 +02:00
|
|
|
|
|
|
|
mcall 2 ;eax=2 - get key code
|
2011-01-18 15:29:19 +01:00
|
|
|
mov al,ah
|
|
|
|
cmp al,13
|
|
|
|
jz restart
|
|
|
|
cmp al,19
|
|
|
|
jz run_rdsave
|
|
|
|
cmp al,27
|
|
|
|
jz close_1
|
|
|
|
cmp al,180
|
|
|
|
jz restart_kernel
|
|
|
|
cmp al,181
|
|
|
|
jz power_off
|
|
|
|
jmp still
|
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
button:
|
|
|
|
mcall 17 ;eax=17 - get pressed button id
|
2011-01-18 15:29:19 +01:00
|
|
|
xchg al,ah
|
|
|
|
dec eax
|
2012-05-25 11:21:47 +02:00
|
|
|
jz close_1
|
2011-01-18 15:29:19 +01:00
|
|
|
dec eax
|
|
|
|
jz restart_kernel
|
|
|
|
dec eax
|
|
|
|
jz restart
|
|
|
|
dec eax
|
|
|
|
jnz run_rdsave
|
2013-10-17 16:31:03 +02:00
|
|
|
|
2012-05-25 11:21:47 +02:00
|
|
|
power_off:
|
|
|
|
push 2
|
|
|
|
jmp mcall_and_close
|
|
|
|
restart:
|
2011-01-18 15:29:19 +01:00
|
|
|
push 3
|
|
|
|
jmp mcall_and_close
|
2013-10-17 16:31:03 +02:00
|
|
|
restart_kernel:
|
2011-01-18 15:29:19 +01:00
|
|
|
push 4
|
|
|
|
mcall_and_close:
|
|
|
|
pop ecx
|
|
|
|
mcall 18,9
|
2013-10-17 16:31:03 +02:00
|
|
|
|
|
|
|
close_1:
|
|
|
|
mcall -1
|
2011-01-18 15:29:19 +01:00
|
|
|
|
|
|
|
run_rdsave:
|
2013-10-17 16:31:03 +02:00
|
|
|
mcall 70,rdsave
|
2011-01-18 15:29:19 +01:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
data
|
2013-10-17 16:31:03 +02:00
|
|
|
include 'data.inc'
|
2011-01-18 15:29:19 +01:00
|
|
|
|
|
|
|
udata
|
2013-10-17 16:31:03 +02:00
|
|
|
|
|
|
|
meos_app_end
|