blob: 1be12903977a80a438166122b9e6423876301ccf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ifndef GBC_RENDER_H
#define GBC_RENDER_H
#include "gb.h"
void term_init(void);
void term_restore(void);
void render_frame(GB *gb);
void render_force_full(void); // force a complete repaint next frame
void render_set_hud(int frameskip, bool turbo); // update HUD readout
// Switch terminal output to sixel graphics (scale = integer pixel zoom, >=1).
// Pass on=false to use the default Unicode half-block renderer.
void render_set_sixel(bool on, int scale);
// Draw a Game Boy body/frame around the LCD (sixel output only); buttons on the
// drawn shell light up while pressed. No effect unless sixel mode is enabled.
void render_set_chrome(bool on);
// Recolor the LCD output to a 4-shade palette by luminance, for the classic
// monochrome-LCD look. Names: "dmg"/"green" (DMG-01 pea green), "pocket"/"gray"
// (grayscale). NULL or unknown name = passthrough (true colors). Applies to
// every render path (half-block, sixel, chrome).
void render_set_palette(const char *name);
// Frame capture for screenshots / video recording: produces the same pixels the
// user sees, applying the LCD recolor palette and the Game Boy chrome when they
// are enabled. render_capture_size reports the resulting dimensions (they only
// change when chrome is toggled); render_capture_frame returns a pointer to an
// internal contiguous RGB888 buffer (w*h*3 bytes, caller must not free).
void render_capture_size(int *w, int *h);
const u8 *render_capture_frame(GB *gb, int *w, int *h);
// Poll keyboard + control FIFO, update gb->buttons. False if quit requested.
bool input_poll(GB *gb);
// Optional external control channel: a named pipe (FIFO) that accepts button
// commands (see README). Safe to call once at startup.
void input_open_fifo(const char *path);
void input_close_fifo(void);
// Process one line of button-command tokens (the FIFO/socket input vocabulary:
// a b start select up down left right; name:N; +name / -name; release). Shared
// by the FIFO and the richer socket control channel.
void input_handle_command(const char *line);
// Returns true once for each pending fast-forward (turbo) toggle keypress.
bool input_take_turbo(void);
// Net frameskip adjustment requested via '[' / ']' since last call.
int input_take_frameskip_delta(void);
#endif
|