Subversion Repositories Kolibri OS

Rev

Rev 9450 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9450 Rev 9647
Line 2... Line 2...
2
;    Crown_s Soft Screensaver v1.13m
2
;    Crown_s Soft Screensaver v1.13m
3
;       WWW: http://www.crown-s-soft.com
3
;       WWW: http://www.crown-s-soft.com
4
;
4
;
5
;    You may add you own figures. See file FIGURES.INC
5
;    You may add you own figures. See file FIGURES.INC
6
;
6
;
7
;    Compile with FASM v1.48 for Menuet or hier  (FASM v1.40 contains bug)
7
;    Compile with FASM v1.73 for Kolibri or hier
8
;
8
;
9
;    Copyright(c) 2002-2004 Crown_s Soft. All rights reserved.
9
;    Copyright(c) 2002-2004 Crown_s Soft. All rights reserved.
10
;
10
;
Line 11... Line 11...
11
 
11
 
Line 33... Line 33...
33
copyrightlen:
33
copyrightlen:
Line 34... Line 34...
34
 
34
 
35
include "lang.inc"
35
include "lang.inc"
36
include "figuresi.inc"
36
include "figuresi.inc"
-
 
37
include "..\..\..\macros.inc"
37
include "..\..\..\macros.inc"
38
include "..\..\..\KOSfuncs.inc"
38
start:
39
start:
39
    cmp     dword[params], '@ss'
40
    cmp     dword[params], '@ss'
40
    setz    [screensaver]
41
    setz    [screensaver]
41
    mov     ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON
42
    mov     ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON
42
    cmovz   ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
43
    cmovz   ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
Line 43... Line 44...
43
    mcall   40
44
    mcall   SF_SET_EVENTS_MASK
44
 
45
 
45
    cmp [flscr],0
46
    cmp [flscr],0
46
    jz @f
47
    jz @f
47
    mov     edi, transparent_cursor
48
    mov     edi, transparent_cursor
48
    xor     eax, eax
49
    xor     eax, eax
49
    mov     ecx, 32*32
50
    mov     ecx, 32*32
50
    rep     stosd
51
    rep     stosd
51
    mcall   37, 4, transparent_cursor, 2
52
    mcall   SF_MOUSE_GET, SSF_LOAD_CURSOR, transparent_cursor, 2
52
    mov     ecx, eax
53
    mov     ecx, eax
53
    mcall   37, 5
54
    mcall   SF_MOUSE_GET, SSF_SET_CURSOR
54
@@:
55
@@:
55
    cld
56
    cld
Line 60... Line 61...
60
    mov [pp1adr],eax
61
    mov [pp1adr],eax
Line 61... Line 62...
61
 
62
 
62
 
63
 
63
    cmp [flscr],0
-
 
64
    jz	nofullscreen
64
    cmp [flscr],0
Line 65... Line 65...
65
      mov  eax,14
65
    jz	nofullscreen
66
      mcall
66
      mcall SF_GET_SCREEN_SIZE
67
 
67
 
68
      mov  [maxy],ax
68
      mov  [maxy],ax
Line 93... Line 93...
93
 
93
 
94
red:
94
red:
Line 95... Line 95...
95
    call draw_window
95
    call draw_window
96
 
96
 
Line 97... Line 97...
97
still:
97
still:
98
    mcall 23,delay			; wait here for event
98
    mcall SF_WAIT_EVENT_TIMEOUT, delay			; wait here for event
99
	
99
	
100
    cmp  eax,1			; redraw request ?
100
    cmp  eax,1			; redraw request ?
Line 105... Line 105...
105
    je	 close
105
    je	 close
106
    cmp  eax,6			; mouse moved ?
106
    cmp  eax,6			; mouse moved ?
107
    je	 close
107
    je	 close
Line 108... Line 108...
108
 
108
 
109
    call calcframe
109
    call calcframe
110
    mov  eax,07 	      ; putimage
110
    mov  eax,SF_PUT_IMAGE
111
    mov  ebx,scr	      ; ebx pointer to image in memory
111
    mov  ebx,scr	      ; ebx pointer to image in memory
112
    mov  ecx,[outsize]	      ; ecx=image position in window [w]*65536+[h]
112
    mov  ecx,[outsize]	      ; ecx=image position in window [w]*65536+[h]
113
    mov  edx,dword [posy]     ; edx=image position in window [x]*65536+[y]
113
    mov  edx,dword [posy]     ; edx=image position in window [x]*65536+[y]
114
    mcall
114
    mcall
Line 115... Line 115...
115
jmp  still
115
jmp  still
116
 
116
 
117
key:
117
key:
Line 118... Line -...
118
	cmp  [screensaver], 0
-
 
119
	jnz  close
118
	cmp  [screensaver], 0
Line 120... Line 119...
120
	
119
	jnz  close
121
    mov  eax,2
120
	
122
    mcall
121
    mcall SF_GET_KEY
123
 
122
 
124
    cmp  al,1			; is key in buffer ?
123
    cmp  al,1			; is key in buffer ?
Line 125... Line 124...
125
    jz	 still
124
    jz	 still
126
    cmp  ah,0x1B		; is key ESC ?
125
    cmp  ah,0x1B		; is key ESC ?
127
    jz	 close
126
    jz	 close
128
jmp  still
127
jmp  still
129
 
128
 
130
close:
129
close:
Line 131... Line 130...
131
    cmp     [screensaver], 0
130
    cmp     [screensaver], 0
132
    jz      @f
131
    jz      @f
133
    mcall   70, f70
132
    mcall   SF_FILE, f70
Line 134... Line 133...
134
  @@:
133
  @@:
135
    mcall   -1
134
    mcall   SF_TERMINATE_PROCESS
Line 136... Line 135...
136
 
135
 
137
 
136
 
138
;   *********************************************
137
;   *********************************************
139
;   *******  WINDOW DEFINITIONS AND DRAW ********
138
;   *******  WINDOW DEFINITIONS AND DRAW ********
140
;   *********************************************
139
;   *********************************************
141
 
140
 
142
 
141
 
143
draw_window:
142
draw_window:
Line 144... Line 143...
144
    mcall 12, 1 ;start draw
143
    mcall SF_REDRAW, SSF_BEGIN_DRAW ;start draw
145
 
144
 
146
    cmp  [flscr],0
145
    cmp  [flscr],0
147
    jnz  m2
146
    jnz  m2
Line 163... Line 162...
163
      xor  eax,eax		     ; function 0 : define and draw window
162
      xor  eax,eax		     ; function 0 : define and draw window
164
      mcall
163
      mcall
Line 165... Line 164...
165
 
164
 
166
      inc bx
165
      inc bx
167
      inc cx
-
 
168
      mov eax,13		     ; functiom 13 : draw bar
166
      inc cx
169
      mcall
167
      mcall SF_DRAW_RECT
Line 170... Line 168...
170
    m3:
168
    m3:
171
 
169
 
Line 172... Line 170...
172
    mcall 12, 2 ;end draw
170
    mcall SF_REDRAW, SSF_END_DRAW ;end draw
173
ret
171
ret
Line 324... Line 322...
324
ret
322
ret
Line 325... Line 323...
325
 
323
 
326
 
324
 
327
filling_alfbet:
-
 
328
     ; Initialize RND
325
filling_alfbet:
329
     mov   eax,3
326
     ; Initialize RND
Line 330... Line 327...
330
     mcall
327
     mcall SF_GET_SYS_TIME
331
     ; eax - fist random number
328
     ; eax - fist random number
332
 
329
 
Line 392... Line 389...
392
  x1	  dd	 ?
389
  x1	  dd	 ?
393
  y1	  dd	 ?
390
  y1	  dd	 ?
394
  z1	  dd	 ?
391
  z1	  dd	 ?
Line 395... Line 392...
395
 
392
 
396
f70:    ; run
393
f70:    ; run
397
        dd 7, 0, 0, 0, 0
394
        dd SSF_START_APP, 0, 0, 0, 0
Line 398... Line 395...
398
        db '/sys/@SS',0
395
        db '/sys/@SS',0
399
 
396
 
400
screensaver db ?
397
screensaver db ?