OT length and MAXPACKET values

Graphic based area of development (Graphics Processing Unit), including the Geometry Transform Engine (GTE), TIM, STR (MDEC), etc.
Post Reply
Yagotzirck
Serious PSXDEV User
Serious PSXDEV User
Posts: 87
Joined: July 17th, 2013, 2:37 am

OT length and MAXPACKET values

Post by Yagotzirck » July 26th, 2013, 3:17 am

how do we establish OT length and amount of max packets, like here: (inc.'s 2d rectangle demo)
#define ORDERING_TABLE_LENGTH (5)
#define MAX_NO_PACKETS (3000)
GsOT_TAG otWorld[2][1<<ORDERING_TABLE_LENGTH];
PACKET out_packet[2][(MAX_NO_PACKETS * 24)];

I mean why this project uses 5 and 3000, the hiworld example uses 2 and 20 etc.
Sorry for the trivial question but I still don't get the relation between those values and their purpose in the project(s) :shrug

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: OT length and MAXPACKET values

Post by inc^lightforce » July 26th, 2013, 3:47 am

please note,

my code was used always and always again(once written i used it for the next cracktro and so on).

i tried to make it clean for the WORKSHOP.
some Values are not necessary but i leave it at that in the source code.
Play around with the Values. You don't need to use it like i did.
my coding page/ forum at:
http://aftermath-creations.net/

Yagotzirck
Serious PSXDEV User
Serious PSXDEV User
Posts: 87
Joined: July 17th, 2013, 2:37 am

Re: OT length and MAXPACKET values

Post by Yagotzirck » July 26th, 2013, 4:02 am

so basically whenever I'm starting a project I don't have to care about putting specific OT length/MAXPACKET values, but rather playing around with them until they fit the project?
Aren't e.g. too high values inefficient in terms of memory, or it's not related at all?

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: OT length and MAXPACKET values

Post by inc^lightforce » July 26th, 2013, 4:10 am

less is more :) and saves Mem...

the lines in my code are from other commands for effects. like i said:
// Many Lines i removed !!!
// Original Source: 27/10/2000


handler for some commands that does not exist in the TUT :)
my coding page/ forum at:
http://aftermath-creations.net/

Yagotzirck
Serious PSXDEV User
Serious PSXDEV User
Posts: 87
Joined: July 17th, 2013, 2:37 am

Re: OT length and MAXPACKET values

Post by Yagotzirck » July 26th, 2013, 4:25 am

got it :) anyway I wonder if there's a specific method to estimate how many packets and OT length values are really needed when starting a project, or it's just a matter of trying increasing/decreasing them until they fit?

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: OT length and MAXPACKET values

Post by inc^lightforce » July 26th, 2013, 4:43 am

i translated this with google to english:
in ordering-table are all displayed objects, eg sprites. lines, dots and text etc., sequentially. More effects you are use, more OTs you'll need

if you are able to understand german in any way, i suggest you this IMPORTANT TUTORIAL that i made.
--------------------------------
viewtopic.php?f=65&t=362
--------------------------------
it's written with psx gnu but very close to psy-q.

with this code i started in 1998? and later it was rewritten for psy-q

if you have trouble or need help with something feel free to ask and let me know your problem or visit the workshop.
new TUTORIALs very soon
my coding page/ forum at:
http://aftermath-creations.net/

Yagotzirck
Serious PSXDEV User
Serious PSXDEV User
Posts: 87
Joined: July 17th, 2013, 2:37 am

Re: OT length and MAXPACKET values

Post by Yagotzirck » July 26th, 2013, 5:20 am

unfortunately I don't understand german :S
btw I have an overall idea on how ordering tables work(sort of), what i'm wondering is: can we estimate the exact amount of PACKETs and OT length we need, based on the amount of objects/effects we're using/planning to use? (so that if we use less packets/shorter OT the program would crash/work badly, and if we use more it would be a waste of resources)

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 140
Joined: December 19th, 2012, 8:08 pm
IRC: t0rxe
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Re: OT length and MAXPACKET values

Post by t0rxe » July 26th, 2013, 4:23 pm

From GPU.TXT found at http://psx.rules.org/gpu.txt

Code: Select all

--------------------------------------------------------------------------
Communication and OT's.
--------------------------------------------------------------------------
All data regarding drawing and drawing environment are sent as packets to
the GPU. Each packet tells the GPU how and where to draw one primitive, or
it sets one of the drawing environment parameters. The display environment
is set up through single word commands using the control port of the GPU.

Packets can be forwarded word by word through the data port of the GPU, or
more efficiently for large numbers of packets through DMA. A special DMA
mode was created for this so large numbers of packets can be sent and
managed easily. In this mode a list of packets is sent, where each entry in
the list contains a header which is one word containing the address of the
next entry and the size of the packet and the packet itself. A result of
this is that the packets do not need to be stored sequentially. This makes
it possible to easily control the order in which packets get processed. The
GPU processes the packets it gets in the order they are offered. So the
first entry in the list also gets drawn first. To insert a packet into the
middle of the list simply find the packet after which you want it to be
processed, replace the address in that packet with the address of the new
packet, and let that point to the address you replaced.

To aid you in finding a location in the list the Ordering Table was
invented. At first this is basically a linked list with entries of packet
size 0, so it's a list of only listentryheaders, where each entry points to
to the next entry. Then as primitives are generated by your program you can
then add them to the table at a certain index. Just read the address in the
table entry and replace it with the address of the new packet and store the
address from the table in the packet. When all packets are generated and
you want to draw, just pass the address of the first listentry to the DMA
and the packets will get drawn in the order you entered the packets to the
table. Packets entered at a higher table index will get drawn after those
entered at a lower table index. Packets entered at the same index will get
drawn in the order they were entered, the last one first.

In 3d drawing it's most common that you want the primitives with the highest
Z value to be drawn first, so it would be nice if the table would be drawn
the other way around, so the Z value can be used as index. This is a simple
thing, just make a table of which each entry points to the previous entry,
and start the DMA with the address of the last table entry. To assist you
in making such a table, a special DMA channel is available which creates
it for you.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: OT length and MAXPACKET values

Post by inc^lightforce » July 27th, 2013, 2:20 am

great. thanks. i never knew about this one.
my coding page/ forum at:
http://aftermath-creations.net/

Yagotzirck
Serious PSXDEV User
Serious PSXDEV User
Posts: 87
Joined: July 17th, 2013, 2:37 am

Re: OT length and MAXPACKET values

Post by Yagotzirck » July 27th, 2013, 5:24 am

At first this is basically a linked list with entries of packet
size 0, so it's a list of only listentryheaders, where each entry points to
to the next entry. Then as primitives are generated by your program you can
then add them to the table at a certain index. Just read the address in the
table entry and replace it with the address of the new packet and store the
address from the table in the packet.
so basically even if we declare a high MAXPACKET value or a long OT it's not really a waste of resources, since entries in linked list aren't used until they point to a packet created by the program, right?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest