Driver for the Dreamcast's Internal Flash Storage
More...
Driver for the Dreamcast's Internal Flash Storage
◆ flashrom_delete()
int flashrom_delete |
( |
uint32_t | offset | ) |
|
Delete data from the flashrom.
This function implements the FLASHROM_DELETE syscall; given a partition offset, that entire partition of the flashrom will be deleted and all data will be reset to 0xFF bytes.
- Note
- This does not rewrite the magic block to the start of the partition. It is your responsibility to do this after running this function.
- Parameters
-
offset | The offset of the start of the partition to erase. |
- Return values
-
◆ flashrom_get_block()
int flashrom_get_block |
( |
uint32_t | part_id, |
|
|
uint32_t | block_id, |
|
|
uint8_t * | buffer_out ) |
Get a logical block from the specified partition.
This function retrieves the specified block ID from the given partition. The newest version of the data is returned.
- Parameters
-
part_id | The partition ID to look in. |
block_id | The logical block ID to look for. |
buffer_out | Space to store the data. Must be at least 60 bytes. |
- Returns
- 0 on success, <0 on error.
- See also
- Error Values
◆ flashrom_get_ispcfg()
Retrieve DreamPassport's ISP configuration.
This function retrieves the console's ISP settings as set by DreamPassport, if they exist. You should check the valid_fields bitfield for the part of the struct you want before relying on the data.
- Parameters
-
out | Storage for the structure. |
- Return values
-
0 | On success. |
-1 | On error (no settings found, or other errors). |
◆ flashrom_get_pw_ispcfg()
Retrieve PlanetWeb's ISP configuration.
This function retrieves the console's ISP settings as set by PlanetWeb (1.0 and 2.1 have been verified to work), if they exist. You should check the valid_fields bitfield for the part of the struct you want before relying on the data.
- Parameters
-
out | Storage for the structure. |
- Return values
-
0 | On success. |
-1 | On error (i.e, no PlanetWeb settings found). |
◆ flashrom_get_region()
int flashrom_get_region |
( |
void | | ) |
|
Retrieve the console's region code.
This function attempts to find the region of the Dreamcast. It may or may not work on 100% of Dreamcasts, apparently.
- Returns
- A region code (>=0), or error (<0).
- See also
- Region Settings
-
Error Values
◆ flashrom_get_syscfg()
Retrieve the current system configuration settings.
- Parameters
-
out | Storage for the configuration. |
- Returns
- 0 on success, <0 on error.
- See also
- Error Values
◆ flashrom_info()
int flashrom_info |
( |
uint32_t | part_id, |
|
|
uint32_t * | start_offset, |
|
|
size_t * | size_out ) |
Retrieve information about the given partition.
This function implements the FLASHROM_INFO syscall; given a partition ID, it returns the offset from the start of the flashrom and the size of the partition in bytes.
- Parameters
-
part_id | The partition ID in question. |
start_offset | Buffer for storing the partition's start offset, in bytes, from the beginning of the flashrom. |
size_out | Buffer for storing the size of the partition in bytes. |
- Return values
-
◆ flashrom_read()
int flashrom_read |
( |
uint32_t | offset, |
|
|
void * | buffer_out, |
|
|
size_t | bytes ) |
Read data from the flashrom.
This function implements the FLASHROM_READ syscall; given a flashrom offset, an output buffer, and a count, this reads data from the flashrom.
- Parameters
-
offset | The offset to read from. |
buffer_out | Space to read into. |
bytes | The number of bytes to read. |
- Returns
- The number of bytes read if successful, or -1 otherwise.
◆ flashrom_write()
int flashrom_write |
( |
uint32_t | offset, |
|
|
const void * | buffer, |
|
|
size_t | bytes ) |
Write data to the flashrom.
This function implements the FLASHROM_WRITE syscall; given a flashrom offset, an input buffer, and a count, this writes data to the flashrom.
- Note
- It is not possible to write ones to the flashrom over zeros. If you want to do this, you must save the old data in the flashrom, delete it out, and save the new data back.
- Parameters
-
offset | The offset to write at. |
buffer | The data to write. |
bytes | The number of bytes to write. |
- Returns
- The number of bytes written if successful, -1 otherwise.