Driver for the Dreamcast's Internal Flash Storage
More...
Driver for the Dreamcast's Internal Flash Storage
◆ flashrom_delete()
int flashrom_delete |
( |
int | 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 |
( |
int | partid, |
|
|
int | blockid, |
|
|
uint8 * | 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
-
partid | The partition ID to look in. |
blockid | 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 |
( |
int | part, |
|
|
int * | start_out, |
|
|
int * | size_out ) |
Retrieve information about the given partition.
This function implements the FLASHROM_INFO syscall; given a partition ID, return two ints specifying the beginning and the size of the partition (respectively) inside the flashrom.
- Parameters
-
part | The partition ID in question. |
start_out | Buffer for storing the start address. |
size_out | Buffer for storing the size of the partition. |
- Return values
-
◆ flashrom_read()
int flashrom_read |
( |
int | offset, |
|
|
void * | buffer_out, |
|
|
int | 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 |
( |
int | offset, |
|
|
void * | buffer, |
|
|
int | 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.