Added missing launcher
[mupen64plus-pandora.git] / source / gles2rice / src / Video.h
1 /*
2 Copyright (C) 2002 Rice1964
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17
18 */
19
20 #ifndef _DLLINTERFACE_H_
21 #define _DLLINTERFACE_H_
22
23 #define M64P_PLUGIN_PROTOTYPES 1
24 #include "typedefs.h"
25 #include "m64p_config.h"
26 #include "m64p_plugin.h"
27 #include "m64p_vidext.h"
28
29 typedef struct {
30     float   fViWidth, fViHeight;
31     unsigned short        uViWidth, uViHeight;
32     unsigned short        uDisplayWidth, uDisplayHeight;
33         unsigned short            uDisplayX, uDisplayY;
34     BOOL        bDisplayRatio;
35         
36     BOOL    bDisplayFullscreen;
37     BOOL    bVerticalSync;
38
39     float   fMultX, fMultY;
40     int     vpLeftW, vpTopW, vpRightW, vpBottomW, vpWidthW, vpHeightW;
41
42     int     statusBarHeight, statusBarHeightToUse, toolbarHeight, toolbarHeightToUse;
43     BOOL    screenSaverStatus;
44
45     struct {
46         uint32      left;
47         uint32      top;
48         uint32      right;
49         uint32      bottom;
50         uint32      width;
51         uint32      height;
52         bool        needToClip;
53     } clipping;
54
55     int     timer;
56     float   fps;    // frame per second
57     float   dps;    // dlist per second
58     uint32  lastSecFrameCount;
59     uint32  lastSecDlistCount;
60 }WindowSettingStruct;
61
62 typedef enum 
63 {
64     PRIM_TRI1,
65     PRIM_TRI2,
66     PRIM_TRI3,
67     PRIM_DMA_TRI,
68     PRIM_LINE3D,
69     PRIM_TEXTRECT,
70     PRIM_TEXTRECTFLIP,
71     PRIM_FILLRECT,
72 } PrimitiveType;
73
74 typedef enum 
75 {
76     RSP_SCISSOR,
77     RDP_SCISSOR,
78     UNKNOWN_SCISSOR,
79 } CurScissorType;
80
81 typedef struct {
82     bool    bGameIsRunning;
83     uint32  dwTvSystem;
84     float   fRatio;
85
86     BOOL    frameReadByCPU;
87     BOOL    frameWriteByCPU;
88
89     uint32  SPCycleCount;       // Count how many CPU cycles SP used in this DLIST
90     uint32  DPCycleCount;       // Count how many CPU cycles DP used in this DLIST
91
92     uint32  dwNumTrisRendered;
93     uint32  dwNumDListsCulled;
94     uint32  dwNumTrisClipped;
95     uint32  dwNumVertices;
96     uint32  dwBiggestVertexIndex;
97
98     uint32  gDlistCount;
99     uint32  gFrameCount;
100     uint32  gUcodeCount;
101     uint32  gRDPTime;
102     BOOL    ToToggleFullScreen;
103     bool    ToResize;
104     uint32  gNewResizeWidth, gNewResizeHeight;
105     bool    bDisableFPS;
106
107     bool    bUseModifiedUcodeMap;
108     bool    ucodeHasBeenSet;
109     bool    bUcodeIsKnown;
110
111     uint32  curRenderBuffer;
112     uint32  curDisplayBuffer;
113     uint32  curVIOriginReg;
114     CurScissorType  curScissor;
115
116     PrimitiveType primitiveType;
117
118     uint32  lastPurgeTimeTime;      // Time textures were last purged
119
120     bool    UseLargerTile[2];       // This is a speed up for large tile loading,
121     uint32  LargerTileRealLeft[2];  // works only for TexRect, LoadTile, large width, large pitch
122
123     bool    bVIOriginIsUpdated;
124     bool    bCIBufferIsRendered;
125     int     leftRendered,topRendered,rightRendered,bottomRendered;
126
127     bool    isMMXSupported;
128     bool    isSSESupported;
129     bool    isVertexShaderSupported;
130
131     bool    isMMXEnabled;
132     bool    isSSEEnabled;
133     bool    isVertexShaderEnabled;
134     bool    bUseHW_T_L;                 // Use hardware T&L, for debug purpose only
135
136     bool    toShowCFB;
137
138     bool    bAllowLoadFromTMEM;
139
140     // Frame buffer simulation related status variables
141     bool    bN64FrameBufferIsUsed;      // Frame buffer is used in the frame
142     bool    bN64IsDrawingTextureBuffer; // The current N64 game is rendering into render_texture, to create self-rendering texture
143     bool    bHandleN64RenderTexture;    // Do we need to handle of the N64 render_texture stuff?
144     bool    bDirectWriteIntoRDRAM;      // When drawing into render_texture, this value =
145                                         // = true   don't render, but write real N64 graphic value into RDRAM
146                                         // = false  rendering into render_texture of DX or OGL, the render_texture
147                                         //          will be copied into RDRAM at the end
148     bool    bFrameBufferIsDrawn;        // flag to mark if the frame buffer is ever drawn
149     bool    bFrameBufferDrawnByTriangles;   // flag to tell if the buffer is even drawn by Triangle cmds
150
151     bool    bScreenIsDrawn;
152
153 } PluginStatus;
154
155 #define MI_INTR_DP          0x00000020  
156 #define MI_INTR_SP          0x00000001  
157
158 extern PluginStatus status;
159 extern GFX_INFO g_GraphicsInfo;
160 extern WindowSettingStruct windowSetting;
161
162 extern unsigned int   g_dwRamSize;
163 extern unsigned int  *g_pRDRAMu32;
164 extern signed char   *g_pRDRAMs8;
165 extern unsigned char *g_pRDRAMu8;
166
167 /* declarations of pointers to Core config functions */
168 extern ptr_ConfigListSections     ConfigListSections;
169 extern ptr_ConfigOpenSection      ConfigOpenSection;
170 extern ptr_ConfigListParameters   ConfigListParameters;
171 extern ptr_ConfigSaveFile         ConfigSaveFile;
172 extern ptr_ConfigSetParameter     ConfigSetParameter;
173 extern ptr_ConfigGetParameter     ConfigGetParameter;
174 extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp;
175 extern ptr_ConfigSetDefaultInt    ConfigSetDefaultInt;
176 extern ptr_ConfigSetDefaultFloat  ConfigSetDefaultFloat;
177 extern ptr_ConfigSetDefaultBool   ConfigSetDefaultBool;
178 extern ptr_ConfigSetDefaultString ConfigSetDefaultString;
179 extern ptr_ConfigGetParamInt      ConfigGetParamInt;
180 extern ptr_ConfigGetParamFloat    ConfigGetParamFloat;
181 extern ptr_ConfigGetParamBool     ConfigGetParamBool;
182 extern ptr_ConfigGetParamString   ConfigGetParamString;
183
184 extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath;
185 extern ptr_ConfigGetUserConfigPath     ConfigGetUserConfigPath;
186 extern ptr_ConfigGetUserDataPath       ConfigGetUserDataPath;
187 extern ptr_ConfigGetUserCachePath      ConfigGetUserCachePath;
188
189 /* declarations of pointers to Core video extension functions */
190 extern ptr_VidExt_Init                  CoreVideo_Init;
191 extern ptr_VidExt_Quit                  CoreVideo_Quit;
192 extern ptr_VidExt_ListFullscreenModes   CoreVideo_ListFullscreenModes;
193 extern ptr_VidExt_SetVideoMode          CoreVideo_SetVideoMode;
194 extern ptr_VidExt_SetCaption            CoreVideo_SetCaption;
195 extern ptr_VidExt_ToggleFullScreen      CoreVideo_ToggleFullScreen;
196 extern ptr_VidExt_ResizeWindow          CoreVideo_ResizeWindow;
197 extern ptr_VidExt_GL_GetProcAddress     CoreVideo_GL_GetProcAddress;
198 extern ptr_VidExt_GL_SetAttribute       CoreVideo_GL_SetAttribute;
199 extern ptr_VidExt_GL_GetAttribute       CoreVideo_GL_GetAttribute;
200 extern ptr_VidExt_GL_SwapBuffers        CoreVideo_GL_SwapBuffers;
201
202 /* global functions provided by Video.cpp */
203 extern char generalText[];
204 extern void (*renderCallback)(int);
205 void DebugMessage(int level, const char *message, ...);
206
207 void SetVIScales();
208 extern void _VIDEO_DisplayTemporaryMessage2(const char *msg, ...);
209 extern void _VIDEO_DisplayTemporaryMessage(const char *msg);
210 extern void XBOX_Debugger_Log(const char *Message, ...);
211
212 #endif
213