mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-29 12:15:39 +00:00
A second sceCommonDialogInitialize returned 0x80B80004 (ALREADY_INITIALIZED), the code each dialog's own Initialize returns. The common-dialog system initializer returns 0x80B80002 (ALREADY_SYSTEM_INITIALIZED), as shadPS4 and the SDK error names have it, so callers that accept only SCE_OK or ALREADY_SYSTEM_INITIALIZED treated a second call as a failure. The header keeps ALREADY_INITIALIZED for the dialog libraries that return it. The test pins the literal instead of the header constant, and the debt entry records that a repeated call's value is not measured on a console. Co-Authored-By: Claude Opus 5.5 <[email protected]>
28 lines
723 B
C++
28 lines
723 B
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include "prx/libSceCommonDialog/CommonDialog.hpp"
|
|
#include <cstdlib>
|
|
|
|
extern "C" {
|
|
int APS5_VABI sceCommonDialogInitialize(void);
|
|
bool APS5_VABI sceCommonDialogIsUsed(void);
|
|
}
|
|
|
|
namespace {
|
|
|
|
void Require(bool value) {
|
|
if (!value) std::abort();
|
|
}
|
|
|
|
constexpr int kErrAlreadySystemInitialized = static_cast<int>(0x80B80002);
|
|
|
|
}
|
|
|
|
int main() {
|
|
Require(!sceCommonDialogIsUsed());
|
|
Require(sceCommonDialogInitialize() == COMMON_DIALOG_OK);
|
|
Require(!sceCommonDialogIsUsed());
|
|
Require(sceCommonDialogInitialize() == kErrAlreadySystemInitialized);
|
|
Require(sceCommonDialogInitialize() == kErrAlreadySystemInitialized);
|
|
Require(!sceCommonDialogIsUsed());
|
|
}
|