Por que os jogos antigos funcionam muito rápido em computadores modernos?

Índice:

Por que os jogos antigos funcionam muito rápido em computadores modernos?
Por que os jogos antigos funcionam muito rápido em computadores modernos?

Vídeo: Por que os jogos antigos funcionam muito rápido em computadores modernos?

Vídeo: Por que os jogos antigos funcionam muito rápido em computadores modernos?
Vídeo: NÃO Cometa Esses 3 ERROS com Seu PS5, ELE CUSTOU CARO - YouTube 2024, Maio
Anonim
Image
Image

Se você já tentou criar um jogo de computador antigo em um sistema moderno, provavelmente ficou chocado com a forma comovelozes o jogo correu. Por que os jogos antigos ficam sem controle no hardware moderno?

Hoje mostramos como executar software antigo em computadores modernos; A sessão de perguntas e respostas de hoje é um elogio agradável que explica por que alguns softwares mais antigos (especificamente jogos) nunca parecem funcionar corretamente quando você tenta executá-los em hardware moderno.

A sessão de perguntas e respostas de hoje nos é oferecida por cortesia do SuperUser, uma subdivisão do Stack Exchange, um agrupamento de sites de perguntas e respostas conduzido pela comunidade.

A questão

Leitor SuperUser TreyK quer saber por que jogos antigos de computador rodam loucamente em um novo hardware:

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.

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

  • 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?

Então, qual é a história? Por que exatamente os sprites em jogos antigos brilham na tela tão rápido que o jogo se torna jogável?

A resposta

O contribuidor do SuperUser, JourneymanGeek, explica:

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.

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.

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”.

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.

Se você está curioso sobre como o código atual foi implementado nos primeiros jogos de computador (e por que eles se adaptam tão mal aos sistemas modernos sem serem colocados em algum tipo de programa de emulação), também sugerimos verificar este longo, mas interessante, processo em outra resposta SuperUser.

Tem algo a acrescentar à explicação? Soe fora nos comentários. Quer ler mais respostas de outros usuários do Stack Exchange com experiência em tecnologia? Confira o tópico de discussão completo aqui.

Recomendado: