[stella] bzoneRepos question

Subject: [stella] bzoneRepos question
From: <richbon-lists4800@xxxxxxxxxxxxxx>
Date: Tue, 7 Jun 2005 22:30:23 -0400
Hi All...

  I have a question about the bzoneRepos (horizontal positionting) 
subroutine, as demonstrated in Kirk's Cookbook document:

 http://alienbill.com/2600/cookbook/subpixel.html

  I've used the routine as presented on that page, but I notice that 
when you move across a horizontal position of 15, it sort of stutters. 
It seems to be off by about three pixels. You can see this if you move 
the ghost (in the demo program on that page) close to the left margin 
of the screen. The routine exhibits the same behavior in my program. 
Adding a "nop" to it seems to fix it. So the new routine looks like 
this:

bzoneRepos
	sta WSYNC                   ; 00     Sync to start of scanline.
	sec                         ; 02     Set the carry flag so no borrow 
will be applied during the division.

        NOP     ;THIS NOP SEEMS TO PREVENT A STUTTER AT 15 PIXELS
	
.divideby15
	sbc #15                     ; 04     Waste the necessary amount of 
time dividing X-pos by 15!
	bcs .divideby15             ; 06/07  
11/16/21/26/31/36/41/46/51/56/61/66

	tay
	lda fineAdjustTable,y       ; 13 -> Consume 5 cycles by guaranteeing 
we cross a page boundary
	sta HMP0,x

	sta RESP0,x                 ; 21/ 26/31/36/41/46/51/56/61/66/71 - Set 
the rough position.
	rts

  It does it in both Stella and z26. Does the problem that I'm seeing 
exist on real hardware, too? Or am I "fixing" something to run in the 
emulators that will break on hardware?  I searched the archive for 
"bzoneRepos", but I didn't find any discussions on this routine.

Thanks!

-Rich

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

Current Thread