Skip to content

Commit

Permalink
Launcher: Moved to retro-core
Browse files Browse the repository at this point in the history
This is just a test but some of the benefits would be:

- This allows retro-core to be used as a standalone esp32 app
- This reduces the total size by about 250KB
- This allows all core apps to have wifi if they want, without increasing size
  • Loading branch information
ducalex committed Sep 7, 2024
1 parent e3e194c commit 76d7d39
Show file tree
Hide file tree
Showing 75 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion components/retro-go/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
// #endif

#ifndef RG_APP_LAUNCHER
#define RG_APP_LAUNCHER "launcher"
#define RG_APP_LAUNCHER "retro-core"
#endif

#ifndef RG_APP_FACTORY
Expand Down
2 changes: 1 addition & 1 deletion components/retro-go/rg_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg
app.bootFlags = rg_settings_get_number(NS_BOOT, SETTING_BOOT_FLAGS, 0);
app.saveSlot = (app.bootFlags & RG_BOOT_SLOT_MASK) >> 4;
app.romPath = app.bootArgs;
app.isLauncher = strcmp(app.name, RG_APP_LAUNCHER) == 0; // Might be overriden after init
// app.isLauncher = strcmp(app.name, RG_APP_LAUNCHER) == 0; // Might be overriden after init
app.indicatorsMask = rg_settings_get_number(NS_GLOBAL, SETTING_INDICATOR_MASK, app.indicatorsMask);

rg_display_init();
Expand Down
9 changes: 9 additions & 0 deletions components/retro-go/targets/odroid-go/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS=y
CONFIG_PARTITION_TABLE_MD5=n
CONFIG_APP_BUILD_BOOTLOADER=n


#
# Partition Table
#
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y
# CONFIG_PARTITION_TABLE_TWO_OTA is not set


#
# HTTP Server
#
Expand Down
4 changes: 0 additions & 4 deletions launcher/CMakeLists.txt

This file was deleted.

4 changes: 2 additions & 2 deletions retro-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
set(COMPONENTS "main retro-go nofrendo gnuboy pce-go gw-emulator handy smsplus snes9x app_trace bootloader esptool_py")
set(RG_ENABLE_NETWORKING 0)
set(COMPONENTS "main retro-go nofrendo gnuboy pce-go gw-emulator handy smsplus snes9x esp_http_server app_trace bootloader esptool_py")
#set(RG_ENABLE_NETWORKING 0)
include(../base.cmake)
project(retro-core)
2 changes: 1 addition & 1 deletion retro-core/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(COMPONENT_SRCDIRS ".")
set(COMPONENT_SRCDIRS ". launcher")
set(COMPONENT_ADD_INCLUDEDIRS ".")
register_component()
rg_setup_compile_options(-O2 -Wno-error=format)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions launcher/main/main.c → retro-core/main/launcher/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void event_handler(int event, void *arg)
gui_redraw();
}

void app_main(void)
void launcher_main(void)
{
const rg_handlers_t handlers = {
.event = &event_handler,
Expand All @@ -440,7 +440,7 @@ void app_main(void)
RG_DIALOG_END,
};

app = rg_system_init(32000, &handlers, options);
app = rg_system_reinit(32000, &handlers, options);
app->configNs = "launcher";
app->isLauncher = true;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions retro-core/main/main_launcher.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "shared.h"

void launcher_main(void)
{
// void launcher_main(void)
// {
// app->configNs = "launcher";
// app->isLauncher = true;
// Currently a separate app, see launcher in project's root
rg_system_exit();
}
// rg_system_exit();
// }
3 changes: 0 additions & 3 deletions retro-go.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
{
"path": "gwenesis"
},
{
"path": "launcher"
},
{
"path": "prboom-go"
},
Expand Down
2 changes: 1 addition & 1 deletion rg_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
PROJECT_ICON = "assets/icon.raw"
PROJECT_APPS = {
# Project name Type, SubType, Size
'launcher': [0, 0, 917504],
# 'launcher': [0, 0, 917504],
'retro-core': [0, 0, 917504],
'prboom-go': [0, 0, 786432],
'gwenesis': [0, 0, 983040],
Expand Down
6 changes: 3 additions & 3 deletions rg_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ def monitor_app(app, port, baudrate=115200):
exec(f.read())

try:
if command in ["build-fw", "build-img", "release", "install"] and "launcher" not in apps:
print("\nWARNING: The launcher is mandatory for those apps and will be included!\n")
apps.insert(0, "launcher")
# if command in ["build-fw", "build-img", "release", "install"] and "launcher" not in apps:
# print("\nWARNING: The launcher is mandatory for those apps and will be included!\n")
# apps.insert(0, "launcher")

if command in ["clean", "release"]:
print("=== Step: Cleaning ===\n")
Expand Down

0 comments on commit 76d7d39

Please sign in to comment.