Implement cellVideoOutGetGamma/SetGamma

Also fixed settings window being too small and some minor formatting.
This commit is contained in:
Raul Tambre 2015-08-10 14:09:57 +03:00 committed by Nekotekina
parent 7e01c81154
commit ff3bfa1ca2
3 changed files with 40 additions and 13 deletions

View File

@ -9,6 +9,8 @@
extern Module cellAvconfExt;
f32 g_gamma;
s32 cellAudioOutUnregisterDevice()
{
throw EXCEPTION("");
@ -39,9 +41,18 @@ s32 cellVideoOutConvertCursorColor()
throw EXCEPTION("");
}
s32 cellVideoOutGetGamma()
s32 cellVideoOutGetGamma(u32 videoOut, vm::ptr<f32> gamma)
{
throw EXCEPTION("");
cellAvconfExt.Warning("cellVideoOutGetGamma(videoOut=%d, gamma=*0x%x)", videoOut, gamma);
if (videoOut != CELL_VIDEO_OUT_PRIMARY)
{
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
*gamma = g_gamma;
return CELL_OK;
}
s32 cellAudioInGetAvailableDeviceInfo()
@ -54,9 +65,23 @@ s32 cellAudioOutGetAvailableDeviceInfo()
throw EXCEPTION("");
}
s32 cellVideoOutSetGamma()
s32 cellVideoOutSetGamma(u32 videoOut, f32 gamma)
{
throw EXCEPTION("");
cellAvconfExt.Warning("cellVideoOutSetGamma(videoOut=%d, gamma=%f)", videoOut, gamma);
if (videoOut != CELL_VIDEO_OUT_PRIMARY)
{
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
if (gamma < 0.8f || gamma > 1.2f)
{
return CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER;
}
g_gamma = gamma;
return CELL_OK;
}
s32 cellAudioOutRegisterDevice()
@ -114,6 +139,8 @@ s32 cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
Module cellAvconfExt("cellAvconfExt", []()
{
g_gamma = 1.0f;
REG_FUNC(cellAvconfExt, cellAudioOutUnregisterDevice);
REG_FUNC(cellAvconfExt, cellAudioOutGetDeviceInfo2);
REG_FUNC(cellAvconfExt, cellVideoOutSetXVColor);

View File

@ -25,11 +25,11 @@ s32 cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutStat
state->displayMode.conversion = Emu.GetGSManager().GetInfo().mode.conversion;
state->displayMode.aspect = Emu.GetGSManager().GetInfo().mode.aspect;
state->displayMode.refreshRates = Emu.GetGSManager().GetInfo().mode.refreshRates;
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
case CELL_VIDEO_OUT_SECONDARY:
*state = { CELL_VIDEO_OUT_OUTPUT_STATE_DISABLED }; // ???
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
}
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
@ -46,7 +46,7 @@ s32 cellVideoOutGetResolution(u32 resolutionId, vm::ptr<CellVideoOutResolution>
resolution->width = ResolutionTable[num].width;
resolution->height = ResolutionTable[num].height;
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
}
s32 cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option, u32 waitForEvent)
@ -73,10 +73,10 @@ s32 cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration> confi
Emu.GetGSManager().GetInfo().mode.pitch = config->pitch;
}
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
case CELL_VIDEO_OUT_SECONDARY:
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
}
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
@ -97,11 +97,11 @@ s32 cellVideoOutGetConfiguration(u32 videoOut, vm::ptr<CellVideoOutConfiguration
config->aspect = Emu.GetGSManager().GetInfo().mode.aspect;
config->pitch = Emu.GetGSManager().GetInfo().mode.pitch;
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
case CELL_VIDEO_OUT_SECONDARY:
return CELL_VIDEO_OUT_SUCCEEDED;
return CELL_OK;
}
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;

View File

@ -1,8 +1,8 @@
#pragma once
enum VideoErrorCode
// Video Out Error Codes
enum
{
CELL_VIDEO_OUT_SUCCEEDED = 0,
CELL_VIDEO_OUT_ERROR_NOT_IMPLEMENTED = 0x8002b220,
CELL_VIDEO_OUT_ERROR_ILLEGAL_CONFIGURATION = 0x8002b221,
CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER = 0x8002b222,