Scientists

Gamers hack classic Tetris on NES to run custom code without altering cartridges

Displaced Gamers demonstrated the breakthrough in a recent video, which exploits the infamous “kill screen” and a quirk in the Japanese Famicom version of Tetris when it comes to handling controller inputs to manipulate the game’s memory in an unexpected way. To learn more about how to trigger the “kill screen,” check out this 13-year-old’s achievement.

When Tetris crashes at level 155 or higher due to an overflow error, a portion of the game’s code is interrupted by a routine that draws the next frame. This causes it to jump to an unexpected part of RAM to find the next instruction.

Normally, this unexpected interruption would cause the code to jump to the very beginning of RAM, read garbage data as instructions, and crash quickly. But by holding down a specific combination of keys when the crash occurs, the player can control exactly where the jump occurs. With the correct input, they can redirect the code to the area of RAM where the game’s high score table is kept.

From there, it’s a matter of encoding custom opcodes (machine instructions) as values in those tables. While limited to just letters, numbers, and a few symbols, skilled hackers can set up miniature programs to run within Tetris’ established code and memory space. One proof-of-concept even tweaks the score calculation to temporarily prevent further crashes.

The limited character set in high score tables makes it challenging to inject a large number of programs. But the community seems to have devised ways to string together multiple table entries, leading to increasingly complex code overlays. With complete control over the game’s memory, the possibilities become endless.

This method is quite complex and makes you wonder how it was thought up. But in theory, with it, it would be possible to rewrite the core of the game and even patch the “kill screen” that triggered the exploit in the first place.

Since NES cards don’t have battery storage, executing these hacks does require manually obtaining high scores and then entering the values one at a time. Nonetheless, it’s an impressive feat of obsessive hardware tinkering to be able to delve into a decades-old game and unlock new and unexpected features.

留言

您的电子邮箱地址不会被公开。 必填项已用 * 标注