From a8830c01aba8b448c737bb550831836c6b666e9c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 5 Aug 2024 00:27:43 +0100 Subject: [PATCH 1/4] Improve dev release tag --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e567d6ae..224f2063 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,8 @@ jobs: with: name: Rolling release body: Rolling release built from latest commit on `main` branch. - tag_name: rolling-release + tag_name: 'rolling_release' + make_latest: true files: | ./output/N64FlashcartMenu.n64 ./output/menu.bin @@ -90,9 +91,10 @@ jobs: uses: softprops/action-gh-release@v2 if: github.ref == 'refs/heads/develop' with: - name: 'Rolling dev release-V${{ github.run_id }}' - body: Rolling dev prerelease built from latest commit on `develop` branch. - tag_name: prerelease-dev + name: 'Rolling pre-release' + body: Experimental pre-release built from latest commit on `develop` branch. + target_commitish: develop + tag_name: 'pre-release_V${{ github.run_number }}' prerelease: true files: | ./output/N64FlashcartMenu.n64 From 68cab6d40e9c803f897b75ff1575af1b9b88afff Mon Sep 17 00:00:00 2001 From: Suprapote <111246491+Suprapote@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:20:41 +0200 Subject: [PATCH 2/4] 64dd & Japanese covers (#126) ## Description This adds in the 64DD disk load menu to visualize the game box. I also created a European and 64DD boxart packs ## Motivation and Context Improves boxart image support. ## How Has This Been Tested? Tested on a local SC64 ## 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 ## Summary by CodeRabbit - **New Features** - Enhanced instructions in the README for boxart dimensions and resources. - Improved handling of box art rendering for various formats in the menu. - New functionality for displaying box art during disk loading in the menu interface, including resource management for cleanup. - **Bug Fixes** - Resolved issues with rendering dimensions for specific types of box art, improving visual consistency. - **Documentation** - Updated README to clarify the boxart requirements and provide multiple download links for different regions. --------- Co-authored-by: Robin Jones --- README.md | 14 ++++++++++++-- src/menu/components/boxart.c | 25 +++++++++++++++---------- src/menu/components/constants.h | 20 ++++++++++++++++++++ src/menu/views/load_disk.c | 12 ++++++++++++ 4 files changed, 59 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1f55ace3..703804cc 100644 --- a/README.md +++ b/README.md @@ -50,11 +50,21 @@ An open source menu for N64 flashcarts. These features are subject to change: ### ROM Boxart -To use boxart, you need to place png files of size 158x112 in the folder `/menu/boxart` on the SD card. +To use boxart, place PNG files in the `/menu/boxart` folder on the SD card with the following dimensions: +* Standard covers: 158x112 +* 64DD covers: 129x112 +* Japanese covers: 112x158 + Each file must be named according to the 2 letter ROM ID, or 3 letter ROM ID including media type. i.e. for GoldenEye 2 letters, this would be `GE.png`. i.e. for GoldenEye 3 letters, this would be `NGE.png`. -A known set of PNG files using 2 letter ID's can be downloaded [here](https://mega.nz/file/6cNGwSqI#8X5ukb65n3YMlGaUtSOGXkKo9HxVnnMOgqn94Epcr7w). +You can download these boxart packs: + +[American Boxart](https://mega.nz/file/6cNGwSqI#8X5ukb65n3YMlGaUtSOGXkKo9HxVnnMOgqn94Epcr7w) + +[European Boxart](https://mega.nz/file/O7AjDbRJ#VnVU10dq8HQvBUQptppI6PAcQMb8-Zembqav8WtAQ_M) + +[64DD Boxart](https://mega.nz/file/O3JzwD7B#BYl1aV-pbrJ-MxWUbM_K0yGVIRbmSoxJJZqQInRzZyM) ### Menu Settings diff --git a/src/menu/components/boxart.c b/src/menu/components/boxart.c index 54121b6e..f50294ee 100644 --- a/src/menu/components/boxart.c +++ b/src/menu/components/boxart.c @@ -31,7 +31,7 @@ component_boxart_t *component_boxart_init (const char *storage_prefix, char *gam sprintf(file_name, "%.3s.png", game_code); path_push(path, file_name); - if (png_decoder_start(path_get(path), BOXART_WIDTH, BOXART_HEIGHT, png_decoder_callback, b) == PNG_OK) { + if (png_decoder_start(path_get(path), BOXART_WIDTH_MAX, BOXART_HEIGHT_MAX, png_decoder_callback, b) == PNG_OK) { path_free(path); return b; } @@ -40,7 +40,7 @@ component_boxart_t *component_boxart_init (const char *storage_prefix, char *gam // TODO: This is bad, we should only check for 3 letter codes sprintf(file_name, "%.2s.png", game_code + 1); path_push(path, file_name); - if (png_decoder_start(path_get(path), BOXART_WIDTH, BOXART_HEIGHT, png_decoder_callback, b) == PNG_OK) { + if (png_decoder_start(path_get(path), BOXART_WIDTH_MAX, BOXART_HEIGHT_MAX, png_decoder_callback, b) == PNG_OK) { path_free(path); return b; } @@ -65,15 +65,20 @@ void component_boxart_free (component_boxart_t *b) { } void component_boxart_draw (component_boxart_t *b) { - if (b && b->image && b->image->width == BOXART_WIDTH && b->image->height == BOXART_HEIGHT) { + int box_x = BOXART_X; + int box_y = BOXART_Y; + + if (b && b->image && b->image->width <= BOXART_WIDTH_MAX && b->image->height <= BOXART_HEIGHT_MAX) { rdpq_mode_push(); rdpq_set_mode_copy(false); - rdpq_tex_blit( - b->image, - BOXART_X, - BOXART_Y, - NULL - ); + if (b->image->height == BOXART_HEIGHT_MAX) { + box_x = BOXART_X_JP; + box_y = BOXART_Y_JP; + } else if (b->image->width == BOXART_WIDTH_DD && b->image->height == BOXART_HEIGHT_DD) { + box_x = BOXART_X_DD; + box_y = BOXART_Y_DD; + } + rdpq_tex_blit(b->image, box_x, box_y, NULL); rdpq_mode_pop(); } else { component_box_draw( @@ -84,4 +89,4 @@ void component_boxart_draw (component_boxart_t *b) { BOXART_LOADING_COLOR ); } -} +} \ No newline at end of file diff --git a/src/menu/components/constants.h b/src/menu/components/constants.h index e4d3eb51..c468a327 100644 --- a/src/menu/components/constants.h +++ b/src/menu/components/constants.h @@ -73,10 +73,30 @@ #define BOXART_WIDTH (158) /** @brief The boxart picture height. */ #define BOXART_HEIGHT (112) + +/** @brief The boxart picture width (64DD). */ +#define BOXART_WIDTH_DD (129) +/** @brief The boxart picture height. */ +#define BOXART_HEIGHT_DD (112) + +/** @brief The boxart picture maximum width. */ +#define BOXART_WIDTH_MAX (158) +/** @brief The boxart picture maximum height. */ +#define BOXART_HEIGHT_MAX (158) + /** @brief The box art position on the X axis. */ #define BOXART_X (VISIBLE_AREA_X1 - BOXART_WIDTH - 24) /** @brief The box art position on the Y axis. */ #define BOXART_Y (LAYOUT_ACTIONS_SEPARATOR_Y - BOXART_HEIGHT - 24) +/** @brief The box art position on the X axis for japanese caratules.*/ +#define BOXART_X_JP (VISIBLE_AREA_X1 - BOXART_WIDTH_MAX + 21) +/** @brief The box art position on the Y axis for japanese caratules. */ +#define BOXART_Y_JP (LAYOUT_ACTIONS_SEPARATOR_Y - BOXART_HEIGHT_MAX - 24) + +/** @brief The box art position on the X axis for 64DD caratules.*/ +#define BOXART_X_DD (VISIBLE_AREA_X1 - BOXART_WIDTH_DD - 23) +/** @brief The box art position on the Y axis for 64DD caratules. */ +#define BOXART_Y_DD (LAYOUT_ACTIONS_SEPARATOR_Y - BOXART_HEIGHT_DD - 24) /** @brief The scroll bar width. */ #define LIST_SCROLLBAR_WIDTH (12) diff --git a/src/menu/views/load_disk.c b/src/menu/views/load_disk.c index 983d052a..0165bdc9 100644 --- a/src/menu/views/load_disk.c +++ b/src/menu/views/load_disk.c @@ -7,6 +7,7 @@ static bool load_pending; static bool load_rom; +static component_boxart_t *boxart; static char *convert_error_message (disk_err_t err) { @@ -92,6 +93,8 @@ static void draw (menu_t *menu, surface_t *d) { "R: Load with ROM" ); } + + component_boxart_draw(boxart); } rdpq_detach_show(); @@ -148,6 +151,9 @@ static void load (menu_t *menu) { } } +static void deinit (void) { + component_boxart_free(boxart); +} void view_load_disk_init (menu_t *menu) { if (menu->load.disk_path) { @@ -163,6 +169,8 @@ void view_load_disk_init (menu_t *menu) { if (err != DISK_OK) { menu_show_error(menu, convert_error_message(err)); } + + boxart = component_boxart_init(menu->storage_prefix, menu->load.disk_info.id); } void view_load_disk_display (menu_t *menu, surface_t *display) { @@ -174,4 +182,8 @@ void view_load_disk_display (menu_t *menu, surface_t *display) { load_pending = false; load(menu); } + + if (menu->next_mode != MENU_MODE_LOAD_DISK) { + deinit(); + } } From 3fb4dc439f678e85d3f4dffc09035755f9e89a63 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 6 Aug 2024 13:41:19 +0100 Subject: [PATCH 3/4] Remove individual tag It needs more thought. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 224f2063..b7da2151 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: name: 'Rolling pre-release' body: Experimental pre-release built from latest commit on `develop` branch. target_commitish: develop - tag_name: 'pre-release_V${{ github.run_number }}' + tag_name: 'rolling_pre-release' prerelease: true files: | ./output/N64FlashcartMenu.n64 From dfcc2d0ec4ee39f0b8bbe1e66ea1096b9584590d Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 6 Aug 2024 15:48:00 +0100 Subject: [PATCH 4/4] Update libdragon submodule (#133) ## Description Update libdragon submodule. ## Motivation and Context Keeps it up-to-date. ## How Has This Been Tested? Tested locally on SC64, no regressions witnessed. ## 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 - **Chores** - Updated the underlying subproject version for potential enhancements and bug fixes. --- libdragon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdragon b/libdragon index e2e2dc06..9bae4999 160000 --- a/libdragon +++ b/libdragon @@ -1 +1 @@ -Subproject commit e2e2dc063add29e9d11f55ae3fbeccc189fb2ad6 +Subproject commit 9bae49994bf1c796f9939ea1aa7c133813b9053f