Beispiel #1
0
int scePsmfPlayerGetCurrentStatus(u32 psmfPlayer) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentStatus(%08x) - invalid psmf", psmfPlayer);
		return ERROR_PSMF_NOT_FOUND;
	}
	DEBUG_LOG(HLE, "%d=scePsmfPlayerGetCurrentStatus(%08x)", psmfplayer->status, psmfPlayer);
	return psmfplayer->status;
}
Beispiel #2
0
int scePsmfPlayerGetCurrentStatus(u32 psmfPlayer) 
{
	ERROR_LOG(HLE, "scePsmfPlayerGetCurrentStatus(%08x)", psmfPlayer);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerUpdate - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	return psmfplayer->status;
}
Beispiel #3
0
u32 scePsmfPlayerSelectVideo(u32 psmfPlayer) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerSelectVideo(%08x): invalid psmf player", psmfPlayer);
		return ERROR_PSMF_NOT_FOUND;
	}
	ERROR_LOG(HLE, "scePsmfPlayerSelectVideo(%08x)", psmfPlayer);
	psmfplayer->videoStreamNum++;
	return 0;
}
Beispiel #4
0
int scePsmfPlayerDelete(u32 psmfPlayer) 
{
	ERROR_LOG(HLE, "UNIMPL scePsmfPlayerDelete(%08x)", psmfPlayer);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (psmfplayer) {
		psmfplayer->status = PSMF_PLAYER_STATUS_NONE;
		delete psmfplayer;
		psmfPlayerMap.erase(psmfPlayer);
	}
	return 0;
}
Beispiel #5
0
u32 scePsmfPlayerSelectAudio(u32 psmfPlayer) 
{
	ERROR_LOG(HLE, "scePsmfPlayerSelectAudio(%08x)", psmfPlayer);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerChangePlayMode - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	psmfplayer->audioStreamNum++;
	return 0;
}
Beispiel #6
0
int scePsmfPlayerDelete(u32 psmfPlayer) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (psmfplayer) {
		INFO_LOG(HLE, "scePsmfPlayerDelete(%08x)", psmfPlayer);
		delete psmfplayer;
		psmfPlayerMap.erase(psmfPlayer);
	} else {
		ERROR_LOG(HLE, "scePsmfPlayerDelete(%08x): invalid psmf player", psmfPlayer);
	}
	return 0;
}
Beispiel #7
0
int scePsmfPlayerSetTempBuf(u32 psmfPlayer, u32 tempBufAddr, u32 tempBufSize) 
{
	INFO_LOG(HLE, "scePsmfPlayerSetTempBuf(%08x, %08x, %08x)", psmfPlayer, tempBufAddr, tempBufSize);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (psmfplayer) {
		psmfplayer->status = PSMF_PLAYER_STATUS_INIT;
		// fake it right now, use tempbuf from memory directly
		//psmfplayer->tempbuf = tempBufAddr;
		//psmfplayer->tempbufSize = tempBufSize;
	}
	return 0;
}
Beispiel #8
0
int scePsmfPlayerGetAudioData(u32 psmfPlayer, u32 audioDataAddr)
{
	ERROR_LOG(HLE, "UNIMPL scePsmfPlayerGetAudioData(%08x, %08x)", psmfPlayer, audioDataAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetAudioData - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}

	Memory::Memset(audioDataAddr, 0, audioSamplesBytes);
	return 0;
}
Beispiel #9
0
int scePsmfPlayerGetCurrentStatus(u32 psmfPlayer) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		// Mana Khemia and other games call this even when not necessary.
		// It's annoying so the logging is verbose'd out.
		VERBOSE_LOG(ME, "scePsmfPlayerGetCurrentStatus(%08x): invalid psmf player", psmfPlayer);
		return ERROR_PSMF_NOT_FOUND;
	}
	DEBUG_LOG(ME, "%d=scePsmfPlayerGetCurrentStatus(%08x)", psmfplayer->status, psmfPlayer);
	return psmfplayer->status;
}
Beispiel #10
0
u32 scePsmfPlayerSelectSpecificAudio(u32 psmfPlayer, int audioCodec, int audioStreamNum) 
{
	ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificAudio(%08x, %i, %i)", psmfPlayer , audioCodec, audioStreamNum);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificAudio - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}

	psmfplayer->audioCodec = audioCodec;
	psmfplayer->audioStreamNum = audioStreamNum;
	return 0;
}
Beispiel #11
0
u32 scePsmfPlayerSelectSpecificVideo(u32 psmfPlayer, int videoCodec, int videoStreamNum) 
{
	ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificVideo(%08x, %i, %i)", psmfPlayer , videoCodec, videoStreamNum);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificVideo - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}

	videoCodec = psmfplayer->videoCodec;
	videoStreamNum = psmfplayer->videoStreamNum;
	return 0;
}
Beispiel #12
0
int scePsmfPlayerGetVideoData(u32 psmfPlayer, u32 videoDataAddr)
{
	ERROR_LOG(HLE, "UNIMPL scePsmfPlayerGetVideoData(%08x, %08x)", psmfPlayer, videoDataAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetVideoData - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}

	// TODO: Once we start increasing pts somewhere, and actually know the last timestamp, do this better.
	psmfplayer->status = PSMF_PLAYER_STATUS_PLAYING_FINISHED;
	return 0;
}
Beispiel #13
0
u32 scePsmfPlayerChangePlayMode(u32 psmfPlayer, int playMode, int playSpeed) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerChangePlayMode(%08x, %i, %i): invalid psmf player", psmfPlayer, playMode, playSpeed);
		return ERROR_PSMF_NOT_FOUND;
	}

	WARN_LOG(HLE, "scePsmfPlayerChangePlayMode(%08x, %i, %i)", psmfPlayer, playMode, playSpeed);
	psmfplayer->playMode = playMode;
	psmfplayer->playSpeed = playSpeed;
	return 0;
}
Beispiel #14
0
u32 scePsmfPlayerSelectSpecificVideo(u32 psmfPlayer, int videoCodec, int videoStreamNum) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificVideo(%08x, %i, %i): invalid psmf player", psmfPlayer, videoCodec, videoStreamNum);
		return ERROR_PSMF_NOT_FOUND;
	}

	ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificVideo(%08x, %i, %i)", psmfPlayer, videoCodec, videoStreamNum);
	psmfplayer->videoCodec = videoCodec;
	psmfplayer->videoStreamNum = videoStreamNum;
	psmfplayer->mediaengine->setVideoStream(videoStreamNum);
	return 0;
}
Beispiel #15
0
u32 scePsmfPlayerSelectSpecificAudio(u32 psmfPlayer, int audioCodec, int audioStreamNum) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificAudio(%08x, %i, %i): invalid psmf player", psmfPlayer, audioCodec, audioStreamNum);
		return ERROR_PSMF_NOT_FOUND;
	}

	ERROR_LOG(HLE, "scePsmfPlayerSelectSpecificAudio(%08x, %i, %i)", psmfPlayer, audioCodec, audioStreamNum);
	psmfplayer->audioCodec = audioCodec;
	psmfplayer->audioStreamNum = audioStreamNum;
	psmfplayer->mediaengine->setAudioStream(audioStreamNum);
	return 0;
}
Beispiel #16
0
int scePsmfPlayerGetAudioData(u32 psmfPlayer, u32 audioDataAddr)
{
	DEBUG_LOG(HLE, "scePsmfPlayerGetAudioData(%08x, %08x)", psmfPlayer, audioDataAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetAudioData - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}

	if (Memory::IsValidAddress(audioDataAddr)) {
		Memory::Memset(audioDataAddr, 0, audioSamplesBytes);
		psmfplayer->mediaengine->getAudioSamples(Memory::GetPointer(audioDataAddr));
	}
	return hleDelayResult(0, "psmfPlayer audio decode", 3000);
}
Beispiel #17
0
u32 scePsmfPlayerGetCurrentPlayMode(u32 psmfPlayer, u32 playModeAddr, u32 playSpeedAddr) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentPlayMode(%08x, %08x, %08x): invalid psmf player", psmfPlayer, playModeAddr, playSpeedAddr);
		return ERROR_PSMF_NOT_FOUND;
	}
	WARN_LOG(HLE, "scePsmfPlayerGetCurrentPlayMode(%08x, %08x, %08x)", psmfPlayer, playModeAddr, playSpeedAddr);
	if (Memory::IsValidAddress(playModeAddr)) {
		Memory::Write_U32(psmfplayer->playMode, playModeAddr); //Fixing for AKB MPEG wrong pointer
	}
	if (Memory::IsValidAddress(playSpeedAddr)) {
		Memory::Write_U32(psmfplayer->playSpeed, playSpeedAddr); //Fixing for AKB MPEG wrong pointer
	}
	return 0;
}
Beispiel #18
0
int scePsmfPlayerGetAudioData(u32 psmfPlayer, u32 audioDataAddr)
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetAudioData(%08x, %08x): invalid psmf player", psmfPlayer, audioDataAddr);
		return ERROR_PSMF_NOT_FOUND;
	}

	DEBUG_LOG(HLE, "scePsmfPlayerGetAudioData(%08x, %08x)", psmfPlayer, audioDataAddr);
	if (Memory::IsValidAddress(audioDataAddr)) {
		Memory::Memset(audioDataAddr, 0, audioSamplesBytes);
		psmfplayer->mediaengine->getAudioSamples(Memory::GetPointer(audioDataAddr));
	}
	int ret = psmfplayer->mediaengine->IsNoAudioData() ? ERROR_PSMFPLAYER_NO_MORE_DATA : 0;
	return hleDelayResult(ret, "psmfPlayer audio decode", 3000);
}
Beispiel #19
0
u32 scePsmfPlayerGetCurrentAudioStream(u32 psmfPlayer, u32 audioCodecAddr, u32 audioStreamNumAddr) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentAudioStream(%08x, %08x, %08x): invalid psmf player", psmfPlayer, audioCodecAddr, audioStreamNumAddr);
		return ERROR_PSMF_NOT_FOUND;
	}
	WARN_LOG(HLE, "scePsmfPlayerGetCurrentAudioStream(%08x, %08x, %08x)", psmfPlayer, audioCodecAddr, audioStreamNumAddr);
	if (Memory::IsValidAddress(audioCodecAddr)) {
		Memory::Write_U64(psmfplayer->audioCodec, audioCodecAddr);
	}
	if (Memory::IsValidAddress(audioStreamNumAddr)) {
		Memory::Write_U64(psmfplayer->audioStreamNum, audioStreamNumAddr);
	}
	return 0;
}
Beispiel #20
0
u32 scePsmfPlayerGetCurrentVideoStream(u32 psmfPlayer, u32 videoCodecAddr, u32 videoStreamNumAddr) 
{
	ERROR_LOG(HLE, "scePsmfPlayerGetCurrentVideoStream(%08x, %08x, %08x)", psmfPlayer , videoCodecAddr, videoStreamNumAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentVideoStream - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	if (Memory::IsValidAddress(videoCodecAddr)) {
		Memory::Write_U64(psmfplayer->videoCodec, videoCodecAddr);
	}
	if (Memory::IsValidAddress(videoStreamNumAddr)) {
		Memory::Write_U64(psmfplayer->videoStreamNum, videoStreamNumAddr);
	}
	return 0;
}
Beispiel #21
0
int scePsmfPlayerSetPsmfOffset(u32 psmfPlayer, const char *filename, int offset) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (psmfplayer)
	{
		INFO_LOG(HLE, "scePsmfPlayerSetPsmfOffset(%08x, %s, %i)", psmfPlayer, filename, offset);
		psmfplayer->status = PSMF_PLAYER_STATUS_STANDBY;
		_PsmfPlayerSetPsmfOffset(psmfplayer, filename, offset, false);
	}
	else
	{
		ERROR_LOG(HLE, "scePsmfPlayerSetPsmfOffset(%08x, %s, %i): invalid psmf player", psmfPlayer, filename, offset);
	}

	return 0;
}
Beispiel #22
0
u32 scePsmfPlayerGetCurrentPlayMode(u32 psmfPlayer, u32 playModeAddr, u32 playSpeedAddr) 
{
	ERROR_LOG(HLE, "scePsmfPlayerGetCurrentPlayMode(%08x, %08x, %08x)", psmfPlayer , playModeAddr, playSpeedAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentPlayMode - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	if (Memory::IsValidAddress(playModeAddr)) {
		Memory::Write_U64(psmfplayer->playMode, playModeAddr);
	}
	if (Memory::IsValidAddress(playSpeedAddr)) {
		Memory::Write_U64(psmfplayer->playSpeed, playSpeedAddr);
	}
	return 0;
}
Beispiel #23
0
u32 scePsmfPlayerConfigPlayer(u32 psmfPlayer, int configMode, int configAttr) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerConfigPlayer - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	if (configMode == PSMF_PLAYER_CONFIG_MODE_LOOP) {
		videoLoopStatus = configAttr;
	} else if (configMode == PSMF_PLAYER_CONFIG_MODE_PIXEL_TYPE) {
		videoPixelMode = configAttr;
	} else {
		ERROR_LOG(HLE, "scePsmfPlayerConfigPlayer(%08x, %i, %i)", psmfPlayer , configMode, configAttr);
	}

	return 0;
}
Beispiel #24
0
u32 scePsmfPlayerGetPsmfInfo(u32 psmfPlayer, u32 psmfInfoAddr) 
{
	ERROR_LOG(HLE, "scePsmfPlayerGetPsmfInfo(%08x, %08x)", psmfPlayer , psmfInfoAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetPsmfInfo - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	if (psmfplayer->status < PSMF_PLAYER_STATUS_STANDBY) {
		return ERROR_PSMFPLAYER_NOT_INITIALIZED;
	}

	if (Memory::IsValidAddress(psmfInfoAddr)) {
		Memory::Write_U64(psmfplayer->psmfPlayerAvcAu.pts, psmfInfoAddr);
	}
	return 0;
}
Beispiel #25
0
int scePsmfPlayerSetPsmfOffsetCB(u32 psmfPlayer, const char *filename, int offset) 
{
	// TODO: hleCheckCurrentCallbacks?
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (psmfplayer)
	{
		INFO_LOG(HLE, "scePsmfPlayerSetPsmfOffsetCB(%08x, %s, %i)", psmfPlayer, filename, offset);
		psmfplayer->status = PSMF_PLAYER_STATUS_STANDBY;
		_PsmfPlayerSetPsmfOffset(psmfplayer, filename, offset, true);
	}
	else
	{
		ERROR_LOG(HLE, "scePsmfPlayerSetPsmfOffsetCB(%08x, %s, %i): invalid psmf player", psmfPlayer, filename, offset);
	}

	return 0;
}
Beispiel #26
0
int scePsmfPlayerUpdate(u32 psmfPlayer) 
{
	DEBUG_LOG(HLE, "scePsmfPlayerUpdate(%08x)", psmfPlayer);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerUpdate - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}

	if (psmfplayer->psmfPlayerAvcAu.pts > 0) {
		if (psmfplayer->psmfPlayerAvcAu.pts >= psmfplayer->psmfPlayerLastTimestamp) {
			INFO_LOG(HLE,"video end reach");
			psmfplayer->status = PSMF_PLAYER_STATUS_PLAYING_FINISHED;
		}
	}
	return 0;
}
Beispiel #27
0
u32 scePsmfPlayerGetCurrentPts(u32 psmfPlayer, u32 currentPtsAddr) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentPts(%08x, %08x): invalid psmf player", psmfPlayer, currentPtsAddr);
		return ERROR_PSMF_NOT_FOUND;
	}
	DEBUG_LOG(HLE, "scePsmfPlayerGetCurrentPts(%08x, %08x)", psmfPlayer, currentPtsAddr);
	if (psmfplayer->status < PSMF_PLAYER_STATUS_STANDBY) {
		return ERROR_PSMFPLAYER_NOT_INITIALIZED;
	}

	if (Memory::IsValidAddress(currentPtsAddr)) {
		Memory::Write_U32(psmfplayer->psmfPlayerAvcAu.pts, currentPtsAddr);
	}	
	return 0;
}
Beispiel #28
0
int scePsmfPlayerUpdate(u32 psmfPlayer) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerUpdate(%08x): invalid psmf player", psmfPlayer);
		return ERROR_PSMF_NOT_FOUND;
	}

	DEBUG_LOG(HLE, "scePsmfPlayerUpdate(%08x)", psmfPlayer);
	if (psmfplayer->psmfPlayerAvcAu.pts > 0) {
		if (psmfplayer->mediaengine->IsVideoEnd()) {
			INFO_LOG(HLE, "video end reached");
			psmfplayer->status = PSMF_PLAYER_STATUS_PLAYING_FINISHED;
		}
	}
	return 0;
}
Beispiel #29
0
int scePsmfPlayerSetPsmf(u32 psmfPlayer, const char *filename) 
{
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (psmfplayer)
	{
		INFO_LOG(HLE, "scePsmfPlayerSetPsmf(%08x, %s)", psmfPlayer, filename);
		psmfplayer->status = PSMF_PLAYER_STATUS_STANDBY;
		psmfplayer->mediaengine->loadFile(filename);
		psmfplayer->psmfPlayerLastTimestamp = psmfplayer->mediaengine->getLastTimeStamp();
	}
	else
	{
		INFO_LOG(HLE, "scePsmfPlayerSetPsmf(%08x, %s): invalid psmf player", psmfPlayer, filename);
	}

	return 0;
}
Beispiel #30
0
u32 scePsmfPlayerGetCurrentPts(u32 psmfPlayer, u32 currentPtsAddr) 
{
	DEBUG_LOG(HLE, "scePsmfPlayerGetCurrentPts(%08x, %08x)", psmfPlayer , currentPtsAddr);
	PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
	if (!psmfplayer) {
		ERROR_LOG(HLE, "scePsmfPlayerGetCurrentPts - invalid psmf");
		return ERROR_PSMF_NOT_FOUND;
	}
	if (psmfplayer->status < PSMF_PLAYER_STATUS_STANDBY) {
		return ERROR_PSMFPLAYER_NOT_INITIALIZED;
	}

	if (Memory::IsValidAddress(currentPtsAddr)) {
		//Comment out until psmfPlayerAvcAu.pts start increasing correctly, Ultimate Ghosts N Goblins relies on it .
		Memory::Write_U64(psmfplayer->psmfPlayerAvcAu.pts, currentPtsAddr);
	}	
	return 0;
}