diff --git a/README.md b/README.md index 100e7170..d23ae9ae 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,14 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md). - Native code, not emulation - 60 fps by default, or a limit of 30 to 240 fps, the display's refresh rate or unlimited - Native widescreen and ultrawide (the window's shape, 21:9 or 32:9) with the HUD, menus and movies kept 16:9 -- AMD FSR 1 or bilinear scaling to the window, with a sharpness setting; black bars or stretch +- Resolutions above the game's 1440p: 1800p, 4K, 5K or the window's own size, sharp on high-DPI displays +- Upscaling and anti-aliasing: NVIDIA DLSS (DLAA, Quality, Balanced, Performance, Ultra Performance; RTX GPUs) or + AMD FSR 3.1 (Native AA and the same modes; any GPU), which render the 3D scene at the mode's share and keep the HUD + sharp; or AMD FSR 1 or bilinear scaling to the window, with a sharpness setting; black bars or stretch +- Frame generation with AMD FSR 3.1 (any GPU): a generated frame between every two the game draws, with the HUD kept + out of it, for about twice the frame rate on a fast display +- HDR on HDR displays: the game's own native HDR, or an enhanced HDR made from its SDR picture +- Every shader prepared when the game is built, so play does not stop to compile them - In-game settings menu (F1, or Minus and Plus together on a gamepad) and performance overlay (F10) - Keyboard, mouse and gamepads with remapping, Nintendo or Xbox button layout, rumble and gyro; the game follows whichever connected gamepad you press @@ -38,8 +45,9 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md). ## Installing -The setup program for this game is not ready yet. [docs/building.md](docs/building.md) describes building from -source. Settings are in the in-game menu and in `nx2navi.ini` ([nx2navi.ini.example](nx2navi.ini.example) lists every +The build kit builds the game on your PC from your own dump (a `.nup` file, or ExeFS and RomFS folders) in about 10 to +15 minutes: [docs/README-BuildKit.md](docs/README-BuildKit.md). [docs/building.md](docs/building.md) describes building +from source. Settings are in the in-game menu and in `nx2navi.ini` ([nx2navi.ini.example](nx2navi.ini.example) lists every key). Controls: [docs/controls.md](docs/controls.md). Requirements: Windows 10 or later, an x86-64 CPU with SSE4.2 (AVX2/FMA machines get a faster build), a GPU with Vulkan diff --git a/docs/README-BuildKit.md b/docs/README-BuildKit.md index 85d27817..2b310c25 100644 --- a/docs/README-BuildKit.md +++ b/docs/README-BuildKit.md @@ -1,4 +1,4 @@ -# Ocarina Recomp build kit +# NX2navi build kit This kit builds *The Legend of Zelda: Ocarina of Time* (Nintendo Switch 2, game version 1.1.1) as a native Windows program **on your PC, from your own copy of the game**. The kit contains no game code or data. Everything the build @@ -34,7 +34,7 @@ writes (`ocarina.exe`, the RomFS image, the shader cache, your saves) comes from Answer `Y` when it asks. If MSYS2 is somewhere other than `C:\msys64`, add `--msys \ucrt64` to the build command. -## Build (about 10 to 25 minutes, once) +## Build (about 10 to 15 minutes, once) Unpack this kit anywhere, open a Command Prompt in its folder and run: @@ -58,8 +58,13 @@ When it says `finished`, start `C:\Games\Ocarina\ocarina.exe`. You can delete `C ## Playing - **F1** opens the settings menu. Settings are saved in `nx2navi.ini` beside the game; saves go to `profile\`. -- The first time a shader appears it is translated, which can stutter briefly; it is cached from then on. After an - update of the kit or your graphics driver, the next start shows "Preparing shaders" once. +- Every shader was prepared during the build. After an update of your graphics driver, the next start shows + "Preparing shaders" once while the driver rebuilds them. +- **Screen** in the menu has Upscaling (DLSS on NVIDIA RTX cards, FSR 3.1 on any card), Frame generation (FSR 3.1; it + needs DLSS or FSR 3.1 upscaling on), HDR (Native is the game's own HDR; turn HDR on in Windows first) and the + resolution. Those marked "after restart" take effect when the game starts again. +- DLSS needs `nvngx_dlss.dll` from NVIDIA beside `ocarina.exe` (the kit does not include it); FSR 3.1's + `amd_fidelityfx_vk.dll` is copied there by the build. - Logs are in `logs\`. When reporting a problem, say where you were in the game and which graphics card you have, and attach `logs\nx2navi.log`. Never send game files. diff --git a/runtime/platform/win32.c b/runtime/platform/win32.c index f9c64396..dca59d8d 100644 --- a/runtime/platform/win32.c +++ b/runtime/platform/win32.c @@ -681,6 +681,19 @@ static LONG CALLBACK crash_veh(EXCEPTION_POINTERS *ep) { if (code == EXCEPTION_ACCESS_VIOLATION || code == EXCEPTION_STACK_OVERFLOW || code == EXCEPTION_ILLEGAL_INSTRUCTION) raw_note("crash_veh", code, (uintptr_t)ep->ContextRecord->Rip, ep->ExceptionRecord->NumberParameters >= 2 ? (uintptr_t)ep->ExceptionRecord->ExceptionInformation[1] : 0); + if (code == EXCEPTION_ACCESS_VIOLATION && !ep->ContextRecord->Rip) { + // a call through a null pointer: the call's return address is on top of the stack, in whichever module made it + const uintptr_t *sp = (const uintptr_t *)ep->ContextRecord->Rsp; + for (int i = 0; i < 4; i++) { + void *base = NULL; + if (!RtlPcToFileHeader((void *)sp[i], &base) || !base) continue; + char b[200]; + int n = snprintf(b, sizeof b, "[host] crash_veh: called from %s+%#llx (stack word %d)\n", image_name(base), + (unsigned long long)(sp[i] - (uintptr_t)base), i); + DWORD w; + if (n > 0) WriteFile(GetStdHandle(STD_ERROR_HANDLE), b, (DWORD)n, &w, NULL); + } + } const char *what = code == EXCEPTION_ACCESS_VIOLATION ? "access violation" : code == EXCEPTION_ILLEGAL_INSTRUCTION ? "illegal instruction" : code == EXCEPTION_INT_DIVIDE_BY_ZERO ? "integer division by zero"