[stella] BMI & BPL questions

Subject: [stella] BMI & BPL questions
From: Ruffin Bailey <rufbo@xxxxxxxxxxx>
Date: Mon, 29 Jun 98 17:58:09 -0500
In COMPUTE!'s book _Machine Language For Beginners_, Richard Mansfield 
warns against ever using BMI and BPL.  To justify this ban, Mr. Mansfield 
writes, "The reasons for this are exotic.  We don't need to go into them. 
 Just be warned that BPL and BMI, which sound so logical and useful, are 
not.  They can fail you and neither one lives up to its name."
(page 75 in my edition)

I wss wondering because I couldn't get this code to work.  Originally the 
asl, bcs was a bmi that I commented out below.  Naturally neither of 
these two options worked, so I'm still confused.  

> lda CXP0FB 			; this byte holds the collision registers for Player
>         						; Zero and the playfield (D7) and P0 and the ball (D6)
>	
>	asl
>	bcs joycheck		; if D7=1 there is a collision and gravity should be 
>	         					; negated.  (The guy's standing on the floor)
> ;bmi joycheck 	
>
>
>	inc ypos   			; gravity moves the player down one scan line.
>						         ; "Note to self": make sure no down inputs are allowed
>						         ; while sprite falls in final.
>joycheck
[etc etc]

This snippet happens between frames during the "game calc" portion of the 
code.

Another question I have is this:  For my last post (the joymove.bin), did 
moving the joystick up move the sprite down and vice versa?  I'm using 
MacStella 0.7, and though I inc the variable ypos to make the sprite go 
down (as if pulled by gravity), I currently dec the ypos twice when the 
joystick is moved down (ie, D4 = 1).  On MacStella, latching D4 (moving 
the joystick down) makes the sprite go downwards three scan lines a frame 
which is what I want, but currently the logic making this happen is 
somewhat paradoxical.  Perhaps the bmi command again?  

Note:  There is a check of scan line versus ypos in the screen drawing 
kernal that resets the player when they are equal (so dec makes the scan 
with the sprite closer to the top of the screen and inc a higher number 
scan line/ lower in the screen).

Is this some episode of the X-Files that I missed, or is Mansfield just 
worried that these two instructions are too complicated for the beginner 
to use?  Or something far more sinister...  ;)  And what's with the crazy 
reversed joystick movement?  Tune in next time...

Thanks,




Ruffin Bailey        |  Write Atari 2600 games on your Mac!
rufbo at cetlink.net |  http://members.aol.com/~mactari

Attachment: joygrav.bin
Description: Binary data

Attachment: joygrav.src
Description: Binary data

Current Thread