Varför går gamla spel för långt på moderna datorer?

Innehållsförteckning:

Video: Varför går gamla spel för långt på moderna datorer?

Video: Varför går gamla spel för långt på moderna datorer?
Video: 30 окончательных прогнозов и подсказок на 2020 год 2024, Mars
Varför går gamla spel för långt på moderna datorer?
Varför går gamla spel för långt på moderna datorer?
Anonim
Image
Image

Om du någonsin har försökt att få ett vintage dator spel igång på ett modernt system, har du troligtvis varit chockad över hursnabb spelet sprang. Varför går gamla spel ute av kontroll på modern hårdvara?

Tidigare idag visade vi dig hur man kör gammal programvara på moderna datorer; dagens frågor och svar är ett bra komplement som gräver till att vissa äldre program (specifikt spel) aldrig verkar fungera rätt när du försöker köra dem på modern maskinvara.

Dagens Question & Answer-session kommer till oss med tillstånd av SuperUser-en indelning av Stack Exchange, en community-driven gruppering av Q & A-webbplatser.

Frågan

SuperUser-läsaren TreyK vill veta varför gamla datorspel körs galen snabbt på ny maskinvara:

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?

Så vad är historien? Varför exakt sprites sprites i gamla spel över skärmen så fort blir spelet ospelbart?

Svaret

SuperUser-bidragare JourneymanGeek bryter ner det:

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.

Om du är nyfiken på hur den faktiska koden implementerades i tidiga datorspel (och varför de anpassar sig så dåligt till moderna system utan att vara sandlåda i någon form av emuleringsprogram), skulle vi också föreslå att du undersöker denna långa men intressanta uppdelning av bearbeta i ett annat SuperUser-svar.

Har du något att lägga till förklaringen? Ljud av i kommentarerna. Vill du läsa mer svar från andra tech-savvy Stack Exchange-användare? Kolla in hela diskussionsgängan här.

Rekommenderad: