Skip to content

Commit

Permalink
Merge branch 'develop' into cpak-management
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion authored Dec 30, 2024
2 parents 694cd12 + f2cff4c commit e5c2fcf
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 37 deletions.
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ An open source menu for N64 flashcarts.
## Documentation
* [Getting started guide](./docs/00_getting_started_sd.md)
* [Menu controls](./docs/01_menu_controls.md)
* [Menu customizations](./docs/07_menu_customizations.md)
* [Menu customization](./docs/07_menu_customization.md)
* [Developer guide](./docs/99_developer_guide.md)

## Video showcase (as of Oct 12 2023)
Expand All @@ -53,27 +53,36 @@ These features are subject to change:

### N64 ROM autoload
To use the autoload function, while on the `N64 ROM information` display, press the `R` button on your joypad and select the `Set ROM to autoload` option. When you restart the console, it will now only load the selected ROM rather than the menu.
NOTE: to return to the menu, hold joypad `start` button whilst powering on the console.
The autoload setting is stored in `config.ini` and persists until changed. This feature may slightly increase boot time as the menu needs to check for the Start button state.
NOTE: To return to the menu, hold the joypad `Start` button while powering on the console.

### GamePak sprites
To use N64 `GamePak` sprites, place `PNG` files within the `sd:/menu/boxart/` folder.

To use N64 GamePak sprites, place PNG files within the `sd:/menu/boxart/` folder.

#### Supported sprites
These must be `PNG` files that use the following dimensions:
* Standard N64 GamePak boxart sprites: 158x112
* Japanese N64 GamePak boxart sprites: 112x158
* 64DD boxart sprites: 129x112

Supported PNG formats:
* RGB/RGBA color formats
* 8-bit color depth

They will be loaded by directories using each character (case-sensitive) of the full 4 character Game Code (as identified in the menu ROM information).
i.e. for GoldenEye NTSC USA (NGEE), this would be `sd:/menu/boxart/N/G/E/E/boxart_front.png`.
i.e. for GoldenEye PAL (NGEP), this would be `sd:/menu/boxart/N/G/E/P/boxart_front.png`.

To improve compatibility between regions (as a fallback), you may exclude the region ID (last matched directory) for GamePaks to match with 3 letter IDs instead:
i.e. for GoldenEye, this would be `sd:/menu/boxart/N/G/E/boxart_front.png`.

**Note1:** Excluding the region ID may show the wrong boxart.
**Note2:** For future support, boxart sprites should also include: `boxart_back.png`, `boxart_top.png`, `boxart_bottom.png`, `boxart_left.png`, `boxart_right.png`.
**Warning**: Excluding the region ID may show the wrong boxart.
**Note**: For future support, boxart sprites should also include:
* `boxart_back.png`
* `boxart_top.png`
* `boxart_bottom.png`
* `boxart_left.png`
* `boxart_right.png`

As a starting point, here is a link to a boxart pack following the new structure, including `boxart_front.png` and failback images:
* [Link](https://drive.google.com/file/d/1IpCmFqmGgGwKKmlRBxYObfFR9XywaC6n/view?usp=drive_link)
Expand Down Expand Up @@ -117,14 +126,14 @@ If required, you can manually adjust the file on the SD card using your computer

### ED64 - WIP - UNTESTED AND UNSUPPORTED - USE AT OWN RISK
Currently not supported, but work is in progress (See [PR's](https://github.com/Polprzewodnikowy/N64FlashcartMenu/pulls)).
NOTE: The menu may be able to load ROM's but not perform saves and may break existing ones..
**Warning**: The menu may be able to load ROMs but cannot guarantee save functionality. Existing saves may be corrupted.

#### ED64 (Vseries)
The aim is to reach feature parity with [ED64-UnofficialOS](https://github.com/n64-tools/ED64-UnofficialOS-binaries) / [ED64-OfficialOS](https://krikzz.com/pub/support/everdrive-64/v2x-v3x/os-bin/).
Download the `OS64.v64` ROM from the latest [action run - assets] and place it in the `/ED64` folder.

#### ED64 (X series)
X Series support is currently awaiting fixes, in the meantime use the official [OS](https://krikzz.com/pub/support/everdrive-64/x-series/OS/) instead.
X Series support is currently awaiting fixes. Please use the official [OS](https://krikzz.com/pub/support/everdrive-64/x-series/OS/) for now.

#### ED64 (P clone)
Download the `OS64P.v64` ROM from the latest [action run - assets] and place it in the `/ED64P` folder.
Expand Down
5 changes: 4 additions & 1 deletion docs/00_getting_started_sd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## First time setup of SD card

Using your PC, insert the SD card and ensure it is formatted for compatibility with your flashcart
### Flashcarts
Using your PC, insert the SD card and ensure it is formatted for compatibility with your flashcart.
**warning** Filenames are expected to be part of the ASCII character set. Unicode characters are not fully supported and may cause a crash screen.

#### SC64
- FAT32 and EXFAT are fully supported.
- An SD formatted with 128 kiB cluster size is recommended.
Expand Down
2 changes: 1 addition & 1 deletion docs/01_menu_controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Use the C-Up and C-Down buttons
### DD ROMs

#### Expansion Disks
To load an expansion disk (e.g. F-Zero X) browse to the N64 ROM and load it (but not start it) and then browse to the DD expansion file and press the `R` button.
To load an expansion disk (e.g. F-Zero X) browse to the N64 ROM and load it (but not start it) and then browse to the DD expansion file and press the `L` or `Z` button.

#### Disk swapping
This feature is not currently available in the menu.
Expand Down
2 changes: 1 addition & 1 deletion src/menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void menu_init (boot_params_t *boot_params) {

path_free(path);

sound_use_sfx(menu->settings.sound_enabled);
sound_use_sfx(menu->settings.soundfx_enabled);

menu->browser.directory = path_init(menu->storage_prefix, menu->settings.default_directory);
if (!directory_exists(path_get(menu->browser.directory))) {
Expand Down
6 changes: 3 additions & 3 deletions src/menu/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static settings_t init = {
.show_protected_entries = false,
.default_directory = "/",
.use_saves_folder = true,
.sound_enabled = true,
.soundfx_enabled = false,
.rom_autoload_enabled = false,
.rom_autoload_path = "",
.rom_autoload_filename = "",
Expand Down Expand Up @@ -42,7 +42,7 @@ void settings_load (settings_t *settings) {
settings->show_protected_entries = mini_get_bool(ini, "menu", "show_protected_entries", init.show_protected_entries);
settings->default_directory = strdup(mini_get_string(ini, "menu", "default_directory", init.default_directory));
settings->use_saves_folder = mini_get_bool(ini, "menu", "use_saves_folder", init.use_saves_folder);
settings->sound_enabled = mini_get_bool(ini, "menu", "sound_enabled", init.sound_enabled);
settings->soundfx_enabled = mini_get_bool(ini, "menu", "soundfx_enabled", init.soundfx_enabled);

settings->rom_autoload_enabled = mini_get_bool(ini, "menu", "autoload_rom_enabled", init.rom_autoload_enabled);
settings->rom_autoload_path = strdup(mini_get_string(ini, "autoload", "rom_path", init.rom_autoload_path));
Expand All @@ -62,7 +62,7 @@ void settings_save (settings_t *settings) {
mini_set_bool(ini, "menu", "show_protected_entries", settings->show_protected_entries);
mini_set_string(ini, "menu", "default_directory", settings->default_directory);
mini_set_bool(ini, "menu", "use_saves_folder", settings->use_saves_folder);
mini_set_bool(ini, "menu", "sound_enabled", settings->sound_enabled);
mini_set_bool(ini, "menu", "soundfx_enabled", settings->soundfx_enabled);
mini_set_bool(ini, "menu", "autoload_rom_enabled", settings->rom_autoload_enabled);
mini_set_string(ini, "autoload", "rom_path", settings->rom_autoload_path);
mini_set_string(ini, "autoload", "rom_filename", settings->rom_autoload_filename);
Expand Down
2 changes: 1 addition & 1 deletion src/menu/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef struct {
bool bgm_enabled;

/** @brief Enable Sounds */
bool sound_enabled;
bool soundfx_enabled;

/** @brief Enable rumble feedback */
bool rumble_enabled;
Expand Down
10 changes: 5 additions & 5 deletions src/menu/views/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ static void set_menu_next_mode (menu_t *menu, void *arg) {

static component_context_menu_t settings_context_menu = {
.list = {
{ .text = "Edit settings", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_SETTINGS_EDITOR) },
{ .text = "Show system info", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_SYSTEM_INFO) },
{ .text = "Show credits", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_CREDITS) },
{ .text = "Adjust RTC", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_RTC) },
{ .text = "Show cart info", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_FLASHCART) },
{ .text = "Menu settings", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_SETTINGS_EDITOR) },
{ .text = "Time (RTC) settings", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_RTC) },
{ .text = "Menu information", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_CREDITS) },
{ .text = "Flashcart information", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_FLASHCART) },
{ .text = "N64 information", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_SYSTEM_INFO) },
{ .text = "CPak Management", .action = set_menu_next_mode, .arg = (void *) (MENU_MODE_JOYPAD_CPAK) },
COMPONENT_CONTEXT_MENU_LIST_END,
}
Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/credits.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void draw (menu_t *menu, surface_t *d) {
" Robin Jones / NetworkFusion\n"
" Mateusz Faderewski / Polprzewodnikowy\n"
"Credits:\n"
" N64Brew / libdragon contributors\n"
" N64Brew / libDragon contributors\n"
"\n"
"OSS software used:\n"
" libdragon (UNLICENSE License)\n"
Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void draw (menu_t *menu, surface_t *d) {

ui_components_actions_bar_text_draw(
ALIGN_LEFT, VALIGN_TOP,
"A: Change\n"
"A: Adjust time\n"
"B: Back"
);
}
Expand Down
17 changes: 8 additions & 9 deletions src/menu/views/settings_editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ static void set_use_saves_folder_type (menu_t *menu, void *arg) {
settings_save(&menu->settings);
}

static void set_sound_enabled_type (menu_t *menu, void *arg) {
menu->settings.sound_enabled = (bool)(uintptr_t)(arg);
sound_use_sfx(menu->settings.sound_enabled);
static void set_soundfx_enabled_type (menu_t *menu, void *arg) {
menu->settings.soundfx_enabled = (bool)(uintptr_t)(arg);
sound_use_sfx(menu->settings.soundfx_enabled);
settings_save(&menu->settings);
}

Expand Down Expand Up @@ -58,9 +58,9 @@ static component_context_menu_t set_protected_entries_type_context_menu = { .lis
COMPONENT_CONTEXT_MENU_LIST_END,
}};

static component_context_menu_t set_sound_enabled_type_context_menu = { .list = {
{.text = "On", .action = set_sound_enabled_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_sound_enabled_type, .arg = (void *)(uintptr_t)(false) },
static component_context_menu_t set_soundfx_enabled_type_context_menu = { .list = {
{.text = "On", .action = set_soundfx_enabled_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_soundfx_enabled_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

Expand Down Expand Up @@ -92,7 +92,7 @@ static component_context_menu_t set_rumble_enabled_type_context_menu = { .list =

static component_context_menu_t options_context_menu = { .list = {
{ .text = "Show Hidden Files", .submenu = &set_protected_entries_type_context_menu },
{ .text = "Sound Effects", .submenu = &set_sound_enabled_type_context_menu },
{ .text = "Sound Effects", .submenu = &set_soundfx_enabled_type_context_menu },
{ .text = "Use Saves Folder", .submenu = &set_use_saves_folder_type_context_menu },
#ifdef BETA_SETTINGS
{ .text = "PAL60 Mode", .submenu = &set_pal60_type_context_menu },
Expand Down Expand Up @@ -154,7 +154,7 @@ static void draw (menu_t *menu, surface_t *d) {
format_switch(menu->settings.rom_autoload_enabled),
format_switch(menu->settings.show_protected_entries),
format_switch(menu->settings.use_saves_folder),
format_switch(menu->settings.sound_enabled)
format_switch(menu->settings.soundfx_enabled)
#ifdef BETA_SETTINGS
,
format_switch(menu->settings.pal60_enabled),
Expand All @@ -177,7 +177,6 @@ static void draw (menu_t *menu, surface_t *d) {


void view_settings_init (menu_t *menu) {

ui_components_context_menu_init(&options_context_menu);

}
Expand Down
11 changes: 6 additions & 5 deletions src/menu/views/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,21 @@ static void draw (menu_t *menu, surface_t *d) {
ALIGN_LEFT, VALIGN_TOP,
"\n"
"\n"
"Current date & time: %s"
"\n"
"Expansion PAK is %sinserted\n"
"\n"
"Joypad 1 is %sconnected %s\n"
"Joypad 2 is %sconnected %s\n"
"Joypad 3 is %sconnected %s\n"
"Joypad 4 is %sconnected %s\n",
menu->current_time >= 0 ? ctime(&menu->current_time) : "Unknown",
"Joypad 4 is %sconnected %s\n"
"\n"
"\n"
"Physical Disk Drive attached: %s\n",
is_memory_expanded() ? "" : "not ",
(joypad[0]) ? "" : "not ", format_accessory(0),
(joypad[1]) ? "" : "not ", format_accessory(1),
(joypad[2]) ? "" : "not ", format_accessory(2),
(joypad[3]) ? "" : "not ", format_accessory(3)
(joypad[3]) ? "" : "not ", format_accessory(3),
"Unknown" // Fixme: Implement disk drive detection
);

ui_components_actions_bar_text_draw(
Expand Down

0 comments on commit e5c2fcf

Please sign in to comment.