|
#define | REG_BG12NBA (*(vuint8 *)0x210B) |
| BG Character Data Area Designation (W) 15-12 BG4 Tile Base Address (in 4K-word steps) 11-8 BG3 Tile Base Address (in 4K-word steps) 7-4 BG2 Tile Base Address (in 4K-word steps) 3-0 BG1 Tile Base Address (in 4K-word steps) More...
|
|
#define | REG_BG1HOFS (*(vuint8 *)0x210D) |
| BG1 Horizontal Scroll (X) (W) and M7HOFS.
|
|
#define | REG_BG1VOFS (*(vuint8 *)0x210E) |
| BG1 Vertical Scroll (Y) (W) and M7VOFS.
|
|
#define | REG_BG2HOFS (*(vuint8 *)0x210F) |
| BG2 Horizontal Scroll (X) (W)
|
|
#define | REG_BG2VOFS (*(vuint8 *)0x2110) |
| BG2 Vertical Scroll (Y) (W)
|
|
#define | REG_BG3HOFS (*(vuint8 *)0x2111) |
| BG3 Horizontal Scroll (X) (W)
|
|
#define | REG_BG3VOFS (*(vuint8 *)0x2112) |
| BG3 Vertical Scroll (Y) (W)
|
|
#define | REG_BG4HOFS (*(vuint8 *)0x2113) |
| BG4 Horizontal Scroll (X) (W)
|
|
#define | REG_BG4VOFS (*(vuint8 *)0x2114) |
| BG4 Vertical Scroll (Y) (W)
|
|
#define | REG_BGMODE (*(vuint8 *)0x2105) |
| BG Mode and BG Character Size (W) 7 BG4 Tile Size (0=8x8, 1=16x16) ;(BgMode0..4: variable 8x8 or 16x16) 6 BG3 Tile Size (0=8x8, 1=16x16) ; (BgMode5: 8x8 acts as 16x8) 5 BG2 Tile Size (0=8x8, 1=16x16) ; (BgMode6: fixed 16x8?) 4 BG1 Tile Size (0=8x8, 1=16x16) ;/(BgMode7: fixed 8x8) 3 BG3 Priority in Mode 1 (0=Normal, 1=High) 2-0 BG Screen Mode (0..7 = see below) More...
|
|
#define | REG_BGxHOFS 0x210D |
| BGx Horizontal Scroll (X) (W) and M7HOFS.
|
|
#define | REG_BGxVOFS 0x210E |
| BGx Vertical Scroll (Y) (W) and M7VOFS.
|
|
#define | REG_MOSAIC (*(vuint8 *)0x2106) |
| Mosaic Size and Mosaic Enable (W) Allows to divide the BG layer into NxN pixel blocks, in each block, the hardware picks the upper-left pixel of each block, and fills the whole block by the color - thus effectively reducing the screen resolution. More...
|
|
#define | REG_TMW (*(vuint8 *)0x212E) |
| Window Area Main Screen Disable (W) 212Eh - TMW - Window Area Main Screen Disable (W) 212Fh - TSW - Window Area Sub Screen Disable (W) 7-5 Not used 4 OBJ (0=Enable, 1=Disable) ;"Disable" forcefully disables the layer 3 BG4 (0=Enable, 1=Disable) ; within the window area (otherwise it is 2 BG3 (0=Enable, 1=Disable) ; enabled or disabled as selected in the 1 BG2 (0=Enable, 1=Disable) ; master enable bits in port 212Ch/212Dh) 0 BG1 (0=Enable, 1=Disable) ;/. More...
|
|
#define | REG_TS (*(vuint8 *)0x212D) |
| TM - Main Screen Designation (W) TS - Sub Screen Designation (W) More...
|
|
#define | REG_W12SEL (*(vuint8 *)0x2123) |
| Window BG1/BG2 Mask Settings (W) 2123h - W12SEL - Window BG1/BG2 Mask Settings (W) 2124h - W34SEL - Window BG3/BG4 Mask Settings (W) 2125h - WOBJSEL - Window OBJ/MATH Mask Settings (W) Bit 2123h 2124h 2125h 7-6 BG2 BG4 MATH Window-2 Area (0..1=Disable, 1=Inside, 2=Outside) 5-4 BG2 BG4 MATH Window-1 Area (0..1=Disable, 1=Inside, 2=Outside) 3-2 BG1 BG3 OBJ Window-2 Area (0..1=Disable, 1=Inside, 2=Outside) 1-0 BG1 BG3 OBJ Window-1 Area (0..1=Disable, 1=Inside, 2=Outside)
|
|
#define | REG_WBGLOG (*(vuint8 *)0x212A) |
| Window 1/2 Mask Logic (W) 212Ah/212Bh - WBGLOG/WOBJLOG - Window 1/2 Mask Logic (W) Bit 212Ah 212Bh 7-6 BG4 - Window 1/2 Mask Logic (0=OR, 1=AND, 2=XOR, 3=XNOR) 5-4 BG3 - Window 1/2 Mask Logic (0=OR, 1=AND, 2=XOR, 3=XNOR) 3-2 BG2 MATH Window 1/2 Mask Logic (0=OR, 1=AND, 2=XOR, 3=XNOR) 1-0 BG1 OBJ Window 1/2 Mask Logic (0=OR, 1=AND, 2=XOR, 3=XNOR) Allows to merge the Window 1 and 2 areas into a single "final" window area (which is then used by TMW, TSW, and CGWSEL). The OR/AND/XOR/XNOR logic is applied ONLY if BOTH window 1 and 2 are enabled (in WxxSEL registers). If only one window is enabled, then that window is used as is as "final" area. If both are disabled, then the "final" area will be empty. Note: "XNOR" means "1 XOR area1 XOR area2" (ie. the inverse of the normal XOR result).
|
|
#define | REG_WH0 (*(vuint8 *)0x2126) |
| Window 1 Left Position (X1) (W) 2126h - WH0 - Window 1 Left Position (X1) (W) 2127h - WH1 - Window 1 Right Position (X2) (W) 2128h - WH2 - Window 2 Left Position (X1) (W) 2129h - WH3 - Window 2 Right Position (X2) (W) 7-0 Window Position (00h..0FFh; 0=leftmost, 255=rightmost) More...
|
|
#define | SC_BASE_SHIFT 2 |
| The shift to apply to map base when storing it in a tile map location register.
|
|
#define | SC_TILE_BASE(base) ((base) << SC_BASE_SHIFT) |
| Macro to set the tile map address in tile map location.
|
|
|
void | bgInitMapSet (u8 bgNumber, u8 *mapSource, u16 mapSize, u8 sizeMode, u16 address) |
| Initializes a Map Set and loads it into SNES VRAM. More...
|
|
void | bgInitMapTileSet7 (u8 *tileSource, u8 *mapSource, u8 *tilePalette, u16 tileSize, u16 address) |
| Initializes a Tile & Map Set and Loads the Tile & Map GFX into VRAM for Mode 7. More...
|
|
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. More...
|
|
void | bgInitTileSetData (u8 bgNumber, u8 *tileSource, u16 tileSize, u16 address) |
| Add some Tile Set and Loads the Tile GFX into VRAM. More...
|
|
void | bgInitTileSetLz (u8 bgNumber, u8 *tileSource, u8 *tilePalette, u8 paletteEntry, u16 paletteSize, u16 colorMode, u16 address) |
| Initializes a Tile Set and Loads the Tile GFX compressed with LZ algo into VRAM. More...
|
|
void | bgSetDisable (u8 bgNumber) |
| Disable a BG in the actual SNES mode. More...
|
|
void | bgSetDisableSub (u8 bgNumber) |
| Disable a BG from sub screen (translucent) in the actual SNES mode. More...
|
|
void | bgSetEnable (u8 bgNumber) |
| Enable a BG in the actual SNES mode. More...
|
|
void | bgSetEnableSub (u8 bgNumber) |
| Enable a BG from sub screen (translucent) in the actual SNES mode. More...
|
|
void | bgSetGfxPtr (u8 bgNumber, u16 address) |
| Definition of each background address. More...
|
|
void | bgSetMapPtr (u8 bgNumber, u16 address, u8 mapSize) |
| Change Background Map address. More...
|
|
void | bgSetScroll (u8 bgNumber, u16 x, u16 y) |
| Sets the scroll hardware to the specified location. More...
|
|
void | bgSetWindowsRegions (u8 bgNumber, u8 winNumber, u8 xLeft, u8 xRight) |
| Define a region on screen where map / sprite can be disable. More...
|
|
snes background defines and functionality.
#define REG_BGMODE (*(vuint8 *)0x2105) |
BG Mode and BG Character Size (W) 7 BG4 Tile Size (0=8x8, 1=16x16) ;(BgMode0..4: variable 8x8 or 16x16) 6 BG3 Tile Size (0=8x8, 1=16x16) ; (BgMode5: 8x8 acts as 16x8) 5 BG2 Tile Size (0=8x8, 1=16x16) ; (BgMode6: fixed 16x8?) 4 BG1 Tile Size (0=8x8, 1=16x16) ;/(BgMode7: fixed 8x8) 3 BG3 Priority in Mode 1 (0=Normal, 1=High) 2-0 BG Screen Mode (0..7 = see below)
The BG Screen Modes are:
Mode BG1 BG2 BG3 BG4 0 4-color 4-color 4-color 4-color ;Normal 1 16-color 16-color 4-color - ;Normal 2 16-color 16-color (o.p.t) - ;Offset-per-tile 3 256-color 16-color - - ;Normal 4 256-color 4-color (o.p.t) - ;Offset-per-tile 5 16-color 4-color - - ;512-pix-hires 6 16-color - (o.p.t) - ;512-pix plus Offs-p-t 7 256-color EXTBG - - ;Rotation/Scaling
Mode 7 supports rotation/scaling and extbg (but doesn't support hv-flip). Mode 5/6 don't support screen addition/subtraction. CG Direct Select is support on BG1 of Mode 3/4, and on BG1/BG2? of Mode 7.
#define REG_MOSAIC (*(vuint8 *)0x2106) |
Mosaic Size and Mosaic Enable (W) Allows to divide the BG layer into NxN pixel blocks, in each block, the hardware picks the upper-left pixel of each block, and fills the whole block by the color - thus effectively reducing the screen resolution.
7-4 Mosaic Size (0=Smallest/1x1, 0Fh=Largest/16x16) 3 BG4 Mosaic Enable (0=Off, 1=On) 2 BG3 Mosaic Enable (0=Off, 1=On) 1 BG2 Mosaic Enable (0=Off, 1=On) 0 BG1 Mosaic Enable (0=Off, 1=On)
Horizontally, the first block is always located on the left edge of the TV screen. Vertically, the first block is located on the top of the TV screen. When changing the mosaic size mid-frame, the hardware does first finish current block (using the old vertical size) before applying the new vertical size. Technically, vertical mosaic is implemented as so: subtract the vertical index (within the current block) from the vertical scroll register (BGnVOFS).