Jump to content
IGNORED

DanBoris' Tech Blog - Ball Horizontal Control Part 2


RSS Bot

Recommended Posts

As supercat observed in my last entry, I totally missed this part the first time around. Better late then never...

 

blog-184-1175728871_thumb.jpg

 

For anyone who has played Pong, you may remember that the more times you volley the ball back and forth, the faster the ball will move. This counter counts those volleys. Each time the ball is hit by either player the counter will increment until it reaches a count of 12, at which point it will be disabled by NAND gate E1. The counter is reset by the RST SPEED signal which we will discuss at a later date

 

There are three counter states that are decoded by the logic gates B1, E1 and H1.:

 

 

CODECounter H1(11) H1(3)

0-3 0 0

4-11 0 1

12-15 1 1

 

 

At the beginning of each video frame these outputs are gated through two more NAND gates (H1) by the VRESET signal where they are applied to the clear inputs on J/K flip-flops H2. The flip-flips are clocked by the /256H at the start or each horizontal line. When the counter is in the range of 0-3, the MOVE signal will be high for one horizontal line, in the range 4-11, it will be high for two horizontal lines, and in the range of 12-15, three horizontal lines. The more lines the MOVE signal stays high for, the faster the ball will move.

 

LetÂ’s take a look at how this works for the 12-15 counter state. Initially after VRESET the Q output of both flip-flops will be low (due to the clear) which will result in MOVE being high. At the start of the next horizontal line when /256H goes high, since the J and K inputs of the first flip/flip are high, it will toggle setting itÂ’s Q output high. The J and K inputs of the second flip/flop are both low so its state will not change. After the first clock pulse MOVE is still high. On the second clock pulse, the first flip-flip will toggle again, but since the J input of the second one is high, its output will go high. After the second clock pulse MOVE is still high. On the third clock pulse the first flip-flop will toggle again, settings its Q output high, and the second flip-flop will remain unchanged. Both inputs of NAND H4 are now high so its output goes low. The MOVE signal will now stay low until the next VRESET.

 

 

http://www.atariage.com/forums/index.php?a...;showentry=3129

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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