CFYC's Guide to PS2Linux Programming, Tips & Tricks page
Lionel Lemarié - hikey@playstation2-linux.com
Last update: 2002-08-13

This is the Tips & Tricks page, where I will attempt to list a number of ideas you absolutly have to get familiar with, some of them are aimed to correct misconceptions that I have observed in the forums. As a general rule, if you don't understand something in the list, post on the forums and take it for granted until it is explained. That will save you a lot of time.

This document is currently in the process of being written, it is online for testing purposes only and is not the full version.
You can find the latest version here: http://playstation2-linux.com/download/cfyc/tips_tricks.html.

You can also check out the Guide to PS2Linux Programming which deals with design and implementation of games in general on PS2Linux.

Should you have any comments, feedback, or insults, please do not hesitate to post them in the forums in the CFYC project or to contact me directly by e-mail.



EE core

Tip #1

Do not ever, ever, consider creating a class for a primitive like a dot, line, triangle. Also, do not send your primitives one at a time, build batches (around 50 vertices on average).

The reason for that is that nothing is less efficient than having the memory fragmented with classes all over the place. Performance is an issue on PS2, if you don't do it the right way, you will have disappointing results.
And it's not good for packet building purposes either because the data would need to be copied into the DMA packet anyway and there is no point having it twice in memory at the same time. It's no good for teaching purposes as well, it's no good learning with the wrong concepts.
So what you want is a clean array (allocated all at once, forget all you know about realloc), that contains your prebuilt DMA packet with the data embedded. Ideally the packet building is done offline and saved into a file that you read at runtime and that needs no processing.

Tip #2

Do not use PATH3 (EE->GS) for geometry, it is *bad*. When you learn, use the basic.vsm file from the samples, make some base code, learn about packets, then have a look at VCL. It's seriously not that hard for common T&L, and it is the way to go.



VIF0 / VU0
- Coming some time in the near (?) future.



VIF1 / VU1
- Coming some time in the near (?) future.



Other
- Coming some time in the near (?) future.