N64FlashcartMenu/src/menu/cpak_handler.h

34 lines
781 B
C
Raw Normal View History

2024-03-18 01:15:47 +01:00
/**
* @file cpak_handler.h
* @brief ControllerPak handler
* @ingroup menu
*/
#include <stdbool.h>
#include <stdint.h>
#ifndef CPAK_HANDLER_H__
#define CPAK_HANDLER_H__
2024-03-19 17:42:06 +01:00
/** @brief Controller Pak state enumeration. */
typedef enum {
CONTROLLER_PAK_OK,
CONTROLLER_PAK_ERR_IO,
CONTROLLER_PAK_ERR_NO_FILE,
CONTROLLER_PAK_ERR_INVALID,
} cpak_err_t;
/** @brief Controller Pak Information Structure. */
typedef struct {
2024-03-19 20:14:04 +01:00
entry_structure_t entries[16];
int free_space;
2024-03-19 17:42:06 +01:00
} cpak_info_t;
cpak_err_t cpak_info_load(uint8_t port, cpak_info_t *cpak_info);
int cpak_clone_contents_to_file(char *path, uint8_t port);
cpak_err_t cpak_overwrite_contents_from_file(char *path, uint8_t port);
2024-03-20 00:00:32 +01:00
cpak_err_t cpak_attempt_repair(uint8_t port, bool allow_formatting);
2024-03-18 01:15:47 +01:00
#endif