RE: [stella] "Zombie" optimizations

Subject: RE: [stella] "Zombie" optimizations
From: "Dennis Debro" <ddebro@xxxxxxxxxxxxx>
Date: Fri, 17 Jan 2003 08:37:51 -0500
Hi Thomas,
 
> The known 'elegant' DCP-Solution needs 26 cycles and 11 of those
cycles
> are overhead for just determining wether to draw or not. The new
> solution reduces that overhead down to only 5 cycles!

I changed the skipDraw routine slightly for my prototype release of
Climber 5 too. It's not as elegant but it saved me a few cycles. During
VBLANK I set the x-register as an offset...

	sec
	sbc verPosP0
	adc #PLAYER_HEIGHT
	tax

Then in the kernel for each new scanline I would do...
	inx				;2
	bmi .skipDraw		;2³
	cpx #PLAYER_HEIGHT+1	;2
	bcs .skipDraw		;2³
	lda playerGraphics,x	;3
	.
	.
	.
This gave me roughly 7-8 cycles for overhead vs. 9-10 cycles used in the
non-illegal opcode version of skipDraw. I'm not counting the increment
of the x-register because that's a given. It takes more bytes but it
saves those precious CPU cycles.

What do you think? I'd love to hear comments on how it could've been
improved.

I will study this optimization too. It will help me get more familiar
with your tricks :)

Take care,
Dennis



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


Current Thread