2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
41#include <gimbal/strings/gimbal_string_buffer.h>
42#include <gimbal/utils/gimbal_date_time.h>
45
46
47
48#define EVMU_VMI_FILE_SIZE 108
49#define EVMU_VMI_DESCRIPTION_SIZE 32
50#define EVMU_VMI_COPYRIGHT_SIZE 32
51#define EVMU_VMI_VMS_RESOURCE_SIZE 8
52#define EVMU_VMI_VMS_NAME_SIZE 12
56
57
58
59#define EVMU_VMI_GAME_POS 1
60#define EVMU_VMI_GAME_MASK 0x2
61#define EVMU_VMI_PROTECTED_POS 0
62#define EVMU_VMI_PROTECTED_MASK 0x1
65#define EVMU_VMI_VERSION 0
67#define GBL_SELF_TYPE EvmuVmi
71GBL_FORWARD_DECLARE_STRUCT(EvmuVms);
85
86
87
88
89
90
91
92
93
94
95
96
114
115
116
117
139
140
141
142
160
161
162
163
173
174
175
176
180 const EvmuDirEntry* pDirEntry,
181 const char* pVmsName) GBL_NOEXCEPT;
185 size_t bytes) GBL_NOEXCEPT;
188 const char* pVmiPath,
189 GblStringBuffer* pVmsPath) GBL_NOEXCEPT;
#define EVMU_EXPORT
Define used for adding attributes to export public symbols.
#define EVMU_VMI_FILE_SIZE
Size of a .vmi file the EvmuVmi structure.
#define EVMU_VMI_VMS_NAME_SIZE
#define EVMU_VMI_DESCRIPTION_SIZE
Size of the EvmuVmi::description field.
#define EVMU_VMI_COPYRIGHT_SIZE
Size of the EvmuVmi::copyright field.
#define EVMU_VMI_VMS_RESOURCE_SIZE
Size of the EvmuVmi::vmsResourceName field.
Structure of the .VMI file format.
const char * EvmuVmi_fileName(const EvmuVmi *pSelf, GblStringBuffer *pbuff)
Copies the EvmuVmi::fileNameOnVms field to the given buffer.
EVMU_RESULT EvmuVmi_fromVmsFile(EvmuVmi *pSelf, const void *pData, size_t bytes)
Populates the given structure from a VMS image, needing to know whether it's a GAME file or not.
uint32_t checksum
Checksum value for entire structure.
size_t EvmuVmi_setVmsResource(EvmuVmi *pSelf, const char *pStr)
Sets the EvmuVmi::vmsResourceName field to the given string, returning the number of bytes copied.
GblBool EvmuVmi_isValid(const EvmuVmi *pSelf)
Returns whether the VMI structure passes a series of validation/sanity checks on its fields.
EvmuVmiTimestamp creationTimestamp
File creation date.
GblDateTime * EvmuVmi_creation(const EvmuVmi *pSelf, GblDateTime *pDateTime)
Converts the EvmuVmi::creationTimestamp field to GblDateTime.
EVMU_RESULT EvmuVmi_load(EvmuVmi *pSelf, const char *pPath)
Populates the given structure by loading its contents from an external .VMI file.
size_t EvmuVmi_setDescription(EvmuVmi *pSelf, const char *pStr)
Sets the EvmuVmi::description field to the given string, returning the number of bytes copied.
size_t EvmuVmi_setFileName(EvmuVmi *pSelf, const char *pStr)
Sets the EvmuVmi::fileNameOnVms field to the given string, returning the number of bytes copied.
void EvmuVmi_setGame(EvmuVmi *pSelf, GblBool val)
Sets the EvmuVmi::fileMode type field signifying whether or not file is a GAME.
GblBool EvmuVmi_isGame(const EvmuVmi *pSelf)
Returns whether the EvmuVmi::fileMode type field signifies a GAME file.
void EvmuVmi_setCreation(EvmuVmi *pSelf, const GblDateTime *pDt)
Sets the EvmuVmi::creationTimestamp field to the given GblDateTime value.
uint16_t vmiVersion
VMI version of the file, see EVMU_VMI_VERSION.
char fileNameOnVms[12]
File name field within the .VMS file.
uint16_t unknown
Unknown and undocumented (assumed to be 0)
void EvmuVmi_log(const EvmuVmi *pSelf)
Logs the fields of the VMI file to the libGimbal log system.
EVMU_RESULT EvmuVmi_fromDirEntry(EvmuVmi *pSelf, const EvmuFat *pFat, const EvmuDirEntry *pDirEntry, const char *pVmsName)
Populates the given structure from an EvmuDirEntry, also needing a pointer to EvmuFat and a VMS name.
uint32_t EvmuVmi_computeChecksum(const EvmuVmi *pSelf)
Computes the checksum for the given VMI data.
GblBool EvmuVmi_isProtected(const EvmuVmi *pSelf)
Returns whether the EvmuVmi::fileMode protected field signifies copy protection.
uint16_t fileNumber
File number in a series.
char description[32]
Description of VMI file string.
void EvmuVmi_setProtected(EvmuVmi *pSelf, GblBool val)
Sets the EvmuVmi::fileMode protected filed to signify whether or not the file is copy protected.
const char * EvmuVmi_copyright(const EvmuVmi *pSelf, GblStringBuffer *pBuff)
Copies the EvmuVmi::copyright field to the given buffer.
size_t EvmuVmi_setCopyright(EvmuVmi *pSelf, const char *pStr)
Sets the EvmuVmi::copyright field to the given string, returning the number of bytes copied.
char vmsResourceName[8]
File name of the corresponding VMS file, expected within the same directory.
uint32_t fileSize
File size of VMS (in bytes?)
const char * EvmuVmi_vmsResource(const EvmuVmi *pSelf, GblStringBuffer *pBuff)
Copies the EvmuVmi::vmsResourceName field to the given buffer.
const char * EvmuVmi_findVmsPath(const EvmuVmi *pSelf, const char *pVmiPath, GblStringBuffer *pVmsPath)
Finds the path for the VMS file coresponding to the given VMI file.
char copyright[32]
Copyright information string.
uint16_t fileMode
File mode bitfield (GAME bit + PROTECTED bit)
const char * EvmuVmi_description(const EvmuVmi *pSelf, GblStringBuffer *pBuff)
Copies the EvmuVmi::description field to the given buffer.
EVMU_RESULT EvmuVmi_save(const EvmuVmi *pSelf, const char *pPath)
Writes the contens of the given structure to an external .VMI file.
.VMI timestamp. Unlike EvmuTimestamp it is not stored in BCD format
uint8_t minute
Time minute (0-59)
uint8_t day
Date day (1-31)
uint8_t month
Date month (1-12)
uint8_t second
Time second (0-59)
uint8_t hour
Time hour (0-23)
uint8_t weekDay
Day of the week (0-6)