KallistiOS git master
Independent SDK for the Sega Dreamcast
|
API for Managing VMU File Headers More...
Topics | |
Eyecatch Types | |
Values for various VMU eyecatch formats | |
Files | |
file | vmu_pkg.h |
VMU Packaging functionality. | |
Data Structures | |
struct | vmu_pkg_t |
VMU Package type. More... | |
struct | vmu_hdr_t |
Final VMU package type. More... | |
Functions | |
int | vmu_pkg_build (vmu_pkg_t *src, uint8_t **dst, int *dst_size) |
Convert a vmu_pkg_t into an array of uint8s. | |
int | vmu_pkg_parse (uint8_t *data, vmu_pkg_t *pkg) |
Parse an array of uint8s into a vmu_pkg_t. | |
int | vmu_pkg_load_icon (vmu_pkg_t *pkg, const char *icon_fn) |
Load a .ico file to use as a VMU file's icon. | |
API for Managing VMU File Headers
This API is provided as a utility for easy management of VMS file headers. These headers must be present on every file saved within the VMU's filesystem for both the Dreamcast and VMU's BIOS to detect them properly.
int vmu_pkg_build | ( | vmu_pkg_t * | src, |
uint8_t ** | 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.
src | The vmu_pkg_t to convert. |
dst | The buffer (will be allocated for you). |
dst_size | The size of the output. |
int vmu_pkg_load_icon | ( | vmu_pkg_t * | pkg, |
const char * | icon_fn ) |
Load a .ico file to use as a VMU file's icon.
Icon files must be in the ICO file format, be 32x32 in size, contain a bitmap (no PNG or compressed BMP), and use paletted 4bpp. They can contain more than one frame, and they can use up to 16 colors if transparency is not used, or 15 colors otherwise. Finally, all frames must use the same palette.
This function assumes that the vmu_pkg_t has been properly initialized; in particular, the .icon_cnt must be set, and the .icon_data must point to a valid buffer (of 512 bytes per frame).
If the .ico file contains more frames than requested, only the first ones are loaded. If it contains less frames than requested, the .icon_cnt field will be updated to the new frame count.
pkg | A pointer a pre-initialized vmu_pkg_t |
icon_fn | The file path to the .ico file |
-1 | If the .ico file cannot be loaded. |
0 | On success. |
int vmu_pkg_parse | ( | uint8_t * | data, |
vmu_pkg_t * | pkg ) |