Loading...
Searching...
No Matches
hdma.h
Go to the documentation of this file.
1
98#ifndef OPENSNES_HDMA_H
99#define OPENSNES_HDMA_H
100
101#include <snes/types.h>
102
103/*============================================================================
104 * HDMA Channel Definitions
105 *============================================================================*/
106
108#define HDMA_CHANNEL_0 0
110#define HDMA_CHANNEL_1 1
112#define HDMA_CHANNEL_2 2
114#define HDMA_CHANNEL_3 3
116#define HDMA_CHANNEL_4 4
118#define HDMA_CHANNEL_5 5
120#define HDMA_CHANNEL_6 6
122#define HDMA_CHANNEL_7 7
123
124/*============================================================================
125 * HDMA Transfer Modes
126 *============================================================================*/
127
134#define HDMA_MODE_1REG 0x00
135
142#define HDMA_MODE_2REG 0x01
143
150#define HDMA_MODE_1REG_2X 0x02
151
158#define HDMA_MODE_2REG_2X 0x03
159
166#define HDMA_MODE_4REG 0x04
167
174#define HDMA_INDIRECT 0x40
175
176/*============================================================================
177 * Common Destination Registers
178 *============================================================================*/
179
181#define HDMA_DEST_CGADD 0x21
182
184#define HDMA_DEST_CGDATA 0x22
185
187#define HDMA_DEST_BG1HOFS 0x0D
188
190#define HDMA_DEST_BG1VOFS 0x0E
191
193#define HDMA_DEST_BG2HOFS 0x0F
194
196#define HDMA_DEST_BG2VOFS 0x10
197
199#define HDMA_DEST_BG3HOFS 0x11
200
202#define HDMA_DEST_BG3VOFS 0x12
203
205#define HDMA_DEST_WH0 0x26
206
208#define HDMA_DEST_WH1 0x27
209
211#define HDMA_DEST_COLDATA 0x32
212
214#define HDMA_DEST_INIDISP 0x00
215
217#define HDMA_DEST_M7A 0x1B
218
219/*============================================================================
220 * Core HDMA Functions
221 *============================================================================*/
222
239void hdmaSetup(u8 channel, u8 mode, u8 destReg, const void *table);
240
254void hdmaSetupBank(u8 channel, u8 mode, u8 destReg, const void *table, u8 bank);
255
268void hdmaEnable(u8 channelMask);
269
277void hdmaDisable(u8 channelMask);
278
284void hdmaDisableAll(void);
285
292
302void hdmaSetTable(u8 channel, const void *table);
303
304/*============================================================================
305 * HDMA Effect Helpers
306 *============================================================================*/
307
320void hdmaParallax(u8 channel, u8 bg, const void *scrollTable);
321
334void hdmaGradient(u8 channel, const void *colorTable);
335
348void hdmaWindowShape(u8 channel, const void *windowTable);
349
350/*============================================================================
351 * HDMA Wave Effect Functions
352 *============================================================================*/
353
360void hdmaWaveInit(void);
361
386void hdmaWaveH(u8 channel, u8 bg, u8 amplitude, u8 frequency);
387
396void hdmaWaveUpdate(void);
397
403void hdmaWaveStop(void);
404
411
412/*============================================================================
413 * HDMA Brightness Gradient
414 *============================================================================*/
415
433void hdmaBrightnessGradient(u8 channel, u8 topBrightness, u8 bottomBrightness);
434
441
442/*============================================================================
443 * HDMA Color Gradient
444 *============================================================================*/
445
467void hdmaColorGradient(u8 channel, u8 colorIndex, u16 topColor, u16 bottomColor);
468
475
476/*============================================================================
477 * HDMA Iris Wipe (Circular Window)
478 *============================================================================*/
479
509void hdmaIrisWipe(u8 channel, u8 layers, u8 centerX, u8 centerY, u8 radius);
510
519void hdmaIrisWipeStop(u8 channel);
520
521/*============================================================================
522 * HDMA Water Ripple
523 *============================================================================*/
524
551void hdmaWaterRipple(u8 channel, u8 bg, u8 amplitude, u8 speed);
552
553#endif /* OPENSNES_HDMA_H */
unsigned short u16
16-bit unsigned integer (0 to 65535)
Definition types.h:52
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:46
void hdmaWaveStop(void)
Stop wave effect and disable HDMA channel.
void hdmaWaveInit(void)
Initialize HDMA wave effect system.
void hdmaWaveH(u8 channel, u8 bg, u8 amplitude, u8 frequency)
Set up horizontal wave effect (water reflection)
void hdmaEnable(u8 channelMask)
Enable HDMA channel(s)
void hdmaGradient(u8 channel, const void *colorTable)
Set up a fixed color gradient effect.
void hdmaWaveUpdate(void)
Update wave animation.
void hdmaBrightnessGradient(u8 channel, u8 topBrightness, u8 bottomBrightness)
Create a vertical brightness gradient.
void hdmaIrisWipeStop(u8 channel)
Stop iris wipe effect and restore window registers.
void hdmaWaveSetSpeed(u8 speed)
Set wave speed.
void hdmaSetTable(u8 channel, const void *table)
Update HDMA table pointer (for dynamic effects)
u8 hdmaGetEnabled(void)
Get currently enabled HDMA channels.
void hdmaColorGradient(u8 channel, u8 colorIndex, u16 topColor, u16 bottomColor)
Create a per-scanline CGRAM color gradient.
void hdmaWindowShape(u8 channel, const void *windowTable)
Set up window position HDMA for shape effects.
void hdmaSetupBank(u8 channel, u8 mode, u8 destReg, const void *table, u8 bank)
Set up an HDMA channel with explicit source bank byte.
void hdmaDisable(u8 channelMask)
Disable HDMA channel(s)
void hdmaColorGradientStop(u8 channel)
Stop color gradient effect.
void hdmaSetup(u8 channel, u8 mode, u8 destReg, const void *table)
Set up an HDMA channel.
void hdmaIrisWipe(u8 channel, u8 layers, u8 centerX, u8 centerY, u8 radius)
Create a circular window mask (iris/spotlight effect)
void hdmaDisableAll(void)
Disable all HDMA channels.
void hdmaBrightnessGradientStop(u8 channel)
Stop brightness gradient and restore full brightness.
void hdmaParallax(u8 channel, u8 bg, const void *scrollTable)
Set up a background parallax scroll effect.
void hdmaWaterRipple(u8 channel, u8 bg, u8 amplitude, u8 speed)
Create a water ripple distortion effect.
OpenSNES Standard Types.