ps2dev / ps2sdk

Homebrew PS2 SDK
Other
940 stars 133 forks source link

Documenting the SDK and updating the readme #25

Closed tamara-schmitz closed 4 years ago

tamara-schmitz commented 8 years ago

PS2SDK has so many awesome features and modules. But rarely any module contains a short description on what it even does or how to use it. So please currently active devs, add a small description to the module you are working on and it will be much easier for people interest in using it to actually understand what it does. In addition it would be awesome if the Readme could hold a list of all available modules right now.

But none the less, thank you so much for all the effort you have put into the project over the past 15 years!

uyjulian commented 8 years ago

SP193 used to have a documentation project going on, but I think she put it on hiatus.

Of course, you can send in pull requests...

sp193 commented 8 years ago

Actually, I think that it's as good as dead.

The IOP system functions are the same as the SONY functions because they are SONY functions. So to make things easier, I am just making all non-compliant functions compliant with the SONY documentation. Not only will that make both the EE and IOP sides symmetrical (as they originally would), there would be reliable documentation. The only problem though, is that the SONY documentation is copyrighted.

tamara-schmitz commented 8 years ago

@sp193 that's great! But what about modules like inputx? They are not part of the Sony documentation right?

BoGanon commented 8 years ago

The input/x library is a high level library that I wrote to wrap around libpad/x. It was designed to be a single library hiding all the details from switching pad modules around and plugging in a multitap and dealing with separate quirks in behavior. It also implements polling under the hood so no need to call pad_wait().

Init a pad, get the button status and when you're done with the controller, like at the end of a program, free it. I was told to split it up when I added it which kind of defeated the point of being high level. It's still got some rough edges like using the raw values from libpad/x. The 'x' version supports multitaps.

// The IOP has been setup with PADMAN or XPADMAN by now
// And padInit() has been called.

// Unlocked means the analog can be turned on or off
pad_t *pad1 = pad_open(0,0,MODE_UNLOCK);
// Read buttons
pad_get_buttons(pad1);
// The btns are in reverse, 0 is pressed, 1 is default, so switch them around
if ((pad1->buttons.btns ^ 0xffff) & PAD_LEFT)
  printf("Left is pressed");
// Enable force feedback
pad_init_actuators(pad1);
// Turn on small motor
pad_set_actuators(pad1,1,0);
// Set large motor to 50%
pad_set_actuators(pad1,1,128);
// Stop force feedback
pad_set_actuators(pad1,0,0);
// Free the pad
pad_close(pad1);

I figured out the doxygen problem, too. It preprocesses macros, so for any macros that are false, it won't process the code.

BoGanon commented 7 years ago

I made some new doxygen configuration files for ps2sdk. It's a little basic right now and ps2sdk's macros still need fixing. Additional macros need to be added to PREDEFINED for some of the libraries. Still playing around with all the options.

It breaks up the documentation into two parts, the EE's namespace and the IOP's namespace. There are also preliminary index pages for each and a main page to tie them all together. Tag files are generated by each configuration file, too. Seemed useful to set it up that way so ee/iop configs will inherit tags from the index config, and the index config will inherit tags from ee/iop config.

You can get them at: https://github.com/BoGanon/ps2sdk-doxy

Already seeing a few trouble spots from looking at the graphs, :stuck_out_tongue_winking_eye:.

I also wrote some lib documentation for input/x, packet, and font for the future.

sp193 commented 7 years ago

@BoGanon, I do not have experience with automatic documentation systems like doxy, but if you think that it is good (after all, I think that mrbrown used it), I could try to help you with getting the existing PS2SDK repository to adapt it.

Adequate documentation and development tools has always been a major problem, after all.

fjtrujy commented 4 years ago

Hello, I think that this issue could be closed because we already implemented the Doxygen.

http://ps2dev.github.io/ps2sdk/

Thanks

AKuHAK commented 4 years ago

Great! I should improve my Doxygen implementation, but it is in a very good state even now.