Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Learning PSP assembly
01-15-2017, 05:30 AM
Post: #25
RE: Learning PSP assembly
Nah, syscalls are as the name suggests functions of the system, there are usually stubs for all syscalls grouped together in small functions after other code and each of those functions look alike:
Code:
zz_sceKernelWakeupThread:
jr ra
syscall sceKernelWakeupThread
And here sceKernelWakeupThread is the syscall.

Now we have stuff like "jal zz_sceKernelWakeupThread" which is not a syscall, but simply Jump-and-link instruction leading to the start of that small function by label. Also note that RA is just register storing return address, it's set by "link" instructions like JAL. Another fun fact, syscalls are executed from delay slot, so it's not really followed by, but it starts from "jr ra". If you never heard about it, maybe you should google for "delay slot" as it can be confusing especially with "likely" instructions like bnel where delay slot is only executed when branch is taken, it's pretty easy to understand by just observing game disassembly through.

You'll never see what syscall does by looking at it's function in game, that is unless you guess by observing everything which can be impossible in many cases;p. To see what syscall exactly does as mentioned you need to check it in SDK(aka use google) or search for it in ppsspp code on github ie like this. You have no means of affecting those system functions from in-game aside from calling them and using different arguments and again not all are known/emulated, most games will show some unimplemented syscalls in the log which we have no idea about, but most of these as long as everything is ok should just return 0 and that's exactly what emulators do with them.;]


As for labels, they mark the start of a function, they can be:
- named after syscalls,
- loaded from game's debug data if it exist(I would guess it's rare;p),
- assigned by ppsspp function replacement(mostly common functions like memcopy or some trigonometry stuff etc., replaced for compatibility, so they might behave weirdly in disassembly, but it shows when they're replaced),
- assigned by user who's into symbols ~ never really bother using it myself since I'm too impatient for longer projects(;p) and reasonably good memory for weird stuff like asm, right click menu in disassembly has some options for creating/renaming functions, probably best used with ini-only setting "AutoSaveSymbolMap" which set to "true" should save them,
- neither of the above, will just have that generic name with address.

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Learning PSP assembly - Yugisokubodai - 12-02-2016, 01:15 PM
RE: Learning PSP assembly - TkSilver - 12-02-2016, 09:46 PM
RE: Learning PSP assembly - Yugisokubodai - 12-02-2016, 10:45 PM
RE: Learning PSP assembly - TkSilver - 12-03-2016, 05:08 AM
RE: Learning PSP assembly - LunaMoo - 12-03-2016, 05:51 PM
RE: Learning PSP assembly - Yugisokubodai - 12-04-2016, 01:32 AM
RE: Learning PSP assembly - LunaMoo - 12-04-2016, 03:04 AM
RE: Learning PSP assembly - Yugisokubodai - 12-04-2016, 03:19 AM
RE: Learning PSP assembly - LunaMoo - 12-04-2016, 03:45 AM
RE: Learning PSP assembly - Yugisokubodai - 12-04-2016, 03:50 AM
RE: Learning PSP assembly - LunaMoo - 12-04-2016, 04:16 AM
RE: Learning PSP assembly - Tehau - 12-04-2016, 07:38 AM
RE: Learning PSP assembly - Yugisokubodai - 12-04-2016, 08:18 AM
RE: Learning PSP assembly - LunaMoo - 12-04-2016, 03:17 PM
RE: Learning PSP assembly - Yugisokubodai - 12-09-2016, 01:26 PM
RE: Learning PSP assembly - LunaMoo - 12-09-2016, 09:09 PM
RE: Learning PSP assembly - Yugisokubodai - 12-20-2016, 11:58 AM
RE: Learning PSP assembly - Yugisokubodai - 01-08-2017, 04:23 PM
RE: Learning PSP assembly - LunaMoo - 01-09-2017, 04:54 AM
RE: Learning PSP assembly - Yugisokubodai - 01-09-2017, 10:43 AM
RE: Learning PSP assembly - LunaMoo - 01-09-2017, 06:03 PM
RE: Learning PSP assembly - Yugisokubodai - 01-12-2017, 02:30 PM
RE: Learning PSP assembly - LunaMoo - 01-12-2017, 05:18 PM
RE: Learning PSP assembly - Yugisokubodai - 01-15-2017, 12:06 AM
RE: Learning PSP assembly - LunaMoo - 01-15-2017 05:30 AM

Forum Jump: