pico9918-core 1.3.0
TMS9918A / F18A video display processor emulation in C99
Loading...
Searching...
No Matches
liveDesktopOps.h
Go to the documentation of this file.
1/**
2 * \file
3 * \brief pico9918-core - host hooks that make a desktop capture the same artifact as a board's
4 *
5 * Copyright (c) 2026 Troy Schrapel
6 *
7 * This code is licensed under the MIT license
8 *
9 * https://github.com/visrealm/pico9918-core
10 *
11 * The device's harness takes a row through PICO9918_LINE_CAPTURE, which the platform
12 * header leaves as a no-op unless a host defines it - and says so: those hooks are
13 * "test/live"'s, defaulted after this header is included so a host gets first say.
14 *
15 * Defining it here is the whole reason a desktop capture is the SAME artifact as a
16 * device one. The row arrives from the identical call site inside
17 * pico9918_frame_scanline, from the identical pointer, rather than from a second
18 * render loop that would have to be kept in step with it by hand.
19 *
20 * PICO9918_LINE_NOTE_TIME is deliberately left as the no-op. Microseconds off a PC
21 * mean nothing here, and a hook that reported them would invite a comparison
22 * against the device's numbers.
23 */
24
25#pragma once
26
27#include <stdint.h>
28
29void liveDesktopCaptureRow(uint16_t y, uint16_t height, uint16_t width, const uint8_t* indices);
30
31#define PICO9918_LINE_CAPTURE(y, height, width, indices) \
32 liveDesktopCaptureRow((y), (height), (width), (indices))
33
34/* the interlock in platform.h: a real ops header announces itself, so a
35 decoy of the same name beside the platform header cannot silently win */
36#define PICO9918_HOST_OPS_SUPPLIED 1