SaturnRingLibrary 0.9.2
SGL wrapper
Loading...
Searching...
No Matches
SRL::VDP2::RBG0 Class Reference

Detailed Description

RBG0 interface.

Rotating Background Scroll 0: -Available color depths: Paletted16, Paletted256, RBG555 -Available image modes: Tilemap, Bitmap -Available features: Scrolling, Scaling, Rotation, -Reading a coefficient table from VRAM allows per-line/per-pixel scaling to simulate a 3D plane. -simulate up to 2 planes using separate rotation parameters and tilemaps

Note
Tilemap Loading for Secondary rotation parameter through RBG0 interface does not support configuration for display on RBG1. While it is possible to control RBG1 rotation mode and perspective through the functions for the secondary parameter, the required VRAM reservations for its display would need to be configured manually.

#include <srl_vdp2.hpp>

Inheritance diagram for SRL::VDP2::RBG0:
SRL::VDP2::BmpScreen< RBG0, scnRBG0, RBG0ON > SRL::VDP2::ScrollScreen< RBG0, Id, On >

Public Member Functions

void * SetCellAddress (void *address, int size, VDP2::RotationParameter param=VDP2::RotationParameter::Primary)
 Manually Sets VRAM area for Priamary or Secondary RBG0 Cell Data (For Advanced Use Cases).

Static Public Member Functions

static void Bmp2VRAM (void *bmpData, void *bmpAdr, SRL::Bitmap::BitmapInfo info)
 Copies Bmp data to VRAM.
static void Cell2VRAM (uint8_t *cellData, void *cellAdr, uint32_t size)
 Copies Cell data to VRAM (adapted from SGL samples).
static void * GetCellAddress ()
 Gets the starting address in VRAM of Cell data allocated to this scroll.
static uint32_t GetCellOffset (SRL::Tilemap::TilemapInfo &tile, void *cellAddress)
 Compute the offset that must be added to map data When Corresponding Cell Data does not start on a VRAM bank boundary.
static void * GetMapAddress ()
 Gets the starting address in VRAM of Map data allocated to this scroll.
static void * GetPageAddress (uint8_t index)
 returns the VRAM Address of the specified page number in a scroll's Page Table or nullptr if the requested page is outside of allocated Map Bounds
static uint32_t GetPalOffset (int8_t paletteID=-1)
 Gets the Pallet Bank That must be included in Map Data to Reference a Palette in CRAM.
static void * GetPlaneAddress (uint8_t index)
 Gets the VRAM Address of the specified plane in a scroll's Page Table (units of 1x1, 2x1, or 2x2 pages).
static void Init (SRL::Bitmap::BitmapInfo &info)
 Initializes the ScrollScreen's bitmap specifications.
static void Init (SRL::Tilemap::TilemapInfo &info)
 Initializes the ScrollScreen's tilemap specifications.
static void Init (SRL::Tilemap::TilemapInfo &infoA, SRL::Tilemap::TilemapInfo &infoB)
 Overload initializes Primary and Secondary rotation parameters to separate source tilemaps.
static void LoadBitmap (SRL::Bitmap::IBitmap *bmp, bool loadPalette=true)
 Loads a bitmap into VRAM and registers it for display on the ScrollScreen.
static void LoadTilemap (SRL::Tilemap::ITilemap &tilemap, bool loadPalette=true)
 Loads Tilemap data to VRAM using ITilemap Interface and configures the Scroll Screen to use it.
static void LoadTilemap (SRL::Tilemap::ITilemap &tilemap, VDP2::RotationMode mode, bool LoadPalette=true)
 Simultaneously Configures the desired rotation mode and loads primary tilemap.
static void LoadTilemap (SRL::Tilemap::ITilemap &tilemapA, SRL::Tilemap::ITilemap &tilemapB, VDP2::RotationMode modeA, VDP2::RotationMode modeB, bool LoadPalette=true)
 Load and configure both a Primary and Secondary Tilemap.
static void Map2VRAM (SRL::Tilemap::TilemapInfo &info, uint16_t *mapData, void *mapAdr, uint8_t paloff, uint32_t mapoff)
 Copies map data to VRAM and applies necessary offsets (adapted from SGL Samples).
static void RegisterAsciiScroll ()
 Registers the ScrollScreen to Display SRL's Debug Ascii Scroll.
static void ScrollDisable ()
 Removes the Scroll Screen from VDP2 cycle pattern register to disable display.
static void ScrollEnable ()
 Registers Scroll in VDP2 cycle pattern to enable display of this Scroll Screen.
static void * SetCellAddress (void *address, int size)
 Manually Sets VRAM area for Cell Data (Advanced Use Cases).
static void SetCurrentTransform (VDP2::RotationParameter param=VDP2::RotationParameter::Primary)
 Writes the current matrix transform to RBG0 rotation parameters to update its perspective.
static void * SetMapAddress (void *Address, int Size)
 Manually Sets VRAM area for Map Data (Advanced Use Cases).
static void SetMapLayout (uint8_t a, uint8_t b, uint8_t c, uint8_t d)
 Manually set the Plane layout of a Scroll Screen.
static void SetOpacity (Math::Fxp opacity=1.0)
 Set the opacity of a scroll screen.
static void SetOverDisplay (VDP2::RotationParameter param, VDP2::OverPattern mode, uint16_t tileIndex=0)
 Sets How screen regions outside the tilemap area are displayed by the rotation parameters.
static void SetPalette (CRAM::Palette palette)
 Manually sets the CRAM palette index for this scrollScreen(Advanced Use Cases).
static void SetParameterMode (SwitchMode mode)
 Sets the condition for switching between display of Primary and Secondary parameters/Tilemaps on screen.
static void SetPlanes (const uint8_t layout[4][4], VDP2::RotationParameter param=VDP2::RotationParameter::Primary)
 Sets the layout of Tilemaps comprised of multiple planes from a 4x4 grid of plane indices.
static void SetPlanes (void *a, void *b, void *c, void *d)
 Sets the plane of Tilemap Data to be displayed.
static void SetPriority (SRL::VDP2::Priority pr)
 Set the Display Priority of a Scroll Screen.
static void SetRotationMode (VDP2::RotationMode mode, bool vblank=true)
 Select what type of rotation to use for the rotating scroll.
static void SetRotationMode (VDP2::RotationMode modeA, VDP2::RotationMode modeB, bool vblank=true)
 Overload to select separate rotation modes for both the primary and secondary rotating planes.
static void TransparentDisable ()
 Disable transparent pixels for a scroll screen.
static void TransparentEnable ()
 Enable transparent pixels for a scroll screen.
static void UseColorOffset (VDP2::OffsetChannel mode)
 Sets Which Color Offset that a scroll Screen should use.

Static Public Attributes

static void * CellAddress
 VRAM Address to start of Cell data when displying Tilemap or Bitmap data when using bitmaps.
static void * CellAddressRB = (void*)(VDP2_VRAM_A0 - 1)
 VRAM Address of TilemapB cell data.
static int CellAllocSize
static int32_t CellAllocSizeB
 Size of Cell B allocation.
static Tilemap::TilemapInfo Info
 Tilemap config info for the ScrollScreen.
static void * KtableAddress = (void*)(VDP2_VRAM_A0 - 1)
 VRAM Address of RBG0 Coefficient table.
static void * KtableAddressB = (void*)(VDP2_VRAM_A0 - 1)
 VRAM Address of RBG0 Coefficient table B.
static void * MapAddress
 VRAM Address of ScrollScreen's Map data when displaying Tilemap.
static void * MapAddressRB = (void*)(VDP2_VRAM_A0 - 1)
 VRAM Address of TilemapB map data.
static int MapAllocSize
 Size of currently allocated VRAM for Map Data.
static uint32_t MapAllocSizeB
 Size of Map B allocation.
static constexpr int16_t ScreenID
 SGL identifier for the ScrollScreen.
static constexpr uint16_t ScreenON
 SGL flag for the ScrollScreen.
static CRAM::Palette TilePalette
 CRAM Pallet for the ScrollScreen.
static CRAM::Palette TilePaletteB = CRAM::Palette()