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:
shenlei
2026-10-14 14:55:05 +09:00
co-authored by Claude Opus 5.5
parent 5bc5a01087
commit 4d91f80bae
106 changed files with 7009 additions and 181 deletions
@@ -0,0 +1,15 @@
// Linux 替身:CommonCrypto/CommonDigest.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: CommonCrypto/CommonDigest.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
#include <stdint.h>
typedef uint32_t CC_LONG;
#define CC_MD5_DIGEST_LENGTH 16
#define CC_SHA1_DIGEST_LENGTH 20
#define CC_SHA256_DIGEST_LENGTH 32
typedef struct { uint32_t h[8]; uint64_t len; uint8_t buf[64]; uint32_t n; } CC_SHA256_CTX;
unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned char *md);
unsigned char *CC_SHA1(const void *data, CC_LONG len, unsigned char *md);
int CC_SHA256_Init(CC_SHA256_CTX *c);
int CC_SHA256_Update(CC_SHA256_CTX *c, const void *data, CC_LONG len);
int CC_SHA256_Final(unsigned char *md, CC_SHA256_CTX *c);
@@ -0,0 +1,3 @@
// Linux 替身:TargetConditionals.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: TargetConditionals.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,15 @@
// Linux 替身:dispatch/dispatch.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: dispatch/dispatch.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
#include <stdint.h>
// 只实现计数信号量(hle_audio 用);队列 / 定时 / 信号源在源码里按 __APPLE__ 分支
// Only the counting semaphore is implemented (used by hle_audio); queues / timers / signal sources branch on __APPLE__ in the sources
typedef struct dm_dsema *dispatch_semaphore_t;
typedef uint64_t dispatch_time_t;
#define DISPATCH_TIME_NOW 0ull
#define DISPATCH_TIME_FOREVER (~0ull)
dispatch_semaphore_t dispatch_semaphore_create(long value);
long dispatch_semaphore_signal(dispatch_semaphore_t s);
long dispatch_semaphore_wait(dispatch_semaphore_t s, dispatch_time_t timeout);
void dispatch_release(void *obj);
@@ -0,0 +1,3 @@
// Linux 替身:libkern/OSCacheControl.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: libkern/OSCacheControl.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,4 @@
// Linux 替身:mach-o/dyld.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach-o/dyld.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
#include <dlfcn.h>
@@ -0,0 +1,3 @@
// Linux 替身:mach-o/getsect.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach-o/getsect.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,3 @@
// Linux 替身:mach-o/ldsyms.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach-o/ldsyms.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
+33
View File
@@ -0,0 +1,33 @@
// Linux 替身:mach/mach.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach/mach.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
#include <stdint.h>
// ---- 线程诊断接口:Linux 上一律返回失败,调用方走「拿不到」分支(暂停取寄存器、线程信息、实时策略都只用于诊断 / 调优) ----
// ---- Thread diagnostic interfaces: always fail on Linux, callers take their "unavailable" branch (suspend-and-read-registers, thread info and real-time policy are only for diagnostics / tuning) ----
typedef int boolean_t;
typedef int *thread_info_t, *thread_state_t, *thread_policy_t;
typedef int thread_flavor_t, thread_state_flavor_t, thread_policy_flavor_t;
typedef mach_port_t *thread_act_array_t;
typedef struct { int seconds, microseconds; } time_value_t;
typedef struct { time_value_t user_time, system_time; int cpu_usage, policy, run_state, flags, suspend_count, sleep_time; } thread_basic_info_data_t;
typedef struct { uint64_t pth_user_time, pth_system_time; int32_t pth_cpu_usage, pth_policy, pth_run_state, pth_flags, pth_sleep_time, pth_curpri, pth_priority, pth_maxpriority; char pth_name[64]; } thread_extended_info_data_t;
typedef struct { uint64_t __x[29], __fp, __lr, __sp, __pc; uint32_t __cpsr, __pad; } arm_thread_state64_t;
#define THREAD_BASIC_INFO 3
#define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t)(sizeof(thread_basic_info_data_t) / sizeof(int)))
#define THREAD_EXTENDED_INFO 5
#define THREAD_EXTENDED_INFO_COUNT ((mach_msg_type_number_t)(sizeof(thread_extended_info_data_t) / sizeof(int)))
#define ARM_THREAD_STATE64 6
#define ARM_THREAD_STATE64_COUNT ((mach_msg_type_number_t)(sizeof(arm_thread_state64_t) / sizeof(int)))
#define __darwin_arm_thread_state64_get_pc(s) ((s).__pc)
#define __darwin_arm_thread_state64_get_lr(s) ((s).__lr)
#define __darwin_arm_thread_state64_get_fp(s) ((s).__fp)
#define __darwin_arm_thread_state64_get_sp(s) ((s).__sp)
static inline kern_return_t thread_info(mach_port_t t, thread_flavor_t f, thread_info_t o, mach_msg_type_number_t *n) { (void)t; (void)f; (void)o; (void)n; return KERN_FAILURE; }
static inline kern_return_t thread_suspend(mach_port_t t) { (void)t; return KERN_FAILURE; }
static inline kern_return_t thread_resume(mach_port_t t) { (void)t; return KERN_FAILURE; }
static inline kern_return_t thread_get_state(mach_port_t t, thread_state_flavor_t f, thread_state_t s, mach_msg_type_number_t *n) { (void)t; (void)f; (void)s; (void)n; return KERN_FAILURE; }
static inline kern_return_t task_threads(mach_port_t task, thread_act_array_t *a, mach_msg_type_number_t *n) { (void)task; *a = 0; *n = 0; return KERN_FAILURE; }
static inline kern_return_t vm_deallocate(mach_port_t task, vm_address_t a, vm_size_t n) { (void)task; (void)a; (void)n; return KERN_SUCCESS; }
// libSystem 私有:本线程 {指令, 周期};Linux 版给 0(可改用 perf_event_open) | libSystem private: this thread's {instructions, cycles}; Linux gives 0 (perf_event_open could be used instead)
static inline int thread_selfcounts(int type, void *buf, size_t nbytes) { (void)type; memset(buf, 0, nbytes); return -1; }
@@ -0,0 +1,3 @@
// Linux 替身:mach/mach_time.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach/mach_time.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,3 @@
// Linux 替身:mach/thread_info.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach/thread_info.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,15 @@
// Linux 替身:mach/thread_policy.h —— 实时线程策略在 Linux 上一律失败(调用方只记日志)
// Linux stand-in: mach/thread_policy.h -- real-time thread policy always fails on Linux (callers only log)
#pragma once
#include <mach/mach.h>
typedef struct { uint32_t period, computation, constraint; boolean_t preemptible; } thread_time_constraint_policy_data_t;
#define THREAD_TIME_CONSTRAINT_POLICY 2
#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t)(sizeof(thread_time_constraint_policy_data_t) / sizeof(int)))
typedef struct { int importance; } thread_precedence_policy_data_t;
#define THREAD_PRECEDENCE_POLICY 3
#define THREAD_PRECEDENCE_POLICY_COUNT 1
typedef struct { boolean_t timeshare; } thread_extended_policy_data_t;
#define THREAD_EXTENDED_POLICY 1
#define THREAD_EXTENDED_POLICY_COUNT 1
static inline kern_return_t thread_policy_set(mach_port_t t, thread_policy_flavor_t f, thread_policy_t p, mach_msg_type_number_t n) { (void)t; (void)f; (void)p; (void)n; return KERN_FAILURE; }
static inline kern_return_t thread_policy_get(mach_port_t t, thread_policy_flavor_t f, thread_policy_t p, mach_msg_type_number_t *n, boolean_t *def) { (void)t; (void)f; (void)p; (void)n; if (def) *def = 1; return KERN_FAILURE; }
@@ -0,0 +1,3 @@
// Linux 替身:mach/vm_statistics.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: mach/vm_statistics.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,10 @@
// Linux 替身:malloc/malloc.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: malloc/malloc.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
#include <malloc.h>
typedef struct { unsigned blocks_in_use; size_t size_in_use, max_size_in_use, size_allocated; } malloc_statistics_t;
// 只填 size_in_use(mallinfo 的 uordblks);zone 参数忽略 | Only size_in_use is filled (mallinfo uordblks); the zone argument is ignored
static inline void malloc_zone_statistics(void *zone, malloc_statistics_t *s) {
(void)zone; struct mallinfo mi = mallinfo();
memset(s, 0, sizeof *s); s->size_in_use = s->size_allocated = (size_t)mi.uordblks;
}
@@ -0,0 +1,3 @@
// Linux 替身:pthread/qos.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: pthread/qos.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once
@@ -0,0 +1,3 @@
// Linux 替身:sys/clonefile.h —— 实际定义见 compat_linux.h(-include 强制先含)
// Linux stand-in: sys/clonefile.h -- the actual definitions are in compat_linux.h (force-included with -include)
#pragma once