├── .github └── workflows │ ├── compilation.yml │ ├── docker.yml │ └── doxygen.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Dockerfile ├── Doxyfile ├── LICENSE ├── Makefile.am ├── README.md ├── bootstrap ├── build-and-install.sh ├── configure.ac ├── doc └── style.css ├── m4 ├── ax_prog_doxygen.m4 └── pspdev.m4 ├── src ├── Makefile.am ├── atrac3 │ ├── Makefile.am │ ├── pspatrac3.h │ └── sceAtrac3plus.S ├── audio │ ├── Makefile.am │ ├── pspaudio.h │ ├── pspaudio_kernel.h │ ├── pspaudiocodec.h │ ├── pspaudiolib.c │ ├── pspaudiolib.h │ ├── sceAudio.S │ ├── sceAudio_driver.S │ └── sceAudiocodec.S ├── base │ ├── AddPrxModule.cmake │ ├── CreatePBP.cmake │ ├── Makefile.am │ ├── as_reg_compat.h │ ├── build.mak │ ├── build_prx.mak │ ├── linkfile.prx.in │ ├── prxspecs │ ├── pspdev.cmake │ ├── pspimport.s │ ├── pspstub.s │ └── psptypes.h ├── ctrl │ ├── Makefile.am │ ├── pspctrl.h │ ├── pspctrl_kernel.h │ ├── sceCtrl.S │ └── sceCtrl_driver.S ├── debug │ ├── Makefile.am │ ├── bitmap.c │ ├── callstack.c │ ├── callstackget.S │ ├── exception.c │ ├── exception_asm.S │ ├── font.c │ ├── gdb-kernellib.c │ ├── gdb-stub.c │ ├── gdb-userlib.c │ ├── kprintf.c │ ├── profiler.c │ ├── pspdebug.h │ ├── pspdebugkb.c │ ├── pspdebugkb.h │ ├── scr_printf.c │ ├── screenshot.c │ ├── sio.c │ ├── stacktrace.c │ └── stdio.c ├── display │ ├── Makefile.am │ ├── pspdisplay.h │ ├── pspdisplay_kernel.h │ ├── sceDisplay.S │ └── sceDisplay_driver.S ├── dmac │ ├── Makefile.am │ ├── pspdmac.h │ └── sceDmac.S ├── fpu │ ├── Makefile.am │ ├── double.S │ ├── pspfpu.c │ └── pspfpu.h ├── ge │ ├── Makefile.am │ ├── pspge.h │ ├── sceGe_driver.S │ └── sceGe_user.S ├── gu │ ├── Makefile.am │ ├── doc │ │ └── commands.txt │ ├── guInternal.c │ ├── guInternal.h │ ├── pspgu.h │ ├── resetValues.c │ ├── sceGuAlphaFunc.c │ ├── sceGuAmbient.c │ ├── sceGuAmbientColor.c │ ├── sceGuBeginObject.c │ ├── sceGuBlendFunc.c │ ├── sceGuBoneMatrix.c │ ├── sceGuBreak.c │ ├── sceGuCallList.c │ ├── sceGuCallMode.c │ ├── sceGuCheckList.c │ ├── sceGuClear.c │ ├── sceGuClearColor.c │ ├── sceGuClearDepth.c │ ├── sceGuClearStencil.c │ ├── sceGuClutLoad.c │ ├── sceGuClutMode.c │ ├── sceGuColor.c │ ├── sceGuColorFunc.c │ ├── sceGuColorMaterial.c │ ├── sceGuContinue.c │ ├── sceGuCopyImage.c │ ├── sceGuDepthBuffer.c │ ├── sceGuDepthFunc.c │ ├── sceGuDepthMask.c │ ├── sceGuDepthOffset.c │ ├── sceGuDepthRange.c │ ├── sceGuDisable.c │ ├── sceGuDispBuffer.c │ ├── sceGuDisplay.c │ ├── sceGuDrawArray.c │ ├── sceGuDrawArrayN.c │ ├── sceGuDrawBezier.c │ ├── sceGuDrawBuffer.c │ ├── sceGuDrawBufferList.c │ ├── sceGuDrawSpline.c │ ├── sceGuEnable.c │ ├── sceGuEndObject.c │ ├── sceGuFinish.c │ ├── sceGuFinishId.c │ ├── sceGuFog.c │ ├── sceGuFrontFace.c │ ├── sceGuGetAllStatus.c │ ├── sceGuGetMemory.c │ ├── sceGuGetStatus.c │ ├── sceGuInit.c │ ├── sceGuLight.c │ ├── sceGuLightAtt.c │ ├── sceGuLightColor.c │ ├── sceGuLightMode.c │ ├── sceGuLightSpot.c │ ├── sceGuLogicalOp.c │ ├── sceGuMaterial.c │ ├── sceGuModelColor.c │ ├── sceGuMorphWeight.c │ ├── sceGuOffset.c │ ├── sceGuPatchDivide.c │ ├── sceGuPatchFrontFace.c │ ├── sceGuPatchPrim.c │ ├── sceGuPixelMask.c │ ├── sceGuScissor.c │ ├── sceGuSendCommandf.c │ ├── sceGuSendCommandi.c │ ├── sceGuSendList.c │ ├── sceGuSetAllStatus.c │ ├── sceGuSetCallback.c │ ├── sceGuSetDither.c │ ├── sceGuSetMatrix.c │ ├── sceGuSetStatus.c │ ├── sceGuShadeModel.c │ ├── sceGuSignal.c │ ├── sceGuSpecular.c │ ├── sceGuStart.c │ ├── sceGuStencilFunc.c │ ├── sceGuStencilOp.c │ ├── sceGuSwapBuffers.c │ ├── sceGuSync.c │ ├── sceGuTerm.c │ ├── sceGuTexEnvColor.c │ ├── sceGuTexFilter.c │ ├── sceGuTexFlush.c │ ├── sceGuTexFunc.c │ ├── sceGuTexImage.c │ ├── sceGuTexLevelMode.c │ ├── sceGuTexMapMode.c │ ├── sceGuTexMode.c │ ├── sceGuTexOffset.c │ ├── sceGuTexProjMapMode.c │ ├── sceGuTexScale.c │ ├── sceGuTexSlope.c │ ├── sceGuTexSync.c │ ├── sceGuTexWrap.c │ ├── sceGuViewport.c │ └── vram.c ├── gum │ ├── Makefile.am │ ├── gumInternal.c │ ├── gumInternal.h │ ├── pspgum.c │ ├── pspgum.h │ └── pspgum_vfpu.c ├── hprm │ ├── Makefile.am │ ├── psphprm.h │ ├── sceHprm.S │ └── sceHprm_driver.S ├── kernel │ ├── ExceptionManagerForKernel.S │ ├── InitForKernel.S │ ├── InterruptManagerForKernel.S │ ├── IoFileMgrForKernel.S │ ├── KDebugForKernel.S │ ├── LoadCoreForKernel.S │ ├── LoadExecForKernel.S │ ├── Makefile.am │ ├── ModuleMgrForKernel.S │ ├── StdioForKernel.S │ ├── SysMemForKernel.S │ ├── SysTimerForKernel.S │ ├── SysclibForKernel.S │ ├── ThreadManForKernel.S │ ├── UtilsForKernel.S │ ├── pspaudiorouting.h │ ├── pspexception.h │ ├── pspidstorage.h │ ├── pspimpose_driver.h │ ├── pspinit.h │ ├── pspintrman_kernel.h │ ├── pspiofilemgr_kernel.h │ ├── pspkdebug.h │ ├── pspkernel.h │ ├── psploadcore.h │ ├── psploadexec_kernel.h │ ├── pspmodulemgr_kernel.h │ ├── pspstdio_kernel.h │ ├── pspsysclib.h │ ├── pspsyscon.h │ ├── pspsysevent.h │ ├── pspsysmem_kernel.h │ ├── pspsysreg.h │ ├── pspsystimer.h │ ├── pspthreadman_kernel.h │ ├── psputilsforkernel.h │ ├── sceAudioRouting_driver.S │ ├── sceIdStorage_driver.S │ ├── sceImpose_driver.S │ ├── sceSysEventForKernel.S │ ├── sceSyscon_driver.S │ └── sceSysreg_driver.S ├── libcglue │ ├── Makefile.am │ ├── arpa │ │ └── inet.h │ ├── cwd.c │ ├── errno.c │ ├── fdman.c │ ├── fdman.h │ ├── glue.c │ ├── init.c │ ├── lock.c │ ├── mutexman.c │ ├── netdb.c │ ├── netdb.h │ ├── netinet │ │ ├── in.h │ │ └── tcp.h │ ├── pipe.c │ ├── select.c │ ├── sleep.c │ ├── socket.c │ ├── sys │ │ ├── ioctl.h │ │ └── socket.h │ └── timezone.c ├── libpthreadglue │ ├── Makefile.am │ ├── osal.c │ └── tls-helper.c ├── modinfo │ ├── Makefile.am │ └── modinfo.S ├── mp3 │ ├── Makefile.am │ ├── pspmp3.h │ └── sceMp3.S ├── mpeg │ ├── Makefile.am │ ├── pspjpeg.h │ ├── pspmpeg.h │ ├── pspmpegbase.h │ ├── sceJpeg.S │ ├── sceMpeg.S │ ├── sceMpegbase.S │ └── sceMpegbase_driver.S ├── nand │ ├── Makefile.am │ ├── pspnand_driver.h │ └── sceNand_driver.S ├── net │ ├── Makefile.am │ ├── psphttp.h │ ├── pspnet.h │ ├── pspnet_adhoc.h │ ├── pspnet_adhocctl.h │ ├── pspnet_adhocmatching.h │ ├── pspnet_apctl.h │ ├── pspnet_inet.h │ ├── pspnet_resolver.h │ ├── pspssl.h │ ├── sceHttp.S │ ├── sceNet.S │ ├── sceNetAdhoc.S │ ├── sceNetAdhocMatching.S │ ├── sceNetAdhocctl.S │ ├── sceNetApctl.S │ ├── sceNetInet.S │ ├── sceNetResolver.S │ ├── sceNet_lib.S │ └── sceSsl.S ├── openpsid │ ├── Makefile.am │ ├── pspopenpsid.h │ └── sceOpenPSID.S ├── power │ ├── Makefile.am │ ├── psppower.h │ ├── scePower.S │ └── scePower_driver.S ├── prof │ ├── Makefile.am │ ├── mcount.s │ ├── prof.c │ └── pspprof.h ├── registry │ ├── Makefile.am │ ├── pspreg.h │ ├── sceReg.S │ └── sceReg_driver.S ├── rtc │ ├── Makefile.am │ ├── psprtc.h │ ├── sceRtc.S │ └── sceRtc_driver.S ├── samples │ ├── Makefile.am │ ├── Makefile.samples │ ├── audio │ │ ├── polyphonic │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ └── wavegen │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── controller │ │ └── basic │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── debug │ │ ├── debugkb │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── exception │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── gdb │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── kprintf │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── profiler │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── prxdecrypt │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── screenshot │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ └── sio │ │ │ ├── Makefile.sample │ │ │ ├── main.c │ │ │ └── readme.txt │ ├── exceptions │ │ ├── Makefile.sample │ │ └── main.cpp │ ├── gprof │ │ ├── basic │ │ │ ├── Makefile.sample │ │ │ ├── README.md │ │ │ └── main.c │ │ └── custom │ │ │ ├── Makefile.sample │ │ │ ├── README.md │ │ │ └── main.c │ ├── gu │ │ ├── beginobject │ │ │ ├── Makefile.sample │ │ │ └── beginobject.c │ │ ├── blend │ │ │ ├── Makefile.sample │ │ │ └── blend.c │ │ ├── blit │ │ │ ├── Makefile.sample │ │ │ └── blit.c │ │ ├── celshading │ │ │ ├── Makefile.sample │ │ │ ├── celshading.c │ │ │ └── lightmap.raw │ │ ├── clut │ │ │ ├── Makefile.sample │ │ │ └── clut.c │ │ ├── common │ │ │ ├── callbacks.c │ │ │ ├── callbacks.h │ │ │ ├── geometry.c │ │ │ ├── geometry.h │ │ │ ├── menu.c │ │ │ └── menu.h │ │ ├── copy │ │ │ ├── Makefile.sample │ │ │ └── copy.c │ │ ├── cube │ │ │ ├── Makefile.sample │ │ │ ├── cube.c │ │ │ └── logo.raw │ │ ├── doublelist │ │ │ ├── Makefile.sample │ │ │ └── doublelist.c │ │ ├── envmap │ │ │ ├── Makefile.sample │ │ │ ├── env0.raw │ │ │ └── envmap.c │ │ ├── integerdrawing │ │ │ ├── Makefile.sample │ │ │ └── integerdrawing.c │ │ ├── lights │ │ │ ├── Makefile.sample │ │ │ └── lights.c │ │ ├── lines │ │ │ ├── Makefile.sample │ │ │ └── lines.c │ │ ├── logic │ │ │ ├── Makefile.sample │ │ │ └── logic.c │ │ ├── mipmapping │ │ │ ├── Makefile.sample │ │ │ ├── mip0.png │ │ │ ├── mip0.raw │ │ │ ├── mip1.png │ │ │ ├── mip1.raw │ │ │ ├── mip2.png │ │ │ ├── mip2.raw │ │ │ └── mipmapping.c │ │ ├── morph │ │ │ ├── Makefile.sample │ │ │ └── morph.c │ │ ├── morphskin │ │ │ ├── Makefile.sample │ │ │ └── morphskin.c │ │ ├── ortho │ │ │ ├── Makefile.sample │ │ │ └── ortho.c │ │ ├── reflection │ │ │ ├── Makefile.sample │ │ │ └── reflection.c │ │ ├── rendertarget │ │ │ ├── Makefile.sample │ │ │ └── rendertarget.c │ │ ├── scissor │ │ │ ├── Makefile.sample │ │ │ └── scissor.c │ │ ├── shadowprojection │ │ │ ├── Makefile.sample │ │ │ └── shadowprojection.c │ │ ├── signals │ │ │ ├── Makefile.sample │ │ │ ├── ball.raw │ │ │ └── signals.c │ │ ├── skinning │ │ │ ├── Makefile.sample │ │ │ └── skinning.c │ │ ├── speed │ │ │ ├── Makefile.sample │ │ │ └── speed.c │ │ ├── spharm │ │ │ ├── Image1.raw │ │ │ ├── Image2.raw │ │ │ ├── Makefile.sample │ │ │ ├── cube.c │ │ │ ├── disablefpu.S │ │ │ ├── logo.raw │ │ │ ├── mt19937.c │ │ │ ├── mt19937.h │ │ │ ├── readme │ │ │ └── spharm.c │ │ ├── splinesurface │ │ │ ├── Makefile.sample │ │ │ └── splinesurface.c │ │ ├── sprite │ │ │ ├── Makefile.sample │ │ │ ├── ball.raw │ │ │ └── sprite.c │ │ ├── text │ │ │ ├── Makefile.sample │ │ │ ├── font.raw │ │ │ └── main.c │ │ ├── timing │ │ │ ├── Makefile.sample │ │ │ └── timing.c │ │ ├── vertex │ │ │ ├── Makefile.sample │ │ │ └── vertex.c │ │ └── zbufferfog │ │ │ ├── Makefile.sample │ │ │ └── zbufferfog.c │ ├── ir │ │ ├── irda │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ └── sircs │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── kernel │ │ ├── cwd │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── fileio │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── idstorage │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── kdumper │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── loadmodule │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── messagebox │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── regenum │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── registry │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── sysevent │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── systimer │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ └── threadstatus │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── libcglue │ │ └── light_elf │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── me │ │ └── basic │ │ │ ├── Makefile.sample │ │ │ ├── main.c │ │ │ └── me.S │ ├── mp3 │ │ ├── Makefile.sample │ │ ├── Test.mp3 │ │ └── main.c │ ├── ms │ │ └── callback │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── nand │ │ └── dumpipl │ │ │ ├── Makefile.sample │ │ │ ├── README │ │ │ └── main.c │ ├── net │ │ ├── resolver │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── simple │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── simple_prx │ │ │ ├── Makefile.sample │ │ │ ├── exports.exp │ │ │ └── main.c │ │ ├── wlanscan │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ └── wlanscan_elf │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── power │ │ ├── Makefile.sample │ │ └── main.c │ ├── prx │ │ ├── image_display │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── prx_loader │ │ │ ├── Makefile.sample │ │ │ ├── MyLib.S │ │ │ └── main.c │ │ └── testprx │ │ │ ├── Makefile.sample │ │ │ ├── exports.exp │ │ │ └── main.c │ ├── savedata │ │ ├── decrypt │ │ │ ├── Makefile.sample │ │ │ ├── README.txt │ │ │ ├── decrypt.c │ │ │ ├── decrypt.h │ │ │ └── main.c │ │ ├── encrypt │ │ │ ├── Makefile.sample │ │ │ ├── README.txt │ │ │ ├── encrypt.c │ │ │ ├── encrypt.h │ │ │ ├── hash.c │ │ │ ├── hash.h │ │ │ ├── main.c │ │ │ ├── psf.c │ │ │ └── psf.h │ │ └── utility │ │ │ ├── Makefile.sample │ │ │ ├── data.h │ │ │ └── main.c │ ├── template │ │ ├── elf_template │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── kprx_template │ │ │ ├── Makefile.sample │ │ │ ├── exports.exp │ │ │ └── main.c │ │ ├── lib_template │ │ │ ├── Makefile.sample │ │ │ ├── template.c │ │ │ └── template.h │ │ └── prx_template │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── usb │ │ └── storage │ │ │ ├── Makefile.sample │ │ │ └── main.c │ ├── utility │ │ ├── gamesharing │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── htmlviewer │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── msgdialog │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── netconf │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── netdialog │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ ├── osk │ │ │ ├── Makefile.sample │ │ │ └── main.c │ │ └── systemparam │ │ │ ├── Makefile.sample │ │ │ └── main.c │ └── wlan │ │ ├── Makefile.sample │ │ └── main.c ├── sdk │ ├── Makefile.am │ ├── fixup.c │ ├── fpu.S │ ├── inethelper.c │ ├── interrupt.S │ ├── k1set.S │ ├── loadmodule.c │ ├── memory.c │ ├── modulemgr_patches.c │ ├── pspsdk.h │ ├── query_mod.c │ └── threadutils.c ├── sircs │ ├── Makefile.am │ ├── pspsircs.h │ └── sceSircs.S ├── startup │ ├── Makefile.am │ ├── crt0.c │ ├── crt0_prx.c │ ├── dummy.c │ └── prxexports.c ├── umd │ ├── Makefile.am │ ├── pspumd.h │ ├── sceUmd.S │ └── sceUmdUser.S ├── usb │ ├── Makefile.am │ ├── pspusb.h │ ├── pspusbacc.h │ ├── pspusbbus.h │ ├── pspusbcam.h │ ├── sceUsb.S │ ├── sceUsbBus_driver.S │ ├── sceUsbCam.S │ └── sceUsb_driver.S ├── usbstor │ ├── Makefile.am │ ├── pspusbstor.h │ ├── sceUsbstor.S │ └── sceUsbstorBoot.S ├── user │ ├── InterruptManager.S │ ├── IoFileMgrForUser.S │ ├── Kernel_Library.S │ ├── LoadExecForUser.S │ ├── Makefile.am │ ├── ModuleMgrForUser.S │ ├── StdioForUser.S │ ├── SysMemUserForUser.S │ ├── ThreadManForUser.S │ ├── UtilsForUser.S │ ├── pspintrman.c │ ├── pspintrman.h │ ├── pspiofilemgr.h │ ├── pspiofilemgr_devctl.h │ ├── pspiofilemgr_dirent.h │ ├── pspiofilemgr_fcntl.h │ ├── pspiofilemgr_stat.h │ ├── pspkerneltypes.h │ ├── pspkerror.h │ ├── psploadexec.h │ ├── pspmoduleexport.h │ ├── pspmoduleinfo.h │ ├── pspmodulemgr.h │ ├── pspmscm.h │ ├── pspstdio.h │ ├── pspsuspend.h │ ├── pspsysmem.h │ ├── pspthreadman.h │ ├── pspuser.h │ ├── psputils.h │ ├── sceImpose.S │ └── sceSuspendForUser.S ├── utility │ ├── Makefile.am │ ├── psputility.h │ ├── psputility_avmodules.h │ ├── psputility_gamesharing.h │ ├── psputility_htmlviewer.h │ ├── psputility_modules.h │ ├── psputility_msgdialog.h │ ├── psputility_netconf.h │ ├── psputility_netmodules.h │ ├── psputility_netparam.h │ ├── psputility_osk.h │ ├── psputility_savedata.h │ ├── psputility_sysparam.h │ ├── psputility_usbmodules.h │ ├── sceUtility.S │ └── sceUtility_netparam_internal.S ├── vaudio │ ├── Makefile.am │ ├── pspvaudio.h │ └── sceVaudio.S ├── vfpu │ ├── Makefile.am │ ├── pspvfpu.c │ └── pspvfpu.h ├── video │ ├── Makefile.am │ ├── pspvideocodec.h │ └── sceVideocodec.S ├── vsh │ ├── Makefile.am │ ├── pspchnnlsv.h │ ├── sceChnnlsv.S │ ├── scePaf.S │ └── sceVshBridge.S └── wlan │ ├── Makefile.am │ ├── pspwlan.h │ ├── sceWlanDrv.S │ └── sceWlanDrv_lib.S └── tools ├── Makefile.am ├── PrxEncrypter ├── LICENSE ├── Makefile.am ├── crypto.c ├── crypto.h ├── endian_.h ├── kirk_engine.c ├── kirk_engine.h ├── main.c ├── psp_headers.h └── types.h ├── bin2c.c ├── bin2o.c ├── bin2s.c ├── elftypes.h ├── getopt.h ├── getopt_long.c ├── mksfo.c ├── mksfoex.c ├── pack-pbp.c ├── prxtypes.h ├── psp-build-exports.c ├── psp-config.c ├── psp-create-license-directory ├── psp-fixup-imports.c ├── psp-prxgen.c ├── sha1.c ├── sha1.h ├── types.h └── unpack-pbp.c /.github/workflows/compilation.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | repository_dispatch: 7 | types: [run_build] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | container: ghcr.io/pspdev/psptoolchain:latest 13 | steps: 14 | 15 | - name: Install dependencies 16 | run: | 17 | apk add build-base autoconf automake zlib-dev bash git 18 | 19 | - uses: actions/checkout@v4 20 | 21 | - name: Compile PSPSDK 22 | run: | 23 | chown -R $(id -nu):$(id -ng) . 24 | export PSPDEV=/usr/local/pspdev 25 | export PATH=$PATH:$PSPDEV/bin 26 | ./build-and-install.sh 27 | 28 | - name: Get short SHA 29 | id: slug 30 | run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT 31 | 32 | - name: Compile Examples 33 | run: | 34 | cd src/samples && make -f Makefile.samples 35 | 36 | - name: Compress Samples folder folder 37 | run: | 38 | tar -zcvf samples.tar.gz src/samples 39 | 40 | - name: Upload Samples artifacts 41 | if: ${{ success() }} 42 | uses: actions/upload-artifact@v4 43 | with: 44 | name: samples-${{ steps.slug.outputs.sha8 }} 45 | path: samples.tar.gz 46 | -------------------------------------------------------------------------------- /.github/workflows/doxygen.yml: -------------------------------------------------------------------------------- 1 | name: doxygen on github pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v4 14 | 15 | - name: Prepare Doxyfile 16 | run: | 17 | sed -e 's/\$(PROJECT)/PSPSDK/' \ 18 | -e 's/\$(VERSION)/'`date +"%Y-%m-%d" | xargs echo -n`'/' \ 19 | -e 's/\$(SRCDIR)/src/g' \ 20 | -e 's/\$(GENERATE_LATEX)/NO/' \ 21 | -e 's/\$(HAVE_DOT)/YES/' \ 22 | -e 's/Helvetica/FreeSans/' \ 23 | -i Doxyfile 24 | 25 | - name: Doxygen documentation generation 26 | uses: mattnotmitt/doxygen-action@v1 27 | 28 | - name: Deploy 29 | uses: peaceiris/actions-gh-pages@v3 30 | with: 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | publish_dir: ./doc/build/html 33 | force_orphan: true 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | doc/build 2 | 3 | *.o 4 | *.a 5 | *~ 6 | *.elf 7 | *.prx 8 | 9 | tools/PrxEncrypter/PrxEncrypter 10 | tools/bin2c 11 | tools/bin2o 12 | tools/bin2s 13 | tools/mksfo 14 | tools/mksfoex 15 | tools/pack-pbp 16 | tools/psp-build-exports 17 | tools/psp-config 18 | tools/psp-fixup-imports 19 | tools/psp-prxgen 20 | tools/unpack-pbp 21 | 22 | Makefile.in 23 | Makefile 24 | .deps/ 25 | .vscode/ 26 | aclocal.m4 27 | autom4te.cache/ 28 | compile 29 | config.h 30 | config.h.in 31 | config.log 32 | config.status 33 | configure 34 | depcomp 35 | install-sh 36 | missing 37 | src/base/linkfile.prx 38 | stamp-h1 39 | .clang-format 40 | compile_flags.txt 41 | EBOOT.PBP 42 | PARAM.SFO 43 | VERSION 44 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # First stage 2 | ARG BASE_DOCKER_IMAGE 3 | 4 | FROM $BASE_DOCKER_IMAGE 5 | 6 | COPY . /src 7 | 8 | RUN apk add build-base autoconf automake zlib-dev bash git && \ 9 | /src/build-and-install.sh 10 | 11 | # Second stage 12 | FROM alpine:latest 13 | 14 | ENV PSPDEV /usr/local/pspdev 15 | ENV PATH $PATH:${PSPDEV}/bin 16 | 17 | COPY --from=0 ${PSPDEV} ${PSPDEV} 18 | RUN apk add --no-cache build-base bash acl sudo fakeroot curl patch gpgme-dev libarchive-tools libarchive-dev xz \ 19 | openssl-dev git bison autoconf automake tcl-dev libtool cmake doxygen texinfo flex pkgconf libcrypto3 20 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | SUBDIRS = src tools 4 | 5 | MOSTLYCLEANFILES = $(DX_CLEANFILES) 6 | 7 | EXTRA_DIST = LICENSE VERSION README.md Doxyfile doc 8 | 9 | @DX_RULES@ 10 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | atrac3 \ 3 | audio \ 4 | base \ 5 | ctrl \ 6 | debug \ 7 | display \ 8 | dmac \ 9 | fpu \ 10 | ge \ 11 | gu \ 12 | gum \ 13 | hprm \ 14 | kernel \ 15 | libcglue \ 16 | libpthreadglue \ 17 | modinfo \ 18 | mp3 \ 19 | mpeg \ 20 | nand \ 21 | net \ 22 | openpsid \ 23 | power \ 24 | prof \ 25 | registry \ 26 | rtc \ 27 | sircs \ 28 | sdk \ 29 | startup \ 30 | umd \ 31 | usb \ 32 | usbstor \ 33 | user \ 34 | vaudio \ 35 | utility \ 36 | vfpu \ 37 | video \ 38 | vsh \ 39 | wlan \ 40 | samples 41 | -------------------------------------------------------------------------------- /src/atrac3/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | ATRAC3_OBJS = sceAtrac3plus_0000.o sceAtrac3plus_0001.o sceAtrac3plus_0002.o sceAtrac3plus_0003.o sceAtrac3plus_0004.o sceAtrac3plus_0005.o sceAtrac3plus_0006.o sceAtrac3plus_0007.o sceAtrac3plus_0008.o sceAtrac3plus_0009.o sceAtrac3plus_0010.o sceAtrac3plus_0011.o sceAtrac3plus_0012.o sceAtrac3plus_0013.o sceAtrac3plus_0014.o sceAtrac3plus_0015.o sceAtrac3plus_0016.o sceAtrac3plus_0017.o sceAtrac3plus_0018.o sceAtrac3plus_0019.o sceAtrac3plus_0020.o sceAtrac3plus_0021.o sceAtrac3plus_0022.o sceAtrac3plus_0023.o sceAtrac3plus_0024.o sceAtrac3plus_0025.o 14 | 15 | libpspatrac3includedir = @PSPSDK_INCLUDEDIR@ 16 | libpspatrac3include_HEADERS = pspatrac3.h 17 | 18 | lib_LIBRARIES = libpspatrac3.a 19 | libpspatrac3_a_SOURCES = sceAtrac3plus.S 20 | libpspatrac3_a_LIBADD = $(ATRAC3_OBJS) 21 | 22 | $(ATRAC3_OBJS): sceAtrac3plus.S 23 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 24 | -------------------------------------------------------------------------------- /src/audio/pspaudiocodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspaudiocodec.h - Prototypes for the sceAudiocodec library. 7 | * 8 | * Copyright (c) 2006 hitchhikr 9 | * 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #define PSP_CODEC_AT3PLUS (0x00001000) 17 | #define PSP_CODEC_AT3 (0x00001001) 18 | #define PSP_CODEC_MP3 (0x00001002) 19 | #define PSP_CODEC_AAC (0x00001003) 20 | 21 | 22 | int sceAudiocodecCheckNeedMem(unsigned long *Buffer, int Type); 23 | int sceAudiocodecInit(unsigned long *Buffer, int Type); 24 | int sceAudiocodecDecode(unsigned long *Buffer, int Type); 25 | int sceAudiocodecGetEDRAM(unsigned long *Buffer, int Type); 26 | int sceAudiocodecReleaseEDRAM(unsigned long *Buffer); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /src/audio/sceAudiocodec.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceAudiocodec_0000 6 | IMPORT_START "sceAudiocodec",0x40090000 7 | #endif 8 | #ifdef F_sceAudiocodec_0001 9 | IMPORT_FUNC "sceAudiocodec",0x9D3F790C,sceAudiocodecCheckNeedMem 10 | #endif 11 | #ifdef F_sceAudiocodec_0002 12 | IMPORT_FUNC "sceAudiocodec",0x5B37EB1D,sceAudiocodecInit 13 | #endif 14 | #ifdef F_sceAudiocodec_0003 15 | IMPORT_FUNC "sceAudiocodec",0x70A703F8,sceAudiocodecDecode 16 | #endif 17 | #ifdef F_sceAudiocodec_0004 18 | IMPORT_FUNC "sceAudiocodec",0x8ACA11D5,sceAudiocodecGetInfo 19 | #endif 20 | #ifdef F_sceAudiocodec_0005 21 | IMPORT_FUNC "sceAudiocodec",0x6CD2A861,sceAudiocodec_6CD2A861 22 | #endif 23 | #ifdef F_sceAudiocodec_0006 24 | IMPORT_FUNC "sceAudiocodec",0x59176A0F,sceAudiocodec_59176A0F 25 | #endif 26 | #ifdef F_sceAudiocodec_0007 27 | IMPORT_FUNC "sceAudiocodec",0x3A20A200,sceAudiocodecGetEDRAM 28 | #endif 29 | #ifdef F_sceAudiocodec_0008 30 | IMPORT_FUNC "sceAudiocodec",0x29681260,sceAudiocodecReleaseEDRAM 31 | #endif 32 | -------------------------------------------------------------------------------- /src/base/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | pspsdkincludedir = @PSPSDK_INCLUDEDIR@ 3 | 4 | pspsdkinclude_HEADERS = \ 5 | as_reg_compat.h \ 6 | psptypes.h \ 7 | pspstub.s \ 8 | pspimport.s 9 | 10 | ## Install the build.mak fragment to $PSPSDK/lib. 11 | buildmakdir = @PSPSDK_LIBDIR@ 12 | buildmak_DATA = build.mak prxspecs 13 | 14 | buildmakprxdir = @PSPSDK_LIBDIR@ 15 | buildmakprx_DATA = build_prx.mak linkfile.prx 16 | 17 | ## Install the cmake toolchain config to $PSPDEV/share 18 | buildmakcmakedir = @PSPDEV_SHAREDIR@ 19 | buildmakcmake_DATA = pspdev.cmake CreatePBP.cmake AddPrxModule.cmake 20 | 21 | EXTRA_DIST = build.mak prxspecs build_prx.mak linkfile.prx pspdev.cmake 22 | -------------------------------------------------------------------------------- /src/base/prxspecs: -------------------------------------------------------------------------------- 1 | *startfile: 2 | crt0_prx%O%s crti%O%s crtbegin%O%s 3 | -------------------------------------------------------------------------------- /src/debug/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base \ 10 | -I$(top_srcdir)/src/kernel \ 11 | -I$(top_srcdir)/src/display \ 12 | -I$(top_srcdir)/src/ge \ 13 | -I$(top_srcdir)/src/user \ 14 | -I$(top_srcdir)/src/ctrl 15 | CFLAGS = @PSPSDK_CFLAGS@ 16 | CCASFLAGS = $(CFLAGS) 17 | 18 | SCRPRINT_OBJS = pspDebugScreenInit.o pspDebugScreenPrintf.o pspDebugScreenKprintf.o 19 | 20 | libpspdebugincludedir = @PSPSDK_INCLUDEDIR@ 21 | libpspdebuginclude_HEADERS = \ 22 | pspdebug.h pspdebugkb.h 23 | 24 | lib_LIBRARIES = libpspdebug.a libpspgdb.a libpspgdb_user.a libpspgdb_kernel.a libpspdebugkb.a 25 | 26 | libpspdebug_a_SOURCES = \ 27 | bitmap.c \ 28 | callstack.c \ 29 | callstackget.S \ 30 | font.c \ 31 | scr_printf.c \ 32 | exception.c \ 33 | exception_asm.S \ 34 | kprintf.c \ 35 | stacktrace.c \ 36 | profiler.c \ 37 | screenshot.c \ 38 | stdio.c \ 39 | sio.c 40 | 41 | libpspdebug_a_LIBADD = $(SCRPRINT_OBJS) 42 | 43 | libpspgdb_a_SOURCES = gdb-stub.c 44 | 45 | libpspgdb_user_a_SOURCES = gdb-userlib.c 46 | 47 | libpspgdb_kernel_a_SOURCES = gdb-kernellib.c 48 | 49 | libpspdebugkb_a_SOURCES = pspdebugkb.c 50 | 51 | $(SCRPRINT_OBJS): scr_printf.c 52 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 53 | -------------------------------------------------------------------------------- /src/debug/kprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * kprintf.c - Basic Kprintf handling for applications. 7 | * 8 | * Copyright (c) 2005 James Forshaw 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | /* The current kprintf handler */ 16 | static PspDebugKprintfHandler curr_handler; 17 | 18 | int sceKernelRegisterKprintfHandler(void *func, void *args); 19 | 20 | /* Default kprintf handler */ 21 | static void _pspDebugDefaultKprintfHandler(const char *format, u32 *args) 22 | { 23 | pspDebugScreenPrintf(format, args[0], args[1], args[2], args[3]); 24 | } 25 | 26 | /* The registered kprintf handler */ 27 | static void _pspDebugKprintfHandler(void *arg, const char *format, u32 *args) 28 | { 29 | if(curr_handler != NULL) 30 | { 31 | curr_handler(format, args); 32 | } 33 | else 34 | { 35 | _pspDebugDefaultKprintfHandler(format, args); 36 | } 37 | } 38 | 39 | /* Install a kprintf handler */ 40 | int pspDebugInstallKprintfHandler(PspDebugKprintfHandler handler) 41 | { 42 | curr_handler = handler; 43 | return sceKernelRegisterKprintfHandler(_pspDebugKprintfHandler, NULL); 44 | } 45 | -------------------------------------------------------------------------------- /src/debug/screenshot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * screenshot.c - Simple screen debug keyboard 7 | * 8 | * Copyright (c) 2025, Francisco Javier Trujillo Mata 9 | * 10 | */ 11 | 12 | #include "pspdebug.h" 13 | #include "pspdisplay.h" 14 | #include "pspuser.h" 15 | 16 | #define PSP_SCREEN_HEIGHT 272 17 | 18 | int bitmapWrite(void *frame_addr, int format, const char *file); 19 | 20 | int pspScreenshotSave(const char *filename) 21 | { 22 | void* buff; 23 | int bufferwidth, pixelformat; 24 | 25 | int ret = sceDisplayGetFrameBuf(&buff, &bufferwidth, &pixelformat, PSP_DISPLAY_SETBUF_NEXTHSYNC); 26 | if (ret != 0 || buff == NULL || bufferwidth == 0) { 27 | return -1; 28 | } 29 | 30 | // write the screenshot to the file 31 | return bitmapWrite(buff, pixelformat, filename); 32 | } -------------------------------------------------------------------------------- /src/dmac/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | DMAC_OBJS = sceDmac_0000.o sceDmac_0001.o sceDmac_0002.o 14 | 15 | libpspdmacincludedir = @PSPSDK_INCLUDEDIR@ 16 | libpspdmacinclude_HEADERS = pspdmac.h 17 | 18 | lib_LIBRARIES = libpspdmac.a 19 | libpspdmac_a_SOURCES = sceDmac.S 20 | libpspdmac_a_LIBADD = $(DMAC_OBJS) 21 | 22 | $(DMAC_OBJS): sceDmac.S 23 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 24 | -------------------------------------------------------------------------------- /src/dmac/pspdmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - http://www.pspdev.org 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * dmac.c - A DMAC function 7 | * 8 | * Copyright (c) 2016 173210 9 | */ 10 | 11 | #ifndef __DMAC_H__ 12 | #define __DMAC_H__ 13 | 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /** 21 | * Copy data in memory using DMAC 22 | * 23 | * @param dst - The pointer to the destination 24 | * @param src - The pointer to the source 25 | * @param n - The size of data 26 | * 27 | * @return 0 on success; otherwise an error code 28 | */ 29 | int sceDmacMemcpy(void *dst, const void *src, SceSize n); 30 | 31 | int sceDmacTryMemcpy(void *dst, const void *src, SceSize n); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/dmac/sceDmac.S: -------------------------------------------------------------------------------- 1 | #include "pspimport.s" 2 | 3 | #ifdef F_sceDmac_0000 4 | IMPORT_START "sceDmac", 0x40010011 5 | #endif 6 | #ifdef F_sceDmac_0001 7 | IMPORT_FUNC "sceDmac", 0x617F3FE6, sceDmacMemcpy 8 | #endif 9 | #ifdef F_sceDmac_0002 10 | IMPORT_FUNC "sceDmac", 0xD97F94D8, sceDmacTryMemcpy 11 | #endif 12 | -------------------------------------------------------------------------------- /src/fpu/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/debug -I$(top_srcdir)/src/user 10 | CFLAGS = @PSPSDK_CFLAGS@ -std=gnu99 -Wall -Wmissing-prototypes 11 | CCASFLAGS = $(CFLAGS) -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 12 | 13 | libpspfpuincludedir = @PSPSDK_INCLUDEDIR@ 14 | libpspfpuinclude_HEADERS = pspfpu.h 15 | 16 | lib_LIBRARIES = libpspfpu.a 17 | libpspfpu_a_SOURCES = pspfpu.c double.S 18 | libpspfpu_a_LIBADD = 19 | -------------------------------------------------------------------------------- /src/gu/guInternal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | GuContext gu_contexts[3]; 12 | int ge_list_executed[2]; 13 | void* ge_edram_address; 14 | GuSettings gu_settings; 15 | GuDisplayList* gu_list; 16 | int gu_curr_context; 17 | int gu_init; 18 | int gu_display_on; 19 | int gu_call_mode; 20 | int gu_states; 21 | GuDrawBuffer gu_draw_buffer; 22 | unsigned int* gu_object_stack[32]; 23 | int gu_object_stack_depth; 24 | 25 | GuLightSettings light_settings[4] = 26 | { 27 | { 28 | 0x18, 0x5f, 0x63, 0x64, 29 | 0x65, 0x6f, 0x70, 0x71, 30 | 0x8f, 0x90, 0x91, 0x7b, 31 | 0x7c, 0x7d, 0x87, 0x8b 32 | }, 33 | 34 | { 35 | 0x19, 0x60, 0x66, 0x67, 36 | 0x68, 0x72, 0x73, 0x74, 37 | 0x92, 0x93, 0x94, 0x7e, 38 | 0x7f, 0x80, 0x88, 0x8c 39 | }, 40 | 41 | { 42 | 0x1a, 0x61, 0x69, 0x6a, 43 | 0x6b, 0x75, 0x76, 0x77, 44 | 0x95, 0x96, 0x97, 0x81, 45 | 0x82, 0x83, 0x89, 0x8d 46 | }, 47 | 48 | { 49 | 0x1b, 0x62, 0x6c, 0x6d, 50 | 0x6e, 0x78, 0x79, 0x7a, 51 | 0x98, 0x99, 0x9a, 0x84, 52 | 0x85, 0x86, 0x8a, 0x8e 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /src/gu/sceGuAlphaFunc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuAlphaFunc(int func, int value, int mask) 12 | { 13 | int arg = func | ((value & 0xff) << 8) | ((mask & 0xff) << 16); 14 | sendCommandi(ALPHA_TEST, arg); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuAmbient.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuAmbient(unsigned int color) 12 | { 13 | sendCommandi(AMBIENT_LIGHT_COLOR,(color)); 14 | sendCommandi(AMBIENT_LIGHT_ALPHA,(color >> 24)); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuAmbientColor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuAmbientColor(unsigned int color) 12 | { 13 | sendCommandi(AMBIENT_COLOR, color); 14 | sendCommandi(AMBIENT_ALPHA, color >> 24); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuBeginObject.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuBeginObject(int vertex_type, int count, const void *indices, const void *vertices) 12 | { 13 | if (vertex_type) 14 | sendCommandi(VERTEX_TYPE, vertex_type); 15 | 16 | if (indices) 17 | { 18 | sendCommandi(BASE, (((unsigned int)indices) >> 8) & 0xf0000); 19 | sendCommandi(IADDR, ((unsigned int)indices)); 20 | } 21 | 22 | if (vertices) 23 | { 24 | sendCommandi(BASE, (((unsigned int)vertices) >> 8) & 0x0f0000); 25 | sendCommandi(VADDR, ((unsigned int)vertices)); 26 | } 27 | 28 | sendCommandi(BOUNDING_BOX, count); 29 | 30 | // store start to new object 31 | 32 | gu_object_stack[gu_object_stack_depth++] = gu_list->current; 33 | 34 | // dummy commands, overwritten in sceGuEndObject() 35 | sendCommandi(BASE, 0); 36 | sendCommandi(BJUMP, 0); 37 | } 38 | -------------------------------------------------------------------------------- /src/gu/sceGuBlendFunc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuBlendFunc(int op, int src, int dest, unsigned int srcfix, unsigned int destfix) 12 | { 13 | sendCommandi(BLEND_MODE, src | (dest << 4) | (op << 8)); 14 | sendCommandi(BLEND_FIXED_A, srcfix); 15 | sendCommandi(BLEND_FIXED_B, destfix); 16 | } 17 | -------------------------------------------------------------------------------- /src/gu/sceGuBoneMatrix.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuBoneMatrix(unsigned int index, const ScePspFMatrix4 *matrix) 12 | { 13 | unsigned int offset = ((index << 1) + index) << 2; // 3*4 matrix 14 | unsigned int i, j; 15 | const float *fmatrix = (const float *)matrix; 16 | 17 | sendCommandi(BONE_MATRIX_NUMBER, offset); 18 | for (i = 0; i < 4; ++i) 19 | { 20 | for (j = 0; j < 3; ++j) 21 | { 22 | sendCommandf(BONE_MATRIX_DATA, fmatrix[j + (i << 2)]); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/gu/sceGuBreak.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "pspge.h" 10 | 11 | int sceGuBreak(int mode) 12 | { 13 | PspGeBreakParam bParam; 14 | return sceGeBreak(mode, &bParam); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuCallList.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | int sceGuCallList(const void *list) 12 | { 13 | int res; 14 | unsigned int list_addr = (unsigned int)list; 15 | 16 | if (gu_call_mode == GU_CALL_SIGNAL) 17 | { 18 | sendCommandi(SIGNAL, (list_addr >> 16) | 0x110000); 19 | sendCommandi(END, list_addr & 0xffff); 20 | } 21 | else 22 | { 23 | sendCommandi(BASE, (list_addr >> 8) & 0xf0000); 24 | sendCommandi(CALL, list_addr); 25 | } 26 | 27 | res = _sceGuUpdateStallAddr(); 28 | if (res < 0) 29 | { 30 | return res; 31 | } 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /src/gu/sceGuCallMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuCallMode(int mode) 12 | { 13 | gu_call_mode = mode; 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuCheckList.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | int sceGuCheckList(void) 12 | { 13 | return ((int)gu_list->current)-((int)gu_list->start); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuClearColor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuClearColor(unsigned int color) 12 | { 13 | GuContext* context = &gu_contexts[gu_curr_context]; 14 | context->clear_color = color; 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuClearDepth.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuClearDepth(unsigned int depth) 12 | { 13 | GuContext* context = &gu_contexts[gu_curr_context]; 14 | context->clear_depth = depth; 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuClearStencil.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuClearStencil(unsigned int stencil) 12 | { 13 | GuContext* context = &gu_contexts[gu_curr_context]; 14 | context->clear_stencil = stencil; 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuClutLoad.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuClutLoad(int num_blocks, const void *cbp) 12 | { 13 | sendCommandi(CLUT_BUF_PTR, ((unsigned int)cbp)); 14 | sendCommandi(CLUT_BUF_WIDTH, (((unsigned int)cbp) >> 8) & 0xf0000); 15 | sendCommandi(CLUT_LOAD, num_blocks); 16 | } 17 | -------------------------------------------------------------------------------- /src/gu/sceGuClutMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuClutMode(unsigned int cpsm, unsigned int shift, unsigned int mask, unsigned int csa) 12 | { 13 | unsigned int argument = (cpsm) | (shift << 2) | (mask << 8) | (csa << 16); 14 | sendCommandi(CLUT_FORMAT, argument); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuColor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuColor(unsigned int color) 12 | { 13 | sceGuMaterial(GU_AMBIENT | GU_DIFFUSE | GU_SPECULAR, color); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuColorFunc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuColorFunc(int func, unsigned int color, unsigned int mask) 12 | { 13 | sendCommandi(COLOR_TEST, func & 0x03); 14 | sendCommandi(COLOR_REF, color); 15 | sendCommandi(COLOR_TESTMASK, mask); 16 | } 17 | -------------------------------------------------------------------------------- /src/gu/sceGuColorMaterial.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuColorMaterial(int components) 12 | { 13 | sendCommandi(MATERIAL_COLOR, components); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuContinue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "pspge.h" 10 | 11 | int sceGuContinue(void) 12 | { 13 | return sceGeContinue(); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuCopyImage.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuCopyImage(int psm, int sx, int sy, int width, int height, int srcw, void *src, int dx, int dy, int destw, void *dest) 12 | { 13 | sendCommandi(TRANSFER_SRC, ((unsigned int)src)); 14 | sendCommandi(TRANSFER_SRC_W, ((((unsigned int)src) & 0xff000000) >> 8) | srcw); 15 | sendCommandi(TRANSFER_SRC_OFFSET, (sy << 10) | sx); 16 | sendCommandi(TRANSFER_DST, ((unsigned int)dest)); 17 | sendCommandi(TRANSFER_DST_W, ((((unsigned int)dest) & 0xff000000) >> 8) | destw); 18 | sendCommandi(TRANSFER_DST_OFFSET, (dy << 10) | dx); 19 | sendCommandi(TRANSFER_SIZE, ((height - 1) << 10) | (width - 1)); 20 | sendCommandi(TRANSFER_START, (psm ^ 0x03) ? 0 : 1); 21 | } 22 | -------------------------------------------------------------------------------- /src/gu/sceGuDepthBuffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDepthBuffer(void *zbp, int zbw) 12 | { 13 | sendCommandi(Z_BUF_PTR, ((unsigned int)zbp)); 14 | sendCommandi(Z_BUF_WIDTH, ((((unsigned int)zbp) & 0xff000000) >> 8) | zbw); 15 | 16 | gu_draw_buffer.depth_buffer = zbp; 17 | 18 | if (!gu_draw_buffer.depth_width || (gu_draw_buffer.depth_width != zbw)) 19 | gu_draw_buffer.depth_width = zbw; 20 | } 21 | -------------------------------------------------------------------------------- /src/gu/sceGuDepthFunc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDepthFunc(int function) 12 | { 13 | sendCommandi(Z_TEST, function); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuDepthMask.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDepthMask(int mask) 12 | { 13 | sendCommandi(Z_MASK, mask); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuDepthOffset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDepthOffset(unsigned int offset) 12 | { 13 | GuContext* context = &gu_contexts[gu_curr_context]; 14 | context->depth_offset = offset; 15 | 16 | sceGuDepthRange(context->near_plane,context->far_plane); 17 | } 18 | -------------------------------------------------------------------------------- /src/gu/sceGuDepthRange.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDepthRange(int near, int far) 12 | { 13 | GuContext *context = &gu_contexts[gu_curr_context]; 14 | 15 | unsigned int max = (unsigned int)near + (unsigned int)far; 16 | int val = (int)((max >> 31) + max); 17 | float z = (float)(val >> 1); 18 | 19 | context->near_plane = near; 20 | context->far_plane = far; 21 | 22 | sendCommandf(VIEWPORT_Z_SCALE, z - ((float)near)); 23 | sendCommandf(VIEWPORT_Z_CENTER, z + ((float)context->depth_offset)); 24 | 25 | if (near > far) 26 | { 27 | int temp = near; 28 | near = far; 29 | far = temp; 30 | } 31 | 32 | sendCommandi(MIN_Z, near); 33 | sendCommandi(MAX_Z, far); 34 | } 35 | -------------------------------------------------------------------------------- /src/gu/sceGuDispBuffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | void sceGuDispBuffer(int width, int height, void *dispbp, int dispbw) 15 | { 16 | gu_draw_buffer.width = width; 17 | gu_draw_buffer.height = height; 18 | gu_draw_buffer.disp_buffer = dispbp; 19 | 20 | if (!gu_draw_buffer.frame_width || (gu_draw_buffer.frame_width != dispbw)) 21 | gu_draw_buffer.frame_width = dispbw; 22 | 23 | sceDisplaySetMode(PSP_DISPLAY_MODE_LCD, gu_draw_buffer.width, gu_draw_buffer.height); 24 | 25 | if (gu_display_on == GU_DISPLAY_ON) 26 | sceDisplaySetFrameBuf((void *)(((unsigned int)ge_edram_address) + ((unsigned int)gu_draw_buffer.disp_buffer)), dispbw, gu_draw_buffer.pixel_size, PSP_DISPLAY_SETBUF_NEXTVSYNC); 27 | } 28 | -------------------------------------------------------------------------------- /src/gu/sceGuDisplay.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | int sceGuDisplay(int state) 15 | { 16 | if (state == GU_TRUE) 17 | sceDisplaySetFrameBuf((void *)((unsigned int)ge_edram_address + (unsigned int)gu_draw_buffer.disp_buffer), gu_draw_buffer.frame_width, gu_draw_buffer.pixel_size, PSP_DISPLAY_SETBUF_NEXTVSYNC); 18 | else 19 | sceDisplaySetFrameBuf(NULL, 0, 0, PSP_DISPLAY_SETBUF_NEXTVSYNC); 20 | 21 | gu_display_on = state; 22 | return state; 23 | } 24 | 25 | int guGetDisplayState() 26 | { 27 | return gu_display_on; 28 | } 29 | -------------------------------------------------------------------------------- /src/gu/sceGuDrawArray.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDrawArray(int prim, int vtype, int count, const void *indices, const void *vertices) 12 | { 13 | if (vtype) 14 | sendCommandi(VERTEX_TYPE, vtype); 15 | 16 | if (indices) 17 | { 18 | sendCommandi(BASE, (((unsigned int)indices) >> 8) & 0xf0000); 19 | sendCommandi(IADDR, ((unsigned int)indices)); 20 | } 21 | 22 | if (vertices) 23 | { 24 | sendCommandi(BASE, (((unsigned int)vertices) >> 8) & 0xf0000); 25 | sendCommandi(VADDR, ((unsigned int)vertices)); 26 | } 27 | 28 | sendCommandi(PRIM, (prim << 16) | count); 29 | _sceGuUpdateStallAddr(); 30 | } 31 | -------------------------------------------------------------------------------- /src/gu/sceGuDrawArrayN.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDrawArrayN(int primitive_type, int vertex_type, int vcount, int primcount, const void *indices, const void *vertices) 12 | { 13 | if (vertex_type) 14 | sendCommandi(VERTEX_TYPE, vertex_type); 15 | 16 | if (indices) 17 | { 18 | sendCommandi(BASE, (((unsigned int)indices) >> 8) & 0xf0000); 19 | sendCommandi(IADDR, (unsigned int)indices); 20 | } 21 | 22 | if (vertices) 23 | { 24 | sendCommandi(BASE, (((unsigned int)vertices) >> 8) & 0xf0000); 25 | sendCommandi(VADDR, (unsigned int)vertices); 26 | } 27 | 28 | if (primcount > 0) 29 | { 30 | int i; 31 | for (i = 0; i < primcount; i++) 32 | sendCommandi(PRIM, (primitive_type << 16) | vcount); 33 | } 34 | 35 | _sceGuUpdateStallAddr(); 36 | } 37 | -------------------------------------------------------------------------------- /src/gu/sceGuDrawBezier.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDrawBezier(int vertex_type, int ucount, int vcount, const void *indices, const void *vertices) 12 | { 13 | if (vertex_type) 14 | sendCommandi(VERTEX_TYPE, vertex_type); 15 | 16 | if (indices) 17 | { 18 | sendCommandi(BASE, (((unsigned int)indices) >> 8) & 0xf0000); 19 | sendCommandi(IADDR, (unsigned int)indices); 20 | } 21 | 22 | if (vertices) 23 | { 24 | sendCommandi(BASE, (((unsigned int)vertices) >> 8) & 0xf0000); 25 | sendCommandi(VADDR, (unsigned int)vertices); 26 | } 27 | 28 | sendCommandi(BEZIER, (vcount << 8) | ucount); 29 | } 30 | -------------------------------------------------------------------------------- /src/gu/sceGuDrawBuffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDrawBuffer(int psm, void *fbp, int frame_width) 12 | { 13 | gu_draw_buffer.pixel_size = psm; 14 | gu_draw_buffer.frame_width = frame_width; 15 | gu_draw_buffer.frame_buffer = fbp; 16 | 17 | if (!gu_draw_buffer.depth_buffer && gu_draw_buffer.height) 18 | gu_draw_buffer.depth_buffer = (void *)(((unsigned int)fbp) + (unsigned int)((gu_draw_buffer.height * frame_width) << 2)); 19 | 20 | if (!gu_draw_buffer.depth_width) 21 | gu_draw_buffer.depth_width = frame_width; 22 | 23 | sendCommandi(FRAMEBUF_PIX_FORMAT, psm); 24 | sendCommandi(FRAME_BUF_PTR, (unsigned int)gu_draw_buffer.frame_buffer); 25 | sendCommandi(FRAME_BUF_WIDTH, ((((unsigned int)gu_draw_buffer.frame_buffer) & 0xff000000) >> 8) | gu_draw_buffer.frame_width); 26 | sendCommandi(Z_BUF_PTR, (unsigned int)gu_draw_buffer.depth_buffer); 27 | sendCommandi(Z_BUF_WIDTH, ((((unsigned int)gu_draw_buffer.depth_buffer) & 0xff000000) >> 8) | gu_draw_buffer.depth_width); 28 | } 29 | -------------------------------------------------------------------------------- /src/gu/sceGuDrawBufferList.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDrawBufferList(int psm, void *fbp, int fbw) 12 | { 13 | sendCommandi(FRAMEBUF_PIX_FORMAT, psm); 14 | sendCommandi(FRAME_BUF_PTR, (unsigned int)fbp); 15 | sendCommandi(FRAME_BUF_WIDTH, ((((unsigned int)fbp) & 0xff000000) >> 8) | fbw); 16 | } 17 | -------------------------------------------------------------------------------- /src/gu/sceGuDrawSpline.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuDrawSpline(int vertex_type, int ucount, int vcount, int uedge, int vedge, const void *indices, const void *vertices) 12 | { 13 | if (vertex_type) 14 | sendCommandi(VERTEX_TYPE, vertex_type); 15 | 16 | if (indices) 17 | { 18 | sendCommandi(BASE, (((unsigned int)indices) >> 8) & 0xf0000); 19 | sendCommandi(IADDR, (unsigned int)indices); 20 | } 21 | 22 | if (vertices) 23 | { 24 | sendCommandi(BASE, (((unsigned int)vertices) >> 8) & 0xf0000); 25 | sendCommandi(VADDR, (unsigned int)vertices); 26 | } 27 | 28 | sendCommandi(SPLINE, (vedge << 18) | (uedge << 16) | (vcount << 8) | ucount); 29 | } 30 | -------------------------------------------------------------------------------- /src/gu/sceGuEndObject.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuEndObject(void) 12 | { 13 | // rewrite commands from sceGuBeginObject() 14 | 15 | unsigned int *current = gu_list->current; 16 | gu_list->current = gu_object_stack[gu_object_stack_depth - 1]; 17 | 18 | sendCommandi(BASE, (((unsigned int)current) >> 8) & 0xf0000); 19 | sendCommandi(BJUMP, (unsigned int)current); 20 | gu_list->current = current; 21 | 22 | gu_object_stack_depth--; 23 | } 24 | -------------------------------------------------------------------------------- /src/gu/sceGuFinish.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | int sceGuFinish(void) 12 | { 13 | return sceGuFinishId(0); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuFog.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuFog(float near, float far, unsigned int color) 12 | { 13 | float distance = far - near; 14 | 15 | if (distance) 16 | distance = 1.0f / distance; 17 | 18 | sendCommandi(FOG_COLOR, color); 19 | sendCommandf(FOG1, far); 20 | sendCommandf(FOG2, distance); 21 | } 22 | -------------------------------------------------------------------------------- /src/gu/sceGuFrontFace.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuFrontFace(int order) 12 | { 13 | sendCommandi(CULL, order ? 0 : 1); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuGetAllStatus.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | int sceGuGetAllStatus(void) 12 | { 13 | return gu_states; 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuGetMemory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | void *sceGuGetMemory(int size) 15 | { 16 | // some kind of 4-byte alignment? 17 | size += 3; 18 | size += ((unsigned int)(size >> 31)) >> 30; 19 | size = (size >> 2) << 2; 20 | 21 | unsigned int* orig_ptr = gu_list->current; 22 | unsigned int* new_ptr = (unsigned int*)(((unsigned int)orig_ptr) + size + 8); 23 | 24 | int lo = (8 << 24) | (((unsigned int)new_ptr) & 0xffffff); 25 | int hi = (16 << 24) | ((((unsigned int)new_ptr) >> 8) & 0xf0000); 26 | 27 | orig_ptr[0] = hi; 28 | orig_ptr[1] = lo; 29 | 30 | gu_list->current = new_ptr; 31 | 32 | if (!gu_curr_context) 33 | sceGeListUpdateStallAddr(ge_list_executed[0],new_ptr); 34 | 35 | return orig_ptr + 2; 36 | } 37 | -------------------------------------------------------------------------------- /src/gu/sceGuGetStatus.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | int sceGuGetStatus(int state) 12 | { 13 | if (state < GU_MAX_STATUS) 14 | return (gu_states >> state) & 1; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/gu/sceGuLight.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuLight(int light, int type, int components, const ScePspFVector3 *position) 12 | { 13 | GuLightSettings* settings = &light_settings[light]; 14 | 15 | sendCommandf(settings->xpos,position->x); 16 | sendCommandf(settings->ypos,position->y); 17 | sendCommandf(settings->zpos,position->z); 18 | 19 | int kind = 2; 20 | if (components != 8) 21 | kind = (components^6) < 1 ? 1 : 0; 22 | 23 | sendCommandi(settings->type,((type & 0x03) << 8)|kind); 24 | } 25 | -------------------------------------------------------------------------------- /src/gu/sceGuLightAtt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuLightAtt(int light, float atten0, float atten1, float atten2) 12 | { 13 | GuLightSettings* settings = &light_settings[light]; 14 | 15 | sendCommandf(settings->constant,atten0); 16 | sendCommandf(settings->linear,atten1); 17 | sendCommandf(settings->quadratic,atten2); 18 | } 19 | -------------------------------------------------------------------------------- /src/gu/sceGuLightColor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuLightColor(int light, int component, unsigned int color) 12 | { 13 | GuLightSettings* settings = &light_settings[light]; 14 | 15 | switch (component) 16 | { 17 | case GU_AMBIENT: sendCommandi(settings->ambient, color); break; 18 | case GU_DIFFUSE: sendCommandi(settings->diffuse, color); break; 19 | case GU_AMBIENT_AND_DIFFUSE: 20 | { 21 | sendCommandi(settings->ambient, color); break; 22 | sendCommandi(settings->diffuse, color); break; 23 | } 24 | break; 25 | 26 | case GU_SPECULAR: sendCommandi(settings->specular, color); break; 27 | case GU_DIFFUSE_AND_SPECULAR: 28 | { 29 | sendCommandi(settings->diffuse, color); break; 30 | sendCommandi(settings->specular, color); break; 31 | } 32 | break; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/gu/sceGuLightMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuLightMode(int mode) 12 | { 13 | sendCommandi(LIGHT_MODE, mode); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuLightSpot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuLightSpot(int light, const ScePspFVector3 *direction, float exponent, float cutoff) 12 | { 13 | GuLightSettings* settings = &light_settings[light]; 14 | 15 | sendCommandf(settings->exponent,exponent); 16 | sendCommandf(settings->cutoff,cutoff); 17 | 18 | sendCommandf(settings->xdir,direction->x); 19 | sendCommandf(settings->ydir,direction->y); 20 | sendCommandf(settings->zdir,direction->z); 21 | } 22 | -------------------------------------------------------------------------------- /src/gu/sceGuLogicalOp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuLogicalOp(int op) 12 | { 13 | sendCommandi(LOGIC_OP, op & 0x0f); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuMaterial.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuMaterial(int mode, int color) 12 | { 13 | if (mode & GU_AMBIENT) { 14 | sendCommandi(AMBIENT_COLOR, color); 15 | sendCommandi(AMBIENT_ALPHA, color >> 24); 16 | } 17 | 18 | if (mode & GU_DIFFUSE) 19 | sendCommandi(MATERIAL_DIFFUSE, color); 20 | 21 | if (mode & GU_SPECULAR) 22 | sendCommandi(MATERIAL_SPECULAR, color); 23 | } 24 | -------------------------------------------------------------------------------- /src/gu/sceGuModelColor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuModelColor(unsigned int emissive, unsigned int ambient, unsigned int diffuse, unsigned int specular) 12 | { 13 | sendCommandi(MATERIAL_EMISSIVE, emissive); 14 | sendCommandi(MATERIAL_DIFFUSE, diffuse); 15 | sendCommandi(AMBIENT_COLOR, ambient); 16 | sendCommandi(MATERIAL_SPECULAR, specular); 17 | } 18 | -------------------------------------------------------------------------------- /src/gu/sceGuMorphWeight.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuMorphWeight(int index, float weight) 12 | { 13 | sendCommandf(MORPH_WEIGHT0 + index, weight); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuOffset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuOffset(unsigned int x, unsigned int y) 12 | { 13 | sendCommandi(OFFSET_X, x << 4); 14 | sendCommandi(OFFSET_Y, y << 4); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuPatchDivide.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuPatchDivide(unsigned int ulevel, unsigned int vlevel) 12 | { 13 | sendCommandi(PATCH_DIVISION, (vlevel << 8) | ulevel); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuPatchFrontFace.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuPatchFrontFace(unsigned int mode) 12 | { 13 | sendCommandi(PATCH_FACING, mode); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuPatchPrim.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuPatchPrim(int prim) 12 | { 13 | switch (prim) 14 | { 15 | case GU_POINTS: 16 | sendCommandi(PATCH_PRIMITIVE, 2); 17 | break; 18 | case GU_LINE_STRIP: 19 | sendCommandi(PATCH_PRIMITIVE, 1); 20 | break; 21 | case GU_TRIANGLE_STRIP: 22 | sendCommandi(PATCH_PRIMITIVE, 0); 23 | break; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/gu/sceGuPixelMask.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuPixelMask(unsigned int mask) 12 | { 13 | sendCommandi(MASK_COLOR, mask); 14 | sendCommandi(MASK_ALPHA, mask >> 24); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuScissor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuScissor(int x, int y, int w, int h) 12 | { 13 | GuContext *context = &gu_contexts[gu_curr_context]; 14 | 15 | context->scissor_start[0] = x; 16 | context->scissor_start[1] = y; 17 | context->scissor_end[0] = x + w - 1; 18 | context->scissor_end[1] = y +h - 1; 19 | 20 | if (context->scissor_enable) 21 | { 22 | int orig = (context->scissor_start[1] << 10) | context->scissor_start[0]; 23 | int end = (context->scissor_end[1] << 10) | context->scissor_end[0]; 24 | 25 | sendCommandi(SCISSOR1, orig); 26 | sendCommandi(SCISSOR2, end); 27 | sendCommandi(REGION1, orig); 28 | sendCommandi(REGION2, end); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/gu/sceGuSendCommandf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSendCommandf(int cmd, float argument) 12 | { 13 | sendCommandf(cmd,argument); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuSendCommandi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSendCommandi(int cmd, int argument) 12 | { 13 | sendCommandi(cmd, argument); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuSendList.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | int sceGuSendList(int mode, const void *list, PspGeContext *context) 15 | { 16 | PspGeListArgs args; 17 | int list_id; 18 | int callback; 19 | 20 | args.size = sizeof(PspGeListArgs); 21 | args.context = context; 22 | args.numStacks = 0; 23 | args.stacks = NULL; 24 | 25 | callback = gu_settings.ge_callback_id; 26 | gu_settings.signal_offset = 0; 27 | list_id = -1; 28 | 29 | switch (mode) 30 | { 31 | case GU_HEAD: 32 | list_id = sceGeListEnQueueHead(list, NULL, callback, &args); 33 | break; 34 | case GU_TAIL: 35 | list_id = sceGeListEnQueue(list, NULL, callback, &args); 36 | break; 37 | } 38 | 39 | if (list_id < 0) 40 | { 41 | return list_id; 42 | } 43 | 44 | ge_list_executed[1] = list_id; 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /src/gu/sceGuSetAllStatus.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSetAllStatus(int status) 12 | { 13 | unsigned int i; 14 | for (i = 0; i < GU_MAX_STATUS; ++i) 15 | { 16 | if ((status >> i) & 1) 17 | sceGuEnable(i); 18 | else 19 | sceGuDisable(i); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/gu/sceGuSetCallback.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void *sceGuSetCallback(int signal, GuCallback callback) 12 | { 13 | GuCallback old_callback = NULL; 14 | 15 | switch (signal) 16 | { 17 | case GU_CALLBACK_SIGNAL: 18 | old_callback = gu_settings.sig; 19 | gu_settings.sig = callback; 20 | break; 21 | case GU_CALLBACK_FINISH: 22 | old_callback = gu_settings.fin; 23 | gu_settings.fin = callback; 24 | break; 25 | } 26 | 27 | return old_callback; 28 | } 29 | -------------------------------------------------------------------------------- /src/gu/sceGuSetDither.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSetDither(const ScePspIMatrix4 *matrix) 12 | { 13 | sendCommandi(DITH0, (matrix->x.x & 0x0f) | ((matrix->x.y & 0x0f) << 4) | ((matrix->x.z & 0x0f) << 8) | ((matrix->x.w & 0x0f) << 12)); 14 | sendCommandi(DITH1, (matrix->y.x & 0x0f) | ((matrix->y.y & 0x0f) << 4) | ((matrix->y.z & 0x0f) << 8) | ((matrix->y.w & 0x0f) << 12)); 15 | sendCommandi(DITH2, (matrix->z.x & 0x0f) | ((matrix->z.y & 0x0f) << 4) | ((matrix->z.z & 0x0f) << 8) | ((matrix->z.w & 0x0f) << 12)); 16 | sendCommandi(DITH3, (matrix->w.x & 0x0f) | ((matrix->w.y & 0x0f) << 4) | ((matrix->w.z & 0x0f) << 8) | ((matrix->w.w & 0x0f) << 12)); 17 | } 18 | -------------------------------------------------------------------------------- /src/gu/sceGuSetStatus.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSetStatus(int state, int status) 12 | { 13 | if (status) 14 | sceGuEnable(state); 15 | else 16 | sceGuDisable(state); 17 | } 18 | -------------------------------------------------------------------------------- /src/gu/sceGuShadeModel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuShadeModel(int mode) 12 | { 13 | sendCommandi(SHADE_MODE, mode); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuSignal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSignal(int signal, int argument) 12 | { 13 | sendCommandi(SIGNAL, ((signal & 0xff) << 16) | (argument & 0xffff)); 14 | sendCommandi(END, 0); 15 | 16 | if (signal == GU_SIGNAL_PAUSE) 17 | { 18 | sendCommandi(FINISH, 0); 19 | sendCommandi(END, 0); 20 | } 21 | 22 | _sceGuUpdateStallAddr(); 23 | } -------------------------------------------------------------------------------- /src/gu/sceGuSpecular.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuSpecular(float power) // specular power 12 | { 13 | sendCommandf(MATERIAL_SPECULAR_COEF, power); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuStencilFunc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuStencilFunc(int func, int ref, int mask) 12 | { 13 | sendCommandi(STENCIL_TEST, func | ((ref & 0xff) << 8) | ((mask & 0xff) << 16)); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuStencilOp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuStencilOp(int fail, int zfail, int zpass) 12 | { 13 | sendCommandi(STENCIL_OP, fail | (zfail << 8) | (zpass << 16)); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuSwapBuffers.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | void *sceGuSwapBuffers(void) 15 | { 16 | if (gu_settings.swapBuffersCallback) 17 | { 18 | gu_settings.swapBuffersCallback(&gu_draw_buffer.disp_buffer, &gu_draw_buffer.frame_buffer); 19 | } 20 | else 21 | { 22 | void *temp = gu_draw_buffer.disp_buffer; 23 | gu_draw_buffer.disp_buffer = gu_draw_buffer.frame_buffer; 24 | gu_draw_buffer.frame_buffer = temp; 25 | } 26 | 27 | if (gu_display_on == GU_TRUE) 28 | sceDisplaySetFrameBuf((void *)((unsigned int)ge_edram_address + (unsigned int)gu_draw_buffer.disp_buffer), gu_draw_buffer.frame_width, gu_draw_buffer.pixel_size, gu_settings.swapBuffersBehaviour); 29 | 30 | return gu_draw_buffer.frame_buffer; 31 | } 32 | 33 | void guSwapBuffersBehaviour(int behaviour) 34 | { 35 | gu_settings.swapBuffersBehaviour = behaviour; 36 | } 37 | 38 | void guSwapBuffersCallback(GuSwapBuffersCallback callback) 39 | { 40 | gu_settings.swapBuffersCallback = callback; 41 | } 42 | -------------------------------------------------------------------------------- /src/gu/sceGuSync.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | int sceGuSync(int mode, int what) 15 | { 16 | switch (mode) 17 | { 18 | case GU_SYNC_FINISH: 19 | return sceGeDrawSync(what); 20 | case GU_SYNC_LIST: 21 | return sceGeListSync(ge_list_executed[0], what); 22 | case GU_SYNC_SEND: 23 | return sceGeListSync(ge_list_executed[1], what); 24 | default: 25 | case GU_SYNC_SIGNAL: 26 | case GU_SYNC_DONE: 27 | return 0; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/gu/sceGuTerm.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | #include 13 | 14 | void sceGuTerm(void) 15 | { 16 | sceKernelDeleteEventFlag(gu_settings.kernel_event_flag); 17 | sceGeUnsetCallback(gu_settings.ge_callback_id); 18 | } 19 | -------------------------------------------------------------------------------- /src/gu/sceGuTexEnvColor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexEnvColor(unsigned int color) 12 | { 13 | sendCommandi(TEX_ENV_COLOR, color); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuTexFilter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexFilter(int min, int mag) 12 | { 13 | sendCommandi(TEX_FILTER, (mag << 8) | min); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuTexFlush.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexFlush(void) 12 | { 13 | sendCommandi(TEX_FLUSH, 0); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuTexFunc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexFunc(int tfx, int tcc) 12 | { 13 | GuContext *context = &gu_contexts[gu_curr_context]; 14 | context->texture_function = (tcc << 8) | tfx; 15 | 16 | sendCommandi(TEX_FUNC, ((tcc << 8) | tfx) | context->fragment_2x); 17 | } 18 | -------------------------------------------------------------------------------- /src/gu/sceGuTexImage.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | static inline int getExp(int val) 12 | { 13 | return 31 - __builtin_clz(val & 0x3FF); 14 | } 15 | 16 | void sceGuTexImage(int mipmap, int width, int height, int tbw, const void *tbp) 17 | { 18 | GECommand texAddr = (GECommand)(TEX_ADDR0 + mipmap); 19 | GECommand texBufWidth = (GECommand)(TEX_BUF_WIDTH0 + mipmap); 20 | GECommand texSize = (GECommand)(TEX_SIZE0 + mipmap); 21 | sendCommandi(texAddr, ((unsigned int)tbp)); 22 | sendCommandi(texBufWidth, ((((unsigned int)tbp) >> 8) & 0x0f0000) | tbw); 23 | sendCommandi(texSize, (getExp(height) << 8) | (getExp(width))); 24 | sceGuTexFlush(); 25 | } 26 | -------------------------------------------------------------------------------- /src/gu/sceGuTexLevelMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | #include 12 | 13 | void sceGuTexLevelMode(unsigned int mode, float bias) 14 | { 15 | int offset = (int)truncf(bias * 16.0f); 16 | 17 | // mip map bias? 18 | if (offset >= 128) 19 | offset = 128; 20 | else if (offset < -128) 21 | offset = -128; 22 | 23 | sendCommandi(TEX_LEVEL, (((unsigned int)(offset)) << 16) | mode); 24 | } 25 | -------------------------------------------------------------------------------- /src/gu/sceGuTexMapMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexMapMode(int mode, unsigned int lu, unsigned int lv) 12 | { 13 | GuContext *context = &gu_contexts[gu_curr_context]; 14 | 15 | context->texture_map_mode = mode & 0x03; 16 | 17 | sendCommandi(TEX_MAP_MODE, context->texture_proj_map_mode | (mode & 0x03)); 18 | sendCommandi(TEX_SHADE_MAPPING, (lu << 8) | (lv & 0x03)); 19 | } 20 | -------------------------------------------------------------------------------- /src/gu/sceGuTexMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexMode(int tpsm, int maxmips, int mc, int swizzle) 12 | { 13 | GuContext *context = &gu_contexts[gu_curr_context]; 14 | context->texture_mode = tpsm; 15 | 16 | sendCommandi(TEX_MODE, (maxmips << 16) | (mc << 8) | (swizzle)); 17 | sendCommandi(TEX_FORMAT, tpsm); 18 | 19 | sceGuTexFlush(); 20 | } 21 | -------------------------------------------------------------------------------- /src/gu/sceGuTexOffset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexOffset(float u, float v) 12 | { 13 | sendCommandf(TEX_OFFSET_U, u); 14 | sendCommandf(TEX_OFFSET_V, v); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuTexProjMapMode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexProjMapMode(int mode) 12 | { 13 | GuContext *context = &gu_contexts[gu_curr_context]; 14 | 15 | context->texture_proj_map_mode = ((mode & 0x03) << 8); 16 | sendCommandi(TEX_MAP_MODE, ((mode & 0x03) << 8) | context->texture_map_mode); 17 | } 18 | -------------------------------------------------------------------------------- /src/gu/sceGuTexScale.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexScale(float u, float v) 12 | { 13 | sendCommandf(TEX_SCALE_U, u); 14 | sendCommandf(TEX_SCALE_V, v); 15 | } 16 | -------------------------------------------------------------------------------- /src/gu/sceGuTexSlope.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexSlope(float slope) 12 | { 13 | sendCommandf(TEX_LOD_SLOPE, slope); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuTexSync.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexSync() 12 | { 13 | sendCommandi(TEX_SYNC, 0); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuTexWrap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuTexWrap(int u, int v) 12 | { 13 | sendCommandi(TEX_WRAP, (v << 8) | (u)); 14 | } 15 | -------------------------------------------------------------------------------- /src/gu/sceGuViewport.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "guInternal.h" 10 | 11 | void sceGuViewport(int cx, int cy, int width, int height) 12 | { 13 | sendCommandf(VIEWPORT_X_SCALE, (float)(width >> 1)); 14 | sendCommandf(VIEWPORT_Y_SCALE, (float)((-height) >> 1)); 15 | sendCommandf(VIEWPORT_X_CENTER, (float)cx); 16 | sendCommandf(VIEWPORT_Y_CENTER, (float)cy); 17 | } 18 | -------------------------------------------------------------------------------- /src/gum/gumInternal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include "gumInternal.h" 10 | #include 11 | #include 12 | 13 | int gum_current_mode = GU_PROJECTION; 14 | 15 | int gum_matrix_update[4] = { 0 }; 16 | int gum_current_matrix_update = 0; 17 | 18 | ScePspFMatrix4* gum_current_matrix = gum_matrix_stack[GU_PROJECTION]; 19 | 20 | ScePspFMatrix4* gum_stack_depth[4] = 21 | { 22 | gum_matrix_stack[GU_PROJECTION], 23 | gum_matrix_stack[GU_VIEW], 24 | gum_matrix_stack[GU_MODEL], 25 | gum_matrix_stack[GU_TEXTURE] 26 | }; 27 | 28 | ScePspFMatrix4 gum_matrix_stack[4][32]; 29 | 30 | struct pspvfpu_context *gum_vfpucontext; 31 | -------------------------------------------------------------------------------- /src/gum/gumInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #ifndef __gumInternal_h__ 10 | #define __gumInternal_h__ 11 | 12 | #include 13 | 14 | #include "pspgum.h" 15 | #include "../gu/pspgu.h" 16 | 17 | #define GUM_EPSILON 0.00001f 18 | 19 | //#define GUM_USE_VFPU 20 | 21 | // these macros are because GCC cannot handle aligned matrices declared on the stack 22 | #define GUM_ALIGNED_MATRIX() (ScePspFMatrix4*)((((unsigned int)alloca(sizeof(ScePspFMatrix4)+64)) + 63) & ~63) 23 | #define GUM_ALIGNED_VECTOR() (ScePspFVector4*)((((unsigned int)alloca(sizeof(ScePspFVector4)+64)) + 63) & ~63) 24 | 25 | extern int gum_current_mode; 26 | extern int gum_matrix_update[4]; 27 | extern int gum_current_matrix_update; 28 | extern ScePspFMatrix4* gum_current_matrix; 29 | extern ScePspFMatrix4* gum_stack_depth[4]; 30 | extern ScePspFMatrix4 gum_matrix_stack[4][32]; 31 | 32 | extern struct pspvfpu_context *gum_vfpucontext; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/hprm/sceHprm.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceHprm_0000 6 | IMPORT_START "sceHprm",0x40010000 7 | #endif 8 | #ifdef F_sceHprm_0001 9 | IMPORT_FUNC "sceHprm",0xC7154136,sceHprmRegisterCallback 10 | #endif 11 | #ifdef F_sceHprm_0002 12 | IMPORT_FUNC "sceHprm",0x444ED0B7,sceHprmUnregisterCallback 13 | #endif 14 | #ifdef F_sceHprm_0003 15 | IMPORT_FUNC "sceHprm",0x208DB1BD,sceHprmIsRemoteExist 16 | #endif 17 | #ifdef F_sceHprm_0004 18 | IMPORT_FUNC "sceHprm",0x7E69EDA4,sceHprmIsHeadphoneExist 19 | #endif 20 | #ifdef F_sceHprm_0005 21 | IMPORT_FUNC "sceHprm",0x219C58F1,sceHprmIsMicrophoneExist 22 | #endif 23 | #ifdef F_sceHprm_0006 24 | IMPORT_FUNC "sceHprm",0x1910B327,sceHprmPeekCurrentKey 25 | #endif 26 | #ifdef F_sceHprm_0007 27 | IMPORT_FUNC "sceHprm",0x2BCEC83E,sceHprmPeekLatch 28 | #endif 29 | #ifdef F_sceHprm_0008 30 | IMPORT_FUNC "sceHprm",0x40D2F9F0,sceHprmReadLatch 31 | #endif 32 | -------------------------------------------------------------------------------- /src/kernel/SysTimerForKernel.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_SysTimerForKernel_0000 6 | IMPORT_START "SysTimerForKernel",0x00010000 7 | #endif 8 | #ifdef F_SysTimerForKernel_0001 9 | IMPORT_FUNC "SysTimerForKernel",0xC99073E3,sceSTimerAlloc 10 | #endif 11 | #ifdef F_SysTimerForKernel_0002 12 | IMPORT_FUNC "SysTimerForKernel",0xC105CF38,sceSTimerFree 13 | #endif 14 | #ifdef F_SysTimerForKernel_0003 15 | IMPORT_FUNC "SysTimerForKernel",0xB53534B4,SysTimerForKernel_B53534B4 16 | #endif 17 | #ifdef F_SysTimerForKernel_0004 18 | IMPORT_FUNC "SysTimerForKernel",0x975D8E84,sceSTimerSetHandler 19 | #endif 20 | #ifdef F_SysTimerForKernel_0005 21 | IMPORT_FUNC "SysTimerForKernel",0xA95143E2,sceSTimerStartCount 22 | #endif 23 | #ifdef F_SysTimerForKernel_0006 24 | IMPORT_FUNC "SysTimerForKernel",0x4A01F9D3,sceSTimerStopCount 25 | #endif 26 | #ifdef F_SysTimerForKernel_0007 27 | IMPORT_FUNC "SysTimerForKernel",0x54BB5DB4,sceSTimerResetCount 28 | #endif 29 | #ifdef F_SysTimerForKernel_0008 30 | IMPORT_FUNC "SysTimerForKernel",0x228EDAE4,sceSTimerGetCount 31 | #endif 32 | #ifdef F_SysTimerForKernel_0009 33 | IMPORT_FUNC "SysTimerForKernel",0x53231A15,SysTimerForKernel_53231A15 34 | #endif 35 | -------------------------------------------------------------------------------- /src/kernel/pspaudiorouting.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspaudiorouting.h - Interface to sceAudioRouting. 7 | * 8 | * Copyright (c) 2007 Alexander Berl 9 | * 10 | */ 11 | #ifndef __PSPAUDIOROUTING_H__ 12 | #define __PSPAUDIOROUTING_H__ 13 | 14 | /** 15 | * Set routing mode. 16 | * 17 | * @param mode The routing mode to set (0 or 1) 18 | * 19 | * @return the previous routing mode, or < 0 on error 20 | */ 21 | int sceAudioRoutingSetMode( int mode ); 22 | 23 | /** 24 | * Get routing mode. 25 | * 26 | * @return the current routing mode. 27 | */ 28 | int sceAudioRoutingGetMode(); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /src/kernel/pspsysclib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspsysclib.h - Interface to sysclib library. 7 | * 8 | * Copyright (c) 2007 James F 9 | * 10 | */ 11 | 12 | #ifndef PSPSYSCLIB_H 13 | #define PSPSYSCLIB_H 14 | 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /** Callback type, ch is 0x200 on start of string, 0x201 on end */ 23 | typedef void (*prnt_callback)(void *ctx, int ch); 24 | 25 | /** 26 | * Generic print routine 27 | * 28 | * @param cb - Callback, called for every character printed 29 | * @param ctx - Context parameter passed to the callback 30 | * @param fmt - Format data 31 | * @param args - Arguments for format 32 | * 33 | */ 34 | void prnt(prnt_callback cb, void *ctx, const char *fmt, va_list args); 35 | 36 | /*@}*/ 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/kernel/sceAudioRouting_driver.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceAudioRouting_driver_0000 6 | IMPORT_START "sceAudioRouting_driver",0x00010000 7 | #endif 8 | #ifdef F_sceAudioRouting_driver_0001 9 | IMPORT_FUNC "sceAudioRouting_driver",0x28235C56,sceAudioRoutingGetVolumeMode 10 | #endif 11 | #ifdef F_sceAudioRouting_driver_0002 12 | IMPORT_FUNC "sceAudioRouting_driver",0x36FD8AA9,sceAudioRoutingSetMode 13 | #endif 14 | #ifdef F_sceAudioRouting_driver_0003 15 | IMPORT_FUNC "sceAudioRouting_driver",0x39240E7D,sceAudioRoutingGetMode 16 | #endif 17 | #ifdef F_sceAudioRouting_driver_0004 18 | IMPORT_FUNC "sceAudioRouting_driver",0xBB548475,sceAudioRoutingSetVolumeMode 19 | #endif 20 | -------------------------------------------------------------------------------- /src/kernel/sceSysEventForKernel.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceSysEventForKernel_0000 6 | IMPORT_START "sceSysEventForKernel",0x00010000 7 | #endif 8 | #ifdef F_sceSysEventForKernel_0001 9 | IMPORT_FUNC "sceSysEventForKernel",0xAEB300AE,sceKernelIsRegisterSysEventHandler 10 | #endif 11 | #ifdef F_sceSysEventForKernel_0002 12 | IMPORT_FUNC "sceSysEventForKernel",0xCD9E4BB5,sceKernelRegisterSysEventHandler 13 | #endif 14 | #ifdef F_sceSysEventForKernel_0003 15 | IMPORT_FUNC "sceSysEventForKernel",0xD7D3FDCD,sceKernelUnregisterSysEventHandler 16 | #endif 17 | #ifdef F_sceSysEventForKernel_0004 18 | IMPORT_FUNC "sceSysEventForKernel",0x36331294,sceKernelSysEventDispatch 19 | #endif 20 | #ifdef F_sceSysEventForKernel_0005 21 | IMPORT_FUNC "sceSysEventForKernel",0x68D55505,sceKernelReferSysEventHandler 22 | #endif 23 | -------------------------------------------------------------------------------- /src/libcglue/arpa/inet.h: -------------------------------------------------------------------------------- 1 | /* arpa/inet.h - Functions for converting IP addresses between strings and numbers */ 2 | 3 | #ifndef _ARPA_INET_H_ 4 | #define _ARPA_INET_H_ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include 11 | 12 | in_addr_t sceNetInetInetAddr(const char *ip); 13 | int sceNetInetInetAton(const char *ip, struct in_addr *in); 14 | const char* sceNetInetInetNtop(int af, const void *src, char *dst, socklen_t cnt); 15 | int sceNetInetInetPton(int af, const char *src, void *dst); 16 | 17 | char *inet_ntoa(struct in_addr in); 18 | #define inet_addr sceNetInetInetAddr 19 | #define inet_aton sceNetInetInetAton 20 | #define inet_ntop sceNetInetInetNtop 21 | #define inet_pton sceNetInetInetPton 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif /* _ARPA_INET_H_ */ 27 | -------------------------------------------------------------------------------- /src/libcglue/errno.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * errno.c - The global init/deinit code for our crt0. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | 14 | #include 15 | #include 16 | 17 | #ifdef F___set_errno 18 | int __set_errno(int code) 19 | { 20 | if ((code & 0x80010000) == 0x80010000) { 21 | errno = code & 0xFFFF; 22 | return -1; 23 | } 24 | return code; 25 | } 26 | #endif -------------------------------------------------------------------------------- /src/libcglue/fdman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - http://www.pspdev.org 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * fdman.h - File descriptor management. 7 | * 8 | * Copyright (c) 2006 Rafael Cabezas 9 | */ 10 | 11 | #ifndef _FDMAN_H_ 12 | 13 | #include 14 | 15 | #define _FDMAN_H_ 16 | 17 | #define __FILENO_MAX 1024 18 | 19 | #define __IS_FD_VALID(FD) \ 20 | ( (FD >= 0) && (FD < __FILENO_MAX) && (__descriptormap[FD] != NULL) ) 21 | 22 | #define __IS_FD_OF_TYPE(FD, TYPE) \ 23 | ( (__IS_FD_VALID(FD)) && (__descriptormap[FD]->type == TYPE) ) 24 | 25 | typedef enum { 26 | __DESCRIPTOR_TYPE_FILE, 27 | __DESCRIPTOR_TYPE_FOLDER, 28 | __DESCRIPTOR_TYPE_PIPE, 29 | __DESCRIPTOR_TYPE_SOCKET, 30 | __DESCRIPTOR_TYPE_TTY 31 | } __fdman_fd_types; 32 | 33 | typedef struct { 34 | uint32_t descriptor; 35 | uint32_t flags; 36 | uint32_t ref_count; 37 | char *filename; 38 | uint8_t type; 39 | } __descriptormap_type; 40 | 41 | extern __descriptormap_type *__descriptormap[__FILENO_MAX]; 42 | 43 | void __fdman_init(); 44 | int __fdman_get_new_descriptor(); 45 | int __fdman_get_dup_descriptor(int fd); 46 | void __fdman_release_descriptor(int fd); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/libcglue/netdb.h: -------------------------------------------------------------------------------- 1 | /* Simple gethostbyname and gethostbyaddr replacements, note not thread safe */ 2 | #ifndef __NETDB_H__ 3 | #define __NETDB_H__ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #define NETDB_INTERNAL -1 /* see errno */ 10 | #define NETDB_SUCCESS 0 /* no problem */ 11 | #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ 12 | #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ 13 | #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ 14 | #define NO_DATA 4 /* Valid name, no data record of requested type */ 15 | #define NO_ADDRESS NO_DATA /* no address, look for MX record */ 16 | 17 | extern int h_errno; 18 | 19 | struct hostent 20 | { 21 | char *h_name; 22 | char **h_aliases; 23 | int h_addrtype; 24 | int h_length; 25 | char **h_addr_list; 26 | char *h_addr; 27 | }; 28 | 29 | struct hostent *gethostbyaddr(const void *addr, int len, int type); 30 | struct hostent *gethostbyname(const char *name); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/libcglue/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __NETINET_TCP_H__ 2 | #define __NETINET_TCP_H__ 3 | 4 | #include 5 | 6 | #define SOL_TCP IPPROTO_TCP 7 | 8 | /* Socket options */ 9 | #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ 10 | #define TCP_MAXSEG 0x02 /* set maximum segment size */ 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/libcglue/sleep.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * sleep.c - Sleep functions needed by newlib. 7 | * 8 | * Copyright (c) 2021 Francisco Javier Trujillo Mata 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | /* Fuctions from errno.c */ 20 | int __set_errno(int code); 21 | 22 | /* Fuctions from errno.c */ 23 | int __set_errno(int code); 24 | 25 | #ifdef F_nanosleep 26 | /* note: we don't use rem as we have no signals */ 27 | int nanosleep(const struct timespec *req, struct timespec *rem) 28 | { 29 | int res = 0; 30 | uint32_t usec = 1000000 * req->tv_sec + (req->tv_nsec / 1000); 31 | res = __set_errno(sceKernelDelayThread(usec)); 32 | 33 | if( rem != NULL ) { 34 | rem->tv_sec = 0; 35 | rem->tv_nsec = 0; 36 | } 37 | 38 | return res; 39 | } 40 | #endif -------------------------------------------------------------------------------- /src/libcglue/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /* Empty file, here for compatibility */ -------------------------------------------------------------------------------- /src/libcglue/timezone.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * timezone.c - Set proper timezone needed by newlib. 7 | * 8 | * Copyright (c) 2021 Francisco Javier Trujillo Mata 9 | * 10 | */ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef F___timezone_update 19 | __attribute__((weak)) 20 | void __timezone_update() 21 | { 22 | /* Initialize timezone from PSP configuration */ 23 | int tzOffset = 0; 24 | sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_TIMEZONE, &tzOffset); 25 | int tzOffsetAbs = tzOffset < 0 ? -tzOffset : tzOffset; 26 | int hours = tzOffsetAbs / 60; 27 | int minutes = tzOffsetAbs - hours * 60; 28 | int pspDaylight = 0; 29 | sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS, &pspDaylight); 30 | static char tz[33]; 31 | sprintf(tz, "GMT%s%02i:%02i%s", tzOffset < 0 ? "+" : "-", hours, minutes, pspDaylight ? "daylight" : ""); 32 | setenv("TZ", tz, 1); 33 | } 34 | #endif -------------------------------------------------------------------------------- /src/modinfo/Makefile.am: -------------------------------------------------------------------------------- 1 | libdir := @PSPSDK_LIBDIR@ 2 | 3 | CC = @PSP_CC@ 4 | CCAS = $(CC) 5 | AR = @PSP_AR@ 6 | RANLIB = @PSP_RANLIB@ 7 | 8 | CPPFLAGS = 9 | CFLAGS = @PSPSDK_CFLAGS@ 10 | CCASFLAGS = $(CFLAGS) 11 | 12 | lib_LIBRARIES = libpspmodinfo.a 13 | libpspmodinfo_a_SOURCES = \ 14 | modinfo.S -------------------------------------------------------------------------------- /src/modinfo/modinfo.S: -------------------------------------------------------------------------------- 1 | 2 | .global __lib_ent_top 3 | .global __lib_ent_bottom 4 | .global __lib_stub_top 5 | .global __lib_stub_bottom 6 | 7 | .set push 8 | .section .lib.ent.top, "a", @progbits 9 | .align 2 10 | .word 0 11 | __lib_ent_top: 12 | .section .lib.ent.btm, "a", @progbits 13 | .align 2 14 | __lib_ent_bottom: 15 | .word 0 16 | .section .lib.stub.top, "a", @progbits 17 | .align 2 18 | .word 0 19 | __lib_stub_top: 20 | .section .lib.stub.btm, "a", @progbits 21 | .align 2 22 | __lib_stub_bottom: 23 | .word 0 24 | .set pop 25 | .text 26 | 27 | -------------------------------------------------------------------------------- /src/mp3/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | MP3_OBJS = sceMp3_0000.o sceMp3_0001.o sceMp3_0002.o sceMp3_0003.o sceMp3_0004.o sceMp3_0005.o sceMp3_0006.o \ 14 | sceMp3_0007.o sceMp3_0008.o sceMp3_0009.o sceMp3_0010.o sceMp3_0011.o sceMp3_0012.o sceMp3_0013.o \ 15 | sceMp3_0014.o sceMp3_0015.o sceMp3_0016.o sceMp3_0017.o sceMp3_0018.o sceMp3_0019.o sceMp3_0020.o \ 16 | sceMp3_0021.o sceMp3_0022.o sceMp3_0023.o sceMp3_0024.o 17 | 18 | libpspmp3includedir = @PSPSDK_INCLUDEDIR@ 19 | libpspmp3include_HEADERS = pspmp3.h 20 | 21 | lib_LIBRARIES = libpspmp3.a 22 | 23 | 24 | libpspmp3_a_SOURCES = sceMp3.S 25 | libpspmp3_a_LIBADD = $(MP3_OBJS) 26 | 27 | $(MP3_OBJS): sceMp3.S 28 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 29 | -------------------------------------------------------------------------------- /src/mpeg/sceMpegbase.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceMpegbase_0000 6 | IMPORT_START "sceMpegbase",0x00090000 7 | #endif 8 | #ifdef F_sceMpegbase_0001 9 | IMPORT_FUNC "sceMpegbase",0xBE45C284,sceMpegBaseYCrCbCopyVme 10 | #endif 11 | #ifdef F_sceMpegbase_0002 12 | IMPORT_FUNC "sceMpegbase",0x492B5E4B,sceMpegBaseCscInit 13 | #endif 14 | #ifdef F_sceMpegbase_0003 15 | IMPORT_FUNC "sceMpegbase",0xCE8EB837,sceMpegBaseCscVme 16 | #endif 17 | #ifdef F_sceMpegbase_0004 18 | IMPORT_FUNC "sceMpegbase",0x0530BE4E,sceMpegbase_0530BE4E 19 | #endif 20 | #ifdef F_sceMpegbase_0005 21 | IMPORT_FUNC "sceMpegbase",0x304882E1,sceMpegbase_304882E1 22 | #endif 23 | #ifdef F_sceMpegbase_0006 24 | IMPORT_FUNC "sceMpegbase",0x7AC0321A,sceMpegBaseYCrCbCopy 25 | #endif 26 | #ifdef F_sceMpegbase_0007 27 | IMPORT_FUNC "sceMpegbase",0x91929A21,sceMpegBaseCscAvc 28 | #endif 29 | #ifdef F_sceMpegbase_0008 30 | IMPORT_FUNC "sceMpegbase",0xAC9E717E,sceMpegbase_AC9E717E 31 | #endif 32 | #ifdef F_sceMpegbase_0009 33 | IMPORT_FUNC "sceMpegbase",0xBEA18F91,sceMpegbase_BEA18F91 34 | #endif 35 | -------------------------------------------------------------------------------- /src/net/sceNet.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceNet_0000 6 | IMPORT_START "sceNet",0x00090000 7 | #endif 8 | #ifdef F_sceNet_0001 9 | IMPORT_FUNC "sceNet",0x39AF39A6,sceNetInit 10 | #endif 11 | #ifdef F_sceNet_0002 12 | IMPORT_FUNC "sceNet",0x281928A9,sceNetTerm 13 | #endif 14 | #ifdef F_sceNet_0003 15 | IMPORT_FUNC "sceNet",0x50647530,sceNetFreeThreadinfo 16 | #endif 17 | #ifdef F_sceNet_0004 18 | IMPORT_FUNC "sceNet",0xAD6844C6,sceNetThreadAbort 19 | #endif 20 | #ifdef F_sceNet_0005 21 | IMPORT_FUNC "sceNet",0x89360950,sceNetEtherNtostr 22 | #endif 23 | #ifdef F_sceNet_0006 24 | IMPORT_FUNC "sceNet",0xD27961C9,sceNetEtherStrton 25 | #endif 26 | #ifdef F_sceNet_0007 27 | IMPORT_FUNC "sceNet",0x0BF0A3AE,sceNetGetLocalEtherAddr 28 | #endif 29 | #ifdef F_sceNet_0008 30 | IMPORT_FUNC "sceNet",0xCC393E48,sceNetGetMallocStat 31 | #endif 32 | -------------------------------------------------------------------------------- /src/net/sceNetApctl.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceNetApctl_0000 6 | IMPORT_START "sceNetApctl",0x00090000 7 | #endif 8 | #ifdef F_sceNetApctl_0001 9 | IMPORT_FUNC "sceNetApctl",0xE2F91F9B,sceNetApctlInit 10 | #endif 11 | #ifdef F_sceNetApctl_0002 12 | IMPORT_FUNC "sceNetApctl",0xB3EDD0EC,sceNetApctlTerm 13 | #endif 14 | #ifdef F_sceNetApctl_0003 15 | IMPORT_FUNC "sceNetApctl",0x2BEFDF23,sceNetApctlGetInfo 16 | #endif 17 | #ifdef F_sceNetApctl_0004 18 | IMPORT_FUNC "sceNetApctl",0x8ABADD51,sceNetApctlAddHandler 19 | #endif 20 | #ifdef F_sceNetApctl_0005 21 | IMPORT_FUNC "sceNetApctl",0x5963991B,sceNetApctlDelHandler 22 | #endif 23 | #ifdef F_sceNetApctl_0006 24 | IMPORT_FUNC "sceNetApctl",0xCFB957C6,sceNetApctlConnect 25 | #endif 26 | #ifdef F_sceNetApctl_0007 27 | IMPORT_FUNC "sceNetApctl",0x24FE91A1,sceNetApctlDisconnect 28 | #endif 29 | #ifdef F_sceNetApctl_0008 30 | IMPORT_FUNC "sceNetApctl",0x5DEAC81B,sceNetApctlGetState 31 | #endif 32 | -------------------------------------------------------------------------------- /src/net/sceNetResolver.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceNetResolver_0000 6 | IMPORT_START "sceNetResolver",0x00090000 7 | #endif 8 | #ifdef F_sceNetResolver_0001 9 | IMPORT_FUNC "sceNetResolver",0xF3370E61,sceNetResolverInit 10 | #endif 11 | #ifdef F_sceNetResolver_0002 12 | IMPORT_FUNC "sceNetResolver",0x6138194A,sceNetResolverTerm 13 | #endif 14 | #ifdef F_sceNetResolver_0003 15 | IMPORT_FUNC "sceNetResolver",0x244172AF,sceNetResolverCreate 16 | #endif 17 | #ifdef F_sceNetResolver_0004 18 | IMPORT_FUNC "sceNetResolver",0x94523E09,sceNetResolverDelete 19 | #endif 20 | #ifdef F_sceNetResolver_0005 21 | IMPORT_FUNC "sceNetResolver",0x224C5F44,sceNetResolverStartNtoA 22 | #endif 23 | #ifdef F_sceNetResolver_0006 24 | IMPORT_FUNC "sceNetResolver",0x629E2FB7,sceNetResolverStartAtoN 25 | #endif 26 | #ifdef F_sceNetResolver_0007 27 | IMPORT_FUNC "sceNetResolver",0x808F6063,sceNetResolverStop 28 | #endif 29 | -------------------------------------------------------------------------------- /src/openpsid/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | OPENPSID_OBJS = sceOpenPSID_0000.o sceOpenPSID_0001.o 14 | 15 | libpspopenspidincludedir = @PSPSDK_INCLUDEDIR@ 16 | libpspopenspidinclude_HEADERS = pspopenpsid.h 17 | 18 | lib_LIBRARIES = libpspopenpsid.a 19 | libpspopenpsid_a_SOURCES = sceOpenPSID.S 20 | libpspopenpsid_a_LIBADD = $(OPENPSID_OBJS) 21 | 22 | $(OPENPSID_OBJS): sceOpenPSID.S 23 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 24 | -------------------------------------------------------------------------------- /src/openpsid/pspopenpsid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspopenpsid.h - Prototypes for the OpenPSID library 7 | * 8 | * Copyright (c) 2008 InsertWittyName (David Perry) 9 | * 10 | */ 11 | 12 | #ifndef __PSPOPENPSID_H__ 13 | #define __PSPOPENPSID_H__ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | typedef struct PspOpenPSID 20 | { 21 | unsigned char data[16]; 22 | } PspOpenPSID; 23 | 24 | int sceOpenPSIDGetOpenPSID(PspOpenPSID *openpsid); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif /* __PSPOPENPSID_H__ */ 31 | -------------------------------------------------------------------------------- /src/openpsid/sceOpenPSID.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | // Build List 6 | // sceOpenPSID_0000.o sceOpenPSID_0001.o 7 | 8 | #ifdef F_sceOpenPSID_0000 9 | IMPORT_START "sceOpenPSID",0x40010011 10 | #endif 11 | #ifdef F_sceOpenPSID_0001 12 | IMPORT_FUNC "sceOpenPSID",0xC69BEBCE,sceOpenPSIDGetOpenPSID 13 | #endif 14 | -------------------------------------------------------------------------------- /src/prof/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/debug -I$(top_srcdir)/src/user 10 | CFLAGS = @PSPSDK_CFLAGS@ -std=gnu99 -Wall -Wmissing-prototypes 11 | CCASFLAGS = $(CFLAGS) -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 12 | 13 | libpspprofincludedir = @PSPSDK_INCLUDEDIR@ 14 | libpspprofinclude_HEADERS = pspprof.h 15 | 16 | lib_LIBRARIES = libpspprof.a 17 | libpspprof_a_SOURCES = prof.c mcount.s 18 | libpspprof_a_LIBADD = 19 | -------------------------------------------------------------------------------- /src/prof/mcount.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .set noat 3 | 4 | .global _mcount 5 | .ent _mcount 6 | 7 | _mcount: 8 | 9 | 10 | # Generated code already substracts 8 bytes 11 | # We store our ra, at and a0-a3 12 | addu $29, $29, -40 13 | sd $31, 0($29) # store ra 14 | sd $1, 8($29) # at = ra of caller 15 | sd $4, 16($29) 16 | sd $5, 24($29) 17 | sd $6, 32($29) 18 | sd $7, 40($29) 19 | 20 | # Call internal C handler 21 | move $4, $1 22 | move $5, $31 23 | jal __mcount 24 | nop 25 | 26 | # Restore registers 27 | ld $31, 0($29) 28 | ld $1, 8($29) 29 | ld $4, 16($29) 30 | ld $5, 24($29) 31 | ld $6, 32($29) 32 | ld $7, 40($29) 33 | addu $29, $29, 48 # generated code substracts 8 bytes 34 | j $31 35 | move $31, $1 # restore caller's ra 36 | 37 | .end _mcount 38 | 39 | .set reorder 40 | .set at 41 | -------------------------------------------------------------------------------- /src/prof/pspprof.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspprof.h - Prototypes for the profiler library 7 | * 8 | * Copyright (c) 2006 Urchin 9 | * 10 | */ 11 | #ifndef __PSPPROF_H__ 12 | #define __PSPPROF_H__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | 19 | /** 20 | * Start the profiler. 21 | * If the profiler is already running, this function stop previous one, 22 | * and ignore the result. 23 | * Finally, it initializes a new profiler session. 24 | */ 25 | __attribute__((__no_instrument_function__, __no_profile_instrument_function__)) 26 | void gprof_start(void); 27 | 28 | /** 29 | * Stop the profiler. 30 | * If the profiler is not running, this function does nothing. 31 | * @param filename The name of the file to write the profiling data to. 32 | * @param should_dump If 1, the profiling data will be written to the file. 33 | * If 0, the profiling data will be discarded. 34 | */ 35 | __attribute__((__no_instrument_function__, __no_profile_instrument_function__)) 36 | void gprof_stop(const char* filename, int should_dump); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* __PSPPROF_H__ */ 43 | -------------------------------------------------------------------------------- /src/samples/audio/polyphonic/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = polyphonic 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspaudiolib -lpspaudio 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Polyphonic sample by Shine 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/audio/wavegen/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = alsample 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspaudiolib -lpspaudio 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Audiolib Wave Generator 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/controller/basic/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = controller_basic 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Basic controller sample 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/debug/debugkb/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = debugkb 2 | OBJS = main.o 3 | LIBS = -lpspdebugkb 4 | 5 | INCDIR = 6 | CFLAGS = -O2 -Wall 7 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 8 | ASFLAGS = $(CFLAGS) 9 | 10 | LIBDIR = 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Debug Screen Keyboard Example 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/debug/exception/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = exception 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Exception Example 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/debug/gdb/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = gdb 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O0 -Wall -ggdb 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBS = -lpspgdb -lpspgdb_user 10 | LIBDIR = 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = GDB 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | LIBS += -lpsphprm_driver 20 | -------------------------------------------------------------------------------- /src/samples/debug/kprintf/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = kptest 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Kprintf Test 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/debug/profiler/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = profiler 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Profiler Test 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/debug/prxdecrypt/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = prxdecrypt 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = PRX Decrypter 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/debug/screenshot/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = screenshot 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Screenshot Test 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/debug/sio/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = sio 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = SIO Test 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | LIBS += -lpsphprm_driver 20 | -------------------------------------------------------------------------------- /src/samples/debug/sio/readme.txt: -------------------------------------------------------------------------------- 1 | This is a simple demo of the SIO code. 2 | 3 | The serial interface used is the remote control port, see http://nil.rpc1.org/psp/remote.html 4 | for how to build the interface. You should setup your local terminal software to 4800 baud 5 | 8N1 to communicate. 6 | 7 | Note this comes with no warranty, if it blows up your psp it is not my resposibility. 8 | -------------------------------------------------------------------------------- /src/samples/exceptions/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = CppException 2 | OBJS = main.o 3 | LIBS = -lstdc++ 4 | 5 | INCDIR = 6 | CFLAGS = -Wall -O2 7 | CXXFLAGS = $(CFLAGS) -fno-rtti -fexceptions 8 | ASFLAGS = $(CFLAGS) 9 | 10 | LIBDIR = 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = C++ Exception Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | -------------------------------------------------------------------------------- /src/samples/exceptions/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* Define printf, just to make typing easier */ 6 | #define printf pspDebugScreenPrintf 7 | 8 | /* Define the module info section */ 9 | PSP_MODULE_INFO("cppException", 0, 1, 1); 10 | 11 | /* Define the main thread's attribute value (optional) */ 12 | PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); 13 | 14 | #include 15 | using namespace std; 16 | 17 | class myexception: public exception 18 | { 19 | virtual const char* what() const throw() 20 | { 21 | return "My exception happened"; 22 | } 23 | } myex; 24 | 25 | int main (void) 26 | { 27 | pspDebugScreenInit(); 28 | SceCtrlData pad; 29 | 30 | try 31 | { 32 | throw myex; 33 | } 34 | catch (exception& e) 35 | { 36 | printf("%s\n", e.what()); 37 | } 38 | 39 | printf("\nPress X to quit.\n"); 40 | 41 | for (;;) 42 | { 43 | sceCtrlReadBufferPositive(&pad, 1); 44 | if (pad.Buttons & PSP_CTRL_CROSS) 45 | break; 46 | } 47 | sceKernelExitGame(); 48 | 49 | return 0; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/samples/gprof/basic/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = gprofbasic 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall -pg -g 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = -pg -g 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = GProf Basic Example 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/gprof/custom/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = gprofcustom 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall -pg -g 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = -pg -g 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = GProf Custom Example 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/gu/beginobject/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = beginobject 2 | OBJS = beginobject.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = BeginObject Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | -------------------------------------------------------------------------------- /src/samples/gu/blend/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = blend 2 | OBJS = blend.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Blend Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/blit/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = blit 2 | OBJS = blit.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Blit Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/celshading/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = celshading 2 | OBJS = lightmap.o celshading.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Celshading Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | lightmap.o : lightmap.raw 20 | bin2o -i lightmap.raw lightmap.o lightmap 21 | -------------------------------------------------------------------------------- /src/samples/gu/celshading/lightmap.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/celshading/lightmap.raw -------------------------------------------------------------------------------- /src/samples/gu/clut/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = clut 2 | OBJS = clut.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Clut Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/common/callbacks.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * Copyright (c) 2005 Jesper Svennevid 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | static int exitRequest = 0; 20 | 21 | int running() 22 | { 23 | return !exitRequest; 24 | } 25 | 26 | int exitCallback(int arg1, int arg2, void *common) 27 | { 28 | exitRequest = 1; 29 | return 0; 30 | } 31 | 32 | int callbackThread(SceSize args, void *argp) 33 | { 34 | int cbid; 35 | 36 | cbid = sceKernelCreateCallback("Exit Callback", exitCallback, NULL); 37 | sceKernelRegisterExitCallback(cbid); 38 | 39 | sceKernelSleepThreadCB(); 40 | 41 | return 0; 42 | } 43 | 44 | int setupCallbacks(void) 45 | { 46 | int thid = 0; 47 | 48 | thid = sceKernelCreateThread("update_thread", callbackThread, 0x11, 0xFA0, 0, 0); 49 | if(thid >= 0) 50 | { 51 | sceKernelStartThread(thid, 0, 0); 52 | } 53 | 54 | return thid; 55 | } 56 | -------------------------------------------------------------------------------- /src/samples/gu/common/callbacks.h: -------------------------------------------------------------------------------- 1 | #ifndef common_callbacks_h 2 | #define common_callbacks_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int running(); 9 | int setupCallbacks(void); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/samples/gu/copy/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = copy 2 | OBJS = copy.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = CopyImage Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/cube/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = cube 2 | OBJS = cube.o logo.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Cube Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | logo.o: logo.raw 20 | bin2o -i logo.raw logo.o logo 21 | -------------------------------------------------------------------------------- /src/samples/gu/cube/logo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/cube/logo.raw -------------------------------------------------------------------------------- /src/samples/gu/doublelist/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = doublelist 2 | OBJS = doublelist.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Blit with Double Display List Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/envmap/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = envmap 2 | OBJS = envmap.o env0.o ../common/callbacks.o ../common/geometry.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Environment Mapping Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | env0.o: env0.raw 20 | bin2o -i env0.raw env0.o env0 21 | -------------------------------------------------------------------------------- /src/samples/gu/envmap/env0.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/envmap/env0.raw -------------------------------------------------------------------------------- /src/samples/gu/integerdrawing/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = integerdrawing 2 | OBJS = integerdrawing.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Integer Drawing Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | -------------------------------------------------------------------------------- /src/samples/gu/lights/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = lights 2 | OBJS = lights.o ../common/callbacks.o ../common/geometry.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Lights Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/lines/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = lines 2 | OBJS = lines.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Lines Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/logic/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = logic 2 | OBJS = logic.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Logic Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = MIPMAPPING 2 | OBJS = mipmapping.o mip0.o mip1.o mip2.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | LIBS = -lpspgum -lpspgu 13 | 14 | EXTRA_TARGETS = EBOOT.PBP 15 | PSP_EBOOT_TITLE = MIP Mapping Sample 16 | 17 | PSPSDK=$(shell psp-config --pspsdk-path) 18 | include $(PSPSDK)/lib/build.mak 19 | 20 | mip0.o: mip0.raw 21 | bin2o -i mip0.raw mip0.o mip0 22 | mip1.o: mip1.raw 23 | bin2o -i mip1.raw mip1.o mip1 24 | mip2.o: mip2.raw 25 | bin2o -i mip2.raw mip2.o mip2 26 | 27 | -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/mip0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/mipmapping/mip0.png -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/mip0.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/mipmapping/mip0.raw -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/mip1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/mipmapping/mip1.png -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/mip1.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/mipmapping/mip1.raw -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/mip2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/mipmapping/mip2.png -------------------------------------------------------------------------------- /src/samples/gu/mipmapping/mip2.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/mipmapping/mip2.raw -------------------------------------------------------------------------------- /src/samples/gu/morph/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = morph 2 | OBJS = morph.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Morph Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/morphskin/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = morphskin 2 | OBJS = morphskin.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Simultaneous Morphing and Skinning Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/ortho/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK=$(shell psp-config --pspsdk-path) 2 | PSPDIR=$(shell psp-config --psp-prefix) 3 | 4 | TARGET = ortho 5 | OBJS = ortho.o ../common/callbacks.o 6 | 7 | CFLAGS = -O2 -Wall -g 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | LIBDIR = 12 | LIBS = -lpspgum -lpspgu 13 | LDFLAGS = 14 | 15 | EXTRA_TARGETS = EBOOT.PBP 16 | PSP_EBOOT_TITLE = Ortho Sample 17 | 18 | include $(PSPSDK)/lib/build.mak 19 | 20 | -------------------------------------------------------------------------------- /src/samples/gu/reflection/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = reflection 2 | OBJS = reflection.o logo.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Reflection Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | logo.o: ../cube/logo.raw 20 | bin2o -i $< logo.o logo 21 | -------------------------------------------------------------------------------- /src/samples/gu/rendertarget/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = rendertarget 2 | OBJS = rendertarget.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Render-To-Texture Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/scissor/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = scissor 2 | OBJS = scissor.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Scissor Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak -------------------------------------------------------------------------------- /src/samples/gu/shadowprojection/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = shadowprojection 2 | OBJS = shadowprojection.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Shadow Projection Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/signals/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = signals 2 | OBJS = signals.o ball.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Signals Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | ball.o: ball.raw 20 | bin2o -i ball.raw ball.o ball 21 | -------------------------------------------------------------------------------- /src/samples/gu/signals/ball.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/signals/ball.raw -------------------------------------------------------------------------------- /src/samples/gu/skinning/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = skinning 2 | OBJS = skinning.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Matrix Skinning Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak -------------------------------------------------------------------------------- /src/samples/gu/speed/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = speed 2 | OBJS = speed.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Memory Speed Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/spharm/Image1.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/spharm/Image1.raw -------------------------------------------------------------------------------- /src/samples/gu/spharm/Image2.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/spharm/Image2.raw -------------------------------------------------------------------------------- /src/samples/gu/spharm/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = spharm 2 | OBJS = cube.o spharm.o disablefpu.o mt19937.o logo.o logo2.o logo3.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -fno-exceptions 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = convlogo EBOOT.PBP 14 | PSP_EBOOT_TITLE = adresd - spharm v1.0 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | convlogo: 20 | bin2o -i logo.raw logo.o logo 21 | bin2o -i Image1.raw logo2.o logo2 22 | bin2o -i Image2.raw logo3.o logo3 23 | 24 | copyms: 25 | cp -f EBOOT.PBP /cygdrive/I/PSP/GAME/SPHARM 26 | -------------------------------------------------------------------------------- /src/samples/gu/spharm/disablefpu.S: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # This disables FPU exceptions 4 | # 5 | # extern void _DisableFPUExceptions(void); 6 | */ 7 | 8 | #include 9 | 10 | .set push 11 | .set noreorder 12 | .globl _DisableFPUExceptions 13 | .ent _DisableFPUExceptions 14 | _DisableFPUExceptions: 15 | cfc1 $2, $31 16 | lui $8, 0x80 17 | and $8, $2, $8 # Mask off all bits except for 23 of FCR 18 | ctc1 $8, $31 19 | jr $31 20 | nop 21 | .end _DisableFPUExceptions 22 | .set pop 23 | -------------------------------------------------------------------------------- /src/samples/gu/spharm/logo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/spharm/logo.raw -------------------------------------------------------------------------------- /src/samples/gu/spharm/mt19937.h: -------------------------------------------------------------------------------- 1 | #ifndef __MT19937_H 2 | #define __MT19937_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void sgenrand(unsigned long seed); 9 | float genrand(); 10 | 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/samples/gu/spharm/readme: -------------------------------------------------------------------------------- 1 | Info file for : Spherical Harmonics 2 | ----------------------------------- 3 | 4 | coding & gfx: adresd 5 | 6 | Just a little demo to wet your appetites! 7 | 8 | LEFT/RIGHT change rendermode 9 | Up = first mode 10 | down = last mode 11 | 12 | Goes through a few pre-defined shapes, then onto random ones.. just interpolating 13 | so it might get messy at times. 14 | 15 | Greets and thank you's go to: 16 | ----------------------------- 17 | Everyone involved with pspsdk and the forums/sites under ps2dev.org 18 | 19 | Chip for his excellent work reversing sceGu :) 20 | -------------------------------------------------------------------------------- /src/samples/gu/splinesurface/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = splinesurface 2 | OBJS = splinesurface.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Spline Surface Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/sprite/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = sprite 2 | OBJS = sprite.o ball.o ../common/callbacks.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Sprite Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | ball.o: ball.raw 20 | bin2o -i ball.raw ball.o ball 21 | -------------------------------------------------------------------------------- /src/samples/gu/sprite/ball.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/sprite/ball.raw -------------------------------------------------------------------------------- /src/samples/gu/text/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = gufont 2 | OBJS = font.c main.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall -O2 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = GUFont Sample by McZonk 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | font.c : font.raw 20 | bin2c font.raw font.c font 21 | -------------------------------------------------------------------------------- /src/samples/gu/text/font.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/gu/text/font.raw -------------------------------------------------------------------------------- /src/samples/gu/timing/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = timing 2 | OBJS = timing.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Timing Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | -------------------------------------------------------------------------------- /src/samples/gu/vertex/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = vertex 2 | OBJS = vertex.o ../common/callbacks.o ../common/menu.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Vertex Speed Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/gu/zbufferfog/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = zbufferfog 2 | OBJS = zbufferfog.o ../common/callbacks.o ../common/geometry.o 3 | 4 | INCDIR = 5 | CFLAGS = -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS= -lpspgum -lpspgu 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Depth Buffer Fog Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/ir/irda/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = irda 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = IrDA Test v1.0 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/ir/sircs/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = sircs 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = -lpspsircs 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Sircs Test v1.0 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/kernel/cwd/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = cwd 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Working Directory example 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/kernel/fileio/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = dumper 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = -lpspumd 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = File IO example 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/kernel/idstorage/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = idstorage 2 | OBJS = main.o 3 | 4 | CFLAGS = -O2 -Wall 5 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 6 | ASFLAGS = $(CFLAGS) 7 | 8 | LIBS = 9 | 10 | EXTRA_TARGETS = EBOOT.PBP 11 | PSP_EBOOT_TITLE = Idstorage Sample 12 | 13 | PSPSDK=$(shell psp-config --pspsdk-path) 14 | include $(PSPSDK)/lib/build.mak 15 | -------------------------------------------------------------------------------- /src/samples/kernel/kdumper/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = kdumper 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Kernel Dumper Sample 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/kernel/loadmodule/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = loadmodule 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Loadmodule PSPSDK Sample 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/kernel/messagebox/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = messagebox 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = messagebox sample 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/kernel/regenum/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = regsh 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspreg 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Registry Shell 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/kernel/registry/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = regsample 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | LIBS = -lpspreg 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Registry Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/kernel/sysevent/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = sysevent 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = SysEvent example 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/kernel/systimer/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = systimer 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = SysTimer example 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/kernel/threadstatus/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = threadstatus 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = threadstatus sample 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/libcglue/light_elf/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = light_size 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -Os -Wall -fdata-sections -ffunction-sections 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = -s 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Light Hello World 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/me/basic/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = mebasic 2 | OBJS = main.o me.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = ME Basic Example 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/me/basic/me.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | .global me_run 4 | .global me_end 5 | 6 | .ent me_run 7 | 8 | me_run: 9 | li $2, 0xbfc00060 10 | li $3, 0 11 | loop: 12 | addiu $3, $3, 1 13 | sw $3, 0($2) 14 | b loop 15 | nop 16 | me_end: 17 | 18 | .end me_run 19 | -------------------------------------------------------------------------------- /src/samples/mp3/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = mp3sample 4 | OBJS = main.o 5 | LIBS = -lpspaudio -lpspmp3 6 | 7 | BUILD_PRX = 1 8 | 9 | CFLAGS = -O2 -Wall 10 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 11 | ASFLAGS = $(CFLAGS) 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Mp3 Sample 15 | 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/mp3/Test.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/samples/mp3/Test.mp3 -------------------------------------------------------------------------------- /src/samples/ms/callback/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = mscm 2 | OBJS = main.o 3 | 4 | BUILD_PRX=1 5 | 6 | INCDIR = 7 | CFLAGS = -O2 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | LIBDIR = 12 | LDFLAGS = 13 | 14 | PSPSDK=$(shell psp-config --pspsdk-path) 15 | include $(PSPSDK)/lib/build.mak 16 | -------------------------------------------------------------------------------- /src/samples/nand/dumpipl/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = dumpipl 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = -lpspnand_driver 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/nand/dumpipl/README: -------------------------------------------------------------------------------- 1 | Sample program to dump the Initial Program Loader (IPL) from flash. 2 | 3 | See http://forums.ps2dev.org/viewtopic.php?t=3573 for more information on the 4 | IPL. 5 | -------------------------------------------------------------------------------- /src/samples/net/resolver/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = resolver 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O0 -Wall -g 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | 11 | EXTRA_TARGETS = EBOOT.PBP 12 | 13 | PSPSDK=$(shell psp-config --pspsdk-path) 14 | include $(PSPSDK)/lib/build.mak 15 | -------------------------------------------------------------------------------- /src/samples/net/simple/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = netsample 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O0 -Wall -g 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | 11 | EXTRA_TARGETS = EBOOT.PBP 12 | 13 | PSPSDK=$(shell psp-config --pspsdk-path) 14 | include $(PSPSDK)/lib/build.mak 15 | -------------------------------------------------------------------------------- /src/samples/net/simple_prx/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = netsample 2 | OBJS = main.o 3 | 4 | PRX_EXPORTS=exports.exp 5 | BUILD_PRX=1 6 | 7 | INCDIR = 8 | CFLAGS = -O0 -Wall -g 9 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 10 | ASFLAGS = $(CFLAGS) 11 | 12 | LIBDIR = 13 | 14 | PSPSDK=$(shell psp-config --pspsdk-path) 15 | include $(PSPSDK)/lib/build.mak 16 | -------------------------------------------------------------------------------- /src/samples/net/simple_prx/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC(module_start) 8 | PSP_EXPORT_FUNC(module_stop) 9 | PSP_EXPORT_VAR(module_info) 10 | PSP_EXPORT_END 11 | 12 | PSP_END_EXPORTS 13 | -------------------------------------------------------------------------------- /src/samples/net/wlanscan/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = wlanscan 2 | OBJS = main.o 3 | 4 | BUILD_PRX=1 5 | 6 | INCDIR = 7 | CFLAGS = -O2 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | LIBS=-lpspwlan -lpspnet 12 | 13 | LIBDIR = 14 | LDFLAGS = 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/net/wlanscan_elf/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = wlanscan 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBS=-lpspwlan -lpspnet 10 | 11 | LIBDIR = 12 | LDFLAGS = 13 | 14 | EXTRA_TARGETS = EBOOT.PBP 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/power/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = powersample 4 | OBJS = main.o 5 | LIBS = -lpsppower 6 | 7 | 8 | CFLAGS = -O2 -Wall 9 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 10 | ASFLAGS = $(CFLAGS) 11 | 12 | include $(PSPSDK)/lib/build.mak 13 | -------------------------------------------------------------------------------- /src/samples/prx/image_display/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = image_display 2 | BUILD_PRX = 1 3 | 4 | OBJS = main.o 5 | 6 | INCDIR = 7 | CFLAGS = -Os -G0 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | LIBS = 11 | 12 | LIBDIR = 13 | 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build_prx.mak -------------------------------------------------------------------------------- /src/samples/prx/prx_loader/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = prxloader 2 | OBJS = main.o MyLib.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | LIBS = 13 | 14 | EXTRA_TARGETS = EBOOT.PBP 15 | PSP_EBOOT_TITLE = Sample PRX Loader 16 | 17 | PSPSDK=$(shell psp-config --pspsdk-path) 18 | include $(PSPSDK)/lib/build.mak 19 | -------------------------------------------------------------------------------- /src/samples/prx/prx_loader/MyLib.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "MyLib",0x00090000,0x00010005 6 | STUB_FUNC 0x563FF2B2,getModuleInfo 7 | STUB_END 8 | -------------------------------------------------------------------------------- /src/samples/prx/testprx/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = mymodule 2 | OBJS = main.o 3 | 4 | # Define to build this as a prx (instead of a static elf) 5 | BUILD_PRX=1 6 | # Define the name of our custom exports (minus the .exp extension) 7 | PRX_EXPORTS=exports.exp 8 | 9 | INCDIR = 10 | CFLAGS = -O2 -Wall 11 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 12 | ASFLAGS = $(CFLAGS) 13 | 14 | LIBDIR = 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/prx/testprx/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_HASH(module_start) 8 | PSP_EXPORT_VAR_HASH(module_info) 9 | PSP_EXPORT_END 10 | 11 | # Export our function 12 | PSP_EXPORT_START(MyLib, 0, 0x0001) 13 | PSP_EXPORT_FUNC_HASH(getModuleInfo) 14 | PSP_EXPORT_END 15 | 16 | PSP_END_EXPORTS 17 | -------------------------------------------------------------------------------- /src/samples/prx/testprx/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * main.c - Simple PRX example. 7 | * 8 | * Copyright (c) 2005 James Forshaw 9 | * 10 | */ 11 | #include 12 | #include 13 | 14 | PSP_MODULE_INFO("TESTPRX", 0x1000, 1, 1); 15 | 16 | #define WELCOME_MESSAGE "Hello from the PRX\n" 17 | 18 | int main(int argc, char **argv) 19 | { 20 | int i; 21 | 22 | printf(WELCOME_MESSAGE); 23 | 24 | for(i = 0; i < argc; i++) 25 | { 26 | printf("Arg %d: %s\n", i, argv[i]); 27 | } 28 | 29 | sceKernelSleepThread(); 30 | 31 | return 0; 32 | } 33 | 34 | /* Exported function returns the address of module_info */ 35 | void* getModuleInfo(void) 36 | { 37 | return (void *) &module_info; 38 | } 39 | -------------------------------------------------------------------------------- /src/samples/savedata/decrypt/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = main 2 | OBJS = main.o decrypt.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = -lpspchnnlsv 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Save Decrypt Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | main.c : decrypt.h 20 | decrypt.c : decrypt.h 21 | -------------------------------------------------------------------------------- /src/samples/savedata/decrypt/README.txt: -------------------------------------------------------------------------------- 1 | This sample uses the sceChnnlsv module directly to do savegame 2 | decryption. It currently works only in VSH mode (e.g., via the TIFF 3 | exploit). It can handle both old and new format saves (SaveParam 4 | structure sizes 0x5c8, 0x5dc, 0x600). New format saves require a 5 | game-specific encryption key. 6 | -------------------------------------------------------------------------------- /src/samples/savedata/decrypt/decrypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * decrypt.h - Declarations for functions in decrypt.c 7 | * 8 | * Copyright (c) 2005 Jim Paris 9 | * Coypright (c) 2005 psp123 10 | * 11 | */ 12 | 13 | #include 14 | 15 | /* Detect the samegame format and decrypt it. See main.c for an example. */ 16 | int decrypt_file(const char *decrypted_filename, 17 | const char *encrypted_filename, 18 | const unsigned char *gamekey); 19 | 20 | /* Do the actual hardware decryption. 21 | mode is 3 for saves with a cryptkey, or 1 otherwise. 22 | data, alignedLen, and cryptkey must be multiples of 0x10. 23 | cryptkey is NULL if mode == 1. 24 | */ 25 | int decrypt_data(unsigned int mode, 26 | unsigned char *data, 27 | int *dataLen, 28 | int *alignedLen, 29 | unsigned char *cryptkey); 30 | -------------------------------------------------------------------------------- /src/samples/savedata/encrypt/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = main 2 | OBJS = main.o encrypt.o hash.o psf.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LIBS = -lpspchnnlsv 11 | LDFLAGS = 12 | 13 | EXTRA_TARGETS = EBOOT.PBP 14 | PSP_EBOOT_TITLE = Save Encrypt Sample 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | 19 | main.c : encrypt.h 20 | encrypt.c : encrypt.h hash.h 21 | hash.c : hash.h psf.h 22 | psf.c : psf.h 23 | 24 | -------------------------------------------------------------------------------- /src/samples/savedata/encrypt/README.txt: -------------------------------------------------------------------------------- 1 | This sample uses the sceChnnlsv module directly to do savegame 2 | encryption. It currently works only in VSH mode (e.g., via the TIFF 3 | exploit). It can handle both old and new format saves (SaveParam 4 | structure sizes 0x5c8, 0x5dc, 0x600). New format saves require a 5 | game-specific encryption key. 6 | -------------------------------------------------------------------------------- /src/samples/savedata/encrypt/encrypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * encrypt.h - Declarations for functions in encrypt.c 7 | * 8 | * Copyright (c) 2005 Jim Paris 9 | * Coypright (c) 2005 psp123 10 | * 11 | */ 12 | 13 | #include 14 | 15 | /* Encrypt the given plaintext file, and update the message 16 | authentication hashes in the param.sfo. The data_filename is 17 | usually the final component of encrypted_filename, e.g. "DATA.BIN". 18 | See main.c for an example of usage. */ 19 | int encrypt_file(const char *plaintext_filename, 20 | const char *encrypted_filename, 21 | const char *data_filename, 22 | const char *paramsfo_filename, 23 | const unsigned char *gamekey); 24 | 25 | /* Do the actual hardware encryption. 26 | mode is 3 for saves with a cryptkey, or 1 otherwise. 27 | data, alignedLen, cryptkey, and hash must be multiples of 0x10. 28 | cryptkey is NULL if mode == 1. 29 | */ 30 | int encrypt_data(unsigned int mode, 31 | unsigned char *data, 32 | int *dataLen, 33 | int *alignedLen, 34 | unsigned char *hash, 35 | unsigned char *cryptkey); 36 | -------------------------------------------------------------------------------- /src/samples/savedata/encrypt/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * hash.h - Declarations for functions in hash.c 7 | * 8 | * Copyright (c) 2005 Jim Paris 9 | * Coypright (c) 2005 psp123 10 | * 11 | */ 12 | 13 | #include 14 | 15 | /* Update the hashes in the param.sfo data, using 16 | the given file hash, and by computing the param.sfo hashes. 17 | filehash must be a multiple of 16 bytes, and is reused to 18 | store other hashes. The filename is e.g. "DATA.BIN". */ 19 | int update_hashes(unsigned char *data, 20 | int len, 21 | const char *filename, 22 | unsigned char *filehash, 23 | int encryptmode); 24 | 25 | /* Build a single hash using the given data and mode. 26 | data, and alignedLen must be multiples of 0x10. 27 | cryptkey is NULL for savedata.*/ 28 | int build_hash(unsigned char *output, 29 | unsigned char *data, 30 | unsigned int len, 31 | unsigned int alignedLen, 32 | int mode, 33 | unsigned char *cryptkey); 34 | -------------------------------------------------------------------------------- /src/samples/savedata/encrypt/psf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * psf.h - Declarations for functions in psf.c 7 | * 8 | * Copyright (c) 2005 Jim Paris 9 | * Coypright (c) 2005 psp123 10 | * 11 | */ 12 | 13 | #include 14 | 15 | /* Find the named section in the PSF file, and return an 16 | absolute pointer to it and the section size. */ 17 | int find_psf_section(const char *name, 18 | unsigned char *data, 19 | int dataLen, 20 | unsigned char **location, 21 | int *size); 22 | 23 | /* Find the named file inside the FILE_LIST, and return 24 | an absolute pointer to it. */ 25 | int find_psf_datafile(const char *name, 26 | unsigned char *filelist, 27 | int size, 28 | unsigned char **location); 29 | -------------------------------------------------------------------------------- /src/samples/savedata/utility/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = savedata 2 | OBJS = main.o 3 | 4 | # For custom firmware uncomment the following lines: 5 | #PSP_FW_VERSION = 200 6 | #BUILD_PRX = 1 7 | 8 | LIBS = -lpspgum -lpspgu 9 | 10 | CFLAGS = -O2 -Wall 11 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 12 | ASFLAGS = $(CFLAGS) 13 | 14 | EXTRA_TARGETS = EBOOT.PBP 15 | PSP_EBOOT_TITLE = PSPSDK Savedata Sample 16 | 17 | PSPSDK = $(shell psp-config --pspsdk-path) 18 | include $(PSPSDK)/lib/build.mak 19 | -------------------------------------------------------------------------------- /src/samples/template/elf_template/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = template 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | EXTRA_TARGETS = EBOOT.PBP 13 | PSP_EBOOT_TITLE = Template 14 | 15 | PSPSDK=$(shell psp-config --pspsdk-path) 16 | include $(PSPSDK)/lib/build.mak 17 | -------------------------------------------------------------------------------- /src/samples/template/elf_template/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * main.c - Basic ELF template 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | #include 14 | #include 15 | 16 | #define printf pspDebugScreenPrintf 17 | 18 | /* Define the module info section */ 19 | PSP_MODULE_INFO("template", 0, 1, 1); 20 | 21 | /* Define the main thread's attribute value (optional) */ 22 | PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | pspDebugScreenInit(); 27 | 28 | pspDebugScreenPrintf("Hello World\n"); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /src/samples/template/kprx_template/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = ktemplate 2 | OBJS = main.o 3 | 4 | # Use only kernel libraries 5 | USE_KERNEL_LIBS = 1 6 | 7 | INCDIR = 8 | CFLAGS = -O2 -Wall -fno-builtin-printf 9 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 10 | ASFLAGS = $(CFLAGS) 11 | 12 | LIBDIR = 13 | 14 | LIBS = 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build_prx.mak 18 | -------------------------------------------------------------------------------- /src/samples/template/kprx_template/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC(module_start) 8 | PSP_EXPORT_FUNC(module_stop) 9 | PSP_EXPORT_VAR(module_info) 10 | PSP_EXPORT_END 11 | 12 | PSP_END_EXPORTS 13 | -------------------------------------------------------------------------------- /src/samples/template/kprx_template/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * main.c - Basic Kernel PRX template 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | #include 14 | #include 15 | #include 16 | 17 | PSP_MODULE_INFO("template", PSP_MODULE_KERNEL, 1, 1); 18 | 19 | int main_thread(SceSize args, void *argp) 20 | { 21 | printf("Hello World\n"); 22 | 23 | return 0; 24 | } 25 | 26 | /* Entry point */ 27 | int module_start(SceSize args, void *argp) 28 | { 29 | int thid; 30 | 31 | thid = sceKernelCreateThread("template", main_thread, 7, 0x800, 0, NULL); 32 | if(thid >= 0) 33 | { 34 | sceKernelStartThread(thid, args, argp); 35 | } 36 | return 0; 37 | } 38 | 39 | /* Module stop entry */ 40 | int module_stop(SceSize args, void *argp) 41 | { 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /src/samples/template/lib_template/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET_LIB = libtemplate.a 2 | OBJS = template.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | LIBDIR = 10 | LDFLAGS = 11 | 12 | PSPSDK=$(shell psp-config --pspsdk-path) 13 | include $(PSPSDK)/lib/build.mak 14 | -------------------------------------------------------------------------------- /src/samples/template/lib_template/template.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * template.c - Template source file for a library 7 | * 8 | * Copyright (c) 2005 James F 9 | * 10 | */ 11 | 12 | #include "template.h" 13 | 14 | int template_call(void) 15 | { 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/samples/template/lib_template/template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * template.c - Template source file for a library 7 | * 8 | * Copyright (c) 2005 James F 9 | * 10 | */ 11 | 12 | #ifndef __TEMPLATE_H 13 | #define __TEMPLATE_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int template_call(void); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/samples/template/prx_template/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = template 2 | OBJS = main.o 3 | 4 | BUILD_PRX=1 5 | 6 | INCDIR = 7 | CFLAGS = -O2 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | LIBDIR = 12 | LDFLAGS = 13 | 14 | PSPSDK=$(shell psp-config --pspsdk-path) 15 | include $(PSPSDK)/lib/build.mak 16 | -------------------------------------------------------------------------------- /src/samples/template/prx_template/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * main.c - Basic PRX template 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | #include 14 | #include 15 | 16 | /* Define the module info section */ 17 | PSP_MODULE_INFO("template", 0, 1, 1); 18 | 19 | /* Define the main thread's attribute value (optional) */ 20 | PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | printf("Hello World\n"); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /src/samples/usb/storage/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = usbstorage 4 | OBJS = main.o 5 | LIBS = -lpspusb -lpspusbstor 6 | CFLAGS = -O2 -Wall 7 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 8 | ASFLAGS = $(CFLAGS) 9 | 10 | include $(PSPSDK)/lib/build.mak 11 | -------------------------------------------------------------------------------- /src/samples/utility/gamesharing/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = gamesharing 2 | OBJS = main.o 3 | 4 | PSP_FW_VERSION = 200 5 | BUILD_PRX = 1 6 | 7 | CFLAGS = -O2 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | 12 | LIBDIR = 13 | LDFLAGS = 14 | LIBS = -lpspgum -lpspgu -lpspnet_adhoc -lpspnet_adhocctl -lpspnet_adhocmatching 15 | 16 | EXTRA_TARGETS = EBOOT.PBP 17 | PSP_EBOOT_TITLE = Game Sharing Sample 18 | 19 | PSPSDK=$(shell psp-config --pspsdk-path) 20 | include $(PSPSDK)/lib/build.mak 21 | -------------------------------------------------------------------------------- /src/samples/utility/htmlviewer/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = htmlsample 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | BUILD_PRX = 1 10 | EXTRA_TARGETS = EBOOT.PBP 11 | 12 | LIBDIR = 13 | LDFLAGS = 14 | LIBS = -lpsphttp -lpspssl -lpspgum -lpspgu 15 | 16 | PSPSDK=$(shell psp-config --pspsdk-path) 17 | include $(PSPSDK)/lib/build.mak 18 | -------------------------------------------------------------------------------- /src/samples/utility/msgdialog/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = msgdialogsample 4 | OBJS = main.o 5 | LIBS = -lpspgum -lpspgu 6 | 7 | # Uncomment the following line to comple for custom firmware 3.xx 8 | #BUILD_PRX = 1 9 | 10 | CFLAGS = -O2 -Wall 11 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 12 | ASFLAGS = $(CFLAGS) 13 | 14 | include $(PSPSDK)/lib/build.mak 15 | -------------------------------------------------------------------------------- /src/samples/utility/netconf/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = netconfsample 4 | OBJS = main.o 5 | 6 | 7 | CFLAGS = -O2 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | include $(PSPSDK)/lib/build.mak 12 | -------------------------------------------------------------------------------- /src/samples/utility/netdialog/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = netdialog 2 | OBJS = main.o 3 | 4 | # For OE firmware: 5 | PSP_FW_VERSION = 200 6 | BUILD_PRX = 1 7 | 8 | 9 | CFLAGS = -O2 -Wall 10 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 11 | ASFLAGS = $(CFLAGS) 12 | 13 | 14 | LIBDIR = 15 | LDFLAGS = 16 | LIBS = -lpspgum -lpspgu 17 | 18 | EXTRA_TARGETS = EBOOT.PBP 19 | PSP_EBOOT_TITLE = Net Dialog Sample 20 | 21 | PSPSDK=$(shell psp-config --pspsdk-path) 22 | include $(PSPSDK)/lib/build.mak 23 | -------------------------------------------------------------------------------- /src/samples/utility/osk/Makefile.sample: -------------------------------------------------------------------------------- 1 | TARGET = osk 2 | OBJS = main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -Wall 6 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 7 | ASFLAGS = $(CFLAGS) 8 | 9 | BUILD_PRX = 1 10 | 11 | LIBDIR = 12 | LDFLAGS = 13 | LIBS = -lpspgu 14 | 15 | EXTRA_TARGETS = EBOOT.PBP 16 | PSP_EBOOT_TITLE = PSP OSK Sample 17 | 18 | PSPSDK=$(shell psp-config --pspsdk-path) 19 | include $(PSPSDK)/lib/build.mak 20 | -------------------------------------------------------------------------------- /src/samples/utility/systemparam/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = sysparamsample 4 | OBJS = main.o 5 | 6 | 7 | CFLAGS = -O2 -Wall 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | include $(PSPSDK)/lib/build.mak 12 | -------------------------------------------------------------------------------- /src/samples/wlan/Makefile.sample: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPLIBSDIR = $(PSPSDK)/.. 3 | TARGET = wlansample 4 | OBJS = main.o 5 | LIBS = -lpspwlan 6 | 7 | 8 | CFLAGS = -O2 -Wall 9 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 10 | ASFLAGS = $(CFLAGS) 11 | 12 | include $(PSPSDK)/lib/build.mak 13 | -------------------------------------------------------------------------------- /src/sdk/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base \ 10 | -I$(top_srcdir)/src/kernel \ 11 | -I$(top_srcdir)/src/libcglue \ 12 | -I$(top_srcdir)/src/user \ 13 | -I$(top_srcdir)/src/net \ 14 | -I$(top_srcdir)/src/utility \ 15 | -I$(top_srcdir)/src/debug 16 | CFLAGS = @PSPSDK_CFLAGS@ 17 | CCASFLAGS = $(CFLAGS) 18 | 19 | libpspsdkincludedir = @PSPSDK_INCLUDEDIR@ 20 | libpspsdkinclude_HEADERS = pspsdk.h 21 | 22 | lib_LIBRARIES = libpspsdk.a 23 | 24 | MODULEMGR_PATCHES_OBJS = \ 25 | InstallNoDeviceCheckPatch.o \ 26 | InstallNoPlainModuleCheckPatch.o \ 27 | InstallKernelLoadModulePatch.o 28 | 29 | INETHELPER_OBJS = pspSdkLoadInetModules.o pspSdkInetInit.o pspSdkInetTerm.o 30 | 31 | MULT_SRCS = modulemgr_patches.c inethelper.c 32 | MULT_OBJS = $(MODULEMGR_PATCHES_OBJS) $(INETHELPER_OBJS) 33 | 34 | libpspsdk_a_SOURCES = query_mod.c loadmodule.c fixup.c threadutils.c memory.c interrupt.S k1set.S fpu.S $(MULT_SRCS) 35 | libpspsdk_a_LIBADD = $(MULT_OBJS) 36 | 37 | $(MODULEMGR_PATCHES_OBJS): modulemgr_patches.c 38 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 39 | 40 | $(INETHELPER_OBJS): inethelper.c 41 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 42 | -------------------------------------------------------------------------------- /src/sdk/fpu.S: -------------------------------------------------------------------------------- 1 | 2 | .set noreorder 3 | .set noat 4 | 5 | .global pspSdkDisableFPUExceptions 6 | .ent pspSdkDisableFPUExceptions 7 | 8 | pspSdkDisableFPUExceptions: 9 | cfc1 $2, $31 10 | lui $8, 0x80 11 | and $8, $2, $8 # Mask off all bits except for 23 of FCR 12 | ctc1 $8, $31 13 | jr $31 14 | nop 15 | .end pspSdkDisableFPUExceptions 16 | -------------------------------------------------------------------------------- /src/sdk/interrupt.S: -------------------------------------------------------------------------------- 1 | 2 | .set noreorder 3 | .set noat 4 | 5 | .global pspSdkDisableInterrupts 6 | .ent pspSdkDisableInterrupts 7 | 8 | pspSdkDisableInterrupts: 9 | mfic $v0, $0 10 | mtic $0, $0 11 | nop 12 | nop 13 | nop 14 | nop 15 | nop 16 | nop 17 | nop 18 | nop 19 | nop 20 | nop 21 | nop 22 | nop 23 | nop 24 | nop 25 | nop 26 | nop 27 | nop 28 | nop 29 | nop 30 | nop 31 | nop 32 | jr $ra 33 | nop 34 | 35 | .end pspSdkDisableInterrupts 36 | 37 | .global pspSdkEnableInterrupts 38 | .ent pspSdkEnableInterrupts 39 | 40 | pspSdkEnableInterrupts: 41 | mtic $a0, $0 42 | nop 43 | nop 44 | nop 45 | nop 46 | nop 47 | nop 48 | nop 49 | nop 50 | nop 51 | nop 52 | nop 53 | nop 54 | nop 55 | nop 56 | nop 57 | nop 58 | nop 59 | nop 60 | nop 61 | nop 62 | nop 63 | jr $ra 64 | nop 65 | 66 | .end pspSdkEnableInterrupts 67 | -------------------------------------------------------------------------------- /src/sdk/k1set.S: -------------------------------------------------------------------------------- 1 | 2 | .set noreorder 3 | .set noat 4 | 5 | .global pspSdkSetK1 6 | .ent pspSdkSetK1 7 | 8 | pspSdkSetK1: 9 | move $v0, $k1 10 | jr $ra 11 | move $k1, $a0 12 | 13 | .end pspSdkSetK1 14 | 15 | .global pspSdkGetK1 16 | .ent pspSdkGetK1 17 | 18 | pspSdkGetK1: 19 | jr $ra 20 | move $v0, $k1 21 | 22 | .end pspSdkGetK1 23 | -------------------------------------------------------------------------------- /src/sircs/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | SIRCS_OBJS = sceSircs_0000.o sceSircs_0001.o 14 | 15 | libpspsircsincludedir = @PSPSDK_INCLUDEDIR@ 16 | libpspsircsinclude_HEADERS = pspsircs.h 17 | 18 | lib_LIBRARIES = libpspsircs.a 19 | libpspsircs_a_SOURCES = sceSircs.S 20 | libpspsircs_a_LIBADD = $(SIRCS_OBJS) 21 | 22 | $(SIRCS_OBJS): sceSircs.S 23 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 24 | -------------------------------------------------------------------------------- /src/sircs/pspsircs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspmodulemgr.h - Prototypes to manage manage modules. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * Copyright (c) 2005 Matthew H 12 | * 13 | * $$ 14 | */ 15 | #ifndef __SIRCS_H__ 16 | #define __SIRCS_H__ 17 | 18 | /** @defgroup Sony Integrated Remote Control System Library 19 | * This module contains the imports for the kernel's remote control routines. 20 | */ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /** @addtogroup Sony Integrated Remote Control System Library */ 27 | /**@{*/ 28 | 29 | struct sircs_data { 30 | u8 type; // 12, 15 or 20 bits 31 | u8 cmd; // 7 bit cmd 32 | u16 dev; // 5, 8 or 13 bit device address 33 | } __packed__; 34 | 35 | /** 36 | */ 37 | int sceSircsSend(struct sircs_data* sd, int count); 38 | 39 | /**@}*/ 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/sircs/sceSircs.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceSircs_0000 6 | IMPORT_START "sceSircs",0x40010000 7 | #endif 8 | #ifdef F_sceSircs_0001 9 | IMPORT_FUNC "sceSircs",0x71EEF62D,sceSircsSend 10 | #endif 11 | -------------------------------------------------------------------------------- /src/startup/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | CC = @PSP_CC@ 3 | CCAS = $(CC) 4 | AR = @PSP_AR@ 5 | RANLIB = @PSP_RANLIB@ 6 | 7 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/user -I$(top_srcdir)/src/debug 8 | CFLAGS = @PSPSDK_CFLAGS@ 9 | CCASFLAGS = $(CFLAGS) 10 | 11 | # Borrowed this trick from newlib: create a dummy library to generate build rules. 12 | noinst_LIBRARIES = lib.a 13 | lib_a_SOURCES = crt0.c crt0_prx.c prxexports.c 14 | 15 | all: crt0.o crt0_prx.o prxexports.o 16 | 17 | startupdir = @PSPDEV_LIBDIR@ 18 | pspsdkdir = @PSPSDK_LIBDIR@ 19 | 20 | # Install the prx specific stuff in the pspsdk libdir 21 | install-exec-hook: 22 | $(mkinstalldirs) $(DESTDIR)$(startupdir) 23 | $(INSTALL_DATA) crt0.o $(DESTDIR)$(startupdir)/crt0.o 24 | $(INSTALL_DATA) crt0_prx.o $(DESTDIR)$(startupdir)/crt0_prx.o 25 | $(INSTALL_DATA) prxexports.o $(DESTDIR)$(pspsdkdir)/prxexports.o 26 | 27 | uninstall-hook: 28 | rm -f $(DESTDIR)$(startupdir)/crt0.o 29 | rm -f $(DESTDIR)$(startupdir)/crt0_prx.o 30 | rm -f $(DESTDIR)$(pspsdkdir)/prxexports.o 31 | 32 | CLEANFILES = crt0.o crt0_prx.o prxexports.o 33 | 34 | # Explicitly add dependencies 35 | EXTRA_DIST = crt0.c crt0_prx.c prxexports.c 36 | -------------------------------------------------------------------------------- /src/startup/dummy.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/src/startup/dummy.c -------------------------------------------------------------------------------- /src/startup/prxexports.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspexports.c - Define the default set of exports for an executable 7 | * 8 | * Copyright (c) 2005 James F. 9 | * 10 | */ 11 | #include 12 | #define NULL ((void *) 0) 13 | 14 | extern int module_start; 15 | extern struct SceModuleInfo module_info; 16 | static const unsigned int __syslib_exports[4] __attribute__((section(".rodata.sceResident"))) = { 17 | 0xD632ACDB, 18 | 0xF01D73A7, 19 | (unsigned int) &module_start, 20 | (unsigned int) &module_info, 21 | }; 22 | 23 | const struct _PspLibraryEntry __library_exports[1] __attribute__((section(".lib.ent"), used)) = { 24 | { NULL, 0x0000, 0x8000, 4, 1, 1, (unsigned int *) &__syslib_exports }, 25 | }; 26 | -------------------------------------------------------------------------------- /src/usb/pspusbacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspusbacc.h - Prototypes for the sceUsbAcc library 7 | * 8 | * Copyright (c) 2007 dot_blank 9 | * 10 | */ 11 | #ifndef __PSPUSBACC_H__ 12 | #define __PSPUSBACC_H__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define PSP_USBACC_DRIVERNAME "USBAccBaseDriver" 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /src/usb/sceUsb.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceUsb_0000 6 | IMPORT_START "sceUsb",0x40010000 7 | #endif 8 | #ifdef F_sceUsb_0001 9 | IMPORT_FUNC "sceUsb",0xAE5DE6AF,sceUsbStart 10 | #endif 11 | #ifdef F_sceUsb_0002 12 | IMPORT_FUNC "sceUsb",0xC2464FA0,sceUsbStop 13 | #endif 14 | #ifdef F_sceUsb_0003 15 | IMPORT_FUNC "sceUsb",0xC21645A4,sceUsbGetState 16 | #endif 17 | #ifdef F_sceUsb_0004 18 | IMPORT_FUNC "sceUsb",0x4E537366,sceUsbGetDrvList 19 | #endif 20 | #ifdef F_sceUsb_0005 21 | IMPORT_FUNC "sceUsb",0x112CC951,sceUsbGetDrvState 22 | #endif 23 | #ifdef F_sceUsb_0006 24 | IMPORT_FUNC "sceUsb",0x586DB82C,sceUsbActivate 25 | #endif 26 | #ifdef F_sceUsb_0007 27 | IMPORT_FUNC "sceUsb",0xC572A9C8,sceUsbDeactivate 28 | #endif 29 | #ifdef F_sceUsb_0008 30 | IMPORT_FUNC "sceUsb",0x5BE0E002,sceUsbWaitState 31 | #endif 32 | #ifdef F_sceUsb_0009 33 | IMPORT_FUNC "sceUsb",0x1C360735,sceUsbWaitCancel 34 | #endif 35 | -------------------------------------------------------------------------------- /src/usb/sceUsbBus_driver.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceUsbBus_driver_0000 6 | IMPORT_START "sceUsbBus_driver",0x00010000 7 | #endif 8 | #ifdef F_sceUsbBus_driver_0001 9 | IMPORT_FUNC "sceUsbBus_driver",0xC21645A4,sceUsbGetState 10 | #endif 11 | #ifdef F_sceUsbBus_driver_0002 12 | IMPORT_FUNC "sceUsbBus_driver",0xB1644BE7,sceUsbbdRegister 13 | #endif 14 | #ifdef F_sceUsbBus_driver_0003 15 | IMPORT_FUNC "sceUsbBus_driver",0xC1E2A540,sceUsbbdUnregister 16 | #endif 17 | #ifdef F_sceUsbBus_driver_0004 18 | IMPORT_FUNC "sceUsbBus_driver",0x951A24CC,sceUsbbdClearFIFO 19 | #endif 20 | #ifdef F_sceUsbBus_driver_0005 21 | IMPORT_FUNC "sceUsbBus_driver",0xE65441C1,sceUsbbdStall 22 | #endif 23 | #ifdef F_sceUsbBus_driver_0006 24 | IMPORT_FUNC "sceUsbBus_driver",0x23E51D8F,sceUsbbdReqSend 25 | #endif 26 | #ifdef F_sceUsbBus_driver_0007 27 | IMPORT_FUNC "sceUsbBus_driver",0x913EC15D,sceUsbbdReqRecv 28 | #endif 29 | #ifdef F_sceUsbBus_driver_0008 30 | IMPORT_FUNC "sceUsbBus_driver",0xCC57EC9D,sceUsbbdReqCancel 31 | #endif 32 | #ifdef F_sceUsbBus_driver_0009 33 | IMPORT_FUNC "sceUsbBus_driver",0xC5E53685,sceUsbbdReqCancelAll 34 | #endif 35 | -------------------------------------------------------------------------------- /src/usb/sceUsb_driver.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceUsb_driver_0000 6 | IMPORT_START "sceUsb_driver",0x00010000 7 | #endif 8 | #ifdef F_sceUsb_driver_0001 9 | IMPORT_FUNC "sceUsb_driver",0xAE5DE6AF,sceUsbStart 10 | #endif 11 | #ifdef F_sceUsb_driver_0002 12 | IMPORT_FUNC "sceUsb_driver",0xC2464FA0,sceUsbStop 13 | #endif 14 | #ifdef F_sceUsb_driver_0003 15 | IMPORT_FUNC "sceUsb_driver",0xC21645A4,sceUsbGetState 16 | #endif 17 | #ifdef F_sceUsb_driver_0004 18 | IMPORT_FUNC "sceUsb_driver",0x4E537366,sceUsbGetDrvList 19 | #endif 20 | #ifdef F_sceUsb_driver_0005 21 | IMPORT_FUNC "sceUsb_driver",0x112CC951,sceUsbGetDrvState 22 | #endif 23 | #ifdef F_sceUsb_driver_0006 24 | IMPORT_FUNC "sceUsb_driver",0x586DB82C,sceUsbActivate 25 | #endif 26 | #ifdef F_sceUsb_driver_0007 27 | IMPORT_FUNC "sceUsb_driver",0xC572A9C8,sceUsbDeactivate 28 | #endif 29 | #ifdef F_sceUsb_driver_0008 30 | IMPORT_FUNC "sceUsb_driver",0x5BE0E002,sceUsbWaitState 31 | #endif 32 | #ifdef F_sceUsb_driver_0009 33 | IMPORT_FUNC "sceUsb_driver",0x1C360735,sceUsbWaitCancel 34 | #endif 35 | #ifdef F_sceUsb_driver_0010 36 | IMPORT_FUNC "sceUsb_driver",0xE20B23A6,sceUsb_E20B23A6 37 | #endif 38 | -------------------------------------------------------------------------------- /src/usbstor/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | USBSTOR_OBJS = sceUsbstor_0000.o sceUsbstor_0001.o 14 | USBSTORBOOT_OBJS = sceUsbstorBoot_0000.o sceUsbstorBoot_0001.o sceUsbstorBoot_0002.o sceUsbstorBoot_0003.o sceUsbstorBoot_0004.o sceUsbstorBoot_0005.o sceUsbstorBoot_0006.o 15 | 16 | libpspusbstorincludedir = @PSPSDK_INCLUDEDIR@ 17 | 18 | libpspusbstorinclude_HEADERS = \ 19 | pspusbstor.h 20 | 21 | lib_LIBRARIES = libpspusbstor.a 22 | 23 | libpspusbstor_a_SOURCES = sceUsbstor.S sceUsbstorBoot.S 24 | libpspusbstor_a_LIBADD = $(USBSTOR_OBJS) $(USBSTORBOOT_OBJS) 25 | 26 | $(USBSTOR_OBJS): sceUsbstor.S 27 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 28 | 29 | $(USBSTORBOOT_OBJS): sceUsbstorBoot.S 30 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 31 | -------------------------------------------------------------------------------- /src/usbstor/sceUsbstor.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceUsbstor_0000 6 | IMPORT_START "sceUsbstor",0x40090000 7 | #endif 8 | #ifdef F_sceUsbstor_0001 9 | IMPORT_FUNC "sceUsbstor",0x60066CFE,sceUsbstorGetStatus 10 | #endif 11 | -------------------------------------------------------------------------------- /src/usbstor/sceUsbstorBoot.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceUsbstorBoot_0000 6 | IMPORT_START "sceUsbstorBoot",0x40090000 7 | #endif 8 | #ifdef F_sceUsbstorBoot_0001 9 | IMPORT_FUNC "sceUsbstorBoot",0xE58818A8,sceUsbstorBootSetCapacity 10 | #endif 11 | #ifdef F_sceUsbstorBoot_0002 12 | IMPORT_FUNC "sceUsbstorBoot",0x594BBF95,sceUsbstorBootSetLoadAddr 13 | #endif 14 | #ifdef F_sceUsbstorBoot_0003 15 | IMPORT_FUNC "sceUsbstorBoot",0x6D865ECD,sceUsbstorBootGetDataSize 16 | #endif 17 | #ifdef F_sceUsbstorBoot_0004 18 | IMPORT_FUNC "sceUsbstorBoot",0xA1119F0D,sceUsbstorBootSetStatus 19 | #endif 20 | #ifdef F_sceUsbstorBoot_0005 21 | IMPORT_FUNC "sceUsbstorBoot",0x1F080078,sceUsbstorBootRegisterNotify 22 | #endif 23 | #ifdef F_sceUsbstorBoot_0006 24 | IMPORT_FUNC "sceUsbstorBoot",0xA55C9E16,sceUsbstorBootUnregisterNotify 25 | #endif 26 | -------------------------------------------------------------------------------- /src/user/InterruptManager.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_InterruptManager_0000 6 | IMPORT_START "InterruptManager",0x40000000 7 | #endif 8 | #ifdef F_InterruptManager_0001 9 | IMPORT_FUNC "InterruptManager",0xCA04A2B9,sceKernelRegisterSubIntrHandler 10 | #endif 11 | #ifdef F_InterruptManager_0002 12 | IMPORT_FUNC "InterruptManager",0xD61E6961,sceKernelReleaseSubIntrHandler 13 | #endif 14 | #ifdef F_InterruptManager_0003 15 | IMPORT_FUNC "InterruptManager",0xFB8E22EC,sceKernelEnableSubIntr 16 | #endif 17 | #ifdef F_InterruptManager_0004 18 | IMPORT_FUNC "InterruptManager",0x8A389411,sceKernelDisableSubIntr 19 | #endif 20 | #ifdef F_InterruptManager_0005 21 | IMPORT_FUNC "InterruptManager",0x5CB5A78B,sceKernelSuspendSubIntr 22 | #endif 23 | #ifdef F_InterruptManager_0006 24 | IMPORT_FUNC "InterruptManager",0x7860E0DC,sceKernelResumeSubIntr 25 | #endif 26 | #ifdef F_InterruptManager_0007 27 | IMPORT_FUNC "InterruptManager",0xFC4374B8,sceKernelIsSubInterruptOccurred 28 | #endif 29 | #ifdef F_InterruptManager_0008 30 | IMPORT_FUNC "InterruptManager",0xD2E8363F,QueryIntrHandlerInfo 31 | #endif 32 | #ifdef F_InterruptManager_0009 33 | IMPORT_FUNC "InterruptManager",0xEEE43F47,sceKernelRegisterUserSpaceIntrStack 34 | #endif 35 | -------------------------------------------------------------------------------- /src/user/Kernel_Library.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_Kernel_Library_0000 6 | IMPORT_START "Kernel_Library",0x00010000 7 | #endif 8 | #ifdef F_Kernel_Library_0001 9 | IMPORT_FUNC "Kernel_Library",0x092968F4,sceKernelCpuSuspendIntr 10 | #endif 11 | #ifdef F_Kernel_Library_0002 12 | IMPORT_FUNC "Kernel_Library",0x5F10D406,sceKernelCpuResumeIntr 13 | #endif 14 | #ifdef F_Kernel_Library_0003 15 | IMPORT_FUNC "Kernel_Library",0x3B84732D,sceKernelCpuResumeIntrWithSync 16 | #endif 17 | #ifdef F_Kernel_Library_0004 18 | IMPORT_FUNC "Kernel_Library",0x47A0B729,sceKernelIsCpuIntrSuspended 19 | #endif 20 | #ifdef F_Kernel_Library_0005 21 | IMPORT_FUNC "Kernel_Library",0xB55249D2,sceKernelIsCpuIntrEnable 22 | #endif 23 | #ifdef F_Kernel_Library_0006 24 | IMPORT_FUNC "Kernel_Library",0xBEA46419,sceKernelLockLwMutex 25 | #endif 26 | #ifdef F_Kernel_Library_0007 27 | IMPORT_FUNC "Kernel_Library",0x15B6446B,sceKernelUnlockLwMutex 28 | #endif 29 | #ifdef F_Kernel_Library_0008 30 | IMPORT_FUNC "Kernel_Library",0xDC692EE3,sceKernelTryLockLwMutex 31 | #endif 32 | -------------------------------------------------------------------------------- /src/user/LoadExecForUser.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_LoadExecForUser_0000 6 | IMPORT_START "LoadExecForUser",0x40010000 7 | #endif 8 | #ifdef F_LoadExecForUser_0001 9 | IMPORT_FUNC "LoadExecForUser",0xBD2F1094,sceKernelLoadExec 10 | #endif 11 | #ifdef F_LoadExecForUser_0002 12 | IMPORT_FUNC "LoadExecForUser",0x2AC9954B,sceKernelExitGameWithStatus 13 | #endif 14 | #ifdef F_LoadExecForUser_0003 15 | IMPORT_FUNC "LoadExecForUser",0x05572A5F,sceKernelExitGame 16 | #endif 17 | #ifdef F_LoadExecForUser_0004 18 | IMPORT_FUNC "LoadExecForUser",0x4AC57943,sceKernelRegisterExitCallback 19 | #endif 20 | -------------------------------------------------------------------------------- /src/user/StdioForUser.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_StdioForUser_0000 6 | IMPORT_START "StdioForUser",0x40010000 7 | #endif 8 | #ifdef F_StdioForUser_0001 9 | IMPORT_FUNC "StdioForUser",0x3054D478,sceKernelStdioRead 10 | #endif 11 | #ifdef F_StdioForUser_0002 12 | IMPORT_FUNC "StdioForUser",0x0CBB0571,sceKernelStdioLseek 13 | #endif 14 | #ifdef F_StdioForUser_0003 15 | IMPORT_FUNC "StdioForUser",0xA46785C9,sceKernelStdioSendChar 16 | #endif 17 | #ifdef F_StdioForUser_0004 18 | IMPORT_FUNC "StdioForUser",0xA3B931DB,sceKernelStdioWrite 19 | #endif 20 | #ifdef F_StdioForUser_0005 21 | IMPORT_FUNC "StdioForUser",0x9D061C19,sceKernelStdioClose 22 | #endif 23 | #ifdef F_StdioForUser_0006 24 | IMPORT_FUNC "StdioForUser",0x924ABA61,sceKernelStdioOpen 25 | #endif 26 | #ifdef F_StdioForUser_0007 27 | IMPORT_FUNC "StdioForUser",0x172D316E,sceKernelStdin 28 | #endif 29 | #ifdef F_StdioForUser_0008 30 | IMPORT_FUNC "StdioForUser",0xA6BAB2E9,sceKernelStdout 31 | #endif 32 | #ifdef F_StdioForUser_0009 33 | IMPORT_FUNC "StdioForUser",0xF78BA90A,sceKernelStderr 34 | #endif 35 | -------------------------------------------------------------------------------- /src/user/SysMemUserForUser.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_SysMemUserForUser_0000 6 | IMPORT_START "SysMemUserForUser",0x40000000 7 | #endif 8 | #ifdef F_SysMemUserForUser_0001 9 | IMPORT_FUNC "SysMemUserForUser",0xA291F107,sceKernelMaxFreeMemSize 10 | #endif 11 | #ifdef F_SysMemUserForUser_0002 12 | IMPORT_FUNC "SysMemUserForUser",0xF919F628,sceKernelTotalFreeMemSize 13 | #endif 14 | #ifdef F_SysMemUserForUser_0003 15 | IMPORT_FUNC "SysMemUserForUser",0x237DBD4F,sceKernelAllocPartitionMemory 16 | #endif 17 | #ifdef F_SysMemUserForUser_0004 18 | IMPORT_FUNC "SysMemUserForUser",0xB6D61D02,sceKernelFreePartitionMemory 19 | #endif 20 | #ifdef F_SysMemUserForUser_0005 21 | IMPORT_FUNC "SysMemUserForUser",0x9D9A5BA1,sceKernelGetBlockHeadAddr 22 | #endif 23 | #ifdef F_SysMemUserForUser_0006 24 | IMPORT_FUNC "SysMemUserForUser",0x3FC9AE6A,sceKernelDevkitVersion 25 | #endif 26 | #ifdef F_SysMemUserForUser_0007 27 | IMPORT_FUNC "SysMemUserForUser",0x13A5ABEF,sceKernelPrintf 28 | #endif 29 | #ifdef F_SysMemUserForUser_0008 30 | IMPORT_FUNC "SysMemUserForUser",0x7591C7DB,sceKernelSetCompiledSdkVersion 31 | #endif 32 | #ifdef F_SysMemUserForUser_0009 33 | IMPORT_FUNC "SysMemUserForUser",0xFC114573,sceKernelGetCompiledSdkVersion 34 | #endif 35 | -------------------------------------------------------------------------------- /src/user/pspintrman.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspintrman.c - Interface to the system interupt manager. 7 | * 8 | * Copyright (c) 2005 James F. (tyranid@gmail.com) 9 | * Copyright (c) 2005 Florin Sasu (...) 10 | * 11 | */ 12 | 13 | #include 14 | 15 | const char* PspInterruptNames[67] = {//67 interrupts 16 | 0, 0, 0, 0, "GPIO", "ATA_ATAPI", "UmdMan", "MScm0", 17 | "Wlan", 0, "Audio", 0, "I2C", 0, "SIRCS_IrDA", 18 | "Systimer0", "Systimer1", "Systimer2", "Systimer3", 19 | "Thread0", "NAND", "DMACPLUS", "DMA0", "DMA1", 20 | "Memlmd", "GE", 0, 0, 0, 0, "Display", "MeCodec", 0, 21 | 0, 0, 0, "HP_Remote", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "MScm1", "MScm2", 23 | 0, 0, 0, "Thread1", "Interrupt" 24 | }; 25 | -------------------------------------------------------------------------------- /src/user/pspiofilemgr_devctl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspiofilemgr_devctl.h - File attributes and directory entries. 7 | * 8 | */ 9 | 10 | #ifndef PSPIOFILEMGR_DEVCTL_H 11 | #define PSPIOFILEMGR_DEVCTL_H 12 | 13 | #include 14 | 15 | /* This sceIoDevctl command gets the device capacity. */ 16 | #define SCE_PR_GETDEV 0x02425818 17 | 18 | /* This structure stores the device capacity using SCE_PR_GETDEV in sceIoDevctl */ 19 | typedef struct SceDevInf { 20 | /* max logical cluster x unit */ 21 | uint32_t maxClusters; 22 | /* number of empty clusters */ 23 | uint32_t freeClusters; 24 | /* cluster of empty logical block */ 25 | uint32_t maxSectors; 26 | /* bytes x logical sector */ 27 | int32_t sectorSize; 28 | /* sector x cluster */ 29 | int32_t sectorCount; 30 | } SceDevInf; 31 | 32 | typedef struct SceDevctlCmd { 33 | SceDevInf *dev_inf; 34 | } SceDevctlCmd; 35 | 36 | #endif /* PSPIOFILEMGR_DEVCTL_H */ 37 | -------------------------------------------------------------------------------- /src/user/pspiofilemgr_dirent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspiofilemgr_dirent.h - File attributes and directory entries. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | 14 | /* Note: Some of the structures, types, and definitions in this file were 15 | extrapolated from symbolic debugging information found in the Japanese 16 | version of Puzzle Bobble. */ 17 | 18 | #ifndef PSPIOFILEMGR_DIRENT_H 19 | #define PSPIOFILEMGR_DIRENT_H 20 | 21 | #include 22 | 23 | /** Describes a single directory entry */ 24 | typedef struct SceIoDirent { 25 | /** File status. */ 26 | SceIoStat d_stat; 27 | /** File name. */ 28 | char d_name[256]; 29 | /** Device-specific data. */ 30 | void * d_private; 31 | int dummy; 32 | } SceIoDirent; 33 | 34 | #endif /* PSPIOFILEMGR_DIRENT_H */ 35 | -------------------------------------------------------------------------------- /src/user/pspiofilemgr_fcntl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspiofilemgr_fcntl.h - File control definitions. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | #ifndef PSPIOFILEMGR_FCNTL_H 14 | #define PSPIOFILEMGR_FCNTL_H 15 | 16 | /* Note: Not all of these sceIoOpen() flags are not compatible with the 17 | open() flags found in sys/unistd.h. */ 18 | #define PSP_O_RDONLY 0x0001 19 | #define PSP_O_WRONLY 0x0002 20 | #define PSP_O_RDWR (PSP_O_RDONLY | PSP_O_WRONLY) 21 | #define PSP_O_NBLOCK 0x0004 22 | #define PSP_O_DIR 0x0008 23 | #define PSP_O_APPEND 0x0100 24 | #define PSP_O_CREAT 0x0200 25 | #define PSP_O_TRUNC 0x0400 26 | #define PSP_O_EXCL 0x0800 27 | #define PSP_O_NOWAIT 0x8000 28 | 29 | #define PSP_SEEK_SET 0 30 | #define PSP_SEEK_CUR 1 31 | #define PSP_SEEK_END 2 32 | 33 | #endif /* PSPIOFILEMGR_FCNTL_H */ 34 | -------------------------------------------------------------------------------- /src/user/pspkerneltypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspkerneltypes.h - PSP kernel types and definitions. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | 14 | /* Note: Some of the structures, types, and definitions in this file were 15 | extrapolated from symbolic debugging information found in the Japanese 16 | version of Puzzle Bobble. */ 17 | 18 | #ifndef PSPKERNELTYPES_H 19 | #define PSPKERNELTYPES_H 20 | 21 | #include 22 | 23 | /** UIDs are used to describe many different kernel objects. */ 24 | typedef int SceUID; 25 | 26 | /* Misc. kernel types. */ 27 | typedef unsigned int SceSize; 28 | typedef int SceSSize; 29 | 30 | typedef unsigned char SceUChar; 31 | typedef unsigned int SceUInt; 32 | 33 | /* File I/O types. */ 34 | typedef int SceMode; 35 | typedef SceInt64 SceOff; 36 | typedef SceInt64 SceIores; 37 | 38 | #endif /* PSPKERNELTYPES_H */ 39 | -------------------------------------------------------------------------------- /src/user/pspmoduleexport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspmoduleexport.h - Definitions for the .rodata.sceResident section. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | 14 | #ifndef PSP_MODEXPORT_H_ 15 | #define PSP_MODEXPORT_H_ 16 | 17 | /** Structure to hold a single export entry */ 18 | struct _PspLibraryEntry { 19 | const char * name; 20 | unsigned short version; 21 | unsigned short attribute; 22 | unsigned char entLen; 23 | unsigned char varCount; 24 | unsigned short funcCount; 25 | void * entrytable; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/user/pspuser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspuser.h - Main include file for the user interface to the PSP kernel. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | */ 13 | 14 | #ifndef PSPUSER_H 15 | #define PSPUSER_H 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif /* PSPUSER_H */ 31 | -------------------------------------------------------------------------------- /src/user/sceSuspendForUser.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceSuspendForUser_0000 6 | IMPORT_START "sceSuspendForUser",0x40000000 7 | #endif 8 | #ifdef F_sceSuspendForUser_0001 9 | IMPORT_FUNC "sceSuspendForUser",0xEADB1BD7,sceKernelPowerLock 10 | #endif 11 | #ifdef F_sceSuspendForUser_0002 12 | IMPORT_FUNC "sceSuspendForUser",0x3AEE7261,sceKernelPowerUnlock 13 | #endif 14 | #ifdef F_sceSuspendForUser_0003 15 | IMPORT_FUNC "sceSuspendForUser",0x090CCB3F,sceKernelPowerTick 16 | #endif 17 | #ifdef F_sceSuspendForUser_0004 18 | IMPORT_FUNC "sceSuspendForUser",0x3E0271D3,sceKernelVolatileMemLock 19 | #endif 20 | #ifdef F_sceSuspendForUser_0005 21 | IMPORT_FUNC "sceSuspendForUser",0xA14F40B2,sceKernelVolatileMemTryLock 22 | #endif 23 | #ifdef F_sceSuspendForUser_0006 24 | IMPORT_FUNC "sceSuspendForUser",0xA569E425,sceKernelVolatileMemUnlock 25 | #endif 26 | -------------------------------------------------------------------------------- /src/utility/sceUtility_netparam_internal.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceUtility_netparam_internal_0000 6 | IMPORT_START "sceUtility_netparam_internal",0x40010000 7 | #endif 8 | #ifdef F_sceUtility_netparam_internal_0001 9 | IMPORT_FUNC "sceUtility_netparam_internal",0x072DEBF2,sceUtilityCreateNetParam 10 | #endif 11 | #ifdef F_sceUtility_netparam_internal_0002 12 | IMPORT_FUNC "sceUtility_netparam_internal",0x9CE50172,sceUtilityDeleteNetParam 13 | #endif 14 | #ifdef F_sceUtility_netparam_internal_0003 15 | IMPORT_FUNC "sceUtility_netparam_internal",0xFB0C4840,sceUtilityCopyNetParam 16 | #endif 17 | #ifdef F_sceUtility_netparam_internal_0004 18 | IMPORT_FUNC "sceUtility_netparam_internal",0xFC4516F3,sceUtilitySetNetParam 19 | #endif 20 | -------------------------------------------------------------------------------- /src/vaudio/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/user -I$(top_srcdir)/src/debug 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | VAUDIO_OBJS = sceVaudio_0000.o sceVaudio_0001.o sceVaudio_0002.o sceVaudio_0003.o sceVaudio_0004.o sceVaudio_0005.o sceVaudio_0006.o sceVaudio_0007.o sceVaudio_0008.o 14 | 15 | libpspvaudioincludedir = @PSPSDK_INCLUDEDIR@ 16 | libpspvaudioinclude_HEADERS = pspvaudio.h 17 | 18 | lib_LIBRARIES = libpspvaudio.a 19 | 20 | libpspvaudio_a_SOURCES = sceVaudio.S 21 | libpspvaudio_a_LIBADD = $(VAUDIO_OBJS) 22 | 23 | $(VAUDIO_OBJS): sceVaudio.S 24 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 25 | -------------------------------------------------------------------------------- /src/vaudio/sceVaudio.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceVaudio_0000 6 | IMPORT_START "sceVaudio",0x40090000 7 | #endif 8 | #ifdef F_sceVaudio_0001 9 | IMPORT_FUNC "sceVaudio",0x8986295E,sceVaudioOutputBlocking 10 | #endif 11 | #ifdef F_sceVaudio_0002 12 | IMPORT_FUNC "sceVaudio",0x03B6807D,sceVaudioChReserve 13 | #endif 14 | #ifdef F_sceVaudio_0003 15 | IMPORT_FUNC "sceVaudio",0x67585DFD,sceVaudioChRelease 16 | #endif 17 | #ifdef F_sceVaudio_0004 18 | IMPORT_FUNC "sceVaudio",0x346fbe94,sceVaudioSetEffectType 19 | #endif 20 | #ifdef F_sceVaudio_0005 21 | IMPORT_FUNC "sceVaudio",0xcbd4ac51,sceVaudioSetAlcMode 22 | #endif 23 | #ifdef F_sceVaudio_0006 24 | IMPORT_FUNC "sceVaudio",0x504E4745,sceVaudio_504E4745 25 | #endif 26 | #ifdef F_sceVaudio_0007 27 | IMPORT_FUNC "sceVaudio",0x27ACC20B,sceVaudioChReserveBuffering 28 | #endif 29 | #ifdef F_sceVaudio_0008 30 | IMPORT_FUNC "sceVaudio",0xE8E78DC8,sceVaudio_E8E78DC8 31 | #endif 32 | -------------------------------------------------------------------------------- /src/vfpu/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/debug -I$(top_srcdir)/src/user 10 | CFLAGS = @PSPSDK_CFLAGS@ -std=gnu99 -Wall -Wmissing-prototypes 11 | CCASFLAGS = $(CFLAGS) -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 12 | 13 | VFPU_OBJS = 14 | 15 | libpspvfpuincludedir = @PSPSDK_INCLUDEDIR@ 16 | libpspvfpuinclude_HEADERS = pspvfpu.h 17 | 18 | lib_LIBRARIES = libpspvfpu.a 19 | libpspvfpu_a_SOURCES = pspvfpu.c 20 | libpspvfpu_a_LIBADD = $(VFPU_OBJS) 21 | -------------------------------------------------------------------------------- /src/video/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | VIDEOCODEC_OBJS = sceVideocodec_0000.o sceVideocodec_0001.o sceVideocodec_0002.o sceVideocodec_0003.o sceVideocodec_0004.o sceVideocodec_0005.o sceVideocodec_0006.o sceVideocodec_0007.o sceVideocodec_0008.o sceVideocodec_0009.o sceVideocodec_0010.o sceVideocodec_0011.o sceVideocodec_0012.o sceVideocodec_0013.o 14 | 15 | 16 | libpspvideocodecincludedir = @PSPSDK_INCLUDEDIR@ 17 | libpspvideocodecinclude_HEADERS = pspvideocodec.h 18 | 19 | 20 | lib_LIBRARIES = libpspvideocodec.a 21 | 22 | 23 | libpspvideocodec_a_SOURCES = sceVideocodec.S 24 | libpspvideocodec_a_LIBADD = $(VIDEOCODEC_OBJS) 25 | 26 | $(VIDEOCODEC_OBJS): sceVideocodec.S 27 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 28 | -------------------------------------------------------------------------------- /src/video/pspvideocodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - https://github.com/pspdev 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * pspvideocodec.h - Prototypes for the sceVideocodec library. 7 | * 8 | * Copyright (c) 2007 cooleyes 9 | * 10 | */ 11 | 12 | #ifndef __SCELIBVIDEOCODEC_H__ 13 | #define __SCELIBVIDEOCODEC_H__ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int sceVideocodecOpen(unsigned long *Buffer, int Type); 20 | int sceVideocodecGetEDRAM(unsigned long *Buffer, int Type); 21 | int sceVideocodecInit(unsigned long *Buffer, int Type); 22 | int sceVideocodecDecode(unsigned long *Buffer, int Type); 23 | int sceVideocodecReleaseEDRAM(unsigned long *Buffer); 24 | 25 | // sceVideocodecGetVersion 26 | // sceVideocodecScanHeader 27 | // sceVideocodecDelete 28 | // sceVideocodecSetMemory 29 | // sceVideocodecStop 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif -------------------------------------------------------------------------------- /src/vsh/sceChnnlsv.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceChnnlsv_0000 6 | IMPORT_START "sceChnnlsv",0x40010000 7 | #endif 8 | #ifdef F_sceChnnlsv_0001 9 | IMPORT_FUNC "sceChnnlsv",0xE7833020,sceChnnlsv_E7833020 10 | #endif 11 | #ifdef F_sceChnnlsv_0002 12 | IMPORT_FUNC "sceChnnlsv",0xF21A1FCA,sceChnnlsv_F21A1FCA 13 | #endif 14 | #ifdef F_sceChnnlsv_0003 15 | IMPORT_FUNC "sceChnnlsv",0xC4C494F8,sceChnnlsv_C4C494F8 16 | #endif 17 | #ifdef F_sceChnnlsv_0004 18 | IMPORT_FUNC "sceChnnlsv",0xABFDFC8B,sceChnnlsv_ABFDFC8B 19 | #endif 20 | #ifdef F_sceChnnlsv_0005 21 | IMPORT_FUNC "sceChnnlsv",0x850A7FA1,sceChnnlsv_850A7FA1 22 | #endif 23 | #ifdef F_sceChnnlsv_0006 24 | IMPORT_FUNC "sceChnnlsv",0x21BE78B4,sceChnnlsv_21BE78B4 25 | #endif 26 | -------------------------------------------------------------------------------- /src/wlan/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdir = @PSPSDK_LIBDIR@ 3 | 4 | CC = @PSP_CC@ 5 | CCAS = $(CC) 6 | AR = @PSP_AR@ 7 | RANLIB = @PSP_RANLIB@ 8 | 9 | CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel 10 | CFLAGS = @PSPSDK_CFLAGS@ 11 | CCASFLAGS = $(CFLAGS) 12 | 13 | WLAN_OBJS = sceWlanDrv_0000.o sceWlanDrv_0001.o sceWlanDrv_0002.o sceWlanDrv_0003.o 14 | WLANLIB_OBJS = sceWlanDrv_lib_0000.o sceWlanDrv_lib_0001.o sceWlanDrv_lib_0002.o sceWlanDrv_lib_0003.o sceWlanDrv_lib_0004.o sceWlanDrv_lib_0005.o sceWlanDrv_lib_0006.o sceWlanDrv_lib_0007.o sceWlanDrv_lib_0008.o sceWlanDrv_lib_0009.o sceWlanDrv_lib_0010.o sceWlanDrv_lib_0011.o sceWlanDrv_lib_0012.o sceWlanDrv_lib_0013.o sceWlanDrv_lib_0014.o sceWlanDrv_lib_0015.o sceWlanDrv_lib_0016.o sceWlanDrv_lib_0017.o sceWlanDrv_lib_0018.o 15 | 16 | libpspwlanincludedir = @PSPSDK_INCLUDEDIR@ 17 | libpspwlaninclude_HEADERS = pspwlan.h 18 | 19 | lib_LIBRARIES = libpspwlan.a 20 | libpspwlan_a_SOURCES = sceWlanDrv.S sceWlanDrv_lib.S 21 | libpspwlan_a_LIBADD = $(WLAN_OBJS) $(WLANLIB_OBJS) 22 | 23 | $(WLAN_OBJS): sceWlanDrv.S 24 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 25 | 26 | $(WLANLIB_OBJS): sceWlanDrv_lib.S 27 | $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ 28 | -------------------------------------------------------------------------------- /src/wlan/sceWlanDrv.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspimport.s" 4 | 5 | #ifdef F_sceWlanDrv_0000 6 | IMPORT_START "sceWlanDrv",0x40010000 7 | #endif 8 | #ifdef F_sceWlanDrv_0001 9 | IMPORT_FUNC "sceWlanDrv",0x93440B11,sceWlanDevIsPowerOn 10 | #endif 11 | #ifdef F_sceWlanDrv_0002 12 | IMPORT_FUNC "sceWlanDrv",0xD7763699,sceWlanGetSwitchState 13 | #endif 14 | #ifdef F_sceWlanDrv_0003 15 | IMPORT_FUNC "sceWlanDrv",0x0C622081,sceWlanGetEtherAddr 16 | #endif 17 | -------------------------------------------------------------------------------- /tools/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = PrxEncrypter 2 | bin_PROGRAMS = bin2s bin2c bin2o pack-pbp unpack-pbp mksfo mksfoex psp-config psp-build-exports psp-prxgen psp-fixup-imports 3 | 4 | bin2s_SOURCES = bin2s.c 5 | bin2c_SOURCES = bin2c.c 6 | bin2o_SOURCES = bin2o.c 7 | 8 | pack_pbp_SOURCES = pack-pbp.c 9 | unpack_pbp_SOURCES = unpack-pbp.c 10 | 11 | mksfo_SOURCES = mksfo.c 12 | 13 | mksfoex_SOURCES = mksfoex.c 14 | 15 | psp_config_SOURCES = psp-config.c getopt_long.c 16 | 17 | psp_build_exports_SOURCES = psp-build-exports.c getopt_long.c sha1.c 18 | 19 | psp_prxgen_SOURCES = psp-prxgen.c getopt_long.c 20 | 21 | psp_fixup_imports_SOURCES = psp-fixup-imports.c getopt_long.c sha1.c 22 | 23 | noinst_HEADERS = elftypes.h getopt.h prxtypes.h sha1.h types.h 24 | 25 | psp_create_license_directorydir = @PSPDEV_BINDIR@ 26 | psp_create_license_directory_SCRIPTS = psp-create-license-directory -------------------------------------------------------------------------------- /tools/PrxEncrypter/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = PrxEncrypter 2 | PrxEncrypter_SOURCES = crypto.c kirk_engine.c main.c 3 | noinst_HEADERS = crypto.h endian_.h kirk_engine.h psp_headers.h types.h 4 | -------------------------------------------------------------------------------- /tools/PrxEncrypter/endian_.h: -------------------------------------------------------------------------------- 1 | /* 2 | * endian.h 3 | * 4 | * Created on: Jan 4, 2011 5 | */ 6 | 7 | #ifndef ENDIAN_H_ 8 | #define ENDIAN_H_ 9 | 10 | #include "types.h" 11 | 12 | static inline u16 Swap16(u16 v) 13 | { 14 | return (((v & 0x00FF) << 8) | (v & 0xFF00) >> 8); 15 | } 16 | 17 | static inline u32 Swap32(u32 v) 18 | { 19 | return (((v & 0x000000FF) << 24) | ((v & 0x0000FF00) << 8) | 20 | ((v & 0xFF000000) >> 24) | ((v & 0x00FF0000) >> 8)); 21 | } 22 | 23 | static inline u64 Swap64(u64 v) 24 | { 25 | return (((v & 0x00000000000000FFULL) << 56) | 26 | ((v & 0x000000000000FF00ULL) << 40) | 27 | ((v & 0x0000000000FF0000ULL) << 24) | 28 | ((v & 0x00000000FF000000ULL) << 8) | 29 | ((v & 0x000000FF00000000ULL) >> 8) | 30 | ((v & 0x0000FF0000000000ULL) >> 24) | 31 | ((v & 0x00FF000000000000ULL) >> 40) | 32 | ((v & 0xFF00000000000000ULL) >> 56)); 33 | } 34 | 35 | 36 | #endif /* ENDIAN_H_ */ 37 | -------------------------------------------------------------------------------- /tools/PrxEncrypter/kirk_engine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pspdev/pspsdk/04778c12a852ca36c4f3668a420e201a952489cc/tools/PrxEncrypter/kirk_engine.h -------------------------------------------------------------------------------- /tools/PrxEncrypter/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * types.h 3 | * 4 | * Created on: Jan 4, 2011 5 | */ 6 | 7 | #ifndef TYPES_H_ 8 | #define TYPES_H_ 9 | 10 | typedef char s8; 11 | typedef short s16; 12 | typedef int s32; 13 | typedef long long s64; 14 | 15 | typedef unsigned char u8; 16 | typedef unsigned short u16; 17 | typedef unsigned int u32; 18 | typedef unsigned long long u64; 19 | 20 | #endif /* TYPES_H_ */ 21 | --------------------------------------------------------------------------------