Skip to content

Lab 5: VBE Framebuffer And XPM

Generated folder: labs/graphics/

Lab 5 turns the screen into memory. You select a VBE-style graphics mode, map a linear framebuffer, compute pixel addresses, draw rectangles, parse small XPM sprites, and present frames.

Device Model

ConceptMeaning
mode infowidth, height, pitch, bits per pixel
linear framebuffercontiguous pixel memory
pitchbytes between row starts
color formathow color bytes are stored
presentshow the prepared frame

Pitch is not always width * bytes_per_pixel.

Plan

  1. Query mode information.
  2. Set the requested graphics mode.
  3. Map the framebuffer once.
  4. Compute pixel offsets with pitch.
  5. Clip rectangles and sprites.

Next: implementation tasks.

Course/docs licensed CC BY 4.0. Code licensed MIT.