├── .github └── FUNDING.yml ├── LICENSE ├── Make_All.bat ├── Make_Clean.bat ├── Makefile ├── Makefile_debug ├── Makefile_loader ├── Makefile_release ├── PS2_EMU ├── lv1 │ ├── include │ │ └── lv1 │ │ │ ├── device.h │ │ │ ├── dispmgr.h │ │ │ ├── gelic.h │ │ │ ├── gelic_wireless.h │ │ │ ├── inttypes.h │ │ │ ├── lv1.h │ │ │ ├── lv1call.h │ │ │ ├── mm.h │ │ │ ├── patch.h │ │ │ ├── ss.h │ │ │ ├── stor.h │ │ │ ├── vas.h │ │ │ └── vuart.h │ └── src │ │ ├── assembly.h │ │ ├── device.c │ │ ├── hvcall.S │ │ ├── mm.c │ │ ├── stor.c │ │ └── vas.c ├── ps2emu │ ├── include │ │ └── ps2emu │ │ │ ├── .directory │ │ │ ├── cdvd.h │ │ │ ├── io.h │ │ │ ├── libc.h │ │ │ ├── macros.h.S │ │ │ ├── memory.h │ │ │ ├── patch.h │ │ │ ├── ps2emu.h │ │ │ ├── symbols.h │ │ │ └── vuart.h │ └── src │ │ ├── io.S │ │ ├── libc.S │ │ ├── libc_c.c │ │ ├── memory.S │ │ ├── patch.S │ │ └── vuart.S ├── ps2emu_gen │ ├── Make_ps2emu_gen.bat │ ├── Makefile │ ├── main.c │ ├── ps2_emu.self │ └── ps2_gxemu.self ├── ps2emu_stage1_file │ ├── Makefile │ ├── Makefile.common │ ├── Makefile.gxemu │ ├── Makefile.hwemu │ ├── data │ │ ├── curves │ │ ├── keys │ │ ├── ldr_curves │ │ ├── npdrm-const │ │ ├── rif-key │ │ └── vsh_curves │ ├── icache.S │ ├── ldscript.ld │ ├── ps2emu_stage1_file.bat │ └── start.S └── ps2emu_stage2 │ ├── common │ ├── common.c │ ├── common.h │ └── scsi.h │ ├── gxemu │ ├── Make_gxemu.bat │ ├── Makefile │ ├── crt0.c │ ├── ldscript.ld │ ├── main.c │ ├── read!!.txt │ ├── restore.h │ └── start.S │ ├── hwemu │ ├── Make_hwemu.bat │ ├── Makefile │ ├── crt0.c │ ├── ldscript.ld │ ├── main.c │ ├── restore.h │ └── start.S │ ├── netemu │ ├── Make_netemu.bat │ ├── Makefile │ ├── data │ │ ├── curves │ │ ├── keys │ │ ├── ldr_curves │ │ ├── npdrm-const │ │ ├── rif-key │ │ └── vsh_curves │ ├── ldscript.ld │ ├── main.c │ ├── printf.c │ ├── ps2_netemu.self │ └── start.S │ └── ps2netemu_gen │ ├── Make_netemu.bat │ ├── Makefile │ ├── main.c │ └── ps2_netemu.self ├── README.md ├── debug ├── include │ ├── debug.h │ ├── debug_util.h │ └── printf.h └── src │ ├── debug.c │ ├── debug_util.c │ └── printf.c ├── fake_ofw ├── debug │ ├── mamba_421C.bin │ ├── mamba_421D.bin │ ├── mamba_430C.bin │ ├── mamba_430D.bin │ ├── mamba_431C.bin │ ├── mamba_440C.bin │ ├── mamba_441C.bin │ ├── mamba_441D.bin │ ├── mamba_446C.bin │ ├── mamba_446D.bin │ ├── mamba_450C.bin │ ├── mamba_450D.bin │ ├── mamba_453C.bin │ ├── mamba_453D.bin │ ├── mamba_455C.bin │ ├── mamba_455D.bin │ ├── mamba_460C.bin │ ├── mamba_465C.bin │ ├── mamba_465D.bin │ ├── mamba_466C.bin │ ├── mamba_466D.bin │ ├── mamba_470C.bin │ ├── mamba_470D.bin │ ├── mamba_475C.bin │ ├── mamba_475D.bin │ ├── mamba_475E.bin │ ├── mamba_476C.bin │ ├── mamba_476D.bin │ ├── mamba_476E.bin │ ├── mamba_478C.bin │ ├── mamba_478D.bin │ ├── mamba_478E.bin │ ├── mamba_480C.bin │ ├── mamba_480D.bin │ ├── mamba_480E.bin │ ├── mamba_481C.bin │ ├── mamba_481D.bin │ ├── mamba_481E.bin │ ├── mamba_482C.bin │ ├── mamba_482D.bin │ ├── mamba_482E.bin │ ├── mamba_483C.bin │ ├── mamba_483D.bin │ ├── mamba_483E.bin │ ├── mamba_484C.bin │ ├── mamba_484D.bin │ ├── mamba_484E.bin │ ├── mamba_485C.bin │ ├── mamba_485D.bin │ ├── mamba_485E.bin │ ├── mamba_486C.bin │ ├── mamba_486D.bin │ ├── mamba_486E.bin │ ├── mamba_487C.bin │ ├── mamba_487D.bin │ ├── mamba_487E.bin │ ├── mamba_488C.bin │ ├── mamba_488D.bin │ ├── mamba_488E.bin │ ├── mamba_489C.bin │ ├── mamba_489D.bin │ ├── mamba_489E.bin │ ├── mamba_490C.bin │ ├── mamba_490D.bin │ └── mamba_490E.bin ├── mamba_421C.bin ├── mamba_421D.bin ├── mamba_430C.bin ├── mamba_430D.bin ├── mamba_431C.bin ├── mamba_440C.bin ├── mamba_441C.bin ├── mamba_441D.bin ├── mamba_446C.bin ├── mamba_446D.bin ├── mamba_450C.bin ├── mamba_450D.bin ├── mamba_453C.bin ├── mamba_453D.bin ├── mamba_455C.bin ├── mamba_455D.bin ├── mamba_460C.bin ├── mamba_465C.bin ├── mamba_465D.bin ├── mamba_466C.bin ├── mamba_466D.bin ├── mamba_470C.bin ├── mamba_470D.bin ├── mamba_475C.bin ├── mamba_475D.bin ├── mamba_475E.bin ├── mamba_476C.bin ├── mamba_476D.bin ├── mamba_476E.bin ├── mamba_478C.bin ├── mamba_478D.bin ├── mamba_478E.bin ├── mamba_480C.bin ├── mamba_480D.bin ├── mamba_480E.bin ├── mamba_481C.bin ├── mamba_481D.bin ├── mamba_481E.bin ├── mamba_482C.bin ├── mamba_482D.bin ├── mamba_482E.bin ├── mamba_483C.bin ├── mamba_483D.bin ├── mamba_483E.bin ├── mamba_484C.bin ├── mamba_484D.bin ├── mamba_484E.bin ├── mamba_485C.bin ├── mamba_485D.bin ├── mamba_485E.bin ├── mamba_486C.bin ├── mamba_486D.bin ├── mamba_486E.bin ├── mamba_487C.bin ├── mamba_487D.bin ├── mamba_487E.bin ├── mamba_488C.bin ├── mamba_488D.bin ├── mamba_488E.bin ├── mamba_489C.bin ├── mamba_489D.bin ├── mamba_489E.bin ├── mamba_490C.bin ├── mamba_490D.bin └── mamba_490E.bin ├── loader_src ├── main.c ├── payload.ld └── start.S ├── lv1 ├── include │ └── lv1 │ │ ├── device.h │ │ ├── dispmgr.h │ │ ├── gelic.h │ │ ├── gelic_wireless.h │ │ ├── inttypes.h │ │ ├── lv1.h │ │ ├── lv1call.h │ │ ├── mm.h │ │ ├── patch.h │ │ ├── ss.h │ │ ├── stor.h │ │ ├── vas.h │ │ └── vuart.h └── src │ ├── assembly.h │ ├── device.c │ ├── hvcall.S │ ├── mm.c │ ├── stor.c │ └── vas.c ├── lv2 ├── include │ └── lv2 │ │ ├── bt.h │ │ ├── ctrl.h │ │ ├── error.h │ │ ├── hid.h │ │ ├── interrupt.h │ │ ├── io.h │ │ ├── libc.h │ │ ├── lv2.h │ │ ├── macros.h.S │ │ ├── memory.h │ │ ├── modules.h │ │ ├── object.h │ │ ├── pad.h │ │ ├── patch.h │ │ ├── process.h │ │ ├── security.h │ │ ├── storage.h │ │ ├── symbols.h │ │ ├── symbols_355C.h │ │ ├── symbols_355D.h │ │ ├── symbols_421C.h │ │ ├── symbols_421D.h │ │ ├── symbols_430C.h │ │ ├── symbols_430D.h │ │ ├── symbols_431C.h │ │ ├── symbols_440C.h │ │ ├── symbols_441C.h │ │ ├── symbols_441D.h │ │ ├── symbols_446C.h │ │ ├── symbols_446D.h │ │ ├── symbols_450C.h │ │ ├── symbols_450D.h │ │ ├── symbols_453C.h │ │ ├── symbols_453D.h │ │ ├── symbols_455C.h │ │ ├── symbols_455D.h │ │ ├── symbols_460C.h │ │ ├── symbols_460D.h │ │ ├── symbols_465C-466C.h │ │ ├── symbols_465D-466D.h │ │ ├── symbols_470C.h │ │ ├── symbols_470D.h │ │ ├── symbols_475C.h │ │ ├── symbols_475D.h │ │ ├── symbols_475E-490E.h │ │ ├── symbols_476C.h │ │ ├── symbols_476D.h │ │ ├── symbols_478C.h │ │ ├── symbols_478D.h │ │ ├── symbols_480C.h │ │ ├── symbols_480D.h │ │ ├── symbols_481C.h │ │ ├── symbols_481D.h │ │ ├── symbols_482C-489C.h │ │ ├── symbols_482C-489C.h.all │ │ ├── symbols_482D-490D.h │ │ ├── symbols_490C.h │ │ ├── symbols_ALL.h │ │ ├── synchronization.h │ │ ├── syscall.h │ │ ├── thread.h │ │ ├── time.h │ │ └── usb.h └── src │ ├── bt.S │ ├── ctrl.S │ ├── hid.S │ ├── interrupt.S │ ├── interrupt_c.c │ ├── io.S │ ├── libc.S │ ├── libc_c.c │ ├── memory.S │ ├── memory_c.c │ ├── modules.S │ ├── modules_c.c │ ├── object.S │ ├── pad.c │ ├── patch.S │ ├── process.S │ ├── security.S │ ├── security_c.c │ ├── storage.S │ ├── synchronization.S │ ├── syscall.S │ ├── thread.S │ ├── thread_c.c │ ├── time.S │ └── usb.S ├── make_all.sh ├── make_clean.sh ├── mamba ├── debug │ ├── mamba_421D.bin │ ├── mamba_430C.bin │ ├── mamba_430D.bin │ ├── mamba_431C.bin │ ├── mamba_440C.bin │ ├── mamba_441C.bin │ ├── mamba_441D.bin │ ├── mamba_446C.bin │ ├── mamba_446D.bin │ ├── mamba_450C.bin │ ├── mamba_450D.bin │ ├── mamba_453C.bin │ ├── mamba_453D.bin │ ├── mamba_455C.bin │ ├── mamba_455D.bin │ ├── mamba_460C.bin │ ├── mamba_465C.bin │ ├── mamba_465D.bin │ ├── mamba_466C.bin │ ├── mamba_466D.bin │ ├── mamba_470C.bin │ ├── mamba_470D.bin │ ├── mamba_475C.bin │ ├── mamba_475D.bin │ ├── mamba_475E.bin │ ├── mamba_476C.bin │ ├── mamba_476D.bin │ ├── mamba_476E.bin │ ├── mamba_478C.bin │ ├── mamba_478D.bin │ ├── mamba_478E.bin │ ├── mamba_480C.bin │ ├── mamba_480D.bin │ ├── mamba_480E.bin │ ├── mamba_481C.bin │ ├── mamba_481D.bin │ ├── mamba_481E.bin │ ├── mamba_482C.bin │ ├── mamba_482D.bin │ ├── mamba_482E.bin │ ├── mamba_483C.bin │ ├── mamba_483D.bin │ ├── mamba_483E.bin │ ├── mamba_484C.bin │ ├── mamba_484D.bin │ ├── mamba_484E.bin │ ├── mamba_485C.bin │ ├── mamba_485D.bin │ ├── mamba_485E.bin │ ├── mamba_486C.bin │ ├── mamba_486D.bin │ ├── mamba_486E.bin │ ├── mamba_487C.bin │ ├── mamba_487D.bin │ ├── mamba_487E.bin │ ├── mamba_488C.bin │ ├── mamba_488D.bin │ ├── mamba_488E.bin │ ├── mamba_489C.bin │ ├── mamba_489D.bin │ ├── mamba_489E.bin │ ├── mamba_490C.bin │ ├── mamba_490D.bin │ └── mamba_490E.bin ├── mamba_421C.bin ├── mamba_421D.bin ├── mamba_430C.bin ├── mamba_430D.bin ├── mamba_431C.bin ├── mamba_440C.bin ├── mamba_441C.bin ├── mamba_441D.bin ├── mamba_446C.bin ├── mamba_446D.bin ├── mamba_450C.bin ├── mamba_450D.bin ├── mamba_453C.bin ├── mamba_453D.bin ├── mamba_455C.bin ├── mamba_455D.bin ├── mamba_460C.bin ├── mamba_465C.bin ├── mamba_465D.bin ├── mamba_466C.bin ├── mamba_466D.bin ├── mamba_470C.bin ├── mamba_470D.bin ├── mamba_475C.bin ├── mamba_475D.bin ├── mamba_475E.bin ├── mamba_476C.bin ├── mamba_476D.bin ├── mamba_476E.bin ├── mamba_478C.bin ├── mamba_478D.bin ├── mamba_478E.bin ├── mamba_480C.bin ├── mamba_480D.bin ├── mamba_480E.bin ├── mamba_481C.bin ├── mamba_481D.bin ├── mamba_481E.bin ├── mamba_482C.bin ├── mamba_482D.bin ├── mamba_482E.bin ├── mamba_483C.bin ├── mamba_483D.bin ├── mamba_483E.bin ├── mamba_484C.bin ├── mamba_484D.bin ├── mamba_484E.bin ├── mamba_485C.bin ├── mamba_485D.bin ├── mamba_485E.bin ├── mamba_486C.bin ├── mamba_486D.bin ├── mamba_486E.bin ├── mamba_487C.bin ├── mamba_487D.bin ├── mamba_487E.bin ├── mamba_488C.bin ├── mamba_488D.bin ├── mamba_488E.bin ├── mamba_489C.bin ├── mamba_489D.bin ├── mamba_489E.bin ├── mamba_490C.bin ├── mamba_490D.bin └── mamba_490E.bin ├── ps3dev └── ppu │ ├── bin │ ├── ppu-gcc.exe │ └── ppu-objcopy.exe │ ├── lib │ └── gcc │ │ └── ppu │ │ └── 4.2.0 │ │ └── include │ │ ├── README │ │ ├── altivec.h │ │ ├── decfloat.h │ │ ├── float.h │ │ ├── iso646.h │ │ ├── limits.h │ │ ├── ppc-asm.h │ │ ├── spe.h │ │ ├── ssp │ │ ├── ssp.h │ │ ├── stdio.h │ │ ├── string.h │ │ └── unistd.h │ │ ├── stdarg.h │ │ ├── stdbool.h │ │ ├── stddef.h │ │ ├── syslimits.h │ │ ├── unwind.h │ │ └── varargs.h │ ├── libexec │ └── gcc │ │ └── ppu │ │ └── 4.2.0 │ │ ├── cc1.exe │ │ ├── cc1plus.exe │ │ ├── collect2.exe │ │ └── install-tools │ │ ├── fixinc.sh │ │ ├── fixincl.exe │ │ └── mkheaders │ └── ppu │ ├── bin │ ├── as.exe │ └── ld.exe │ └── include │ ├── _ansi.h │ ├── alloca.h │ ├── machine │ ├── _types.h │ ├── ansi.h │ ├── endian.h │ ├── fastmath.h │ ├── ieeefp.h │ ├── malloc.h │ ├── param.h │ ├── setjmp-dj.h │ ├── setjmp.h │ ├── stdlib.h │ ├── termios.h │ ├── time.h │ └── types.h │ ├── newlib.h │ ├── reent.h │ ├── stdint.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ └── sys │ ├── _types.h │ ├── cdefs.h │ ├── config.h │ ├── dirent.h │ ├── fcntl.h │ ├── features.h │ ├── file.h │ ├── iconvnls.h │ ├── lock.h │ ├── param.h │ ├── queue.h │ ├── reent.h │ ├── resource.h │ ├── sched.h │ ├── signal.h │ ├── stat.h │ ├── stdio.h │ ├── string.h │ ├── syslimits.h │ ├── time.h │ ├── timeb.h │ ├── times.h │ ├── types.h │ ├── unistd.h │ ├── utime.h │ └── wait.h ├── stage2 ├── common.h ├── config.c ├── config.h ├── crypto.c ├── crypto.h ├── fan_control.h ├── homebrew_blocker.h ├── kernel_payload.h ├── laboratory.c ├── laboratory.h ├── lv2_patches.h ├── main.c ├── make_rif.h ├── mappath.c ├── mappath.h ├── modulespatch.c ├── modulespatch.h ├── peek_poke.h ├── ps3mapi_core.c ├── ps3mapi_core.h ├── psp.c ├── psp.c.TEST ├── psp.h ├── psp_s.S ├── qa.c ├── qa.h ├── reactPSN.h ├── region.c ├── region.h ├── savegames.c ├── savegames.h ├── scsi.h ├── self.h ├── sm_ext.c ├── sm_ext.h ├── stage2.ld ├── start.S ├── storage_ext.c ├── storage_ext.h ├── syscall8.h └── vsh_patches.h ├── zlibutil ├── zlibutil.exe └── zlibutil_src ├── MakeIt.bat ├── Makefile └── zpipe.c /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: ["https://www.paypal.me/aldostools"] 4 | -------------------------------------------------------------------------------- /Make_All.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set PS3DEV=./ps3dev 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 7 | 8 | rem %PATH%; 9 | 10 | if exist mamba\lz\*.lz.bin del mamba\lz\*.lz.bin>nul 11 | if exist mamba\lz rmdir mamba\lz 12 | 13 | if exist mamba\debug\*.bin del mamba\debug\*.bin>nul 14 | if exist mamba\debug rmdir mamba\debug 15 | 16 | if exist mamba\*.bin del mamba\*.bin>nul 17 | if exist mamba rmdir mamba 18 | 19 | if exist *.bin del /q *.bin>nul 20 | 21 | if not exist mamba mkdir mamba 22 | if not exist mamba\lz mkdir mamba\lz 23 | if not exist mamba\debug mkdir mamba\debug 24 | 25 | make clean --no-print-directory 26 | 27 | rem make all --no-print-directory 28 | make release --no-print-directory 29 | rem make debug --no-print-directory 30 | 31 | if not exist mamba\debug\mamba_490C.lz.bin rd mamba\lz>nul 32 | if not exist mamba\debug\mamba_490C.bin rd mamba\debug>nul 33 | 34 | FOR /F "usebackq" %%A IN ('"mamba\mamba_490C.bin"') DO set SIZE=%%~zA 35 | SET SIZE=%SIZE:~0,3%,%SIZE:~3% 36 | echo mamba_490C.bin is %SIZE% bytes 37 | 38 | pause 39 | -------------------------------------------------------------------------------- /Make_Clean.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set PS3DEV=./ps3dev 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 7 | 8 | rem %PATH%; 9 | 10 | if exist mamba\bin del mamba\bin\*.bin>nul 11 | if exist mamba\bin rmdir mamba\bin 12 | 13 | if exist mamba\lz del mamba\lz\*.bin>nul 14 | if exist mamba\lz rmdir mamba\lz 15 | 16 | if exist mamba\debug del mamba\debug\*.bin>nul 17 | if exist mamba\debug rmdir mamba\debug 18 | 19 | if exist mamba del mamba\*.bin>nul 20 | if exist mamba rmdir mamba 21 | 22 | del *.bin>nul 23 | 24 | make clean --no-print-directory 25 | 26 | pause -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PAYLOADS = 421C 421D 430C 430D 431C 440C 441C 441D \ 2 | 446C 446D 450C 450D 453C 453D 455C 455D \ 3 | 460C 465C 465D 466C 466D 470C 470D \ 4 | 475C 476C 478C 480C 481C 482C 483C 484C 485C 486C 487C 488C 489C 490C \ 5 | 475D 476D 478D 480D 481D 482D 483D 484D 485D 486D 487D 488D 489D 490D \ 6 | 475E 476E 478E 480E 481E 482E 483E 484E 485E 486E 487E 488E 489E 490E 7 | 8 | #PAYLOADS = 484C 484D 490C 9 | PAYLOADS = 490C 421C 10 | 11 | export MAMBA_VER 12 | 13 | clean: 14 | @make -f Makefile_release clean 15 | 16 | all: $(PAYLOADS) 17 | 18 | $(PAYLOADS): 19 | $(eval MAMBA_VER = $@) 20 | @echo building mamba_$(MAMBA_VER).bin 21 | @make -f Makefile_release clean --no-print-directory 22 | @make -f Makefile_release all --no-print-directory 23 | @echo building debug/mamba_$(MAMBA_VER).bin 24 | @make -f Makefile_debug clean --no-print-directory 25 | @make -f Makefile_debug all --no-print-directory 26 | 27 | release: release_$(PAYLOADS) 28 | 29 | release_%: 30 | $(eval MAMBA_VER = $(subst release_,,$@)) 31 | @echo building mamba_$(MAMBA_VER).bin 32 | @make -f Makefile_release clean --no-print-directory 33 | @make -f Makefile_release all --no-print-directory 34 | 35 | debug: debug_$(PAYLOADS) 36 | 37 | debug_%: 38 | $(eval MAMBA_VER = $(subst debug_,,$@)) 39 | @echo building debug/mamba_$(MAMBA_VER).bin 40 | @make -f Makefile_debug clean --no-print-directory 41 | @make -f Makefile_debug all --no-print-directory 42 | 43 | loader: 44 | make -f Makefile_loader clean --no-print-directory 45 | make -f Makefile_loader --no-print-directory 46 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/device.h: -------------------------------------------------------------------------------- 1 | /* device.h - lv1 device functions 2 | 3 | Copyright (C) 2010 Hector Martin "marcan" 13 | #include 14 | 15 | enum 16 | { 17 | DEV_TYPE_STOR_DISK = 0, 18 | DEV_TYPE_GELIC = 3, 19 | DEV_TYPE_USB = 4, 20 | DEV_TYPE_STOR_ROM = 5, 21 | DEV_TYPE_SB_GPIO = 6, 22 | DEV_TYPE_STOR_FLASH = 14, 23 | }; 24 | 25 | int map_dma_mem(int bus_id, int dev_id, void *start, size_t len, u64 *bus_addr); 26 | int unmap_dma_mem(int bus_id, int dev_id, u64 bus_addr, size_t len); 27 | 28 | int find_device_by_type(int type, int index, int *bus_id, int *dev_id, int *irq); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/dispmgr.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _DISPMGR_H_ 18 | #define _DISPMGR_H_ 19 | 20 | #include 21 | 22 | #define DISPMGR_VUART_PORT 10 23 | 24 | struct dispmgr_header 25 | { 26 | u32 request_id; 27 | u32 function_id; 28 | u32 request_size; 29 | u32 response_size; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/inttypes.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _INTTYPES_H_ 18 | #define _INTTYPES_H_ 19 | 20 | typedef char s8; 21 | typedef unsigned char u8; 22 | typedef short s16; 23 | typedef unsigned short u16; 24 | typedef int s32; 25 | typedef unsigned int u32; 26 | typedef long s64; 27 | typedef unsigned long u64; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/lv1.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV1_H__ 2 | #define __LV1_H__ 3 | 4 | #include 5 | #include 6 | 7 | #define PS3_LPAR_ID_PME 1 8 | 9 | #define _PS(s) (s "\0\0\0\0\0\0\0\0") 10 | #define S2I(s) ( \ 11 | (((u64)_PS(s)[0])<<56) | \ 12 | (((u64)_PS(s)[1])<<48) | \ 13 | (((u64)_PS(s)[2])<<40) | \ 14 | (((u64)_PS(s)[3])<<32) | \ 15 | (((u64)_PS(s)[4])<<24) | \ 16 | (((u64)_PS(s)[5])<<16) | \ 17 | (((u64)_PS(s)[6])<<8) | \ 18 | (((u64)_PS(s)[7])<<0)) 19 | 20 | #define FIELD_FIRST(s, i) ((S2I(s)>>32) + (i)) 21 | #define FIELD(s, i) (S2I(s) + (i)) 22 | 23 | #endif /* __LV1_H__ */ 24 | 25 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/mm.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _MM_H_ 18 | #define _MM_H_ 19 | 20 | #include 21 | 22 | #define MM_LOAD_BASE(ptr, offset) \ 23 | __asm__ __volatile__ ( \ 24 | "li %0, 1\n\t" \ 25 | "rldicr %0, %0, 63, 0\n\t" \ 26 | "oris %0, %0, %1\n\t" \ 27 | "ori %0, %0, %2\n\t" : \ 28 | "=r"(ptr) : \ 29 | "g"(((offset) >> 16) & 0xFFFF), \ 30 | "g"((offset) & 0xFFFF)) 31 | 32 | #define MM_EA2VA(ea) ((ea) & ~0x8000000000000000ULL) 33 | 34 | int mm_init(void); 35 | 36 | int mm_insert_htab_entry(u64 va_addr, u64 lpar_addr, u64 prot); 37 | 38 | int mm_map_lpar_memory_region(u64 lpar_start_addr, u64 ea_start_addr, u64 size, 39 | u64 page_shift, u64 prot); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/stor.h: -------------------------------------------------------------------------------- 1 | #ifndef _STOR_H_ 2 | #define _STOR_H_ 3 | 4 | #include 5 | 6 | #define LV1_FLASH_DEV_ID 1 7 | #define LV1_BDVD_DEV_ID 2 8 | 9 | typedef struct 10 | { 11 | u64 dev_id; 12 | u64 block_size; 13 | void *dma; 14 | u64 dma_lpar_addr; 15 | u64 dma_size_log; 16 | u32 dma_bus_addr; 17 | } lv1_stor_wrapper_var; 18 | 19 | int lv1_stor_wrapper_open(u64 dev_id, void *dma_buf, u64 dma_buf_lpar_addr, u64 dma_size_log, lv1_stor_wrapper_var *stor_var); 20 | 21 | int lv1_stor_wrapper_close(lv1_stor_wrapper_var *stor_var); 22 | 23 | int lv1_stor_wrapper_read(lv1_stor_wrapper_var *stor_var, u64 region_id, u64 start_sector, u64 num_sectors, u64 flags, void *data); 24 | 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/vas.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _VAS_H_ 18 | #define _VAS_H_ 19 | 20 | unsigned long vas_get_id(void); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/include/lv1/vuart.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _VUART_H_ 18 | #define _VUART_H_ 19 | 20 | #define VUART_PARAM_TX_TRIGGER 0 21 | #define VUART_PARAM_RX_TRIGGER 1 22 | #define VUART_PARAM_INTERRUPT_MASK 2 23 | #define VUART_PARAM_RX_BUFSIZE 3 24 | #define VUART_PARAM_RX_BYTES 4 25 | #define VUART_PARAM_TX_BUFSIZE 5 26 | #define VUART_PARAM_TX_BYTES 6 27 | #define VUART_PARAM_INTERRUPT_STATUS 7 28 | 29 | #define VUART_INTERRUPT_MASK_TX 0x00000001 30 | #define VUART_INTERRUPT_MASK_RX 0x00000002 31 | #define VUART_INTERRUPT_MASK_DISCONNECT 0x00000004 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/src/assembly.h: -------------------------------------------------------------------------------- 1 | /* assembly.h - assembly language definitions 2 | 3 | Copyright (C) 2010 Hector Martin "marcan" 2 | #include 3 | #include 4 | 5 | 6 | #define HPTE_V_BOLTED 0x0000000000000010ULL 7 | #define HPTE_V_LARGE 0x0000000000000004ULL 8 | #define HPTE_V_VALID 0x0000000000000001ULL 9 | #define HPTE_R_PROT_MASK 0x0000000000000003ULL 10 | 11 | int mm_init(void) 12 | { 13 | return 0; 14 | } 15 | 16 | int mm_insert_htab_entry(u64 va_addr, u64 lpar_addr, u64 prot) 17 | { 18 | u64 hpte_group, hpte_index, hpte_v, hpte_r, hpte_evicted_v, hpte_evicted_r; 19 | 20 | hpte_group = (((va_addr >> 28) ^ ((va_addr & 0xFFFFFFFULL) >> 12)) & 0x7FF) << 3; 21 | hpte_v = ((va_addr >> 23) << 7) | HPTE_V_VALID; 22 | hpte_r = lpar_addr | 0x38 | (prot & HPTE_R_PROT_MASK); 23 | 24 | return lv1_insert_htab_entry(0, hpte_group, hpte_v, hpte_r, HPTE_V_BOLTED, 0, 25 | &hpte_index, &hpte_evicted_v, &hpte_evicted_r); 26 | } 27 | 28 | int mm_map_lpar_memory_region(u64 lpar_start_addr, u64 ea_start_addr, u64 size, 29 | u64 page_shift, u64 prot) 30 | { 31 | int i, result; 32 | 33 | for (i = 0; i < size >> page_shift; i++) 34 | { 35 | result = mm_insert_htab_entry(MM_EA2VA(ea_start_addr), lpar_start_addr, prot); 36 | if (result) 37 | return result; 38 | 39 | lpar_start_addr += (1 << page_shift); 40 | ea_start_addr += (1 << page_shift); 41 | } 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/src/stor.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef LV2 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | 13 | #define STOR_BUS_ID 4 14 | 15 | 16 | int lv1_stor_wrapper_open(u64 dev_id, void *dma_buf, u64 dma_buf_lpar_addr, u64 dma_size_log, lv1_stor_wrapper_var *stor_var) 17 | { 18 | u64 dma_bus_addr, v2; 19 | int result; 20 | 21 | result = map_dma_mem(STOR_BUS_ID, dev_id, (void *)dma_buf_lpar_addr, (1<block_size, &v2); 26 | if (result) 27 | { 28 | unmap_dma_mem(STOR_BUS_ID, dev_id, dma_bus_addr, dma_size_log); 29 | return result; 30 | } 31 | 32 | stor_var->dev_id = dev_id; 33 | stor_var->dma = dma_buf; 34 | stor_var->dma_lpar_addr = dma_buf_lpar_addr; 35 | stor_var->dma_size_log = dma_size_log; 36 | stor_var->dma_bus_addr = dma_bus_addr; 37 | 38 | return 0; 39 | } 40 | 41 | int lv1_stor_wrapper_close(lv1_stor_wrapper_var *stor_var) 42 | { 43 | return unmap_dma_mem(STOR_BUS_ID, stor_var->dev_id, stor_var->dma_bus_addr, stor_var->dma_size_log); 44 | } 45 | 46 | int lv1_stor_wrapper_read(lv1_stor_wrapper_var *stor_var, u64 region_id, u64 start_sector, u64 num_sectors, u64 flags, void *data) 47 | { 48 | u64 tag, status; 49 | int result; 50 | 51 | result = lv1_storage_read(stor_var->dev_id, region_id, start_sector, num_sectors, 52 | flags, stor_var->dma_lpar_addr, &tag); 53 | if (result) 54 | return result; 55 | 56 | for (;;) 57 | { 58 | result = lv1_storage_check_async_status(stor_var->dev_id, tag, &status); 59 | if (result) 60 | continue; 61 | 62 | if (status == 0) 63 | break; 64 | } 65 | 66 | memcpy(data, stor_var->dma, stor_var->block_size * num_sectors); 67 | 68 | return 0; 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /PS2_EMU/lv1/src/vas.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | unsigned long vas_get_id(void) 21 | { 22 | u64 id; 23 | 24 | lv1_get_logical_ppe_id(&id); 25 | lv1_get_virtual_address_space_id_of_ppe(id, &id); 26 | 27 | return id; 28 | } 29 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | Timestamp=2011,5,29,11,8,16 3 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/cdvd.h: -------------------------------------------------------------------------------- 1 | #ifndef __PS2EMU_CDVD_H__ 2 | #define __PS2EMU_CDVD_H__ 3 | 4 | #define DEVICE_TYPE_PS3_DVD 0xFF70 5 | #define DEVICE_TYPE_PS3_BD 0xFF71 6 | #define DEVICE_TYPE_PS2_CD 0xFF60 7 | #define DEVICE_TYPE_PS2_DVD 0xFF61 8 | #define DEVICE_TYPE_PSX_CD 0xFF50 9 | #define DEVICE_TYPE_BDROM 0x40 10 | #define DEVICE_TYPE_BDMR_SR 0x41 /* Sequential record */ 11 | #define DEVICE_TYPE_BDMR_RR 0x42 /* Random record */ 12 | #define DEVICE_TYPE_BDMRE 0x43 13 | #define DEVICE_TYPE_DVD 0x10 /* DVD-ROM, DVD+-R, DVD+-RW etc, they are differenced by booktype field in some scsi command */ 14 | #define DEVICE_TYPE_CD 0x08 /* CD-ROM, CD-DA, CD-R, CD-RW, etc, they are differenced somehow with scsi commands */ 15 | 16 | #define STORAGE_COMMAND_ATAPI 0x01 17 | #define STORAGE_COMMAND_GET_DEVICE_SIZE 0x10 18 | #define STORAGE_COMMAND_GET_DEVICE_TYPE 0x11 19 | 20 | #endif /* __PS2EMU_CDVD__ */ 21 | 22 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/io.h: -------------------------------------------------------------------------------- 1 | #ifndef __PS2EMU_IO_H__ 2 | #define __PS2EMU_IO_H__ 3 | 4 | #include 5 | 6 | #ifdef PS2NETEMU 7 | 8 | typedef struct 9 | { 10 | uint64_t st_atime; 11 | uint64_t st_mtime; 12 | uint64_t st_unktime; // Real less fakeable modtime? 13 | uint64_t st_ctime; 14 | uint32_t unk; 15 | uint32_t unk2; 16 | uint64_t st_size; 17 | } __attribute__((packed)) ufs_stat; 18 | 19 | #else 20 | 21 | typedef struct 22 | { 23 | uint64_t st_atime; 24 | uint64_t st_mtime; 25 | uint64_t st_unktime; // Real less fakeable modtime? 26 | uint64_t st_ctime; 27 | uint32_t unk; 28 | } __attribute__((packed)) ufs_stat; 29 | 30 | #endif 31 | 32 | PS2EMU_EXPORT int ufs_open(int unk, char *path); 33 | PS2EMU_EXPORT int ufs_close(int fd); 34 | PS2EMU_EXPORT int ufs_read(int fd, uint64_t offset, void *buf, uint64_t size); 35 | PS2EMU_EXPORT int decrypt(int fd, uint64_t offset, void *buf, uint64_t size); 36 | PS2EMU_EXPORT int ufs_write(int fd, uint64_t offset, void *buf, uint64_t size); 37 | PS2EMU_EXPORT int ufs_fstat(int fd, ufs_stat *stat); 38 | 39 | #endif /* __PS2EMU_IO_H */ 40 | 41 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/libc.h: -------------------------------------------------------------------------------- 1 | #ifndef __PS2EMU_LIBC_H__ 2 | #define __PS2EMU_LIBC_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | PS2EMU_EXPORT int ps2emu_snprintf(char *str, size_t size, const char *format, ...) __attribute__ ((format (printf, 3, 4))); 12 | PS2EMU_EXPORT char *ps2emu_strcpy(char *s1, const char *s2); 13 | PS2EMU_EXPORT char *ps2emu_strcat(char *s1, const char *s2); 14 | PS2EMU_EXPORT size_t ps2emu_strlen (const char * str); 15 | PS2EMU_EXPORT void *ps2emu_memcpy(void *dest, const void *src, size_t n); 16 | PS2EMU_EXPORT void *ps2emu_memset(void *s, int c, size_t n); 17 | 18 | #define snprintf ps2emu_snprintf 19 | #define strcpy ps2emu_strcpy 20 | #define strcat ps2emu_strcat 21 | #define strlen ps2emu_strlen 22 | #define memcpy ps2emu_memcpy 23 | #define memset ps2emu_memset 24 | #define malloc ps2emu_malloc 25 | #define free ps2emu_free 26 | 27 | 28 | #endif /* _PS2EMU_LIBC_H__ */ 29 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/macros.h.S: -------------------------------------------------------------------------------- 1 | #ifndef __MACRO_H_S__ 2 | #define __MACRO_H_S__ 3 | 4 | #include "symbols.h" 5 | 6 | #define LOAD_LABEL(dest, source, address) \ 7 | oris dest, source, (address)@h; \ 8 | ori dest, dest, (address)@l; 9 | 10 | #define PS2EMU_FUNCTION(name, address) \ 11 | .section .name.text, "ax"; \ 12 | .global name; \ 13 | name:; \ 14 | .quad address, TOC; \ 15 | .previous; 16 | 17 | #define PS2EMU_FUNCTION2(name, address) \ 18 | .section .name.text, "ax"; \ 19 | .global name; \ 20 | name:; \ 21 | stdu %sp, -0x80(%sp); \ 22 | mflr %r0; \ 23 | std %r0, 0x90(%sp); \ 24 | std %rtoc, 0x28(%sp); \ 25 | li %r0, 0; \ 26 | LOAD_LABEL(%rtoc, %r0, address); \ 27 | mtctr %rtoc; \ 28 | LOAD_LABEL(%rtoc, %r0, TOC); \ 29 | bctrl; \ 30 | ld %rtoc, 0x28(%sp); \ 31 | ld %r0, 0x90(%sp); \ 32 | addi %sp, %sp, 0x80; \ 33 | mtlr %r0; \ 34 | blr; \ 35 | .previous; 36 | 37 | 38 | #define PS2EMU_FUNCTION3(name, address) \ 39 | .section .name.text, "ax"; \ 40 | .global name; \ 41 | name:; \ 42 | std %rtoc, 0x28(%sp); \ 43 | stdu %sp, -0x70(%sp); \ 44 | mflr %r0; \ 45 | std %r0, 0x80(%sp); \ 46 | li %r0, 0; \ 47 | LOAD_LABEL(%rtoc, %r0, address); \ 48 | mtctr %rtoc; \ 49 | LOAD_LABEL(%rtoc, %r0, TOC); \ 50 | bctrl; \ 51 | ld %r0, 0x80(%sp); \ 52 | mtlr %r0; \ 53 | addi %sp, %sp, 0x70; \ 54 | ld %rtoc, 0x28(%sp); \ 55 | blr; \ 56 | .previous; 57 | 58 | #endif /* __MACRO_H_S__ */ 59 | 60 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/memory.h: -------------------------------------------------------------------------------- 1 | #ifndef __PS2EMU_MEMORY_H__ 2 | #define __PS2EMU_MEMORY_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | PS2EMU_EXPORT void *ps2emu_malloc(size_t size); 9 | PS2EMU_EXPORT void ps2emu_free(void *p); 10 | PS2EMU_EXPORT void *zeroalloc(size_t size); 11 | 12 | #endif /* __PS2EMU_MEMORY_H__ */ 13 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/ps2emu.h: -------------------------------------------------------------------------------- 1 | #ifndef __PS2EMU_H__ 2 | #define __PS2EMU_H__ 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | #define LONGCALL extern "C" __attribute__((longcall)) 9 | #else 10 | #define LONGCALL extern __attribute__((longcall)) 11 | #endif 12 | 13 | #define PS2EMU_EXPORT LONGCALL 14 | #define INLINE inline __attribute__((always_inline)) 15 | 16 | 17 | #define PS2EMU_STATIC_CONTEXT(ret, name, args) asm("" \ 18 | " .section \".text\"\n" \ 19 | " .align 2\n" \ 20 | " .p2align 3,,7\n" \ 21 | " .globl "#name"\n" \ 22 | " .section \".opd\",\"aw\"\n" \ 23 | " .align 3\n" \ 24 | #name": \n" \ 25 | " .quad .L."#name",.TOC.@tocbase\n" \ 26 | " .previous\n" \ 27 | " .type "#name", @function\n" \ 28 | ".L."#name":\n" \ 29 | " mflr 0\n" \ 30 | " std 0, 32(1)\n" \ 31 | " std 2, 40(1)\n" \ 32 | " clrrdi 2, 2, 32\n" \ 33 | " oris 2, 2, __toc@h\n" \ 34 | " ori 2, 2, __toc@l\n" \ 35 | " bl .L._"#name"\n" \ 36 | " ld 2, 40(1)\n" \ 37 | " ld 0, 32(1)\n" \ 38 | " mtlr 0\n" \ 39 | " blr\n" \ 40 | " .size "#name",.-.L."#name"\n"); \ 41 | ret name args; \ 42 | ret _##name args 43 | 44 | #define PS2EMU_CONTEXT(ret, name, args) asm("" \ 45 | " .section \".text\"\n" \ 46 | " .align 2\n" \ 47 | " .p2align 3,,7\n" \ 48 | " .globl "#name"\n" \ 49 | " .section \".opd\",\"aw\"\n" \ 50 | " .align 3\n" \ 51 | #name": \n" \ 52 | " .quad .L."#name",.TOC.@tocbase\n" \ 53 | " .previous\n" \ 54 | " .type "#name", @function\n" \ 55 | ".L."#name":\n" \ 56 | " mflr 0\n" \ 57 | " std 0, 32(1)\n" \ 58 | " std 2, 40(1)\n" \ 59 | " bl +4\n" \ 60 | " li 0, 0\n" \ 61 | " li 2, 0\n" \ 62 | " oris 2, 2, __toc@h\n" \ 63 | " ori 2, 2, __toc@l\n" \ 64 | " oris 0, 0, .L."#name"@h\n" \ 65 | " ori 0, 0, .L."#name"@l\n" \ 66 | " subf 0, 0, 2\n" \ 67 | " mflr 2\n" \ 68 | " addi 2, 2, -16\n" \ 69 | " add 2, 2, 0\n" \ 70 | " bl .L._"#name"\n" \ 71 | " ld 2, 40(1)\n" \ 72 | " ld 0, 32(1)\n" \ 73 | " mtlr 0\n" \ 74 | " blr\n" \ 75 | " .size "#name",.-.L."#name"\n"); \ 76 | ret name args; \ 77 | ret _##name args 78 | 79 | #define PS2EMU_CALLBACK PS2EMU_CONTEXT 80 | 81 | #endif /* __LV2_H__ */ 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/include/ps2emu/vuart.h: -------------------------------------------------------------------------------- 1 | #ifndef __PS2EMU_VUART_H__ 2 | #define __PS2EMU_VUART_H__ 3 | 4 | #include 5 | 6 | #define VUART_PORT_AV 0 7 | #define VUART_PORT_SYSMGGR 2 8 | #define VUART_PORT_DISPMGR 10 9 | 10 | 11 | PS2EMU_EXPORT int vuart_read(uint64_t port, void *buf, uint64_t size); 12 | PS2EMU_EXPORT int vuart_write(uint64_t port, void *buf, uint64_t size); 13 | 14 | #endif /* __PS2EMU_VUART_H__ */ 15 | 16 | 17 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/src/io.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | PS2EMU_FUNCTION(ufs_open, ufs_open_symbol) 5 | PS2EMU_FUNCTION(ufs_close, ufs_close_symbol) 6 | PS2EMU_FUNCTION(ufs_read, ufs_read_symbol) 7 | PS2EMU_FUNCTION(decrypt, decrypt_symbol) 8 | PS2EMU_FUNCTION(ufs_write, ufs_write_symbol) 9 | 10 | #ifdef ufs_fstat_symbol 11 | PS2EMU_FUNCTION(ufs_fstat, ufs_fstat_symbol) 12 | #endif 13 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/src/libc.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef snprintf_symbol 5 | PS2EMU_FUNCTION(ps2emu_snprintf, snprintf_symbol) 6 | #endif 7 | 8 | PS2EMU_FUNCTION(ps2emu_strcpy, strcpy_symbol) 9 | PS2EMU_FUNCTION(ps2emu_strlen, strlen_symbol) 10 | PS2EMU_FUNCTION(ps2emu_strcat, strcat_symbol) 11 | PS2EMU_FUNCTION(ps2emu_memcpy, memcpy_symbol) 12 | PS2EMU_FUNCTION(ps2emu_memset, memset_symbol) 13 | 14 | /* For compatibility with apps that don't import ps2emu/libc.h */ 15 | #ifdef snprintf_symbol 16 | PS2EMU_FUNCTION2(snprintf, snprintf_symbol) 17 | #endif 18 | 19 | PS2EMU_FUNCTION2(strcpy, strcpy_symbol) 20 | PS2EMU_FUNCTION2(strlen, strlen_symbol) 21 | PS2EMU_FUNCTION2(strcat, strcat_symbol) 22 | PS2EMU_FUNCTION2(memcpy, memcpy_symbol) 23 | PS2EMU_FUNCTION2(memset, memset_symbol) 24 | 25 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/src/libc_c.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strcmp(const char *s1, const char *s2) 4 | { 5 | while ((*s1 && *s2) && (*s1 == *s2)) 6 | { 7 | s1++; 8 | s2++; 9 | } 10 | 11 | return *s1 - *s2; 12 | } 13 | 14 | int strncmp(const char *s1, const char *s2, size_t n) 15 | { 16 | unsigned char uc1, uc2; 17 | 18 | /* Nothing to compare? Return zero. */ 19 | if (n == 0) 20 | return 0; 21 | 22 | /* Loop, comparing bytes. */ 23 | while (n-- > 0 && *s1 == *s2) 24 | { 25 | /* If we've run out of bytes or hit a null, return zero 26 | since we already know *s1 == *s2. */ 27 | if (n == 0 || *s1 == '\0') 28 | return 0; 29 | 30 | s1++; 31 | s2++; 32 | } 33 | 34 | uc1 = (*(unsigned char *) s1); 35 | uc2 = (*(unsigned char *) s2); 36 | 37 | return ((uc1 < uc2) ? -1 : (uc1 > uc2)); 38 | } 39 | 40 | int memcmp(const void *s1, const void *s2, size_t n) 41 | { 42 | const unsigned char *p1 = s1; 43 | const unsigned char *p2 = s2; 44 | 45 | for (int i = 0; i < n; i++) 46 | { 47 | if (p1[i] != p2[i]) 48 | { 49 | return (p1[i] < p2[i]) ? -1 : 1; 50 | } 51 | } 52 | 53 | return 0; 54 | } 55 | 56 | char *strchr(const char *s, int c) 57 | { 58 | while (*s != (char)c) 59 | if (!*s++) 60 | return 0; 61 | 62 | return (char *)s; 63 | } 64 | 65 | char *strstr(const char *haystack, const char *needle) 66 | { 67 | size_t needlelen; 68 | 69 | /* Check for the null needle case. */ 70 | if (*needle == '\0') 71 | return (char *) haystack; 72 | 73 | needlelen = strlen(needle); 74 | 75 | for (; (haystack = strchr(haystack, *needle)) != NULL; haystack++) 76 | if (strncmp(haystack, needle, needlelen) == 0) 77 | return (char *) haystack; 78 | 79 | return NULL; 80 | } 81 | 82 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/src/memory.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef malloc_symbol 5 | PS2EMU_FUNCTION(ps2emu_malloc, malloc_symbol) 6 | #endif 7 | 8 | #ifdef free_symbol 9 | PS2EMU_FUNCTION(ps2emu_free, free_symbol) 10 | #endif 11 | 12 | #ifdef zeroalloc_symbol 13 | PS2EMU_FUNCTION(zeroalloc, zeroalloc_symbol) 14 | #endif 15 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/src/patch.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | .global clear_icache 5 | clear_icache: 6 | 7 | add %r4, %r3, %r4 8 | rldicr %r3, %r3, 0, 56 9 | 1: 10 | cmpld %r3, %r4 11 | bge 2f 12 | dcbst 0, %r3 13 | sync 14 | icbi 0, %r3 15 | isync 16 | addi %r3, %r3, 0x80 17 | b 1b 18 | 2: 19 | blr 20 | 21 | .global get_call_address 22 | get_call_address: 23 | 24 | ld %r5, 0(%sp) 25 | cmpwi %r3, 0 26 | ble 4f 27 | mtctr %r3 28 | 3: 29 | cmpdi %r5, 0 30 | beq 5f 31 | ld %r5, 0(%r5) 32 | bdnz 3b 33 | 4: 34 | cmpdi %r5, 0 35 | beq 5f 36 | ld %r3, 0x10(%r5) 37 | addi %r3, %r3, -4 38 | blr 39 | 5: 40 | li %r3, 0 41 | blr 42 | 43 | .global get_patched_func_call_address 44 | get_patched_func_call_address: 45 | 46 | ld %r3, 0(%sp) 47 | cmpdi %r3, 0 48 | beq 6f 49 | ld %r3, 0x20(%r3) 50 | cmpdi %r3, 0 51 | beq 6f 52 | addi %r3, %r3, -4 53 | 6: 54 | blr 55 | 56 | .global call_hooked_function 57 | call_hooked_function: 58 | 59 | std %rtoc, 0x28(%sp) 60 | stdu %sp, -0x70(%sp) 61 | mflr %r0 62 | std %r0, 0x80(%sp) 63 | 64 | ld %r0, 0(%r3) 65 | mtctr %r0 66 | mr %r3, %r4 67 | mr %r4, %r5 68 | mr %r5, %r6 69 | mr %r6, %r7 70 | mr %r7, %r8 71 | mr %r8, %r9 72 | mr %r9, %r10 73 | 74 | li %r0, 0 75 | LOAD_LABEL(%rtoc, %r0, TOC) 76 | bctrl 77 | 78 | ld %r0, 0x80(%sp) 79 | mtlr %r0 80 | addi %sp, %sp, 0x70 81 | ld %rtoc, 0x28(%sp) 82 | blr 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu/src/vuart.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | PS2EMU_FUNCTION(vuart_read, vuart_read_symbol) 5 | PS2EMU_FUNCTION(vuart_write, vuart_write_symbol) 6 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_gen/Make_ps2emu_gen.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PS3DEV=%PS3SDK%/ps3dev2 7 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 8 | set CYGWIN=nodosfilewarning 9 | 10 | rm -f *.o *.exe 11 | make -f Makefile all 12 | pause -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_gen/Makefile: -------------------------------------------------------------------------------- 1 | OUTPUT = ps2emu_gen 2 | OBJS = main.o 3 | CFLAGS = -Wall -I. --std=gnu99 4 | LDFLAGS = -L. -lstdc++ 5 | 6 | all: $(OUTPUT) 7 | 8 | clean: 9 | @rm -f *.exe *.o 10 | 11 | $(OUTPUT): $(OBJS) 12 | $(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS) 13 | @rm -f *.o 14 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_gen/ps2_emu.self: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_gen/ps2_emu.self -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_gen/ps2_gxemu.self: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_gen/ps2_gxemu.self -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/Makefile: -------------------------------------------------------------------------------- 1 | 2 | clean: 3 | @rm -f *.o *.elf *.bin *.self *.map *.lzma ../lv2/src/*.o ../lv1/src/*.o ../debug/src/*.o 4 | 5 | all: 6 | @rm -f *.o *.elf *.bin *.self *.map *.lzma ../lv2/src/*.o ../lv1/src/*.o ../debug/src/*.o 7 | @make -f Makefile.hwemu --no-print-directory 8 | 9 | @rm -f *.o *.elf *.bin *.lzma ../lv2/src/*.o ../lv1/src/*.o ../debug/src/*.o 10 | @make -f Makefile.gxemu --no-print-directory 11 | @rm -f *.o *.elf *.bin *.lzma ../lv2/src/*.o ../lv1/src/*.o ../debug/src/*.o 12 | 13 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/Makefile.common: -------------------------------------------------------------------------------- 1 | CC = ppu-gcc 2 | STRIP = ppu-strip 3 | OBJCOPY = ppu-objcopy 4 | CFLAGS += -mno-toc -ffunction-sections -fdata-sections -Os $(INC) -DFIRMWARE_CEX -DPS2EMU 5 | LDFLAGS = -Tldscript.ld -nostartfiles -nostdlib -nodefaultlibs -Wl,--gc-sections 6 | INC = -I. -I../ps2emu/include 7 | 8 | SRC_ASM= start.S icache.S 9 | 10 | SRC_C= 11 | 12 | OBJ=$(SRC_ASM:.S=.o) $(SRC_C:.c=.o) 13 | 14 | ELF=$(TARGET).elf 15 | BIN=$(TARGET).bin 16 | 17 | all: $(BIN) 18 | 19 | $(BIN): $(ELF) 20 | $(STRIP) -s $^ 21 | $(OBJCOPY) -j .start -j .text -j .data -j .got -j .bss -O binary $^ $@ 22 | ../ps2emu_gen/ps2emu_gen $@ $(SRC_SELF) $(OUT_SELF) $(TEXT_OFFSET) $(PAYLOAD_ADDR) $(SH_ADDR) $(DATA_ADDR) $(PATCH_ADDR) $(PATCH_DATA) 23 | @cp $(OUT_SELF) ../../BIN 24 | @rm -f $(BIN) temp.self $(ELF) $(OBJ) 25 | 26 | $(ELF): $(OBJ) 27 | $(CC) $(LDFLAGS) $(OBJ) -o $@ 28 | 29 | %.o: %.S 30 | $(CC) $(CFLAGS) -c $^ 31 | 32 | %.o: %.c 33 | $(CC) $(CFLAGS) -c $^ 34 | 35 | clean: 36 | @rm -f $(BIN) $(ELF) $(OBJ) temp.self 37 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/Makefile.gxemu: -------------------------------------------------------------------------------- 1 | CFLAGS = -DPS2GXEMU 2 | TARGET = ps2gxemu_stage1_file 3 | SRC_SELF = ../ps2emu_gen/ps2_gxemu.self 4 | OUT_SELF = ps2_gxemu.self 5 | TEXT_OFFSET = 0x10000 6 | PAYLOAD_ADDR = 0x8CAD8 7 | SH_ADDR = 0x208630 8 | DATA_ADDR = 0x677880 9 | PATCH_ADDR = 0x00000000 10 | PATCH_DATA = 0x00000000 11 | 12 | include Makefile.common 13 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/Makefile.hwemu: -------------------------------------------------------------------------------- 1 | CFLAGS = -DPS2HWEMU 2 | TARGET = ps2hwemu_stage1_file 3 | SRC_SELF = ../ps2emu_gen/ps2_emu.self 4 | OUT_SELF = ps2_emu.self 5 | TEXT_OFFSET = 0x10000 6 | PAYLOAD_ADDR = 0x23D6C 7 | SH_ADDR = 0x1BFEC8 8 | DATA_ADDR = 0x4F7930 9 | PATCH_ADDR = 0xFFFFFFFF 10 | PATCH_DATA = 0x00000000 11 | 12 | include Makefile.common 13 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/data/curves: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage1_file/data/curves -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/data/ldr_curves: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage1_file/data/ldr_curves -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/data/npdrm-const: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage1_file/data/npdrm-const -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/data/rif-key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage1_file/data/rif-key -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/data/vsh_curves: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage1_file/data/vsh_curves -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/icache.S: -------------------------------------------------------------------------------- 1 | .global clear_icache 2 | 3 | clear_icache: 4 | 5 | add %r4, %r3, %r4 6 | rldicr %r3, %r3, 0, 56 7 | 1: 8 | cmpld %r3, %r4 9 | bge 2f 10 | dcbst 0, %r3 11 | sync 12 | icbi 0, %r3 13 | isync 14 | addi %r3, %r3, 0x80 15 | b 1b 16 | 2: 17 | blr 18 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/ldscript.ld: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | ENTRY(_start) 18 | 19 | __self_start = 0x0000000000000000; 20 | 21 | SECTIONS 22 | { 23 | . = __self_start; 24 | 25 | .text : 26 | { 27 | *(.text) 28 | *(.text.*) 29 | *(.rodata) 30 | *(.rodata.*) 31 | *(.gnu.linkonce.t.*) 32 | } 33 | 34 | .data : 35 | { 36 | *(.data) 37 | *(.data.*) 38 | } 39 | 40 | .got : 41 | { 42 | *(.got) 43 | *(.got.*) 44 | __toc_start = .; 45 | __toc = . + 0x8000; 46 | *(.toc) 47 | *(.toc.*) 48 | __toc_end = .; 49 | } 50 | 51 | .bss : 52 | { 53 | *(.bss) 54 | *(.bss.*) 55 | } 56 | 57 | __self_end = .; 58 | 59 | .opd : 60 | { 61 | *(.opd) 62 | *(.opd.*) 63 | } 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/ps2emu_stage1_file.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PS3DEV=%PS3SDK%/ps3dev2 7 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin;%PS3DEV%/ppu/ppu/bin; 8 | set CYGWIN=nodosfilewarning 9 | 10 | if not exist ..\..\BIN mkdir ..\..\BIN 11 | make -f Makefile all 12 | 13 | pause -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage1_file/start.S: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | .global _start 4 | 5 | #ifdef PS2HWEMU 6 | 7 | #define stage1_addr overwritten_symbol 8 | #define stage2_addr 0x021f0000 9 | 10 | #elif defined(PS2GXEMU) 11 | 12 | #define stage1_addr overwritten_symbol 13 | #define stage2_addr 0x2bbab28 14 | 15 | #endif 16 | 17 | _start: 18 | 19 | stdu %sp, -0xA0(%sp) 20 | mflr %r0 21 | std %r0, 0xB0(%sp) 22 | std %r23, 0x70(%sp) 23 | std %r24, 0x78(%sp) 24 | std %r25, 0x80(%sp) 25 | std %r26, 0x88(%sp) 26 | std %r31, 0x90(%sp) 27 | std %r30, 0x98(%sp) 28 | 29 | // Save registers 30 | mr %r23, %r3 31 | mr %r24, %r4 32 | mr %r25, %r5 33 | mr %r26, %r6 34 | 35 | lis %r31, stage2_addr@ha 36 | addi %r31, %r31, stage2_addr@l 37 | 38 | // r30 = ufs_open (0, stage2_file); 39 | li %r3, 0 40 | lis %r4, (stage1_addr+stage2_file)@ha 41 | addi %r4, %r4, (stage1_addr+stage2_file)@l 42 | bla ufs_open_symbol 43 | mr %r30, %r3 44 | 45 | // ufs_read(r30, 0, r31, 0x10000); 46 | li %r4, 0 47 | mr %r5, %r31 48 | lis %r6, 1 49 | bla ufs_read_symbol 50 | 51 | // ufs_close(r30); 52 | mr %r3, %r30 53 | bla ufs_close_symbol 54 | 55 | // clear_icache(r31, 0x10000); 56 | mr %r3, %r31 57 | lis %r4, 1 58 | bl clear_icache 59 | 60 | // Stage2 call 61 | mr %r3, %r23 62 | mr %r4, %r24 63 | mr %r5, %r25 64 | mr %r6, %r26 65 | mtctr %r31 66 | bctrl 67 | 68 | # Exit must be at stage2 69 | 70 | /*ld %r23, 0x70(%sp) 71 | ld %r24, 0x78(%sp) 72 | ld %r25, 0x80(%sp) 73 | ld %r26, 0x88(%sp) 74 | ld %r31, 0x90(%sp) 75 | ld %r30, 0x98(%sp) 76 | ld %r0, 0xB0(%sp) 77 | mtlr %r0 78 | addi %sp, %sp, 0xA0 79 | blr*/ 80 | 81 | stage2_file: 82 | 83 | .string "/vm/pm0" 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/gxemu/Make_gxemu.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PS3DEV=%PS3SDK%/ps3dev2 7 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 8 | set CYGWIN=nodosfilewarning 9 | 10 | if not exist ..\..\..\BIN mkdir ..\..\..\BIN 11 | @rm -f *.o *.elf *.bin *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 12 | make -f Makefile all 13 | 14 | pause -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/gxemu/Makefile: -------------------------------------------------------------------------------- 1 | CC := ppu-gcc 2 | CXX := ppu-g++ 3 | LD := ppu-ld 4 | OBJCOPY := ppu-objcopy 5 | OBJDUMP := ppu-objdump 6 | AR := ppu-ar 7 | STRIP := ppu-strip 8 | INCLUDE = ../common ../../ps2emu/include ../../lv2/include ../../lv1/include ../../debug/include 9 | INCLUDE += $(PS3DEV)/ppu/ppu/include 10 | LIBSDIR = 11 | LIBS = 12 | BUILD_TYPE = release 13 | OUTPUT = ps2gxemu_stage2.bin 14 | 15 | CFLAGS = -ffunction-sections -fdata-sections -Os -m64 -fno-builtin -fno-exceptions \ 16 | -Os -Wall -Wno-strict-aliasing $(foreach dir,$(INCLUDE),-I$(dir)) \ 17 | -DPS2EMU -DPS2GXEMU -DFIRMWARE_CEX -ffreestanding 18 | CFLAGS += --std=gnu99 19 | 20 | ifeq ($(BUILD_TYPE), debug) 21 | CFLAGS += -DDEBUG 22 | endif 23 | 24 | ifeq ($(BUILD_TYPE), release) 25 | endif 26 | 27 | LDFLAGS= -T ldscript.ld -nostartfiles -nostdlib -nodefaultlibs -Wl,-static -Wl,-s -L. $(foreach dir,$(LIBSDIR),-L$(dir)) $(LIBS) \ 28 | -Wl,--gc-sections -Wl,-Map=ps2gxemu_stage2.map 29 | 30 | OBJS = start.o crt0.o main.o ../../ps2emu/src/libc.o ../../ps2emu/src/libc_c.o ../../ps2emu/src/memory.o ../../ps2emu/src/io.o \ 31 | ../../ps2emu/src/vuart.o ../../ps2emu/src/patch.o 32 | 33 | ifeq ($(BUILD_TYPE), debug) 34 | OBJS += ../../lv1/src/hvcall.o ../../lv1/src/device.o ../../debug/src/debug.o ../../debug/src/printf.o 35 | endif 36 | 37 | all: $(OUTPUT) 38 | @cp $(OUTPUT) ../../../BIN 39 | @rm -f *.o *.elf *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 40 | 41 | objdump: $(OUTPUT) 42 | $(OBJDUMP) -D -EB -b binary -m powerpc:common64 $(OUTPUT) 43 | 44 | %.bin: %.elf 45 | $(OBJCOPY) -O binary $< $@ 46 | 47 | ps2gxemu_stage2.elf: $(OBJS) ldscript.ld 48 | $(CC) $(LDFLAGS) -o $@ $(OBJS) 49 | 50 | %.o: %.S 51 | $(CC) $(CFLAGS) -c -o $@ $< 52 | 53 | %.o: %.c 54 | $(CC) $(CFLAGS) -c -o $@ $< 55 | 56 | clean: 57 | @rm -f *.o *.elf *.bin *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 58 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/gxemu/crt0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "restore.h" 7 | 8 | extern int main(void); 9 | 10 | int crt0(uint64_t r3, uint64_t r4, uint64_t r5, uint64_t r6) 11 | { 12 | f_desc_t f; 13 | int (* overwritten)(uint64_t, uint64_t, uint64_t, uint64_t); 14 | 15 | memcpy((void *)overwritten_symbol, restore, sizeof(restore)); 16 | clear_icache((void *)overwritten_symbol, sizeof(restore)); 17 | 18 | f.addr = (void *)overwritten_symbol; 19 | f.toc = (void *)TOC; 20 | 21 | overwritten = (void *)&f; 22 | 23 | main(); 24 | return overwritten(r3, r4, r5, r6); 25 | } 26 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/gxemu/ldscript.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-powerpc") 2 | OUTPUT_ARCH(powerpc:common64) 3 | 4 | __base = 0x0BADCAFE00000008; 5 | 6 | ENTRY(_start) 7 | 8 | PHDRS { 9 | stage1 PT_LOAD FLAGS(7); 10 | } 11 | 12 | SECTIONS { 13 | . = __base; 14 | __self_start = .; 15 | 16 | .start : { *(.start) } :stage1 = 0 17 | 18 | . = ALIGN(32); 19 | .text : { 20 | *(.text) 21 | *(.text.*) 22 | } 23 | .rodata : { 24 | *(.rodata) 25 | *(.rodata.*) 26 | } 27 | 28 | __reloc_start = .; 29 | 30 | .data : { 31 | *(.data) 32 | *(.data.*) 33 | *(.sdata) 34 | *(.sdata.*) 35 | } 36 | .bss : { 37 | *(.sbss) 38 | *(.sbss.*) 39 | *(COMMON) 40 | *(.bss) 41 | *(.bss.*) 42 | LONG(0) 43 | } 44 | 45 | . = ALIGN(32); 46 | __toc_start = .; 47 | __toc = . + 0x8000; 48 | .toc : { 49 | *(.toc) 50 | *(.toc.*) 51 | } 52 | __toc_end = .; 53 | __opd_start = .; 54 | .opd : { 55 | *(.opd) 56 | *(.opd.*) 57 | } 58 | __opd_end = .; 59 | __reloc_end = .; 60 | 61 | __self_end = .; 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/gxemu/read!!.txt: -------------------------------------------------------------------------------- 1 | base address in ldscript must have same 16 bytes alignment that stage2_addr (from ps2emu_stage1) 2 | 3 | Examples: 4 | 0x2BB8A20 -> 0x0BADCAFE00000000 5 | 0x2BB8A24 -> 0x0BADCAFE00000004 6 | 0x2BB8A28 -> 0x0BADCAFE00000008 7 | 0x2BB8A2C -> 0x0BADCAFE0000000C 8 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/gxemu/start.S: -------------------------------------------------------------------------------- 1 | .text 2 | .section .start,"ax",@progbits 3 | .align 3 4 | 5 | .global _start 6 | 7 | _start: 8 | 9 | mflr %r0 10 | bl 1f 11 | 1: 12 | mflr %r8 13 | lis %r9, 1b@ha 14 | addi %r9, %r9, 1b@l 15 | subf %r8, %r9, %r8 16 | 17 | li %r11, 0 18 | oris %r11, %r11, 0xBAD 19 | ori %r11, %r11, 0xCAFE 20 | 21 | lis %r9, __reloc_start@ha 22 | addi %r9, %r9, __reloc_start@l 23 | lis %r10, __reloc_end@ha 24 | addi %r10, %r10, __reloc_end@l 25 | subf %r10, %r9, %r10 26 | srdi %r10, %r10, 3 27 | mtctr %r10 28 | add %r9, %r9, %r8 29 | 30 | 2: 31 | ld %r10, 0(%r9) 32 | srdi %r7, %r10, 32 33 | cmpw %r7, %r11 34 | bne 3f 35 | rldicl %r10, %r10, 0, 32 36 | add %r10, %r10, %r8 37 | std %r10, 0(%r9) 38 | 39 | 3: 40 | addi %r9, %r9, 8 41 | bdnz 2b 42 | 43 | 4: 44 | std %r0, 0x10(%sp) 45 | stdu %sp, -0x80(%sp) 46 | std %rtoc, 0x28(%sp) 47 | 48 | lis %rtoc, __toc@ha 49 | addi %rtoc, %rtoc, __toc@l 50 | add %rtoc, %rtoc, %r8 51 | bl crt0 52 | 53 | ld %rtoc, 0x28(%sp) 54 | addi %sp, %sp, 0x80 55 | 56 | // Stage1 return. 57 | ld %r23, 0x70(%sp) 58 | ld %r24, 0x78(%sp) 59 | ld %r25, 0x80(%sp) 60 | ld %r26, 0x88(%sp) 61 | ld %r31, 0x90(%sp) 62 | ld %r30, 0x98(%sp) 63 | ld %r0, 0xB0(%sp) 64 | mtlr %r0 65 | addi %sp, %sp, 0xA0 66 | blr 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/hwemu/Make_hwemu.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PS3DEV=%PS3SDK%/ps3dev2 7 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 8 | set CYGWIN=nodosfilewarning 9 | 10 | if not exist ..\..\..\BIN mkdir ..\..\..\BIN 11 | rm -f *.o *.elf *.bin *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 12 | make all 13 | 14 | pause -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/hwemu/Makefile: -------------------------------------------------------------------------------- 1 | CC := ppu-gcc 2 | CXX := ppu-g++ 3 | LD := ppu-ld 4 | OBJCOPY := ppu-objcopy 5 | OBJDUMP := ppu-objdump 6 | AR := ppu-ar 7 | STRIP := ppu-strip 8 | INCLUDE = ../common ../../ps2emu/include ../../lv1/include ../../debug/include 9 | INCLUDE += $(PS3DEV)/ppu/ppu/include 10 | LIBSDIR = 11 | LIBS = 12 | BUILD_TYPE = release 13 | OUTPUT = ps2hwemu_stage2.bin 14 | 15 | CFLAGS = -ffunction-sections -fdata-sections -Os -m64 -fno-builtin -fno-exceptions \ 16 | -Os -Wall -Wno-strict-aliasing $(foreach dir,$(INCLUDE),-I$(dir)) \ 17 | -DPS2EMU -DPS2HWEMU -DFIRMWARE_CEX -ffreestanding 18 | CFLAGS += --std=gnu99 19 | 20 | ifeq ($(BUILD_TYPE), debug) 21 | CFLAGS += -DDEBUG 22 | endif 23 | 24 | ifeq ($(BUILD_TYPE), release) 25 | endif 26 | 27 | LDFLAGS= -T ldscript.ld -nostartfiles -nostdlib -nodefaultlibs -Wl,-static -Wl,-s -L. $(foreach dir,$(LIBSDIR),-L$(dir)) $(LIBS) \ 28 | -Wl,--gc-sections -Wl,-Map=ps2hwemu_stage2.map 29 | 30 | OBJS = start.o crt0.o main.o ../../ps2emu/src/libc.o ../../ps2emu/src/libc_c.o ../../ps2emu/src/memory.o ../../ps2emu/src/io.o ../../ps2emu/src/patch.o 31 | 32 | ifeq ($(BUILD_TYPE), debug) 33 | OBJS += ../../lv1/src/hvcall.o ../../lv1/src/device.o ../../debug/src/debug.o ../../debug/src/printf.o 34 | endif 35 | 36 | all: $(OUTPUT) 37 | @cp $(OUTPUT) ../../../BIN 38 | @rm -f *.o *.elf *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 39 | 40 | objdump: $(OUTPUT) 41 | $(OBJDUMP) -D -EB -b binary -m powerpc:common64 $(OUTPUT) 42 | 43 | %.bin: %.elf 44 | $(OBJCOPY) -O binary $< $@ 45 | 46 | ps2hwemu_stage2.elf: $(OBJS) ldscript.ld 47 | $(CC) $(LDFLAGS) -o $@ $(OBJS) 48 | 49 | %.o: %.S 50 | $(CC) $(CFLAGS) -c -o $@ $< 51 | 52 | %.o: %.c 53 | $(CC) $(CFLAGS) -c -o $@ $< 54 | 55 | clean: 56 | @rm -f *.o *.elf *.bin *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 57 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/hwemu/crt0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include "restore.h" 10 | 11 | extern int main(void); 12 | 13 | int crt0(uint64_t r3, uint64_t r4, uint64_t r5, uint64_t r6) 14 | { 15 | f_desc_t f; 16 | int (* overwritten)(uint64_t, uint64_t, uint64_t, uint64_t); 17 | 18 | memcpy((void *)overwritten_symbol, restore, sizeof(restore)); 19 | clear_icache((void *)overwritten_symbol, sizeof(restore)); 20 | 21 | f.addr = (void *)overwritten_symbol; 22 | f.toc = (void *)TOC; 23 | 24 | overwritten = (void *)&f; 25 | 26 | main(); 27 | return overwritten(r3, r4, r5, r6); 28 | } 29 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/hwemu/ldscript.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-powerpc") 2 | OUTPUT_ARCH(powerpc:common64) 3 | 4 | __base = 0x0BADCAFE00000000; 5 | 6 | ENTRY(_start) 7 | 8 | PHDRS { 9 | stage1 PT_LOAD FLAGS(7); 10 | } 11 | 12 | SECTIONS { 13 | . = __base; 14 | __self_start = .; 15 | 16 | .start : { *(.start) } :stage1 = 0 17 | 18 | . = ALIGN(32); 19 | .text : { 20 | *(.text) 21 | *(.text.*) 22 | } 23 | .rodata : { 24 | *(.rodata) 25 | *(.rodata.*) 26 | } 27 | 28 | __reloc_start = .; 29 | 30 | .data : { 31 | *(.data) 32 | *(.data.*) 33 | *(.sdata) 34 | *(.sdata.*) 35 | } 36 | .bss : { 37 | *(.sbss) 38 | *(.sbss.*) 39 | *(COMMON) 40 | *(.bss) 41 | *(.bss.*) 42 | LONG(0) 43 | } 44 | 45 | . = ALIGN(32); 46 | __toc_start = .; 47 | __toc = . + 0x8000; 48 | .toc : { 49 | *(.toc) 50 | *(.toc.*) 51 | } 52 | __toc_end = .; 53 | __opd_start = .; 54 | .opd : { 55 | *(.opd) 56 | *(.opd.*) 57 | } 58 | __opd_end = .; 59 | __reloc_end = .; 60 | 61 | __self_end = .; 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/hwemu/start.S: -------------------------------------------------------------------------------- 1 | .text 2 | .section .start,"ax",@progbits 3 | .align 3 4 | 5 | .global _start 6 | 7 | _start: 8 | 9 | mflr %r0 10 | bl 1f 11 | 1: 12 | mflr %r8 13 | lis %r9, 1b@ha 14 | addi %r9, %r9, 1b@l 15 | subf %r8, %r9, %r8 16 | 17 | li %r11, 0 18 | oris %r11, %r11, 0xBAD 19 | ori %r11, %r11, 0xCAFE 20 | 21 | lis %r9, __reloc_start@ha 22 | addi %r9, %r9, __reloc_start@l 23 | lis %r10, __reloc_end@ha 24 | addi %r10, %r10, __reloc_end@l 25 | subf %r10, %r9, %r10 26 | srdi %r10, %r10, 3 27 | mtctr %r10 28 | add %r9, %r9, %r8 29 | 30 | 2: 31 | ld %r10, 0(%r9) 32 | srdi %r7, %r10, 32 33 | cmpw %r7, %r11 34 | bne 3f 35 | rldicl %r10, %r10, 0, 32 36 | add %r10, %r10, %r8 37 | std %r10, 0(%r9) 38 | 39 | 3: 40 | addi %r9, %r9, 8 41 | bdnz 2b 42 | 43 | 4: 44 | std %r0, 0x10(%sp) 45 | stdu %sp, -0x80(%sp) 46 | std %rtoc, 0x28(%sp) 47 | 48 | lis %rtoc, __toc@ha 49 | addi %rtoc, %rtoc, __toc@l 50 | add %rtoc, %rtoc, %r8 51 | bl crt0 52 | 53 | ld %rtoc, 0x28(%sp) 54 | addi %sp, %sp, 0x80 55 | 56 | // Stage1 return. 57 | ld %r23, 0x70(%sp) 58 | ld %r24, 0x78(%sp) 59 | ld %r25, 0x80(%sp) 60 | ld %r26, 0x88(%sp) 61 | ld %r31, 0x90(%sp) 62 | ld %r30, 0x98(%sp) 63 | ld %r0, 0xB0(%sp) 64 | mtlr %r0 65 | addi %sp, %sp, 0xA0 66 | blr 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/Make_netemu.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PS3DEV=%PS3SDK%/ps3dev2 7 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 8 | set CYGWIN=nodosfilewarning 9 | 10 | if not exist ..\..\..\BIN mkdir ..\..\..\BIN 11 | rm -f *.o *.elf *.bin *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 12 | make all 13 | 14 | pause -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/Makefile: -------------------------------------------------------------------------------- 1 | CC := ppu-gcc 2 | CXX := ppu-g++ 3 | LD := ppu-ld 4 | OBJCOPY := ppu-objcopy 5 | OBJDUMP := ppu-objdump 6 | AR := ppu-ar 7 | STRIP := ppu-strip 8 | INCLUDE = ../common ../../ps2emu/include ../../lv1/include ../../debug/include 9 | INCLUDE += $(PS3DEV)/ppu/ppu/include 10 | LIBSDIR = 11 | LIBS = 12 | BUILD_TYPE = release 13 | 14 | GEN = ../ps2netemu_gen/ps2netemu_gen 15 | SRC_SELF = ../ps2netemu_gen/ps2_netemu.self 16 | OUT_SELF = ps2_netemu.self 17 | 18 | 19 | CFLAGS = -ffunction-sections -fdata-sections -Os -m64 -fno-builtin -fno-exceptions \ 20 | -Os -Wall -Wno-strict-aliasing $(foreach dir,$(INCLUDE),-I$(dir)) \ 21 | -DPS2EMU -DPS2NETEMU -DFIRMWARE_CEX -ffreestanding 22 | CFLAGS += --std=gnu99 23 | 24 | ifeq ($(BUILD_TYPE), debug) 25 | CFLAGS += -DDEBUG 26 | endif 27 | 28 | ifeq ($(BUILD_TYPE), release) 29 | endif 30 | 31 | LDFLAGS= -T ldscript.ld -nostartfiles -nostdlib -nodefaultlibs -Wl,-static -Wl,-s -L. $(foreach dir,$(LIBSDIR),-L$(dir)) $(LIBS) \ 32 | -Wl,--gc-sections -Wl,-Map=ps2netemu_stage2.map 33 | 34 | OBJS = start.o main.o ../../ps2emu/src/libc.o ../../ps2emu/src/libc_c.o ../../ps2emu/src/memory.o ../../ps2emu/src/io.o \ 35 | ../../ps2emu/src/patch.o 36 | 37 | ifeq ($(BUILD_TYPE), debug) 38 | OBJS += 39 | endif 40 | 41 | all: ps2netemu_stage2.bin 42 | @cp $(OUT_SELF) ../../../BIN 43 | @rm -f *.o *.elf *.map temp.self ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 44 | 45 | objdump: ps2netemu_stage2.bin 46 | $(OBJDUMP) -D -EB -b binary -m powerpc:common64 ps2netemu_stage2.bin 47 | 48 | %.bin: %.elf 49 | $(OBJCOPY) -O binary $< $@ 50 | $(GEN) $@ $(SRC_SELF) $(OUT_SELF) ps2netemu_stage2.map 51 | 52 | ps2netemu_stage2.elf: $(OBJS) ldscript.ld 53 | $(CC) $(LDFLAGS) -o $@ $(OBJS) 54 | 55 | %.o: %.S 56 | $(CC) $(CFLAGS) -c -o $@ $< 57 | 58 | %.o: %.c 59 | $(CC) $(CFLAGS) -c -o $@ $< 60 | 61 | clean: 62 | @rm -f *.o *.elf *.self *.bin *.map temp.self ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 63 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/data/curves: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/netemu/data/curves -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/data/ldr_curves: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/netemu/data/ldr_curves -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/data/npdrm-const: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/netemu/data/npdrm-const -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/data/rif-key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/netemu/data/rif-key -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/data/vsh_curves: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/netemu/data/vsh_curves -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/ldscript.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-powerpc") 2 | OUTPUT_ARCH(powerpc:common64) 3 | 4 | __base = 0x3940; 5 | 6 | ENTRY(_start) 7 | 8 | PHDRS { 9 | stage1 PT_LOAD FLAGS(7); 10 | } 11 | 12 | SECTIONS { 13 | . = __base; 14 | __self_start = .; 15 | 16 | .start : { *(.start) } :stage1 = 0 17 | 18 | . = ALIGN(32); 19 | .text : { 20 | *(.text) 21 | *(.text.*) 22 | } 23 | 24 | . = ALIGN(32); 25 | .rodata : { 26 | *(.rodata) 27 | *(.rodata.*) 28 | } 29 | 30 | . = ALIGN(32); 31 | __reloc_start = .; 32 | .data : { 33 | *(.data) 34 | *(.data.*) 35 | *(.sdata) 36 | *(.sdata.*) 37 | } 38 | 39 | . = ALIGN(32); 40 | .bss : { 41 | *(.sbss) 42 | *(.sbss.*) 43 | *(COMMON) 44 | *(.bss) 45 | *(.bss.*) 46 | LONG(0) 47 | } 48 | 49 | . = ALIGN(32); 50 | __toc_start = .; 51 | __toc = . + 0x8000; 52 | .toc : { 53 | *(.toc) 54 | *(.toc.*) 55 | } 56 | __toc_end = .; 57 | __opd_start = .; 58 | .opd : { 59 | *(.opd) 60 | *(.opd.*) 61 | } 62 | __opd_end = .; 63 | __reloc_end = .; 64 | 65 | __self_end = .; 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/ps2_netemu.self: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/netemu/ps2_netemu.self -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/netemu/start.S: -------------------------------------------------------------------------------- 1 | .text 2 | .section .start,"ax",@progbits 3 | .align 3 4 | 5 | .global _start 6 | 7 | _start: 8 | 9 | // Fill this with jumps to the patched functions 10 | // b ufs_open_patched 11 | // b ufs_read_patched 12 | // b ufs_fstat_patched 13 | b open_iso 14 | b fstat_iso_patched 15 | b read_iso_size 16 | b open_config 17 | b read_config_size 18 | b decrypt_config 19 | b cdvd_read_patched 20 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/ps2netemu_gen/Make_netemu.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | set PS3SDK=/c/PSDK3v2 5 | set WIN_PS3SDK=C:/PSDK3v2 6 | set PS3DEV=%PS3SDK%/ps3dev2 7 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin; 8 | set CYGWIN=nodosfilewarning 9 | 10 | rm -f *.o *.elf *.bin *.map ../../ps2emu/src/*.o ../../lv1/src/*.o ../../debug/src/*.o 11 | make all 12 | 13 | pause -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/ps2netemu_gen/Makefile: -------------------------------------------------------------------------------- 1 | OUTPUT = ps2netemu_gen 2 | OBJS = main.o 3 | CFLAGS = -Wall $(INC) --std=gnu99 4 | LDFLAGS = -L. -lstdc++ 5 | INC = -I. -I../../ps2emu/include 6 | 7 | all: $(OUTPUT) 8 | 9 | clean: 10 | @rm -f *.exe *.o 11 | 12 | $(OUTPUT): $(OBJS) 13 | $(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS) 14 | @rm -f *.o 15 | -------------------------------------------------------------------------------- /PS2_EMU/ps2emu_stage2/ps2netemu_gen/ps2_netemu.self: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/PS2_EMU/ps2emu_stage2/ps2netemu_gen/ps2_netemu.self -------------------------------------------------------------------------------- /debug/include/debug.h: -------------------------------------------------------------------------------- 1 | /* debug.h - printf message logging via Lv-1 Ethernet 2 | 3 | Copyright (C) 2010 Hector Martin "marcan" 7 | 8 | void debug_print_modules(process_t process); 9 | 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /debug/include/printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 Patrick Powell. 3 | * 4 | * This code is based on code written by Patrick Powell . 5 | * It may be used for any purpose as long as this notice remains intact on all 6 | * source code distributions. 7 | */ 8 | 9 | /* 10 | * Copyright (c) 2008 Holger Weiss. 11 | * 12 | * This version of the code is maintained by Holger Weiss . 13 | * My changes to the code may freely be used, modified and/or redistributed for 14 | * any purpose. It would be nice if additions and fixes to this file (including 15 | * trivial code cleanups) would be sent back in order to let me include them in 16 | * the version available at . 17 | * However, this is not a requirement for using or redistributing (possibly 18 | * modified) versions of this file, nor is leaving this notice intact mandatory. 19 | */ 20 | #ifndef __VSPRINTF_H__ 21 | #define __VSPRINTF_H__ 22 | 23 | #include 24 | 25 | int _vsprintf(char *buf, const char *fmt, va_list args); 26 | int _vsnprintf(char *str, size_t size, const char *format, va_list args); 27 | int _sprintf(char *buffer, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /debug/src/debug_util.c: -------------------------------------------------------------------------------- 1 | #ifdef LV2 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #define MAX_PRX 256 9 | 10 | void debug_print_modules(process_t process) 11 | { 12 | sys_prx_id_t *list; 13 | uint32_t *unk_list; 14 | uint32_t n, n2; 15 | 16 | list = kalloc(sizeof(sys_prx_id_t)*MAX_PRX); 17 | unk_list = kalloc(sizeof(uint32_t)*MAX_PRX); 18 | 19 | if (prx_get_module_list(process, list, unk_list, MAX_PRX, &n, &n2) == 0) 20 | { 21 | for (uint32_t i = 0; i < n; i++) 22 | { 23 | sys_prx_module_info_t modinfo; 24 | sys_prx_segment_info_t text_segment; 25 | 26 | memset(&modinfo, 0, sizeof(modinfo)); 27 | modinfo.segments_num = 1; 28 | 29 | if (prx_get_module_info(process, list[i], &modinfo, NULL, &text_segment) == 0) 30 | { 31 | printf("<%s> [%08lX]\n", modinfo.name, text_segment.base); 32 | } 33 | } 34 | } 35 | 36 | kfree(list); 37 | kfree(unk_list); 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_421C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_421C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_421D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_421D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_430C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_430C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_430D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_430D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_431C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_431C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_440C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_440C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_441C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_441C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_441D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_441D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_446C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_446C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_446D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_446D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_450C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_450C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_450D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_450D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_453C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_453C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_453D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_453D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_455C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_455C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_455D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_455D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_460C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_460C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_465C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_465C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_465D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_465D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_466C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_466C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_466D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_466D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_470C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_470C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_470D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_470D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_475C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_475C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_475D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_475D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_475E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_475E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_476C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_476C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_476D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_476D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_476E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_476E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_478C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_478C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_478D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_478D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_478E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_478E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_480C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_480C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_480D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_480D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_480E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_480E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_481C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_481C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_481D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_481D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_481E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_481E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_482C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_482C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_482D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_482D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_482E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_482E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_483C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_483C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_483D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_483D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_483E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_483E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_484C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_484C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_484D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_484D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_484E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_484E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_485C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_485C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_485D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_485D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_485E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_485E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_486C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_486C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_486D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_486D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_486E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_486E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_487C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_487C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_487D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_487D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_487E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_487E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_488C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_488C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_488D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_488D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_488E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_488E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_489C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_489C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_489D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_489D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_489E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_489E.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_490C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_490C.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_490D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_490D.bin -------------------------------------------------------------------------------- /fake_ofw/debug/mamba_490E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/debug/mamba_490E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_421C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_421C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_421D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_421D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_430C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_430C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_430D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_430D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_431C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_431C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_440C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_440C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_441C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_441C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_441D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_441D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_446C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_446C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_446D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_446D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_450C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_450C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_450D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_450D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_453C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_453C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_453D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_453D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_455C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_455C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_455D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_455D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_460C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_460C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_465C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_465C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_465D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_465D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_466C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_466C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_466D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_466D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_470C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_470C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_470D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_470D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_475C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_475C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_475D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_475D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_475E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_475E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_476C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_476C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_476D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_476D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_476E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_476E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_478C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_478C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_478D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_478D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_478E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_478E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_480C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_480C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_480D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_480D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_480E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_480E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_481C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_481C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_481D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_481D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_481E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_481E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_482C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_482C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_482D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_482D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_482E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_482E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_483C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_483C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_483D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_483D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_483E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_483E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_484C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_484C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_484D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_484D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_484E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_484E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_485C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_485C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_485D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_485D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_485E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_485E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_486C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_486C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_486D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_486D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_486E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_486E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_487C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_487C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_487D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_487D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_487E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_487E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_488C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_488C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_488D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_488D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_488E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_488E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_489C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_489C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_489D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_489D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_489E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_489E.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_490C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_490C.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_490D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_490D.bin -------------------------------------------------------------------------------- /fake_ofw/mamba_490E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/fake_ofw/mamba_490E.bin -------------------------------------------------------------------------------- /loader_src/payload.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-powerpc") 2 | OUTPUT_ARCH(powerpc:common64) 3 | 4 | __base = 0x80000000007F0000; 5 | 6 | ENTRY(_start) 7 | 8 | SECTIONS 9 | { 10 | .text __base : 11 | { 12 | *(.text) 13 | *(.text.*) 14 | *(.rodata) 15 | *(.rodata.*) 16 | *(.gnu.linkonce.t.*) 17 | } 18 | 19 | 20 | .data : 21 | { 22 | *(.data) 23 | *(.data.*) 24 | 25 | } : data = 0 26 | 27 | 28 | .opd : 29 | { 30 | *(.opd) 31 | *(.opd.*) 32 | } 33 | 34 | .got : 35 | { 36 | __toc_start = .; 37 | *(.got) 38 | *(.got.*) 39 | *(.toc) 40 | *(.toc.*) 41 | __toc_end = .; 42 | } 43 | 44 | .bss : 45 | { 46 | *(.bss) 47 | *(.bss.*) 48 | } 49 | } -------------------------------------------------------------------------------- /loader_src/start.S: -------------------------------------------------------------------------------- 1 | .text 2 | .section .text,"ax",@progbits 3 | .align 3 4 | 5 | .global _start 6 | _start: 7 | // push to the stack 8 | stdu %sp, -0x0090(%sp) 9 | std %r31, 0x0088(%sp) 10 | std %r2, 0x0070(%sp) 11 | mflr %r0 12 | std %r0, 0x00A0(%sp) 13 | 14 | // setup proper rtoc 15 | li %r2, 1 16 | rldicr %r2, %r2, 63, 0 17 | oris %r2, %r2, (__toc_start + 0x8000)@h 18 | ori %r2, %r2, (__toc_start + 0x8000)@l 19 | 20 | // branch to main func 21 | bl syscall1022 22 | 23 | // pop the stack 24 | ld %r31, 0x0088(%sp) 25 | ld %r2, 0x0070(%sp) 26 | ld %r0, 0x00A0(%sp) 27 | mtlr %r0 28 | addi %sp, %sp, 0x90 29 | blr 30 | 31 | .global .panic 32 | 33 | -------------------------------------------------------------------------------- /lv1/include/lv1/device.h: -------------------------------------------------------------------------------- 1 | /* device.h - lv1 device functions 2 | 3 | Copyright (C) 2010 Hector Martin "marcan" 13 | #include 14 | 15 | enum 16 | { 17 | DEV_TYPE_STOR_DISK = 0, 18 | DEV_TYPE_GELIC = 3, 19 | DEV_TYPE_USB = 4, 20 | DEV_TYPE_STOR_ROM = 5, 21 | DEV_TYPE_SB_GPIO = 6, 22 | DEV_TYPE_STOR_FLASH = 14, 23 | }; 24 | 25 | int map_dma_mem(int bus_id, int dev_id, void *start, size_t len, u64 *bus_addr); 26 | int unmap_dma_mem(int bus_id, int dev_id, u64 bus_addr, size_t len); 27 | 28 | int find_device_by_type(int type, int index, int *bus_id, int *dev_id, int *irq); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lv1/include/lv1/dispmgr.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _DISPMGR_H_ 18 | #define _DISPMGR_H_ 19 | 20 | #include 21 | 22 | #define DISPMGR_VUART_PORT 10 23 | 24 | struct dispmgr_header 25 | { 26 | u32 request_id; 27 | u32 function_id; 28 | u32 request_size; 29 | u32 response_size; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lv1/include/lv1/inttypes.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _INTTYPES_H_ 18 | #define _INTTYPES_H_ 19 | 20 | typedef char s8; 21 | typedef unsigned char u8; 22 | typedef short s16; 23 | typedef unsigned short u16; 24 | typedef int s32; 25 | typedef unsigned int u32; 26 | typedef long s64; 27 | typedef unsigned long u64; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lv1/include/lv1/lv1.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV1_H__ 2 | #define __LV1_H__ 3 | 4 | #include 5 | #include 6 | 7 | #define PS3_LPAR_ID_PME 1 8 | 9 | #define _PS(s) (s "\0\0\0\0\0\0\0\0") 10 | #define S2I(s) ( \ 11 | (((u64)_PS(s)[0])<<56) | \ 12 | (((u64)_PS(s)[1])<<48) | \ 13 | (((u64)_PS(s)[2])<<40) | \ 14 | (((u64)_PS(s)[3])<<32) | \ 15 | (((u64)_PS(s)[4])<<24) | \ 16 | (((u64)_PS(s)[5])<<16) | \ 17 | (((u64)_PS(s)[6])<<8) | \ 18 | (((u64)_PS(s)[7])<<0)) 19 | 20 | #define FIELD_FIRST(s, i) ((S2I(s)>>32) + (i)) 21 | #define FIELD(s, i) (S2I(s) + (i)) 22 | 23 | #endif /* __LV1_H__ */ 24 | -------------------------------------------------------------------------------- /lv1/include/lv1/mm.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _MM_H_ 18 | #define _MM_H_ 19 | 20 | #include 21 | 22 | #define MM_LOAD_BASE(ptr, offset) \ 23 | __asm__ __volatile__ ( \ 24 | "li %0, 1\n\t" \ 25 | "rldicr %0, %0, 63, 0\n\t" \ 26 | "oris %0, %0, %1\n\t" \ 27 | "ori %0, %0, %2\n\t" : \ 28 | "=r"(ptr) : \ 29 | "g"(((offset) >> 16) & 0xFFFF), \ 30 | "g"((offset) & 0xFFFF)) 31 | 32 | #define MM_EA2VA(ea) ((ea) & ~0x8000000000000000ULL) 33 | 34 | int mm_init(void); 35 | 36 | int mm_insert_htab_entry(u64 va_addr, u64 lpar_addr, u64 prot); 37 | 38 | int mm_map_lpar_memory_region(u64 lpar_start_addr, u64 ea_start_addr, u64 size, 39 | u64 page_shift, u64 prot); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /lv1/include/lv1/stor.h: -------------------------------------------------------------------------------- 1 | #ifndef _STOR_H_ 2 | #define _STOR_H_ 3 | 4 | #include 5 | 6 | #define LV1_FLASH_DEV_ID 1 7 | #define LV1_BDVD_DEV_ID 2 8 | 9 | typedef struct 10 | { 11 | u64 dev_id; 12 | u64 block_size; 13 | void *dma; 14 | u64 dma_lpar_addr; 15 | u64 dma_size_log; 16 | u32 dma_bus_addr; 17 | } lv1_stor_wrapper_var; 18 | 19 | int lv1_stor_wrapper_open(u64 dev_id, void *dma_buf, u64 dma_buf_lpar_addr, u64 dma_size_log, lv1_stor_wrapper_var *stor_var); 20 | 21 | int lv1_stor_wrapper_close(lv1_stor_wrapper_var *stor_var); 22 | 23 | int lv1_stor_wrapper_read(lv1_stor_wrapper_var *stor_var, u64 region_id, u64 start_sector, u64 num_sectors, u64 flags, void *data); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /lv1/include/lv1/vas.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _VAS_H_ 18 | #define _VAS_H_ 19 | 20 | unsigned long vas_get_id(void); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /lv1/include/lv1/vuart.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #ifndef _VUART_H_ 18 | #define _VUART_H_ 19 | 20 | #define VUART_PARAM_TX_TRIGGER 0 21 | #define VUART_PARAM_RX_TRIGGER 1 22 | #define VUART_PARAM_INTERRUPT_MASK 2 23 | #define VUART_PARAM_RX_BUFSIZE 3 24 | #define VUART_PARAM_RX_BYTES 4 25 | #define VUART_PARAM_TX_BUFSIZE 5 26 | #define VUART_PARAM_TX_BYTES 6 27 | #define VUART_PARAM_INTERRUPT_STATUS 7 28 | 29 | #define VUART_INTERRUPT_MASK_TX 0x00000001 30 | #define VUART_INTERRUPT_MASK_RX 0x00000002 31 | #define VUART_INTERRUPT_MASK_DISCONNECT 0x00000004 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lv1/src/assembly.h: -------------------------------------------------------------------------------- 1 | /* assembly.h - assembly language definitions 2 | 3 | Copyright (C) 2010 Hector Martin "marcan" 2 | #include 3 | #include 4 | 5 | 6 | #define HPTE_V_BOLTED 0x0000000000000010ULL 7 | #define HPTE_V_LARGE 0x0000000000000004ULL 8 | #define HPTE_V_VALID 0x0000000000000001ULL 9 | #define HPTE_R_PROT_MASK 0x0000000000000003ULL 10 | 11 | int mm_init(void) 12 | { 13 | return 0; 14 | } 15 | 16 | int mm_insert_htab_entry(u64 va_addr, u64 lpar_addr, u64 prot) 17 | { 18 | u64 hpte_group, hpte_index, hpte_v, hpte_r, hpte_evicted_v, hpte_evicted_r; 19 | 20 | hpte_group = (((va_addr >> 28) ^ ((va_addr & 0xFFFFFFFULL) >> 12)) & 0x7FF) << 3; 21 | hpte_v = ((va_addr >> 23) << 7) | HPTE_V_VALID; 22 | hpte_r = lpar_addr | 0x38 | (prot & HPTE_R_PROT_MASK); 23 | 24 | return lv1_insert_htab_entry(0, hpte_group, hpte_v, hpte_r, HPTE_V_BOLTED, 0, 25 | &hpte_index, &hpte_evicted_v, &hpte_evicted_r); 26 | } 27 | 28 | int mm_map_lpar_memory_region(u64 lpar_start_addr, u64 ea_start_addr, u64 size, 29 | u64 page_shift, u64 prot) 30 | { 31 | int i, result; 32 | 33 | for (i = 0; i < size >> page_shift; i++) 34 | { 35 | result = mm_insert_htab_entry(MM_EA2VA(ea_start_addr), lpar_start_addr, prot); 36 | if (result) 37 | return result; 38 | 39 | lpar_start_addr += (1 << page_shift); 40 | ea_start_addr += (1 << page_shift); 41 | } 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /lv1/src/stor.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef LV2 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | 13 | #define STOR_BUS_ID 4 14 | 15 | 16 | int lv1_stor_wrapper_open(u64 dev_id, void *dma_buf, u64 dma_buf_lpar_addr, u64 dma_size_log, lv1_stor_wrapper_var *stor_var) 17 | { 18 | u64 dma_bus_addr, v2; 19 | int result; 20 | 21 | result = map_dma_mem(STOR_BUS_ID, dev_id, (void *)dma_buf_lpar_addr, (1<block_size, &v2); 26 | if (result) 27 | { 28 | unmap_dma_mem(STOR_BUS_ID, dev_id, dma_bus_addr, dma_size_log); 29 | return result; 30 | } 31 | 32 | stor_var->dev_id = dev_id; 33 | stor_var->dma = dma_buf; 34 | stor_var->dma_lpar_addr = dma_buf_lpar_addr; 35 | stor_var->dma_size_log = dma_size_log; 36 | stor_var->dma_bus_addr = dma_bus_addr; 37 | 38 | return 0; 39 | } 40 | 41 | int lv1_stor_wrapper_close(lv1_stor_wrapper_var *stor_var) 42 | { 43 | return unmap_dma_mem(STOR_BUS_ID, stor_var->dev_id, stor_var->dma_bus_addr, stor_var->dma_size_log); 44 | } 45 | 46 | int lv1_stor_wrapper_read(lv1_stor_wrapper_var *stor_var, u64 region_id, u64 start_sector, u64 num_sectors, u64 flags, void *data) 47 | { 48 | u64 tag, status; 49 | int result; 50 | 51 | result = lv1_storage_read(stor_var->dev_id, region_id, start_sector, num_sectors, 52 | flags, stor_var->dma_lpar_addr, &tag); 53 | if (result) 54 | return result; 55 | 56 | for (;;) 57 | { 58 | result = lv1_storage_check_async_status(stor_var->dev_id, tag, &status); 59 | if (result) 60 | continue; 61 | 62 | if (status == 0) 63 | break; 64 | } 65 | 66 | memcpy(data, stor_var->dma, stor_var->block_size * num_sectors); 67 | 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /lv1/src/vas.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; version 2 of the License. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | unsigned long vas_get_id(void) 21 | { 22 | u64 id; 23 | 24 | lv1_get_logical_ppe_id(&id); 25 | lv1_get_virtual_address_space_id_of_ppe(id, &id); 26 | 27 | return id; 28 | } 29 | -------------------------------------------------------------------------------- /lv2/include/lv2/bt.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV2_BT_H__ 2 | #define __LV2_BT_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | LV2_EXPORT int bt_set_controller_info_internal(void *bt_work, void *buf, uint16_t vid, uint16_t pid); 10 | 11 | static INLINE int bt_set_controller_info(void *buf, uint16_t vid, uint16_t pid) 12 | { 13 | return bt_set_controller_info_internal((void *) *(uint64_t *)MKA(TOC + bt_rtoc_entry_1), buf, vid, pid); 14 | } 15 | 16 | #endif /* __LV2_BT_H__ */ 17 | -------------------------------------------------------------------------------- /lv2/include/lv2/ctrl.h: -------------------------------------------------------------------------------- 1 | // Created and improved by Evilnat 2 | 3 | #ifndef __LV2_CTRL_H__ 4 | #define __LV2_CTRL_H__ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define SINGLE_BEEP 0x6 12 | #define DOUBLE_BEEP 0x36 13 | #define TRIPLE_BEEP 0x1B6 14 | #define CONTINUOUS_BEEP 0xFFFF 15 | 16 | #ifdef SYSM_OBJ_OFFSET 17 | 18 | uint64_t *sysm_obj; 19 | 20 | LV2_EXPORT int sm_get_temperature_internal(uint64_t *sysm_obj, int id, uint32_t *temp, int time_out); 21 | LV2_EXPORT int sm_get_fan_policy_internal(uint64_t *sysm_obj, uint8_t id, uint8_t *st, uint8_t *mode, uint8_t *speed, uint8_t *unk, int time_out); 22 | LV2_EXPORT int sm_set_fan_policy_internal(uint64_t *sysm_obj, uint8_t unk, uint8_t mode, uint8_t speed); 23 | 24 | #ifdef sm_ring_buzzer_symbol 25 | LV2_EXPORT int sm_ring_buzzer_internal(uint64_t *sysm_obj, uint16_t packet, uint8_t arg3, uint8_t beep); 26 | 27 | static INLINE int sm_ring_buzzer(uint16_t beep) 28 | { 29 | memcpy(&sysm_obj, (void *)SYSM_OBJ_OFFSET, 8); 30 | sm_ring_buzzer_internal(sysm_obj, 0x29, 0xA, beep); 31 | 32 | return 0; 33 | } 34 | #endif 35 | 36 | static INLINE void sm_get_temperature(int id, uint32_t *temp) 37 | { 38 | memcpy(&sysm_obj, (void *)SYSM_OBJ_OFFSET, 8); 39 | sm_get_temperature_internal(sysm_obj, id, temp, 1000000); 40 | *temp >>= 24; // return °C 41 | } 42 | 43 | static INLINE void sm_get_fan_policy(uint8_t id, uint8_t *st, uint8_t *mode, uint8_t *speed, uint8_t *unk) 44 | { 45 | memcpy(&sysm_obj, (void *)SYSM_OBJ_OFFSET, 8); 46 | sm_get_fan_policy_internal(sysm_obj, id, st, mode, speed, unk, 1000000); 47 | } 48 | 49 | static INLINE int sm_set_fan_policy(uint8_t unk, uint8_t mode, uint8_t speed) 50 | { 51 | memcpy(&sysm_obj, (void *)SYSM_OBJ_OFFSET, 8); 52 | sm_set_fan_policy_internal(sysm_obj, unk, mode, speed); 53 | 54 | return 0; 55 | } 56 | 57 | #endif //#if def SYSM_OBJ_OFFSET 58 | 59 | #endif /* __LV2_CTRL_H__ */ 60 | -------------------------------------------------------------------------------- /lv2/include/lv2/hid.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV2_HID_H__ 2 | #define __LV2_HID_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | LV2_EXPORT int hid_mgr_read_usb(uint8_t unk1, void *buf, uint32_t cmd, uint8_t unk2); 9 | // Len is both in/out! 10 | LV2_EXPORT int hid_mgr_read_bt(uint8_t unk1, void *buf, uint16_t *len, uint8_t unk2); 11 | 12 | #endif /* __LV2_HID_H__ */ 13 | -------------------------------------------------------------------------------- /lv2/include/lv2/interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV2_INTERRUPT_H__ 2 | #define __LV2_INTERRUPT_H__ 3 | 4 | #include 5 | 6 | void suspend_intr(void); 7 | void resume_intr(void); 8 | 9 | LV2_EXPORT uint64_t spin_lock_irqsave_ex(void *ta); 10 | LV2_EXPORT void spin_unlock_irqrestore_ex(void *ta, uint64_t restore, int zero); 11 | 12 | uint64_t spin_lock_irqsave(void); 13 | void spin_unlock_irqrestore(uint64_t restore); 14 | 15 | #endif /* __LV2_INTERRUPT_H__ */ 16 | -------------------------------------------------------------------------------- /lv2/include/lv2/macros.h.S: -------------------------------------------------------------------------------- 1 | #ifndef __MACRO_H_S__ 2 | #define __MACRO_H_S__ 3 | 4 | #include "symbols.h" 5 | 6 | #define MEM_BASE(dest) \ 7 | li dest, 1; \ 8 | rldicr dest, dest, 63, 0; 9 | 10 | #define LOAD_LABEL(dest, source, address) \ 11 | oris dest, source, (address)@h; \ 12 | ori dest, dest, (address)@l; 13 | 14 | #define LV2_FUNCTION(name, address) \ 15 | .section .name.text, "ax"; \ 16 | .global name; \ 17 | .align 3; \ 18 | name:; \ 19 | .quad 0x8000000000000000 | address, 0x8000000000000000 | TOC; \ 20 | .previous; 21 | 22 | 23 | #define LV2_FUNCTION2(name, address) \ 24 | .section .name.text, "ax"; \ 25 | .global name; \ 26 | name:; \ 27 | stdu %sp, -0x80(%sp); \ 28 | mflr %r0; \ 29 | std %r0, 0x90(%sp); \ 30 | std %rtoc, 0x28(%sp); \ 31 | MEM_BASE(%r0); \ 32 | LOAD_LABEL(%rtoc, %r0, address); \ 33 | mtctr %rtoc; \ 34 | LOAD_LABEL(%rtoc, %r0, TOC); \ 35 | bctrl; \ 36 | ld %rtoc, 0x28(%sp); \ 37 | ld %r0, 0x90(%sp); \ 38 | addi %sp, %sp, 0x80; \ 39 | mtlr %r0; \ 40 | blr; \ 41 | .previous; 42 | 43 | #define LV2_FUNCTION3(name, address) \ 44 | .section .name.text, "ax"; \ 45 | .global name; \ 46 | name:; \ 47 | std %rtoc, 0x28(%sp); \ 48 | stdu %sp, -0x70(%sp); \ 49 | mflr %r0; \ 50 | std %r0, 0x80(%sp); \ 51 | MEM_BASE(%r0); \ 52 | LOAD_LABEL(%rtoc, %r0, address); \ 53 | mtctr %rtoc; \ 54 | LOAD_LABEL(%rtoc, %r0, TOC); \ 55 | bctrl; \ 56 | ld %r0, 0x80(%sp); \ 57 | mtlr %r0; \ 58 | addi %sp, %sp, 0x70; \ 59 | ld %rtoc, 0x28(%sp); \ 60 | blr; \ 61 | .previous; 62 | 63 | #endif /* __MACRO_H_S__ */ 64 | -------------------------------------------------------------------------------- /lv2/include/lv2/pad.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV2_PAD_H__ 2 | #define __LV2_PAD_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | // Note values in this file are different than user mode functions 9 | 10 | #define PAD_BTN_OFFSET_DIGITAL 1 11 | #define PAD_CTRL_LEFT (1 << 15) 12 | #define PAD_CTRL_DOWN (1 << 14) 13 | #define PAD_CTRL_RIGHT (1 << 13) 14 | #define PAD_CTRL_UP (1 << 12) 15 | #define PAD_CTRL_START (1 << 11) 16 | #define PAD_CTRL_R3 (1 << 10) 17 | #define PAD_CTRL_L3 (1 << 9) 18 | #define PAD_CTRL_SELECT (1 << 8) 19 | #define PAD_CTRL_SQUARE (1 << 7) 20 | #define PAD_CTRL_CROSS (1 << 6) 21 | #define PAD_CTRL_CIRCLE (1 << 5) 22 | #define PAD_CTRL_TRIANGLE (1 << 4) 23 | #define PAD_CTRL_R1 (1 << 3) 24 | #define PAD_CTRL_L1 (1 << 2) 25 | #define PAD_CTRL_R2 (1 << 1) 26 | #define PAD_CTRL_L2 (1 << 0) 27 | 28 | #define PAD_BTN_OFFSET_PS 2 29 | #define PAD_CTRL_PS (1 << 8) 30 | 31 | #define PAD_BTN_OFFSET_ANALOG_LEFT 3 32 | #define PAD_BTN_OFFSET_ANALOG_RIGHT 4 33 | #define PAD_CTRL_ANALOG_X(x) (x >> 8) 34 | #define PAD_CTRL_ANALOG_Y(x) (x & 0xFF) 35 | 36 | 37 | // TODO: add rest 38 | 39 | 40 | typedef struct _pad_data 41 | { 42 | uint16_t button[64]; 43 | } __attribute__((packed)) pad_data; 44 | 45 | // Return value: the length of data or < 0 -> error 46 | // if (pad_get_data(&data) > 0) 47 | // if (data.button[PAD_BTN_OFFSET_DIGITAL] & PAD_CTRL_TRIANGLE) 48 | // triangle pressed; 49 | int pad_get_data(pad_data *data); 50 | 51 | #endif /* __LV2_PAD_H__ */ 52 | -------------------------------------------------------------------------------- /lv2/include/lv2/symbols_355C.h: -------------------------------------------------------------------------------- 1 | #if defined(FIRMWARE_355C) 2 | 3 | #define FIRMWARE_VERSION 0x0355 4 | //#define PS3MAPI_FW_VERSION 0x0355 5 | #if defined(IS_MAMBA) 6 | #define PS3MAPI_FW_TYPE "CEX MAMBA" 7 | #else 8 | #define PS3MAPI_FW_TYPE "CEX COBRA" 9 | #endif 10 | #define PS3MAPI_IDPS_1 0x80000000003BA880ULL 11 | #define PS3MAPI_IDPS_2 0x800000000044A174ULL 12 | //#define PS3MAPI_PSID 0x800000000044A18CULL 13 | 14 | #define EXPLORE_PLUGIN_HASH 0x8c0a948c000db78d 15 | #define EXPLORE_PLUGIN_REBUG_HASH 0x8c0a948c000dbd9b //rebug rex 16 | #define EXPLORE_CATEGORY_GAME_HASH 0xa2bc18fa00052c74 17 | #define EXPLORE_CATEGORY_GAME_REBUG_HASH 0xa2bc1e5e00052fd7 //rebug rex 18 | #define GAME_EXT_PLUGIN_HASH 0x3bebd0440001dd6b 19 | #define GAME_EXT_PLUGIN_REBUG_HASH 0x3bebc61c0001deeb //rebug rex 20 | #define LIBFS_EXTERNAL_HASH 0x4437cd5500000000 21 | 22 | 23 | //WARNING: search this address in RAM! 24 | //The offset is found with bruteforce if you set it to 0x0 or wrong. 25 | #define vsh_pos_in_ram 0x930000 //Search in RAM 0xF821FF917C0802A6F80100804800039D or use socat ;) 26 | //---------------------// 27 | /* vsh */ 28 | #define ps2tonet_patch 0x0 29 | #define ps2tonet_size_patch 0x0 30 | #define vmode_patch_offset 0x4637F4 31 | 32 | #define ps2_nonbw_offset 0xD7708 33 | #define ps2_nonbw_offset2 0x7544C 34 | #define ps2_nonbw_offset3 0x14314 35 | 36 | #define aio_copy_root_offset 0xD37C 37 | //rebug rex 38 | #define dex_ps2_nonbw_offset 0xD7E64 39 | #define dex_ps2_nonbw_offset2 0x75C48 40 | #define dex_ps2_nonbw_offset3 0x14624 41 | #define dex_ps2tonet_patch 0x0 42 | #define dex_ps2tonet_size_patch 0x0 43 | #define dex_vmode_patch_offset 0x0 44 | 45 | #endif /* FIRMWARE */ 46 | -------------------------------------------------------------------------------- /lv2/include/lv2/symbols_355D.h: -------------------------------------------------------------------------------- 1 | #if defined(FIRMWARE_355D) 2 | 3 | #define FIRMWARE_VERSION 0x0355 4 | //#define PS3MAPI_FW_VERSION 0x0355 5 | #if defined(IS_MAMBA) 6 | #define PS3MAPI_FW_TYPE "DEX MAMBA" 7 | #else 8 | #define PS3MAPI_FW_TYPE "DEX COBRA" 9 | #endif 10 | #define PS3MAPI_IDPS_1 0x80000000003DE170ULL 11 | #define PS3MAPI_IDPS_2 0x8000000000472174ULL 12 | //#define PS3MAPI_PSID 0x800000000047218CULL 13 | 14 | #define EXPLORE_PLUGIN_HASH 0x8c0a948c000dbd9b 15 | #define EXPLORE_CATEGORY_GAME_HASH 0xa2bc1e5e00052fd7 16 | #define GAME_EXT_PLUGIN_HASH 0x3bebc61c0001deeb 17 | #define LIBFS_EXTERNAL_HASH 0x5bc7bad800005fa4 18 | 19 | //WARNING: search this address in RAM! 20 | //The offset is found with bruteforce if you set it to 0x0 or wrong. 21 | #define vsh_pos_in_ram 0x930000 //Search in RAM 0xF821FF917C0802A6F80100804800039D or use socat ;) 22 | //---------------------// 23 | /* vsh */ 24 | #define ps2tonet_patch 0x0 25 | #define ps2tonet_size_patch 0x0 26 | #define vmode_patch_offset 0x0 27 | 28 | #define ps2_nonbw_offset 0xD7E64 29 | #define ps2_nonbw_offset2 0x75C48 30 | #define ps2_nonbw_offset3 0x14624 31 | 32 | #define aio_copy_root_offset 0xD37C 33 | //rebug rex 34 | #define cex_ps2tonet_patch 0x0 35 | #define cex_ps2tonet_size_patch 0x0 36 | #define cex_vmode_patch_offset 0x4637F4 37 | 38 | #endif /* FIRMWARE */ 39 | -------------------------------------------------------------------------------- /lv2/include/lv2/syscall.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/lv2/include/lv2/syscall.h -------------------------------------------------------------------------------- /lv2/include/lv2/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV2_THREAD_H__ 2 | #define __LV2_THREAD_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define PPU_THREAD_CREATE_JOINABLE 0x0000000000000001 10 | #define PPU_THREAD_CREATE_INTERRUPT 0x0000000000000002 11 | 12 | typedef struct 13 | { 14 | void *unk_0; // ptr to some funcs 15 | uint64_t unk_8; 16 | uint32_t unk_10; 17 | uint32_t unk_14; 18 | void *unk_18; 19 | void *unk_20; // same as unk_18? :S 20 | uint64_t unk_28[3]; 21 | void *unk_40; // same as unk_0? 22 | // ... 23 | } *thread_t; 24 | 25 | typedef uint64_t sys_ppu_thread_t; 26 | 27 | LV2_EXPORT int ppu_thread_create(thread_t *thread, void *entry, uint64_t arg, int prio, uint64_t stacksize, uint64_t flags, const char *threadname); 28 | LV2_EXPORT int ppu_thread_exit(uint64_t val); 29 | LV2_EXPORT int ppu_thread_join(thread_t thread, uint64_t *vptr); 30 | 31 | LV2_EXPORT int ppu_thread_delay(thread_t, uint64_t usecs, int unk, int unk2); 32 | 33 | thread_t get_current_thread(void); 34 | static INLINE int timer_usleep(uint64_t usecs) { return ppu_thread_delay(get_current_thread(), usecs, 0, 1); } 35 | 36 | int ppu_user_thread_create(process_t process, thread_t *thread, void *entry, uint64_t arg, int prio, uint64_t stacksize, uint64_t flags, const char *threadname); 37 | 38 | #endif /* __LV2_THREAD_H__ */ 39 | -------------------------------------------------------------------------------- /lv2/include/lv2/time.h: -------------------------------------------------------------------------------- 1 | #ifndef __LV2_TIME_H__ 2 | #define __LV2_TIME_H__ 3 | 4 | #include 5 | 6 | #define SECONDS(s) (s*1000000) 7 | #define MILISECONDS(s) (s*1000) 8 | 9 | #ifndef time_t 10 | #define time_t int64_t 11 | #endif 12 | 13 | static INLINE uint64_t get_ticks(void) 14 | { 15 | unsigned int tbl, tbu0, tbu1; 16 | do 17 | { 18 | __asm__ __volatile__( "mftbu %0":"=r"( tbu0 ) ); 19 | __asm__ __volatile__( "mftb %0":"=r"( tbl ) ); 20 | __asm__ __volatile__( "mftbu %0":"=r"( tbu1 ) ); 21 | } while (tbu0 != tbu1); 22 | 23 | return (((uint64_t) tbu0 ) << 32) | tbl; 24 | } 25 | 26 | time_t get_time_seconds(void); 27 | 28 | #endif /* __LV2_TIME_H__ */ 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /lv2/src/bt.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef bt_set_controller_info_internal_symbol 5 | LV2_FUNCTION(bt_set_controller_info_internal, bt_set_controller_info_internal_symbol) 6 | #endif 7 | -------------------------------------------------------------------------------- /lv2/src/ctrl.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef sm_ring_buzzer_symbol 5 | LV2_FUNCTION(sm_ring_buzzer_internal, sm_ring_buzzer_symbol) 6 | #endif 7 | 8 | #ifdef sm_get_temperature_symbol 9 | 10 | LV2_FUNCTION(sm_get_temperature_internal, sm_get_temperature_symbol) 11 | LV2_FUNCTION(sm_get_fan_policy_internal, sm_get_fan_policy_symbol) 12 | LV2_FUNCTION(sm_set_fan_policy_internal, sm_set_fan_policy_symbol) 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /lv2/src/hid.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef hid_mgr_read_usb_symbol 5 | LV2_FUNCTION(hid_mgr_read_usb, hid_mgr_read_usb_symbol) 6 | #endif 7 | 8 | #ifdef hid_mgr_read_bt_symbol 9 | LV2_FUNCTION(hid_mgr_read_bt, hid_mgr_read_bt_symbol) 10 | #endif 11 | -------------------------------------------------------------------------------- /lv2/src/interrupt.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | .global suspend_intr 5 | .global resume_intr 6 | 7 | suspend_intr: 8 | mfsprg0 %r9 9 | ld %r3, 0x48(%r9) 10 | li %r0, 2 11 | mtmsrd %r0, 1 12 | blr 13 | 14 | resume_intr: 15 | mfsprg0 %r9 16 | ld %r3, 0x48(%r9) 17 | li %r0, 0 18 | ori %r0, %r0, 0x8002 19 | lwsync 20 | mtmsrd %r0, 1 21 | blr 22 | 23 | #ifdef spin_lock_irqsave_ex_symbol 24 | LV2_FUNCTION(spin_lock_irqsave_ex, spin_lock_irqsave_ex_symbol) 25 | #endif 26 | 27 | #ifdef spin_unlock_irqrestore_ex_symbol 28 | LV2_FUNCTION(spin_unlock_irqrestore_ex, spin_unlock_irqrestore_ex_symbol) 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /lv2/src/interrupt_c.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | uint64_t spin_lock_irqsave(void) 6 | { 7 | uint8_t *ta = (uint8_t *)get_current_thread(); 8 | return spin_lock_irqsave_ex(ta + 0x28); 9 | } 10 | 11 | void spin_unlock_irqrestore(uint64_t restore) 12 | { 13 | uint8_t *ta = (uint8_t *)get_current_thread(); 14 | spin_unlock_irqrestore_ex(ta + 0x28, restore, 0); 15 | } 16 | -------------------------------------------------------------------------------- /lv2/src/io.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef cellFsOpen_symbol 5 | LV2_FUNCTION(cellFsOpen, cellFsOpen_symbol) 6 | #endif 7 | 8 | #ifdef cellFsClose_symbol 9 | LV2_FUNCTION(cellFsClose, cellFsClose_symbol) 10 | #endif 11 | 12 | #ifdef cellFsRead_symbol 13 | LV2_FUNCTION(cellFsRead, cellFsRead_symbol) 14 | #endif 15 | 16 | #ifdef cellFsWrite_symbol 17 | LV2_FUNCTION(cellFsWrite, cellFsWrite_symbol) 18 | #endif 19 | 20 | #ifdef cellFsLseek_symbol 21 | LV2_FUNCTION(cellFsLseek, cellFsLseek_symbol) 22 | #endif 23 | 24 | #ifdef cellFsStat_symbol 25 | LV2_FUNCTION(cellFsStat, cellFsStat_symbol) 26 | #endif 27 | 28 | #ifdef cellFsMkdir_symbol 29 | LV2_FUNCTION(cellFsMkdir, cellFsMkdir_symbol) 30 | #endif 31 | 32 | #ifdef cellFsUtime_symbol 33 | LV2_FUNCTION(cellFsUtime, cellFsUtime_symbol) 34 | #endif 35 | 36 | #ifdef cellFsUnlink_internal_symbol 37 | LV2_FUNCTION(cellFsUnlink_internal, cellFsUnlink_internal_symbol) 38 | #endif 39 | 40 | #ifdef cellFsUtilMount_symbol 41 | LV2_FUNCTION(cellFsUtilMount, cellFsUtilMount_symbol) 42 | LV2_FUNCTION3(cellFsUtilMount_h, cellFsUtilMount_symbol) /* We need to call this but it is hooked */ 43 | #endif 44 | 45 | #ifdef cellFsUtilUmount_symbol 46 | LV2_FUNCTION(cellFsUtilUmount, cellFsUtilUmount_symbol) 47 | #endif 48 | 49 | #ifdef cellFsUtilNewfs_symbol 50 | LV2_FUNCTION(cellFsUtilNewfs, cellFsUtilNewfs_symbol) 51 | #endif 52 | 53 | #ifdef cellFsRename_internal_symbol 54 | LV2_FUNCTION(cellFsRename_internal, cellFsRename_internal_symbol) 55 | #endif 56 | 57 | #ifdef pathdup_from_user_symbol 58 | LV2_FUNCTION(pathdup_from_user, pathdup_from_user_symbol) 59 | #endif 60 | 61 | #ifdef open_fs_object_symbol 62 | LV2_FUNCTION(open_fs_object, open_fs_object_symbol) 63 | #endif 64 | 65 | #ifdef close_fs_object_symbol 66 | LV2_FUNCTION(close_fs_object, close_fs_object_symbol) 67 | #endif 68 | -------------------------------------------------------------------------------- /lv2/src/memory.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef alloc_symbol 5 | LV2_FUNCTION(alloc, alloc_symbol) 6 | #endif 7 | 8 | #ifdef dealloc_symbol 9 | LV2_FUNCTION(dealloc, dealloc_symbol) 10 | #endif 11 | 12 | #ifdef copy_to_user_symbol 13 | LV2_FUNCTION(copy_to_user, copy_to_user_symbol) 14 | #endif 15 | 16 | #ifdef copy_from_user_symbol 17 | LV2_FUNCTION(copy_from_user, copy_from_user_symbol) 18 | #endif 19 | 20 | #ifdef copy_to_process_symbol 21 | LV2_FUNCTION(copy_to_process, copy_to_process_symbol) 22 | #endif 23 | 24 | #ifdef copy_from_process_symbol 25 | LV2_FUNCTION(copy_from_process, copy_from_process_symbol) 26 | #endif 27 | 28 | #ifdef page_allocate_symbol 29 | LV2_FUNCTION(page_allocate, page_allocate_symbol) 30 | #endif 31 | 32 | #ifdef page_free_symbol 33 | LV2_FUNCTION(page_free, page_free_symbol) 34 | #endif 35 | 36 | #ifdef page_export_to_proc_symbol 37 | LV2_FUNCTION(page_export_to_proc, page_export_to_proc_symbol) 38 | #endif 39 | 40 | #ifdef page_unexport_from_proc_symbol 41 | LV2_FUNCTION(page_unexport_from_proc, page_unexport_from_proc_symbol) 42 | #endif 43 | 44 | #ifdef kernel_ea_to_lpar_addr_symbol 45 | LV2_FUNCTION(kernel_ea_to_lpar_addr, kernel_ea_to_lpar_addr_symbol) 46 | #endif 47 | 48 | #ifdef process_ea_to_lpar_addr_ex_symbol 49 | LV2_FUNCTION(process_ea_to_lpar_addr_ex, process_ea_to_lpar_addr_ex_symbol) 50 | #endif 51 | 52 | #ifdef set_pte_symbol 53 | LV2_FUNCTION(set_pte, set_pte_symbol) 54 | #endif 55 | 56 | #ifdef process_read_memory_symbol 57 | LV2_FUNCTION(process_read_memory, process_read_memory_symbol) 58 | #endif 59 | 60 | #ifdef process_write_memory_symbol 61 | LV2_FUNCTION(process_write_memory, process_write_memory_symbol) 62 | #endif 63 | -------------------------------------------------------------------------------- /lv2/src/modules.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef decrypt_func_symbol 5 | LV2_FUNCTION(decrypt_func, decrypt_func_symbol) 6 | #endif 7 | 8 | #ifdef authenticate_program_segment_symbol 9 | LV2_FUNCTION(authenticate_program_segment, authenticate_program_segment_symbol) 10 | #endif 11 | 12 | #ifdef prx_load_module_symbol 13 | LV2_FUNCTION(prx_load_module, prx_load_module_symbol) 14 | #endif 15 | 16 | #ifdef prx_start_module_symbol 17 | LV2_FUNCTION(prx_start_module, prx_start_module_symbol) 18 | #endif 19 | 20 | #ifdef prx_stop_module_symbol 21 | LV2_FUNCTION(prx_stop_module, prx_stop_module_symbol) 22 | #endif 23 | 24 | #ifdef prx_unload_module_symbol 25 | LV2_FUNCTION(prx_unload_module, prx_unload_module_symbol) 26 | #endif 27 | 28 | #ifdef prx_get_module_info_symbol 29 | LV2_FUNCTION(prx_get_module_info, prx_get_module_info_symbol) 30 | #endif 31 | 32 | #ifdef prx_get_module_id_by_address_symbol 33 | LV2_FUNCTION(prx_get_module_id_by_address, prx_get_module_id_by_address_symbol) 34 | #endif 35 | 36 | #ifdef prx_get_module_id_by_name_symbol 37 | LV2_FUNCTION(prx_get_module_id_by_name, prx_get_module_id_by_name_symbol) 38 | #endif 39 | 40 | #ifdef prx_get_module_list_symbol 41 | LV2_FUNCTION(prx_get_module_list, prx_get_module_list_symbol) 42 | #endif 43 | 44 | #ifdef open_prx_object_symbol 45 | LV2_FUNCTION(open_prx_object, open_prx_object_symbol) 46 | #endif 47 | 48 | #ifdef close_prx_object_symbol 49 | LV2_FUNCTION(close_prx_object, close_prx_object_symbol) 50 | #endif 51 | 52 | #ifdef lock_prx_mutex_symbol 53 | LV2_FUNCTION(lock_prx_mutex, lock_prx_mutex_symbol) 54 | #endif 55 | 56 | #ifdef unlock_prx_mutex_symbol 57 | LV2_FUNCTION(unlock_prx_mutex, unlock_prx_mutex_symbol) 58 | #endif 59 | -------------------------------------------------------------------------------- /lv2/src/object.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef create_kernel_object_symbol 5 | LV2_FUNCTION(create_kernel_object, create_kernel_object_symbol) 6 | #endif 7 | 8 | #ifdef destroy_kernel_object_symbol 9 | LV2_FUNCTION(destroy_kernel_object, destroy_kernel_object_symbol) 10 | #endif 11 | 12 | #ifdef destroy_shared_kernel_object_symbol 13 | LV2_FUNCTION(destroy_shared_kernel_object, destroy_shared_kernel_object_symbol) 14 | #endif 15 | 16 | #ifdef open_kernel_object_symbol 17 | LV2_FUNCTION(open_kernel_object, open_kernel_object_symbol) 18 | #endif 19 | 20 | #ifdef open_shared_kernel_object_symbol 21 | LV2_FUNCTION(open_shared_kernel_object, open_shared_kernel_object_symbol) 22 | #endif 23 | 24 | #ifdef close_kernel_object_handle_symbol 25 | LV2_FUNCTION(close_kernel_object_handle, close_kernel_object_handle_symbol) 26 | #endif 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /lv2/src/pad.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int pad_get_data(pad_data *data) 7 | { 8 | int ret; 9 | 10 | memset(data, 0, sizeof(pad_data)); 11 | 12 | while ((ret = hid_mgr_read_usb(0, data, 0x40, 0)) == 0); 13 | 14 | if (ret == 0xFFFFFFD8) 15 | { 16 | // USB failed, try BT now... 17 | 18 | uint16_t len; 19 | 20 | do 21 | { 22 | len = 0x40; 23 | ret = hid_mgr_read_bt(0, data, &len, 1); 24 | 25 | if (ret == 0) 26 | { 27 | ret = len; 28 | } 29 | 30 | } while (ret == 0); 31 | } 32 | 33 | return ret; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /lv2/src/process.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | .global get_current_process 5 | 6 | get_current_process: 7 | mfsprg0 %r3 8 | lhz %r0, 0xC0(%r3) 9 | cmpwi cr7, %r0, 3 10 | beq cr7, loc_0 11 | ld %r3, 0xB0(%r3) 12 | blr 13 | loc_0: 14 | mfsprg0 %r9 15 | ld %r11, 0x68(%r9) 16 | li %r3, 0 17 | ld %r11, 0(%r11) 18 | cmpdi cr7, %r11, 0 19 | beqlr cr7 20 | ld %r3, 0x80(%r11) 21 | blr 22 | 23 | #ifdef process_kill_symbol 24 | LV2_FUNCTION(process_kill, process_kill_symbol) 25 | #endif 26 | -------------------------------------------------------------------------------- /lv2/src/security.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef aescbccfb_enc_symbol 5 | #ifdef aescbccfb_dec_symbol 6 | LV2_FUNCTION(aescbccfb_enc, aescbccfb_enc_symbol) 7 | LV2_FUNCTION(aescbccfb_dec, aescbccfb_dec_symbol) 8 | #endif 9 | #endif 10 | 11 | #ifdef get_pseudo_random_number_symbol 12 | LV2_FUNCTION(get_pseudo_random_number, get_pseudo_random_number_symbol) 13 | #endif 14 | 15 | #ifdef md5_reset_symbol 16 | #ifdef md5_update_symbol 17 | #ifdef md5_final_symbol 18 | LV2_FUNCTION(md5_reset, md5_reset_symbol) 19 | LV2_FUNCTION(md5_update, md5_update_symbol) 20 | LV2_FUNCTION(md5_final, md5_final_symbol) 21 | #endif 22 | #endif 23 | #endif 24 | 25 | #ifdef SHA1_init_symbol 26 | #ifdef SHA1_update_symbol 27 | #ifdef SHA1_final_symbol 28 | LV2_FUNCTION(sha1_init, SHA1_init_symbol) 29 | LV2_FUNCTION(sha1_update, SHA1_update_symbol) 30 | LV2_FUNCTION(sha1_final, SHA1_final_symbol) 31 | #endif 32 | #endif 33 | #endif 34 | 35 | #ifdef ss_get_open_psid_symbol 36 | LV2_FUNCTION(ss_get_open_psid, ss_get_open_psid_symbol) 37 | #endif 38 | 39 | #ifdef update_mgr_read_eeprom_symbol 40 | LV2_FUNCTION(update_mgr_read_eeprom, update_mgr_read_eeprom_symbol) 41 | #endif 42 | 43 | #ifdef update_mgr_write_eeprom_symbol 44 | LV2_FUNCTION(update_mgr_write_eeprom, update_mgr_write_eeprom_symbol) 45 | #endif 46 | -------------------------------------------------------------------------------- /lv2/src/storage.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef storage_get_device_info_symbol 5 | LV2_FUNCTION(storage_get_device_info, storage_get_device_info_symbol) 6 | #endif 7 | 8 | #ifdef storage_get_device_config_symbol 9 | LV2_FUNCTION(storage_get_device_config, storage_get_device_config_symbol) 10 | #endif 11 | 12 | #ifdef storage_open_symbol 13 | LV2_FUNCTION(storage_open, storage_open_symbol) 14 | #endif 15 | 16 | #ifdef storage_close_symbol 17 | LV2_FUNCTION(storage_close, storage_close_symbol) 18 | #endif 19 | 20 | #ifdef storage_read_symbol 21 | LV2_FUNCTION(storage_read, storage_read_symbol) 22 | #endif 23 | 24 | #ifdef storage_write_symbol 25 | LV2_FUNCTION(storage_write, storage_write_symbol) 26 | #endif 27 | 28 | #ifdef storage_send_device_command_symbol 29 | LV2_FUNCTION(storage_send_device_command, storage_send_device_command_symbol) 30 | #endif 31 | 32 | #ifdef storage_map_io_memory_symbol 33 | LV2_FUNCTION(storage_map_io_memory, storage_map_io_memory_symbol) 34 | #endif 35 | 36 | #ifdef storage_unmap_io_memory_symbol 37 | LV2_FUNCTION(storage_unmap_io_memory, storage_unmap_io_memory_symbol) 38 | #endif 39 | 40 | #ifdef storage_internal_get_device_object_symbol 41 | LV2_FUNCTION(storage_internal_get_device_object, storage_internal_get_device_object_symbol) 42 | #endif 43 | -------------------------------------------------------------------------------- /lv2/src/syscall.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef extend_kstack_symbol 5 | LV2_FUNCTION(extend_kstack, extend_kstack_symbol) 6 | #endif 7 | -------------------------------------------------------------------------------- /lv2/src/thread.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef ppu_thread_create_symbol 5 | LV2_FUNCTION(ppu_thread_create, ppu_thread_create_symbol) 6 | #endif 7 | 8 | #ifdef ppu_thread_exit_symbol 9 | LV2_FUNCTION(ppu_thread_exit, ppu_thread_exit_symbol) 10 | #endif 11 | 12 | #ifdef ppu_thread_join_symbol 13 | LV2_FUNCTION(ppu_thread_join, ppu_thread_join_symbol) 14 | #endif 15 | 16 | #ifdef ppu_thread_delay_symbol 17 | LV2_FUNCTION(ppu_thread_delay, ppu_thread_delay_symbol) 18 | #endif 19 | 20 | #ifdef create_kernel_thread_symbol 21 | LV2_FUNCTION(create_kernel_thread, create_kernel_thread_symbol) 22 | #endif 23 | 24 | #ifdef create_user_thread_symbol 25 | LV2_FUNCTION(create_user_thread, create_user_thread_symbol) 26 | #endif 27 | 28 | #ifdef create_user_thread2_symbol 29 | LV2_FUNCTION(create_user_thread2, create_user_thread2_symbol) 30 | #endif 31 | 32 | #ifdef start_thread_symbol 33 | LV2_FUNCTION(start_thread, start_thread_symbol) 34 | #endif 35 | 36 | #ifdef run_thread_symbol 37 | LV2_FUNCTION(run_thread, run_thread_symbol) 38 | #endif 39 | 40 | #ifdef register_thread_symbol 41 | LV2_FUNCTION(register_thread, register_thread_symbol) 42 | #endif 43 | 44 | #ifdef allocate_user_stack_symbol 45 | LV2_FUNCTION(allocate_user_stack, allocate_user_stack_symbol) 46 | #endif 47 | 48 | #ifdef deallocate_user_stack_symbol 49 | LV2_FUNCTION(deallocate_user_stack, deallocate_user_stack_symbol) 50 | #endif 51 | 52 | 53 | .global get_current_thread 54 | get_current_thread: 55 | 56 | mfsprg0 %r9 57 | ld %r4, 0xA0(%r9) 58 | ld %r3, 0x40(%r4) 59 | blr 60 | 61 | .global get_current_thread_name 62 | get_current_thread_name: 63 | 64 | mfsprg0 %r3 65 | blr 66 | -------------------------------------------------------------------------------- /lv2/src/thread_c.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | LV2_EXPORT thread_t create_user_thread(void *unk, void *entry, u64 arg, u64 unk2, u32 stack, u64 stacksize, process_t process, u64 flags, void *unk3, const char *name); 9 | LV2_EXPORT thread_t create_user_thread2(void *unk, void *entry, u64 arg, u64 unk2, u32 stack, u64 stacksize, process_t process, u64 flags, const char *name); 10 | LV2_EXPORT int start_thread(thread_t thread, int priority, u64 unk); 11 | LV2_EXPORT int register_thread(process_t process, thread_t thread, u64 unk); 12 | LV2_EXPORT int run_thread(thread_t thread); 13 | LV2_EXPORT u32 allocate_user_stack(process_t process, u64 *stacksize); 14 | LV2_EXPORT void deallocate_user_stack(process_t process, u32 stack, u64 stacksize); 15 | 16 | int ppu_user_thread_create(process_t process, thread_t *thread, void *entry, u64 arg, int prio, u64 stacksize, u64 flags, const char *threadname) 17 | { 18 | u64 *spr0; 19 | u32 user_stack; 20 | u64 translated_flags; 21 | 22 | user_stack = allocate_user_stack(process, &stacksize); 23 | if (user_stack == 0) 24 | { 25 | return ENOMEM; 26 | } 27 | 28 | if (flags & PPU_THREAD_CREATE_JOINABLE) 29 | { 30 | translated_flags = 0x10003; 31 | } 32 | else 33 | { 34 | translated_flags = 0x10001; 35 | } 36 | 37 | if (flags & PPU_THREAD_CREATE_INTERRUPT) 38 | { 39 | translated_flags |= 0x4000; 40 | } 41 | 42 | spr0 = mfsprg0(); 43 | *thread = create_user_thread2((void *)spr0[0x48/8], entry, arg, 200, user_stack, stacksize, process, translated_flags, threadname); 44 | 45 | if (!(thread)) 46 | { 47 | deallocate_user_stack(process, user_stack, stacksize); 48 | return EAGAIN; 49 | } 50 | 51 | start_thread(*thread, prio + 0x300, 0); 52 | register_thread(process, *thread, 0); 53 | 54 | if (!(flags & PPU_THREAD_CREATE_INTERRUPT)) 55 | { 56 | run_thread(*thread); 57 | } 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /lv2/src/time.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | .global get_time_seconds 5 | 6 | get_time_seconds: 7 | 8 | stdu %sp, -0x80(%sp) 9 | mflr %r0 10 | std %r0, 0x90(%sp) 11 | std %rtoc, 0x28(%sp) 12 | MEM_BASE(%r0) 13 | LOAD_LABEL(%rtoc, %r0, TOC) 14 | 1: 15 | mftb %r9 16 | cmpwi %r9, 0 17 | beq 1b 18 | ld %r8, time_rtoc_entry_1(%rtoc) 19 | ld %r7, time_rtoc_entry_2(%rtoc) 20 | ld %r0, 0(%r8) 21 | ld %r11, 0(%r7) 22 | add %r9, %r9, %r0 23 | divd %r3, %r9, %r11 24 | ld %rtoc, 0x28(%sp) 25 | ld %r0, 0x90(%sp) 26 | addi %sp, %sp, 0x80 27 | mtlr %r0 28 | blr 29 | -------------------------------------------------------------------------------- /lv2/src/usb.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef cellUsbdRegisterLdd 5 | LV2_FUNCTION(cellUsbdRegisterLdd, cellUsbdRegisterLdd_symbol) 6 | #endif 7 | 8 | #ifdef cellUsbdUnregisterLdd_symbol 9 | LV2_FUNCTION(cellUsbdUnregisterLdd, cellUsbdUnregisterLdd_symbol) 10 | #endif 11 | 12 | #ifdef cellUsbdScanStaticDescriptor_symbol 13 | LV2_FUNCTION(cellUsbdScanStaticDescriptor, cellUsbdScanStaticDescriptor_symbol) 14 | #endif 15 | 16 | #ifdef cellUsbdOpenPipe_symbol 17 | LV2_FUNCTION(cellUsbdOpenPipe, cellUsbdOpenPipe_symbol) 18 | #endif 19 | 20 | #ifdef cellUsbdClosePipe_symbol 21 | LV2_FUNCTION(cellUsbdClosePipe, cellUsbdClosePipe_symbol) 22 | #endif 23 | 24 | #ifdef cellUsbdControlTransfer_symbol 25 | LV2_FUNCTION(cellUsbdControlTransfer, cellUsbdControlTransfer_symbol) 26 | #endif 27 | 28 | #ifdef cellUsbdBulkTransfer_symbol 29 | LV2_FUNCTION(cellUsbdBulkTransfer, cellUsbdBulkTransfer_symbol) 30 | #endif 31 | -------------------------------------------------------------------------------- /make_clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -d mamba ]; then 4 | rm -r mamba 5 | fi 6 | 7 | rm *.bin 8 | make clean 9 | -------------------------------------------------------------------------------- /mamba/debug/mamba_421D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_421D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_430C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_430C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_430D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_430D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_431C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_431C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_440C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_440C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_441C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_441C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_441D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_441D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_446C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_446C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_446D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_446D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_450C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_450C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_450D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_450D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_453C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_453C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_453D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_453D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_455C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_455C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_455D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_455D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_460C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_460C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_465C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_465C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_465D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_465D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_466C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_466C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_466D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_466D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_470C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_470C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_470D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_470D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_475C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_475C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_475D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_475D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_475E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_475E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_476C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_476C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_476D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_476D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_476E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_476E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_478C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_478C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_478D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_478D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_478E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_478E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_480C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_480C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_480D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_480D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_480E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_480E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_481C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_481C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_481D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_481D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_481E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_481E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_482C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_482C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_482D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_482D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_482E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_482E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_483C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_483C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_483D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_483D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_483E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_483E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_484C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_484C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_484D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_484D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_484E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_484E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_485C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_485C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_485D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_485D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_485E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_485E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_486C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_486C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_486D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_486D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_486E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_486E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_487C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_487C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_487D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_487D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_487E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_487E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_488C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_488C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_488D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_488D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_488E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_488E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_489C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_489C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_489D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_489D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_489E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_489E.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_490C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_490C.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_490D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_490D.bin -------------------------------------------------------------------------------- /mamba/debug/mamba_490E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/debug/mamba_490E.bin -------------------------------------------------------------------------------- /mamba/mamba_421C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_421C.bin -------------------------------------------------------------------------------- /mamba/mamba_421D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_421D.bin -------------------------------------------------------------------------------- /mamba/mamba_430C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_430C.bin -------------------------------------------------------------------------------- /mamba/mamba_430D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_430D.bin -------------------------------------------------------------------------------- /mamba/mamba_431C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_431C.bin -------------------------------------------------------------------------------- /mamba/mamba_440C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_440C.bin -------------------------------------------------------------------------------- /mamba/mamba_441C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_441C.bin -------------------------------------------------------------------------------- /mamba/mamba_441D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_441D.bin -------------------------------------------------------------------------------- /mamba/mamba_446C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_446C.bin -------------------------------------------------------------------------------- /mamba/mamba_446D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_446D.bin -------------------------------------------------------------------------------- /mamba/mamba_450C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_450C.bin -------------------------------------------------------------------------------- /mamba/mamba_450D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_450D.bin -------------------------------------------------------------------------------- /mamba/mamba_453C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_453C.bin -------------------------------------------------------------------------------- /mamba/mamba_453D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_453D.bin -------------------------------------------------------------------------------- /mamba/mamba_455C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_455C.bin -------------------------------------------------------------------------------- /mamba/mamba_455D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_455D.bin -------------------------------------------------------------------------------- /mamba/mamba_460C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_460C.bin -------------------------------------------------------------------------------- /mamba/mamba_465C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_465C.bin -------------------------------------------------------------------------------- /mamba/mamba_465D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_465D.bin -------------------------------------------------------------------------------- /mamba/mamba_466C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_466C.bin -------------------------------------------------------------------------------- /mamba/mamba_466D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_466D.bin -------------------------------------------------------------------------------- /mamba/mamba_470C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_470C.bin -------------------------------------------------------------------------------- /mamba/mamba_470D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_470D.bin -------------------------------------------------------------------------------- /mamba/mamba_475C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_475C.bin -------------------------------------------------------------------------------- /mamba/mamba_475D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_475D.bin -------------------------------------------------------------------------------- /mamba/mamba_475E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_475E.bin -------------------------------------------------------------------------------- /mamba/mamba_476C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_476C.bin -------------------------------------------------------------------------------- /mamba/mamba_476D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_476D.bin -------------------------------------------------------------------------------- /mamba/mamba_476E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_476E.bin -------------------------------------------------------------------------------- /mamba/mamba_478C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_478C.bin -------------------------------------------------------------------------------- /mamba/mamba_478D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_478D.bin -------------------------------------------------------------------------------- /mamba/mamba_478E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_478E.bin -------------------------------------------------------------------------------- /mamba/mamba_480C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_480C.bin -------------------------------------------------------------------------------- /mamba/mamba_480D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_480D.bin -------------------------------------------------------------------------------- /mamba/mamba_480E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_480E.bin -------------------------------------------------------------------------------- /mamba/mamba_481C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_481C.bin -------------------------------------------------------------------------------- /mamba/mamba_481D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_481D.bin -------------------------------------------------------------------------------- /mamba/mamba_481E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_481E.bin -------------------------------------------------------------------------------- /mamba/mamba_482C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_482C.bin -------------------------------------------------------------------------------- /mamba/mamba_482D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_482D.bin -------------------------------------------------------------------------------- /mamba/mamba_482E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_482E.bin -------------------------------------------------------------------------------- /mamba/mamba_483C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_483C.bin -------------------------------------------------------------------------------- /mamba/mamba_483D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_483D.bin -------------------------------------------------------------------------------- /mamba/mamba_483E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_483E.bin -------------------------------------------------------------------------------- /mamba/mamba_484C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_484C.bin -------------------------------------------------------------------------------- /mamba/mamba_484D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_484D.bin -------------------------------------------------------------------------------- /mamba/mamba_484E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_484E.bin -------------------------------------------------------------------------------- /mamba/mamba_485C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_485C.bin -------------------------------------------------------------------------------- /mamba/mamba_485D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_485D.bin -------------------------------------------------------------------------------- /mamba/mamba_485E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_485E.bin -------------------------------------------------------------------------------- /mamba/mamba_486C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_486C.bin -------------------------------------------------------------------------------- /mamba/mamba_486D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_486D.bin -------------------------------------------------------------------------------- /mamba/mamba_486E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_486E.bin -------------------------------------------------------------------------------- /mamba/mamba_487C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_487C.bin -------------------------------------------------------------------------------- /mamba/mamba_487D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_487D.bin -------------------------------------------------------------------------------- /mamba/mamba_487E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_487E.bin -------------------------------------------------------------------------------- /mamba/mamba_488C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_488C.bin -------------------------------------------------------------------------------- /mamba/mamba_488D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_488D.bin -------------------------------------------------------------------------------- /mamba/mamba_488E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_488E.bin -------------------------------------------------------------------------------- /mamba/mamba_489C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_489C.bin -------------------------------------------------------------------------------- /mamba/mamba_489D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_489D.bin -------------------------------------------------------------------------------- /mamba/mamba_489E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_489E.bin -------------------------------------------------------------------------------- /mamba/mamba_490C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_490C.bin -------------------------------------------------------------------------------- /mamba/mamba_490D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_490D.bin -------------------------------------------------------------------------------- /mamba/mamba_490E.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/mamba/mamba_490E.bin -------------------------------------------------------------------------------- /ps3dev/ppu/bin/ppu-gcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/bin/ppu-gcc.exe -------------------------------------------------------------------------------- /ps3dev/ppu/bin/ppu-objcopy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/bin/ppu-objcopy.exe -------------------------------------------------------------------------------- /ps3dev/ppu/lib/gcc/ppu/4.2.0/include/README: -------------------------------------------------------------------------------- 1 | This README file is copied into the directory for GCC-only header files 2 | when fixincludes is run by the makefile for GCC. 3 | 4 | Many of the files in this directory were automatically edited from the 5 | standard system header files by the fixincludes process. They are 6 | system-specific, and will not work on any other kind of system. They 7 | are also not part of GCC. The reason we have to do this is because 8 | GCC requires ANSI C headers and many vendors supply ANSI-incompatible 9 | headers. 10 | 11 | Because this is an automated process, sometimes headers get "fixed" 12 | that do not, strictly speaking, need a fix. As long as nothing is broken 13 | by the process, it is just an unfortunate collateral inconvenience. 14 | We would like to rectify it, if it is not "too inconvenient". 15 | -------------------------------------------------------------------------------- /ps3dev/ppu/lib/gcc/ppu/4.2.0/include/iso646.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1997, 1999 Free Software Foundation, Inc. 2 | 3 | This file is part of GCC. 4 | 5 | GCC is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | GCC is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with GCC; see the file COPYING. If not, write to 17 | the Free Software Foundation, 51 Franklin Street, Fifth Floor, 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | /* As a special exception, if you include this header file into source 21 | files compiled by GCC, this header file does not by itself cause 22 | the resulting executable to be covered by the GNU General Public 23 | License. This exception does not however invalidate any other 24 | reasons why the executable file might be covered by the GNU General 25 | Public License. */ 26 | 27 | /* 28 | * ISO C Standard: 7.9 Alternative spellings 29 | */ 30 | 31 | #ifndef _ISO646_H 32 | #define _ISO646_H 33 | 34 | #ifndef __cplusplus 35 | #define and && 36 | #define and_eq &= 37 | #define bitand & 38 | #define bitor | 39 | #define compl ~ 40 | #define not ! 41 | #define not_eq != 42 | #define or || 43 | #define or_eq |= 44 | #define xor ^ 45 | #define xor_eq ^= 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /ps3dev/ppu/lib/gcc/ppu/4.2.0/include/stdbool.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. 2 | 3 | This file is part of GCC. 4 | 5 | GCC is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | GCC is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with GCC; see the file COPYING. If not, write to 17 | the Free Software Foundation, 51 Franklin Street, Fifth Floor, 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | /* As a special exception, if you include this header file into source 21 | files compiled by GCC, this header file does not by itself cause 22 | the resulting executable to be covered by the GNU General Public 23 | License. This exception does not however invalidate any other 24 | reasons why the executable file might be covered by the GNU General 25 | Public License. */ 26 | 27 | /* 28 | * ISO C Standard: 7.16 Boolean type and values 29 | */ 30 | 31 | #ifndef _STDBOOL_H 32 | #define _STDBOOL_H 33 | 34 | #ifndef __cplusplus 35 | 36 | #define bool _Bool 37 | #define true 1 38 | #define false 0 39 | 40 | #else /* __cplusplus */ 41 | 42 | /* Supporting in C++ is a GCC extension. */ 43 | #define _Bool bool 44 | #define bool bool 45 | #define false false 46 | #define true true 47 | 48 | #endif /* __cplusplus */ 49 | 50 | /* Signal that all the definitions are present. */ 51 | #define __bool_true_false_are_defined 1 52 | 53 | #endif /* stdbool.h */ 54 | -------------------------------------------------------------------------------- /ps3dev/ppu/lib/gcc/ppu/4.2.0/include/syslimits.h: -------------------------------------------------------------------------------- 1 | /* syslimits.h stands for the system's own limits.h file. 2 | If we can use it ok unmodified, then we install this text. 3 | If fixincludes fixes it, then the fixed version is installed 4 | instead of this text. */ 5 | 6 | #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ 7 | #include_next 8 | #undef _GCC_NEXT_LIMITS_H 9 | -------------------------------------------------------------------------------- /ps3dev/ppu/lib/gcc/ppu/4.2.0/include/varargs.h: -------------------------------------------------------------------------------- 1 | #ifndef _VARARGS_H 2 | #define _VARARGS_H 3 | 4 | #error "GCC no longer implements ." 5 | #error "Revise your code to use ." 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /ps3dev/ppu/libexec/gcc/ppu/4.2.0/cc1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/libexec/gcc/ppu/4.2.0/cc1.exe -------------------------------------------------------------------------------- /ps3dev/ppu/libexec/gcc/ppu/4.2.0/cc1plus.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/libexec/gcc/ppu/4.2.0/cc1plus.exe -------------------------------------------------------------------------------- /ps3dev/ppu/libexec/gcc/ppu/4.2.0/collect2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/libexec/gcc/ppu/4.2.0/collect2.exe -------------------------------------------------------------------------------- /ps3dev/ppu/libexec/gcc/ppu/4.2.0/install-tools/fixincl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/libexec/gcc/ppu/4.2.0/install-tools/fixincl.exe -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/bin/as.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/ppu/bin/as.exe -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/bin/ld.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/ps3dev/ppu/ppu/bin/ld.exe -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/alloca.h: -------------------------------------------------------------------------------- 1 | /* libc/include/alloca.h - Allocate memory on stack */ 2 | 3 | /* Written 2000 by Werner Almesberger */ 4 | /* Rearranged for general inclusion by stdlib.h. 5 | 2001, Corinna Vinschen */ 6 | 7 | #ifndef _NEWLIB_ALLOCA_H 8 | #define _NEWLIB_ALLOCA_H 9 | 10 | #include "_ansi.h" 11 | #include 12 | 13 | #undef alloca 14 | 15 | #ifdef __GNUC__ 16 | #define alloca(size) __builtin_alloca(size) 17 | #else 18 | void * _EXFUN(alloca,(size_t)); 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/ansi.h: -------------------------------------------------------------------------------- 1 | /* dummy header file to support BSD compiler */ 2 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef __MACHINE_ENDIAN_H__ 2 | 3 | #include 4 | 5 | #ifndef BIG_ENDIAN 6 | #define BIG_ENDIAN 4321 7 | #endif 8 | #ifndef LITTLE_ENDIAN 9 | #define LITTLE_ENDIAN 1234 10 | #endif 11 | 12 | #ifndef BYTE_ORDER 13 | #ifdef __IEEE_LITTLE_ENDIAN 14 | #define BYTE_ORDER LITTLE_ENDIAN 15 | #else 16 | #define BYTE_ORDER BIG_ENDIAN 17 | #endif 18 | #endif 19 | 20 | #endif /* __MACHINE_ENDIAN_H__ */ 21 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/malloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHMALLOC_H_ 2 | #define _MACHMALLOC_H_ 3 | 4 | # if defined(__ALTIVEC__) 5 | 6 | _PTR _EXFUN(vec_calloc,(size_t __nmemb, size_t __size)); 7 | _PTR _EXFUN(_vec_calloc_r,(struct _reent *, size_t __nmemb, size_t __size)); 8 | _VOID _EXFUN(vec_free,(_PTR)); 9 | #define _vec_freer _freer 10 | _PTR _EXFUN(vec_malloc,(size_t __size)); 11 | #define _vec_mallocr _memalign_r 12 | _PTR _EXFUN(vec_realloc,(_PTR __r, size_t __size)); 13 | _PTR _EXFUN(_vec_realloc_r,(struct _reent *, _PTR __r, size_t __size)); 14 | 15 | # endif /* __ALTIVEC__ */ 16 | 17 | 18 | #endif /* _MACHMALLOC_H_ */ 19 | 20 | 21 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/param.h: -------------------------------------------------------------------------------- 1 | /* Place holder for machine-specific param.h. */ 2 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/setjmp-dj.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991 DJ Delorie 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms is permitted 6 | * provided that the above copyright notice and following paragraph are 7 | * duplicated in all such forms. 8 | * 9 | * This file is distributed WITHOUT ANY WARRANTY; without even the implied 10 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | */ 12 | 13 | /* Modified to use SETJMP_DJ_H rather than SETJMP_H to avoid 14 | conflicting with setjmp.h. Ian Taylor, Cygnus support, April, 15 | 1993. */ 16 | 17 | #ifndef _SETJMP_DJ_H_ 18 | #define _SETJMP_DJ_H_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct { 25 | unsigned long eax; 26 | unsigned long ebx; 27 | unsigned long ecx; 28 | unsigned long edx; 29 | unsigned long esi; 30 | unsigned long edi; 31 | unsigned long ebp; 32 | unsigned long esp; 33 | unsigned long eip; 34 | } jmp_buf[1]; 35 | 36 | extern int setjmp(jmp_buf); 37 | extern void longjmp(jmp_buf, int); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/termios.h: -------------------------------------------------------------------------------- 1 | #define __MAX_BAUD B4000000 2 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHTIME_H_ 2 | #define _MACHTIME_H_ 3 | 4 | #if defined(__rtems__) 5 | #define _CLOCKS_PER_SEC_ sysconf(_SC_CLK_TCK) 6 | #else /* !__rtems__ */ 7 | #if defined(__arm__) || defined(__thumb__) 8 | #define _CLOCKS_PER_SEC_ 100 9 | #endif 10 | #endif /* !__rtems__ */ 11 | 12 | #endif /* _MACHTIME_H_ */ 13 | 14 | 15 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/machine/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHTYPES_H_ 2 | #define _MACHTYPES_H_ 3 | 4 | /* 5 | * The following section is RTEMS specific and is needed to more 6 | * closely match the types defined in the BSD machine/types.h. 7 | * This is needed to let the RTEMS/BSD TCP/IP stack compile. 8 | */ 9 | #if defined(__rtems__) 10 | #include 11 | #endif 12 | 13 | #define _CLOCK_T_ unsigned long /* clock() */ 14 | #define _TIME_T_ long /* time() */ 15 | #define _CLOCKID_T_ unsigned long 16 | #define _TIMER_T_ unsigned long 17 | 18 | #ifndef _HAVE_SYSTYPES 19 | typedef long int __off_t; 20 | typedef int __pid_t; 21 | #ifdef __GNUC__ 22 | __extension__ typedef long long int __loff_t; 23 | #else 24 | typedef long int __loff_t; 25 | #endif 26 | #endif 27 | 28 | #endif /* _MACHTYPES_H_ */ 29 | 30 | 31 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/_types.h: -------------------------------------------------------------------------------- 1 | /* ANSI C namespace clean utility typedefs */ 2 | 3 | /* This file defines various typedefs needed by the system calls that support 4 | the C library. Basically, they're just the POSIX versions with an '_' 5 | prepended. This file lives in the `sys' directory so targets can provide 6 | their own if desired (or they can put target dependant conditionals here). 7 | */ 8 | 9 | #ifndef _SYS__TYPES_H 10 | #define _SYS__TYPES_H 11 | 12 | #include 13 | 14 | typedef long _off_t; 15 | __extension__ typedef long long _off64_t; 16 | 17 | #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 18 | typedef int _ssize_t; 19 | #else 20 | typedef long _ssize_t; 21 | #endif 22 | 23 | #define __need_wint_t 24 | #include 25 | 26 | /* Conversion state information. */ 27 | typedef struct 28 | { 29 | int __count; 30 | union 31 | { 32 | wint_t __wch; 33 | unsigned char __wchb[4]; 34 | } __value; /* Value so far. */ 35 | } _mbstate_t; 36 | 37 | typedef _LOCK_RECURSIVE_T _flock_t; 38 | 39 | /* Iconv descriptor type */ 40 | typedef void *_iconv_t; 41 | 42 | #endif /* _SYS__TYPES_H */ 43 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/dirent.h: -------------------------------------------------------------------------------- 1 | /* includes , which is this file. On a 2 | system which supports , this file is overridden by 3 | dirent.h in the libc/sys/.../sys directory. On a system which does 4 | not support , we will get this file which uses #error to force 5 | an error. */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | #error " not supported" 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/file.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/param.h: -------------------------------------------------------------------------------- 1 | /* This is a dummy file, not customized for any 2 | particular system. If there is a param.h in libc/sys/SYSDIR/sys, 3 | it will override this one. */ 4 | 5 | #ifndef _SYS_PARAM_H 6 | # define _SYS_PARAM_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #ifndef HZ 13 | # define HZ (60) 14 | #endif 15 | #ifndef NOFILE 16 | # define NOFILE (60) 17 | #endif 18 | #ifndef PATHSIZE 19 | # define PATHSIZE (1024) 20 | #endif 21 | 22 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) 23 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RESOURCE_H_ 2 | #define _SYS_RESOURCE_H_ 3 | 4 | #include 5 | 6 | #define RUSAGE_SELF 0 /* calling process */ 7 | #define RUSAGE_CHILDREN -1 /* terminated child processes */ 8 | 9 | struct rusage { 10 | struct timeval ru_utime; /* user time used */ 11 | struct timeval ru_stime; /* system time used */ 12 | }; 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef _NEWLIB_STDIO_H 2 | #define _NEWLIB_STDIO_H 3 | 4 | #include 5 | #include 6 | 7 | /* Internal locking macros, used to protect stdio functions. In the 8 | general case, expand to nothing. Use __SSTR flag in FILE _flags to 9 | detect if FILE is private to sprintf/sscanf class of functions; if 10 | set then do nothing as lock is not initialised. */ 11 | #if !defined(_flockfile) 12 | #ifndef __SINGLE_THREAD__ 13 | # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) 14 | #else 15 | # define _flockfile(fp) 16 | #endif 17 | #endif 18 | 19 | #if !defined(_funlockfile) 20 | #ifndef __SINGLE_THREAD__ 21 | # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) 22 | #else 23 | # define _funlockfile(fp) 24 | #endif 25 | #endif 26 | 27 | #endif /* _NEWLIB_STDIO_H */ 28 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/string.h: -------------------------------------------------------------------------------- 1 | /* This is a dummy used as a placeholder for 2 | systems that need to have a special header file. */ 3 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/timeb.h: -------------------------------------------------------------------------------- 1 | /* timeb.h -- An implementation of the standard Unix file. 2 | Written by Ian Lance Taylor 3 | Public domain; no rights reserved. 4 | 5 | declares the structure used by the ftime function, as 6 | well as the ftime function itself. Newlib does not provide an 7 | implementation of ftime. */ 8 | 9 | #ifndef _SYS_TIMEB_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #define _SYS_TIMEB_H 16 | 17 | #include <_ansi.h> 18 | #include 19 | 20 | #ifndef __time_t_defined 21 | typedef _TIME_T_ time_t; 22 | #define __time_t_defined 23 | #endif 24 | 25 | struct timeb 26 | { 27 | time_t time; 28 | unsigned short millitm; 29 | short timezone; 30 | short dstflag; 31 | }; 32 | 33 | extern int ftime _PARAMS ((struct timeb *)); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* ! defined (_SYS_TIMEB_H) */ 40 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/times.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIMES_H 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _SYS_TIMES_H 6 | 7 | #include <_ansi.h> 8 | #include 9 | 10 | #ifndef __clock_t_defined 11 | typedef _CLOCK_T_ clock_t; 12 | #define __clock_t_defined 13 | #endif 14 | 15 | /* Get Process Times, P1003.1b-1993, p. 92 */ 16 | struct tms { 17 | clock_t tms_utime; /* user time */ 18 | clock_t tms_stime; /* system time */ 19 | clock_t tms_cutime; /* user time, children */ 20 | clock_t tms_cstime; /* system time, children */ 21 | }; 22 | 23 | clock_t _EXFUN(times,(struct tms *)); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !_SYS_TIMES_H */ 29 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UTIME_H 2 | #define _SYS_UTIME_H 3 | 4 | /* This is a dummy file, not customized for any 5 | particular system. If there is a utime.h in libc/sys/SYSDIR/sys, 6 | it will override this one. */ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct utimbuf 13 | { 14 | time_t actime; 15 | time_t modtime; 16 | }; 17 | 18 | #ifdef __cplusplus 19 | }; 20 | #endif 21 | 22 | #endif /* _SYS_UTIME_H */ 23 | -------------------------------------------------------------------------------- /ps3dev/ppu/ppu/include/sys/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_WAIT_H 2 | #define _SYS_WAIT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define WNOHANG 1 11 | #define WUNTRACED 2 12 | 13 | /* A status looks like: 14 | <2 bytes info> <2 bytes code> 15 | 16 | == 0, child has exited, info is the exit value 17 | == 1..7e, child has exited, info is the signal number. 18 | == 7f, child has stopped, info was the signal number. 19 | == 80, there was a core dump. 20 | */ 21 | 22 | #define WIFEXITED(w) (((w) & 0xff) == 0) 23 | #define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) 24 | #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) 25 | #define WEXITSTATUS(w) (((w) >> 8) & 0xff) 26 | #define WTERMSIG(w) ((w) & 0x7f) 27 | #define WSTOPSIG WEXITSTATUS 28 | 29 | pid_t wait (int *); 30 | pid_t waitpid (pid_t, int *, int); 31 | 32 | /* Provide prototypes for most of the _ names that are 33 | provided in newlib for some compilers. */ 34 | pid_t _wait (int *); 35 | 36 | #ifdef __cplusplus 37 | }; 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /stage2/config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/stage2/config.h -------------------------------------------------------------------------------- /stage2/crypto.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "common.h" 5 | #include "crypto.h" 6 | 7 | // For whatever reason, if this function gets inlined automatically, it fucks everything 8 | // Stupid compiler 9 | static __attribute__ ((noinline)) void xtea_encrypt_block(u32 *k, u32 *in, u32 *out) 10 | { 11 | u32 sum, y, z; 12 | unsigned char i; 13 | 14 | sum = 0; 15 | y = in[0]; 16 | z = in[1]; 17 | 18 | for (i = 0; i < 32; i++) 19 | { 20 | y += (((z<<4) ^ (z>>5)) + z) ^ (sum + k[sum & 3]); 21 | sum += 0x9e3779b9; 22 | z += (((y<<4) ^ (y>>5)) + y) ^ (sum + k[sum>>11 & 3]); 23 | } 24 | 25 | out[0] = y; 26 | out[1] = z; 27 | } 28 | 29 | static inline void xor64(void *in, void *out) 30 | { 31 | u8 *in8 = (u8 *)in; 32 | u8 *out8 = (u8 *)out; 33 | 34 | for (int i = 0; i < 8; i++) 35 | out8[i] ^= in8[i]; 36 | } 37 | 38 | void xtea_ctr(u8 *key, u64 nounce, u8 *buf, int size) 39 | { 40 | u8 ct[8]; 41 | 42 | for (int i = 0; i < size; i += 8, ++nounce) 43 | { 44 | xtea_encrypt_block((u32 *)key, (u32 *)&nounce, (u32 *)ct); 45 | xor64(ct, buf + i); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /stage2/crypto.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRYPTO_H__ 2 | #define __CRYPTO_H__ 3 | 4 | #include 5 | 6 | /* 7 | typedef struct 8 | { 9 | int mode; //!< encrypt/decrypt 10 | unsigned long sk[32]; //!< DES subkeys 11 | } 12 | des_context; 13 | */ 14 | void xtea_ctr(u8 *key, u64 nounce, u8 *buf, int size); 15 | /* 16 | void des_init(void); 17 | void des_destroy(void); 18 | 19 | void des_setkey_enc(des_context *ctx, const u8 key[8]); 20 | void des_crypt_ecb(des_context *ctx, const u8 input[8], u8 output[8]); 21 | */ 22 | #endif /* __CRYPTO_H__ */ 23 | -------------------------------------------------------------------------------- /stage2/kernel_payload.h: -------------------------------------------------------------------------------- 1 | #define kplugin_base_address 0x80000000007f0000 2 | 3 | int inst_and_run_kernel(u8 *payload, int size) 4 | { 5 | if((size < 4) || (size > KB(64))) 6 | return EINVAL; 7 | 8 | if(!payload) 9 | return ESRCH; 10 | 11 | memcpy((void *)kplugin_base_address, get_secure_user_ptr(payload), size); 12 | 13 | f_desc_t f; 14 | f.addr = (void *)kplugin_base_address; 15 | f.toc = (void *)MKA(TOC); 16 | 17 | int (* func)(void); 18 | func = (void *)&f; 19 | func(); 20 | 21 | return SUCCEEDED; 22 | } 23 | 24 | int inst_and_run_kernel_dynamic(u8 *payload, int size, u64 *residence) 25 | { 26 | if(size < 4) 27 | return EINVAL; 28 | 29 | if(!payload) 30 | return ESRCH; 31 | 32 | void *skprx = malloc(size); 33 | 34 | if(skprx) 35 | { 36 | memcpy(skprx, get_secure_user_ptr(payload), size); 37 | 38 | f_desc_t f; 39 | f.addr = skprx; 40 | f.toc = (void *)MKA(TOC); 41 | 42 | int (* func)(void); 43 | func = (void *)&f; 44 | func(); 45 | 46 | u64 resident = (u64)skprx; 47 | copy_to_user(&resident, get_secure_user_ptr(residence), 8); 48 | 49 | return SUCCEEDED; 50 | } 51 | 52 | return FAILED; 53 | } 54 | 55 | int unload_plugin_kernel(u64 residence) 56 | { 57 | if(residence) 58 | free((u64 *)residence); 59 | 60 | return SUCCEEDED; 61 | } 62 | -------------------------------------------------------------------------------- /stage2/laboratory.h: -------------------------------------------------------------------------------- 1 | #ifndef __LABORATORY_H__ 2 | #define __LABORATORY_H__ 3 | 4 | void do_hook_all_syscalls(void); 5 | void do_dump_threads_info_test(void); 6 | void do_dump_processes_test(void); 7 | void do_hook_load_module(void); 8 | void do_hook_mutex_create(void); 9 | void do_ps2net_copy_test(void); 10 | void do_dump_modules_info_test(void); 11 | void do_pad_test(void); 12 | 13 | #endif 14 | 15 | 16 | -------------------------------------------------------------------------------- /stage2/mappath.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAPPATH_H__ 2 | #define __MAPPATH_H__ 3 | 4 | #include 5 | 6 | #define SYS_MAP_PATH 35 7 | //#define SYS_MAP_GAME 36 8 | 9 | #define FLAG_COPY 1 10 | #define FLAG_TABLE 2 11 | #define FLAG_PROTECT 4 12 | 13 | //void map_first_slot(char *old, char *newp); 14 | void map_path_patches(int syscall); 15 | int map_path(char *oldpath, char *newpath, u32 flags); 16 | int map_path_user(char *oldpath, char *newpath, u32 flags); 17 | int get_map_path(unsigned int num, char *path, char *new_path); 18 | int sys_map_path(char *oldpath, char *newpath); 19 | int sys_map_paths(char *paths[], char *new_paths[], unsigned int num); 20 | /*int sys_map_game(char *path); 21 | int sys_hermes_pathtable(u64 pathtable);*/ 22 | int sys_aio_copy_root(char *src, char *dst); 23 | 24 | void unhook_all_map_path(void); 25 | 26 | void create_syscalls(void); 27 | 28 | #endif /* __MAPPATH_H_ */ 29 | 30 | -------------------------------------------------------------------------------- /stage2/region.h: -------------------------------------------------------------------------------- 1 | #ifndef __REGION_H__ 2 | #define __REGION_H__ 3 | 4 | #include 5 | 6 | extern u8 dvd_video_region; 7 | extern u8 bd_video_region; 8 | 9 | enum 10 | { 11 | DVD_VIDEO_REGION_1 = 1, 12 | DVD_VIDEO_REGION_2 = 2, 13 | DVD_VIDEO_REGION_3 = 4, 14 | DVD_VIDEO_REGION_4 = 8, 15 | DVD_VIDEO_REGION_5 = 16, 16 | DVD_VIDEO_REGION_6 = 32, 17 | DVD_VIDEO_REGION_MAX = DVD_VIDEO_REGION_6 18 | }; 19 | 20 | enum 21 | { 22 | BD_VIDEO_REGION_A = 1, 23 | BD_VIDEO_REGION_B = 2, 24 | BD_VIDEO_REGION_C = 4, 25 | BD_VIDEO_REGION_MAX = BD_VIDEO_REGION_C 26 | }; 27 | 28 | void region_patches(void); 29 | 30 | #ifdef PS3M_API 31 | 32 | void unhook_all_region(void); 33 | 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /stage2/savegames.h: -------------------------------------------------------------------------------- 1 | #ifndef SAVEGAMES_H__ 2 | #define SAVEGAMES_H__ 3 | 4 | #define AUTOSIGN 0 5 | #define ACCOUNTID 1 6 | 7 | #define READ 0 8 | #define WRITE 1 9 | 10 | #define HEADER_SIZE 0x60 11 | #define Y_TABLE_OFFSET 0x7B60 12 | 13 | #define COPY_PROTECTION_OFFSET 0x150 14 | #define USER_ID_1_OFFSET 0x570 15 | #define USER_ID_2_OFFSET 0x584 16 | 17 | #define XREGISTRY_FILE "/dev_flash2/etc/xRegistry.sys" 18 | 19 | #define LOGINUSERID "/setting/user/lastLoginUserId" 20 | #define SETTING_AUTOSIGN "/setting/user/%08d/npaccount/autoSignInEnable" 21 | #define SETTING_ACCOUNTID "/setting/user/%08d/npaccount/accountid" 22 | 23 | uint8_t account_id[0x10]; 24 | uint32_t userID; 25 | 26 | void sha1_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[20]); 27 | int patch_savedata(const char *path); 28 | int xreg_data(char *value, int type, int mode, int overwrite, int checkEmpty); 29 | int set_fakeID(int userid, int overwrite); 30 | 31 | #endif /* SAVEGAMES_H__ */ 32 | -------------------------------------------------------------------------------- /stage2/sm_ext.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "common.h" 7 | #include "sm_ext.h" 8 | #include "modulespatch.h" 9 | #include "storage_ext.h" 10 | 11 | static int patch_done = 0; 12 | static int is_reboot = 0; 13 | 14 | LV2_HOOKED_FUNCTION_COND_POSTCALL_4(int, send_poweroff_event, (u64 *event_data1, u64 *event_data2, u64 *event_data3, u32 unk)) 15 | { 16 | process_t p = get_current_process_critical(); 17 | 18 | if (!vsh_process) vsh_process = get_vsh_process(); //NzV 19 | if (p == vsh_process) 20 | { 21 | u64 data1, data2, data3; 22 | 23 | if (is_reboot) 24 | { 25 | data1 = 5; 26 | data2 = 2; 27 | } 28 | else 29 | { 30 | data1 = 3; 31 | data2 = 0; 32 | } 33 | 34 | data3 = 0; 35 | 36 | copy_to_user(&data1, get_secure_user_ptr(event_data1), sizeof(data1)); 37 | copy_to_user(&data2, get_secure_user_ptr(event_data2), sizeof(data2)); 38 | copy_to_user(&data3, get_secure_user_ptr(event_data3), sizeof(data3)); 39 | 40 | unhook_function_with_cond_postcall(get_syscall_address(SYS_SM_GET_EXT_EVENT2), send_poweroff_event, 4); 41 | patch_done = 0; 42 | } 43 | else 44 | return DO_POSTCALL; 45 | 46 | return 0; 47 | } 48 | 49 | int sys_sm_ext_send_poweroff_event(int reboot) 50 | { 51 | is_reboot = reboot; 52 | 53 | if (!patch_done) 54 | { 55 | hook_function_with_cond_postcall(get_syscall_address(SYS_SM_GET_EXT_EVENT2), send_poweroff_event, 4); 56 | patch_done = 1; 57 | } 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /stage2/sm_ext.h: -------------------------------------------------------------------------------- 1 | #ifndef __SM_EXT_H__ 2 | #define __SM_EXT_H__ 3 | 4 | /* Causes a power off event, which will be caught by vsh. Clean poweroff and reboots, unlike calling sys_sm_shutdown */ 5 | int sys_sm_ext_send_poweroff_event(int reboot); 6 | 7 | #endif /* __SM_EXT_H__ */ 8 | -------------------------------------------------------------------------------- /stage2/stage2.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-powerpc") 2 | OUTPUT_ARCH(powerpc:common64) 3 | 4 | __base = 0xBAADCAFE00000000; 5 | 6 | ENTRY(_start) 7 | 8 | PHDRS { 9 | stage1 PT_LOAD FLAGS(7); 10 | } 11 | 12 | SECTIONS { 13 | . = __base; 14 | __self_start = .; 15 | 16 | .start : { *(.start) } :stage1 = 0 17 | 18 | . = ALIGN(32); 19 | .text : { 20 | *(.text) 21 | *(.text.*) 22 | } 23 | . = ALIGN(32); 24 | .rodata : { 25 | *(.rodata) 26 | *(.rodata.*) 27 | } 28 | 29 | . = ALIGN(32); 30 | __reloc_start = .; 31 | 32 | .data : { 33 | *(.data) 34 | *(.data.*) 35 | *(.sdata) 36 | *(.sdata.*) 37 | } 38 | . = ALIGN(32); 39 | .bss : { 40 | *(.sbss) 41 | *(.sbss.*) 42 | *(COMMON) 43 | *(.bss) 44 | *(.bss.*) 45 | LONG(0) 46 | } 47 | 48 | . = ALIGN(32); 49 | __toc_start = .; 50 | __toc = . + 0x8000; 51 | .toc : { 52 | *(.toc) 53 | *(.toc.*) 54 | } 55 | __toc_end = .; 56 | . = ALIGN(32); 57 | __opd_start = .; 58 | .opd : { 59 | *(.opd) 60 | *(.opd.*) 61 | } 62 | __opd_end = .; 63 | __reloc_end = .; 64 | 65 | __self_end = .; 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /stage2/start.S: -------------------------------------------------------------------------------- 1 | .text 2 | .section .start,"ax",@progbits 3 | .align 3 4 | 5 | .global _start 6 | 7 | _start: 8 | 9 | mflr %r0 10 | bl 1f 11 | 1: 12 | mflr %r8 13 | lis %r4, 1b@ha 14 | addi %r4, %r4, 1b@l 15 | subf. %r8, %r4, %r8 16 | beq 4f 17 | 18 | li %r6, 0 19 | oris %r6, %r6, 0xBAAD 20 | ori %r6, %r6, 0xCAFE 21 | 22 | lis %r4, __reloc_start@ha 23 | addi %r4, %r4, __reloc_start@l 24 | lis %r5, __reloc_end@ha 25 | addi %r5, %r5, __reloc_end@l 26 | subf. %r5, %r4, %r5 27 | beq 4f 28 | srdi. %r5, %r5, 3 29 | mtctr %r5 30 | add %r4, %r4, %r8 31 | 32 | 2: 33 | ld %r5, 0(%r4) 34 | srdi %r7, %r5, 32 35 | cmpw %r7, %r6 36 | bne 3f 37 | rldicl %r5, %r5, 0, 32 38 | add %r5, %r5, %r8 39 | std %r5, 0(%r4) 40 | 41 | 3: 42 | addi %r4, %r4, 8 43 | bdnz 2b 44 | 45 | 4: 46 | std %r0, 0x10(%sp) 47 | stdu %sp, -0x80(%sp) 48 | std %rtoc, 0x28(%sp) 49 | 50 | lis %r4, __toc@ha 51 | addi %r4, %r4, __toc@l 52 | add %rtoc, %r4, %r8 53 | bl main 54 | 55 | ld %rtoc, 0x28(%sp) 56 | addi %sp, %sp, 0x80 57 | ld %r0, 0x10(%sp) 58 | mtlr %r0 59 | li %r8, 0 60 | blr 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /zlibutil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/zlibutil -------------------------------------------------------------------------------- /zlibutil.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldostools/Mamba/563371948f1b35697e3310aec474b97147b54220/zlibutil.exe -------------------------------------------------------------------------------- /zlibutil_src/MakeIt.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set WIN_PS3SDK=H:/C_PS3SDK 4 | set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%WIN_PS3SDK%/ps3dev/bin;%WIN_PS3SDK%/ps3dev/ppu/bin;%WIN_PS3SDK%/ps3dev/spu/bin;%WIN_PS3SDK%/mingw/Python27; 5 | 6 | make clean 7 | make 8 | 9 | pause -------------------------------------------------------------------------------- /zlibutil_src/Makefile: -------------------------------------------------------------------------------- 1 | CC := $(PREFIX)gcc 2 | CXX := $(PREFIX)g++ 3 | AR := $(PREFIX)ar 4 | OBJCOPY := $(PREFIX)objcopy 5 | 6 | UNAME := $(shell uname -s) 7 | 8 | CFLAGS := $(DEBUGFLAGS) -O2 9 | CFLAGS += $(INCLUDES) 10 | CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions 11 | LDFLAGS = $(DEBUGFLAGS) 12 | 13 | 14 | ifneq (,$(findstring MINGW,$(UNAME))) 15 | PLATFORM := win32 16 | POSTFIX := .exe 17 | CFLAGS += -I/include -mno-cygwin 18 | LDFLAGS += -L/lib -mno-cygwin -Wall -lz -s 19 | OS := win32 20 | endif 21 | 22 | ifneq (,$(findstring CYGWIN,$(UNAME))) 23 | LDFLAGS += -s -lz 24 | POSTFIX := .exe 25 | OS := win32 26 | endif 27 | 28 | ifneq (,$(findstring Darwin,$(UNAME))) 29 | SDK := /Developer/SDKs/MacOSX10.4u.sdk 30 | OSXCFLAGS := -mmacosx-version-min=10.4 -arch i386 31 | OSXCXXFLAGS := $(OSXCFLAGS) 32 | CXXFLAGS += -fvisibility=hidden 33 | LDFLAGS += -mmacosx-version-min=10.4 -arch i386 -Wl,-syslibroot,$(SDK) -L/opt/local/lib 34 | endif 35 | 36 | ifneq (,$(findstring BSD,$(UNAME))) 37 | CFLAGS += -I/usr/local/include 38 | LDFLAGS += -L/usr/local/lib 39 | endif 40 | 41 | ifneq (,$(findstring SunOS,$(UNAME))) 42 | CFLAGS += -I/opt/csw/include 43 | LDFLAGS += -L/opt/csw/lib -R/opt/csw/lib 44 | endif 45 | 46 | ifneq (,$(findstring Linux,$(UNAME))) 47 | LDFLAGS += -lz 48 | OS := Linux 49 | endif 50 | 51 | TARGETS := zlibutil$(POSTFIX) 52 | 53 | all: $(TARGETS) 54 | 55 | zlibutil$(POSTFIX):zpipe.c 56 | @echo building ... $(notdir $@) 57 | @$(CC) $< $(CFLAGS) $(LDFLAGS) -o $@ 58 | 59 | clean: 60 | @echo clean ... 61 | @rm -f $(TARGETS) 62 | 63 | .PHONY: clean 64 | --------------------------------------------------------------------------------