diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a48b2b886..858bc710c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -721,6 +721,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/scesupPreAcc.h
Core/HLE/sceUmd.cpp
Core/HLE/sceUmd.h
+ Core/HLE/sceUsb.cpp
+ Core/HLE/sceUsb.h
Core/HLE/sceUtility.cpp
Core/HLE/sceUtility.h
Core/HLE/sceVaudio.cpp
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index 4894a26d59..c96cec250a 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -55,6 +55,7 @@ set(SRCS
HLE/sceRtc.cpp
HLE/sceSas.cpp
HLE/sceUmd.cpp
+ HLE/sceUsb.cpp
HLE/sceUtility.cpp
HLE/sceParseUri.cpp
HLE/sceSsl.cpp
diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj
index 7447844c2a..e7c9e19328 100644
--- a/Core/Core.vcxproj
+++ b/Core/Core.vcxproj
@@ -170,6 +170,7 @@
+
@@ -316,6 +317,7 @@
+
diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters
index a3a729f24a..0784ba189c 100644
--- a/Core/Core.vcxproj.filters
+++ b/Core/Core.vcxproj.filters
@@ -345,6 +345,9 @@
HW
+
+ HLE\Libraries
+
@@ -635,6 +638,9 @@
HW
+
+ HLE\Libraries
+
diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp
index 67d1ef8d9e..a2e2f5a634 100644
--- a/Core/HLE/HLETables.cpp
+++ b/Core/HLE/HLETables.cpp
@@ -53,6 +53,7 @@
#include "sceParseHttp.h"
#include "scesupPreAcc.h"
#include "sceVaudio.h"
+#include "sceUsb.h"
#define N(s) s
@@ -185,43 +186,12 @@ const HLEFunction pspeDebug[] =
};
-const HLEFunction sceUsb[] =
-{
- {0xae5de6af, 0, "sceUsbStart"},
- {0xc2464fa0, 0, "sceUsbStop"},
- {0xc21645a4, 0, "sceUsbGetState"},
- {0x4e537366, 0, "sceUsbGetDrvList"},
- {0x112cc951, 0, "sceUsbGetDrvState"},
- {0x586db82c, 0, "sceUsbActivate"},
- {0xc572a9c8, 0, "sceUsbDeactivate"},
- {0x5be0e002, 0, "sceUsbWaitState"},
- {0x1c360735, 0, "sceUsbWaitCancel"},
-};
-
-const HLEFunction sceUsbstor[] =
-{
- {0x60066CFE, 0, "sceUsbstorGetStatus"},
-};
-
-const HLEFunction sceUsbstorBoot[] =
-{
- {0xE58818A8, 0, "sceUsbstorBootSetCapacity"},
- {0x594BBF95, 0, "sceUsbstorBootSetLoadAddr"},
- {0x6D865ECD, 0, "sceUsbstorBootGetDataSize"},
- {0xA1119F0D, 0, "sceUsbstorBootSetStatus"},
- {0x1F080078, 0, "sceUsbstorBootRegisterNotify"},
- {0xA55C9E16, 0, "sceUsbstorBootUnregisterNotify"},
-};
-
const HLEModule moduleList[] =
{
{"FakeSysCalls", SZ(FakeSysCalls), FakeSysCalls},
{"UtilsForUser",SZ(UtilsForUser),UtilsForUser},
{"KDebugForKernel",SZ(KDebugForKernel),KDebugForKernel},
{"sceSAScore"},
- {"sceUsbstor",SZ(sceUsbstor),sceUsbstor},
- {"sceUsbstorBoot",SZ(sceUsbstorBoot),sceUsbstorBoot},
- {"sceUsb", SZ(sceUsb), sceUsb},
{"SceBase64_Library"},
{"sceCert_Loader"},
{"SceFont_Library"},
@@ -275,6 +245,7 @@ void RegisterAllModules() {
Register_sceParseHttp();
Register_scesupPreAcc();
Register_sceVaudio();
+ Register_sceUsb();
for (int i = 0; i < numModules; i++)
{
diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp
index 451e100a42..591c1b382d 100644
--- a/Core/HLE/sceDisplay.cpp
+++ b/Core/HLE/sceDisplay.cpp
@@ -265,7 +265,7 @@ u32 sceDisplaySetMode(u32 unknown, u32 xres, u32 yres)
return 0;
}
-void sceDisplaySetFramebuf()
+u32 sceDisplaySetFramebuf()
{
//host->EndFrame();
u32 topaddr = PARAM(0);
@@ -298,8 +298,7 @@ void sceDisplaySetFramebuf()
latchedFramebuf = fbstate;
framebufIsLatched = true;
}
-
- RETURN(0);
+ return 0;
}
u32 sceDisplayGetFramebuf(u32 topaddrPtr, u32 linesizePtr, u32 pixelFormatPtr, int mode)
@@ -392,16 +391,16 @@ float sceDisplayGetFramePerSec()
const HLEFunction sceDisplay[] =
{
- {0x0E20F177,&WrapU_UUU, "sceDisplaySetMode"},
- {0x289D82FE,sceDisplaySetFramebuf, "sceDisplaySetFramebuf"},
- {0xEEDA2E54,&WrapU_UUUI,"sceDisplayGetFrameBuf"},
+ {0x0E20F177,WrapU_UUU, "sceDisplaySetMode"},
+ {0x289D82FE,WrapU_V, "sceDisplaySetFramebuf"},
+ {0xEEDA2E54,WrapU_UUUI,"sceDisplayGetFrameBuf"},
{0x36CDFADE,sceDisplayWaitVblank, "sceDisplayWaitVblank"},
{0x984C27E7,sceDisplayWaitVblankStart, "sceDisplayWaitVblankStart"},
{0x40f1469c,sceDisplayWaitVblankStartMulti, "sceDisplayWaitVblankStartMulti"},
{0x8EB9EC49,sceDisplayWaitVblankCB, "sceDisplayWaitVblankCB"},
{0x46F186C3,sceDisplayWaitVblankStartCB, "sceDisplayWaitVblankStartCB"},
{0x77ed8b3a,sceDisplayWaitVblankStartMultiCB,"sceDisplayWaitVblankStartMultiCB"},
- {0xdba6c4c4,&WrapF_V,"sceDisplayGetFramePerSec"},
+ {0xdba6c4c4,WrapF_V,"sceDisplayGetFramePerSec"},
{0x773dd3a3,sceDisplayGetCurrentHcount,"sceDisplayGetCurrentHcount"},
{0x210eab3a,sceDisplayGetAccumulatedHcount,"sceDisplayGetAccumulatedHcount"},
{0x9C6EAAD7,sceDisplayGetVcount,"sceDisplayGetVcount"},
diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp
index 662cc30d68..3740e35070 100644
--- a/Core/HLE/sceKernel.cpp
+++ b/Core/HLE/sceKernel.cpp
@@ -50,6 +50,7 @@
#include "sceUtility.h"
#include "sceUmd.h"
#include "sceSsl.h"
+#include "sceSas.h"
#include "../Util/PPGeDraw.h"
@@ -76,6 +77,7 @@ void __KernelInit()
__KernelThreadingInit();
__IoInit();
__AudioInit();
+ __SasInit();
__DisplayInit();
__InterruptsInit();
__GeInit();
@@ -106,6 +108,7 @@ void __KernelShutdown()
__PPGeShutdown();
__GeShutdown();
+ __SasShutdown();
__AudioShutdown();
__IoShutdown();
__InterruptsShutdown();
diff --git a/Core/HLE/sceUsb.cpp b/Core/HLE/sceUsb.cpp
new file mode 100644
index 0000000000..faec5397a9
--- /dev/null
+++ b/Core/HLE/sceUsb.cpp
@@ -0,0 +1,64 @@
+// Copyright (c) 2012- PPSSPP Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0 or later versions.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official git repository and contact information can be found at
+// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
+
+#include "HLE.h"
+#include "../MIPS/MIPS.h"
+#include "../../Core/CoreTiming.h"
+#include "sceUsb.h"
+
+bool usbActivated = false;
+
+u32 sceUsbActivate() {
+ ERROR_LOG(HLE, "UNIMPL sceUsbActivate");
+ usbActivated = true;
+ return 0;
+}
+
+const HLEFunction sceUsb[] =
+{
+ {0xae5de6af, 0, "sceUsbStart"},
+ {0xc2464fa0, 0, "sceUsbStop"},
+ {0xc21645a4, 0, "sceUsbGetState"},
+ {0x4e537366, 0, "sceUsbGetDrvList"},
+ {0x112cc951, 0, "sceUsbGetDrvState"},
+ {0x586db82c, WrapU_V, "sceUsbActivate"},
+ {0xc572a9c8, 0, "sceUsbDeactivate"},
+ {0x5be0e002, 0, "sceUsbWaitState"},
+ {0x1c360735, 0, "sceUsbWaitCancel"},
+};
+
+const HLEFunction sceUsbstor[] =
+{
+ {0x60066CFE, 0, "sceUsbstorGetStatus"},
+};
+
+const HLEFunction sceUsbstorBoot[] =
+{
+ {0xE58818A8, 0, "sceUsbstorBootSetCapacity"},
+ {0x594BBF95, 0, "sceUsbstorBootSetLoadAddr"},
+ {0x6D865ECD, 0, "sceUsbstorBootGetDataSize"},
+ {0xA1119F0D, 0, "sceUsbstorBootSetStatus"},
+ {0x1F080078, 0, "sceUsbstorBootRegisterNotify"},
+ {0xA55C9E16, 0, "sceUsbstorBootUnregisterNotify"},
+};
+
+void Register_sceUsb()
+{
+ RegisterModule("sceUsbstor", ARRAY_SIZE(sceUsbstor), sceUsbstor);
+ RegisterModule("sceUsbstorBoot", ARRAY_SIZE(sceUsbstorBoot), sceUsbstorBoot);
+ RegisterModule("sceUsb", ARRAY_SIZE(sceUsb), sceUsb);
+}
diff --git a/Core/HLE/sceUsb.h b/Core/HLE/sceUsb.h
new file mode 100644
index 0000000000..009f44ec96
--- /dev/null
+++ b/Core/HLE/sceUsb.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2012- PPSSPP Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0 or later versions.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official git repository and contact information can be found at
+// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
+
+#pragma once
+
+void Register_sceUsb();
diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj
index 8016e5e377..4d14a6d2e3 100644
--- a/Windows/PPSSPP.vcxproj
+++ b/Windows/PPSSPP.vcxproj
@@ -323,6 +323,7 @@
+
@@ -360,4 +361,4 @@
-
+
\ No newline at end of file
diff --git a/Windows/PPSSPP.vcxproj.filters b/Windows/PPSSPP.vcxproj.filters
index 5786358b73..c76c21f6ca 100644
--- a/Windows/PPSSPP.vcxproj.filters
+++ b/Windows/PPSSPP.vcxproj.filters
@@ -203,6 +203,7 @@
Android
+
diff --git a/android/jni/Android.mk b/android/jni/Android.mk
index 245346dffe..13a44e02f1 100644
--- a/android/jni/Android.mk
+++ b/android/jni/Android.mk
@@ -141,6 +141,7 @@ LOCAL_SRC_FILES := \
$(SRC)/Core/HLE/sceSas.cpp \
$(SRC)/Core/HLE/sceSsl.cpp \
$(SRC)/Core/HLE/sceUmd.cpp \
+ $(SRC)/Core/HLE/sceUsb.cpp \
$(SRC)/Core/HLE/sceUtility.cpp \
$(SRC)/Core/HLE/sceVaudio.cpp \
$(SRC)/Core/HLE/scesupPreAcc.cpp \