Hacker News 中文摘要

RSS订阅

WinQuake的由来及其运作原理 -- Why WinQuake exists and how it works

文章摘要

WinQuake是为了解决Quake在Windows 95下运行性能下降问题而开发的版本。原版quake.exe在Windows 95的DOS虚拟机中运行时帧率比纯DOS环境下低25%。WinQuake通过原生Windows实现提升了性能,同时保持了与DOS版本相同的功能体验。

文章总结

WinQuake的诞生与运行机制解析

背景与性能问题

在Quake系列二进制文件中,quake.exe作为原始版本可在DOS和Windows 95运行,但其在Windows 95下的性能表现存在显著差异: - DOS环境:48 fps
- Windows 95环境:38 fps(下降25%)
这是由于Windows 95通过虚拟机运行DOS程序,导致内存访问和中断虚拟化带来性能损耗。此外,DOS版无法直接访问Windows 95的TCP/IP栈,且与Windows NT的DPMI客户端不兼容。

WinQuake的解决方案

winquake.exe作为纯Win32应用应运而生,主要优势包括: 1. 性能优化:通过六种运行模式平衡速度与兼容性,最高可达45 fps(接近DOS版的94%); 2. 技术实现: - 音频后端:支持DirectSound(低延迟)和WinMM(高帧率) - 输入控制:可选DirectInput或传统WinAPI - 视频渲染:采用五层架构: - DIB模式(最安全但最慢) - SciTech MGL库支持的VBEAF/VBE2/VGA - DirectDraw加速 - WinDirect技术:通过WDIR32.DLL绕过GDI直接访问硬件

历史意义与现代兼容性

尽管MGL库当年售价高达499美元(1997年),但其为Quake等游戏提供了跨平台图形解决方案。如今在Windows 11上,winquake.exe仍可流畅运行窗口模式,展现了微软卓越的向后兼容性。

关键数据对比:
| 运行模式 | 帧率(fps) |
|----------------|----------|
| DOS版 | 48 |
| WinQuake最优 | 45 |
| Windows 95原生 | 38 |

(注:测试环境为Pentium MMX 233MHz/Matrox Mystique显卡/320x200分辨率)

评论总结

总结评论内容:

  1. 对Quake游戏的怀旧与赞赏
  • "This is a great write-up for those of us that were into Quake when it was released" (progmetaldev)
  • "I got into Quake because of all the available MAP tools...and the multiplayer aspect" (progmetaldev)
  1. 技术实现讨论
  • "The detail that -wavonly...actually gave the highest frame rate" (victorbuilds)
  • "DirectSound's lower latency came at the cost of more CPU cycles" (victorbuilds)
  1. Windows向后兼容性赞赏
  • "More than 30 years later, you can still run winquake.exe on Windows 11" (71bw)
  • "their commitment to backward compatibility is impressive" (71bw)
  1. 技术链接问题
  • "Link to MGL v4 programmer guide seems to be broken" (markus_zhang)
  • "can we do the same nowadays for modern Windows and video cards?" (markus_zhang)
  1. SDL抽象层讨论
  • "That's some of the same stuff that SDL is meant to abstract over" (01HNNWZ0MV43FF)
  • "SDL was more targeting Windows/Linux differences" (01HNNWZ0MV43FF)