KallistiOS  ##version##
 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...
 

Macros

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

Typedefs

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

Functions

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

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.

Author
Dan Potter
See also
dc/fs_vmu.h

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.

Parameters
srcThe vmu_pkg_t to convert.
dstThe buffer (will be allocated for you).
dst_sizeThe size of the output.
Returns
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.

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