Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5ff462e
Fixing include misunderstanding
SergioMartin86 Apr 6, 2025
aa7b5b3
Deparalleliing initialization
SergioMartin86 Apr 6, 2025
6ee33db
Executing tasks sequentially (part1)
SergioMartin86 Apr 7, 2025
630400c
Serialized thread manager
SergioMartin86 Apr 7, 2025
8a570bb
Adding missing files
SergioMartin86 Apr 7, 2025
ab602e4
Removing threading
SergioMartin86 Apr 7, 2025
2ffd44a
Merge commit 'ab602e4e46' into ported2
SergioMartin86 Apr 7, 2025
f3a8a1a
Finishing dethread
SergioMartin86 Apr 7, 2025
2d096dd
Removed unnecessary deinit
SergioMartin86 Apr 7, 2025
5818639
Reading cd rom image from callbacks
SergioMartin86 Apr 7, 2025
a2402a9
Removing GL and vulkan dep
SergioMartin86 Apr 7, 2025
c01f978
Grabbing file that produced annoying warning
SergioMartin86 Apr 7, 2025
f88e80f
Removing camera stuff
SergioMartin86 Apr 7, 2025
d427de8
Waterbox compatible
SergioMartin86 Apr 7, 2025
2dbe996
Waterbox compatible
SergioMartin86 Apr 7, 2025
9f48dd9
Progress
Apr 7, 2025
0a52ce9
WIP
Apr 7, 2025
863de1a
Removing stuff
SergioMartin86 Apr 7, 2025
e42456c
Removing retro achvs
SergioMartin86 Apr 8, 2025
4ca9da9
Removing achievements
SergioMartin86 Apr 8, 2025
8e3cabe
Merge
SergioMartin86 Apr 8, 2025
b50c92a
Removed libzip
SergioMartin86 Apr 8, 2025
7a31f13
Removing cheats and lua
SergioMartin86 Apr 8, 2025
f6f3ee7
Removing lua and cheats
SergioMartin86 Apr 8, 2025
d55f2dd
Removed libchdr and zip
SergioMartin86 Apr 8, 2025
7631fa0
Simplifications
SergioMartin86 Apr 8, 2025
d376ecd
Updates
Apr 8, 2025
329dd09
Making it wbx ready
SergioMartin86 Apr 8, 2025
8cd5e81
Removing glslang
SergioMartin86 Apr 9, 2025
f768297
Making UI files compilable
SergioMartin86 Apr 9, 2025
333127d
Advancing during initialization until save/load is available
Apr 9, 2025
d77dcc3
Preventing crash on save dialog
Apr 10, 2025
04d6f25
Fixin compile
SergioMartin86 Apr 10, 2025
a542d2a
Adding compatibility file loading
SergioMartin86 Apr 10, 2025
da291d5
loading atlas ZIM font file directly from memory
SergioMartin86 Apr 10, 2025
973acb4
Detecting input reads
SergioMartin86 Apr 10, 2025
750f571
Adding atlas font metadata
SergioMartin86 Apr 10, 2025
9f005e9
Fixing file size
Apr 10, 2025
67508e1
Recovering font loading
SergioMartin86 Apr 10, 2025
1fc25f1
Restoring more
SergioMartin86 Apr 10, 2025
1ab2be4
Reverting changes to UI files
SergioMartin86 Apr 10, 2025
1f60cf4
restoring more original files
SergioMartin86 Apr 10, 2025
1dda35c
Reducing distance to upstream
SergioMartin86 Apr 10, 2025
546ff9e
rebasing upstream
SergioMartin86 Apr 10, 2025
1d2acfd
Simplifying
SergioMartin86 Apr 10, 2025
f86ab45
simplifications
SergioMartin86 Apr 10, 2025
a28303d
Merge branch 'master' into ported2
SergioMartin86 Apr 11, 2025
1caa97d
reducing diff
SergioMartin86 Apr 11, 2025
9295505
upstream sync
SergioMartin86 Apr 11, 2025
2d501d9
reducing diff
SergioMartin86 Apr 11, 2025
bbe04ba
reducing diff
SergioMartin86 Apr 11, 2025
10eeb7f
reducing diff
SergioMartin86 Apr 11, 2025
a3aaaf4
reducing diff
SergioMartin86 Apr 11, 2025
cd06a14
reducing diff
SergioMartin86 Apr 11, 2025
77a1c7c
reducing diff
SergioMartin86 Apr 11, 2025
fe33772
reducing diff
SergioMartin86 Apr 11, 2025
e85ad0f
Reducing diff
SergioMartin86 Apr 11, 2025
69ba735
fixing submodule
SergioMartin86 Apr 11, 2025
84dd361
Fix
SergioMartin86 Apr 11, 2025
a037d1b
Reducing diff
SergioMartin86 Apr 11, 2025
f6fc154
Reducing diff
SergioMartin86 Apr 11, 2025
1877d9c
reducing diff
SergioMartin86 Apr 11, 2025
216a771
reducing diff
SergioMartin86 Apr 11, 2025
be70025
reducing diff
SergioMartin86 Apr 11, 2025
5dbcbbe
reducing diff
SergioMartin86 Apr 11, 2025
66f4099
Reducing diff
SergioMartin86 Apr 11, 2025
2d4429d
reducing diff
SergioMartin86 Apr 11, 2025
82b6b76
Reducing diff
SergioMartin86 Apr 11, 2025
959d226
reducing diff
SergioMartin86 Apr 11, 2025
f7fc3dc
Now printing text
SergioMartin86 Apr 12, 2025
f1d25ce
Modifications to enable windows compilation
Apr 12, 2025
cde6f93
Accepting UI atlas font
SergioMartin86 Apr 13, 2025
f9bc944
Merge branch 'master' into ported2
Apr 13, 2025
0745d0f
Some changes to prevent crashing in windows
Apr 15, 2025
d65c3a2
Removing problematic logging functions on bizhawk
SergioMartin86 Aug 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Common/CPUDetect.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ struct CPUInfo {
} sQuirks;

// Call Detect()
explicit CPUInfo();
explicit CPUInfo(){};

// Turn the cpu info into a string we can show
std::vector<std::string> Features();
std::string Summarize();
std::vector<std::string> Features() { return {}; };
std::string Summarize() { return ""; } ;

private:
// Detects the various cpu features
void Detect();
};

extern CPUInfo cpu_info;
static CPUInfo cpu_info;

const char *GetCompilerABI();
inline const char *GetCompilerABI() { return ""; }
File renamed without changes.
File renamed without changes.
22 changes: 21 additions & 1 deletion Common/Data/Format/ZIMLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,29 @@ int LoadZIMPtr(const uint8_t *zim, size_t datasize, int *width, int *height, int
return num_levels;
}

extern std::string _atlasFontZimFileData;
extern std::string _ppgeAtlasFontZimFileData;
int LoadZIM(const char *filename, int *width, int *height, int *format, uint8_t **image) {
size_t size;
uint8_t *buffer = g_VFS.ReadFile(filename, &size);
bool deleteBuffer = true;

// If couldn't find the file natively, check the pre-loaded file data
if (!buffer && std::string(filename).find("ppge_atlas.zim") != std::string::npos)
{
size = _ppgeAtlasFontZimFileData.size();
buffer = (uint8_t*)_ppgeAtlasFontZimFileData.data();
deleteBuffer = false;
}

// If couldn't find the file natively, check the pre-loaded file data
if (!buffer && std::string(filename).find("font_atlas.zim") != std::string::npos)
{
size = _atlasFontZimFileData.size();
buffer = (uint8_t*)_atlasFontZimFileData.data();
deleteBuffer = false;
}

if (!buffer) {
ERROR_LOG(Log::IO, "Couldn't read data for '%s'", filename);
return 0;
Expand All @@ -136,6 +156,6 @@ int LoadZIM(const char *filename, int *width, int *height, int *format, uint8_t
if (!retval) {
ERROR_LOG(Log::IO, "Not a valid ZIM file: %s (size: %lld bytes)", filename, (long long)size);
}
delete [] buffer;
if (deleteBuffer) delete [] buffer;
return retval;
}
File renamed without changes.
4 changes: 2 additions & 2 deletions Common/GPU/OpenGL/GLFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct GLExtensions {
int GLSLVersion();
};

extern GLExtensions gl_extensions;
static GLExtensions gl_extensions;

// Call this after filling out vendor etc to lookup the bugs etc.
// Only needs to be called once. Currently called by CheckGLExtensions().
Expand All @@ -150,4 +150,4 @@ bool CheckGLExtensions();
void SetGLCoreContext(bool flag);
void ResetGLExtensions();

std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage);
std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage);
9 changes: 9 additions & 0 deletions Common/Log/LogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const char *LogManager::GetLogTypeName(Log type) {
void PrintfLog(const LogMessage &message);

void LogManager::Init(bool *enabledSetting, bool headless) {
return;
g_bLogEnabledSetting = enabledSetting;
if (initialized_) {
// Just update the pointer, already done above.
Expand All @@ -134,6 +135,7 @@ void LogManager::Init(bool *enabledSetting, bool headless) {
}

void LogManager::Shutdown() {
return;
if (!initialized_) {
// already done
return;
Expand All @@ -160,6 +162,7 @@ void LogManager::Shutdown() {
}

LogManager::LogManager() {
return;
#if PPSSPP_PLATFORM(IOS) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(SWITCH)
stdioUseColor_ = false;
#elif defined(_MSC_VER)
Expand All @@ -185,6 +188,7 @@ LogManager::LogManager() {
}

LogManager::~LogManager() {
return;
Shutdown();

#if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP)
Expand All @@ -194,6 +198,7 @@ LogManager::~LogManager() {
}

void LogManager::ChangeFileLog(const Path &filename) {
return;
if (fp_ && filename == logFilename_) {
// All good
return;
Expand All @@ -214,13 +219,15 @@ void LogManager::ChangeFileLog(const Path &filename) {
}

void LogManager::SaveConfig(Section *section) {
return;
for (int i = 0; i < (int)Log::NUMBER_OF_LOGS; i++) {
section->Set((std::string(g_logTypeNames[i]) + "Enabled"), g_log[i].enabled);
section->Set((std::string(g_logTypeNames[i]) + "Level"), (int)g_log[i].level);
}
}

void LogManager::LoadConfig(const Section *section, bool debugDefaults) {
return;
for (int i = 0; i < (int)Log::NUMBER_OF_LOGS; i++) {
bool enabled = false;
int level = 0;
Expand All @@ -232,13 +239,15 @@ void LogManager::LoadConfig(const Section *section, bool debugDefaults) {
}

void LogManager::SetOutputsEnabled(LogOutput outputs) {
return;
outputs_ = outputs;
if (outputs & LogOutput::File) {
ChangeFileLog(logFilename_);
}
}

void LogManager::LogLine(LogLevel level, Log type, const char *file, int line, const char *format, va_list args) {
return;
char msgBuf[1024];

const LogChannel &log = g_log[(size_t)type];
Expand Down
1 change: 1 addition & 0 deletions Common/Log/LogManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class LogManager {
}

void SetAllLogLevels(LogLevel level) {
return;
for (int i = 0; i < (int)Log::NUMBER_OF_LOGS; ++i) {
g_log[i].level = level;
}
Expand Down
File renamed without changes.
20 changes: 16 additions & 4 deletions Common/Render/Text/draw_text_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#if defined(USE_SDL2_TTF)

#include "SDL2/SDL.h"
#include "SDL2/SDL_ttf.h"
#include "SDL.h"
#include "SDL_ttf.h"

static std::string getlocale() {
// setlocale is not an intuitive function...
Expand Down Expand Up @@ -245,6 +245,7 @@ int TextDrawerSDL::FindFallbackFonts(uint32_t missingGlyph, int ptSize) {
return -1;
}

extern std::string _ppgeFontFileData;
uint32_t TextDrawerSDL::SetFont(const char *fontName, int size, int flags) {
uint32_t fontHash = fontName && strlen(fontName) ? hash::Adler32((const uint8_t *)fontName, strlen(fontName)) : 0;
fontHash ^= size;
Expand All @@ -256,10 +257,21 @@ uint32_t TextDrawerSDL::SetFont(const char *fontName, int size, int flags) {
return fontHash;
}

const char *useFont = fontName ? fontName : "Roboto-Condensed.ttf";
const char *useFont = std::string(fontName) != "" ? fontName : "Roboto-Condensed.ttf";
const int ptSize = (int)((size + 6) / dpiScale_);
TTF_Font *font = nullptr;

TTF_Font *font = TTF_OpenFont(useFont, ptSize);
// If it's the default font, take it from memory
if (_ppgeFontFileData != "")
{
SDL_RWops *rw = SDL_RWFromConstMem(_ppgeFontFileData.data(), _ppgeFontFileData.size());
if ( rw != NULL ) font = TTF_OpenFontRW(rw, 0, ptSize);
}
else // otherwise from a file
{
font = TTF_OpenFont(useFont, ptSize);
}


if (!font) {
File::FileInfo fileInfo;
Expand Down
4 changes: 2 additions & 2 deletions Common/Render/Text/draw_text_sdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#if defined(USE_SDL2_TTF)

#include "SDL2/SDL.h"
#include "SDL2/SDL_ttf.h"
#include "SDL.h"
#include "SDL_ttf.h"

#if defined(USE_SDL2_TTF_FONTCONFIG)
#include <fontconfig/fontconfig.h>
Expand Down
14 changes: 13 additions & 1 deletion Common/Thread/ThreadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ThreadManager::~ThreadManager() {
}

void ThreadManager::Teardown() {
return;
for (TaskThreadContext *&threadCtx : global_->threads_) {
std::unique_lock<std::mutex> lock(threadCtx->mutex);
threadCtx->cancelled = true;
Expand Down Expand Up @@ -106,6 +107,7 @@ void ThreadManager::Teardown() {
}

bool ThreadManager::TeardownTask(Task *task, bool enqueue) {
return true;
if (!task)
return true;

Expand All @@ -131,6 +133,7 @@ bool ThreadManager::TeardownTask(Task *task, bool enqueue) {
}

static void WorkerThreadFunc(GlobalThreadContext *global, TaskThreadContext *thread) {
return;
if (thread->type == TaskType::CPU_COMPUTE) {
snprintf(thread->name, sizeof(thread->name), "PoolW %d", thread->index);
} else {
Expand Down Expand Up @@ -216,6 +219,7 @@ static void WorkerThreadFunc(GlobalThreadContext *global, TaskThreadContext *thr
}

void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) {
return;
if (IsInitialized()) {
Teardown();
}
Expand All @@ -238,6 +242,9 @@ void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) {
}

void ThreadManager::EnqueueTask(Task *task) {
task->Run();
task->Release();
return;
if (task->Type() == TaskType::DEDICATED_THREAD) {
std::thread th([=](Task *task) {
SetCurrentThreadName("DedicatedThreadTask");
Expand Down Expand Up @@ -302,6 +309,9 @@ void ThreadManager::EnqueueTask(Task *task) {
}

void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task) {
task->Run();
task->Release();
return;
_assert_msg_(task->Type() != TaskType::DEDICATED_THREAD, "Dedicated thread tasks can't be put on specific threads");

_assert_msg_(threadNum >= 0 && threadNum < (int)global_->threads_.size(), "Bad threadnum or not initialized");
Expand All @@ -316,6 +326,7 @@ void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task) {
}

int ThreadManager::GetNumLooperThreads() const {
return 1;
return numComputeThreads_;
}

Expand All @@ -324,5 +335,6 @@ void ThreadManager::TryCancelTask(uint64_t taskID) {
}

bool ThreadManager::IsInitialized() const {
return true;
return !global_->threads_.empty();
}
}
2 changes: 1 addition & 1 deletion Common/VR/OpenXRLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
#if defined(_M_IX86) || defined(_M_X64)
#include "Common/GPU/OpenGL/GLCommon.h"
#define XR_USE_GRAPHICS_API_OPENGL 1
//#define XR_USE_GRAPHICS_API_OPENGL 1
#endif
#define XR_USE_PLATFORM_WIN32 1
#endif
Expand Down
11 changes: 9 additions & 2 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include "Core/Config.h"
#include "Core/System.h"

#include <sstream>
extern std::string _compatibilityFileData;
extern std::string _compatibilityVRFileData;

void Compatibility::Load(const std::string &gameID) {
Clear();

Expand All @@ -38,10 +42,13 @@ void Compatibility::Load(const std::string &gameID) {
if (ignored_.find("ALL") != ignored_.end())
return;

std::istringstream compatIString (_compatibilityFileData);
std::istringstream compatVRIString (_compatibilityVRFileData);

{
IniFile compat;
// This loads from assets.
if (compat.LoadFromVFS(g_VFS, "compat.ini")) {
if (compat.Load(compatIString)) {
CheckSettings(compat, gameID);
} else {
auto e = GetI18NCategory(I18NCat::ERRORS);
Expand All @@ -62,7 +69,7 @@ void Compatibility::Load(const std::string &gameID) {
{
IniFile compat;
// This loads from assets.
if (compat.LoadFromVFS(g_VFS, "compatvr.ini")) {
if (compat.Load(compatVRIString)) {
CheckVRSettings(compat, gameID);
}
}
Expand Down
3 changes: 3 additions & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@

#include "GPU/Common/FramebufferManagerCommon.h"

const char *PPSSPP_GIT_VERSION = "unknown";
inline bool VulkanMayBeAvailable() { return false; }

// TODO: Find a better place for this.
http::RequestManager g_DownloadManager;

Expand Down
3 changes: 3 additions & 0 deletions Core/Dialog/PSPSaveDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ void PSPSaveDialog::ExecuteNotVisibleIOAction() {
}

void PSPSaveDialog::JoinIOThread() {
return; // Disabling multithreading
if (ioThread) {
ioThread->join();
delete ioThread;
Expand All @@ -1221,6 +1222,8 @@ static void DoExecuteIOAction(PSPSaveDialog *dialog) {
}

void PSPSaveDialog::StartIOThread() {
ExecuteIOAction(); // Exeute the action directly
return; // Disabling multithreading
if (ioThread) {
WARN_LOG_REPORT(Log::sceUtility, "Starting a save io thread when one already pending, uh oh.");
JoinIOThread();
Expand Down
2 changes: 2 additions & 0 deletions Core/FileLoaders/CachingFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ void CachingFileLoader::StartReadAhead(s64 pos) {
aheadThreadRunning_ = true;
if (aheadThread_.joinable())
aheadThread_.join();

fprintf(stderr, "Unexpected thread creation found in CachingFileLoader.cpp\n"); std::abort();
aheadThread_ = std::thread([this, pos] {
SetCurrentThreadName("FileLoaderReadAhead");

Expand Down
Loading