2006-01-03 12:43:31 +03:00
|
|
|
;
|
|
|
|
; END
|
|
|
|
;
|
2006-02-16 09:44:47 +03:00
|
|
|
; <diamond> note that 'mov al,xx' is shorter than 'mov eax,xx'
|
|
|
|
; and if we know that high 24 bits of eax are zero, we can use 1st form
|
|
|
|
; the same about ebx,ecx,edx
|
2008-02-19 08:28:11 +03:00
|
|
|
;
|
|
|
|
; 15.02.2007 merge old END with new one (fron Veliant & Leency) by Heavyiron
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
include "..\..\..\macros.inc"
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
meos_app_start
|
|
|
|
code
|
|
|
|
|
2008-02-19 08:28:11 +03:00
|
|
|
draw:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2006-02-16 09:44:47 +03:00
|
|
|
mov al,12 ; eax=12 - tell os about redraw start
|
2008-02-19 08:28:11 +03:00
|
|
|
mov ebx,1
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2006-02-16 09:44:47 +03:00
|
|
|
mov al,14 ; eax=14 - get screen max x & max y
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2008-02-19 08:28:11 +03:00
|
|
|
movzx ecx, ax
|
|
|
|
shr eax, 16
|
|
|
|
shr ecx, 1
|
|
|
|
shr eax, 1
|
|
|
|
sub eax, 157
|
|
|
|
sub ecx, 100
|
|
|
|
mov ebx, eax
|
|
|
|
shl ebx, 16
|
|
|
|
add ebx, 253
|
|
|
|
shl ecx, 16
|
|
|
|
add ecx, 154
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2007-02-12 08:14:58 +03:00
|
|
|
xor eax,eax ; define and draw window
|
2008-02-19 08:28:11 +03:00
|
|
|
mov edx,0x41ffffff
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2008-02-19 08:28:11 +03:00
|
|
|
mov al, 7
|
|
|
|
mov ebx, background
|
|
|
|
mov ecx, 254 shl 16 + 155
|
|
|
|
xor edx, edx
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2008-02-19 08:28:11 +03:00
|
|
|
|
|
|
|
mov al,8
|
|
|
|
mcall ,58 shl 16 + 32,59 shl 16 + 34, 1 shl 30 + 1
|
|
|
|
inc edx
|
|
|
|
mcall ,110 shl 16 + 32,54 shl 16 + 32
|
|
|
|
inc edx
|
|
|
|
mcall ,161 shl 16 + 32,59 shl 16 + 34
|
|
|
|
inc edx
|
|
|
|
mcall ,193 shl 16 + 43,125 shl 16 + 16,
|
|
|
|
inc edx
|
|
|
|
mcall ,144 shl 16 + 43
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2007-02-12 08:14:58 +03:00
|
|
|
mov al,12 ;end of redraw
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ebx,2
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2006-02-16 09:44:47 +03:00
|
|
|
still:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2006-02-16 09:44:47 +03:00
|
|
|
mov eax,10 ; wait here for event
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2006-02-16 09:44:47 +03:00
|
|
|
dec eax
|
2008-02-19 08:28:11 +03:00
|
|
|
jz draw
|
2006-02-16 09:44:47 +03:00
|
|
|
dec eax
|
|
|
|
jnz button
|
|
|
|
key:
|
|
|
|
mov al,2 ; now eax=2 - get key code
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-02-16 09:44:47 +03:00
|
|
|
mov al,ah
|
|
|
|
cmp al,13
|
|
|
|
jz restart
|
|
|
|
cmp al,27
|
|
|
|
jz close_1
|
|
|
|
cmp al,180
|
|
|
|
jz restart_kernel
|
|
|
|
cmp al,181
|
|
|
|
jz power_off
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
button:
|
|
|
|
mov al,17 ; now eax=17 - get pressed button id
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-02-16 09:44:47 +03:00
|
|
|
xchg al,ah
|
|
|
|
dec eax
|
|
|
|
jz restart_kernel
|
|
|
|
dec eax
|
2008-02-19 08:28:11 +03:00
|
|
|
jz power_off
|
|
|
|
dec eax
|
2006-02-16 09:44:47 +03:00
|
|
|
jz restart
|
2007-02-12 08:14:58 +03:00
|
|
|
dec eax
|
|
|
|
jnz run_rdsave
|
2006-02-16 09:44:47 +03:00
|
|
|
; we have only one button left, this is close button
|
|
|
|
; dec eax
|
|
|
|
; jnz still
|
|
|
|
close_1:
|
|
|
|
or eax,-1
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2006-02-16 09:44:47 +03:00
|
|
|
power_off:
|
|
|
|
push 2
|
|
|
|
jmp mcall_and_close
|
|
|
|
|
|
|
|
restart:
|
|
|
|
push 3
|
|
|
|
jmp mcall_and_close
|
|
|
|
|
|
|
|
restart_kernel:
|
|
|
|
push 4
|
|
|
|
mcall_and_close:
|
|
|
|
pop ecx
|
|
|
|
mcall 18,9
|
|
|
|
jmp close_1
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2007-02-12 08:14:58 +03:00
|
|
|
run_rdsave:
|
|
|
|
mov eax,70
|
|
|
|
mov ebx,rdsave
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2007-02-12 08:14:58 +03:00
|
|
|
jmp still
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
data
|
2008-02-19 08:28:11 +03:00
|
|
|
background file 'back.raw'
|
2007-02-12 08:14:58 +03:00
|
|
|
rdsave:
|
|
|
|
dd 7
|
|
|
|
dd 0
|
|
|
|
dd 0
|
|
|
|
dd 0
|
|
|
|
dd 0
|
2007-05-30 18:45:45 +04:00
|
|
|
db '/sys/rdsave',0
|
2006-01-03 12:43:31 +03:00
|
|
|
udata
|
|
|
|
|
|
|
|
meos_app_end
|