mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 10:09:59 -04:00
Default to the Switch's own button positions on every gamepad, and fix menu edge cases.
pad_layout defaults to nintendo: Switch A on the right face button, B bottom, X top, Y left, on an Xbox pad too, where auto had picked the Xbox layout. The settings probe checks every button's position. Menu: the "default" mark follows the Steam Deck profile's values (cfg_default); Left on a value the list does not hold goes to the last entry; the HDR row says "in use: off" when the swapchain is not HDR10; the open state is read again after taking the reset, so a menu opened by F1 while the overlay alone was drawn starts with its focus row; the font atlas is rebuilt only for a scale more than 12% off or one that held for half a second, so dragging the window's edge no longer rebuilds it every frame. A shader that fails to translate keeps its request and code in the shader cache. NX2NAVI_GPA_TWIN=0 turns the guest copy of device address table stores off (diagnosis). The memcpy override no longer prints its first 500 calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -243,10 +243,13 @@ uint32_t vk_gpa_remap(uint64_t lo, uint64_t hi, uint32_t old_rec, VkBuffer buf,
|
||||
uint64_t dev = vk_gpa_device_address(buf);
|
||||
uint64_t p0 = (lo + 4095) >> PAGE_SHIFT, p1 = hi >> PAGE_SHIFT;
|
||||
plat_mutex_lock(&gpa_lock);
|
||||
// the twin: the buffer the pages named before (the pool's imported buffer), so writes reach guest memory too
|
||||
uint64_t twin = old_rec ? (uint64_t)G.cpu[REC_WORD + old_rec * REC_WORDS] |
|
||||
(uint64_t)G.cpu[REC_WORD + old_rec * REC_WORDS + 1] << 32
|
||||
: dev - buf_lo;
|
||||
// the twin: the buffer the pages named before (the pool's imported buffer), so writes reach guest memory too.
|
||||
// NX2NAVI_GPA_TWIN=0 (diagnosis): no twin, the writes go to the mirror alone, as before patch 0034.
|
||||
static int twins = -1;
|
||||
if (twins < 0) { const char *e = cfg_get("NX2NAVI_GPA_TWIN"); twins = !(e && !strcmp(e, "0")); }
|
||||
uint64_t twin = old_rec && twins ? (uint64_t)G.cpu[REC_WORD + old_rec * REC_WORDS] |
|
||||
(uint64_t)G.cpu[REC_WORD + old_rec * REC_WORDS + 1] << 32
|
||||
: dev - buf_lo;
|
||||
uint32_t r = dev ? rec_alloc(dev - buf_lo, twin) : 0;
|
||||
if (!r) { plat_mutex_unlock(&gpa_lock); return old_rec; }
|
||||
for (uint64_t p = p0; p < p1; p++) {
|
||||
|
||||
Reference in New Issue
Block a user