Skip to content

Commit

Permalink
Merge branch 'develop' into rtc-adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion authored Oct 25, 2024
2 parents fe53110 + f65b345 commit f61813f
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
- uses: actions/checkout@v4

- name: Run Doxygen
uses: mattnotmitt/doxygen-action@1.9.5
uses: mattnotmitt/doxygen-action@v1
with:
doxyfile-path: './Doxyfile'

Expand Down
1 change: 1 addition & 0 deletions src/flashcart/64drive/64drive.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static bool d64_has_feature (flashcart_features_t feature) {
case FLASHCART_FEATURE_USB: return true;
case FLASHCART_FEATURE_AUTO_CIC: return true;
case FLASHCART_FEATURE_AUTO_REGION: return true;
case FLASHCART_FEATURE_SAVE_WRITEBACK: return true;
default: return false;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/flashcart/flashcart.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ typedef enum {
FLASHCART_FEATURE_USB,
FLASHCART_FEATURE_AUTO_CIC,
FLASHCART_FEATURE_AUTO_REGION,
FLASHCART_FEATURE_DIAGNOSTIC_DATA,
FLASHCART_FEATURE_BIOS_UPDATE_FROM_MENU,
FLASHCART_FEATURE_SAVE_WRITEBACK
} flashcart_features_t;

/** @brief Flashcart save type enumeration */
Expand Down
2 changes: 2 additions & 0 deletions src/flashcart/sc64/sc64.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ static bool sc64_has_feature (flashcart_features_t feature) {
case FLASHCART_FEATURE_USB: return true;
case FLASHCART_FEATURE_AUTO_CIC: return true;
case FLASHCART_FEATURE_AUTO_REGION: return true;
case FLASHCART_FEATURE_DIAGNOSTIC_DATA: return true;
case FLASHCART_FEATURE_SAVE_WRITEBACK: return true;
default: return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/miniz
Submodule miniz updated 4 files
+31 −23 CMakeLists.txt
+5 −4 miniz_zip.c
+2 −1 miniz_zip.h
+31 −1 tests/main.cpp
5 changes: 4 additions & 1 deletion src/menu/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ static bool sfx_enabled = false;

static void sound_reconfigure (int frequency) {
if ((frequency > 0) && (audio_get_frequency() != frequency)) {
sound_deinit();
if (sound_initialized) {
mixer_close();
audio_close();
}
audio_init(frequency, NUM_BUFFERS);
mixer_init(NUM_CHANNELS);
mp3player_mixer_init();
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 @@ -12,8 +12,8 @@

static void process (menu_t *menu) {
if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/menu/views/file_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ static char *format_file_type (char *name, bool is_directory) {

static void process (menu_t *menu) {
if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down Expand Up @@ -84,7 +84,7 @@ static void draw (menu_t *menu, surface_t *d) {
S_ISDIR(st.st_mode) ? "Directory" : "File",
st.st_mode & S_IWUSR ? "" : "(Read only)",
format_file_type(menu->browser.entry->name, S_ISDIR(st.st_mode)),
ctime(&st.st_mtim.tv_sec)
ctime(&st.st_mtime)
);

component_actions_bar_text_draw(
Expand Down
51 changes: 36 additions & 15 deletions src/menu/views/flashcart_info.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
#include "views.h"
#include "../sound.h"
#include <libcart/cart.h>


static inline const char *format_boolean_type (bool bool_value) {
return bool_value ? "Supported" : "Unsupported";
}

static const char *format_cart_type () {
switch (cart_type) {
case CART_CI:
return "64drive";

case CART_EDX:
return "Series X EverDrive-64";

case CART_ED:
return "Series V EverDrive-64";

case CART_SC:
return "SummerCart64";

default: // Probably emulator
return "Emulator?";
}
}

static void process (menu_t *menu) {
if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down Expand Up @@ -39,23 +59,24 @@ static void draw (menu_t *menu, surface_t *d) {
" Virtual 64DD: %s.\n"
" Real Time Clock: %s.\n"
" USB Debugging: %s.\n"
" CIC Detection: %s.\n"
" Automatic CIC: %s.\n"
" Region Detection: %s.\n"
" Save Writeback: %s.\n"
" Update from menu: %s.\n"
"\n\n",
"SummerCart64",
"V?.?.?",
format_boolean_type(true),
format_boolean_type(true),
format_boolean_type(true),
format_boolean_type(true),
format_boolean_type(true)
);

// FIXME: Display:
// * cart_type
// * Firmware version
// * supported features (flashcart_features_t)
format_cart_type(),
"Not Available", // TODO get cart firmware version(s).
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_64DD)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_RTC)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_USB)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_AUTO_CIC)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_AUTO_REGION)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_SAVE_WRITEBACK)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_BIOS_UPDATE_FROM_MENU))

//TODO: display the battery and temperature information (if available).
//format_diagnostic_data(flashcart_has_feature(FLASHCART_FEATURE_DIAGNOSTIC_DATA))
);

component_actions_bar_text_draw(
ALIGN_LEFT, VALIGN_TOP,
Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/load_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ static void process (menu_t *menu) {
load_rom = true;
sound_play_effect(SFX_SETTING);
} else if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/load_emulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ static void process (menu_t *menu) {
if (menu->actions.enter) {
load_pending = true;
} else if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/load_rom.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ static void process (menu_t *menu) {
if (menu->actions.enter) {
load_pending = true;
} else if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
} else if (menu->actions.options) {
component_context_menu_show(&options_context_menu);
sound_play_effect(SFX_SETTING);
Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/music_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ static void process (menu_t *menu) {
if (err != MP3PLAYER_OK) {
menu_show_error(menu, convert_error_message(err));
} else if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
} else if (menu->actions.enter) {
err = mp3player_toggle();
if (err != MP3PLAYER_OK) {
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 @@ -70,8 +70,8 @@ void adjust_rtc_time( struct tm *t, int incr )
static void process (menu_t *menu) {
if (menu->actions.back) {
is_editing_mode = false;
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
else if (menu->actions.enter) { // FIXME: rtc_is_writable()
is_editing_mode = true;
Expand Down
7 changes: 4 additions & 3 deletions src/menu/views/settings_editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ static void process (menu_t *menu) {
component_context_menu_show(&options_context_menu);
sound_play_effect(SFX_SETTING);
} else if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down Expand Up @@ -145,8 +145,9 @@ static void draw (menu_t *menu, surface_t *d) {
" Background Music : %s\n"
" Rumble Feedback : %s\n"
#endif
"Note: Certain settings have the following caveats:\n\n"
"* Requires a flashcart reboot.\n",
"\n\n"
"Note: Certain settings have the following caveats:\n"
"* Requires rebooting the N64 Console.\n",
menu->settings.default_directory,
format_switch(menu->settings.pal60_enabled),
format_switch(menu->settings.show_protected_entries),
Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ static void process (menu_t *menu) {
}

if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/menu/views/text_viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ static void perform_vertical_scroll (int lines) {

static void process (menu_t *menu) {
if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
sound_play_effect(SFX_EXIT);
menu->next_mode = MENU_MODE_BROWSER;
} else if (text) {
if (menu->actions.go_up) {
perform_vertical_scroll(menu->actions.go_fast ? -10 : -1);
Expand Down

0 comments on commit f61813f

Please sign in to comment.