Advertisement
Guest User

Features for my Tetris

a guest
Mar 31st, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. INPUT:
  2. All of the inputs go to the pink circuit. The clock button directly toggles the clock on and off with a toggle flip flop. Any player move (Left and right shift, clockcwise and counter clockwise rotation) go into the scheduling system. The scheduling system saves your inputs for when they need to be executed. If you do both contradictory inputs in the same clock cycle (left and right shift at the same time). then they both cancel out and the piece won't shift at all. The scheduling system decides when to execute moves because it goes in order. Fall -> Shift -> Rotate. However If you have Downfast enabled, then the scheduling system will only do fall repeatedly and will not allow you to do any player moves. One thing to note is if you try to do player moves while Downfast is on then it will save those moves for later when you turn downfast off and then execute them. One last thing is if you want to reset the game you can simply press the reset button and it will pause the clock, reset the piece, and then start clearing the screen when it will finally display the reset message letting you know the game is playable again.
  3.  
  4. MOVEMENT:
  5. Once a move has been executed it can increment each pixels X Y coordinates accordingly. They also have to go through the positive/negative to make sure the pixel is moving the right direction. However Rotation is a lot more complicated. Rotation has to read from a ROM to know how to move each pixel individually dependent on what piece it is and what rotation it currently is in. Once the increments are made they go to the looping Cancel Carry Adders.
  6.  
  7. PIECE RENDERING:
  8. Once the new coordinates for the pixels are saved they go to the decoders to decode their X and Y coordinates. And where they meet will write a pixel. I have four layers of this, one for each pixel. All four pixels get bussed into the same matrix.
  9.  
  10. LINE CLEARING:
  11. When a piece receives the pulse to save onto the display because they collided while falling then they will turn into saved information as opposed to animated information. both of which go to the display but saved information; if it fills up an entire row then it will trigger a line clear by shifting all of the information above it down.
  12.  
  13. COLLISION DETECTION:
  14. When animated data and saved data are on the same pixel together then the collision detection will send a pulse to the scheduling system to undo the move. The scheduling system saves the move specifically so it can do the opposite move incase it collides. And then a pulse is sent to the display to update the screen. Then it will spawn in a new random piece at the top which will also update the screen for which piece is next.
  15.  
  16. DISPLAY:
  17. When the screen is updated because the piece successfully didn't collide, then it goes to my 4x4 ring pixel display
  18.  
  19. LOSE DETECTION:
  20. If any data saves on the top layer then you lose. The lose signal is sent to the clock to pause the game and then the board gets cleared. Once the board is cleared then it will pick one of the four random lose messages to display on the screen.
  21.  
  22. SCORE:
  23. When a line gets cleared the pulse gets sent to the scoring system which will keep count of how many pulses get sent to it. And it has a ROM to know how many points to give you based on how many pulses it receives. First it will check if your amount of points is greater than the highscore and if it is then it will save a new highscore. Then your points convert from binary to BCD using my vertical non sequential Double Dabble design. and then go into 6 segment displays to display your score and your highscore.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement