Skip to content

Commit

Permalink
Excluding Android from multiple-instance feature because i'm too lazy…
Browse files Browse the repository at this point in the history
… to learn ashmem :D
  • Loading branch information
anr2me authored and hrydgard committed Jul 19, 2020
1 parent 9fae299 commit 3e2595e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Core/HLE/proAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
// All credit goes to him!

#if !defined(_WIN32)
#include <netdb.h>
#include <unistd.h>
#include <netinet/in.h>
#endif

#include <cstring>
Expand Down
11 changes: 10 additions & 1 deletion Core/HLE/sceNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <netinet/in.h>
#endif

#include "net/resolve.h"
Expand Down Expand Up @@ -113,6 +112,9 @@ static uint8_t getInstanceNumber() {
//hIDMapFile = NULL;

return id;
#elif __ANDROID__
// TODO : replace shm_open & shm_unlink with ashmem or android-shmem
return 1;
#elif __linux__ || __APPLE__
long BUF_SIZE = 4096;
//caddr_t pIDBuf;
Expand Down Expand Up @@ -158,6 +160,13 @@ static void PPSSPPIDCleanup() {
CloseHandle(hIDMapFile); // If program exited(or crashed?) or the last handle reference closed the shared memory object will be deleted.
hIDMapFile = NULL;
}
#elif __ANDROID__
if (hIDMapFile != 0) {
close(hIDMapFile);
// TODO : replace shm_unlink with ashmem or android-shmem
//shm_unlink(ID_SHM_NAME); // If program exited or crashed before unlinked the shared memory object and it's contents will persist.
hIDMapFile = 0;
}
#elif __linux__ || __APPLE__
// TODO : This unlink should be called when program exits instead of everytime the game reset.
if (hIDMapFile != 0) {
Expand Down

0 comments on commit 3e2595e

Please sign in to comment.