Browse Source

Fixes for PSP

psp
Anders Jenbo 2 years ago
parent
commit
835b8a860e
  1. 4
      CMake/platforms/psp_defs.cmake
  2. 2
      Source/diablo.cpp
  3. 4
      Source/storm/storm_net.cpp
  4. 8
      Source/utils/file_util.cpp

4
CMake/platforms/psp_defs.cmake

@ -6,5 +6,5 @@ set(BUILD_TESTING OFF)
set(PREFILL_PLAYER_NAME ON)
set(NOEXIT ON)
set(DEFAULT_WIDTH 480)
set(DEFAULT_HEIGHT 272)
# Use lower resampling quality for FPS.
set(DEFAULT_AUDIO_RESAMPLING_QUALITY 2)

2
Source/diablo.cpp

@ -1149,7 +1149,7 @@ void DiabloInit()
}
}
#ifndef USE_SDL1
#if !defined(USE_SDL1) && !defined(PSP)
InitializeVirtualGamepad();
#endif

4
Source/storm/storm_net.cpp

@ -23,10 +23,12 @@ namespace devilution {
namespace {
std::unique_ptr<net::abstract_net> dvlnet_inst;
bool GameIsPublic = {};
thread_local uint32_t dwLastError = 0;
#ifndef NONET
thread_local uint32_t dwLastError = 0;
SdlMutex storm_net_mutex;
#else
uint32_t dwLastError = 0;
#endif
} // namespace

8
Source/utils/file_util.cpp

@ -31,6 +31,10 @@
#endif
#endif
#ifdef PSP
#include <pspkernel.h>
#endif
#if (_POSIX_C_SOURCE >= 200112L || defined(_BSD_SOURCE) || defined(__APPLE__)) && !defined(NXDK)
#include <sys/stat.h>
#include <unistd.h>
@ -396,7 +400,11 @@ void RemoveFile(const char *path)
FILE *f = fopen(name.c_str(), "r+");
if (f != nullptr) {
fclose(f);
#ifdef PSP
sceIoRemove(name.c_str());
#else
remove(name.c_str());
#endif
f = nullptr;
LogVerbose("Removed file: {}", name);
} else {

Loading…
Cancel
Save