Hacker News new | ask | show | jobs
by dx211 3885 days ago
Way back in the day (mid high-school), I wrote a Tetris game in Pascal and Z80 assembly for the TRS-80. At some point I realized that since what was displayed on the screen was just a representation of an area of memory, I could keep track of the "cup" and all of the pieces that had already fallen into it directly in video memory instead of variables. I also optimized the code for drawing the "cup" so all three sides of it would get rendered in one shot in a single loop. The first time I ran it, a bug caused half of the bottom not to get drawn, and the first Tetris piece dropped through the hole and sliced straight into whatever vital memory came after the video area, immediately crashing the computer.