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
36
37
38
39
40
41
42
43
44
45
46
47#ifndef EVMU_ICONDATA_H
48#define EVMU_ICONDATA_H
51#include <gimbal/utils/gimbal_byte_array.h>
54#define EVMU_ICONDATA_VMS_FILE_NAME "ICONDATA_VMS"
57
58
59
60#define EVMU_ICONDATA_DESCRIPTION_SIZE 16
61#define EVMU_ICONDATA_ICON_WIDTH 32
62#define EVMU_ICONDATA_ICON_HEIGHT 32
63#define EVMU_ICONDATA_VMU_ICON_BYTES 128
64#define EVMU_ICONDATA_DC_PALETTE_SIZE 16
65#define EVMU_ICONDATA_DC_PALETTE_BYTES 32
66#define EVMU_ICONDATA_DC_ICON_BYTES 512
70
71
72
73#define EVMU_ICONDATA_BIOS_SECRET_OFFSET 0x2c0
74#define EVMU_ICONDATA_BIOS_SECRET_BYTE_COUNT 16
78
79
80
81#define EVMU_ICONDATA_PALETTE_ENTRY_A(c) ((c >> 12
) & 0xf
)
82#define EVMU_ICONDATA_PALETTE_ENTRY_R(c) ((c >> 8
) & 0xf
)
83#define EVMU_ICONDATA_PALETTE_ENTRY_G(c) ((c >> 4
) & 0xf
)
84#define EVMU_ICONDATA_PALETTE_ENTRY_B(c) ((c ) & 0xf
)
86#define EVMU_ICONDATA_PALETTE_ENTRY(a, r, g, b)
87 ((uint16_t)(((a & 0xf
) << 12
) | ((r & 0xf
) << 8
) | ((g & 0xf
) << 4
) | ((b & 0xf
))))
90#define GBL_SELF_TYPE EvmuIconData
95
96
97
98
99
100
101
113
114
115
116
119 GblStringBuffer* pBuff) GBL_NOEXCEPT;
135
136
137
138
141 const char* pString) GBL_NOEXCEPT;
147 const uint8_t* pBytes) GBL_NOEXCEPT;
151
152
153
154
#define EVMU_EXPORT
Define used for adding attributes to export public symbols.
const uint8_t * EvmuIconData_unlockSecretBiosBytes(void)
Returns the 16-byte ICONDATA sequence for unlocking the secret Dreamcast BIOS.
#define EVMU_ICONDATA_DESCRIPTION_SIZE
Number of bytes in the EvmuIconData::description string.
Header structure for the ICONDATA_VMS special VMU file.
uint32_t vmuIconOffset
Byte offset of the VMU icon from the header.
const char * EvmuIconData_description(const EvmuIconData *pSelf, GblStringBuffer *pBuff)
Fills the given GblStringBuffer with the EvmuIconData::description field, returning its C string.
const void * EvmuIconData_dcIcon(const EvmuIconData *pSelf)
Returns a raw data pointer to the DC icon, which is a 4-bit paletted image where each color is 16-bit...
size_t EvmuIconData_setDescription(EvmuIconData *pSelf, const char *pString)
Sets the EvmuIconData::description field to the string given by pString, returning the number of byte...
const uint8_t * EvmuIconData_secretBiosBytes(const EvmuIconData *pSelf)
Returns a pointer to the beginning of the byte sequence for unlocking the secret DC BIOS.
GblBool EvmuIconData_secretBiosUnlocked(const EvmuIconData *pSelf)
Returns GBL_TRUE if the secret 3D Dreamcast BIOS has been unlocked, GBL_FALSE otherwise.
uint16_t EvmuIconData_dcPaletteEntry(const EvmuIconData *pSelf, size_t idx)
Returns the 16-bit color palette entry at index idx for the DC icon.
uint32_t dcIconOffset
Byte offset of the DC icon from the header.
void EvmuIconData_setSecretBiosBytes(EvmuIconData *pSelf, const uint8_t *pBytes)
Sets the 16-byte sequence for unlocking the secret BIOS to the data pointed to by pBytes.
const void * EvmuIconData_vmuIcon(const EvmuIconData *pSelf)
Returns a raw data pointer to the VMU icon, which is a monochrome bitmap.
GblByteArray * EvmuIconData_createDcIconArgb4444(const EvmuIconData *pSelf)
Creats and returns a GblByteArray containing an ARGB4444 16-bit format texture for the DC icon.
void EvmuIconData_unlockSecretBios(EvmuIconData *pSelf, GblBool unlock)
Locks or unlocks the secret 3D additional Dreamcast BIOS by writing a secret bit sequence.
size_t EvmuIconData_totalBytes(const EvmuIconData *pSelf)
Returns the total size of the EvmuIconData file on the filesystem in bytes.
char description[16]
VMU filesystem description of file.
GblByteArray * EvmuIconData_createVmuIconArgb4444(const EvmuIconData *pSelf)
Creates and returns a GblByteArray containing an ARGB4444 16-bit format texture for the VMU icon.
EVMU_RESULT EvmuIconData_log(const EvmuIconData *pSelf)
Dumps all attribute and field information for EvmuIconData to the libGimbal log system.