Hacker News new | past | comments | ask | show | jobs | submit login

In this case, the hardware limit is CPU time. NES Tetris will give you more points for clearing lines the higher the level is. For example, on level 0 clearing one line gives you 40 points but on level 9 clearing one line gives you 400 points. This is implemented in the code by adding the base number of points to the score in a loop where the counter is the level number: https://github.com/CelestialAmber/TetrisNESDisasm/blob/2bd89... NES Tetris is written with the assumption that its main game code won't run for more than one frame. When the player reaches a high enough level the "add score for cleared lines" code will take too long, and the processor will get interrupted for the start of the next frame while it's still adding the score. This causes the game to crash.



Why do they use a loop - does the 6502 not have a multiply instruction?


My non-expert googling suggests that there is indeed no multiply instruction for the 6502.

https://www.masswerk.at/6502/6502_instruction_set.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: