mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
cellMusic: improvements
This commit is contained in:
parent
f8c8a3a26c
commit
456aa4ab8d
1 changed files with 68 additions and 2 deletions
|
@ -22,6 +22,10 @@ struct music_t
|
||||||
s32 cellMusicGetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
s32 cellMusicGetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetSelectionContext(context=*0x%x)", context);
|
cellMusic.todo("cellMusicGetSelectionContext(context=*0x%x)", context);
|
||||||
|
|
||||||
|
if (!context)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +33,9 @@ s32 cellMusicSetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicSetSelectionContext2(context=*0x%x)", context);
|
cellMusic.todo("cellMusicSetSelectionContext2(context=*0x%x)", context);
|
||||||
|
|
||||||
|
if (!context)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
const auto music = fxm::get_always<music_t>();
|
const auto music = fxm::get_always<music_t>();
|
||||||
|
|
||||||
if (!music->func)
|
if (!music->func)
|
||||||
|
@ -47,6 +54,8 @@ s32 cellMusicSetVolume2(f32 level)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicSetVolume2(level=0x%x)", level);
|
cellMusic.todo("cellMusicSetVolume2(level=0x%x)", level);
|
||||||
|
|
||||||
|
level = std::clamp(level, 0.0f, 1.0f);
|
||||||
|
|
||||||
const auto music = fxm::get_always<music_t>();
|
const auto music = fxm::get_always<music_t>();
|
||||||
|
|
||||||
if (!music->func)
|
if (!music->func)
|
||||||
|
@ -64,6 +73,10 @@ s32 cellMusicSetVolume2(f32 level)
|
||||||
s32 cellMusicGetContentsId(vm::ptr<CellSearchContentId> contents_id)
|
s32 cellMusicGetContentsId(vm::ptr<CellSearchContentId> contents_id)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetContentsId(contents_id=*0x%x)", contents_id);
|
cellMusic.todo("cellMusicGetContentsId(contents_id=*0x%x)", contents_id);
|
||||||
|
|
||||||
|
if (!contents_id)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +84,9 @@ s32 cellMusicSetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicSetSelectionContext(context=*0x%x)", context);
|
cellMusic.todo("cellMusicSetSelectionContext(context=*0x%x)", context);
|
||||||
|
|
||||||
|
if (!context)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
const auto music = fxm::get_always<music_t>();
|
const auto music = fxm::get_always<music_t>();
|
||||||
|
|
||||||
if (!music->func)
|
if (!music->func)
|
||||||
|
@ -89,6 +105,15 @@ s32 cellMusicInitialize2SystemWorkload(s32 mode, vm::ptr<CellMusic2Callback> fun
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicInitialize2SystemWorkload(mode=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, func, userData, spurs, priority, attr);
|
cellMusic.todo("cellMusicInitialize2SystemWorkload(mode=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, func, userData, spurs, priority, attr);
|
||||||
|
|
||||||
|
if (!func)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
|
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
||||||
|
{
|
||||||
|
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
const auto music = fxm::make_always<music_t>();
|
const auto music = fxm::make_always<music_t>();
|
||||||
music->func = func;
|
music->func = func;
|
||||||
music->userData = userData;
|
music->userData = userData;
|
||||||
|
@ -105,12 +130,20 @@ s32 cellMusicInitialize2SystemWorkload(s32 mode, vm::ptr<CellMusic2Callback> fun
|
||||||
s32 cellMusicGetPlaybackStatus2(vm::ptr<s32> status)
|
s32 cellMusicGetPlaybackStatus2(vm::ptr<s32> status)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetPlaybackStatus2(status=*0x%x)", status);
|
cellMusic.todo("cellMusicGetPlaybackStatus2(status=*0x%x)", status);
|
||||||
|
|
||||||
|
if (!status)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellMusicGetContentsId2(vm::ptr<CellSearchContentId> contents_id)
|
s32 cellMusicGetContentsId2(vm::ptr<CellSearchContentId> contents_id)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetContentsId2(contents_id=*0x%x)", contents_id);
|
cellMusic.todo("cellMusicGetContentsId2(contents_id=*0x%x)", contents_id);
|
||||||
|
|
||||||
|
if (!contents_id)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +169,10 @@ s32 cellMusicInitializeSystemWorkload(s32 mode, u32 container, vm::ptr<CellMusic
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicInitializeSystemWorkload(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, container, func, userData, spurs, priority, attr);
|
cellMusic.todo("cellMusicInitializeSystemWorkload(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, container, func, userData, spurs, priority, attr);
|
||||||
|
|
||||||
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
if (!func)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
|
if (mode != CELL_MUSIC_PLAYER_MODE_NORMAL)
|
||||||
{
|
{
|
||||||
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
||||||
return CELL_MUSIC_ERROR_PARAM;
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
@ -159,7 +195,10 @@ s32 cellMusicInitialize(s32 mode, u32 container, s32 spuPriority, vm::ptr<CellMu
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicInitialize(mode=0x%x, container=0x%x, spuPriority=0x%x, func=*0x%x, userData=*0x%x)", mode, container, spuPriority, func, userData);
|
cellMusic.todo("cellMusicInitialize(mode=0x%x, container=0x%x, spuPriority=0x%x, func=*0x%x, userData=*0x%x)", mode, container, spuPriority, func, userData);
|
||||||
|
|
||||||
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
if (!func)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
|
if (mode != CELL_MUSIC_PLAYER_MODE_NORMAL)
|
||||||
{
|
{
|
||||||
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
||||||
return CELL_MUSIC_ERROR_PARAM;
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
@ -199,18 +238,30 @@ s32 cellMusicFinalize2()
|
||||||
s32 cellMusicGetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
s32 cellMusicGetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetSelectionContext2(context=*0x%x)", context);
|
cellMusic.todo("cellMusicGetSelectionContext2(context=*0x%x)", context);
|
||||||
|
|
||||||
|
if (!context)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellMusicGetVolume(vm::ptr<f32> level)
|
s32 cellMusicGetVolume(vm::ptr<f32> level)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetVolume(level=*0x%x)", level);
|
cellMusic.todo("cellMusicGetVolume(level=*0x%x)", level);
|
||||||
|
|
||||||
|
if (!level)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellMusicGetPlaybackStatus(vm::ptr<s32> status)
|
s32 cellMusicGetPlaybackStatus(vm::ptr<s32> status)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetPlaybackStatus(status=*0x%x)", status);
|
cellMusic.todo("cellMusicGetPlaybackStatus(status=*0x%x)", status);
|
||||||
|
|
||||||
|
if (!status)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,6 +269,9 @@ s32 cellMusicSetPlaybackCommand2(s32 command, vm::ptr<void> param)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicSetPlaybackCommand2(command=0x%x, param=*0x%x)", command, param);
|
cellMusic.todo("cellMusicSetPlaybackCommand2(command=0x%x, param=*0x%x)", command, param);
|
||||||
|
|
||||||
|
if (command < CELL_MUSIC_PB_CMD_STOP || command > CELL_MUSIC_PB_CMD_FASTREVERSE)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
const auto music = fxm::get_always<music_t>();
|
const auto music = fxm::get_always<music_t>();
|
||||||
|
|
||||||
if (!music->func)
|
if (!music->func)
|
||||||
|
@ -236,6 +290,9 @@ s32 cellMusicSetPlaybackCommand(s32 command, vm::ptr<void> param)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicSetPlaybackCommand(command=0x%x, param=*0x%x)", command, param);
|
cellMusic.todo("cellMusicSetPlaybackCommand(command=0x%x, param=*0x%x)", command, param);
|
||||||
|
|
||||||
|
if (command < CELL_MUSIC_PB_CMD_STOP || command > CELL_MUSIC_PB_CMD_FASTREVERSE)
|
||||||
|
return CELL_MUSIC_ERROR_PARAM;
|
||||||
|
|
||||||
const auto music = fxm::get_always<music_t>();
|
const auto music = fxm::get_always<music_t>();
|
||||||
|
|
||||||
if (!music->func)
|
if (!music->func)
|
||||||
|
@ -290,6 +347,9 @@ s32 cellMusicInitialize2(s32 mode, s32 spuPriority, vm::ptr<CellMusic2Callback>
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicInitialize2(mode=%d, spuPriority=%d, func=*0x%x, userData=*0x%x)", mode, spuPriority, func, userData);
|
cellMusic.todo("cellMusicInitialize2(mode=%d, spuPriority=%d, func=*0x%x, userData=*0x%x)", mode, spuPriority, func, userData);
|
||||||
|
|
||||||
|
if (!func)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
||||||
{
|
{
|
||||||
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
||||||
|
@ -313,6 +373,8 @@ s32 cellMusicSetVolume(f32 level)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicSetVolume(level=0x%x)", level);
|
cellMusic.todo("cellMusicSetVolume(level=0x%x)", level);
|
||||||
|
|
||||||
|
level = std::clamp(level, 0.0f, 1.0f);
|
||||||
|
|
||||||
const auto music = fxm::get_always<music_t>();
|
const auto music = fxm::get_always<music_t>();
|
||||||
|
|
||||||
if (!music->func)
|
if (!music->func)
|
||||||
|
@ -330,6 +392,10 @@ s32 cellMusicSetVolume(f32 level)
|
||||||
s32 cellMusicGetVolume2(vm::ptr<f32> level)
|
s32 cellMusicGetVolume2(vm::ptr<f32> level)
|
||||||
{
|
{
|
||||||
cellMusic.todo("cellMusicGetVolume2(level=*0x%x)", level);
|
cellMusic.todo("cellMusicGetVolume2(level=*0x%x)", level);
|
||||||
|
|
||||||
|
if (!level)
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue