GregMiscellaneous: zzogl-pg: Add a new header. More work on zerogs.h.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/GregMiscellaneous@3928 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-10-17 09:07:16 +00:00
parent bce1dfbade
commit 9bde4de02a
14 changed files with 63 additions and 29 deletions

View File

@ -96,6 +96,7 @@ set(zzoglHeaders
ZZoglCRTC.h
ZZoglMath.h
ZZoglShaders.h
ZZoglShoots.h
ZZGl.h
ZZLog.h)

View File

@ -385,6 +385,8 @@ union tex_0_info
#define TEX_HIGHLIGHT 2
#define TEX_HIGHLIGHT2 3
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height);
typedef struct
{
int lcm;

View File

@ -38,6 +38,7 @@ using namespace std;
#include "targets.h"
#include "ZZoglShaders.h"
#include "ZZoglFlushHack.h"
#include "ZZoglShoots.h"
#ifdef _MSC_VER
#pragma warning(disable:4244)
@ -594,6 +595,9 @@ int CALLBACK GSsetupRecording(int start, void* pData)
return 1;
}
int ZZSave(s8* pbydata);
bool ZZLoad(s8* pbydata);
s32 CALLBACK GSfreeze(int mode, freezeData *data)
{
FUNCLOG

View File

@ -157,6 +157,7 @@
<Unit filename="../../ZZoglShaders.cpp" />
<Unit filename="../../ZZoglShaders.h" />
<Unit filename="../../ZZoglShoots.cpp" />
<Unit filename="../../ZZoglShoots.h" />
<Unit filename="../../ZZoglVB.cpp" />
<Unit filename="../../common.h" />
<Unit filename="../../glprocs.c">

View File

@ -22,7 +22,10 @@
#ifdef USE_OLD_REGS
#include "Regs.h"
#else
#else
bool CheckChangeInClut(u32 highdword, u32 psm); // returns true if clut will change after this tex0 op
enum GIF_REG
{
GIF_REG_PRIM = 0x00,

View File

@ -23,6 +23,8 @@
#ifdef USE_OLD_REGS
bool CheckChangeInClut(u32 highdword, u32 psm); // returns true if clut will change after this tex0 op
enum GIF_REG
{
GIF_REG_PRIM = 0x00,

View File

@ -24,6 +24,7 @@
#include "ZZoglCRTC.h"
#include "GLWin.h"
#include "ZZoglShaders.h"
#include "ZZoglShoots.h"
#include "rasterfont.h" // simple font
//------------------ Defines

View File

@ -24,8 +24,8 @@
#include "Mem.h"
#include "zerogs.h"
#include "GLWin.h"
#include "ZZoglShaders.h"
#include "targets.h"
#include "rasterfont.h" // simple font
@ -163,6 +163,8 @@ u32 ptexBilinearBlocks = 0;
u32 ptexConv32to16 = 0;
int g_nDepthBias = 0;
extern void Delete_Avi_Capture();
//------------------ Code
bool IsGLExt(const char* szTargetExtension)

View File

@ -205,7 +205,7 @@ void FlushTransferRanges(const tex0Info* ptex); //zz
void SetTexVariables(int context, FRAGMENTSHADER* pfragment); // zz
void SetTexInt(int context, FRAGMENTSHADER* pfragment, int settexint); // zz
void SetAlphaVariables(const alphaInfo& ainfo); // zzz
void ResetAlphaVariables();
//void ResetAlphaVariables();
inline void SetAlphaTestInt(pixTest curtest);
@ -2360,9 +2360,9 @@ void SetTexVariablesInt(int context, int bilinear, const tex0Info& tex0, bool Ch
// } \
// else { \
void ResetAlphaVariables() {
FUNCLOG
}
//void ResetAlphaVariables() {
// FUNCLOG
//}
inline void NeedFactor(int w)
{

View File

@ -30,6 +30,7 @@
#include "zerogs.h"
#include "targets.h"
#include "Mem.h"
#include "ZZoglShoots.h"
// AVI Capture
int s_avicapturing = 0;

View File

@ -0,0 +1,35 @@
/* ZZ Open GL graphics plugin
* Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef ZZOGLSHOOTS_H_INCLUDED
#define ZZOGLSHOOTS_H_INCLUDED
void SaveSnapshot(const char* filename);
bool SaveRenderTarget(const char* filename, int width, int height, int jpeg);
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height);
bool SaveJPEG(const char* filename, int width, int height, const void* pdata, int quality);
bool SaveTGA(const char* filename, int width, int height, void* pdata);
void Stop_Avi();
void Delete_Avi_Capture();
void StartCapture();
void StopCapture();
void CaptureFrame();
#endif // ZZOGLSHOOTS_H_INCLUDED

View File

@ -389,7 +389,7 @@ void VB::CheckFrame(int tbp)
if ((prndr != NULL) && (prndr->psm != gsfb.psm))
{
// behavior for dest alpha varies
ResetAlphaVariables();
// ResetAlphaVariables();
}
bChanged = CheckFrameResolveRender(tbp);

View File

@ -26,6 +26,7 @@
#include "zerogs.h"
#include "targets.h"
#include "ZZoglShaders.h"
#ifdef ZEROGS_SSE2
#include <emmintrin.h>
#endif
@ -57,6 +58,8 @@ bool g_bSaveZUpdate = 0;
int VALIDATE_THRESH = 8;
u32 TEXDESTROY_THRESH = 16;
void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, bool mode);
// ------------------------- Useful inlines ------------------------------------
// memory size for one row of texture. It depends on width of texture and number of bytes
@ -514,7 +517,7 @@ void CRenderTarget::Update(int context, CRenderTarget* pdepth)
// reset since settings changed
vb[0].bVarsTexSync = 0;
ResetAlphaVariables();
// ResetAlphaVariables();
}
void CRenderTarget::ConvertTo32()

View File

@ -119,32 +119,11 @@ void TransferLocalLocal();
void RenderCRTC(int interlace);
void ResetRenderTarget(int index);
bool CheckChangeInClut(u32 highdword, u32 psm); // returns true if clut will change after this tex0 op
int ZZSave(s8* pbydata);
bool ZZLoad(s8* pbydata);
void SaveSnapshot(const char* filename);
bool SaveRenderTarget(const char* filename, int width, int height, int jpeg);
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height);
bool SaveJPEG(const char* filename, int width, int height, const void* pdata, int quality);
bool SaveTGA(const char* filename, int width, int height, void* pdata);
void Stop_Avi();
void Delete_Avi_Capture();
// private methods
void FlushSysMem(const RECT* prc);
void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, bool mode);
// returns the first and last addresses aligned to a page that cover
void GetRectMemAddress(int& start, int& end, int psm, int x, int y, int w, int h, int bp, int bw);
void NeedFactor(int w);
void ResetAlphaVariables();
void StartCapture();
void StopCapture();
void CaptureFrame();
// The size in bytes of x strings (of texture).
inline int MemorySize(int x)