《忍者龙剑传 黑之章》(含飓风版中文汉化 vb-zh-x2.1)与《忍者龙剑传》(2004)的非官方 Windows 原生移植。2.3.1。
2.3.1:窗口和无边框走翻页模式,低延迟呈现按屏幕实测判断,Alt+Enter 不再闪旧画面
先看这里:这次更新对你有什么影响
| 你的情况 | 更新后 |
|---|---|
| 无边框(显卡直接驱动这台显示器) | 画面直接翻页到屏幕、不经桌面合成;集显 60 Hz 上按键到画面约 30 ms,是各模式里最低的 |
| 窗口(显卡直接驱动这台显示器) | 也走翻页模式,仍经桌面合成,约 46 ms |
| 打开了「低延迟呈现」 | 程序按屏幕实测判断提前送帧有没有用,没用就自动停用;窗口、无边框、G-SYNC / FreeSync 下也能用(见下) |
| 笔记本混合模式下用独显,按 Alt+Enter 从真全屏切回 | 不再闪出约 5 秒前的旧画面 |
| 笔记本混合模式下用独显(画面由集显输出)的窗口 | 和以前一样,每秒可能有一两次轻微卡顿;建议用无边框或真全屏,或打开独显直连(见下) |
| 以前打开过「开始游戏」页的「固定游戏时钟」 | 开关已从启动器移除;升级后第一次打开启动器时改回关闭(只改这一次) |
| Wine / Linux | 窗口和无边框仍用以前的复制方式,行为不变 |
| 游戏速度、画面内容、声音 | 不变 |
改了什么
- 窗口和无边框改用翻页模式(D3D9Ex FLIPEX):显卡直接驱动这台显示器时,无边框的画面由 Windows 直接翻页到屏幕(独立翻页),
不经桌面合成。实测按键到画面上屏(集显 Iris Xe,60 Hz):无边框约 30 ms,窗口约 46 ms,真全屏约 30–61 ms(Windows 每次呈现
真全屏的方式可能不同,同一台电脑不同次运行都见过);RTX 3060 + G-SYNC 真全屏约 17 ms、无边框约 28 ms。笔记本混合模式下用独显
(画面由集显输出)以及 Wine 下,没有可用的翻页,仍用以前的复制方式。是不是混合模式,按窗口所在显示器实际由哪块显卡驱动来判断。 - 低延迟呈现按屏幕实测判断(仍默认关闭):程序从显卡的呈现统计知道每帧实际在哪次刷新上屏,自动学习要提前多少才赶得上;赶不上的帧
照常等节拍,回落越频繁,要连续赶得上越久才再提前;提前的帧如果没有更早上屏,自动停用一段时间再试。各模式的边界:- 窗口:约 46 → 31 ms,代价很小(每分钟约 2 帧)。建议开。
- 无边框:集显上本来就最快(约 30 ms),开了能到约 14 ms,但每次从提前回到等节拍要丢一帧,每分钟约 5 次。在意流畅就关。
- 真全屏 + 垂直同步:Windows 让真全屏本来就快的那几次运行里,提前没有更早上屏,程序会自动停用;慢的那几次约 44 → 30 ms。
- 开着 G-SYNC / FreeSync:真全屏约 17 → 4–8 ms,无边框约 28 → 4–8 ms,帧间隔 ±1 ms 内 99.5% 以上(RTX 3060 实测)。建议开。
- 不起作用:真全屏关垂直同步;笔记本混合模式下用独显的窗口和无边框;Wine(拿不到呈现统计)。
- Alt+Enter 从真全屏切回不再闪旧画面:笔记本混合模式下用独显时,从真全屏切回窗口,按键后 0.02 秒和模式切换结束时,屏幕会先显示
窗口进入真全屏前留下的画面(约 5 秒前)。原因是桌面合成器在游戏送出新帧之前先显示窗口的旧内容。现在进入真全屏前、离开真全屏后
各给窗口送一帧黑画面:复测切进、切出都只有黑屏。每次切换多一帧,平时没有开销。 - 「开始游戏」页的「固定游戏时钟」开关移除:2.3 起游戏时钟从不等待屏幕,对不准屏幕时(G-SYNC / FreeSync、读不到刷新时间、
75 Hz 这类刷新率)会自动改用固定 59.94 Hz,打开这个开关只会让 60 Hz 屏约每 17 秒多显示一帧。打开过的玩家没法再从界面关掉,
所以升级后第一次打开启动器时把它改回关闭(只改这一次;直接运行游戏程序、不经启动器的不会被改)。
black.ini里的timer_vblank = 1仍然有效,排查画面问题时可以手动打开。 - 说明更新:启动器「显示模式」「低延迟呈现」「垂直同步」「全屏时用 60 Hz」的帮助按显示模式写明收益、代价和建议。
笔记本混合模式下用独显时,窗口模式每秒可能有一两次轻微卡顿:60 Hz 实测 75 秒重复 226 次(无边框 30、真全屏 13、集显窗口 4),
游戏自己每帧的时间和集显上完全一样,是独显画面复制给集显再合成这条跨显卡路径造成的,这一版也无法改善。建议用无边框或真全屏,或打开独显直连。 - README:Batocera v44 玩家实测(wine-proton;赛扬 1037U + GT730、AMD A8-7500;2.2.36.x 及之后所有版本):游戏完全正常,没有贴图错误、
没有死机;autorun.cmd写CMD="Ninja Gaiden Black.exe"可以直接进游戏;1037U 的 HD4000 集显把black.ini的window设成400x300
能跑到 55 fps 以上。
测试
- 显示(用桌面复制逐帧读出屏幕上实际显示的帧号,呈现延迟只用呈现统计测、测时不截屏):集显 Iris Xe 60 / 165 Hz、RTX 3060 独显直连 + G-SYNC、
笔记本混合模式,窗口 / 无边框 / 真全屏,低延迟开 / 关。数据全部在源码仓库project/docs/30_D3D9Ex上限计划_2.3.1.md。 - 性能(集显 Iris Xe,开场演示 160 秒、空缓存,2.3.0.2 和 2.3.1 交替各 2 次):游戏速度 93.70% 对 93.70%,平均帧时间 7.53 对 7.21 ms,卡顿都是 0。
之前 RTX 3060 和集显上翻页对复制也都是 93.70%。 - 冒烟测试(发布包本身):
Ninja Gaiden Black.exe在集显上跑 40 秒,版本 2.3.1,窗口走翻页,无错误。 - 发布包:Windows Defender 扫描四个程序,无威胁;文件列表和 2.3.0.2 相同。测试用的选项
--copy-present不加参数时不起作用。 - 没测:120 / 240 Hz 屏幕(作者手上没有);AMD 显卡;Steam Deck。
发布包
ngb-hurricane-pc-2.3.1-win32.zip- 大小:3,542,787 字节
- SHA-256:
d98d11fe07037ea62c4030f7d1c035799637f347eabe7375814aa13ef3eabb0f - 符号包
ngb-hurricane-pc-2.3.1-win32-symbols.zip:20,005,927 字节 - SHA-256:
a895cf57ec65578841a31e2368dd69371edb87ad4891ad77c1c094fd2ec39a2d
作者:b站 哈雅布撒(QQ:2682557218)
English
An unofficial native Windows port of Ninja Gaiden Black (including the Hurricane Chinese translation vb-zh-x2.1) and Ninja Gaiden (2004). 2.3.1.
2.3.1: windows and borderless present by flip, low latency judged by the screen, no old picture on Alt+Enter
Start here: what this update means for you
| Your setup | After the update |
|---|---|
| Borderless (the graphics card drives that screen) | Frames flip straight to the screen, not through the desktop compositor: about 30 ms from the pad to the screen on integrated graphics at 60 Hz, the least of all modes |
| Window (the graphics card drives that screen) | Presents by flip too, still through the compositor: about 46 ms |
| "Low-latency present" on | The program judges by what reached the screen whether sending early helps, and stops when it does not; now works in a window, borderless and with G-SYNC / FreeSync too (below) |
| Hybrid laptop on the dedicated GPU, Alt+Enter out of exclusive fullscreen | No picture from about 5 s before flashes up any more |
| Hybrid laptop on the dedicated GPU (the integrated one drives the panel), window | As before, may hitch once or twice a second; use borderless or exclusive fullscreen, or the dedicated-GPU-only mode (below) |
| You had the Play page's "Fixed game clock" on | The switch is off the launcher; the launcher's first start after the update turns it back off (once) |
| Wine / Linux | A window and borderless copy as before, no change |
| Game speed, picture, sound | Unchanged |
What changed
- Windows and borderless present by flip (D3D9Ex FLIPEX): when the graphics card drives that screen, Windows flips borderless frames
straight to it (independent flip), not through the desktop compositor. Measured from the pad read to the screen (Iris Xe, 60 Hz):
borderless about 30 ms, a window about 46 ms, exclusive fullscreen about 30-61 ms (Windows may present exclusive fullscreen differently
from run to run; all were seen on the same PC); RTX 3060 + G-SYNC exclusive about 17 ms, borderless about 28 ms. A hybrid laptop
rendering on the dedicated GPU (the integrated one drives the panel) and Wine have no flip to use and copy as before; which card drives
the window's screen decides it. - Low-latency present judged by the screen (still off by default): from the card's present statistics the program knows at which refresh
each frame reached the screen and learns how early a frame must be ready; a frame that would miss waits for its beat as usual, the more
often frames fall back the longer they must make it before going early again, and when early frames reach the screen no sooner it stops
for a while and tries again later. Per mode:- Window: about 46 -> 31 ms at a small cost (about 2 frames a minute). Worth it.
- Borderless: already the fastest on integrated graphics (about 30 ms); on, about 14 ms, but every fall back to the beat drops a frame,
about 5 a minute. Off if smoothness matters more. - Exclusive with V-Sync: in the runs where Windows makes exclusive fullscreen fast anyway, early frames reach the screen no sooner and it
stops itself; in the slow ones about 44 -> 30 ms. - G-SYNC / FreeSync on: exclusive about 17 -> 4-8 ms, borderless about 28 -> 4-8 ms, over 99.5% of frame gaps within 1 ms (RTX 3060). Worth it.
- No effect: exclusive without V-Sync; a window or borderless on a hybrid laptop's dedicated GPU; Wine (no present statistics).
- No old picture when Alt+Enter leaves exclusive fullscreen: on a hybrid laptop's dedicated GPU, 0.02 s after the key and again when the
mode change ended, the screen showed what the window held before it went exclusive (about 5 s old): the desktop compositor shows the
window's old content before the game presents to it. The window now gets a black frame before going exclusive and after leaving it;
retested, only black either way. One frame per switch, nothing otherwise. - The Play page's "Fixed game clock" switch is gone: since 2.3 the clock never waits on the screen and falls back to a fixed 59.94 Hz by
itself where it cannot line up (G-SYNC / FreeSync, no readable refresh times, a 75 Hz-class rate), so the switch only made a 60 Hz screen
repeat a frame about every 17 s. A player who had it on could no longer turn it off, so the launcher's first start after the update turns
it back off (once; running the game program directly, without the launcher, leaves it).timer_vblank = 1inblack.inistill works,
to rule the lining-up out by hand. - Texts: the launcher's help for display mode, low-latency present, V-Sync and 60 Hz in fullscreen says per mode what you gain, what it
costs and what to choose. On a hybrid laptop's dedicated GPU a window may hitch once or twice a second: at 60 Hz 226 pictures shown twice
in 75 s (borderless 30, exclusive 13, the integrated GPU's own window 4), while the game's own frame times matched the integrated GPU's:
the copy from the dedicated GPU to the integrated one, which this version cannot improve. Use borderless or exclusive fullscreen, or the
laptop's dedicated-GPU-only mode. - README: a Batocera v44 player's report (wine-proton; Celeron 1037U + GT730, AMD A8-7500; 2.2.36.x and every version since): fully
working, no texture errors, no hangs; anautorun.cmdwithCMD="Ninja Gaiden Black.exe"goes straight into the game; the 1037U's HD4000
integrated graphics withwindow = 400x300inblack.iniruns at 55 fps or more.
Tests
- Display (the frame number on screen read back with Desktop Duplication; present latency from present statistics only, with no capture
running): Iris Xe at 60 / 165 Hz, RTX 3060 via MUX with G-SYNC, a hybrid laptop; window / borderless / exclusive, low latency on / off.
All the data:project/docs/30_D3D9Ex上限计划_2.3.1.mdin the source repository. - Performance (Iris Xe, attract demo 160 s with an empty cache, 2.3.0.2 and 2.3.1 alternated, 2 runs each): game speed 93.70% vs 93.70%,
average frame 7.53 vs 7.21 ms, no hitches in either. Flip against copy was 93.70% on the RTX 3060 and the Iris Xe before. - Smoke test (the package itself):
Ninja Gaiden Black.exe40 s on the Iris Xe, version 2.3.1, the window by flip, no errors. - The package: Windows Defender scan of the four programs, no threats; the same files as 2.3.0.2. The test option
--copy-presentdoes
nothing unless given. - Not tested: 120 / 240 Hz screens (none at hand); AMD graphics; Steam Deck.
Package
ngb-hurricane-pc-2.3.1-win32.zip- Size: 3,542,787 bytes
- SHA-256:
d98d11fe07037ea62c4030f7d1c035799637f347eabe7375814aa13ef3eabb0f - Symbols
ngb-hurricane-pc-2.3.1-win32-symbols.zip: 20,005,927 bytes - SHA-256:
a895cf57ec65578841a31e2368dd69371edb87ad4891ad77c1c094fd2ec39a2d
Author: 哈雅布撒 on Bilibili (QQ: 2682557218)