Path: chuka.playstation.co.uk!news From: "Martin Keates" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Packet Explanation Date: Tue, 27 Nov 2001 18:27:37 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 68 Message-ID: <9u0lva$ogp5@www.netyaroze-europe.com> References: <9tkp3s$dq91@www.netyaroze-europe.com> <9tlh4b$dq95@www.netyaroze-europe.com> <9tne1e$dq916@www.netyaroze-europe.com> NNTP-Posting-Host: modem-327.sprat.dialup.pol.co.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 > how would i clear the screen, put the words " thanks for checking me oout" > and then quit the program? Steven's state machine paradigm is a good way of working. Rather than use switch/case though I'd use callback functions (i.e. a variable that points to a function). So, you'd have a variable for e.g. pad_func, display_func, compute_func or whatever and assign different functions to them depending on the current state. Then your main loop looks something like: { (*pad_func)(); (*compute_func)(); (*display_func)(); } Um - it's probably easier to look at an example. I seem to remember nicking this idea off Alex so look at Super Bub source code. > // not sure about the (PACKET*) part, but as i understand it > // it is type casting (PACKET*) but whats the *? pointer? Yes * means pointer. If you defined your packetArea as an array of PACKET rather than struct PACKET you wouldn't need a cast. An array is equivalent to a pointer in this (function parameter passing) situation. > // why is this set at 4? hmmm good question... how did you work that value > out? > // i know what the 4 means, non interlaced etc,but how did you get 4? > > GsInitGraph(SCREEN_WIDTH,SCREEN_HEIGHT,4,0,0); It's just the flag values used by the library. There's nothing special about the numbers, except that the individual elements are powers of 2 so that you can use | to add a flag and & to check a flag's status. (i.e. interlace is 2^0 and offset mode is 2^2). So to have interlaced and GPU offset you'd have (1 | 4) == 5. For non-interlaced and GPU it's (0 | 4) == 4. > // still unsure about this.. whats exactly is WorldTags[x] > > WorldOT[x].org = WorldTags[x]; // link in the OT units WorldTags has an element for each possible priority in the OT. As you add packets to the OT the packet address is inserted into its priority element in the WorldTags array, and the end of the packet is set to point to whatever was previously in that element. So you create a chain starting at each WorldTag array element containing all the packets for that priority. If you're not using priorities you might as well us an OT length of 1, which needs WorldTags array of size [2][1<<1] (i.e.[2][2]). > // where do some of these magic numbers come from... > > FntLoad(960,256); This is just the frame buffer position that the font will be put (so it must not conflict with either the display buffers or any other textures). > FntOpen(10,80,256,200,0,512); These parameters are all explained in the library reference. Martin.