demos/web: now can be used as a screensaver

git-svn-id: svn://kolibrios.org@9451 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-21 00:42:38 +00:00
parent 011d6f7a41
commit 36abfafd64

View File

@ -8,6 +8,11 @@
; 2) Screen width bigger than height ; 2) Screen width bigger than height
; 3) Screen width and height are even (2*k) ; 3) Screen width and height are even (2*k)
use32
org 0
db 'MENUET01'
dd 0x01,__start,__end,__memory,__stack,param,0
include '../../../macros.inc' include '../../../macros.inc'
background_cl = 0x000000 background_cl = 0x000000
@ -17,9 +22,15 @@ delay = 4
; debug = 1 ; debug = 1
MEOS_APP_START ;KOS_APP_START
CODE CODE
cmp dword [param], '@ss'
setz [screensaver]
mov ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON
cmovz ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
mcall 40
;Preinit. Randomize start counter ;Preinit. Randomize start counter
mcall 3 mcall 3
mov [initial_counter], eax ;init with system time mov [initial_counter], eax ;init with system time
@ -44,7 +55,7 @@ CODE
mcall 68, 11 ; Init heap mcall 68, 11 ; Init heap
test eax, eax ; Is heap successfully inited? test eax, eax ; Is heap successfully inited?
jnz @f jnz @f
mcall -1 ; Netu pamjati?! Nu i nahuj vas jmp exit ; Netu pamjati?! Nu i nahuj vas
@@: @@:
movzx ecx, [y_max] movzx ecx, [y_max]
inc ecx inc ecx
@ -54,7 +65,7 @@ CODE
mcall 68, 12, mcall 68, 12,
test eax, eax ; Did we get something non zero? test eax, eax ; Did we get something non zero?
jnz @f jnz @f
mcall -1 jmp exit
@@: @@:
mov [line_coords_array_pointer], eax mov [line_coords_array_pointer], eax
add eax, edx add eax, edx
@ -358,6 +369,10 @@ wait_event:
; button pressed; we have only one button, close ; button pressed; we have only one button, close
; also seems to handle Alt+F4 ; also seems to handle Alt+F4
exit: exit:
cmp [screensaver], 0
jz @f
mcall 70, f70
@@:
mcall -1 mcall -1
@ -418,4 +433,13 @@ line_coords_array_pointer dd ?
line_start_pointer_offset = 8 line_start_pointer_offset = 8
line_coords_element_size = 12 line_coords_element_size = 12
__params:
param rb 40
f70: ; run
dd 7, 0, 0, 0, 0
db '/sys/@SS',0
screensaver db ?
MEOS_APP_END MEOS_APP_END