Conflicts:
	Windows/resource.h
This commit is contained in:
Peter Thoman 2013-05-05 01:38:47 +02:00
commit f49cc04c7d
19 changed files with 1041 additions and 438 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "lang"]
path = lang
url = git://github.com/hrydgard/ppsspp-lang.git
[submodule "ffmpeg"]
path = ffmpeg
url = git://github.com/hrydgard/ppsspp-ffmpeg.git

File diff suppressed because it is too large Load Diff

View File

@ -76,6 +76,7 @@
static bool kernelRunning = false;
KernelObjectPool kernelObjects;
KernelStats kernelStats;
u32 registeredExitCbId;
void __KernelInit()
{
@ -236,13 +237,15 @@ void sceKernelExitGameWithStatus()
int LoadExecForUser_362A956B()
{
ERROR_LOG(HLE,"UNIMPL LoadExecForUser_362A956B()");
return 0;
return hleLoadExecForUser_362A956B();
}
u32 sceKernelRegisterExitCallback(u32 cbId)
{
DEBUG_LOG(HLE,"NOP sceKernelRegisterExitCallback(%i)", cbId);
DEBUG_LOG(HLE,"sceKernelRegisterExitCallback(%i)", cbId);
if (__KernelRegisterCallback(THREAD_CALLBACK_EXIT, cbId) == 0) {
registeredExitCbId = cbId;
}
return 0;
}

View File

@ -27,209 +27,285 @@ class PointerWrap;
enum
{
SCE_KERNEL_ERROR_OK = 0,
SCE_KERNEL_ERROR_ALREADY = 0x80000020,
SCE_KERNEL_ERROR_BUSY = 0x80000021,
SCE_KERNEL_ERROR_OUT_OF_MEMORY = 0x80000022,
SCE_KERNEL_ERROR_INVALID_ID = 0x80000100,
SCE_KERNEL_ERROR_INVALID_NAME = 0x80000101,
SCE_KERNEL_ERROR_INVALID_INDEX = 0x80000102,
SCE_KERNEL_ERROR_INVALID_POINTER = 0x80000103,
SCE_KERNEL_ERROR_INVALID_SIZE = 0x80000104,
SCE_KERNEL_ERROR_INVALID_FLAG = 0x80000105,
SCE_KERNEL_ERROR_INVALID_COMMAND = 0x80000106,
SCE_KERNEL_ERROR_INVALID_MODE = 0x80000107,
SCE_KERNEL_ERROR_INVALID_VALUE = 0x800001fe,
SCE_KERNEL_ERROR_INVALID_ARGUMENT = 0x800001ff,
SCE_KERNEL_ERROR_ERROR = 0x80020001,
SCE_KERNEL_ERROR_NOTIMP = 0x80020002,
SCE_KERNEL_ERROR_ILLEGAL_EXPCODE = 0x80020032,
SCE_KERNEL_ERROR_EXPHANDLER_NOUSE = 0x80020033,
SCE_KERNEL_ERROR_EXPHANDLER_USED = 0x80020034,
SCE_KERNEL_ERROR_SYCALLTABLE_NOUSED = 0x80020035,
SCE_KERNEL_ERROR_SYCALLTABLE_USED = 0x80020036,
SCE_KERNEL_ERROR_ILLEGAL_SYSCALLTABLE = 0x80020037,
SCE_KERNEL_ERROR_ILLEGAL_PRIMARY_SYSCALL_NUMBER = 0x80020038,
SCE_KERNEL_ERROR_PRIMARY_SYSCALL_NUMBER_INUSE = 0x80020039,
SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = 0x80020064,
SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = 0x80020065,
SCE_KERNEL_ERROR_CPUDI = 0x80020066,
SCE_KERNEL_ERROR_FOUND_HANDLER = 0x80020067,
SCE_KERNEL_ERROR_NOTFOUND_HANDLER = 0x80020068,
SCE_KERNEL_ERROR_ILLEGAL_INTRLEVEL = 0x80020069,
SCE_KERNEL_ERROR_ILLEGAL_ADDRESS = 0x8002006a,
SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = 0x8002006b,
SCE_KERNEL_ERROR_ILLEGAL_STACK_ADDRESS = 0x8002006c,
SCE_KERNEL_ERROR_ALREADY_STACK_SET = 0x8002006d,
SCE_KERNEL_ERROR_NO_TIMER = 0x80020096,
SCE_KERNEL_ERROR_ILLEGAL_TIMERID = 0x80020097,
SCE_KERNEL_ERROR_ILLEGAL_SOURCE = 0x80020098,
SCE_KERNEL_ERROR_ILLEGAL_PRESCALE = 0x80020099,
SCE_KERNEL_ERROR_TIMER_BUSY = 0x8002009a,
SCE_KERNEL_ERROR_TIMER_NOT_SETUP = 0x8002009b,
SCE_KERNEL_ERROR_TIMER_NOT_INUSE = 0x8002009c,
SCE_KERNEL_ERROR_UNIT_USED = 0x800200a0,
SCE_KERNEL_ERROR_UNIT_NOUSE = 0x800200a1,
SCE_KERNEL_ERROR_NO_ROMDIR = 0x800200a2,
SCE_KERNEL_ERROR_IDTYPE_EXIST = 0x800200c8,
SCE_KERNEL_ERROR_IDTYPE_NOT_EXIST = 0x800200c9,
SCE_KERNEL_ERROR_IDTYPE_NOT_EMPTY = 0x800200ca,
SCE_KERNEL_ERROR_UNKNOWN_UID = 0x800200cb,
SCE_KERNEL_ERROR_UNMATCH_UID_TYPE = 0x800200cc,
SCE_KERNEL_ERROR_ID_NOT_EXIST = 0x800200cd,
SCE_KERNEL_ERROR_NOT_FOUND_UIDFUNC = 0x800200ce,
SCE_KERNEL_ERROR_UID_ALREADY_HOLDER = 0x800200cf,
SCE_KERNEL_ERROR_UID_NOT_HOLDER = 0x800200d0,
SCE_KERNEL_ERROR_ILLEGAL_PERM = 0x800200d1,
SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT = 0x800200d2,
SCE_KERNEL_ERROR_ILLEGAL_ADDR = 0x800200d3,
SCE_KERNEL_ERROR_OUT_OF_RANGE = 0x800200d4,
SCE_KERNEL_ERROR_MEM_RANGE_OVERLAP = 0x800200d5,
SCE_KERNEL_ERROR_ILLEGAL_PARTITION = 0x800200d6,
SCE_KERNEL_ERROR_PARTITION_INUSE = 0x800200d7,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE = 0x800200d8,
SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED = 0x800200d9,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_LOCKED = 0x800200da,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_FAILED = 0x800200db,
SCE_KERNEL_ERROR_HEAPBLOCK_ALLOC_FAILED = 0x800200dc,
SCE_KERNEL_ERROR_HEAP_ALLOC_FAILED = 0x800200dd,
SCE_KERNEL_ERROR_ILLEGAL_CHUNK_ID = 0x800200de,
SCE_KERNEL_ERROR_NOCHUNK = 0x800200df,
SCE_KERNEL_ERROR_NO_FREECHUNK = 0x800200e0,
SCE_ERROR_KERNEL_ILLEGAL_ALIGNMENT_SIZE = 0x800200e4,
SCE_KERNEL_ERROR_LINKERR = 0x8002012c,
SCE_KERNEL_ERROR_ILLEGAL_OBJECT = 0x8002012d,
SCE_KERNEL_ERROR_UNKNOWN_MODULE = 0x8002012e,
SCE_KERNEL_ERROR_NOFILE = 0x8002012f,
SCE_KERNEL_ERROR_FILEERR = 0x80020130,
SCE_KERNEL_ERROR_MEMINUSE = 0x80020131,
SCE_KERNEL_ERROR_PARTITION_MISMATCH = 0x80020132,
SCE_KERNEL_ERROR_ALREADY_STARTED = 0x80020133,
SCE_KERNEL_ERROR_NOT_STARTED = 0x80020134,
SCE_KERNEL_ERROR_ALREADY_STOPPED = 0x80020135,
SCE_KERNEL_ERROR_CAN_NOT_STOP = 0x80020136,
SCE_KERNEL_ERROR_NOT_STOPPED = 0x80020137,
SCE_KERNEL_ERROR_NOT_REMOVABLE = 0x80020138,
SCE_KERNEL_ERROR_EXCLUSIVE_LOAD = 0x80020139,
SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED = 0x8002013a,
SCE_KERNEL_ERROR_LIBRARY_FOUND = 0x8002013b,
SCE_KERNEL_ERROR_LIBRARY_NOTFOUND = 0x8002013c,
SCE_KERNEL_ERROR_ILLEGAL_LIBRARY = 0x8002013d,
SCE_KERNEL_ERROR_LIBRARY_INUSE = 0x8002013e,
SCE_KERNEL_ERROR_ALREADY_STOPPING = 0x8002013f,
SCE_KERNEL_ERROR_ILLEGAL_OFFSET = 0x80020140,
SCE_KERNEL_ERROR_ILLEGAL_POSITION = 0x80020141,
SCE_KERNEL_ERROR_ILLEGAL_ACCESS = 0x80020142,
SCE_KERNEL_ERROR_MODULE_MGR_BUSY = 0x80020143,
SCE_KERNEL_ERROR_ILLEGAL_FLAG = 0x80020144,
SCE_KERNEL_ERROR_CANNOT_GET_MODULELIST = 0x80020145,
SCE_KERNEL_ERROR_PROHIBIT_LOADMODULE_DEVICE = 0x80020146,
SCE_KERNEL_ERROR_PROHIBIT_LOADEXEC_DEVICE = 0x80020147,
SCE_KERNEL_ERROR_UNSUPPORTED_PRX_TYPE = 0x80020148,
SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL = 0x80020149,
SCE_KERNEL_ERROR_CANNOT_GET_MODULE_INFORMATION = 0x8002014a,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_BUFFER = 0x8002014b,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_FILENAME = 0x8002014c,
SCE_KERNEL_ERROR_NO_EXIT_CALLBACK = 0x8002014d,
SCE_KERNEL_ERROR_NO_MEMORY = 0x80020190,
SCE_KERNEL_ERROR_ILLEGAL_ATTR = 0x80020191,
SCE_KERNEL_ERROR_ILLEGAL_ENTRY = 0x80020192,
SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = 0x80020193,
SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = 0x80020194,
SCE_KERNEL_ERROR_ILLEGAL_MODE = 0x80020195,
SCE_KERNEL_ERROR_ILLEGAL_MASK = 0x80020196,
SCE_KERNEL_ERROR_ILLEGAL_THID = 0x80020197,
SCE_KERNEL_ERROR_UNKNOWN_THID = 0x80020198,
SCE_KERNEL_ERROR_UNKNOWN_SEMID = 0x80020199,
SCE_KERNEL_ERROR_UNKNOWN_EVFID = 0x8002019a,
SCE_KERNEL_ERROR_UNKNOWN_MBXID = 0x8002019b,
SCE_KERNEL_ERROR_UNKNOWN_VPLID = 0x8002019c,
SCE_KERNEL_ERROR_UNKNOWN_FPLID = 0x8002019d,
SCE_KERNEL_ERROR_UNKNOWN_MPPID = 0x8002019e,
SCE_KERNEL_ERROR_UNKNOWN_ALMID = 0x8002019f,
SCE_KERNEL_ERROR_UNKNOWN_TEID = 0x800201a0,
SCE_KERNEL_ERROR_UNKNOWN_CBID = 0x800201a1,
SCE_KERNEL_ERROR_DORMANT = 0x800201a2,
SCE_KERNEL_ERROR_SUSPEND = 0x800201a3,
SCE_KERNEL_ERROR_NOT_DORMANT = 0x800201a4,
SCE_KERNEL_ERROR_NOT_SUSPEND = 0x800201a5,
SCE_KERNEL_ERROR_NOT_WAIT = 0x800201a6,
SCE_KERNEL_ERROR_CAN_NOT_WAIT = 0x800201a7,
SCE_KERNEL_ERROR_WAIT_TIMEOUT = 0x800201a8,
SCE_KERNEL_ERROR_WAIT_CANCEL = 0x800201a9,
SCE_KERNEL_ERROR_RELEASE_WAIT = 0x800201aa,
SCE_KERNEL_ERROR_NOTIFY_CALLBACK = 0x800201ab,
SCE_KERNEL_ERROR_THREAD_TERMINATED = 0x800201ac,
SCE_KERNEL_ERROR_SEMA_ZERO = 0x800201ad,
SCE_KERNEL_ERROR_SEMA_OVF = 0x800201ae,
SCE_KERNEL_ERROR_EVF_COND = 0x800201af,
SCE_KERNEL_ERROR_EVF_MULTI = 0x800201b0,
SCE_KERNEL_ERROR_EVF_ILPAT = 0x800201b1,
SCE_KERNEL_ERROR_MBOX_NOMSG = 0x800201b2,
SCE_KERNEL_ERROR_MPP_FULL = 0x800201b3,
SCE_KERNEL_ERROR_MPP_EMPTY = 0x800201b4,
SCE_KERNEL_ERROR_WAIT_DELETE = 0x800201b5,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK = 0x800201b6,
SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE = 0x800201b7,
SCE_KERNEL_ERROR_ILLEGAL_SPADADDR = 0x800201b8,
SCE_KERNEL_ERROR_SPAD_INUSE = 0x800201b9,
SCE_KERNEL_ERROR_SPAD_NOT_INUSE = 0x800201ba,
SCE_KERNEL_ERROR_ILLEGAL_TYPE = 0x800201bb,
SCE_KERNEL_ERROR_ILLEGAL_SIZE = 0x800201bc,
SCE_KERNEL_ERROR_ILLEGAL_COUNT = 0x800201bd,
SCE_KERNEL_ERROR_UNKNOWN_VTID = 0x800201be,
SCE_KERNEL_ERROR_ILLEGAL_VTID = 0x800201bf,
SCE_KERNEL_ERROR_ILLEGAL_KTLSID = 0x800201c0,
SCE_KERNEL_ERROR_KTLS_FULL = 0x800201c1,
SCE_KERNEL_ERROR_KTLS_BUSY = 0x800201c2,
SCE_KERNEL_ERROR_PM_INVALID_PRIORITY = 0x80020258,
SCE_KERNEL_ERROR_PM_INVALID_DEVNAME = 0x80020259,
SCE_KERNEL_ERROR_PM_UNKNOWN_DEVNAME = 0x8002025a,
SCE_KERNEL_ERROR_PM_PMINFO_REGISTERED = 0x8002025b,
SCE_KERNEL_ERROR_PM_PMINFO_UNREGISTERED = 0x8002025c,
SCE_KERNEL_ERROR_PM_INVALID_MAJOR_STATE = 0x8002025d,
SCE_KERNEL_ERROR_PM_INVALID_REQUEST = 0x8002025e,
SCE_KERNEL_ERROR_PM_UNKNOWN_REQUEST = 0x8002025f,
SCE_KERNEL_ERROR_PM_INVALID_UNIT = 0x80020260,
SCE_KERNEL_ERROR_PM_CANNOT_CANCEL = 0x80020261,
SCE_KERNEL_ERROR_PM_INVALID_PMINFO = 0x80020262,
SCE_KERNEL_ERROR_PM_INVALID_ARGUMENT = 0x80020263,
SCE_KERNEL_ERROR_PM_ALREADY_TARGET_PWRSTATE = 0x80020264,
SCE_KERNEL_ERROR_PM_CHANGE_PWRSTATE_FAILED = 0x80020265,
SCE_KERNEL_ERROR_PM_CANNOT_CHANGE_DEVPWR_STATE = 0x80020266,
SCE_KERNEL_ERROR_PM_NO_SUPPORT_DEVPWR_STATE = 0x80020267,
SCE_KERNEL_ERROR_DMAC_REQUEST_FAILED = 0x800202bc,
SCE_KERNEL_ERROR_DMAC_REQUEST_DENIED = 0x800202bd,
SCE_KERNEL_ERROR_DMAC_OP_QUEUED = 0x800202be,
SCE_KERNEL_ERROR_DMAC_OP_NOT_QUEUED = 0x800202bf,
SCE_KERNEL_ERROR_DMAC_OP_RUNNING = 0x800202c0,
SCE_KERNEL_ERROR_DMAC_OP_NOT_ASSIGNED = 0x800202c1,
SCE_KERNEL_ERROR_DMAC_OP_TIMEOUT = 0x800202c2,
SCE_KERNEL_ERROR_DMAC_OP_FREED = 0x800202c3,
SCE_KERNEL_ERROR_DMAC_OP_USED = 0x800202c4,
SCE_KERNEL_ERROR_DMAC_OP_EMPTY = 0x800202c5,
SCE_KERNEL_ERROR_DMAC_OP_ABORTED = 0x800202c6,
SCE_KERNEL_ERROR_DMAC_OP_ERROR = 0x800202c7,
SCE_KERNEL_ERROR_DMAC_CHANNEL_RESERVED = 0x800202c8,
SCE_KERNEL_ERROR_DMAC_CHANNEL_EXCLUDED = 0x800202c9,
SCE_KERNEL_ERROR_DMAC_PRIVILEGE_ADDRESS = 0x800202ca,
SCE_KERNEL_ERROR_DMAC_NO_ENOUGHSPACE = 0x800202cb,
SCE_KERNEL_ERROR_DMAC_CHANNEL_NOT_ASSIGNED = 0x800202cc,
SCE_KERNEL_ERROR_DMAC_CHILD_OPERATION = 0x800202cd,
SCE_KERNEL_ERROR_DMAC_TOO_MUCH_SIZE = 0x800202ce,
SCE_KERNEL_ERROR_DMAC_INVALID_ARGUMENT = 0x800202cf,
SCE_KERNEL_ERROR_MFILE = 0x80020320,
SCE_KERNEL_ERROR_NODEV = 0x80020321,
SCE_KERNEL_ERROR_XDEV = 0x80020322,
SCE_KERNEL_ERROR_BADF = 0x80020323,
SCE_KERNEL_ERROR_INVAL = 0x80020324,
SCE_KERNEL_ERROR_UNSUP = 0x80020325,
SCE_KERNEL_ERROR_ALIAS_USED = 0x80020326,
SCE_KERNEL_ERROR_CANNOT_MOUNT = 0x80020327,
SCE_KERNEL_ERROR_DRIVER_DELETED = 0x80020328,
SCE_KERNEL_ERROR_ASYNC_BUSY = 0x80020329,
SCE_KERNEL_ERROR_NOASYNC = 0x8002032a,
SCE_KERNEL_ERROR_REGDEV = 0x8002032b,
SCE_KERNEL_ERROR_NOCWD = 0x8002032c,
SCE_KERNEL_ERROR_NAMETOOLONG = 0x8002032d,
SCE_KERNEL_ERROR_NXIO = 0x800203e8,
SCE_KERNEL_ERROR_IO = 0x800203e9,
SCE_KERNEL_ERROR_NOMEM = 0x800203ea,
SCE_KERNEL_ERROR_STDIO_NOT_OPENED = 0x800203eb,
SCE_KERNEL_ERROR_CACHE_ALIGNMENT = 0x8002044c,
SCE_KERNEL_ERROR_ERRORMAX = 0x8002044d,
SCE_KERNEL_ERROR_INVALID_FORMAT = 0x80000108,
SCE_KERNEL_ERROR_INVALID_VALUE = 0x800001FE,
SCE_KERNEL_ERROR_INVALID_ARGUMENT = 0x800001FF,
SCE_KERNEL_ERROR_BAD_FILE = 0x80000209,
SCE_KERNEL_ERROR_ACCESS_ERROR = 0x8000020D,
SCE_KERNEL_ERROR_ERRNO_ARG_LIST_TOO_LONG = 0x80010007,
SCE_KERNEL_ERROR_ERRNO_INVALID_FILE_DESCRIPTOR = 0x80010009,
SCE_KERNEL_ERROR_ERRNO_RESOURCE_UNAVAILABLE = 0x8001000B,
SCE_KERNEL_ERROR_ERRNO_NO_MEMORY = 0x8001000C,
SCE_KERNEL_ERROR_ERRNO_NO_PERM = 0x8001000D,
SCE_KERNEL_ERROR_ERRNO_FILE_INVALID_ADDR = 0x8001000E,
SCE_KERNEL_ERROR_ERRNO_DEVICE_BUSY = 0x80010010,
SCE_KERNEL_ERROR_ERRNO_FILE_ALREADY_EXISTS = 0x80010011,
SCE_KERNEL_ERROR_ERRNO_CROSS_DEV_LINK = 0x80010012,
SCE_KERNEL_ERROR_ERRNO_DEVICE_NOT_FOUND = 0x80010013,
SCE_KERNEL_ERROR_ERRNO_NOT_A_DIRECTORY = 0x80010014,
SCE_KERNEL_ERROR_ERRNO_IS_DIRECTORY = 0x80010015,
SCE_KERNEL_ERROR_ERRNO_INVALID_ARGUMENT = 0x80010016,
SCE_KERNEL_ERROR_ERRNO_TOO_MANY_OPEN_SYSTEM_FILES = 0x80010018,
SCE_KERNEL_ERROR_ERRNO_FILE_IS_TOO_BIG = 0x8001001B,
SCE_KERNEL_ERROR_ERRNO_DEVICE_NO_FREE_SPACE = 0x8001001C,
SCE_KERNEL_ERROR_ERRNO_READ_ONLY = 0x8001001E,
SCE_KERNEL_ERROR_ERRNO_CLOSED = 0x80010020,
SCE_KERNEL_ERROR_ERRNO_FILE_PATH_TOO_LONG = 0x80010024,
SCE_KERNEL_ERROR_ERRNO_FILE_PROTOCOL = 0x80010047,
SCE_KERNEL_ERROR_ERRNO_DIRECTORY_IS_NOT_EMPTY = 0x8001005A,
SCE_KERNEL_ERROR_ERRNO_TOO_MANY_SYMBOLIC_LINKS = 0x8001005C,
SCE_KERNEL_ERROR_ERRNO_FILE_ADDR_IN_USE = 0x80010062,
SCE_KERNEL_ERROR_ERRNO_CONNECTION_ABORTED = 0x80010067,
SCE_KERNEL_ERROR_ERRNO_CONNECTION_RESET = 0x80010068,
SCE_KERNEL_ERROR_ERRNO_NO_FREE_BUF_SPACE = 0x80010069,
SCE_KERNEL_ERROR_ERRNO_FILE_TIMEOUT = 0x8001006E,
SCE_KERNEL_ERROR_ERRNO_IN_PROGRESS = 0x80010077,
SCE_KERNEL_ERROR_ERRNO_ALREADY = 0x80010078,
SCE_KERNEL_ERROR_ERRNO_NO_MEDIA = 0x8001007B,
SCE_KERNEL_ERROR_ERRNO_INVALID_MEDIUM = 0x8001007C,
SCE_KERNEL_ERROR_ERRNO_ADDRESS_NOT_AVAILABLE = 0x8001007D,
SCE_KERNEL_ERROR_ERRNO_IS_ALREADY_CONNECTED = 0x8001007F,
SCE_KERNEL_ERROR_ERRNO_NOT_CONNECTED = 0x80010080,
SCE_KERNEL_ERROR_ERRNO_FILE_QUOTA_EXCEEDED = 0x80010084,
SCE_KERNEL_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED = 0x8001B000,
SCE_KERNEL_ERROR_ERRNO_ADDR_OUT_OF_MAIN_MEM = 0x8001B001,
SCE_KERNEL_ERROR_ERRNO_INVALID_UNIT_NUM = 0x8001B002,
SCE_KERNEL_ERROR_ERRNO_INVALID_FILE_SIZE = 0x8001B003,
SCE_KERNEL_ERROR_ERRNO_INVALID_FLAG = 0x8001B004,
SCE_KERNEL_ERROR_ERROR = 0x80020001,
SCE_KERNEL_ERROR_NOTIMP = 0x80020002,
SCE_KERNEL_ERROR_ILLEGAL_EXPCODE = 0x80020032,
SCE_KERNEL_ERROR_EXPHANDLER_NOUSE = 0x80020033,
SCE_KERNEL_ERROR_EXPHANDLER_USED = 0x80020034,
SCE_KERNEL_ERROR_SYCALLTABLE_NOUSED = 0x80020035,
SCE_KERNEL_ERROR_SYCALLTABLE_USED = 0x80020036,
SCE_KERNEL_ERROR_ILLEGAL_SYSCALLTABLE = 0x80020037,
SCE_KERNEL_ERROR_ILLEGAL_PRIMARY_SYSCALL_NUMBER = 0x80020038,
SCE_KERNEL_ERROR_PRIMARY_SYSCALL_NUMBER_INUSE = 0x80020039,
SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = 0x80020064,
SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = 0x80020065,
SCE_KERNEL_ERROR_CPUDI = 0x80020066,
SCE_KERNEL_ERROR_FOUND_HANDLER = 0x80020067,
SCE_KERNEL_ERROR_NOTFOUND_HANDLER = 0x80020068,
SCE_KERNEL_ERROR_ILLEGAL_INTRLEVEL = 0x80020069,
SCE_KERNEL_ERROR_ILLEGAL_ADDRESS = 0x8002006a,
SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = 0x8002006b,
SCE_KERNEL_ERROR_ILLEGAL_STACK_ADDRESS = 0x8002006c,
SCE_KERNEL_ERROR_ALREADY_STACK_SET = 0x8002006d,
SCE_KERNEL_ERROR_NO_TIMER = 0x80020096,
SCE_KERNEL_ERROR_ILLEGAL_TIMERID = 0x80020097,
SCE_KERNEL_ERROR_ILLEGAL_SOURCE = 0x80020098,
SCE_KERNEL_ERROR_ILLEGAL_PRESCALE = 0x80020099,
SCE_KERNEL_ERROR_TIMER_BUSY = 0x8002009a,
SCE_KERNEL_ERROR_TIMER_NOT_SETUP = 0x8002009b,
SCE_KERNEL_ERROR_TIMER_NOT_INUSE = 0x8002009c,
SCE_KERNEL_ERROR_UNIT_USED = 0x800200a0,
SCE_KERNEL_ERROR_UNIT_NOUSE = 0x800200a1,
SCE_KERNEL_ERROR_NO_ROMDIR = 0x800200a2,
SCE_KERNEL_ERROR_IDTYPE_EXIST = 0x800200c8,
SCE_KERNEL_ERROR_IDTYPE_NOT_EXIST = 0x800200c9,
SCE_KERNEL_ERROR_IDTYPE_NOT_EMPTY = 0x800200ca,
SCE_KERNEL_ERROR_UNKNOWN_UID = 0x800200cb,
SCE_KERNEL_ERROR_UNMATCH_UID_TYPE = 0x800200cc,
SCE_KERNEL_ERROR_ID_NOT_EXIST = 0x800200cd,
SCE_KERNEL_ERROR_NOT_FOUND_UIDFUNC = 0x800200ce,
SCE_KERNEL_ERROR_UID_ALREADY_HOLDER = 0x800200cf,
SCE_KERNEL_ERROR_UID_NOT_HOLDER = 0x800200d0,
SCE_KERNEL_ERROR_ILLEGAL_PERM = 0x800200d1,
SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT = 0x800200d2,
SCE_KERNEL_ERROR_ILLEGAL_ADDR = 0x800200d3,
SCE_KERNEL_ERROR_OUT_OF_RANGE = 0x800200d4,
SCE_KERNEL_ERROR_MEM_RANGE_OVERLAP = 0x800200d5,
SCE_KERNEL_ERROR_ILLEGAL_PARTITION = 0x800200d6,
SCE_KERNEL_ERROR_PARTITION_INUSE = 0x800200d7,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE = 0x800200d8,
SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED = 0x800200d9,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_LOCKED = 0x800200da,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_FAILED = 0x800200db,
SCE_KERNEL_ERROR_HEAPBLOCK_ALLOC_FAILED = 0x800200dc,
SCE_KERNEL_ERROR_HEAP_ALLOC_FAILED = 0x800200dd,
SCE_KERNEL_ERROR_ILLEGAL_CHUNK_ID = 0x800200de,
SCE_KERNEL_ERROR_NOCHUNK = 0x800200df,
SCE_KERNEL_ERROR_NO_FREECHUNK = 0x800200e0,
SCE_KERNEL_ERROR_MEMBLOCK_FRAGMENTED = 0x800200e1,
SCE_KERNEL_ERROR_MEMBLOCK_CANNOT_JOINT = 0x800200e2,
SCE_KERNEL_ERROR_MEMBLOCK_CANNOT_SEPARATE = 0x800200e3,
SCE_KERNEL_ERROR_ILLEGAL_ALIGNMENT_SIZE = 0x800200e4,
SCE_KERNEL_ERROR_ILLEGAL_DEVKIT_VER = 0x800200e5,
SCE_KERNEL_ERROR_LINKERR = 0x8002012c,
SCE_KERNEL_ERROR_ILLEGAL_OBJECT = 0x8002012d,
SCE_KERNEL_ERROR_UNKNOWN_MODULE = 0x8002012e,
SCE_KERNEL_ERROR_NOFILE = 0x8002012f,
SCE_KERNEL_ERROR_FILEERR = 0x80020130,
SCE_KERNEL_ERROR_MEMINUSE = 0x80020131,
SCE_KERNEL_ERROR_PARTITION_MISMATCH = 0x80020132,
SCE_KERNEL_ERROR_ALREADY_STARTED = 0x80020133,
SCE_KERNEL_ERROR_NOT_STARTED = 0x80020134,
SCE_KERNEL_ERROR_ALREADY_STOPPED = 0x80020135,
SCE_KERNEL_ERROR_CAN_NOT_STOP = 0x80020136,
SCE_KERNEL_ERROR_NOT_STOPPED = 0x80020137,
SCE_KERNEL_ERROR_NOT_REMOVABLE = 0x80020138,
SCE_KERNEL_ERROR_EXCLUSIVE_LOAD = 0x80020139,
SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED = 0x8002013a,
SCE_KERNEL_ERROR_LIBRARY_FOUND = 0x8002013b,
SCE_KERNEL_ERROR_LIBRARY_NOTFOUND = 0x8002013c,
SCE_KERNEL_ERROR_ILLEGAL_LIBRARY = 0x8002013d,
SCE_KERNEL_ERROR_LIBRARY_INUSE = 0x8002013e,
SCE_KERNEL_ERROR_ALREADY_STOPPING = 0x8002013f,
SCE_KERNEL_ERROR_ILLEGAL_OFFSET = 0x80020140,
SCE_KERNEL_ERROR_ILLEGAL_POSITION = 0x80020141,
SCE_KERNEL_ERROR_ILLEGAL_ACCESS = 0x80020142,
SCE_KERNEL_ERROR_MODULE_MGR_BUSY = 0x80020143,
SCE_KERNEL_ERROR_ILLEGAL_FLAG = 0x80020144,
SCE_KERNEL_ERROR_CANNOT_GET_MODULELIST = 0x80020145,
SCE_KERNEL_ERROR_PROHIBIT_LOADMODULE_DEVICE = 0x80020146,
SCE_KERNEL_ERROR_PROHIBIT_LOADEXEC_DEVICE = 0x80020147,
SCE_KERNEL_ERROR_UNSUPPORTED_PRX_TYPE = 0x80020148,
SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL = 0x80020149,
SCE_KERNEL_ERROR_CANNOT_GET_MODULE_INFORMATION = 0x8002014a,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_BUFFER = 0x8002014b,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_FILENAME = 0x8002014c,
SCE_KERNEL_ERROR_NO_EXIT_CALLBACK = 0x8002014d,
SCE_KERNEL_ERROR_MEDIA_CHANGED = 0x8002014e,
SCE_KERNEL_ERROR_CANNOT_USE_BETA_VER_MODULE = 0x8002014f,
SCE_KERNEL_ERROR_NO_MEMORY = 0x80020190,
SCE_KERNEL_ERROR_ILLEGAL_ATTR = 0x80020191,
SCE_KERNEL_ERROR_ILLEGAL_ENTRY = 0x80020192,
SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = 0x80020193,
SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = 0x80020194,
SCE_KERNEL_ERROR_ILLEGAL_MODE = 0x80020195,
SCE_KERNEL_ERROR_ILLEGAL_MASK = 0x80020196,
SCE_KERNEL_ERROR_ILLEGAL_THID = 0x80020197,
SCE_KERNEL_ERROR_UNKNOWN_THID = 0x80020198,
SCE_KERNEL_ERROR_UNKNOWN_SEMID = 0x80020199,
SCE_KERNEL_ERROR_UNKNOWN_EVFID = 0x8002019a,
SCE_KERNEL_ERROR_UNKNOWN_MBXID = 0x8002019b,
SCE_KERNEL_ERROR_UNKNOWN_VPLID = 0x8002019c,
SCE_KERNEL_ERROR_UNKNOWN_FPLID = 0x8002019d,
SCE_KERNEL_ERROR_UNKNOWN_MPPID = 0x8002019e,
SCE_KERNEL_ERROR_UNKNOWN_ALMID = 0x8002019f,
SCE_KERNEL_ERROR_UNKNOWN_TEID = 0x800201a0,
SCE_KERNEL_ERROR_UNKNOWN_CBID = 0x800201a1,
SCE_KERNEL_ERROR_DORMANT = 0x800201a2,
SCE_KERNEL_ERROR_SUSPEND = 0x800201a3,
SCE_KERNEL_ERROR_NOT_DORMANT = 0x800201a4,
SCE_KERNEL_ERROR_NOT_SUSPEND = 0x800201a5,
SCE_KERNEL_ERROR_NOT_WAIT = 0x800201a6,
SCE_KERNEL_ERROR_CAN_NOT_WAIT = 0x800201a7,
SCE_KERNEL_ERROR_WAIT_TIMEOUT = 0x800201a8,
SCE_KERNEL_ERROR_WAIT_CANCEL = 0x800201a9,
SCE_KERNEL_ERROR_RELEASE_WAIT = 0x800201aa,
SCE_KERNEL_ERROR_NOTIFY_CALLBACK = 0x800201ab,
SCE_KERNEL_ERROR_THREAD_TERMINATED = 0x800201ac,
SCE_KERNEL_ERROR_SEMA_ZERO = 0x800201ad,
SCE_KERNEL_ERROR_SEMA_OVF = 0x800201ae,
SCE_KERNEL_ERROR_EVF_COND = 0x800201af,
SCE_KERNEL_ERROR_EVF_MULTI = 0x800201b0,
SCE_KERNEL_ERROR_EVF_ILPAT = 0x800201b1,
SCE_KERNEL_ERROR_MBOX_NOMSG = 0x800201b2,
SCE_KERNEL_ERROR_MPP_FULL = 0x800201b3,
SCE_KERNEL_ERROR_MPP_EMPTY = 0x800201b4,
SCE_KERNEL_ERROR_WAIT_DELETE = 0x800201b5,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK = 0x800201b6,
SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE = 0x800201b7,
SCE_KERNEL_ERROR_ILLEGAL_SPADADDR = 0x800201b8,
SCE_KERNEL_ERROR_SPAD_INUSE = 0x800201b9,
SCE_KERNEL_ERROR_SPAD_NOT_INUSE = 0x800201ba,
SCE_KERNEL_ERROR_ILLEGAL_TYPE = 0x800201bb,
SCE_KERNEL_ERROR_ILLEGAL_SIZE = 0x800201bc,
SCE_KERNEL_ERROR_ILLEGAL_COUNT = 0x800201bd,
SCE_KERNEL_ERROR_UNKNOWN_VTID = 0x800201be,
SCE_KERNEL_ERROR_ILLEGAL_VTID = 0x800201bf,
SCE_KERNEL_ERROR_ILLEGAL_KTLSID = 0x800201c0,
SCE_KERNEL_ERROR_KTLS_FULL = 0x800201c1,
SCE_KERNEL_ERROR_KTLS_BUSY = 0x800201c2,
SCE_KERNEL_ERROR_MUTEX_NOT_FOUND = 0x800201c3,
SCE_KERNEL_ERROR_MUTEX_LOCKED = 0x800201c4,
SCE_KERNEL_ERROR_MUTEX_UNLOCKED = 0x800201c5,
SCE_KERNEL_ERROR_MUTEX_LOCK_OVERFLOW = 0x800201c6,
SCE_KERNEL_ERROR_MUTEX_UNLOCK_UNDERFLOW = 0x800201c7,
SCE_KERNEL_ERROR_MUTEX_RECURSIVE_NOT_ALLOWED = 0x800201c8,
SCE_KERNEL_ERROR_MESSAGEBOX_DUPLICATE_MESSAGE = 0x800201c9,
SCE_KERNEL_ERROR_LWMUTEX_NOT_FOUND = 0x800201ca,
SCE_KERNEL_ERROR_LWMUTEX_LOCKED = 0x800201cb,
SCE_KERNEL_ERROR_LWMUTEX_UNLOCKED = 0x800201cc,
SCE_KERNEL_ERROR_LWMUTEX_LOCK_OVERFLOW = 0x800201cd,
SCE_KERNEL_ERROR_LWMUTEX_UNLOCK_UNDERFLOW = 0x800201ce,
SCE_KERNEL_ERROR_LWMUTEX_RECURSIVE_NOT_ALLOWED = 0x800201cf,
SCE_KERNEL_ERROR_PM_INVALID_PRIORITY = 0x80020258,
SCE_KERNEL_ERROR_PM_INVALID_DEVNAME = 0x80020259,
SCE_KERNEL_ERROR_PM_UNKNOWN_DEVNAME = 0x8002025a,
SCE_KERNEL_ERROR_PM_PMINFO_REGISTERED = 0x8002025b,
SCE_KERNEL_ERROR_PM_PMINFO_UNREGISTERED = 0x8002025c,
SCE_KERNEL_ERROR_PM_INVALID_MAJOR_STATE = 0x8002025d,
SCE_KERNEL_ERROR_PM_INVALID_REQUEST = 0x8002025e,
SCE_KERNEL_ERROR_PM_UNKNOWN_REQUEST = 0x8002025f,
SCE_KERNEL_ERROR_PM_INVALID_UNIT = 0x80020260,
SCE_KERNEL_ERROR_PM_CANNOT_CANCEL = 0x80020261,
SCE_KERNEL_ERROR_PM_INVALID_PMINFO = 0x80020262,
SCE_KERNEL_ERROR_PM_INVALID_ARGUMENT = 0x80020263,
SCE_KERNEL_ERROR_PM_ALREADY_TARGET_PWRSTATE = 0x80020264,
SCE_KERNEL_ERROR_PM_CHANGE_PWRSTATE_FAILED = 0x80020265,
SCE_KERNEL_ERROR_PM_CANNOT_CHANGE_DEVPWR_STATE = 0x80020266,
SCE_KERNEL_ERROR_PM_NO_SUPPORT_DEVPWR_STATE = 0x80020267,
SCE_KERNEL_ERROR_DMAC_REQUEST_FAILED = 0x800202bc,
SCE_KERNEL_ERROR_DMAC_REQUEST_DENIED = 0x800202bd,
SCE_KERNEL_ERROR_DMAC_OP_QUEUED = 0x800202be,
SCE_KERNEL_ERROR_DMAC_OP_NOT_QUEUED = 0x800202bf,
SCE_KERNEL_ERROR_DMAC_OP_RUNNING = 0x800202c0,
SCE_KERNEL_ERROR_DMAC_OP_NOT_ASSIGNED = 0x800202c1,
SCE_KERNEL_ERROR_DMAC_OP_TIMEOUT = 0x800202c2,
SCE_KERNEL_ERROR_DMAC_OP_FREED = 0x800202c3,
SCE_KERNEL_ERROR_DMAC_OP_USED = 0x800202c4,
SCE_KERNEL_ERROR_DMAC_OP_EMPTY = 0x800202c5,
SCE_KERNEL_ERROR_DMAC_OP_ABORTED = 0x800202c6,
SCE_KERNEL_ERROR_DMAC_OP_ERROR = 0x800202c7,
SCE_KERNEL_ERROR_DMAC_CHANNEL_RESERVED = 0x800202c8,
SCE_KERNEL_ERROR_DMAC_CHANNEL_EXCLUDED = 0x800202c9,
SCE_KERNEL_ERROR_DMAC_PRIVILEGE_ADDRESS = 0x800202ca,
SCE_KERNEL_ERROR_DMAC_NO_ENOUGHSPACE = 0x800202cb,
SCE_KERNEL_ERROR_DMAC_CHANNEL_NOT_ASSIGNED = 0x800202cc,
SCE_KERNEL_ERROR_DMAC_CHILD_OPERATION = 0x800202cd,
SCE_KERNEL_ERROR_DMAC_TOO_MUCH_SIZE = 0x800202ce,
SCE_KERNEL_ERROR_DMAC_INVALID_ARGUMENT = 0x800202cf,
SCE_KERNEL_ERROR_MFILE = 0x80020320,
SCE_KERNEL_ERROR_NODEV = 0x80020321,
SCE_KERNEL_ERROR_XDEV = 0x80020322,
SCE_KERNEL_ERROR_BADF = 0x80020323,
SCE_KERNEL_ERROR_INVAL = 0x80020324,
SCE_KERNEL_ERROR_UNSUP = 0x80020325,
SCE_KERNEL_ERROR_ALIAS_USED = 0x80020326,
SCE_KERNEL_ERROR_CANNOT_MOUNT = 0x80020327,
SCE_KERNEL_ERROR_DRIVER_DELETED = 0x80020328,
SCE_KERNEL_ERROR_ASYNC_BUSY = 0x80020329,
SCE_KERNEL_ERROR_NOASYNC = 0x8002032a,
SCE_KERNEL_ERROR_REGDEV = 0x8002032b,
SCE_KERNEL_ERROR_NOCWD = 0x8002032c,
SCE_KERNEL_ERROR_NAMETOOLONG = 0x8002032d,
SCE_KERNEL_ERROR_NXIO = 0x800203e8,
SCE_KERNEL_ERROR_IO = 0x800203e9,
SCE_KERNEL_ERROR_NOMEM = 0x800203ea,
SCE_KERNEL_ERROR_STDIO_NOT_OPENED = 0x800203eb,
SCE_KERNEL_ERROR_CACHE_ALIGNMENT = 0x8002044c,
SCE_KERNEL_ERROR_ERRORMAX = 0x8002044d,
};
// If you add to this, make sure to check KernelObjectPool::CreateByIDType().
@ -467,6 +543,7 @@ struct KernelStats {
};
extern KernelStats kernelStats;
extern u32 registeredExitCbId;
void Register_ThreadManForUser();
void Register_LoadExecForUser();

View File

@ -512,8 +512,8 @@ int sceKernelAllocPartitionMemory(int partition, const char *name, int type, u32
// Alignment is only allowed for powers of 2.
if ((type == PSP_SMEM_LowAligned || type == PSP_SMEM_HighAligned) && ((addr & (addr - 1)) != 0 || addr == 0))
{
WARN_LOG_REPORT(HLE, "%08x=sceKernelAllocPartitionMemory(): invalid alignment %x", SCE_ERROR_KERNEL_ILLEGAL_ALIGNMENT_SIZE, addr);
return SCE_ERROR_KERNEL_ILLEGAL_ALIGNMENT_SIZE;
WARN_LOG_REPORT(HLE, "%08x=sceKernelAllocPartitionMemory(): invalid alignment %x", SCE_KERNEL_ERROR_ILLEGAL_ALIGNMENT_SIZE, addr);
return SCE_KERNEL_ERROR_ILLEGAL_ALIGNMENT_SIZE;
}
PartitionMemoryBlock *block = new PartitionMemoryBlock(&userMemory, name, size, (MemblockType)type, addr);
@ -1161,11 +1161,25 @@ int sceKernelReferVplStatus(SceUID uid, u32 infoPtr)
// TODO: Make proper kernel objects for these instead of using the UID as a pointer.
u32 AllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAddr) {
// Just support allocating a block in the user region.
if (paramsAddr) {
u32 length = Memory::Read_U32(paramsAddr);
if (length != 4) {
WARN_LOG(HLE, "AllockMemoryBlock(SysMemUserForUser_FE707FDF) : unknown parameters with length %d", length);
}
}
if (type < 0 || type > 1) {
return SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE;
}
u32 blockPtr = userMemory.Alloc(size, type == 1, pname);
if (!blockPtr) {
return SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED;
}
INFO_LOG(HLE,"%08x=AllocMemoryBlock(SysMemUserForUser_FE707FDF)(%s, %i, %08x, %08x)", blockPtr, pname, type, size, paramsAddr);
// Create a UID object??? Nah, let's just us the UID itself (hack!)
@ -1175,13 +1189,21 @@ u32 AllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAddr) {
u32 FreeMemoryBlock(u32 uid) {
INFO_LOG(HLE, "FreeMemoryBlock(%08x)", uid);
userMemory.Free(uid);
u32 blockPtr = userMemory.GetBlockStartFromAddress(uid);
if (!blockPtr) {
return SCE_KERNEL_ERROR_UNKNOWN_UID;
}
userMemory.Free(blockPtr);
return 0;
}
u32 GetMemoryBlockPtr(u32 uid, u32 addr) {
INFO_LOG(HLE, "GetMemoryBlockPtr(%08x, %08x)", uid, addr);
Memory::Write_U32(uid, addr);
u32 blockPtr = userMemory.GetBlockStartFromAddress(uid);
if (!blockPtr) {
return SCE_KERNEL_ERROR_UNKNOWN_UID;
}
Memory::Write_U32(blockPtr, addr);
return 0;
}

View File

@ -3241,3 +3241,36 @@ void __KernelChangeThreadState(SceUID threadId, ThreadStatus newStatus)
__KernelChangeThreadState(t, newStatus);
}
int hleLoadExecForUser_362A956B()
{
u32 error;
Callback *cb = kernelObjects.Get<Callback>(registeredExitCbId, error);
if (!cb) {
WARN_LOG(HLE, "LoadExecForUser_362A956B() : registeredExitCbId not found 0x%x", registeredExitCbId);
return SCE_KERNEL_ERROR_UNKNOWN_CBID;
}
int cbArg = cb->nc.commonArgument;
if (!Memory::IsValidAddress(cbArg)) {
WARN_LOG(HLE, "LoadExecForUser_362A956B() : invalid address for cbArg (0x%08X)", cbArg);
return SCE_KERNEL_ERROR_ILLEGAL_ADDR;
}
int unknown1 = Memory::Read_U32(cbArg - 8);
if (unknown1 < 0 || unknown1 >= 4) {
WARN_LOG(HLE, "LoadExecForUser_362A956B() : invalid value unknown1 (0x%08X)", unknown1);
return SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT;
}
int parameterArea = Memory::Read_U32(cbArg - 4);
if (!Memory::IsValidAddress(parameterArea)) {
WARN_LOG(HLE, "LoadExecForUser_362A956B() : invalid address for parameterArea on userMemory (0x%08X)", parameterArea);
return SCE_KERNEL_ERROR_ILLEGAL_ADDR;
}
int size = Memory::Read_U32(parameterArea);
if (size < 12) {
WARN_LOG(HLE, "LoadExecForUser_362A956B() : invalid parameterArea size %d", size);
return SCE_KERNEL_ERROR_ILLEGAL_SIZE;
}
Memory::Write_U32(0, parameterArea + 4);
Memory::Write_U32(-1, parameterArea + 8);
return 0;
}

View File

@ -307,3 +307,4 @@ struct DebugThreadInfo
std::vector<DebugThreadInfo> GetThreadsInfo();
void __KernelChangeThreadState(SceUID threadId, ThreadStatus newStatus);
int hleLoadExecForUser_362A956B();

View File

@ -241,13 +241,20 @@ void FramebufferManager::DrawActiveTexture(float x, float y, float w, float h, b
}
VirtualFramebuffer *FramebufferManager::GetDisplayFBO() {
VirtualFramebuffer *match = NULL;
for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ++iter) {
VirtualFramebuffer *v = *iter;
if (MaskedEqual(v->fb_address, displayFramebufPtr_) && v->format == displayFormat_) {
// Could check w too but whatever
return *iter;
if (match == NULL || match->last_frame_used < v->last_frame_used) {
match = v;
}
}
}
if (match != NULL) {
return match;
}
DEBUG_LOG(HLE, "Finding no FBO matching address %08x", displayFramebufPtr_);
#if 0 // defined(_DEBUG)
std::string debug = "FBOs: ";

View File

@ -23,6 +23,7 @@
#include "Common/CommonFuncs.h"
#include "Common/ThreadPools.h"
#include "ext/xbrz/xbrz.h"
#include <stdlib.h>
#ifdef __SYMBIAN32__
#define p

View File

@ -518,7 +518,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
// We do software T&L for now
float out[3], norm[3];
float pos[3], nrm[3];
Vec3 normal(0, 0, 0);
Vec3 normal(0, 0, 1);
reader.ReadPos(pos);
if (reader.hasNormal())
reader.ReadNrm(nrm);

View File

@ -165,8 +165,6 @@ void GenerateVertexShader(int prim, char *buffer) {
int shadeLight0 = gstate.getUVGenMode() == 2 ? gstate.getUVLS0() : -1;
int shadeLight1 = gstate.getUVGenMode() == 2 ? gstate.getUVLS1() : -1;
for (int i = 0; i < 4; i++) {
if (!hasNormal)
continue;
if (i == shadeLight0 || i == shadeLight1)
doLight[i] = LIGHT_SHADE;
if ((gstate.lightingEnable & 1) && (gstate.lightEnable[i] & 1))
@ -293,10 +291,14 @@ void GenerateVertexShader(int prim, char *buffer) {
WRITE(p, " vec3 worldpos = (u_world * vec4(a_position.xyz, 1.0)).xyz;\n");
if (hasNormal)
WRITE(p, " vec3 worldnormal = (u_world * vec4(a_normal, 0.0)).xyz;\n");
else
WRITE(p, " vec3 worldnormal = vec3(0.0, 0.0, 1.0);\n");
} else {
WRITE(p, " vec3 worldpos = vec3(0.0);\n");
if (hasNormal)
WRITE(p, " vec3 worldnormal = vec3(0.0);\n");
else
WRITE(p, " vec3 worldnormal = vec3(0.0, 0.0, 1.0);\n");
int numWeights = 1 + ((vertType & GE_VTYPE_WEIGHTCOUNT_MASK) >> GE_VTYPE_WEIGHTCOUNT_SHIFT);
static const float rescale[4] = {0, 2*127.5f/128.f, 2*32767.5f/32768.f, 2.0f};

View File

@ -808,10 +808,10 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer) {
"unsupported2",
"unsupported3",
};
if (data & ~0x107)
sprintf(buffer, "TexFunc %i %s (%s, extra %x)", data & 7, data & 0x100 ? "RGBA" : "RGB", texfuncs[data & 7], data);
if (data & ~0x10107)
sprintf(buffer, "TexFunc %i %s %s%s (extra %x)", data & 7, data & 0x100 ? "RGBA" : "RGB", texfuncs[data & 7], data & 0x10000 ? " color double" : "", data);
else
sprintf(buffer, "TexFunc %i %s (%s)", data & 7, data & 0x100 ? "RGBA" : "RGB", texfuncs[data & 7]);
sprintf(buffer, "TexFunc %i %s %s%s", data & 7, data & 0x100 ? "RGBA" : "RGB", texfuncs[data & 7], data & 0x10000 ? " color double" : "");
}
break;

View File

@ -26,6 +26,39 @@ in order to get the "native" library.
Now, the actual building:
Building for Windows
---------------------
Use Visual Studio 2010+, Visual C++ Express is fine. Open the solution and just build,
it'll work. You may just need to set up a path or two to the Windows SDK (which includes the DX SDK)
nowadays.
Building for Android
--------------------
Install the Android SDK and NDK.
To build the native C/C++ part, from a shell or command prompt, run:
./ab.sh
or, on Windows:
ab.cmd
in android/. You may need to tweak the paths in the ab file.
Then just open the project in Eclipse and run on your device. When you make changes to
the native code, you may have to refresh or add a few spaces to PPSSPPActivity.java for
Eclipse to rebuild the APK when you run it on your device the next time.
There's an alternate method of building for Android using CMake below.
Other platforms
---------------
PPSSPP currently uses CMake for its build system. In order
to build for most systems, create a `build` directory and
run:
@ -75,10 +108,10 @@ on homebrew. Just follow the basic build instructions afterwards.
Currently the user interface is identical to Android's, operated
with the mouse. A Qt-based interface is planned.
Building for Android
--------------------
Building for Android using CMake (not recommended, see above)
-------------------------------------------------------------
To build for android, first you must set the ANDROID\_NDK environment
To build for Android using CMake, first you must set the ANDROID\_NDK environment
variable to point to the path of your NDK install. This is done on
windows cmd with `set ANDROID_NDK=X:\...`, on bourne shells with
`export ANDROID_NDK=/path/to/ndk`, and on C shells with

View File

@ -1,4 +1,4 @@
// Copyright (c) 2012- PPSSPP Project.
// 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
@ -740,8 +740,8 @@ void GraphicsScreenP2::render() {
if (g_Config.iAnisotropyLevel == 0)
g_Config.iAnisotropyLevel = 2;
ui_draw2d.DrawText(UBUNTU24, gs->T("Level :"), x + 60, y += stride - 5, 0xFFFFFFFF, ALIGN_LEFT);
HLinear hlinear1(x + 160 , y + 5, 20);
ui_draw2d.DrawText(UBUNTU24, gs->T("Level :"), x + 60, y += stride, 0xFFFFFFFF, ALIGN_LEFT);
HLinear hlinear1(x + 160 , y, 20);
if (UIButton(GEN_ID, hlinear1, 45, 0, "2x", ALIGN_LEFT))
g_Config.iAnisotropyLevel = 2;
if (UIButton(GEN_ID, hlinear1, 45, 0, "4x", ALIGN_LEFT))
@ -755,23 +755,20 @@ void GraphicsScreenP2::render() {
}
bool TexScaling = g_Config.iTexScalingLevel > 1;
UICheckBox(GEN_ID, x, y += stride + 20, gs->T("xBRZ Texture Scaling"), ALIGN_TOPLEFT, &TexScaling);
UICheckBox(GEN_ID, x, y += stride + 15, gs->T("xBRZ Texture Scaling"), ALIGN_TOPLEFT, &TexScaling);
if (TexScaling) {
if (g_Config.iTexScalingLevel <= 1)
g_Config.iTexScalingLevel = 2;
ui_draw2d.DrawText(UBUNTU24, gs->T("Level :"), x + 60, y += stride + 5, 0xFFFFFFFF, ALIGN_LEFT);
HLinear hlinear1(x + 160 , y - 5, 20);
UICheckBox(GEN_ID, x + 60, y += stride, gs->T("Deposterize"), ALIGN_LEFT, &g_Config.bTexDeposterize);
bool tst = g_Config.iTexScalingType == 1;
UICheckBox(GEN_ID, x + 60, y += stride, gs->T("Hybrid"), ALIGN_LEFT, &tst);
g_Config.iTexScalingType = tst ? 1 : 0;
ui_draw2d.DrawText(UBUNTU24, gs->T("Level :"), x + 60, y += stride, 0xFFFFFFFF, ALIGN_LEFT);
HLinear hlinear1(x + 160 , y, 20);
if (UIButton(GEN_ID, hlinear1, 45, 0, "2x", ALIGN_LEFT))
g_Config.iTexScalingLevel = 2;
if (UIButton(GEN_ID, hlinear1, 45, 0, "3x", ALIGN_LEFT))
g_Config.iTexScalingLevel = 3;
HLinear hlinear2(x + 160 , y + 60, 20);
ui_draw2d.DrawText(UBUNTU24, gs->T("Type :"), x + 60, y += stride + 20, 0xFFFFFFFF, ALIGN_LEFT);
if (UIButton(GEN_ID, hlinear2, 90, 0, "xBRZ", ALIGN_LEFT))
g_Config.iTexScalingType = 0;
if (UIButton(GEN_ID, hlinear2, 100, 0, "Hybrid", ALIGN_LEFT))
g_Config.iTexScalingType = 1;
} else {
g_Config.iTexScalingLevel = 1;
}

View File

@ -18,6 +18,7 @@
#include "Core/Core.h"
#include "Core/Config.h"
#include "Core/CoreParameter.h"
#include "Core/System.h"
#include "EmuThread.h"
#include "DSoundStream.h"
#include "WindowsHost.h"
@ -127,6 +128,7 @@ void WindowsHost::SetDebugMode(bool mode)
disasmWindow[i]->SetDebugMode(mode);
}
extern BOOL g_bFullScreen;
void WindowsHost::PollControllers(InputState &input_state)
{

View File

@ -42,11 +42,12 @@
#define ENABLE_TOUCH 0
static BOOL g_bFullScreen = FALSE;
BOOL g_bFullScreen = FALSE;
static RECT g_normalRC = {0};
extern InputState input_state;
#define TIMER_CURSORUPDATE 1
#define CURSORUPDATE_INTERVAL_MS 50
extern unsigned short analog_ctrl_map[];
extern unsigned int key_pad_map[];
extern const char * getVirtualKeyName(unsigned char key);
@ -200,6 +201,7 @@ namespace MainWindow
hwndMain = CreateWindowEx(0,szWindowClass, "", style,
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, hInstance, NULL);
SetTimer(hwndMain, TIMER_CURSORUPDATE, CURSORUPDATE_INTERVAL_MS, 0);
SetPlaying(0);
if (!hwndMain)
return FALSE;
@ -233,6 +235,7 @@ namespace MainWindow
#endif
SetFocus(hwndMain);
SetFocus(hwndDisplay);
return TRUE;
}
@ -388,6 +391,17 @@ namespace MainWindow
ResizeDisplay();
break;
case WM_TIMER:
// Hack: Take the opportunity to also show/hide the mouse cursor in fullscreen mode.
if (g_bFullScreen && globalUIState == UISTATE_INGAME) {
ShowCursor(FALSE);
} else {
ShowCursor(TRUE);
SetCursor(LoadCursor(NULL, IDC_ARROW));
}
SetTimer(hWnd, TIMER_CURSORUPDATE, CURSORUPDATE_INTERVAL_MS, 0);
return 0;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
@ -751,7 +765,8 @@ namespace MainWindow
disasmWindow[0] = new CDisasm(MainWindow::GetHInstance(), MainWindow::GetHWND(), currentDebugMIPS);
DialogManager::AddDlg(disasmWindow[0]);
disasmWindow[0]->Show(g_Config.bShowDebuggerOnLoad);
if (g_Config.bFullScreen) _ViewFullScreen(hWnd);
if (g_Config.bFullScreen)
_ViewFullScreen(hWnd);
memoryWindow[0] = new CMemoryDlg(MainWindow::GetHInstance(), MainWindow::GetHWND(), currentDebugMIPS);
DialogManager::AddDlg(memoryWindow[0]);
if (disasmWindow[0])
@ -1120,7 +1135,7 @@ namespace MainWindow
{
ShowCursor(TRUE);
SetCursor(LoadCursor(NULL, IDC_ARROW));
ClipCursor(NULL);
// put caption and border styles back
DWORD dwOldStyle = ::GetWindowLong(hWnd, GWL_STYLE);
DWORD dwNewStyle = dwOldStyle | WS_CAPTION | WS_THICKFRAME;
@ -1144,9 +1159,9 @@ namespace MainWindow
void _ViewFullScreen(HWND hWnd)
{
ShowCursor(FALSE);
SetCursor(NULL);
ClipCursor(&g_normalRC);
if (globalUIState == UISTATE_INGAME)
ShowCursor(FALSE);
// keep in mind normal window rectangle
::GetWindowRect(hWnd, &g_normalRC);

Binary file not shown.

2
lang

@ -1 +1 @@
Subproject commit 2a6b9579029002d347aa11bc89cb5e44e1c68dbe
Subproject commit a8d260acb367e922c7f4792ab134c8a02052c854

2
native

@ -1 +1 @@
Subproject commit 203e3c9903c7bece68ef42ea05261edeb5d1b7eb
Subproject commit 3edf239571e8132eed1fa6baaf7b8e269d889103