Separated internal and external common headers

libatrac3plus exports, sysmem export fixes, various cleans a bit everywhere
This commit is contained in:
artart78 2012-08-23 13:37:32 +00:00
parent 5e1118713f
commit d5f989a8d2
78 changed files with 1437 additions and 1395 deletions

View File

@ -9,7 +9,7 @@
* The audio.prx module RE'ing.
*/
#include "common.h"
#include "common_header.h"
/** @defgroup Audio Audio Module
*

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
typedef struct
{

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
int sceClockgenAudioClkSetFreq(int);

View File

@ -2,7 +2,14 @@
See the file COPYING for copying permission.
*/
#include "common.h"
/**
* @author artart78
* @version 6.60
*
* The codec.prx module RE'ing.
*/
#include "common_header.h"
int sceCodecOutputEnable(int arg0, int arg1);
int sceCodecSetOutputVolume(int reg);

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
#define COP0_CTRL_EPC 0

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
typedef enum

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
#define SCE_ERROR_OK 0x0

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
static inline s32 pspMax(s32 a, s32 b)

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
#define UCACHED(ptr) (void*)((u32)(void*)(ptr) & 0x1FFFFFFF)
@ -14,4 +14,5 @@
#define UPALIGN64(v) (((v) + 0x3F) & 0xFFFFFFC0)
#define HW(addr) (*(vs32*)(addr))
#define HWPTR(addr) ((vs32*)(addr))

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
typedef struct {

View File

@ -2,8 +2,8 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
# error "Only include common.h!"
#ifndef COMMON_INCLUDED
# error "Only include common_imp.h or common_header.h!"
#endif
static inline int pspGetK1(void)

16
include/common_header.h Normal file
View File

@ -0,0 +1,16 @@
/* Copyright (C) 2011, 2012 The uOFW team
See the file COPYING for copying permission.
*/
/* Common file for module headers, ie the headers that specify the exports & data structures of a module */
#ifndef COMMON_HEADER_H
#define COMMON_HEADER_H
#define COMMON_INCLUDED
#include "common/errors.h"
#include "common/types.h"
#endif

View File

@ -2,10 +2,14 @@
See the file COPYING for copying permission.
*/
#ifndef COMMON_H
#define COMMON_H
/* Common file for module implementations */
#include "types.h"
#ifndef COMMON_IMP_H
#define COMMON_IMP_H
#define COMMON_INCLUDED
#include "common/types.h"
#include "common/cop0.h"
#include "common/debug.h"

View File

@ -11,7 +11,7 @@
* Controller libraries of the SCE PSP system.
*/
#include "common.h"
#include "common_header.h"
/** @defgroup Controller Controller libraries
*

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
/** Framebuffer pixel formats. */
enum PspDisplayPixelFormats {

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
int sceKernelDmaOpQuit(u32*);
int sceKernelDmaOpAssign(u32*, int, int, int, int);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
// interruption
#define EXCEP_INT 1

View File

@ -9,7 +9,7 @@
* The ge.prx module RE'ing.
*/
#include "common.h"
#include "common_header.h"
/** @defgroup GE sceGE_Manager Module
*

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
enum SceInterrupts {
SCE_GPIO_INT = 4,

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
#define SCE_O_RDONLY 0x0001
#define SCE_O_WRONLY 0x0002

View File

@ -9,7 +9,7 @@
* The StdioForUser/Kernel libraries
*/
#include "common.h"
#include "common_header.h"
/** @defgroup Stdio StdioForUser/Kernel libraries
*

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
int sceLfatfsWaitReady(void);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
int sceDdrFlush(int);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
s32 sceSysregTopResetEnable(void);
s32 sceSysregScResetEnable(void);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
int sceWmd_driver_7A0E484C(void *data, int inSize, int *outSize);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
enum SceApplicationType {
SCE_INIT_APPLICATION_VSH = 0x100,

View File

@ -14,7 +14,7 @@
#ifndef DDRDB_H
#define DDRDB_H
#include "common.h"
#include "common_header.h"
#ifdef __cplusplus
extern "C" {

View File

@ -9,7 +9,7 @@
* The syscon.prx module RE'ing.
*/
#include "common.h"
#include "common_header.h"
/** @defgroup Syscon Syscon Module
*

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
typedef struct {
int size;

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
#include <loadcore.h>
typedef struct {

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
/** The PSP SDK defines this as PSP_POWER_TICK_ALL. Cancels all timers. */
#define SCE_KERNEL_POWER_TICK_DEFAULT 0

View File

@ -4,7 +4,7 @@
#include <stdarg.h>
#include "common.h"
#include "common_header.h"
#define CTYPE_DOWNCASE_LETTER 0x01
#define CTYPE_UPCASE_LETTER 0x02

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
typedef struct {
s32 size;

View File

@ -5,7 +5,7 @@
#ifndef SYSMEM_USER_H
#define SYSMEM_USER_H
#include "common.h"
#include "common_header.h"
#ifdef __cplusplus
extern "C" {

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
int UtilsForKernel_6C6887EE(void *outBuf, int outSize, void *inBuf, void **end);
void sceKernelDcacheInvalidateAll(void);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
typedef int SceSysTimerId;
typedef int (*SceSysTimerCb)(int, int, int, int);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
#define SCE_MEMORY_PARTITION_KERNEL 1

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include "common_header.h"
s32 sceKernelCpuSuspendIntr(void);
void sceKernelCpuResumeIntr(s32 intr);

View File

@ -53,7 +53,7 @@ Makefile.exp: $(PRX_EXPORTS)
exp: Makefile.exp
make -f Makefile.exp
exp-clean:
exp-clean: Makefile.exp
make -f Makefile.exp clean
-$(RM) Makefile.exp

View File

@ -3,5 +3,5 @@
include ../../lib/common.mak
CFLAGS=-O2 -G0 -Wall -I../../include
CFLAGS=-O2 -G0 -Wall -I../../include/common

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include <common.h>
#include <common_imp.h>
#include <clockgen.h>
#include <codec.h>

View File

@ -1,4 +1,4 @@
#include "common.h"
#include <common_imp.h>
#include "codec.h"
#include "lowio_gpio.h"

View File

@ -10,7 +10,7 @@
#define DEBUG_FILE "uofw/log.txt"
#define IO_DEBUG_FILE "ms0:/" DEBUG_FILE
#include <common.h>
#include <common_imp.h>
#include <display.h>
#include <iofilemgr_kernel.h>

View File

@ -1,7 +1,7 @@
#ifndef __SYSCON_H__
#define __SYSCON_H__
#include "common.h"
#include <common_imp.h>
/*
CMD 07,08 : CTRL data

View File

@ -2,7 +2,7 @@
PSP IPL SYSREG Driver
****************************************************************************/
#include <common.h>
#include <common_imp.h>
#define REG32(ADDR) (*(vu32*)(ADDR))
#define SYNC() asm(" sync; nop"::)

View File

@ -1,7 +1,7 @@
#ifndef __SYSREG_H__
#define __SYSREG_H__
#include <common.h>
#include <common_imp.h>
u32 sceSysregSpiClkSelect(int a1,int a2);
u32 sceSysregSpiClkEnable(u32 bit);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
#include "excep.h"
#include "exceptions.h"

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
#include "excep.h"
#include "exceptionman.h"

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
#define IS_JUMP(op) ((op & 0xFC000000) == 0x0C000000)
#define JUMP(ref, addr) ((ref & 0xF0000000) | ((addr & 0x03FFFFFFF) << 2))

View File

@ -4,7 +4,7 @@
TARGET = interruptman
OBJS = start.o interruptman.o end.o
DEBUG = 1
#DEBUG = 1
LIBS = -lExceptionManagerForKernel -lLoadCoreForKernel -lSysMemForKernel -lsceSuspendForKernel

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include <common.h>
#include <common_imp.h>
#include <exceptionman.h>
#include <loadcore.h>
@ -509,10 +509,10 @@ void InterruptManagerForKernel_E790EAED(s32 (*arg0)(), s32 (*arg1)())
{
dbg_printf("Called %s\n", __FUNCTION__);
s32 oldIc = sceKernelCpuSuspendIntr();
*(s32*)(&mod_0468) = 0x0C000000 + (((s32)arg1 >> 2) & 0x3FFFFFF);
mod_0468 = 0x0C000000 + (((s32)arg1 >> 2) & 0x3FFFFFF);
pspCache(0x1A, &mod_0468);
pspCache(0x08, &mod_0468);
*(s32*)(&mod_0400) = 0x0C000000 + (((s32)arg0 >> 2) & 0x3FFFFFF);
mod_0400 = 0x0C000000 + (((s32)arg0 >> 2) & 0x3FFFFFF);
pspCache(0x1A, &mod_0400);
pspCache(0x08, &mod_0400);
sceKernelCpuResumeIntr(oldIc);
@ -1247,11 +1247,11 @@ void InterruptManagerForKernel_E526B767(s32 arg)
{
dbg_printf("Called %s\n", __FUNCTION__);
if (arg == 0)
*(s32*)(&mod_0E48) = 0x42000018; // eret
mod_0E48 = 0x42000018; // eret
// 30F0
if (arg == 1) {
// 3104
*(s32*)(&mod_0E50) = 0x00005821; // t3 = 0
mod_0E50 = 0x00005821; // t3 = 0
}
}

View File

@ -1,4 +1,4 @@
#include "common.h"
#include <common_imp.h>
#include "interruptman.h"
#include "sysmem_kernel.h"

View File

@ -4,7 +4,7 @@
#include <stdarg.h>
#include "common.h"
#include <common_imp.h>
#include "sysmem_kdebug.h"
#include "sysmem_kernel.h"

View File

@ -0,0 +1,52 @@
# Export file automatically generated with prxtool
PSP_BEGIN_EXPORTS
PSP_EXPORT_START(syslib, 0x0000, 0x8000)
PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_FUNC_HASH(module_stop)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_VAR_HASH(module_sdk_version)
PSP_EXPORT_VAR_HASH(module_start_thread_parameter)
PSP_EXPORT_VAR_HASH(module_stop_thread_parameter)
PSP_EXPORT_END
PSP_EXPORT_START(sceAtrac3plus, 0x0011, 0x0001)
PSP_EXPORT_FUNC_HASH(sceAtracLowLevelDecode)
PSP_EXPORT_FUNC_HASH(sceAtracSetData)
PSP_EXPORT_FUNC_HASH(sceAtracSetHalfwayBufferAndGetID)
PSP_EXPORT_FUNC_HASH(sceAtracReinit)
PSP_EXPORT_FUNC_HASH(sceAtracLowLevelInitDecoder)
PSP_EXPORT_FUNC_HASH(_sceAtracGetContextAddress)
PSP_EXPORT_FUNC_HASH(sceAtracGetBufferInfoForResetting)
PSP_EXPORT_FUNC_HASH(sceAtracGetChannel)
PSP_EXPORT_FUNC_HASH(sceAtracGetNextSample)
PSP_EXPORT_FUNC_HASH(sceAtracSetHalfwayBuffer)
PSP_EXPORT_FUNC_HASH(sceAtracSetAA3DataAndGetID)
PSP_EXPORT_FUNC_HASH(sceAtracSetMOutHalfwayBuffer)
PSP_EXPORT_FUNC_HASH(sceAtracGetStreamDataInfo)
PSP_EXPORT_FUNC_HASH(sceAtracSetAA3HalfwayBufferAndGetID)
PSP_EXPORT_FUNC_HASH(sceAtracReleaseAtracID)
PSP_EXPORT_FUNC_HASH(sceAtracResetPlayPosition)
PSP_EXPORT_FUNC_HASH(sceAtracDecodeData)
PSP_EXPORT_FUNC_HASH(sceAtracGetAtracID)
PSP_EXPORT_FUNC_HASH(sceAtracSetDataAndGetID)
PSP_EXPORT_FUNC_HASH(sceAtracAddStreamData)
PSP_EXPORT_FUNC_HASH(sceAtracSetSecondBuffer)
PSP_EXPORT_FUNC_HASH(sceAtracGetSecondBufferInfo)
PSP_EXPORT_FUNC_HASH(sceAtracSetLoopNum)
PSP_EXPORT_FUNC_HASH(sceAtracGetRemainFrame)
PSP_EXPORT_FUNC_HASH(sceAtracSetMOutHalfwayBufferAndGetID)
PSP_EXPORT_FUNC_HASH(sceAtracGetSoundSample)
PSP_EXPORT_FUNC_HASH(sceAtracGetBitrate)
PSP_EXPORT_FUNC_HASH(sceAtracGetOutputChannel)
PSP_EXPORT_FUNC_HASH(sceAtracGetBufferInfoForReseting)
PSP_EXPORT_FUNC_HASH(sceAtracStartEntry)
PSP_EXPORT_FUNC_HASH(sceAtracEndEntry)
PSP_EXPORT_FUNC_HASH(sceAtracGetMaxSample)
PSP_EXPORT_FUNC_HASH(sceAtracGetNextDecodePosition)
PSP_EXPORT_FUNC_HASH(sceAtracGetInternalErrorInfo)
PSP_EXPORT_FUNC_HASH(sceAtracIsSecondBufferNeeded)
PSP_EXPORT_FUNC_HASH(sceAtracGetLoopStatus)
PSP_EXPORT_END
PSP_END_EXPORTS

View File

@ -1,4 +1,4 @@
#include <common.h>
#include <common_imp.h>
#include <avcodec_audiocodec.h>
#include <usersystemlib_kernel.h>

12
src/loadexec/Makefile Normal file
View File

@ -0,0 +1,12 @@
# Copyright (C) 2011, 2012 The uOFW team
# See the file COPYING for copying permission.
TARGET = loadexec
OBJS = kl4e.o loadexec.o
#DEBUG = 1
LIBS =
include ../../lib/build.mak

739
src/loadexec/kl4e.S Normal file
View File

@ -0,0 +1,739 @@
#include "common.S"
decodeKL4E:
addiu $sp, $sp, -2680
sw $s2, 2664($sp)
addu $t4, $a0, $a1
addiu $t3, $a0, 0
sw $s1, 2660($sp)
li $t2, 6
addiu $a1, $sp, -2656
sw $s0, 2656($sp)
move $t9, $zr
li $t0, 1
sw $s3, 2668($sp)
li $s3, -1
sw $s4, 2672($sp)
addiu $s4, $t4, -64
ins $s4, $zr, 0, 6
lb $s0, 0($a2)
lwl $t1, 4($a2)
lwr $t1, 1($a2)
bltz $s0, loc_00000744
wsbw $t1, $t1
ext $at, $s0, 3, 2
sll $at, $at, 4
li $s1, 128
subu $at, $s1, $at
ins $at, $at, 8, 8
andi $s0, $s0, 0x7
ins $at, $at, 16, 16
loc_0000006C:
sw $at, 2656($a1)
addiu $a1, $a1, 8
bne $a1, $sp, loc_0000006C
sw $at, 2652($a1)
li $at, 255
loc_00000080:
ins $t9, $t3, 8, 3
srav $v1, $t9, $s0
andi $v1, $v1, 0x7
sll $t9, $v1, 8
subu $t8, $t9, $v1
addu $v1, $sp, $t8
li $t9, 1
loc_0000009C:
addu $t7, $v1, $t9
srl $t5, $s3, 24
beqz $t5, loc_000000EC
lbu $t6, -1($t7)
sll $t9, $t9, 1
srl $s2, $s3, 8
mult $s2, $t6
srl $s2, $t6, 3
subu $t6, $t6, $s2
mflo $t5
sltu $t8, $t1, $t5
beqz $t8, loc_00000120
srl $s2, $t9, 8
loc_000000D0:
mflo $s3
addiu $t6, $t6, 31
sb $t6, -1($t7)
beqz $s2, loc_0000009C
addiu $t9, $t9, 1
j loc_00000134
sb $t9, 0($t3)
loc_000000EC:
lbu $s2, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $s2
sll $t9, $t9, 1
mult $s3, $t6
sll $s3, $s3, 8
srl $s2, $t6, 3
subu $t6, $t6, $s2
mflo $t5
sltu $t8, $t1, $t5
bnez $t8, loc_000000D0
srl $s2, $t9, 8
loc_00000120:
sb $t6, -1($t7)
subu $t1, $t1, $t5
beqz $s2, loc_0000009C
subu $s3, $s3, $t5
sb $t9, 0($t3)
loc_00000134:
srl $s1, $s3, 24
lbu $t5, 2336($a1)
beqz $s1, loc_0000017C
srl $v1, $s3, 8
mult $v1, $t5
addiu $t3, $t3, 1
srl $v1, $t5, 4
mflo $s1
sltu $t6, $t1, $s1
bnez $t6, loc_000001AC
subu $t5, $t5, $v1
loc_00000160:
beq $t3, $t4, loc_000008E0
sb $t5, 2336($a1)
addiu $a1, $a1, -1
max $a1, $a1, $sp
subu $t1, $t1, $s1
j loc_00000080
subu $s3, $s3, $s1
loc_0000017C:
lbu $t8, 5($a2)
addiu $t3, $t3, 1
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $t8
mult $s3, $t5
sll $s3, $s3, 8
srl $v1, $t5, 4
mflo $s1
sltu $t6, $t1, $s1
beqz $t6, loc_00000160
subu $t5, $t5, $v1
loc_000001AC:
addiu $s3, $t5, 15
sb $s3, 2336($a1)
li $t8, -1
mflo $s3
loc_000001BC:
srl $t9, $s1, 24
beqz $t9, loc_00000750
lbu $t5, 2344($a1)
addiu $a1, $a1, 8
srl $s2, $s3, 8
mult $s2, $t5
srl $s2, $t5, 4
subu $t5, $t5, $s2
mflo $s1
sltu $t9, $t1, $s1
bnez $t9, loc_00000784
addiu $v1, $t5, 15
loc_000001EC:
subu $s3, $s3, $s1
subu $t1, $t1, $s1
sb $t5, 2336($a1)
bltz $t8, loc_000003A0
addu $t5, $sp, $t8
loc_00000200:
addiu $t9, $t8, -3
sllv $t6, $t3, $t8
sll $s1, $t8, 5
ins $s1, $t6, 3, 2
ins $s1, $a1, 0, 3
addu $s1, $sp, $s1
bltz $t9, loc_000002BC
li $t6, 1
lbu $s2, 2424($s1)
srl $v1, $s3, 24
beqz $v1, loc_00000858
srl $v0, $s3, 8
mult $v0, $s2
loc_00000234:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_000008A8
li $t6, 2
subu $t1, $t1, $v1
blez $t9, loc_000002B8
subu $s3, $s3, $v1
srl $v1, $s3, 24
beqz $v1, loc_000008C4
srl $v0, $s3, 8
loc_00000264:
mult $v0, $s2
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_00000874
sll $t6, $t6, 1
subu $t1, $t1, $v1
beq $t9, $t0, loc_000002B8
subu $s3, $s3, $v1
srl $v1, $s3, 24
beqz $v1, loc_00000890
sll $t6, $t6, 1
loc_00000298:
srl $s3, $s3, 1
loc_0000029C:
sltu $v0, $t1, $s3
subu $v1, $t1, $s3
addiu $t9, $t9, -1
movz $t1, $v1, $v0
addu $t6, $t6, $v0
bnel $t9, $t0, loc_00000298
sll $t6, $t6, 1
loc_000002B8:
sb $s2, 2424($s1)
loc_000002BC:
srl $v1, $s3, 24
addiu $a1, $sp, 7
lbu $s2, 2400($s1)
beqz $v1, loc_0000080C
srl $v0, $s3, 8
mult $v0, $s2
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_0000083C
sll $t6, $t6, 1
loc_000002EC:
sb $s2, 2400($s1)
subu $t1, $t1, $v1
blez $t8, loc_000003A4
subu $s3, $s3, $v1
lbu $s2, 2408($s1)
loc_00000300:
srl $v1, $s3, 24
beqz $v1, loc_000007F0
srl $v0, $s3, 8
mult $v0, $s2
loc_00000310:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_000007D4
sll $t6, $t6, 1
sb $s2, 2408($s1)
subu $t1, $t1, $v1
beq $t8, $t0, loc_00000370
subu $s3, $s3, $v1
lbu $s2, 2416($s1)
loc_0000033C:
srl $v1, $s3, 24
beqz $v1, loc_0000079C
srl $v0, $s3, 8
mult $v0, $s2
loc_0000034C:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_000007B8
sll $t6, $t6, 1
sb $s2, 2416($s1)
subu $t1, $t1, $v1
subu $s3, $s3, $v1
loc_00000370:
addiu $t5, $t5, 56
li $s2, 128
li $s1, 8
srl $v1, $s3, 24
bnez $v1, loc_000003B8
addu $t9, $t5, $s1
loc_00000388:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
j loc_000003B8
sll $s3, $s3, 8
loc_000003A0:
addiu $a1, $sp, 7
loc_000003A4:
li $s2, 64
li $s1, 8
loc_000003AC:
srl $v1, $s3, 24
beqz $v1, loc_00000388
addu $t9, $t5, $s1
loc_000003B8:
lbu $t8, 2033($t9)
srl $v0, $s3, 8
sll $s1, $s1, 1
mult $v0, $t8
srl $v0, $t8, 3
subu $t7, $t8, $v0
mflo $v1
sltu $t8, $t1, $v1
beqz $t8, loc_0000071C
subu $t8, $s1, $s2
mflo $s3
addiu $t7, $t7, 31
sb $t7, 2033($t9)
bltz $t8, loc_000003AC
addiu $s1, $s1, 8
loc_000003F4:
addu $s1, $sp, $t8
sra $t8, $t8, 3
lw $t5, 2216($s1)
addiu $t9, $t8, -3
bltz $t9, loc_000004A8
li $t7, 1
srl $v0, $s3, 24
beqz $v0, loc_00000694
ext $s2, $t5, 24, 8
srl $v0, $s3, 8
mult $v0, $s2
loc_00000420:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_000006E4
li $t7, 2
subu $t1, $t1, $v1
blez $t9, loc_000004A4
subu $s3, $s3, $v1
srl $v0, $s3, 24
beqz $v0, loc_00000700
srl $v0, $s3, 8
loc_00000450:
mult $v0, $s2
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_000006B0
sll $t7, $t7, 1
subu $t1, $t1, $v1
beq $t9, $t0, loc_000004A4
subu $s3, $s3, $v1
srl $v0, $s3, 24
beqz $v0, loc_000006CC
sll $t7, $t7, 1
loc_00000484:
srl $s3, $s3, 1
loc_00000488:
sltu $v0, $t1, $s3
subu $v1, $t1, $s3
addiu $t9, $t9, -1
movz $t1, $v1, $v0
addu $t7, $t7, $v0
bnel $t9, $t0, loc_00000484
sll $t7, $t7, 1
loc_000004A4:
ins $t5, $s2, 24, 8
loc_000004A8:
srl $v0, $s3, 24
beqz $v0, loc_00000678
ext $s2, $t5, 0, 8
srl $v0, $s3, 8
mult $v0, $s2
loc_000004BC:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_00000644
sll $t7, $t7, 1
ins $t5, $s2, 0, 8
subu $t1, $t1, $v1
blez $t8, loc_00000558
subu $s3, $s3, $v1
loc_000004E4:
srl $v0, $s3, 24
beqz $v0, loc_0000065C
ext $s2, $t5, 8, 8
srl $v0, $s3, 8
mult $v0, $s2
loc_000004F8:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_0000062C
sll $t7, $t7, 1
ins $t5, $s2, 8, 8
subu $t1, $t1, $v1
beq $t8, $t0, loc_00000558
subu $s3, $s3, $v1
loc_00000520:
srl $v0, $s3, 24
beqz $v0, loc_00000600
ext $s2, $t5, 16, 8
srl $v0, $s3, 8
mult $v0, $s2
loc_00000534:
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
bnez $v0, loc_0000061C
sll $t7, $t7, 1
ins $t5, $s2, 16, 8
subu $t1, $t1, $v1
subu $s3, $s3, $v1
loc_00000558:
addiu $t7, $t7, -1
loc_0000055C:
sw $t5, 2216($s1)
subu $t5, $t3, $a0
sltu $t9, $t7, $t5
beqz $t9, loc_00000744
addu $t6, $t3, $t6
subu $v1, $t3, $t7
loc_00000574:
sltu $t9, $t6, $t4
beqz $t9, loc_000008E0
lbu $t9, -1($v1)
ins $a1, $t6, 0, 1
sltu $s1, $t4, $s4
bnezl $s1, loc_000005AC
cache 0x18, 64($t3)
loc_00000590:
addiu $t3, $t3, 1
sb $t9, -1($t3)
addiu $v1, $v1, 1
bne $t3, $t6, loc_00000590
lbu $t9, -1($v1)
j loc_00000134
sb $t9, 0($t3)
loc_000005AC:
subu $s1, $t6, $t3
slti $s1, $s1, 4
bnez $s1, loc_00000590
subu $s1, $t3, $v1
slti $s1, $s1, 3
bnez $s1, loc_00000590
addiu $v0, $t3, 0
move $t3, $t6
ins $t6, $v0, 0, 2
loc_000005D0:
lwl $t9, 2($v1)
lwr $t9, -1($v1)
swl $t9, 3($v0)
swr $t9, 0($v0)
beq $t6, $v0, loc_000005F0
addiu $v1, $v1, 4
j loc_000005D0
addiu $v0, $v0, 4
loc_000005F0:
bne $t3, $t4, loc_00000134
lbu $t9, 0($t3)
j loc_000008E8
subu $v0, $t3, $a0
loc_00000600:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_00000534
sll $s3, $s3, 8
loc_0000061C:
addiu $s2, $s2, 31
ins $t5, $s2, 16, 8
j loc_0000055C
mflo $s3
loc_0000062C:
addiu $s2, $s2, 31
ins $t5, $s2, 8, 8
beq $t8, $t0, loc_0000055C
mflo $s3
j loc_00000520
addiu $t7, $t7, 1
loc_00000644:
addiu $s2, $s2, 31
ins $t5, $s2, 0, 8
blez $t8, loc_0000055C
mflo $s3
j loc_000004E4
addiu $t7, $t7, 1
loc_0000065C:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_000004F8
sll $s3, $s3, 8
loc_00000678:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_000004BC
sll $s3, $s3, 8
loc_00000694:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_00000420
sll $s3, $s3, 8
loc_000006B0:
mflo $s3
addiu $t7, $t7, 1
beq $t9, $t0, loc_000004A4
addiu $s2, $s2, 31
srl $v0, $s3, 24
bnez $v0, loc_00000484
sll $t7, $t7, 1
loc_000006CC:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
j loc_00000488
sll $s3, $s3, 7
loc_000006E4:
mflo $s3
li $t7, 3
blez $t9, loc_000004A4
addiu $s2, $s2, 31
srl $v0, $s3, 24
bnez $v0, loc_00000450
srl $v0, $s3, 8
loc_00000700:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
sll $s3, $s3, 8
j loc_00000450
srl $v0, $s3, 8
loc_0000071C:
subu $s3, $s3, $v1
subu $t1, $t1, $v1
bltz $t8, loc_000003AC
sb $t7, 2033($t9)
bnez $t8, loc_000003F4
addiu $t8, $t8, -8
move $v1, $t3
subu $t5, $t3, $a0
bnez $t5, loc_00000574
addu $t6, $t3, $t6
loc_00000744:
lui $v0, 0x8000
j loc_000008E8
ori $v0, $v0, 0x108
loc_00000750:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
addiu $a1, $a1, 8
mult $s3, $t5
sll $s3, $s1, 8
srl $s2, $t5, 4
mflo $s1
sltu $t9, $t1, $s1
beqz $t9, loc_000001EC
subu $t5, $t5, $s2
addiu $v1, $t5, 15
loc_00000784:
addiu $t8, $t8, 1
mflo $s3
bne $t8, $t2, loc_000001BC
sb $v1, 2336($a1)
j loc_00000200
addu $t5, $sp, $t8
loc_0000079C:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_0000034C
sll $s3, $s3, 8
loc_000007B8:
addiu $s2, $s2, 31
sb $s2, 2416($s1)
addiu $t6, $t6, 1
bne $t6, $at, loc_00000370
mflo $s3
j loc_000008E8
subu $v0, $t3, $a0
loc_000007D4:
addiu $s2, $s2, 31
sb $s2, 2408($s1)
addiu $t6, $t6, 1
beq $t8, $t0, loc_00000370
mflo $s3
j loc_0000033C
lbu $s2, 2416($s1)
loc_000007F0:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_00000310
sll $s3, $s3, 8
loc_0000080C:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
sll $s3, $s3, 8
srl $v0, $s2, 3
subu $s2, $s2, $v0
mflo $v1
sltu $v0, $t1, $v1
beqz $v0, loc_000002EC
sll $t6, $t6, 1
loc_0000083C:
addiu $s2, $s2, 31
sb $s2, 2400($s1)
mflo $s3
blez $t8, loc_00000370
addiu $t6, $t6, 1
j loc_00000300
lbu $s2, 2408($s1)
loc_00000858:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
mult $s3, $s2
j loc_00000234
sll $s3, $s3, 8
loc_00000874:
mflo $s3
addiu $t6, $t6, 1
beq $t9, $t0, loc_000002B8
addiu $s2, $s2, 31
srl $v1, $s3, 24
bnez $v1, loc_00000298
sll $t6, $t6, 1
loc_00000890:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
j loc_0000029C
sll $s3, $s3, 7
loc_000008A8:
mflo $s3
li $t6, 3
blez $t9, loc_000002B8
addiu $s2, $s2, 31
srl $v1, $s3, 24
bnez $v1, loc_00000264
srl $v0, $s3, 8
loc_000008C4:
lbu $v1, 5($a2)
sll $t1, $t1, 8
addiu $a2, $a2, 1
addu $t1, $t1, $v1
sll $s3, $s3, 8
j loc_00000264
srl $v0, $s3, 8
loc_000008E0:
lui $v0, 0x8000
ori $v0, $v0, 0x104
loc_000008E8:
beqz $a3, loc_000008F4
addiu $a2, $a2, 5
sw $a2, 0($a3)
loc_000008F4:
lw $s4, 2672($sp)
lw $s3, 2668($sp)
lw $s2, 2664($sp)
lw $s1, 2660($sp)
lw $s0, 2656($sp)
jr $ra
addiu $sp, $sp, 2680

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
/** Structure for LoadExecVSH* functions */
typedef struct
@ -89,794 +89,6 @@ int *g_unkCbInfo[4]; // 0xD400
//#define EXEC_START 0x3E80 // TODO: store new executable in an array and set this as the executable start & end
//#define EXEC_END 0xD350
// 0000
void decodeKL4E(char *dst, int size, char *src, int arg3)
{
char *end = dst + size;
char *curDst = dst;
char buf[2656];
char *curBuf = buf;
t9 = 0;
s3 = -1;
s4 = (end - 64) & 0xFFFFFFC0;
s0 = src[0];
t1 = *(int*)&src[1]; // unaligned reading
t1 = wsbw(t1);
if (s0 < 0)
{
// 744
if (arg3 != 0)
*arg3 = src + 5;
return 0x80000108;
}
at = 0x80 - (((s0 & 0x18) >> 2) << 4);
at = (at & 0xffff00ff) | ((at << 8) & 0xff00);
s0 = s0 & 7;
at = (at & 0x0000ffff) | ((at << 16) & 0xffff0000);
// 06C
int i;
for (i = 0; i < 664; i += 2) {
*((int*)curBuf)[i + 0] = at;
*((int*)curBuf)[i + 1] = at;
}
// 080
for (;;)
{
t9 = (t9 & 0xfffff8ff) | ((curDst << 8) & 0x700);
v1 = buf + ((t9 >> (s0 & 0x1F)) & 7) * 255;
t9 = 1;
// 09C
do
{
t7 = v1 + t9;
t6 = *(u8*)(t7 - 1);
if ((s3 >> 24) == 0)
{
// 0EC
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
t9 <<= 1;
lo = s3 * t6;
s3 <<= 8;
}
else
{
t9 <<= 1;
lo = (s3 >> 8) * t6;
}
t6 -= (t6 >> 3);
t5 = lo;
s2 = t9 >> 8;
if (t1 >= t5)
{
// 120
*(s8*)(t7 - 1) = t6;
t1 -= t5;
s3 -= t5;
}
else
{
// 0D0
s3 = lo;
*(s8*)(t7 - 1) = t6 + 31;
t9++;
}
} while (s2 == 0);
// 0D0 == 120
*(s8*)(curDst + 0) = t9;
// 134
for (;;)
{
t5 = curBuf[2336];
if ((s3 >> 24) == 0)
{
// 17C
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
lo = s3 * t5;
s3 <<= 8;
}
else
lo = (s3 >> 8) * t5;
curDst++;
s1 = lo;
t5 -= (t5 >> 4);
if (t1 < s1)
{
// 1AC
s3 = t5 + 15;
curBuf[2336] = s3;
t8 = -1;
s3 = lo;
// 1BC
int goto_3a4 = 0;
for (;;)
{
t5 = curBuf[2344];
if ((s1 >> 24) == 0)
{
// 750
t1 <<= 8;
t1 += *(u8*)(src + 5);
lo = s3 * t5;
s3 = s1 << 8;
src++;
}
else
lo = (s3 >> 8) * t5;
curBuf += 8;
t5 -= (t5 >> 4);
s1 = lo;
v1 = t5 + 15;
if (t1 < s1)
{
// 784
t8++;
s3 = lo;
curBuf[2336] = v1;
if (t8 == 6) {
t5 = buf + t8;
break;
}
// CONTINUE
}
else
{
// 1EC
s3 -= s1;
t1 -= s1;
curBuf[2336] = t5;
t5 = buf + t8;
if (t8 < 0) {
// 3A0
curBuf = buf + 7;
goto_3a4 = 1;
}
break;
}
}
if (!goto_3a4)
{
// 200
t9 = t8 - 3;
t6 = curDst << (t8 & 0x1f);
s1 = t8 << 5;
s1 = (s1 & 0xffffffe7) | ((t6 << 3) & 0x18);
s1 = (s1 & 0xfffffff8) | ((int)curBuf & 3);
s1 += buf;
t6 = 1;
if (t9 >= 0)
{
s2 = *(u8*)(s1 + 2424)
v1 = s3 >> 24;
v0 = s3 >> 8;
if (v1 == 0)
{
// 858
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = v0 * s2;
// 234
s2 -= (s2 >> 3);
v1 = lo;
t6 = 2;
if (t1 < v1)
{
// 8A8
s3 = lo;
t6 = 3;
s2 += 31;
}
else {
t1 -= v1;
s3 -= v1;
}
if (t9 > 0)
{
v1 = s3 >> 24;
if (v1 == 0)
{
// 8C4
v1 = *(u8*)(src + 5);
t1 <<= 8;
src++;
t1 += v1;
s3 <<= 8;
}
// 264
lo = (s3 >> 8) * s2;
s2 -= (s2 >> 3);
v1 = lo;
t6 <<= 1;
if (t1 < v1)
{
// 874
s3 = lo;
t6++;
s2 += 31;
}
else {
t1 -= v1;
s3 -= v1;
}
if (t9 != 1)
{
t6 <<= 1;
if ((s3 >> 24) == 0)
{
// 890
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
s3 <<= 7;
}
else
s3 >>= 1;
// 29C
for (;;)
{
t9--;
if (t1 >= s3)
t1 -= s3;
t6 += v0;
if (t9 == 1)
break;
t6 <<= 1;
s3 >>= 1;
}
}
}
}
else // 2B8
*(s8*)(s1 + 2424) = s2;
// 2BC
curBuf = buf + 7;
s2 = *(u8*)(s1 + 2400);
if ((s3 >> 24) == 0)
{
// 80C
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = (s3 >> 8) * s2;
s2 -= (s2 >> 3);
v1 = lo;
t6 <<= 1;
int stop = 0;
if (t1 < v1)
{
// 83C
s2 += 31;
*(s8*)(s1 + 2400) = s2;
s3 = lo;
t6++;
if (t8 <= 0)
stop = 1;
}
else
{
// 2EC
*(s8*)(s1 + 2400) = s2;
t1 -= v1;
s3 -= v1;
if (t8 <= 0)
goto_3a4 = 1;
}
if (!stop && !goto_3a4)
{
s2 = *(u8*)(s1 + 2408);
// 300
v1 = s3 >> 24;
v0 = s3 >> 8;
if (v1 == 0)
{
// 7F0
v1 = *(u8*)(src + 5);
t1 <<= 8;
src++;
t1 += v1;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = v0 * s2;
// 310
s2 -= (s2 >> 3);
v1 = lo;
t6 <<= 1;
if (t1 < v1)
{
// 7D4
s2 += 31;
*(s8*)(s1 + 2408) = s2;
t6++;
s3 = lo;
}
else
{
*(s8*)(s1 + 2408) = s2;
t1 -= v1;
s3 -= v1;
}
if (t8 != 1)
{
s2 = *(u8*)(s1 + 2416);
// 33C
v1 = s3 >> 24;
v0 = s3 >> 8;
if (v1 == 0)
{
// 79C
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = v0 * s2;
// 34C
v0 = s2 >> 3;
s2 -= v0;
v1 = lo;
t6 <<= 1;
if (t1 < v1)
{
// 7B8
s2 += 31;
*(s8*)(s1 + 2416) = s2;
t6++;
s3 = lo;
if (t6 == 0xFF) {
// END (8E8)
if (arg3 != 0)
*arg3 = src + 5;
// 8F4
return curDst - dst;
}
}
else
{
*(s8*)(s1 + 2416) = s2;
t1 -= v1;
s3 -= v1;
}
}
}
if (!goto_3a4)
{
// 370
t5 += 56;
s2 = 128;
s1 = 8;
goto_3ac = 1;
}
}
else
{
// 3A4
s2 = 64;
s1 = 8;
goto_3ac = 1;
}
if (goto_3ac)
{
// 3AC
for (;;)
{
v1 = s3 >> 24;
t9 = t5 + s1;
if (v1 == 0)
{
// 388
v1 = *(u8*)(src + 5);
t1 <<= 8;
src++;
t1 += v1;
s3 <<= 8;
}
// 3B8
t8 = *(u8*)(t9 + 2033);
s1 <<= 1;
lo = (s3 >> 8) * t8;
t7 = t8 - (t8 >> 3);
v1 = lo;
t8 = s1 - s2;
int goto_3f4 = 0;
int goto_574 = 0;
if (t1 >= v1)
{
// 71C
s3 -= v1;
t1 -= v1;
*(s8*)(t9 + 2033) = t7;
if (t8 >= 0)
{
t8 -= 8;
if (s1 == s2)
{
v1 = curDst;
t5 = curDst - dst;
t6 += curDst;
if (t5 != 0)
goto_574 = 1;
else
{
// 744
if (arg3 != 0)
*arg3 = src + 5;
return 0x80000108;
}
}
else
goto_3f4 = 1;
}
}
else
{
s3 = lo;
t7 += 31;
*(s8*)(t9 + 2033) = t7;
s1 += 8;
if (t8 >= 0)
goto_3f4 = 1;
}
if (goto_3f4)
{
// 3F4
s1 = buf + t8;
t8 = (s32)t8 >> 3;
t5 = *(s1 + 2216);
t9 = t8 - 3;
t7 = 1;
if (t9 >= 0)
{
s2 = (t5 & 0xff000000) >> 24;
if ((s3 >> 24) == 0)
{
// 694
v1 = *(u8*)(src + 5);
t1 <<= 8;
src++;
t1 += v1;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = (s3 >> 8) * s2;
// 420
s2 -= (s2 >> 3);
v1 = lo;
t7 = 2;
if (t1 < v1)
{
// 6E4
s3 = lo;
t7 = 3;
s2 += 31;
}
else {
t1 -= v1;
s3 -= v1;
}
if (t9 > 0)
{
if (s3 >> 24)
{
// 700
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
s3 <<= 8;
}
// 450
lo = (s3 >> 8) * s2;
s2 -= (s2 >> 3);
v1 = lo;
t7 <<= 1;
if (t1 < v1)
{
// 6B0
s3 = lo;
t7++;
s2 += 31;
}
else {
t1 -= v1;
s3 -= v1;
}
if (t9 != 1)
{
v0 = s3 >> 24;
t7 <<= 1;
if (v0 == 0)
{
// 6CC
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
s3 <<= 7;
}
else // 484
s3 >>= 1;
// 488
for (;;)
{
t9--;
if (t1 >= s3)
t1 -= s3;
t7 += v0;
if (t9 == 1)
break;
t7 <<= 1;
s3 >>= 1;
}
}
}
}
else {
// 4A4
t5 = (t5 & 0x00ffffff) | ((s2 << 24) & 0xff000000);
}
// 4A8
s2 = t5 & 0xff;
if ((s3 >> 24) == 0)
{
// 678
v1 = *(u8*)(src + 5);
t1 <<= 8;
src++;
t1 += v1;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = (s3 >> 8) * s2;
// 4BC
s2 -= (s2 >> 3);
v1 = lo;
t7 <<= 1;
int goto_55c = 0;
if (t1 < v1)
{
// 644
s2 += 31;
t5 = (t5 & 0xffffff00) | (s2 & 0x000000ff);
s3 = lo;
if (t8 <= 0)
goto_55c = 1;
else
t7++;
}
else
{
t5 = (t5 & 0xffffff00) | (s2 & 0xff);
t1 -= v1;
if (t8 <= 0) {
t7--;
goto_55c = 1;
}
else
s3 -= v1;
}
if (!goto_55c)
{
// 4E4
s2 = (t5 & 0xff00) >> 8;
if ((s3 >> 24) == 0)
{
// 65C
t1 <<= 8;
t1 += *(u8*)(src + 5);
src++;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = (s3 >> 8) * s2;
// 4F8
s2 -= (s2 >> 3);
v1 = lo;
t7 <<= 1;
if (t1 < v1)
{
// 62C
s2 += 31;
t5 = (t5 & 0xffff00ff) | ((s2 << 8) & 0x0000ff00);
s3 = lo;
if (t8 == 1)
goto_55c = 1;
else
t7++;
}
else
{
t5 = (t5 & 0xffff00ff) | ((s2 << 8) & 0x0000ff00);
t1 -= v1;
s3 -= v1;
if (t8 == 1) {
t7--;
goto_55c = 1;
}
}
if (!goto_55c)
{
// 520
s2 = (t5 & 0x00ff0000) >> 16;
if ((s3 >> 24) == 0)
{
// 600
v1 = *(u8*)(src + 5);
t1 <<= 8;
src++;
t1 += v1;
lo = s3 * s2;
s3 <<= 8;
}
else
lo = (s3 >> 8) * s2;
// 534
s2 -= (s2 >> 3);
v1 = lo;
t7 <<= 1;
if (t1 < v1)
{
// 61C
s2 += 31;
t5 = (t5 & 0xff00ffff) | ((s2 << 16) & 0x00ff0000);
s3 = lo;
}
else
{
t5 = (t5 & 0xff00ffff) | ((s2 << 16) & 0x00ff0000);
t1 -= v1;
s3 -= v1;
t7--;
}
}
}
// 55C
*(s1 + 2216) = t5;
t5 = curDst - dst;
t6 += curDst;
if (t7 >= t5)
{
// 744
if (arg3 != 0)
*arg3 = src + 5;
return 0x80000108;
}
v1 = curDst - t7;
}
else if (!goto_574)
continue;
break;
}
// 574
t9 = *(u8*)(v1 - 1);
if (t6 >= end)
{
// 8E0
if (arg3 != 0)
*arg3 = src + 5;
return 0x80000104;
}
curBuf = (char*)(int)((int)curBuf & 0xfffffffe) | (t6 & 1);
if (end < s4)
{
cache(0x18, curDst + 64);
// 5AC
s1 = curDst - v1;
if (t6 - curDst >= 4)
{
v0 = curDst;
if (s1 >= 3)
{
curDst = t6;
t6 = (t6 & 0xfffffffc) | (v0 & 3);
// 5D0
for (;;)
{
*(int*)v0 = *(int*)(v1 - 1); // unaligned R-W
v1 += 4;
if (t6 == v0)
{
// 5F0
t9 = *(u8*)curDst;
if (curDst != end)
break;
// END (8E8)
if (arg3 != 0)
*arg3 = src + 5;
return curDst - dst;
}
v0 += 4;
}
}
}
}
else
{
// 590
do
{
*(s8*)curDst = t9;
curDst++;
t9 = *(u8*)(v1);
v1++;
} while (curDst != t6)
*(s8*)t3 = t9;
}
continue; // 134
}
}
break;
}
// 160
curBuf[2336] = t5;
if (t3 != end)
{
curBuf--;
curBuf = pspMax((int)curBuf, (int)buf);
t1 -= s1;
s3 -= s1;
continue; // 080
}
else
{
if (arg3 != 0)
*arg3 = src + 5;
return 0x80000104;
}
}
}
int LoadExecForUser_362A956B()
{
int oldK1 = pspShiftK1();

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
static int g_0000C820;
static int g_0000C83C;

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
#include "lcdc.h"

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include "common.h"
#include <common_imp.h>
int sub_01B8(int flag, int enable)
{

View File

@ -12,7 +12,7 @@
/* TODO: Reverse the sceDdrdb_driver library functions in openpsid.prx.*/
#include "common.h"
#include <common_imp.h>
#include "openpsid_ddrdb.h"

View File

@ -7,7 +7,7 @@
#include <stdarg.h>
#include "common.h"
#include <common_imp.h>
#include "avcodec_audiocodec.h"
#include "interruptman.h"

View File

@ -5,7 +5,7 @@
#ifndef REBOOT_H
#define REBOOT_H
#include "common.h"
#include <common_imp.h>
typedef int (*Callback1)(int, int, int);
typedef int (*Callback2)(int, int);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include <common.h>
#include <common_imp.h>
#include <interruptman.h>
#include <lowio_gpio.h>

View File

@ -2,7 +2,7 @@
# See the file COPYING for copying permission.
TARGET = sysmem
OBJS = start.o debug.o sysevent.o suspend.o assert.o sysclib.o utils.o kdebug.o main.o
OBJS = start.o debug.o sysevent.o suspend.o assert.o sysclib.o utils.o kdebug.o main.o intr.o
include ../../lib/build.mak

View File

@ -1,4 +1,4 @@
#include "common.h"
#include <common_imp.h>
// 143FC
void (*g_assertHandler)(int);

View File

@ -116,7 +116,7 @@ PSP_EXPORT_FUNC_NID(sceKernelIsKindOf, 0xFFC63884)
PSP_EXPORT_END
PSP_EXPORT_START(SysMemUserForUser, 0x0011, 0x4000)
PSP_EXPORT_FUNC_NID(SysMemUserForUser_057E7380, 0x057E7380)
PSP_EXPORT_FUNC_NID(sceKernelSetCompiledSdkVersion401_402, 0x057E7380)
PSP_EXPORT_FUNC_HASH(sceKernelPrintf)
PSP_EXPORT_FUNC_NID(sceKernelSetCompiledSdkVersion603_605, 0x1B4217BC)
PSP_EXPORT_FUNC_HASH(sceKernelAllocPartitionMemory)
@ -222,7 +222,7 @@ PSP_EXPORT_FUNC_NID(UtilsForUser_004D4DEE, 0x004D4DEE)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMt19937UInt)
PSP_EXPORT_FUNC_NID(UtilsForUser_0939D45C, 0x0939D45C)
PSP_EXPORT_FUNC_NID(UtilsForUser_157A383A, 0x157A383A)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheReadTag)
PSP_EXPORT_FUNC_NID(sceKernelDcacheReadTagForUser, 0x16641D70)
PSP_EXPORT_FUNC_NID(UtilsForUser_1B0592A3, 0x1B0592A3)
PSP_EXPORT_FUNC_HASH(sceKernelLibcTime)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1BlockUpdate)
@ -234,7 +234,7 @@ PSP_EXPORT_FUNC_NID(UtilsForUser_3FD3D324, 0x3FD3D324)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheInvalidateRange)
PSP_EXPORT_FUNC_NID(UtilsForUser_485E430A, 0x485E430A)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheProbe)
PSP_EXPORT_FUNC_NID(UtilsForUser_515B4FAF, 0x515B4FAF)
PSP_EXPORT_FUNC_NID(sceKernelDcacheReadTagForUser, 0x515B4FAF)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1BlockResult)
PSP_EXPORT_FUNC_NID(UtilsForUser_5C7F2B1A, 0x5C7F2B1A)
PSP_EXPORT_FUNC_NID(UtilsForUser_601E43E6, 0x601E43E6)
@ -249,14 +249,14 @@ PSP_EXPORT_FUNC_HASH(sceKernelDcacheWritebackAll)
PSP_EXPORT_FUNC_NID(UtilsForUser_7C5DC253, 0x7C5DC253)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheProbe)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1Digest)
PSP_EXPORT_FUNC_NID(UtilsForUser_87E81561, 0x87E81561)
PSP_EXPORT_FUNC_HASH(sceKernelPutUserLog)
PSP_EXPORT_FUNC_HASH(sceKernelLibcClock)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheInvalidateAll)
PSP_EXPORT_FUNC_NID(sceKernelDcachePurgeRangeForUser, 0x99134C3F)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMd5BlockInit)
PSP_EXPORT_FUNC_NID(UtilsForUser_AF3766BB, 0xAF3766BB)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheWritebackInvalidateAll)
PSP_EXPORT_FUNC_NID(UtilsForUser_B83A1E76, 0xB83A1E76)
PSP_EXPORT_FUNC_NID(sceKernelDcachePurgeRangeForUser, 0xB83A1E76)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMd5BlockResult)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheInvalidateRange)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheInvalidateRange)
@ -265,18 +265,18 @@ PSP_EXPORT_FUNC_NID(UtilsForUser_DBBE9A46, 0xDBBE9A46)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMt19937Init)
PSP_EXPORT_FUNC_NID(UtilsForUser_F0155BCA, 0xF0155BCA)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1BlockInit)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheReadTag)
PSP_EXPORT_FUNC_NID(UtilsForUser_5C7F2B1A, 0xFB05FAD0)
PSP_EXPORT_END
PSP_EXPORT_START(UtilsForKernel, 0x0011, 0x0009)
PSP_EXPORT_FUNC_NID(UtilsForKernel_004D4DEE, 0x004D4DEE)
PSP_EXPORT_FUNC_NID(UtilsForUser_004D4DEE, 0x004D4DEE)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMt19937UInt)
PSP_EXPORT_FUNC_NID(UtilsForKernel_0939D45C, 0x0939D45C)
PSP_EXPORT_FUNC_NID(UtilsForUser_0939D45C, 0x0939D45C)
PSP_EXPORT_FUNC_HASH(sceKernelSetPTRIGMask)
PSP_EXPORT_FUNC_NID(UtilsForKernel_157A383A, 0x157A383A)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheReadTag)
PSP_EXPORT_FUNC_HASH(sceKernelSetGPIMask)
PSP_EXPORT_FUNC_NID(UtilsForKernel_1B0592A3, 0x1B0592A3)
PSP_EXPORT_FUNC_NID(UtilsForUser_1B0592A3, 0x1B0592A3)
PSP_EXPORT_FUNC_HASH(sceKernelRegisterRtcFunc)
PSP_EXPORT_FUNC_HASH(sceKernelGzipGetCompressedData)
PSP_EXPORT_FUNC_HASH(sceKernelLibcTime)
@ -287,27 +287,27 @@ PSP_EXPORT_FUNC_HASH(sceKernelGetGPI)
PSP_EXPORT_FUNC_HASH(sceKernelGetPTRIG)
PSP_EXPORT_FUNC_NID(UtilsForKernel_39FFB756, 0x39FFB756)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheWritebackRange)
PSP_EXPORT_FUNC_NID(UtilsForKernel_3FD3D324, 0x3FD3D324)
PSP_EXPORT_FUNC_NID(UtilsForUser_3FD3D324, 0x3FD3D324)
PSP_EXPORT_FUNC_HASH(sceKernelReleaseRtcFunc)
PSP_EXPORT_FUNC_NID(UtilsForKernel_43C9A8DB, 0x43C9A8DB)
PSP_EXPORT_FUNC_NID(UtilsForKernel_485E430A, 0x485E430A)
PSP_EXPORT_FUNC_NID(UtilsForUser_485E430A, 0x485E430A)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheProbe)
PSP_EXPORT_FUNC_NID(UtilsForKernel_515B4FAF, 0x515B4FAF)
PSP_EXPORT_FUNC_NID(sceKernelDcacheReadTag, 0x515B4FAF)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1BlockResult)
PSP_EXPORT_FUNC_NID(UtilsForKernel_5C7F2B1A, 0x5C7F2B1A)
PSP_EXPORT_FUNC_NID(UtilsForKernel_601E43E6, 0x601E43E6)
PSP_EXPORT_FUNC_NID(UtilsForUser_601E43E6, 0x601E43E6)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMd5BlockUpdate)
PSP_EXPORT_FUNC_HASH(sceKernelSetPTRIG)
PSP_EXPORT_FUNC_NID(UtilsForKernel_66463BEC, 0x66463BEC)
PSP_EXPORT_FUNC_HASH(sceKernelSetGPO)
PSP_EXPORT_FUNC_NID(UtilsForKernel_6C6887EE, 0x6C6887EE)
PSP_EXPORT_FUNC_HASH(sceKernelLibcGettimeofday)
PSP_EXPORT_FUNC_NID(UtilsForKernel_7333E539, 0x7333E539)
PSP_EXPORT_FUNC_NID(UtilsForKernel_740DF7F0, 0x740DF7F0)
PSP_EXPORT_FUNC_NID(UtilsForUser_7333E539, 0x7333E539)
PSP_EXPORT_FUNC_NID(UtilsForUser_740DF7F0, 0x740DF7F0)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheProbeRange)
PSP_EXPORT_FUNC_HASH(sceKernelGzipDecompress)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheWritebackAll)
PSP_EXPORT_FUNC_NID(UtilsForKernel_7C5DC253, 0x7C5DC253)
PSP_EXPORT_FUNC_NID(UtilsForUser_7C5DC253, 0x7C5DC253)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheProbe)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1Digest)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheInvalidateAll)
@ -323,25 +323,25 @@ PSP_EXPORT_FUNC_NID(UtilsForKernel_A6B0A6B8, 0xA6B0A6B8)
PSP_EXPORT_FUNC_NID(UtilsForKernel_AA9AF5CF, 0xAA9AF5CF)
PSP_EXPORT_FUNC_NID(UtilsForKernel_AF0C0173, 0xAF0C0173)
PSP_EXPORT_FUNC_HASH(sceKernelGetGPO)
PSP_EXPORT_FUNC_NID(UtilsForKernel_AF3766BB, 0xAF3766BB)
PSP_EXPORT_FUNC_NID(UtilsForUser_AF3766BB, 0xAF3766BB)
PSP_EXPORT_FUNC_HASH(sceKernelGzipGetInfo)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheWritebackInvalidateAll)
PSP_EXPORT_FUNC_NID(UtilsForKernel_B83A1E76, 0xB83A1E76)
PSP_EXPORT_FUNC_NID(sceKernelDcachePurgeRange, 0xB83A1E76)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMd5BlockResult)
PSP_EXPORT_FUNC_HASH(sceKernelRtcGetTick)
PSP_EXPORT_FUNC_HASH(sceKernelDcacheInvalidateRange)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheInvalidateRange)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMd5Digest)
PSP_EXPORT_FUNC_NID(UtilsForKernel_DBBE9A46, 0xDBBE9A46)
PSP_EXPORT_FUNC_NID(UtilsForUser_DBBE9A46, 0xDBBE9A46)
PSP_EXPORT_FUNC_HASH(sceKernelGzipIsValid)
PSP_EXPORT_FUNC_HASH(sceKernelGzipGetName)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsMt19937Init)
PSP_EXPORT_FUNC_HASH(sceKernelDeflateDecompress)
PSP_EXPORT_FUNC_NID(UtilsForKernel_EC86074D, 0xEC86074D)
PSP_EXPORT_FUNC_NID(UtilsForKernel_F0155BCA, 0xF0155BCA)
PSP_EXPORT_FUNC_NID(UtilsForUser_F0155BCA, 0xF0155BCA)
PSP_EXPORT_FUNC_NID(UtilsForKernel_F192F2EC, 0xF192F2EC)
PSP_EXPORT_FUNC_HASH(sceKernelUtilsSha1BlockInit)
PSP_EXPORT_FUNC_HASH(sceKernelIcacheReadTag)
PSP_EXPORT_FUNC_NID(UtilsForKernel_5C7F2B1A, 0xFB05FAD0)
PSP_EXPORT_END
PSP_EXPORT_START(KDebugForKernel, 0x0011, 0x0001)

View File

@ -1,6 +1,6 @@
#include <stdarg.h>
#include "common.h"
#include <common_imp.h>
// 13BC4
int (*g_kprintfHandler)(short*, const char*, va_list, int) = kprnt;
@ -9,7 +9,7 @@ void *g_kprintfParam = (void*)g_kprintfDefaultParam; // TODO: determine the size
// 13BCC
int g_putcharByBootloader = 1;
// 13BD0
int (*g_dbgEcho)();
int g_dbgEcho = 1;
// 14410
u32 g_dipsLo;
@ -637,7 +637,7 @@ int kprnt(short *arg0, const char *fmt, va_list ap, int userMode)
}
}
int KprintfForUser(const char *fmt, ...)
int KprintfForUser(const char *fmt, ...) __attribute__((alias("sceKernelPrintf")))
{
va_list ap;
int oldK1 = pspShiftK1();
@ -745,14 +745,14 @@ int sceKernelRegisterDebugRead(int (*func)())
return 0;
}
int (*sceKernelDebugEcho(void))()
int sceKernelDebugEcho(void)
{
return g_dbgEcho;
}
int (*sceKernelDebugEchoSet(int (*func)()))()
int sceKernelDebugEchoSet(int echo)
{
g_dbgEcho = func;
return func;
g_dbgEcho = echo;
return echo;
}

View File

@ -424,7 +424,7 @@ sceSuspendForKernel_B2C9640B:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_79D1C3FA:
sceKernelDcacheWritebackAll:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00000714
@ -489,7 +489,7 @@ loc_00000714:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_B435DEC5:
sceKernelDcacheWritebackInvalidateAll:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00000784
@ -525,7 +525,7 @@ loc_00000784:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForKernel_864A9D72:
sceKernelDcacheInvalidateAll:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00000804
@ -565,7 +565,7 @@ loc_00000804:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_3EE30821:
sceKernelDcacheWritebackRange:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_000008F0
@ -648,7 +648,7 @@ loc_000008F0:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_34B9FA9E:
sceKernelDcacheWritebackInvalidateRange:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_000009EC
@ -914,7 +914,7 @@ loc_00000C28:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_80001C4C:
sceKernelDcacheProbe:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00000CD0
@ -954,7 +954,7 @@ loc_00000CD0:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_16641D70:
sceKernelDcacheReadTagForUser:
mfic $t0, $0
mtic $zr, $0
cache 0x10, 0($a0)
@ -970,7 +970,7 @@ UtilsForUser_16641D70:
jr $ra
nop
UtilsForKernel_16641D70:
sceKernelDcacheReadTag:
mfic $t0, $0
mtic $zr, $0
cache 0x10, 0($a0)
@ -990,7 +990,7 @@ UtilsForKernel_16641D70:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_77DFF087:
sceKernelDcacheProbeRange:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00000E50
@ -1080,7 +1080,7 @@ loc_00000E50:
lui $ra, %hi(sub_1120)
addiu $ra, $ra, %lo(sub_1120)
UtilsForUser_920F104A:
sceKernelIcacheInvalidateAll:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00000EE8
@ -1211,7 +1211,7 @@ loc_00000FF8:
lui $t0, 0xA000
or $ra, $t0, $ra
UtilsForUser_4FD31C9D:
sceKernelIcacheProbe:
mfc0 $t8, $24
andi $t8, $t8, 0x1
bnez $t8, loc_00001098
@ -2234,7 +2234,7 @@ loc_00001DA0:
nop
nop
UtilsForUser_37FB5C42:
sceKernelGetGPI:
lui $v0, %hi(g_13B40)
lw $v0, %lo(g_13B40)($v0)
beqz $v0, loc_00001DD8
@ -2246,7 +2246,7 @@ loc_00001DD8:
jr $ra
move $v0, $zr
UtilsForUser_6AD345D7:
sceKernelSetGPO:
lui $v0, %hi(g_13B48)
lw $v0, %lo(g_13B48)($v0)
beqz $v0, loc_00001DD8
@ -2257,7 +2257,7 @@ UtilsForUser_6AD345D7:
jr $v0
and $a0, $a0, $v1
UtilsForKernel_AF3616C0:
sceKernelGetGPO:
lui $v0, %hi(g_13B48)
lw $v0, %lo(g_13B48)($v0)
beqz $v0, loc_00001DD8
@ -2265,7 +2265,7 @@ UtilsForKernel_AF3616C0:
jr $v0
move $a1, $zr
UtilsForKernel_193D4036:
sceKernelSetGPIMask:
lui $t0, %hi(g_13B44)
nor $t1, $zr, $a0
lw $v0, %lo(g_13B44)($t0)
@ -2274,7 +2274,7 @@ UtilsForKernel_193D4036:
jr $ra
sw $v0, %lo(g_13B44)($t0)
UtilsForKernel_95035FEF:
sceKernelSetGPOMask:
lui $t0, %hi(g_13B4C)
nor $t1, $zr, $a0
lw $v0, %lo(g_13B4C)($t0)
@ -2294,7 +2294,7 @@ UtilsForKernel_95035FEF:
nop
nop
UtilsForUser_6231A71D:
sceKernelSetPTRIG:
lui $v0, %hi(g_13B84)
lw $v0, %lo(g_13B84)($v0)
beqz $v0, loc_00001E9C
@ -2307,7 +2307,7 @@ loc_00001E9C:
jr $ra
move $v0, $zr
UtilsForUser_39F49610:
sceKernelGetPTRIG:
lui $v0, %hi(g_13B80)
lw $v0, %lo(g_13B80)($v0)
beqz $v0, loc_00001E9C
@ -2315,12 +2315,12 @@ UtilsForUser_39F49610:
jr $v0
nop
UtilsForKernel_136F2419:
sceKernelSetPTRIGMask:
lui $v0, %hi(g_13B88)
jr $ra
sw $a0, %lo(g_13B88)($v0)
UtilsForUser_87E81561:
sceKernelPutUserLog:
lui $v0, %hi(g_13BC0)
lw $v0, %lo(g_13BC0)($v0)
beqz $v0, loc_00001EE0
@ -2332,12 +2332,12 @@ loc_00001EE0:
jr $ra
move $v0, $zr
UtilsForKernel_92282A47:
sceKernelRegisterUserLogHandler:
lui $v0, %hi(g_13BC0)
jr $ra
sw $a0, %lo(g_13BC0)($v0)
UtilsForKernel_E8DB3CE6:
sceKernelDeflateDecompress:
addiu $sp, $sp, -1344
sw $s4, 1228($sp)
addu $a1, $a0, $a1

View File

@ -1,4 +1,4 @@
#include "common.h"
#include <common_imp.h>
typedef struct
{

View File

@ -1,6 +1,6 @@
#include <stdarg.h>
#include "common.h"
#include <common_imp.h>
#include "sysclib.h"
@ -876,6 +876,21 @@ int prnt(prnt_callback cb, void *ctx, const char *fmt, va_list args)
}
}
char *rindex(const char *s, char c)
{
const char *cur = s;
if (s == NULL)
return NULL;
while (*(cur++) != '\0')
;
// E22C
do
if (*(--cur) == c)
return cur;
while (s < cur);
return 0;
}
int sprintf(char *str, const char *format, ...)
{
va_list ap;

View File

@ -1,4 +1,4 @@
#include "common.h"
#include <common_imp.h>
// 140F0
SceSysEventHandler *g_sysEvHandlers;

View File

@ -1,4 +1,4 @@
#include "common.h"
#include <common_imp.h>
typedef struct {
u32 count;
@ -485,7 +485,7 @@ int sceKernelGzipDecompress(u8 *dest, u32 destSize, const u8 *src, u32 *unk)
return 0x80020001;
if (src[2] != 8)
return 0x80000004;
int ret = UtilsForKernel_E8DB3CE6(dest, destSize, buf, &unkPtr);
int ret = sceKernelDeflateDecompress(dest, destSize, buf, &unkPtr);
if (ret < 0)
return ret;
memcpy(unkBuf, unkPtr, 8);

View File

@ -2,7 +2,7 @@
See the file COPYING for copying permission.
*/
#include <common.h>
#include <common_imp.h>
#include <interruptman.h>
#include <sysmem_suspend_kernel.h>