KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Typedefs | Functions
vmu_pkg.h File Reference

VMU Packaging functionality. More...

#include <sys/cdefs.h>
#include <arch/types.h>

Go to the source code of this file.

Data Structures

struct  vmu_pkg
 VMU Package type. More...
struct  vmu_hdr
 Final VMU package type. More...


#define VMUPKG_EC_NONE   0
 No eyecatch.
#define VMUPKG_EC_16BIT   1
 16-bit ARGB4444
#define VMUPKG_EC_256COL   2
 256-color palette
#define VMUPKG_EC_16COL   3
 16-color palette


typedef struct vmu_pkg vmu_pkg_t
 VMU Package type.
typedef struct vmu_hdr vmu_hdr_t
 Final VMU package type.


int vmu_pkg_build (vmu_pkg_t *src, uint8 **dst, int *dst_size)
 Convert a vmu_pkg_t into an array of uint8s.
int vmu_pkg_parse (uint8 *data, vmu_pkg_t *pkg)
 Parse an array of uint8s into a vmu_pkg_t.

Detailed Description

VMU Packaging functionality.

This file provides declarations for managing the headers that must be attached to VMU files for the BIOS to pay attention to them. This does not handle reading/writing files directly.

Dan Potter
See also:

Typedef Documentation

typedef struct vmu_hdr vmu_hdr_t

Final VMU package type.

This structure will be written into the file itself, not vmu_pkg_t.

typedef struct vmu_pkg vmu_pkg_t

VMU Package type.

Anyone wanting to package a VMU file should create one of these somewhere; eventually it will be turned into a flat file that you can save using fs_vmu.

Function Documentation

int vmu_pkg_build ( vmu_pkg_t src,
uint8 **  dst,
int *  dst_size 

Convert a vmu_pkg_t into an array of uint8s.

This function converts a vmu_pkg_t structure into an array of uint8's which may be written to a VMU file via fs_vmu, or whatever.

srcThe vmu_pkg_t to convert.
dstThe buffer (will be allocated for you).
dst_sizeThe size of the output.
0 on success, <0 on failure.
int vmu_pkg_parse ( uint8 data,
vmu_pkg_t pkg 

Parse an array of uint8s into a vmu_pkg_t.

This function does the opposite of vmu_pkg_build and is used to parse VMU files read in.

dataThe buffer to parse.
pkgWhere to store the vmu_pkg_t.
Return values:
-1On invalid CRC in the data.
0On success.