Jump to content
  • entries
    39
  • comments
    57
  • views
    124,734

Vertical Ball Control


Guest

992 views

Now that we have looked at the horizontal component of the ball we will look at the vertical portion. The vertical is based on a slip counter just like the horizontal so we will cover the slip counter control first. The vertical motion of the ball is influenced by two things, hitting the top or bottom of the screen, or hitting one of the paddles. When the ball hits the top or bottom of the screen, it will reverse direction, but keep the same speed. When the ball hits the paddle the effect on the vertical motion is determined by where on the paddle it hits. The paddle is 16 pixels high which is divided up into 8 regions, a hit on these regions effects the vertical position as follows:1 – Up fast2 – Up medium3 – Up slow4 – No vertical motion5 - No vertical motion6 – Down slow7 – Down medium8 – Down fastNote that the vertical speed of the ball actually translates into the angle the ball is moving on the screen. The first circuit we need to look at is the hit detector which detects when the ball has hit one of the paddles. The /HVID and /VVID signals are both low when the ball is being displayed, which will cause the output of G1 to go high. PAD1 and PAD2 are high whenever their respective paddles are being displayed. When both the ball signal and the PAD1 signal are high, the output of G3, the /HIT1 signal, will go low signaling that the ball has hit paddle 1. Same thing happens with PAD2 and /HIT2. The /HIT1 and /HIT2 signals are combined by NAND B2 to produce HIT. HIT is high whenever either paddle has been hit and low when neither paddle has been hit. Note that the vertical circuit doesn’t directly use /HIT1 or /HIT2, but these are used in other circuits. post-3928-1098333363_thumb.jpgNow we can look at the actual vertical control circuit. post-3928-1083735866_thumb.jpgWe start out on the left side of the circuit with the B1, C1, D1 and B2, C2, D2 signals. These are the 2nd, 3rd and 4th bits of the paddle counters. Since the 1st bit is not used the paddle is divided up into 8, 2 pixel high segments. Gates A6 and B6 are used to select the correct set of paddle counter signals. When /256H is high, we are on the left side of the screen so the paddle 1 signals are passed through the gates. When 256H is high, we are on the right side of the screen so the paddle 2 signals are passed through the gates. The paddle counter signals then go to A5 and B5 where they are latched in by the HIT signal. At the bottom of the circuit is the section which determines if the ball has gone off either the top or bottom of the screen. This is done with a very simple technique. If the vertical component of the ball, VVID, is high when VBLANK goes low, then the ball is either off the top or bottom of the screen. In this case the Q output of H2 will go high. H2 is cleared by the HIT signal so that the ball will always be going in the correct direction when it hits the paddle. The output of H2 is connected to gates A4 and B6 along with the paddle counter signals in such a way that the paddle count will be inverted when the H2 output is high, thus reversing the current vertical direction of the ball. The B6 gate may look a little odd, but it is wired up in such a way that is behaves exactly like the XOR gate A4. I assume they did this because they ran out of XOR gates, so used a spare gate in B6 instead of adding another chip. The paddle count signals finally go through B4 which is an adder. The output of the adder is as follows:Paddle count - Non-inverted output,Inverted output 1 - 13 , 72 - 12 , 83 - 11 , 94 - 10 , 105 - 10 , 106 - 9 , 117 - 8 , 128 - 7 , 13The output of the adder is used to control the vertical slip counter which we will look at next.

1 Comment


Recommended Comments

Glad you're back. Interesting that rather than use a direction bit which would be set if the ball goes off the top or clear if it goes off the bottom, they have a "wrong direction" bit that inverts the effective direction from the last latched collision. I wonder if this has anything to do with supposed bugs at the corners? If a player hits the ball with the top of the paddle when the ball is already at the top edge of the screen, could this cause the ball to get stuck in odd fashion?

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...