Merge branch 'develop' into cpak-management

This commit is contained in:
Robin Jones 2024-08-08 13:54:45 +01:00 committed by GitHub
commit 83367c28b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 66 additions and 17 deletions

View File

@ -77,7 +77,8 @@ jobs:
with: with:
name: Rolling release name: Rolling release
body: Rolling release built from latest commit on `main` branch. body: Rolling release built from latest commit on `main` branch.
tag_name: rolling-release tag_name: 'rolling_release'
make_latest: true
files: | files: |
./output/N64FlashcartMenu.n64 ./output/N64FlashcartMenu.n64
./output/menu.bin ./output/menu.bin
@ -90,9 +91,10 @@ jobs:
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
if: github.ref == 'refs/heads/develop' if: github.ref == 'refs/heads/develop'
with: with:
name: 'Rolling dev release-V${{ github.run_id }}' name: 'Rolling pre-release'
body: Rolling dev prerelease built from latest commit on `develop` branch. body: Experimental pre-release built from latest commit on `develop` branch.
tag_name: prerelease-dev target_commitish: develop
tag_name: 'rolling_pre-release'
prerelease: true prerelease: true
files: | files: |
./output/N64FlashcartMenu.n64 ./output/N64FlashcartMenu.n64

View File

@ -50,11 +50,21 @@ An open source menu for N64 flashcarts.
These features are subject to change: These features are subject to change:
### ROM Boxart ### 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. 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 2 letters, this would be `GE.png`.
i.e. for GoldenEye 3 letters, this would be `NGE.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 ### Menu Settings

@ -1 +1 @@
Subproject commit e2e2dc063add29e9d11f55ae3fbeccc189fb2ad6 Subproject commit 9bae49994bf1c796f9939ea1aa7c133813b9053f

View File

@ -31,7 +31,7 @@ component_boxart_t *component_boxart_init (const char *storage_prefix, char *gam
sprintf(file_name, "%.3s.png", game_code); sprintf(file_name, "%.3s.png", game_code);
path_push(path, file_name); 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); path_free(path);
return b; 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 // TODO: This is bad, we should only check for 3 letter codes
sprintf(file_name, "%.2s.png", game_code + 1); sprintf(file_name, "%.2s.png", game_code + 1);
path_push(path, file_name); 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); path_free(path);
return b; return b;
} }
@ -65,15 +65,20 @@ void component_boxart_free (component_boxart_t *b) {
} }
void component_boxart_draw (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_mode_push();
rdpq_set_mode_copy(false); rdpq_set_mode_copy(false);
rdpq_tex_blit( if (b->image->height == BOXART_HEIGHT_MAX) {
b->image, box_x = BOXART_X_JP;
BOXART_X, box_y = BOXART_Y_JP;
BOXART_Y, } else if (b->image->width == BOXART_WIDTH_DD && b->image->height == BOXART_HEIGHT_DD) {
NULL box_x = BOXART_X_DD;
); box_y = BOXART_Y_DD;
}
rdpq_tex_blit(b->image, box_x, box_y, NULL);
rdpq_mode_pop(); rdpq_mode_pop();
} else { } else {
component_box_draw( component_box_draw(
@ -84,4 +89,4 @@ void component_boxart_draw (component_boxart_t *b) {
BOXART_LOADING_COLOR BOXART_LOADING_COLOR
); );
} }
} }

View File

@ -73,10 +73,30 @@
#define BOXART_WIDTH (158) #define BOXART_WIDTH (158)
/** @brief The boxart picture height. */ /** @brief The boxart picture height. */
#define BOXART_HEIGHT (112) #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. */ /** @brief The box art position on the X axis. */
#define BOXART_X (VISIBLE_AREA_X1 - BOXART_WIDTH - 24) #define BOXART_X (VISIBLE_AREA_X1 - BOXART_WIDTH - 24)
/** @brief The box art position on the Y axis. */ /** @brief The box art position on the Y axis. */
#define BOXART_Y (LAYOUT_ACTIONS_SEPARATOR_Y - BOXART_HEIGHT - 24) #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. */ /** @brief The scroll bar width. */
#define LIST_SCROLLBAR_WIDTH (12) #define LIST_SCROLLBAR_WIDTH (12)

View File

@ -7,6 +7,7 @@
static bool load_pending; static bool load_pending;
static bool load_rom; static bool load_rom;
static component_boxart_t *boxart;
static char *convert_error_message (disk_err_t err) { 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" "R: Load with ROM"
); );
} }
component_boxart_draw(boxart);
} }
rdpq_detach_show(); 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) { void view_load_disk_init (menu_t *menu) {
if (menu->load.disk_path) { if (menu->load.disk_path) {
@ -163,6 +169,8 @@ void view_load_disk_init (menu_t *menu) {
if (err != DISK_OK) { if (err != DISK_OK) {
menu_show_error(menu, convert_error_message(err)); 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) { 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_pending = false;
load(menu); load(menu);
} }
if (menu->next_mode != MENU_MODE_LOAD_DISK) {
deinit();
}
} }