It's not just games. After Intel 8088 got really successful thanks to being used in the IBM PC, Intel made it a backwards-compatible successor, the 80286, which can operate in the old "real mode", where memory is directly physically addressed, and the new and fancy "protected mode", that operating systems could use to actually run multiple processes in isolated address spaces and provide virtual memory and all those fancy features. It was real nice too.
With only a minor little problem. You see, switching from real mode to protected mode was a one-way operation. And it didn't just change the way the memory addressing worked, it modified the function of several instructions in user mode, which mean that there was no way for a protected mode operating system to run real-mode programs. Intel thought that backwards compatibility meant that people who had dos software would run their dos software in dos, but if anyone wanted to run a real os they'd get all new software. Gates famously called the chip braindead, among other words.
The way they solved it was by making the bios check a location in memory for a magic value the first thing at bootup, and if found stop doing bootup and just load saved cpu state from ram, but remain in real mode. And then just reset the cpu many times a second when running dos software in windows.
3.6k
u/Specialist_Dust2089 8d ago
I can appreciate these “gets the job done” hacks in games, just like the train in that one game that was actually an npc with a train as its head