From c49b9ed33027e66ef656182f098e925622795e18 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 30 Sep 2024 22:16:40 +0100 Subject: [PATCH 1/2] Update docs for newer firmware (#143) ## Description Update the "supported" SC64 firmware version. ## Motivation and Context Although the latest firmware is not "required", it is best to keep it aligned. ## How Has This Been Tested? ## Screenshots ## Types of changes - [ ] Improvement (non-breaking change that adds a new feature) - [ ] Bug fix (fixes an issue) - [ ] Breaking change (breaking change) - [ ] Documentation Improvement - [ ] 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 ## Summary by CodeRabbit - **New Features** - Updated the supported firmware version for "SummerCart64" to 2.20.0+ in error messages. - **Documentation** - Revised developer documentation to reflect the upgrade of the SC64 deployer to v2.20.0, including updated links and compatibility requirements. - Clarified instructions for using the dev container and added a workaround for USB device communication. - Expanded guidance on generating and serving documentation locally. --- .devcontainer/Dockerfile | 2 +- docs/99_developer_guide.md | 6 +++--- src/menu/views/fault.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 116f0cb9..e5a3ad30 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ FROM debian:bookworm-slim -ARG SC64_DEPLOYER_VERSION=v2.18.0 +ARG SC64_DEPLOYER_VERSION=v2.20.0 RUN apt-get update && \ apt-get upgrade -y && \ apt-get install build-essential doxygen git python3 wget -y && \ diff --git a/docs/99_developer_guide.md b/docs/99_developer_guide.md index ff6ad67c..ab148140 100644 --- a/docs/99_developer_guide.md +++ b/docs/99_developer_guide.md @@ -8,11 +8,11 @@ You can use a dev container in VSCode to ease development. ### To deploy: #### SC64 -* Download the deployer [here](https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.18.0/sc64-deployer-windows-v2.18.0.zip) +* Download the deployer [here](https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.20.0/sc64-deployer-windows-v2.20.0.zip) * Extract and place `sc64deployer.exe` in the `tools/sc64` directory. -Make sure that your firmware is compatible (currently v2.18.0+) -See: [here](https://github.com/Polprzewodnikowy/SummerCart64/blob/v2.18.0/docs/00_quick_startup_guide.md#firmware-backupupdate) +Make sure that your firmware is compatible (currently v2.20.0+) +See: [here](https://github.com/Polprzewodnikowy/SummerCart64/blob/v2.20.0/docs/00_quick_startup_guide.md#firmware-backupupdate) ##### From the devcontainer It is not currently possible to directly communicate with USB devices. diff --git a/src/menu/views/fault.c b/src/menu/views/fault.c index 7128f666..6ec767a4 100644 --- a/src/menu/views/fault.c +++ b/src/menu/views/fault.c @@ -7,7 +7,7 @@ static void draw (menu_t *menu, surface_t *d) { rdpq_clear(RGBA32(0x7F, 0x00, 0x00, 0xFF)); const char *firmware_message = ( - "Supported firmware versions:\n" + "Minimum supported firmware versions:\n" "64drive: 2.05+\n" "EverDrive-64: ???+\n" "SummerCart64: 2.17.0+" From 49ea127dd76f7a84696be212e9a187a3827c244f Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 20 Oct 2024 15:52:02 +0100 Subject: [PATCH 2/2] Integer type fixes (#145) ## Description Improve integer type under certain conditions. ## Motivation and Context When running the flags `-Wall -Wextra`. ## 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) - [ ] Documentation Improvement - [ ] 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 ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of loop variables to prevent negative overflow in various functions, enhancing stability and reliability when processing larger values. - **Refactor** - Updated loop variable types to `unsigned int` for better performance and accuracy in ROM data handling across multiple components. --- src/boot/boot.c | 2 +- src/flashcart/64drive/64drive.c | 2 +- src/flashcart/sc64/sc64.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/boot/boot.c b/src/boot/boot.c index 9aaac778..2fc0a889 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -95,7 +95,7 @@ void boot (boot_params_t *params) { io32_t *reboot_dst = SP_MEM->IMEM; size_t reboot_instructions = (size_t) (&reboot_size) / sizeof(uint32_t); - for (int i = 0; i < reboot_instructions; i++) { + for (unsigned int i = 0; i < reboot_instructions; i++) { cpu_io_write(&reboot_dst[i], reboot_src[i]); } diff --git a/src/flashcart/64drive/64drive.c b/src/flashcart/64drive/64drive.c index 0fd47bef..61af404d 100644 --- a/src/flashcart/64drive/64drive.c +++ b/src/flashcart/64drive/64drive.c @@ -99,7 +99,7 @@ static flashcart_err_t d64_load_rom (char *rom_path, flashcart_progress_callback size_t sdram_size = MiB(64); size_t chunk_size = KiB(128); - for (int offset = 0; offset < sdram_size; offset += chunk_size) { + for (unsigned int offset = 0; offset < sdram_size; offset += chunk_size) { size_t block_size = MIN(sdram_size - offset, chunk_size); if (f_read(&fil, (void *) (ROM_ADDRESS + offset), block_size, &br) != FR_OK) { f_close(&fil); diff --git a/src/flashcart/sc64/sc64.c b/src/flashcart/sc64/sc64.c index 7119a271..57bb7e73 100644 --- a/src/flashcart/sc64/sc64.c +++ b/src/flashcart/sc64/sc64.c @@ -232,7 +232,7 @@ static flashcart_err_t sc64_init (void) { { CFG_ID_ROM_EXTENDED_ENABLE, false }, }; - for (int i = 0; i < sizeof(default_config) / sizeof(default_config[0]); i++) { + for (unsigned int i = 0; i < sizeof(default_config) / sizeof(default_config[0]); i++) { if (sc64_ll_set_config(default_config[i].id, default_config[i].value) != SC64_OK) { return FLASHCART_ERR_INT; } @@ -283,7 +283,7 @@ static flashcart_err_t sc64_load_rom (char *rom_path, flashcart_progress_callbac size_t extended_size = extended_enabled ? rom_size - MiB(64) : 0; size_t chunk_size = KiB(128); - for (int offset = 0; offset < sdram_size; offset += chunk_size) { + for (unsigned int offset = 0; offset < sdram_size; offset += chunk_size) { size_t block_size = MIN(sdram_size - offset, chunk_size); if (f_read(&fil, (void *) (ROM_ADDRESS + offset), block_size, &br) != FR_OK) { f_close(&fil); @@ -445,7 +445,7 @@ static flashcart_err_t sc64_load_64dd_ipl (char *ipl_path, flashcart_progress_ca } size_t chunk_size = KiB(128); - for (int offset = 0; offset < ipl_size; offset += chunk_size) { + for (unsigned int offset = 0; offset < ipl_size; offset += chunk_size) { size_t block_size = MIN(ipl_size - offset, chunk_size); if (f_read(&fil, (void *) (IPL_ADDRESS + offset), block_size, &br) != FR_OK) { f_close(&fil); @@ -499,7 +499,7 @@ static flashcart_err_t sc64_load_64dd_disk (char *disk_path, flashcart_disk_para { CFG_ID_BUTTON_MODE, BUTTON_MODE_DD_DISK_SWAP }, }; - for (int i = 0; i < sizeof(config) / sizeof(config[0]); i++) { + for (unsigned int i = 0; i < sizeof(config) / sizeof(config[0]); i++) { if (sc64_ll_set_config(config[i].id, config[i].value) != SC64_OK) { return FLASHCART_ERR_INT; }