OldSchool Library 1.5.1
Loading...
Searching...
No Matches
drawing.h File Reference

Drawing and image handling functions in OSLib. More...

Data Structures

struct  OSL_ALPHA_PARAMS
 Structure containing data for a special alpha effect. More...
 
struct  OSL_PALETTE
 Structure representing a palette. More...
 
struct  OSL_IMAGE
 Structure representing an image loaded in memory. More...
 
struct  OSL_PRECISE_VERTEX
 Precise vertex with texture. More...
 
struct  OSL_FAST_VERTEX
 Fast vertex with texture. More...
 
struct  OSL_FAST_VERTEX_COLOR32
 Fast vertex with texture and 16-bit color. More...
 
struct  OSL_LINE_VERTEX
 Untextured vertex with 32-bit color. More...
 
struct  OSL_LINE_VERTEX_COLOR32
 Untextured vertex with 16-bit color. More...
 
struct  OSL_UVFLOAT_VERTEX
 Precise texture vertex. More...
 

Macros

#define bool   char
 Boolean type.
 
#define oslResetScreenClipping()   oslSetScreenClipping(0, 0, osl_curBuf->sizeX, osl_curBuf->sizeY)
 Resets the screen clipping region to the entire screen.
 
#define OSL_FX_DEFAULT   OSL_FX_RGBA
 Default effect that combines RGBA channels.
 
#define OSL_FX_OPAQUE   OSL_FX_NONE
 Opaque effect with no special processing.
 
#define OSL_FX_TINT   (OSL_FX_ALPHA | OSL_FX_COLOR)
 Tint effect that combines alpha blending and color.
 
#define RGB(r, v, b)   ((u32)(r) | ((u32)(v) << 8) | ((u32)(b) << 16) | ((u32)0xff << 24))
 Creates a 32-bit opaque color.
 
#define RGBA(r, v, b, a)   ((u32)(r) | ((u32)(v) << 8) | ((u32)(b) << 16) | ((u32)(a) << 24))
 Creates a 32-bit color with alpha (transparency).
 
#define RGB12(r, v, b)   ((((b) >> 4) << 8) | (((v) >> 4) << 4) | ((r) >> 4) | (0xf << 12))
 Creates a 12-bit opaque color.
 
#define RGBA12(r, v, b, a)   ((((a) >> 4) << 12) | (((b) >> 4) << 8) | (((v) >> 4) << 4) | ((r) >> 4))
 Creates a 12-bit color with alpha.
 
#define RGB15(r, v, b)   ((((b) >> 3) << 10) | (((v) >> 3) << 5) | ((r) >> 3) | (1 << 15))
 Creates a 15-bit opaque color.
 
#define RGBA15(r, v, b, a)   ((((a) >> 7) << 15) | (((b) >> 3) << 10) | (((v) >> 3) << 5) | ((r) >> 3))
 Creates a 15-bit color with alpha.
 
#define RGB16(r, v, b)   ((((b) >> 3) << 11) | (((v) >> 2) << 5) | ((r) >> 3))
 Creates a 16-bit color.
 
#define oslRgbaGet8888(data, r, g, b, a)   ((r) = ((data) & 0xff), (g) = (((data) >> 8) & 0xff), (b) = (((data) >> 16) & 0xff), (a) = (((data) >> 24) & 0xff))
 Extracts the R, G, B, A (Red, Green, Blue, Alpha) component values from a 32-bit color.
 
#define oslRgbaGet4444(data, r, g, b, a)   ((r) = ((data) & 0xf) << 4, (g) = (((data) >> 4) & 0xf) << 4, (b) = (((data) >> 8) & 0xf) << 4, (a) = (((data) >> 12) & 0xf) << 4)
 Extracts R, G, B, A values from a 4444 color.
 
#define oslRgbaGet5551(data, r, g, b, a)   ((r) = ((data) & 0x1f) << 3, (g) = (((data) >> 5) & 0x1f) << 3, (b) = (((data) >> 10) & 0x1f) << 3, (a) = (((data) >> 15) & 0x1) << 7)
 Extracts R, G, B, A values from a 5551 color.
 
#define oslRgbGet5650(data, r, g, b)   ((r) = ((data) & 0x1f) << 3, (g) = (((data) >> 5) & 0x3f) << 2, (b) = (((data) >> 11) & 0x1f) << 3)
 Extracts R, G, B values from a 5650 color.
 
#define oslRgbaGet4444f(data, r, g, b, a)   ((r) = ((data) & 0xf) << 4 | ((data) & 0xf), (g) = (((data) >> 4) & 0xf) << 4 | (((data) >> 4) & 0xf), (b) = (((data) >> 8) & 0xf) << 4 | (((data) >> 8) & 0xf), (a) = (((data) >> 12) & 0xf) << 4 | (((data) >> 12) & 0xf))
 Extracts R, G, B, A values from a 4444 color with finer precision.
 
#define oslRgbaGet5551f(data, r, g, b, a)   ((r) = ((data) & 0x1f) << 3 | ((data) & 0x1f) >> 2, (g) = (((data) >> 5) & 0x1f) << 3 | (((data) >> 5) & 0x1f) >> 2, (b) = (((data) >> 10) & 0x1f) << 3 | (((data) >> 10) & 0x1f) >> 2, (a) = (((data) >> 15) & 0x1) * 255)
 Extracts R, G, B, A values from a 5551 color with finer precision.
 
#define oslRgbGet5650f(data, r, g, b)   ((r) = ((data) & 0x1f) << 3 | ((data) & 0x1f) >> 2, (g) = (((data) >> 5) & 0x3f) << 2 | (((data) >> 5) & 0x3f) >> 4, (b) = (((data) >> 11) & 0x1f) << 3 | (((data) >> 10) & 0x1f) >> 2)
 Extracts R, G, B values from a 5650 color with finer precision.
 
#define OSL_PALETTEDATA16   unsigned short __attribute__((aligned(16)))
 Type definition for 16-bit palette data.
 
#define OSL_PALETTEDATA32   unsigned long __attribute__((aligned(16)))
 Type definition for 32-bit palette data.
 
#define oslAddVramPrefixPtr(adr)   ((void *)((int)(adr) | 0x04000000))
 Adds a VRAM prefix to an address.
 
#define oslRemoveVramPrefixPtr(adr)   ((void *)((int)(adr) & (~0x04000000)))
 Removes the VRAM prefix from an address.
 
#define oslDrawImageXY(img, px, py)   ({ (img)->x=(px), (img)->y=(py); oslDrawImage(img); })
 Draws an image at the specified position.
 
#define oslDrawImageSimpleXY(img, px, py)   ({ (img)->x=(px), (img)->y=(py); oslDrawImageSimple(img); })
 Draws an image at the specified position (backward compatibility).
 
#define oslSetImageTile(img, x0, y0, x1, y1)   ({ (img)->offsetX0=(float)x0, (img)->offsetY0=(float)y0, (img)->offsetX1=(float)x1, (img)->offsetY1=(float)y1; (img)->stretchX = oslAbs((int)((float)((img)->offsetX1) - (float)((img)->offsetX0))), (img)->stretchY = oslAbs((int)((float)((img)->offsetY1) - (float)((img)->offsetY0))); })
 Sets the source rectangle of the image to be displayed.
 
#define oslSetImageTileSize(img, x0, y0, x1, y1)   ({ (img)->offsetX0 = (float)(x0), (img)->offsetY0 = (float)(y0), (img)->offsetX1 = (float)(x0) + (float)(x1), (img)->offsetY1 = (float)(y0) + (float)(y1), (img)->stretchX = (int)(x1), (img)->stretchY = (int)(y1); })
 Sets the source rectangle of the image to be displayed using tile size.
 
#define oslResetImageTile(img)   ({ (img)->offsetX0=0, (img)->offsetY0=0, (img)->offsetX1=(img)->sizeX, (img)->offsetY1=(img)->sizeY; (img)->stretchX = (img)->sizeX, (img)->stretchY = (img)->sizeY; })
 Resets the image rectangle to its full (original) size.
 
#define oslMirrorImageH(img)   ({ float ___tmp; ___tmp = (img)->offsetX0; (img)->offsetX0 = (img)->offsetX1; (img)->offsetX1 = ___tmp; })
 Mirrors an image (or an image tile) horizontally.
 
#define oslMirrorImageV(img)   ({ float ___tmp; ___tmp = (img)->offsetY0; (img)->offsetY0 = (img)->offsetY1; (img)->offsetY1 = ___tmp; })
 Mirrors an image (or an image tile) vertically.
 
#define oslImageIsMirroredH(img)   ((img)->offsetX1 > (img)->offsetX0)
 Returns whether the image is mirrored horizontally.
 
#define oslImageIsMirroredV(img)   ((img)->offsetY1 > (img)->offsetY0)
 Returns whether the image is mirrored vertically.
 
#define oslImageRotMoveX(img, x)   ((((x) + (img)->centerX * (img)->stretchX) / (img)->sizeX))
 Calculates the x-coordinate for moving an image so that its top-left corner is at the specified position when no rotation is applied.
 
#define oslImageRotMoveY(img, y)   ((((y) + (img)->centerY * (img)->stretchY) / (img)->sizeY))
 Calculates the y-coordinate for moving an image so that its top-left corner is at the specified position when no rotation is applied.
 
#define oslSetImageRotCenter(img)   ((img)->centerX = (int)oslAbs((img)->offsetX1 - (img)->offsetX0) >> 1, (img)->centerY = (int)oslAbs((img)->offsetY1 - (img)->offsetY0) >> 1)
 Sets the rotation center of an image to its center.
 
#define oslImageSetRotCenter   oslSetImageRotCenter
 Alias for oslSetImageRotCenter.
 
#define oslCorrectImageHalfBorder(img)   ((img)->offsetX0 = (img)->offsetX0 + 0.5f, (img)->offsetY0 = (img)->offsetY0 + 0.5f, (img)->offsetX1 = (img)->offsetX1 - 0.5f, (img)->offsetY1 = (img)->offsetY1 - 0.5f, img->stretchX--, img->stretchY--)
 Crops 0.5 pixel from each corner of the image.
 
#define oslResetImageHalfBorder(img)   ((img)->offsetX0 = (img)->offsetX0 - 0.5f, (img)->offsetY0 = (img)->offsetY0 - 0.5f, (img)->offsetX1 = (img)->offsetX1 + 0.5f, (img)->offsetY1 = (img)->offsetY1 + 0.5f, img->stretchX++, img->stretchY++)
 Undoes the effect of oslCorrectImageHalfBorder.
 
#define oslGetImageWidth(img)   ((int)oslAbs((img)->offsetX1 - (img)->offsetX0))
 Returns the width of the image, considering the current frame or tile.
 
#define oslGetImageHeight(img)   ((int)oslAbs((img)->offsetY1 - (img)->offsetY0))
 Returns the height of the image, considering the current frame or tile.
 
#define oslGetImageSizeX   oslGetImageWidth
 Returns the width of the image, considering the current frame or tile.
 
#define oslGetImageSizeY   oslGetImageHeight
 Returns the height of the image, considering the current frame or tile.
 
#define oslGetImageLine(img, y)   ((char *)((img)->data) + (y) * (((img)->realSizeX * osl_pixelWidth[(img)->pixelFormat]) >> 3))
 
#define oslGetImagePixelAddr(img, x, y)   ((char *)((img)->data) + ((((y) * (img)->realSizeX + (x)) * osl_pixelWidth[(img)->pixelFormat]) >> 3))
 
#define oslGetImagePixelAdr   oslGetImagePixelAddr
 
#define oslGetDrawBuffer()   osl_curBuf
 
#define OSL_DEFAULT_BUFFER   (&osl_defaultBufferImage)
 
#define OSL_SECONDARY_BUFFER   (&osl_secondaryBufferImage)
 
#define OSL_SCREEN_WIDTH   (osl_curBuf->sizeX)
 
#define OSL_SCREEN_HEIGHT   (osl_curBuf->sizeY)
 
#define oslImageIsCopy(img)   (img->flags & OSL_IMAGE_COPY)
 
#define oslImageIsSwizzled(img)   (img->flags & OSL_IMAGE_SWIZZLED)
 
#define oslImageGetAutoStrip(img)   (img->flags & OSL_IMAGE_AUTOSTRIP)
 
#define oslEnableTexturing()   ({ if (!osl_textureEnabled) sceGuEnable(GU_TEXTURE_2D), osl_textureEnabled = 1; })
 
#define oslDisableTexturing()   ({ if (osl_textureEnabled) sceGuDisable(GU_TEXTURE_2D), osl_textureEnabled = 0; })
 
#define OSL_SLICE_SIZE   64
 

Typedefs

typedef unsigned long OSL_COLOR
 
typedef enum OSL_LOCATION_FLAGS OSL_LOCATION_FLAGS
 Flags indicating the memory location of an image and optional swizzling.
 

Enumerations

enum  {
  OSL_FX_NONE = 0 , OSL_FX_FLAT , OSL_FX_ALPHA , OSL_FX_ADD ,
  OSL_FX_SUB
}
 
enum  OSL_IMAGE_FLAGS { OSL_IMAGE_SWIZZLED = 1 , OSL_IMAGE_COPY = 2 , OSL_IMAGE_AUTOSTRIP = 4 }
 Constants for the flags member of OSL_IMAGE. More...
 
enum  OSL_LOCATION_FLAGS {
  OSL_IN_NONE = 0 , OSL_IN_VRAM = 1 , OSL_IN_RAM = 2 , OSL_LOCATION_MASK = 7 ,
  OSL_SWIZZLED = 8 , OSL_UNSWIZZLED = 16
}
 Flags indicating the memory location of an image and optional swizzling. More...
 
enum  OSL_PIXELFORMATS {
  OSL_PF_5650 = GU_PSM_5650 , OSL_PF_5551 = GU_PSM_5551 , OSL_PF_4444 = GU_PSM_4444 , OSL_PF_8888 = GU_PSM_8888 ,
  OSL_PF_4BIT = GU_PSM_T4 , OSL_PF_8BIT = GU_PSM_T8
}
 Pixel formats used for defining color modes in OSLib. More...
 
enum  OSL_WRITE_FLAGS { OSL_WRI_ALPHA = 1 }
 
enum  OSL_FX_ALPHAWRITE { OSL_FXAW_NONE , OSL_FXAW_SET }
 
enum  OSL_FX_ALPHATEST {
  OSL_FXAT_NEVER = GU_NEVER , OSL_FXAT_ALWAYS = GU_ALWAYS , OSL_FXAT_EQUAL = GU_EQUAL , OSL_FXAT_NOTEQUAL = GU_NOTEQUAL ,
  OSL_FXAT_LESS = GU_LESS , OSL_FXAT_LEQUAL = GU_LEQUAL , OSL_FXAT_GREATER = GU_GREATER , OSL_FXAT_GEQUAL = GU_GEQUAL
}
 
enum  OSL_TEXWRAP_MODES { OSL_TW_REPEAT = GU_REPEAT , OSL_TW_CLAMP = GU_CLAMP }
 

Functions

void oslInitGfx (int pixelFormat, int bDoubleBuffer)
 
void oslStartDrawing ()
 Initializes the drawing process with OSLib. Call this function before performing any drawing operations.
 
void oslEndDrawing ()
 
void oslSyncDrawing ()
 
void oslSwapBuffers ()
 
void oslEndGfx ()
 
void oslSetSysDisplayListSize (int newSize)
 
void oslClearScreen (int backColor)
 
void oslSetScreenClipping (int x0, int y0, int x1, int y1)
 
void oslSetDepthTest (int enabled)
 
void oslSetAlpha2 (u32 effect, u32 coeff1, u32 coeff2)
 Configures the current alpha effect parameters for subsequent drawing operations.
 
static void oslSetAlpha (u32 effect, u32 coeff1)
 A simplified version of oslSetAlpha2, where coeff2 is set to the maximum value.
 
static void oslGetAlphaEx (OSL_ALPHA_PARAMS *alpha)
 Stores the current alpha parameters into an OSL_ALPHA_PARAMS structure.
 
static void oslSetAlphaEx (OSL_ALPHA_PARAMS *alpha)
 Sets the current alpha parameters using an OSL_ALPHA_PARAMS structure.
 
void oslSetBilinearFilter (int enabled)
 
void oslSetDithering (int enabled)
 
void oslSetTransparentColor (OSL_COLOR color)
 Enables color keying, making a specific color transparent.
 
void oslDisableTransparentColor ()
 Disables color keying, preventing any color-based transparency.
 
void oslDrawLine (int x0, int y0, int x1, int y1, OSL_COLOR color)
 Draws a line from (x0, y0) to (x1, y1).
 
void oslDrawRect (int x0, int y0, int x1, int y1, OSL_COLOR color)
 Draws an empty rectangle from (x0, y0) to (x1, y1).
 
void oslDrawFillRect (int x0, int y0, int x1, int y1, OSL_COLOR color)
 Draws a filled rectangle from (x0, y0) to (x1, y1).
 
void oslDrawGradientRect (int x0, int y0, int x1, int y1, OSL_COLOR c1, OSL_COLOR c2, OSL_COLOR c3, OSL_COLOR c4)
 Draws a gradient rectangle from (x0, y0) to (x1, y1).
 
void oslSwizzleTexture (u8 *out, const u8 *in, unsigned int width, unsigned int height)
 Swizzles texture data.
 
void oslUnswizzleTexture (u8 *out, const u8 *in, unsigned int width, unsigned int height)
 Unswizzles texture data.
 
void oslDrawTile (int u, int v, int x, int y, int tX, int tY)
 Draws a tile from the currently selected texture at the specified position.
 
OSL_IMAGEoslCreateImage (int larg, int haut, short location, short pixelFormat)
 Creates an empty image in OSLib.
 
void oslDeleteImage (OSL_IMAGE *img)
 Deletes an image previously created or loaded.
 
OSL_IMAGEoslLoadImageFile (char *filename, int location, int pixelFormat)
 Loads an image from a file, allowing selection of its location and pixel format.
 
OSL_IMAGEoslLoadImageFilePNG (char *filename, int location, int pixelFormat)
 Loads an image from a PNG file.
 
OSL_IMAGEoslLoadImageFileJPG (char *filename, int location, int pixelFormat)
 Loads an image from a JPG file.
 
OSL_IMAGEoslLoadImageFileGIF (char *filename, int location, int pixelFormat)
 Loads an image from a GIF file.
 
static void oslSetImageAutoSwizzle (int enabled)
 Controls whether images should be automatically swizzled upon loading.
 
void * oslAllocImageData (OSL_IMAGE *img, int location)
 Allocates memory for image data based on the properties of the provided OSL_IMAGE structure.
 
void oslFreeImageData (OSL_IMAGE *img)
 Frees the memory allocated for image data.
 
int oslImageLocationIsSwizzled (int location)
 Checks if an image location is swizzled.
 
void oslDrawImage (OSL_IMAGE *img)
 Draws an image at its current position.
 
void oslDrawImageSimple (OSL_IMAGE *img)
 Draws an image at its current position (deprecated).
 
void oslDrawImageBig (OSL_IMAGE *img)
 Draws a very large image.
 
OSL_IMAGEoslCreateImageTile (OSL_IMAGE *img, int offsetX0, int offsetY0, int offsetX1, int offsetY1)
 
OSL_IMAGEoslCreateImageTileSize (OSL_IMAGE *img, int offsetX0, int offsetY0, int width, int height)
 
OSL_IMAGEoslConvertImageTo (OSL_IMAGE *imgOriginal, int newLocation, int newFormat)
 
OSL_IMAGEoslCreateImageCopy (OSL_IMAGE *src, int newLocation)
 
OSL_IMAGEoslCreateSwizzledImage (OSL_IMAGE *src, int newLocation)
 
void oslCopyImageTo (OSL_IMAGE *imgDst, OSL_IMAGE *imgSrc)
 
void oslSwizzleImage (OSL_IMAGE *img)
 
void oslUnswizzleImage (OSL_IMAGE *img)
 
void oslSwizzleImageTo (OSL_IMAGE *imgDst, OSL_IMAGE *imgSrc)
 
bool oslMoveImageTo (OSL_IMAGE *img, int newLocation)
 
void oslClearImage (OSL_IMAGE *img, int color)
 
int oslWriteImageFile (OSL_IMAGE *img, const char *filename, int flags)
 
int oslWriteImageFilePNG (OSL_IMAGE *img, const char *filename, int flags)
 
void oslResetImageProperties (OSL_IMAGE *img)
 
void oslScaleImage (OSL_IMAGE *dstImg, OSL_IMAGE *srcImg, int newX, int newY, int newWidth, int newHeight)
 
OSL_IMAGEoslScaleImageCreate (OSL_IMAGE *img, short newLocation, int newWidth, int newHeight, short newPixelFormat)
 
static void oslSetImageFrameSize (OSL_IMAGE *img, u16 width, u16 height)
 
void oslSetImageFrame (OSL_IMAGE *img, int frame)
 
OSL_PALETTEoslCreatePaletteEx (int size, int location, short pixelFormat)
 
static OSL_PALETTEoslCreatePalette (int size, short pixelFormat)
 
OSL_PALETTEoslCreatePaletteFrom (void *data, int size, short pixelFormat)
 
void oslDeletePalette (OSL_PALETTE *p)
 
int oslGetPaletteColor (OSL_PALETTE *p, int index)
 
void oslUncachePalette (OSL_PALETTE *pal)
 
static void oslUncacheImageData (OSL_IMAGE *img)
 
void oslUncacheImage (OSL_IMAGE *img)
 
int oslGetImagePixel (OSL_IMAGE *img, unsigned int x, unsigned int y)
 
void oslSetImagePixel (OSL_IMAGE *img, unsigned int x, unsigned int y, int pixelValue)
 
void * oslGetSwizzledPixelAddr (OSL_IMAGE *img, unsigned int x, unsigned int y)
 
int oslConvertColor (int pfDst, int pfSrc, int color)
 Converts a color from one pixel format to another.
 
int oslConvertColorEx (OSL_PALETTE *p, int pfDst, int pfSrc, int color)
 Converts a color between different pixel formats, optionally using a palette for indexed formats.
 
void oslLockImage (OSL_IMAGE *img)
 
void oslUnlockImage (OSL_IMAGE *img)
 
void oslSetDrawBuffer (OSL_IMAGE *img)
 
void oslSetAlphaWrite (int action, int value1, int value2)
 Controls writing to the alpha channel of the draw buffer.
 
void oslSetAlphaTest (int condition, int value)
 
void oslDisableAlphaTest ()
 
static void oslImageIsCopySet (OSL_IMAGE *img, bool enabled)
 
static void oslImageIsSwizzledSet (OSL_IMAGE *img, bool enabled)
 
static void oslImageSetAutoStrip (OSL_IMAGE *img, bool enabled)
 
int oslVerifyStripBlit (OSL_IMAGE *img)
 
static void oslSetTextureWrap (int u, int v)
 
void oslSetTexture (OSL_IMAGE *img)
 Defines the current texture for low-level image drawing.
 
void oslSetTexturePart (OSL_IMAGE *img, int x, int y)
 Defines the current texture and its starting coordinates for rendering.
 
OSL_COLOR oslBlendColors (OSL_COLOR c1, OSL_COLOR c2)
 Blends two colors together.
 
static OSL_COLOR oslBlendColor (OSL_COLOR c)
 Applies alpha parameters to a color, tinting it.
 

Variables

int osl_currentAlphaEffect
 Current global alpha effect.
 
OSL_COLOR osl_currentAlphaCoeff
 Current first coefficient for the global alpha effect.
 
OSL_COLOR osl_currentAlphaCoeff2
 Current second coefficient for the global alpha effect.
 
int osl_bilinearFilterEnabled
 Indicates whether bilinear filtering is currently enabled.
 
int osl_ditheringEnabled
 Indicates whether dithering is currently enabled.
 
int osl_colorKeyEnabled
 Indicates whether color keying is currently enabled.
 
int osl_autoSwizzleImages
 Controls automatic swizzling of images.
 
int osl_alignBuffer
 Controls advanced parameters for image creation.
 
const int osl_pixelWidth []
 
const u8 osl_paletteSizes []
 
int osl_alphaTestEnabled
 
int osl_currentTexWrapU
 
int osl_currentTexWrapV
 
unsigned int * osl_list
 System display list for low-level drawing operations.
 
int osl_textureEnabled
 Indicates if texturing is currently enabled.
 
void * osl_curTexture
 Current texture being used for drawing.
 
void * osl_curPalette
 Current palette being used.
 
void * osl_curDrawBuf
 Current draw buffer being used.
 
void * osl_curDispBuf
 Current display buffer being used.
 
OSL_IMAGE osl_defaultBufferImage
 Default and secondary buffers.
 
int osl_isDrawingStarted
 Flag indicating if drawing has started.
 

Detailed Description

Drawing and image handling functions in OSLib.

This file provides the 2D drawing API: screen and drawbuffer management, colors, shapes, low level GU vertex types, and the complete image system (loading, placement, manipulation, palettes, pixel access and sprites).