1 /*---------------------------------------------------------------------------*
2   Project:  Dolphin GD library
3   File:     GDFile.h
4 
5   Copyright 2001 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Log: GDFile.h,v $
14   Revision 1.2  2006/02/04 11:56:46  hashida
15   (none)
16 
17   Revision 1.1.1.1  2005/05/12 02:41:07  yasuh-to
18   Ported from dolphin source tree.
19 
20 
21     3     2002/08/05 19:49 Hirose
22     Const type specifier support.
23 
24     2     2001/09/14 2:13p Carl
25     Fixed some name consistency.
26 
27     1     2001/09/12 1:55p Carl
28     Initial revision of GD: Graphics Display List Library.
29 
30   $NoKeywords: $
31  *---------------------------------------------------------------------------*/
32 
33 #ifndef __GDFile_H__
34 #define __GDFile_H__
35 
36 /*---------------------------------------------------------------------------*/
37 #include <revolution/types.h>
38 /*---------------------------------------------------------------------------*/
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 // Element of a general-purpose data list.
45 // This is used to keep track of multiple DL's or multiple patch lists.
46 typedef struct _GDGList
47 {
48     void *ptr;        // Points to either a DL or an array of GDPatch's
49     u32   byteLength; // Length of DL or number of GDPatch's * sizeof(GDPatch)
50 } GDGList;
51 
52 typedef struct _GDFileHeader
53 {
54     u32 versionNumber;    // This kind of thing always seems to be useful
55     u32 numDLs;           // How many DL's are in this file?
56     u32 numPLs;           // How many patch tables are in this file?
57     GDGList *DLDescArray; // Pointer (in file it's an offset) to list of DL's
58     GDGList *PLDescArray; // Pointer (in file it's an offset) to list of PL's
59 } GDLFileHeader;
60 
61 enum { GDFileVersionNumber = 0x11223344 };
62 
63 /*---------------------------------------------------------------------------*/
64 
65 #ifndef EPPC
66 s32 GDWriteDLFile(char *fName, u32 numDLs, u32 numPLs,
67                   GDGList *DLDescArray, GDGList *PLDescArray);
68 #endif
69 
70 s32 GDReadDLFile(const char *fName, u32 *numDLs, u32 *numPLs,
71                  GDGList **DLDescArray, GDGList **PLDescArray);
72 
73 /*---------------------------------------------------------------------------*/
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif // __GDFile_H__
79 
80