Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parappa The Rapper hangs #7713

Closed
daniel229 opened this issue Apr 24, 2015 · 13 comments
Closed

Parappa The Rapper hangs #7713

daniel229 opened this issue Apr 24, 2015 · 13 comments

Comments

@daniel229
Copy link
Collaborator

Since unknownbrackets@a16ccf5

debug log(rename jpg to 7z)
master build
not work

revert that change.
work

@sum2012
Copy link
Collaborator

sum2012 commented Apr 24, 2015

@tpunix tell us kernel address need change 0x08000000 to 0x88000000
#6094 (comment)
Allocate kernel modules that fail to decrypt.
I think need "Allocate kernel modules" in kernel address

@unknownbrackets
Copy link
Collaborator

No, that's not how it works. On a PSP, 0x08xxxxxx doesn't necessarily work. 0x88xxxxxx is mapped to the same memory. The allocation isn't different. The upper bits are just used for security measures on the PSP.

Probably we need a JpcspTrace of this game logging the memory usage.

-[Unknown]

@daniel229
Copy link
Collaborator Author

How to log the memory usage with JpcspTrace?

@unknownbrackets
Copy link
Collaborator

Try this version:

https://github.com/unknownbrackets/JpcspTrace/tree/log-memory

Not super well tested.

-[Unknown]

@daniel229
Copy link
Collaborator Author

Log which syscalls?

@unknownbrackets
Copy link
Collaborator

sceKernelLoadModule 0X977DE386
sceKernelLoadModuleByID 0XB7F46618
sceKernelLoadModuleBufferUsbWlan 0XF9275D98

-[Unknown]

@daniel229
Copy link
Collaborator Author

I don't see anything but "JpcspTrace - module_start" in the log.

@unknownbrackets
Copy link
Collaborator

Hmm. It should be loading psmf.prx, which isn't decryptable. Maybe I need to do more tests, I see it's using data=2 and text=2, I vaguely remember these options seemed to be ignored in some cases but maybe it's allocating it in the wrong place.

Probably it's not flushing. You'll want to add sceKernelCreateThread or something else to it to ensure it writes out the log (or I can recompile it with flush-every-time, but then it's more likely to crash the game.)

-[Unknown]

@sum2012
Copy link
Collaborator

sum2012 commented Apr 26, 2015

Not sure gid15 's JPCSPTrace log useful or not
08:02:06 LoadUserModule - sceKernelStartModule 0x80020149, 0x0, 0x0, 0x0, 0x0 = 0x8002012E

TotalFreeMem=0x17FF900, MaxFreeMem=0x17FF900

full log:
https://gist.github.com/sum2012/e2de7b733a949d874173

@unknownbrackets
Copy link
Collaborator

Oh, hadn't been looking at updates of that. Well, JpcspTrace does still flush every syscall iirc.

I should probably add a timer to it to flush after a certain period of time or on a vblank or something. There's probably some relatively safe behavior to be found there.

Seems like something returned SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL. We probably don't return that properly in some cases.

29:49:928 ParappaPorta D[LOAD]: HLE\sceKernelModule.cpp:1664 sceKernelLoadModule(disc0:/PSP_GAME/USRDIR/modules.psp/psmf.prx, 00000000)
29:49:928 ParappaPorta W[LOAD]: HLE\sceKernelModule.cpp:1684 sceKernelLoadModule: unsupported options size=00000014, flags=00000000, pos=0, access=1, data=2, text=2
29:49:951 ParappaPorta I[MODULE]: HLE\sceKernelModule.cpp:852 ~SCE module, skipping header
29:49:951 ParappaPorta D[MODULE]: HLE\sceKernelModule.cpp:858 Decrypting ~PSP file
29:49:951 ParappaPorta I[MODULE]: HLE\sceKernelModule.cpp:866 Loading module scePsmf_library with version 0101, devkit 00000000
29:49:951 ParappaPorta I[HLE]: ELF\PrxDecrypter.cpp:308 Missing key 5B, cannot decrypt module
29:49:951 ParappaPorta I[MODULE]: HLE\sceKernelModule.cpp:1727 470=sceKernelLoadModule(name=disc0:/PSP_GAME/USRDIR/modules.psp/psmf.prx,flag=00000000,00000014,00000002,00000002,position = 00000000)

This is what's ultimately passed into sceKernelStartModule. Probably some combination of unsupported options size=00000014, flags=00000000, pos=0, access=1, data=2, text=2 is causing the load to fail (on a PSP), and the game may be accidentally depending on this for proper memory allocation behavior.

-[Unknown]

@daniel229
Copy link
Collaborator Author

Log other syscall like sceKernelCreateThread would crash PSP.

@sum2012
Copy link
Collaborator

sum2012 commented Apr 26, 2015

I try return SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL in sceKernelLoadModule
But it would call itself again

19:20:244 root I[KERNEL]: HLE\sceKernelThread.cpp:2171 276=sceKernelCreateThread(user_main, 08804228, 00000020, 262144, 80000000, 00000000)
19:20:244 root I[KERNEL]: HLE\sceKernelThread.cpp:2242 0=sceKernelStartThread(276, 33, 0bfffed0)
19:20:244 root I[KERNEL]: HLE\sceKernelThread.cpp:2281 __KernelReturnFromThread: 0
19:20:245 user_main I[UTIL]: HLE\sceUtility.cpp:220 sceUtilityLoadModule(768)
19:20:264 user_main I[UTIL]: HLE\sceUtility.cpp:220 sceUtilityLoadModule(769)
19:20:297 user_main W[LOAD]: HLE\sceKernelModule.cpp:1684 TESTING sceKernelLoadModule: unsupported options size=00000014, flags=00000000, pos=0, access=1, data=2, text=2
19:20:297 user_main I[UTIL]: HLE\sceUtility.cpp:255 sceUtilityUnloadModule(769)
19:20:297 user_main I[UTIL]: HLE\sceUtility.cpp:255 sceUtilityUnloadModule(768)
19:20:397 user_main I[UTIL]: HLE\sceUtility.cpp:220 sceUtilityLoadModule(768)
19:20:414 user_main I[UTIL]: HLE\sceUtility.cpp:220 sceUtilityLoadModule(769)
19:20:447 user_main W[LOAD]: HLE\sceKernelModule.cpp:1684 TESTING sceKernelLoadModule: unsupported options size=00000014, flags=00000000, pos=0, access=1, data=2, text=2

@daniel229
Copy link
Collaborator Author

fixed in #8043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants