From c44ff7f75224932f67976099b1362fcc3eb944d5 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 28 Aug 2023 16:19:51 +0100 Subject: [PATCH] Update emulator load display (#46) ## Description Update emulator load display to be, well, better. Add TotalSMS (not tested, however, shows that the emulator is not found.) Fix rolling release for new forks. ## Motivation and Context ## How Has This Been Tested? ## Screenshots ## Types of changes - [ ] Improvement (non-breaking change that adds a new feature) - [ ] Bug fix (fixes an issue) - [ ] Breaking change (breaking change) - [ ] Config and build (change in the configuration and build system, has no impact on code or features) ## Checklist: - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Signed-off-by: GITHUB_USER --- .github/workflows/build.yml | 2 ++ README.md | 1 + src/menu/cart_load.c | 4 ++++ src/menu/cart_load.h | 1 + src/menu/views/browser.c | 2 +- src/menu/views/load_emulator.c | 35 +++++++++++++++++++++++++++++----- 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff53f62f..ebccb00d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,6 +74,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} tag_name: rolling-release + continue-on-error: true - name: Upload rolling release uses: softprops/action-gh-release@v0.1.15 @@ -88,6 +89,7 @@ jobs: ./output/OS64.v64 ./output/OS64P.v64 ./output/sc64menu.n64 + continue-on-error: true generate-docs: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 2809611c..6dda5dcc 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Menu currently supports the following emulators and associated ROM file names: - **NES**: [neon64v2](https://github.com/hcs64/neon64v2) by *hcs64* - `neon64bu.rom` - **SNES**: [sodium64](https://github.com/Hydr8gon/sodium64) by *Hydr8gon* - `sodium64.z64` - **Game Boy** / **GB Color**: [gb64](https://lambertjamesd.github.io/gb64/romwrapper/romwrapper.html) by *lambertjamesd* - `gb.v64` / `gbc.v64` + - **Sega Master System ** / **Sega Game Gear** / ** Sg1000 **: [TotalSMS](https://github.com/ITotalJustice/TotalSMS) - `TotalSMS.z64` # Developer documentation diff --git a/src/menu/cart_load.c b/src/menu/cart_load.c index a8f898dc..366ce259 100644 --- a/src/menu/cart_load.c +++ b/src/menu/cart_load.c @@ -101,6 +101,10 @@ cart_load_err_t cart_load_emulator (menu_t *menu, cart_load_emu_type_t emu_type, path_push(path, "gbc.v64"); save_type = FLASHCART_SAVE_TYPE_FLASHRAM; break; + case CART_LOAD_EMU_TYPE_SEGA_GENERIC_8BIT: + path_push(path, "TotalSMS.z64"); + save_type = FLASHCART_SAVE_TYPE_SRAM; + break; } if (!file_exists(path_get(path))) { diff --git a/src/menu/cart_load.h b/src/menu/cart_load.h index 3fde2d3c..e5359ddd 100644 --- a/src/menu/cart_load.h +++ b/src/menu/cart_load.h @@ -28,6 +28,7 @@ typedef enum { CART_LOAD_EMU_TYPE_SNES, CART_LOAD_EMU_TYPE_GAMEBOY, CART_LOAD_EMU_TYPE_GAMEBOY_COLOR, + CART_LOAD_EMU_TYPE_SEGA_GENERIC_8BIT, } cart_load_emu_type_t; diff --git a/src/menu/views/browser.c b/src/menu/views/browser.c index 1e7e0811..7ed8d0b6 100644 --- a/src/menu/views/browser.c +++ b/src/menu/views/browser.c @@ -10,7 +10,7 @@ static const char *rom_extensions[] = { "z64", "n64", "v64", "rom", NULL }; -static const char *emulator_extensions[] = { "nes", "sfc", "smc", "gb", "gbc", NULL }; +static const char *emulator_extensions[] = { "nes", "sfc", "smc", "gb", "gbc", "sms", "gg", "sg", NULL }; static const char *save_extensions[] = { "sav", NULL }; // TODO: "eep", "sra", "srm", "fla" could be used if transfered from different flashcarts. static const char *image_extensions[] = { "png", NULL }; static const char *music_extensions[] = { "mp3", NULL }; diff --git a/src/menu/views/load_emulator.c b/src/menu/views/load_emulator.c index 8c8e6573..777bfa63 100644 --- a/src/menu/views/load_emulator.c +++ b/src/menu/views/load_emulator.c @@ -8,10 +8,28 @@ static const char *emu_nes_rom_extensions[] = { "nes", NULL }; static const char *emu_snes_rom_extensions[] = { "sfc", "smc", NULL }; static const char *emu_gameboy_rom_extensions[] = { "gb", NULL }; static const char *emu_gameboy_color_rom_extensions[] = { "gbc", NULL }; +static const char *emu_sega_8bit_rom_extensions[] = { "sms", "gg", "sg", NULL }; static bool load_pending; static cart_load_emu_type_t emu_type; +static char *format_emulator_name (cart_load_emu_type_t emulator_info) { + switch (emulator_info) { + case CART_LOAD_EMU_TYPE_NES: + return "Nintendo Famicom (NES)"; + case CART_LOAD_EMU_TYPE_SNES: + return "Nintendo Super Famicom (SNES)"; + case CART_LOAD_EMU_TYPE_GAMEBOY: + return "Nintendo GAMEBOY"; + case CART_LOAD_EMU_TYPE_GAMEBOY_COLOR: + return "Nintendo GAMEBOY Color"; + case CART_LOAD_EMU_TYPE_SEGA_GENERIC_8BIT: + return "SEGA 8bit system"; + default: + return "Unknown"; + } +} + static void process (menu_t *menu) { if (menu->actions.enter) { @@ -33,17 +51,22 @@ static void draw (menu_t *menu, surface_t *d) { component_main_text_draw( ALIGN_CENTER, VALIGN_TOP, - "Emulator information\n" - "THE EMULATOR\n" - "Rom Name\n" + "Load Emulated ROM\n" + ); + + component_main_text_draw( + ALIGN_LEFT, VALIGN_TOP, "\n" - "%s", + "\n" + "Emulated System: %s\n" + "Rom Name: %s", + format_emulator_name(emu_type), menu->browser.entry->name ); component_actions_bar_text_draw( ALIGN_LEFT, VALIGN_TOP, - "A: Load and run Emulator ROM\n" + "A: Load and run Emulated ROM\n" "B: Exit" ); } @@ -93,6 +116,8 @@ void view_load_emulator_init (menu_t *menu) { emu_type = CART_LOAD_EMU_TYPE_GAMEBOY; } else if (file_has_extensions(path_get(path), emu_gameboy_color_rom_extensions)) { emu_type = CART_LOAD_EMU_TYPE_GAMEBOY_COLOR; + } else if (file_has_extensions(path_get(path), emu_sega_8bit_rom_extensions)) { + emu_type = CART_LOAD_EMU_TYPE_SEGA_GENERIC_8BIT; } else { menu_show_error(menu, "Unsupported ROM"); }