Subversion Repositories Kolibri OS

Rev

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

Rev 205 Rev 485
Line 24... Line 24...
24
  dd 0x3000
24
  dd 0x3000
25
  dd 0x3000
25
  dd 0x3000
26
  dd 0x0
26
  dd 0x0
27
  dd 0x0
27
  dd 0x0
Line 28... Line 28...
28
 
28
 
29
include 'macros.inc'
29
include '..\..\..\macros.inc'
Line 30... Line 30...
30
ENTRANCE: ; start of code
30
ENTRANCE: ; start of code
Line 31... Line 31...
31
 
31
 
Line 39... Line 39...
39
 
39
 
Line 40... Line 40...
40
call draw_eyes                   ; draw those funny "eyes"
40
call draw_eyes                   ; draw those funny "eyes"
41
 
41
 
42
mov eax,23                       ; wait for event with timeout
42
mov eax,23                       ; wait for event with timeout
Line 43... Line 43...
43
mov ebx,TIMEOUT
43
mov ebx,TIMEOUT
44
int 0x40
44
mcall
45
 
45
 
46
cmp eax,1                        ; redraw ?
46
cmp eax,1                        ; redraw ?
Line 58... Line 58...
58
 
58
 
Line 59... Line 59...
59
; EVENTS
59
; EVENTS
60
 
60
 
61
key:
61
key:
62
mov eax,2        ; just read and ignore
62
mov eax,2        ; just read and ignore
Line 63... Line 63...
63
int 0x40
63
mcall
64
jmp still
64
jmp still
65
 
65
 
66
button:          ; analyze button
66
button:          ; analyze button
Line 67... Line 67...
67
mov eax,-1       ; this is button 1 - we have only one button :-)
67
mov eax,-1       ; this is button 1 - we have only one button :-)
Line 68... Line 68...
68
int 0x40
68
mcall
Line 79... Line 79...
79
shape_window:
79
shape_window:
Line 80... Line 80...
80
 
80
 
81
mov eax,50                   ; set up shape reference area
81
mov eax,50                   ; set up shape reference area
82
mov ebx,0
82
mov ebx,0
83
mov ecx,winref
83
mov ecx,winref
Line 84... Line 84...
84
int 0x40
84
mcall
Line 85... Line 85...
85
 
85
 
Line 86... Line 86...
86
ret
86
ret
Line 87... Line 87...
87
 
87
 
88
; -====- redrawing -====-
88
; -====- redrawing -====-
89
 
89
 
90
draw_eyes:                   ; check mousepos to disable blinking
90
draw_eyes:                   ; check mousepos to disable blinking
91
 
91
 
92
mov eax,37
92
mov eax,37
93
xor ebx,ebx
93
xor ebx,ebx
94
int 0x40
94
mcall
Line 95... Line 95...
95
cmp dword [mouse],eax
95
cmp dword [mouse],eax
Line 96... Line 96...
96
jne redraw_ok
96
jne redraw_ok
97
ret
97
ret
98
redraw_ok:
98
redraw_ok:
Line 99... Line 99...
99
mov [mouse],eax
99
mov [mouse],eax
100
 
100
 
101
redraw_overlap:              ; label for redraw event (without checkmouse)
101
redraw_overlap:              ; label for redraw event (without checkmouse)
102
 
102
 
103
mov eax,12
103
mov eax,12
104
mov ebx,1
104
mov ebx,1
105
int 0x40
105
mcall
Line 106... Line 106...
106
 
106
 
107
xor eax,eax                  ; define window
107
xor eax,eax                  ; define window
108
mov ebx,[win_ebx]
108
mov ebx,[win_ebx]
109
mov ecx,[win_ecx]
109
mov ecx,[win_ecx]
110
xor edx,edx
110
xor edx,edx
Line 111... Line 111...
111
xor esi,esi
111
xor esi,esi
112
xor edi,edi
112
xor edi,edi
113
int 0x40
113
mcall
114
 
114
 
115
mov eax,8                    ; define closebutton
115
mov eax,8                    ; define closebutton
Line 116... Line 116...
116
mov ebx,60
116
mov ebx,60
117
mov ecx,45
117
mov ecx,45
118
mov edx,1
118
mov edx,1
119
int 0x40
119
mcall
120
 
120
 
Line 121... Line 121...
121
mov eax,7
121
mov eax,7
122
mov ebx,skindata
122
mov ebx,skindata
123
mov ecx,60*65536+30
123
mov ecx,60*65536+30
Line 124... Line 124...
124
mov edx,15
124
mov edx,15
Line 125... Line 125...
125
int 0x40
125
mcall
126
 
126
 
Line 279... Line 279...
279
add ecx,4
279
add ecx,4
280
shl ebx,16
280
shl ebx,16
281
add ebx,4
281
add ebx,4
282
mov eax,13
282
mov eax,13
283
xor edx,edx
283
xor edx,edx
284
int 0x40
284
mcall
Line 285... Line 285...
285
 
285
 
286
popa
286
popa
Line 287... Line 287...
287
ret
287
ret
Line 293... Line 293...
293
;mov eax,6            ; load EYES.RAW
293
;mov eax,6            ; load EYES.RAW
294
;mov ebx,graphix
294
;mov ebx,graphix
295
;mov ecx,0x00000000
295
;mov ecx,0x00000000
296
;mov edx,0xFFFFFFFF
296
;mov edx,0xFFFFFFFF
297
;mov esi,imagedata
297
;mov esi,imagedata
298
;int 0x40
298
;mcall
299
;cmp eax,0xFFFFFFFF
299
;cmp eax,0xFFFFFFFF
300
;jnz filefound
300
;jnz filefound
Line 301... Line 301...
301
 
301
 
302
;mov eax,-1           ; file not exists...
302
;mov eax,-1           ; file not exists...
Line 303... Line 303...
303
;int 0x40
303
;mcall
304
 
304
 
305
;filefound:
305
;filefound:
306
mov esi,imagedata+25 ; transform grayscale to putimage format
306
mov esi,imagedata+25 ; transform grayscale to putimage format
Line 325... Line 325...
325
loop lp2
325
loop lp2
326
pop  ecx
326
pop  ecx
327
loop transform_loop
327
loop transform_loop
Line 328... Line 328...
328
 
328
 
329
mov eax,14           ; calculating screen position
329
mov eax,14           ; calculating screen position
330
int 0x40
330
mcall
331
shr eax,1
331
shr eax,1
332
mov ax,59
332
mov ax,59
333
sub eax,30*65536
333
sub eax,30*65536
334
mov [win_ebx],eax
334
mov [win_ebx],eax