From 4aafc635fe3928ffa5d9136d66d8d2253a38a30e Mon Sep 17 00:00:00 2001 From: cpasjuste Date: Thu, 18 Apr 2024 14:53:41 +0200 Subject: [PATCH] vita: enable large heap size (256MB) vita: enable console games back vita: fix scaling options (missing scale 2x) vita: fix crash in release builds --- external/libcross2d | 2 +- src/cores/pfbneo/CMakeLists.txt | 5 +++-- src/cores/pfbneo/sources/pfbneo_config.cpp | 2 ++ src/cores/pfbneo/sources/pfbneo_romlist.cpp | 14 +++++++++++++- src/skeleton/romlist.cpp | 16 ++++++++++------ src/skeleton/romlist.h | 3 ++- 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/external/libcross2d b/external/libcross2d index 472d456f..d7be86e2 160000 --- a/external/libcross2d +++ b/external/libcross2d @@ -1 +1 @@ -Subproject commit 472d456ff90fd52fb1501d6af48f3fe910293035 +Subproject commit d7be86e24ead8c02a5552daf449feeab9d115caa diff --git a/src/cores/pfbneo/CMakeLists.txt b/src/cores/pfbneo/CMakeLists.txt index d0930942..34689c9b 100644 --- a/src/cores/pfbneo/CMakeLists.txt +++ b/src/cores/pfbneo/CMakeLists.txt @@ -265,8 +265,9 @@ set(FLAGS -DLSB_FIRST -DINCLUDE_7Z_SUPPORT -DMINIZIP_LIB -DBUILD_SDL2 -DBUILD_M68K - -fomit-frame-pointer -Wno-write-strings - -Wall -Wno-long-long -Wno-sign-compare -Wno-uninitialized -Wno-unused + #-fomit-frame-pointer + -Wno-strict-aliasing -Wno-long-long + -Wno-write-strings -Wno-sign-compare -Wno-uninitialized -Wno-unused -Wno-conversion -Wno-attributes -Wno-unused-parameter -Wno-unused-value -Wno-format-truncation -Wno-parentheses -Wno-sequence-point -Wno-format -Wno-misleading-indentation -Wno-restrict -Wno-unused-result diff --git a/src/cores/pfbneo/sources/pfbneo_config.cpp b/src/cores/pfbneo/sources/pfbneo_config.cpp index 0f3439ee..e653f7e9 100644 --- a/src/cores/pfbneo/sources/pfbneo_config.cpp +++ b/src/cores/pfbneo/sources/pfbneo_config.cpp @@ -63,6 +63,7 @@ PFBAConfig::PFBAConfig(c2d::Io *io, int version) : PEMUConfig(io, "PFBNEO", vers // add custom rom path PEMUConfig::addRomPath("ARCADE", io->getDataPath() + "arcade/", {HARDWARE_PREFIX_ARCADE, 0, "Arcade"}); +#ifndef __PFBN_LIGHT__ PEMUConfig::addRomPath("CHANNELF", io->getDataPath() + "channelf/", {HARDWARE_PREFIX_CHANNELF, 0, "Channel F"}); PEMUConfig::addRomPath("COLECO", io->getDataPath() + "coleco/", {HARDWARE_PREFIX_COLECO, 0, "ColecoVision"}); PEMUConfig::addRomPath("FDS", io->getDataPath() + "fds/", {HARDWARE_PREFIX_FDS, 0, "NES FDS"}); @@ -80,6 +81,7 @@ PFBAConfig::PFBAConfig(c2d::Io *io, int version) : PEMUConfig(io, "PFBNEO", vers {HARDWARE_PREFIX_SEGA_MASTER_SYSTEM, 0, "Sega Master System"}); PEMUConfig::addRomPath("SPECTRUM", io->getDataPath() + "spectrum/", {HARDWARE_PREFIX_SPECTRUM, 0, "ZX Spectrum"}); PEMUConfig::addRomPath("TG16", io->getDataPath() + "tg16/", {HARDWARE_PCENGINE_TG16, 0, "PC Engine TG16"}); +#endif // save newly added roms paths PEMUConfig::save(); diff --git a/src/cores/pfbneo/sources/pfbneo_romlist.cpp b/src/cores/pfbneo/sources/pfbneo_romlist.cpp index f707a7e0..998d7c07 100644 --- a/src/cores/pfbneo/sources/pfbneo_romlist.cpp +++ b/src/cores/pfbneo/sources/pfbneo_romlist.cpp @@ -64,17 +64,29 @@ void PFBNRomList::build(const ss_api::GameList::GameAddedCb &cb) { } }); + printf("PFBNRomList::build: removing HARDWARE_PREFIX_ARCADE...\n"); // remove custom "ARCADE" system added from "RomList::build" gameList->systemList.remove(HARDWARE_PREFIX_ARCADE); + + printf("PFBNRomList::build: sorting systems...\n"); // sort systems std::sort(gameList->systemList.systems.begin(), gameList->systemList.systems.end(), Api::sortSystemByName); + // update system filtering option + printf("PFBNRomList::build: updating UI_FILTER_SYSTEM...\n"); auto opt = ui->getConfig()->get(PEMUConfig::OptId::UI_FILTER_SYSTEM); - opt->setArray(gameList->systemList.getNames()); + if (opt != nullptr) { + opt->setArray(gameList->systemList.getNames()); + } else { + printf("PFBNRomList::build: updating UI_FILTER_SYSTEM... FAILED !\n"); + } // update config + printf("PFBNRomList::build: updating config again...\n"); ui->getConfig()->load(); +#ifndef __VITA__ // TODO: verify why this make release build crashing in vita float time_spent = ui->getElapsedTime().asSeconds() - time_start; printf("PFBNRomList::build(): list built in %f\n", time_spent); +#endif } diff --git a/src/skeleton/romlist.cpp b/src/skeleton/romlist.cpp index befae7e4..6d75adc3 100644 --- a/src/skeleton/romlist.cpp +++ b/src/skeleton/romlist.cpp @@ -55,7 +55,7 @@ void RomList::build(const ss_api::GameList::GameAddedCb &cb) { float time_start = ui->getElapsedTime().asSeconds(); auto cfg = ui->getConfig(); p_cb = cb; - m_count = 0; + m_games_count = m_games_available_count = 0; ui->flip(); @@ -64,18 +64,20 @@ void RomList::build(const ss_api::GameList::GameAddedCb &cb) { std::string gameListPath = p.path + "gamelist.xml"; gameList->append(gameListPath, p.path, false, filters, p.system, false, [this](Game *game) { if (p_cb) p_cb(game); - m_count++; - if (!(m_count % 200)) { - setLoadingText("Games: %li / %li", m_count, gameList->games.size()); + m_games_count++; + if (game->available) m_games_available_count++; + if (!(m_games_count % 200)) { + setLoadingText("Games: %li / %li", m_games_available_count, m_games_count); } }); - setLoadingText("Games: %li / %li", gameList->getAvailableCount(), gameList->games.size()); + setLoadingText("Games: %li / %li", m_games_available_count, m_games_count); printf("RomList::build: %s, games found: %zu / %zu (system: %s (0x%08x))\n", gameListPath.c_str(), gameList->getAvailableCount(), gameList->games.size(), p.system.name.c_str(), p.system.id); } - // sort lists + // sort games + printf("RomList::build: sorting games...\n"); std::sort(gameList->systemList.systems.begin(), gameList->systemList.systems.end(), Api::sortSystemByName); std::sort(gameList->editors.begin(), gameList->editors.end(), Api::sortEditorByName); std::sort(gameList->developers.begin(), gameList->developers.end(), Api::sortDeveloperByName); @@ -87,6 +89,7 @@ void RomList::build(const ss_api::GameList::GameAddedCb &cb) { std::sort(gameList->dates.begin(), gameList->dates.end(), Api::sortByName); // add filtering options + printf("RomList::build: add filtering options...\n"); auto grp = cfg->getGroup(PEMUConfig::GrpId::UI_FILTERING); grp->getOption(PEMUConfig::OptId::UI_FILTER_SYSTEM)->setArray(gameList->systemList.getNames(), 0); grp->getOption(PEMUConfig::OptId::UI_FILTER_GENRE)->setArray(gameList->getGenreNames(), 0); @@ -103,6 +106,7 @@ void RomList::build(const ss_api::GameList::GameAddedCb &cb) { } // we need to reload config to update new options we just added + printf("RomList::build: reloading config...\n"); cfg->load(); printf("RomList::build(): list built in %f\n", ui->getElapsedTime().asSeconds() - time_start); diff --git a/src/skeleton/romlist.h b/src/skeleton/romlist.h index 4448f4ef..8ad9fc0b 100644 --- a/src/skeleton/romlist.h +++ b/src/skeleton/romlist.h @@ -35,7 +35,8 @@ namespace pemu { protected: std::vector filters; - size_t m_count = 0; + size_t m_games_count = 0; + size_t m_games_available_count = 0; }; }