Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ducalex committed Sep 2, 2024
2 parents 082889d + d47519f commit 8f80acd
Show file tree
Hide file tree
Showing 167 changed files with 4,587 additions and 3,473 deletions.
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ __pycache__/
.vscode/
build/

# ESP32 build
/partitions.bin
/partitions.csv
/sdkconfig.old
/sdkconfig
/*/sdkconfig.old
/*/sdkconfig
/*.exe
/*.fw
/*.img
/*.zip

/partitions.bin
/partitions.csv

# SDL2 build
/sd
/stderr.txt
/stdout.txt
/gmon.out
/*.exe
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Retro-Go 1.43 (2024-09-02)
- All: Added ZIP support (large 4MB+ GBC roms not supported unfortunately)
- Launcher: Added menu option to pre-compute all CRC32s (for cover art)
- Launcher: Officially support name-based cover art (eg: `/covers/nes/game name.png`)
- Launcher: Improved responsiveness when cover art/save preview is enabled
- Launcher: Added network status/details in wifi dialog


# Retro-Go 1.42 (2024-06-05)
- PCE: Fixed out-of-bounds VCE regs access (Crash in Raiden, probably others)
- NES: Fixed panic in some games (Snow Brothers, Chip'n'Dale, probably others)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ This method is intended to be used when .fw support isn't available (when portin

# Usage

## Game covers
## Game covers / artwork
Game covers should be placed in the `romart` folder at the base of your sd card. You can obtain a pre-made pack [here](https://github.com/ducalex/retro-go-covers). Retro-Go is also compatible with the older Go-Play romart pack.

You can add missing cover art by creating a PNG image (160x168, 8bit). Two naming schemes are supported:
- Filename-based: `/romart/nes/Super Mario.png` (notice the rom extension is *not* included)
- CRC32-based: `/romart/nes/A/ABCDE123.png` where `nes` is the same as the rom folder, and `ABCDE123` is the CRC32 of the game (press A -> Properties in the launcher to find it), and `A` is the first character of the CRC32
- Name-based: `/romart/nes/Super Mario.nes.png` (notice the rom extension is included!)

_Note: CRC32-based, which is what is used in the pre-made pack, is much slower than name-based! This type is useful because filenames vary greatly despite having identical CRCs, but if you generate your own art I suggest you use name-based format and delete all CRC-based art from your SD Card to improve responsiveness._
_Note: CRC32-based, which is what is used in the pre-made pack, is much slower than name-based! This type is useful because filenames vary greatly despite having identical CRCs, but if you generate your own art I suggest you use filename-based format and delete all CRC-based art from your SD Card to improve responsiveness._


## BIOS files
Expand Down
7 changes: 2 additions & 5 deletions base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/components")

macro(rg_setup_compile_options)
set(RG_TARGET "RG_TARGET_${RG_BUILD_TARGET}")
message("Target: ${RG_TARGET}")

component_compile_options(
-D${RG_TARGET}
-DRETRO_GO
-D${RG_BUILD_TARGET}=1
-DRETRO_GO=1
-fjump-tables -ftree-switch-conversion
${ARGV}
)
Expand Down
56 changes: 56 additions & 0 deletions build_sdl2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# Supported systems: Linux / MINGW32 / MINGW64
# Required: SDL2

CC="gcc"
# BUILD_INFO="RG:$(git describe) / SDL:$(sdl2-config --version)"
CFLAGS="-no-pie -DRG_TARGET_SDL2 -DRETRO_GO -DCJSON_HIDE_SYMBOLS -DSDL_MAIN_HANDLED=1 -DRG_BUILD_INFO=\"SDL2\" -Dapp_main=SDL_Main $(sdl2-config --cflags)"
INCLUDES="-Icomponents/retro-go -Icomponents/retro-go/libs/cJSON -Icomponents/retro-go/libs/lodepng"
SRCFILES="components/retro-go/*.c components/retro-go/drivers/audio/*.c components/retro-go/fonts/*.c
components/retro-go/libs/cJSON/*.c components/retro-go/libs/lodepng/*.c"
LIBS="$(sdl2-config --libs) -lstdc++"

echo "Cleaning..."
rm -f launcher.exe retro-core.exe gmon.out

echo "Building launcher..."
$CC $CFLAGS $INCLUDES -Ilauncher/main $SRCFILES launcher/main/*.c $LIBS -o launcher.exe

echo "Building retro-core..."
$CC $CFLAGS $INCLUDES \
-Iretro-core/components/gnuboy \
-Iretro-core/components/gw-emulator/src \
-Iretro-core/components/gw-emulator/src/cpus \
-Iretro-core/components/gw-emulator/src/gw_sys \
-Iretro-core/components/handy \
-Iretro-core/components/nofrendo \
-Iretro-core/components/pce-go \
-Iretro-core/components/snes9x \
-Iretro-core/components/snes9x/src \
-Iretro-core/components/smsplus \
-Iretro-core/main \
$SRCFILES \
retro-core/components/gnuboy/*.c \
retro-core/components/gw-emulator/src/*.c \
retro-core/components/gw-emulator/src/cpus/*.c \
retro-core/components/gw-emulator/src/gw_sys/*.c \
retro-core/components/handy/*.cpp \
retro-core/components/nofrendo/mappers/*.c \
retro-core/components/nofrendo/nes/*.c \
retro-core/components/nofrendo/*.c \
retro-core/components/pce-go/*.c \
retro-core/components/snes9x/src/*.c \
retro-core/components/smsplus/*.c \
retro-core/components/smsplus/cpu/*.c \
retro-core/components/smsplus/sound/*.c \
retro-core/main/*.c \
retro-core/main/*.cpp \
$LIBS \
-o retro-core.exe

echo "Running"
./launcher.exe && ./retro-core.exe

# && gprof.exe retro-core.exe gmon.out > profile.txt
# gdb -iex 'set pagination off' -ex run ./retro-core.exe
38 changes: 16 additions & 22 deletions components/retro-go/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
set(COMPONENT_SRCDIRS ". fonts libs/netplay libs/lodepng")
set(COMPONENT_SRCDIRS ". drivers/audio fonts libs/netplay libs/lodepng")
set(COMPONENT_ADD_INCLUDEDIRS ". libs/netplay libs/lodepng")

message(STATUS "ESP-IDF version: ${IDF_VER}")

if (IDF_VERSION_MAJOR EQUAL 5)
set(COMPONENT_REQUIRES "spi_flash fatfs app_update json nvs_flash esp_adc esp_timer esp_psram esp_wifi esp_http_client")
else() # esp-idf 4.1 - 4.4
Expand All @@ -26,35 +23,32 @@ set_source_files_properties(
-O2
)

if (IDF_VERSION_MAJOR EQUAL 5)
if(RG_ENABLE_NETPLAY OR RG_ENABLE_NETWORKING)
message(WARNING "Retro-Go's networking isn't compatible with esp-idf 5.x")
endif()
else()
if(RG_ENABLE_NETPLAY)
component_compile_options(-DRG_ENABLE_NETWORKING -DRG_ENABLE_NETPLAY)
elseif(RG_ENABLE_NETWORKING)
component_compile_options(-DRG_ENABLE_NETWORKING)
endif()
if(RG_ENABLE_NETPLAY)
component_compile_options(-DRG_ENABLE_NETWORKING -DRG_ENABLE_NETPLAY)
elseif(RG_ENABLE_NETWORKING)
component_compile_options(-DRG_ENABLE_NETWORKING)
endif()

if(RG_ENABLE_PROFILING)
component_compile_options(-DRG_ENABLE_PROFILING)
endif()

if(RG_BUILD_VERSION)
component_compile_options(-DRG_BUILD_VERSION="${RG_BUILD_VERSION}")
if(RG_PROJECT_VER)
component_compile_options(-DRG_PROJECT_VER="${RG_PROJECT_VER}")
endif()

if(RG_BUILD_RELEASE)
component_compile_options(-DRG_BUILD_RELEASE=1)
endif()

set(RG_TARGET "RG_TARGET_${RG_BUILD_TARGET}")
string(TIMESTAMP RG_TIME "%s")
set(RG_BUILD_INFO "${RG_BUILD_TARGET}-${RG_BUILD_RELEASE} ${PROJECT_VER} SDK:${IDF_VER} ${IDF_TARGET}")
string(TIMESTAMP RG_BUILD_TIME "%s")

message(STATUS "Target: ${RG_TARGET}")
message(STATUS "Time: ${RG_TIME}")
component_compile_options(-D${RG_BUILD_TARGET}=1)
component_compile_options(-DRG_PROJECT_APP="${RG_PROJECT_APP}")
component_compile_options(-DRG_BUILD_INFO="${RG_BUILD_INFO}")
component_compile_options(-DRG_BUILD_TIME=${RG_BUILD_TIME})

component_compile_options(-DRG_BUILD_TIME=${RG_TIME})
component_compile_options(-D${RG_TARGET})
message(STATUS "RG_PROJECT_APP: ${RG_PROJECT_APP}")
message(STATUS "RG_PROJECT_VER: ${RG_PROJECT_VER}")
message(STATUS "RG_BUILD_INFO: ${RG_BUILD_INFO}")
1 change: 1 addition & 0 deletions components/retro-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ I develop and test mainly on the ODROID-GO. I occasionally test on the MRGC-G32
| [esp32s3-devkit-c](esp32s3-devkit-c/docs/README.md) | |
| [esplay-micro](targets/esplay-micro/docs/README.md) | |
| [esplay-s3](targets/esplay-s3/docs/README.md) | |
| [fri3d-2024](targets/fri3d-2024/docs/README.md) | |
| [mrgc-g32](targets/mrgc-g32/docs/README.md) | |
| [mrgc-gbm](targets/mrgc-gbm/docs/README.md) | |
| [odroid-go](targets/odroid-go/docs/README.md) | |
Expand Down
97 changes: 59 additions & 38 deletions components/retro-go/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,20 @@
#include "targets/esplay-s3/config.h"
#elif defined(RG_TARGET_ESP32S3_DEVKIT_C)
#include "targets/esp32s3-devkit-c/config.h"
#elif defined(RG_TARGET_FRI3D_2024)
#include "targets/fri3d-2024/config.h"
#else
#warning "No target defined. Defaulting to ODROID-GO."
#include "targets/odroid-go/config.h"
#define RG_TARGET_ODROID_GO
#endif

// #ifndef RG_ENABLE_NETPLAY
// #define RG_ENABLE_NETPLAY 0
// #endif

// #ifndef RG_ENABLE_PROFILING
// #define RG_ENABLE_PROFILING 0
// #endif

#ifndef RG_APP_LAUNCHER
#define RG_APP_LAUNCHER "launcher"
#endif

#ifndef RG_APP_FACTORY
#define RG_APP_FACTORY NULL
#endif

#ifndef RG_PATH_MAX
#define RG_PATH_MAX 255
#endif

#ifndef RG_PROJECT_NAME
#define RG_PROJECT_NAME "Retro-Go"
#endif

#ifndef RG_PROJECT_APP
#define RG_PROJECT_APP "unknown"
#endif

#ifndef RG_PROJECT_VERSION
#define RG_PROJECT_VERSION RG_BUILD_VERSION
#ifndef RG_PROJECT_WEBSITE
#define RG_PROJECT_WEBSITE "https://github.com/ducalex/retro-go"
#endif

#ifndef RG_PROJECT_CREDITS
Expand All @@ -63,16 +41,16 @@
// What about targets/ports? Should we have a RG_TARGET_AUTHOR to append here?
#endif

#ifndef RG_PROJECT_WEBSITE
#define RG_PROJECT_WEBSITE "https://github.com/ducalex/retro-go"
#ifndef RG_PROJECT_APP
#define RG_PROJECT_APP "unknown"
#endif

#ifndef RG_PROJECT_RELEASES_URL
#define RG_PROJECT_RELEASES_URL "https://api.github.com/repos/ducalex/retro-go/releases"
#ifndef RG_PROJECT_VER
#define RG_PROJECT_VER "unknown"
#endif

#ifndef RG_BUILD_VERSION
#define RG_BUILD_VERSION "unknown"
#ifndef RG_BUILD_INFO
#define RG_BUILD_INFO "(none)"
#endif

#ifndef RG_BUILD_TIME
Expand All @@ -84,8 +62,41 @@
#define RG_BUILD_DATE __DATE__ " " __TIME__
#endif

#ifndef RG_BUILD_TOOL
#define RG_BUILD_TOOL "unknown"
// #ifndef RG_ENABLE_NETPLAY
// #define RG_ENABLE_NETPLAY 0
// #endif

// #ifndef RG_ENABLE_PROFILING
// #define RG_ENABLE_PROFILING 0
// #endif

#ifndef RG_APP_LAUNCHER
#define RG_APP_LAUNCHER "launcher"
#endif

#ifndef RG_APP_FACTORY
#define RG_APP_FACTORY NULL
#endif

#ifndef RG_APP_UPDATER
#define RG_APP_UPDATER RG_APP_FACTORY
// #define RG_APP_UPDATER "updater"
#endif

#ifndef RG_UPDATER_GITHUB_RELEASES
#define RG_UPDATER_GITHUB_RELEASES "https://api.github.com/repos/ducalex/retro-go/releases"
#endif

#ifndef RG_UPDATER_DOWNLOAD_LOCATION
#if defined(RG_TARGET_ODROID_GO)
#define RG_UPDATER_DOWNLOAD_LOCATION RG_STORAGE_ROOT "/odroid/firmware"
#else
#define RG_UPDATER_DOWNLOAD_LOCATION RG_STORAGE_ROOT "/espgbc/firmware"
#endif
#endif

#ifndef RG_PATH_MAX
#define RG_PATH_MAX 255
#endif

#ifndef RG_RECOVERY_BTN
Expand All @@ -108,10 +119,20 @@
#define RG_BATTERY_UPDATE_THRESHOLD_VOLT 0.010f
#endif

#ifndef RG_GPIO_LED
#define RG_GPIO_LED (-1)
#endif

#ifndef RG_LOG_COLORS
#define RG_LOG_COLORS (1)
#endif

#ifndef RG_TICK_RATE
#ifdef ESP_PLATFORM
#define RG_TICK_RATE CONFIG_FREERTOS_HZ
#else
#define RG_TICK_RATE 1000
#endif
#endif

#ifdef ESP_PLATFORM
#define RG_ZIP_SUPPORT 1
#else
#define RG_ZIP_SUPPORT 0
#endif
Loading

0 comments on commit 8f80acd

Please sign in to comment.