《忍者龙剑传 黑之章》(含飓风版中文汉化 vb-zh-x2.1)与《忍者龙剑传》(2004)的非官方 Windows 原生移植。2.2.29。
2.2.29:启动器检查「号码重复」的存档,可一键移进回收站
只改了启动器,游戏程序与 2.2.28 相同。
玩家遇到的问题
用别人的存档覆盖了第 2 个存档槽,退出再进游戏,这个位置显示的却不是刚存的那个。
原因:同一个号码有两个存档(游戏代码与玩家存档双重确认)
- 游戏按存档名开头的号码分配存档格。 存档名形如
2. CHAPTER 7 012:40。游戏列出存档时(飓风版 x2.1 的 0x1DA220),用wcstol读出开头的号码,放进一张 30 格的表的对应位置,不检查这一格是否已有存档。所以同号的两个存档,后读到的会把先读到的顶掉,游戏只显示其中一个。 - 覆盖时只删显示出来的那个。 覆盖存档格时(0x1DA1B0),游戏先删掉这一格原来的存档,再用新名字写一个新存档。藏着的那个同号存档游戏根本不知道,不会被删;下次进游戏重新列表,它可能又把新存的顶掉。这就是“覆盖后显示的不是我刚存的”。
- 游戏自己不会造出重复号码。 新建存档时(0x1DA0B0),游戏从第 1 格往后找第一个空格;签名不对的外来存档也会占住号码(读档返回 -6,照样列入表中,只标为损坏)。
- 重复来自手动拷存档文件夹。 存档文件夹名是游戏对整个存档名算出的 12 位哈希(0x328CCB,玩家存档里 17 个文件夹全部算对)。
1. CHAPTER 255 012:26和1. CHAPTER 1 000:10号码相同,文件夹名却完全不同,所以把别处的存档文件夹拷进来时,Windows 不会提示“已存在”,两个 1 号就并存了。这位玩家的存档里就有一对:一个是别处拷来的(签名不是本机,文件时间都是 10-18 00:31),一个是本机存的。 - 启动器的导入、还原、导出会先把原存档整体挪进备份再换入,不会合并,不会造成重复。
新功能
- 「存档」页标红列出号码重复的存档:每个号码一行,下面每个存档一行,写明存档名、最后保存时间、文件夹名;签名不是本机的会注明「签名不是本机:别处拷来的」,方便判断哪个是拷进来的。没有重复时页面和以前一样。
- 每个重复存档后面有「移除」按钮:先弹确认框,写明移除哪个、保留哪个;移除的存档文件夹放进 Windows 回收站,删错了可以从回收站还原,不生成备份。
- 移除前按硬盘上的实际状态再核对一遍,任何一项不符就什么都不动并提示刷新:
- 游戏运行时不能移除(游戏自己记着一份存档列表);
- 文件夹名必须是游戏生成的 12 位十六进制格式,且确实在
UDATA\5443000d下,不能是链接; - 文件夹里的存档名必须与页面显示的一致(防止页面过时删错);
- 这个号码必须还有别的存档,一个号码的最后一个存档永远不会被移除。
- 只检查黑之章。2004 的存档名是
SAVE GAME NO01这种格式,它的存档格分配方式没有核实,暂不检查。
顺带修复
启动器的备份、导入、导出出错时,转换系统错误信息的写法有误(把两个不同的临时字符串首尾拼接),会导致启动器直接崩溃。正常操作很少走到这条路,这次测试“备份遇到链接文件夹而失败”时发现。现在出错会正常显示原因。
测试
- 用测试程序直接调用移除功能,逐项验证:非法文件夹名、链接文件夹(链接的目标不受影响)、某号码唯一的存档、页面已过时、文件夹已不存在、只读文件、删到只剩一个后再删,全部按上面的规则处理;移除的文件夹确实在回收站里,并记着原位置。
- 构造的边界存档:两个 1 号、三个 2 号、开头带空格的
5.与5.(和游戏一样算同号)都标出;10 号、11 号没有被误认成 1 号;31 号、0 号、SAVE GAME NO01不计入(游戏只有 1~30 号)。 - 玩家存档副本:正确标出 1 号的两个存档,移除后剩 14 个,没有重复;作者在测试启动器里实际点击移除确认。没有重复的正常存档不显示任何提示。
- 游戏在后台运行时尝试移除:被拦下,存档未变。
- 游戏程序启动正常(与 2.2.28 代码相同)。Windows Defender 扫描三个程序:无威胁。
发布包
ngb-hurricane-pc-2.2.29-win32.zip- 大小:3,063,635 字节
- SHA-256:
d0f5535f70f48caf7e8eed7997299b6b64555d3722a2394af329592339813297 - 符号包
ngb-hurricane-pc-2.2.29-win32-symbols.zip:26,667,550 字节 - SHA-256:
8c3d3cc4f2f6858c621743da9e529ff4850f63d99b3ce4e1b7bbd67ae5fad0af
作者: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.2.29.
2.2.29: the launcher finds saves that share a slot number and can move them to the Recycle Bin
Launcher only; the game program is the same as 2.2.28.
What a player ran into
With someone else's saves, the player overwrote slot 2, quit, and on the next start that slot showed something other than the save just made.
Cause: two saves with the same number (checked in the game's code and in the player's saves)
- The game files a save by the number its name starts with. Names look like
2. CHAPTER 7 012:40. Listing saves (x2.1 0x1DA220), the game reads the leading number withwcstoland puts the save in that entry of a 30-entry table, without checking whether the entry is taken. Of two saves with one number, the one read later replaces the earlier, and the game shows only one of them. - Overwriting deletes only the one shown. Overwriting a slot (0x1DA1B0), the game deletes that entry's save and writes a new one under a new name. The hidden save with the same number is unknown to the game and stays; on the next start it can take the new save's place again. That is "the slot is not the save I just made".
- The game never makes two itself. A new save (0x1DA0B0) takes the first free entry; a save signed elsewhere also holds its number (loading it returns -6, still listed, marked damaged).
- Duplicates come from copying save folders by hand. A save's folder name is the game's 12-digit hash of the whole name (0x328CCB; all 17 folders of the player's saves match).
1. CHAPTER 255 012:26and1. CHAPTER 1 000:10share a number but not a folder name, so copying another save folder's slots in raises no "already exists" in Windows, and both stay. The player's saves held such a pair: one copied in (signed elsewhere, files all dated 10-18 00:31), one made on this PC. - The launcher's import, restore and export move the old saves into a backup before putting the new ones in; they never merge, and never make duplicates.
New
- The Saves page lists saves sharing a number in red: a line per number and under it a line per save, with its name, last save time and folder; saves signed elsewhere say "signed elsewhere: copied in", a hint which one came from another folder. Without duplicates the page is as before.
- Remove beside each of them: it asks first, naming what goes and what stays; the removed save's folder goes to the Windows Recycle Bin, to take back from there. No backup is made.
- Before removing, the disk is checked again as it is now; if anything differs nothing is touched and the page asks to look again:
- not while the game runs (it keeps its own list of the slots);
- the folder name must be the game's 12 hex digits, straight under
UDATA\5443000d, and not a link; - the folder must still hold the save shown (a stale page cannot remove the wrong one);
- its number must still have another save: a number's last save is never removed.
- Ninja Gaiden Black only. 2004 names its saves like
SAVE GAME NO01; how it files them is not checked, so it is not checked here.
Also fixed
When a backup, import or export failed, the launcher turned the system's error text into a string from two different temporaries (start of one, end of the other) and crashed. Normal use rarely gets there; a test where a backup met a link folder did. Such errors are now shown.
Tests
- A test program calling the removal directly: a bad folder name, a link folder (its target untouched), a number's only save, a stale page, a folder already gone, read-only files, removing down to one and then once more, all as described above; the removed folder is in the Recycle Bin with its original location.
- Made-up saves: two No. 1, three No. 2,
5.with a leading space and5.(one number, as the game reads it) are listed; No. 10 and 11 are not taken for 1; No. 31, 0 andSAVE GAME NO01are left out (the game has 1 to 30). - A copy of the player's saves: the two No. 1 saves are listed; after removing one, 14 saves and no duplicates; the author clicked Remove in a test launcher. Normal saves without duplicates show nothing new.
- Removing while the game runs in the background: refused, saves unchanged.
- The game program starts as before (same code as 2.2.28). Windows Defender scan of the three programs: no threats.
Package
ngb-hurricane-pc-2.2.29-win32.zip- Size: 3,063,635 bytes
- SHA-256:
d0f5535f70f48caf7e8eed7997299b6b64555d3722a2394af329592339813297 - Symbols
ngb-hurricane-pc-2.2.29-win32-symbols.zip: 26,667,550 bytes - SHA-256:
8c3d3cc4f2f6858c621743da9e529ff4850f63d99b3ce4e1b7bbd67ae5fad0af
Author: 哈雅布撒 on Bilibili (QQ: 2682557218)