mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-20 00:29:57 -04:00
Triforce v0.5.0
In-game mods (GameBanana browser, search and installs, with the Mask Salesman), code-patch and cheat mods, the devs' test18 to test45 work (full performance overlay, frame pacing on, steady frame rate, save export and import, bug capture, new options rows, Setup's Mods page and Add to Steam), occlusion queries and new defaults, Auto resolution that scales, replay helper threads and robust buffers off by default, the options in sections.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
Ioctl numbers are Linux-style: nr bits 0-7, group 8-15, size 16-29, direction 30-31. Structures and values follow
|
||||
suyu's nvdrv (src/core/hle/service/nvdrv, GPL-2.0-or-later) and switchbrew "NV services". */
|
||||
#include "hos.h"
|
||||
#include "guest_bounds.h" /* ((Triforce) hos_range_ok: MAP_BUFFER_EX's remap check) */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
@@ -407,7 +408,10 @@ static uint32_t ioctl_as_gpu(uint32_t nr, uint64_t p, uint64_t size) {
|
||||
const uint64_t va = G64(p + 32);
|
||||
LOCK();
|
||||
const int i = map_floor(va);
|
||||
const int ok = i >= 0 && va + G64(p + 16) + G64(p + 24) <= maps[i].va + maps[i].size;
|
||||
/* ((Triforce) inside the mapping counted from its start: va + offset + size wrapped past 2^64 for a huge
|
||||
offset or size and passed) */
|
||||
const uint64_t at = i >= 0 ? va - maps[i].va : 0, off = G64(p + 16), size = G64(p + 24);
|
||||
const int ok = i >= 0 && hos_range_ok(at, off, maps[i].size) && hos_range_ok(at + off, size, maps[i].size);
|
||||
UNLOCK();
|
||||
MAP_LOG("nvdrv: remap GPU %#llx +%#llx size %#llx kind %#x: %s", (unsigned long long)va,
|
||||
(unsigned long long)G64(p + 16), (unsigned long long)G64(p + 24), G32(p + 4), ok ? "ok" : "no mapping");
|
||||
|
||||
Reference in New Issue
Block a user