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	ecx
34
	push	ecx
35
	mov	ecx,edi
35
	mov	ecx,edi
Line 36... Line 36...
36
	call	color_24_to_8_bits
36
	call	color_24_to_8_bits
37
	mov	edi,ecx
37
	mov	edi,ecx
38
	pop	ecx
38
	pop	ecx
39
 
39
 
40
	mov	esi,[0x00003000]
40
	mov	esi,[CURRENT_TASK]
41
	mov	esi,[CLIP_RECTS+esi*4]
41
	mov	esi,[CLIP_RECTS+esi*4]
Line 56... Line 56...
56
	mov	ecx,[rr.right]
56
	mov	ecx,[rr.right]
57
    @@: jif	edx,l,[rr.bottom],@f
57
    @@: jif	edx,l,[rr.bottom],@f
58
	mov	edx,[rr.bottom]
58
	mov	edx,[rr.bottom]
59
    @@: call	is_intersect_rc
59
    @@: call	is_intersect_rc
60
	jc	.put
60
	jc	.put
61
	cmp	[mouse_invisible],0
61
	cmp	byte[MOUSE_VISIBLE],0
62
	jne	.put
62
	je	.put
63
	call	[SF.draw_mouse_under]
63
	call	[SF.draw_mouse_under]
64
	mov	[mouse_invisible],1
64
	mov	byte[MOUSE_VISIBLE],0
65
  .put: mov	ebp,[bytes_per_scanline]
65
  .put: mov	ebp,[BytesPerScanLine]
66
	imul	ebp,ebx
66
	imul	ebp,ebx
67
	add	ebp,eax
67
	add	ebp,eax
68
	add	ebp,[lfb_address]
68
	add	ebp,[LFBAddress]
69
  .xxx: push	eax ebp
69
  .xxx: push	eax ebp
70
	xchg	eax,edi
70
	xchg	eax,edi
71
    @@: push	ebp
71
    @@: push	ebp
72
	call	[set_bank]
72
	call	[set_bank]
73
	mov	[ebp],al
73
	mov	[ebp],al
Line 77... Line 77...
77
	inc	edi
77
	inc	edi
78
	cmp	edi,ecx
78
	cmp	edi,ecx
79
	jl	@b
79
	jl	@b
80
	xchg	eax,edi
80
	xchg	eax,edi
81
	pop	ebp eax
81
	pop	ebp eax
82
	add	ebp,[bytes_per_scanline]
82
	add	ebp,[BytesPerScanLine]
83
	inc	ebx
83
	inc	ebx
84
	cmp	ebx,edx
84
	cmp	ebx,edx
85
	jl	.xxx
85
	jl	.xxx
86
	popad
86
	popad
87
  .skip:
87
  .skip:
Line 126... Line 126...
126
	retn
126
	retn
Line 127... Line 127...
127
 
127
 
128
  dl.08.vert_line:
128
  dl.08.vert_line:
129
	test	edi,1
129
	test	edi,1
130
	jnz	.forced
130
	jnz	.forced
131
	mov	esi,[0x00003000]
131
	mov	esi,[CURRENT_TASK]
132
	mov	esi,[CLIP_RECTS+esi*4]
132
	mov	esi,[CLIP_RECTS+esi*4]
133
	mov	edi,[esi]
133
	mov	edi,[esi]
134
	or	edi,edi
134
	or	edi,edi
135
	jz	.exit
135
	jz	.exit
Line 150... Line 150...
150
	mov	edx,[rr.bottom]
150
	mov	edx,[rr.bottom]
151
	dec	edx
151
	dec	edx
152
  .draw:
152
  .draw:
153
    @@: call	is_intersect_vln
153
    @@: call	is_intersect_vln
154
	jc	.put
154
	jc	.put
155
	cmp	[mouse_invisible],0
155
	cmp	byte[MOUSE_VISIBLE],0
156
	jne	.put
156
	je	.put
157
	call	[SF.draw_mouse_under]
157
	call	[SF.draw_mouse_under]
158
	mov	[mouse_invisible],1
158
	mov	byte[MOUSE_VISIBLE],0
159
  .put: mov	ebp,[bytes_per_scanline]
159
  .put: mov	ebp,[BytesPerScanLine]
160
	imul	ebp,ebx
160
	imul	ebp,ebx
161
	add	ebp,eax
161
	add	ebp,eax
162
	add	ebp,[lfb_address]
162
	add	ebp,[LFBAddress]
163
    @@: push	ebp
163
    @@: push	ebp
164
	call	[set_bank]
164
	call	[set_bank]
165
	test	ecx,0x01000000
165
	test	ecx,0x01000000
166
	jz	.dr
166
	jz	.dr
167
	movzx	ecx,byte[ebp]
167
	movzx	ecx,byte[ebp]
Line 174... Line 174...
174
;       test    ecx,0x01000000
174
;       test    ecx,0x01000000
175
;       jz      .dr
175
;       jz      .dr
176
;       mov     cx,[ebp]
176
;       mov     cx,[ebp]
177
;       not     cx
177
;       not     cx
178
;  .dr: mov     [ebp],cx
178
;  .dr: mov     [ebp],cx
179
	add	ebp,[bytes_per_scanline]
179
	add	ebp,[BytesPerScanLine]
180
	inc	ebx
180
	inc	ebx
181
	cmp	ebx,edx
181
	cmp	ebx,edx
182
	jle	@b
182
	jle	@b
183
  .skip:
183
  .skip:
184
	add	esi,SR
184
	add	esi,SR
Line 207... Line 207...
207
	jmp	.draw
207
	jmp	.draw
Line 208... Line 208...
208
 
208
 
209
  dl.08.horz_line:
209
  dl.08.horz_line:
210
	test	edi,1
210
	test	edi,1
211
	jnz	.forced
211
	jnz	.forced
212
	mov	esi,[0x00003000]
212
	mov	esi,[CURRENT_TASK]
213
	mov	esi,[CLIP_RECTS+esi*4]
213
	mov	esi,[CLIP_RECTS+esi*4]
214
	mov	edi,[esi]
214
	mov	edi,[esi]
215
	or	edi,edi
215
	or	edi,edi
216
	jz	.exit
216
	jz	.exit
Line 231... Line 231...
231
	mov	edx,[rr.right]
231
	mov	edx,[rr.right]
232
	dec	edx
232
	dec	edx
233
  .draw:
233
  .draw:
234
    @@: call	is_intersect_hln
234
    @@: call	is_intersect_hln
235
	jc	.put
235
	jc	.put
236
	cmp	[mouse_invisible],0
236
	cmp	byte[MOUSE_VISIBLE],0
237
	jne	.put
237
	je	.put
238
	call	[SF.draw_mouse_under]
238
	call	[SF.draw_mouse_under]
239
	mov	[mouse_invisible],1
239
	mov	byte[MOUSE_VISIBLE],0
240
  .put: mov	ebp,[bytes_per_scanline]
240
  .put: mov	ebp,[BytesPerScanLine]
241
	imul	ebp,eax
241
	imul	ebp,eax
242
	add	ebp,ebx
242
	add	ebp,ebx
243
	add	ebp,[lfb_address]
243
	add	ebp,[LFBAddress]
244
    @@: push	ebp
244
    @@: push	ebp
245
	call	[set_bank]
245
	call	[set_bank]
246
	test	ecx,0x01000000
246
	test	ecx,0x01000000
247
	jz	.dr
247
	jz	.dr
248
	movzx	ecx,byte[ebp]
248
	movzx	ecx,byte[ebp]
Line 329... Line 329...
329
; edi = 0x00000001 force
329
; edi = 0x00000001 force
330
;-----------------------------------------------------------------------------
330
;-----------------------------------------------------------------------------
331
begin
331
begin
332
	pushad
332
	pushad
333
	cli
333
	cli
334
	mov	edx,[bytes_per_scanline]
334
	mov	edx,[BytesPerScanLine]
335
	imul	edx,ebx
335
	imul	edx,ebx
336
	add	edx,eax
336
	add	edx,eax
337
	add	edx,[lfb_address]
337
	add	edx,[LFBAddress]
338
	test	edi,1
338
	test	edi,1
339
	jnz	.forced
339
	jnz	.forced
340
	mov	esi,[0x00003000]
340
	mov	esi,[CURRENT_TASK]
341
	mov	esi,[CLIP_RECTS+esi*4]
341
	mov	esi,[CLIP_RECTS+esi*4]
342
	mov	edi,[esi]
342
	mov	edi,[esi]
343
	or	edi,edi
343
	or	edi,edi
344
	jz	.exit
344
	jz	.exit
345
	add	esi,4
345
	add	esi,4
Line 348... Line 348...
348
	jif	ebx,l,[rr.top],.skip
348
	jif	ebx,l,[rr.top],.skip
349
	jif	ebx,ge,[rr.bottom],.skip
349
	jif	ebx,ge,[rr.bottom],.skip
350
	call	get_cursor_rect
350
	call	get_cursor_rect
351
	call	is_intersect_pt
351
	call	is_intersect_pt
352
	jc	.put
352
	jc	.put
353
	cmp	[mouse_invisible],0
353
	cmp	byte[MOUSE_VISIBLE],0
354
	jne	.put
354
	je	.put
355
	call	[SF.draw_mouse_under]
355
	call	[SF.draw_mouse_under]
356
	mov	[mouse_invisible],1
356
	mov	byte[MOUSE_VISIBLE],0
357
  .put: push	edx
357
  .put: push	edx
358
	call	[set_bank]
358
	call	[set_bank]
359
	pop	edx
359
	pop	edx
360
	test	ecx,0x01000000
360
	test	ecx,0x01000000
361
	jz	.lp1
361
	jz	.lp1
Line 402... Line 402...
402
;-----------------------------------------------------------------------------
402
;-----------------------------------------------------------------------------
403
begin
403
begin
404
	pushad
404
	pushad
405
	cli
405
	cli
Line 406... Line 406...
406
 
406
 
407
	imul	ebx,[bytes_per_scanline]
407
	imul	ebx,[BytesPerScanLine]
408
	add	eax,ebx
408
	add	eax,ebx
409
	add	eax,[lfb_address]
409
	add	eax,[LFBAddress]
410
	push	eax
410
	push	eax
411
	call	[set_bank]
411
	call	[set_bank]
412
	pop	eax
412
	pop	eax
413
	movzx	eax,byte[ebp]
413
	movzx	eax,byte[ebp]
Line 447... Line 447...
447
	movsx	edx,word[esp+4*4]
447
	movsx	edx,word[esp+4*4]
448
	lea	edi,[ecx*3]
448
	lea	edi,[ecx*3]
449
	push	edi
449
	push	edi
450
	add	ecx,eax
450
	add	ecx,eax
451
	add	edx,ebx
451
	add	edx,ebx
452
	mov	edi,[0x00003010]
452
	mov	edi,[TASK_BASE]
453
	movsx	esi,word[edi-0x3000+0]
453
	movsx	esi,word[edi-CURRENT_TASK+0]
454
	add	eax,esi
454
	add	eax,esi
455
	add	ecx,esi
455
	add	ecx,esi
456
	movsx	esi,word[edi-0x3000+4]
456
	movsx	esi,word[edi-CURRENT_TASK+4]
457
	add	ebx,esi
457
	add	ebx,esi
458
	add	edx,esi
458
	add	edx,esi
459
;       add     eax,[esi-0x3000+0]
459
;       add     eax,[esi-CURRENT_TASK+0]
460
;       add     ebx,[esi-0x3000+4]
460
;       add     ebx,[esi-CURRENT_TASK+4]
461
;       add     ecx,[esi-0x3000+0]
461
;       add     ecx,[esi-CURRENT_TASK+0]
462
;       add     edx,[esi-0x3000+4]
462
;       add     edx,[esi-CURRENT_TASK+4]
Line 463... Line 463...
463
 
463
 
464
	mov	esi,[0x00003000]
464
	mov	esi,[CURRENT_TASK]
465
	mov	esi,[CLIP_RECTS+esi*4]
465
	mov	esi,[CLIP_RECTS+esi*4]
466
	mov	edi,[esi]
466
	mov	edi,[esi]
467
	or	edi,edi
467
	or	edi,edi
468
	jz	.exit
468
	jz	.exit
Line 481... Line 481...
481
	mov	ecx,[rr.right]
481
	mov	ecx,[rr.right]
482
    @@: jif	edx,l,[rr.bottom],@f
482
    @@: jif	edx,l,[rr.bottom],@f
483
	mov	edx,[rr.bottom]
483
	mov	edx,[rr.bottom]
484
    @@: call	is_intersect_rc
484
    @@: call	is_intersect_rc
485
	jc	.put
485
	jc	.put
486
	cmp	[mouse_invisible],0
486
	cmp	byte[MOUSE_VISIBLE],0
487
	jne	.put
487
	je	.put
488
	call	[SF.draw_mouse_under]
488
	call	[SF.draw_mouse_under]
489
	mov	[mouse_invisible],1
489
	mov	byte[MOUSE_VISIBLE],0
490
  .put: mov	esi,ebx
490
  .put: mov	esi,ebx
491
	sub	esi,[esp+4*4]
491
	sub	esi,[esp+4*4]
492
	imul	esi,[esp+4*8]
492
	imul	esi,[esp+4*8]
493
	mov	edi,eax
493
	mov	edi,eax
494
	sub	edi,[esp+4*7]
494
	sub	edi,[esp+4*7]
495
	lea	edi,[edi*3]
495
	lea	edi,[edi*3]
496
	add	esi,edi
496
	add	esi,edi
497
	add	esi,ebp
497
	add	esi,ebp
498
	mov	edi,[bytes_per_scanline]
498
	mov	edi,[BytesPerScanLine]
499
	imul	edi,ebx
499
	imul	edi,ebx
500
	add	edi,eax
500
	add	edi,eax
501
	add	edi,[lfb_address]
501
	add	edi,[LFBAddress]
502
  .xxx: push	eax esi edi eax
502
  .xxx: push	eax esi edi eax
503
    @@: lodsd
503
    @@: lodsd
504
	xchg	eax,ecx
504
	xchg	eax,ecx
505
	call	color_24_to_8_bits
505
	call	color_24_to_8_bits
506
	xchg	eax,ecx
506
	xchg	eax,ecx
Line 515... Line 515...
515
	inc	dword[esp]
515
	inc	dword[esp]
516
	cmp	[esp],ecx
516
	cmp	[esp],ecx
517
	jl	@b
517
	jl	@b
518
	pop	eax edi esi eax
518
	pop	eax edi esi eax
519
	add	esi,[esp+4*8]
519
	add	esi,[esp+4*8]
520
	add	edi,[bytes_per_scanline]
520
	add	edi,[BytesPerScanLine]
521
	inc	ebx
521
	inc	ebx
522
	cmp	ebx,edx
522
	cmp	ebx,edx
523
	jl	.xxx
523
	jl	.xxx
524
	popad
524
	popad
525
  .skip:
525
  .skip:
Line 547... Line 547...
547
	mov	edx,[viewport.bottom]
547
	mov	edx,[viewport.bottom]
Line 548... Line 548...
548
 
548
 
Line 549... Line 549...
549
	cli
549
	cli
550
 
550
 
Line 551... Line 551...
551
	call	[SF.draw_mouse_under]
551
	call	[SF.draw_mouse_under]
552
	mov	[mouse_invisible],1
552
	mov	byte[MOUSE_VISIBLE],0
553
 
553
 
554
	mov	esi,[CLIP_RECTS+4]
554
	mov	esi,[CLIP_RECTS+4]
Line 643... Line 643...
643
	mov	eax,[bg_height]
643
	mov	eax,[bg_height]
644
	cmp	eax,[screen_height]
644
	cmp	eax,[screen_height]
645
	je	.tiled
645
	je	.tiled
646
    @@:
646
    @@:
647
	imul	eax,[bg_width],3
647
	imul	eax,[bg_width],3
648
	mov	[bg_bytes_per_scanline],eax
648
	mov	[bg_BytesPerScanLine],eax
Line 649... Line 649...
649
 
649
 
650
	mov	eax,[viewport.left]
650
	mov	eax,[viewport.left]
651
	mov	ebx,[viewport.top]
651
	mov	ebx,[viewport.top]
652
	mov	ecx,[viewport.right]
652
	mov	ecx,[viewport.right]
Line 684... Line 684...
684
	jc	.put
684
	jc	.put
685
	cmp	[mouse_invisible],0
685
	cmp	[mouse_invisible],0
686
	jne	.put
686
	jne	.put
687
	call	[SF.draw_mouse_under]
687
	call	[SF.draw_mouse_under]
688
	mov	[mouse_invisible],1
688
	mov	[mouse_invisible],1
689
  .put: mov	ebp,[bytes_per_scanline]
689
  .put: mov	ebp,[BytesPerScanLine]
690
	imul	ebp,ebx
690
	imul	ebp,ebx
691
	add	ebp,eax
691
	add	ebp,eax
692
	add	ebp,[lfb_address]
692
	add	ebp,[LFBAddress]
693
  .xxx: push	eax ebp
693
  .xxx: push	eax ebp
694
    @@: push	ebp
694
    @@: push	ebp
695
	call	[set_bank]
695
	call	[set_bank]
696
	mov	[ebp],di
696
	mov	[ebp],di
697
	pop	ebp
697
	pop	ebp
Line 699... Line 699...
699
	inc	ebp
699
	inc	ebp
700
	inc	eax
700
	inc	eax
701
	cmp	eax,ecx
701
	cmp	eax,ecx
702
	jl	@b
702
	jl	@b
703
	pop	ebp eax
703
	pop	ebp eax
704
	add	ebp,[bytes_per_scanline]
704
	add	ebp,[BytesPerScanLine]
705
	inc	ebx
705
	inc	ebx
706
	cmp	ebx,edx
706
	cmp	ebx,edx
707
	jl	.xxx
707
	jl	.xxx
708
	popad
708
	popad
709
  .skip:
709
  .skip:
Line 715... Line 715...
715
	sti
715
	sti
716
	popad
716
	popad
717
	retn
717
	retn
Line 718... Line 718...
718
 
718
 
719
  .tiled:
719
  .tiled:
720
	mov	eax,bg_address
720
	mov	eax,IMG_BACKGROUND
721
	mov	ebx,[bg_width-2]
721
	mov	ebx,[bg_width-2]
722
	mov	bx,word[bg_height]
722
	mov	bx,word[bg_height]
723
	xor	ecx,ecx
723
	xor	ecx,ecx
724
  .lp1: push	eax
724
  .lp1: push	eax
Line 736... Line 736...
736
	jb	.lp1
736
	jb	.lp1
737
	popad
737
	popad
738
	retn
738
	retn
Line 739... Line 739...
739
 
739
 
740
  .color:
740
  .color:
741
	mov	edi,[bg_address]
741
	mov	edi,[IMG_BACKGROUND]
742
	and	edi,0x00FFFFFF
742
	and	edi,0x00FFFFFF
743
	call	vm_mike_draw_rect.08
743
	call	vm_mike_draw_rect.08
744
	popad
744
	popad
745
	retn
745
	retn