mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-21 14:41:39 +00:00
Implement a couple basic Psmf functions, unify some project settings, update native.
This commit is contained in:
parent
2e7b971895
commit
a3dd3b53c3
@ -36,7 +36,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
@ -142,7 +142,7 @@
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<OmitFramePointers>false</OmitFramePointers>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>USE_FFMPEG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
@ -497,4 +497,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
@ -110,6 +110,13 @@ public:
|
||||
Psmf(u32 data);
|
||||
~Psmf();
|
||||
void DoState(PointerWrap &p);
|
||||
|
||||
bool isValidCurrentStreamNumber() {
|
||||
return currentStreamNum >= 0 && currentStreamNum < streamMap.size(); // urgh, checking size isn't really right here.
|
||||
}
|
||||
|
||||
void setStreamNum(int num);
|
||||
bool setStreamWithType(int type, int channel);
|
||||
|
||||
u32 magic;
|
||||
u32 version;
|
||||
@ -209,6 +216,7 @@ public:
|
||||
p.Do(channel);
|
||||
}
|
||||
|
||||
|
||||
int type;
|
||||
int channel;
|
||||
};
|
||||
@ -317,6 +325,45 @@ void PsmfPlayer::DoState(PointerWrap &p) {
|
||||
p.DoMarker("PsmfPlayer");
|
||||
}
|
||||
|
||||
void Psmf::setStreamNum(int num) {
|
||||
currentStreamNum = num;
|
||||
if (!isValidCurrentStreamNumber())
|
||||
return;
|
||||
PsmfStreamMap::iterator iter = streamMap.find(currentStreamNum);
|
||||
if (iter == streamMap.end())
|
||||
return;
|
||||
|
||||
int type = iter->second->type;
|
||||
int channel = iter->second->channel;
|
||||
switch (type) {
|
||||
case PSMF_AVC_STREAM:
|
||||
if (currentVideoStreamNum != num) {
|
||||
// TODO: Tell video mediaengine or something about channel.
|
||||
currentVideoStreamNum = num;
|
||||
}
|
||||
break;
|
||||
|
||||
case PSMF_ATRAC_STREAM:
|
||||
case PSMF_PCM_STREAM:
|
||||
if (currentAudioStreamNum != num) {
|
||||
// TODO: Tell audio mediaengine or something about channel.
|
||||
currentAudioStreamNum = num;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool Psmf::setStreamWithType(int type, int channel) {
|
||||
for (PsmfStreamMap::iterator iter = streamMap.begin(); iter != streamMap.end(); ++iter) {
|
||||
if (iter->second->type == type) {
|
||||
setStreamNum(iter->first);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static std::map<u32, Psmf *> psmfMap;
|
||||
static std::map<u32, PsmfPlayer *> psmfPlayerMap;
|
||||
|
||||
@ -407,18 +454,37 @@ u32 scePsmfGetNumberOfSpecificStreams(u32 psmfStruct, u32 streamType)
|
||||
|
||||
u32 scePsmfSpecifyStreamWithStreamType(u32 psmfStruct, u32 streamType, u32 channel)
|
||||
{
|
||||
Psmf *psmf = getPsmf(psmfStruct);
|
||||
if (!psmf) {
|
||||
ERROR_LOG(HLE, "scePsmfSpecifyStreamWithStreamType - invalid psmf");
|
||||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
ERROR_LOG(HLE, "UNIMPL scePsmfSpecifyStreamWithStreamType(%08x, %08x, %i)", psmfStruct, streamType, channel);
|
||||
if (!psmf->setStreamWithType(streamType, channel)) {
|
||||
psmf->setStreamNum(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 scePsmfSpecifyStreamWithStreamTypeNumber(u32 psmfStruct, u32 streamType, u32 typeNum)
|
||||
{
|
||||
Psmf *psmf = getPsmf(psmfStruct);
|
||||
if (!psmf) {
|
||||
ERROR_LOG(HLE, "scePsmfSpecifyStream - invalid psmf");
|
||||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
ERROR_LOG(HLE, "UNIMPL scePsmfSpecifyStreamWithStreamTypeNumber(%08x, %08x, %08x)", psmfStruct, streamType, typeNum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 scePsmfSpecifyStream(u32 psmfPlayer, int streamNum) {
|
||||
ERROR_LOG(HLE, "UNIMPL scePsmfSpecifyStream(%08x, %i)", psmfPlayer, streamNum);
|
||||
u32 scePsmfSpecifyStream(u32 psmfStruct, int streamNum) {
|
||||
Psmf *psmf = getPsmf(psmfStruct);
|
||||
if (!psmf) {
|
||||
ERROR_LOG(HLE, "scePsmfSpecifyStream - invalid psmf");
|
||||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
INFO_LOG(HLE, "scePsmfSpecifyStream(%08x, %i)", psmfStruct, streamNum);
|
||||
psmf->setStreamNum(streamNum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -63,14 +63,14 @@
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
@ -39,14 +39,14 @@
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
@ -38,13 +38,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
2
native
2
native
@ -1 +1 @@
|
||||
Subproject commit 628005799f57aff04694d618dc59d1efb0a3fe44
|
||||
Subproject commit c94767905aa6fc1f0853e052948d2ebc27eb1b9b
|
@ -41,14 +41,14 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user