Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Submit feedback
  • Sign in
joeylib
joeylib
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Labels
    • Milestones
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Public Skunkworks
  • joeylibjoeylib
  • Wiki
  • JoeyLib Formats

JoeyLib Formats

Last edited by Scott Duensing Oct 17, 2019
Page history

STA - Static Images

Static images are created either by JoeyLib applications or the imgconvert tool. Static images are 320x200 pixels with a 16 color 4-bit RGB palette. The on-disk format is the same as the in-memory format. STA files begin with a three byte signature ("STA") and a single byte version number followed by palette and then image data.

typedef struct {
	 byte b : 4;
	 byte g : 4;
	 byte r : 4;
	 byte reserved : 4;
} jlColorT;

typedef struct {
	byte l : 4;
	byte r : 4;
} jlPixelPairT;

typedef struct {
	char         id[3];
	byte         version;
	jlColorT     palette[16];    // 4 bits reserved, 4 bits red, 4 green, 4 blue
	jlPixelPairT pixels[32000];  // 320x200, 4 bits per pixel
} jlStaT;

VEC - Vector Images

Vector images begin life as a text file specifying the operations needed to draw them. The text file is processed by the vecdraw utility into an efficient byte stream that can be used by JoeyLib. The supported operations in the text format are:

C <color>                 - Specify Drawing Color
E                         - Erase the Display
D <x1> <y1> ...           - Draw a Pixel
L <x1> <y1> ... <xn> <yn> - Draw a Line
B <x1> <y1> <x2> <y2> ... - Draw a Hollow Box
S <x1> <y1> <x2> <y2> ... - Draw a Solid Box
F <x1> <y1> ...           - Flood Fill over Single Color
T <x1> <y1> <color> ...   - Flood Fill To Color
P <i> <r> <g> <b> ...     - Set Palette Color
R                         - Reset Palette to Default

One command can be entered per line and lines can be up to 1024 characters long.

Commands followed by "..." can have additional sets of parameters added to repeat the operation without the need to specify another command line.

After processing, the byte stream is stored as a three byte header ("VEC") followed by a single byte version number, an unsigned integer length of the data to follow, and then the data itself.

typedef struct {
	char          id[3];
	byte          version;
	unsigned int  length;
	byte         *data;
} jlVecT;
Clone repository
  • Installation
  • JoeyLib API
  • JoeyLib Concepts
  • JoeyLib Data Types
  • JoeyLib Definitions
  • JoeyLib Display Functions
  • JoeyLib Drawing Functions
  • JoeyLib Enumerations
  • JoeyLib Formats
  • JoeyLib Gamepad Functions
  • JoeyLib Keyboard Functions
  • JoeyLib Memory Functions
  • JoeyLib Palette Functions
  • JoeyLib Sound Functions
  • JoeyLib Static Image Functions
View All Pages