RPCS3 Forums

Full Version: Questions about development
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

syphurith

Thanks to all of you devs. You are doing awesome work.
I'm trying to find someone that may get interested in such development within my ordinary reach. And i have some questions about devs, so i registered and came to ask you. If you think that would be the questions dev should help himself with, please tell me such an answer.

1.How can i know a function's prototype?
I searched "UNIMPLEMENTED_FUNC" in the repo with Astrogrep, and easily get a hugh list telling me about those unimplemented functions.
* Some has their arguments list mentioned as comment, ie cellSaveDataListAutoSave in <rpcs3_repo_base_directory>\rpcs3\Emu\SysCalls\Modules\cellSysutil_SaveData.cpp.
Code:
int cellSaveDataUserListSave() //u32 version, CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
However it might be a little different as below. It looks like to pick a save data slot from the list and save yep.
Code:
int cellSaveDataUserListSave(u32 version, u64 userId, mem_ptr_t<CellSaveDataSetList > setList,
    mem_ptr_t<CellSaveDataSetBuf> setBuf, mem_ptr_t<CellSaveDataListCallback> funcList,
    mem_ptr_t<CellSaveDataStatCallback> funcStat, mem_ptr_t<CellSaveDataFileCallback> funcFile,
    u32 container, u32 userdata_addr)
I know i could get the arguments by add a cellSysutil->Warning call to such a call.
* And many of those functions are only names without any comments telling about the arguments, such as int cellSpursLFQueueDetachLv2EventQueue() in cellSpurs.cpp (Queue with Mutex lock?), int cellGameDeleteGameData() in cellGame.cpp, and BLABLA. Some with comments may even have outdated arguments list.
Searched PS3Wiki and Search Engines (sorry i can not connect to google due to GFW), i got no results that may be associated with these function names. I searched the documentations linked on the Development Information page on Github, and got no results neither. I know i may give a call a name but i can not directly know what arguments it has.
Just guess? or using Debugger to let it pause at those calls and analyze the nearby memory manually? or somewhat else? If you know how to do such a thing, please tell me.

2.About function debugging. And the debug console..
Once someone implemented a function, how can he know that the function actioned as expected. Yes we can use games to find somewhere that called the function (also we can know some functions that unimplemented related to the game), but i'm afraid we do not have the chance to access the memories mentioned in the function, or else only the VS debugger would help.
Then, rpcs3 may have a feature that auto pause at the function calls in the list (given a list of function names or hex marks). It would help debugging the functions, and this makes the non-devs may help the function debugging.
Also i find the debug console doesn't have a clear option.. I do not expect a filter for the log but a clear command might be needed. Taking a while looking for the code i can locate a "clear" could be in <rpcs3_repo_base_directory>\rpcs3\Gui\ConLogFrame.cpp and <rpcs3_repo_base_directory>\Utilities\Log.cpp, but i did not have sufficiant skills, so sorry.

3.About the function comments..
I know all of you devs are awesome people so you write awesome apps and code. But to a newbie the comments may be insufficiant for him to get a breif information about the function and its behaviour. You know little comment make code difficult to read and understand.
Then would you allow one adding comment about the functions, and such documentation work as write some words about the architecture of the project (helps when u want to gain a easy breif of where to find)? Reading and trying to understand the code written by others would be a little difficult, but quite "safe" (that does not affect the actual working behaviour). Also reading might find some silly points done accidentially. Would you allow such reading and commenting guys?

Hoping rpcs3 can run better. Thank all you guys for such work.

syphurith

(08-10-2014, 08:25 AM)AlexAltea Wrote: [ -> ]Sorry, I cannot give a detailed answer atm.
1. Reverse firmware files and ask in the dev chatroom @ irc.efnet.org:6667 : #rpcs3.
2. You can test them writing tests (e.g. with PSL1GHT), check ps3autotests repo and use VS debugger.
3. Clean code doesn't need commenting, and bad code needs to be refactored rather than commented, IMO. And yes, there are lots of bad code.
Thanks for your reply. Well also thanks for your IRC addr.

1.So that's still a little difficult for those newbies. Well what i can hope is only the mod made on their local repo did not crash the emulator.
2.Maybe still a "Pause at function calls" be a feature you need? VS is already laggy, and rpcs3 running slow - gosh.. Okey when i find out what to call to make it pause. Also it would help when a non dev wanna help collect some info about some calls - ps3 games are a little big you know, and dev may not have so many games..
3.Well i mean, would you allow someone comment the codes? You see there is only Roadmap/Dev.Info./FAQ/.. on github wiki. Someone might want to know what calls he might need or which call he could take a look, and the comment would help even when he searches the repo with grep. Without comment reading code may be a difficult work, especially for those big works. And this may helps us find out what might be improvable. Even you've told us to comment, but some still does not like to do it much (that is humanly speaking, not programming..hah). And reading these might lead to code review, which would help us know what might cause troubles.

Indeed i think a little help might be good things for you - even i don't have so many exp like you. And hope my questions don't annoy any of you.
1) Of course, it's not very clear... but there are some *reasons* in terms of copyright and other shit.
2) Not a big problem, if I generally understand. We *can* get some information, and can reverse some function, so finally we understand how does it work, in direct or indirect way, and there are many debugging possibilities which are not limited by anything but time spent. At least I hope so.
3) If you examine existing code and comment how it works, nobody will argue. But I can only say "sorry" about the code already written (by me or other developers). It may get eventually rewritten. And of course, if you have good questions to ask regarding your research, you are welcome on IRC, we will try to help.

syphurith

(08-10-2014, 09:17 PM)NekotekinaHito Wrote: [ -> ]1) Of course, it's not very clear... but there are some *reasons* in terms of copyright and other shit.
2) Not a big problem, if I generally understand. We *can* get some information, and can reverse some function, so finally we understand how does it work, in direct or indirect way, and there are many debugging possibilities which are not limited by anything but time spent. At least I hope so.
3) If you examine existing code and comment how it works, nobody will argue. But I can only say "sorry" about the code already written (by me or other developers). It may get eventually rewritten. And of course, if you have good questions to ask regarding your research, you are welcome on IRC, we will try to help.

I'm glad you replied me. And i may get some time to do some job around rpcs3, after some works done.
1. So i can't expect those direct materials (well other than ps3dev wiki). Thx.
2. Yeah rpcs3 is also a debugger, iirc. So it can have some debugging feature, targeting devs.
3. Oh so that's okey. I understand. If having trouble i would get myself on irc. Or if some code may cause troubles / improvable (after read and comment about them).
I would try first use a local repo to read it and try to be helpful.
If i have made a new feature (Debug Console Clean Command, Pause at Call - Hex, and etc) and tested that fully i would tell you again.