PVSnesLib  4.3.0
Documentation to code in C or ASM for the Nintendo SNES
graphics/Effects/TransparentWindow/src/main.c
/*---------------------------------------------------------------------------------
Transparent window effect in mode 1
-- digifox
---------------------------------------------------------------------------------*/
#include <snes.h>
#include "window.h"
// ROM
extern char backgroundPic, backgroundPic_end;
extern char backgroundPalette, backgroundPalette_end;
extern char backgroundMap, backgroundMap_end;
#define BG0 0
#define BG1 1
#define BG2 2
#define BG3 3
#define PAL0 0
#define PAL1 1
#define PAL2 2
#define PAL3 3
#define PAL4 4
#define PAL5 5
#define PAL6 6
#define PAL7 7
int main(void) {
&backgroundPic,
&backgroundPalette,
PAL0,
(&backgroundPic_end - &backgroundPic),
16*2,
BG_16COLORS,
0x4000);
&backgroundMap,
(&backgroundMap_end - &backgroundMap),
SC_32x32,
0x0000);
createTransparentWindow(40, 96, 176, 112,
BG1,
0b11100000,
0b00001100,
0b10000000);
setMode(BG_MODE1, 0);
while (1) {
}
return 0;
}
void bgSetDisable(u8 bgNumber)
Disable a BG in the actual SNES mode.
void bgSetEnable(u8 bgNumber)
Enable a BG in the actual SNES mode.
void bgInitMapSet(u8 bgNumber, u8 *mapSource, u16 mapSize, u8 sizeMode, u16 address)
Initializes a Map Set and loads it into SNES VRAM.
void bgInitTileSet(u8 bgNumber, u8 *tileSource, u8 *tilePalette, u8 paletteEntry, u16 tileSize, u16 paletteSize, u16 colorMode, u16 address)
Initializes a Tile Set and Loads the Tile GFX into VRAM.
void consoleInit(void)
Initialize console.
void WaitForVBlank(void)
Wait for vblank interrupt
the master include file for snes applications.
void setScreenOn(void)
Put screen On.
void setMode(u8 mode, u8 size)
Set the SNES hardware to operate in new display mode.