mirror of
https://github.com/Polprzewodnikowy/N64FlashcartMenu.git
synced 2025-01-26 00:31:14 +01:00
Merge branch 'develop' into cpak-management
This commit is contained in:
commit
83367c28b5
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@ -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: 'rolling_pre-release'
|
||||
prerelease: true
|
||||
files: |
|
||||
./output/N64FlashcartMenu.n64
|
||||
|
14
README.md
14
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
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit e2e2dc063add29e9d11f55ae3fbeccc189fb2ad6
|
||||
Subproject commit 9bae49994bf1c796f9939ea1aa7c133813b9053f
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user