mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
Merge pull request #126 from oneandonlydean/feat/systemservice-hdr-tone-map
feat(systemservice): report the SDR tone-map luminance
This commit is contained in:
@@ -216,6 +216,15 @@ if(BUILD_TESTING)
|
||||
set_tests_properties(guest_system_exit guest_system_exit_parameters guest_immediate_exit PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
|
||||
endif()
|
||||
add_executable(guest_system_service_tests tests/GuestSystemService.cpp)
|
||||
target_include_directories(guest_system_service_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_system_service_tests PRIVATE libSceSystemService libc)
|
||||
configure_windows_unwind(guest_system_service_tests)
|
||||
add_test(NAME guest_system_service COMMAND guest_system_service_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_system_service PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
|
||||
endif()
|
||||
add_executable(guest_character_tests tests/GuestCharacter.cpp)
|
||||
target_include_directories(guest_character_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_character_tests PRIVATE libc)
|
||||
|
||||
@@ -33,9 +33,14 @@ int APS5_VABI sceSystemServiceGetDisplaySafeAreaInfo(SystemServiceDisplaySafeAre
|
||||
}
|
||||
|
||||
int APS5_VABI sceSystemServiceGetHdrToneMapLuminance(SystemServiceHdrToneMapLuminance* luminance) {
|
||||
(void)luminance;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
if (luminance == nullptr) {
|
||||
return SYSTEM_SERVICE_ERROR_PARAMETER;
|
||||
}
|
||||
constexpr float SdrReferenceWhiteNits = 100.0f;
|
||||
luminance->max_full_frame_tone_map_luminance = SdrReferenceWhiteNits;
|
||||
luminance->max_tone_map_luminance = SdrReferenceWhiteNits;
|
||||
luminance->min_tone_map_luminance = 0.0f;
|
||||
return SYSTEM_SERVICE_OK;
|
||||
}
|
||||
|
||||
int APS5_VABI sceSystemServiceGetNoticeScreenSkipFlag(bool* value) {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libSceSystemService/SystemService.hpp"
|
||||
#include <cstdlib>
|
||||
|
||||
extern "C" int APS5_VABI sceSystemServiceGetHdrToneMapLuminance(SystemServiceHdrToneMapLuminance* luminance);
|
||||
|
||||
namespace {
|
||||
|
||||
void Require(bool value) { if (!value) std::abort(); }
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
Require(sceSystemServiceGetHdrToneMapLuminance(nullptr) == SYSTEM_SERVICE_ERROR_PARAMETER);
|
||||
SystemServiceHdrToneMapLuminance luminance{-1.0f, -1.0f, -1.0f};
|
||||
Require(sceSystemServiceGetHdrToneMapLuminance(&luminance) == SYSTEM_SERVICE_OK);
|
||||
Require(luminance.max_full_frame_tone_map_luminance == 100.0f);
|
||||
Require(luminance.max_tone_map_luminance == 100.0f);
|
||||
Require(luminance.min_tone_map_luminance == 0.0f);
|
||||
}
|
||||
Reference in New Issue
Block a user