Archives
- November 2025
- October 2025
- September 2025
- August 2025
- July 2025
- June 2025
- May 2025
- April 2025
- March 2025
- February 2025
- January 2025
- December 2024
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- January 2011
- November 2010
- October 2010
- August 2010
- July 2010
Need for Speed SE video glitch
When attempting to play the classic racing game Need for Speed SE in a virtualized environment (VirtualBox), I was dismayed to discover that all the in-game videos were completely garbled. Curiously, the introductory video played when the game is first launched looked fine, even though there was no reason to think it should be any different from the in-game videos.
At first glance, it looked like the video mode used by the game didn’t match the data. Indeed the game was using a 320×200 mode at 16bpp, which was rather suspicious. One would expect an 8bpp mode, perhaps the standard VGA mode 13h, which is what the intro video uses.
A more detailed investigation revealed that the garbled video is the result of a subtle bug in NFS SE, rather than any deficiency in the virtualized environment. The game uses a routine called initgraphics which establishes a video mode. The routine predictably takes the requested resolution and color depth as arguments. However, the color depth is optional and if supplied as zero, the routine will choose a suitable mode. And that’s where the problem lies.
The initgraphics routine will use a 16bpp mode if found, otherwise it will fall back to an 8bpp mode. For some reason, or more likely, for no specific reason at all, the game uses the default color depth (zero) when playing in-game videos. However, the video playback in fact assumes an 8bpp mode and the output will be garbled (as shown above) if a different color depth is used.
So how come this bug was not found when Need for Speed SE was first released? That’s easyβat the time, the 320×200 mode at 16bpp was very unusual and not supported by the VESA BIOS built into the graphics cards. In that situation, the initgraphics routine falls back to 8bpp and all is well. But in a more modern environment, the 16bpp mode will be available and used, causing the video to be garbled.
How to fix this? One possibility is to make the 320×200, 16bpp mode unavailable, but that is not so easy and is only a workaround rather than a real fix. The better solution is to patch the game executable (NFS.EXE) to avoid the whole automatic color depth selection nonsense, which is not only unnecessary but wrong. All it takes is changing one byte where the arguments are passed to initgraphics in the video playback setup code, and using 8 instead of 0 for the color depth.
In my copy of NFS SE, that is the byte at offset 607E6h in the NFS.EXE file (dated 6-17-96, size 1,254,591 bytes). After changing it from zero to 8, the in-game videos appear like this:
That looks so much better! The game now chooses the correct mode for video playback regardless of whether the 320×200 mode with 16bpp is available or not.
8 Responses to Need for Speed SE video glitch
It’s like the whole OS/2 floppy ‘detection’ thing… Relying on things will fail, in the long run is a ‘bad thing’ ….
Exactly…clearly the behavior of NFS SE isn’t intentional, but it very nicely illustrates why assuming more than 1+1=2 is just not very smart. Actually reminds me of the bug with the loader in old DOS versions–who knew that hard disks with more than 17 sectors per track might show up one day… (See Hang with early DOS boot sector.)
Wow, that messed-up screenshot was a blast from the past. And explains a /lot/.
I used to play /tons/ of Need For Speed during my childhood, and had that problem with /all/ the videos.
And guess what? I forked out six months of pocket money for a very flash (at the time) Tseng Labs ET4000/W32p… which, you guessed it, had a 16-bit 320×200 mode. π
Hah, that ET4000 was badass though, had a 256 byte buffer built in the chip itself that sped up bursts of data transfer.
This actually works!
I used HXD Editor to edit the exe and now all videos work fine.
You sir, deserve a medal!
I am playing nfs 2 special edition and the same problem happens with me and I cannot find the offset you are mentioning please someone help me and please tell me which app u used to patch you exe file
Interesting.
I ran into this issue back in the day, but it only occurred on some systems, not all. I never really understood what the problem was. And unlike most such issues, univbe didn’t fix this (in fact, it probably breaks this on certain working cards, if it adds a 16-bit 320×200 mode that the standard VGA BIOS doesn’t expose).
This explains it perfectly: some machines I ran it on had the 16-bit mode, others did not.
Thank You! Videos look great now.
This site uses Akismet to reduce spam. Learn how your comment data is processed.