Describe 1.1.0 field of view support and strengthen patch preservation checks

This commit is contained in:
shenjack committed 2026-11-09 08:44:44 +08:00
1 parent 89364414ea
commit c8eb315c1e
2 files changed
+26 -11

No files matched your search

+4 -4
View File
@@ -84,7 +84,7 @@ static const char *const text_en[UI_TEXT_COUNT] = {
"bars, or stretch them over the whole picture. Applies from the next movie.",
[UI_MENU_MOVIE_ASPECT_KEEP] = "Black bars", [UI_MENU_MOVIE_ASPECT_STRETCH] = "Stretch",
[UI_MENU_FOV] = "Field of view",
[UI_MENU_FOV_DESC] = "How much of the world the camera shows, in percent of the game's own. Game version 1.4.3 only.",
[UI_MENU_FOV_DESC] = "How much of the world the camera shows, in percent of the game's own. Game versions 1.1.0 and 1.4.3.",
[UI_MENU_SHADOW_RES] = "Shadow map size",
[UI_MENU_SHADOW_RES_DESC] = "Size of the sun's shadow map. The game's own size changes with the view, down to about 400 "
"near the ground, so leaf shadows look blocky and jump; a fixed size keeps them still and "
@@ -561,7 +561,7 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
"растянуть их на всю картинку. Действует со следующего ролика.",
[UI_MENU_MOVIE_ASPECT_KEEP] = "Чёрные полосы", [UI_MENU_MOVIE_ASPECT_STRETCH] = "Растянуть",
[UI_MENU_FOV] = "Поле зрения",
[UI_MENU_FOV_DESC] = "Сколько мира показывает камера, в процентах от игрового. Только для версии игры 1.4.3.",
[UI_MENU_FOV_DESC] = "Сколько мира показывает камера, в процентах от игрового. Для версий игры 1.1.0 и 1.4.3.",
[UI_MENU_SHADOW_RES] = "Размер карты теней",
[UI_MENU_SHADOW_RES_DESC] = "Размер карты теней от солнца. Собственный размер игры меняется вместе с видом, у земли до "
"примерно 400, поэтому тени листвы выглядят квадратными и дёргаются; постоянный размер делает "
@@ -1336,7 +1336,7 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
[UI_MENU_OV_FMT_FSR] = "AMD FSR 1, nitidez %d%%", [UI_MENU_OV_SCALE_NONE] = "nenhuma (1:1)",
[UI_MENU_OV_SCALE_BILINEAR] = "bilinear",
[UI_MENU_FOV] = "Campo de visão",
[UI_MENU_FOV_DESC] = "Quanto do mundo a câmera mostra, em porcentagem do original do jogo. Só na versão 1.4.3 do "
[UI_MENU_FOV_DESC] = "Quanto do mundo a câmera mostra, em porcentagem do original do jogo. Nas versões 1.1.0 e 1.4.3 do "
"jogo.",
[UI_MENU_SHADOW_RES] = "Tamanho do mapa de sombras",
[UI_MENU_SHADOW_RES_DESC] = "Tamanho do mapa de sombras do sol. O tamanho do jogo muda com a vista, até cerca de "
@@ -1606,7 +1606,7 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
[UI_MENU_MOVIE_ASPECT_STRETCH] = "拉伸",
[UI_MENU_FOV] = "视野",
[UI_MENU_FOV_DESC] = "镜头能看到多大范围,以游戏自身视野的百分比表示。"
"仅限游戏版本 1.4.3。",
"支持游戏版本 1.1.0 和 1.4.3。",
[UI_MENU_SHARPNESS] = "FSR 锐度",
[UI_MENU_SHARPNESS_DESC] = "FSR 缩放后的锐化强度;0 为关闭。",
[UI_MENU_COLOR] = "色彩",
+22 -7
View File
@@ -8,6 +8,7 @@ import math
import struct
import sys
import tempfile
import zlib
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
@@ -45,7 +46,9 @@ def main():
ap.add_argument('--exefs', type=Path)
ap.add_argument('--cflags', default='-march=x86-64-v3')
args = ap.parse_args()
mods = layout(args.exefs) if args.exefs else [('main', 0x7000000000, 0x472d000)]
mods = layout(args.exefs) if args.exefs else [
('main', 0x7000000000, 0x472d000), ('subsdk0', 0x7004800000, 0x400000),
('sdk', 0x7004c00000, 0x800000)]
table = patches.load(ROOT / 'recomp' / 'patches-v110.txt', mods)
base = mods[0][1]
if args.exefs:
@@ -100,10 +103,11 @@ def main():
struct.pack_into('<' + 'I' * len(code), text, pc - lo, *code)
emu = Emu([(lo, text), (table.page, page)])
emu.mu.mem_write(BUF, bytes(mem))
x = [BUF + 0x2000] * 31
x[8] = BUF + 0x2000
x = [0x1234567800000000 + i for i in range(31)]
for i in (8, 19, 20, 23, 27):
x[i] = BUF + 0x2000
x[25], x[30] = offset, enabled
v = [int.from_bytes(struct.pack('<f', 2.0), 'little')] * 32
v = [(0x123456789abcdef << 32) | int.from_bytes(struct.pack('<f', 2.0), 'little')] * 32
v[1] = int.from_bytes(struct.pack('<f', 4.0), 'little')
v[9] = int.from_bytes(struct.pack('<f', 3.0), 'little')
v[10] = int.from_bytes(struct.pack('<f', 4.0), 'little')
@@ -128,9 +132,20 @@ def main():
# The stack save must preserve the complete x10, not just its lower word.
if name in ('aspect', 'fov'):
assert ex[10] == x[10]
allowed_x = {target} if kind in ('offset', 'source', 'shadow', 'cascade') else {9} if kind == 'map' else set()
allowed_v = {0, 1} if kind == 'map' else {target}
if enabled and kind in ('map', 'aim', 'gyro'):
allowed_v |= {16}
if kind == 'map':
allowed_v |= {1}
if enabled and kind == 'fov':
allowed_v |= {8}
assert all(ex[i] == x[i] for i in range(31) if i not in allowed_x)
assert all(ev[i] == v[i] for i in range(32) if i not in allowed_v)
cases, expect = groups[ratio]
cases.append((k, 0, x, sp, nzcv, v, False))
expect.append((ex, esp, enz, epc, ev, 0))
cases.append((k, 0, x, sp, nzcv, v, True))
memory = zlib.crc32(emu.mu.mem_read(BUF, BUF_SIZE))
expect.append((ex, esp, enz, epc, ev, memory))
page_path = work / 'page.bin'
page_base = table.page & ~0xffff # Windows reserves at 64 KiB allocation granularity
page_path.write_bytes(bytes(table.page - page_base) + page)
@@ -142,7 +157,7 @@ def main():
records, err = run_harness(exe, work, mem, cases, [(page_base, page_path)])
assert not err and len(records) == len(cases), err
for case, want, got in zip(cases, expect, records):
differences = diff_state(got, want, False, False)
differences = diff_state(got, want, False, True)
assert not differences, (SITES[case[0]], differences)
total += len(cases)
print(f'v110: {len(SITES)} patch contracts, {total} native/Unicorn cases passed (on and off)')