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,3
39
	shl	al,3
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.15.vert_line:
134
  dl.15.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]
Line 177... Line 177...
177
;	test	ecx,0x01000000
177
;       test    ecx,0x01000000
178
;	jz	.dr
178
;       jz      .dr
179
;	mov	cx,[ebp]
179
;       mov     cx,[ebp]
180
;	not	cx
180
;       not     cx
181
;  .dr:	mov	[ebp],cx
181
;  .dr: mov     [ebp],cx
182
	add	ebp,[bytes_per_scanline]
182
	add	ebp,[BytesPerScanLine]
183
	inc	ebx
183
	inc	ebx
184
	cmp	ebx,edx
184
	cmp	ebx,edx
185
	jle	@b
185
	jle	@b
186
  .skip:
186
  .skip:
187
	add	esi,SR
187
	add	esi,SR
Line 210... Line 210...
210
	jmp	.draw
210
	jmp	.draw
Line 211... Line 211...
211
 
211
 
212
  dl.15.horz_line:
212
  dl.15.horz_line:
213
	test	edi,1
213
	test	edi,1
214
	jnz	.forced
214
	jnz	.forced
215
	mov	esi,[0x00003000]
215
	mov	esi,[CURRENT_TASK]
216
	mov	esi,[CLIP_RECTS+esi*4]
216
	mov	esi,[CLIP_RECTS+esi*4]
217
	mov	edi,[esi]
217
	mov	edi,[esi]
218
	or	edi,edi
218
	or	edi,edi
219
	jz	.exit
219
	jz	.exit
Line 234... Line 234...
234
	mov	edx,[rr.right]
234
	mov	edx,[rr.right]
235
	dec	edx
235
	dec	edx
236
  .draw:
236
  .draw:
237
    @@: call	is_intersect_hln
237
    @@: call	is_intersect_hln
238
	jc	.put
238
	jc	.put
239
	cmp	[mouse_invisible],0
239
	cmp	byte[MOUSE_VISIBLE],0
240
	jne	.put
240
	je	.put
241
	call	[SF.draw_mouse_under]
241
	call	[SF.draw_mouse_under]
242
	mov	[mouse_invisible],1
242
	mov	byte[MOUSE_VISIBLE],0
243
  .put: mov	ebp,[bytes_per_scanline]
243
  .put: mov	ebp,[BytesPerScanLine]
244
	imul	ebp,eax
244
	imul	ebp,eax
245
	lea	ebp,[ebp+ebx*2]
245
	lea	ebp,[ebp+ebx*2]
246
	add	ebp,[lfb_address]
246
	add	ebp,[LFBAddress]
247
    @@: push	ebp
247
    @@: push	ebp
248
	call	[set_bank]
248
	call	[set_bank]
249
	test	ecx,0x01000000
249
	test	ecx,0x01000000
250
	jz	.dr
250
	jz	.dr
251
	mov	cx,[ebp]
251
	mov	cx,[ebp]
Line 298... Line 298...
298
; edi = 0x00000001 force
298
; edi = 0x00000001 force
299
;-----------------------------------------------------------------------------
299
;-----------------------------------------------------------------------------
300
begin
300
begin
301
	pushad
301
	pushad
302
	cli
302
	cli
303
	mov	edx,[bytes_per_scanline]
303
	mov	edx,[BytesPerScanLine]
304
	imul	edx,ebx
304
	imul	edx,ebx
305
	lea	edx,[edx+eax*2]
305
	lea	edx,[edx+eax*2]
306
	add	edx,[lfb_address]
306
	add	edx,[LFBAddress]
307
	test	edi,1
307
	test	edi,1
308
	jnz	.forced
308
	jnz	.forced
309
	mov	esi,[0x00003000]
309
	mov	esi,[CURRENT_TASK]
310
	mov	esi,[CLIP_RECTS+esi*4]
310
	mov	esi,[CLIP_RECTS+esi*4]
311
	mov	edi,[esi]
311
	mov	edi,[esi]
312
	or	edi,edi
312
	or	edi,edi
313
	jz	.exit
313
	jz	.exit
314
	add	esi,4
314
	add	esi,4
Line 317... Line 317...
317
	jif	ebx,l,[rr.top],.skip
317
	jif	ebx,l,[rr.top],.skip
318
	jif	ebx,ge,[rr.bottom],.skip
318
	jif	ebx,ge,[rr.bottom],.skip
319
	call	get_cursor_rect
319
	call	get_cursor_rect
320
	call	is_intersect_pt
320
	call	is_intersect_pt
321
	jc	.put
321
	jc	.put
322
	cmp	[mouse_invisible],0
322
	cmp	byte[MOUSE_VISIBLE],0
323
	jne	.put
323
	je	.put
324
	call	[SF.draw_mouse_under]
324
	call	[SF.draw_mouse_under]
325
	mov	[mouse_invisible],1
325
	mov	byte[MOUSE_VISIBLE],0
326
  .put: push	edx
326
  .put: push	edx
327
	call	[set_bank]
327
	call	[set_bank]
328
	pop	edx
328
	pop	edx
329
	test	ecx,0x01000000
329
	test	ecx,0x01000000
330
	jz	.lp1
330
	jz	.lp1
Line 374... Line 374...
374
;-----------------------------------------------------------------------------
374
;-----------------------------------------------------------------------------
375
begin
375
begin
376
	pushad
376
	pushad
377
	cli
377
	cli
Line 378... Line 378...
378
 
378
 
379
	imul	ebx,[bytes_per_scanline]
379
	imul	ebx,[BytesPerScanLine]
380
	shl	eax,1
380
	shl	eax,1
381
	add	eax,ebx
381
	add	eax,ebx
382
	add	eax,[lfb_address]
382
	add	eax,[LFBAddress]
383
	push	eax
383
	push	eax
384
	call	[set_bank]
384
	call	[set_bank]
385
	pop	eax
385
	pop	eax
Line 426... Line 426...
426
	movsx	edx,word[esp+4*4]
426
	movsx	edx,word[esp+4*4]
427
	lea	edi,[ecx*3]
427
	lea	edi,[ecx*3]
428
	push	edi
428
	push	edi
429
	add	ecx,eax
429
	add	ecx,eax
430
	add	edx,ebx
430
	add	edx,ebx
431
	mov	edi,[0x00003010]
431
	mov	edi,[TASK_BASE]
432
	movsx	esi,word[edi-0x3000+0]
432
	movsx	esi,word[edi-CURRENT_TASK+0]
433
	add	eax,esi
433
	add	eax,esi
434
	add	ecx,esi
434
	add	ecx,esi
435
	movsx	esi,word[edi-0x3000+4]
435
	movsx	esi,word[edi-CURRENT_TASK+4]
436
	add	ebx,esi
436
	add	ebx,esi
437
	add	edx,esi
437
	add	edx,esi
438
;	add	eax,[esi-0x3000+0]
438
;       add     eax,[esi-CURRENT_TASK+0]
439
;	add	ebx,[esi-0x3000+4]
439
;       add     ebx,[esi-CURRENT_TASK+4]
440
;	add	ecx,[esi-0x3000+0]
440
;       add     ecx,[esi-CURRENT_TASK+0]
441
;	add	edx,[esi-0x3000+4]
441
;       add     edx,[esi-CURRENT_TASK+4]
Line 442... Line 442...
442
 
442
 
443
	mov	esi,[0x00003000]
443
	mov	esi,[CURRENT_TASK]
444
	mov	esi,[CLIP_RECTS+esi*4]
444
	mov	esi,[CLIP_RECTS+esi*4]
445
	mov	edi,[esi]
445
	mov	edi,[esi]
446
	or	edi,edi
446
	or	edi,edi
447
	jz	.exit
447
	jz	.exit
Line 460... Line 460...
460
	mov	ecx,[rr.right]
460
	mov	ecx,[rr.right]
461
    @@: jif	edx,l,[rr.bottom],@f
461
    @@: jif	edx,l,[rr.bottom],@f
462
	mov	edx,[rr.bottom]
462
	mov	edx,[rr.bottom]
463
    @@: call	is_intersect_rc
463
    @@: call	is_intersect_rc
464
	jc	.put
464
	jc	.put
465
	cmp	[mouse_invisible],0
465
	cmp	byte[MOUSE_VISIBLE],0
466
	jne	.put
466
	je	.put
467
	call	[SF.draw_mouse_under]
467
	call	[SF.draw_mouse_under]
468
	mov	[mouse_invisible],1
468
	mov	byte[MOUSE_VISIBLE],0
469
  .put: mov	esi,ebx
469
  .put: mov	esi,ebx
470
	sub	esi,[esp+4*4]
470
	sub	esi,[esp+4*4]
471
	imul	esi,[esp+4*8]
471
	imul	esi,[esp+4*8]
472
	mov	edi,eax
472
	mov	edi,eax
473
	sub	edi,[esp+4*7]
473
	sub	edi,[esp+4*7]
474
	lea	edi,[edi*3]
474
	lea	edi,[edi*3]
475
	add	esi,edi
475
	add	esi,edi
476
	add	esi,ebp
476
	add	esi,ebp
477
	mov	edi,[bytes_per_scanline]
477
	mov	edi,[BytesPerScanLine]
478
	imul	edi,ebx
478
	imul	edi,ebx
479
	lea	edi,[edi+eax*2]
479
	lea	edi,[edi+eax*2]
480
	add	edi,[lfb_address]
480
	add	edi,[LFBAddress]
481
  .xxx: push	eax esi edi eax
481
  .xxx: push	eax esi edi eax
482
    @@: lodsd
482
    @@: lodsd
483
	shr	eax,3
483
	shr	eax,3
484
	shl	ax,3
484
	shl	ax,3
485
	shr	eax,3
485
	shr	eax,3
Line 496... Line 496...
496
	inc	dword[esp]
496
	inc	dword[esp]
497
	cmp	[esp],ecx
497
	cmp	[esp],ecx
498
	jl	@b
498
	jl	@b
499
	pop	eax edi esi eax
499
	pop	eax edi esi eax
500
	add	esi,[esp+4*8]
500
	add	esi,[esp+4*8]
501
	add	edi,[bytes_per_scanline]
501
	add	edi,[BytesPerScanLine]
502
	inc	ebx
502
	inc	ebx
503
	cmp	ebx,edx
503
	cmp	ebx,edx
504
	jl	.xxx
504
	jl	.xxx
505
	popad
505
	popad
506
  .skip:
506
  .skip:
Line 524... Line 524...
524
 
524
 
525
	cmp	byte[bg_type],BGT_TILE
525
	cmp	byte[bg_type],BGT_TILE
Line 526... Line 526...
526
	je	.tiled
526
	je	.tiled
527
 
527
 
528
	mov	eax,[bg_width]
528
	mov	eax,[bg_width]
529
	cmp	eax,[screen_width]
529
	cmp	eax,[ScreenWidth]
530
	jne	@f
530
	jne	@f
531
	mov	eax,[bg_height]
531
	mov	eax,[bg_height]
532
	cmp	eax,[screen_height]
532
	cmp	eax,[ScreenHeight]
533
	je	.tiled
533
	je	.tiled
534
    @@:
534
    @@:
Line 535... Line 535...
535
	imul	eax,[bg_width],3
535
	imul	eax,[bg_width],3
536
	mov	[bg_bytes_per_scanline],eax
536
	mov	[bg_BytesPerScanLine],eax
537
 
537
 
538
	mov	eax,[viewport.left]
538
	mov	eax,[viewport.left]
Line 546... Line 546...
546
	je	.color
546
	je	.color
547
    @@:
547
    @@:
548
	cli
548
	cli
Line 549... Line 549...
549
 
549
 
550
	call	[SF.draw_mouse_under]
550
	call	[SF.draw_mouse_under]
Line 551... Line 551...
551
	mov	[mouse_invisible],1
551
	mov	byte[MOUSE_VISIBLE],0
552
 
552
 
553
	mov	esi,[CLIP_RECTS+4]
553
	mov	esi,[CLIP_RECTS+4]
554
	mov	ebp,[esi]
554
	mov	ebp,[esi]
Line 572... Line 572...
572
	;jc	.put
572
	;jc     .put
573
	;cmp	[mouse_invisible],0
573
	;cmp    [mouse_invisible],0
574
	;jne	.put
574
	;jne    .put
575
	;call	[SF.draw_mouse_under]
575
	;call   [SF.draw_mouse_under]
576
	;mov	[mouse_invisible],1
576
	;mov    [mouse_invisible],1
577
  .put: mov	ebp,[bytes_per_scanline]
577
  .put: mov	ebp,[BytesPerScanLine]
578
	imul	ebp,ebx
578
	imul	ebp,ebx
579
	lea	ebp,[ebp+eax*2]
579
	lea	ebp,[ebp+eax*2]
580
	add	ebp,[lfb_address]
580
	add	ebp,[LFBAddress]
581
  .xxx: push	eax ebp
581
  .xxx: push	eax ebp
582
    @@: push	ebp
582
    @@: push	ebp
583
	call	[set_bank]
583
	call	[set_bank]
584
	push	eax edx
584
	push	eax edx
585
	mul	[bg_width]
585
	mul	[bg_width]
586
	div	[screen_width]
586
	div	dword[ScreenWidth]
587
	lea	edi,[eax*3]
587
	lea	edi,[eax*3]
588
	mov	eax,ebx
588
	mov	eax,ebx
589
	mul	[bg_height]
589
	mul	[bg_height]
590
	div	[screen_height]
590
	div	dword[ScreenHeight]
591
	mul	[bg_bytes_per_scanline]
591
	mul	[bg_BytesPerScanLine]
592
	add	edi,eax
592
	add	edi,eax
593
	add	edi,bg_address
593
	add	edi,IMG_BACKGROUND
594
	mov	eax,[edi]
594
	mov	eax,[edi]
595
	shr	eax,3
595
	shr	eax,3
596
	shl	ax,3
596
	shl	ax,3
597
	shr	eax,3
597
	shr	eax,3
598
	shl	al,3
598
	shl	al,3
Line 604... Line 604...
604
	inc	ebp
604
	inc	ebp
605
	inc	eax
605
	inc	eax
606
	cmp	eax,ecx
606
	cmp	eax,ecx
607
	jl	@b
607
	jl	@b
608
	pop	ebp eax
608
	pop	ebp eax
609
	add	ebp,[bytes_per_scanline]
609
	add	ebp,[BytesPerScanLine]
610
	inc	ebx
610
	inc	ebx
611
	cmp	ebx,edx
611
	cmp	ebx,edx
612
	jl	.xxx
612
	jl	.xxx
613
	popad
613
	popad
614
  .skip:
614
  .skip:
Line 620... Line 620...
620
	sti
620
	sti
621
	popad
621
	popad
622
	retn
622
	retn
Line 623... Line 623...
623
 
623
 
624
  .tiled:
624
  .tiled:
625
	mov	eax,bg_address
625
	mov	eax,IMG_BACKGROUND
626
	mov	ebx,[bg_width-2]
626
	mov	ebx,[bg_width-2]
627
	mov	bx,word[bg_height]
627
	mov	bx,word[bg_height]
628
	xor	ecx,ecx
628
	xor	ecx,ecx
629
  .lp1: push	eax
629
  .lp1: push	eax
630
	call	vm_mike_put_image.15.direct
630
	call	vm_mike_put_image.15.direct
631
	pop	eax
631
	pop	eax
632
	rol	ecx,16
632
	rol	ecx,16
633
	add	cx,word[bg_width]
633
	add	cx,word[bg_width]
634
	cmp	cx,word[screen_width]
634
	cmp	cx,word[ScreenWidth]
635
	jae	@f
635
	jae	@f
636
	rol	ecx,16
636
	rol	ecx,16
637
	jmp	.lp1
637
	jmp	.lp1
638
    @@: shr	ecx,16
638
    @@: shr	ecx,16
639
	add	ecx,[bg_height]
639
	add	ecx,[bg_height]
640
	cmp	ecx,[screen_height]
640
	cmp	ecx,[ScreenHeight]
641
	jb	.lp1
641
	jb	.lp1
642
	popad
642
	popad
Line 643... Line 643...
643
	retn
643
	retn
644
 
644
 
645
  .color:
645
  .color:
646
	mov	edi,[bg_address]
646
	mov	edi,[IMG_BACKGROUND]
647
	and	edi,0x00FFFFFF
647
	and	edi,0x00FFFFFF
648
	call	vm_mike_draw_rect.15
648
	call	vm_mike_draw_rect.15
649
	popad
649
	popad
650
	retn
650
	retn