N64FlashcartMenu
Loading...
Searching...
No Matches
64drive_ll.h
Go to the documentation of this file.
1
7#ifndef FLASHCART_64DRIVE_LL_H__
8#define FLASHCART_64DRIVE_LL_H__
9
10
11#include <stdbool.h>
12#include <stdint.h>
13
14
20typedef struct {
21 uint8_t BUFFER[512];
22 uint32_t STATUS;
23 uint32_t __unused_1;
24 uint32_t COMMAND;
25 uint32_t __unused_2;
26 uint32_t LBA;
27 uint32_t __unused_3;
28 uint32_t LENGTH;
29 uint32_t __unused_4;
30 uint32_t RESULT;
31
32 uint32_t __unused_5[49];
33
34 uint32_t SDRAM_SIZE;
35 uint32_t MAGIC;
36 uint32_t VARIANT;
37 uint32_t PERSISTENT;
38 uint32_t BUTTON_UPGRADE;
39 uint32_t REVISION;
40
41 uint32_t __unused_6[64];
42
43 uint32_t USB_COMMAND_STATUS;
44 uint32_t USB_PARAM_RESULT[2];
45
46 uint32_t __unused_7[5];
47
48 uint32_t WIFI_COMMAND_STATUS;
49 uint32_t WIFI_PARAM_RESULT[2];
50
51 uint32_t __unused_8[757];
52
53 uint8_t EEPROM[2048];
54 uint32_t WRITEBACK[256];
56
57#define D64_REGS_BASE (0x18000000UL)
58#define D64_REGS_BASE_EXT (0x1F800000UL)
59#define D64_REGS ((d64_regs_t *) D64_REGS_BASE)
60#define D64_REGS_EXT ((d64_regs_t *) D64_REGS_BASE_EXT)
61
62
63typedef enum {
64 DEVICE_VARIANT_UNKNOWN = 0x0000,
65 DEVICE_VARIANT_A = 0x4100,
66 DEVICE_VARIANT_B = 0x4200,
67} d64_device_variant_t;
68
69typedef enum {
70 TV_TYPE_PAL = 0,
71 TV_TYPE_NTSC = 1,
72 TV_TYPE_MPAL = 2,
73 TV_TYPE_UNKNOWN = 3,
74} d64_tv_type_t;
75
76typedef enum {
77 SAVE_TYPE_NONE,
78 SAVE_TYPE_EEPROM_4K,
79 SAVE_TYPE_EEPROM_16K,
80 SAVE_TYPE_SRAM,
81 SAVE_TYPE_FLASHRAM,
82 SAVE_TYPE_SRAM_BANKED,
83 SAVE_TYPE_FLASHRAM_PKST2,
84} d64_save_type_t;
85
86
87bool d64_ll_get_version (d64_device_variant_t *device_variant, uint16_t *fpga_revision, uint32_t *bootloader_version);
88bool d64_ll_set_persistent_variable_storage (bool quick_reboot, d64_tv_type_t force_tv_type, uint8_t cic_seed);
89bool d64_ll_set_save_type (d64_save_type_t save_type);
90bool d64_ll_enable_save_writeback (bool enabled);
91bool d64_ll_enable_cartrom_writes (bool enabled);
92bool d64_ll_enable_extended_mode (bool enabled);
93bool d64_ll_write_eeprom_contents (void *contents);
94bool d64_ll_write_save_writeback_lba_list (void *list);
95 /* 64drive */
97
98
99#endif
Definition: 64drive_ll.h:20