From afdcd2bedd419497fdd6c233842e8e6e75548839 Mon Sep 17 00:00:00 2001 From: artart78 Date: Thu, 10 May 2012 20:52:46 +0000 Subject: [PATCH] Fixed codec (building & working), some work on ctrl debugging --- include/lowio_gpio.h | 9 ++++++++ include/lowio_i2c.h | 6 +++++ include/lowio_sysreg.h | 2 ++ include/threadman_kernel.h | 1 + lib/build.mak | 2 +- lib/libsceDdr_driver.a | Bin 14878 -> 14878 bytes lib/libsceDmac.a | Bin 2982 -> 2982 bytes lib/libsceDmacplus_driver.a | Bin 20230 -> 20230 bytes lib/libsceGpio_driver.a | Bin 16880 -> 16778 bytes lib/libsceI2c_driver.a | Bin 8062 -> 8020 bytes lib/libsceLcdc_driver.a | Bin 20890 -> 20890 bytes lib/libsceNand_driver.a | Bin 37272 -> 37272 bytes lib/libscePwm_driver.a | Bin 7084 -> 7084 bytes lib/libsceSysreg_driver.a | Bin 177324 -> 177324 bytes src/audio/audio.c | 2 +- src/codec/Makefile | 2 ++ src/codec/codec.c | 13 +++++++++-- src/codec/exports.exp | 4 ++-- src/ctrl/ctrl.c | 37 ++++++++++++++++++++---------- src/ctrl/ctrl_custom_VB_handler.c | 2 +- src/iofilemgr/iofilemgr.c | 14 +++++++++++ 21 files changed, 75 insertions(+), 19 deletions(-) create mode 100644 include/lowio_gpio.h create mode 100644 include/lowio_i2c.h diff --git a/include/lowio_gpio.h b/include/lowio_gpio.h new file mode 100644 index 0000000..683b097 --- /dev/null +++ b/include/lowio_gpio.h @@ -0,0 +1,9 @@ +/* Copyright (C) 2011, 2012 The uOFW team + See the file COPYING for copying permission. +*/ + +int sceGpioPortSet(int); +int sceGpioPortClear(int); +int sceGpioSetPortMode(int, int); +int sceGpioDisableTimerCapture(int, int); + diff --git a/include/lowio_i2c.h b/include/lowio_i2c.h new file mode 100644 index 0000000..f30885f --- /dev/null +++ b/include/lowio_i2c.h @@ -0,0 +1,6 @@ +/* Copyright (C) 2011, 2012 The uOFW team + See the file COPYING for copying permission. +*/ + +int sceI2cMasterTransmit(int reg, void *buf, int bufSize); + diff --git a/include/lowio_sysreg.h b/include/lowio_sysreg.h index f195827..f25f6d3 100644 --- a/include/lowio_sysreg.h +++ b/include/lowio_sysreg.h @@ -47,6 +47,8 @@ int sceSysregAudioClkSelect(int, int); int sceSysregAudioBusClockEnable(int); int sceSysregAudioIoEnable(int); int sceSysregAudioIoDisable(int); +int sceSysregAudioClkoutClkEnable(void); +int sceSysregAudioClkoutClkDisable(void); int sceSysregAudioClkoutClkSelect(int); int sceSysregAudioClkoutIoEnable(void); int sceSysregAudioClkoutIoDisable(void); diff --git a/include/threadman_kernel.h b/include/threadman_kernel.h index a4c2600..5dfd714 100644 --- a/include/threadman_kernel.h +++ b/include/threadman_kernel.h @@ -56,6 +56,7 @@ int sceKernelCreateMutex(char *, int, int, int); int sceKernelTryLockMutex(int, int); int sceKernelLockMutex(int, int, int); int sceKernelUnlockMutex(int, int); +int sceKernelDeleteMutex(int); /* Event flags */ diff --git a/lib/build.mak b/lib/build.mak index 46af939..707a7ee 100644 --- a/lib/build.mak +++ b/lib/build.mak @@ -16,7 +16,7 @@ EXPORT_OBJ=$(patsubst %.exp,%.o,$(PRX_EXPORTS)) ifdef DEBUG CFLAGS += -DDEBUG -LIBS := -ldebug -lpspdebug $(LIBS) -lSysclibForKernel -lsceDisplay -lsceGe_user -lIoFileMgrForUser -lsceSyscon_driver +LIBS := -ldebug -lpspdebug $(LIBS) -lSysclibForKernel -lsceDisplay -lsceGe_user -lIoFileMgrForKernel -lsceSyscon_driver endif MODULE_STUBS=$(foreach mod,$(MODULES), $($(mod)_STUBS)) diff --git a/lib/libsceDdr_driver.a b/lib/libsceDdr_driver.a index fc8b51dfde24d02ee4115a2f957940d9900fc5e9..eb0a1a474743a8e9df59fe2a754feaeea02577b7 100644 GIT binary patch delta 229 zcmbPNGOuKU44avmshO$8Mx_8|D06cKGaCz(Jy}AdX!AFA4VWC5KaCreZ^nz7^0&#t_{L!K!xZ8C%`GZ@P`iycOK8l3vv+7C*b({&_75WjdxlvXGXNyx BI{E+r diff --git a/lib/libsceDmac.a b/lib/libsceDmac.a index d7d6966eabba0a18cd6fab150d3c1ab285953d9b..528efc2dbab22f2a4bc9bb409e9bcdd9589d6764 100644 GIT binary patch delta 51 pcmZ1`zD#_A44avmshO$yM5P)iYvYnn%uwd$IV@dpwhl)XGXQw|4hR4M delta 51 pcmZ1`zD#_A44Z+4ftk7CM5P)iYvYnn%uwd$IV@dpwhl)XGXQhL4b%Vt diff --git a/lib/libsceDmacplus_driver.a b/lib/libsceDmacplus_driver.a index 13896d9816e641a0a74062ac8a5714f3dd2cef4c..b7c1529ce399a4659bc2fc2a0ec92b816da07620 100644 GIT binary patch delta 319 zcmZph$JjQHae@q+nVG4Xsl`Sm304Txe6s_q7z>m=IYFdo^EplvW@LU9FDhS65YFG6 zAhHZaZJh*M4s4c|3@ZPcJe=y-(27T(`x}%+vft4gYd09Q2Eci6_^1(B~`2d delta 319 zcmZph$JjQHae@q+frWvYxzR=?304TxaI*ue7z>m=IYFdo^EplvW@LU9FN|*lmRA#m z^EW4mEQ6|r$kj=}<-lsSWKj9nsQ>@~ diff --git a/lib/libsceGpio_driver.a b/lib/libsceGpio_driver.a index 5906313d07726f7f16a309e70db1048d7b30837e..d5aba6269ae27a30bce1b4beb7161c7b9cfdb95f 100644 GIT binary patch delta 966 zcmey+%-Ge;I6QhaWHN@-4NeDP#|Zc$;E%;LnPoYaua+|(lH#DbF2qST28B<&rO3rjPL zQa$rZiWrKMQ{4+P^8-s$iz<-?T=UR%!j!sCPGl5g^UNztEh?Gp$!JyYo>~GmJRrZQ z1f~pXH?o<*SQP@bgB1DZr=-I4LM%tq3RlFSuMZ79Fg010NqVvZ6Z>WhrWK5AkYJx& zCnmP}5Azph1ixr=2FD*p#)8QcW&UFen91ebvM|;2G>SI!@TkCbgZL}>BN#WIQCq^u zjTC&7w+o?Y@)3?;oD5X7n1hdz6CS3MBgN#QMsKbY%VT292RT9rGl(bulaxbt!xSl~ zos9023pGR}4b2RZeQs!MYzFl&$b}Yi5X%|ULB?}|A_E#rZi-08N^EXYtU~cxi7MQy zo9AgvLz0tVw3y7#5xIGdP6Q)k%;bZdiy5;)hV!Au`Q%;tFbg){)5m7O8)Jk4n+w&M z7`c&>%;aBYFzu5;9+_Yc3u>gaF?qffN>H0vBl}hlDainH6axbjJ1~&cR8$a>%8`oHp`!jd|1?5HvGE}!hO%|S1rnr6EvcNAp-T{D zfeCRNBVu6a=8dTX141BmMhGz>MrMQrc9Od|c5bl!eZKF#yZ7FUBkA{%^s?4hY{j%x zSytqDC7-fP3~kVr<*fpM^FZ!1kpBi0p8%yAP&ok>+CcRTP(KD58^F>pVEGxaA_J=* z0DTLvW`X8AVEwl5_x2C&`@7xt!A{5Tu`lN?^!;|Q{kRkOifcHU*P`e>=-k}f?rwC0 zeRrpGFW?QnQEgeeLNz7RcO0_jm`1vOO(%jIM@FZ85<=?0I zM>EncyI%M=&$)$O0J~GHk9M+hDF}ZSmvX#5%?IJr(x${-pM9G`5JE->&np5Uo>-hu zPMDli7DOdj-ZbtKAvl((7_CVp=wCxnS2gh@4Z(;jOn%PBPv O*ON#!ZX}Ow(wG0DYBje2 diff --git a/lib/libsceI2c_driver.a b/lib/libsceI2c_driver.a index cae443d245905b595273bfb69cedb1b97a77f4c8..5777b48658f009c365a4f96af293a71ba7c47b86 100644 GIT binary patch delta 804 zcmexocg1dkjE|X_shO#{f`Wkp2q2RR3PuJdU{M8y1TF>!1`Y-W#y<=UY(ScG1p@=G z4+De13kC*}1_lNR1qKG`EtAi&%1oZe$yOhnS`v_-lara3?wg;I%21q~>S>hhn^;_u zS`<>0m{**eSrU|*oSIpNDu*ftG{iY4KRFw#cBo)bYH?}_lnqqxlA2VS?vcoumy(lO zRLr2SKiQB`b+Q8^=j1TP3v3XtZq{L9V}Y?P*z%YdGbiuo5TCq{kTLJ6Sr0>I8ofH_YCk}MET aGewC!gt41{Narw1ArcNW-GJQ$igf_%CdX(1 delta 593 zcmca&_s?#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oLvYy-5!e9&sJD zaYVs^cZ^Ou4{23`@Xfon{{XtZTz(JpGsW2?badI?|E*{QocE39CQfLC{1|&lz7VwB zXE;Xti9;->Wl-Y?!nu!$D1kVi)DQ{Sc?LP4=dA5NVSN1Oh(dAhp<&xUcelgR1(I7C zp>Y1VOpju1`F|5;$8iAiT)MNG8g~(!Ib#upuSpsH#}!XbOy%#37?s=2Uojl!!ctrlBufStartIndex; //0x00001F70 readIntBufs = intDataPtr->ctrlBufIndex - startBufIndex; //0x00001F74 if (readIntBufs < 0) { //0x00001F7C readIntBufs += 64; //0x00001F78 & 0x00001F80 } + dbg_printf("%d\n", __LINE__); intDataPtr->ctrlBufStartIndex = intDataPtr->ctrlBufIndex; //0x00001F8C if (reqBufReads < readIntBufs) { //0x00001F88 + dbg_printf("%d\n", __LINE__); startBufIndex = intDataPtr->ctrlBufIndex - reqBufReads; //0x00001F90 startBufIndex = (startBufIndex < 0) ? startBufIndex + CTRL_INTERNAL_CONTROLLER_BUFFERS : startBufIndex; //0x00001F98 & 0x00001F9C readIntBufs = reqBufReads; } } else { + dbg_printf("%d\n", __LINE__); suspendFlag = sceKernelCpuSuspendIntr(); //0x0000216C bufIndex = intDataPtr->ctrlBufIndex; //0x00002174 startBufIndex = bufIndex; //0x00002184 + dbg_printf("%d\n", __LINE__); if (reqBufReads < 64) { //0x00002178 + dbg_printf("%d\n", __LINE__); startBufIndex = bufIndex - reqBufReads; //0x0000218C startBufIndex = (startBufIndex < 0) ? startBufIndex + CTRL_INTERNAL_CONTROLLER_BUFFERS : startBufIndex; //0x00001F98 & 0x00001F9C readIntBufs = reqBufReads; //0x00001FA0 } } + dbg_printf("%d\n", __LINE__); if (arg3 != 0) { //0x00001FA4 ctrlBuf = (SceCtrlDataExt *)intDataPtr->sceCtrlBuf[arg3] + startBufIndex; //0x00002160 } @@ -2027,6 +2038,7 @@ static int _sceCtrlReadBuf(SceCtrlDataExt *pad, u8 reqBufReads, int arg3, u8 mod pspSetK1(oldK1); //0x000020B0 return readIntBufs; } + dbg_printf("%d\n", __LINE__); /* read internal data buffers. */ while (reqBufReads-- > 0) { //0x0000209C & 0x000020A0 pad->activeTime = ctrlBuf->activeTime; //0x00001FE4 & 0x00001FF0 @@ -2099,6 +2111,7 @@ static int _sceCtrlReadBuf(SceCtrlDataExt *pad, u8 reqBufReads, int arg3, u8 mod } } } + dbg_printf("%d\n", __LINE__); sceKernelCpuResumeIntr(suspendFlag); //0x000020A8 pspSetK1(oldK1); //0x000020B0 @@ -2110,11 +2123,11 @@ static int _sceCtrlReadBuf(SceCtrlDataExt *pad, u8 reqBufReads, int arg3, u8 mod * Exported in syslib */ int CtrlInit(void) { - dbg_init(1, FB_NONE, FAT_AFTER_SYSCON); + dbg_init(1, FB_AFTER_DISPLAY, FAT_NONE); dbg_printf("Ctrl_Start: %s\n", __FUNCTION__); - sceCtrlInit(); + //sceCtrlInit(); return SCE_ERROR_OK; } diff --git a/src/ctrl/ctrl_custom_VB_handler.c b/src/ctrl/ctrl_custom_VB_handler.c index 4c88781..bf0939b 100644 --- a/src/ctrl/ctrl_custom_VB_handler.c +++ b/src/ctrl/ctrl_custom_VB_handler.c @@ -2121,7 +2121,7 @@ static int _sceCtrlReadBuf(SceCtrlDataExt *pad, u8 reqBufReads, int arg3, u8 mod * Exported in syslib */ int CtrlInit(void) { - dbg_init(1, FB_NONE, FAT_AFTER_SYSCON); + dbg_init(1, FB_AFTER_DISPLAY, FAT_NONE); dbg_printf("Ctrl_Start: %s\n", __FUNCTION__); diff --git a/src/iofilemgr/iofilemgr.c b/src/iofilemgr/iofilemgr.c index 2e4330e..1bc9fba 100644 --- a/src/iofilemgr/iofilemgr.c +++ b/src/iofilemgr/iofilemgr.c @@ -727,6 +727,19 @@ int sceIoDevctl(const char *dev, unsigned int cmd, void *indata, int inlen, void int sceIoAssign(const char *dev, const char *blockDev, const char *fs, int mode, void* unk1, int unk2) { + int oldIntr; + asm("mfic %0, $0" : "=r" (oldIntr)); + asm("mtic $zero, $0"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); dbg_printf("Calling %s\n", __FUNCTION__); dbg_printf("Calling %s\n", __FUNCTION__); dbg_printf("Calling %s\n", __FUNCTION__); @@ -739,6 +752,7 @@ int sceIoAssign(const char *dev, const char *blockDev, const char *fs, int mode, dbg_printf("Calling %s\n", __FUNCTION__); dbg_printf("Calling %s\n", __FUNCTION__); dbg_printf("Calling %s\n", __FUNCTION__); + asm("mtic %0, $0" : : "r" (oldIntr)); return 0; char outDev[32]; char blkAliasName[32];