N64FlashcartMenu/src/menu/disk_info.h
Mateusz Faderewski 3becd1ff59
Use stdio calls for file/directory interaction instead of fatfs (#95)
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
This PR changes most of the calls to the fatfs lib with the standard C
ones.
Additionally, there's couple of changes required to adapt to new
interface and several bug fixes.
As a bonus menu can now be run in ares emulator and on the iQue player,
adapting to the available storage options - DragonFS in the ROM and iQue
flash modules (bbfs).

## Motivation and Context
<!--- What does this sample do? What problem does it solve? -->
<!--- If it fixes/closes/resolves an open issue, please link to the
issue here -->
To make it easier to use storage medium other than SD cards on platforms
other than N64 with flashcart.

## How Has This Been Tested?
<!-- (if applicable) -->
<!--- Please describe in detail how you tested your sample/changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
SummerCart64 flashcart and ares emulator

## Screenshots
<!-- (if appropriate): -->
N/A

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Improvement (non-breaking change that adds a new feature)
- [x] Bug fix (fixes an issue)
- [x] Breaking change (breaking change)
- [x] Config and build (change in the configuration and build system,
has no impact on code or features)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

<!--- It would be nice if you could sign off your contribution by
replacing the name with your GitHub user name and GitHub email contact.
-->
Signed-off-by: Polprzewodnikowy <sc@mateuszfaderewski.pl>
2024-04-24 02:45:09 +02:00

59 lines
977 B
C

/**
* @file disk_info.h
* @brief 64DD disk information
* @ingroup menu
*/
#ifndef DISK_INFO_H__
#define DISK_INFO_H__
#include <stdbool.h>
#include <stdint.h>
#include "path.h"
/** @brief Disk state enumeration. */
typedef enum {
DISK_OK,
DISK_ERR_IO,
DISK_ERR_NO_FILE,
DISK_ERR_INVALID,
} disk_err_t;
/** @brief Disk region enumeration. */
typedef enum {
DISK_REGION_DEVELOPMENT,
DISK_REGION_JAPANESE,
DISK_REGION_USA,
} disk_region_t;
/** @brief Disk type enumeration. */
typedef enum {
DISK_TYPE_0,
DISK_TYPE_1,
DISK_TYPE_2,
DISK_TYPE_3,
DISK_TYPE_4,
DISK_TYPE_5,
DISK_TYPE_6,
} disk_type_t;
/** @brief Disk Information Structure. */
typedef struct {
disk_region_t region;
disk_type_t disk_type;
char id[4];
uint8_t version;
bool bad_system_area_lbas[24];
uint8_t defect_tracks[16][12];
} disk_info_t;
disk_err_t disk_info_load (path_t *path, disk_info_t *disk_info);
#endif