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_file) (char *file_path, uint32_t rom_offset, uint32_t file_offset);
46 flashcart_error_t (*load_save) (char *save_path);
47 flashcart_error_t (*set_save_type) (flashcart_save_type_t save_type);
48 flashcart_error_t (*set_save_writeback) (uint32_t *sectors);
50
51
52flashcart_error_t flashcart_init (void);
53flashcart_error_t flashcart_deinit (void);
54flashcart_error_t flashcart_load_rom (char *rom_path, bool byte_swap, flashcart_progress_callback_t *progress);
55flashcart_error_t flashcart_load_file (char *file_path, uint32_t rom_offset, uint32_t file_offset);
56flashcart_error_t flashcart_load_save (char *save_path, flashcart_save_type_t save_type);
57
58
59#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