Native macOS App (first version): dm/tools/mac_app.sh, docs/MAC.md
The Mac host can now be packaged as a double-click macOS App with keyboard, mouse and gamepad input, saves under Application Support, a first-launch resource-folder picker and save-before-quit. dm/tools/mac_app.sh builds it after ./setup.sh; by default the package carries no derived content and points at this machine's build outputs, so it runs only on the Mac that built it and needs only a local ad-hoc signature. Nobody has played this version by hand yet; what was verified was run unattended. See docs/MAC.md.
This commit is contained in:
@@ -125,7 +125,8 @@ void dm_padmode_boot(void) { // 开机:游戏建面板之前(main.c,nnMa
|
||||
module_t *m = NULL; for (int i = 0; i < g_nmod; ++i) if (!strcmp(g_mod[i].name, "main")) m = &g_mod[i]; char mk[1100];
|
||||
if (!m || !getenv("DM_ROMFS_OVERLAY")) return;
|
||||
if (!dm_overlay_file("ctrl_touch", mk, sizeof mk)) { LOG("手柄 / 触屏布局:覆盖层没有 ctrl_touch 标记,照原版布局"); return; }
|
||||
if (pfx_write((uint8_t *)m->base, 0)) { g_have = 1; g_cur = 0; g_b = (uint8_t *)m->base; str_load(); LOG("手柄 / 触屏布局:开机用触屏版(layouts/xtouch_lay 等三个目录)"); }
|
||||
int pad = getenv("DM_APP") != NULL; // Mac App:没有触屏圆钮与底栏的绘制层,开机就用原版手柄版(我们的功能页在手柄版布局里同样有),之后也不切 | Mac App: there is no drawing layer for the touch buttons and bottom bar, so it starts in the original gamepad UI (our feature pages exist in the gamepad layout as well) and never switches afterwards
|
||||
if (pfx_write((uint8_t *)m->base, pad)) { g_have = 1; g_cur = pad; atomic_store(&g_want, pad); g_b = (uint8_t *)m->base; str_load(); LOG("手柄 / 触屏布局:开机用%s", pad ? "原版手柄版(Mac App)" : "触屏版(layouts/xtouch_lay 等三个目录)"); }
|
||||
}
|
||||
void dm_padmode_request(int pad) { pad = pad ? 1 : 0; atomic_store(&g_want, pad); if (g_have && pad != g_cur) atomic_store(&g_freeze, 1); } // 前端(任意线程):从这一刻起输入就不再交给游戏 | Front end (any thread): from this moment on input is no longer handed to the game
|
||||
int dm_padmode_current(void) { return g_cur; }
|
||||
|
||||
Reference in New Issue
Block a user