Skip to content

Commit

Permalink
vita: enable large heap size (256MB)
Browse files Browse the repository at this point in the history
vita: enable console games back
vita: fix scaling options (missing scale 2x)
vita: fix crash in release builds
  • Loading branch information
Cpasjuste committed Apr 18, 2024
1 parent bf24478 commit 4aafc63
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/cores/pfbneo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/cores/pfbneo/sources/pfbneo_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"});
Expand All @@ -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();
Expand Down
14 changes: 13 additions & 1 deletion src/cores/pfbneo/sources/pfbneo_romlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
16 changes: 10 additions & 6 deletions src/skeleton/romlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/skeleton/romlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ namespace pemu {

protected:
std::vector<std::string> filters;
size_t m_count = 0;
size_t m_games_count = 0;
size_t m_games_available_count = 0;
};
}

Expand Down

0 comments on commit 4aafc63

Please sign in to comment.