N64FlashcartMenu
Loading...
Searching...
No Matches
datel_codes.h File Reference

Datel Codes. More...

Go to the source code of this file.

Data Structures

struct  cheat_file_code_t
 Cheat file code Structure. More...
 

Macros

#define MAX_CHEAT_CODES   (64)
 
#define MAX_CHEAT_CODE_ARRAYLIST_SIZE   (MAX_CHEAT_CODES * 2 + 2)
 

Enumerations

enum  cheat_file_load_err_t {
  CHEAT_FILE_LOAD_OK , CHEAT_FILE_LOAD_ERR_MEMORY_ALLOC_FAIL , CHEAT_FILE_LOAD_ERR_FILE_OPEN_FAIL , CHEAT_FILE_LOAD_ERR_FILE_STAT_FAIL ,
  CHEAT_FILE_LOAD_ERR_FILE_EMPTY , CHEAT_FILE_LOAD_ERR_FILE_TOO_BIG , CHEAT_FILE_LOAD_ERR_FILE_CONTENTS_ALLOC_FAIL , CHEAT_FILE_LOAD_ERR_FILE_READ_FAIL ,
  CHEAT_FILE_LOAD_ERR_FILE_CLOSE_FAIL , CHEAT_FILE_LOAD_ERR_UNKNOWN
}
 Cheat code loading enum.
 

Functions

size_t generate_enabled_cheats_array (cheat_file_code_t *cheats_in, uint32_t *cheats_out)
 Generate a cheats array containing enabled cheats as address/value pairs. The last two entries will always be zero.
 
cheat_file_code_tget_cheat_codes (void)
 Get the cheat codes.
 
void set_cheat_codes (cheat_file_code_t *cheats)
 Set the cheat codes.
 
void load_cheats_from_file (char *path)
 Load cheats from a file.
 
void save_cheats_to_file (char *path)
 Save cheats to a file.
 

Detailed Description

Datel Codes.


Data Structure Documentation

◆ cheat_file_code_t

struct cheat_file_code_t

Cheat file code Structure.

Data Fields
uint32_t address

Cheat address

uint16_t value

Cheat value

bool enabled

Cheat enabled flag

char description[32]

Cheat description

Function Documentation

◆ generate_enabled_cheats_array()

size_t generate_enabled_cheats_array ( cheat_file_code_t * cheats_in,
uint32_t * cheats_out )

Generate a cheats array containing enabled cheats as address/value pairs. The last two entries will always be zero.

Parameters
cheats_inInput array of type cheat_file_code_t.
cheats_outOutput array (must be at least (MAX_CHEAT_CODES * 2 + 2) in size).
Returns
Number of address/value pairs written (including the trailing zeros).

◆ get_cheat_codes()

cheat_file_code_t * get_cheat_codes ( void )

Get the cheat codes.

Returns
Pointer to the array of cheat codes.
Returns
Pointer to the array of cheat codes.

◆ set_cheat_codes()

void set_cheat_codes ( cheat_file_code_t * cheats)

Set the cheat codes.

Parameters
cheatsPointer to the array of cheat codes.
Parameters
cheatsPointer to the array of cheat codes.

◆ load_cheats_from_file()

void load_cheats_from_file ( char * path)

Load cheats from a file.

Parameters
pathPath to the file containing cheat codes.

◆ save_cheats_to_file()

void save_cheats_to_file ( char * path)

Save cheats to a file.

Parameters
pathPath to the file where cheat codes should be saved.