SaturnRingLibrary 0.6
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::VDP1 Class Reference

Detailed Description

VDP1 control functions.

#include <srl_vdp1.hpp>

Classes

struct  Texture
 VDP1 texture. More...
 
struct  TextureMetadata
 Metadata for texture. More...
 

Static Public Member Functions

static size_t GetAvailableMemory ()
 Get free available memory left for textures on VDP1.
 
static Types::HighColorGetGouraudTable ()
 Get the start location of the gouraud table.
 
static uint16_t GetTextureCount ()
 Get the number of currently loaded textures.
 
static void ResetTextureHeap ()
 Fully reset texture heap.
 
static void ResetTextureHeap (const uint16_t index)
 Reset texture heap to specified index.
 
static int32_t TryLoadTexture (const uint16_t width, const uint16_t height, const CRAM::TextureColorMode colorMode, const uint16_t palette, void *data)
 Try to load a texture.
 
static int32_t TryLoadTexture (SRL::Bitmap::IBitmap *bitmap, int16_t(*paletteHandler)(SRL::Bitmap::BitmapInfo *)=nullptr)
 Try to load a texture.
 

Static Public Attributes

static const uint32_t FrontBuffer = 0x25C80000
 VDP1 front buffer address.
 
static TextureMetadata Metadata [SRL_MAX_TEXTURES] = { TextureMetadata() }
 Texture metadata.
 
static Texture Textures [SRL_MAX_TEXTURES] = { Texture() }
 Texture heap.
 
static const uint32_t UserAreaEnd = 0x25C7FEF8
 End location of the user area.
 

Member Function Documentation

◆ GetAvailableMemory()

static size_t SRL::VDP1::GetAvailableMemory ( )
inlinestatic

Get free available memory left for textures on VDP1.

Returns
Number of bytes left

◆ GetGouraudTable()

static Types::HighColor * SRL::VDP1::GetGouraudTable ( )
inlinestatic

Get the start location of the gouraud table.

Returns
HighColor* Start location of the gouraud table

◆ GetTextureCount()

static uint16_t SRL::VDP1::GetTextureCount ( )
inlinestatic

Get the number of currently loaded textures.

Returns
Number of currently loaded textures

◆ ResetTextureHeap()

static void SRL::VDP1::ResetTextureHeap ( const uint16_t index)
inlinestatic

Reset texture heap to specified index.

Parameters
indexIndex to reset to (texture on this index will be overwritten on next TryLoadTexture(); call)

◆ TryLoadTexture() [1/2]

static int32_t SRL::VDP1::TryLoadTexture ( const uint16_t width,
const uint16_t height,
const CRAM::TextureColorMode colorMode,
const uint16_t palette,
void * data )
inlinestatic

Try to load a texture.

Parameters
widthTexture width
heightTexture height
colorModeColor mode
palettePalette start identifier in color RAM (not used in RGB555 mode)
dataTexture data
Returns
Index of the loaded texture

◆ TryLoadTexture() [2/2]

static int32_t SRL::VDP1::TryLoadTexture ( SRL::Bitmap::IBitmap * bitmap,
int16_t(*)(SRL::Bitmap::BitmapInfo *) paletteHandler = nullptr )
inlinestatic

Try to load a texture.

Parameters
bitmapTexture to load
paletteHandlerPalette loader handling (expects index of the palette in CRAM as result, only needed for loading paletted image)
Returns
Index of the loaded texture