TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Beating Super Mario Bros 3 in 19 frames (2021)

27 点作者 streblo超过 2 年前

5 条评论

lupire超过 2 年前
Really quick summary:<p>A hardware bug causes the NES to misread inputs sometimes (losing 1bit), if music is playing.<p>To work around the bug, the game only accepts inputs if the same key is pressed for two consecutive input cycles (an input cycle is much shorter than one frame)<p>If the inputs don&#x27;t match, the game loops and tries again.<p>This loop has no hard coded limit, so if you spam changing inputs fast enough for long enough (using a computer; your fingers aren&#x27;t fast enough), the game keeps trying to read inputs until it&#x27;s time for next frame to be drawn to screen.<p>The NES clock sends an interrupt to prompt the drawing code to run.<p>The input code and the drawing code use overlapping areas of memory, and the game didn&#x27;t do what it needs to do (at a low level in memory) to be ready draw the frame properly, and ends up reading drawing instructions from input bytes instead of what the game was designed to put into that area of memory.<p>(This part is where the real dirty magic is; it requires understanding of assembler and interrupts to properly explain how it works. Basically one function interrupts another and starts running before the first one finished, and the functions use different invocation logic, so the second function ends up exiting &quot;the wrong way&quot; and the program jumps to a wrong return location when it&#x27;s done.)<p>Thus the attacker can write run semi-arbitrary code that makes the game jump to the instruction that starts playing the ending&#x2F;credits scenes.
评论 #33381335 未加载
CM30超过 2 年前
For those who want to see what those frames look like, Supper Mario Broth posted images of all 19 on Twitter:<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;MarioBrothBlog&#x2F;status&#x2F;1585644239073193984" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;MarioBrothBlog&#x2F;status&#x2F;158564423907319398...</a>
评论 #33420710 未加载
LocalH超过 2 年前
what in the fuck, literal assembly fu, amazing
评论 #33379534 未加载
wly_cdgr超过 2 年前
Not bad, but...aah, who am I kidding, this is some power level 9000 macromancer shit
评论 #33381187 未加载
bitwize超过 2 年前
They should get like, a million P-Wings for this.
评论 #33420731 未加载