2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
27#include <gimbal/strings/gimbal_string_buffer.h>
28#include <gimbal/utils/gimbal_byte_array.h>
31
32
33
34#define EVMU_VMS_SIZE 128
35#define EVMU_VMS_VMU_DESCRIPTION_SIZE 16
36#define EVMU_VMS_DC_DESCRIPTION_SIZE 32
37#define EVMU_VMS_CREATOR_APP_SIZE 16
38#define EVMU_VMS_RESERVED_SIZE 20
42
43
44
45#define EVMU_VMS_ICON_PALETTE_BLUE_POS 0
46#define EVMU_VMS_ICON_PALETTE_BLUE_MASK 0x000f
47#define EVMU_VMS_ICON_PALETTE_GREEN_POS 4
48#define EVMU_VMS_ICON_PALETTE_GREEN_MASK 0x00f0
49#define EVMU_VMS_ICON_PALETTE_RED_POS 8
50#define EVMU_VMS_ICON_PALETTE_RED_MASK 0x0f00
51#define EVMU_VMS_ICON_PALETTE_ALPHA_POS 12
52#define EVMU_VMS_ICON_PALETTE_ALPHA_MASK 0xf000
56
57
58
59#define EVMU_VMS_ICON_COUNT_MAX 3
60#define EVMU_VMS_ICON_PALETTE_SIZE 16
61#define EVMU_VMS_ICON_BITMAP_WIDTH 32
62#define EVMU_VMS_ICON_BITMAP_HEIGHT 32
63#define EVMU_VMS_ICON_BITMAP_SIZE 512
67
68
69
70#define EVMU_VMS_EYECATCH_BITMAP_WIDTH 72
71#define EVMU_VMS_EYECATCH_BITMAP_HEIGHT 56
72#define EVMU_VMS_EYECATCH_PALETTE_SIZE_COLOR_256 512
73#define EVMU_VMS_EYECATCH_PALETTE_SIZE_COLOR_16 32
74#define EVMU_VMS_EYECATCH_BITMAP_SIZE_COLOR_16BIT 8064
75#define EVMU_VMS_EYECATCH_BITMAP_SIZE_COLOR_256 4032
76#define EVMU_VMS_EYECATCH_BITMAP_SIZE_COLOR_16 2016
79#define GBL_SELF_TYPE EvmuVms
90} EVMU_VMS_EYECATCH_TYPE;
93
94
95
96
97
98
99
100
101
102
103
104
105
106
121
122
123
124
139 GblStringBuffer* pBuffer) GBL_NOEXCEPT;
142 GblStringBuffer* pBuffer) GBL_NOEXCEPT;
145 GblStringBuffer* pBuffer) GBL_NOEXCEPT;
153
154
155
156
166
167
168
169
178 GblStringBuffer* pBuffer) GBL_NOEXCEPT;
#define EVMU_EXPORT
Define used for adding attributes to export public symbols.
#define EVMU_VMS_RESERVED_SIZE
#define EVMU_VMS_ICON_PALETTE_SIZE
Number of entries within a VMS icon palette.
#define EVMU_VMS_VMU_DESCRIPTION_SIZE
Size of the EvmuVms::vmuDesc field.
EVMU_VMS_EYECATCH_TYPE
Types of different eyecatch formats.
@ EVMU_VMS_EYECATCH_COUNT
Number of Formats.
@ EVMU_VMS_EYECATCH_PALETTE_16
16-Entry Palleted
@ EVMU_VMS_EYECATCH_16BIT
16-bit Color
@ EVMU_VMS_EYECATCH_PALETTE_256
256-Entry Palleted
@ EVMU_VMS_EYECATCH_NONE
None.
#define EVMU_VMS_DC_DESCRIPTION_SIZE
Size of the EvmuVms::dcDesc field.
#define EVMU_VMS_CREATOR_APP_SIZE
Size of the EvmuVms::creatorApp field.
Structure of the .VMS file header.
const char * EvmuVms_creatorApp(const EvmuVms *pSelf, GblStringBuffer *pBuffer)
Copies EvmuVms::creatorApp to the given buffer.
uint16_t animSpeed
Number of frames to wait before advancing icon animation.
char dcDesc[32]
File description in DC BIOS.
const char * EvmuVms_eyecatchTypeStr(const EvmuVms *pSelf)
Returns a string representation of the EvmuVms::eyecatchType.
uint16_t crc
CRC for whole file.
EVMU_FILE_TYPE EvmuVms_guessFileType(const EvmuVms *pSelf)
Attempts to autodetect the type of file represented by the VMS, usually for when no VMI is present.
GblByteArray * EvmuVms_createEyecatchArgb4444(const EvmuVms *pSelf)
Creates a GblByteArray containing an ARG444 encoded bitmap for the eyecatch.
uint32_t dataBytes
Size of actual file data, without header, icons, and eyecatch (ignored for GAME files)
uint16_t iconCount
Number of icons in animation.
uint16_t palette[16]
Palette color entries.
const void * EvmuVms_icon(const EvmuVms *pSelf, size_t index)
Returns a pointer to the raw icon image data for the given index.
size_t EvmuVms_setVmuDescription(EvmuVms *pSelf, const char *pStr)
Sets the EvmuVms::vmuDesc field to the given string, returning the number of bytes copied.
const void * EvmuVms_eyecatch(const EvmuVms *pSelf)
Returns a pointer to the raw eyecatch image data.
char reserved[20]
Reserved/unknown.
GblRingList * EvmuVms_createIconsArgb4444(const EvmuVms *pSelf)
Creates a GblRingList of GblByteArray instances containing ARGB444-encoded bitmaps for each icon.
size_t EvmuVms_totalBytes(const EvmuVms *pSelf)
Retruns the total calculated size of the VMS file, including header, icons, and eyecatch.
uint16_t eyecatchType
Type of eyecatch graphic.
char creatorApp[16]
App used to create VMS file.
const char * EvmuVms_findVmiPath(const char *pPath, GblStringBuffer *pBuffer)
Tries to find a valid path for the VMI file corresponding to the given VMS file, returning the path o...
size_t EvmuVms_setDcDescription(EvmuVms *pSelf, const char *pStr)
Sets the EvmuVms::dcDesc field to the given string, returning the number of bytes copied.
void EvmuVms_log(const EvmuVms *pSelf)
Logs the properties of the VMS file to the libGimbal log system.
size_t EvmuVms_setCreatorApp(EvmuVms *pSelf, const char *pStr)
Sets the EvmuVms::creatorApp field to the given string, returning the number of bytes copied.
uint16_t EvmuVms_computeCrc(const EvmuVms *pSelf)
Computes the expected CRC for the entire VMS file.
size_t EvmuVms_headerBytes(const EvmuVms *pSelf)
Returns the number of bytes of the VMS header, including graphics.
const char * EvmuVms_dcDescription(const EvmuVms *pSelf, GblStringBuffer *pBuffer)
Copies EvmuVms::dcDesc to the given buffer.
GblBool EvmuVms_isValid(const EvmuVms *pSelf)
Determine whether the given VMS header appears sane based on expected field values.
char vmuDesc[16]
File description in VMU BIOS.
const char * EvmuVms_vmuDescription(const EvmuVms *pSelf, GblStringBuffer *pBuffer)
Copies EvmuVms::vmuDesc to the given buffer.