Loading...
Searching...
No Matches
video.h
Go to the documentation of this file.
1
14
#ifndef OPENSNES_VIDEO_H
15
#define OPENSNES_VIDEO_H
16
17
#include <
snes/types.h
>
18
19
/*============================================================================
20
* Background Modes
21
*============================================================================*/
22
27
#define BG_MODE0 0
28
#define BG_MODE1 1
29
#define BG_MODE2 2
30
#define BG_MODE3 3
31
#define BG_MODE4 4
32
#define BG_MODE5 5
33
#define BG_MODE6 6
34
#define BG_MODE7 7
41
#define BG3_MODE1_PRIORITY_HIGH 0x08
62
void
setMode
(
u8
mode,
u8
flags);
63
64
/*============================================================================
65
* Palette
66
*============================================================================*/
67
76
#define RGB(r, g, b) (((b) << 10) | ((g) << 5) | (r))
77
86
#define RGB24(r, g, b) RGB((r) >> 3, (g) >> 3, (b) >> 3)
87
88
/*============================================================================
89
* Layer Enable Constants (for REG_TM / REG_TS / setMainScreen / setSubScreen)
90
*============================================================================*/
91
96
#define LAYER_BG1 0x01
97
#define LAYER_BG2 0x02
98
#define LAYER_BG3 0x04
99
#define LAYER_BG4 0x08
100
#define LAYER_OBJ 0x10
103
/*============================================================================
104
* Screen Layer Control
105
*============================================================================*/
106
121
#define setMainScreen(layers) (REG_TM = (u8)(layers))
122
135
#define setSubScreen(layers) (REG_TS = (u8)(layers))
136
137
/*============================================================================
138
* Palette Helpers
139
*============================================================================*/
140
156
#define setColor(index, color) do { \
157
REG_CGADD = (u8)(index); \
158
REG_CGDATA = (u8)((color) & 0xFF); \
159
REG_CGDATA = (u8)(((color) >> 8) & 0xFF); \
160
} while(0)
161
162
#endif
/* OPENSNES_VIDEO_H */
u8
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition
types.h:46
types.h
OpenSNES Standard Types.
setMode
void setMode(u8 mode, u8 flags)
Set background mode.
lib
include
snes
video.h
Generated by
1.9.8