Subversion Repositories Kolibri OS

Rev

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

Rev 129 Rev 384
Line 17... Line 17...
17
	jif	eax,e,ecx,.exit
17
	jif	eax,e,ecx,.exit
18
	jif	ebx,e,edx,.exit
18
	jif	ebx,e,edx,.exit
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
	call	get_cursor_rect
20
	call	get_cursor_rect
21
 
21
 
22
	mov	ebp,[0x3010]
22
	mov	ebp,[TASK_BASE]
23
	movsx	esi,word[ebp-0x3000+0]
23
	movsx	esi,word[ebp-CURRENT_TASK+0]
24
	add	eax,esi
24
	add	eax,esi
25
	add	ecx,esi
25
	add	ecx,esi
26
	movsx	esi,word[ebp-0x3000+4]
26
	movsx	esi,word[ebp-CURRENT_TASK+4]
27
	add	ebx,esi
27
	add	ebx,esi
28
	add	edx,esi
28
	add	edx,esi
29
;	add	eax,[ebp-0x3000+0]
29
;       add     eax,[ebp-CURRENT_TASK+0]
30
;	add	ebx,[ebp-0x3000+4]
30
;       add     ebx,[ebp-CURRENT_TASK+4]
Line 31... Line 31...
31
;	add	ecx,[ebp-0x3000+0]
31
;       add     ecx,[ebp-CURRENT_TASK+0]
32
;	add	edx,[ebp-0x3000+4]
32
;       add     edx,[ebp-CURRENT_TASK+4]
33
 
33
 
34
	push	eax
34
	push	eax
Line 39... Line 39...
39
	shl	al,2
39
	shl	al,2
40
	shr	eax,3
40
	shr	eax,3
41
	mov	di,ax
41
	mov	di,ax
42
	pop	eax
42
	pop	eax
Line 43... Line 43...
43
 
43
 
44
	mov	esi,[0x00003000]
44
	mov	esi,[CURRENT_TASK]
45
	mov	esi,[CLIP_RECTS+esi*4]
45
	mov	esi,[CLIP_RECTS+esi*4]
46
	mov	ebp,[esi]
46
	mov	ebp,[esi]
47
	or	ebp,ebp
47
	or	ebp,ebp
48
	jz	.exit
48
	jz	.exit
Line 60... Line 60...
60
	mov	ecx,[rr.right]
60
	mov	ecx,[rr.right]
61
    @@: jif	edx,l,[rr.bottom],@f
61
    @@: jif	edx,l,[rr.bottom],@f
62
	mov	edx,[rr.bottom]
62
	mov	edx,[rr.bottom]
63
    @@: call	is_intersect_rc
63
    @@: call	is_intersect_rc
64
	jc	.put
64
	jc	.put
65
	cmp	[mouse_invisible],0
65
	cmp	byte[MOUSE_VISIBLE],0
66
	jne	.put
66
	je	.put
67
	call	[SF.draw_mouse_under]
67
	call	[SF.draw_mouse_under]
68
	mov	[mouse_invisible],1
68
	mov	byte[MOUSE_VISIBLE],0
69
  .put: mov	ebp,[bytes_per_scanline]
69
  .put: mov	ebp,[BytesPerScanLine]
70
	imul	ebp,ebx
70
	imul	ebp,ebx
71
	lea	ebp,[ebp+eax*2]
71
	lea	ebp,[ebp+eax*2]
72
	add	ebp,[lfb_address]
72
	add	ebp,[LFBAddress]
73
  .xxx: push	eax ebp
73
  .xxx: push	eax ebp
74
    @@: push	ebp
74
    @@: push	ebp
75
	call	[set_bank]
75
	call	[set_bank]
76
	mov	[ebp],di
76
	mov	[ebp],di
77
	pop	ebp
77
	pop	ebp
Line 79... Line 79...
79
	add	ebp,2
79
	add	ebp,2
80
	inc	eax
80
	inc	eax
81
	cmp	eax,ecx
81
	cmp	eax,ecx
82
	jl	@b
82
	jl	@b
83
	pop	ebp eax
83
	pop	ebp eax
84
	add	ebp,[bytes_per_scanline]
84
	add	ebp,[BytesPerScanLine]
85
	inc	ebx
85
	inc	ebx
86
	cmp	ebx,edx
86
	cmp	ebx,edx
87
	jl	.xxx
87
	jl	.xxx
88
	popad
88
	popad
89
  .skip:
89
  .skip:
Line 132... Line 132...
132
	retn
132
	retn
Line 133... Line 133...
133
 
133
 
134
  dl.16.vert_line:
134
  dl.16.vert_line:
135
	test	edi,1
135
	test	edi,1
136
	jnz	.forced
136
	jnz	.forced
137
	mov	esi,[0x00003000]
137
	mov	esi,[CURRENT_TASK]
138
	mov	esi,[CLIP_RECTS+esi*4]
138
	mov	esi,[CLIP_RECTS+esi*4]
139
	mov	edi,[esi]
139
	mov	edi,[esi]
140
	or	edi,edi
140
	or	edi,edi
141
	jz	.exit
141
	jz	.exit
Line 156... Line 156...
156
	mov	edx,[rr.bottom]
156
	mov	edx,[rr.bottom]
157
	dec	edx
157
	dec	edx
158
  .draw:
158
  .draw:
159
    @@: call	is_intersect_vln
159
    @@: call	is_intersect_vln
160
	jc	.put
160
	jc	.put
161
	cmp	[mouse_invisible],0
161
	cmp	byte[MOUSE_VISIBLE],0
162
	jne	.put
162
	je	.put
163
	call	[SF.draw_mouse_under]
163
	call	[SF.draw_mouse_under]
164
	mov	[mouse_invisible],1
164
	mov	byte[MOUSE_VISIBLE],0
165
  .put: mov	ebp,[bytes_per_scanline]
165
  .put: mov	ebp,[BytesPerScanLine]
166
	imul	ebp,ebx
166
	imul	ebp,ebx
167
	lea	ebp,[ebp+eax*2]
167
	lea	ebp,[ebp+eax*2]
168
	add	ebp,[lfb_address]
168
	add	ebp,[LFBAddress]
169
    @@: push	ebp
169
    @@: push	ebp
170
	call	[set_bank]
170
	call	[set_bank]
171
	test	ecx,0x01000000
171
	test	ecx,0x01000000
172
	jz	.dr
172
	jz	.dr
173
	mov	cx,[ebp]
173
	mov	cx,[ebp]
174
	not	cx
174
	not	cx
175
  .dr:	mov	[ebp],cx
175
  .dr:	mov	[ebp],cx
176
	pop	ebp
176
	pop	ebp
177
;	mov	[ebp],cx
177
;       mov     [ebp],cx
178
	add	ebp,[bytes_per_scanline]
178
	add	ebp,[BytesPerScanLine]
179
	inc	ebx
179
	inc	ebx
180
	cmp	ebx,edx
180
	cmp	ebx,edx
181
	jle	@b
181
	jle	@b
182
  .skip:
182
  .skip:
183
	add	esi,SR
183
	add	esi,SR
Line 206... Line 206...
206
	jmp	.draw
206
	jmp	.draw
Line 207... Line 207...
207
 
207
 
208
  dl.16.horz_line:
208
  dl.16.horz_line:
209
	test	edi,1
209
	test	edi,1
210
	jnz	.forced
210
	jnz	.forced
211
	mov	esi,[0x00003000]
211
	mov	esi,[CURRENT_TASK]
212
	mov	esi,[CLIP_RECTS+esi*4]
212
	mov	esi,[CLIP_RECTS+esi*4]
213
	mov	edi,[esi]
213
	mov	edi,[esi]
214
	or	edi,edi
214
	or	edi,edi
215
	jz	.exit
215
	jz	.exit
Line 230... Line 230...
230
	mov	edx,[rr.right]
230
	mov	edx,[rr.right]
231
	dec	edx
231
	dec	edx
232
  .draw:
232
  .draw:
233
    @@: call	is_intersect_hln
233
    @@: call	is_intersect_hln
234
	jc	.put
234
	jc	.put
235
	cmp	[mouse_invisible],0
235
	cmp	byte[MOUSE_VISIBLE],0
236
	jne	.put
236
	je	.put
237
	call	[SF.draw_mouse_under]
237
	call	[SF.draw_mouse_under]
238
	mov	[mouse_invisible],1
238
	mov	byte[MOUSE_VISIBLE],0
239
  .put: mov	ebp,[bytes_per_scanline]
239
  .put: mov	ebp,[BytesPerScanLine]
240
	imul	ebp,eax
240
	imul	ebp,eax
241
	lea	ebp,[ebp+ebx*2]
241
	lea	ebp,[ebp+ebx*2]
242
	add	ebp,[lfb_address]
242
	add	ebp,[LFBAddress]
243
    @@: push	ebp
243
    @@: push	ebp
244
	call	[set_bank]
244
	call	[set_bank]
245
	test	ecx,0x01000000
245
	test	ecx,0x01000000
246
	jz	.dr
246
	jz	.dr
247
	mov	cx,[ebp]
247
	mov	cx,[ebp]
Line 290... Line 290...
290
; edi = 0x00000001 force
290
; edi = 0x00000001 force
291
;-----------------------------------------------------------------------------
291
;-----------------------------------------------------------------------------
292
begin
292
begin
293
	pushad
293
	pushad
294
	cli
294
	cli
295
	mov	edx,[bytes_per_scanline]
295
	mov	edx,[BytesPerScanLine]
296
	imul	edx,ebx
296
	imul	edx,ebx
297
	lea	edx,[edx+eax*2]
297
	lea	edx,[edx+eax*2]
298
	add	edx,[lfb_address]
298
	add	edx,[LFBAddress]
299
	test	edi,1
299
	test	edi,1
300
	jnz	.forced
300
	jnz	.forced
301
	mov	esi,[0x00003000]
301
	mov	esi,[CURRENT_TASK]
302
	mov	esi,[CLIP_RECTS+esi*4]
302
	mov	esi,[CLIP_RECTS+esi*4]
303
	mov	edi,[esi]
303
	mov	edi,[esi]
304
	or	edi,edi
304
	or	edi,edi
305
	jz	.exit
305
	jz	.exit
306
	add	esi,4
306
	add	esi,4
Line 309... Line 309...
309
	jif	ebx,l,[rr.top],.skip
309
	jif	ebx,l,[rr.top],.skip
310
	jif	ebx,ge,[rr.bottom],.skip
310
	jif	ebx,ge,[rr.bottom],.skip
311
	call	get_cursor_rect
311
	call	get_cursor_rect
312
	call	is_intersect_pt
312
	call	is_intersect_pt
313
	jc	.put
313
	jc	.put
314
	cmp	[mouse_invisible],0
314
	cmp	byte[MOUSE_VISIBLE],0
315
	jne	.put
315
	je	.put
316
	call	[SF.draw_mouse_under]
316
	call	[SF.draw_mouse_under]
317
	mov	[mouse_invisible],1
317
	mov	byte[MOUSE_VISIBLE],0
318
  .put: push	edx
318
  .put: push	edx
319
	call	[set_bank]
319
	call	[set_bank]
320
	pop	edx
320
	pop	edx
321
	test	ecx,0x01000000
321
	test	ecx,0x01000000
322
	jz	.lp1
322
	jz	.lp1
Line 369... Line 369...
369
;-----------------------------------------------------------------------------
369
;-----------------------------------------------------------------------------
370
begin
370
begin
371
	pushad
371
	pushad
372
	cli
372
	cli
Line 373... Line 373...
373
 
373
 
374
	imul	ebx,[bytes_per_scanline]
374
	imul	ebx,[BytesPerScanLine]
375
	shl	eax,1
375
	shl	eax,1
376
	add	eax,ebx
376
	add	eax,ebx
377
	add	eax,[lfb_address]
377
	add	eax,[LFBAddress]
378
	push	eax
378
	push	eax
379
	call	[set_bank]
379
	call	[set_bank]
380
	pop	eax
380
	pop	eax
Line 421... Line 421...
421
	movsx	edx,word[esp+4*4]
421
	movsx	edx,word[esp+4*4]
422
	lea	edi,[ecx*3]
422
	lea	edi,[ecx*3]
423
	push	edi
423
	push	edi
424
	add	ecx,eax
424
	add	ecx,eax
425
	add	edx,ebx
425
	add	edx,ebx
426
	mov	edi,[0x00003010]
426
	mov	edi,[TASK_BASE]
427
	movsx	esi,word[edi-0x3000+0]
427
	movsx	esi,word[edi-CURRENT_TASK+0]
428
	add	eax,esi
428
	add	eax,esi
429
	add	ecx,esi
429
	add	ecx,esi
430
	movsx	esi,word[edi-0x3000+4]
430
	movsx	esi,word[edi-CURRENT_TASK+4]
431
	add	ebx,esi
431
	add	ebx,esi
432
	add	edx,esi
432
	add	edx,esi
433
;	add	eax,[esi-0x3000+0]
433
;       add     eax,[esi-CURRENT_TASK+0]
434
;	add	ebx,[esi-0x3000+4]
434
;       add     ebx,[esi-CURRENT_TASK+4]
435
;	add	ecx,[esi-0x3000+0]
435
;       add     ecx,[esi-CURRENT_TASK+0]
436
;	add	edx,[esi-0x3000+4]
436
;       add     edx,[esi-CURRENT_TASK+4]
Line 437... Line 437...
437
 
437
 
438
	mov	esi,[0x00003000]
438
	mov	esi,[CURRENT_TASK]
439
	mov	esi,[CLIP_RECTS+esi*4]
439
	mov	esi,[CLIP_RECTS+esi*4]
440
	mov	edi,[esi]
440
	mov	edi,[esi]
441
	or	edi,edi
441
	or	edi,edi
442
	jz	.exit
442
	jz	.exit
Line 455... Line 455...
455
	mov	ecx,[rr.right]
455
	mov	ecx,[rr.right]
456
    @@: jif	edx,l,[rr.bottom],@f
456
    @@: jif	edx,l,[rr.bottom],@f
457
	mov	edx,[rr.bottom]
457
	mov	edx,[rr.bottom]
458
    @@: call	is_intersect_rc
458
    @@: call	is_intersect_rc
459
	jc	.put
459
	jc	.put
460
	cmp	[mouse_invisible],0
460
	cmp	byte[MOUSE_VISIBLE],0
461
	jne	.put
461
	je	.put
462
	call	[SF.draw_mouse_under]
462
	call	[SF.draw_mouse_under]
463
	mov	[mouse_invisible],1
463
	mov	byte[MOUSE_VISIBLE],0
464
  .put: mov	esi,ebx
464
  .put: mov	esi,ebx
465
	sub	esi,[esp+4*4]
465
	sub	esi,[esp+4*4]
466
	imul	esi,[esp+4*8]
466
	imul	esi,[esp+4*8]
467
	mov	edi,eax
467
	mov	edi,eax
468
	sub	edi,[esp+4*7]
468
	sub	edi,[esp+4*7]
469
	lea	edi,[edi*3]
469
	lea	edi,[edi*3]
470
	add	esi,edi
470
	add	esi,edi
471
	add	esi,ebp
471
	add	esi,ebp
472
	mov	edi,[bytes_per_scanline]
472
	mov	edi,[BytesPerScanLine]
473
	imul	edi,ebx
473
	imul	edi,ebx
474
	lea	edi,[edi+eax*2]
474
	lea	edi,[edi+eax*2]
475
	add	edi,[lfb_address]
475
	add	edi,[LFBAddress]
476
  .xxx: push	eax esi edi eax
476
  .xxx: push	eax esi edi eax
477
    @@: lodsd
477
    @@: lodsd
478
	shr	eax,3
478
	shr	eax,3
479
	shl	ax,3
479
	shl	ax,3
480
	shr	eax,2
480
	shr	eax,2
Line 491... Line 491...
491
	inc	dword[esp]
491
	inc	dword[esp]
492
	cmp	[esp],ecx
492
	cmp	[esp],ecx
493
	jl	@b
493
	jl	@b
494
	pop	eax edi esi eax
494
	pop	eax edi esi eax
495
	add	esi,[esp+4*8]
495
	add	esi,[esp+4*8]
496
	add	edi,[bytes_per_scanline]
496
	add	edi,[BytesPerScanLine]
497
	inc	ebx
497
	inc	ebx
498
	cmp	ebx,edx
498
	cmp	ebx,edx
499
	jl	.xxx
499
	jl	.xxx
500
	popad
500
	popad
501
  .skip:
501
  .skip:
Line 519... Line 519...
519
 
519
 
520
	cmp	byte[bg_type],BGT_TILE
520
	cmp	byte[bg_type],BGT_TILE
Line 521... Line 521...
521
	je	.tiled
521
	je	.tiled
522
 
522
 
523
	mov	eax,[bg_width]
523
	mov	eax,[bg_width]
524
	cmp	eax,[screen_width]
524
	cmp	eax,[ScreenWidth]
525
	jne	@f
525
	jne	@f
526
	mov	eax,[bg_height]
526
	mov	eax,[bg_height]
527
	cmp	eax,[screen_height]
527
	cmp	eax,[ScreenHeight]
528
	je	.tiled
528
	je	.tiled
529
    @@:
529
    @@:
Line 530... Line 530...
530
	imul	eax,[bg_width],3
530
	imul	eax,[bg_width],3
531
	mov	[bg_bytes_per_scanline],eax
531
	mov	[bg_BytesPerScanLine],eax
532
 
532
 
533
	mov	eax,[viewport.left]
533
	mov	eax,[viewport.left]
Line 541... Line 541...
541
	je	.color
541
	je	.color
542
    @@:
542
    @@:
543
	cli
543
	cli
Line 544... Line 544...
544
 
544
 
545
	call	[SF.draw_mouse_under]
545
	call	[SF.draw_mouse_under]
Line 546... Line 546...
546
	mov	[mouse_invisible],1
546
	mov	byte[MOUSE_VISIBLE],0
547
 
547
 
548
	mov	esi,[CLIP_RECTS+4]
548
	mov	esi,[CLIP_RECTS+4]
549
	mov	ebp,[esi]
549
	mov	ebp,[esi]
Line 567... Line 567...
567
	;jc	.put
567
	;jc     .put
568
	;cmp	[mouse_invisible],0
568
	;cmp    [mouse_invisible],0
569
	;jne	.put
569
	;jne    .put
570
	;call	[SF.draw_mouse_under]
570
	;call   [SF.draw_mouse_under]
571
	;mov	[mouse_invisible],1
571
	;mov    [mouse_invisible],1
572
  .put: mov	ebp,[bytes_per_scanline]
572
  .put: mov	ebp,[BytesPerScanLine]
573
	imul	ebp,ebx
573
	imul	ebp,ebx
574
	lea	ebp,[ebp+eax*2]
574
	lea	ebp,[ebp+eax*2]
575
	add	ebp,[lfb_address]
575
	add	ebp,[LFBAddress]
576
  .xxx: push	eax ebp
576
  .xxx: push	eax ebp
577
    @@: push	ebp
577
    @@: push	ebp
578
	call	[set_bank]
578
	call	[set_bank]
579
	push	eax edx
579
	push	eax edx
580
	mul	[bg_width]
580
	mul	[bg_width]
581
	div	[screen_width]
581
	div	dword[ScreenWidth]
582
	lea	edi,[eax*3]
582
	lea	edi,[eax*3]
583
	mov	eax,ebx
583
	mov	eax,ebx
584
	mul	[bg_height]
584
	mul	[bg_height]
585
	div	[screen_height]
585
	div	dword[ScreenHeight]
586
	mul	[bg_bytes_per_scanline]
586
	mul	[bg_BytesPerScanLine]
587
	add	edi,eax
587
	add	edi,eax
588
	add	edi,bg_address
588
	add	edi,IMG_BACKGROUND
589
	mov	eax,[edi]
589
	mov	eax,[edi]
590
	shr	eax,3
590
	shr	eax,3
591
	shl	ax,3
591
	shl	ax,3
592
	shr	eax,2
592
	shr	eax,2
593
	shl	al,2
593
	shl	al,2
Line 599... Line 599...
599
	inc	ebp
599
	inc	ebp
600
	inc	eax
600
	inc	eax
601
	cmp	eax,ecx
601
	cmp	eax,ecx
602
	jl	@b
602
	jl	@b
603
	pop	ebp eax
603
	pop	ebp eax
604
	add	ebp,[bytes_per_scanline]
604
	add	ebp,[BytesPerScanLine]
605
	inc	ebx
605
	inc	ebx
606
	cmp	ebx,edx
606
	cmp	ebx,edx
607
	jl	.xxx
607
	jl	.xxx
608
	popad
608
	popad
609
  .skip:
609
  .skip:
Line 615... Line 615...
615
	sti
615
	sti
616
	popad
616
	popad
617
	retn
617
	retn
Line 618... Line 618...
618
 
618
 
619
  .tiled:
619
  .tiled:
620
	mov	eax,bg_address
620
	mov	eax,IMG_BACKGROUND
621
	mov	ebx,[bg_width-2]
621
	mov	ebx,[bg_width-2]
622
	mov	bx,word[bg_height]
622
	mov	bx,word[bg_height]
623
	xor	ecx,ecx
623
	xor	ecx,ecx
624
  .lp1: push	eax
624
  .lp1: push	eax
625
	call	vm_mike_put_image.16.direct
625
	call	vm_mike_put_image.16.direct
626
	pop	eax
626
	pop	eax
627
	rol	ecx,16
627
	rol	ecx,16
628
	add	cx,word[bg_width]
628
	add	cx,word[bg_width]
629
	cmp	cx,word[screen_width]
629
	cmp	cx,word[ScreenWidth]
630
	jae	@f
630
	jae	@f
631
	rol	ecx,16
631
	rol	ecx,16
632
	jmp	.lp1
632
	jmp	.lp1
633
    @@: shr	ecx,16
633
    @@: shr	ecx,16
634
	add	ecx,[bg_height]
634
	add	ecx,[bg_height]
635
	cmp	ecx,[screen_height]
635
	cmp	ecx,[ScreenHeight]
636
	jb	.lp1
636
	jb	.lp1
637
	popad
637
	popad
Line 638... Line 638...
638
	retn
638
	retn
639
 
639
 
640
  .color:
640
  .color:
641
	mov	edi,[bg_address]
641
	mov	edi,[IMG_BACKGROUND]
642
	and	edi,0x00FFFFFF
642
	and	edi,0x00FFFFFF
643
	call	vm_mike_draw_rect.16
643
	call	vm_mike_draw_rect.16
644
	popad
644
	popad
645
	retn
645
	retn