Merge branch 'main' into ed64-basic

This commit is contained in:
Robin Jones 2023-12-22 20:55:50 +00:00 committed by GitHub
commit 321d1e0473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 102 additions and 23 deletions

View File

@ -1,14 +1,15 @@
FROM debian:bookworm-slim FROM debian:bookworm-slim
ARG SC64_DEPLOYER_VERSION=v2.18.0
RUN apt-get update && \ RUN apt-get update && \
apt-get upgrade -y && \ apt-get upgrade -y && \
apt-get install build-essential doxygen git python3 wget -y && \ apt-get install build-essential doxygen git python3 wget -y && \
wget https://github.com/DragonMinded/libdragon/releases/download/toolchain-continuous-prerelease/gcc-toolchain-mips64-x86_64.deb && \ wget https://github.com/DragonMinded/libdragon/releases/download/toolchain-continuous-prerelease/gcc-toolchain-mips64-x86_64.deb && \
dpkg -i gcc-toolchain-mips64-x86_64.deb && \ dpkg -i gcc-toolchain-mips64-x86_64.deb && \
rm gcc-toolchain-mips64-x86_64.deb && \ rm gcc-toolchain-mips64-x86_64.deb && \
wget https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.17.0/sc64-deployer-linux-v2.17.0.tar.gz && \ wget https://github.com/Polprzewodnikowy/SummerCart64/releases/download/$SC64_DEPLOYER_VERSION/sc64-deployer-linux-$SC64_DEPLOYER_VERSION.tar.gz && \
tar -xf sc64-deployer-linux-v2.17.0.tar.gz -C /usr/local/bin && \ tar -xf sc64-deployer-linux-$SC64_DEPLOYER_VERSION.tar.gz -C /usr/local/bin && \
rm sc64-deployer-linux-v2.17.0.tar.gz && \ rm sc64-deployer-linux-$SC64_DEPLOYER_VERSION.tar.gz && \
git config --global --add safe.directory "*" && \ git config --global --add safe.directory "*" && \
SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" && \ SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" && \
echo "$SNIPPET" >> "/root/.bashrc" echo "$SNIPPET" >> "/root/.bashrc"

View File

@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
@ -37,7 +37,7 @@ jobs:
FLAGS: -DNDEBUG FLAGS: -DNDEBUG
- name: Upload artifact (Standard ROM) - name: Upload artifact (Standard ROM)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: N64FlashcartMenu name: N64FlashcartMenu
path: | path: |
@ -45,25 +45,25 @@ jobs:
./build/N64FlashcartMenu.elf ./build/N64FlashcartMenu.elf
- name: Upload artifact (64drive version) - name: Upload artifact (64drive version)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: 64drive name: 64drive
path: ./output/menu.bin path: ./output/menu.bin
- name: Upload artifact (ED64 version) - name: Upload artifact (ED64 version)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ED64 name: ED64
path: ./output/OS64.v64 path: ./output/OS64.v64
- name: Upload artifact (ED64P version) - name: Upload artifact (ED64P version)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ED64P name: ED64P
path: ./output/OS64P.v64 path: ./output/OS64P.v64
- name: Upload artifact (SC64 version) - name: Upload artifact (SC64 version)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: SC64 name: SC64
path: ./output/sc64menu.n64 path: ./output/sc64menu.n64
@ -97,7 +97,7 @@ jobs:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run Doxygen - name: Run Doxygen
uses: mattnotmitt/doxygen-action@1.9.5 uses: mattnotmitt/doxygen-action@1.9.5

View File

@ -65,6 +65,7 @@ SRCS = \
menu/views/startup.c \ menu/views/startup.c \
menu/views/system_info.c \ menu/views/system_info.c \
menu/views/settings_editor.c \ menu/views/settings_editor.c \
menu/views/rtc.c \
utils/fs.c utils/fs.c
FONTS = \ FONTS = \

View File

@ -92,11 +92,11 @@ You can use a dev container in VSCode to ease development.
## To deploy: ## To deploy:
### SC64 ### SC64
* Download the deployer [here](https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.17.0/sc64-deployer-windows-v2.17.0.zip) * Download the deployer [here](https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.18.0/sc64-deployer-windows-v2.18.0.zip)
* Extract and place `sc64deployer.exe` in the `tools/sc64` directory. * Extract and place `sc64deployer.exe` in the `tools/sc64` directory.
Make sure that your firmware is compatible (currently v2.17.0+) Make sure that your firmware is compatible (currently v2.18.0+)
See: [here](https://github.com/Polprzewodnikowy/SummerCart64/blob/v2.17.0/docs/00_quick_startup_guide.md#firmware-backupupdate) See: [here](https://github.com/Polprzewodnikowy/SummerCart64/blob/v2.18.0/docs/00_quick_startup_guide.md#firmware-backupupdate)
#### From the devcontainer #### From the devcontainer

View File

@ -6,8 +6,9 @@
#include "constants.h" #include "constants.h"
#include "utils/fs.h" #include "utils/fs.h"
#ifndef BOXART_DIRECTORY
#define BOXART_DIRECTORY "sd:/menu/boxart" #define BOXART_DIRECTORY "sd:/menu/boxart"
#endif
static void png_decoder_callback (png_err_t err, surface_t *decoded_image, void *callback_data) { static void png_decoder_callback (png_err_t err, surface_t *decoded_image, void *callback_data) {

View File

@ -148,6 +148,7 @@ static struct views_s {
{ view_music_player_init, view_music_player_display }, // MENU_MODE_MUSIC_PLAYER { view_music_player_init, view_music_player_display }, // MENU_MODE_MUSIC_PLAYER
{ view_credits_init, view_credits_display }, // MENU_MODE_CREDITS { view_credits_init, view_credits_display }, // MENU_MODE_CREDITS
{ view_settings_init, view_settings_display }, // MENU_MODE_SETTINGS_EDITOR { view_settings_init, view_settings_display }, // MENU_MODE_SETTINGS_EDITOR
{ view_rtc_init, view_rtc_display }, // MENU_MODE_RTC
{ view_load_rom_init, view_load_rom_display }, // MENU_MODE_LOAD_ROM { view_load_rom_init, view_load_rom_display }, // MENU_MODE_LOAD_ROM
{ view_load_disk_init, view_load_disk_display }, // MENU_MODE_LOAD_DISK { view_load_disk_init, view_load_disk_display }, // MENU_MODE_LOAD_DISK
{ view_load_emulator_init, view_load_emulator_display }, // MENU_MODE_LOAD_EMULATOR { view_load_emulator_init, view_load_emulator_display }, // MENU_MODE_LOAD_EMULATOR

View File

@ -32,6 +32,7 @@ typedef enum {
MENU_MODE_MUSIC_PLAYER, MENU_MODE_MUSIC_PLAYER,
MENU_MODE_CREDITS, MENU_MODE_CREDITS,
MENU_MODE_SETTINGS_EDITOR, MENU_MODE_SETTINGS_EDITOR,
MENU_MODE_RTC,
MENU_MODE_LOAD_ROM, MENU_MODE_LOAD_ROM,
MENU_MODE_LOAD_DISK, MENU_MODE_LOAD_DISK,
MENU_MODE_LOAD_EMULATOR, MENU_MODE_LOAD_EMULATOR,

View File

@ -240,11 +240,16 @@ static void show_credits (menu_t *menu) {
menu->next_mode = MENU_MODE_CREDITS; menu->next_mode = MENU_MODE_CREDITS;
} }
static void edit_rtc (menu_t *menu) {
menu->next_mode = MENU_MODE_RTC;
}
static component_context_menu_t settings_context_menu = { static component_context_menu_t settings_context_menu = {
.list = { .list = {
{ .text = "Edit settings", .action = edit_settings }, { .text = "Edit settings", .action = edit_settings },
{ .text = "Show system info", .action = show_system_info }, { .text = "Show system info", .action = show_system_info },
{ .text = "Show credits", .action = show_credits }, { .text = "Show credits", .action = show_credits },
{ .text = "Adjust RTC", .action = edit_rtc },
COMPONENT_CONTEXT_MENU_LIST_END, COMPONENT_CONTEXT_MENU_LIST_END,
} }
}; };

View File

@ -33,7 +33,7 @@ static void draw (menu_t *menu, surface_t *d) {
"Github:\n" "Github:\n"
" https://github.com/Polprzewodnikowy/N64FlashcartMenu\n" " https://github.com/Polprzewodnikowy/N64FlashcartMenu\n"
"Authors:\n" "Authors:\n"
" JonesAlmighty / NetworkFusion\n" " Robin Jones / NetworkFusion\n"
" Mateusz Faderewski / Polprzewodnikowy\n" " Mateusz Faderewski / Polprzewodnikowy\n"
"Credits:\n" "Credits:\n"
" N64Brew / libdragon contributors\n" " N64Brew / libdragon contributors\n"

66
src/menu/views/rtc.c Normal file
View File

@ -0,0 +1,66 @@
#include <time.h>
#include "views.h"
// FIXME: add implementation!
// struct {
// uint16_t seconds;
// uint16_t minutes;
// uint16_t hours;
// uint16_t day;
// uint16_t month;
// uint16_t year;
// } adjusted_datetime;
// static void save_adjusted_datetime () {
// }
static void process (menu_t *menu) {
if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
}
}
static void draw (menu_t *menu, surface_t *d) {
rdpq_attach(d, NULL);
component_background_draw();
component_layout_draw();
component_main_text_draw(
ALIGN_CENTER, VALIGN_TOP,
"ADJUST REAL TIME CLOCK\n"
"\n"
"\n"
"To set the date and time, please use the PC terminal\n"
"application and set via USB.\n\n"
"Current date & time: %s\n",
menu->current_time >= 0 ? ctime(&menu->current_time) : "Unknown\n"
);
component_main_text_draw(
ALIGN_LEFT, VALIGN_TOP,
"\n"
"\n"
);
component_actions_bar_text_draw(
ALIGN_LEFT, VALIGN_TOP,
"\n" // "A: Save\n"
"B: Back"
);
rdpq_detach_show();
}
void view_rtc_init (menu_t *menu) {
// Nothing to initialize (yet)
}
void view_rtc_display (menu_t *menu, surface_t *display) {
process(menu);
draw(menu, display);
}

View File

@ -1,6 +1,6 @@
#include "views.h" #include "views.h"
static char *convert_boolean (int state) { static char *format_boolean_type (int state) {
switch (state) { switch (state) {
case 0: return "Off"; case 0: return "Off";
case 1: return "On"; case 1: return "On";
@ -38,13 +38,13 @@ static void draw (menu_t *menu, surface_t *d) {
"bgm_enabled: %s\n" "bgm_enabled: %s\n"
"sound_enabled: %s\n" "sound_enabled: %s\n"
"rumble_enabled: %s\n", "rumble_enabled: %s\n",
convert_boolean(menu->settings.pal60_enabled), format_boolean_type(menu->settings.pal60_enabled),
convert_boolean(menu->settings.hidden_files_enabled), format_boolean_type(menu->settings.hidden_files_enabled),
menu->settings.default_directory, menu->settings.default_directory,
convert_boolean(menu->settings.use_saves_folder), format_boolean_type(menu->settings.use_saves_folder),
convert_boolean(menu->settings.bgm_enabled), format_boolean_type(menu->settings.bgm_enabled),
convert_boolean(menu->settings.sound_enabled), format_boolean_type(menu->settings.sound_enabled),
convert_boolean(menu->settings.rumble_enabled) format_boolean_type(menu->settings.rumble_enabled)
); );

View File

@ -47,6 +47,9 @@ void view_load_disk_display (menu_t *menu, surface_t *display);
void view_settings_init (menu_t *menu); void view_settings_init (menu_t *menu);
void view_settings_display (menu_t *menu, surface_t *display); void view_settings_display (menu_t *menu, surface_t *display);
void view_rtc_init (menu_t *menu);
void view_rtc_display (menu_t *menu, surface_t *display);
void view_load_emulator_init (menu_t *menu); void view_load_emulator_init (menu_t *menu);
void view_load_emulator_display (menu_t *menu, surface_t *display); void view_load_emulator_display (menu_t *menu, surface_t *display);