mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-25 21:40:54 +00:00
Merge pull request #326 from Nekotekina/master
cellSysmoduleLoadModule modified
This commit is contained in:
commit
c9dec7b118
42
Utilities/Interval.h
Normal file
42
Utilities/Interval.h
Normal file
@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
template<typename T>
|
||||
struct BaseInterval
|
||||
{
|
||||
static const uint64_t zero = 0ull;
|
||||
static const uint64_t notz = 0xffffffffffffffffull;
|
||||
|
||||
T m_min, m_max;
|
||||
|
||||
static BaseInterval<T> make(T min_value, T max_value)
|
||||
{
|
||||
BaseInterval<T> res = { min_value, max_value };
|
||||
return res;
|
||||
}
|
||||
|
||||
static BaseInterval<T> make()
|
||||
{
|
||||
return make((T&)zero, (T&)notz);
|
||||
}
|
||||
|
||||
bool getconst(T& result)
|
||||
{
|
||||
if (m_min == m_max)
|
||||
{
|
||||
result = m_min;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool isindef()
|
||||
{
|
||||
if (T == float)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
};
|
@ -1211,12 +1211,19 @@ private:
|
||||
c.add(*addr, cpu_dword(GPR[rb]._u32[3]));
|
||||
}
|
||||
c.and_(*addr, 0x3fff0);
|
||||
|
||||
/*const XmmLink& vt = XmmGet(rt);
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
c.movdqa(oword_ptr(*ls_var, *addr), vt.get());
|
||||
XmmFinalize(vt);*/
|
||||
|
||||
c.mov(*qw0, cpu_qword(GPR[rt]._u64[0]));
|
||||
c.mov(*qw1, cpu_qword(GPR[rt]._u64[1]));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(qword_ptr(*ls_var, *addr, 0, 0), *qw1);
|
||||
c.mov(qword_ptr(*ls_var, *addr, 0, 8), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void BI(u32 ra)
|
||||
@ -1350,12 +1357,19 @@ private:
|
||||
c.add(*addr, cpu_dword(GPR[rb]._u32[3]));
|
||||
}
|
||||
c.and_(*addr, 0x3fff0);
|
||||
|
||||
/*const XmmLink& vt = XmmAlloc(rt);
|
||||
c.movdqa(vt.get(), oword_ptr(*ls_var, *addr));
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
XmmFinalize(vt, rt);*/
|
||||
|
||||
c.mov(*qw0, qword_ptr(*ls_var, *addr, 0, 0));
|
||||
c.mov(*qw1, qword_ptr(*ls_var, *addr, 0, 8));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[0]), *qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[1]), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void ROTQBYBI(u32 rt, u32 ra, u32 rb)
|
||||
@ -2798,12 +2812,19 @@ private:
|
||||
void STQA(u32 rt, s32 i16)
|
||||
{
|
||||
const u32 lsa = (i16 << 2) & 0x3fff0;
|
||||
|
||||
/*const XmmLink& vt = XmmGet(rt);
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
c.movdqa(oword_ptr(*ls_var, lsa), vt.get());
|
||||
XmmFinalize(vt);*/
|
||||
|
||||
c.mov(*qw0, cpu_qword(GPR[rt]._u64[0]));
|
||||
c.mov(*qw1, cpu_qword(GPR[rt]._u64[1]));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(qword_ptr(*ls_var, lsa), *qw1);
|
||||
c.mov(qword_ptr(*ls_var, lsa + 8), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void BRNZ(u32 rt, s32 i16)
|
||||
@ -2842,12 +2863,19 @@ private:
|
||||
void STQR(u32 rt, s32 i16)
|
||||
{
|
||||
const u32 lsa = branchTarget(CPU.PC, i16) & 0x3fff0;
|
||||
|
||||
/*const XmmLink& vt = XmmGet(rt);
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
c.movdqa(oword_ptr(*ls_var, lsa), vt.get());
|
||||
XmmFinalize(vt);*/
|
||||
|
||||
c.mov(*qw0, cpu_qword(GPR[rt]._u64[0]));
|
||||
c.mov(*qw1, cpu_qword(GPR[rt]._u64[1]));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(qword_ptr(*ls_var, lsa), *qw1);
|
||||
c.mov(qword_ptr(*ls_var, lsa + 8), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void BRA(s32 i16)
|
||||
@ -2863,12 +2891,19 @@ private:
|
||||
XmmInvalidate(rt);
|
||||
|
||||
const u32 lsa = (i16 << 2) & 0x3fff0;
|
||||
|
||||
/*const XmmLink& vt = XmmAlloc(rt);
|
||||
c.movdqa(vt.get(), oword_ptr(*ls_var, lsa));
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
XmmFinalize(vt, rt);*/
|
||||
|
||||
c.mov(*qw0, qword_ptr(*ls_var, lsa));
|
||||
c.mov(*qw1, qword_ptr(*ls_var, lsa + 8));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[0]), *qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[1]), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void BRASL(u32 rt, s32 i16)
|
||||
@ -2931,12 +2966,19 @@ private:
|
||||
XmmInvalidate(rt);
|
||||
|
||||
const u32 lsa = branchTarget(CPU.PC, i16) & 0x3fff0;
|
||||
|
||||
/*const XmmLink& vt = XmmAlloc(rt);
|
||||
c.movdqa(vt.get(), oword_ptr(*ls_var, lsa));
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
XmmFinalize(vt, rt);*/
|
||||
|
||||
c.mov(*qw0, qword_ptr(*ls_var, lsa));
|
||||
c.mov(*qw1, qword_ptr(*ls_var, lsa + 8));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[0]), *qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[1]), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void IL(u32 rt, s32 i16)
|
||||
@ -3265,12 +3307,19 @@ private:
|
||||
c.mov(*addr, cpu_dword(GPR[ra]._u32[3]));
|
||||
if (i10) c.add(*addr, i10);
|
||||
c.and_(*addr, 0x3fff0);
|
||||
|
||||
/*const XmmLink& vt = XmmGet(rt);
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
c.movdqa(oword_ptr(*ls_var, *addr), vt.get());
|
||||
XmmFinalize(vt);*/
|
||||
|
||||
c.mov(*qw0, cpu_qword(GPR[rt]._u64[0]));
|
||||
c.mov(*qw1, cpu_qword(GPR[rt]._u64[1]));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(qword_ptr(*ls_var, *addr, 0, 0), *qw1);
|
||||
c.mov(qword_ptr(*ls_var, *addr, 0, 8), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void LQD(u32 rt, s32 i10, u32 ra) // i10 is shifted left by 4 while decoding
|
||||
@ -3280,12 +3329,19 @@ private:
|
||||
c.mov(*addr, cpu_dword(GPR[ra]._u32[3]));
|
||||
if (i10) c.add(*addr, i10);
|
||||
c.and_(*addr, 0x3fff0);
|
||||
|
||||
/*const XmmLink& vt = XmmAlloc(rt);
|
||||
c.movdqa(vt.get(), oword_ptr(*ls_var, *addr));
|
||||
c.pshufb(vt.get(), XmmConst(_mm_set_epi32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f)));
|
||||
XmmFinalize(vt, rt);*/
|
||||
|
||||
c.mov(*qw0, qword_ptr(*ls_var, *addr, 0, 0));
|
||||
c.mov(*qw1, qword_ptr(*ls_var, *addr, 0, 8));
|
||||
c.bswap(*qw0);
|
||||
c.bswap(*qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[0]), *qw1);
|
||||
c.mov(cpu_qword(GPR[rt]._u64[1]), *qw0);
|
||||
|
||||
LOG_OPCODE();
|
||||
}
|
||||
void XORI(u32 rt, u32 ra, s32 i10)
|
||||
|
@ -169,20 +169,18 @@ int cellSysmoduleLoadModule(u16 id)
|
||||
cellSysmodule->Error("cellSysmoduleLoadModule: TODO: CELL_SYSMODULE_LIBATRAC3MULTI");
|
||||
}
|
||||
cellSysmodule->Warning("cellSysmoduleLoadModule(%s)", getModuleName(id));
|
||||
Module* m = Emu.GetModuleManager().GetModuleById(id);
|
||||
|
||||
if(!m)
|
||||
if (Module* m = Emu.GetModuleManager().GetModuleById(id))
|
||||
{
|
||||
// CELL_SYSMODULE_ERROR_DUPLICATED shouldn't be returned (it breaks some games)
|
||||
// If some game requires it yet, there probably should be a configurable hack or something.
|
||||
m->Load();
|
||||
return CELL_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CELL_SYSMODULE_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
if(m->IsLoaded() && id != 0x10) // CELL_SYSMODULE_GCM_SYS and CELL_SYSMODULE_GCM share the same ID
|
||||
{
|
||||
return CELL_SYSMODULE_ERROR_DUPLICATED;
|
||||
}
|
||||
|
||||
m->Load();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSysmoduleUnloadModule(u16 id)
|
||||
|
@ -919,13 +919,23 @@ int cellHddGameCheck(u32 version, u32 dirName_addr, u32 errDialog, mem_func_ptr_
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
bool bgm_playback_enabled = false;
|
||||
|
||||
int cellSysutilEnableBgmPlayback()
|
||||
{
|
||||
cellSysutil->Warning("cellSysutilEnableBgmPlayback()");
|
||||
|
||||
bgm_playback_enabled = true;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSysutilGetBgmPlaybackStatus(mem_ptr_t<CellBgmPlaybackStatus> status)
|
||||
{
|
||||
cellSysutil->Warning("cellSysutilGetBgmPlaybackStatus(status=0x%x)", status.GetAddr());
|
||||
|
||||
// non-essential, so always assume background music is stopped/disabled
|
||||
// TODO
|
||||
status->playbackState = CELL_BGMPLAYBACK_STATUS_STOP;
|
||||
status->enabled = CELL_BGMPLAYBACK_STATUS_DISABLE;
|
||||
status->enabled = bgm_playback_enabled ? CELL_BGMPLAYBACK_STATUS_ENABLE : CELL_BGMPLAYBACK_STATUS_DISABLE;
|
||||
status->fadeRatio = 0; // volume ratio
|
||||
memset(status->contentId, 0, sizeof(status->contentId));
|
||||
|
||||
@ -970,6 +980,7 @@ void cellSysutil_init()
|
||||
cellSysutil->AddFunc(0xc96e89e9, cellAudioOutSetCopyControl);
|
||||
|
||||
cellSysutil->AddFunc(0xa11552f6, cellSysutilGetBgmPlaybackStatus);
|
||||
cellSysutil->AddFunc(0x220894e3, cellSysutilEnableBgmPlayback);
|
||||
|
||||
cellSysutil->AddFunc(0x1e7bff94, cellSysCacheMount);
|
||||
cellSysutil->AddFunc(0x744c1544, cellSysCacheClear);
|
||||
|
@ -342,13 +342,17 @@ int cellSurMixerPause(u32 type)
|
||||
|
||||
int cellSurMixerGetCurrentBlockTag(mem64_t tag)
|
||||
{
|
||||
libmixer->Error("cellSurMixerGetCurrentBlockTag(tag_addr=0x%x)", tag.GetAddr());
|
||||
libmixer->Log("cellSurMixerGetCurrentBlockTag(tag_addr=0x%x)", tag.GetAddr());
|
||||
|
||||
tag = mixcount;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSurMixerGetTimestamp(u64 tag, mem64_t stamp)
|
||||
{
|
||||
libmixer->Error("cellSurMixerGetTimestamp(tag=0x%llx, stamp_addr=0x%x)", tag, stamp.GetAddr());
|
||||
libmixer->Log("cellSurMixerGetTimestamp(tag=0x%llx, stamp_addr=0x%x)", tag, stamp.GetAddr());
|
||||
|
||||
stamp = m_config.start_time + (tag) * 256000000 / 48000; // ???
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user