现代计算机理论基础是什么_为什么旧游戏在现代计算机上运行得太快?

现代计算机理论基础是什么

现代计算机理论基础是什么

If you’ve ever tried to get a vintage computer game up and running on a modern system, you’ve likely been shocked at how fast the game ran. Why do old games run out of control on modern hardware?

如果您曾经尝试过在现代系统上启动并运行老式计算机游戏,那么您可能会对游戏的运行速度感到震惊。 为什么旧游戏在现代硬件上失去控制?

Earlier today we showed you how to run older software on modern computers; today’s question and answer session is a nice compliment that digs into why some older software (specifically games) never seem to work right when you try to run them on modern hardware.

今天早些时候,我们向您展示了如何在现代计算机上运行旧软件 ; 今天的问答环节是一个很好的赞美,它解释了为什么当您尝试在现代硬件上运行某些较旧的软件(尤其是游戏)似乎无法正常工作时。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader TreyK wants to know why old computer games run crazy fast on new hardware:

超级用户阅读器TreyK想知道为什么旧的计算机游戏在新的硬件上会疯狂地快速运行:

I’ve got a few old programs I pulled off an early 90s-era Windows computer and tried to run them on a relatively modern computer. Interestingly enough, they ran at a blazing fast speed – no, not the 60 frames per second kind of fast, rather the oh-my-god-the-character-is-walking-at-the-speed-of-sound kind of fast. I would press an arrow key and the character’s sprite would zip across the screen much faster than normal. Time progression in the game was happening much faster than it should. There are even programs made to slow down your CPU so that these games are actually playable.

我有一些旧程序,是从90年代早期的Windows计算机上提取的,并试图在相对现代的计算机上运行它们。 有趣的是,它们以惊人的速度运行-不,不是每秒60帧的快速,而是我的上帝字符以某种声音的速度在行走快速。 我按箭头键,角色的精灵会比平常更快地在屏幕上滑动。 游戏中的时间进度比预期要快得多。 甚至制作了一些程序来减慢CPU的速度,以使这些游戏真正可以玩。

I’ve heard that this is related to the game depending on CPU cycles, or something like that. My questions are:

我听说这与游戏有关,具体取决于CPU周期或类似情况。 我的问题是:

  • Why do older games do this, and how did they get away with it?

    为什么较早的游戏会这样做,而他们又如何摆脱它呢?
  • How do newer games not do this and run independently of the CPU frequency?

    如何新游戏没有做到这一点,并独立于CPU的频率运行?

So what’s the story? Why exactly do the sprites in old games blaze across the screen so fast the game becomes unplayable?

那是什么故事? 为什么老游戏中的精灵会在整个屏幕上闪耀得如此之快,导致游戏无法播放?

答案 (The Answer)

SuperUser contributor JourneymanGeek breaks it down:

超级用户贡献者JourneymanGeek对此进行了细分:

I believe they assumed the system clock would run at a specific rate, and tied in their internal timers to that clock rate. Most of these games probably ran on DOS, and were real mode (with complete, direct hardware access) and assumed you were running a iirc 4.77 MHz system for PCs and whatever standard processor that model ran for other systems like the Amiga.

我相信他们认为系统时钟将以特定速率运行,并将内部计时器与该时钟速率绑定在一起。 这些游戏大多数都可能在DOS上运行,并且是实模式 (具有完整的直接硬件访问权限),并假定您正在运行用于PC的iirc 4.77 MHz系统以及该模型运行于Amiga等其他系统的任何标准处理器。

They also took clever shortcuts based on those assumptions including saving a tiny bit of resources by not writing internal timing loops inside the program. They also took up as much processor power as they could – which was a decent idea in the days of slow, often passively cooled chips!

他们还根据这些假设采取了巧妙的捷径,包括通过不在程序内部编写内部定时循环来节省少量资源。 他们还占用了尽可能多的处理器能力–在缓慢的,通常是被动冷却的芯片时代,这是一个不错的主意!

Initially one way to get around differing processor speed was the good old Turbo button (which slowed your system down). Modern applications are in protected mode and the OS tends to manage resources – they wouldn’t allow a DOS application (which is running in NTVDM on a 32-bit system anyway) to use up all of the processor in many cases. In short, OSes have gotten smarter, as have APIs.

最初,解决不同处理器速度的一种方法是使用老旧的Turbo按钮 (这会降低系统速度)。 现代应用程序处于保护模式,并且OS倾向于管理资源–在许多情况下,它们都不允许 DOS应用程序(无论如何在32位系统上的NTVDM中运行)都用光了所有处理器。 简而言之,OS和API都变得更加智能。

Heavily based off this guide on Oldskool PC where logic and memory failed me – it’s a great read, and probably goes more in depth into the “why”.

该指南很大程度上基于Oldskool PC上的指南,在该指南中 ,逻辑和内存使我无法正常工作-这是一本好书 ,并且可能更深入地探讨了“为什么”。

Stuff like CPUkiller use up as many resources as possible to “slow” down your system, which is inefficient. You’d be better off using DOSBox to manage the clock speed your application sees.

诸如CPUkiller之类的东西会占用尽可能多的资源来“减慢”您的系统速度,这是低效的。 使用DOSBox来管理应用程序看到的时钟速度会更好。

If you’re curious about how the actual code was implemented in early computer games (and why they adapt so poorly to modern systems without being sandboxed in some sort of emulation program), we’d also suggest checking out this lengthy but interesting breakdown of process in another SuperUser answer.

如果您对在早期的计算机游戏中如何实现实际代码感到好奇(以及为什么它们没有在某种仿真程序中被沙盒化而无法很好地适应现代系统),我们也建议您检查一下冗长而有趣的细分处理的另一个超级用户的答案。



Have something to add to the explanation? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不对。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/171945/why-do-old-game-run-way-too-fast-on-modern-computers/

现代计算机理论基础是什么

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值