[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110822":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":13,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":14,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":24,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},110822,"knife","AuroraWright\u002Fknife","AuroraWright","A Rust reimplementation of the engine of Tsukihime -A piece of blue glass moon- for Nintendo Switch",null,"Rust",75,7,1,4,0,5,22,49.41,"Mozilla Public License 2.0",false,"main",true,[],"2026-11-12 12:34:46","2026-11-23 13:15:19","# knife\n\nA Rust reimplementation of the engine of Tsukihime -A piece of blue glass moon- and Witch on the Holy Night for\nNintendo Switch. It plays the games from their Switch releases' data and aims to behave exactly like the\noriginals: it is heavily based on a decompilation of the original Switch executables, and its behaviour is\nchecked against the Switch games running in an emulator.\n\n![The title screen of Tsukihime's overseas release in knife](screenshot.png)\n\n![The title screen of Witch on the Holy Night in English in knife](screenshot_woh.png)\n\nBoth releases of Tsukihime are supported: the Japanese one and the overseas one (English, Simplified and\nTraditional Chinese besides Japanese). So is the Switch release of Witch on the Holy Night (Japanese, English,\nSimplified and Traditional Chinese). knife tells the games apart by their data.\n\nknife is inspired by [shin](https:\u002F\u002Fgithub.com\u002FDCNick3\u002Fshin), DCNick3's reimplementation of the engine of\nthe Switch visual novels by Entergram, and shares some of its code.\n\n[engine-writeup.md](engine-writeup.md) describes how the original engine works: the game data, the script\nmachine and its frame loop, text, the stage, sound, saves and the full instruction set, and what Witch on the\nHoly Night does differently.\n\n## Game data\n\nknife needs the game data from your own copy of the game:\n\n1. Extract the romfs of the game's Switch release, with its latest update applied (knife follows the Japanese\n   Tsukihime's update 1.0.3; data from its earlier versions still plays).\n2. Add the Switch's shared system font, which the menus and help lines use. Dump\n   `nintendo_udsg-r_std_003.bfttf` from the firmware's FontStandard archive (system title 0100000000000811)\n   and copy it into the extracted romfs folder, for example:\n\n   ```sh\n   hactoolnet -k prod.keys --romfsdir fontstandard \u003CFontStandard>.nca\n   cp fontstandard\u002Fnintendo_udsg-r_std_003.bfttf \u003Cromfs folder>\u002F\n   ```\n\n   The Chinese languages of Tsukihime's overseas release and of Witch on the Holy Night also use the Chinese\n   system fonts: copy the `.bfttf` files of FontChineseSimplified (0100000000000814:\n   `nintendo_udsg-r_org_zh-cn_003.bfttf`, `nintendo_udsg-r_ext_zh-cn_003.bfttf`) and FontChineseTraditional\n   (0100000000000813: `nintendo_udjxh-db_zh-tw_003.bfttf`) into the same folder.\n\nBy default knife looks for this folder as `assets` next to the executable (inside a macOS app bundle, also\n`Contents\u002FResources\u002Fassets`).\n\n### Mod\u002Ftranslation support\n\nFiles in a `mod_assets` folder (found the same way as `assets`, or set with `-m`) are used in place of the game\ndata's files at the same path: an archive's `.hed`, `.nam` or `.mrg`, a movie, a stream, a font and so on. A font\nfolder (`ja`, `en2`, ...) with files of its own replaces the game data's. Everything else still comes from\n`assets`.\n\n## Building and running\n\n```sh\ncargo build --release -p knife\n.\u002Ftarget\u002Frelease\u002Fknife -a \u003Cromfs folder>\n```\n\nMovies are decoded by the platform: VideoToolbox on macOS, Media Foundation on Windows (N editions need the\nMedia Feature Pack) and GStreamer elsewhere (with an H.264 plugin such as gst-libav, plus the GStreamer\ndevelopment packages to build). An `ffmpeg` executable on the `PATH` is used as a fallback.\n\n### Options\n\n| Option | |\n|---|---|\n| `-a`, `--assets-dir DIR` | the game data folder |\n| `-m`, `--mod-assets-dir DIR` | the mod folder, whose files replace the game data's (see above; used only if it exists) |\n| `-l`, `--language ja\\|en\\|zc\\|zt` | the language, as the console language and the config's language buttons pick it (Tsukihime's overseas release and Witch on the Holy Night; by default the config's setting) |\n| `-s`, `--save-file PATH` | the save file (see below for the default) |\n| `-t`, `--text-websocket HOST:PORT` | serve the displayed text over WebSocket for text hookers (e.g. `127.0.0.1:6677`) |\n| `-f`, `--fullscreen` | start in fullscreen |\n| `--skip-intro` | leave out the TYPE-MOON logo movie and the notice before the title |\n| `--skip-movies` | let every story movie be skipped, even the ones the Switch plays through the first time |\n| `--tsukihimates` | apply the [Tsukihimates](https:\u002F\u002Fgithub.com\u002FTsukihimates\u002FTsukihime-Translation) English patch's code changes (Japanese release; their romfs as the mod assets folder) |\n\nWith `--text-websocket`, every client receives each message as plain text and each choice's options one per\nline; a client that connects late first gets the most recent text.\n\nThe default save file is in:\n\n- macOS: `~\u002FLibrary\u002FApplication Support\u002Fknife\u002Fsavedata000`\n- Windows: `%APPDATA%\\knife\\savedata000`\n- Linux: `~\u002F.local\u002Fshare\u002Fknife\u002Fsavedata000` (or `$XDG_DATA_HOME\u002Fknife\u002Fsavedata000`)\n\nTsukihime's overseas release uses `knife\u002Foverseas\u002Fsavedata000` in the same folder, Witch on the Holy Night\n`knife\u002Fwitch\u002Fsavedata000`. Settings, unlocks, read text and save slots are all stored in this one file, in the\nSwitch game's own format, so a save copied from a Switch loads as is, and the reverse also works.\n\n### knife.ini\n\nA `knife.ini` file next to the executable (or in `Contents\u002FResources` inside a macOS app bundle) can set any of\nthe options above, one per line, using the long option name without `--`:\n\n```ini\nassets-dir = assets\nlanguage = en\ntext-websocket = 127.0.0.1:6677\nskip-intro = true\n```\n\nLines starting with `;` or `#` are comments, an empty value leaves an option unset, on \u002F off options take\ntrue or false, and relative paths are resolved from the folder containing `knife.ini`. Options given on the\ncommand line take precedence. See [`knife.ini.example`](knife.ini.example).\n\n## Controls\n\nThe keyboard stands in for the Switch controller, and each button does what it does in the Switch game on that\nscreen (the game's own map is in Config → 操作説明 \u002F controls). The left mouse button is the touch screen; the\nmouse wheel or trackpad tilts the left stick.\n\nGame controllers work too: every controller acts as the Switch controller, button for button (A \u002F B \u002F X \u002F Y as\nthe controller labels them, Plus \u002F Minus as Start \u002F Back).\n\n| Key | Switch |\n|---|---|\n| Arrow keys | D-pad |\n| W \u002F A \u002F S \u002F D | left stick |\n| Enter | A (confirm, advance text) |\n| Escape, right click | B (cancel, back) |\n| B | X |\n| M | Y |\n| H \u002F J | L \u002F R |\n| T \u002F Y | ZL \u002F ZR |\n| K \u002F L | right stick up \u002F down |\n| O | R3 |\n| P | L3 |\n| U \u002F I | Minus \u002F Plus |\n| F | toggle fullscreen |\n| Left Ctrl (hold) | skip text while held |\n\n### In the story\n\n| Switch | Action |\n|---|---|\n| A | advance text; shows a hidden message window |\n| B | stop skipping, else hide \u002F show the message window |\n| X | backlog |\n| Y | system menu |\n| L | auto mode on \u002F off |\n| R | skip mode on \u002F off |\n| ZL (hold) | rewind |\n| ZR (hold) | fast forward |\n| Plus or L3 | quick save (Witch on the Holy Night) |\n| Minus | quick load (Witch on the Holy Night) |\n| D-pad \u002F right stick up | open the mode panel |\n| D-pad \u002F right stick down | advance text, close the mode panel |\n| D-pad up \u002F down | move between choices |\n\n| Touch (mouse) | Action |\n|---|---|\n| tap | advance text |\n| drag left \u002F right from the middle | rewind \u002F fast forward, faster the further it is dragged |\n| flick down from the top edge, or pointer at the top edge | open the mode panel |\n| flick up, or tap below the panel | close the mode panel |\n| flick right from the left edge | system menu (Witch on the Holy Night: backlog) |\n| flick left from the right edge | backlog (Witch on the Holy Night: system menu) |\n| pointer at the bottom edge | hide the message window |\n\nThe mode panel holds previous scene, rewind, auto, skip, next scene, quick save, quick load and voice replay.\n\n### Menus and gallery\n\n| Switch | Action |\n|---|---|\n| D-pad \u002F right stick | move the cursor |\n| A | confirm (hold A + left \u002F right to drag a config slider) |\n| B | back |\n| L \u002F R | config tabs; previous \u002F next picture in the CG viewer |\n| left stick | scroll lists, the flowchart and the config; move the picture in the CG viewer |\n| right stick up \u002F down | zoom in the CG viewer |\n\nA mouse drag scrolls the flowchart, CG list, music list and config, like a touch drag on the Switch.\n\n## License\n\nknife is licensed under the [Mozilla Public License 2.0](LICENSE).\n","knife 是一个用 Rust 编写的任天堂 Switch 版《月姬 -A piece of blue glass moon-》及《魔法使之夜》游戏引擎的重实现。它基于对原版 Switch 可执行文件的反编译分析，精确复现原始运行逻辑，支持日\u002F英\u002F简体中文\u002F繁体中文多语言版本，并通过 romfs 游戏数据与系统字体文件运行。项目强调行为一致性，依赖用户自有游戏资源，提供 mod\u002Ftranslation 覆盖机制，适用于本地化补丁、跨平台兼容性研究及视觉小说引擎逆向工程验证场景。",2,"2026-11-24 04:39:41","CREATED_QUERY"]