mirror of
https://github.com/joel16/uofw.git
synced 2024-11-23 03:29:43 +00:00
Fixes in interruptman & libatrac3plus (both do not work yet), added some partial headers/exports/libraries
This commit is contained in:
parent
8f857b2a2b
commit
4c09030eab
@ -6,38 +6,48 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int unk0;
|
||||
int unk4;
|
||||
int err; // 8
|
||||
int edramAddr; // 12
|
||||
int neededMem; // 16
|
||||
int unk20;
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
s32 err; // 8
|
||||
s32 edramAddr; // 12
|
||||
s32 neededMem; // 16
|
||||
s32 unk20;
|
||||
void *inBuf; // 24
|
||||
int unk28;
|
||||
s32 unk28;
|
||||
void *outBuf; // 32
|
||||
int unk36;
|
||||
char unk40;
|
||||
char unk41;
|
||||
char unk42;
|
||||
char unk43;
|
||||
char unk44;
|
||||
char unk45;
|
||||
char unk46;
|
||||
char unk47;
|
||||
int unk48;
|
||||
int unk52;
|
||||
int unk56;
|
||||
int unk60;
|
||||
int unk64;
|
||||
int unk68;
|
||||
int unk72;
|
||||
int unk76;
|
||||
int unk80;
|
||||
int unk84;
|
||||
int unk88;
|
||||
int unk92;
|
||||
int unk96;
|
||||
int unk100;
|
||||
s32 unk36;
|
||||
s8 unk40;
|
||||
s8 unk41;
|
||||
s8 unk42;
|
||||
s8 unk43;
|
||||
s8 unk44;
|
||||
s8 unk45;
|
||||
s8 unk46;
|
||||
s8 unk47;
|
||||
s32 unk48;
|
||||
s32 unk52;
|
||||
s32 unk56;
|
||||
s32 unk60;
|
||||
s32 unk64;
|
||||
s32 unk68;
|
||||
s32 unk72;
|
||||
s32 unk76;
|
||||
s32 unk80;
|
||||
s32 unk84;
|
||||
s32 unk88;
|
||||
s32 unk92;
|
||||
s32 unk96;
|
||||
s32 unk100;
|
||||
void *allocMem; // 104
|
||||
} SceAudiocodecCodec;
|
||||
|
||||
s32 sceAudiocodecCheckNeedMem(SceAudiocodecCodec *info, s32 codec);
|
||||
s32 sceAudiocodecInit(SceAudiocodecCodec *info, s32 codec);
|
||||
s32 sceAudiocodec_3DD7EE1A(SceAudiocodecCodec *info, s32 codec);
|
||||
s32 sceAudiocodecDecode(SceAudiocodecCodec *info, s32 codec);
|
||||
s32 sceAudiocodecGetInfo(SceAudiocodecCodec *info, s32 codec);
|
||||
s32 sceAudiocodecAlcExtendParameter(SceAudiocodecCodec *info, s32 codec, s32 *sizeOut);
|
||||
s32 sceAudiocodecGetEDRAM(SceAudiocodecCodec *info, s32 codec);
|
||||
s32 sceAudiocodecReleaseEDRAM(SceAudiocodecCodec *info);
|
||||
|
||||
|
||||
|
@ -18,6 +18,13 @@ typedef struct {
|
||||
void *stub_end;
|
||||
} SceModuleInfo;
|
||||
|
||||
typedef struct {
|
||||
u32 unk0;
|
||||
u32 unk4;
|
||||
u32 unk8;
|
||||
u32 unk12;
|
||||
} SceThreadParameter;
|
||||
|
||||
extern char _gp[];
|
||||
|
||||
/* Module attributes. */
|
||||
@ -72,3 +79,9 @@ enum SceModuleInfoAttr {
|
||||
__lib_stub_top, __lib_stub_bottom \
|
||||
}
|
||||
|
||||
#define SCE_MODULE_START_THREAD_PARAMETER(unk1, unk2, unk3, unk4) \
|
||||
const SceThreadParameter module_start_thread_parameter = { unk1, unk2, unk3, unk4 };
|
||||
|
||||
#define SCE_MODULE_STOP_THREAD_PARAMETER(unk1, unk2, unk3, unk4) \
|
||||
const SceThreadParameter module_stop_thread_parameter = { unk1, unk2, unk3, unk4 };
|
||||
|
||||
|
@ -35,125 +35,131 @@ enum SceInterrupts {
|
||||
|
||||
typedef struct {
|
||||
// Handler address
|
||||
int handler; // 0
|
||||
s32 handler; // 0
|
||||
// GP of the module
|
||||
int gp; // 4
|
||||
s32 gp; // 4
|
||||
// Argument given by sceKernelRegisterSubIntrHandler
|
||||
int arg; // 8
|
||||
int u12, u16, u20;
|
||||
s32 arg; // 8
|
||||
s32 u12, u16, u20;
|
||||
// See disableCb
|
||||
int enableCb; // 24
|
||||
s32 enableCb; // 24
|
||||
// Pointer to the callback called by sceKernelDisableSubIntr(), that takes the same arguments as it
|
||||
int disableCb; // 28
|
||||
s32 disableCb; // 28
|
||||
// See disableCb
|
||||
int suspendCb; // 32
|
||||
s32 suspendCb; // 32
|
||||
// See disableCb
|
||||
int resumeCb; // 36
|
||||
s32 resumeCb; // 36
|
||||
// See disableCb
|
||||
int isOccuredCb; // 40
|
||||
int u44;
|
||||
s32 isOccuredCb; // 40
|
||||
s32 u44;
|
||||
// Some options
|
||||
int v48; // 48
|
||||
int u52, u56, u60;
|
||||
s32 v48; // 48
|
||||
s32 u52, u56, u60;
|
||||
} SubInterrupt; // Size: 64
|
||||
|
||||
typedef struct {
|
||||
int size; // 0
|
||||
int u4;
|
||||
s32 size; // 0
|
||||
s32 u4;
|
||||
// Callback called before setting sub interrupt, when registering
|
||||
int (*cbRegBefore)(int, int, void*, void*); // 8
|
||||
s32 (*cbRegBefore)(s32, s32, void*, void*); // 8
|
||||
// Callback called after
|
||||
int (*cbRegAfter)(int, int, void*, void*); // 12
|
||||
s32 (*cbRegAfter)(s32, s32, void*, void*); // 12
|
||||
// Callback called before resetting handler to 0
|
||||
int (*cbRelBefore)(int, int); // 16
|
||||
s32 (*cbRelBefore)(s32, s32); // 16
|
||||
// Callback called after
|
||||
int (*cbRelAfter)(int, int); // 20
|
||||
int (*cbEnable)(int, int); // 24
|
||||
int (*cbDisable)(int, int); // 28
|
||||
int (*cbSuspend)(int, int, int*); // 32
|
||||
int (*cbResume)(int, int, int); // 36
|
||||
int (*cbIsOccured)(int, int); // 40
|
||||
s32 (*cbRelAfter)(s32, s32); // 20
|
||||
s32 (*cbEnable)(s32, s32); // 24
|
||||
s32 (*cbDisable)(s32, s32); // 28
|
||||
s32 (*cbSuspend)(s32, s32, s32*); // 32
|
||||
s32 (*cbResume)(s32, s32, s32); // 36
|
||||
s32 (*cbIsOccured)(s32, s32); // 40
|
||||
} SceIntrCb; // Size: 44
|
||||
|
||||
// Arg4 in sceKernelRegisterIntrHandler()
|
||||
typedef struct {
|
||||
// Handler address, sometimes OR'ed with 2 ?!?
|
||||
int handler; // 0
|
||||
s32 handler; // 0
|
||||
// GP of the module
|
||||
int gp; // 4
|
||||
s32 gp; // 4
|
||||
// Argument given by sceKernelRegisterIntrHandler
|
||||
int arg; // 8
|
||||
int u12, u16, u20, u24, u28, u32, u36;
|
||||
void *arg; // 8
|
||||
s32 u12, u16, u20, u24, u28, u32, u36;
|
||||
// Pointer to sub interrupts
|
||||
SubInterrupt *subIntrs; // 40
|
||||
// Some value set by sceKernelRegisterIntrHandler, using arg4 SubIntrInfo.callbacks, contains some handlers ran by sceKernelRegisterSubIntrHandler
|
||||
SceIntrCb *cb; // 44
|
||||
// InterruptManagerForKernel_D01EAA3F changes a bit depending on arg1, sceKernelRegisterIntrHandler changes some also; lower byte is the max number of sub interrupts
|
||||
int v48; // 48
|
||||
int u52, u56, u60;
|
||||
s32 v48; // 48
|
||||
s32 u52, u56, u60;
|
||||
} Interrupt; // Size: 64
|
||||
|
||||
typedef struct {
|
||||
int size; // must be 12
|
||||
int numSubIntrs; // 4
|
||||
s32 size; // must be 12
|
||||
s32 numSubIntrs; // 4
|
||||
SceIntrCb *callbacks; // 8
|
||||
} SubIntrInfo; // Size: 12
|
||||
|
||||
typedef struct {
|
||||
int size;
|
||||
int attr;
|
||||
s32 size;
|
||||
s32 attr;
|
||||
void *cb;
|
||||
} SceIntrHandler;
|
||||
|
||||
typedef struct CbMap {
|
||||
struct CbMap *next;
|
||||
int unk1, unk2, unk3;
|
||||
void (*callbacks[64])(void);
|
||||
} CbMap;
|
||||
typedef struct SceSyscallTable {
|
||||
struct SceSyscallTable *next;
|
||||
s32 seed;
|
||||
/** Size of the structure (including the syscalls array). */
|
||||
s32 tableSize;
|
||||
/** Size of the syscalls array. */
|
||||
s32 funcTableSize;
|
||||
/** Variable-size array containing a list of syscalls. */
|
||||
void (*syscalls[])(void);
|
||||
} SceSyscallTable;
|
||||
|
||||
typedef int (*MonitorCb)(int intrNum, int subIntrNum, int, int, int, int, char);
|
||||
typedef s32 (*MonitorCb)(s32 intrNum, s32 subIntrNum, s32, s32, s32, s32, s8);
|
||||
|
||||
int sceKernelRegisterIntrHandler(int intrNum, int arg1, void *func, void *arg3, SceIntrHandler *handler);
|
||||
int sceKernelSetUserModeIntrHanlerAcceptable(int intrNum, int subIntrNum, int setBit);
|
||||
int sceKernelReleaseIntrHandler(int intrNum);
|
||||
int sceKernelSetIntrLevel(int intrNum, int num);
|
||||
int sceKernelSetIntrLogging(int intrNum, int arg1);
|
||||
int sceKernelEnableIntr(int intNum);
|
||||
int sceKernelSuspendIntr(int arg0, int arg1);
|
||||
int sceKernelResumeIntr(int intrNum, int arg1);
|
||||
s32 sceKernelRegisterIntrHandler(s32 intrNum, s32 arg1, void *func, void *arg3, SceIntrHandler *handler);
|
||||
s32 sceKernelSetUserModeIntrHanlerAcceptable(s32 intrNum, s32 subIntrNum, s32 setBit);
|
||||
s32 sceKernelReleaseIntrHandler(s32 intrNum);
|
||||
s32 sceKernelSetIntrLevel(s32 intrNum, s32 num);
|
||||
s32 sceKernelSetIntrLogging(s32 intrNum, s32 arg1);
|
||||
s32 sceKernelEnableIntr(s32 intNum);
|
||||
s32 sceKernelSuspendIntr(s32 arg0, s32 *arg1);
|
||||
s32 sceKernelResumeIntr(s32 intrNum, s32 arg1);
|
||||
void ReleaseContextHooks();
|
||||
void InterruptManagerForKernel_E790EAED(int (*arg0)(), int (*arg1)());
|
||||
int sceKernelCallSubIntrHandler(int intrNum, int subIntrNum, int arg2, int arg3);
|
||||
int sceKernelGetUserIntrStack();
|
||||
int sceKernelRegisterSubIntrHandler(int intrNum, int subIntrNum, void *handler, void *arg);
|
||||
int sceKernelReleaseSubIntrHandler(int intrNum, int subIntrNum);
|
||||
int sceKernelEnableSubIntr(int intrNum, int subIntrNum);
|
||||
int sceKernelDisableSubIntr(int intrNum, int subIntrNum);
|
||||
int sceKernelSuspendSubIntr(int intrNum, int subIntrNum, int *arg2);
|
||||
int sceKernelResumeSubIntr(int intrNum, int subIntrNum, int arg2);
|
||||
int sceKernelIsSubInterruptOccured(int intrNum, int subIntrNum);
|
||||
int sceKernelQueryIntrHandlerInfo(int intrNum, int subIntrNum, int out);
|
||||
int sceKernelSetPrimarySyscallHandler(int arg0, void (*arg1)());
|
||||
void InterruptManagerForKernel_E790EAED(s32 (*arg0)(), s32 (*arg1)());
|
||||
s32 sceKernelCallSubIntrHandler(s32 intrNum, s32 subIntrNum, s32 arg2, s32 arg3);
|
||||
s32 sceKernelGetUserIntrStack();
|
||||
s32 sceKernelRegisterSubIntrHandler(s32 intrNum, s32 subIntrNum, void *handler, void *arg);
|
||||
s32 sceKernelReleaseSubIntrHandler(s32 intrNum, s32 subIntrNum);
|
||||
s32 sceKernelEnableSubIntr(s32 intrNum, s32 subIntrNum);
|
||||
s32 sceKernelDisableSubIntr(s32 intrNum, s32 subIntrNum);
|
||||
s32 sceKernelSuspendSubIntr(s32 intrNum, s32 subIntrNum, s32 *arg2);
|
||||
s32 sceKernelResumeSubIntr(s32 intrNum, s32 subIntrNum, s32 arg2);
|
||||
s32 sceKernelIsSubInterruptOccured(s32 intrNum, s32 subIntrNum);
|
||||
s32 sceKernelQueryIntrHandlerInfo(s32 intrNum, s32 subIntrNum, s32 out);
|
||||
s32 sceKernelSetPrimarySyscallHandler(s32 arg0, void (*arg1)());
|
||||
void sceKernelCpuEnableIntr();
|
||||
int InterruptManagerForKernel_6FCBA912(int set);
|
||||
int sceKernelClearIntrLogging(int intrNum);
|
||||
int sceKernelIsInterruptOccurred(int intrNum);
|
||||
int sceKernelDisableIntr(int intrNum);
|
||||
s32 InterruptManagerForKernel_6FCBA912(s32 set);
|
||||
s32 sceKernelClearIntrLogging(s32 intrNum);
|
||||
s32 sceKernelIsInterruptOccurred(s32 intrNum);
|
||||
s32 sceKernelDisableIntr(s32 intrNum);
|
||||
void RegisterSubIntrruptMonitor(MonitorCb before, MonitorCb after);
|
||||
void ReleaseSubIntrruptMonitor();
|
||||
int UnSupportIntr(int intrNum);
|
||||
int InterruptManagerForKernel_8DFBD787();
|
||||
int QueryIntrHandlerInfoForUser();
|
||||
int sceKernelRegisterUserSpaceIntrStack(int addr, int size, int arg2);
|
||||
int sceKernelGetCpuClockCounter();
|
||||
s32 UnSupportIntr(s32 intrNum);
|
||||
s32 InterruptManagerForKernel_8DFBD787();
|
||||
s32 QueryIntrHandlerInfoForUser();
|
||||
s32 sceKernelRegisterUserSpaceIntrStack(s32 addr, s32 size, s32 arg2);
|
||||
s32 sceKernelGetCpuClockCounter();
|
||||
u64 sceKernelGetCpuClockCounterWide();
|
||||
u32 _sceKernelGetCpuClockCounterLow();
|
||||
int sceKernelRegisterSystemCallTable(CbMap *newMap);
|
||||
int sceKernelQuerySystemCall(int (*arg)());
|
||||
void InterruptManagerForKernel_E526B767(int arg);
|
||||
int sceKernelGetSyscallRA(void);
|
||||
int sceKernelCpuSuspendIntr(void);
|
||||
void sceKernelCpuResumeIntr(int intr);
|
||||
void sceKernelCpuResumeIntrWithSync(int intr);
|
||||
int sceKernelIsIntrContext(void);
|
||||
s32 sceKernelRegisterSystemCallTable(SceSyscallTable *newMap);
|
||||
s32 sceKernelQuerySystemCall(void (*sysc)());
|
||||
void InterruptManagerForKernel_E526B767(s32 arg);
|
||||
s32 sceKernelGetSyscallRA(void);
|
||||
s32 sceKernelCpuSuspendIntr(void);
|
||||
void sceKernelCpuResumeIntr(s32 intr);
|
||||
void sceKernelCpuResumeIntrWithSync(s32 intr);
|
||||
s32 sceKernelIsIntrContext(void);
|
||||
int sceKernelCallUserIntrHandler(int, int, int, int, int, int);
|
||||
|
||||
|
20
include/loadcore.h
Normal file
20
include/loadcore.h
Normal file
@ -0,0 +1,20 @@
|
||||
/* Copyright (C) 2011, 2012 The uOFW team
|
||||
See the file COPYING for copying permission.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
s8 *libName; //0
|
||||
u8 version[2]; //4
|
||||
u16 attribute; //6
|
||||
u8 len; //8
|
||||
u8 vstubcount; //9
|
||||
u8 stubcount; //10
|
||||
void *entryTable; //12
|
||||
u16 unk16; //16
|
||||
u8 unk18; //18
|
||||
u8 unk19; //19
|
||||
} SceLibraryEntryTable;
|
||||
|
||||
int sceKernelRegisterLibrary(SceLibraryEntryTable *lib);
|
||||
int sceKernelGetModuleGPByAddressForKernel(void *addr);
|
||||
|
@ -1431,9 +1431,9 @@ s32 sceSysconBatteryGetChargeTime(s32 *time);
|
||||
s32 sceSysconCtrlTachyonVoltage(s32 voltage);
|
||||
|
||||
/**
|
||||
* Get the digital key (?).
|
||||
* Get the pressed user keys.
|
||||
*
|
||||
* @param key Pointer to a 2-byte buffer where the digital key will be stored.
|
||||
* @param key Pointer to a 2-byte buffer where the pressed user keys will be stored.
|
||||
*
|
||||
* @return 0 on success.
|
||||
*/
|
||||
|
15
include/usersystemlib_kernel.h
Normal file
15
include/usersystemlib_kernel.h
Normal file
@ -0,0 +1,15 @@
|
||||
/* Copyright (C) 2011, 2012 The uOFW team
|
||||
See the file COPYING for copying permission.
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
s32 sceKernelCpuSuspendIntr(void);
|
||||
void sceKernelCpuResumeIntr(s32 intr);
|
||||
void sceKernelCpuResumeIntrWithSync(s32 intr);
|
||||
s32 sceKernelIsCpuIntrSuspended(s32 intr);
|
||||
s32 sceKernelIsCpuIntrEnable(void);
|
||||
|
||||
void *sceKernelMemcpy(void *dst, const void *src, u32 n);
|
||||
void *sceKernelMemset(void *s, s32 c, u32 n);
|
||||
|
@ -4,7 +4,7 @@
|
||||
include ../../lib/common.mak
|
||||
|
||||
PSPSDK = $(shell psp-config --pspsdk-path)
|
||||
CFLAGS := -I../../include -O1 -fno-toplevel-reorder -G0 -Wall -Wextra -Werror -fno-builtin-bcopy -fno-builtin-bzero -fno-builtin-strchr -nostdlib -I$(PSPSDK)/include
|
||||
CFLAGS := -I../../include -O1 -fno-toplevel-reorder -G0 -Wall -Wextra -Werror -fno-builtin-bcopy -fno-builtin-bzero -fno-builtin-strchr -fno-builtin-printf -fno-builtin-puts -fno-builtin-putchar -nostdlib -I$(PSPSDK)/include
|
||||
CFLAGS_S := -I../../include/common
|
||||
LDFLAGS := -L../../lib -specs=../../lib/prxspecs -Wl,-q,-T../../lib/linkfile.prx -L$(PSPSDK)/lib
|
||||
|
||||
|
BIN
lib/libExceptionManagerForKernel.a
Normal file
BIN
lib/libExceptionManagerForKernel.a
Normal file
Binary file not shown.
BIN
lib/libKernel_Library.a
Normal file
BIN
lib/libKernel_Library.a
Normal file
Binary file not shown.
BIN
lib/libLoadCoreForKernel.a
Normal file
BIN
lib/libLoadCoreForKernel.a
Normal file
Binary file not shown.
BIN
lib/libdebug.a
BIN
lib/libdebug.a
Binary file not shown.
BIN
lib/libsceAudiocodec.a
Normal file
BIN
lib/libsceAudiocodec.a
Normal file
Binary file not shown.
BIN
lib/libsceAvcodec_driver.a
Normal file
BIN
lib/libsceAvcodec_driver.a
Normal file
Binary file not shown.
BIN
lib/libsceGe_lazy.a
Normal file
BIN
lib/libsceGe_lazy.a
Normal file
Binary file not shown.
BIN
lib/libsceJpeg.a
Normal file
BIN
lib/libsceJpeg.a
Normal file
Binary file not shown.
BIN
lib/libsceMpegbase.a
Normal file
BIN
lib/libsceMpegbase.a
Normal file
Binary file not shown.
BIN
lib/libsceMpegbase_driver.a
Normal file
BIN
lib/libsceMpegbase_driver.a
Normal file
Binary file not shown.
BIN
lib/libsceVideocodec.a
Normal file
BIN
lib/libsceVideocodec.a
Normal file
Binary file not shown.
@ -4,6 +4,8 @@
|
||||
TARGET = audio
|
||||
OBJS = audio.o
|
||||
|
||||
DEBUG = 1
|
||||
|
||||
LIBS = -lsceCodec_driver -lInterruptManagerForKernel -lSysclibForKernel -lThreadManForKernel -lsceSysEventForKernel -lSysMemForKernel -lDmacManForKernel -lsceDdr_driver -lsceSysreg_driver -lsceClockgen_driver -lUtilsForKernel
|
||||
|
||||
include ../../lib/build.mak
|
||||
|
@ -2,21 +2,21 @@
|
||||
See the file COPYING for copying permission.
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include <common.h>
|
||||
|
||||
#include "clockgen.h"
|
||||
#include "codec.h"
|
||||
#include "dmacman.h"
|
||||
#include "interruptman.h"
|
||||
#include "lowio_ddr.h"
|
||||
#include "lowio_sysreg.h"
|
||||
#include "sysmem_kernel.h"
|
||||
#include "sysmem_sysclib.h"
|
||||
#include "sysmem_sysevent.h"
|
||||
#include "sysmem_utils_kernel.h"
|
||||
#include "threadman_kernel.h"
|
||||
#include <clockgen.h>
|
||||
#include <codec.h>
|
||||
#include <dmacman.h>
|
||||
#include <interruptman.h>
|
||||
#include <lowio_ddr.h>
|
||||
#include <lowio_sysreg.h>
|
||||
#include <sysmem_kernel.h>
|
||||
#include <sysmem_sysclib.h>
|
||||
#include <sysmem_sysevent.h>
|
||||
#include <sysmem_utils_kernel.h>
|
||||
#include <threadman_kernel.h>
|
||||
|
||||
#include "audio.h"
|
||||
#include <audio.h>
|
||||
|
||||
asm(".set noat"); // needed for AUDIO_SET_BUSY()
|
||||
|
||||
@ -94,7 +94,7 @@ void audioHwInit();
|
||||
int audioOutputDmaCb(int unused, int arg1);
|
||||
int audioOutput(SceAudioChannel *channel, short leftVol, short rightVol, void *buf);
|
||||
int audioIntrHandler();
|
||||
int audioEventHandler(int ev_id, char* ev_name, void* param, int* result);
|
||||
s32 audioEventHandler(s32 ev_id, s8* ev_name __attribute__((unused)), void* param, s32* result);
|
||||
int audioSRCOutput(int vol, void *buf);
|
||||
int audioSRCOutputDmaCb(int arg0, int arg1);
|
||||
int audioInputSetup();
|
||||
@ -104,8 +104,7 @@ int audioInputThread();
|
||||
int audioInputDmaCb(int arg0, int arg1);
|
||||
|
||||
SceAudio g_audio;
|
||||
char g_audioEventName[] = "SceAudio";
|
||||
SceSysEventHandler g_audioEvent = {0x40, g_audioEventName, 0x00FFFF00, audioEventHandler, 0, 0, NULL, {0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
SceSysEventHandler g_audioEvent = {0x40, (s8*)"SceAudio", 0x00FFFF00, audioEventHandler, 0, 0, NULL, {0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
// 0000
|
||||
/*
|
||||
@ -125,23 +124,23 @@ void updateAudioBuf(int arg)
|
||||
}
|
||||
// 0038
|
||||
int v2 = v | g_audio.flags;
|
||||
*(int*)(0xBE000004) = (int)(char)(v2 & 0xFF) ^ v;
|
||||
HW(0xBE000004) = (int)(char)(v2 & 0xFF) ^ v;
|
||||
g_audio.flags = v2;
|
||||
// 0054
|
||||
while ((LW(0xBE00000C) & v) != 0)
|
||||
while ((HW(0xBE00000C) & v) != 0)
|
||||
;
|
||||
sceKernelDmaOpQuit(g_audio.dmaPtr[0]);
|
||||
*(int*)(0xBE000008) = v ^ 7;
|
||||
*(int*)(0xBE00002C) = v;
|
||||
*(int*)(0xBE000020) = v;
|
||||
HW(0xBE000008) = v ^ 7;
|
||||
HW(0xBE00002C) = v;
|
||||
HW(0xBE000020) = v;
|
||||
v <<= 4;
|
||||
// 00A0
|
||||
int i;
|
||||
for (i = 0; i < 24; i++)
|
||||
{
|
||||
while ((LW(0xBE000028) & v) == 0)
|
||||
while ((HW(0xBE000028) & v) == 0)
|
||||
;
|
||||
*(int*)(0xBE000060 + (arg << 4)) = 0;
|
||||
HW(0xBE000060 + (arg << 4)) = 0;
|
||||
}
|
||||
if (sceKernelDmaOpAssign(g_audio.dmaPtr[arg], 0xFF, 0xFF, (arg * 64 + 320) | 0x0100C801, 0) == 0)
|
||||
{
|
||||
@ -161,10 +160,10 @@ void updateAudioBuf(int arg)
|
||||
}
|
||||
// 0180
|
||||
// 0184
|
||||
*(int*)(0xBE000008) = 7;
|
||||
*(int*)(0xBE000004) = (int)g_audio.flags;
|
||||
*(int*)(0xBE000010) = g_audio.flags & 3;
|
||||
*(int*)(0xBE000024) = (int)g_audio.flags;
|
||||
HW(0xBE000008) = 7;
|
||||
HW(0xBE000004) = (int)g_audio.flags;
|
||||
HW(0xBE000010) = g_audio.flags & 3;
|
||||
HW(0xBE000024) = (int)g_audio.flags;
|
||||
pspSync();
|
||||
}
|
||||
|
||||
@ -177,7 +176,7 @@ int dmaUpdate(int arg)
|
||||
{
|
||||
dbg_printf("Running %s\n", __FUNCTION__);
|
||||
char v = g_audio.flags & ~(1 << (arg & 0x1F));
|
||||
*(int*)(0xBE000004) = v;
|
||||
HW(0xBE000004) = v;
|
||||
g_audio.flags = v;
|
||||
sceKernelDmaOpQuit(g_audio.dmaPtr[arg]);
|
||||
sceKernelDmaOpDeQueue(g_audio.dmaPtr[arg]);
|
||||
@ -186,7 +185,7 @@ int dmaUpdate(int arg)
|
||||
// 0298
|
||||
g_audio.inputInited = 0;
|
||||
// 029C
|
||||
while ((LW(0xBE00000C) & 4) != 0)
|
||||
while ((HW(0xBE00000C) & 4) != 0)
|
||||
;
|
||||
}
|
||||
// 025C
|
||||
@ -835,14 +834,14 @@ int sceAudioSetFrequency(int freq)
|
||||
int oldIntr = sceKernelCpuSuspendIntr();
|
||||
AUDIO_SET_BUSY(1);
|
||||
g_audio.freq = freq;
|
||||
*(int*)(0xBE000004) = 0;
|
||||
HW(0xBE000004) = 0;
|
||||
// 149C
|
||||
while (LW(0xBE00000C) != 0)
|
||||
while (HW(0xBE00000C) != 0)
|
||||
;
|
||||
*(int*)(0xBE000040) = 1;
|
||||
*(int*)(0xBE000038) = hwFreq;
|
||||
*(int*)(0xBE00003C) = hwFreq;
|
||||
*(int*)(0xBE000004) = g_audio.flags;
|
||||
HW(0xBE000040) = 1;
|
||||
HW(0xBE000038) = hwFreq;
|
||||
HW(0xBE00003C) = hwFreq;
|
||||
HW(0xBE000004) = g_audio.flags;
|
||||
if (g_audio.flags == 0)
|
||||
AUDIO_SET_BUSY(0);
|
||||
// 14D0
|
||||
@ -854,9 +853,7 @@ int sceAudioSetFrequency(int freq)
|
||||
|
||||
int sceAudioInit()
|
||||
{
|
||||
//dbg_init(1, FB_AFTER_DISPLAY, FAT_AFTER_FATMS);
|
||||
//dbg_init(1, FB_NONE, FAT_AFTER_FATMS);
|
||||
dbg_init(1, FB_NONE, FAT_AFTER_FATMS);
|
||||
dbg_init(1, FB_NONE, FAT_AFTER_SYSCON);
|
||||
dbg_printf("Running %s\n", __FUNCTION__);
|
||||
memset(&g_audio, 0, sizeof(g_audio));
|
||||
// 1558
|
||||
@ -934,12 +931,12 @@ int sceAudioLoopbackTest(int arg0)
|
||||
g_audio.flags = 7;
|
||||
AUDIO_SET_BUSY(1);
|
||||
sceCodec_driver_376399B6(1);
|
||||
*(int*)(0xBE000004) = 7;
|
||||
*(int*)(0xBE00002C) = 7;
|
||||
*(int*)(0xBE000010) = 4;
|
||||
*(int*)(0xBE000008) = 0;
|
||||
*(int*)(0xBE000020) = 7;
|
||||
*(int*)(0xBE000024) = 0;
|
||||
HW(0xBE000004) = 7;
|
||||
HW(0xBE00002C) = 7;
|
||||
HW(0xBE000010) = 4;
|
||||
HW(0xBE000008) = 0;
|
||||
HW(0xBE000020) = 7;
|
||||
HW(0xBE000024) = 0;
|
||||
sceKernelCpuResumeIntrWithSync(oldIntr);
|
||||
}
|
||||
return 0;
|
||||
@ -993,7 +990,7 @@ int audioIntrHandler()
|
||||
dbg_printf("Running %s\n", __FUNCTION__);
|
||||
int oldIntr = sceKernelCpuSuspendIntr();
|
||||
char attr = g_audio.flags;
|
||||
char hwAttr = LW(0xBE00001C) & attr;
|
||||
char hwAttr = HW(0xBE00001C) & attr;
|
||||
if (hwAttr != 0)
|
||||
{
|
||||
// 1A00
|
||||
@ -1027,7 +1024,7 @@ int audioIntrHandler()
|
||||
g_audio.flags = attr;
|
||||
}
|
||||
// 19B4
|
||||
*(int*)(0xBE000024) = attr;
|
||||
HW(0xBE000024) = attr;
|
||||
if (attr == 0)
|
||||
{
|
||||
// 19EC
|
||||
@ -1053,45 +1050,45 @@ void audioHwInit()
|
||||
sceSysregAudioClkoutClkSelect(0);
|
||||
sceSysregAudioClkoutIoEnable();
|
||||
AUDIO_SET_BUSY(1);
|
||||
*(int*)(0xBE000004) = 0;
|
||||
HW(0xBE000004) = 0;
|
||||
// 1B00
|
||||
while ((LW(0xBE00000C) & 7) != 0)
|
||||
while ((HW(0xBE00000C) & 7) != 0)
|
||||
;
|
||||
*(int*)(0xBE00002C) = 7;
|
||||
HW(0xBE00002C) = 7;
|
||||
// 1B20
|
||||
while ((LW(0xBE000028) & 0x30) != 0x30)
|
||||
while ((HW(0xBE000028) & 0x30) != 0x30)
|
||||
;
|
||||
*(int*)(0xBE000024) = 0;
|
||||
*(int*)(0xBE000020) = 7;
|
||||
*(int*)(0xBE000008) = 7;
|
||||
*(int*)(0xBE000014) = 0x1208;
|
||||
HW(0xBE000024) = 0;
|
||||
HW(0xBE000020) = 7;
|
||||
HW(0xBE000008) = 7;
|
||||
HW(0xBE000014) = 0x1208;
|
||||
// 1B50
|
||||
while ((LW(0xBE000050) & 0x30) != 0)
|
||||
while ((HW(0xBE000050) & 0x30) != 0)
|
||||
;
|
||||
*(int*)(0xBE000050) = 0x8000;
|
||||
HW(0xBE000050) = 0x8000;
|
||||
g_audio.srcVol = 0x0400;
|
||||
*(int*)(0xBE000018) = 0;
|
||||
HW(0xBE000018) = 0;
|
||||
if (g_audio.freq == 48000)
|
||||
{
|
||||
// 1BF0
|
||||
*(int*)(0xBE000038) = 0x100;
|
||||
HW(0xBE000038) = 0x100;
|
||||
}
|
||||
else {
|
||||
g_audio.freq = 44100;
|
||||
*(int*)(0xBE000038) = 0x80;
|
||||
HW(0xBE000038) = 0x80;
|
||||
}
|
||||
// 1BA0
|
||||
short v = g_audio.hwFreq;
|
||||
if (v == 0) {
|
||||
// 1BE0
|
||||
*(int*)(0xBE000040) = 5;
|
||||
HW(0xBE000040) = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
*(int*)(0xBE000040) = 4;
|
||||
*(int*)(0xBE000044) = v;
|
||||
HW(0xBE000040) = 4;
|
||||
HW(0xBE000044) = v;
|
||||
// 1BBC
|
||||
while ((LW(0xBE000040) & 2) != 0)
|
||||
while ((HW(0xBE000040) & 2) != 0)
|
||||
;
|
||||
}
|
||||
// 1BD0
|
||||
@ -1104,7 +1101,7 @@ void audioHwInit()
|
||||
*
|
||||
* Returns 0.
|
||||
*/
|
||||
int audioEventHandler(int ev_id, char* ev_name __attribute__((unused)), void* param __attribute__((unused)), int* result __attribute__((unused)))
|
||||
s32 audioEventHandler(s32 ev_id, s8* ev_name __attribute__((unused)), void* param __attribute__((unused)), s32* result __attribute__((unused)))
|
||||
{
|
||||
dbg_printf("Running %s\n", __FUNCTION__);
|
||||
switch (ev_id)
|
||||
@ -1135,11 +1132,11 @@ int audioEventHandler(int ev_id, char* ev_name __attribute__((unused)), void* pa
|
||||
ptr[2] = 0;
|
||||
ptr[10] = 0;
|
||||
AUDIO_SET_BUSY(1);
|
||||
*(int*)(0xBE000004) = 1;
|
||||
HW(0xBE000004) = 1;
|
||||
sceKernelSetEventFlag(g_audio.evFlagId, (g_audio.inputCurSampleCnt != 0) ? 0x60000000 : 0xE0000000);
|
||||
g_audio.flags = 0;
|
||||
*(int*)(0xBE000004) = 0;
|
||||
*(int*)(0xBE000008) = 0;
|
||||
HW(0xBE000004) = 0;
|
||||
HW(0xBE000008) = 0;
|
||||
pspSync();
|
||||
sceSysregAudioIoDisable(0);
|
||||
sceSysregAudioClkoutIoDisable();
|
||||
@ -1196,8 +1193,8 @@ int sceAudioSRCChReserve(int sampleCount, int freq, int numChans)
|
||||
if (g_audio.freq == 48000)
|
||||
{
|
||||
// 2030
|
||||
*(int*)(0xBE000038) = 128;
|
||||
*(int*)(0xBE00003C) = 128;
|
||||
HW(0xBE000038) = 128;
|
||||
HW(0xBE00003C) = 128;
|
||||
}
|
||||
|
||||
// 1E84
|
||||
@ -1246,31 +1243,31 @@ int sceAudioSRCChReserve(int sampleCount, int freq, int numChans)
|
||||
AUDIO_SET_BUSY(1);
|
||||
if ((g_audio.flags & 2) != 0)
|
||||
{
|
||||
*(int*)(0xBE000004) = (int)(g_audio.flags ^ 2);
|
||||
HW(0xBE000004) = (int)(g_audio.flags ^ 2);
|
||||
// 1F30
|
||||
while ((LW(0xBE00000C) & 2) != 0)
|
||||
while ((HW(0xBE00000C) & 2) != 0)
|
||||
;
|
||||
}
|
||||
// 1F44
|
||||
g_audio.hwFreq = hwFreq;
|
||||
if (hwFreq == 0) {
|
||||
// 1FA8
|
||||
*(int*)(0xBE000040) = 5;
|
||||
HW(0xBE000040) = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
*(int*)(0xBE000040) = 4;
|
||||
*(int*)(0xBE000044) = hwFreq;
|
||||
HW(0xBE000040) = 4;
|
||||
HW(0xBE000044) = hwFreq;
|
||||
// 1F5C
|
||||
while ((LW(0xBE000040) & 2) != 0)
|
||||
while ((HW(0xBE000040) & 2) != 0)
|
||||
;
|
||||
}
|
||||
// 1F70
|
||||
*(int*)(0xBE00002C) = 2;
|
||||
HW(0xBE00002C) = 2;
|
||||
if (g_audio.flags != 0)
|
||||
{
|
||||
// 1F9C
|
||||
*(int*)(0xBE000004) = g_audio.flags;
|
||||
HW(0xBE000004) = g_audio.flags;
|
||||
}
|
||||
else
|
||||
AUDIO_SET_BUSY(0);
|
||||
@ -1407,13 +1404,13 @@ int audioSRCOutput(int vol, void *buf)
|
||||
while (sceKernelGetSystemTimeLow() - oldTime < 25)
|
||||
;
|
||||
// 2414
|
||||
while ((LW(0xBE00000C) & 2) == 0)
|
||||
while ((HW(0xBE00000C) & 2) == 0)
|
||||
;
|
||||
}
|
||||
// 23D8
|
||||
while ((LW(0xBE000050) & 0x10000) != 0)
|
||||
while ((HW(0xBE000050) & 0x10000) != 0)
|
||||
;
|
||||
*(int*)(0xBE000050) = volHi;
|
||||
HW(0xBE000050) = volHi;
|
||||
}
|
||||
// 239C
|
||||
return g_audio.srcChSampleCnt;
|
||||
@ -1450,13 +1447,13 @@ int audioInputThread()
|
||||
if (g_audio.inputIsWaiting == 0 && g_audio.unkCodecArgSet == 0)
|
||||
{
|
||||
int oldIntr = sceKernelCpuSuspendIntr();
|
||||
*(int*)(0xBE000004) = (int)(char)(g_audio.flags & 0xFB);
|
||||
HW(0xBE000004) = (int)(char)(g_audio.flags & 0xFB);
|
||||
g_audio.flags &= 0xFB;
|
||||
// 268C
|
||||
while ((LW(0xBE00000C) & 4) != 0)
|
||||
while ((HW(0xBE00000C) & 4) != 0)
|
||||
;
|
||||
sceKernelDmaOpQuit(g_audio.dmaPtr[2]);
|
||||
*(int*)(0xBE000008) = g_audio.flags;
|
||||
HW(0xBE000008) = g_audio.flags;
|
||||
sceKernelCpuResumeIntr(oldIntr);
|
||||
sceCodec_driver_277DFFB6();
|
||||
}
|
||||
@ -1505,11 +1502,11 @@ int audioInputThread()
|
||||
*uncached2 = (int)UCACHED(&g_audio.hwBuf[36 + shift]);
|
||||
if (DmacManForKernel_E18A93A5(ptr1, UCACHED(&g_audio.hwBuf[32 + shift])) < 0)
|
||||
{
|
||||
*(int*)(0xBE000004) = (int)(char)(g_audio.flags & 0xFB);
|
||||
HW(0xBE000004) = (int)(char)(g_audio.flags & 0xFB);
|
||||
g_audio.flags &= 0xFB;
|
||||
pspSync();
|
||||
// 2600
|
||||
while ((LW(0xBE00000C) & 4) != 0)
|
||||
while ((HW(0xBE00000C) & 4) != 0)
|
||||
;
|
||||
sceKernelDmaOpQuit(g_audio.dmaPtr[2]);
|
||||
ptr1[2] = g_audio.flags;
|
||||
@ -1647,15 +1644,15 @@ int audioInputSetup()
|
||||
sceCodec_driver_376399B6(1);
|
||||
}
|
||||
// 2A10
|
||||
*(int*)(0xBE000024) = (char)((flags | 4) & 0xFF) - 4;
|
||||
HW(0xBE000024) = (char)((flags | 4) & 0xFF) - 4;
|
||||
g_audio.flags = flags | 4;
|
||||
*(int*)(0xBE00002C) = 4;
|
||||
*(int*)(0xBE000020) = 4;
|
||||
HW(0xBE00002C) = 4;
|
||||
HW(0xBE000020) = 4;
|
||||
pspSync();
|
||||
ret = sceKernelDmaOpEnQueue(g_audio.dmaPtr[2]);
|
||||
*(int*)(0xBE000008) = g_audio.flags;
|
||||
*(int*)(0xBE000004) = g_audio.flags | 1;
|
||||
*(int*)(0xBE000024) = g_audio.flags;
|
||||
HW(0xBE000008) = g_audio.flags;
|
||||
HW(0xBE000004) = g_audio.flags | 1;
|
||||
HW(0xBE000024) = g_audio.flags;
|
||||
pspSync();
|
||||
return ret;
|
||||
}
|
||||
@ -1752,7 +1749,7 @@ int audioInput(int sampleCount, int freq, void *buf)
|
||||
{
|
||||
g_audio.unkCodecRet = ret & 1;
|
||||
if ((ret & 4) != 0)
|
||||
*(int*)(0xBE0000D0) = (ret >> 1) & 1;
|
||||
HW(0xBE0000D0) = (ret >> 1) & 1;
|
||||
}
|
||||
// 2BD8
|
||||
ret = sceCodec_driver_A88FD064(g_audio.unkInput0, g_audio.inputGain, g_audio.unkInput2, g_audio.unkInput3, g_audio.unkInput4, g_audio.unkInput5);
|
||||
|
@ -4,5 +4,9 @@
|
||||
TARGET = interruptman
|
||||
OBJS = start.o interruptman.o end.o
|
||||
|
||||
DEBUG = 1
|
||||
|
||||
LIBS = -lExceptionManagerForKernel -lLoadCoreForKernel -lSysMemForKernel -lsceSuspendForKernel
|
||||
|
||||
include ../../lib/build.mak
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
# Copyright (C) 2011, 2012 The uOFW team
|
||||
# See the file COPYING for copying permission.
|
||||
|
||||
.text
|
||||
.set noat
|
||||
.set noreorder
|
||||
#include "common.S"
|
||||
|
||||
.text
|
||||
.globl sceKernelCpuSuspendIntr
|
||||
sceKernelCpuSuspendIntr:
|
||||
mfic $v0, $0
|
||||
|
@ -59,7 +59,7 @@ PSP_EXPORT_FUNC_NID(sceKernelEnableSubIntr, 0xFB8E22EC)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelIsIntrContext, 0xFE28C6D9)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelRegisterSubIntrHandler, 0xFFA8B183)
|
||||
PSP_EXPORT_VAR_NID(intInfo, 0x201A1A19)
|
||||
PSP_EXPORT_VAR_NID(intInfo.intrStackArg, 0xFD6B9CAB)
|
||||
PSP_EXPORT_VAR_NID(intInfo + 116, 0xFD6B9CAB)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_EXPORT_START(InterruptManager, 0x0011, 0x4000)
|
||||
|
File diff suppressed because it is too large
Load Diff
11
src/interruptman/interruptman.h
Normal file
11
src/interruptman/interruptman.h
Normal file
@ -0,0 +1,11 @@
|
||||
/* Copyright (C) 2011, 2012 The uOFW team
|
||||
See the file COPYING for copying permission.
|
||||
*/
|
||||
|
||||
void *mymemset(void *dstVoid, s8 c, s32 n);
|
||||
s32 SuspendIntc(s32 unk, void *param);
|
||||
s32 ResumeIntc(s32 unk, void *param);
|
||||
void InterruptDisableInTable(s32 intrNum);
|
||||
void sub_29B0(s32 intrNum);
|
||||
void AllLevelInterruptDisable(s32 intrNum);
|
||||
|
@ -30,10 +30,10 @@ loc_0024:
|
||||
nop # ?
|
||||
|
||||
##
|
||||
# sub_0038
|
||||
# intrExcepHandler
|
||||
##
|
||||
.globl sub_0038
|
||||
sub_0038:
|
||||
.globl intrExcepHandler
|
||||
intrExcepHandler:
|
||||
nop
|
||||
nop
|
||||
cfc0 $v0, $13
|
||||
@ -91,8 +91,8 @@ loc_00F8:
|
||||
move $k1, $sp
|
||||
bnez $gp, loc_0138
|
||||
sw $a3, 92($sp)
|
||||
lui $sp, %hi(unkTab)
|
||||
addiu $sp, $sp, %lo(unkTab)
|
||||
lui $sp, %hi(g_syscCtx)
|
||||
addiu $sp, $sp, %lo(g_syscCtx)
|
||||
cache 0x18, 0($sp)
|
||||
lui $a3, %hi(intInfo)
|
||||
addiu $a2, $a3, 32
|
||||
@ -146,7 +146,7 @@ loc_019C:
|
||||
|
||||
sh $0, 36($k1)
|
||||
or $ra, $ra, $v1
|
||||
beqz $ra, InterruptManagerForKernel_551097F2
|
||||
beqz $ra, _InterruptManagerForKernel_551097F2
|
||||
move $a0, $k1
|
||||
j loc_00000978
|
||||
sw $k1, 12($sp)
|
||||
@ -178,8 +178,8 @@ loc_0218:
|
||||
addiu $sp, $sp, -320
|
||||
|
||||
loc_022C:
|
||||
lui $v0, %hi(wut)
|
||||
addiu $v0, $v0, %lo(wut)
|
||||
lui $v0, %hi(g_stackMiddle)
|
||||
addiu $v0, $v0, %lo(g_stackMiddle)
|
||||
sltu $v0, $sp, $v0
|
||||
beqz $v0, loc_0050
|
||||
ins $sp, $0, 0, 6
|
||||
@ -319,7 +319,7 @@ loc_03A4:
|
||||
mod_0400:
|
||||
jal sub_091C
|
||||
li $k1, 3
|
||||
beqz $v0, InterruptManagerForKernel_551097F2
|
||||
beqz $v0, _InterruptManagerForKernel_551097F2
|
||||
lw $a0, 12($sp)
|
||||
lb $v0, 36($a0)
|
||||
bnez $v0, loc_0444
|
||||
@ -351,12 +351,12 @@ mod_0468:
|
||||
jal sub_091C
|
||||
|
||||
move $a1, $0
|
||||
j InterruptManagerForKernel_551097F2
|
||||
j _InterruptManagerForKernel_551097F2
|
||||
move $a0, $v0
|
||||
|
||||
loc_0478:
|
||||
lb $a2, 37($a0)
|
||||
beqz $a2, InterruptManagerForKernel_551097F2
|
||||
beqz $a2, _InterruptManagerForKernel_551097F2
|
||||
mfc0 $k0, $12
|
||||
ins $k0, $a2, 29, 1
|
||||
mtc0 $k0, $12
|
||||
@ -394,6 +394,7 @@ loc_0478:
|
||||
lwc1 $30, 312($a0)
|
||||
lwc1 $31, 316($a0)
|
||||
|
||||
_InterruptManagerForKernel_551097F2:
|
||||
.globl InterruptManagerForKernel_551097F2
|
||||
InterruptManagerForKernel_551097F2:
|
||||
lw $sp, 180($a0)
|
||||
@ -691,8 +692,8 @@ sub_091C:
|
||||
jr $ra
|
||||
move $v0, $0
|
||||
|
||||
.globl sub_0924
|
||||
sub_0924:
|
||||
.globl intrExcepHandler2
|
||||
intrExcepHandler2:
|
||||
nop
|
||||
nop
|
||||
cfc0 $v1, $25
|
||||
@ -719,8 +720,8 @@ loc_0000095C:
|
||||
|
||||
loc_00000978:
|
||||
move $sp, $k1
|
||||
lui $v1, %hi(sub_0038)
|
||||
lw $v1, %lo(sub_0038)($v1)
|
||||
lui $v1, %hi(intrExcepHandler)
|
||||
lw $v1, %lo(intrExcepHandler)($v1)
|
||||
lui $at, %hi(intInfo+108)
|
||||
sw $v1, %lo(intInfo+108)($at)
|
||||
sll $v0, $gp, 3
|
||||
@ -964,12 +965,13 @@ InterruptManagerForKernel_1373F20E:
|
||||
nop
|
||||
nop
|
||||
|
||||
_sub_0CC0:
|
||||
.globl sub_0CC0
|
||||
sub_0CC0:
|
||||
cfc0 $v0, $0
|
||||
mtc0 $v0, $14
|
||||
lui $v0, %hi(sub_0CF8)
|
||||
lw $v0, %lo(sub_0CF8)
|
||||
lui $v0, %hi(syscallExcepHandler)
|
||||
lw $v0, %lo(syscallExcepHandler)
|
||||
jr $v0
|
||||
nop
|
||||
|
||||
@ -986,12 +988,8 @@ loc_00000CF0:
|
||||
jr $ra
|
||||
nop
|
||||
|
||||
##
|
||||
# sub_0CF8
|
||||
##
|
||||
|
||||
.globl sub_0CF8
|
||||
sub_0CF8:
|
||||
.globl syscallExcepHandler
|
||||
syscallExcepHandler:
|
||||
nop
|
||||
nop
|
||||
cfc0 $v0, $0
|
||||
@ -1002,9 +1000,9 @@ sub_0CF8:
|
||||
beqz $at, loc_00000D34
|
||||
ctc0 $t7, $23
|
||||
bltz $v1, loc_00000E98
|
||||
lui $t4, %hi(cbMap + 0x20000010)
|
||||
lui $t4, %hi(g_syscallTable + 0x20000010)
|
||||
addu $t4, $t4, $t7
|
||||
lw $t7, %lo(cbMap+16)($t4)
|
||||
lw $t7, %lo(g_syscallTable + 0x10)($t4)
|
||||
jr $t7
|
||||
mtc0 $v0, $14
|
||||
|
||||
@ -1017,7 +1015,7 @@ loc_00000D40:
|
||||
lw $t5, 4($t4)
|
||||
mtc0 $v0, $14
|
||||
lw $t6, 8($t4)
|
||||
beqz $t5, sub_0CC0
|
||||
beqz $t5, _sub_0CC0
|
||||
subu $t5, $t7, $t5
|
||||
sltu $at, $t5, $t6
|
||||
beqzl $at, loc_00000D40
|
||||
|
@ -3,19 +3,13 @@
|
||||
*/
|
||||
|
||||
void sub_0000();
|
||||
void sub_0038();
|
||||
void InterruptManagerForKernel_551097F2();
|
||||
int sceKernelIsIntrContext();
|
||||
void intrExcepHandler(void);
|
||||
void SaveThreadContext();
|
||||
int sceKernelCallUserIntrHandler(int, int, int, int, int, int);
|
||||
void sub_0864();
|
||||
int sub_091C();
|
||||
void sub_0924();
|
||||
void InterruptManagerForKernel_A6978B70();
|
||||
void InterruptManagerForKernel_1373F20E();
|
||||
void intrExcepHandler2(void);
|
||||
void sub_0CC0();
|
||||
int sceKernelGetSyscallRA();
|
||||
void sub_0CF8();
|
||||
void syscallExcepHandler(void);
|
||||
void loc_00000DDC();
|
||||
void sub_0EC0();
|
||||
void sub_0ECC();
|
||||
@ -36,9 +30,9 @@ void sub_1050(int*);
|
||||
void sub_1080(int*);
|
||||
void sub_10A8(int*);
|
||||
|
||||
int mod_0400;
|
||||
int mod_0468;
|
||||
int mod_0DC4;
|
||||
int mod_0E48;
|
||||
int mod_0E50;
|
||||
s32 mod_0400;
|
||||
s32 mod_0468;
|
||||
s32 mod_0DC4;
|
||||
s32 mod_0E48;
|
||||
s32 mod_0E50;
|
||||
|
||||
|
@ -2228,13 +2228,13 @@ int sceIoReadAsync(SceUID fd, void *data, SceSize size)
|
||||
return do_read(fd, data, size, 1);
|
||||
}
|
||||
|
||||
int sceIoWrite(SceUID fd, void *data, SceSize size)
|
||||
int sceIoWrite(SceUID fd, const void *data, SceSize size)
|
||||
{
|
||||
dbg_printf("Calling %s\n", __FUNCTION__);
|
||||
return do_write(fd, data, size, 0);
|
||||
}
|
||||
|
||||
int sceIoWriteAsync(SceUID fd, void *data, SceSize size)
|
||||
int sceIoWriteAsync(SceUID fd, const void *data, SceSize size)
|
||||
{
|
||||
dbg_printf("Calling %s\n", __FUNCTION__);
|
||||
return do_write(fd, data, size, 1);
|
||||
|
@ -1,6 +1,16 @@
|
||||
#include "common.h"
|
||||
#include <common.h>
|
||||
|
||||
#include "libatrac3plus_int.h"
|
||||
#include <avcodec_audiocodec.h>
|
||||
#include <usersystemlib_kernel.h>
|
||||
|
||||
#include "libatrac3plus.h"
|
||||
|
||||
SCE_MODULE_INFO("sceATRAC3plus_Library", SCE_MODULE_SINGLE_LOAD | SCE_MODULE_SINGLE_START, 1, 5);
|
||||
SCE_MODULE_BOOTSTART("sceAtracStartEntry");
|
||||
SCE_MODULE_STOP("sceAtracEndEntry");
|
||||
SCE_SDK_VERSION(0x06060010);
|
||||
SCE_MODULE_START_THREAD_PARAMETER(3, 0x20, 0x0400, 0);
|
||||
SCE_MODULE_STOP_THREAD_PARAMETER(3, 0x20, 0x0400, 0);
|
||||
|
||||
// 3F80
|
||||
int g_edramAddr = -1;
|
||||
@ -78,7 +88,7 @@ int sceAtracReinit(int numAT3Id, int numAT3plusId)
|
||||
return 0;
|
||||
}
|
||||
g_edramAddr = -1;
|
||||
return sceAudiocodecReleaseEDRAM(&g_atracIds[0]);
|
||||
return sceAudiocodecReleaseEDRAM(&g_atracIds[0].codec);
|
||||
}
|
||||
|
||||
int sceAtracGetAtracID(u32 codecType)
|
||||
@ -453,6 +463,7 @@ int sceAtracSetLoopNum(int atracID, int loopNum)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __attribute__((alias("sceAtracGetBufferInfoForResetting"))) sceAtracGetBufferInfoForReseting(int atracID, u32 sample, SceBufferInfo *bufferInfo);
|
||||
int sceAtracGetBufferInfoForResetting(int atracID, u32 sample, SceBufferInfo *bufferInfo)
|
||||
{
|
||||
if (atracID < 0 || atracID >= 6 || g_atracIds[atracID].info.state <= 0)
|
||||
@ -710,12 +721,12 @@ int allocEdram(void)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
g_needMemAT3plus = (g_atracIds[0].codec.neededMem + 0x3F) & 0xFFFFFFC0;
|
||||
ret = sceAudiocodecCheckNeedMem(&g_atracIds[0].info, 0x1001);
|
||||
ret = sceAudiocodecCheckNeedMem(&g_atracIds[0].codec, 0x1001);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
g_needMemAT3 = (g_atracIds[0].codec.neededMem + 0x3F) & 0xFFFFFFC0;
|
||||
g_atracIds[0].codec.neededMem = 0x19000;
|
||||
ret = sceAudiocodecGetEDRAM(&g_atracIds[0].info, 0x1001);
|
||||
ret = sceAudiocodecGetEDRAM(&g_atracIds[0].codec, 0x1001);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
g_edramAddr = g_atracIds[0].codec.edramAddr;
|
||||
@ -905,9 +916,9 @@ int loadWaveFile(u32 size, SceAtracFile *info, u8 *in)
|
||||
int inc = cksize + (cksize & 1);
|
||||
if (readWaveData(in, &curOff, 4) == WAVE_MAGIC)
|
||||
break;
|
||||
if (size < curOff + cksize)
|
||||
if (size < curOff + inc)
|
||||
return 0x80630011;
|
||||
curOff += cksize;
|
||||
curOff += inc;
|
||||
}
|
||||
// 1EAC
|
||||
if (curOff + 8 >= size) {
|
||||
@ -994,7 +1005,7 @@ int loadWaveFile(u32 size, SceAtracFile *info, u8 *in)
|
||||
|
||||
case WAVE_CHUNK_ID_FMT:
|
||||
// 1F64
|
||||
if (fmt != 0x80630006)
|
||||
if (fmt != (s32)0x80630006)
|
||||
return 0x80630006;
|
||||
if (cksize < 32)
|
||||
return 0x80630006;
|
||||
@ -1029,7 +1040,7 @@ int loadWaveFile(u32 size, SceAtracFile *info, u8 *in)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fmtCode != 0xFFFE) {
|
||||
if (fmtCode != (s16)0xFFFE) {
|
||||
// 20B8
|
||||
return 0x80630006;
|
||||
}
|
||||
@ -1315,7 +1326,7 @@ int initAT3Decoder(SceAudiocodecCodec *codec, void *arg1)
|
||||
return 0;
|
||||
}
|
||||
// 2784
|
||||
unk;
|
||||
unk--;
|
||||
}
|
||||
return 0x80630001;
|
||||
}
|
||||
@ -1364,7 +1375,7 @@ int initAT3plusDecoder(SceAudiocodecCodec *codec, void *arg1)
|
||||
int *cur = (int*)&g_3E88[0];
|
||||
int *curSp = sp;
|
||||
int *end = (int*)&g_3E88[28];
|
||||
if ((int)g_3E88 & 3 == 0)
|
||||
if (((int)g_3E88 & 3) == 0)
|
||||
{
|
||||
// 2918
|
||||
do
|
||||
@ -1634,7 +1645,7 @@ int sub_2DF8(SceAtracIdInfo *info)
|
||||
return ret;
|
||||
u32 ret2 = getSecondBufPos(info, info->loopEnd);
|
||||
u32 sum = info->curOff + info->streamDataByte;
|
||||
if (sum >= ret2 + 1 && (sum - (ret2 + 1)) / (ret2 - getOffFromSample(info, info->loopStart) + 1) >= info->loopNum) // 2E78
|
||||
if (sum >= ret2 + 1 && (s32)(sum - (ret2 + 1)) / (s32)(ret2 - getOffFromSample(info, info->loopStart) + 1) >= info->loopNum) // 2E78
|
||||
ret = -3;
|
||||
// 2E58
|
||||
return ret;
|
||||
@ -1642,7 +1653,7 @@ int sub_2DF8(SceAtracIdInfo *info)
|
||||
|
||||
int sub_2EA4(SceAtracIdInfo *info)
|
||||
{
|
||||
int ret = getSecondBufPos(info, info->loopEnd);
|
||||
u32 ret = getSecondBufPos(info, info->loopEnd);
|
||||
u32 sum = info->curOff + info->streamDataByte;
|
||||
u32 sum2 = sum - ret - 1;
|
||||
int count;
|
||||
@ -2006,7 +2017,7 @@ int parseAA3(u32 readByte, SceAA3File *aa3, int arg2, u8 *buffer)
|
||||
aa3->unk44 = sub_3AA0(buffer, &curOff, readByte);
|
||||
if (aa3->unk44 == -1)
|
||||
return 0x80631003;
|
||||
if (sub_3AA0(buffer, &curOff, readByte) != 0xFFFF)
|
||||
if (sub_3AA0(buffer, &curOff, readByte) != -1)
|
||||
return 0x80631003;
|
||||
curOff += 24;
|
||||
aa3->unk6 = *(u8*)(buffer + curOff);
|
||||
|
@ -26,7 +26,7 @@ typedef struct
|
||||
char unk22;
|
||||
char numChan; // 23
|
||||
u16 sampleSize; // 24
|
||||
short codec; // 26
|
||||
u16 codec; // 26
|
||||
u32 dataOff; // 28
|
||||
u32 curOff; // 32
|
||||
u32 dataEnd; // 36
|
||||
@ -69,7 +69,9 @@ typedef struct
|
||||
u32 dataSize; // 16
|
||||
u32 unk20, unk24, unk28;
|
||||
u32 unk32;
|
||||
u32 unk36, unk40, unk44;
|
||||
u32 unk36;
|
||||
s32 unk40;
|
||||
s32 unk44;
|
||||
} SceAA3File;
|
||||
|
||||
int setHalfwayBuffer(SceAtracId *id, u8 *buffer, u32 readByte, u32 bufferByte, SceAtracFile *info);
|
48
src/loadcore/exports.exp
Normal file
48
src/loadcore/exports.exp
Normal file
@ -0,0 +1,48 @@
|
||||
# Export file automatically generated with prxtool
|
||||
PSP_BEGIN_EXPORTS
|
||||
|
||||
PSP_EXPORT_START(syslib, 0x0000, 0x8000)
|
||||
PSP_EXPORT_FUNC_HASH(module_bootstart)
|
||||
PSP_EXPORT_VAR_HASH(module_info)
|
||||
PSP_EXPORT_VAR_HASH(module_sdk_version)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_EXPORT_START(LoadCoreForKernel, 0x0011, 0x0001)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelDeleteModule, 0x001B57BB)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelUnlinkLibraryEntries, 0x0295CFCE)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelMaskLibraryEntries, 0x1915737F)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLoadCoreLock, 0x1999032F)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLoadExecutableObject, 0x1C394885)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelCreateModule, 0x2C44F793)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelRegisterLibraryForUser, 0x2C60CCB8)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelGetModuleIdListForKernel, 0x37E6F41B)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelGetModuleListWithAlloc, 0x3FE631F0)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelFindModuleByUID, 0x40972E6E)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelGetModuleGPByAddressForKernel, 0x410084F9)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelProbeExecutableObject, 0x41D10899)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelRegisterLibrary, 0x48AF96A9)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLoadModuleBootLoadCore, 0x493EE781)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelCanReleaseLibrary, 0x538129F8)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelSegmentChecksum, 0x5FDDB07A)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelQueryLoadCoreCB, 0x696594C8)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLinkLibraryEntriesForUser, 0x6ECFFFBA)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelCreateAssignModule, 0x84D5C971)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLinkLibraryEntries, 0x8EAE9534)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLinkLibraryEntriesWithModule, 0xA481E30E)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelReleaseModule, 0xB17F5075)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLoadRebootBin, 0xB27CC244)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLoadCoreUnlock, 0xB6C037EA)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelFindModuleByAddress, 0xBC99C625)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelRegisterModule, 0xBF2E388C)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelLoadCoreMode, 0xC8FF5EE5)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelReleaseLibrary, 0xCB636A90)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelGetModuleFromUID, 0xCD26E0CA)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelCheckExecFile, 0xD3353EC4)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelAssignModule, 0xF3DD4808)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelFindModuleByName, 0xF6B1BF0F)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelSetBootCallbackLevel, 0xF976EF41)
|
||||
PSP_EXPORT_FUNC_NID(sceKernelCheckPspConfig, 0xFC47F93A)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_END_EXPORTS
|
||||
|
35
src/usersystemlib/exports.exp
Normal file
35
src/usersystemlib/exports.exp
Normal file
@ -0,0 +1,35 @@
|
||||
# Export file automatically generated with prxtool
|
||||
PSP_BEGIN_EXPORTS
|
||||
|
||||
PSP_EXPORT_START(syslib, 0x0000, 0x8000)
|
||||
PSP_EXPORT_FUNC_HASH(module_start)
|
||||
PSP_EXPORT_VAR_HASH(module_info)
|
||||
PSP_EXPORT_VAR_HASH(module_sdk_version)
|
||||
PSP_EXPORT_VAR_HASH(module_start_thread_parameter)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_EXPORT_START(Kernel_Library, 0x0011, 0x0001)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelCpuSuspendIntr)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelUnlockLwMutex)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelMemcpy)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelLockLwMutexCB)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelGetThreadId)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelTryLockLwMutex_600)
|
||||
PSP_EXPORT_FUNC_NID(Kernel_Library_3AD10D4D, 0x3AD10D4D)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelCpuResumeIntrWithSync)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelIsCpuIntrSuspended)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelCpuResumeIntr)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelMemset)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelIsCpuIntrEnable)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelLockLwMutex)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelReferLwMutexStatus)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelCheckThreadStack)
|
||||
PSP_EXPORT_FUNC_HASH(sceKernelTryLockLwMutex)
|
||||
PSP_EXPORT_FUNC_NID(Kernel_Library_FA835CDE, 0xFA835CDE)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_EXPORT_START(sceGe_lazy, 0x0011, 0x0001)
|
||||
PSP_EXPORT_FUNC_NID(sceGe_lazy_31129B95, 0x31129B95)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_END_EXPORTS
|
@ -276,7 +276,7 @@ int parse_string(char *line, char **params, int max_params)
|
||||
param_start = pos;
|
||||
|
||||
/* Scan parameters */
|
||||
while((isalnum(line[pos])) || (line[pos] == '_') || (line[pos] == ',') || (line[pos] == '.'))
|
||||
while((isalnum(line[pos])) || (line[pos] == '_') || (line[pos] == ',') || (line[pos] == '.') || (line[pos] == '+'))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
@ -325,7 +325,8 @@ void build_exports_output_extern(struct psp_export *pHead)
|
||||
pExp = pHead;
|
||||
while(pExp != NULL)
|
||||
{
|
||||
fprintf(stdout, "extern int %s;\n", pExp->name);
|
||||
if (strchr(pExp->name, '+') == NULL)
|
||||
fprintf(stdout, "extern char %s;\n", pExp->name);
|
||||
pExp = pExp->pNext;
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user