SRWYAccess v2.94 — 全面代碼審查修正
v2.93 之後的全面代碼審查成果:修正多個長期存在的播報遺漏、補強崩潰防護、進一步降低背景成本。無新增功能,建議所有使用者更新。
播報修正
- 重開選單會正常播報了:同一畫面內關掉再打開同類型選單(例如精神指令清單、切換另一台機體的狀態畫面)原本會只聽到畫面名稱、聽不到目前選項,現在會完整重新播報。
- 閒置後開選單不再延遲:閒置超過幾秒後打開新選單,原本會有最多約 0.7 秒的無聲延遲才開始播報。
- 新關卡的「戰術畫面」播報不再被吞:上一關殘留的播報抑制旗標會洩漏到下一關,偶爾吞掉新關卡的開場狀態播報。
- 場景轉換後第一次按複讀鍵不再失效:轉換期間放開 R/[/] 鍵會讓下一次按壓被誤判為長按而吞掉。
- 對話框不再偶爾整個沉默:對話框在遊戲重建系統物件的瞬間出現時,模組會錯過偵測且不再重試,整個對話框(含是/否選項)完全無聲。現在會自動重試。
- 戰後選單期間的教學視窗會播報了:戰鬥結束後的選單情境下首次出現的教學視窗原本永遠不會被偵測。
- 自訂獎勵畫面的標籤修正:原本會唸出英文原始 key(fullcustom_chosen),現在正確唸出「已選擇」與「已選 X/Y」。
- 畫面複讀瀏覽位置:切換到項目數恰好相同的不同畫面時,[/] 瀏覽位置現在會正確重置,不會從上個畫面的中間位置接續。
效能
- 系統選項畫面:一個節流條件寫反的 bug 讓選項畫面開啟期間每次輪詢都做一次全場景掃描,已修正,選項畫面明顯變順。
- 戰鬥準備畫面的 [/] 瀏覽:每按一次原本觸發最多 4 次全場景掃描(找任務目標、戰況、幕間等根本不可能開著的畫面),現在改為快取+情境跳過,連按瀏覽不再卡頓。R 鍵仍強制重新讀取保證即時。
- 距離查詢:游標移動後按敵我距離鍵不再重新掃描地圖上每個單位,改用 2 秒內有效的掃描快取,距離方向純本地運算。
- 指標優先比對擴大套用:戰鬥字幕、開場旁白、對話框內容偵測、排序/篩選文字——遊戲內部字串沒變就跳過昂貴的轉換。多處每輪詢的元件查詢也改為快取。
- 高幀率保護:輪詢頻率改以實際時間為上限。遊戲跑高於 60fps 時(高更新率螢幕),模組原本會等比加速輪詢、成倍增加 CPU 成本,現在維持設計速率。
穩定性
- 七處跨輪詢快取指標的讀取路徑補上原生記憶體驗證(教學管理器、對話框選擇追蹤、畫面複讀、戰鬥結算、戰術地圖單位資料、MAP 武器目標、升級樹導航),堵住場景轉換期間的罕見崩潰窗口。做法與既有防護一致,不增加任何操作延遲。
內部清理
- 移除約 15 項死代碼:一整個從未執行的處理器、6 個孤兒設定常數、舊版複讀實作、重複的工具函式(整併後並升級為崩潰安全的字串轉換)、未使用的函式庫引用。
安裝
將壓縮檔內容放到遊戲目錄(詳見 README):SRWYSafe.dll、Tolk.dll、nvdaControllerClient64.dll 放遊戲根目錄,Mods\SRWYAccess.dll 放 Mods 資料夾。從 v2.93 更新只需覆蓋 Mods\SRWYAccess.dll。
SRWYAccess v2.94 — Comprehensive Code Audit
Results of a full code audit following v2.93: fixes for several long-standing announcement gaps, hardened crash protection, and further background-cost reduction. No new features; recommended for all users.
Announcement fixes
- Reopened menus announce again: closing and reopening a menu of the same type within one screen (e.g. the spirit command list, or another unit's status screen) used to announce only the screen name and stay silent about the current selection. It now re-announces fully.
- No more silent delay after idling: opening a new menu after a few seconds of idling had up to ~0.7s of silence before the first announcement.
- New stage's "tactical battle" announcement no longer swallowed: a suppression flag could leak from the previous stage and eat the opening state announcement.
- First review key press after a transition works: releasing R / [ / ] during a scene transition made the next press be misread as a held key and swallowed.
- Dialogs can no longer go permanently silent: a dialog appearing the instant the game recreates its system object was missed once and never retried — the whole dialog (including yes/no options) stayed unvoiced. It now retries automatically.
- Tutorial windows during post-battle menus are read: a first-time tutorial window opening in that context was never detected before.
- Custom Bonus screen labels fixed: raw label keys ("fullcustom_chosen") were announced instead of "Chosen" / "Chosen X of Y".
- Screen review browse position: switching to a different screen that coincidentally has the same item count now resets the [ / ] browse position correctly.
Performance
- Options screen: an inverted throttle condition made the mod run a whole-scene scan every poll for as long as the options screen stayed open. Fixed — the screen is noticeably smoother.
- Battle preparation [ / ] browsing: each press used to trigger up to 4 whole-scene scans looking for overlays that cannot be open there. Now cached + context-gated; rapid browsing no longer stutters. R still forces a fresh read.
- Distance queries: pressing enemy/ally distance keys after moving the cursor reuses a 2-second unit scan instead of re-reading every unit on the map; distance/direction math is pure local computation.
- Pointer-first comparison extended: battle subtitles, prologue narration, dialog content polling, and sort/filter labels now skip the expensive string conversion when the game's internal string instance is unchanged. Several per-poll component lookups are now cached.
- High-refresh-rate protection: polling is now capped by wall-clock time. Above 60fps the mod used to poll proportionally faster, multiplying its CPU cost; it now holds the designed rate.
Stability
- Seven cached-pointer read paths (tutorial manager, dialog selection tracking, screen review, battle results, tactical map unit data, MAP weapon targeting, upgrade tree navigation) now verify native memory before reading, closing rare crash windows during scene transitions. Same approach as the existing protections — adds no input latency.
Internal cleanup
- Removed ~15 dead-code items: an entire never-executed handler, 6 orphaned config constants, a legacy screen-review implementation, duplicated helpers (consolidated and upgraded to the crash-safe string conversion), and unused library references.
Installation
Place the archive contents into the game directory (see README): SRWYSafe.dll, Tolk.dll, nvdaControllerClient64.dll in the game root; Mods\SRWYAccess.dll in the Mods folder. Updating from v2.93 only requires replacing Mods\SRWYAccess.dll.