mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
UFC 6 (PPSA23566) imports both. Initialization marks the library initialized and termination clears it, as in shadPS4. Termination without initialization and a second initialization throw, since no PS5 source settles their results. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit d2866a886a7702cdaad56d161460a3ce86ede629)
35 lines
802 B
C++
35 lines
802 B
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include <cstdlib>
|
|
#include <stdexcept>
|
|
|
|
extern "C" {
|
|
int APS5_VABI sceNpEAAccessInitialize(void);
|
|
int APS5_VABI sceNpEAAccessTerminate(void);
|
|
}
|
|
|
|
namespace {
|
|
|
|
void Require(bool value) { if (!value) std::abort(); }
|
|
|
|
template <typename TAction>
|
|
bool Throws(TAction action) {
|
|
try {
|
|
action();
|
|
} catch (const std::logic_error&) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
int main() {
|
|
Require(Throws([] { sceNpEAAccessTerminate(); }));
|
|
Require(sceNpEAAccessInitialize() == 0);
|
|
Require(Throws([] { sceNpEAAccessInitialize(); }));
|
|
Require(sceNpEAAccessTerminate() == 0);
|
|
Require(Throws([] { sceNpEAAccessTerminate(); }));
|
|
Require(sceNpEAAccessInitialize() == 0);
|
|
Require(sceNpEAAccessTerminate() == 0);
|
|
}
|