N64FlashcartMenu
Loading...
Searching...
No Matches
sc64_ll.h
Go to the documentation of this file.
1
7#ifndef FLASHCART_SC64_LL_H__
8#define FLASHCART_SC64_LL_H__
9
10#include <stddef.h>
11#include <stdint.h>
12
19typedef struct {
20 uint8_t BUFFER[8192];
21 uint8_t EEPROM[2048];
22 uint8_t DD_SECTOR[256];
23 uint8_t FLASHRAM[128];
25
26#define SC64_BUFFERS_BASE (0x1FFE0000UL)
27#define SC64_BUFFERS ((sc64_buffers_t *) SC64_BUFFERS_BASE)
28
39
58
66
75
86
88typedef enum {
89 CIC_SEED_AUTO = 0xFFFF
91
99
105
112
120
122typedef struct {
123 int count;
124 struct {
125 uint32_t thb_table;
126 uint32_t sector_table;
127 } disks[4];
129
133void sc64_ll_lock(void);
134
143sc64_error_t sc64_ll_get_version(uint16_t *major, uint16_t *minor, uint32_t *revision);
144
152sc64_error_t sc64_ll_get_config(sc64_cfg_id_t cfg, uint32_t *value);
153
162
170
178
186
193
200sc64_error_t sc64_ll_flash_get_erase_block_size(size_t *erase_block_size);
201
209
210 /* sc64 */
211
212#endif // FLASHCART_SC64_LL_H__
int count
Definition sc64_ll.h:123
sc64_error_t sc64_ll_writeback_pending(bool *pending)
Check if writeback is pending.
Definition sc64_ll.c:170
sc64_error_t sc64_ll_get_config(sc64_cfg_id_t cfg, uint32_t *value)
Get the SC64 configuration.
Definition sc64_ll.c:107
sc64_error_t sc64_ll_get_version(uint16_t *major, uint16_t *minor, uint32_t *revision)
Get the SC64 version.
Definition sc64_ll.c:89
void sc64_ll_lock(void)
Lock the SC64.
Definition sc64_ll.c:77
sc64_dd_mode_t
The SC64 Disk Drive Mode Enumeration.
Definition sc64_ll.h:60
sc64_error_t sc64_ll_flash_wait_busy(void)
Wait for flash to be not busy.
Definition sc64_ll.c:198
sc64_disk_state_t
The SC64 Disk State Enumeration.
Definition sc64_ll.h:107
sc64_boot_mode_t
The SC64 Boot Mode Enumeration.
Definition sc64_ll.h:68
sc64_error_t sc64_ll_set_disk_mapping(sc64_disk_mapping_t *disk_mapping)
Set the SC64 disk mapping.
Definition sc64_ll.c:138
sc64_error_t sc64_ll_writeback_enable(void *address)
Enable writeback.
Definition sc64_ll.c:185
sc64_tv_type_t
The SC64 TV Type Enumeration.
Definition sc64_ll.h:93
sc64_drive_type_t
The SC64 Drive Type Enumeration.
Definition sc64_ll.h:101
sc64_button_mode_t
The SC64 Button Mode Enumeration.
Definition sc64_ll.h:114
sc64_cic_seed_t
The SC64 CIC Seed Enumeration.
Definition sc64_ll.h:88
sc64_cfg_id_t
The SC64 Configuration ID Enumeration.
Definition sc64_ll.h:41
sc64_save_type_t
The SC64 Save Type Enumeration.
Definition sc64_ll.h:77
sc64_error_t sc64_ll_flash_get_erase_block_size(size_t *erase_block_size)
Get the flash erase block size.
Definition sc64_ll.c:212
sc64_error_t
The SC64 State Enumeration.
Definition sc64_ll.h:30
sc64_error_t sc64_ll_flash_erase_block(void *address)
Erase a flash block.
Definition sc64_ll.c:228
sc64_error_t sc64_ll_set_config(sc64_cfg_id_t cfg, uint32_t value)
Set the SC64 configuration.
Definition sc64_ll.c:124
@ DD_MODE_DISABLED
Definition sc64_ll.h:61
@ DD_MODE_FULL
Definition sc64_ll.h:64
@ DD_MODE_IPL
Definition sc64_ll.h:63
@ DD_MODE_REGS
Definition sc64_ll.h:62
@ DISK_STATE_INSERTED
Definition sc64_ll.h:109
@ DISK_STATE_EJECTED
Definition sc64_ll.h:108
@ DISK_STATE_CHANGED
Definition sc64_ll.h:110
@ BOOT_MODE_DIRECT_DDIPL
Definition sc64_ll.h:73
@ BOOT_MODE_DIRECT_ROM
Definition sc64_ll.h:72
@ BOOT_MODE_DDIPL
Definition sc64_ll.h:71
@ BOOT_MODE_ROM
Definition sc64_ll.h:70
@ BOOT_MODE_MENU
Definition sc64_ll.h:69
@ TV_TYPE_MPAL
Definition sc64_ll.h:96
@ TV_TYPE_NTSC
Definition sc64_ll.h:95
@ TV_TYPE_PASSTHROUGH
Definition sc64_ll.h:97
@ TV_TYPE_PAL
Definition sc64_ll.h:94
@ DRIVE_TYPE_RETAIL
Definition sc64_ll.h:102
@ DRIVE_TYPE_DEVELOPMENT
Definition sc64_ll.h:103
@ BUTTON_MODE_DD_DISK_SWAP
Definition sc64_ll.h:118
@ BUTTON_MODE_NONE
Definition sc64_ll.h:115
@ BUTTON_MODE_N64_IRQ
Definition sc64_ll.h:116
@ BUTTON_MODE_USB_PACKET
Definition sc64_ll.h:117
@ CIC_SEED_AUTO
Definition sc64_ll.h:89
@ CFG_ID_DD_DRIVE_TYPE
Definition sc64_ll.h:52
@ CFG_ID_BOOT_MODE
Definition sc64_ll.h:47
@ CFG_ID_ROM_WRITE_ENABLE
Definition sc64_ll.h:43
@ CFG_ID_CIC_SEED
Definition sc64_ll.h:49
@ CFG_ID_ISV_ADDRESS
Definition sc64_ll.h:46
@ CFG_ID_BOOTLOADER_SWITCH
Definition sc64_ll.h:42
@ CFG_ID_DD_SD_ENABLE
Definition sc64_ll.h:51
@ CFG_ID_SAVE_TYPE
Definition sc64_ll.h:48
@ CFG_ID_DD_DISK_STATE
Definition sc64_ll.h:53
@ CFG_ID_ROM_EXTENDED_ENABLE
Definition sc64_ll.h:56
@ CFG_ID_DD_MODE
Definition sc64_ll.h:45
@ CFG_ID_TV_TYPE
Definition sc64_ll.h:50
@ CFG_ID_BUTTON_MODE
Definition sc64_ll.h:55
@ CFG_ID_ROM_SHADOW_ENABLE
Definition sc64_ll.h:44
@ CFG_ID_BUTTON_STATE
Definition sc64_ll.h:54
@ SAVE_TYPE_FLASHRAM_1MBIT
Definition sc64_ll.h:82
@ SAVE_TYPE_EEPROM_4KBIT
Definition sc64_ll.h:79
@ SAVE_TYPE_SRAM_256KBIT
Definition sc64_ll.h:81
@ SAVE_TYPE_EEPROM_16KBIT
Definition sc64_ll.h:80
@ SAVE_TYPE_NONE
Definition sc64_ll.h:78
@ SAVE_TYPE_SRAM_BANKED
Definition sc64_ll.h:83
@ SAVE_TYPE_SRAM_1MBIT
Definition sc64_ll.h:84
@ SC64_ERROR_SD_CARD
Definition sc64_ll.h:36
@ SC64_ERROR_BAD_ADDRESS
Definition sc64_ll.h:33
@ SC64_ERROR_TIMEOUT
Definition sc64_ll.h:35
@ SC64_OK
Definition sc64_ll.h:31
@ SC64_ERROR_BAD_CONFIG_ID
Definition sc64_ll.h:34
@ SC64_ERROR_UNKNOWN_CMD
Definition sc64_ll.h:37
@ SC64_ERROR_BAD_ARGUMENT
Definition sc64_ll.h:32
The SC64 buffers structure.
Definition sc64_ll.h:19
The SC64 Disk Mapping Structure.
Definition sc64_ll.h:122