Live data from Hacker News

Celebrating the first NES Tetris game crash

biggieblog.com

11–20 of 59 posts

Re: Celebrating the first NES Tetris game crash

#11
post #3

The author and the AI video describes some very interesting bugs arisen from assumptions made by the original developers. I'm curious on the technicality of it – what were these assumptions? These are some fascinating bugs. There are some surface explanations here but I have no doubt somebody could write hours worth of content on this, like the other video [0] in the article that discusses real maths. [0]: https://ww…

I think the assumptions are pretty simple: Almost nobody’s going to get past 999,999 points and nobody’s going to be able to play at the speed of level 30, so we don’t need to worry about what happens in level 30 or what should happen when somebody gets 1,000,000 points.

> level 30

This is also an interesting one...

Thought 1 - is this a result of the limitations of assembly coding? Is it more efficient (either computationally or memory-wise) to store 29 constants rather than doing it computationally? This would make "29 levels" a conscious assumption and I'm assuming there must be some kind of technical hardware limitation that makes it 29.

Thought 2 - is this a result of game coding logic?

Game code runs on a game loop. So there is a "minimum" logical number of frames that things could possibly happen i.e. 1 frame. So, the "max speed" is set at 1 frame. You can't go any faster than that. So if they just made (e.g.) 1 frame less per next level, they just decided that 29 frames was a nice starting speed.

This makes "29 levels" less of an assumption, and more a consequence of other decisions.

Re: Celebrating the first NES Tetris game crash

#13

The author and the AI video describes some very interesting bugs arisen from assumptions made by the original developers. I'm curious on the technicality of it – what were these assumptions? These are some fascinating bugs. There are some surface explanations here but I have no doubt somebody could write hours worth of content on this, like the other video [0] in the article that discusses real maths. [0]: https://ww…

The Tetris board is 10 blocks wide, so to be able to play the full field, you need to be able to tap left or right at least 5 times before the block lands. Without tapping at super-human speeds, the fastest way to move the blocks that fast is by holding the left or right button down and letting key repeat take over. When that’s someone’s approach, level 29 becomes fast enough that the pieces can’t reach the edges of…

The last few years have seen people learn how to “roll”, effectively lightly pressing left or right and then drumming their fingers on the back of the controller, getting discrete taps far faster than typical.

The essence of this trick being that one can move multiple fingers to hit successively with time intervals impossible for a single finger; the same mechanism is also how fast typists work.

Re: Celebrating the first NES Tetris game crash

#14
post #3

Earlier quoted context omitted.

I think the assumptions are pretty simple: Almost nobody’s going to get past 999,999 points and nobody’s going to be able to play at the speed of level 30, so we don’t need to worry about what happens in level 30 or what should happen when somebody gets 1,000,000 points.

But why specifically 999,999? That's not an overflow or anything...

I'm not familiar with Tetris specifically, but for a score display it was rather common to store each individual digit as a tile ID, which helped to speed up drawing that score into the nametable. I wouldn't be surprised if the algorithm that handles score addition was a simple loop that doesn't check the bounds of the highest digit; this would cause it to eventually corrupt adjacent memory in RAM.

Edit: the article covers much of this! Based on the 3 byte display I'm guessing it is indeed BCD as others have noted, with slower software routines to get around the 2A03's lack of a decimal arithmetic mode. The slower operation may be part of why the crash is possible, but the mechanism is simple unguarded lag: NTSC isn't going to wait around forever and the program wasn't prepared for this.

Re: Celebrating the first NES Tetris game crash

#15
post #3

Earlier quoted context omitted.

I think the assumptions are pretty simple: Almost nobody’s going to get past 999,999 points and nobody’s going to be able to play at the speed of level 30, so we don’t need to worry about what happens in level 30 or what should happen when somebody gets 1,000,000 points.

> level 30 This is also an interesting one... Thought 1 - is this a result of the limitations of assembly coding? Is it more efficient (either computationally or memory-wise) to store 29 constants rather than doing it computationally? This would make "29 levels" a conscious assumption and I'm assuming there must be some kind of technical hardware limitation that makes it 29. Thought 2 - is this a result of game codin…

there's a disassembly here, it looks like: https://github.com/CelestialAmber/TetrisNESDisasm

Re: Celebrating the first NES Tetris game crash

#16
post #8
post #7

Earlier quoted context omitted.

It's likely it's 3 bytes of BCD (binary coded decimal). It's a handy way of storing things like scores, especially on 6502 processors which have built-in BCD handling support.

No BCD support on the specific chip used in the NES, though.

Looks like it might be doing the bcd by hand. See, e.g., L93C7 (and following code) in the disassembly here: https://github.com/CelestialAmber/TetrisNESDisasm

Re: Celebrating the first NES Tetris game crash

#18
post #4

I recently got a Miyoo Mini and I almost exclusively use it to play NES Tetris. I’m hooked and I didn’t know there even was a community! https://www.aliexpress.us/item/3256805029072733.html

Is the Miyoo Mini worth getting?

I personally love mine. The build quality is great and it fits well in my hands

Re: Celebrating the first NES Tetris game crash

#19
post #4

I recently got a Miyoo Mini and I almost exclusively use it to play NES Tetris. I’m hooked and I didn’t know there even was a community! https://www.aliexpress.us/item/3256805029072733.html

Ha, I did the almost the thing but to play Gameboy Tetris instead. The Miyoo Mini was impossible to get at a good price around this time last year so I got the Abernic RG35XX and been really happy with it.

What’s considered a good price? I’m blown away by how much functionality this packs for under $65 on this listing but I don’t know what’s normal.
Post reply on HN