00001 /* 00002 * PSP Software Development Kit - http://www.pspdev.org 00003 * ----------------------------------------------------------------------- 00004 * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 00005 * 00006 * Copyright (c) 2005 Jesper Svennevid 00007 */ 00008 00009 #ifndef __guInternal_h__ 00010 #define __guInternal_h__ 00011 00012 #include "pspgu.h" 00013 00014 typedef void (*GuCallback)(int); 00015 00016 typedef struct 00017 { 00018 GuCallback sig; 00019 GuCallback fin; 00020 short signal_history[16]; 00021 int signal_offset; 00022 int kernel_event_flag; 00023 int ge_callback_id; 00024 00025 GuSwapBuffersCallback swapBuffersCallback; 00026 int swapBuffersBehaviour; 00027 } GuSettings; 00028 00029 typedef struct 00030 { 00031 unsigned int* start; 00032 unsigned int* current; 00033 int parent_context; 00034 } GuDisplayList; 00035 00036 typedef struct 00037 { 00038 GuDisplayList list; 00039 int scissor_enable; 00040 int scissor_start[2]; 00041 int scissor_end[2]; 00042 int near_plane; 00043 int far_plane; 00044 int depth_offset; 00045 int fragment_2x; 00046 int texture_function; 00047 int texture_proj_map_mode; 00048 int texture_map_mode; 00049 int sprite_mode[4]; 00050 unsigned int clear_color; 00051 unsigned int clear_stencil; 00052 unsigned int clear_depth; 00053 int texture_mode; 00054 } GuContext; 00055 00056 typedef struct 00057 { 00058 int pixel_size; 00059 int frame_width; 00060 void* frame_buffer; 00061 void* disp_buffer; 00062 void* depth_buffer; 00063 int depth_width; 00064 int width; 00065 int height; 00066 } GuDrawBuffer; 00067 00068 typedef struct 00069 { 00070 /* row 0 */ 00071 00072 unsigned char enable; // Light enable 00073 unsigned char type; // Light type 00074 unsigned char xpos; // X position 00075 unsigned char ypos; // Y position 00076 00077 /* row 1 */ 00078 00079 unsigned char zpos; // Z position 00080 unsigned char xdir; // X direction 00081 unsigned char ydir; // Y direction 00082 unsigned char zdir; // Z direction 00083 00084 /* row 2 */ 00085 00086 unsigned char ambient; // Ambient color 00087 unsigned char diffuse; // Diffuse color 00088 unsigned char specular; // Specular color 00089 unsigned char constant; // Constant attenuation 00090 00091 /* row 3 */ 00092 00093 unsigned char linear; // Linear attenuation 00094 unsigned char quadratic;// Quadratic attenuation 00095 unsigned char exponent; // Light exponent 00096 unsigned char cutoff; // Light cutoff 00097 } GuLightSettings; 00098 00099 extern unsigned int gu_current_frame; 00100 extern GuContext gu_contexts[3]; 00101 extern int ge_list_executed[2]; 00102 extern void* ge_edram_address; 00103 extern GuSettings gu_settings; 00104 extern GuDisplayList* gu_list; 00105 extern int gu_curr_context; 00106 extern int gu_init; 00107 extern int gu_display_on; 00108 extern int gu_call_mode; 00109 extern int gu_states; 00110 extern GuDrawBuffer gu_draw_buffer; 00111 00112 extern unsigned int* gu_object_stack[]; 00113 extern int gu_object_stack_depth; 00114 00115 extern GuLightSettings light_settings[4]; 00116 00117 void sendCommandi(int cmd, int argument); 00118 void sendCommandiStall(int cmd, int argument); 00119 void sendCommandf(int cmd, float argument); 00120 00121 void callbackSig(int id, void* arg); 00122 void callbackFin(int id, void* arg); 00123 void resetValues(); 00124 00125 #endif