Android port (Adreno): Vulkan backend, GameActivity app, touch HUD, lifecycle, minimap quest goals
- host/android: Vulkan replay backend (nvn_vk.c) with pipeline/descriptor caching, ADPF, AChoreographer present link; Linux compat layer; Makefile.android (headless dmhost + APK lib) - android/app: GameActivity shell without Gradle (build_apk.sh), AAudio output, touch HUD port (touch_app.c + TouchOverlay.java, three layers: body / joystick / minimap goals), lifecycle save-on-background like iOS, art_from_ipa.py for touch / HUD / mapgoal art - touch: shared touch controls moved from ios/Sources to dm/touch - patch_nso.py Android ruleset, dmsh_vk.py shader pack, DM_TOUCH_PRODUCT defaults - hle_audio: AAudio resume waits through STARTING and reopens once on failure - .gitignore: local resources/ (original game data) never committed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5bc5a01087
commit
4d91f80bae
+10
-4
@@ -133,7 +133,7 @@ HLE_FORCE("_ZN2nn2oe20SetFocusHandlingModeENS0_17FocusHandlingModeE", "前后台
|
||||
// 界面层与 Final Result 仍按输出尺寸(+0xee88 / +0xee8c)建,末端由游戏自己的放大着色器 ps_upsample_p 放回输出尺寸。
|
||||
// 启动流程不调 0x8582f0,所以要主动调一次;调用点必须是游戏主线程取系统通知处——游戏自己处理模式切换的同一上下文
|
||||
// (在出图 HLE 里调会自锁:渲染锁已被出图路径持有)。
|
||||
// 缺省:iOS 0.75,Mac 宿主 1.0(画面闸门对 Switch 真值比);DM_3D_SCALE=0.5–1.0 覆盖。
|
||||
// 缺省:iOS 0.75,安卓 0.8(3D 720 档),Mac 宿主 1.0(画面闸门对 Switch 真值比);DM_3D_SCALE=0.5–1.0 覆盖。
|
||||
// 视觉尺子真值阶段(DM_NVN_RULER=1 的 A / B)强制 1.0,切到被测模式后才生效。
|
||||
// 动态比例(系统降频看的是占用率,温控档位只是粗信号 → 按实际掉帧调):控制器吃出图线程报来的实际上屏间隔
|
||||
// (与 perf.txt 同源),三级 配置值(0.75) → 0.72 → 0.70;下限 0.70(实看 0.65 有差别)。规则见 scale3d_ctl_step。
|
||||
@@ -146,7 +146,7 @@ HLE_FORCE("_ZN2nn2oe20SetFocusHandlingModeENS0_17FocusHandlingModeE", "前后台
|
||||
// the UI layer and Final Result are still built at the output size (+0xee88 / +0xee8c), and at the end the game's own upscale shader ps_upsample_p brings it back to the output size.
|
||||
// The boot flow does not call 0x8582f0, so it has to be called once actively; the call site must be where the game main thread fetches system notifications -- the same context in which the game itself handles mode switches
|
||||
// (calling it in the present HLE self-deadlocks: the render lock is already held by the present path).
|
||||
// Default: iOS 0.75, Mac host 1.0 (the screenshot gate compares against Switch ground truth); DM_3D_SCALE=0.5–1.0 overrides.
|
||||
// Default: iOS 0.75, Android 0.8 (3D at the 720 level), Mac host 1.0 (the screenshot gate compares against Switch ground truth); DM_3D_SCALE=0.5–1.0 overrides.
|
||||
// The visual ruler ground truth phase (A / B of DM_NVN_RULER=1) forces 1.0, it only takes effect after switching to the mode under test.
|
||||
// Dynamic scale (system throttling looks at utilization, the thermal state is only a coarse signal → adjust by actual dropped frames): the controller consumes the actual present intervals reported by the present thread
|
||||
// (same source as perf.txt), three levels configured value (0.75) → 0.72 → 0.70; lower limit 0.70 (0.65 is visibly different). For the rules see scale3d_ctl_step.
|
||||
@@ -155,6 +155,12 @@ HLE_FORCE("_ZN2nn2oe20SetFocusHandlingModeENS0_17FocusHandlingModeE", "前后台
|
||||
#include <TargetConditionals.h>
|
||||
#define SCALE3D_MIN 0.70f
|
||||
#define SCALE3D_MID 0.72f
|
||||
// 安卓缺省 0.8:输出高 900 时 3D 目标高 720(掌机档),界面仍按 900 画 | Android default 0.8: with output height 900 the 3D target is 720 high (handheld level), the UI is still drawn at 900
|
||||
#ifdef __ANDROID__
|
||||
#define DM_3D_SCALE_ANDROID 0.8f
|
||||
#else
|
||||
#define DM_3D_SCALE_ANDROID 1.0f
|
||||
#endif
|
||||
// 纯函数控制器(单测 t_oe.c 直接喂序列):level 0 = 配置值,越大越低。安全阀:只在可感的掉帧时动。
|
||||
// 窗:每累计 2 秒的上屏间隔一个窗,窗内帧率 = 上屏帧数 ÷ 间隔之和(被系统丢掉的帧不计数,那段时间落在下一张上屏帧的间隔里)。
|
||||
// 降:连续两个窗的帧率都 < 目标 × 0.92(60 帧时 55.2)→ 降一级。
|
||||
@@ -219,7 +225,7 @@ float dm_3d_scale_cur(void) { return atomic_load(&g_scale3d_cur); }
|
||||
static void scale3d_tick(void) {
|
||||
static float want_cfg = -1, cur = 1.0f; static module_t *main;
|
||||
if (want_cfg < 0) {
|
||||
const char *e = getenv("DM_3D_SCALE"); want_cfg = TARGET_OS_IPHONE ? 0.75f : 1.0f;
|
||||
const char *e = getenv("DM_3D_SCALE"); want_cfg = TARGET_OS_IPHONE ? 0.75f : DM_3D_SCALE_ANDROID;
|
||||
if (e) { char *end; float v = strtof(e, &end); if (end == e || *end || !(v >= 0.5f && v <= 1.0f)) die("DM_3D_SCALE 非法:%s(要求 0.5–1.0)", e); want_cfg = v; }
|
||||
for (int i = 0; i < g_nmod; i++) if (!strcmp(g_mod[i].name, "main")) main = &g_mod[i];
|
||||
}
|
||||
@@ -249,7 +255,7 @@ HLE_FORCE("_ZN2nn2oe25TryPopNotificationMessageEPj", "系统通知队列;前
|
||||
// The resolution parameter bits live in the thread slot, and the game reads them on the thread that fetches notifications to change the render size (on receiving 31 "performance mode changed", from main+0xe10ddc; 30 only updates a flag).
|
||||
// When they are read: each time the handler is entered, once after the first notification is fetched (0xe10d5c / 0xe10d60), and notifications fetched later in the loop still use the values from that read. So every time one is taken, the value due at this moment is written into the current thread's slot --
|
||||
// writing only when 31 is taken is not enough: when 31 is queued behind another notification (e.g. focus 15), the parameter bits have already been read after fetching 15 (iOS app: the front end did not switch to 16:9, in the Mac host run 31 happened to be queued first).
|
||||
if (ok) for (int i = 0; i < 2; i++) if (g_keyres[i]) pthread_setspecific(g_keyres[i], (void *)dm_game_res(i));
|
||||
if (ok) for (int i = 0; i < 2; i++) if (g_keyres[i]) dm_slot_set(g_keyres[i], (void *)dm_game_res(i));
|
||||
if (ok && *msg == MSG_PERFMODE) dm_uiscreen_res_reread();
|
||||
if (ok) LOG("oe 通知被游戏取走:%u", *msg); // 状态变化很少,逐条打不刷屏 | state changes are rare, printing each one does not flood the log
|
||||
return ok;
|
||||
|
||||
Reference in New Issue
Block a user