Replace Tmem_nasm.asm with C++ code. Patch by pyro.
[Glide64.git] / Gfx1.3.h
blob2ae5ca88ef22af56304881939717fbd774b814c1
1 /*
2 * Glide64 - Glide video plugin for Nintendo 64 emulators.
3 * Copyright (c) 2002 Dave2001
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //****************************************************************
22 // Glide64 - Glide Plugin for Nintendo 64 emulators (tested mostly with Project64)
23 // Project started on December 29th, 2001
25 // To modify Glide64:
26 // * Write your name and (optional)email, commented by your work, so I know who did it, and so that you can find which parts you modified when it comes time to send it to me.
27 // * Do NOT send me the whole project or file that you modified. Take out your modified code sections, and tell me where to put them. If people sent the whole thing, I would have many different versions, but no idea how to combine them all.
29 // Official Glide64 development channel: #Glide64 on EFnet
31 // Original author: Dave2001 (Dave2999@hotmail.com)
32 // Other authors: Gonetz, Gugaman
34 //****************************************************************
36 // ** NOTE: this file has been modified from it's original version, which can be
37 // downloaded along with Project64 **
39 /**********************************************************************************
40 Common gfx plugin spec, version #1.3 maintained by zilmar (zilmar@emulation64.com)
42 All questions or suggestions should go through the mailing list.
43 http://www.egroups.com/group/Plugin64-Dev
44 ***********************************************************************************
46 Notes:
47 ------
49 Setting the approprate bits in the MI_INTR_REG and calling CheckInterrupts which
50 are both passed to the DLL in InitiateGFX will generate an Interrupt from with in
51 the plugin.
53 The Setting of the RSP flags and generating an SP interrupt should not be done in
54 the plugin
56 **********************************************************************************/
58 // THIS FILE IS A PRECOMPILED HEADER TO DECREASE BUILD TIME. INCLUDE ALL STANDARD
59 // .H FILES HERE
61 #ifndef _GFX_H_INCLUDED__
62 #define _GFX_H_INCLUDED__
64 #if defined(WIN32) && defined(GCC)
65 // ZIGGY ARRRRGG what a pain in the #$@$
66 //# include "Gfx #1.3-mangling.h"
67 #ifdef GCC
68 #include <stdio.h>
69 //#define printf(...)
70 #endif
71 #endif
73 #define _WIN32_WINNT 0x0400
75 #ifdef _WIN32
76 #include <windows.h>
77 #else // _WIN32
78 #include "winlnxdefs.h"
79 #endif // _WIN32
80 #include <stdio.h>
82 #include <ostream>
83 #include <fstream>
85 #include <cstddef> // offsetof
86 #include <cmath>
87 #ifdef _WIN32
88 #include <io.h>
89 #include <direct.h>
90 #include <mmsystem.h>
91 #include <commctrl.h>
92 #endif // _WIN32
93 #include <time.h>
94 #include <glide.h>
95 #include <g3ext.h>
96 #include "rdp.h"
98 #if defined(__cplusplus)
99 extern "C" {
100 #endif
102 // tooltips have an error on debug mode, this can be overcome by clicking ignore,
103 // but I'd rather just disable tooltips altogether since nobody else should
104 // have the debug version anyway.
105 #ifndef _DEBUG
106 //#ifndef __INTEL_COMPILER // tooltips don't work with intel compiler
107 #define USE_TOOLTIPS
108 //#endif
109 #endif
111 #ifndef VPDEBUG
112 # define _FINAL_RELEASE_
113 #endif
114 // #ifdef WIN32
115 // # define _FINAL_RELEASE_
116 // #else
117 // //# define _FINAL_RELEASE_
118 // #endif
120 //********
121 // Logging
123 // ********************************
124 // ** TAKE OUT BEFORE RELEASE!!! **
125 //#define LOGGING // log of spec functions called
126 //#define LOG_KEY // says "Key!!!" in the log when space bar is pressed
128 //#define LOG_UCODE
130 //#define ALTTAB_FIX
132 //#define EXTREME_LOGGING // lots of logging
133 // note that some of these things are inserted/removed
134 // from within the code & may not be changed by this define.
136 //#define TLUT_LOGGING // log every entry of the TLUT?
137 // ********************************
139 #define FPS // fps counter able? (not enabled necessarily)
141 #define LOGNOTKEY // Log if not pressing:
142 #ifdef WIN32
143 #define LOGKEY VK_LCONTROL // this key
144 #else
145 #include <SDL/SDL.h>
146 #define LOGKEY KMOD_LCTRL
147 inline int GetAsyncKeyState(int key) {
148 return (SDL_GetModState() & key) != 0;
150 #endif
152 #define LOG_COMMANDS // log the whole 64-bit command as (0x........, 0x........)
154 #define CATCH_EXCEPTIONS // catch exceptions so it doesn't freeze and will report
155 // "The gfx plugin has caused an exception" instead.
157 #define FLUSH // flush the file buffer. slower logging, but makes sure
158 // the command is logged before continuing (in case of
159 // crash or exception, the log will not be cut short)
160 #ifndef _FINAL_RELEASE_
161 #define RDP_LOGGING // Allow logging (will not log unless checked, but allows the option)
162 // Logging functions will not be compiled if this is not present.
163 //#define RDP_ERROR_LOG
164 #endif
166 #define FPS_FRAMES 10 // Number of frames in which to make an FPS count
168 //#define SHOW_FULL_TEXVIEWER // shows the entire contents of the texture in the cache viewer,
169 // usually used to debug clamping issues.
172 // Usually enabled
173 #define LARGE_TEXTURE_HANDLING // allow large-textured objects to be split?
175 #ifdef ALTTAB_FIX
176 extern HHOOK hhkLowLevelKybd;
177 extern LRESULT CALLBACK LowLevelKeyboardProc(int nCode,
178 WPARAM wParam, LPARAM lParam);
179 #endif
181 // Simulations
182 //#define SIMULATE_VOODOO1
183 //#define SIMULATE_BANSHEE
184 //********
186 #ifdef EXT_LOGGING
187 extern std::ofstream extlog;
188 #define EXT(x) extlog.open("ext.txt",ios::app); extlog << x; extlog.close();
189 #else
190 #define EXT(x)
191 #endif
193 #ifndef _FINAL_RELEASE_
194 #define UNIMP_LOG // Keep enabled, option in dialog
195 #define BRIGHT_RED // Keep enabled, option in dialog
196 #endif
198 #define COLORED_DEBUGGER // ;) pretty colors
200 #ifdef FPS
201 extern LARGE_INTEGER perf_freq;
202 extern LARGE_INTEGER fps_last;
203 extern LARGE_INTEGER fps_next;
204 extern float fps;
205 extern DWORD fps_count;
206 #endif
208 // rdram mask at 0x400000 bytes (bah, not right for majora's mask)
209 //#define BMASK 0x7FFFFF
210 extern unsigned long BMASK;
211 #define WMASK 0x3FFFFF
212 #define DMASK 0x1FFFFF
214 extern long num_tmu;
215 extern long max_tex_size;
216 extern long sup_mirroring;
217 extern BOOL sup_32bit_tex;
218 extern DWORD update_screen_count;
220 extern DWORD resolutions[0x18][2];
222 //#define PERFORMANCE
223 #ifdef PERFORMANCE
224 extern __int64 perf_cur;
225 extern __int64 perf_next;
226 #endif
228 #ifdef LOGGING
229 extern std::ofstream loga;
230 #define LOG(x) loga.open("log.txt",ios::app); loga << x; loga.flush(); loga.close();
231 #else
232 #define LOG(x)
233 #endif
236 #ifdef RDP_LOGGING
237 extern int dumping;
238 extern BOOL log_open;
239 extern std::ofstream rdp_log;
240 //#define rdp_log std::cerr;
241 #define OPEN_RDP_LOG() EXT("OPEN_RDP_LOG ()\n"); if (settings.logging && !log_open) { /*rdp_log.open ("rdp.txt");*/ log_open=TRUE; }
242 #define CLOSE_RDP_LOG() EXT("CLOSE_RDP_LOG ()\n"); if (settings.logging && log_open) { /*rdp_log.close ();*/ log_open=FALSE; }
244 #ifdef LOGNOTKEY
245 #define RDP(x) EXT("RDP (...)\n"); if (dumping && settings.logging && log_open) { if (!(GetAsyncKeyState(LOGKEY)&0x8000)) { fprintf(stderr, x);/*rdp_log << x; rdp_log.flush();*/ } }
246 #else
247 #define RDP(x) EXT("RDP (...)\n"); if (dumping && settings.logging && log_open) { fprintf(stderr, x);/*rdp_log << x; rdp_log.flush();*/ }
248 #endif
250 #else
251 #define OPEN_RDP_LOG()
252 #define CLOSE_RDP_LOG()
253 #define RDP(x)
254 #endif
257 #ifdef RDP_ERROR_LOG
258 extern BOOL elog_open;
259 extern std::ofstream rdp_err;
260 //#define rdp_err std::cerr
261 #define OPEN_RDP_E_LOG() EXT("OPEN_RDP_E_LOG ()\n"); if (settings.elogging && !elog_open) { /*rdp_err.open ("rdp_e.txt");*/ elog_open=TRUE; }
262 #define CLOSE_RDP_E_LOG() EXT("CLOSE_RDP_LOG ()\n"); if (settings.elogging && elog_open) { /*rdp_err.close (); */elog_open=FALSE; }
263 #define RDP_E(x) if (dumping && settings.elogging) { FRDP_E (x); }
264 #else
265 #define OPEN_RDP_E_LOG()
266 #define CLOSE_RDP_E_LOG()
267 #define RDP_E(x)
268 #endif
271 #ifdef RDP_LOGGING
272 __inline void FRDP (const char *fmt, ...)
274 #ifdef RDP_LOGGING
275 if (!dumping || !settings.logging || !log_open) return;
277 #ifdef LOGNOTKEY
278 if (GetAsyncKeyState(LOGKEY)&0x8000) return;
279 #endif
281 va_list ap;
282 va_start(ap, fmt);
283 vsprintf(out_buf, fmt, ap);
284 RDP (out_buf);
285 va_end(ap);
286 #endif
288 __inline void FRDP_E (const char *fmt, ...)
290 #ifdef RDP_ERROR_LOG
291 if (!dumping || !settings.elogging || !elog_open) return;
293 #ifdef LOGNOTKEY
294 if (GetAsyncKeyState(LOGKEY)&0x8000) return;
295 #endif
297 sprintf (out_buf, "%08x: (%08x, %08x) ", rdp.pc[rdp.pc_i]-8, rdp.cmd0, rdp.cmd1);
298 rdp_err << out_buf;
300 va_list ap2;
301 va_start(ap2, fmt);
302 vsprintf(out_buf, fmt, ap2);
303 // rdp_err << out_buf;
304 // rdp_err.flush();
305 fprintf(stderr, out_buf);
306 va_end(ap2);
307 #endif
310 #else
311 #ifndef GCC
312 #define FRDP(x)
313 #define FRDP_E(x)
314 #else // _WIN32
315 inline void FRDP (const char *fmt, ...) {}
316 inline void FRDP_E (const char *fmt, ...) {}
317 #endif // _WIN32
318 #endif
321 extern BOOL fullscreen;
322 extern BOOL romopen;
323 extern BOOL to_fullscreen;
324 extern BOOL debugging;
325 extern HINSTANCE hInstance;
327 extern BOOL evoodoo;
328 extern BOOL ev_fullscreen;
330 extern BOOL exception;
332 extern PROPSHEETHEADER m_PropSheet;
333 extern PROPSHEETPAGE m_psp[3];
336 BOOL InitGfx (BOOL);
337 void ReleaseGfx ();
338 void DrawFrameBuffer ();
340 // The highest 8 bits are the segment # (1-16), and the lower 24 bits are the offset to
341 // add to it.
342 __inline DWORD segoffset (DWORD so)
344 return (rdp.segment[(so>>24)&0x0f] + (so&BMASK))&BMASK;
347 /* Plugin types */
348 #define PLUGIN_TYPE_GFX 2
350 #define EXPORT __declspec(dllexport)
351 #define CALL _cdecl
353 /***** Structures *****/
354 typedef struct {
355 WORD Version; /* Set to 0x0103 */
356 WORD Type; /* Set to PLUGIN_TYPE_GFX */
357 char Name[100]; /* Name of the DLL */
359 /* If DLL supports memory these memory options then set them to TRUE or FALSE
360 if it does not support it */
361 BOOL NormalMemory; /* a normal BYTE array */
362 BOOL MemoryBswaped; /* a normal BYTE array where the memory has been pre
363 bswap on a dword (32 bits) boundry */
364 } PLUGIN_INFO;
366 typedef struct {
367 HWND hWnd; /* Render window */
368 HWND hStatusBar; /* if render window does not have a status bar then this is NULL */
370 BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
371 // bswap on a dword (32 bits) boundry
372 // eg. the first 8 bytes are stored like this:
373 // 4 3 2 1 8 7 6 5
375 BYTE * HEADER; // This is the rom header (first 40h bytes of the rom
376 // This will be in the same memory format as the rest of the memory.
377 BYTE * RDRAM;
378 BYTE * DMEM;
379 BYTE * IMEM;
381 DWORD * MI_INTR_REG;
383 DWORD * DPC_START_REG;
384 DWORD * DPC_END_REG;
385 DWORD * DPC_CURRENT_REG;
386 DWORD * DPC_STATUS_REG;
387 DWORD * DPC_CLOCK_REG;
388 DWORD * DPC_BUFBUSY_REG;
389 DWORD * DPC_PIPEBUSY_REG;
390 DWORD * DPC_TMEM_REG;
392 DWORD * VI_STATUS_REG;
393 DWORD * VI_ORIGIN_REG;
394 DWORD * VI_WIDTH_REG;
395 DWORD * VI_INTR_REG;
396 DWORD * VI_V_CURRENT_LINE_REG;
397 DWORD * VI_TIMING_REG;
398 DWORD * VI_V_SYNC_REG;
399 DWORD * VI_H_SYNC_REG;
400 DWORD * VI_LEAP_REG;
401 DWORD * VI_H_START_REG;
402 DWORD * VI_V_START_REG;
403 DWORD * VI_V_BURST_REG;
404 DWORD * VI_X_SCALE_REG;
405 DWORD * VI_Y_SCALE_REG;
407 void (*CheckInterrupts)( void );
408 } GFX_INFO;
410 extern GFX_INFO gfx;
411 extern BOOL no_dlist;
413 typedef GrContext_t (FX_CALL *GRWINOPENEXT)( FxU32 hWnd,
414 GrScreenResolution_t resolution,
415 GrScreenRefresh_t refresh,
416 GrColorFormat_t format,
417 GrOriginLocation_t origin,
418 GrPixelFormat_t pixelformat,
419 int nColBuffers,
420 int nAuxBuffers) ;
422 typedef void (FX_CALL *GRTEXBUFFEREXT)( GrChipID_t tmu,
423 FxU32 startAddress,
424 GrLOD_t lodmin,
425 GrLOD_t lodmax,
426 GrAspectRatio_t aspect,
427 GrTextureFormat_t fmt,
428 FxU32 evenOdd) ;
430 typedef void (FX_CALL *GRAUXBUFFEREXT)( GrBuffer_t buffer ) ;
432 typedef void (FX_CALL *GRCOLORCOMBINEEXT) (GrCCUColor_t a,
433 GrCombineMode_t a_mode,
434 GrCCUColor_t b,
435 GrCombineMode_t b_mode,
436 GrCCUColor_t c,
437 FxBool c_invert,
438 GrCCUColor_t d,
439 FxBool d_invert,
440 FxU32 shift,
441 FxBool invert) ;
443 typedef void (FX_CALL *GRTEXCOLORCOMBINEEXT) (GrChipID_t tmu,
444 GrTCCUColor_t a,
445 GrCombineMode_t a_mode,
446 GrTCCUColor_t b,
447 GrCombineMode_t b_mode,
448 GrTCCUColor_t c,
449 FxBool c_invert,
450 GrTCCUColor_t d,
451 FxBool d_invert,
452 FxU32 shift,
453 FxBool invert);
455 typedef void (FX_CALL *GRCONSTANTCOLORVALUEEXT)
456 (GrChipID_t tmu,
457 GrColor_t value);
459 typedef void (FX_CALL *GRSTIPPLE)( FxI32 mode) ;
461 typedef void (FX_CALL *GRCONFIGWRAPPEREXT)(HINSTANCE instance, HWND hwnd);
463 typedef GrScreenResolution_t (FX_CALL *GRWRAPPERFULLSCREENRESOLUTIONEXT)();
465 // ZIGGY framebuffer copy extension
466 // allow to copy the depth or color buffer from back/front to front/back
467 // (GL has separate back and front depth buffer, unlike glide, so this extension
468 // makes sense only in a wrapper)
469 #define GR_FBCOPY_MODE_DEPTH 0
470 #define GR_FBCOPY_MODE_COLOR 1
471 #define GR_FBCOPY_BUFFER_BACK 0
472 #define GR_FBCOPY_BUFFER_FRONT 1
473 typedef void (FX_CALL *GRFRAMEBUFFERCOPYEXT)(int x, int y, int w, int h,
474 int buffer_from, int buffer_to, int mode);
476 extern GRFRAMEBUFFERCOPYEXT grFramebufferCopyExt;
478 extern GRTEXBUFFEREXT grTextureBufferExt;
479 extern GRTEXBUFFEREXT grTextureAuxBufferExt;
480 extern GRAUXBUFFEREXT grAuxBufferExt;
481 extern GRSTIPPLE grStippleModeExt;
482 extern GRSTIPPLE grStipplePatternExt;
484 #ifndef GR_STIPPLE_DISABLE
485 #define GR_STIPPLE_DISABLE 0x0
486 #define GR_STIPPLE_PATTERN 0x1
487 #define GR_STIPPLE_ROTATE 0x2
488 #endif
490 void ReadSettings ();
491 void ReadSpecialSettings (char name[21]);
492 void WriteSettings ();
494 /******************************************************************
495 Function: CaptureScreen
496 Purpose: This function dumps the current frame to a file
497 input: pointer to the directory to save the file to
498 output: none
499 *******************************************************************/
500 EXPORT void CALL CaptureScreen ( char * Directory );
502 /******************************************************************
503 Function: ChangeWindow
504 Purpose: to change the window between fullscreen and window
505 mode. If the window was in fullscreen this should
506 change the screen to window mode and vice vesa.
507 input: none
508 output: none
509 *******************************************************************/
510 EXPORT void CALL ChangeWindow (void);
512 /******************************************************************
513 Function: CloseDLL
514 Purpose: This function is called when the emulator is closing
515 down allowing the dll to de-initialise.
516 input: none
517 output: none
518 *******************************************************************/
519 EXPORT void CALL CloseDLL (void);
521 /******************************************************************
522 Function: DllAbout
523 Purpose: This function is optional function that is provided
524 to give further information about the DLL.
525 input: a handle to the window that calls this function
526 output: none
527 *******************************************************************/
528 EXPORT void CALL DllAbout ( HWND hParent );
530 /******************************************************************
531 Function: DllConfig
532 Purpose: This function is optional function that is provided
533 to allow the user to configure the dll
534 input: a handle to the window that calls this function
535 output: none
536 *******************************************************************/
537 EXPORT void CALL DllConfig ( HWND hParent );
539 /******************************************************************
540 Function: DllTest
541 Purpose: This function is optional function that is provided
542 to allow the user to test the dll
543 input: a handle to the window that calls this function
544 output: none
545 *******************************************************************/
546 EXPORT void CALL DllTest ( HWND hParent );
549 EXPORT void CALL ReadScreen(void **dest, long *width, long *height);
551 /******************************************************************
552 Function: DrawScreen
553 Purpose: This function is called when the emulator receives a
554 WM_PAINT message. This allows the gfx to fit in when
555 it is being used in the desktop.
556 input: none
557 output: none
558 *******************************************************************/
559 EXPORT void CALL DrawScreen (void);
561 /******************************************************************
562 Function: GetDllInfo
563 Purpose: This function allows the emulator to gather information
564 about the dll by filling in the PluginInfo structure.
565 input: a pointer to a PLUGIN_INFO stucture that needs to be
566 filled by the function. (see def above)
567 output: none
568 *******************************************************************/
569 EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo );
571 /******************************************************************
572 Function: InitiateGFX
573 Purpose: This function is called when the DLL is started to give
574 information from the emulator that the n64 graphics
575 uses. This is not called from the emulation thread.
576 Input: Gfx_Info is passed to this function which is defined
577 above.
578 Output: TRUE on success
579 FALSE on failure to initialise
581 ** note on interrupts **:
582 To generate an interrupt set the appropriate bit in MI_INTR_REG
583 and then call the function CheckInterrupts to tell the emulator
584 that there is a waiting interrupt.
585 *******************************************************************/
586 EXPORT BOOL CALL InitiateGFX (GFX_INFO Gfx_Info);
588 /******************************************************************
589 Function: MoveScreen
590 Purpose: This function is called in response to the emulator
591 receiving a WM_MOVE passing the xpos and ypos passed
592 from that message.
593 input: xpos - the x-coordinate of the upper-left corner of the
594 client area of the window.
595 ypos - y-coordinate of the upper-left corner of the
596 client area of the window.
597 output: none
598 *******************************************************************/
599 EXPORT void CALL MoveScreen (int xpos, int ypos);
601 /******************************************************************
602 Function: ProcessDList
603 Purpose: This function is called when there is a Dlist to be
604 processed. (High level GFX list)
605 input: none
606 output: none
607 *******************************************************************/
608 EXPORT void CALL ProcessDList(void);
610 /******************************************************************
611 Function: ProcessRDPList
612 Purpose: This function is called when there is a Dlist to be
613 processed. (Low level GFX list)
614 input: none
615 output: none
616 *******************************************************************/
617 EXPORT void CALL ProcessRDPList(void);
619 /******************************************************************
620 Function: RomClosed
621 Purpose: This function is called when a rom is closed.
622 input: none
623 output: none
624 *******************************************************************/
625 EXPORT void CALL RomClosed (void);
627 /******************************************************************
628 Function: RomOpen
629 Purpose: This function is called when a rom is open. (from the
630 emulation thread)
631 input: none
632 output: none
633 *******************************************************************/
634 EXPORT void CALL RomOpen (void);
636 /******************************************************************
637 Function: ShowCFB
638 Purpose: Useally once Dlists are started being displayed, cfb is
639 ignored. This function tells the dll to start displaying
640 them again.
641 input: none
642 output: none
643 *******************************************************************/
644 EXPORT void CALL ShowCFB (void);
646 /******************************************************************
647 Function: UpdateScreen
648 Purpose: This function is called in response to a vsync of the
649 screen were the VI bit in MI_INTR_REG has already been
651 input: none
652 output: none
653 *******************************************************************/
654 EXPORT void CALL UpdateScreen (void);
656 /******************************************************************
657 Function: ViStatusChanged
658 Purpose: This function is called to notify the dll that the
659 ViStatus registers value has been changed.
660 input: none
661 output: none
662 *******************************************************************/
663 EXPORT void CALL ViStatusChanged (void);
665 /******************************************************************
666 Function: ViWidthChanged
667 Purpose: This function is called to notify the dll that the
668 ViWidth registers value has been changed.
669 input: none
670 output: none
671 *******************************************************************/
672 EXPORT void CALL ViWidthChanged (void);
675 /******************************************************************
676 Function: FrameBufferWrite
677 Purpose: This function is called to notify the dll that the
678 frame buffer has been modified by CPU at the given address.
679 input: addr rdram address
680 val val
681 size 1 = BYTE, 2 = WORD, 4 = DWORD
682 output: none
683 *******************************************************************/
684 EXPORT void CALL FBWrite(DWORD, DWORD);
686 typedef struct
688 DWORD addr;
689 DWORD val;
690 DWORD size; // 1 = BYTE, 2 = WORD, 4=DWORD
691 } FrameBufferModifyEntry;
693 /******************************************************************
694 Function: FrameBufferWriteList
695 Purpose: This function is called to notify the dll that the
696 frame buffer has been modified by CPU at the given address.
697 input: FrameBufferModifyEntry *plist
698 size = size of the plist, max = 1024
699 output: none
700 *******************************************************************/
701 EXPORT void CALL FBWList(FrameBufferModifyEntry *plist, DWORD size);
703 /******************************************************************
704 Function: FrameBufferRead
705 Purpose: This function is called to notify the dll that the
706 frame buffer memory is beening read at the given address.
707 DLL should copy content from its render buffer to the frame buffer
708 in N64 RDRAM
709 DLL is responsible to maintain its own frame buffer memory addr list
710 DLL should copy 4KB block content back to RDRAM frame buffer.
711 Emulator should not call this function again if other memory
712 is read within the same 4KB range
713 input: addr rdram address
714 val val
715 size 1 = BYTE, 2 = WORD, 4 = DWORD
716 output: none
717 *******************************************************************/
718 EXPORT void CALL FBRead(DWORD addr);
720 /************************************************************************
721 Function: FBGetFrameBufferInfo
722 Purpose: This function is called by the emulator core to retrieve depth
723 buffer information from the video plugin in order to be able
724 to notify the video plugin about CPU depth buffer read/write
725 operations
727 size:
728 = 1 byte
729 = 2 word (16 bit) <-- this is N64 default depth buffer format
730 = 4 dword (32 bit)
732 when depth buffer information is not available yet, set all values
733 in the FrameBufferInfo structure to 0
735 input: FrameBufferInfo *pinfo
736 pinfo is pointed to a FrameBufferInfo structure which to be
737 filled in by this function
738 output: Values are return in the FrameBufferInfo structure
739 ************************************************************************/
740 EXPORT void CALL FBGetFrameBufferInfo(void *pinfo);
742 /******************************************************************
743 NOTE: THIS HAS BEEN ADDED FOR MUPEN64PLUS AND IS NOT PART OF THE
744 ORIGINAL SPEC
745 Function: SetConfigDir
746 Purpose: To pass the location where config files should be read/
747 written to.
748 input: path to config directory
749 output: none
750 *******************************************************************/
751 EXPORT void CALL SetConfigDir( char *configDir );
753 #if defined(__cplusplus)
755 #endif
756 #endif //_GFX_H_INCLUDED__