From cc46a3b9fb5ecc8223e8065690d2e8796a0fbadd Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Wed, 17 Jan 2024 14:51:10 +0000 Subject: [PATCH] Add USB feature for flashcart (#85) ## Description Adds a feature to the flashcart to determine whether USB is supported. ## Motivation and Context Some flashcarts (ED64 X5, V2.5, V2.0, V1.0 & ED64P ) do not support it. ## How Has This Been Tested? ## Screenshots ## Types of changes - [x] Improvement (non-breaking change that adds a new feature) - [ ] Bug fix (fixes an issue) - [ ] Breaking change (breaking change) - [ ] Config and build (change in the configuration and build system, has no impact on code or features) ## Checklist: - [ ] My code follows the code style of this project. - [ ] 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. Signed-off-by: GITHUB_USER Co-authored-by: Mateusz Faderewski --- src/flashcart/64drive/64drive.c | 1 + src/flashcart/flashcart.h | 1 + src/flashcart/sc64/sc64.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/flashcart/64drive/64drive.c b/src/flashcart/64drive/64drive.c index bf0094c0..9b0b8b08 100644 --- a/src/flashcart/64drive/64drive.c +++ b/src/flashcart/64drive/64drive.c @@ -74,6 +74,7 @@ static bool d64_has_feature (flashcart_features_t feature) { switch (feature) { case FLASHCART_FEATURE_64DD: return false; case FLASHCART_FEATURE_RTC: return true; + case FLASHCART_FEATURE_USB: return true; default: return false; } } diff --git a/src/flashcart/flashcart.h b/src/flashcart/flashcart.h index 0adb56e3..001516bb 100644 --- a/src/flashcart/flashcart.h +++ b/src/flashcart/flashcart.h @@ -28,6 +28,7 @@ typedef enum { typedef enum { FLASHCART_FEATURE_64DD, FLASHCART_FEATURE_RTC, + FLASHCART_FEATURE_USB, } flashcart_features_t; /** @brief Flashcart save type enumeration */ diff --git a/src/flashcart/sc64/sc64.c b/src/flashcart/sc64/sc64.c index 895b6d5d..b7febf16 100644 --- a/src/flashcart/sc64/sc64.c +++ b/src/flashcart/sc64/sc64.c @@ -261,6 +261,7 @@ static bool sc64_has_feature (flashcart_features_t feature) { switch (feature) { case FLASHCART_FEATURE_64DD: return true; case FLASHCART_FEATURE_RTC: return true; + case FLASHCART_FEATURE_USB: return true; default: return false; } }