SDK crate

psx-vram

Texture pages, palettes and uploads

On this page

Use psx-vram to describe where textures and palettes live in the PS1's video memory. The important units are VRAM halfwords, texels at a chosen bit depth, and the packed handles placed in GPU commands.

How the crate is organized

This crate has one source module. Color555 represents packed colour, VramRect describes bounded VRAM rectangles, TexturePage carries texture-page coordinates and TextureDepth the bit depth, and Clut carries palette coordinates. Upload helpers move caller-owned data into those regions.

Integration notes

A texture page has alignment requirements; a CLUT has its own. Typed constructors validate these rules, but the caller still owns the overall layout: texture data, fonts, palettes and framebuffers must not overlap. Indexed pixels are packed into halfwords before upload. Read each upload function's length and alignment contract; the byte-oriented helpers preserve an unaligned fallback.

Follow textured sprites, then read the complete hello-tex program.

API, dependencies and source structure

SDK revision f2fec1c301f1. Structure, dependencies and features below come from this revision.

The PS1 reference includes all Cargo features. The manifest below shows which features are enabled by default.

Dependencies

  • psx-hw (shared repository crate): all targets
  • psx-io: all targets

Cargo features

This crate declares no Cargo features.

Read the complete manifest and feature comments.

Source layout

The list includes internal implementation and test files. Public modules, types, functions and their signatures are indexed in the API reference above.

2 source and manifest files