X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fgpu-gles%2FgpuPlugin.c;h=9d749a5d924e488022d532df3fb03a19e38cd2fd;hp=81b7f05ea5844b5fa277ec54aaccd5b2cb844235;hb=b243416b907e6ce366b051e77ed8a434f7668d5d;hpb=677ea10304049d6f7aae48317fe32cfea060d209 diff --git a/plugins/gpu-gles/gpuPlugin.c b/plugins/gpu-gles/gpuPlugin.c index 81b7f05e..9d749a5d 100644 --- a/plugins/gpu-gles/gpuPlugin.c +++ b/plugins/gpu-gles/gpuPlugin.c @@ -27,25 +27,8 @@ //#include "gpuStdafx.h" //#include - #define _IN_GPU -#ifdef _WINDOWS -#include "stdafx.h" -#include -#include -#include -#include -#include - -#include "externals.h" -#include "gpu.h" -#include "draw.h" -#include "prim.h" -#include "texture.h" -#include "fps.h" -#include "resource.h" -#else #include #include #include @@ -60,10 +43,7 @@ //#include "NoPic.h" #include "gpuStdafx.h" -#endif -extern void ProcessEvents(); - short g_m1=255,g_m2=255,g_m3=255; short DrawSemiTrans=FALSE; short Ymin; @@ -100,10 +80,6 @@ BOOL bNeedInterlaceUpdate=FALSE; BOOL bNeedRGB24Update=FALSE; BOOL bChangeWinMode=FALSE; -#ifdef _WINDOWS -extern HGLRC GLCONTEXT; -#endif - unsigned long ulStatusControl[256]; //////////////////////////////////////////////////////////////////////// @@ -155,28 +131,12 @@ int iRumbleVal = 0; int iRumbleTime = 0; static void (*rearmed_get_layer_pos)(int *x, int *y, int *w, int *h); +static void flipEGL(void); //////////////////////////////////////////////////////////////////////// // stuff to make this a true PDK module //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -char * CALLBACK PSEgetLibName(void) -{ - return "name"; -} - -unsigned long CALLBACK PSEgetLibType(void) -{ - return 1; -} - -unsigned long CALLBACK PSEgetLibVersion(void) -{ - return 1<<16|1<<8|1; -} -#endif - //////////////////////////////////////////////////////////////////////// // snapshot funcs (saves screen to bitmap / text infos into file) //////////////////////////////////////////////////////////////////////// @@ -189,10 +149,10 @@ void ResizeWindow() glViewport(rRatioRect.left, // init viewport by ratio rect iResY-(rRatioRect.top+rRatioRect.bottom), rRatioRect.right, - rRatioRect.bottom); + rRatioRect.bottom); glError(); - glScissor(0, 0, iResX, iResY); // init clipping (fullscreen) - glEnable(GL_SCISSOR_TEST); + glScissor(0, 0, iResX, iResY); glError(); // init clipping (fullscreen) + glEnable(GL_SCISSOR_TEST); glError(); #ifndef OWNSCALE glMatrixMode(GL_TEXTURE); // init psx tex sow and tow if not "ownscale" @@ -200,19 +160,16 @@ void ResizeWindow() glScalef(1.0f/255.99f,1.0f/255.99f,1.0f); // geforce precision hack #endif - glMatrixMode(GL_PROJECTION); // init projection with psx resolution - glLoadIdentity(); + glMatrixMode(GL_PROJECTION); glError(); // init projection with psx resolution + glLoadIdentity(); glError(); glOrtho(0,PSXDisplay.DisplayMode.x, - PSXDisplay.DisplayMode.y, 0, -1, 1); + PSXDisplay.DisplayMode.y, 0, -1, 1); glError(); if (bKeepRatio) SetAspectRatio(); } char * GetConfigInfos(int hW) { -#ifdef _WINDOWS - HDC hdc;HGLRC hglrc; -#endif char szO[2][4]={"off","on "}; char szTxt[256]; char * pB=(char *)malloc(32767); @@ -395,11 +352,7 @@ void DoSnapShot(void) { } -#ifdef _WINDOWS void CALLBACK GPUmakeSnapshot(void) -#else -void CALLBACK GPUmakeSnapshot(void) -#endif { //bSnapShot = TRUE; } @@ -408,26 +361,12 @@ void CALLBACK GPUmakeSnapshot(void) // GPU INIT... here starts it all (first func called by emu) //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS long CALLBACK GPUinit() -#else -long CALLBACK GPUinit() -#endif { memset(ulStatusControl,0,256*sizeof(unsigned long)); -#ifdef _WINDOWS -iResX=240;iResY=320; -#endif bChangeRes=FALSE; -#ifdef _WINDOWS -bWindowMode=TRUE; -#else bWindowMode=FALSE; -#endif -#ifdef _WINDOWS -iWinSize=MAKELONG(iResX,iResY); -#endif bKeepRatio = TRUE; // different ways of accessing PSX VRAM @@ -500,33 +439,6 @@ return 0; } -//////////////////////////////////////////////////////////////////////// -// GPU OPEN: funcs to open up the gpu display (Windows) -//////////////////////////////////////////////////////////////////////// - -#ifdef _WINDOWS - -void ChangeDesktop() // change destop resolution -{ - DEVMODE dv;long lRes,iTry=0; - - while(iTry<10) // keep on hammering... - { - memset(&dv,0,sizeof(DEVMODE)); - dv.dmSize=sizeof(DEVMODE); - dv.dmBitsPerPel=iColDepth; - dv.dmPelsWidth=iResX; - dv.dmPelsHeight=iResY; - - dv.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; - - lRes=ChangeDisplaySettings(&dv,0); // ...hammering the anvil - - if(lRes==DISP_CHANGE_SUCCESSFUL) return; - iTry++;Sleep(10); - } -} - //////////////////////////////////////////////////////////////////////// // OPEN interface func: attention! // some emus are calling this func in their main Window thread, @@ -541,35 +453,12 @@ void ChangeDesktop() // change destop resoluti // some PAD or SPU plugins would not work anymore) //////////////////////////////////////////////////////////////////////// -HMENU hPSEMenu=NULL; - -long CALLBACK GPUopen(HWND hwndGPU) -#else long CALLBACK GPUopen(int hwndGPU) -#endif { - #ifdef _WINDOWS - HDC hdc;RECT r;DEVMODE dv; - - hWWindow = hwndGPU; // store hwnd globally - #endif - // InitKeyHandler(); // init key handler (subclass window) - - - - #ifdef _WINDOWS - iResX=240;iResY=320; - #endif -#ifdef MAEMO_CHANGES - iResX=800;iResY=480; -#endif + iResX=800;iResY=480; iColDepth=8; bChangeRes=FALSE; - #ifdef _WINDOWS - bWindowMode=TRUE; - #else bWindowMode=FALSE; - #endif bFullVRam=FALSE; iFilterType=0; // bAdvancedBlend=FALSE; @@ -583,9 +472,6 @@ long CALLBACK GPUopen(int hwndGPU) //bOpaquePass=FALSE; //bUseAntiAlias=FALSE; //iTexQuality=0; - #ifdef _WINDOWS - iWinSize=MAKELONG(iResX,iResY); - #endif iUseMask=0; iZBufferDepth=0; bUseFastMdec=FALSE; @@ -607,65 +493,12 @@ long CALLBACK GPUopen(int hwndGPU) -#ifdef _WINDOWS - memset(&dv,0,sizeof(DEVMODE)); - dv.dmSize=sizeof(DEVMODE); - EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&dv); -#endif bIsFirstFrame = TRUE; // flag: we have to init OGL later in windows! -#ifdef _WINDOWS - if(bWindowMode) // win mode? - { - DWORD dw=GetWindowLong(hWWindow, GWL_STYLE); // -> adjust wnd style (owndc needed by some stupid ogl drivers) - dw&=~WS_THICKFRAME; - dw|=WS_BORDER|WS_CAPTION|CS_OWNDC; - SetWindowLong(hWWindow, GWL_STYLE, dw); - - hPSEMenu=GetMenu(hWWindow); // -> hide emu menu (if any) - if(hPSEMenu!=NULL) SetMenu(hWWindow,NULL); - - iResX=LOWORD(iWinSize);iResY=HIWORD(iWinSize); - ShowWindow(hWWindow,SW_SHOWNORMAL); - - MoveWindow(hWWindow, // -> center wnd - GetSystemMetrics(SM_CXFULLSCREEN)/2-iResX/2, - GetSystemMetrics(SM_CYFULLSCREEN)/2-iResY/2, - iResX+GetSystemMetrics(SM_CXFIXEDFRAME)+3, - iResY+GetSystemMetrics(SM_CYFIXEDFRAME)+GetSystemMetrics(SM_CYCAPTION)+3, - TRUE); - UpdateWindow(hWWindow); // -> let windows do some update - - if(dv.dmBitsPerPel==16 || dv.dmBitsPerPel==32) // -> overwrite user color info with desktop color info - iColDepth=dv.dmBitsPerPel; - } - else // fullscreen mode: - { - if(dv.dmBitsPerPel!=(unsigned int)iColDepth || // -> check, if we have to change resolution - dv.dmPelsWidth !=(unsigned int)iResX || - dv.dmPelsHeight!=(unsigned int)iResY) - bChangeRes=TRUE; else bChangeRes=FALSE; - - if(bChangeRes) ChangeDesktop(); // -> change the res (had to do an own func because of some MS 'optimizations') - - SetWindowLong(hWWindow, GWL_STYLE, CS_OWNDC); // -> adjust wnd style as well (to be sure) - - hPSEMenu=GetMenu(hWWindow); // -> hide menu - if(hPSEMenu!=NULL) SetMenu(hWWindow,NULL); - ShowWindow(hWWindow,SW_SHOWMAXIMIZED); // -> max mode - } -#endif rRatioRect.left = rRatioRect.top=0; rRatioRect.right = iResX; rRatioRect.bottom = iResY; -#ifdef _WINDOWS - r.left=r.top=0;r.right=iResX;r.bottom=iResY; // hack for getting a clean black window until OGL gets initialized - hdc = GetDC(hWWindow); - FillRect(hdc,&r,(HBRUSH)GetStockObject(BLACK_BRUSH)); - bSetupPixelFormat(hdc); - ReleaseDC(hWWindow,hdc); -#endif bDisplayNotSet = TRUE; bSetClip=TRUE; @@ -673,10 +506,12 @@ long CALLBACK GPUopen(int hwndGPU) InitializeTextureStore(); // init texture mem + CSTEXTURE = CSVERTEX = CSCOLOR = 0; + // lGPUstatusRet = 0x74000000; // with some emus, we could do the OGL init right here... oh my -// if(bIsFirstFrame) GLinitialize(); + if(bIsFirstFrame) GLinitialize(); return 0; } @@ -685,28 +520,6 @@ long CALLBACK GPUopen(int hwndGPU) // close //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -long CALLBACK GPUclose() // WINDOWS CLOSE -{ -// ExitKeyHandler(); - - GLcleanup(); // close OGL - - if(bChangeRes) // change res back - ChangeDisplaySettings(NULL,0); - - if(hPSEMenu) // set menu again - SetMenu(hWWindow,hPSEMenu); - - if(pGfxCardScreen) free(pGfxCardScreen); // free helper memory - pGfxCardScreen=0; - -// if(iNoScreenSaver) EnableScreenSaver(TRUE); // enable screen saver again - - return 0; -} - -#else long GPUclose() // LINUX CLOSE { @@ -719,17 +532,12 @@ long GPUclose() // LINUX CLOSE return 0; } -#endif //////////////////////////////////////////////////////////////////////// // I shot the sheriff... last function called from emu //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -long CALLBACK GPUshutdown() -#else long CALLBACK GPUshutdown() -#endif { if(psxVSecure) free(psxVSecure); // kill emulated vram memory psxVSecure=0; @@ -744,15 +552,15 @@ long CALLBACK GPUshutdown() void PaintBlackBorders(void) { short s; + glDisable(GL_SCISSOR_TEST); glError(); + if(bTexEnabled) {glDisable(GL_TEXTURE_2D);bTexEnabled=FALSE;} glError(); + if(bOldSmoothShaded) {glShadeModel(GL_FLAT);bOldSmoothShaded=FALSE;} glError(); + if(bBlendEnable) {glDisable(GL_BLEND);bBlendEnable=FALSE;} glError(); + glDisable(GL_ALPHA_TEST); glError(); - glDisable(GL_SCISSOR_TEST); - if(bTexEnabled) {glDisable(GL_TEXTURE_2D);bTexEnabled=FALSE;} - if(bOldSmoothShaded) {glShadeModel(GL_FLAT);bOldSmoothShaded=FALSE;} - if(bBlendEnable) {glDisable(GL_BLEND);bBlendEnable=FALSE;} - glDisable(GL_ALPHA_TEST); + glEnable(GL_ALPHA_TEST); glError(); + glEnable(GL_SCISSOR_TEST); glError(); - glEnable(GL_ALPHA_TEST); - glEnable(GL_SCISSOR_TEST); } //////////////////////////////////////////////////////////////////////// @@ -793,10 +601,6 @@ void updateDisplay(void) // UPDATE DISPLAY { BOOL bBlur=FALSE; -#ifdef _WINDOWS -HDC hdc=GetDC(hWWindow); // windows: -wglMakeCurrent(hdc,GLCONTEXT); // -> make context current again -#endif bFakeFrontBuffer=FALSE; bRenderFrontBuffer=FALSE; @@ -838,11 +642,13 @@ if(PreviousPSXDisplay.Range.x0|| // paint black borders aro if(PSXDisplay.Disabled) // display disabled? { + //LOGE("PSXDisplay.Disabled"); + // moved here - glDisable(GL_SCISSOR_TEST); - glClearColor(0,0,0,128); // -> clear whole backbuffer - glClear(uiBufferBits); - glEnable(GL_SCISSOR_TEST); + glDisable(GL_SCISSOR_TEST); glError(); + glClearColor(0,0,0,128); glError(); // -> clear whole backbuffer + glClear(uiBufferBits); glError(); + glEnable(GL_SCISSOR_TEST); glError(); gl_z=0.0f; bDisplayNotSet = TRUE; } @@ -884,29 +690,16 @@ if(bUseFrameSkip) // frame skipping active ? { if(!bSkipNextFrame) { - if(iDrawnSomething) -#ifdef _WINDOWS - SwapBuffers(wglGetCurrentDC()); // -> to skip or not to skip -#else - eglSwapBuffers(display,surface); -#endif + if(iDrawnSomething) flipEGL(); } - if(dwActFixes&0x180) // -> special old frame skipping: skip max one in a row - { if((fps_skip < fFrameRateHz) && !(bSkipNextFrame)) {bSkipNextFrame = TRUE; fps_skip=fFrameRateHz;} else bSkipNextFrame = FALSE; - } - else FrameSkip(); + } else // no skip ? { - if(iDrawnSomething) -#ifdef _WINDOWS - SwapBuffers(wglGetCurrentDC()); // -> swap -#else - eglSwapBuffers(display,surface); -#endif + if(iDrawnSomething) flipEGL(); } iDrawnSomething=0; @@ -923,11 +716,10 @@ if(lClearOnSwap) // clear buffer after swap g=((GLclampf)GREEN(lClearOnSwapColor))/255.0f; // -> get col b=((GLclampf)BLUE(lClearOnSwapColor))/255.0f; r=((GLclampf)RED(lClearOnSwapColor))/255.0f; - - glDisable(GL_SCISSOR_TEST); - glClearColor(r,g,b,128); // -> clear - glClear(uiBufferBits); - glEnable(GL_SCISSOR_TEST); + glDisable(GL_SCISSOR_TEST); glError(); + glClearColor(r,g,b,128); glError(); // -> clear + glClear(uiBufferBits); glError(); + glEnable(GL_SCISSOR_TEST); glError(); lClearOnSwap=0; // -> done } else @@ -936,11 +728,12 @@ else if(iZBufferDepth) // clear zbuffer as well (if activated) { - glDisable(GL_SCISSOR_TEST); - glClear(GL_DEPTH_BUFFER_BIT); - glEnable(GL_SCISSOR_TEST); + glDisable(GL_SCISSOR_TEST); glError(); + glClear(GL_DEPTH_BUFFER_BIT); glError(); + glEnable(GL_SCISSOR_TEST); glError(); } } + gl_z=0.0f; //----------------------------------------------------// @@ -987,7 +780,7 @@ if(iRumbleTime) // shake screen by modifyi glViewport(rRatioRect.left+i1, iResY-(rRatioRect.top+rRatioRect.bottom)+i2, rRatioRect.right+i3, - rRatioRect.bottom+i4); + rRatioRect.bottom+i4); glError(); } //----------------------------------------------------// @@ -1020,18 +813,9 @@ bRenderFrontBuffer=FALSE; // if(gTexPicName) DisplayPic(); // if(ulKeybits&KEY_SHOWFPS) DisplayText(); -#ifdef _WINDOWS - { // windows: - HDC hdc=GetDC(hWWindow); - wglMakeCurrent(hdc,GLCONTEXT); // -> make current again - if(iDrawnSomething) - SwapBuffers(wglGetCurrentDC()); // -> swap - ReleaseDC(hWWindow,hdc); // -> ! important ! - } -#else if(iDrawnSomething) // linux: - eglSwapBuffers(display,surface); -#endif + flipEGL(); + //if(iBlurBuffer) UnBlurBackBuffer(); } @@ -1135,12 +919,11 @@ if(r.bottom < 1) r.bottom = 1; r.left = (iResX-r.right)/2; r.top = (iResY-r.bottom)/2; - if(r.bottom new psx resolution - PSXDisplay.DisplayModeNew.y, 0, -1, 1); + PSXDisplay.DisplayModeNew.y, 0, -1, 1); glError(); if(bKeepRatio) SetAspectRatio(); } @@ -1243,15 +1028,6 @@ if(bUp) updateDisplay(); // yeah, real update (swap // window mode <-> fullscreen mode (windows) //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void ChangeWindowMode(void) -{ - GPUclose(); - bWindowMode=!bWindowMode; - GPUopen(hWWindow); - bChangeWinMode=FALSE; -} -#endif //////////////////////////////////////////////////////////////////////// // swap update check (called by psx vsync function) @@ -1319,11 +1095,7 @@ return FALSE; static unsigned short usFirstPos=2; -#ifdef _WINDOWS -void CALLBACK GPUupdateLace(void) -#else void CALLBACK GPUupdateLace(void) -#endif { if(!(dwActFixes&0x1000)) STATUSREG^=0x80000000; // interlaced bit toggle, if the CC game fix is not active (see gpuReadStatus) @@ -1352,20 +1124,13 @@ else if(usFirstPos==1) // initial updates (after updateDisplay(); } -#ifdef _WINDOWS -if(bChangeWinMode) ChangeWindowMode(); -#endif } //////////////////////////////////////////////////////////////////////// // process read request from GPU status register //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -unsigned long CALLBACK GPUreadStatus(void) -#else unsigned long CALLBACK GPUreadStatus(void) -#endif { if(dwActFixes&0x1000) // CC game fix { @@ -1401,17 +1166,11 @@ return STATUSREG; // these are always single packet commands. //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS void CALLBACK GPUwriteStatus(unsigned long gdata) -#else -void CALLBACK GPUwriteStatus(unsigned long gdata) -#endif { unsigned long lCommand=(gdata>>24)&0xff; -#ifdef _WINDOWS if(bIsFirstFrame) GLinitialize(); // real ogl startup (needed by some emus) -#endif ulStatusControl[lCommand]=gdata; @@ -1827,7 +1586,7 @@ void CheckVRamReadEx(int x, int y, int dx, int dy) if(!pGfxCardScreen) { - glPixelStorei(GL_PACK_ALIGNMENT,1); + glPixelStorei(GL_PACK_ALIGNMENT,1); glError(); pGfxCardScreen=(unsigned char *)malloc(iResX*iResY*4); } @@ -1835,8 +1594,7 @@ void CheckVRamReadEx(int x, int y, int dx, int dy) //if(!sArea) glReadBuffer(GL_FRONT); - glReadPixels(x,y,dx,dy,GL_RGB,GL_UNSIGNED_BYTE,ps); - + glReadPixels(x,y,dx,dy,GL_RGB,GL_UNSIGNED_BYTE,ps); glError(); //if(!sArea) glReadBuffer(GL_BACK); s=0; @@ -1975,7 +1733,7 @@ void CheckVRamRead(int x, int y, int dx, int dy, bool bFront) if(!pGfxCardScreen) { - glPixelStorei(GL_PACK_ALIGNMENT,1); + glPixelStorei(GL_PACK_ALIGNMENT,1); glError(); pGfxCardScreen=(unsigned char *)malloc(iResX*iResY*4); } @@ -1983,8 +1741,7 @@ void CheckVRamRead(int x, int y, int dx, int dy, bool bFront) // if(bFront) glReadBuffer(GL_FRONT); - glReadPixels(x,y,dx,dy,GL_RGB,GL_UNSIGNED_BYTE,ps); - + glReadPixels(x,y,dx,dy,GL_RGB,GL_UNSIGNED_BYTE,ps); glError(); glError(); // if(bFront) glReadBuffer(GL_BACK); XS=(float)dx/(float)(udx); @@ -2017,11 +1774,7 @@ void CheckVRamRead(int x, int y, int dx, int dy, bool bFront) // core read from vram //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void CALLBACK GPUreadDataMem(unsigned int * pMem, int iSize) -#else void CALLBACK GPUreadDataMem(unsigned long * pMem, int iSize) -#endif { int i; @@ -2093,18 +1846,10 @@ ENDREAD: GPUIsIdle; } -#ifdef _WINDOWS unsigned long CALLBACK GPUreadData(void) -#else -unsigned long CALLBACK GPUreadData(void) -#endif { unsigned long l; -#ifdef _WINDOWS - GPUreadDataMem(&l,1); -#else GPUreadDataMem(&l,1); -#endif return GPUdataRet; } @@ -2186,11 +1931,7 @@ const unsigned char primTableCX[256] = // processes data send to GPU data register //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void CALLBACK GPUwriteDataMem(unsigned long * pMem, int iSize) -#else void CALLBACK GPUwriteDataMem(unsigned long * pMem, int iSize) -#endif { unsigned char command; unsigned long gdata=0; @@ -2309,17 +2050,9 @@ GPUIsIdle; //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void CALLBACK GPUwriteData(unsigned long gdata) -#else void CALLBACK GPUwriteData(unsigned long gdata) -#endif { -#ifdef _WINDOWS GPUwriteDataMem(&gdata,1); -#else - GPUwriteDataMem(&gdata,1); -#endif } //////////////////////////////////////////////////////////////////////// @@ -2403,22 +2136,9 @@ void StartCfgTool(char * pCmdLine) // linux: start external #endif -#ifdef _WINDOWS long CALLBACK GPUconfigure(void) -#else -long CALLBACK GPUconfigure(void) -#endif { -#ifdef _WINDOWS -// HWND hWP=GetActiveWindow(); -// DialogBox(hInst,MAKEINTRESOURCE(IDD_CFGDLG), -// hWP,(DLGPROC)CfgDlgProc); -#else - -// StartCfgTool("CFG"); - -#endif return 0; } @@ -2457,11 +2177,7 @@ return FALSE; // core gives a dma chain to gpu: same as the gpuwrite interface funcs //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS long CALLBACK GPUdmaChain(unsigned long * baseAddrL, unsigned long addr) -#else -long CALLBACK GPUdmaChain(unsigned long * baseAddrL, unsigned long addr) -#endif { unsigned long dmaMem; unsigned char * baseAddrB; @@ -2486,11 +2202,7 @@ do dmaMem=addr+4; -#ifdef _WINDOWS if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count); -#else - if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count); -#endif addr = baseAddrL[addr>>2]&0xffffff; } @@ -2505,11 +2217,7 @@ return 0; // show about dlg //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void CALLBACK GPUabout(void) -#else void CALLBACK GPUabout(void) -#endif { } @@ -2518,11 +2226,7 @@ void CALLBACK GPUabout(void) // We are ever fine ;) //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -long CALLBACK GPUtest(void) -#else long CALLBACK GPUtest(void) -#endif { // if test fails this function should return negative value for error (unable to continue) // and positive value for warning (can continue but output might be crappy) @@ -2536,11 +2240,7 @@ long CALLBACK GPUtest(void) //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF) -#else -long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF) -#endif { if(ulGetFreezeData==2) { @@ -2571,17 +2271,6 @@ memcpy(psxVub, pF->psxVRam, 1024*iGPUHeight*2); ResetTextureArea(TRUE); -#ifdef _WINDOWS - GPUwriteStatus(ulStatusControl[0]); - GPUwriteStatus(ulStatusControl[1]); - GPUwriteStatus(ulStatusControl[2]); - GPUwriteStatus(ulStatusControl[3]); - GPUwriteStatus(ulStatusControl[8]); - GPUwriteStatus(ulStatusControl[6]); - GPUwriteStatus(ulStatusControl[7]); - GPUwriteStatus(ulStatusControl[5]); - GPUwriteStatus(ulStatusControl[4]); -#else GPUwriteStatus(ulStatusControl[0]); GPUwriteStatus(ulStatusControl[1]); GPUwriteStatus(ulStatusControl[2]); @@ -2591,7 +2280,6 @@ ResetTextureArea(TRUE); GPUwriteStatus(ulStatusControl[7]); GPUwriteStatus(ulStatusControl[5]); GPUwriteStatus(ulStatusControl[4]); -#endif return 1; } @@ -2839,11 +2527,7 @@ void PaintPicDot(unsigned char * p,unsigned char c) //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void CALLBACK GPUgetScreenPic(unsigned char * pMem) -#else long CALLBACK GPUgetScreenPic(unsigned char * pMem) -#endif { float XS,YS;int x,y,v; unsigned char * ps, * px, * pf; @@ -2851,7 +2535,7 @@ long CALLBACK GPUgetScreenPic(unsigned char * pMem) if(!pGfxCardScreen) { - glPixelStorei(GL_PACK_ALIGNMENT,1); + glPixelStorei(GL_PACK_ALIGNMENT,1); glError(); pGfxCardScreen=(unsigned char *)malloc(iResX*iResY*4); } @@ -2859,7 +2543,7 @@ long CALLBACK GPUgetScreenPic(unsigned char * pMem) // glReadBuffer(GL_FRONT); - glReadPixels(0,0,iResX,iResY,GL_RGB,GL_UNSIGNED_BYTE,ps); + glReadPixels(0,0,iResX,iResY,GL_RGB,GL_UNSIGNED_BYTE,ps); glError(); // glReadBuffer(GL_BACK); @@ -2922,11 +2606,7 @@ long CALLBACK GPUgetScreenPic(unsigned char * pMem) //////////////////////////////////////////////////////////////////////// -#ifdef _WINDOWS -void CALLBACK GPUshowScreenPic(unsigned char * pMem) -#else long CALLBACK GPUshowScreenPic(unsigned char * pMem) -#endif { // DestroyPic(); // if(pMem==0) return; @@ -2973,3 +2653,7 @@ void CALLBACK GPUrearmedCallbacks(const void **cbs) rearmed_get_layer_pos = cbs[0]; } +static void flipEGL(void) +{ + eglSwapBuffers(display, surface); +}