cellSysutilBgmPlayback fix

This commit is contained in:
Nekotekina 2014-06-27 15:11:56 +04:00
parent 458322e548
commit 5ef3b80596
2 changed files with 52 additions and 34 deletions

View file

@ -257,23 +257,38 @@ struct CellAudioInDeviceConfiguration
u8 reserved[31]; u8 reserved[31];
}; };
enum CellBgmPlaybackStatusState enum CellSysutilBgmPlaybackStatusState
{ {
CELL_BGMPLAYBACK_STATUS_PLAY = 0, CELL_SYSUTIL_BGMPLAYBACK_STATUS_PLAY = 0,
CELL_BGMPLAYBACK_STATUS_STOP = 1 CELL_SYSUTIL_BGMPLAYBACK_STATUS_STOP = 1
}; };
enum CellBgmPlaybackStatusEnabled enum CellSysutilBgmPlaybackStatusEnabled
{ {
CELL_BGMPLAYBACK_STATUS_ENABLE = 0, CELL_SYSUTIL_BGMPLAYBACK_STATUS_ENABLE = 0,
CELL_BGMPLAYBACK_STATUS_DISABLE = 1 CELL_SYSUTIL_BGMPLAYBACK_STATUS_DISABLE = 1
}; };
struct CellBgmPlaybackStatus struct CellSysutilBgmPlaybackStatus
{ {
u8 playbackState; u8 playerState;
u8 enabled; u8 enableState;
char contentId[16]; char contentId[16];
u8 fadeRatio; u8 currentFadeRatio;
char reserved[13]; char reserved[13];
}; };
struct CellSysutilBgmPlaybackStatus2
{
u8 playerState;
char reserved[7];
};
struct CellSysutilBgmPlaybackExtraParam
{
be_t<s32> systemBgmFadeInTime;
be_t<s32> systemBgmFadeOutTime;
be_t<s32> gameBgmFadeInTime;
be_t<s32> gameBgmFadeOutTime;
char reserved[8];
};

View file

@ -919,22 +919,24 @@ int cellHddGameCheck(u32 version, u32 dirName_addr, u32 errDialog, mem_func_ptr_
return CELL_OK; return CELL_OK;
} }
bool bgm_playback_enabled = false; bool bgm_playback_enabled = true;
int cellSysutilEnableBgmPlayback() int cellSysutilEnableBgmPlayback()
{ {
cellSysutil->Warning("cellSysutilEnableBgmPlayback()"); cellSysutil->Warning("cellSysutilEnableBgmPlayback()");
// TODO
bgm_playback_enabled = true; bgm_playback_enabled = true;
return CELL_OK; return CELL_OK;
} }
int cellSysutilEnableBgmPlaybackEx() int cellSysutilEnableBgmPlaybackEx(mem_ptr_t<CellSysutilBgmPlaybackExtraParam> param)
{ {
cellSysutil->Warning("cellSysutilEnableBgmPlaybackEx()"); cellSysutil->Warning("cellSysutilEnableBgmPlaybackEx(param_addr=0x%x)", param.GetAddr());
bgm_playback_enabled = true; // TODO
bgm_playback_enabled = true;
return CELL_OK; return CELL_OK;
} }
@ -943,42 +945,43 @@ int cellSysutilDisableBgmPlayback()
{ {
cellSysutil->Warning("cellSysutilDisableBgmPlayback()"); cellSysutil->Warning("cellSysutilDisableBgmPlayback()");
// TODO
bgm_playback_enabled = false; bgm_playback_enabled = false;
return CELL_OK; return CELL_OK;
} }
int cellSysutilDisableBgmPlaybackEx() int cellSysutilDisableBgmPlaybackEx(mem_ptr_t<CellSysutilBgmPlaybackExtraParam> param)
{ {
cellSysutil->Warning("cellSysutilDisableBgmPlaybackEx()"); cellSysutil->Warning("cellSysutilDisableBgmPlaybackEx(param_addr=0x%x)", param.GetAddr());
bgm_playback_enabled = false;
return CELL_OK;
}
int cellSysutilGetBgmPlaybackStatus(mem_ptr_t<CellBgmPlaybackStatus> status)
{
cellSysutil->Warning("cellSysutilGetBgmPlaybackStatus(status=0x%x)", status.GetAddr());
// TODO // TODO
status->playbackState = CELL_BGMPLAYBACK_STATUS_STOP; bgm_playback_enabled = false;
status->enabled = bgm_playback_enabled ? CELL_BGMPLAYBACK_STATUS_ENABLE : CELL_BGMPLAYBACK_STATUS_DISABLE;
status->fadeRatio = 0; // volume ratio return CELL_OK;
}
int cellSysutilGetBgmPlaybackStatus(mem_ptr_t<CellSysutilBgmPlaybackStatus> status)
{
cellSysutil->Log("cellSysutilGetBgmPlaybackStatus(status_addr=0x%x)", status.GetAddr());
// TODO
status->playerState = CELL_SYSUTIL_BGMPLAYBACK_STATUS_STOP;
status->enableState = bgm_playback_enabled ? CELL_SYSUTIL_BGMPLAYBACK_STATUS_ENABLE : CELL_SYSUTIL_BGMPLAYBACK_STATUS_DISABLE;
status->currentFadeRatio = 0; // current volume ratio (0%)
memset(status->contentId, 0, sizeof(status->contentId)); memset(status->contentId, 0, sizeof(status->contentId));
memset(status->reserved, 0, sizeof(status->reserved));
return CELL_OK; return CELL_OK;
} }
int cellSysutilGetBgmPlaybackStatus2(mem_ptr_t<CellBgmPlaybackStatus> status2) int cellSysutilGetBgmPlaybackStatus2(mem_ptr_t<CellSysutilBgmPlaybackStatus2> status2)
{ {
cellSysutil->Warning("cellSysutilGetBgmPlaybackStatus2(status=0x%x)", status2.GetAddr()); cellSysutil->Log("cellSysutilGetBgmPlaybackStatus2(status2_addr=0x%x)", status2.GetAddr());
// TODO // TODO
status2->playbackState = CELL_BGMPLAYBACK_STATUS_STOP; status2->playerState = CELL_SYSUTIL_BGMPLAYBACK_STATUS_STOP;
status2->enabled = bgm_playback_enabled ? CELL_BGMPLAYBACK_STATUS_ENABLE : CELL_BGMPLAYBACK_STATUS_DISABLE; memset(status2->reserved, 0, sizeof(status2->reserved));
status2->fadeRatio = 0; // volume ratio
memset(status2->contentId, 0, sizeof(status2->contentId));
return CELL_OK; return CELL_OK;
} }