Apart from the header section, all the data in the PPU file is separated into data blocks, which permit easily adding additional data blocks, without compromising backward compatibility. This is similar to both Electronic Arts IFF chunk format and Microsoft’s RIFF chunk format.
Each ’chunk’ (tppuentry) has the following format, and can be nested:
|
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; |
The possible entry types are found in ppu.pas, but a short description of the most common ones are shown in table (A.5).
|
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; |
A complete list of entries and what their fields contain can be found in ppudump.pp.