[Plugins] Give access to notify class
This commit is contained in:
parent
59a51e2c71
commit
0c1c5e39af
|
@ -47,6 +47,7 @@
|
||||||
#include <png/png.h>
|
#include <png/png.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <Common/SmartPointer.h>
|
#include <Common/SmartPointer.h>
|
||||||
|
#include <Settings/Settings.h>
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
@ -84,7 +85,6 @@ int ev_fullscreen = 0;
|
||||||
extern int g_viewport_offset;
|
extern int g_viewport_offset;
|
||||||
extern int g_width, g_height;
|
extern int g_width, g_height;
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HINSTANCE hinstDLL = NULL;
|
HINSTANCE hinstDLL = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@ -520,11 +520,7 @@ int InitGfx()
|
||||||
gfx_context = grSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
|
gfx_context = grSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
|
||||||
if (!gfx_context)
|
if (!gfx_context)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
g_Notify->DisplayError("Error setting display mode");
|
||||||
MessageBox(gfx.hWnd, "Error setting display mode", "Error", MB_OK | MB_ICONEXCLAMATION);
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "Error setting display mode\n");
|
|
||||||
#endif
|
|
||||||
grGlideShutdown();
|
grGlideShutdown();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -710,7 +706,7 @@ int InitGfx()
|
||||||
voodoo.sup_mirroring = 1;
|
voodoo.sup_mirroring = 1;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReleaseGfx()
|
void ReleaseGfx()
|
||||||
{
|
{
|
||||||
|
@ -1074,7 +1070,7 @@ void CALL RomClosed(void)
|
||||||
if (evoodoo)
|
if (evoodoo)
|
||||||
{
|
{
|
||||||
ReleaseGfx();
|
ReleaseGfx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CheckDRAMSize()
|
static void CheckDRAMSize()
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include <Common/StdString.h>
|
#include <Common/StdString.h>
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
#include "SettingsID.h"
|
#include "SettingsID.h"
|
||||||
|
#include <Settings/Settings.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <Common/CriticalSection.h>
|
#include <Common/CriticalSection.h>
|
||||||
|
@ -305,12 +306,12 @@ void microcheck()
|
||||||
|
|
||||||
#ifdef LOG_UCODE
|
#ifdef LOG_UCODE
|
||||||
std::ofstream ucf;
|
std::ofstream ucf;
|
||||||
ucf.open ("ucode.txt", std::ios::out | std::ios::binary);
|
ucf.open("ucode.txt", std::ios::out | std::ios::binary);
|
||||||
char d;
|
char d;
|
||||||
for (i=0; i<0x400000; i++)
|
for (i = 0; i < 0x400000; i++)
|
||||||
{
|
{
|
||||||
d = ((char*)gfx.RDRAM)[i^3];
|
d = ((char*)gfx.RDRAM)[i ^ 3];
|
||||||
ucf.write (&d, 1);
|
ucf.write(&d, 1);
|
||||||
}
|
}
|
||||||
ucf.close();
|
ucf.close();
|
||||||
#endif
|
#endif
|
||||||
|
@ -324,9 +325,7 @@ void microcheck()
|
||||||
{
|
{
|
||||||
ReleaseGfx();
|
ReleaseGfx();
|
||||||
WriteTrace(TraceGlide64, TraceError, "uCode crc not found in INI, using currently selected uCode %08lx", (unsigned long)uc_crc);
|
WriteTrace(TraceGlide64, TraceError, "uCode crc not found in INI, using currently selected uCode %08lx", (unsigned long)uc_crc);
|
||||||
#ifdef _WIN32
|
g_Notify->DisplayError(stdstr_f("Error: uCode crc not found in INI, using currently selected uCode\n\n%08lx", uc_crc).c_str());
|
||||||
MessageBox(gfx.hWnd, stdstr_f("Error: uCode crc not found in INI, using currently selected uCode\n\n%08lx", uc_crc).c_str(), "Error", MB_OK | MB_ICONEXCLAMATION);
|
|
||||||
#endif
|
|
||||||
g_ucode_error_report = false; // don't report any more ucode errors from this game
|
g_ucode_error_report = false; // don't report any more ucode errors from this game
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,9 +335,7 @@ void microcheck()
|
||||||
{
|
{
|
||||||
ReleaseGfx();
|
ReleaseGfx();
|
||||||
WriteTrace(TraceGlide64, TraceError, "Unsupported uCode! crc: %08lx", (unsigned long)uc_crc);
|
WriteTrace(TraceGlide64, TraceError, "Unsupported uCode! crc: %08lx", (unsigned long)uc_crc);
|
||||||
#ifdef _WIN32
|
g_Notify->DisplayError(stdstr_f("Error: Unsupported uCode!\n\ncrc: %08lx", uc_crc).c_str());
|
||||||
MessageBox(gfx.hWnd, stdstr_f("Error: Unsupported uCode!\n\ncrc: %08lx", uc_crc).c_str(), "Error", MB_OK | MB_ICONEXCLAMATION);
|
|
||||||
#endif
|
|
||||||
g_ucode_error_report = FALSE; // don't report any more ucode errors from this game
|
g_ucode_error_report = FALSE; // don't report any more ucode errors from this game
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -735,7 +732,7 @@ EXPORT void CALL ProcessDList(void)
|
||||||
catch (...) {
|
catch (...) {
|
||||||
if (g_fullscreen)
|
if (g_fullscreen)
|
||||||
{
|
{
|
||||||
ReleaseGfx ();
|
ReleaseGfx();
|
||||||
rdp_reset();
|
rdp_reset();
|
||||||
if (g_ghq_use)
|
if (g_ghq_use)
|
||||||
{
|
{
|
||||||
|
@ -743,14 +740,8 @@ EXPORT void CALL ProcessDList(void)
|
||||||
g_ghq_use = false;
|
g_ghq_use = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MessageBox(gfx.hWnd, "The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?","Glide64 Exception", MB_YESNO|MB_ICONEXCLAMATION) == MB_NO)
|
DisplayError("The GFX plugin caused an exception and has been disabled");
|
||||||
{
|
|
||||||
exception = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
to_fullscreen = TRUE;
|
to_fullscreen = TRUE;
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -759,7 +750,7 @@ EXPORT void CALL ProcessDList(void)
|
||||||
{
|
{
|
||||||
rdp.scale_x = rdp.scale_x_bak;
|
rdp.scale_x = rdp.scale_x_bak;
|
||||||
rdp.scale_y = rdp.scale_y_bak;
|
rdp.scale_y = rdp.scale_y_bak;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_settings->hacks(CSettings::hack_OoT))
|
if (g_settings->hacks(CSettings::hack_OoT))
|
||||||
{
|
{
|
||||||
|
@ -781,7 +772,7 @@ EXPORT void CALL ProcessDList(void)
|
||||||
CI_SET = FALSE;
|
CI_SET = FALSE;
|
||||||
}
|
}
|
||||||
WriteTrace(TraceRDP, TraceDebug, "ProcessDList end");
|
WriteTrace(TraceRDP, TraceDebug, "ProcessDList end");
|
||||||
}
|
}
|
||||||
|
|
||||||
// undef - undefined instruction, always ignore
|
// undef - undefined instruction, always ignore
|
||||||
static void undef()
|
static void undef()
|
||||||
|
|
|
@ -216,34 +216,6 @@ void display_warning(const char *text, ...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
void display_error()
|
|
||||||
{
|
|
||||||
LPVOID lpMsgBuf;
|
|
||||||
if (!FormatMessage(
|
|
||||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
|
||||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
|
||||||
NULL,
|
|
||||||
GetLastError(),
|
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
|
||||||
(LPTSTR)&lpMsgBuf,
|
|
||||||
0,
|
|
||||||
NULL))
|
|
||||||
{
|
|
||||||
// Handle the error.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Process any inserts in lpMsgBuf.
|
|
||||||
// ...
|
|
||||||
// Display the string.
|
|
||||||
MessageBox(NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION);
|
|
||||||
|
|
||||||
// Free the buffer.
|
|
||||||
LocalFree(lpMsgBuf);
|
|
||||||
}
|
|
||||||
#endif // _WIN32
|
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grSstOrigin(GrOriginLocation_t origin)
|
grSstOrigin(GrOriginLocation_t origin)
|
||||||
{
|
{
|
||||||
|
@ -380,7 +352,7 @@ FX_ENTRY GrContext_t FX_CALL grSstWinOpenExt(GrColorFormat_t color_format, GrOri
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FX_ENTRY GrContext_t FX_CALL grSstWinOpen( GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
|
FX_ENTRY GrContext_t FX_CALL grSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
|
||||||
{
|
{
|
||||||
static int show_warning = 1;
|
static int show_warning = 1;
|
||||||
|
|
||||||
|
@ -988,12 +960,12 @@ int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTextureAuxBufferExt(GrChipID_t tmu,
|
grTextureAuxBufferExt(GrChipID_t tmu,
|
||||||
FxU32 startAddress,
|
FxU32 startAddress,
|
||||||
GrLOD_t thisLOD,
|
GrLOD_t thisLOD,
|
||||||
GrLOD_t largeLOD,
|
GrLOD_t largeLOD,
|
||||||
GrAspectRatio_t aspectRatio,
|
GrAspectRatio_t aspectRatio,
|
||||||
GrTextureFormat_t format,
|
GrTextureFormat_t format,
|
||||||
FxU32 odd_even_mask)
|
FxU32 odd_even_mask)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d startAddress: %d thisLOD: %d largeLOD: %d aspectRatio: %d format: %d odd_even_mask: %d", tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
|
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d startAddress: %d thisLOD: %d largeLOD: %d aspectRatio: %d format: %d odd_even_mask: %d", tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
|
||||||
//WriteTrace(TraceGlitch, TraceWarning, "grTextureAuxBufferExt");
|
//WriteTrace(TraceGlitch, TraceWarning, "grTextureAuxBufferExt");
|
||||||
|
@ -1623,14 +1595,14 @@ grBufferSwap(FxU32 swap_interval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// frame buffer
|
// frame buffer
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grLfbLock(GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
|
grLfbLock(GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
|
||||||
GrOriginLocation_t origin, FxBool pixelPipeline,
|
GrOriginLocation_t origin, FxBool pixelPipeline,
|
||||||
GrLfbInfo_t *info)
|
GrLfbInfo_t *info)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
|
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
|
||||||
if (type == GR_LFB_WRITE_ONLY)
|
if (type == GR_LFB_WRITE_ONLY)
|
||||||
|
@ -1694,7 +1666,7 @@ GrLfbInfo_t *info)
|
||||||
info->origin = origin;
|
info->origin = origin;
|
||||||
glReadPixels(0, g_viewport_offset, g_width, g_height, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, depthBuffer);
|
glReadPixels(0, g_viewport_offset, g_width, g_height, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, depthBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FXTRUE;
|
return FXTRUE;
|
||||||
}
|
}
|
||||||
|
@ -1712,9 +1684,9 @@ grLfbUnlock(GrLock_t type, GrBuffer_t buffer)
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grLfbReadRegion(GrBuffer_t src_buffer,
|
grLfbReadRegion(GrBuffer_t src_buffer,
|
||||||
FxU32 src_x, FxU32 src_y,
|
FxU32 src_x, FxU32 src_y,
|
||||||
FxU32 src_width, FxU32 src_height,
|
FxU32 src_width, FxU32 src_height,
|
||||||
FxU32 dst_stride, void *dst_data)
|
FxU32 dst_stride, void *dst_data)
|
||||||
{
|
{
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
@ -1777,11 +1749,11 @@ FxU32 dst_stride, void *dst_data)
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grLfbWriteRegion(GrBuffer_t dst_buffer,
|
grLfbWriteRegion(GrBuffer_t dst_buffer,
|
||||||
FxU32 dst_x, FxU32 dst_y,
|
FxU32 dst_x, FxU32 dst_y,
|
||||||
GrLfbSrcFmt_t src_format,
|
GrLfbSrcFmt_t src_format,
|
||||||
FxU32 src_width, FxU32 src_height,
|
FxU32 src_width, FxU32 src_height,
|
||||||
FxBool pixelPipeline,
|
FxBool pixelPipeline,
|
||||||
FxI32 src_stride, void *src_data)
|
FxI32 src_stride, void *src_data)
|
||||||
{
|
{
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
@ -1886,7 +1858,7 @@ FxI32 src_stride, void *src_data)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float *buf = (float*)malloc(src_width*(src_height + (g_viewport_offset))*sizeof(float));
|
float *buf = (float*)malloc(src_width*(src_height + (g_viewport_offset)) * sizeof(float));
|
||||||
|
|
||||||
if (src_format != GR_LFBWRITEMODE_ZA16)
|
if (src_format != GR_LFBWRITEMODE_ZA16)
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer write format:%x", src_format);
|
WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer write format:%x", src_format);
|
||||||
|
@ -1927,7 +1899,7 @@ FxI32 src_stride, void *src_data)
|
||||||
//glDrawPixels(src_width, src_height+(g_viewport_offset), GL_DEPTH_COMPONENT, GL_FLOAT, buf);
|
//glDrawPixels(src_width, src_height+(g_viewport_offset), GL_DEPTH_COMPONENT, GL_FLOAT, buf);
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
//glDrawBuffer(current_buffer);
|
//glDrawBuffer(current_buffer);
|
||||||
//glPopAttrib();
|
//glPopAttrib();
|
||||||
return FXTRUE;
|
return FXTRUE;
|
||||||
|
@ -2035,46 +2007,46 @@ grFlush(void)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexMultibase(GrChipID_t tmu,
|
grTexMultibase(GrChipID_t tmu,
|
||||||
FxBool enable)
|
FxBool enable)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibase");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibase");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexMipMapMode(GrChipID_t tmu,
|
grTexMipMapMode(GrChipID_t tmu,
|
||||||
GrMipMapMode_t mode,
|
GrMipMapMode_t mode,
|
||||||
FxBool lodBlend)
|
FxBool lodBlend)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexMipMapMode");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexMipMapMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexDownloadTablePartial(GrTexTable_t type,
|
grTexDownloadTablePartial(GrTexTable_t type,
|
||||||
void *data,
|
void *data,
|
||||||
int start,
|
int start,
|
||||||
int end)
|
int end)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTablePartial");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTablePartial");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexDownloadTable(GrTexTable_t type,
|
grTexDownloadTable(GrTexTable_t type,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTable");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTable");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grTexDownloadMipMapLevelPartial(GrChipID_t tmu,
|
grTexDownloadMipMapLevelPartial(GrChipID_t tmu,
|
||||||
FxU32 startAddress,
|
FxU32 startAddress,
|
||||||
GrLOD_t thisLod,
|
GrLOD_t thisLod,
|
||||||
GrLOD_t largeLod,
|
GrLOD_t largeLod,
|
||||||
GrAspectRatio_t aspectRatio,
|
GrAspectRatio_t aspectRatio,
|
||||||
GrTextureFormat_t format,
|
GrTextureFormat_t format,
|
||||||
FxU32 evenOdd,
|
FxU32 evenOdd,
|
||||||
void *data,
|
void *data,
|
||||||
int start,
|
int start,
|
||||||
int end)
|
int end)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevelPartial");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevelPartial");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2082,13 +2054,13 @@ int end)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexDownloadMipMapLevel(GrChipID_t tmu,
|
grTexDownloadMipMapLevel(GrChipID_t tmu,
|
||||||
FxU32 startAddress,
|
FxU32 startAddress,
|
||||||
GrLOD_t thisLod,
|
GrLOD_t thisLod,
|
||||||
GrLOD_t largeLod,
|
GrLOD_t largeLod,
|
||||||
GrAspectRatio_t aspectRatio,
|
GrAspectRatio_t aspectRatio,
|
||||||
GrTextureFormat_t format,
|
GrTextureFormat_t format,
|
||||||
FxU32 evenOdd,
|
FxU32 evenOdd,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevel");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevel");
|
||||||
}
|
}
|
||||||
|
@ -2126,8 +2098,8 @@ grSelectContext(GrContext_t context)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grAADrawTriangle(
|
grAADrawTriangle(
|
||||||
const void *a, const void *b, const void *c,
|
const void *a, const void *b, const void *c,
|
||||||
FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
|
FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grAADrawTriangle");
|
WriteTrace(TraceGlitch, TraceWarning, "grAADrawTriangle");
|
||||||
|
@ -2189,10 +2161,10 @@ grLfbConstantAlpha(GrAlpha_t alpha)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexMultibaseAddress(GrChipID_t tmu,
|
grTexMultibaseAddress(GrChipID_t tmu,
|
||||||
GrTexBaseRange_t range,
|
GrTexBaseRange_t range,
|
||||||
FxU32 startAddress,
|
FxU32 startAddress,
|
||||||
FxU32 evenOdd,
|
FxU32 evenOdd,
|
||||||
GrTexInfo *info)
|
GrTexInfo *info)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibaseAddress");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibaseAddress");
|
||||||
}
|
}
|
||||||
|
@ -2384,7 +2356,7 @@ void CHECK_FRAMEBUFFER_STATUS(void)
|
||||||
GLenum status;
|
GLenum status;
|
||||||
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "status: %X", status);
|
WriteTrace(TraceGlitch, TraceDebug, "status: %X", status);
|
||||||
switch(status) {
|
switch (status) {
|
||||||
case GL_FRAMEBUFFER_COMPLETE:
|
case GL_FRAMEBUFFER_COMPLETE:
|
||||||
/*WriteTrace(TraceGlitch, TraceWarning, "framebuffer complete!\n");*/
|
/*WriteTrace(TraceGlitch, TraceWarning, "framebuffer complete!\n");*/
|
||||||
break;
|
break;
|
||||||
|
@ -2406,5 +2378,5 @@ void CHECK_FRAMEBUFFER_STATUS(void)
|
||||||
break;
|
break;
|
||||||
/* programming error; will fail on all hardware */
|
/* programming error; will fail on all hardware */
|
||||||
/*assert(0);*/
|
/*assert(0);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* `GetSystemSetting` and `FindSystemSettingId` from Project64 debugger
|
* `GetSystemSetting` and `FindSystemSettingId` from Project64 debugger
|
||||||
* used only in DisplayError when OpenGL extension loading fails on WGL
|
* used only in g_Notify->DisplayError when OpenGL extension loading fails on WGL
|
||||||
*/
|
*/
|
||||||
#include <Settings/Settings.h>
|
#include <Settings/Settings.h>
|
||||||
|
|
||||||
|
@ -78,39 +78,31 @@ static inline void opt_glCopyTexImage2D(GLenum target,
|
||||||
* displaying error information showing the missing OpenGL support.
|
* displaying error information showing the missing OpenGL support.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void DisplayError(const char * message)
|
|
||||||
{
|
|
||||||
if (GetSystemSetting(FindSystemSettingId("Debugger")) == 0)
|
|
||||||
return;
|
|
||||||
MessageBoxA(NULL, message, NULL, MB_ICONERROR);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
|
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
|
||||||
PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
|
PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
|
||||||
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
|
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
|
||||||
PFNGLFOGCOORDFPROC glFogCoordfEXT;
|
PFNGLFOGCOORDFPROC glFogCoordfEXT;
|
||||||
void APIENTRY dummy_glActiveTexture(GLenum/*texture*/)
|
void APIENTRY dummy_glActiveTexture(GLenum/*texture*/)
|
||||||
{ /* GLX render opcode 197, req. OpenGL 1.3 (1.2 w/ ARB_multitexture) */
|
{ /* GLX render opcode 197, req. OpenGL 1.3 (1.2 w/ ARB_multitexture) */
|
||||||
DisplayError("glActiveTexture");
|
g_Notify->DisplayError("glActiveTexture");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glMultiTexCoord2f(GLenum/*target*/, GLfloat/*s*/, GLfloat/*t*/)
|
void APIENTRY dummy_glMultiTexCoord2f(GLenum/*target*/, GLfloat/*s*/, GLfloat/*t*/)
|
||||||
{ /* GLX render opcode 203, req. OpenGL 1.3 (1.2 w/ ARB_multitexture) */
|
{ /* GLX render opcode 203, req. OpenGL 1.3 (1.2 w/ ARB_multitexture) */
|
||||||
DisplayError("glMultiTexCoord2f");
|
g_Notify->DisplayError("glMultiTexCoord2f");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glFogCoordf(GLfloat/*coord*/)
|
void APIENTRY dummy_glFogCoordf(GLfloat/*coord*/)
|
||||||
{ /* GLX render opcode 4124, req. OpenGL 1.4 (1.1 w/ EXT_fog_coord) */
|
{ /* GLX render opcode 4124, req. OpenGL 1.4 (1.1 w/ EXT_fog_coord) */
|
||||||
DisplayError("glFogCoordf");
|
g_Notify->DisplayError("glFogCoordf");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum)
|
void APIENTRY dummy_glBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum)
|
||||||
{ /* GLX render opcode 4134, req. OpenGL 1.0 w/ EXT_blend_func_separate */
|
{ /* GLX render opcode 4134, req. OpenGL 1.0 w/ EXT_blend_func_separate */
|
||||||
DisplayError("glBlendFuncSeparate");
|
g_Notify->DisplayError("glBlendFuncSeparate");
|
||||||
}
|
}
|
||||||
|
|
||||||
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
|
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
|
||||||
const char * APIENTRY dummy_wglGetExtensionsString(HDC)
|
const char * APIENTRY dummy_wglGetExtensionsString(HDC)
|
||||||
{
|
{
|
||||||
DisplayError("wglGetExtensionsString");
|
g_Notify->DisplayError("wglGetExtensionsString");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,44 +118,44 @@ PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
|
||||||
PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
|
PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
|
||||||
void APIENTRY dummy_glGenRenderbuffers(GLsizei/*n*/, GLuint* /*renderbuffers*/)
|
void APIENTRY dummy_glGenRenderbuffers(GLsizei/*n*/, GLuint* /*renderbuffers*/)
|
||||||
{ /* GLX vendor opcode 1423, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX vendor opcode 1423, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glGenRenderbuffers");
|
g_Notify->DisplayError("glGenRenderbuffers");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glGenFramebuffers(GLsizei/*n*/, GLuint* /*framebuffers*/)
|
void APIENTRY dummy_glGenFramebuffers(GLsizei/*n*/, GLuint* /*framebuffers*/)
|
||||||
{ /* GLX vendor opcode 1426, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX vendor opcode 1426, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glGenFramebuffers");
|
g_Notify->DisplayError("glGenFramebuffers");
|
||||||
}
|
}
|
||||||
GLenum APIENTRY dummy_glCheckFramebufferStatus(GLenum/*target*/)
|
GLenum APIENTRY dummy_glCheckFramebufferStatus(GLenum/*target*/)
|
||||||
{ /* GLX vendor opcode 1427, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX vendor opcode 1427, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glCheckFramebufferStatus");
|
g_Notify->DisplayError("glCheckFramebufferStatus");
|
||||||
return 0x00008CDD; /* GL_FRAMEBUFFER_UNSUPPORTED */
|
return 0x00008CDD; /* GL_FRAMEBUFFER_UNSUPPORTED */
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glBindRenderbuffer(GLenum/*target*/, GLuint/*renderbuffer*/)
|
void APIENTRY dummy_glBindRenderbuffer(GLenum/*target*/, GLuint/*renderbuffer*/)
|
||||||
{ /* GLX render opcode 4316, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4316, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glBindRenderbuffer");
|
g_Notify->DisplayError("glBindRenderbuffer");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glDeleteRenderbuffers(GLsizei/*n*/, const GLuint* /*renderbuffers*/)
|
void APIENTRY dummy_glDeleteRenderbuffers(GLsizei/*n*/, const GLuint* /*renderbuffers*/)
|
||||||
{ /* GLX render opcode 4317, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4317, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glDeleteRenderbuffers");
|
g_Notify->DisplayError("glDeleteRenderbuffers");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glRenderbufferStorage(GLenum, GLenum, GLsizei, GLsizei)
|
void APIENTRY dummy_glRenderbufferStorage(GLenum, GLenum, GLsizei, GLsizei)
|
||||||
{ /* GLX render opcode 4318, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4318, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glRenderbufferStorage");
|
g_Notify->DisplayError("glRenderbufferStorage");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glBindFramebuffer(GLenum/*target*/, GLuint/*framebuffer*/)
|
void APIENTRY dummy_glBindFramebuffer(GLenum/*target*/, GLuint/*framebuffer*/)
|
||||||
{ /* GLX render opcode 4319, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4319, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glBindFramebuffer");
|
g_Notify->DisplayError("glBindFramebuffer");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glDeleteFramebuffers(GLsizei/*n*/, const GLuint* /*framebuffers*/)
|
void APIENTRY dummy_glDeleteFramebuffers(GLsizei/*n*/, const GLuint* /*framebuffers*/)
|
||||||
{ /* GLX render opcode 4320, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4320, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glDeleteFramebuffers");
|
g_Notify->DisplayError("glDeleteFramebuffers");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glFramebufferTexture2D(GLenum, GLenum, GLenum, GLuint, GLint)
|
void APIENTRY dummy_glFramebufferTexture2D(GLenum, GLenum, GLenum, GLuint, GLint)
|
||||||
{ /* GLX render opcode 4322, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4322, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glFramebufferTexture2D");
|
g_Notify->DisplayError("glFramebufferTexture2D");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glFramebufferRenderbuffer(GLenum, GLenum, GLenum, GLuint)
|
void APIENTRY dummy_glFramebufferRenderbuffer(GLenum, GLenum, GLenum, GLuint)
|
||||||
{ /* GLX render opcode 4324, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
{ /* GLX render opcode 4324, req. OpenGL 1.2 w/ EXT_framebuffer_object */
|
||||||
DisplayError("glFramebufferRenderbuffer");
|
g_Notify->DisplayError("glFramebufferRenderbuffer");
|
||||||
}
|
}
|
||||||
|
|
||||||
PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
|
PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
|
||||||
|
@ -184,70 +176,70 @@ PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
|
||||||
PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f;
|
PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f;
|
||||||
void APIENTRY dummy_glSecondaryColor3f(GLfloat/*red*/, GLfloat/*green*/, GLfloat/*blue*/)
|
void APIENTRY dummy_glSecondaryColor3f(GLfloat/*red*/, GLfloat/*green*/, GLfloat/*blue*/)
|
||||||
{ /* GLX render opcode 4129, req. OpenGL 1.4 (1.1 w/ EXT_secondary_color) */
|
{ /* GLX render opcode 4129, req. OpenGL 1.4 (1.1 w/ EXT_secondary_color) */
|
||||||
DisplayError("glSecondaryColor3f");
|
g_Notify->DisplayError("glSecondaryColor3f");
|
||||||
}
|
}
|
||||||
GLuint APIENTRY dummy_glCreateShader(GLenum/*type*/)
|
GLuint APIENTRY dummy_glCreateShader(GLenum/*type*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glCreateShader");
|
g_Notify->DisplayError("glCreateShader");
|
||||||
return ((GLuint)(NULL));
|
return ((GLuint)(NULL));
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glShaderSource(GLuint, GLsizei, const GLchar **, GLint *)
|
void APIENTRY dummy_glShaderSource(GLuint, GLsizei, const GLchar **, GLint *)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glShaderSource");
|
g_Notify->DisplayError("glShaderSource");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glCompileShader(GLuint/*shader*/)
|
void APIENTRY dummy_glCompileShader(GLuint/*shader*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glCompileShader");
|
g_Notify->DisplayError("glCompileShader");
|
||||||
}
|
}
|
||||||
GLuint APIENTRY dummy_glCreateProgram(void)
|
GLuint APIENTRY dummy_glCreateProgram(void)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glCreateProgram");
|
g_Notify->DisplayError("glCreateProgram");
|
||||||
return ((GLuint)(NULL));
|
return ((GLuint)(NULL));
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glAttachObject(GLhandleARB, GLhandleARB)
|
void APIENTRY dummy_glAttachObject(GLhandleARB, GLhandleARB)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glAttachObject");
|
g_Notify->DisplayError("glAttachObject");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glLinkProgram(GLuint/*program*/)
|
void APIENTRY dummy_glLinkProgram(GLuint/*program*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glLinkProgram");
|
g_Notify->DisplayError("glLinkProgram");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glUseProgram(GLuint/*program*/)
|
void APIENTRY dummy_glUseProgram(GLuint/*program*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glUseProgram");
|
g_Notify->DisplayError("glUseProgram");
|
||||||
}
|
}
|
||||||
GLint APIENTRY dummy_glGetUniformLocation(GLuint/*program*/, GLchar* /*name*/)
|
GLint APIENTRY dummy_glGetUniformLocation(GLuint/*program*/, GLchar* /*name*/)
|
||||||
{ /* GLX single opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX single opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glGetUniformLocation");
|
g_Notify->DisplayError("glGetUniformLocation");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glUniform1i(GLint/*location*/, GLint/*v0*/)
|
void APIENTRY dummy_glUniform1i(GLint/*location*/, GLint/*v0*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glUniform1i");
|
g_Notify->DisplayError("glUniform1i");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glUniform4i(GLint/*location*/, GLint, GLint, GLint, GLint)
|
void APIENTRY dummy_glUniform4i(GLint/*location*/, GLint, GLint, GLint, GLint)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glUniform4i");
|
g_Notify->DisplayError("glUniform4i");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glUniform1f(GLint/*location*/, GLfloat/*v0*/)
|
void APIENTRY dummy_glUniform1f(GLint/*location*/, GLfloat/*v0*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glUniform1f");
|
g_Notify->DisplayError("glUniform1f");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glUniform4f(GLint/*location*/, GLfloat, GLfloat, GLfloat, GLfloat)
|
void APIENTRY dummy_glUniform4f(GLint/*location*/, GLfloat, GLfloat, GLfloat, GLfloat)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
{ /* GLX render opcode ?, req. OpenGL 2.0 (1.2 w/ ARB_shader_objects) */
|
||||||
DisplayError("glUniform4f");
|
g_Notify->DisplayError("glUniform4f");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glDeleteObject(GLhandleARB/*obj*/)
|
void APIENTRY dummy_glDeleteObject(GLhandleARB/*obj*/)
|
||||||
{ /* GLX render opcode ?, req. OpenGL 1.2 w/ ARB_shader_objects */
|
{ /* GLX render opcode ?, req. OpenGL 1.2 w/ ARB_shader_objects */
|
||||||
DisplayError("glDeleteObject");
|
g_Notify->DisplayError("glDeleteObject");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glGetInfoLog(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)
|
void APIENTRY dummy_glGetInfoLog(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)
|
||||||
{ /* GLX single opcode ?, req. OpenGL 1.2 w/ ARB_shader_objects */
|
{ /* GLX single opcode ?, req. OpenGL 1.2 w/ ARB_shader_objects */
|
||||||
DisplayError("glGetInfoLog");
|
g_Notify->DisplayError("glGetInfoLog");
|
||||||
}
|
}
|
||||||
void APIENTRY dummy_glGetObjectParameteriv(GLhandleARB, GLenum, GLint *)
|
void APIENTRY dummy_glGetObjectParameteriv(GLhandleARB, GLenum, GLint *)
|
||||||
{ /* GLX single opcode ?, req. OpenGL 1.2 w/ ARB_shader_objects */
|
{ /* GLX single opcode ?, req. OpenGL 1.2 w/ ARB_shader_objects */
|
||||||
DisplayError("glGetObjectParameteriv");
|
g_Notify->DisplayError("glGetObjectParameteriv");
|
||||||
}
|
}
|
||||||
|
|
||||||
// FXT1,DXT1,DXT5 support - Hiroshi Morii <koolsmoky(at)users.sourceforge.net>
|
// FXT1,DXT1,DXT5 support - Hiroshi Morii <koolsmoky(at)users.sourceforge.net>
|
||||||
|
@ -259,7 +251,7 @@ void APIENTRY dummy_glGetObjectParameteriv(GLhandleARB, GLenum, GLint *)
|
||||||
PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DARB;
|
PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DARB;
|
||||||
void APIENTRY dummy_glCompressedTexImage2D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)
|
void APIENTRY dummy_glCompressedTexImage2D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)
|
||||||
{ /* GLX render opcode 215, req. OpenGL 1.3 (1.2 w/ ARB_texture_compression) */
|
{ /* GLX render opcode 215, req. OpenGL 1.3 (1.2 w/ ARB_texture_compression) */
|
||||||
DisplayError("glCompressedTexImage2D");
|
g_Notify->DisplayError("glCompressedTexImage2D");
|
||||||
}
|
}
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
@ -332,19 +324,6 @@ unsigned short depthBuffer[2048 * 2048];
|
||||||
|
|
||||||
//#define VOODOO1
|
//#define VOODOO1
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
void display_error()
|
|
||||||
{
|
|
||||||
LPVOID lpMsgBuf;
|
|
||||||
if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MessageBox(NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION);
|
|
||||||
LocalFree(lpMsgBuf);
|
|
||||||
}
|
|
||||||
#endif // _WIN32
|
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grSstOrigin(GrOriginLocation_t origin)
|
grSstOrigin(GrOriginLocation_t origin)
|
||||||
{
|
{
|
||||||
|
@ -472,11 +451,11 @@ int isWglExtensionSupported(const char *extension)
|
||||||
|
|
||||||
FX_ENTRY GrContext_t FX_CALL
|
FX_ENTRY GrContext_t FX_CALL
|
||||||
grSstWinOpenExt(
|
grSstWinOpenExt(
|
||||||
GrColorFormat_t color_format,
|
GrColorFormat_t color_format,
|
||||||
GrOriginLocation_t origin_location,
|
GrOriginLocation_t origin_location,
|
||||||
GrPixelFormat_t /*pixelformat*/,
|
GrPixelFormat_t /*pixelformat*/,
|
||||||
int nColBuffers,
|
int nColBuffers,
|
||||||
int nAuxBuffers)
|
int nAuxBuffers)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "color_format: %d, origin_location: %d, nColBuffers: %d, nAuxBuffers: %d", color_format, origin_location, nColBuffers, nAuxBuffers);
|
WriteTrace(TraceGlitch, TraceDebug, "color_format: %d, origin_location: %d, nColBuffers: %d, nAuxBuffers: %d", color_format, origin_location, nColBuffers, nAuxBuffers);
|
||||||
return grSstWinOpen(color_format, origin_location, nColBuffers, nAuxBuffers);
|
return grSstWinOpen(color_format, origin_location, nColBuffers, nAuxBuffers);
|
||||||
|
@ -492,10 +471,10 @@ extern HWND g_hwnd_win;
|
||||||
|
|
||||||
FX_ENTRY GrContext_t FX_CALL
|
FX_ENTRY GrContext_t FX_CALL
|
||||||
grSstWinOpen(
|
grSstWinOpen(
|
||||||
GrColorFormat_t color_format,
|
GrColorFormat_t color_format,
|
||||||
GrOriginLocation_t origin_location,
|
GrOriginLocation_t origin_location,
|
||||||
int nColBuffers,
|
int nColBuffers,
|
||||||
int nAuxBuffers)
|
int nAuxBuffers)
|
||||||
{
|
{
|
||||||
static int show_warning = 1;
|
static int show_warning = 1;
|
||||||
|
|
||||||
|
@ -1236,12 +1215,12 @@ int CheckTextureBufferFormat(GrChipID_t tmu, FxU32 startAddress, GrTexInfo *info
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTextureAuxBufferExt(GrChipID_t tmu,
|
grTextureAuxBufferExt(GrChipID_t tmu,
|
||||||
FxU32 startAddress,
|
FxU32 startAddress,
|
||||||
GrLOD_t thisLOD,
|
GrLOD_t thisLOD,
|
||||||
GrLOD_t largeLOD,
|
GrLOD_t largeLOD,
|
||||||
GrAspectRatio_t aspectRatio,
|
GrAspectRatio_t aspectRatio,
|
||||||
GrTextureFormat_t format,
|
GrTextureFormat_t format,
|
||||||
FxU32 odd_even_mask)
|
FxU32 odd_even_mask)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d startAddress: %d thisLOD: %d largeLOD: %d aspectRatio: %d format: %d odd_even_mask: %d", tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
|
WriteTrace(TraceGlitch, TraceDebug, "tmu: %d startAddress: %d thisLOD: %d largeLOD: %d aspectRatio: %d format: %d odd_even_mask: %d", tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
|
||||||
}
|
}
|
||||||
|
@ -1823,8 +1802,8 @@ grBufferSwap(FxU32 swap_interval)
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grLfbLock(GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
|
grLfbLock(GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
|
||||||
GrOriginLocation_t origin, FxBool pixelPipeline,
|
GrOriginLocation_t origin, FxBool pixelPipeline,
|
||||||
GrLfbInfo_t *info)
|
GrLfbInfo_t *info)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
|
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
|
||||||
if (type == GR_LFB_WRITE_ONLY)
|
if (type == GR_LFB_WRITE_ONLY)
|
||||||
|
@ -1907,9 +1886,9 @@ grLfbUnlock(GrLock_t type, GrBuffer_t buffer)
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grLfbReadRegion(GrBuffer_t src_buffer,
|
grLfbReadRegion(GrBuffer_t src_buffer,
|
||||||
FxU32 src_x, FxU32 src_y,
|
FxU32 src_x, FxU32 src_y,
|
||||||
FxU32 src_width, FxU32 src_height,
|
FxU32 src_width, FxU32 src_height,
|
||||||
FxU32 dst_stride, void *dst_data)
|
FxU32 dst_stride, void *dst_data)
|
||||||
{
|
{
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
@ -1973,11 +1952,11 @@ FxU32 dst_stride, void *dst_data)
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grLfbWriteRegion(GrBuffer_t dst_buffer,
|
grLfbWriteRegion(GrBuffer_t dst_buffer,
|
||||||
FxU32 dst_x, FxU32 dst_y,
|
FxU32 dst_x, FxU32 dst_y,
|
||||||
GrLfbSrcFmt_t src_format,
|
GrLfbSrcFmt_t src_format,
|
||||||
FxU32 src_width, FxU32 src_height,
|
FxU32 src_width, FxU32 src_height,
|
||||||
FxBool pixelPipeline,
|
FxBool pixelPipeline,
|
||||||
FxI32 src_stride, void *src_data)
|
FxI32 src_stride, void *src_data)
|
||||||
{
|
{
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
@ -2082,7 +2061,7 @@ FxI32 src_stride, void *src_data)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float *buf = (float*)malloc(src_width*(src_height + (g_viewport_offset))*sizeof(float));
|
float *buf = (float*)malloc(src_width*(src_height + (g_viewport_offset)) * sizeof(float));
|
||||||
|
|
||||||
if (src_format != GR_LFBWRITEMODE_ZA16)
|
if (src_format != GR_LFBWRITEMODE_ZA16)
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer write format:%x", src_format);
|
WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer write format:%x", src_format);
|
||||||
|
@ -2131,7 +2110,6 @@ FxI32 src_stride, void *src_data)
|
||||||
return FXTRUE;
|
return FXTRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* wrapper-specific glide extensions */
|
/* wrapper-specific glide extensions */
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL grKeyPressedExt(FxU32 key)
|
FX_ENTRY FxBool FX_CALL grKeyPressedExt(FxU32 key)
|
||||||
|
@ -2233,46 +2211,46 @@ grFlush(void)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexMultibase(GrChipID_t /*tmu*/,
|
grTexMultibase(GrChipID_t /*tmu*/,
|
||||||
FxBool /*enable*/)
|
FxBool /*enable*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibase");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibase");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexMipMapMode(GrChipID_t /*tmu*/,
|
grTexMipMapMode(GrChipID_t /*tmu*/,
|
||||||
GrMipMapMode_t /*mode*/,
|
GrMipMapMode_t /*mode*/,
|
||||||
FxBool /*lodBlend*/)
|
FxBool /*lodBlend*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexMipMapMode");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexMipMapMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexDownloadTablePartial(GrTexTable_t /*type*/,
|
grTexDownloadTablePartial(GrTexTable_t /*type*/,
|
||||||
void * /*data*/,
|
void * /*data*/,
|
||||||
int /*start*/,
|
int /*start*/,
|
||||||
int /*end*/)
|
int /*end*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTablePartial");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTablePartial");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexDownloadTable(GrTexTable_t /*type*/,
|
grTexDownloadTable(GrTexTable_t /*type*/,
|
||||||
void * /*data*/)
|
void * /*data*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTable");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadTable");
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_ENTRY FxBool FX_CALL
|
FX_ENTRY FxBool FX_CALL
|
||||||
grTexDownloadMipMapLevelPartial(GrChipID_t /*tmu*/,
|
grTexDownloadMipMapLevelPartial(GrChipID_t /*tmu*/,
|
||||||
FxU32 /*startAddress*/,
|
FxU32 /*startAddress*/,
|
||||||
GrLOD_t /*thisLod*/,
|
GrLOD_t /*thisLod*/,
|
||||||
GrLOD_t /*largeLod*/,
|
GrLOD_t /*largeLod*/,
|
||||||
GrAspectRatio_t /*aspectRatio*/,
|
GrAspectRatio_t /*aspectRatio*/,
|
||||||
GrTextureFormat_t /*format*/,
|
GrTextureFormat_t /*format*/,
|
||||||
FxU32 /*evenOdd*/,
|
FxU32 /*evenOdd*/,
|
||||||
void * /*data*/,
|
void * /*data*/,
|
||||||
int /*start*/,
|
int /*start*/,
|
||||||
int /*end*/)
|
int /*end*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevelPartial");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevelPartial");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2280,13 +2258,13 @@ int /*end*/)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexDownloadMipMapLevel(GrChipID_t /*tmu*/,
|
grTexDownloadMipMapLevel(GrChipID_t /*tmu*/,
|
||||||
FxU32 /*startAddress*/,
|
FxU32 /*startAddress*/,
|
||||||
GrLOD_t /*thisLod*/,
|
GrLOD_t /*thisLod*/,
|
||||||
GrLOD_t /*largeLod*/,
|
GrLOD_t /*largeLod*/,
|
||||||
GrAspectRatio_t /*aspectRatio*/,
|
GrAspectRatio_t /*aspectRatio*/,
|
||||||
GrTextureFormat_t /*format*/,
|
GrTextureFormat_t /*format*/,
|
||||||
FxU32 /*evenOdd*/,
|
FxU32 /*evenOdd*/,
|
||||||
void * /*data*/)
|
void * /*data*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevel");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexDownloadMipMapLevel");
|
||||||
}
|
}
|
||||||
|
@ -2324,8 +2302,8 @@ grSelectContext(GrContext_t /*context*/)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grAADrawTriangle(
|
grAADrawTriangle(
|
||||||
const void * /*a*/, const void * /*b*/, const void * /*c*/,
|
const void * /*a*/, const void * /*b*/, const void * /*c*/,
|
||||||
FxBool /*ab_antialias*/, FxBool /*bc_antialias*/, FxBool /*ca_antialias*/
|
FxBool /*ab_antialias*/, FxBool /*bc_antialias*/, FxBool /*ca_antialias*/
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grAADrawTriangle");
|
WriteTrace(TraceGlitch, TraceWarning, "grAADrawTriangle");
|
||||||
|
@ -2387,10 +2365,10 @@ grLfbConstantAlpha(GrAlpha_t /*alpha*/)
|
||||||
|
|
||||||
FX_ENTRY void FX_CALL
|
FX_ENTRY void FX_CALL
|
||||||
grTexMultibaseAddress(GrChipID_t /*tmu*/,
|
grTexMultibaseAddress(GrChipID_t /*tmu*/,
|
||||||
GrTexBaseRange_t /*range*/,
|
GrTexBaseRange_t /*range*/,
|
||||||
FxU32 /*startAddress*/,
|
FxU32 /*startAddress*/,
|
||||||
FxU32 /*evenOdd*/,
|
FxU32 /*evenOdd*/,
|
||||||
GrTexInfo * /*info*/)
|
GrTexInfo * /*info*/)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibaseAddress");
|
WriteTrace(TraceGlitch, TraceWarning, "grTexMultibaseAddress");
|
||||||
}
|
}
|
||||||
|
@ -2648,7 +2626,7 @@ void dump_tex(int id)
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
// yes, it's inefficient
|
// yes, it's inefficient
|
||||||
for (n=0; n<tl_i; n++)
|
for (n = 0; n < tl_i; n++)
|
||||||
if (tl[n] == id)
|
if (tl[n] == id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,19 @@ bool CPlugin::Load(const char * FileName)
|
||||||
LoadFunction(DllConfig);
|
LoadFunction(DllConfig);
|
||||||
LoadFunction(DllAbout);
|
LoadFunction(DllAbout);
|
||||||
|
|
||||||
|
LoadFunction(SetPluginNotification);
|
||||||
|
if (SetPluginNotification)
|
||||||
|
{
|
||||||
|
WriteTrace(PluginTraceType(), TraceDebug, "Found SetPluginNotification");
|
||||||
|
PLUGIN_NOTIFICATION info;
|
||||||
|
info.DisplayError = DisplayError;
|
||||||
|
info.FatalError = FatalError;
|
||||||
|
info.DisplayMessage = DisplayMessage;
|
||||||
|
info.DisplayMessage2 = DisplayMessage2;
|
||||||
|
info.BreakPoint = BreakPoint;
|
||||||
|
SetPluginNotification(&info);
|
||||||
|
}
|
||||||
|
|
||||||
LoadFunction(SetSettingNotificationInfo);
|
LoadFunction(SetSettingNotificationInfo);
|
||||||
if (SetSettingNotificationInfo)
|
if (SetSettingNotificationInfo)
|
||||||
{
|
{
|
||||||
|
@ -306,3 +319,28 @@ bool CPlugin::ValidPluginVersion(PLUGIN_INFO & PluginInfo)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlugin::DisplayError(const char * Message)
|
||||||
|
{
|
||||||
|
g_Notify->DisplayError(Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlugin::FatalError(const char * Message)
|
||||||
|
{
|
||||||
|
g_Notify->FatalError(Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlugin::DisplayMessage(int DisplayTime, const char * Message)
|
||||||
|
{
|
||||||
|
g_Notify->DisplayMessage(DisplayTime, Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlugin::DisplayMessage2(const char * Message)
|
||||||
|
{
|
||||||
|
g_Notify->DisplayMessage2(Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlugin::BreakPoint(const char * FileName, int32_t LineNumber)
|
||||||
|
{
|
||||||
|
g_Notify->BreakPoint(FileName, LineNumber);
|
||||||
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ protected:
|
||||||
void(CALL *SetSettingInfo2)(PLUGIN_SETTINGS2 *);
|
void(CALL *SetSettingInfo2)(PLUGIN_SETTINGS2 *);
|
||||||
void(CALL *SetSettingInfo3)(PLUGIN_SETTINGS3 *);
|
void(CALL *SetSettingInfo3)(PLUGIN_SETTINGS3 *);
|
||||||
void(CALL *SetSettingNotificationInfo)(PLUGIN_SETTINGS_NOTIFICATION *);
|
void(CALL *SetSettingNotificationInfo)(PLUGIN_SETTINGS_NOTIFICATION *);
|
||||||
|
void(CALL *SetPluginNotification)(PLUGIN_NOTIFICATION *);
|
||||||
|
|
||||||
pjutil::DynLibHandle m_LibHandle;
|
pjutil::DynLibHandle m_LibHandle;
|
||||||
bool m_Initialized, m_RomOpen;
|
bool m_Initialized, m_RomOpen;
|
||||||
|
@ -76,4 +77,11 @@ protected:
|
||||||
// i.e. _LoadFunction("CloseDLL", CloseDLL);
|
// i.e. _LoadFunction("CloseDLL", CloseDLL);
|
||||||
#define LoadFunction(functionName) _LoadFunctionVoid(#functionName, (void **)&functionName)
|
#define LoadFunction(functionName) _LoadFunctionVoid(#functionName, (void **)&functionName)
|
||||||
#define _LoadFunction(functionName,function) _LoadFunctionVoid(functionName, (void **)&function)
|
#define _LoadFunction(functionName,function) _LoadFunctionVoid(functionName, (void **)&function)
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void DisplayError(const char * Message);
|
||||||
|
static void FatalError(const char * Message);
|
||||||
|
static void DisplayMessage(int DisplayTime, const char * Message);
|
||||||
|
static void DisplayMessage2(const char * Message);
|
||||||
|
static void BreakPoint(const char * FileName, int32_t LineNumber);
|
||||||
};
|
};
|
||||||
|
|
|
@ -326,7 +326,6 @@ bool CPlugins::Reset(CN64System * System)
|
||||||
bool bRspChange = _stricmp(m_RSPFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0;
|
bool bRspChange = _stricmp(m_RSPFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0;
|
||||||
bool bContChange = _stricmp(m_ControlFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0;
|
bool bContChange = _stricmp(m_ControlFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0;
|
||||||
|
|
||||||
|
|
||||||
if (g_Settings->LoadBool(Plugin_ForceGfxReset))
|
if (g_Settings->LoadBool(Plugin_ForceGfxReset))
|
||||||
{
|
{
|
||||||
//this is a hack and should not be here, glide64 is not correctly freeing something on restart, this needs to be fixed but this is a short term workaround
|
//this is a hack and should not be here, glide64 is not correctly freeing something on restart, this needs to be fixed but this is a short term workaround
|
||||||
|
|
|
@ -80,6 +80,15 @@ typedef struct
|
||||||
void(*UnregisterChangeCB)(void * handle, int ID, void * Data, SettingChangedFunc Func);
|
void(*UnregisterChangeCB)(void * handle, int ID, void * Data, SettingChangedFunc Func);
|
||||||
} PLUGIN_SETTINGS_NOTIFICATION;
|
} PLUGIN_SETTINGS_NOTIFICATION;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void(*DisplayError)(const char * Message);
|
||||||
|
void(*FatalError)(const char * Message);
|
||||||
|
void(*DisplayMessage)(int DisplayTime, const char * Message);
|
||||||
|
void(*DisplayMessage2)(const char * Message);
|
||||||
|
void(*BreakPoint)(const char * FileName, int32_t LineNumber);
|
||||||
|
} PLUGIN_NOTIFICATION;
|
||||||
|
|
||||||
enum PLUGIN_TYPE
|
enum PLUGIN_TYPE
|
||||||
{
|
{
|
||||||
PLUGIN_TYPE_NONE = 0,
|
PLUGIN_TYPE_NONE = 0,
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
#define CALL
|
#define CALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CNotification g_NotifyLocal;
|
||||||
|
CNotification * g_Notify = &g_NotifyLocal;
|
||||||
|
|
||||||
enum SettingLocation
|
enum SettingLocation
|
||||||
{
|
{
|
||||||
SettingType_ConstString = 0,
|
SettingType_ConstString = 0,
|
||||||
|
@ -72,16 +75,27 @@ typedef struct
|
||||||
void(*UnregisterChangeCB)(void * handle, int ID, void * Data, SettingChangedFunc Func);
|
void(*UnregisterChangeCB)(void * handle, int ID, void * Data, SettingChangedFunc Func);
|
||||||
} PLUGIN_SETTINGS_NOTIFICATION;
|
} PLUGIN_SETTINGS_NOTIFICATION;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void (*DisplayError)(const char * Message);
|
||||||
|
void (*FatalError)(const char * Message);
|
||||||
|
void (*DisplayMessage)(int DisplayTime, const char * Message);
|
||||||
|
void (*DisplayMessage2)(const char * Message);
|
||||||
|
void (*BreakPoint)(const char * FileName, int32_t LineNumber);
|
||||||
|
} PLUGIN_NOTIFICATION;
|
||||||
|
|
||||||
static PLUGIN_SETTINGS g_PluginSettings;
|
static PLUGIN_SETTINGS g_PluginSettings;
|
||||||
static PLUGIN_SETTINGS2 g_PluginSettings2;
|
static PLUGIN_SETTINGS2 g_PluginSettings2;
|
||||||
static PLUGIN_SETTINGS3 g_PluginSettings3;
|
static PLUGIN_SETTINGS3 g_PluginSettings3;
|
||||||
static PLUGIN_SETTINGS_NOTIFICATION g_PluginSettingsNotification;
|
static PLUGIN_SETTINGS_NOTIFICATION g_PluginSettingsNotification;
|
||||||
|
static PLUGIN_NOTIFICATION g_PluginNotification;
|
||||||
static bool g_PluginInitilized = false;
|
static bool g_PluginInitilized = false;
|
||||||
static char g_PluginSettingName[300];
|
static char g_PluginSettingName[300];
|
||||||
|
|
||||||
EXPORT void SetSettingInfo(PLUGIN_SETTINGS * info);
|
EXPORT void SetSettingInfo(PLUGIN_SETTINGS * info);
|
||||||
EXPORT void SetSettingInfo2(PLUGIN_SETTINGS2 * info);
|
EXPORT void SetSettingInfo2(PLUGIN_SETTINGS2 * info);
|
||||||
EXPORT void SetSettingInfo3(PLUGIN_SETTINGS3 * info);
|
EXPORT void SetSettingInfo3(PLUGIN_SETTINGS3 * info);
|
||||||
|
EXPORT void SetPluginNotification(PLUGIN_NOTIFICATION * info);
|
||||||
|
|
||||||
EXPORT void SetSettingInfo(PLUGIN_SETTINGS * info)
|
EXPORT void SetSettingInfo(PLUGIN_SETTINGS * info)
|
||||||
{
|
{
|
||||||
|
@ -105,6 +119,11 @@ EXPORT void SetSettingNotificationInfo(PLUGIN_SETTINGS_NOTIFICATION * info)
|
||||||
g_PluginSettingsNotification = *info;
|
g_PluginSettingsNotification = *info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPORT void SetPluginNotification(PLUGIN_NOTIFICATION * info)
|
||||||
|
{
|
||||||
|
g_PluginNotification = *info;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t SettingsInitilized(void)
|
int32_t SettingsInitilized(void)
|
||||||
{
|
{
|
||||||
return g_PluginInitilized;
|
return g_PluginInitilized;
|
||||||
|
@ -316,3 +335,43 @@ void SettingsUnregisterChange(bool SystemSetting, int SettingID, void * Data, Se
|
||||||
g_PluginSettingsNotification.UnregisterChangeCB(g_PluginSettings.handle, SettingID + (SystemSetting ? 0 : g_PluginSettings.SettingStartRange), Data, Func);
|
g_PluginSettingsNotification.UnregisterChangeCB(g_PluginSettings.handle, SettingID + (SystemSetting ? 0 : g_PluginSettings.SettingStartRange), Data, Func);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNotification::DisplayError(const char * Message)
|
||||||
|
{
|
||||||
|
if (g_PluginNotification.BreakPoint != NULL)
|
||||||
|
{
|
||||||
|
g_PluginNotification.DisplayError(Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNotification::FatalError(const char * Message)
|
||||||
|
{
|
||||||
|
if (g_PluginNotification.BreakPoint != NULL)
|
||||||
|
{
|
||||||
|
g_PluginNotification.FatalError(Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNotification::DisplayMessage(int DisplayTime, const char * Message)
|
||||||
|
{
|
||||||
|
if (g_PluginNotification.BreakPoint != NULL)
|
||||||
|
{
|
||||||
|
g_PluginNotification.DisplayMessage(DisplayTime, Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNotification::DisplayMessage2(const char * Message)
|
||||||
|
{
|
||||||
|
if (g_PluginNotification.BreakPoint != NULL)
|
||||||
|
{
|
||||||
|
g_PluginNotification.DisplayMessage2(Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNotification::BreakPoint(const char * FileName, int LineNumber)
|
||||||
|
{
|
||||||
|
if (g_PluginNotification.BreakPoint != NULL)
|
||||||
|
{
|
||||||
|
g_PluginNotification.BreakPoint(FileName, LineNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -48,3 +48,15 @@ extern "C" {
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class CNotification
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void DisplayError(const char * Message);
|
||||||
|
static void FatalError(const char * Message);
|
||||||
|
static void DisplayMessage(int DisplayTime, const char * Message);
|
||||||
|
static void DisplayMessage2(const char * Message);
|
||||||
|
static void BreakPoint(const char * FileName, int LineNumber);
|
||||||
|
};
|
||||||
|
|
||||||
|
extern CNotification * g_Notify;
|
||||||
|
|
Loading…
Reference in New Issue