Better wrapper system, and fixed warnings
This commit is contained in:
parent
a54dcbedc1
commit
a00b1855cb
34 changed files with 708 additions and 683 deletions
|
@ -173,9 +173,9 @@ void CPUInfo::Detect()
|
||||||
if (max_ex_fn >= 0x80000001) {
|
if (max_ex_fn >= 0x80000001) {
|
||||||
// Check for more features.
|
// Check for more features.
|
||||||
__cpuid(cpu_id, 0x80000001);
|
__cpuid(cpu_id, 0x80000001);
|
||||||
bool cmp_legacy = false;
|
//bool cmp_legacy = false;
|
||||||
if (cpu_id[2] & 1) bLAHFSAHF64 = true;
|
if (cpu_id[2] & 1) bLAHFSAHF64 = true;
|
||||||
if (cpu_id[2] & 2) cmp_legacy = true; //wtf is this?
|
//if (cpu_id[2] & 2) cmp_legacy = true; //wtf is this?
|
||||||
if ((cpu_id[3] >> 29) & 1) bLongMode = true;
|
if ((cpu_id[3] >> 29) & 1) bLongMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
|
|
||||||
bool remove(T item)
|
bool remove(T item)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count_; i++)
|
for (u32 i = 0; i < count_; i++)
|
||||||
{
|
{
|
||||||
if (data_[i] == item)
|
if (data_[i] == item)
|
||||||
{
|
{
|
||||||
|
@ -62,5 +62,5 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T data_[maxCount];
|
T data_[maxCount];
|
||||||
int count_;
|
u32 count_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,12 +31,9 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||||
info.hasImmediate = false;
|
info.hasImmediate = false;
|
||||||
info.isMemoryWrite = false;
|
info.isMemoryWrite = false;
|
||||||
|
|
||||||
int addressSize = 8;
|
|
||||||
u8 modRMbyte = 0;
|
u8 modRMbyte = 0;
|
||||||
u8 sibByte = 0;
|
u8 sibByte = 0;
|
||||||
bool hasModRM = false;
|
bool hasModRM = false;
|
||||||
bool hasSIBbyte = false;
|
|
||||||
bool hasDisplacement = false;
|
|
||||||
|
|
||||||
int displacementSize = 0;
|
int displacementSize = 0;
|
||||||
|
|
||||||
|
@ -47,7 +44,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||||
}
|
}
|
||||||
else if (*codePtr == 0x67)
|
else if (*codePtr == 0x67)
|
||||||
{
|
{
|
||||||
addressSize = 4;
|
|
||||||
codePtr++;
|
codePtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +109,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||||
info.otherReg = (sibByte & 7);
|
info.otherReg = (sibByte & 7);
|
||||||
if (rex & 2) info.scaledReg += 8;
|
if (rex & 2) info.scaledReg += 8;
|
||||||
if (rex & 1) info.otherReg += 8;
|
if (rex & 1) info.otherReg += 8;
|
||||||
hasSIBbyte = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -122,7 +117,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||||
}
|
}
|
||||||
if (mrm.mod == 1 || mrm.mod == 2)
|
if (mrm.mod == 1 || mrm.mod == 2)
|
||||||
{
|
{
|
||||||
hasDisplacement = true;
|
|
||||||
if (mrm.mod == 1)
|
if (mrm.mod == 1)
|
||||||
displacementSize = 1;
|
displacementSize = 1;
|
||||||
else
|
else
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
|
|
||||||
#if !defined(_M_IX86) && !defined(_M_X64)
|
#if !defined(_M_IX86) && !defined(_M_X64)
|
||||||
#error Don't build this on arm.
|
#error Do not build this on arm.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Gen
|
namespace Gen
|
||||||
|
|
|
@ -154,7 +154,6 @@ bool ElfReader::LoadInto(u32 vaddr)
|
||||||
if (s->sh_type == SHT_PSPREL)
|
if (s->sh_type == SHT_PSPREL)
|
||||||
{
|
{
|
||||||
//We have a relocation table!
|
//We have a relocation table!
|
||||||
int symbolSection = s->sh_link;
|
|
||||||
int sectionToModify = s->sh_info;
|
int sectionToModify = s->sh_info;
|
||||||
|
|
||||||
if (!(sections[sectionToModify].sh_flags & SHF_ALLOC))
|
if (!(sections[sectionToModify].sh_flags & SHF_ALLOC))
|
||||||
|
@ -289,7 +288,6 @@ bool ElfReader::LoadInto(u32 vaddr)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//We have a relocation table!
|
//We have a relocation table!
|
||||||
int symbolSection = s->sh_link;
|
|
||||||
int sectionToModify = s->sh_info;
|
int sectionToModify = s->sh_info;
|
||||||
if (!(sections[sectionToModify].sh_flags & SHF_ALLOC))
|
if (!(sections[sectionToModify].sh_flags & SHF_ALLOC))
|
||||||
{
|
{
|
||||||
|
@ -341,7 +339,6 @@ bool ElfReader::LoadSymbols()
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int bind = symtab[sym].st_info >> 4;
|
|
||||||
int type = symtab[sym].st_info & 0xF;
|
int type = symtab[sym].st_info & 0xF;
|
||||||
int sectionIndex = symtab[sym].st_shndx;
|
int sectionIndex = symtab[sym].st_shndx;
|
||||||
int value = symtab[sym].st_value;
|
int value = symtab[sym].st_value;
|
||||||
|
|
|
@ -21,66 +21,137 @@
|
||||||
|
|
||||||
// For easy parameter parsing and return value processing.
|
// For easy parameter parsing and return value processing.
|
||||||
|
|
||||||
template<void func()> void WrapV_V() {
|
template<void func()> void Wrap() {
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func()> void WrapU_V() {
|
template<u32 func()> void Wrap() {
|
||||||
RETURN(func());
|
RETURN(func());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<float func()> void WrapF_V() {
|
template<float func()> void Wrap() {
|
||||||
RETURNF(func());
|
RETURNF(func());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func(u32)> void WrapU_U() {
|
template<u32 func(u32)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<int func(int)> void Wrap() {
|
||||||
|
int retval = func(PARAM(0));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(int)> void Wrap() {
|
||||||
u32 retval = func(PARAM(0));
|
u32 retval = func(PARAM(0));
|
||||||
RETURN(retval);
|
RETURN(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<void func(u32)> void WrapV_U() {
|
template<void func(u32)> void Wrap() {
|
||||||
func(PARAM(0));
|
func(PARAM(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<void func(u32, u32)> void WrapV_UU() {
|
template <u32 func(time_t *)> void Wrap() {
|
||||||
|
u32 retval = func((time_t*)Memory::GetPointer(PARAM(0)));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<void func(u32, u32)> void Wrap() {
|
||||||
func(PARAM(0), PARAM(1));
|
func(PARAM(0), PARAM(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func(u32, u32)> void WrapU_UU() {
|
template<u32 func(u32, u32)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), PARAM(1));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(timeval *, u32)> void Wrap() {
|
||||||
|
u32 retval = func((timeval*)Memory::GetPointer(PARAM(0)), PARAM(1));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(int, u32)> void Wrap() {
|
||||||
u32 retval = func(PARAM(0), PARAM(1));
|
u32 retval = func(PARAM(0), PARAM(1));
|
||||||
RETURN(retval);
|
RETURN(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int func(const char *, u32)> void WrapI_CU() {
|
template<int func(const char *, u32)> void Wrap() {
|
||||||
int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
|
int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
|
||||||
RETURN((u32)retval);
|
RETURN((u32)retval);
|
||||||
}
|
}
|
||||||
|
template<u32 func(const char *, int)> void Wrap() {
|
||||||
|
u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
|
||||||
template<u32 func(const char *, u32, u32)> void WrapU_CUU() {
|
template<u32 func(const char *, u32, u32)> void Wrap() {
|
||||||
|
int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
|
||||||
|
RETURN((u32)retval);
|
||||||
|
}
|
||||||
|
template<u32 func(const char *, int, int)> void Wrap() {
|
||||||
int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
|
int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
|
||||||
RETURN((u32)retval);
|
RETURN((u32)retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func(u32, u32, u32)> void WrapU_UUU() {
|
template<u32 func(u32, u32, u32)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(int, int, u32)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(int, u32, u32)> void Wrap() {
|
||||||
u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
|
||||||
RETURN(retval);
|
RETURN(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<void func(u32, u32, u32)> void WrapV_UUU() {
|
template<void func(u32, u32, u32)> void Wrap() {
|
||||||
func(PARAM(0), PARAM(1), PARAM(2));
|
func(PARAM(0), PARAM(1), PARAM(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func(u32, u32, u32, u32)> void WrapU_UUUU() {
|
template<u32 func(u32, u32, u32, u32)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(u32, int, int, int)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
template<u32 func(u32, u32, u32, int)> void Wrap() {
|
||||||
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
|
||||||
RETURN(retval);
|
RETURN(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func(u32, u32, u32, u32, u32)> void WrapU_UUUUU() {
|
template<u32 func(u32, u32, u32, u32, u32)> void Wrap() {
|
||||||
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
|
||||||
RETURN(retval);
|
RETURN(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 func(u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUU() {
|
template<u32 func(u32, u32, u32, u32, u32, u32)> void Wrap() {
|
||||||
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
|
||||||
RETURN(retval);
|
RETURN(retval);
|
||||||
}
|
}
|
||||||
|
template<u32 func(u32, int, u32, int, u32, int)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<u32 func(u64)> void Wrap() {
|
||||||
|
u32 retval = func(((u64)PARAM(1) << 32) | PARAM(0));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<u64 func(u32, u64, u32)> void Wrap() {
|
||||||
|
u64 retval = func(PARAM(0), ((u64)PARAM(3) << 32) | PARAM(2), PARAM(4));
|
||||||
|
RETURN(retval);
|
||||||
|
RETURN2(retval >> 32);
|
||||||
|
}
|
||||||
|
template<u64 func(int, s64, u32)> void Wrap() {
|
||||||
|
u64 retval = func(PARAM(0), ((u64)PARAM(3) << 32) | PARAM(2), PARAM(4));
|
||||||
|
RETURN(retval);
|
||||||
|
RETURN2(retval >> 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<u32 func(int, s64, u32)> void Wrap() {
|
||||||
|
u32 retval = func(PARAM(0), ((u64)PARAM(3) << 32) | PARAM(2), PARAM(4));
|
||||||
|
RETURN(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ struct HLEModule
|
||||||
|
|
||||||
#define PARAM(n) currentMIPS->r[4+n]
|
#define PARAM(n) currentMIPS->r[4+n]
|
||||||
#define RETURN(n) currentMIPS->r[2]=n
|
#define RETURN(n) currentMIPS->r[2]=n
|
||||||
|
#define RETURN2(n) currentMIPS->r[3]=n
|
||||||
#define RETURNF(fl) currentMIPS->f[0]=fl
|
#define RETURNF(fl) currentMIPS->f[0]=fl
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
|
|
|
@ -65,9 +65,9 @@ const HLEFunction FakeSysCalls[] =
|
||||||
|
|
||||||
const HLEFunction UtilsForUser[] =
|
const HLEFunction UtilsForUser[] =
|
||||||
{
|
{
|
||||||
{0x91E4F6A7, sceKernelLibcClock, "sceKernelLibcClock"},
|
{0x91E4F6A7, &Wrap<sceKernelLibcClock>, "sceKernelLibcClock"},
|
||||||
{0x27CC57F0, sceKernelLibcTime, "sceKernelLibcTime"},
|
{0x27CC57F0, &Wrap<sceKernelLibcTime>, "sceKernelLibcTime"},
|
||||||
{0x71EC4271, sceKernelLibcGettimeofday, "sceKernelLibcGettimeofday"},
|
{0x71EC4271, &Wrap<sceKernelLibcGettimeofday>, "sceKernelLibcGettimeofday"},
|
||||||
{0xBFA98062, 0, "sceKernelDcacheInvalidateRange"},
|
{0xBFA98062, 0, "sceKernelDcacheInvalidateRange"},
|
||||||
{0xC8186A58, 0, "sceKernelUtilsMd5Digest"},
|
{0xC8186A58, 0, "sceKernelUtilsMd5Digest"},
|
||||||
{0x9E5C5086, 0, "sceKernelUtilsMd5BlockInit"},
|
{0x9E5C5086, 0, "sceKernelUtilsMd5BlockInit"},
|
||||||
|
@ -79,28 +79,28 @@ const HLEFunction UtilsForUser[] =
|
||||||
{0x585F1C09, 0, "sceKernelUtilsSha1BlockResult"},
|
{0x585F1C09, 0, "sceKernelUtilsSha1BlockResult"},
|
||||||
{0xE860E75E, 0, "sceKernelUtilsMt19937Init"},
|
{0xE860E75E, 0, "sceKernelUtilsMt19937Init"},
|
||||||
{0x06FB8A63, 0, "sceKernelUtilsMt19937UInt"},
|
{0x06FB8A63, 0, "sceKernelUtilsMt19937UInt"},
|
||||||
{0x37FB5C42, sceKernelGetGPI, "sceKernelGetGPI"},
|
{0x37FB5C42, &Wrap<sceKernelGetGPI>, "sceKernelGetGPI"},
|
||||||
{0x6AD345D7, sceKernelSetGPO, "sceKernelSetGPO"},
|
{0x6AD345D7, &Wrap<sceKernelSetGPO>, "sceKernelSetGPO"},
|
||||||
{0x79D1C3FA, sceKernelDcacheWritebackAll, "sceKernelDcacheWritebackAll"},
|
{0x79D1C3FA, &Wrap<sceKernelDcacheWritebackAll>, "sceKernelDcacheWritebackAll"},
|
||||||
{0xB435DEC5, sceKernelDcacheWritebackInvalidateAll, "sceKernelDcacheWritebackInvalidateAll"},
|
{0xB435DEC5, &Wrap<sceKernelDcacheWritebackInvalidateAll>, "sceKernelDcacheWritebackInvalidateAll"},
|
||||||
{0x3EE30821, sceKernelDcacheWritebackRange, "sceKernelDcacheWritebackRange"},
|
{0x3EE30821, &Wrap<sceKernelDcacheWritebackRange>, "sceKernelDcacheWritebackRange"},
|
||||||
{0x34B9FA9E, sceKernelDcacheWritebackInvalidateRange, "sceKernelDcacheWritebackInvalidateRange"},
|
{0x34B9FA9E, &Wrap<sceKernelDcacheWritebackInvalidateRange>, "sceKernelDcacheWritebackInvalidateRange"},
|
||||||
{0x80001C4C, 0, "sceKernelDcacheProbe"},
|
{0x80001C4C, 0, "sceKernelDcacheProbe"},
|
||||||
{0x16641D70, 0, "sceKernelDcacheReadTag"},
|
{0x16641D70, 0, "sceKernelDcacheReadTag"},
|
||||||
{0x4FD31C9D, 0, "sceKernelIcacheProbe"},
|
{0x4FD31C9D, 0, "sceKernelIcacheProbe"},
|
||||||
{0xFB05FAD0, 0, "sceKernelIcacheReadTag"},
|
{0xFB05FAD0, 0, "sceKernelIcacheReadTag"},
|
||||||
{0x920f104a, sceKernelIcacheInvalidateAll, "sceKernelIcacheInvalidateAll"}
|
{0x920f104a, &Wrap<sceKernelIcacheInvalidateAll>, "sceKernelIcacheInvalidateAll"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const HLEFunction sceRtc[] =
|
const HLEFunction sceRtc[] =
|
||||||
{
|
{
|
||||||
{0xC41C2853, sceRtcGetTickResolution, "sceRtcGetTickResolution"},
|
{0xC41C2853, &Wrap<sceRtcGetTickResolution>, "sceRtcGetTickResolution"},
|
||||||
{0x3f7ad767, sceRtcGetCurrentTick, "sceRtcGetCurrentTick"},
|
{0x3f7ad767, &Wrap<sceRtcGetCurrentTick>, "sceRtcGetCurrentTick"},
|
||||||
{0x011F03C1, 0, "sceRtcGetAccumulativeTime"},
|
{0x011F03C1, 0, "sceRtcGetAccumulativeTime"},
|
||||||
{0x029CA3B3, 0, "sceRtcGetAccumlativeTime"},
|
{0x029CA3B3, 0, "sceRtcGetAccumlativeTime"},
|
||||||
{0x4cfa57b0, 0, "sceRtcGetCurrentClock"},
|
{0x4cfa57b0, 0, "sceRtcGetCurrentClock"},
|
||||||
{0xE7C27D1B, sceRtcGetCurrentClockLocalTime, "sceRtcGetCurrentClockLocalTime"},
|
{0xE7C27D1B, &Wrap<sceRtcGetCurrentClockLocalTime>, "sceRtcGetCurrentClockLocalTime"},
|
||||||
{0x34885E0D, 0, "sceRtcConvertUtcToLocalTime"},
|
{0x34885E0D, 0, "sceRtcConvertUtcToLocalTime"},
|
||||||
{0x779242A2, 0, "sceRtcConvertLocalTimeToUTC"},
|
{0x779242A2, 0, "sceRtcConvertLocalTimeToUTC"},
|
||||||
{0x42307A17, 0, "sceRtcIsLeapYear"},
|
{0x42307A17, 0, "sceRtcIsLeapYear"},
|
||||||
|
@ -114,7 +114,7 @@ const HLEFunction sceRtc[] =
|
||||||
{0x7ACE4C04, 0, "sceRtcSetWin32FileTime"},
|
{0x7ACE4C04, 0, "sceRtcSetWin32FileTime"},
|
||||||
{0xCF561893, 0, "sceRtcGetWin32FileTime"},
|
{0xCF561893, 0, "sceRtcGetWin32FileTime"},
|
||||||
{0x7ED29E40, 0, "sceRtcSetTick"},
|
{0x7ED29E40, 0, "sceRtcSetTick"},
|
||||||
{0x6FF40ACC, sceRtcGetTick, "sceRtcGetTick"},
|
{0x6FF40ACC, &Wrap<sceRtcGetTick>, "sceRtcGetTick"},
|
||||||
{0x9ED0AE87, 0, "sceRtcCompareTick"},
|
{0x9ED0AE87, 0, "sceRtcCompareTick"},
|
||||||
{0x44F45E05, 0, "sceRtcTickAddTicks"},
|
{0x44F45E05, 0, "sceRtcTickAddTicks"},
|
||||||
{0x26D25A5D, 0, "sceRtcTickAddMicroseconds"},
|
{0x26D25A5D, 0, "sceRtcTickAddMicroseconds"},
|
||||||
|
@ -179,7 +179,7 @@ const HLEFunction LoadCoreForKernel[] =
|
||||||
{0xCCE4A157, 0, "sceKernelFindModuleByUID"},
|
{0xCCE4A157, 0, "sceKernelFindModuleByUID"},
|
||||||
{0x82CE54ED, 0, "sceKernelModuleCount"},
|
{0x82CE54ED, 0, "sceKernelModuleCount"},
|
||||||
{0xC0584F0C, 0, "sceKernelGetModuleList"},
|
{0xC0584F0C, 0, "sceKernelGetModuleList"},
|
||||||
{0xCF8A41B1, sceKernelFindModuleByName,"sceKernelFindModuleByName"},
|
{0xCF8A41B1, &Wrap<sceKernelFindModuleByName>,"sceKernelFindModuleByName"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ const HLEFunction KDebugForKernel[] =
|
||||||
{0x2FF4E9F9, 0, "sceKernelAssert"},
|
{0x2FF4E9F9, 0, "sceKernelAssert"},
|
||||||
{0x9B868276, 0, "sceKernelGetDebugPutchar"},
|
{0x9B868276, 0, "sceKernelGetDebugPutchar"},
|
||||||
{0xE146606D, 0, "sceKernelRegisterDebugPutchar"},
|
{0xE146606D, 0, "sceKernelRegisterDebugPutchar"},
|
||||||
{0x7CEB2C09, sceKernelRegisterKprintfHandler, "sceKernelRegisterKprintfHandler"},
|
{0x7CEB2C09, &Wrap<sceKernelRegisterKprintfHandler>, "sceKernelRegisterKprintfHandler"},
|
||||||
{0x84F370BC, 0, "Kprintf"},
|
{0x84F370BC, 0, "Kprintf"},
|
||||||
{0x5CE9838B, 0, "sceKernelDebugWrite"},
|
{0x5CE9838B, 0, "sceKernelDebugWrite"},
|
||||||
{0x66253C4E, 0, "sceKernelRegisterDebugWrite"},
|
{0x66253C4E, 0, "sceKernelRegisterDebugWrite"},
|
||||||
|
|
|
@ -28,19 +28,14 @@
|
||||||
#define ATRAC_ERROR_API_FAIL 0x80630002
|
#define ATRAC_ERROR_API_FAIL 0x80630002
|
||||||
#define ATRAC_ERROR_ALL_DATA_DECODED 0x80630024
|
#define ATRAC_ERROR_ALL_DATA_DECODED 0x80630024
|
||||||
|
|
||||||
void sceAtracAddStreamData()
|
u32 sceAtracAddStreamData(u32 atracID, u32 addByte)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracAddStreamData(%i, %i)", PARAM(0), PARAM(1));
|
ERROR_LOG(HLE, "UNIMPL sceAtracAddStreamData(%i, %i)", atracID, addByte);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracDecodeData()
|
u32 sceAtracDecodeData(u32 atracID, u32 outAddr, u32 numSamplesAddr, u32 finishFlagAddr, u32 remainAddr)
|
||||||
{
|
{
|
||||||
u32 atracID = PARAM(0);
|
|
||||||
u32 outAddr = PARAM(1);
|
|
||||||
u32 numSamplesAddr = PARAM(2);
|
|
||||||
u32 finishFlagAddr = PARAM(3);
|
|
||||||
u32 remainAddr = PARAM(4);
|
|
||||||
ERROR_LOG(HLE, "FAKE sceAtracDecodeData(%i, %08x, %08x, %08x, %08x)", atracID, outAddr, numSamplesAddr, finishFlagAddr, remainAddr);
|
ERROR_LOG(HLE, "FAKE sceAtracDecodeData(%i, %08x, %08x, %08x, %08x)", atracID, outAddr, numSamplesAddr, finishFlagAddr, remainAddr);
|
||||||
|
|
||||||
Memory::Write_U16(0, outAddr); // Write a single 16-bit stereo
|
Memory::Write_U16(0, outAddr); // Write a single 16-bit stereo
|
||||||
|
@ -50,199 +45,193 @@ void sceAtracDecodeData()
|
||||||
Memory::Write_U32(1, finishFlagAddr); // Lie that decoding is finished
|
Memory::Write_U32(1, finishFlagAddr); // Lie that decoding is finished
|
||||||
Memory::Write_U32(0, remainAddr); // Lie that decoding is finished
|
Memory::Write_U32(0, remainAddr); // Lie that decoding is finished
|
||||||
|
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracEndEntry()
|
u32 sceAtracEndEntry()
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracEndEntry");
|
ERROR_LOG(HLE, "UNIMPL sceAtracEndEntry");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetAtracID()
|
u32 sceAtracGetAtracID(u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetAtracID");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetAtracID");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetBufferInfoForReseting()
|
u32 sceAtracGetBufferInfoForReseting(u32, u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetBufferInfoForReseting");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetBufferInfoForReseting");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetBitrate()
|
u32 sceAtracGetBitrate(u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetBitrate");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetBitrate");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetChannel()
|
u32 sceAtracGetChannel(u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetChannel");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetChannel");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetLoopStatus()
|
u32 sceAtracGetLoopStatus(u32, u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetLoopStatus");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetLoopStatus");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetInternalErrorInfo()
|
u32 sceAtracGetInternalErrorInfo(u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetInternalErrorInfo");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetInternalErrorInfo");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetMaxSample()
|
u32 sceAtracGetMaxSample(u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetMaxSample");
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetMaxSample");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetNextDecodePosition()
|
u32 sceAtracGetNextDecodePosition(u32 atracID, u32 samplePositionAddr)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetNextDecodePosition(%i, %08x)", PARAM(0), PARAM(1));
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetNextDecodePosition(%i, %08x)", atracID, samplePositionAddr);
|
||||||
u32 *outPos = (u32*)Memory::GetPointer(PARAM(1));
|
u32 *outPos = (u32*)Memory::GetPointer(samplePositionAddr);
|
||||||
*outPos = 1;
|
*outPos = 1;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetNextSample()
|
u32 sceAtracGetNextSample(u32 atracID, u32 outN)
|
||||||
{
|
{
|
||||||
u32 atracID = PARAM(0);
|
|
||||||
u32 outN = PARAM(1);
|
|
||||||
ERROR_LOG(HLE, "FAKE sceAtracGetNextSample(%i, %08x)", atracID, outN);
|
ERROR_LOG(HLE, "FAKE sceAtracGetNextSample(%i, %08x)", atracID, outN);
|
||||||
Memory::Write_U32(0, outN);
|
Memory::Write_U32(0, outN);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetRemainFrame()
|
u32 sceAtracGetRemainFrame(u32 atracID, u32 remainAddr)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "sceAtracGetRemainFrame(%i, %08x)",PARAM(0),PARAM(1));
|
ERROR_LOG(HLE, "sceAtracGetRemainFrame(%i, %08x)",atracID,remainAddr);
|
||||||
u32 *outPos = (u32*)Memory::GetPointer(PARAM(1));
|
u32 *outPos = (u32*)Memory::GetPointer(remainAddr);
|
||||||
*outPos = 12;
|
*outPos = 12;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetSecondBufferInfo()
|
u32 sceAtracGetSecondBufferInfo(u32 atracID, u32 positionAddr, u32 dataAddr)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "sceAtracGetSecondBufferInfo(%i, %08x, %08x)",PARAM(0),PARAM(1),PARAM(2));
|
ERROR_LOG(HLE, "sceAtracGetSecondBufferInfo(%i, %08x, %08x)",atracID,positionAddr,dataAddr);
|
||||||
u32 *outPos = (u32*)Memory::GetPointer(PARAM(1));
|
u32 *outPos = (u32*)Memory::GetPointer(positionAddr);
|
||||||
u32 *outBytes = (u32*)Memory::GetPointer(PARAM(2));
|
u32 *outBytes = (u32*)Memory::GetPointer(dataAddr);
|
||||||
*outPos = 0;
|
*outPos = 0;
|
||||||
*outBytes = 0x10000;
|
*outBytes = 0x10000;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetSoundSample()
|
u32 sceAtracGetSoundSample(u32 atracID, u32 endSampleAddr, u32 loopStartAddr, u32 loopEndAddr)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracGetSoundSample(%i, %08x, %08x, %08x)",PARAM(0),PARAM(1),PARAM(2),PARAM(3));
|
ERROR_LOG(HLE, "UNIMPL sceAtracGetSoundSample(%i, %08x, %08x, %08x)",atracID,endSampleAddr,loopStartAddr,loopEndAddr);
|
||||||
u32 *outEndSample = (u32*)Memory::GetPointer(PARAM(1));
|
u32 *outEndSample = (u32*)Memory::GetPointer(endSampleAddr);
|
||||||
u32 *outLoopStartSample = (u32*)Memory::GetPointer(PARAM(2));
|
u32 *outLoopStartSample = (u32*)Memory::GetPointer(loopStartAddr);
|
||||||
u32 *outLoopEndSample = (u32*)Memory::GetPointer(PARAM(2));
|
u32 *outLoopEndSample = (u32*)Memory::GetPointer(loopEndAddr);
|
||||||
*outEndSample = 0x10000;
|
*outEndSample = 0x10000;
|
||||||
*outLoopStartSample = -1;
|
*outLoopStartSample = -1;
|
||||||
*outLoopEndSample = -1;
|
*outLoopEndSample = -1;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracGetStreamDataInfo()
|
u32 sceAtracGetStreamDataInfo(u32 atracID, u32 writePointerAddr, u32 availableBytesAddr, u32 readOffsetAddr)
|
||||||
{
|
{
|
||||||
u32 atracID = PARAM(0);
|
|
||||||
u32 writePointerAddr = PARAM(1);
|
|
||||||
u32 availableBytesAddr = PARAM(2);
|
|
||||||
u32 readOffsetAddr = PARAM(3);
|
|
||||||
ERROR_LOG(HLE, "FAKE sceAtracGetStreamDataInfo(%i, %08x, %08x, %08x)", atracID, writePointerAddr, availableBytesAddr, readOffsetAddr);
|
ERROR_LOG(HLE, "FAKE sceAtracGetStreamDataInfo(%i, %08x, %08x, %08x)", atracID, writePointerAddr, availableBytesAddr, readOffsetAddr);
|
||||||
Memory::Write_U32(0, readOffsetAddr);
|
Memory::Write_U32(0, readOffsetAddr);
|
||||||
Memory::Write_U32(0, availableBytesAddr);
|
Memory::Write_U32(0, availableBytesAddr);
|
||||||
Memory::Write_U32(0, writePointerAddr);
|
Memory::Write_U32(0, writePointerAddr);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracReleaseAtracID()
|
u32 sceAtracReleaseAtracID(u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracReleaseAtracID");
|
ERROR_LOG(HLE, "UNIMPL sceAtracReleaseAtracID");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracResetPlayPosition()
|
u32 sceAtracResetPlayPosition(u32, u32, u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracResetPlayPosition");
|
ERROR_LOG(HLE, "UNIMPL sceAtracResetPlayPosition");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracSetHalfwayBuffer()
|
u32 sceAtracSetHalfwayBuffer(u32, u32, u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracSetHalfwayBuffer");
|
ERROR_LOG(HLE, "UNIMPL sceAtracSetHalfwayBuffer");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracSetSecondBuffer()
|
u32 sceAtracSetSecondBuffer(u32 atracID, u32 secondBufferAddr, u32 secondBufferSize)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracSetSecondBuffer(%i, %08x, %i)", PARAM(0),PARAM(1),PARAM(2));
|
ERROR_LOG(HLE, "UNIMPL sceAtracSetSecondBuffer(%i, %08x, %i)", atracID, secondBufferAddr, secondBufferSize);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracSetData()
|
u32 sceAtracSetData(u32, u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracSetData");
|
ERROR_LOG(HLE, "UNIMPL sceAtracSetData");
|
||||||
RETURN(0);
|
return 0;
|
||||||
} //?
|
|
||||||
|
|
||||||
void sceAtracSetDataAndGetID()
|
|
||||||
{
|
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracSetDataAndGetID(%08x, %i)", PARAM(0), PARAM(1));
|
|
||||||
RETURN(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracSetHalfwayBufferAndGetID()
|
u32 sceAtracSetDataAndGetID(u32 bufferAddr, u32 bufferSize)
|
||||||
|
{
|
||||||
|
ERROR_LOG(HLE, "UNIMPL sceAtracSetDataAndGetID(%08x, %i)", bufferAddr, bufferSize);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sceAtracSetHalfwayBufferAndGetID(u32, u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracSetHalfwayBufferAndGetID");
|
ERROR_LOG(HLE, "UNIMPL sceAtracSetHalfwayBufferAndGetID");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracStartEntry()
|
u32 sceAtracStartEntry()
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracStartEntry");
|
ERROR_LOG(HLE, "UNIMPL sceAtracStartEntry");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAtracSetLoopNum()
|
u32 sceAtracSetLoopNum(u32 atracID, u32 loopNum)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE, "UNIMPL sceAtracSetLoopNum(%i, %i)", PARAM(0), PARAM(1));
|
ERROR_LOG(HLE, "UNIMPL sceAtracSetLoopNum(%i, %i)", atracID, loopNum);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const HLEFunction sceAtrac3plus[] =
|
const HLEFunction sceAtrac3plus[] =
|
||||||
{
|
{
|
||||||
{0x7db31251,sceAtracAddStreamData,"sceAtracAddStreamData"},
|
{0x7db31251,&Wrap<sceAtracAddStreamData>,"sceAtracAddStreamData"},
|
||||||
{0x6a8c3cd5,sceAtracDecodeData,"sceAtracDecodeData"},
|
{0x6a8c3cd5,&Wrap<sceAtracDecodeData>,"sceAtracDecodeData"},
|
||||||
{0xd5c28cc0,sceAtracEndEntry,"sceAtracEndEntry"},
|
{0xd5c28cc0,&Wrap<sceAtracEndEntry>,"sceAtracEndEntry"},
|
||||||
{0x780f88d1,sceAtracGetAtracID,"sceAtracGetAtracID"},
|
{0x780f88d1,&Wrap<sceAtracGetAtracID>,"sceAtracGetAtracID"},
|
||||||
{0xca3ca3d2,sceAtracGetBufferInfoForReseting,"sceAtracGetBufferInfoForReseting"},
|
{0xca3ca3d2,&Wrap<sceAtracGetBufferInfoForReseting>,"sceAtracGetBufferInfoForReseting"},
|
||||||
{0xa554a158,sceAtracGetBitrate,"sceAtracGetBitrate"},
|
{0xa554a158,&Wrap<sceAtracGetBitrate>,"sceAtracGetBitrate"},
|
||||||
{0x31668baa,sceAtracGetChannel,"sceAtracGetChannel"},
|
{0x31668baa,&Wrap<sceAtracGetChannel>,"sceAtracGetChannel"},
|
||||||
{0xfaa4f89b,sceAtracGetLoopStatus,"sceAtracGetLoopStatus"},
|
{0xfaa4f89b,&Wrap<sceAtracGetLoopStatus>,"sceAtracGetLoopStatus"},
|
||||||
{0xe88f759b,sceAtracGetInternalErrorInfo,"sceAtracGetInternalErrorInfo"},
|
{0xe88f759b,&Wrap<sceAtracGetInternalErrorInfo>,"sceAtracGetInternalErrorInfo"},
|
||||||
{0xd6a5f2f7,sceAtracGetMaxSample,"sceAtracGetMaxSample"},
|
{0xd6a5f2f7,&Wrap<sceAtracGetMaxSample>,"sceAtracGetMaxSample"},
|
||||||
{0xe23e3a35,sceAtracGetNextDecodePosition,"sceAtracGetNextDecodePosition"},
|
{0xe23e3a35,&Wrap<sceAtracGetNextDecodePosition>,"sceAtracGetNextDecodePosition"},
|
||||||
{0x36faabfb,sceAtracGetNextSample,"sceAtracGetNextSample"},
|
{0x36faabfb,&Wrap<sceAtracGetNextSample>,"sceAtracGetNextSample"},
|
||||||
{0x9ae849a7,sceAtracGetRemainFrame,"sceAtracGetRemainFrame"},
|
{0x9ae849a7,&Wrap<sceAtracGetRemainFrame>,"sceAtracGetRemainFrame"},
|
||||||
{0x83e85ea0,sceAtracGetSecondBufferInfo,"sceAtracGetSecondBufferInfo"},
|
{0x83e85ea0,&Wrap<sceAtracGetSecondBufferInfo>,"sceAtracGetSecondBufferInfo"},
|
||||||
{0xa2bba8be,sceAtracGetSoundSample,"sceAtracGetSoundSample"},
|
{0xa2bba8be,&Wrap<sceAtracGetSoundSample>,"sceAtracGetSoundSample"},
|
||||||
{0x5d268707,sceAtracGetStreamDataInfo,"sceAtracGetStreamDataInfo"},
|
{0x5d268707,&Wrap<sceAtracGetStreamDataInfo>,"sceAtracGetStreamDataInfo"},
|
||||||
{0x61eb33f5,sceAtracReleaseAtracID,"sceAtracReleaseAtracID"},
|
{0x61eb33f5,&Wrap<sceAtracReleaseAtracID>,"sceAtracReleaseAtracID"},
|
||||||
{0x644e5607,sceAtracResetPlayPosition,"sceAtracResetPlayPosition"},
|
{0x644e5607,&Wrap<sceAtracResetPlayPosition>,"sceAtracResetPlayPosition"},
|
||||||
{0x3f6e26b5,sceAtracSetHalfwayBuffer,"sceAtracSetHalfwayBuffer"},
|
{0x3f6e26b5,&Wrap<sceAtracSetHalfwayBuffer>,"sceAtracSetHalfwayBuffer"},
|
||||||
{0x83bf7afd,sceAtracSetSecondBuffer,"sceAtracSetSecondBuffer"},
|
{0x83bf7afd,&Wrap<sceAtracSetSecondBuffer>,"sceAtracSetSecondBuffer"},
|
||||||
{0x0E2A73AB,sceAtracSetData,"sceAtracSetData"}, //?
|
{0x0E2A73AB,&Wrap<sceAtracSetData>,"sceAtracSetData"}, //?
|
||||||
{0x7a20e7af,sceAtracSetDataAndGetID,"sceAtracSetDataAndGetID"},
|
{0x7a20e7af,&Wrap<sceAtracSetDataAndGetID>,"sceAtracSetDataAndGetID"},
|
||||||
{0x0eb8dc38,sceAtracSetHalfwayBufferAndGetID,"sceAtracSetHalfwayBufferAndGetID"},
|
{0x0eb8dc38,&Wrap<sceAtracSetHalfwayBufferAndGetID>,"sceAtracSetHalfwayBufferAndGetID"},
|
||||||
{0xd1f59fdb,sceAtracStartEntry,"sceAtracStartEntry"},
|
{0xd1f59fdb,&Wrap<sceAtracStartEntry>,"sceAtracStartEntry"},
|
||||||
{0x868120b5,sceAtracSetLoopNum,"sceAtracSetLoopNum"},
|
{0x868120b5,&Wrap<sceAtracSetLoopNum>,"sceAtracSetLoopNum"},
|
||||||
{0x132f1eca,0,"sceAtracReinit"},
|
{0x132f1eca,0,"sceAtracReinit"},
|
||||||
{0xeca32a99,0,"sceAtracIsSecondBufferNeeded"},
|
{0xeca32a99,0,"sceAtracIsSecondBufferNeeded"},
|
||||||
{0x0fae370e,0,"sceAtracSetHalfwayBufferAndGetID"},
|
{0x0fae370e,0,"sceAtracSetHalfwayBufferAndGetID"},
|
||||||
|
|
|
@ -59,11 +59,11 @@ u32 sceAudioOutputPannedBlocking(u32 chan, u32 volume1, u32 volume2, u32 sampleP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAudioGetChannelRestLen()
|
u32 sceAudioGetChannelRestLen(u32 chanId)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceAudioGetChannelRestLen(%i)", PARAM(0));
|
ERROR_LOG(HLE,"UNIMPL sceAudioGetChannelRestLen(%i)", chanId);
|
||||||
// Remaining samples in that channel buffer.
|
// Remaining samples in that channel buffer.
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sceAudioOutputPanned(u32 chan, u32 leftVol, u32 rightVol, u32 samplePtr)
|
u32 sceAudioOutputPanned(u32 chan, u32 leftVol, u32 rightVol, u32 samplePtr)
|
||||||
|
@ -147,7 +147,7 @@ u32 sceAudioChReserve(u32 channel, u32 sampleCount, u32 format) //.Allocate soun
|
||||||
{
|
{
|
||||||
WARN_LOG(HLE, "WARNING: Reserving already reserved channel. Error?");
|
WARN_LOG(HLE, "WARNING: Reserving already reserved channel. Error?");
|
||||||
}
|
}
|
||||||
DEBUG_LOG(HLE,"%i = sceAudioChReserve(%i, %i, %i)", channel, PARAM(0), sampleCount, format);
|
DEBUG_LOG(HLE,"%i = sceAudioChReserve(%i, %i, %i)", channel, channel, sampleCount, format);
|
||||||
|
|
||||||
chans[channel].sampleCount = sampleCount;
|
chans[channel].sampleCount = sampleCount;
|
||||||
chans[channel].reserved = true;
|
chans[channel].reserved = true;
|
||||||
|
@ -230,10 +230,10 @@ u32 sceAudioChangeChannelVolume(u32 chan, u32 lvolume, u32 rvolume)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceAudioInit()
|
u32 sceAudioInit()
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceAudioInit");
|
ERROR_LOG(HLE,"UNIMPL sceAudioInit");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const HLEFunction sceAudio[] =
|
const HLEFunction sceAudio[] =
|
||||||
|
@ -246,7 +246,7 @@ const HLEFunction sceAudio[] =
|
||||||
{0x210567F7, 0, "sceAudioEnd"},
|
{0x210567F7, 0, "sceAudioEnd"},
|
||||||
{0x38553111, 0, "sceAudioSRCChReserve"},
|
{0x38553111, 0, "sceAudioSRCChReserve"},
|
||||||
{0x5C37C0AE, 0, "sceAudioSRCChRelease"},
|
{0x5C37C0AE, 0, "sceAudioSRCChRelease"},
|
||||||
{0x80F1F7E0, sceAudioInit, "sceAudioInit"},
|
{0x80F1F7E0, Wrap<sceAudioInit>, "sceAudioInit"},
|
||||||
{0x927AC32B, 0, "sceAudioSetVolumeOffset"},
|
{0x927AC32B, 0, "sceAudioSetVolumeOffset"},
|
||||||
{0xA2BEAA6C, 0, "sceAudioSetFrequency"},
|
{0xA2BEAA6C, 0, "sceAudioSetFrequency"},
|
||||||
{0xA633048E, 0, "sceAudioPollInputEnd"},
|
{0xA633048E, 0, "sceAudioPollInputEnd"},
|
||||||
|
@ -255,15 +255,15 @@ const HLEFunction sceAudio[] =
|
||||||
{0xE0727056, 0, "sceAudioSRCOutputBlocking"},
|
{0xE0727056, 0, "sceAudioSRCOutputBlocking"},
|
||||||
{0xE926D3FB, 0, "sceAudioInputInitEx"},
|
{0xE926D3FB, 0, "sceAudioInputInitEx"},
|
||||||
{0x8c1009b2, 0, "sceAudioOutput"},
|
{0x8c1009b2, 0, "sceAudioOutput"},
|
||||||
{0x136CAF51, WrapU_UUU<sceAudioOutputBlocking>, "sceAudioOutputBlocking"},
|
{0x136CAF51, Wrap<sceAudioOutputBlocking>, "sceAudioOutputBlocking"},
|
||||||
{0xE2D56B2D, WrapU_UUUU<sceAudioOutputPanned>, "sceAudioOutputPanned"},
|
{0xE2D56B2D, Wrap<sceAudioOutputPanned>, "sceAudioOutputPanned"},
|
||||||
{0x13F592BC, WrapU_UUUU<sceAudioOutputPannedBlocking>, "sceAudioOutputPannedBlocking"}, //(u32, u32, u32, void *)Output sound, blocking
|
{0x13F592BC, Wrap<sceAudioOutputPannedBlocking>, "sceAudioOutputPannedBlocking"}, //(u32, u32, u32, void *)Output sound, blocking
|
||||||
{0x5EC81C55, WrapU_UUU<sceAudioChReserve>, "sceAudioChReserve"}, //(u32, u32 samplecount, u32) Initialize channel and allocate buffer long, long samplecount, long);//init buffer? returns handle, minus if error
|
{0x5EC81C55, Wrap<sceAudioChReserve>, "sceAudioChReserve"}, //(u32, u32 samplecount, u32) Initialize channel and allocate buffer long, long samplecount, long);//init buffer? returns handle, minus if error
|
||||||
{0x6FC46853, WrapU_U<sceAudioChRelease>, "sceAudioChRelease"}, //(long handle)Terminate channel and deallocate buffer //free buffer?
|
{0x6FC46853, Wrap<sceAudioChRelease>, "sceAudioChRelease"}, //(long handle)Terminate channel and deallocate buffer //free buffer?
|
||||||
{0xE9D97901, sceAudioGetChannelRestLen, "sceAudioGetChannelRestLen"},
|
{0xE9D97901, Wrap<sceAudioGetChannelRestLen>, "sceAudioGetChannelRestLen"},
|
||||||
{0xCB2E439E, WrapU_UU<sceAudioSetChannelDataLen>, "sceAudioSetChannelDataLen"}, //(u32, u32)
|
{0xCB2E439E, Wrap<sceAudioSetChannelDataLen>, "sceAudioSetChannelDataLen"}, //(u32, u32)
|
||||||
{0x95FD0C2D, WrapU_UU<sceAudioChangeChannelConfig>, "sceAudioChangeChannelConfig"},
|
{0x95FD0C2D, Wrap<sceAudioChangeChannelConfig>, "sceAudioChangeChannelConfig"},
|
||||||
{0xB7E1D8E7, WrapU_UUU<sceAudioChangeChannelVolume>, "sceAudioChangeChannelVolume"},
|
{0xB7E1D8E7, Wrap<sceAudioChangeChannelVolume>, "sceAudioChangeChannelVolume"},
|
||||||
{0x41efade7, 0, "sceAudioOneshotOutput"},
|
{0x41efade7, 0, "sceAudioOneshotOutput"},
|
||||||
{0x086e5895, 0, "sceAudioInputBlocking"},
|
{0x086e5895, 0, "sceAudioInputBlocking"},
|
||||||
{0x6d4bec68, 0, "sceAudioInput"},
|
{0x6d4bec68, 0, "sceAudioInput"},
|
||||||
|
|
|
@ -72,14 +72,15 @@ void __CtrlSetAnalog(float x, float y)
|
||||||
ctrl.analog[1] = (u8)(y * 127.f + 128.f);
|
ctrl.analog[1] = (u8)(y * 127.f + 128.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceCtrlInit()
|
u32 sceCtrlInit()
|
||||||
{
|
{
|
||||||
ctrlInited = true;
|
ctrlInited = true;
|
||||||
memset(&ctrl, 0, sizeof(ctrl));
|
memset(&ctrl, 0, sizeof(ctrl));
|
||||||
DEBUG_LOG(HLE,"sceCtrlInit");
|
DEBUG_LOG(HLE,"sceCtrlInit");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceCtrlSetSamplingMode()
|
u32 sceCtrlSetSamplingMode(u32)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceCtrlSetSamplingMode");
|
DEBUG_LOG(HLE,"sceCtrlSetSamplingMode");
|
||||||
if (ctrlInited)
|
if (ctrlInited)
|
||||||
|
@ -87,14 +88,16 @@ void sceCtrlSetSamplingMode()
|
||||||
// Looks odd
|
// Looks odd
|
||||||
analogEnabled = true;
|
analogEnabled = true;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceCtrlSetIdleCancelThreshold()
|
u32 sceCtrlSetIdleCancelThreshold(u32, u32)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"UNIMPL sceCtrlSetIdleCancelThreshold");
|
DEBUG_LOG(HLE,"UNIMPL sceCtrlSetIdleCancelThreshold");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceCtrlReadBufferPositive()
|
u32 sceCtrlReadBufferPositive(u32 ctrlData, u32 nBufs)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> guard(ctrlMutex);
|
std::lock_guard<std::recursive_mutex> guard(ctrlMutex);
|
||||||
if (ctrlInited)
|
if (ctrlInited)
|
||||||
|
@ -146,20 +149,21 @@ void sceCtrlReadBufferPositive()
|
||||||
data.analog[1]=analogY;
|
data.analog[1]=analogY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memcpy(Memory::GetPointer(PARAM(0)), &data, sizeof(_ctrl_data));
|
memcpy(Memory::GetPointer(ctrlData), &data, sizeof(_ctrl_data));
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const HLEFunction sceCtrl[] =
|
static const HLEFunction sceCtrl[] =
|
||||||
{
|
{
|
||||||
{0x6a2774f3, sceCtrlInit, "sceCtrlInit"}, //(int unknown), init with 0
|
{0x6a2774f3, Wrap<sceCtrlInit>, "sceCtrlInit"},
|
||||||
{0x1f4011e6, sceCtrlSetSamplingMode, "sceCtrlSetSamplingMode"}, //(int on);
|
{0x1f4011e6, Wrap<sceCtrlSetSamplingMode>, "sceCtrlSetSamplingMode"},
|
||||||
{0x1f803938, sceCtrlReadBufferPositive, "sceCtrlReadBufferPositive"}, //(ctrl_data_t* paddata, int unknown) // unknown should be 1
|
{0x1f803938, Wrap<sceCtrlReadBufferPositive>, "sceCtrlReadBufferPositive"},
|
||||||
{0x6A2774F3, 0, "sceCtrlSetSamplingCycle"}, //?
|
{0x6A2774F3, 0, "sceCtrlSetSamplingCycle"},
|
||||||
{0x6A2774F3,sceCtrlInit,"sceCtrlSetSamplingCycle"},
|
{0x6A2774F3, Wrap<sceCtrlInit>,"sceCtrlSetSamplingCycle"},
|
||||||
{0x02BAAD91,0,"sceCtrlGetSamplingCycle"},
|
{0x02BAAD91,0,"sceCtrlGetSamplingCycle"},
|
||||||
{0xDA6B76A1,0,"sceCtrlGetSamplingMode"},
|
{0xDA6B76A1,0,"sceCtrlGetSamplingMode"},
|
||||||
{0x3A622550,sceCtrlReadBufferPositive,"sceCtrlPeekBufferPositive"},
|
{0x3A622550, Wrap<sceCtrlReadBufferPositive>,"sceCtrlPeekBufferPositive"},
|
||||||
{0xC152080A,0,"sceCtrlPeekBufferNegative"},
|
{0xC152080A,0,"sceCtrlPeekBufferNegative"},
|
||||||
{0x60B81F86,0,"sceCtrlReadBufferNegative"},
|
{0x60B81F86,0,"sceCtrlReadBufferNegative"},
|
||||||
{0xB1D0E5CD,0,"sceCtrlPeekLatch"},
|
{0xB1D0E5CD,0,"sceCtrlPeekLatch"},
|
||||||
|
@ -168,7 +172,7 @@ static const HLEFunction sceCtrl[] =
|
||||||
{0xAF5960F3,0,"sceCtrl_AF5960F3"},
|
{0xAF5960F3,0,"sceCtrl_AF5960F3"},
|
||||||
{0xA68FD260,0,"sceCtrlClearRapidFire"},
|
{0xA68FD260,0,"sceCtrlClearRapidFire"},
|
||||||
{0x6841BE1A,0,"sceCtrlSetRapidFire"},
|
{0x6841BE1A,0,"sceCtrlSetRapidFire"},
|
||||||
{0xa7144800,sceCtrlSetIdleCancelThreshold,"sceCtrlSetIdleCancelThreshold"},
|
{0xa7144800, Wrap<sceCtrlSetIdleCancelThreshold>,"sceCtrlSetIdleCancelThreshold"},
|
||||||
{0x687660fa,0,"sceCtrlGetIdleCancelThreshold"},
|
{0x687660fa,0,"sceCtrlGetIdleCancelThreshold"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ static int enterVblankEvent = -1;
|
||||||
static int leaveVblankEvent = -1;
|
static int leaveVblankEvent = -1;
|
||||||
|
|
||||||
static int hCount = 0;
|
static int hCount = 0;
|
||||||
static int hCountTotal = 0; //unused
|
//static int hCountTotal = 0; //unused
|
||||||
static int vCount = 0;
|
static int vCount = 0;
|
||||||
static int isVblank = 0;
|
static int isVblank = 0;
|
||||||
// STATE END
|
// STATE END
|
||||||
|
@ -163,10 +163,10 @@ void hleLeaveVblank(u64 userdata, int cyclesLate)
|
||||||
CoreTiming::ScheduleEvent(msToCycles(frameMs - vblankMs) - cyclesLate, enterVblankEvent, userdata);
|
CoreTiming::ScheduleEvent(msToCycles(frameMs - vblankMs) - cyclesLate, enterVblankEvent, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayIsVblank()
|
u32 sceDisplayIsVblank()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"%i=sceDisplayIsVblank()",isVblank);
|
DEBUG_LOG(HLE,"%i=sceDisplayIsVblank()",isVblank);
|
||||||
RETURN(isVblank);
|
return isVblank;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sceDisplaySetMode(u32 unknown, u32 xres, u32 yres)
|
u32 sceDisplaySetMode(u32 unknown, u32 xres, u32 yres)
|
||||||
|
@ -181,14 +181,8 @@ u32 sceDisplaySetMode(u32 unknown, u32 xres, u32 yres)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplaySetFramebuf()
|
u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync)
|
||||||
{
|
{
|
||||||
//host->EndFrame();
|
|
||||||
u32 topaddr = PARAM(0);
|
|
||||||
int linesize = PARAM(1);
|
|
||||||
int pixelformat = PARAM(2);
|
|
||||||
int sync = PARAM(3);
|
|
||||||
|
|
||||||
FrameBufferState *fbstate = 0;
|
FrameBufferState *fbstate = 0;
|
||||||
if (sync == PSP_DISPLAY_SETBUF_IMMEDIATE)
|
if (sync == PSP_DISPLAY_SETBUF_IMMEDIATE)
|
||||||
{
|
{
|
||||||
|
@ -215,56 +209,60 @@ void sceDisplaySetFramebuf()
|
||||||
fbstate->pspFramebufLinesize = linesize;
|
fbstate->pspFramebufLinesize = linesize;
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayGetFramebuf()
|
u32 sceDisplayGetFramebuf(u32 topAddrAddr, u32 bufferWidthAddr, u32 pixelFormatAddr, int sync)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceDisplayGetFramebuf");
|
DEBUG_LOG(HLE,"sceDisplayGetFramebuf");
|
||||||
RETURN(framebuf.topaddr);
|
Memory::Write_U32(topAddrAddr, framebuf.topaddr);
|
||||||
|
Memory::Write_U32(bufferWidthAddr, framebuf.pspFramebufLinesize);
|
||||||
|
Memory::Write_U32(pixelFormatAddr, framebuf.pspFramebufFormat);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayWaitVblankStart()
|
u32 sceDisplayWaitVblankStart()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceDisplayWaitVblankStart");
|
DEBUG_LOG(HLE,"sceDisplayWaitVblankStart");
|
||||||
__KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, false);
|
__KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, false);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayWaitVblank()
|
u32 sceDisplayWaitVblank()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceDisplayWaitVblank");
|
DEBUG_LOG(HLE,"sceDisplayWaitVblank");
|
||||||
__KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, false);
|
__KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, false);
|
||||||
sceDisplayWaitVblankStart();
|
return sceDisplayWaitVblankStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayWaitVblankStartCB()
|
u32 sceDisplayWaitVblankStartCB()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceDisplayWaitVblankStartCB");
|
DEBUG_LOG(HLE,"sceDisplayWaitVblankStartCB");
|
||||||
__KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, true);
|
__KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, true);
|
||||||
|
return sceDisplayWaitVblankStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayGetVcount()
|
u32 sceDisplayGetVcount()
|
||||||
{
|
{
|
||||||
// Too spammy
|
// Too spammy
|
||||||
// DEBUG_LOG(HLE,"%i=sceDisplayGetVcount()", vCount);
|
// DEBUG_LOG(HLE,"%i=sceDisplayGetVcount()", vCount);
|
||||||
// Games like Puyo Puyo call this in a tight loop at end-of-frame. We could have it consume some time from CoreTiming?
|
// Games like Puyo Puyo call this in a tight loop at end-of-frame. We could have it consume some time from CoreTiming?
|
||||||
CoreTiming::Idle(100000);
|
CoreTiming::Idle(100000);
|
||||||
RETURN(vCount);
|
return vCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceDisplayGetCurrentHcount()
|
u32 sceDisplayGetCurrentHcount()
|
||||||
{
|
{
|
||||||
RETURN(hCount++);
|
return (hCount++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sceDisplayGetAccumulatedHcount()
|
u32 sceDisplayGetAccumulatedHcount()
|
||||||
{
|
{
|
||||||
// Just do an estimate
|
// Just do an estimate
|
||||||
u32 accumHCount = CoreTiming::GetTicks() / (222000000 / 60 / 272);
|
u32 accumHCount = CoreTiming::GetTicks() / (222000000 / 60 / 272);
|
||||||
DEBUG_LOG(HLE,"%i=sceDisplayGetAccumulatedHcount()", accumHCount);
|
DEBUG_LOG(HLE,"%i=sceDisplayGetAccumulatedHcount()", accumHCount);
|
||||||
RETURN(accumHCount);
|
return accumHCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
float sceDisplayGetFramePerSec()
|
float sceDisplayGetFramePerSec()
|
||||||
|
@ -276,26 +274,26 @@ float sceDisplayGetFramePerSec()
|
||||||
|
|
||||||
const HLEFunction sceDisplay[] =
|
const HLEFunction sceDisplay[] =
|
||||||
{
|
{
|
||||||
{0x0E20F177,&WrapU_UUU<sceDisplaySetMode>, "sceDisplaySetMode"},
|
{0x0E20F177,&Wrap<sceDisplaySetMode>, "sceDisplaySetMode"},
|
||||||
{0x289D82FE,sceDisplaySetFramebuf, "sceDisplaySetFramebuf"},
|
{0x289D82FE,&Wrap<sceDisplaySetFramebuf>, "sceDisplaySetFramebuf"},
|
||||||
{0x36CDFADE,sceDisplayWaitVblank, "sceDisplayWaitVblank"},
|
{0x36CDFADE,&Wrap<sceDisplayWaitVblank>, "sceDisplayWaitVblank"},
|
||||||
{0x984C27E7,sceDisplayWaitVblankStart, "sceDisplayWaitVblankStart"},
|
{0x984C27E7,&Wrap<sceDisplayWaitVblankStart>, "sceDisplayWaitVblankStart"},
|
||||||
{0x46F186C3,sceDisplayWaitVblankStartCB,"sceDisplayWaitVblankStartCB"},
|
{0x46F186C3,&Wrap<sceDisplayWaitVblankStartCB>,"sceDisplayWaitVblankStartCB"},
|
||||||
{0x8EB9EC49,sceDisplayWaitVblankStartCB,"sceDisplayWaitVblankCB"},
|
{0x8EB9EC49,&Wrap<sceDisplayWaitVblankStartCB>,"sceDisplayWaitVblankCB"},
|
||||||
|
|
||||||
{0xdba6c4c4,&WrapF_V<sceDisplayGetFramePerSec>,"sceDisplayGetFramePerSec"},
|
{0xdba6c4c4,&Wrap<sceDisplayGetFramePerSec>,"sceDisplayGetFramePerSec"},
|
||||||
{0x773dd3a3,sceDisplayGetCurrentHcount,"sceDisplayGetCurrentHcount"},
|
{0x773dd3a3,&Wrap<sceDisplayGetCurrentHcount>,"sceDisplayGetCurrentHcount"},
|
||||||
{0x210eab3a,sceDisplayGetAccumulatedHcount,"sceDisplayGetAccumulatedHcount"},
|
{0x210eab3a,&Wrap<sceDisplayGetAccumulatedHcount>,"sceDisplayGetAccumulatedHcount"},
|
||||||
{0x9C6EAAD7,sceDisplayGetVcount,"sceDisplayGetVcount"},
|
{0x9C6EAAD7,&Wrap<sceDisplayGetVcount>,"sceDisplayGetVcount"},
|
||||||
{0x984C27E7,0,"sceDisplayWaitVblankStart"},
|
{0x984C27E7,0,"sceDisplayWaitVblankStart"},
|
||||||
{0xDEA197D4,0,"sceDisplayGetMode"},
|
{0xDEA197D4,0,"sceDisplayGetMode"},
|
||||||
{0x7ED59BC4,0,"sceDisplaySetHoldMode"},
|
{0x7ED59BC4,0,"sceDisplaySetHoldMode"},
|
||||||
{0xA544C486,0,"sceDisplaySetResumeMode"},
|
{0xA544C486,0,"sceDisplaySetResumeMode"},
|
||||||
{0x289D82FE,0,"sceDisplaySetFrameBuf"},
|
{0x289D82FE,0,"sceDisplaySetFrameBuf"},
|
||||||
{0xEEDA2E54,sceDisplayGetFramebuf,"sceDisplayGetFrameBuf"},
|
{0xEEDA2E54,&Wrap<sceDisplayGetFramebuf>,"sceDisplayGetFrameBuf"},
|
||||||
{0xB4F378FA,0,"sceDisplayIsForeground"},
|
{0xB4F378FA,0,"sceDisplayIsForeground"},
|
||||||
{0x31C4BAA8,0,"sceDisplayGetBrightness"},
|
{0x31C4BAA8,0,"sceDisplayGetBrightness"},
|
||||||
{0x4D4E10EC,sceDisplayIsVblank,"sceDisplayIsVblank"},
|
{0x4D4E10EC,&Wrap<sceDisplayIsVblank>,"sceDisplayIsVblank"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void Register_sceDisplay()
|
void Register_sceDisplay()
|
||||||
|
|
|
@ -28,7 +28,7 @@ u32 sceDmacMemcpy(u32 dst, u32 src, u32 size)
|
||||||
|
|
||||||
const HLEFunction sceDmac[] =
|
const HLEFunction sceDmac[] =
|
||||||
{
|
{
|
||||||
{0x617f3fe6, &WrapU_UUU<sceDmacMemcpy>, "sceDmacMemcpy"},
|
{0x617f3fe6, &Wrap<sceDmacMemcpy>, "sceDmacMemcpy"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void Register_sceDmac()
|
void Register_sceDmac()
|
||||||
|
|
|
@ -110,10 +110,9 @@ void sceGeListSync(u32 displayListID, u32 mode) //0 : wait for completion 1:che
|
||||||
DEBUG_LOG(HLE,"sceGeListSync(dlid=%08x, mode=%08x)", displayListID,mode);
|
DEBUG_LOG(HLE,"sceGeListSync(dlid=%08x, mode=%08x)", displayListID,mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sceGeDrawSync(u32)
|
u32 sceGeDrawSync(u32 mode)
|
||||||
{
|
{
|
||||||
//wait/check entire drawing state
|
//wait/check entire drawing state
|
||||||
u32 mode = PARAM(0); //0 : wait for completion 1:check and return
|
|
||||||
DEBUG_LOG(HLE,"FAKE sceGeDrawSync(mode=%d)",mode);
|
DEBUG_LOG(HLE,"FAKE sceGeDrawSync(mode=%d)",mode);
|
||||||
if (mode == 1)
|
if (mode == 1)
|
||||||
{
|
{
|
||||||
|
@ -125,16 +124,16 @@ u32 sceGeDrawSync(u32)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceGeBreak()
|
u32 sceGeBreak(u32 mode, u32)
|
||||||
{
|
{
|
||||||
u32 mode = PARAM(0); //0 : current dlist 1: all drawing
|
|
||||||
ERROR_LOG(HLE,"UNIMPL sceGeBreak(mode=%d)",mode);
|
ERROR_LOG(HLE,"UNIMPL sceGeBreak(mode=%d)",mode);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceGeContinue()
|
u32 sceGeContinue()
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceGeContinue");
|
ERROR_LOG(HLE,"UNIMPL sceGeContinue");
|
||||||
// no arguments
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sceGeSetCallback(u32 structAddr)
|
u32 sceGeSetCallback(u32 structAddr)
|
||||||
|
@ -172,32 +171,31 @@ void sceGeGetMtx()
|
||||||
ERROR_LOG(HLE,"UNIMPL sceGeGetMtx()");
|
ERROR_LOG(HLE,"UNIMPL sceGeGetMtx()");
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceGeEdramSetAddrTranslation()
|
int sceGeEdramSetAddrTranslation(int new_size)
|
||||||
{
|
{
|
||||||
int new_size = PARAM(0);
|
|
||||||
INFO_LOG(HLE,"sceGeEdramSetAddrTranslation(%i)", new_size);
|
INFO_LOG(HLE,"sceGeEdramSetAddrTranslation(%i)", new_size);
|
||||||
static int EDRamWidth;
|
static int EDRamWidth;
|
||||||
int last = EDRamWidth;
|
int last = EDRamWidth;
|
||||||
EDRamWidth = new_size;
|
EDRamWidth = new_size;
|
||||||
RETURN(last);
|
return last;
|
||||||
}
|
}
|
||||||
|
|
||||||
const HLEFunction sceGe_user[] =
|
const HLEFunction sceGe_user[] =
|
||||||
{
|
{
|
||||||
{0xE47E40E4,&WrapU_V<sceGeEdramGetAddr>, "sceGeEdramGetAddr"},
|
{0xE47E40E4,&Wrap<sceGeEdramGetAddr>, "sceGeEdramGetAddr"},
|
||||||
{0xAB49E76A,&WrapU_UUUU<sceGeListEnQueue>, "sceGeListEnQueue"},
|
{0xAB49E76A,&Wrap<sceGeListEnQueue>, "sceGeListEnQueue"},
|
||||||
{0x1C0D95A6,&WrapU_UUUU<sceGeListEnQueueHead>, "sceGeListEnQueueHead"},
|
{0x1C0D95A6,&Wrap<sceGeListEnQueueHead>, "sceGeListEnQueueHead"},
|
||||||
{0xE0D68148,&WrapV_UU<sceGeListUpdateStallAddr>, "sceGeListUpdateStallAddr"},
|
{0xE0D68148,&Wrap<sceGeListUpdateStallAddr>, "sceGeListUpdateStallAddr"},
|
||||||
{0x03444EB4,&WrapV_UU<sceGeListSync>, "sceGeListSync"},
|
{0x03444EB4,&Wrap<sceGeListSync>, "sceGeListSync"},
|
||||||
{0xB287BD61,&WrapU_U<sceGeDrawSync>, "sceGeDrawSync"},
|
{0xB287BD61,&Wrap<sceGeDrawSync>, "sceGeDrawSync"},
|
||||||
{0xB448EC0D,sceGeBreak, "sceGeBreak"},
|
{0xB448EC0D,&Wrap<sceGeBreak>, "sceGeBreak"},
|
||||||
{0x4C06E472,sceGeContinue, "sceGeContinue"},
|
{0x4C06E472,&Wrap<sceGeContinue>, "sceGeContinue"},
|
||||||
{0xA4FC06A4,&WrapU_U<sceGeSetCallback>, "sceGeSetCallback"},
|
{0xA4FC06A4,&Wrap<sceGeSetCallback>, "sceGeSetCallback"},
|
||||||
{0x05DB22CE,&WrapV_U<sceGeUnsetCallback>, "sceGeUnsetCallback"},
|
{0x05DB22CE,&Wrap<sceGeUnsetCallback>, "sceGeUnsetCallback"},
|
||||||
{0x1F6752AD,&WrapU_V<sceGeEdramGetSize>, "sceGeEdramGetSize"},
|
{0x1F6752AD,&Wrap<sceGeEdramGetSize>, "sceGeEdramGetSize"},
|
||||||
{0xB77905EA,&sceGeEdramSetAddrTranslation,"sceGeEdramSetAddrTranslation"},
|
{0xB77905EA,&Wrap<sceGeEdramSetAddrTranslation>,"sceGeEdramSetAddrTranslation"},
|
||||||
{0xDC93CFEF,0,"sceGeGetCmd"},
|
{0xDC93CFEF,0,"sceGeGetCmd"},
|
||||||
{0x57C8945B,&sceGeGetMtx,"sceGeGetMtx"},
|
{0x57C8945B,&Wrap<sceGeGetMtx>,"sceGeGetMtx"},
|
||||||
{0x438A385A,0,"sceGeSaveContext"},
|
{0x438A385A,0,"sceGeSaveContext"},
|
||||||
{0x0BF608FB,0,"sceGeRestoreContext"},
|
{0x0BF608FB,0,"sceGeRestoreContext"},
|
||||||
{0x5FB86AB0,0,"sceGeListDeQueue"},
|
{0x5FB86AB0,0,"sceGeListDeQueue"},
|
||||||
|
|
|
@ -30,7 +30,7 @@ u32 sceHprmPeekCurrentKey(u32 keyAddress)
|
||||||
const HLEFunction sceHprm[] =
|
const HLEFunction sceHprm[] =
|
||||||
{
|
{
|
||||||
{0x089fdfa4, 0, "sceHprm_0x089fdfa4"},
|
{0x089fdfa4, 0, "sceHprm_0x089fdfa4"},
|
||||||
{0x1910B327, &WrapU_U<sceHprmPeekCurrentKey>, "sceHprmPeekCurrentKey"},
|
{0x1910B327, &Wrap<sceHprmPeekCurrentKey>, "sceHprmPeekCurrentKey"},
|
||||||
{0x208DB1BD, 0, "sceHprmIsRemoteExist"},
|
{0x208DB1BD, 0, "sceHprmIsRemoteExist"},
|
||||||
{0x7E69EDA4, 0, "sceHprmIsHeadphoneExist"},
|
{0x7E69EDA4, 0, "sceHprmIsHeadphoneExist"},
|
||||||
{0x219C58F1, 0, "sceHprmIsMicrophoneExist"},
|
{0x219C58F1, 0, "sceHprmIsMicrophoneExist"},
|
||||||
|
|
|
@ -189,31 +189,31 @@ void __IoShutdown()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoAssign()
|
u32 sceIoAssign(u32 aliasNameAddr, u32 physNameAddr, u32 devNameAddr, u32 flag, u32, u32)
|
||||||
{
|
{
|
||||||
const char *aliasname = Memory::GetCharPointer(PARAM(0));
|
const char *aliasname = Memory::GetCharPointer(aliasNameAddr);
|
||||||
const char *physname = Memory::GetCharPointer(PARAM(1));
|
const char *physname = Memory::GetCharPointer(physNameAddr);
|
||||||
const char *devname = Memory::GetCharPointer(PARAM(2));
|
const char *devname = Memory::GetCharPointer(devNameAddr);
|
||||||
u32 flag = PARAM(3);
|
|
||||||
ERROR_LOG(HLE,"UNIMPL sceIoAssign(%s, %s, %s, %08x, ...)",aliasname,physname,devname,flag);
|
ERROR_LOG(HLE,"UNIMPL sceIoAssign(%s, %s, %s, %08x, ...)",aliasname,physname,devname,flag);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelStdin()
|
u32 sceKernelStdin()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"3=sceKernelStdin()");
|
DEBUG_LOG(HLE,"3=sceKernelStdin()");
|
||||||
RETURN(3);
|
return 3;
|
||||||
}
|
|
||||||
void sceKernelStdout()
|
|
||||||
{
|
|
||||||
DEBUG_LOG(HLE,"1=sceKernelStdout()");
|
|
||||||
RETURN(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelStderr()
|
u32 sceKernelStdout()
|
||||||
|
{
|
||||||
|
DEBUG_LOG(HLE,"1=sceKernelStdout()");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sceKernelStderr()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"2=sceKernelStderr()");
|
DEBUG_LOG(HLE,"2=sceKernelStderr()");
|
||||||
RETURN(2);
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __IoCompleteAsyncIO(SceUID id)
|
void __IoCompleteAsyncIO(SceUID id)
|
||||||
|
@ -247,97 +247,87 @@ void __IoGetStat(SceIoStat *stat, PSPFileInfo &info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sceIoGetstat()
|
u32 sceIoGetstat(u32 fileAddr, u32 statAddr)
|
||||||
{
|
{
|
||||||
const char *filename = Memory::GetCharPointer(PARAM(0));
|
const char *filename = Memory::GetCharPointer(fileAddr);
|
||||||
u32 addr = PARAM(1);
|
DEBUG_LOG(HLE,"sceIoGetstat(%s, %08x)",filename,statAddr);
|
||||||
DEBUG_LOG(HLE,"sceIoGetstat(%s, %08x)",filename,addr);
|
|
||||||
|
|
||||||
SceIoStat *stat = (SceIoStat*)Memory::GetPointer(addr);
|
SceIoStat *stat = (SceIoStat*)Memory::GetPointer(statAddr);
|
||||||
PSPFileInfo info = pspFileSystem.GetFileInfo(filename);
|
PSPFileInfo info = pspFileSystem.GetFileInfo(filename);
|
||||||
__IoGetStat(stat, info);
|
__IoGetStat(stat, info);
|
||||||
|
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoRead() //(int fd, void *data, int size);
|
u32 sceIoRead(SceUID fd, u32 dataAddr, SceSize size)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
if (fd == 3)
|
||||||
if (id == 3)
|
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoRead STDIN");
|
DEBUG_LOG(HLE,"sceIoRead STDIN");
|
||||||
RETURN(0); //stdin
|
return 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
if (PARAM(1))
|
if (dataAddr)
|
||||||
{
|
{
|
||||||
u8 *data = (u8*)Memory::GetPointer(PARAM(1));
|
u8 *data = (u8*)Memory::GetPointer(dataAddr);
|
||||||
int size = PARAM(2);
|
f->asyncResult = (u32)pspFileSystem.ReadFile(f->handle, data, size);
|
||||||
f->asyncResult = RETURN((u32)pspFileSystem.ReadFile(f->handle, data, size));
|
DEBUG_LOG(HLE,"%i=sceIoRead(%d, %08x , %i)",f->asyncResult, fd, dataAddr, size);
|
||||||
DEBUG_LOG(HLE,"%i=sceIoRead(%d, %08x , %i)",f->asyncResult, id, PARAM(1), size);
|
return f->asyncResult;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"sceIoRead Reading into zero pointer");
|
ERROR_LOG(HLE,"sceIoRead Reading into zero pointer");
|
||||||
RETURN(-1);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"sceIoRead ERROR: no file open");
|
ERROR_LOG(HLE,"sceIoRead ERROR: no file open");
|
||||||
RETURN(error);
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoWrite() //(int fd, void *data, int size);
|
u32 sceIoWrite(SceUID fd, u32 dataAddr, SceSize size)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
if (fd == 2)
|
||||||
int size = PARAM(2);
|
|
||||||
if (PARAM(0) == 2)
|
|
||||||
{
|
{
|
||||||
//stderr!
|
//stderr!
|
||||||
const char *str = Memory::GetCharPointer(PARAM(1));
|
const char *str = Memory::GetCharPointer(dataAddr);
|
||||||
DEBUG_LOG(HLE,"stderr: %s", str);
|
DEBUG_LOG(HLE,"stderr: %s", str);
|
||||||
RETURN(size);
|
return size;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (PARAM(0) == 1)
|
if (fd == 1)
|
||||||
{
|
{
|
||||||
//stdout!
|
//stdout!
|
||||||
char *str = (char *)Memory::GetPointer(PARAM(1));
|
char *str = (char *)Memory::GetPointer(dataAddr);
|
||||||
char temp = str[size];
|
char temp = str[size];
|
||||||
str[size]=0;
|
str[size]=0;
|
||||||
DEBUG_LOG(HLE,"stdout: %s", str);
|
DEBUG_LOG(HLE,"stdout: %s", str);
|
||||||
str[size]=temp;
|
str[size]=temp;
|
||||||
RETURN(size);
|
return size;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
u8 *data = (u8*)Memory::GetPointer(PARAM(1));
|
u8 *data = (u8*)Memory::GetPointer(dataAddr);
|
||||||
f->asyncResult = RETURN((u32)pspFileSystem.WriteFile(f->handle,data,size));
|
return (f->asyncResult = (u32)pspFileSystem.WriteFile(f->handle,data,size));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"sceIoWrite ERROR: no file open");
|
ERROR_LOG(HLE,"sceIoWrite ERROR: no file open");
|
||||||
RETURN(error);
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoLseek() //(int fd, int64 offset, int whence);
|
u64 sceIoLseek(SceUID fd, s64 offset, u32 whence)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
s64 offset = ((s64)PARAM(2)) | ((s64)(PARAM(3))<<32);
|
|
||||||
int whence = PARAM(4);
|
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
FileMove seek = FILEMOVE_BEGIN;
|
FileMove seek = FILEMOVE_BEGIN;
|
||||||
|
@ -348,26 +338,24 @@ void sceIoLseek() //(int fd, int64 offset, int whence);
|
||||||
case 2: seek=FILEMOVE_END;break;
|
case 2: seek=FILEMOVE_END;break;
|
||||||
}
|
}
|
||||||
|
|
||||||
f->asyncResult = RETURN((u32)pspFileSystem.SeekFile(f->handle, (s32)offset, seek));
|
f->asyncResult = (u32)pspFileSystem.SeekFile(f->handle, offset, seek);
|
||||||
DEBUG_LOG(HLE,"%i = sceIoLseek(%d,%i,%i)",f->asyncResult, id,(int)offset,whence);
|
DEBUG_LOG(HLE,"%i = sceIoLseek(%d,%lli,%i)",f->asyncResult, fd, offset,whence);
|
||||||
|
return f->asyncResult;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"sceIoLseek(%d, %i, %i) - ERROR: invalid file", id, (int)offset, whence);
|
ERROR_LOG(HLE,"sceIoLseek(%d, %lli, %i) - ERROR: invalid file", fd, offset, whence);
|
||||||
RETURN(error);
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoLseek32() //(int fd, int offset, int whence);
|
u32 sceIoLseek32(SceUID fd, int offset, u32 whence)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
s32 offset = (s32)PARAM(2);
|
DEBUG_LOG(HLE,"sceIoLseek32(%d,%08x,%i)",fd,offset,whence);
|
||||||
int whence = PARAM(3);
|
|
||||||
DEBUG_LOG(HLE,"sceIoLseek32(%d,%08x,%i)",id,(int)offset,whence);
|
|
||||||
|
|
||||||
FileMove seek=FILEMOVE_BEGIN;
|
FileMove seek=FILEMOVE_BEGIN;
|
||||||
switch (whence)
|
switch (whence)
|
||||||
|
@ -377,34 +365,29 @@ void sceIoLseek32() //(int fd, int offset, int whence);
|
||||||
case 2: seek=FILEMOVE_END;break;
|
case 2: seek=FILEMOVE_END;break;
|
||||||
}
|
}
|
||||||
|
|
||||||
f->asyncResult = RETURN((u32)pspFileSystem.SeekFile(f->handle, (s32)offset, seek));
|
return (f->asyncResult = (u32)pspFileSystem.SeekFile(f->handle, (s32)offset, seek));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"sceIoLseek32 ERROR: no file open");
|
ERROR_LOG(HLE,"sceIoLseek32 ERROR: no file open");
|
||||||
RETURN(error);
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try WrapI_CU
|
u32 sceIoOpen(const char *filename, int flags, SceMode)
|
||||||
void sceIoOpen() //(const char* file, int mode);
|
|
||||||
{
|
{
|
||||||
const char *filename = Memory::GetCharPointer(PARAM(0));
|
|
||||||
int mode = PARAM(1);
|
|
||||||
|
|
||||||
//memory stick filename
|
//memory stick filename
|
||||||
int access=FILEACCESS_NONE;
|
int access=FILEACCESS_NONE;
|
||||||
if (mode & O_RDONLY) access |= FILEACCESS_READ;
|
if (flags & O_RDONLY) access |= FILEACCESS_READ;
|
||||||
if (mode & O_WRONLY) access |= FILEACCESS_WRITE;
|
if (flags & O_WRONLY) access |= FILEACCESS_WRITE;
|
||||||
if (mode & O_APPEND) access |= FILEACCESS_APPEND;
|
if (flags & O_APPEND) access |= FILEACCESS_APPEND;
|
||||||
if (mode & O_CREAT) access |= FILEACCESS_CREATE;
|
if (flags & O_CREAT) access |= FILEACCESS_CREATE;
|
||||||
|
|
||||||
u32 h = pspFileSystem.OpenFile(filename, (FileAccess)access);
|
u32 h = pspFileSystem.OpenFile(filename, (FileAccess)access);
|
||||||
if (h == 0)
|
if (h == 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"ERROR_ERRNO_FILE_NOT_FOUND=sceIoOpen(%s, %08x) - file not found", filename, mode);
|
ERROR_LOG(HLE,"ERROR_ERRNO_FILE_NOT_FOUND=sceIoOpen(%s, %08x) - file not found", filename, flags);
|
||||||
RETURN(ERROR_ERRNO_FILE_NOT_FOUND);
|
return ERROR_ERRNO_FILE_NOT_FOUND;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileNode *f = new FileNode();
|
FileNode *f = new FileNode();
|
||||||
|
@ -412,46 +395,43 @@ void sceIoOpen() //(const char* file, int mode);
|
||||||
f->handle = h;
|
f->handle = h;
|
||||||
f->fullpath = filename;
|
f->fullpath = filename;
|
||||||
f->asyncResult = id;
|
f->asyncResult = id;
|
||||||
DEBUG_LOG(HLE,"%i=sceIoOpen(%s, %08x)",id,filename,mode);
|
DEBUG_LOG(HLE,"%i=sceIoOpen(%s, %08x)",id,filename,flags);
|
||||||
RETURN(id);
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoClose() //(int fd);
|
u32 sceIoClose(SceUID fd)
|
||||||
{
|
{
|
||||||
SceUID f = PARAM(0);
|
DEBUG_LOG(HLE,"sceIoClose(%d)",fd);
|
||||||
DEBUG_LOG(HLE,"sceIoClose(%d)",f);
|
return kernelObjects.Destroy<FileNode>(fd);
|
||||||
RETURN(kernelObjects.Destroy<FileNode>(f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoRemove() //(const char *file);
|
u32 sceIoRemove(u32 filenameAddr)
|
||||||
{
|
{
|
||||||
const char *filename = Memory::GetCharPointer(PARAM(0));
|
const char *filename = Memory::GetCharPointer(filenameAddr);
|
||||||
if (pspFileSystem.DeleteFile(filename))
|
|
||||||
RETURN(0);
|
|
||||||
else
|
|
||||||
RETURN(-1);
|
|
||||||
DEBUG_LOG(HLE,"sceIoRemove(%s)", filename);
|
DEBUG_LOG(HLE,"sceIoRemove(%s)", filename);
|
||||||
|
if (pspFileSystem.DeleteFile(filename))
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoMkdir() //(const char *dir, int mode);
|
u32 sceIoMkdir(const char *filename, int mode)
|
||||||
{
|
{
|
||||||
const char *filename = Memory::GetCharPointer(PARAM(0));
|
|
||||||
int mode = PARAM(1);
|
|
||||||
if (pspFileSystem.MkDir(filename))
|
|
||||||
RETURN(0);
|
|
||||||
else
|
|
||||||
RETURN(-1);
|
|
||||||
DEBUG_LOG(HLE,"sceIoMkdir(%s, %i)", filename, mode);
|
DEBUG_LOG(HLE,"sceIoMkdir(%s, %i)", filename, mode);
|
||||||
|
if (pspFileSystem.MkDir(filename))
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoRmdir() //(const char *dir);
|
u32 sceIoRmdir(u32 dirAddr)
|
||||||
{
|
{
|
||||||
const char *filename = Memory::GetCharPointer(PARAM(0));
|
const char *filename = Memory::GetCharPointer(dirAddr);
|
||||||
if (pspFileSystem.RmDir(filename))
|
|
||||||
RETURN(0);
|
|
||||||
else
|
|
||||||
RETURN(-1);
|
|
||||||
DEBUG_LOG(HLE,"sceIoRmdir(%s)", filename);
|
DEBUG_LOG(HLE,"sceIoRmdir(%s)", filename);
|
||||||
|
if (pspFileSystem.RmDir(filename))
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoSync()
|
void sceIoSync()
|
||||||
|
@ -468,14 +448,9 @@ struct DeviceSize
|
||||||
u32 freeClusters;
|
u32 freeClusters;
|
||||||
};
|
};
|
||||||
|
|
||||||
void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void *buf, size_t *buflen);
|
u32 sceIoDevctl(u32 nameAddr, int cmd, u32 argAddr, int argLen, u32 outPtr, int outLen)
|
||||||
{
|
{
|
||||||
const char *name = Memory::GetCharPointer(PARAM(0));
|
const char *name = Memory::GetCharPointer(nameAddr);
|
||||||
int cmd = PARAM(1);
|
|
||||||
u32 argAddr = PARAM(2);
|
|
||||||
int argLen = PARAM(3);
|
|
||||||
u32 outPtr = PARAM(4);
|
|
||||||
int outLen = PARAM(5);
|
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
DEBUG_LOG(HLE,"%i=sceIoDevctl(\"%s\", %08x, %08x, %i, %08x, %i)",
|
DEBUG_LOG(HLE,"%i=sceIoDevctl(\"%s\", %08x, %08x, %i, %08x, %i)",
|
||||||
retVal, name, cmd,argAddr,argLen,outPtr,outLen);
|
retVal, name, cmd,argAddr,argLen,outPtr,outLen);
|
||||||
|
@ -490,8 +465,7 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void
|
||||||
case 0x02025806: // Memory stick inserted?
|
case 0x02025806: // Memory stick inserted?
|
||||||
case 0x02025801: // Memstick Driver status?
|
case 0x02025801: // Memstick Driver status?
|
||||||
Memory::Write_U32(1, outPtr);
|
Memory::Write_U32(1, outPtr);
|
||||||
RETURN(0);
|
return 0;
|
||||||
return;
|
|
||||||
case 0x02425818:
|
case 0x02425818:
|
||||||
// Pretend we have a 2GB memory stick.
|
// Pretend we have a 2GB memory stick.
|
||||||
{
|
{
|
||||||
|
@ -504,8 +478,7 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void
|
||||||
deviceSize.totalClusters = (u32)((totalSize * 95 / 100) / (deviceSize.sectorSize * deviceSize.sectorsPerCluster));
|
deviceSize.totalClusters = (u32)((totalSize * 95 / 100) / (deviceSize.sectorSize * deviceSize.sectorsPerCluster));
|
||||||
deviceSize.freeClusters = (u32)((freeSize * 95 / 100) / (deviceSize.sectorSize * deviceSize.sectorsPerCluster));
|
deviceSize.freeClusters = (u32)((freeSize * 95 / 100) / (deviceSize.sectorSize * deviceSize.sectorsPerCluster));
|
||||||
Memory::WriteStruct(outPtr, &deviceSize);
|
Memory::WriteStruct(outPtr, &deviceSize);
|
||||||
RETURN(0);
|
return 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -516,8 +489,7 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void
|
||||||
if (Memory::IsValidAddress(outPtr))
|
if (Memory::IsValidAddress(outPtr))
|
||||||
Memory::Write_U32(1, outPtr); // TODO: Make a headless mode for running tests!
|
Memory::Write_U32(1, outPtr); // TODO: Make a headless mode for running tests!
|
||||||
|
|
||||||
RETURN(0);
|
return 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -564,33 +536,33 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void
|
||||||
089c6c78 ]: HLE: sceIoDevctl("fatms0:", 02415821, 09ffb9c4, 4, 00000000, 0) (z_un_089c6bc4)
|
089c6c78 ]: HLE: sceIoDevctl("fatms0:", 02415821, 09ffb9c4, 4, 00000000, 0) (z_un_089c6bc4)
|
||||||
089c6cac ]: HLE: sceIoDevctl("mscmhc0:", 02025806, 00000000, 0, 09ffb9c8, 4) (z_un_089c6bc4)
|
089c6cac ]: HLE: sceIoDevctl("mscmhc0:", 02025806, 00000000, 0, 09ffb9c8, 4) (z_un_089c6bc4)
|
||||||
*/
|
*/
|
||||||
RETURN(retVal);
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoRename() //(const char *oldname, const char *newname);
|
u32 sceIoRename(u32 oldNameAddr, u32 newNameAddr)
|
||||||
{
|
{
|
||||||
const char *from = Memory::GetCharPointer(PARAM(0));
|
const char *from = Memory::GetCharPointer(oldNameAddr);
|
||||||
const char *to = Memory::GetCharPointer(PARAM(1));
|
const char *to = Memory::GetCharPointer(newNameAddr);
|
||||||
ERROR_LOG(HLE,"UNIMPL sceIoRename(%s, %s)", from, to);
|
ERROR_LOG(HLE,"UNIMPL sceIoRename(%s, %s)", from, to);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoChdir()
|
u32 sceIoChdir(u32 dirAddr)
|
||||||
{
|
{
|
||||||
const char *dir = Memory::GetCharPointer(PARAM(0));
|
const char *dir = Memory::GetCharPointer(dirAddr);
|
||||||
pspFileSystem.ChDir(dir);
|
pspFileSystem.ChDir(dir);
|
||||||
DEBUG_LOG(HLE,"sceIoChdir(%s)",dir);
|
DEBUG_LOG(HLE,"sceIoChdir(%s)",dir);
|
||||||
RETURN(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef u32 (*DeferredAction)(SceUID id, int param);
|
typedef u32 (*DeferredAction)(SceUID id, int param);
|
||||||
DeferredAction defAction = 0;
|
DeferredAction defAction = 0;
|
||||||
u32 defParam;
|
u32 defParam;
|
||||||
|
|
||||||
void sceIoChangeAsyncPriority()
|
u32 sceIoChangeAsyncPriority(u32 prio)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceIoChangeAsyncPriority(%d)", PARAM(0));
|
ERROR_LOG(HLE,"UNIMPL sceIoChangeAsyncPriority(%d)", prio);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 __IoClose(SceUID id, int param)
|
u32 __IoClose(SceUID id, int param)
|
||||||
|
@ -600,154 +572,150 @@ u32 __IoClose(SceUID id, int param)
|
||||||
return kernelObjects.Destroy<FileNode>(id);
|
return kernelObjects.Destroy<FileNode>(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoCloseAsync()
|
u32 sceIoCloseAsync(SceUID fd)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoCloseAsync(%d)",PARAM(0));
|
DEBUG_LOG(HLE,"sceIoCloseAsync(%d)",fd);
|
||||||
//sceIoClose();
|
//sceIoClose();
|
||||||
defAction = &__IoClose;
|
defAction = &__IoClose;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoLseekAsync()
|
u32 sceIoLseekAsync(SceUID fd, SceOff offset, u32 whence)
|
||||||
{
|
{
|
||||||
sceIoLseek();
|
sceIoLseek(fd, offset, whence);
|
||||||
__IoCompleteAsyncIO(PARAM(0));
|
__IoCompleteAsyncIO(fd);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoSetAsyncCallback()
|
u32 sceIoSetAsyncCallback(SceUID fd, SceUID cb, u32 argAddr)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoSetAsyncCallback(%d, %i, %08x)",PARAM(0), PARAM(1), PARAM(2));
|
DEBUG_LOG(HLE,"sceIoSetAsyncCallback(%d, %i, %08x)", fd, cb, argAddr);
|
||||||
|
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
f->callbackID = PARAM(1);
|
f->callbackID = cb;
|
||||||
f->callbackArg = PARAM(2);
|
f->callbackArg = argAddr;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RETURN(error);
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoLseek32Async()
|
u32 sceIoLseek32Async(SceUID fd, int offset, u32 whence)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoLseek32Async(%d) sorta implemented",PARAM(0));
|
DEBUG_LOG(HLE,"sceIoLseek32Async(%d) sorta implemented",fd);
|
||||||
sceIoLseek32();
|
sceIoLseek32(fd, offset, whence);
|
||||||
__IoCompleteAsyncIO(PARAM(0));
|
__IoCompleteAsyncIO(fd);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoOpenAsync()
|
u32 sceIoOpenAsync(const char *filename, int flags, SceMode mode)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoOpenAsync() sorta implemented");
|
DEBUG_LOG(HLE,"sceIoOpenAsync() sorta implemented");
|
||||||
sceIoOpen();
|
return sceIoOpen(filename, flags, mode);
|
||||||
// __IoCompleteAsyncIO(currentMIPS->r[2]); // The return value
|
// __IoCompleteAsyncIO(currentMIPS->r[2]); // The return value
|
||||||
// We have to return a UID here, which may have been destroyed when we reach Wait if it failed.
|
// We have to return a UID here, which may have been destroyed when we reach Wait if it failed.
|
||||||
// Now that we're just faking it, we just don't RETURN(0) here.
|
// Now that we're just faking it, we just don't RETURN(0) here.
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoReadAsync()
|
u32 sceIoReadAsync(SceUID fd, u32 dataAddr, SceSize size)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoReadAsync(%d)",PARAM(0));
|
DEBUG_LOG(HLE,"sceIoReadAsync(%d)",fd);
|
||||||
sceIoRead();
|
sceIoRead(fd, dataAddr, size);
|
||||||
__IoCompleteAsyncIO(PARAM(0));
|
__IoCompleteAsyncIO(fd);
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoGetAsyncStat()
|
u32 sceIoGetAsyncStat(SceUID fd, int poll, u32 resAddr)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
u64 *resPtr = (u64*)Memory::GetPointer(PARAM(2));
|
u64 *resPtr = (u64*)Memory::GetPointer(resAddr);
|
||||||
*resPtr = f->asyncResult;
|
*resPtr = f->asyncResult;
|
||||||
DEBUG_LOG(HLE,"%i = sceIoGetAsyncStat(%i, %i, %08x) (HACK)", (u32)*resPtr, id, PARAM(1), PARAM(2));
|
DEBUG_LOG(HLE,"%i = sceIoGetAsyncStat(%i, %i, %08x) (HACK)", (u32)*resPtr, fd, poll, resAddr);
|
||||||
RETURN(0); //completed
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"ERROR - sceIoGetAsyncStat with invalid id %i", id);
|
ERROR_LOG(HLE,"ERROR - sceIoGetAsyncStat with invalid id %i", fd);
|
||||||
RETURN(-1);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sceIoWaitAsync()
|
u32 sceIoWaitAsync(SceUID fd, u32 resAddr)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
u64 *resPtr = (u64*)Memory::GetPointer(PARAM(1));
|
u64 *resPtr = (u64*)Memory::GetPointer(resAddr);
|
||||||
*resPtr = f->asyncResult;
|
*resPtr = f->asyncResult;
|
||||||
if (defAction)
|
if (defAction)
|
||||||
{
|
{
|
||||||
*resPtr = defAction(id, defParam);
|
*resPtr = defAction(fd, defParam);
|
||||||
defAction = 0;
|
defAction = 0;
|
||||||
}
|
}
|
||||||
DEBUG_LOG(HLE,"%i = sceIoWaitAsync(%i, %08x) (HACK)", (u32)*resPtr, id, PARAM(1));
|
DEBUG_LOG(HLE,"%i = sceIoWaitAsync(%i, %08x) (HACK)", (u32)*resPtr, fd, resAddr);
|
||||||
RETURN(0); //completed
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"ERROR - sceIoWaitAsync waiting for invalid id %i", id);
|
ERROR_LOG(HLE,"ERROR - sceIoWaitAsync waiting for invalid id %i", fd);
|
||||||
RETURN(-1);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoWaitAsyncCB()
|
u32 sceIoWaitAsyncCB(SceUID fd, u32 resAddr)
|
||||||
{
|
{
|
||||||
// Should process callbacks here
|
// Should process callbacks here
|
||||||
|
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
u64 *resPtr = (u64*)Memory::GetPointer(PARAM(1));
|
u64 *resPtr = (u64*)Memory::GetPointer(resAddr);
|
||||||
*resPtr = f->asyncResult;
|
*resPtr = f->asyncResult;
|
||||||
if (defAction)
|
if (defAction)
|
||||||
{
|
{
|
||||||
*resPtr = defAction(id, defParam);
|
*resPtr = defAction(fd, defParam);
|
||||||
defAction = 0;
|
defAction = 0;
|
||||||
}
|
}
|
||||||
DEBUG_LOG(HLE,"%i = sceIoWaitAsyncCB(%i, %08x) (HACK)", (u32)*resPtr, id, PARAM(1));
|
DEBUG_LOG(HLE,"%i = sceIoWaitAsyncCB(%i, %08x) (HACK)", (u32)*resPtr, fd, resAddr);
|
||||||
RETURN(0); //completed
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"ERROR - sceIoWaitAsyncCB waiting for invalid id %i", id);
|
ERROR_LOG(HLE,"ERROR - sceIoWaitAsyncCB waiting for invalid id %i", fd);
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoPollAsync()
|
u32 sceIoPollAsync(SceUID fd, u32 resAddr)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
FileNode *f = kernelObjects.Get<FileNode>(id, error);
|
FileNode *f = kernelObjects.Get<FileNode>(fd, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
u64 *resPtr = (u64*)Memory::GetPointer(PARAM(1));
|
u64 *resPtr = (u64*)Memory::GetPointer(resAddr);
|
||||||
*resPtr = f->asyncResult;
|
*resPtr = f->asyncResult;
|
||||||
if (defAction)
|
if (defAction)
|
||||||
{
|
{
|
||||||
*resPtr = defAction(id, defParam);
|
*resPtr = defAction(fd, defParam);
|
||||||
defAction = 0;
|
defAction = 0;
|
||||||
}
|
}
|
||||||
DEBUG_LOG(HLE,"%i = sceIoPollAsync(%i, %08x) (HACK)", (u32)*resPtr, id, PARAM(1));
|
DEBUG_LOG(HLE,"%i = sceIoPollAsync(%i, %08x) (HACK)", (u32)*resPtr, fd, resAddr);
|
||||||
RETURN(0); //completed
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"ERROR - sceIoPollAsync waiting for invalid id %i", id);
|
ERROR_LOG(HLE,"ERROR - sceIoPollAsync waiting for invalid id %i", fd);
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,9 +732,9 @@ public:
|
||||||
int index;
|
int index;
|
||||||
};
|
};
|
||||||
|
|
||||||
void sceIoDopen() //(const char *path);
|
u32 sceIoDopen(u32 pathAddr)
|
||||||
{
|
{
|
||||||
const char *path = Memory::GetCharPointer(PARAM(0));
|
const char *path = Memory::GetCharPointer(pathAddr);
|
||||||
DEBUG_LOG(HLE,"sceIoDopen(\"%s\")",path);
|
DEBUG_LOG(HLE,"sceIoDopen(\"%s\")",path);
|
||||||
|
|
||||||
DirListing *dir = new DirListing();
|
DirListing *dir = new DirListing();
|
||||||
|
@ -778,86 +746,84 @@ void sceIoDopen() //(const char *path);
|
||||||
dir->index = 0;
|
dir->index = 0;
|
||||||
dir->name = std::string(path);
|
dir->name = std::string(path);
|
||||||
|
|
||||||
RETURN(id);
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoDread()
|
u32 sceIoDread(SceUID id, u32 dirEntAddr)
|
||||||
{
|
{
|
||||||
SceUID id = PARAM(0);
|
|
||||||
u32 error;
|
u32 error;
|
||||||
DirListing *dir = kernelObjects.Get<DirListing>(id, error);
|
DirListing *dir = kernelObjects.Get<DirListing>(id, error);
|
||||||
if (dir)
|
if (dir)
|
||||||
{
|
{
|
||||||
if (dir->index == (int)dir->listing.size())
|
if (dir->index == (int)dir->listing.size())
|
||||||
{
|
{
|
||||||
RETURN(0);
|
return 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PSPFileInfo &info = dir->listing[dir->index];
|
PSPFileInfo &info = dir->listing[dir->index];
|
||||||
|
|
||||||
SceIoDirEnt *entry = (SceIoDirEnt*)Memory::GetPointer(PARAM(1));
|
SceIoDirEnt *entry = (SceIoDirEnt*)Memory::GetPointer(dirEntAddr);
|
||||||
|
|
||||||
__IoGetStat(&entry->d_stat, info);
|
__IoGetStat(&entry->d_stat, info);
|
||||||
|
|
||||||
strncpy(entry->d_name, info.name.c_str(), 256);
|
strncpy(entry->d_name, info.name.c_str(), 256);
|
||||||
entry->d_private = 0xC0DEBABE;
|
entry->d_private = 0xC0DEBABE;
|
||||||
DEBUG_LOG(HLE,"sceIoDread( %d %08x ) = %s", PARAM(0), PARAM(1), entry->d_name);
|
DEBUG_LOG(HLE,"sceIoDread( %d %08x ) = %s", id, dirEntAddr, entry->d_name);
|
||||||
|
|
||||||
dir->index++;
|
dir->index++;
|
||||||
RETURN((u32)(dir->listing.size()-dir->index+1));
|
return (u32)(dir->listing.size()-dir->index+1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"sceIoDread - invalid listing %i, error %08x", id, error);
|
DEBUG_LOG(HLE,"sceIoDread - invalid listing %i, error %08x", id, error);
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceIoDclose()
|
u32 sceIoDclose(SceUID id)
|
||||||
{
|
{
|
||||||
u32 id = PARAM(0);
|
|
||||||
DEBUG_LOG(HLE,"sceIoDclose(%d)",id);
|
DEBUG_LOG(HLE,"sceIoDclose(%d)",id);
|
||||||
RETURN(kernelObjects.Destroy<DirListing>(id));
|
return kernelObjects.Destroy<DirListing>(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const HLEFunction IoFileMgrForUser[] =
|
const HLEFunction IoFileMgrForUser[] =
|
||||||
{
|
{
|
||||||
{0xb29ddf9c,sceIoDopen, "sceIoDopen"},
|
{0xb29ddf9c,&Wrap<sceIoDopen>, "sceIoDopen"},
|
||||||
{0xe3eb004c,sceIoDread, "sceIoDread"},
|
{0xe3eb004c,&Wrap<sceIoDread>, "sceIoDread"},
|
||||||
{0xeb092469,sceIoDclose,"sceIoDclose"},
|
{0xeb092469,&Wrap<sceIoDclose>,"sceIoDclose"},
|
||||||
{0xe95a012b,0,"sceIoIoctlAsync"},
|
{0xe95a012b,0,"sceIoIoctlAsync"},
|
||||||
{0x63632449,0,"sceIoIoctl"},
|
{0x63632449,0,"sceIoIoctl"},
|
||||||
{0xace946e8,sceIoGetstat,"sceIoGetstat"},
|
{0xace946e8,&Wrap<sceIoGetstat>,"sceIoGetstat"},
|
||||||
{0xb8a740f4,0,"sceIoChstat"},
|
{0xb8a740f4,0,"sceIoChstat"},
|
||||||
{0x55f4717d,sceIoChdir,"sceIoChdir"},
|
{0x55f4717d,&Wrap<sceIoChdir>,"sceIoChdir"},
|
||||||
{0x08bd7374,0,"sceIoGetDevType"},
|
{0x08bd7374,0,"sceIoGetDevType"},
|
||||||
{0xB2A628C1,sceIoAssign,"sceIoAssign"},
|
{0xB2A628C1,&Wrap<sceIoAssign>,"sceIoAssign"},
|
||||||
{0xe8bc6571,0,"sceIoCancel"},
|
{0xe8bc6571,0,"sceIoCancel"},
|
||||||
{0xb293727f,sceIoChangeAsyncPriority,"sceIoChangeAsyncPriority"},
|
{0xb293727f,&Wrap<sceIoChangeAsyncPriority>,"sceIoChangeAsyncPriority"},
|
||||||
{0x810C4BC3,sceIoClose, "sceIoClose"}, //(int fd);
|
{0x810C4BC3,&Wrap<sceIoClose>, "sceIoClose"}, //(int fd);
|
||||||
{0xff5940b6,sceIoCloseAsync,"sceIoCloseAsync"},
|
{0xff5940b6,&Wrap<sceIoCloseAsync>,"sceIoCloseAsync"},
|
||||||
{0x54F5FB11,sceIoDevctl,"sceIoDevctl"}, //(const char *name int cmd, void *arg, size_t arglen, void *buf, size_t *buflen);
|
{0x54F5FB11,&Wrap<sceIoDevctl>,"sceIoDevctl"}, //(const char *name int cmd, void *arg, size_t arglen, void *buf, size_t *buflen);
|
||||||
{0xcb05f8d6,sceIoGetAsyncStat,"sceIoGetAsyncStat"},
|
{0xcb05f8d6,&Wrap<sceIoGetAsyncStat>,"sceIoGetAsyncStat"},
|
||||||
{0x27EB27B8,sceIoLseek, "sceIoLseek"}, //(int fd, int offset, int whence);
|
{0x27EB27B8,&Wrap<sceIoLseek>, "sceIoLseek"}, //(int fd, int offset, int whence);
|
||||||
{0x68963324,sceIoLseek32,"sceIoLseek32"},
|
{0x68963324,&Wrap<sceIoLseek32>,"sceIoLseek32"},
|
||||||
{0x1b385d8f,sceIoLseek32Async,"sceIoLseek32Async"},
|
{0x1b385d8f,&Wrap<sceIoLseek32Async>,"sceIoLseek32Async"},
|
||||||
{0x71b19e77,sceIoLseekAsync,"sceIoLseekAsync"},
|
{0x71b19e77,&Wrap<sceIoLseekAsync>,"sceIoLseekAsync"},
|
||||||
{0x109F50BC,sceIoOpen, "sceIoOpen"}, //(const char* file, int mode);
|
{0x109F50BC,&Wrap<sceIoOpen>, "sceIoOpen"}, //(const char* file, int mode);
|
||||||
{0x89AA9906,sceIoOpenAsync,"sceIoOpenAsync"},
|
{0x89AA9906,&Wrap<sceIoOpenAsync>,"sceIoOpenAsync"},
|
||||||
{0x06A70004,sceIoMkdir,"sceIoMkdir"}, //(const char *dir, int mode);
|
{0x06A70004,&Wrap<sceIoMkdir>,"sceIoMkdir"}, //(const char *dir, int mode);
|
||||||
{0x3251ea56,sceIoPollAsync,"sceIoPollAsync"},
|
{0x3251ea56,&Wrap<sceIoPollAsync>,"sceIoPollAsync"},
|
||||||
{0x6A638D83,sceIoRead, "sceIoRead"}, //(int fd, void *data, int size);
|
{0x6A638D83,&Wrap<sceIoRead>, "sceIoRead"}, //(int fd, void *data, int size);
|
||||||
{0xa0b5a7c2,sceIoReadAsync,"sceIoReadAsync"},
|
{0xa0b5a7c2,&Wrap<sceIoReadAsync>,"sceIoReadAsync"},
|
||||||
{0xF27A9C51,sceIoRemove,"sceIoRemove"}, //(const char *file);
|
{0xF27A9C51,&Wrap<sceIoRemove>,"sceIoRemove"}, //(const char *file);
|
||||||
{0x779103A0,sceIoRename,"sceIoRename"}, //(const char *oldname, const char *newname);
|
{0x779103A0,&Wrap<sceIoRename>,"sceIoRename"}, //(const char *oldname, const char *newname);
|
||||||
{0x1117C65F,sceIoRmdir,"sceIoRmdir"}, //(const char *dir);
|
{0x1117C65F,&Wrap<sceIoRmdir>,"sceIoRmdir"}, //(const char *dir);
|
||||||
{0xA12A0514,sceIoSetAsyncCallback,"sceIoSetAsyncCallback"},
|
{0xA12A0514,&Wrap<sceIoSetAsyncCallback>,"sceIoSetAsyncCallback"},
|
||||||
{0xab96437f,sceIoSync,"sceIoSync"},
|
{0xab96437f,&Wrap<sceIoSync>,"sceIoSync"},
|
||||||
{0x6d08a871,0,"sceIoUnassign"},
|
{0x6d08a871,0,"sceIoUnassign"},
|
||||||
{0x42EC03AC,sceIoWrite, "sceIoWrite"}, //(int fd, void *data, int size);
|
{0x42EC03AC,&Wrap<sceIoWrite>, "sceIoWrite"}, //(int fd, void *data, int size);
|
||||||
{0x0facab19,0,"sceIoWriteAsync"},
|
{0x0facab19,0,"sceIoWriteAsync"},
|
||||||
{0x35dbd746,sceIoWaitAsyncCB,"sceIoWaitAsyncCB"},
|
{0x35dbd746,&Wrap<sceIoWaitAsyncCB>,"sceIoWaitAsyncCB"},
|
||||||
{0xe23eec33,sceIoWaitAsync,"sceIoWaitAsync"},
|
{0xe23eec33,&Wrap<sceIoWaitAsync>,"sceIoWaitAsync"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void Register_IoFileMgrForUser()
|
void Register_IoFileMgrForUser()
|
||||||
|
@ -868,9 +834,9 @@ void Register_IoFileMgrForUser()
|
||||||
|
|
||||||
const HLEFunction StdioForUser[] =
|
const HLEFunction StdioForUser[] =
|
||||||
{
|
{
|
||||||
{0x172D316E,sceKernelStdin,"sceKernelStdin"},
|
{0x172D316E,&Wrap<sceKernelStdin>,"sceKernelStdin"},
|
||||||
{0xA6BAB2E9,sceKernelStdout,"sceKernelStdout"},
|
{0xA6BAB2E9,&Wrap<sceKernelStdout>,"sceKernelStdout"},
|
||||||
{0xF78BA90A,sceKernelStderr,"sceKernelStderr"},
|
{0xF78BA90A,&Wrap<sceKernelStderr>,"sceKernelStderr"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void Register_StdioForUser()
|
void Register_StdioForUser()
|
||||||
|
|
|
@ -137,45 +137,45 @@ void sceKernelDevkitVersion()
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
void sceKernelRegisterKprintfHandler()
|
void sceKernelRegisterKprintfHandler(u32, u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceKernelRegisterKprintfHandler()");
|
ERROR_LOG(HLE,"UNIMPL sceKernelRegisterKprintfHandler()");
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelRegisterDefaultExceptionHandler()
|
void sceKernelRegisterDefaultExceptionHandler()
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceKernelRegisterDefaultExceptionHandler()");
|
ERROR_LOG(HLE,"UNIMPL sceKernelRegisterDefaultExceptionHandler()");
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelSetGPO()
|
void sceKernelSetGPO(u32 num)
|
||||||
{
|
{
|
||||||
// Sets debug LEDs.
|
// Sets debug LEDs.
|
||||||
INFO_LOG(HLE,"sceKernelSetGPO(%02x)", PARAM(0));
|
INFO_LOG(HLE,"sceKernelSetGPO(%02x)", num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelGetGPI()
|
u32 sceKernelGetGPI()
|
||||||
{
|
{
|
||||||
// Always returns 0 on production systems.
|
// Always returns 0 on production systems.
|
||||||
INFO_LOG(HLE,"0=sceKernelGetGPI()");
|
INFO_LOG(HLE,"0=sceKernelGetGPI()");
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelDcacheWritebackAll()
|
void sceKernelDcacheWritebackAll()
|
||||||
{
|
{
|
||||||
//RETURN(0);
|
|
||||||
}
|
}
|
||||||
void sceKernelDcacheWritebackRange()
|
|
||||||
|
void sceKernelDcacheWritebackRange(u32, u32)
|
||||||
{
|
{
|
||||||
//RETURN(0);
|
|
||||||
}
|
}
|
||||||
void sceKernelDcacheWritebackInvalidateRange()
|
|
||||||
|
void sceKernelDcacheWritebackInvalidateRange(u32, u32)
|
||||||
{
|
{
|
||||||
//RETURN(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelDcacheWritebackInvalidateAll()
|
void sceKernelDcacheWritebackInvalidateAll()
|
||||||
{
|
{
|
||||||
// RETURN(0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KernelObjectPool kernelObjects;
|
KernelObjectPool kernelObjects;
|
||||||
|
@ -269,71 +269,71 @@ void sceKernelIcacheInvalidateAll()
|
||||||
|
|
||||||
const HLEFunction ThreadManForUser[] =
|
const HLEFunction ThreadManForUser[] =
|
||||||
{
|
{
|
||||||
{0x55C20A00,sceKernelCreateEventFlag, "sceKernelCreateEventFlag"},
|
{0x55C20A00,&Wrap<sceKernelCreateEventFlag>, "sceKernelCreateEventFlag"},
|
||||||
{0x812346E4,sceKernelClearEventFlag, "sceKernelClearEventFlag"},
|
{0x812346E4,&Wrap<sceKernelClearEventFlag>, "sceKernelClearEventFlag"},
|
||||||
{0xEF9E4C70,sceKernelDeleteEventFlag, "sceKernelDeleteEventFlag"},
|
{0xEF9E4C70,&Wrap<sceKernelDeleteEventFlag>, "sceKernelDeleteEventFlag"},
|
||||||
{0x1fb15a32,sceKernelSetEventFlag, "sceKernelSetEventFlag"},
|
{0x1fb15a32,&Wrap<sceKernelSetEventFlag>, "sceKernelSetEventFlag"},
|
||||||
{0x402FCF22,sceKernelWaitEventFlag, "sceKernelWaitEventFlag"},
|
{0x402FCF22,&Wrap<sceKernelWaitEventFlag>, "sceKernelWaitEventFlag"},
|
||||||
{0x328C546A,sceKernelWaitEventFlagCB, "sceKernelWaitEventFlagCB"},
|
{0x328C546A,&Wrap<sceKernelWaitEventFlagCB>, "sceKernelWaitEventFlagCB"},
|
||||||
{0x30FD48F0,sceKernelPollEventFlag, "sceKernelPollEventFlag"},
|
{0x30FD48F0,&Wrap<sceKernelPollEventFlag>, "sceKernelPollEventFlag"},
|
||||||
{0xCD203292,sceKernelCancelEventFlag, "sceKernelCancelEventFlag"},
|
{0xCD203292,&Wrap<sceKernelCancelEventFlag>, "sceKernelCancelEventFlag"},
|
||||||
{0xA66B0120,sceKernelReferEventFlagStatus,"sceKernelReferEventFlagStatus"},
|
{0xA66B0120,&Wrap<sceKernelReferEventFlagStatus>,"sceKernelReferEventFlagStatus"},
|
||||||
|
|
||||||
{0x8FFDF9A2,sceKernelCancelSema, "sceKernelCancelSema"},
|
{0x8FFDF9A2,&Wrap<sceKernelCancelSema>, "sceKernelCancelSema"},
|
||||||
{0xD6DA4BA1,sceKernelCreateSema, "sceKernelCreateSema"},
|
{0xD6DA4BA1,&Wrap<sceKernelCreateSema>, "sceKernelCreateSema"},
|
||||||
{0x28b6489c,sceKernelDeleteSema, "sceKernelDeleteSema"},
|
{0x28b6489c,&Wrap<sceKernelDeleteSema>, "sceKernelDeleteSema"},
|
||||||
{0x58b1f937,sceKernelPollSema, "sceKernelPollSema"},
|
{0x58b1f937,&Wrap<sceKernelPollSema>, "sceKernelPollSema"},
|
||||||
{0xBC6FEBC5,sceKernelReferSemaStatus,"sceKernelReferSemaStatus"},
|
{0xBC6FEBC5,&Wrap<sceKernelReferSemaStatus>,"sceKernelReferSemaStatus"},
|
||||||
{0x3F53E640,sceKernelSignalSema, "sceKernelSignalSema"},
|
{0x3F53E640,&Wrap<sceKernelSignalSema>, "sceKernelSignalSema"},
|
||||||
{0x4E3A1105,sceKernelWaitSema, "sceKernelWaitSema"},
|
{0x4E3A1105,&Wrap<sceKernelWaitSema>, "sceKernelWaitSema"},
|
||||||
{0x6d212bac,sceKernelWaitSemaCB, "sceKernelWaitSemaCB"},
|
{0x6d212bac,&Wrap<sceKernelWaitSemaCB>, "sceKernelWaitSemaCB"},
|
||||||
|
|
||||||
{0x60107536,0,"sceKernelDeleteLwMutex"},
|
{0x60107536,0,"sceKernelDeleteLwMutex"},
|
||||||
{0x19CFF145,0,"sceKernelCreateLwMutex"},
|
{0x19CFF145,0,"sceKernelCreateLwMutex"},
|
||||||
{0xf8170fbe,&WrapU_U<sceKernelDeleteMutex>,"sceKernelDeleteMutex"},
|
{0xf8170fbe,&Wrap<sceKernelDeleteMutex>,"sceKernelDeleteMutex"},
|
||||||
{0xB011B11F,&WrapU_UUU<sceKernelLockMutex>,"sceKernelLockMutex"},
|
{0xB011B11F,&Wrap<sceKernelLockMutex>,"sceKernelLockMutex"},
|
||||||
{0x5bf4dd27,&WrapU_UUU<sceKernelLockMutexCB>,"sceKernelLockMutexCB"},
|
{0x5bf4dd27,&Wrap<sceKernelLockMutexCB>,"sceKernelLockMutexCB"},
|
||||||
{0x6b30100f,&WrapU_UU<sceKernelUnlockMutex>,"sceKernelUnlockMutex"},
|
{0x6b30100f,&Wrap<sceKernelUnlockMutex>,"sceKernelUnlockMutex"},
|
||||||
{0xb7d098c6,&WrapU_CUU<sceKernelCreateMutex>,"sceKernelCreateMutex"},
|
{0xb7d098c6,&Wrap<sceKernelCreateMutex>,"sceKernelCreateMutex"},
|
||||||
// NOTE: LockLwMutex and UnlockLwMutex are in Kernel_Library, see sceKernelInterrupt.cpp.
|
// NOTE: LockLwMutex and UnlockLwMutex are in Kernel_Library, see sceKernelInterrupt.cpp.
|
||||||
|
|
||||||
{0xFCCFAD26,0,"sceKernelCancelWakeupThread"},
|
{0xFCCFAD26,0,"sceKernelCancelWakeupThread"},
|
||||||
{0xea748e31,sceKernelChangeCurrentThreadAttr,"sceKernelChangeCurrentThreadAttr"},
|
{0xea748e31,&Wrap<sceKernelChangeCurrentThreadAttr>,"sceKernelChangeCurrentThreadAttr"},
|
||||||
{0x71bc9871,sceKernelChangeThreadPriority,"sceKernelChangeThreadPriority"},
|
{0x71bc9871,&Wrap<sceKernelChangeThreadPriority>,"sceKernelChangeThreadPriority"},
|
||||||
{0x446D8DE6,sceKernelCreateThread,"sceKernelCreateThread"},
|
{0x446D8DE6,&Wrap<sceKernelCreateThread>,"sceKernelCreateThread"},
|
||||||
{0x9fa03cd3,sceKernelDeleteThread,"sceKernelDeleteThread"},
|
{0x9fa03cd3,&Wrap<sceKernelDeleteThread>,"sceKernelDeleteThread"},
|
||||||
{0xBD123D9E,0,"sceKernelDelaySysClockThread"},
|
{0xBD123D9E,0,"sceKernelDelaySysClockThread"},
|
||||||
{0x1181E963,0,"sceKernelDelaySysClockThreadCB"},
|
{0x1181E963,0,"sceKernelDelaySysClockThreadCB"},
|
||||||
{0xceadeb47,sceKernelDelayThread,"sceKernelDelayThread"},
|
{0xceadeb47,&Wrap<sceKernelDelayThread>,"sceKernelDelayThread"},
|
||||||
{0x68da9e36,sceKernelDelayThreadCB,"sceKernelDelayThreadCB"},
|
{0x68da9e36,&Wrap<sceKernelDelayThreadCB>,"sceKernelDelayThreadCB"},
|
||||||
{0xaa73c935,sceKernelExitThread,"sceKernelExitThread"},
|
{0xaa73c935,&Wrap<sceKernelExitThread>,"sceKernelExitThread"},
|
||||||
{0x809ce29b,sceKernelExitDeleteThread,"sceKernelExitDeleteThread"},
|
{0x809ce29b,&Wrap<sceKernelExitDeleteThread>,"sceKernelExitDeleteThread"},
|
||||||
{0x94aa61ee,0,"sceKernelGetThreadCurrentPriority"},
|
{0x94aa61ee,0,"sceKernelGetThreadCurrentPriority"},
|
||||||
{0x293b45b8,sceKernelGetThreadId,"sceKernelGetThreadId"},
|
{0x293b45b8,&Wrap<sceKernelGetThreadId>,"sceKernelGetThreadId"},
|
||||||
{0x3B183E26,sceKernelGetThreadExitStatus,"sceKernelGetThreadExitStatus"},
|
{0x3B183E26,&Wrap<sceKernelGetThreadExitStatus>,"sceKernelGetThreadExitStatus"},
|
||||||
{0x52089CA1,sceKernelGetThreadStackFreeSize,"sceKernelGetThreadStackFreeSize"},
|
{0x52089CA1,&Wrap<sceKernelGetThreadStackFreeSize>,"sceKernelGetThreadStackFreeSize"},
|
||||||
{0xFFC36A14,0,"sceKernelReferThreadRunStatus"},
|
{0xFFC36A14,0,"sceKernelReferThreadRunStatus"},
|
||||||
{0x17c1684e,sceKernelReferThreadStatus,"sceKernelReferThreadStatus"},
|
{0x17c1684e,&Wrap<sceKernelReferThreadStatus>,"sceKernelReferThreadStatus"},
|
||||||
{0x2C34E053,0,"sceKernelReleaseWaitThread"},
|
{0x2C34E053,0,"sceKernelReleaseWaitThread"},
|
||||||
{0x75156e8f,sceKernelResumeThread,"sceKernelResumeThread"},
|
{0x75156e8f,&Wrap<sceKernelResumeThread>,"sceKernelResumeThread"},
|
||||||
{0x27e22ec2,0,"sceKernelResumeDispatchThread"},
|
{0x27e22ec2,0,"sceKernelResumeDispatchThread"},
|
||||||
{0x912354a7,sceKernelRotateThreadReadyQueue,"sceKernelRotateThreadReadyQueue"},
|
{0x912354a7,&Wrap<sceKernelRotateThreadReadyQueue>,"sceKernelRotateThreadReadyQueue"},
|
||||||
{0x9ACE131E,sceKernelSleepThread,"sceKernelSleepThread"},
|
{0x9ACE131E,&Wrap<sceKernelSleepThread>,"sceKernelSleepThread"},
|
||||||
{0x82826f70,sceKernelSleepThreadCB,"sceKernelSleepThreadCB"},
|
{0x82826f70,&Wrap<sceKernelSleepThreadCB>,"sceKernelSleepThreadCB"},
|
||||||
{0xF475845D,sceKernelStartThread,"sceKernelStartThread"},
|
{0xF475845D,&Wrap<sceKernelStartThread>,"sceKernelStartThread"},
|
||||||
{0x9944f31f,sceKernelSuspendThread,"sceKernelSuspendThread"},
|
{0x9944f31f,&Wrap<sceKernelSuspendThread>,"sceKernelSuspendThread"},
|
||||||
{0x3ad58b8c,0,"sceKernelSuspendDispatchThread"},
|
{0x3ad58b8c,0,"sceKernelSuspendDispatchThread"},
|
||||||
{0x616403ba,0,"sceKernelTerminateThread"},
|
{0x616403ba,0,"sceKernelTerminateThread"},
|
||||||
{0x383f7bcc,sceKernelTerminateDeleteThread,"sceKernelTerminateDeleteThread"},
|
{0x383f7bcc,&Wrap<sceKernelTerminateDeleteThread>,"sceKernelTerminateDeleteThread"},
|
||||||
{0x840E8133,sceKernelWaitThreadEndCB,"sceKernelWaitThreadEndCB"},
|
{0x840E8133,&Wrap<sceKernelWaitThreadEndCB>,"sceKernelWaitThreadEndCB"},
|
||||||
{0xd13bde95,sceKernelCheckThreadStack,"sceKernelCheckThreadStack"},
|
{0xd13bde95,&Wrap<sceKernelCheckThreadStack>,"sceKernelCheckThreadStack"},
|
||||||
|
|
||||||
{0x94416130,0,"sceKernelGetThreadmanIdList"},
|
{0x94416130,0,"sceKernelGetThreadmanIdList"},
|
||||||
{0x57CF62DD,sceKernelGetThreadmanIdType,"sceKernelGetThreadmanIdType"},
|
{0x57CF62DD,&Wrap<sceKernelGetThreadmanIdType>,"sceKernelGetThreadmanIdType"},
|
||||||
|
|
||||||
{0x20fff560,sceKernelCreateVTimer,"sceKernelCreateVTimer"},
|
{0x20fff560,&Wrap<sceKernelCreateVTimer>,"sceKernelCreateVTimer"},
|
||||||
{0x328F9E52,0,"sceKernelDeleteVTimer"},
|
{0x328F9E52,0,"sceKernelDeleteVTimer"},
|
||||||
{0xc68d9437,sceKernelStartVTimer,"sceKernelStartVTimer"},
|
{0xc68d9437,&Wrap<sceKernelStartVTimer>,"sceKernelStartVTimer"},
|
||||||
{0xD0AEEE87,0,"sceKernelStopVTimer"},
|
{0xD0AEEE87,0,"sceKernelStopVTimer"},
|
||||||
{0xD2D615EF,0,"sceKernelCancelVTimerHandler"},
|
{0xD2D615EF,0,"sceKernelCancelVTimerHandler"},
|
||||||
{0xB3A59970,0,"sceKernelGetVTimerBase"},
|
{0xB3A59970,0,"sceKernelGetVTimerBase"},
|
||||||
|
@ -343,82 +343,82 @@ const HLEFunction ThreadManForUser[] =
|
||||||
{0x5F32BEAA,0,"sceKernelReferVTimerStatus"},
|
{0x5F32BEAA,0,"sceKernelReferVTimerStatus"},
|
||||||
{0x542AD630,0,"sceKernelSetVTimerTime"},
|
{0x542AD630,0,"sceKernelSetVTimerTime"},
|
||||||
{0xFB6425C3,0,"sceKernelSetVTimerTimeWide"},
|
{0xFB6425C3,0,"sceKernelSetVTimerTimeWide"},
|
||||||
{0xd8b299ae,sceKernelSetVTimerHandler,"sceKernelSetVTimerHandler"},
|
{0xd8b299ae,&Wrap<sceKernelSetVTimerHandler>,"sceKernelSetVTimerHandler"},
|
||||||
{0x53B00E9A,0,"sceKernelSetVTimerHandlerWide"},
|
{0x53B00E9A,0,"sceKernelSetVTimerHandlerWide"},
|
||||||
|
|
||||||
{0x82BC5777,sceKernelGetSystemTimeWide,"sceKernelGetSystemTimeWide"},
|
{0x82BC5777,&Wrap<sceKernelGetSystemTimeWide>,"sceKernelGetSystemTimeWide"},
|
||||||
{0xdb738f35,sceKernelGetSystemTime,"sceKernelGetSystemTime"},
|
{0xdb738f35,&Wrap<sceKernelGetSystemTime>,"sceKernelGetSystemTime"},
|
||||||
{0x369ed59d,sceKernelGetSystemTimeLow,"sceKernelGetSystemTimeLow"},
|
{0x369ed59d,&Wrap<sceKernelGetSystemTimeLow>,"sceKernelGetSystemTimeLow"},
|
||||||
|
|
||||||
{0x8218B4DD,0,"sceKernelReferGlobalProfiler"},
|
{0x8218B4DD,0,"sceKernelReferGlobalProfiler"},
|
||||||
{0x627E6F3A,0,"sceKernelReferSystemStatus"},
|
{0x627E6F3A,0,"sceKernelReferSystemStatus"},
|
||||||
{0x64D4540E,0,"sceKernelReferThreadProfiler"},
|
{0x64D4540E,0,"sceKernelReferThreadProfiler"},
|
||||||
|
|
||||||
//Fifa Street 2 uses alarms
|
//Fifa Street 2 uses alarms
|
||||||
{0x6652b8ca,sceKernelSetAlarm,"sceKernelSetAlarm"},
|
{0x6652b8ca,&Wrap<sceKernelSetAlarm>,"sceKernelSetAlarm"},
|
||||||
{0xB2C25152,sceKernelSetSysClockAlarm,"sceKernelSetSysClockAlarm"},
|
{0xB2C25152,&Wrap<sceKernelSetSysClockAlarm>,"sceKernelSetSysClockAlarm"},
|
||||||
{0x7e65b999,sceKernelCancelAlarm,"sceKernelCancelAlarm"},
|
{0x7e65b999,&Wrap<sceKernelCancelAlarm>,"sceKernelCancelAlarm"},
|
||||||
{0xDAA3F564,sceKernelReferAlarmStatus,"sceKernelReferAlarmStatus"},
|
{0xDAA3F564,&Wrap<sceKernelReferAlarmStatus>,"sceKernelReferAlarmStatus"},
|
||||||
|
|
||||||
{0xba6b92e2,sceKernelSysClock2USec,"sceKernelSysClock2USec"},
|
{0xba6b92e2,&Wrap<sceKernelSysClock2USec>,"sceKernelSysClock2USec"},
|
||||||
{0x110DEC9A,0,"sceKernelUSec2SysClock"},
|
{0x110DEC9A,0,"sceKernelUSec2SysClock"},
|
||||||
{0xC8CD158C,0,"sceKernelUSec2SysClockWide"},
|
{0xC8CD158C,0,"sceKernelUSec2SysClockWide"},
|
||||||
{0xE1619D7C,sceKernelSysClock2USecWide,"sceKernelSysClock2USecWide"},
|
{0xE1619D7C,&Wrap<sceKernelSysClock2USecWide>,"sceKernelSysClock2USecWide"},
|
||||||
|
|
||||||
{0x110dec9a,sceKernelUSec2SysClock,"sceKernelUSec2SysClock"},
|
{0x110dec9a,&Wrap<sceKernelUSec2SysClock>,"sceKernelUSec2SysClock"},
|
||||||
{0x278C0DF5,sceKernelWaitThreadEnd,"sceKernelWaitThreadEnd"},
|
{0x278C0DF5,&Wrap<sceKernelWaitThreadEnd>,"sceKernelWaitThreadEnd"},
|
||||||
{0xd59ead2f,sceKernelWakeupThread,"sceKernelWakeupThread"}, //AI Go, audio?
|
{0xd59ead2f,&Wrap<sceKernelWakeupThread>,"sceKernelWakeupThread"}, //AI Go, audio?
|
||||||
|
|
||||||
{0x0C106E53,0,"sceKernelRegisterThreadEventHandler"},
|
{0x0C106E53,0,"sceKernelRegisterThreadEventHandler"},
|
||||||
{0x72F3C145,0,"sceKernelReleaseThreadEventHandler"},
|
{0x72F3C145,0,"sceKernelReleaseThreadEventHandler"},
|
||||||
{0x369EEB6B,0,"sceKernelReferThreadEventHandlerStatus"},
|
{0x369EEB6B,0,"sceKernelReferThreadEventHandlerStatus"},
|
||||||
|
|
||||||
{0x349d6d6c,sceKernelCheckCallback,"sceKernelCheckCallback"},
|
{0x349d6d6c,&Wrap<sceKernelCheckCallback>,"sceKernelCheckCallback"},
|
||||||
{0xE81CAF8F,sceKernelCreateCallback,"sceKernelCreateCallback"},
|
{0xE81CAF8F,&Wrap<sceKernelCreateCallback>,"sceKernelCreateCallback"},
|
||||||
{0xEDBA5844,sceKernelDeleteCallback,"sceKernelDeleteCallback"},
|
{0xEDBA5844,&Wrap<sceKernelDeleteCallback>,"sceKernelDeleteCallback"},
|
||||||
{0xC11BA8C4,sceKernelNotifyCallback,"sceKernelNotifyCallback"},
|
{0xC11BA8C4,&Wrap<sceKernelNotifyCallback>,"sceKernelNotifyCallback"},
|
||||||
{0xBA4051D6,sceKernelCancelCallback,"sceKernelCancelCallback"},
|
{0xBA4051D6,&Wrap<sceKernelCancelCallback>,"sceKernelCancelCallback"},
|
||||||
{0x2A3D44FF,sceKernelGetCallbackCount,"sceKernelGetCallbackCount"},
|
{0x2A3D44FF,&Wrap<sceKernelGetCallbackCount>,"sceKernelGetCallbackCount"},
|
||||||
{0x349D6D6C,sceKernelCheckCallback,"sceKernelCheckCallback"},
|
{0x349D6D6C,&Wrap<sceKernelCheckCallback>,"sceKernelCheckCallback"},
|
||||||
{0x730ED8BC,sceKernelReferCallbackStatus,"sceKernelReferCallbackStatus"},
|
{0x730ED8BC,&Wrap<sceKernelReferCallbackStatus>,"sceKernelReferCallbackStatus"},
|
||||||
|
|
||||||
{0x8125221D,sceKernelCreateMbx,"sceKernelCreateMbx"},
|
{0x8125221D,&Wrap<sceKernelCreateMbx>,"sceKernelCreateMbx"},
|
||||||
{0x86255ADA,sceKernelDeleteMbx,"sceKernelDeleteMbx"},
|
{0x86255ADA,&Wrap<sceKernelDeleteMbx>,"sceKernelDeleteMbx"},
|
||||||
{0xE9B3061E,sceKernelSendMbx,"sceKernelSendMbx"},
|
{0xE9B3061E,&Wrap<sceKernelSendMbx>,"sceKernelSendMbx"},
|
||||||
{0x18260574,sceKernelReceiveMbx,"sceKernelReceiveMbx"},
|
{0x18260574,&Wrap<sceKernelReceiveMbx>,"sceKernelReceiveMbx"},
|
||||||
{0xF3986382,sceKernelReceiveMbxCB,"sceKernelReceiveMbxCB"},
|
{0xF3986382,&Wrap<sceKernelReceiveMbxCB>,"sceKernelReceiveMbxCB"},
|
||||||
{0x0D81716A,sceKernelPollMbx,"sceKernelPollMbx"},
|
{0x0D81716A,&Wrap<sceKernelPollMbx>,"sceKernelPollMbx"},
|
||||||
{0x87D4DD36,sceKernelCancelReceiveMbx,"sceKernelCancelReceiveMbx"},
|
{0x87D4DD36,&Wrap<sceKernelCancelReceiveMbx>,"sceKernelCancelReceiveMbx"},
|
||||||
{0xA8E8C846,sceKernelReferMbxStatus,"sceKernelReferMbxStatus"},
|
{0xA8E8C846,&Wrap<sceKernelReferMbxStatus>,"sceKernelReferMbxStatus"},
|
||||||
|
|
||||||
{0x7C0DC2A0,sceKernelCreateMsgPipe,"sceKernelCreateMsgPipe"},
|
{0x7C0DC2A0,&Wrap<sceKernelCreateMsgPipe>,"sceKernelCreateMsgPipe"},
|
||||||
{0xF0B7DA1C,sceKernelDeleteMsgPipe,"sceKernelDeleteMsgPipe"},
|
{0xF0B7DA1C,&Wrap<sceKernelDeleteMsgPipe>,"sceKernelDeleteMsgPipe"},
|
||||||
{0x876DBFAD,sceKernelSendMsgPipe,"sceKernelSendMsgPipe"},
|
{0x876DBFAD,&Wrap<sceKernelSendMsgPipe>,"sceKernelSendMsgPipe"},
|
||||||
{0x7C41F2C2,sceKernelSendMsgPipeCB,"sceKernelSendMsgPipeCB"},
|
{0x7C41F2C2,&Wrap<sceKernelSendMsgPipeCB>,"sceKernelSendMsgPipeCB"},
|
||||||
{0x884C9F90,sceKernelTrySendMsgPipe,"sceKernelTrySendMsgPipe"},
|
{0x884C9F90,&Wrap<sceKernelTrySendMsgPipe>,"sceKernelTrySendMsgPipe"},
|
||||||
{0x74829B76,sceKernelReceiveMsgPipe,"sceKernelReceiveMsgPipe"},
|
{0x74829B76,&Wrap<sceKernelReceiveMsgPipe>,"sceKernelReceiveMsgPipe"},
|
||||||
{0xFBFA697D,sceKernelReceiveMsgPipeCB,"sceKernelReceiveMsgPipeCB"},
|
{0xFBFA697D,&Wrap<sceKernelReceiveMsgPipeCB>,"sceKernelReceiveMsgPipeCB"},
|
||||||
{0xDF52098F,sceKernelTryReceiveMsgPipe,"sceKernelTryReceiveMsgPipe"},
|
{0xDF52098F,&Wrap<sceKernelTryReceiveMsgPipe>,"sceKernelTryReceiveMsgPipe"},
|
||||||
{0x349B864D,sceKernelCancelMsgPipe,"sceKernelCancelMsgPipe"},
|
{0x349B864D,&Wrap<sceKernelCancelMsgPipe>,"sceKernelCancelMsgPipe"},
|
||||||
{0x33BE4024,sceKernelReferMsgPipeStatus,"sceKernelReferMsgPipeStatus"},
|
{0x33BE4024,&Wrap<sceKernelReferMsgPipeStatus>,"sceKernelReferMsgPipeStatus"},
|
||||||
|
|
||||||
{0x56C039B5,sceKernelCreateVpl,"sceKernelCreateVpl"},
|
{0x56C039B5,&Wrap<sceKernelCreateVpl>,"sceKernelCreateVpl"},
|
||||||
{0x89B3D48C,sceKernelDeleteVpl,"sceKernelDeleteVpl"},
|
{0x89B3D48C,&Wrap<sceKernelDeleteVpl>,"sceKernelDeleteVpl"},
|
||||||
{0xBED27435,sceKernelAllocateVpl,"sceKernelAllocateVpl"},
|
{0xBED27435,&Wrap<sceKernelAllocateVpl>,"sceKernelAllocateVpl"},
|
||||||
{0xEC0A693F,sceKernelAllocateVplCB,"sceKernelAllocateVplCB"},
|
{0xEC0A693F,&Wrap<sceKernelAllocateVplCB>,"sceKernelAllocateVplCB"},
|
||||||
{0xAF36D708,sceKernelTryAllocateVpl,"sceKernelTryAllocateVpl"},
|
{0xAF36D708,&Wrap<sceKernelTryAllocateVpl>,"sceKernelTryAllocateVpl"},
|
||||||
{0xB736E9FF,sceKernelFreeVpl,"sceKernelFreeVpl"},
|
{0xB736E9FF,&Wrap<sceKernelFreeVpl>,"sceKernelFreeVpl"},
|
||||||
{0x1D371B8A,sceKernelCancelVpl,"sceKernelCancelVpl"},
|
{0x1D371B8A,&Wrap<sceKernelCancelVpl>,"sceKernelCancelVpl"},
|
||||||
{0x39810265,sceKernelReferVplStatus,"sceKernelReferVplStatus"},
|
{0x39810265,&Wrap<sceKernelReferVplStatus>,"sceKernelReferVplStatus"},
|
||||||
|
|
||||||
{0xC07BB470,sceKernelCreateFpl,"sceKernelCreateFpl"},
|
{0xC07BB470,&Wrap<sceKernelCreateFpl>,"sceKernelCreateFpl"},
|
||||||
{0xED1410E0,sceKernelDeleteFpl,"sceKernelDeleteFpl"},
|
{0xED1410E0,&Wrap<sceKernelDeleteFpl>,"sceKernelDeleteFpl"},
|
||||||
{0xD979E9BF,sceKernelAllocateFpl,"sceKernelAllocateFpl"},
|
{0xD979E9BF,&Wrap<sceKernelAllocateFpl>,"sceKernelAllocateFpl"},
|
||||||
{0xE7282CB6,sceKernelAllocateFplCB,"sceKernelAllocateFplCB"},
|
{0xE7282CB6,&Wrap<sceKernelAllocateFplCB>,"sceKernelAllocateFplCB"},
|
||||||
{0x623AE665,sceKernelTryAllocateFpl,"sceKernelTryAllocateFpl"},
|
{0x623AE665,&Wrap<sceKernelTryAllocateFpl>,"sceKernelTryAllocateFpl"},
|
||||||
{0xF6414A71,sceKernelFreeFpl,"sceKernelFreeFpl"},
|
{0xF6414A71,&Wrap<sceKernelFreeFpl>,"sceKernelFreeFpl"},
|
||||||
{0xA8AA591F,sceKernelCancelFpl,"sceKernelCancelFpl"},
|
{0xA8AA591F,&Wrap<sceKernelCancelFpl>,"sceKernelCancelFpl"},
|
||||||
{0xD8199E4C,sceKernelReferFplStatus,"sceKernelReferFplStatus"},
|
{0xD8199E4C,&Wrap<sceKernelReferFplStatus>,"sceKernelReferFplStatus"},
|
||||||
|
|
||||||
{0x0E927AED, _sceKernelReturnFromTimerHandler, "_sceKernelReturnFromTimerHandler"},
|
{0x0E927AED, _sceKernelReturnFromTimerHandler, "_sceKernelReturnFromTimerHandler"},
|
||||||
{0x532A522E, _sceKernelExitThread,"_sceKernelExitThread"},
|
{0x532A522E, _sceKernelExitThread,"_sceKernelExitThread"},
|
||||||
|
|
|
@ -253,16 +253,16 @@ void sceKernelSleepThreadCB();
|
||||||
|
|
||||||
void sceKernelDevkitVersion();
|
void sceKernelDevkitVersion();
|
||||||
|
|
||||||
void sceKernelRegisterKprintfHandler();
|
void sceKernelRegisterKprintfHandler(u32, u32);
|
||||||
void sceKernelRegisterDefaultExceptionHandler();
|
void sceKernelRegisterDefaultExceptionHandler();
|
||||||
|
|
||||||
void sceKernelFindModuleByName();
|
u32 sceKernelFindModuleByName(u32);
|
||||||
|
|
||||||
void sceKernelSetGPO();
|
void sceKernelSetGPO(u32);
|
||||||
void sceKernelGetGPI();
|
u32 sceKernelGetGPI();
|
||||||
void sceKernelDcacheWritebackAll();
|
void sceKernelDcacheWritebackAll();
|
||||||
void sceKernelDcacheWritebackRange();
|
void sceKernelDcacheWritebackRange(u32, u32);
|
||||||
void sceKernelDcacheWritebackInvalidateRange();
|
void sceKernelDcacheWritebackInvalidateRange(u32, u32);
|
||||||
void sceKernelDcacheWritebackInvalidateAll();
|
void sceKernelDcacheWritebackInvalidateAll();
|
||||||
void sceKernelGetThreadStackFreeSize();
|
void sceKernelGetThreadStackFreeSize();
|
||||||
void sceKernelIcacheInvalidateAll();
|
void sceKernelIcacheInvalidateAll();
|
||||||
|
|
|
@ -178,6 +178,13 @@ retry:
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wokeThreads)
|
||||||
|
{
|
||||||
|
// Probably useful to make things go faster: trigger thread change directly after the event flag has been set
|
||||||
|
__KernelReSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -211,9 +218,9 @@ void sceKernelWaitEventFlag()
|
||||||
th.wait = wait;
|
th.wait = wait;
|
||||||
th.outAddr = outBitsPtr;
|
th.outAddr = outBitsPtr;
|
||||||
e->waitingThreads.push_back(th);
|
e->waitingThreads.push_back(th);
|
||||||
u32 timeout;
|
//u32 timeout;
|
||||||
if (Memory::IsValidAddress(timeoutPtr))
|
//if (Memory::IsValidAddress(timeoutPtr))
|
||||||
timeout = Memory::Read_U32(timeoutPtr);
|
// timeout = Memory::Read_U32(timeoutPtr);
|
||||||
|
|
||||||
__KernelWaitCurThread(WAITTYPE_EVENTFLAG, id, 0, 0, false);
|
__KernelWaitCurThread(WAITTYPE_EVENTFLAG, id, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
@ -250,9 +257,9 @@ void sceKernelWaitEventFlagCB()
|
||||||
th.wait = wait;
|
th.wait = wait;
|
||||||
th.outAddr = outBitsPtr;
|
th.outAddr = outBitsPtr;
|
||||||
e->waitingThreads.push_back(th);
|
e->waitingThreads.push_back(th);
|
||||||
u32 timeout;
|
//u32 timeout;
|
||||||
if (Memory::IsValidAddress(timeoutPtr))
|
//if (Memory::IsValidAddress(timeoutPtr))
|
||||||
timeout = Memory::Read_U32(timeoutPtr);
|
// timeout = Memory::Read_U32(timeoutPtr);
|
||||||
|
|
||||||
__KernelWaitCurThread(WAITTYPE_EVENTFLAG, id, 0, 0, true);
|
__KernelWaitCurThread(WAITTYPE_EVENTFLAG, id, 0, 0, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,7 @@ public:
|
||||||
if (has(subIntrNum))
|
if (has(subIntrNum))
|
||||||
return subIntrHandlers[subIntrNum];
|
return subIntrHandlers[subIntrNum];
|
||||||
// what to do, what to do...
|
// what to do, what to do...
|
||||||
|
return voidSubIntr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void queueUp()
|
void queueUp()
|
||||||
|
@ -197,6 +198,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<int, SubIntrHandler> subIntrHandlers;
|
std::map<int, SubIntrHandler> subIntrHandlers;
|
||||||
|
// Only useful to handle when the subIntr doesn't exist
|
||||||
|
SubIntrHandler voidSubIntr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -261,7 +264,7 @@ bool __RunOnePendingInterrupt()
|
||||||
void __TriggerInterrupt(PSPInterrupt intno)
|
void __TriggerInterrupt(PSPInterrupt intno)
|
||||||
{
|
{
|
||||||
intrHandlers[intno].queueUp();
|
intrHandlers[intno].queueUp();
|
||||||
DEBUG_LOG(HLE, "Triggering subinterrupts for interrupt %i (%i in queue)", intno, pendingInterrupts.size());
|
DEBUG_LOG(HLE, "Triggering subinterrupts for interrupt %i (%li in queue)", intno, pendingInterrupts.size());
|
||||||
if (!inInterrupt)
|
if (!inInterrupt)
|
||||||
__RunOnePendingInterrupt();
|
__RunOnePendingInterrupt();
|
||||||
}
|
}
|
||||||
|
@ -382,12 +385,12 @@ void sceKernelMemset()
|
||||||
|
|
||||||
const HLEFunction Kernel_Library[] =
|
const HLEFunction Kernel_Library[] =
|
||||||
{
|
{
|
||||||
{0x092968F4,sceKernelCpuSuspendIntr,"sceKernelCpuSuspendIntr"},
|
{0x092968F4,&Wrap<sceKernelCpuSuspendIntr>,"sceKernelCpuSuspendIntr"},
|
||||||
{0x5F10D406,WrapV_U<sceKernelCpuResumeIntr>, "sceKernelCpuResumeIntr"}, //int oldstat
|
{0x5F10D406,&Wrap<sceKernelCpuResumeIntr>, "sceKernelCpuResumeIntr"}, //int oldstat
|
||||||
{0x3b84732d,WrapV_U<sceKernelCpuResumeIntrWithSync>, "sceKernelCpuResumeIntrWithSync"},
|
{0x3b84732d,&Wrap<sceKernelCpuResumeIntrWithSync>, "sceKernelCpuResumeIntrWithSync"},
|
||||||
{0x47a0b729,sceKernelIsCpuIntrSuspended, "sceKernelIsCpuIntrSuspended"}, //flags
|
{0x47a0b729,&Wrap<sceKernelIsCpuIntrSuspended>, "sceKernelIsCpuIntrSuspended"}, //flags
|
||||||
{0xb55249d2,sceKernelIsCpuIntrEnable, "sceKernelIsCpuIntrEnable"},
|
{0xb55249d2,&Wrap<sceKernelIsCpuIntrEnable>, "sceKernelIsCpuIntrEnable"},
|
||||||
{0xa089eca4,sceKernelMemset, "sceKernelMemset"},
|
{0xa089eca4,&Wrap<sceKernelMemset>, "sceKernelMemset"},
|
||||||
{0xbea46419,0, "sceKernelLockLwMutex"},
|
{0xbea46419,0, "sceKernelLockLwMutex"},
|
||||||
{0x15b6446b,0, "sceKernelUnlockLwMutex"},
|
{0x15b6446b,0, "sceKernelUnlockLwMutex"},
|
||||||
{0x293b45b8,0, "sceKernelGetThreadId"},
|
{0x293b45b8,0, "sceKernelGetThreadId"},
|
||||||
|
@ -403,10 +406,10 @@ void Register_Kernel_Library()
|
||||||
|
|
||||||
const HLEFunction InterruptManager[] =
|
const HLEFunction InterruptManager[] =
|
||||||
{
|
{
|
||||||
{0xCA04A2B9, WrapU_UUUU<sceKernelRegisterSubIntrHandler>, "sceKernelRegisterSubIntrHandler"},
|
{0xCA04A2B9, &Wrap<sceKernelRegisterSubIntrHandler>, "sceKernelRegisterSubIntrHandler"},
|
||||||
{0xD61E6961, WrapU_UU<sceKernelReleaseSubIntrHandler>, "sceKernelReleaseSubIntrHandler"},
|
{0xD61E6961, &Wrap<sceKernelReleaseSubIntrHandler>, "sceKernelReleaseSubIntrHandler"},
|
||||||
{0xFB8E22EC, WrapU_UU<sceKernelEnableSubIntr>, "sceKernelEnableSubIntr"},
|
{0xFB8E22EC, &Wrap<sceKernelEnableSubIntr>, "sceKernelEnableSubIntr"},
|
||||||
{0x8A389411, WrapU_UU<sceKernelDisableSubIntr>, "sceKernelDisableSubIntr"},
|
{0x8A389411, &Wrap<sceKernelDisableSubIntr>, "sceKernelDisableSubIntr"},
|
||||||
{0x5CB5A78B, 0, "sceKernelSuspendSubIntr"},
|
{0x5CB5A78B, 0, "sceKernelSuspendSubIntr"},
|
||||||
{0x7860E0DC, 0, "sceKernelResumeSubIntr"},
|
{0x7860E0DC, 0, "sceKernelResumeSubIntr"},
|
||||||
{0xFC4374B8, 0, "sceKernelIsSubInterruptOccurred"},
|
{0xFC4374B8, 0, "sceKernelIsSubInterruptOccurred"},
|
||||||
|
|
|
@ -113,7 +113,7 @@ static SceUID mainModuleID; // hack
|
||||||
Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, SceUID &id, std::string *error_string)
|
Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, SceUID &id, std::string *error_string)
|
||||||
{
|
{
|
||||||
Module *m = new Module;
|
Module *m = new Module;
|
||||||
SceUID uid = kernelObjects.Create(m);
|
kernelObjects.Create(m);
|
||||||
|
|
||||||
u32 magic = *((u32*)ptr);
|
u32 magic = *((u32*)ptr);
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, SceUID &id, std::
|
||||||
|
|
||||||
if (entSection != -1)
|
if (entSection != -1)
|
||||||
{
|
{
|
||||||
libent *lib = (libent *)(Memory::GetPointer(reader.GetSectionAddr(entSection)));
|
//libent *lib = (libent *)(Memory::GetPointer(reader.GetSectionAddr(entSection)));
|
||||||
//what's this for?
|
//what's this for?
|
||||||
//lib->l1+=0;
|
//lib->l1+=0;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, SceUID &id, std::
|
||||||
|
|
||||||
DEBUG_LOG(LOADER,"Resident data addr: %08x", sceResidentAddr);
|
DEBUG_LOG(LOADER,"Resident data addr: %08x", sceResidentAddr);
|
||||||
|
|
||||||
PspResidentData *resdata = (PspResidentData *)Memory::GetPointer(sceResidentAddr);
|
//PspResidentData *resdata = (PspResidentData *)Memory::GetPointer(sceResidentAddr);
|
||||||
|
|
||||||
struct PspModuleInfo
|
struct PspModuleInfo
|
||||||
{
|
{
|
||||||
|
@ -267,7 +267,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, SceUID &id, std::
|
||||||
{
|
{
|
||||||
const char *modulename = (const char*)Memory::GetPointer(entry[m].moduleNameSymbol);
|
const char *modulename = (const char*)Memory::GetPointer(entry[m].moduleNameSymbol);
|
||||||
u32 *nidDataPtr = (u32*)Memory::GetPointer(entry[m].nidData);
|
u32 *nidDataPtr = (u32*)Memory::GetPointer(entry[m].nidData);
|
||||||
u32 *stubs = (u32*)Memory::GetPointer(entry[m].firstSymAddr);
|
//u32 *stubs = (u32*)Memory::GetPointer(entry[m].firstSymAddr);
|
||||||
|
|
||||||
DEBUG_LOG(LOADER,"Importing Module %s, stubs at %08x",modulename,entry[m].firstSymAddr);
|
DEBUG_LOG(LOADER,"Importing Module %s, stubs at %08x",modulename,entry[m].firstSymAddr);
|
||||||
|
|
||||||
|
@ -295,11 +295,11 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, SceUID &id, std::
|
||||||
|
|
||||||
bool __KernelLoadPBP(const char *filename, std::string *error_string)
|
bool __KernelLoadPBP(const char *filename, std::string *error_string)
|
||||||
{
|
{
|
||||||
static const char *FileNames[] =
|
//static const char *FileNames[] =
|
||||||
{
|
//{
|
||||||
"PARAM.SFO", "ICON0.PNG", "ICON1.PMF", "UNKNOWN.PNG",
|
// "PARAM.SFO", "ICON0.PNG", "ICON1.PMF", "UNKNOWN.PNG",
|
||||||
"PIC1.PNG", "SND0.AT3", "UNKNOWN.PSP", "UNKNOWN.PSAR"
|
// "PIC1.PNG", "SND0.AT3", "UNKNOWN.PSP", "UNKNOWN.PSAR"
|
||||||
};
|
//};
|
||||||
|
|
||||||
std::ifstream in(filename, std::ios::binary);
|
std::ifstream in(filename, std::ios::binary);
|
||||||
|
|
||||||
|
@ -485,9 +485,9 @@ void sceKernelStartModule()
|
||||||
int argsize = PARAM(1);
|
int argsize = PARAM(1);
|
||||||
u32 argptr = PARAM(2);
|
u32 argptr = PARAM(2);
|
||||||
u32 ptrReturn = PARAM(3);
|
u32 ptrReturn = PARAM(3);
|
||||||
if (PARAM(4)) {
|
//if (PARAM(4)) {
|
||||||
SceKernelSMOption *smoption = (SceKernelSMOption*)Memory::GetPointer(PARAM(4));
|
//SceKernelSMOption *smoption = (SceKernelSMOption*)Memory::GetPointer(PARAM(4));
|
||||||
}
|
//}
|
||||||
ERROR_LOG(HLE,"UNIMPL sceKernelStartModule(%d,asize=%08x,aptr=%08x,retptr=%08x,...)",
|
ERROR_LOG(HLE,"UNIMPL sceKernelStartModule(%d,asize=%08x,aptr=%08x,retptr=%08x,...)",
|
||||||
id,argsize,argptr,ptrReturn);
|
id,argsize,argptr,ptrReturn);
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
|
@ -522,14 +522,12 @@ void sceKernelGetModuleId()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelFindModuleByName()
|
u32 sceKernelFindModuleByName(u32)
|
||||||
{
|
{
|
||||||
ERROR_LOG(HLE,"UNIMPL sceKernelFindModuleByName()");
|
ERROR_LOG(HLE,"UNIMPL sceKernelFindModuleByName()");
|
||||||
RETURN(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const HLEFunction ModuleMgrForUser[] =
|
const HLEFunction ModuleMgrForUser[] =
|
||||||
{
|
{
|
||||||
{0x977DE386,sceKernelLoadModule,"sceKernelLoadModule"},
|
{0x977DE386,sceKernelLoadModule,"sceKernelLoadModule"},
|
||||||
|
|
|
@ -49,10 +49,10 @@ struct MsgPipe : public KernelObject
|
||||||
void sceKernelCreateMsgPipe()
|
void sceKernelCreateMsgPipe()
|
||||||
{
|
{
|
||||||
const char *name = Memory::GetCharPointer(PARAM(0));
|
const char *name = Memory::GetCharPointer(PARAM(0));
|
||||||
int memoryPartition = PARAM(1);
|
//int memoryPartition = PARAM(1);
|
||||||
SceUInt attr = PARAM(2);
|
SceUInt attr = PARAM(2);
|
||||||
int size = PARAM(3);
|
int size = PARAM(3);
|
||||||
int opt = PARAM(4);
|
//int opt = PARAM(4);
|
||||||
|
|
||||||
MsgPipe *m = new MsgPipe();
|
MsgPipe *m = new MsgPipe();
|
||||||
SceUID id = kernelObjects.Create(m);
|
SceUID id = kernelObjects.Create(m);
|
||||||
|
@ -188,3 +188,4 @@ void sceKernelReferMsgPipeStatus()
|
||||||
RETURN(error);
|
RETURN(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ void sceKernelSignalSema()
|
||||||
s->ns.currentCount += signal;
|
s->ns.currentCount += signal;
|
||||||
DEBUG_LOG(HLE,"sceKernelSignalSema(%i, %i) (old: %i, new: %i)", id, signal, oldval, s->ns.currentCount);
|
DEBUG_LOG(HLE,"sceKernelSignalSema(%i, %i) (old: %i, new: %i)", id, signal, oldval, s->ns.currentCount);
|
||||||
|
|
||||||
bool wokeThreads = false;
|
//bool wokeThreads = false;
|
||||||
retry:
|
retry:
|
||||||
//TODO: check for threads to wake up - wake them
|
//TODO: check for threads to wake up - wake them
|
||||||
std::vector<SceUID>::iterator iter;
|
std::vector<SceUID>::iterator iter;
|
||||||
|
@ -139,7 +139,7 @@ retry:
|
||||||
{
|
{
|
||||||
__KernelResumeThread(id);
|
__KernelResumeThread(id);
|
||||||
s->ns.currentCount -= wVal;
|
s->ns.currentCount -= wVal;
|
||||||
wokeThreads = true;
|
//wokeThreads = true;
|
||||||
s->waitingThreads.erase(iter);
|
s->waitingThreads.erase(iter);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,10 +318,10 @@ void __KernelNotifyCallback(SceUID threadID, SceUID cbid, u32 notifyArg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CallbackNotification cb;
|
//CallbackNotification cb;
|
||||||
cb.cbid = cbid;
|
//cb.cbid = cbid;
|
||||||
cb.arg = notifyArg;
|
//cb.arg = notifyArg;
|
||||||
cb.count = 1;
|
//cb.count = 1;
|
||||||
}
|
}
|
||||||
// TODO: error checking
|
// TODO: error checking
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ void __KernelLoadContext(ThreadContext *ctx)
|
||||||
// If any changes were made, it will context switch
|
// If any changes were made, it will context switch
|
||||||
bool __KernelTriggerWait(WaitType type, int id, bool dontSwitch)
|
bool __KernelTriggerWait(WaitType type, int id, bool dontSwitch)
|
||||||
{
|
{
|
||||||
bool doneAnything = false;
|
//bool doneAnything = false;
|
||||||
|
|
||||||
for (std::vector<Thread *>::iterator iter = threadqueue.begin(); iter != threadqueue.end(); iter++)
|
for (std::vector<Thread *>::iterator iter = threadqueue.begin(); iter != threadqueue.end(); iter++)
|
||||||
{
|
{
|
||||||
|
@ -464,7 +464,7 @@ bool __KernelTriggerWait(WaitType type, int id, bool dontSwitch)
|
||||||
{
|
{
|
||||||
t->nt.status = THREADSTATUS_READY;
|
t->nt.status = THREADSTATUS_READY;
|
||||||
}
|
}
|
||||||
doneAnything = true;
|
//doneAnything = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -536,7 +536,7 @@ void __KernelScheduleWakeup(SceUID threadID, int usFromNow)
|
||||||
|
|
||||||
void __KernelRemoveFromThreadQueue(Thread *t)
|
void __KernelRemoveFromThreadQueue(Thread *t)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < threadqueue.size(); i++)
|
for (u32 i = 0; i < threadqueue.size(); i++)
|
||||||
{
|
{
|
||||||
if (threadqueue[i] == t)
|
if (threadqueue[i] == t)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,24 +95,21 @@ void sceKernelSysClock2USecWide()
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelLibcClock()
|
u32 sceKernelLibcClock()
|
||||||
{
|
{
|
||||||
u32 retVal = clock()*1000;
|
u32 retVal = clock()*1000;
|
||||||
DEBUG_LOG(HLE,"%i = sceKernelLibcClock",retVal);
|
DEBUG_LOG(HLE,"%i = sceKernelLibcClock",retVal);
|
||||||
RETURN(retVal); // TODO: fix
|
return retVal; // TODO: fix
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelLibcTime()
|
u32 sceKernelLibcTime(time_t *t)
|
||||||
{
|
{
|
||||||
time_t *t = 0;
|
|
||||||
if (PARAM(0))
|
|
||||||
t = (time_t*)Memory::GetPointer(PARAM(0));
|
|
||||||
u32 retVal = (u32)time(t);
|
u32 retVal = (u32)time(t);
|
||||||
DEBUG_LOG(HLE,"%i = sceKernelLibcTime()",retVal);
|
DEBUG_LOG(HLE,"%i = sceKernelLibcTime()",retVal);
|
||||||
RETURN(retVal);
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceKernelLibcGettimeofday()
|
u32 sceKernelLibcGettimeofday(timeval *tv, u32)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
union {
|
union {
|
||||||
|
@ -126,28 +123,30 @@ void sceKernelLibcGettimeofday()
|
||||||
u32 tv_usec;
|
u32 tv_usec;
|
||||||
};
|
};
|
||||||
|
|
||||||
timeval *tv = (timeval*)Memory::GetPointer(PARAM(0));
|
|
||||||
DEBUG_LOG(HLE,"sceKernelLibcGettimeofday()");
|
DEBUG_LOG(HLE,"sceKernelLibcGettimeofday()");
|
||||||
|
|
||||||
GetSystemTimeAsFileTime (&now.ft);
|
GetSystemTimeAsFileTime (&now.ft);
|
||||||
tv->tv_usec = (long) ((now.ns100 / 10LL) % 1000000LL);
|
tv->tv_usec = (long) ((now.ns100 / 10LL) % 1000000LL);
|
||||||
tv->tv_sec = (long) ((now.ns100 - 116444736000000000LL) / 10000000LL);
|
tv->tv_sec = (long) ((now.ns100 - 116444736000000000LL) / 10000000LL);
|
||||||
#endif
|
#endif
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
|
||||||
void sceRtcGetCurrentClockLocalTime()
|
|
||||||
{
|
|
||||||
DEBUG_LOG(HLE,"0=sceRtcGetCurrentClockLocalTime()");
|
|
||||||
RETURN(0);
|
|
||||||
}
|
|
||||||
void sceRtcGetTick()
|
|
||||||
{
|
|
||||||
DEBUG_LOG(HLE,"0=sceRtcGetTick()");
|
|
||||||
RETURN(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sceRtcGetTickResolution()
|
u32 sceRtcGetCurrentClockLocalTime(u32)
|
||||||
|
{
|
||||||
|
DEBUG_LOG(HLE,"0=sceRtcGetCurrentClockLocalTime()");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sceRtcGetTick(u32, u32)
|
||||||
|
{
|
||||||
|
DEBUG_LOG(HLE,"0=sceRtcGetTick()");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sceRtcGetTickResolution()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE,"100=sceRtcGetTickResolution()");
|
DEBUG_LOG(HLE,"100=sceRtcGetTickResolution()");
|
||||||
RETURN(100);
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,15 +17,15 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void sceKernelLibcGettimeofday();
|
u32 sceKernelLibcGettimeofday(timeval *tv, u32);
|
||||||
void sceKernelLibcClock();
|
u32 sceKernelLibcClock();
|
||||||
void sceKernelLibcTime();
|
u32 sceKernelLibcTime(time_t*);
|
||||||
void sceKernelUSec2SysClock();
|
void sceKernelUSec2SysClock();
|
||||||
void sceKernelGetSystemTime();
|
void sceKernelGetSystemTime();
|
||||||
void sceKernelGetSystemTimeLow();
|
void sceKernelGetSystemTimeLow();
|
||||||
void sceKernelGetSystemTimeWide();
|
void sceKernelGetSystemTimeWide();
|
||||||
void sceKernelSysClock2USec();
|
void sceKernelSysClock2USec();
|
||||||
void sceKernelSysClock2USecWide();
|
void sceKernelSysClock2USecWide();
|
||||||
void sceRtcGetCurrentClockLocalTime();
|
u32 sceRtcGetCurrentClockLocalTime(u32);
|
||||||
void sceRtcGetTickResolution();
|
u32 sceRtcGetTickResolution();
|
||||||
void sceRtcGetTick();
|
u32 sceRtcGetTick(u32, u32);
|
||||||
|
|
|
@ -175,8 +175,8 @@ const HLEFunction sceNetApctl[] =
|
||||||
const HLEFunction sceWlanDrv[] =
|
const HLEFunction sceWlanDrv[] =
|
||||||
{
|
{
|
||||||
{0xd7763699, 0, "sceWlanGetSwitchState"},
|
{0xd7763699, 0, "sceWlanGetSwitchState"},
|
||||||
{0x0c622081, WrapU_U<sceWlanGetEtherAddr>, "sceWlanGetEtherAddr"},
|
{0x0c622081, Wrap<sceWlanGetEtherAddr>, "sceWlanGetEtherAddr"},
|
||||||
{0x93440B11, WrapU_V<sceWlanDevIsPowerOn>, "sceWlanDevIsPowerOn"},
|
{0x93440B11, Wrap<sceWlanDevIsPowerOn>, "sceWlanDevIsPowerOn"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void Register_sceNet()
|
void Register_sceNet()
|
||||||
|
|
|
@ -175,7 +175,7 @@ static const HLEFunction scePower[] =
|
||||||
{0xBD681969,0,"scePowerGetBusClockFrequencyInt"},
|
{0xBD681969,0,"scePowerGetBusClockFrequencyInt"},
|
||||||
{0xB1A52C83,0,"scePowerGetCpuClockFrequencyFloat"},
|
{0xB1A52C83,0,"scePowerGetCpuClockFrequencyFloat"},
|
||||||
{0x9BADB3EB,0,"scePowerGetBusClockFrequencyFloat"},
|
{0x9BADB3EB,0,"scePowerGetBusClockFrequencyFloat"},
|
||||||
{0x737486F2,&WrapV_UUU<scePowerSetClockFrequency>,"scePowerSetClockFrequency"},
|
{0x737486F2,&Wrap<scePowerSetClockFrequency>,"scePowerSetClockFrequency"},
|
||||||
{0x34f9c463,0,"scePowerGetPllClockFrequencyInt"},
|
{0x34f9c463,0,"scePowerGetPllClockFrequencyInt"},
|
||||||
{0xea382a27,0,"scePowerGetPllClockFrequencyFloat"},
|
{0xea382a27,0,"scePowerGetPllClockFrequencyFloat"},
|
||||||
{0xebd177d6,0,"scePower_driver_EBD177D6"},
|
{0xebd177d6,0,"scePower_driver_EBD177D6"},
|
||||||
|
|
|
@ -60,19 +60,19 @@ u32 scePsmfSpecifyStreamWithStreamType(u32 psmfStruct, u32 streamType) // possib
|
||||||
|
|
||||||
const HLEFunction scePsmf[] =
|
const HLEFunction scePsmf[] =
|
||||||
{
|
{
|
||||||
{0xc22c8327,&WrapU_UU<scePsmfSetPsmf>,"scePsmfSetPsmfFunction"},
|
{0xc22c8327,&Wrap<scePsmfSetPsmf>,"scePsmfSetPsmfFunction"},
|
||||||
{0xC7DB3A5B,0,"scePsmfGetCurrentStreamTypeFunction"},
|
{0xC7DB3A5B,0,"scePsmfGetCurrentStreamTypeFunction"},
|
||||||
{0x28240568,0,"scePsmfGetCurrentStreamNumberFunction"},
|
{0x28240568,0,"scePsmfGetCurrentStreamNumberFunction"},
|
||||||
{0x1E6D9013,&WrapU_UU<scePsmfSpecifyStreamWithStreamType>,"scePsmfSpecifyStreamWithStreamTypeFunction"},
|
{0x1E6D9013,&Wrap<scePsmfSpecifyStreamWithStreamType>,"scePsmfSpecifyStreamWithStreamTypeFunction"},
|
||||||
{0x4BC9BDE0,0,"scePsmfSpecifyStreamFunction"},
|
{0x4BC9BDE0,0,"scePsmfSpecifyStreamFunction"},
|
||||||
{0x76D3AEBA,0,"scePsmfGetPresentationStartTimeFunction"},
|
{0x76D3AEBA,0,"scePsmfGetPresentationStartTimeFunction"},
|
||||||
{0xBD8AE0D8,0,"scePsmfGetPresentationEndTimeFunction"},
|
{0xBD8AE0D8,0,"scePsmfGetPresentationEndTimeFunction"},
|
||||||
{0xEAED89CD,&WrapU_U<scePsmfGetNumberOfStreams>,"scePsmfGetNumberOfStreamsFunction"},
|
{0xEAED89CD,&Wrap<scePsmfGetNumberOfStreams>,"scePsmfGetNumberOfStreamsFunction"},
|
||||||
{0x7491C438,0,"scePsmfGetNumberOfEPentriesFunction"},
|
{0x7491C438,0,"scePsmfGetNumberOfEPentriesFunction"},
|
||||||
{0x0BA514E5,0,"scePsmfGetVideoInfoFunction"},
|
{0x0BA514E5,0,"scePsmfGetVideoInfoFunction"},
|
||||||
{0xA83F7113,0,"scePsmfGetAudioInfoFunction"},
|
{0xA83F7113,0,"scePsmfGetAudioInfoFunction"},
|
||||||
{0x971A3A90,0,"scePsmfCheckEPmapFunction"},
|
{0x971A3A90,0,"scePsmfCheckEPmapFunction"},
|
||||||
{0x68d42328,&WrapU_UU<scePsmfGetNumberOfSpecificStreams>,"scePsmfGetNumberOfSpecificStreamsFunction"},
|
{0x68d42328,&Wrap<scePsmfGetNumberOfSpecificStreams>,"scePsmfGetNumberOfSpecificStreamsFunction"},
|
||||||
{0x5b70fcc1,0,"scePsmfQueryStreamOffsetFunction"},
|
{0x5b70fcc1,0,"scePsmfQueryStreamOffsetFunction"},
|
||||||
{0x9553cc91,0,"scePsmfQueryStreamSizeFunction"},
|
{0x9553cc91,0,"scePsmfQueryStreamSizeFunction"},
|
||||||
{0x0C120E1D,0,"scePsmfSpecifyStreamWithStreamTypeNumberFunction"},
|
{0x0C120E1D,0,"scePsmfSpecifyStreamWithStreamTypeNumberFunction"},
|
||||||
|
|
|
@ -26,12 +26,12 @@
|
||||||
|
|
||||||
#include "sceRtc.h"
|
#include "sceRtc.h"
|
||||||
|
|
||||||
void sceRtcGetCurrentTick()
|
u32 sceRtcGetCurrentTick(u64)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
RETURN(GetTickCount());
|
return GetTickCount();
|
||||||
#else
|
#else
|
||||||
time_update();
|
time_update();
|
||||||
RETURN(time_now_d());
|
return time_now_d();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,4 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void sceRtcGetCurrentTick();
|
u32 sceRtcGetCurrentTick(u64);
|
||||||
|
|
|
@ -391,10 +391,10 @@ void sceSasGetOutputMode()
|
||||||
|
|
||||||
const HLEFunction sceSasCore[] =
|
const HLEFunction sceSasCore[] =
|
||||||
{
|
{
|
||||||
{0x42778a9f, WrapU_UUUUU<sceSasInit>, "__sceSasInit"}, // (SceUID * sasCore, int grain, int maxVoices, int outputMode, int sampleRate)
|
{0x42778a9f, Wrap<sceSasInit>, "__sceSasInit"}, // (SceUID * sasCore, int grain, int maxVoices, int outputMode, int sampleRate)
|
||||||
{0xa3589d81, _sceSasCore, "__sceSasCore"},
|
{0xa3589d81, _sceSasCore, "__sceSasCore"},
|
||||||
{0x50a14dfc, _sceSasCoreWithMix, "__sceSasCoreWithMix"}, // Process and mix into buffer (int sasCore, int sasInOut, int leftVolume, int rightVolume)
|
{0x50a14dfc, _sceSasCoreWithMix, "__sceSasCoreWithMix"}, // Process and mix into buffer (int sasCore, int sasInOut, int leftVolume, int rightVolume)
|
||||||
{0x68a46b95, WrapU_V<sceSasGetEndFlag>, "__sceSasGetEndFlag"}, // int sasCore
|
{0x68a46b95, Wrap<sceSasGetEndFlag>, "__sceSasGetEndFlag"}, // int sasCore
|
||||||
{0x440ca7d8, sceSasSetVolume, "__sceSasSetVolume"},
|
{0x440ca7d8, sceSasSetVolume, "__sceSasSetVolume"},
|
||||||
{0xad84d37f, sceSasSetPitch, "__sceSasSetPitch"},
|
{0xad84d37f, sceSasSetPitch, "__sceSasSetPitch"},
|
||||||
{0x99944089, sceSasSetVoice, "__sceSasSetVoice"}, // (int sasCore, int voice, int vagAddr, int size, int loopmode)
|
{0x99944089, sceSasSetVoice, "__sceSasSetVoice"}, // (int sasCore, int voice, int vagAddr, int size, int loopmode)
|
||||||
|
@ -402,8 +402,8 @@ const HLEFunction sceSasCore[] =
|
||||||
{0x019b25eb, sceSasSetADSR, "__sceSasSetADSR"},
|
{0x019b25eb, sceSasSetADSR, "__sceSasSetADSR"},
|
||||||
{0x9ec3676a, sceSasSetADSRMode, "__sceSasSetADSRmode"},
|
{0x9ec3676a, sceSasSetADSRMode, "__sceSasSetADSRmode"},
|
||||||
{0x5f9529f6, 0, "__sceSasSetSL"},
|
{0x5f9529f6, 0, "__sceSasSetSL"},
|
||||||
{0x74ae582a, WrapU_UU<sceSasGetEnvelopeHeight>, "__sceSasGetEnvelopeHeight"},
|
{0x74ae582a, Wrap<sceSasGetEnvelopeHeight>, "__sceSasGetEnvelopeHeight"},
|
||||||
{0xcbcd4f79, WrapU_UUUU<sceSasSetSimpleADSR>, "__sceSasSetSimpleADSR"},
|
{0xcbcd4f79, Wrap<sceSasSetSimpleADSR>, "__sceSasSetSimpleADSR"},
|
||||||
{0xa0cf2fa4, sceSasSetKeyOff, "__sceSasSetKeyOff"},
|
{0xa0cf2fa4, sceSasSetKeyOff, "__sceSasSetKeyOff"},
|
||||||
{0x76f01aca, sceSasSetKeyOn, "__sceSasSetKeyOn"}, // (int sasCore, int voice)
|
{0x76f01aca, sceSasSetKeyOn, "__sceSasSetKeyOn"}, // (int sasCore, int voice)
|
||||||
{0xf983b186, sceSasRevVON, "__sceSasRevVON"}, // int sasCore, int dry, int wet
|
{0xf983b186, sceSasRevVON, "__sceSasRevVON"}, // int sasCore, int dry, int wet
|
||||||
|
|
|
@ -877,11 +877,11 @@ void GPU::ExecuteOp(u32 op, u32 diff)
|
||||||
|
|
||||||
case GE_CMD_ZTEST:
|
case GE_CMD_ZTEST:
|
||||||
{
|
{
|
||||||
static const GLuint ztests[8] =
|
//static const GLuint ztests[8] =
|
||||||
{
|
//{
|
||||||
GL_NEVER, GL_ALWAYS, GL_EQUAL, GL_NOTEQUAL,
|
// GL_NEVER, GL_ALWAYS, GL_EQUAL, GL_NOTEQUAL,
|
||||||
GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL
|
// GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL
|
||||||
};
|
//};
|
||||||
//glDepthFunc(ztests[data&7]);
|
//glDepthFunc(ztests[data&7]);
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
DEBUG_LOG(G3D,"DL Z test mode: %i", data);
|
DEBUG_LOG(G3D,"DL Z test mode: %i", data);
|
||||||
|
|
|
@ -134,7 +134,7 @@ void Light(float colorOut[4], const float colorIn[4], Vec3 pos, Vec3 normal, flo
|
||||||
else
|
else
|
||||||
toLight = Vec3(gstate.lightpos[l]) - pos;
|
toLight = Vec3(gstate.lightpos[l]) - pos;
|
||||||
|
|
||||||
Vec3 dir = Vec3(gstate.lightdir[l]);
|
//Vec3 dir = Vec3(gstate.lightdir[l]);
|
||||||
|
|
||||||
bool doSpecular = (comp != GE_LIGHTCOMP_ONLYDIFFUSE);
|
bool doSpecular = (comp != GE_LIGHTCOMP_ONLYDIFFUSE);
|
||||||
bool poweredDiffuse = comp == GE_LIGHTCOMP_BOTHWITHPOWDIFFUSE;
|
bool poweredDiffuse = comp == GE_LIGHTCOMP_BOTHWITHPOWDIFFUSE;
|
||||||
|
@ -225,7 +225,6 @@ void TransformAndDrawPrim(void *verts, void *inds, int prim, int vertexCount, Li
|
||||||
|
|
||||||
|
|
||||||
// TODO: Split up into multiple draw calls for Android where you can't guarantee support for more than 0x10000 verts.
|
// TODO: Split up into multiple draw calls for Android where you can't guarantee support for more than 0x10000 verts.
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
if (vertexCount > 0x10000/3)
|
if (vertexCount > 0x10000/3)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue