mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-19 01:10:39 +02:00
Wrap some of the sceUmd* HLE functions.
Intentionally skipped unimpl funcs. Also skipped sceUmdCheckMedium because docs online said it takes no param, but code says it does.
This commit is contained in:
1 parent
ce5afbc166
commit
cc58a9bd35
2 files changed
+19
-16
No files matched your search
@@ -104,6 +104,11 @@ template<u32 func(const char *, u32)> void WrapU_CU() {
|
||||
RETURN((u32)retval);
|
||||
}
|
||||
|
||||
template<u32 func(u32, const char *)> void WrapU_UC() {
|
||||
int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
|
||||
RETURN(retval);
|
||||
}
|
||||
|
||||
template<u32 func(const char *, u32, u32)> void WrapU_CUU() {
|
||||
int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
|
||||
RETURN((u32)retval);
|
||||
|
||||
+14
-16
@@ -94,29 +94,27 @@ void sceUmdGetDiscInfo()
|
||||
RETURN(0);
|
||||
}
|
||||
|
||||
void sceUmdActivate()
|
||||
u32 sceUmdActivate(u32 unknown, const char *name)
|
||||
{
|
||||
u32 unknown = PARAM(0);
|
||||
const char *name = Memory::GetCharPointer(PARAM(1));
|
||||
u32 retVal = 0;
|
||||
__KernelUmdActivate();
|
||||
DEBUG_LOG(HLE,"%i=sceUmdActivate(%08x, %s)", retVal, unknown, name);
|
||||
u32 notifyArg = UMD_PRESENT | UMD_READABLE;
|
||||
__KernelNotifyCallbackType(THREAD_CALLBACK_UMD, -1, notifyArg);
|
||||
RETURN(retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void sceUmdDeactivate()
|
||||
u32 sceUmdDeactivate(u32 unknown, const char *name)
|
||||
{
|
||||
DEBUG_LOG(HLE,"sceUmdDeactivate()");
|
||||
bool triggerCallback = umdActivated;
|
||||
u8 triggerCallback = umdActivated;
|
||||
__KernelUmdDeactivate();
|
||||
|
||||
if (triggerCallback) {
|
||||
u32 notifyArg = UMD_PRESENT | UMD_READY;
|
||||
__KernelNotifyCallbackType(THREAD_CALLBACK_UMD, -1, notifyArg);
|
||||
}
|
||||
RETURN(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sceUmdRegisterUMDCallBack(u32 cbId)
|
||||
@@ -131,12 +129,12 @@ u32 sceUmdUnRegisterUMDCallBack(u32 cbId)
|
||||
return __KernelUnregisterCallback(THREAD_CALLBACK_UMD, cbId);
|
||||
}
|
||||
|
||||
void sceUmdGetDriveStat()
|
||||
u32 sceUmdGetDriveStat()
|
||||
{
|
||||
//u32 retVal = PSP_UMD_INITED | PSP_UMD_READY | PSP_UMD_PRESENT;
|
||||
u32 retVal = __KernelUmdGetState();
|
||||
DEBUG_LOG(HLE,"0x%02x=sceUmdGetDriveStat()",retVal);
|
||||
RETURN(retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,25 +176,25 @@ void sceUmdCancelWaitDriveStat()
|
||||
RETURN(0);
|
||||
}
|
||||
|
||||
void sceUmdGetErrorStat()
|
||||
u32 sceUmdGetErrorStat()
|
||||
{
|
||||
DEBUG_LOG(HLE,"%i=sceUmdGetErrorStat()", umdErrorStat);
|
||||
RETURN(umdErrorStat);
|
||||
return umdErrorStat;
|
||||
}
|
||||
|
||||
|
||||
const HLEFunction sceUmdUser[] =
|
||||
{
|
||||
{0xC6183D47,sceUmdActivate,"sceUmdActivate"},
|
||||
{0x6B4A146C,sceUmdGetDriveStat,"sceUmdGetDriveStat"},
|
||||
{0xC6183D47,&WrapU_UC<sceUmdActivate>,"sceUmdActivate"},
|
||||
{0x6B4A146C,&WrapU_V<sceUmdGetDriveStat>,"sceUmdGetDriveStat"},
|
||||
{0x46EBB729,sceUmdCheckMedium,"sceUmdCheckMedium"},
|
||||
{0xE83742BA,sceUmdDeactivate,"sceUmdDeactivate"},
|
||||
{0xE83742BA,&WrapU_UC<sceUmdDeactivate>,"sceUmdDeactivate"},
|
||||
{0x8EF08FCE,sceUmdWaitDriveStat,"sceUmdWaitDriveStat"},
|
||||
{0x56202973,sceUmdWaitDriveStatWithTimer,"sceUmdWaitDriveStatWithTimer"},
|
||||
{0x4A9E5E29,sceUmdWaitDriveStatCB,"sceUmdWaitDriveStatCB"},
|
||||
{0x6af9b50a,sceUmdCancelWaitDriveStat,"sceUmdCancelWaitDriveStat"},
|
||||
{0x6B4A146C,sceUmdGetDriveStat,"sceUmdGetDriveStat"},
|
||||
{0x20628E6F,sceUmdGetErrorStat,"sceUmdGetErrorStat"},
|
||||
{0x6B4A146C,&WrapU_V<sceUmdGetDriveStat>,"sceUmdGetDriveStat"},
|
||||
{0x20628E6F,&WrapU_V<sceUmdGetErrorStat>,"sceUmdGetErrorStat"},
|
||||
{0x340B7686,sceUmdGetDiscInfo,"sceUmdGetDiscInfo"},
|
||||
{0xAEE7404D,&WrapU_U<sceUmdRegisterUMDCallBack>,"sceUmdRegisterUMDCallBack"},
|
||||
{0xBD2BDE07,&WrapU_U<sceUmdUnRegisterUMDCallBack>,"sceUmdUnRegisterUMDCallBack"},
|
||||
|
||||
Reference in new issue
Block a user