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
127
void
windowInit
(
void
);
128
143
void
windowSetPos
(
u8
window,
u8
left,
u8
right);
144
158
void
windowEnable
(
u8
window,
u8
layers);
159
166
void
windowDisable
(
u8
window,
u8
layers);
167
173
void
windowDisableAll
(
void
);
174
187
void
windowSetInvert
(
u8
window,
u8
layers,
u8
invert);
188
197
void
windowSetLogic
(
u8
layer
,
u8
logic);
198
206
void
windowSetMainMask
(
u8
layers);
207
215
void
windowSetSubMask
(
u8
layers);
216
217
/*============================================================================
218
* Window Effect Helpers
219
*============================================================================*/
220
229
void
windowCentered
(
u8
window,
u8
width);
230
239
void
windowSplit
(
u8
splitX);
240
241
#endif
/* OPENSNES_WINDOW_H */
u8
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition
types.h:47
layer
static FAR u8 layer[(20 *8) *16]
Definition
main.c:84
types.h
OpenSNES Standard Types.
windowCentered
void windowCentered(u8 window, u8 width)
Create a centered rectangular window.
windowSetPos
void windowSetPos(u8 window, u8 left, u8 right)
Set window boundaries.
windowSetMainMask
void windowSetMainMask(u8 layers)
Set main screen window masking.
windowSetSubMask
void windowSetSubMask(u8 layers)
Set sub screen window masking.
windowInit
void windowInit(void)
Initialize window system.
windowSplit
void windowSplit(u8 splitX)
Create a vertical split at the specified X position.
windowSetLogic
void windowSetLogic(u8 layer, u8 logic)
Set logic operation for combining windows.
windowDisable
void windowDisable(u8 window, u8 layers)
Disable window for specified layers.
windowDisableAll
void windowDisableAll(void)
Disable all windows.
windowSetInvert
void windowSetInvert(u8 window, u8 layers, u8 invert)
Set window inversion for layers.
windowEnable
void windowEnable(u8 window, u8 layers)
Enable window for specified layers.
lib
include
snes
window.h
Generated by
1.16.1