Subversion Repositories Kolibri OS

Rev

Rev 485 | Rev 9450 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 485 Rev 9449
Line 10... Line 10...
10
;
10
;
Line 11... Line 11...
11
 
11
 
12
fullscreen = 1
12
fullscreen = 1
13
n_points = 0x1800
13
n_points = 0x1800
-
 
14
delay = 2
14
delay = 2
15
const480 = 480
Line 15... Line 16...
15
speed equ 0.004
16
speed equ 0.004
Line 23... Line 24...
23
	       dd     0x01		      ; header version
24
	       dd     0x01		      ; header version
24
	       dd     start		      ; start of code
25
	       dd     start		      ; start of code
25
	       dd     i_end		      ; size of image
26
	       dd     i_end		      ; size of image
26
	       dd     i_end+0x1000	      ; memory for app
27
	       dd     i_end+0x1000	      ; memory for app
27
	       dd     i_end+0x1000	      ; esp
28
	       dd     i_end+0x1000	      ; esp
28
	       dd     0x0		      ; I_Param
29
	       dd     params		      ; I_Param
29
	       dd     0x0		      ; I_Icon
30
	       dd     0x0		      ; I_Icon
Line 30... Line 31...
30
 
31
 
31
copyright db   'Crown_s Soft(c) Screensaver v1.13m    www.crown-s-soft.com',0
32
copyright db   'Crown_s Soft(c) Screensaver - www.crown-s-soft.com',0
Line 32... Line 33...
32
copyrightlen:
33
copyrightlen:
33
 
34
 
34
include "lang.inc"
35
include "lang.inc"
35
include "figuresi.inc"
36
include "figuresi.inc"
-
 
37
include "..\..\..\macros.inc"
-
 
38
start:
-
 
39
    cmp     dword[params], '@ss'
-
 
40
    setz    [screensaver]
-
 
41
    mov     ebx, EVM_REDRAW + EVM_KEY
-
 
42
    cmovz   ebx, EVM_REDRAW + EVM_KEY + EVM_MOUSE
-
 
43
    mcall   40
-
 
44
 
-
 
45
    cmp [flscr],0
-
 
46
    jz @f
-
 
47
    mov     edi, transparent_cursor
-
 
48
    xor     eax, eax
-
 
49
    mov     ecx, 32*32
-
 
50
    rep     stosd
-
 
51
    mcall   37, 4, transparent_cursor, 2
-
 
52
    mov     ecx, eax
36
include "..\..\..\macros.inc"
53
    mcall   37, 5
37
start:
54
@@:
38
    cld
55
    cld
Line 39... Line 56...
39
    finit
56
    finit
Line 47... Line 64...
47
    jz	nofullscreen
64
    jz	nofullscreen
48
      mov  eax,14
65
      mov  eax,14
49
      mcall
66
      mcall
Line 50... Line 67...
50
 
67
 
51
      mov  [maxy],ax
68
      mov  [maxy],ax
52
      sub  ax,480
69
      sub  ax,const480
53
      jnc m5
70
      jnc m5
54
	xor ax,ax
71
	xor ax,ax
55
      m5:
72
      m5:
56
      shr  ax,1
73
      shr  ax,1
Line 57... Line 74...
57
      mov  [posy],ax
74
      mov  [posy],ax
58
 
75
 
59
      shr  eax,16
76
      shr  eax,16
60
      mov  [maxx],ax
77
      mov  [maxx],ax
61
      sub  ax,480
78
      sub  ax,const480
62
      jnc m6
79
      jnc m6
63
	xor ax,ax
80
	xor ax,ax
64
      m6:
81
      m6:
Line 65... Line 82...
65
      shr  ax,1
82
      shr  ax,1
66
      mov  [posx],ax
83
      mov  [posx],ax
67
 
84
 
68
      mov  [outsize],480+65536*480
85
      mov  [outsize],const480+65536*const480
69
    jmp m4
86
    jmp m4
Line 70... Line 87...
70
    nofullscreen:
87
    nofullscreen:
71
      mov  [posx],75
88
      mov  [posx],75
Line 72... Line 89...
72
      mov  [posy],20
89
      mov  [posy],20
73
 
90
 
Line 74... Line 91...
74
      mov  [outsize],450+65536*480
91
      mov  [outsize],const480+65536*const480
75
    m4:
-
 
76
 
-
 
77
red:
92
    m4:
Line 78... Line 93...
78
    call draw_window
93
 
79
 
94
red:
80
still:
95
    call draw_window
81
    mov  eax,23
96
 
82
    mov  ebx,delay
97
still:
83
    mcall			; wait here for event
98
    mcall 23,delay			; wait here for event
-
 
99
	
84
 
100
    cmp  eax,1			; redraw request ?
Line 85... Line 101...
85
    cmp  eax,1			; redraw request ?
101
    je	 red
86
    je	 red
-
 
87
    cmp  eax,2			; key in buffer ?
-
 
88
    je	 key
-
 
89
    cmp  eax,3			; button in buffer ?
102
    cmp  eax,2			; key in buffer ?
-
 
103
    je	 key
-
 
104
    cmp  eax,3			; button in buffer ?
-
 
105
    je	 close
90
    je	 button
106
    cmp  eax,6			; mouse moved ?
91
 
107
    je	 close
Line 92... Line 108...
92
 
108
 
-
 
109
    call calcframe
-
 
110
    mov  eax,07 	      ; putimage
-
 
111
    mov  ebx,scr	      ; ebx pointer to image in memory
93
    call calcframe
112
    mov  ecx,[outsize]	      ; ecx=image position in window [w]*65536+[h]
94
    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]
Line 95... Line 114...
95
    mov  ecx,[outsize]	      ; ecx=image position in window [x]*65536+[y]
114
    mcall
96
    mov  ebx,scr	      ; ebx pointer to image in memory
115
jmp  still
97
    mov  eax,07 	      ; putimage
116
 
98
    mcall
117
key:
99
jmp  still
118
	cmp  [screensaver], 0
Line 100... Line -...
100
 
-
 
101
key:
-
 
102
    mov  eax,2
-
 
103
    mcall
-
 
104
 
-
 
105
    cmp  al,1			; is key in buffer ?
-
 
106
    jz	 still
-
 
107
    cmp  ah,0x1B		; is key ESC ?
119
	jnz  close
108
    jz	 close
120
	
-
 
121
    mov  eax,2
-
 
122
    mcall
-
 
123
 
109
jmp  still
124
    cmp  al,1			; is key in buffer ?
Line 110... Line 125...
110
 
125
    jz	 still
111
button: 			; button
126
    cmp  ah,0x1B		; is key ESC ?
112
    mov  eax,17 		; get id
127
    jz	 close
Line 113... Line 128...
113
    mcall
128
jmp  still
114
 
-
 
115
;    cmp  ah,1                   ; button id=1 ?
129
 
116
;    jne  still
-
 
Line 117... Line 130...
117
 
130
close:
118
close:
131
    cmp     [screensaver], 0
119
    mov  eax,-1 		; close this program
132
    jz      @f
120
    mcall
133
    mcall   70, f70
121
 
134
  @@:
122
 
135
    mcall   -1
123
;   *********************************************
136
 
124
;   *******  WINDOW DEFINITIONS AND DRAW ********
137
 
125
;   *********************************************
-
 
Line 126... Line -...
126
 
-
 
127
 
-
 
128
draw_window:
-
 
129
    mov  eax,12 		     ; function 12:tell os about windowdraw
-
 
130
    mov  ebx,1			     ; 1, start of draw
-
 
131
    mcall
-
 
132
 
-
 
133
    cmp  [flscr],0
-
 
134
    jnz  m2
-
 
135
      mov  ebx,1*65536+638	     ; [x start] *65536 + [x size]
-
 
136
      mov  ecx,1*65536+478	     ; [y start] *65536 + [y size]
-
 
137
      mov  edx,0x02000000	     ; color of work area RRGGBB,8->color gl
-
 
138
      mov  esi,0x805080d0	     ; color of grab bar  RRGGBB,8->color gl
-
 
139
      mov  edi,0x005080d0	     ; color of frames    RRGGBB
-
 
140
      xor  eax,eax		     ; function 0 : define and draw window
-
 
141
      mcall
138
;   *********************************************
142
 
139
;   *******  WINDOW DEFINITIONS AND DRAW ********
143
				     ; WINDOW LABEL
140
;   *********************************************
144
      mov  ebx,8*65536+8	     ; [x start] *65536 + [y start]
141
 
Line 170... Line 167...
170
      inc cx
167
      inc cx
171
      mov eax,13		     ; functiom 13 : draw bar
168
      mov eax,13		     ; functiom 13 : draw bar
172
      mcall
169
      mcall
173
    m3:
170
    m3:
Line 174... Line -...
174
 
-
 
175
    mov  eax,12 		     ; function 12:tell os about windowdraw
171
 
176
    mov  ebx,2			     ; 2, end of draw
-
 
177
    mcall
172
    mcall 12, 2 ;end draw
Line 178... Line 173...
178
ret
173
ret
179
 
174
 
180
 
175
 
181
calcframe:
176
calcframe:
182
     cld
177
     cld
183
     mov  edi,scr
178
     mov  edi,scr
Line 184... Line 179...
184
     mov  ecx,480*480*3/4
179
     mov  ecx,const480*const480*3/4
Line 290... Line 285...
290
 
285
 
Line 291... Line 286...
291
  push edx
286
  push edx
292
 
287
 
293
  mov  eax,[x1]
288
  mov  eax,[x1]
294
  add  eax,[mid]
289
  add  eax,[mid]
295
  mul  [const480]
290
  mul  [consts]
296
  add  eax,[y1]
291
  add  eax,[y1]
Line 297... Line 292...
297
  add  eax,[mid]
292
  add  eax,[mid]
Line 359... Line 354...
359
  mal_r   dd	 6.28318530717958648
354
  mal_r   dd	 6.28318530717958648
360
  mbt_r   dd	 6.28318530717958648
355
  mbt_r   dd	 6.28318530717958648
Line 361... Line 356...
361
 
356
 
362
  const3   dd	 3
357
  const3   dd	 3
363
  const6   dw	 6
358
  const6   dw	 6
Line 364... Line 359...
364
  const480 dd	 480
359
  consts   dd    const480
365
 
360
 
Line 366... Line 361...
366
  mFl	  dd	 n_points
361
  mFl	  dd	 n_points
Line 396... Line 391...
396
 
391
 
397
  x1	  dd	 ?
392
  x1	  dd	 ?
398
  y1	  dd	 ?
393
  y1	  dd	 ?
Line -... Line 394...
-
 
394
  z1	  dd	 ?
-
 
395
 
-
 
396
f70:    ; run
-
 
397
        dd 7, 0, 0, 0, 0
-
 
398
        db '/sys/@SS',0
-
 
399
 
-
 
400
screensaver db ?
-
 
401
params rb 4
399
  z1	  dd	 ?
402
transparent_cursor rd 32*32
400
 
403
 
401
align 16
404
align 16
402
  alfbet:		  ; alfbet  db  n_points*4  dup (?)
405
  alfbet:		  ; alfbet  db  n_points*4  dup (?)