After this header follow the sections. All sections work the same! A section contains of entries and is ended with also an entry, but containing the specific ibend constant (see ppu.pas for a list).
Each entry starts with an entryheader.
tppuentry=packed record id : byte; nr : byte; size : longint; end;
field | Description |
id | this is 1 or 2 and can be check if it the entry is correctly found. 1 means its a main entry, which says that it is part of the basic layout as explained before. 2 toggles that it it a sub entry of a record or object |
nr | contains the ib constant number which determines what kind of entry it is |
size | size of this entry without the header, can be used to skip entries very easily. |
To read an entry you can simply call ppufile.readentry:byte, it returns the tppuentry.nr field, which holds the type of the entry. A common way how this works is (example is for the symbols):
repeat b:=ppufile.readentry; case b of ib<etc> : begin end; ibendsyms : break; end; until false;
Then you can parse each entry type yourself. ppufile.readentry will take care of skipping unread bytes in the entry an read the next entry correctly! A special function is skipuntilentry(untilb:byte):boolean; which will read the ppufile until it finds entry untilb in the main entries.
Parsing an entry can be done with ppufile.getxxx functions. The available functions are:
procedure ppufile.getdata(var b;len:longint); function getbyte:byte; function getword:word; function getlongint:longint; function getreal:ppureal; function getstring:string;
To check if you're at the end of an entry you can use the following function:
function EndOfEntry:boolean;notes:
A complete list of entries and what their fields contain can be found in ppudump.pp.