2 Copyright (C) 2002 Rice1964
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.
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.
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.
20 #ifndef _DLLINTERFACE_H_
21 #define _DLLINTERFACE_H_
23 #define M64P_PLUGIN_PROTOTYPES 1
25 #include "m64p_config.h"
26 #include "m64p_plugin.h"
27 #include "m64p_vidext.h"
30 float fViWidth, fViHeight;
31 unsigned short uViWidth, uViHeight;
32 unsigned short uDisplayWidth, uDisplayHeight;
34 unsigned short uDisplayX, uDisplayY;
37 BOOL bDisplayFullscreen;
41 int vpLeftW, vpTopW, vpRightW, vpBottomW, vpWidthW, vpHeightW;
43 int statusBarHeight, statusBarHeightToUse, toolbarHeight, toolbarHeightToUse;
44 BOOL screenSaverStatus;
57 float fps; // frame per second
58 float dps; // dlist per second
59 uint32 lastSecFrameCount;
60 uint32 lastSecDlistCount;
90 uint32 SPCycleCount; // Count how many CPU cycles SP used in this DLIST
91 uint32 DPCycleCount; // Count how many CPU cycles DP used in this DLIST
93 uint32 dwNumTrisRendered;
94 uint32 dwNumDListsCulled;
95 uint32 dwNumTrisClipped;
97 uint32 dwBiggestVertexIndex;
103 BOOL ToToggleFullScreen;
105 uint32 gNewResizeWidth, gNewResizeHeight;
108 bool bUseModifiedUcodeMap;
109 bool ucodeHasBeenSet;
112 uint32 curRenderBuffer;
113 uint32 curDisplayBuffer;
114 uint32 curVIOriginReg;
115 CurScissorType curScissor;
117 PrimitiveType primitiveType;
119 uint32 lastPurgeTimeTime; // Time textures were last purged
121 bool UseLargerTile[2]; // This is a speed up for large tile loading,
122 uint32 LargerTileRealLeft[2]; // works only for TexRect, LoadTile, large width, large pitch
124 bool bVIOriginIsUpdated;
125 bool bCIBufferIsRendered;
126 int leftRendered,topRendered,rightRendered,bottomRendered;
130 bool isVertexShaderSupported;
134 bool isVertexShaderEnabled;
135 bool bUseHW_T_L; // Use hardware T&L, for debug purpose only
139 bool bAllowLoadFromTMEM;
141 // Frame buffer simulation related status variables
142 bool bN64FrameBufferIsUsed; // Frame buffer is used in the frame
143 bool bN64IsDrawingTextureBuffer; // The current N64 game is rendering into render_texture, to create self-rendering texture
144 bool bHandleN64RenderTexture; // Do we need to handle of the N64 render_texture stuff?
145 bool bDirectWriteIntoRDRAM; // When drawing into render_texture, this value =
146 // = true don't render, but write real N64 graphic value into RDRAM
147 // = false rendering into render_texture of DX or OGL, the render_texture
148 // will be copied into RDRAM at the end
149 bool bFrameBufferIsDrawn; // flag to mark if the frame buffer is ever drawn
150 bool bFrameBufferDrawnByTriangles; // flag to tell if the buffer is even drawn by Triangle cmds
156 #define MI_INTR_DP 0x00000020
157 #define MI_INTR_SP 0x00000001
159 extern PluginStatus status;
160 extern GFX_INFO g_GraphicsInfo;
161 extern WindowSettingStruct windowSetting;
163 extern unsigned int g_dwRamSize;
164 extern unsigned int *g_pRDRAMu32;
165 extern signed char *g_pRDRAMs8;
166 extern unsigned char *g_pRDRAMu8;
168 /* declarations of pointers to Core config functions */
169 extern ptr_ConfigListSections ConfigListSections;
170 extern ptr_ConfigOpenSection ConfigOpenSection;
171 extern ptr_ConfigListParameters ConfigListParameters;
172 extern ptr_ConfigSaveFile ConfigSaveFile;
173 extern ptr_ConfigSetParameter ConfigSetParameter;
174 extern ptr_ConfigGetParameter ConfigGetParameter;
175 extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp;
176 extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt;
177 extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat;
178 extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool;
179 extern ptr_ConfigSetDefaultString ConfigSetDefaultString;
180 extern ptr_ConfigGetParamInt ConfigGetParamInt;
181 extern ptr_ConfigGetParamFloat ConfigGetParamFloat;
182 extern ptr_ConfigGetParamBool ConfigGetParamBool;
183 extern ptr_ConfigGetParamString ConfigGetParamString;
185 extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath;
186 extern ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath;
187 extern ptr_ConfigGetUserDataPath ConfigGetUserDataPath;
188 extern ptr_ConfigGetUserCachePath ConfigGetUserCachePath;
190 /* declarations of pointers to Core video extension functions */
191 extern ptr_VidExt_Init CoreVideo_Init;
192 extern ptr_VidExt_Quit CoreVideo_Quit;
193 extern ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes;
194 extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode;
195 extern ptr_VidExt_SetCaption CoreVideo_SetCaption;
196 extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen;
197 extern ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow;
198 extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress;
199 extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute;
200 extern ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute;
201 extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers;
203 /* global functions provided by Video.cpp */
204 extern char generalText[];
205 extern void (*renderCallback)(int);
206 void DebugMessage(int level, const char *message, ...);
209 extern void _VIDEO_DisplayTemporaryMessage2(const char *msg, ...);
210 extern void _VIDEO_DisplayTemporaryMessage(const char *msg);
211 extern void XBOX_Debugger_Log(const char *Message, ...);