Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve case consistency for structs #1064

Open
jgcodes2020 opened this issue Mar 24, 2024 · 0 comments
Open

Improve case consistency for structs #1064

jgcodes2020 opened this issue Mar 24, 2024 · 0 comments

Comments

@jgcodes2020
Copy link

Here's a few structs from the current m64p_types.h.

typedef struct
{
uint8_t init_PI_BSB_DOM1_LAT_REG; /* 0x00 */
uint8_t init_PI_BSB_DOM1_PGS_REG; /* 0x01 */
uint8_t init_PI_BSB_DOM1_PWD_REG; /* 0x02 */
uint8_t init_PI_BSB_DOM1_PGS_REG2; /* 0x03 */
uint32_t ClockRate; /* 0x04 */
uint32_t PC; /* 0x08 */
uint32_t Release; /* 0x0C */
uint32_t CRC1; /* 0x10 */
uint32_t CRC2; /* 0x14 */
uint32_t Unknown[2]; /* 0x18 */
uint8_t Name[20]; /* 0x20 */
uint32_t unknown; /* 0x34 */
uint32_t Manufacturer_ID; /* 0x38 */
uint16_t Cartridge_ID; /* 0x3C - Game serial number */
uint8_t Country_code; /* 0x3E */
uint8_t Version; /* 0x3F */
} m64p_rom_header;

typedef struct
{
char goodname[256];
char MD5[33];
unsigned char savetype;
unsigned char status; /* Rom status on a scale from 0-5. */
unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */
unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */
unsigned char transferpak; /* 0 - No, 1 - Yes boolean for transfer pak support. */
unsigned char mempak; /* 0 - No, 1 - Yes boolean for memory pak support. */
unsigned char biopak; /* 0 - No, 1 - Yes boolean for bio pak support. */
unsigned char disableextramem; /* 0 - No, 1 - Yes boolean for disabling 4MB expansion RAM pack */
unsigned int countperop; /* Number of CPU cycles per instruction. */
unsigned int sidmaduration; /* Default SI DMA duration */
unsigned int aidmamodifier; /* Percentage modifier for AI DMA duration */
} m64p_rom_settings;

typedef struct {
/* Frontend-defined callback data. */
void* cb_data;
/* Allow the frontend to specify the GB cart ROM file to load
* cb_data: points to frontend-defined callback data.
* controller_num: (0-3) tell the frontend which controller is about to load a GB cart
* Returns a NULL-terminated string owned by the core specifying the GB cart ROM filename to load.
* Empty or NULL string results in no GB cart being loaded (eg. empty transferpak).
*/
char* (*get_gb_cart_rom)(void* cb_data, int controller_num);
/* Allow the frontend to specify the GB cart RAM file to load
* cb_data: points to frontend-defined callback data.
* controller_num: (0-3) tell the frontend which controller is about to load a GB cart
* Returns a NULL-terminated string owned by the core specifying the GB cart RAM filename to load
* Empty or NULL string results in the core generating a default save file with empty content.
*/
char* (*get_gb_cart_ram)(void* cb_data, int controller_num);
/* Allow the frontend to know what DD IPL ROM region file to load
* cb_data: points to frontend-defined callback data.
* region: a region from m64p_system_type
*/
void (*set_dd_rom_region)(void* cb_data, uint8_t region);
/* Allow the frontend to specify the DD IPL ROM file to load
* cb_data: points to frontend-defined callback data.
* Returns a NULL-terminated string owned by the core specifying the DD IPL ROM filename to load
* Empty or NULL string results in disabled 64DD.
*/
char* (*get_dd_rom)(void* cb_data);
/* Allow the frontend to specify the DD disk file to load
* cb_data: points to frontend-defined callback data.
* Returns a NULL-terminated string owned by the core specifying the DD disk filename to load
* Empty or NULL string results in no DD disk being loaded (eg. empty disk drive).
*/
char* (*get_dd_disk)(void* cb_data);
} m64p_media_loader;

It would be a good code-formatting thing to stick with a common casing convention for these structs. Doing so will also make it easier to create bindings for other languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant