Re: [stella] zero-read

Subject: Re: [stella] zero-read
From: Erik Mooney <emooney@xxxxxxxxxxxxxxxx>
Date: Sun, 11 Feb 2001 04:39:50 -0500
On Sun, 11 Feb 2001 11:47:57 +1100, you wrote:

>I need a register location which, upon read, is ALWAYS guaranteed 0.
>Can anybody suggest any/the best register or location to use?
>Thanks
>A

I suppose you want zeropage, because if that wasn't a requirement, you
could just use a ROM location.  And I suppose you don't just want to
dedicate one byte of RAM to the task of holding 0.  And I'm not quite sure
why an immediate LDA #00 wouldn't work.  But here goes anyway:

The collision registers map to $x0 through $x7, the paddles are at $x8 -
$xB, and the joystick button inputs are at $xC and $xD, for all values of
x 0-7.  I _think_ $xE and $xF always return $FF, but I'm not sure.

If you can do a CXCLR (clear all collision collision latches) closely
before this routine so that you can ensure that no collisions of any one
particular type will occur between the CXCLR and this routine, you can use
that collision register.  (example: $x4 contains the collision latches for
missile 0 - playfield and missile 0 - ball.  You can use $x4 to always
return 0 upon read, if you can ensure that such a collision will not
happen between a STA CXCLR instruction and this routine, which will be
true if either you're not using missile 0, you're not using PF or ball, or
you're in vblank.)

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

Current Thread