diff --git a/emulator/include/Emulator.hpp b/emulator/include/Emulator.hpp index b9c325910..145257bae 100644 --- a/emulator/include/Emulator.hpp +++ b/emulator/include/Emulator.hpp @@ -40,9 +40,10 @@ class OswEmulator { static OswEmulator* instance; // "Singleton" const bool isHeadless; + const bool isSoftwareRenderer; bool autoWakeUp = true; - OswEmulator(bool headless, std::string configPath = "config.json", std::string imguiPath = "imgui.ini"); + OswEmulator(bool softwareRenderer, bool headless, std::string configPath = "config.json", std::string imguiPath = "imgui.ini"); ~OswEmulator(); void run(); diff --git a/emulator/lib/ArduinoJson b/emulator/lib/ArduinoJson index 6f57cda0b..8d3d9c718 160000 --- a/emulator/lib/ArduinoJson +++ b/emulator/lib/ArduinoJson @@ -1 +1 @@ -Subproject commit 6f57cda0b44e288b63a7d09985f38e1e28810ae7 +Subproject commit 8d3d9c718d3ab45d7cc7268a5773c2e7ad19c967 diff --git a/emulator/lib/ImGUI b/emulator/lib/ImGUI index b32ef809c..659fb41d0 160000 --- a/emulator/lib/ImGUI +++ b/emulator/lib/ImGUI @@ -1 +1 @@ -Subproject commit b32ef809c398d490f9c3b42a84d5a5bd744a1b11 +Subproject commit 659fb41d0a23efbb9ea6cf74f51ecae0a51575b5 diff --git a/emulator/lib/ImGUI_TestEngine b/emulator/lib/ImGUI_TestEngine index 5e06f016e..25ec7bffa 160000 --- a/emulator/lib/ImGUI_TestEngine +++ b/emulator/lib/ImGUI_TestEngine @@ -1 +1 @@ -Subproject commit 5e06f016e35793ef09879c4ce81febb10a96f08c +Subproject commit 25ec7bffa3ad9c28b517dd4facf4cc338c159b18 diff --git a/emulator/src/Emulator.cpp b/emulator/src/Emulator.cpp index 07f8a43fd..c3f7b86ee 100644 --- a/emulator/src/Emulator.cpp +++ b/emulator/src/Emulator.cpp @@ -35,7 +35,7 @@ static void shutdownEmulatorByInterruptSignal(int s) { called = true; } -OswEmulator::OswEmulator(bool headless, std::string configPath, std::string imguiPath): isHeadless(headless) { +OswEmulator::OswEmulator(bool softwareRenderer, bool headless, std::string configPath, std::string imguiPath): isHeadless(headless), isSoftwareRenderer(softwareRenderer) { // Initialize variables for(size_t i = 0; i < BTN_NUMBER; i++) this->buttonCheckboxes[i] = false; @@ -58,6 +58,7 @@ OswEmulator::OswEmulator(bool headless, std::string configPath, std::string imgu if(this->isHeadless) { this->mainSurface = SDL_CreateRGBSurface(0, width, height, 32, 0, 0, 0, 0); assert(this->mainSurface && "Never fail surface creation"); + assert(this->isSoftwareRenderer && "Software renderer is required in headless mode"); this->mainRenderer = SDL_CreateSoftwareRenderer(this->mainSurface); } else { // Init the SDL window and renderer @@ -70,7 +71,7 @@ OswEmulator::OswEmulator(bool headless, std::string configPath, std::string imgu SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI ); assert(this->mainWindow && "Never fail window creation"); - this->mainRenderer = SDL_CreateRenderer(this->mainWindow, -1, SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED); + this->mainRenderer = SDL_CreateRenderer(this->mainWindow, -1, this->isSoftwareRenderer ? SDL_RENDERER_SOFTWARE : (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED)); } assert(this->mainRenderer && "Never fail renderer creation"); fakeDisplayInstance = std::make_unique(DISP_W, DISP_H, this->mainRenderer); diff --git a/emulator/src/main.cpp b/emulator/src/main.cpp index 97350284c..746a34eec 100644 --- a/emulator/src/main.cpp +++ b/emulator/src/main.cpp @@ -25,10 +25,13 @@ int main(int argc, char** argv) { const std::string argRunUnitTests = "unit_tests"; const std::string argListAllTests = "list_tests"; const std::string argUiTests = "ui_tests"; + const std::string argHeadless = "headless"; + const std::string argSoftwareRenderer = "software_renderer"; a.add(argRunUnitTests, '\0', "run the unit test framework"); a.add(argListAllTests, '\0', "list all unit and UI tests, one per line"); a.add(argUiTests, '\0', "run emulator with UI tests window"); - a.add("headless", '\0', "do not open a window; use software-rendering only"); // Warning: This parameter name is also used in the unit-tests! + a.add(argHeadless, '\0', "do not open a window; also implies --software_renderer"); // Warning: This parameter name is also used in the unit-tests! + a.add(argSoftwareRenderer, '\0', "use software-rendering only"); a.parse_check(argc, argv); // Initialize SDL @@ -60,7 +63,7 @@ int main(int argc, char** argv) { returnval = UiTests_main(); } else { // Create and run the emulator - std::unique_ptr oswEmu = std::make_unique(a.exist("headless")); + std::unique_ptr oswEmu = std::make_unique(a.exist(argSoftwareRenderer) or a.exist(argHeadless), a.exist(argHeadless)); OswEmulator::instance = oswEmu.get(); oswEmu->run(); OswEmulator::instance = nullptr; diff --git a/emulator/src/tests/uiTests/UiTests_main.hpp b/emulator/src/tests/uiTests/UiTests_main.hpp index 85311956e..b45d73795 100644 --- a/emulator/src/tests/uiTests/UiTests_main.hpp +++ b/emulator/src/tests/uiTests/UiTests_main.hpp @@ -39,7 +39,7 @@ int UiTests_main(UiTests_Mode mode = UiTests_Mode::Run) { const bool isListMode = mode == UiTests_Mode::List; // Create and run the emulator - std::unique_ptr oswEmu = std::make_unique(isListMode); + std::unique_ptr oswEmu = std::make_unique(isListMode, isListMode); OswEmulator::instance = oswEmu.get(); // Setup test engine diff --git a/emulator/src/tests/unitTests/fixtures/EmulatorFixture.hpp b/emulator/src/tests/unitTests/fixtures/EmulatorFixture.hpp index 18953cdfd..fa68fc16d 100644 --- a/emulator/src/tests/unitTests/fixtures/EmulatorFixture.hpp +++ b/emulator/src/tests/unitTests/fixtures/EmulatorFixture.hpp @@ -25,7 +25,7 @@ class EmulatorFixture { // Create and run the (headless) emulator this->configPath = "config_" + std::to_string(rand()) + ".json"; this->imguiPath = "imgui_" + std::to_string(rand()) + ".ini"; - oswEmu = std::make_unique(headless, this->configPath, this->imguiPath); + oswEmu = std::make_unique(headless, headless, this->configPath, this->imguiPath); OswEmulator::instance = oswEmu.get(); std::thread t([&]() { try { diff --git a/lib/AnimatedGIF b/lib/AnimatedGIF index 1d2fae5e4..74df32962 160000 --- a/lib/AnimatedGIF +++ b/lib/AnimatedGIF @@ -1 +1 @@ -Subproject commit 1d2fae5e40b718e715f720b809acbab90ad6b55d +Subproject commit 74df329624c3434dccca1908e97839e352f41f2a diff --git a/lib/open-smartwatch-web b/lib/open-smartwatch-web index 854c7989a..df4e89fcb 160000 --- a/lib/open-smartwatch-web +++ b/lib/open-smartwatch-web @@ -1 +1 @@ -Subproject commit 854c7989abcdefabfa7e48c17fe0396f06e2afab +Subproject commit df4e89fcbf0e4eaf9d34d3bc6f6269d26d21f88d diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 65a19bcf4..50e238078 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -1 +1 @@ -Pillow==9.0.1 \ No newline at end of file +pillow==10.2.0 \ No newline at end of file