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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Zelda Screen Transitions Are Undefined Behaviour

366 点作者 Kaali将近 6 年前

17 条评论

yc-kraln将近 6 年前
I don&#x27;t think I would call this undefined behavior... the behavior is defined by what happens on the hardware when it&#x27;s executed!<p>There are many, many classical effects on raster hardware which are accomplished by changing registers within the horizontal blanking period... copper bars, mode 7, certain paralax scrolling. When you&#x27;re on a resource limited system it becomes an art to get the most out of the platform. Look at the difference between Mario 64 and Conker&#x27;s Bad Fur Day... or Genji: Days of the Blade (PS3) vs Persona 5 (PS3) Even with modern consoles, there is a marked improvement in the apparent visual quality over the lifetime of the device, as developers learn how to squeeze more and more out of the platform.
评论 #20461263 未加载
评论 #20461168 未加载
评论 #20466450 未加载
评论 #20462430 未加载
评论 #20462748 未加载
daniel5151将近 6 年前
I actually had to wrestle with this exact effect while working on wideNES [1]. By saving a screenshot of the screen at each frame alongside with it&#x27;s PPUSCROLL value, it&#x27;s possible to gradually build-up a map of the level as it&#x27;s explored. Moreover, on subsequent playthroughs of the same level, it&#x27;s possible to sync the map with the on-screen action, effectively enabling a &quot;widescreen&quot; mode for old NES games (with certain limitations).<p>Lots of games used funky scrolling mechanics, typically to create status bars, but of all the different games I tested with, TLOZ was by-far the weirdest, requiring an entire special case to get working!<p>I don&#x27;t have any screenshots of my own, but some japanese website recently covered wideNES, posting screenshots of it working with the original Legent of Zelda.[2]<p>[1] <a href="http:&#x2F;&#x2F;prilik.com&#x2F;blog&#x2F;2018&#x2F;08&#x2F;24&#x2F;wideNES.html" rel="nofollow">http:&#x2F;&#x2F;prilik.com&#x2F;blog&#x2F;2018&#x2F;08&#x2F;24&#x2F;wideNES.html</a><p>[2] <a href="https:&#x2F;&#x2F;emulog.net&#x2F;fc-nes-emulator-anese-how-to-use-widenes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;emulog.net&#x2F;fc-nes-emulator-anese-how-to-use-widenes&#x2F;</a>
评论 #20460476 未加载
评论 #20462602 未加载
jedberg将近 6 年前
It feels like programming used to be a much harder job in the past. You not only had to figure out the program logic, but you had to work within very tight hardware constraints.<p>Reading articles like this, or about the Atari and how the code would double as a sprite in pac-man, or how 3D was rendered in Wolfenstein, makes me think one had to be much more clever back then.
评论 #20460298 未加载
评论 #20460155 未加载
评论 #20460123 未加载
评论 #20460974 未加载
评论 #20460299 未加载
评论 #20460957 未加载
评论 #20460357 未加载
评论 #20463469 未加载
评论 #20469845 未加载
评论 #20460306 未加载
MobiusHorizons将近 6 年前
Undefined behavior in C or C++ is possible because the language specification is built to deal with different hardware architectures, so it&#x27;s not possible to build portable code. In the case of something like NES game development, there is only one hardware target, so the actual observed hardware behavior can be relied upon when doing things that aren&#x27;t explicitly documented. In this case it is possible to know before hand exactly what will happen because there is only one hardware target. Undefined behavior in a language like C is unknowable at compile time because its behavior has not been specified by the language, and it can&#x27;t be specified by the hardware. Technically I guess you are correct that it is undefined behavior, but in practice it&#x27;s pretty different IMO.
评论 #20466809 未加载
Bluecobra将近 6 年前
Thanks for posting this... as a non-programmer, I really enjoy reading how the games I grew up with worked. If you enjoyed reading this, there&#x27;s a great Youtube channel called Retro Game Mechanics Explained:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;channel&#x2F;UCwRqWnW5ZkVaP_lZF7caZ-g&#x2F;videos" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;channel&#x2F;UCwRqWnW5ZkVaP_lZF7caZ-g&#x2F;vid...</a>
评论 #20464935 未加载
klodolph将近 6 年前
There are a few games that do diagonal scrolling. In general it&#x27;s very difficult to do well on the NES, and you will likely have to live with some amount of glitching--unless you have extra name table RAM on the cartridge, which is fairly rare.<p>See <a href="http:&#x2F;&#x2F;bootgod.dyndns.org:7777&#x2F;" rel="nofollow">http:&#x2F;&#x2F;bootgod.dyndns.org:7777&#x2F;</a> for a database of the hardware inside each cartridge.
评论 #20459678 未加载
评论 #20461707 未加载
coldpie将近 6 年前
This is a great description of a commonly-used technique for splitting the screen in NES games that scroll smoothly. It may or may not have been intended, but this is a common technique for games that have a &quot;status bar&quot;. Super Mario Bros 3 is another obvious example, but even Super Mario Bros uses it long before then for its top status bar. I first read about it in the excellent &quot;I Am Error&quot; book by Nathan Altice, but googling around for &quot;nes sprite zero split&quot; turns up plenty of other articles, too.
评论 #20459702 未加载
pubby将近 6 年前
The NES designers goofed and made the size of the view window (nametable) 240 pixels tall. This makes vertical scrolling awkward as it throws a non-power-of-two divisor into the math. The NES doesn&#x27;t have a division instruction - only bit shifts, so having to divide by 240 is a real pain!<p>Also, Y-scrolling wasn&#x27;t completely figured out until late in the NES&#x27;s life. The register writes needed to do so are very strange, and Zelda certainly doesn&#x27;t do it correctly!
评论 #20462261 未加载
评论 #20462672 未加载
and0将近 6 年前
Vertical scrolling, and emulating the weird side-effects of the registers being written to, was the hardest part of recreating the NES using 3D meshes. It took me a few weekends to get Zelda 2&#x27;s intro working reliably. I wrote about it a bit myself (probably got a few details wrong or simplified them) here:<p><a href="http:&#x2F;&#x2F;n3s.io&#x2F;index.php?title=How_It_Works" rel="nofollow">http:&#x2F;&#x2F;n3s.io&#x2F;index.php?title=How_It_Works</a>
评论 #20463293 未加载
tinus_hn将近 6 年前
Weird to have this limitation that you can’t vertically scroll mid-frame, when it turns out you can if you just circumvent the blockade.
baruchthescribe将近 6 年前
This reminds me a lot of Mode X which, although a funky 320x240 mode with square pixels built in to standard VGA, only became popular after Michael Abrash popularized it in Dr Dobbs. And then there was the utterly gorgeous mode Q - 256x256 with 256 colors. No muls or shifts - high byte is Y and low byte is X.
评论 #20460044 未加载
评论 #20461292 未加载
duxup将近 6 年前
It&#x27;s always interesting how the NES cartridges had their own hardware that could expand the system&#x27;s capability. Allowing for simple cartridges for simple games and more expensive cartridges for more advanced games.
评论 #20462417 未加载
shultays将近 6 年前
It is not really undefined behavior when you have single hardware that will behave in a very well defined way. Old console games have all sort of hacks that allows them to do stuff that the system is not designed for. Having such a basic hardware with no security checks allows a lot of potential!<p>Also isn&#x27;t vertical split quite common? I would assume this is something the hardware designera thought of, not a game company figuring it out. They even put stuff like sprite 0 hit bit for this kind of tricks
llao将近 6 年前
Warning, 33 megabytes of (great) GIFs.
评论 #20462439 未加载
EGreg将近 6 年前
meta-irony: &quot;in a <i>manor</i> likely that was unintended by its designers&quot;
msla将近 6 年前
Is anyone else getting a blank white page?
penagwin将近 6 年前
Thanks for the great visuals!