Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cheats: a weak dm_cheats_present for the gfx tests
hle_nvn.c calls dm_cheats_present once per presented frame, and the
CPU-only graphics tests (dm/gfx/tests t_nvn) link hle_nvn.c without the
host, so they stopped linking. A weak no-op in nvn_mtl.m, beside the
other weak host stubs, lets them link again; hle_cheats.c provides the
strong definition in the host.

(cherry picked from commit 9782490ec0127ccec6d7f5042cd95a05cbc7f35e, only its weak cheats stub)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
  • Loading branch information
Amost- and claude committed Oct 30, 2026
commit e1547423aaf70366b31f5a1cb09231a770bfd7ef
1 change: 1 addition & 0 deletions dm/gfx/nvn/nvn_mtl.m
Original file line number Diff line number Diff line change
Expand Up @@ -2863,6 +2863,7 @@ static inline int passdump(void) {
#define PD(...) do { if (passdump()) { flockfile(stderr); fprintf(stderr, "[pass] F%llu ", (unsigned long long)atomic_load(&g_cur_frame)); fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); funlockfile(stderr); } } while (0)
static void blit_note(void) { if (g_enc) PD("E %llu copy / buffer update ends the render pass", g_stat_pass); }
__attribute__((weak)) void dm_guest_frame_tick(void) {} // hle_os.c provides the strong definition (DM_DETCLOCK deterministic guest clock); a no-op when graphics unit tests do not link the host // diag.c provides the strong definition (DM_TICK_HOLD=E:SHOT unfreeze); a no-op when graphics unit tests do not link the host
__attribute__((weak)) void dm_cheats_present(void) {} // hle_cheats.c provides the strong definition (the Atmosphère cheat pass per presented frame); a no-op when graphics unit tests do not link the host
__attribute__((weak)) int dm_detclock_enabled(void) { return 0; } // Same as above: the host's hle_os.c provides the strong definition; when graphics unit tests do not link the host, the deterministic clock is treated as off
__attribute__((weak)) uint64_t guest_ns(void) { return 0; } // Same as above: read only when the deterministic clock is on; never reached in graphics unit tests
static uint64_t att_bytes(id<MTLTexture> t, NSUInteger level) {
Expand Down