N64FlashcartMenu
Loading...
Searching...
No Matches
flashcart.h
Go to the documentation of this file.
1
7#ifndef FLASHCART_H__
8#define FLASHCART_H__
9
10
11#include <stdbool.h>
12#include <stdint.h>
13
14
16typedef enum {
17 FLASHCART_OK,
18 FLASHCART_ERROR_NOT_DETECTED,
19 FLASHCART_ERROR_OUTDATED,
20 FLASHCART_ERROR_SD_CARD,
21 FLASHCART_ERROR_ARGS,
22 FLASHCART_ERROR_LOAD,
23 FLASHCART_ERROR_INT,
25
27typedef enum {
28 FLASHCART_SAVE_TYPE_NONE,
29 FLASHCART_SAVE_TYPE_EEPROM_4K,
30 FLASHCART_SAVE_TYPE_EEPROM_16K,
31 FLASHCART_SAVE_TYPE_SRAM,
32 FLASHCART_SAVE_TYPE_SRAM_BANKED,
33 FLASHCART_SAVE_TYPE_SRAM_128K,
34 FLASHCART_SAVE_TYPE_FLASHRAM,
35 __FLASHCART_SAVE_TYPE_END
37
38typedef void flashcart_progress_callback_t (float progress);
39
41typedef struct {
42 flashcart_error_t (*init) (void);
43 flashcart_error_t (*deinit) (void);
44 flashcart_error_t (*load_rom) (char *rom_path, flashcart_progress_callback_t *progress);
45 flashcart_error_t (*load_save) (char *save_path);
46 flashcart_error_t (*set_save_type) (flashcart_save_type_t save_type);
47 flashcart_error_t (*set_save_writeback) (uint32_t *sectors);
49
50
51flashcart_error_t flashcart_init (void);
52flashcart_error_t flashcart_deinit (void);
53flashcart_error_t flashcart_load_rom (char *rom_path, bool byte_swap, flashcart_progress_callback_t *progress);
54flashcart_error_t flashcart_load_save (char *save_path, flashcart_save_type_t save_type);
55
56
57#endif
flashcart_error_t
Flashcart error enumeration.
Definition: flashcart.h:16
flashcart_save_type_t
Flashcart save type enumeration.
Definition: flashcart.h:27
Flashcart Structure.
Definition: flashcart.h:41