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_FLASHRAM_PKST2,
36 __FLASHCART_SAVE_TYPE_END
38
39typedef void flashcart_progress_callback_t (float progress);
40
42typedef struct {
43 flashcart_error_t (*init) (void);
44 flashcart_error_t (*deinit) (void);
45 flashcart_error_t (*load_rom) (char *rom_path, flashcart_progress_callback_t *progress);
46 flashcart_error_t (*load_file) (char *file_path, uint32_t rom_offset, uint32_t file_offset);
47 flashcart_error_t (*load_save) (char *save_path);
48 flashcart_error_t (*set_save_type) (flashcart_save_type_t save_type);
49 flashcart_error_t (*set_save_writeback) (uint32_t *sectors);
51
52
53flashcart_error_t flashcart_init (void);
54flashcart_error_t flashcart_deinit (void);
55flashcart_error_t flashcart_load_rom (char *rom_path, bool byte_swap, flashcart_progress_callback_t *progress);
56flashcart_error_t flashcart_load_file (char *file_path, uint32_t rom_offset, uint32_t file_offset);
57flashcart_error_t flashcart_load_save (char *save_path, flashcart_save_type_t save_type);
58
59
60#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:42