[stella] Loops with two counters

Subject: [stella] Loops with two counters
From: "Bob Montgomery" <BobM@xxxxxxxxxxx>
Date: Thu, 7 Jul 2005 15:26:56 -0400
Hi all,

I am writing a kernel that uses Y to count scanlines but also uses X to count down as well.

So, the looping code looks something like this:

  dey                 ;+2   50

  tya                 ;+2   52
  cmp BlockChange,X   ;+4   56
  bne Kernel1Loopa    ;+2   58
  dex                 ;+2   60
  bpl Kernel1Loopb    ;+3   63

That takes 15 cycles. Is there a faster way?  I really need a few more cycles :)


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

Current Thread