pspsdk-1.0+beta2
guInternal.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * Copyright (c) 2005 Jesper Svennevid
7  */
8 
9 #ifndef __guInternal_h__
10 #define __guInternal_h__
11 
12 #include "pspgu.h"
13 
14 typedef void (*GuCallback)(int);
15 
16 typedef struct
17 {
20  short signal_history[16];
24 
27 } GuSettings;
28 
29 typedef struct
30 {
31  unsigned int* start;
32  unsigned int* current;
35 
36 typedef struct
37 {
40  int scissor_start[2];
41  int scissor_end[2];
43  int far_plane;
49  int sprite_mode[4];
50  unsigned int clear_color;
51  unsigned int clear_stencil;
52  unsigned int clear_depth;
54 } GuContext;
55 
56 typedef struct
57 {
60  void* frame_buffer;
61  void* disp_buffer;
62  void* depth_buffer;
64  int width;
65  int height;
66 } GuDrawBuffer;
67 
68 typedef struct
69 {
70  /* row 0 */
71 
72  unsigned char enable; // Light enable
73  unsigned char type; // Light type
74  unsigned char xpos; // X position
75  unsigned char ypos; // Y position
76 
77  /* row 1 */
78 
79  unsigned char zpos; // Z position
80  unsigned char xdir; // X direction
81  unsigned char ydir; // Y direction
82  unsigned char zdir; // Z direction
83 
84  /* row 2 */
85 
86  unsigned char ambient; // Ambient color
87  unsigned char diffuse; // Diffuse color
88  unsigned char specular; // Specular color
89  unsigned char constant; // Constant attenuation
90 
91  /* row 3 */
92 
93  unsigned char linear; // Linear attenuation
94  unsigned char quadratic;// Quadratic attenuation
95  unsigned char exponent; // Light exponent
96  unsigned char cutoff; // Light cutoff
98 
99 extern unsigned int gu_current_frame;
100 extern GuContext gu_contexts[3];
101 extern int ge_list_executed[2];
102 extern void* ge_edram_address;
103 extern GuSettings gu_settings;
104 extern GuDisplayList* gu_list;
105 extern int gu_curr_context;
106 extern int gu_init;
107 extern int gu_display_on;
108 extern int gu_call_mode;
109 extern int gu_states;
111 
112 extern unsigned int* gu_object_stack[];
113 extern int gu_object_stack_depth;
114 
116 
117 void sendCommandi(int cmd, int argument);
118 void sendCommandiStall(int cmd, int argument);
119 void sendCommandf(int cmd, float argument);
120 
121 void callbackSig(int id, void* arg);
122 void callbackFin(int id, void* arg);
123 void resetValues();
124 
125 #endif