OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1
41
42#ifndef OPENSNES_WINDOW_H
43#define OPENSNES_WINDOW_H
44
45#include <snes/types.h>
46
47/*============================================================================
48 * Window Identifiers
49 *============================================================================*/
50
52#define WINDOW_1 0
53
55#define WINDOW_2 1
56
57/*============================================================================
58 * Layer Masks (for windowEnable/windowDisable)
59 *============================================================================*/
60
61/* The layers are named by LAYER_BG1..LAYER_BG4 and LAYER_OBJ (video.h), the
62 * same bits everywhere a call takes a set of layers. WINDOW_MATH is the one
63 * bit only the window has. */
64
66#define WINDOW_MATH BIT(5)
67
69#define WINDOW_ALL_BG 0x0F
70
72#define WINDOW_ALL 0x1F
73
74/* WINDOW_BG1..WINDOW_BG4 and WINDOW_OBJ were removed on 2026-10-05: the layer
75 * bits are LAYER_BG1..LAYER_OBJ (video.h), the same values (docs/UPGRADING.md). */
76
77/*============================================================================
78 * Window Logic Operations
79 *============================================================================*/
80
82#define WINDOW_LOGIC_OR 0
83
85#define WINDOW_LOGIC_AND 1
86
88#define WINDOW_LOGIC_XOR 2
89
91#define WINDOW_LOGIC_XNOR 3
92
93/*============================================================================
94 * Window Masking Modes
95 *============================================================================*/
96
97/* These two are used by nothing in the library — the polarity is set with
98 * windowSetInvert(). Their comments had it backwards (fullsnes, "2123h
99 * W12SEL": an enabled, non-inverted window masks the area INSIDE it), so the
100 * values are kept and the meaning is now stated as the hardware has it. */
101
103#define WINDOW_MASK_INSIDE 0
104
106#define WINDOW_MASK_OUTSIDE 1
107
108/*============================================================================
109 * Main Screen / Sub Screen Window Selection
110 *============================================================================*/
111
113#define WINDOW_MAIN_SCREEN 0
114
116#define WINDOW_SUB_SCREEN 1
117
118/*============================================================================
119 * Core Window Functions
120 *============================================================================*/
121
127void windowInit(void);
128
143void windowSetPos(u8 window, u8 left, u8 right);
144
158void windowEnable(u8 window, u8 layers);
159
166void windowDisable(u8 window, u8 layers);
167
174
187void windowSetInvert(u8 window, u8 layers, u8 invert);
188
198
207
215void windowSetSubMask(u8 layers);
216
217/*============================================================================
218 * Window Effect Helpers
219 *============================================================================*/
220
229void windowCentered(u8 window, u8 width);
230
239void windowSplit(u8 splitX);
240
241#endif /* OPENSNES_WINDOW_H */
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:47
static FAR u8 layer[(20 *8) *16]
Definition main.c:84
OpenSNES Standard Types.
void windowCentered(u8 window, u8 width)
Create a centered rectangular window.
void windowSetPos(u8 window, u8 left, u8 right)
Set window boundaries.
void windowSetMainMask(u8 layers)
Set main screen window masking.
void windowSetSubMask(u8 layers)
Set sub screen window masking.
void windowInit(void)
Initialize window system.
void windowSplit(u8 splitX)
Create a vertical split at the specified X position.
void windowSetLogic(u8 layer, u8 logic)
Set logic operation for combining windows.
void windowDisable(u8 window, u8 layers)
Disable window for specified layers.
void windowDisableAll(void)
Disable all windows.
void windowSetInvert(u8 window, u8 layers, u8 invert)
Set window inversion for layers.
void windowEnable(u8 window, u8 layers)
Enable window for specified layers.