[no subject]

From: "Vlad Pylin" <pylin_vlad@xxxxxxx>
Date: Tue, 29 Jul 2003 20:01:28 +0400

-----Original Message-----
From: "Eckhard Stolberg" <Eckhard_Stolberg@xxxxxx>
To: <stella@xxxxxxxxxxx>
Date: Sat, 26 Jul 2003 14:55:08 +0200
Subject: Re: [stella] VDELP problem

> > I have a problem with the damn VDELP.
> >
> > When use only VDELP0 all is just perfect!
> > But after adding VDELP1 I have following troubles:
> > P0 and P1 sprites are showed interlaced (when they are on the same
> scanline). I have the feeling that VDELP0 and VDELP1 use the same additional
> buffer register.
> >
> 
> No, there are individual buffer registers for GRP0 and GRP1, but
> how they are written to isn't explaind that well in the Stella
> programmers guide.
> 
[skipped]
> 
> Ciao, Eckhard Stolberg
> 

  Thanks a lot! I've got the idea. Actually I don't care about single line movement resolution, because my goal was saving some extra cycles by not using player buffer. But now it seems that there will be no optimization (or even worse), because I'll have to change some code and waste some cycles.

  Now about optimization. Currently I use the following code for displaying sprites and other objects (it includes the checking of range, where the entity is visible).

---code begins here

	; calc current PF's graphics line (div by 4)

	LDA	ScanLine	; 3
	CLC			; 2
	ADC	PFRY		; 3
	LSR			; 2
	LSR			; 2
	TAY			; 2
	LDA	(PFPtr0),Y	; 5
	; = 21 = 145
	
	; start new scanline	

	STA	PF0		; 3	set PF graphics

	LDA	EnemyBuff	; 3	set enemy's graph
	STA	GRP1		; 3
	
	LDA	ObjBuff		; 3	set obj's graph
	STA	ENABL		; 3

	LDA	(PFPtr1),Y	; 5
	STA	PF1		; 3 = 23

	LDA	(PFPtr2),Y	; 5
	STA	PF2		; 3 = 26	set remaining PF graph
	
; prepare P0 graphics for the next scanline

CheckP0_0
	LDA	#0		; 2
	STA	ObjBuff         ; 3  zero out object's buffer

        LDX	ScanLine	; 3 = 37
	
PrepareP0Graph_0
	CPX	P0RY		; 3  P0RY contains the upper coord
	BCS	Waste1_27 	; 2
	CPX	Temp4		; 3  contains lower coord
	BMI	Waste1_22 	; 2	
 
	; C is always set here
	LDA	P0RY		; 3
	SBC	ScanLine	; 3
	TAY			; 2

	LDA	(P0GrPtr),Y	; 5
	STA	GRP0            ; 3
	LDA	P0Colors-1,Y	; 4
	STA	COLUP0		; 3
	; = 33 = 69
	
FinishP0_0

PrepareP1Graph_0
	CPX	EnemyRY		; 3
	BCS	Waste2_27 	; 2
	CPX	Temp3		; 3
	BMI	Waste2_22 	; 2	

	; C is always set here
	LDA	EnemyRY		; 3
	SBC	ScanLine	; 3
	TAY			; 2
	
	LDA	(EnemyGrPtr),Y	; 5
	STA	EnemyBuff	; 3
	LDA	EnemyColors-1,Y	; 4
	STA	COLUP1		; 3
	; = 33 = 101
	
FinishP1_0

PrepareBLGraph_0
	CPX	ObjRY			; 3
	BCS	Waste3_14 	; 2
	CPX	Temp5			; 3
	BMI	Waste3_9  	; 2	
	LDA	#M_Enable		; 2
	STA	ObjBuff			; 3
	DEC	ScanLine		; 5
	; = 20 = 118

FinishBL_0

Finish_0
	NOP
	STA	Temp ; 5 cycles available
	BNE	MainParScanLoop	; 3 next scanline
	; = 126
        JMP	FinishScanLoop	; 6


Does anyone know if it is possible to optimize this? Maybe there are other methods to check if the entity must be shown?

PS. I used to use line counters which were decremented every time another line had been shawn. This method have some disadvantages.

>From Russia with love!



----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread