31#ifndef SNES_DMA_INCLUDE
32#define SNES_DMA_INCLUDE
41#define HDMA_CHANNEL0 (1 << 0)
42#define HDMA_CHANNEL1 (1 << 1)
43#define HDMA_CHANNEL2 (1 << 2)
44#define HDMA_CHANNEL3 (1 << 3)
45#define HDMA_CHANNEL4 (1 << 4)
46#define HDMA_CHANNEL5 (1 << 5)
47#define HDMA_CHANNEL6 (1 << 6)
48#define HDMA_CHANNEL7 (1 << 7)
49#define HDMA_CHANNELALL (HDMA_CHANNEL0 | HDMA_CHANNEL1 | HDMA_CHANNEL2 | HDMA_CHANNEL3 | HDMA_CHANNEL4 | HDMA_CHANNEL5 | HDMA_CHANNEL6 | HDMA_CHANNEL7)
52#define MSWIN_BG1 (1 << 0)
53#define MSWIN_BG2 (1 << 1)
54#define MSWIN_BG3 (1 << 2)
55#define MSWIN_BG4 (1 << 3)
57#define MSWIN1_BG1MSKOUT (1 << 0)
58#define MSWIN1_BG1MSKENABLE (2 << 0)
59#define MSWIN2_BG1MSKOUT (1 << 2)
60#define MSWIN2_BG1MSKENABLE (2 << 2)
61#define MSWIN1_BG2MSKOUT (1 << 4)
62#define MSWIN1_BG2MSKENABLE (2 << 4)
63#define MSWIN2_BG2MSKOUT (1 << 4)
64#define MSWIN2_BG2MSKENABLE (2 << 4)
65#define MSWIN1_BG3MSKOUT (1 << 0)
66#define MSWIN1_BG3MSKENABLE (2 << 0)
67#define MSWIN2_BG3MSKOUT (1 << 2)
68#define MSWIN2_BG3MSKENABLE (2 << 2)
69#define MSWIN1_BG4MSKOUT (1 << 4)
70#define MSWIN1_BG4MSKENABLE (2 << 4)
71#define MSWIN2_BG4MSKOUT (1 << 4)
72#define MSWIN2_BG4MSKENABLE (2 << 4)
77typedef struct dmaMemory
105#define REG_MDMAEN (*(vuint8 *)0x420B)
112#define REG_HDMAEN (*(vuint8 *)0x420C)
140#define REG_DMAP0 (*(vuint8 *)0x4300)
141#define REG_DMAP1 (*(vuint8 *)0x4310)
142#define REG_DMAP2 (*(vuint8 *)0x4320)
143#define REG_DMAP3 (*(vuint8 *)0x4330)
144#define REG_DMAP4 (*(vuint8 *)0x4340)
145#define REG_DMAP5 (*(vuint8 *)0x4350)
146#define REG_DMAP6 (*(vuint8 *)0x4360)
147#define REG_DMAP7 (*(vuint8 *)0x4370)
161#define REG_BBAD0 (*(vuint8 *)0x4301)
162#define REG_BBAD1 (*(vuint8 *)0x4311)
163#define REG_BBAD2 (*(vuint8 *)0x4321)
164#define REG_BBAD3 (*(vuint8 *)0x4331)
165#define REG_BBAD4 (*(vuint8 *)0x4341)
166#define REG_BBAD5 (*(vuint8 *)0x4351)
167#define REG_BBAD6 (*(vuint8 *)0x4361)
168#define REG_BBAD7 (*(vuint8 *)0x4371)
199#define REG_A1T0LH (*(vuint16 *)0x4302)
200#define REG_A1T1LH (*(vuint16 *)0x4312)
201#define REG_A1T2LH (*(vuint16 *)0x4322)
202#define REG_A1T3LH (*(vuint16 *)0x4332)
203#define REG_A1T4LH (*(vuint16 *)0x4342)
204#define REG_A1T5LH (*(vuint16 *)0x4352)
205#define REG_A1T6LH (*(vuint16 *)0x4362)
206#define REG_A1T7LH (*(vuint16 *)0x4372)
208#define REG_A1B0 (*(vuint8 *)0x4304)
209#define REG_A1B1 (*(vuint8 *)0x4314)
210#define REG_A1B2 (*(vuint8 *)0x4324)
211#define REG_A1B3 (*(vuint8 *)0x4334)
212#define REG_A1B4 (*(vuint8 *)0x4344)
213#define REG_A1B5 (*(vuint8 *)0x4354)
214#define REG_A1B6 (*(vuint8 *)0x4364)
215#define REG_A1B7 (*(vuint8 *)0x4374)
237#define REG_DAS0LH (*(vuint16 *)0x4305)
238#define REG_DAS1LH (*(vuint16 *)0x4315)
239#define REG_DAS2LH (*(vuint16 *)0x4325)
240#define REG_DAS3LH (*(vuint16 *)0x4335)
241#define REG_DAS4LH (*(vuint16 *)0x4345)
242#define REG_DAS5LH (*(vuint16 *)0x4355)
243#define REG_DAS6LH (*(vuint16 *)0x4365)
244#define REG_DAS7LH (*(vuint16 *)0x4375)
307void dmaCopyVram7(u8 *source, u16 address, u16 size, u8 vrammodeinc, u16 dmacontrol);
371void setModeHdmaWindow(u8 bgrnd, u8 bgrndmask,u8* hdmatableL,u8* hdmatableR);
snes background defines and functionality.
void setModeHdmaShading(unsigned char mode)
Do a shading effect on screen. Use HDMA Channels 0 to 2.
void dmaFillVram(u8 *source, u16 address, u16 size)
fill the source data to destination using channel 0 of DMA available channels in half words
void dmaCopySpr16Vram(u8 *source, u16 address)
copy sprite 16pix size data from source to destination using channel 0 of DMA available channels in h...
void setModeHdmaWindowReset(u8 channels)
Reset or Set HDMA channels and remove WINDOW effect.
void setModeHdmaShadeUpDown(void)
Do a brightness gradient from up/down to center of the screen. Use HDMA Channels 3.
void dmaClearVram(void)
clear all vram data with #0
void dmaCopyOAram(u8 *source, u16 address, u16 size)
copies Sprites from source to destination using channel 0 of DMA available channels in half words
void setModeHdmaColor(u8 *hdmatable)
Do a color gradient effect on screen (with color 0). Use HDMA Channels 6.
void setModeHdmaReset(u8 channels)
Reset or Set HDMA channels.
void setParallaxScrolling(u8 bgrnd)
Do a parallax scrolling effect on screen. Use HDMA Channels 3.
void setModeHdmaWaves(u8 bgrnd)
Do a waves effect on screen (init function). Use HDMA Channels 6.
void dmaCopySpr32Vram(u8 *source, u16 address)
copy sprite 32pix size data from source to destination using channel 0 of DMA available channels in h...
void dmaCopyVram7(u8 *source, u16 address, u16 size, u8 vrammodeinc, u16 dmacontrol)
copies data from source to destination using channel 0 of DMA available channels in half words with V...
void setModeHdmaGradient(u8 maxLevels)
Do a brightness gradient on screen. Use HDMA Channels 3.
u8 HDMATable16[224+1]
HDMA table accessible to change values.
void setModeHdmaWavesMove(void)
Animate the waves effect. Must be called during each frame. setModeHdmaWaves must have been done to ...
void dmaCopyVram(u8 *source, u16 address, u16 size)
copy data from source to destination using channel 0 of DMA available channels in half words
void dmaCopyCGram(u8 *source, u16 address, u16 size)
copy data from source to destination using channel 0 of DMA available channels in half words
Custom types used by libsnes.
snes sprites functionality.
contains the basic definitions for controlling the video hardware.