mirror of https://github.com/PCSX2/pcsx2.git
zzogl-pg: Create a local fork of ZZOgl to play with. Currently just ZZOgl 211 with name and version changes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2739 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
46c39081c7
commit
799da2100e
|
@ -23,6 +23,7 @@ buildplugin SPU2null $@
|
|||
|
||||
buildplugin zerogs $@
|
||||
buildplugin zzogl $@
|
||||
buildplugin zzogl-pg $@
|
||||
buildplugin zeropad $@
|
||||
buildplugin zerospu2 $@
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
curdir=`pwd`
|
||||
|
||||
echo ----------------------
|
||||
echo Building ZZOpenGL
|
||||
echo ----------------------
|
||||
|
||||
cd ${curdir}/opengl
|
||||
|
||||
if [ $# -gt 0 ] && [ $1 = "all" ]
|
||||
then
|
||||
|
||||
aclocal
|
||||
automake
|
||||
autoconf
|
||||
chmod +x configure
|
||||
./configure --enable-sse2 --prefix=${PCSX2PLUGINS}
|
||||
make clean
|
||||
make install
|
||||
|
||||
else
|
||||
make $@
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#cp libZeroGSogl*.so* ${PCSX2PLUGINS}/
|
||||
cp Win32/ps2hw.dat ${PCSX2PLUGINS}/
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
|||
project(ZeroGSLinux)
|
||||
|
||||
# maybe less is possible but i'm writing this on cmake 2.6 :)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
include_directories(${ZeroGSLinux_SOURCE_DIR}/..)
|
||||
|
||||
add_library(ZeroGSLinux callbacks.c Conf.cpp interface.c Linux.cpp support.c)
|
|
@ -0,0 +1,110 @@
|
|||
/* GSsoft
|
||||
* Copyright (C) 2002-2004 GSsoft Team
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include "GS.h"
|
||||
|
||||
void SaveConfig()
|
||||
{
|
||||
const std::string iniFile( s_strIniPath + "zerogs.ini" );
|
||||
FILE* f = fopen(iniFile.c_str(),"w");
|
||||
|
||||
if (f == NULL)
|
||||
{
|
||||
printf("failed to open %s\n", iniFile.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(f, "interlace = %hhx\n", conf.interlace);
|
||||
fprintf(f, "mrtdepth = %hhx\n", conf.mrtdepth);
|
||||
fprintf(f, "options = %x\n", conf.options); //u32
|
||||
fprintf(f, "bilinear = %hhx\n", conf.bilinear);
|
||||
fprintf(f, "aliasing = %hhx\n", conf.aa);
|
||||
fprintf(f, "gamesettings = %x\n", conf.gamesettings); //u32
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void LoadConfig()
|
||||
{
|
||||
char cfg[255];
|
||||
|
||||
memset(&conf, 0, sizeof(conf));
|
||||
conf.interlace = 0; // on, mode 1
|
||||
conf.mrtdepth = 1;
|
||||
conf.options = 0;
|
||||
conf.bilinear = 1;
|
||||
conf.width = 640;
|
||||
conf.height = 480;
|
||||
conf.aa = 0;
|
||||
|
||||
const std::string iniFile( s_strIniPath + "zerogs.ini" );
|
||||
FILE* f = fopen(iniFile.c_str(), "r");
|
||||
if (f == NULL)
|
||||
{
|
||||
printf("failed to open %s\n", iniFile.c_str());
|
||||
SaveConfig();//save and return
|
||||
return;
|
||||
}
|
||||
fscanf(f, "interlace = %hhx\n", &conf.interlace);
|
||||
fscanf(f, "mrtdepth = %hhx\n", &conf.mrtdepth);
|
||||
fscanf(f, "options = %x\n", &conf.options);//u32
|
||||
fscanf(f, "bilinear = %hhx\n", &conf.bilinear);
|
||||
fscanf(f, "aliasing = %hhx\n", &conf.aa);
|
||||
fscanf(f, "gamesettings = %x\n", &conf.gamesettings);//u32
|
||||
fclose(f);
|
||||
|
||||
// filter bad files
|
||||
if ((conf.aa < 0) || (conf.aa > 4)) conf.aa = 0;
|
||||
|
||||
conf.isWideScreen = conf.options & GSOPTION_WIDESCREEN;
|
||||
switch(conf.options & GSOPTION_WINDIMS)
|
||||
{
|
||||
case GSOPTION_WIN640:
|
||||
conf.width = 640;
|
||||
conf.height = conf.isWideScreen ? 360 : 480;
|
||||
break;
|
||||
case GSOPTION_WIN800:
|
||||
conf.width = 800;
|
||||
conf.height = conf.isWideScreen ? 450 : 600;
|
||||
break;
|
||||
case GSOPTION_WIN1024:
|
||||
conf.width = 1024;
|
||||
conf.height = conf.isWideScreen ? 576 : 768;
|
||||
break;
|
||||
case GSOPTION_WIN1280:
|
||||
conf.width = 1280;
|
||||
conf.height = conf.isWideScreen ? 720 : 960;
|
||||
break;
|
||||
}
|
||||
|
||||
// turn off all hacks by default
|
||||
conf.options &= ~(GSOPTION_WIREFRAME | GSOPTION_CAPTUREAVI);
|
||||
conf.options |= GSOPTION_LOADED;
|
||||
|
||||
if( conf.width <= 0 || conf.height <= 0 )
|
||||
{
|
||||
conf.width = 640;
|
||||
conf.height = 480;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,441 @@
|
|||
/* ZeroGS
|
||||
* Copyright (C) 2002-2004 GSsoft Team
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "GS.h"
|
||||
|
||||
extern "C" {
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
#include "callbacks.h"
|
||||
}
|
||||
|
||||
#include "Linux.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
GtkWidget *Conf, *Logging, *About;
|
||||
GList *fresl, *wresl, *cachesizel, *codecl, *filtersl;
|
||||
|
||||
static int prevbilinearfilter;
|
||||
|
||||
struct confOptsStruct
|
||||
{
|
||||
int value;
|
||||
const char *desc;
|
||||
} confOpts;
|
||||
|
||||
static map<string, confOptsStruct> mapConfOpts;
|
||||
|
||||
void CALLBACK GSkeyEvent(keyEvent *ev)
|
||||
{
|
||||
//static bool bShift = false;
|
||||
static bool bAlt = false;
|
||||
|
||||
switch(ev->evt) {
|
||||
case KEYPRESS:
|
||||
switch(ev->key) {
|
||||
case XK_F5:
|
||||
case XK_F6:
|
||||
case XK_F7:
|
||||
case XK_F9:
|
||||
THR_KeyEvent = ev->key ;
|
||||
break;
|
||||
case XK_Escape:
|
||||
if (conf.options & GSOPTION_FULLSCREEN)
|
||||
GSclose();
|
||||
break;
|
||||
case XK_Shift_L:
|
||||
case XK_Shift_R:
|
||||
//bShift = true;
|
||||
THR_bShift = true;
|
||||
break;
|
||||
case XK_Alt_L:
|
||||
case XK_Alt_R:
|
||||
bAlt = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case KEYRELEASE:
|
||||
switch(ev->key) {
|
||||
case XK_Shift_L:
|
||||
case XK_Shift_R:
|
||||
//bShift = false;
|
||||
THR_bShift = false;
|
||||
break;
|
||||
case XK_Alt_L:
|
||||
case XK_Alt_R:
|
||||
bAlt = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnConf_Ok(GtkButton *button, gpointer user_data)
|
||||
{
|
||||
GtkWidget *Btn;
|
||||
GtkWidget *treeview;
|
||||
GtkTreeModel *treemodel;
|
||||
GtkTreeIter treeiter;
|
||||
gboolean treeoptval;
|
||||
gchar *gbuf;
|
||||
char *str;
|
||||
int i;
|
||||
|
||||
conf.bilinear = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(Conf, "checkBilinear")));
|
||||
// restore
|
||||
if (conf.bilinear && prevbilinearfilter)
|
||||
conf.bilinear = prevbilinearfilter;
|
||||
|
||||
//conf.mrtdepth = 1;//IsDlgButtonChecked(hW, IDC_CONFIG_DEPTHWRITE);
|
||||
|
||||
if is_checked(Conf, "radioAANone")
|
||||
conf.aa = 0;
|
||||
else if is_checked(Conf, "radioAA2X")
|
||||
conf.aa = 1;
|
||||
else if is_checked(Conf, "radioAA4X")
|
||||
conf.aa = 2;
|
||||
else if is_checked(Conf, "radioAA8X")
|
||||
conf.aa = 3;
|
||||
else
|
||||
conf.aa = 4;
|
||||
conf.negaa = 0;
|
||||
|
||||
conf.options = 0;
|
||||
conf.options |= is_checked(Conf, "checkAVI") ? GSOPTION_CAPTUREAVI : 0;
|
||||
conf.options |= is_checked(Conf, "checkWireframe") ? GSOPTION_WIREFRAME : 0;
|
||||
conf.options |= is_checked(Conf, "checkfullscreen") ? GSOPTION_FULLSCREEN : 0;
|
||||
conf.options |= is_checked(Conf, "checkwidescreen") ? GSOPTION_WIDESCREEN : 0;
|
||||
conf.options |= is_checked(Conf, "checkTGA") ? GSOPTION_TGASNAP : 0;
|
||||
|
||||
if is_checked(Conf, "radiointerlace0")
|
||||
conf.interlace = 0;
|
||||
else if is_checked(Conf, "radiointerlace1")
|
||||
conf.interlace = 1;
|
||||
else
|
||||
conf.interlace = 2;
|
||||
|
||||
//------- get advanced options from the treeview model -------//
|
||||
treeview = lookup_widget(Conf,"treeview1");
|
||||
treemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
|
||||
gtk_tree_model_get_iter_first(treemodel, &treeiter);
|
||||
|
||||
conf.gamesettings = 0;
|
||||
for(map<string, confOptsStruct>::iterator it = mapConfOpts.begin(); it != mapConfOpts.end(); ++it)
|
||||
{
|
||||
treeoptval = FALSE;
|
||||
gtk_tree_model_get(treemodel, &treeiter, 0, &treeoptval, -1);
|
||||
|
||||
if(treeoptval) conf.gamesettings |= it->second.value;
|
||||
|
||||
gtk_tree_model_iter_next(treemodel,&treeiter);
|
||||
}
|
||||
|
||||
GSsetGameCRC(0, conf.gamesettings);
|
||||
//---------- done getting advanced options ---------//
|
||||
|
||||
if is_checked(Conf, "radioSize640")
|
||||
conf.options |= GSOPTION_WIN640;
|
||||
else if is_checked(Conf, "radioSize800")
|
||||
conf.options |= GSOPTION_WIN800;
|
||||
else if is_checked(Conf, "radioSize1024")
|
||||
conf.options |= GSOPTION_WIN1024;
|
||||
else if is_checked(Conf, "radioSize1280")
|
||||
conf.options |= GSOPTION_WIN1280;
|
||||
|
||||
SaveConfig();
|
||||
|
||||
gtk_widget_destroy(Conf);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void OnConf_Cancel(GtkButton *button, gpointer user_data)
|
||||
{
|
||||
gtk_widget_destroy(Conf);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void CALLBACK GSconfigure()
|
||||
{
|
||||
char name[32];
|
||||
char descbuf[255];
|
||||
int nmodes, i;
|
||||
bool itval;
|
||||
GtkWidget *treeview;
|
||||
GtkCellRenderer *treerend;
|
||||
GtkListStore *treestore;//Gets typecast as GtkTreeModel as needed.
|
||||
GtkTreeIter treeiter;
|
||||
GtkTreeViewColumn *treecol;
|
||||
|
||||
char strcurdir[256];
|
||||
getcwd(strcurdir, 256);
|
||||
|
||||
if (!(conf.options & GSOPTION_LOADED)) LoadConfig();
|
||||
Conf = create_Config();
|
||||
|
||||
// fixme; Need to check "checkInterlace" as well.
|
||||
if (conf.interlace == 0)
|
||||
set_checked(Conf, "radiointerlace0", true);
|
||||
else if (conf.interlace == 1)
|
||||
set_checked(Conf, "radiointerlace1", true);
|
||||
else
|
||||
set_checked(Conf, "radionointerlace", true);
|
||||
|
||||
set_checked(Conf, "checkBilinear", !!conf.bilinear);
|
||||
//set_checked(Conf, "checkbutton6", conf.mrtdepth);
|
||||
set_checked(Conf, "radioAANone", (conf.aa==0));
|
||||
set_checked(Conf, "radioAA2X", (conf.aa==1));
|
||||
set_checked(Conf, "radioAA4X", (conf.aa==2));
|
||||
set_checked(Conf, "radioAA8X", (conf.aa==3));
|
||||
set_checked(Conf, "radioAA16X", (conf.aa==4));
|
||||
set_checked(Conf, "checkWireframe", (conf.options&GSOPTION_WIREFRAME)?1:0);
|
||||
set_checked(Conf, "checkAVI", (conf.options&GSOPTION_CAPTUREAVI)?1:0);
|
||||
set_checked(Conf, "checkfullscreen", (conf.options&GSOPTION_FULLSCREEN)?1:0);
|
||||
set_checked(Conf, "checkwidescreen", (conf.options&GSOPTION_WIDESCREEN)?1:0);
|
||||
set_checked(Conf, "checkTGA", (conf.options&GSOPTION_TGASNAP)?1:0);
|
||||
|
||||
set_checked(Conf, "radioSize640", ((conf.options&GSOPTION_WINDIMS)>>4)==0);
|
||||
set_checked(Conf, "radioSize800", ((conf.options&GSOPTION_WINDIMS)>>4)==1);
|
||||
set_checked(Conf, "radioSize1024", ((conf.options&GSOPTION_WINDIMS)>>4)==2);
|
||||
set_checked(Conf, "radioSize1280", ((conf.options&GSOPTION_WINDIMS)>>4)==3);
|
||||
|
||||
prevbilinearfilter = conf.bilinear;
|
||||
|
||||
//--------- Let's build a treeview for our advanced options! --------//
|
||||
treeview = lookup_widget(Conf,"treeview1");
|
||||
treestore = gtk_list_store_new(2,G_TYPE_BOOLEAN, G_TYPE_STRING);
|
||||
|
||||
//setup columns in treeview
|
||||
//COLUMN 0 is the checkboxes
|
||||
treecol = gtk_tree_view_column_new();
|
||||
gtk_tree_view_column_set_title(treecol, "Select");
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), treecol);
|
||||
treerend = gtk_cell_renderer_toggle_new();
|
||||
gtk_tree_view_column_pack_start(treecol, treerend, TRUE);
|
||||
gtk_tree_view_column_add_attribute(treecol, treerend, "active", 0);//link 'active' attrib to first column of model
|
||||
g_object_set(treerend, "activatable", TRUE, NULL);//set 'activatable' attrib true by default for all rows regardless of model.
|
||||
g_signal_connect(treerend, "toggled", (GCallback) OnToggle_advopts, treestore);//set a global callback, we also pass a reference to our treestore.
|
||||
|
||||
//COLUMN 1 is the text descriptions
|
||||
treecol = gtk_tree_view_column_new();
|
||||
gtk_tree_view_column_set_title(treecol, "Description");
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), treecol);
|
||||
treerend = gtk_cell_renderer_text_new();
|
||||
gtk_tree_view_column_pack_start(treecol, treerend, TRUE);
|
||||
gtk_tree_view_column_add_attribute(treecol, treerend, "text", 1);//link 'text' attrib to second column of model
|
||||
|
||||
//setup the model with all our rows of option data
|
||||
mapConfOpts.clear();
|
||||
confOpts.value = 0x00000001;
|
||||
confOpts.desc = "Tex Target checking - 00000001\nLego Racers";
|
||||
mapConfOpts["00000001"] = confOpts;
|
||||
confOpts.value = 0x00000002;
|
||||
confOpts.desc = "Auto reset targs - 00000002\nShadow Hearts, Samurai Warriors. Use when game is slow and toggling AA fixes it.";
|
||||
mapConfOpts["00000002"] = confOpts;
|
||||
confOpts.value = 0x00000010;
|
||||
confOpts.desc = "No target resolves - 00000010\nStops all resolving of targets. Try this first for really slow games. Dark Cloud 1";
|
||||
mapConfOpts["00000010"] = confOpts;
|
||||
confOpts.value = 0x00000020;
|
||||
confOpts.desc = "Exact color testing - 00000020\nFixes overbright or shadow/black artifacts (Crash 'n Burn).";
|
||||
mapConfOpts["00000020"] = confOpts;
|
||||
confOpts.value = 0x00000040;
|
||||
confOpts.desc = "No color clamping - 00000040\nSpeeds up games, but might be too bright or too dim.";
|
||||
mapConfOpts["00000040"] = confOpts;
|
||||
confOpts.value = 0x00000100;
|
||||
confOpts.desc = "Alpha Fail hack - 00000100\nFor Sonic Unleashed, Shadow the Hedgehog, Ghost in the Shell. Remove vertical stripes or other coloring artefacts. Break Persona 4 and MGS3";
|
||||
mapConfOpts["00000100"] = confOpts;
|
||||
confOpts.value = 0x00000200;
|
||||
confOpts.desc = "Disable depth updates - 00000200";
|
||||
mapConfOpts["00000200"] = confOpts;
|
||||
confOpts.value = 0x00000400;
|
||||
confOpts.desc = "Resolve Hack #1 - 00000400\nKingdom Hearts. Speeds some games.";
|
||||
mapConfOpts["00000400"] = confOpts;
|
||||
confOpts.value = 0x00000800;
|
||||
confOpts.desc = "Resolve Hack #2 - 00000800\nShadow Hearts, Urbz. Destroy FFX";
|
||||
mapConfOpts["00000800"] = confOpts;
|
||||
confOpts.value = 0x00001000;
|
||||
confOpts.desc = "No target CLUT - 00001000\nResident Evil 4, or foggy scenes.";
|
||||
mapConfOpts["00001000"] = confOpts;
|
||||
confOpts.value = 0x00002000;
|
||||
confOpts.desc = "Disable stencil buffer - 00002000\nUsually safe to do for simple scenes. Harvest Moon";
|
||||
mapConfOpts["00002000"] = confOpts;
|
||||
confOpts.value = 0x00008000;
|
||||
confOpts.desc = "No depth resolve - 00008000\nMight give z buffer artifacts.";
|
||||
mapConfOpts["00008000"] = confOpts;
|
||||
confOpts.value = 0x00010000;
|
||||
confOpts.desc = "Full 16 bit resolution - 00010000\nUse when half the screen is missing.";
|
||||
mapConfOpts["00010000"] = confOpts;
|
||||
confOpts.value = 0x00020000;
|
||||
confOpts.desc = "Resolve Hack #3 - 00020000\nNeopets";
|
||||
mapConfOpts["00020000"] = confOpts;
|
||||
confOpts.value = 0x00040000;
|
||||
confOpts.desc = "Fast Update - 00040000\nOkami. Speeds some games. Needs for Sonic Unleashed";
|
||||
mapConfOpts["00040000"] = confOpts;
|
||||
confOpts.value = 0x00080000;
|
||||
confOpts.desc = "Disable alpha testing - 00080000";
|
||||
mapConfOpts["00080000"] = confOpts;
|
||||
confOpts.value = 0x00100000;
|
||||
confOpts.desc = "Enable Multiple RTs - 00100000";
|
||||
mapConfOpts["00100000"] = confOpts;
|
||||
confOpts.value = 0x01000000;
|
||||
confOpts.desc = "Specular Highlights - 01000000\nMakes xenosaga and Okage graphics faster by removing highlights";
|
||||
mapConfOpts["01000000"] = confOpts;
|
||||
confOpts.value = 0x02000000;
|
||||
confOpts.desc = "Partial targets - 02000000";
|
||||
mapConfOpts["00200000"] = confOpts;
|
||||
confOpts.value = 0x04000000;
|
||||
confOpts.desc = "Partial depth - 04000000";
|
||||
mapConfOpts["04000000"] = confOpts;
|
||||
confOpts.value = 0x10000000;
|
||||
confOpts.desc = "Gust fix, made gustgame more clean and fast - 10000000";
|
||||
mapConfOpts["10000000"] = confOpts;
|
||||
confOpts.value = 0x20000000;
|
||||
confOpts.desc = "No logarphmic Z, could decrease number of Z-artefacts - 20000000";
|
||||
mapConfOpts["20000000"] = confOpts;
|
||||
|
||||
confOpts.value = 0x00000004;
|
||||
confOpts.desc = "Interlace 2X - 00000004\nFixes 2x bigger screen (Gradius 3).";
|
||||
mapConfOpts["00000004"] = confOpts;
|
||||
|
||||
for(map<string, confOptsStruct>::iterator it = mapConfOpts.begin(); it != mapConfOpts.end(); ++it)
|
||||
{
|
||||
gtk_list_store_append(treestore, &treeiter);//new row
|
||||
itval = (conf.gamesettings&it->second.value)?TRUE:FALSE;
|
||||
snprintf(descbuf, 254, "%s", it->second.desc);
|
||||
gtk_list_store_set(treestore, &treeiter, 0, itval, 1, descbuf, -1);
|
||||
}
|
||||
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(treestore));//NB: store is cast as tree model.
|
||||
g_object_unref(treestore);//allow model to be destroyed when the tree is destroyed.
|
||||
|
||||
//don't select/highlight rows
|
||||
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), GTK_SELECTION_NONE);
|
||||
//------treeview done -------//
|
||||
|
||||
//Let's do it!
|
||||
gtk_widget_show_all(Conf);
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
void OnToggle_advopts(GtkCellRendererToggle *cell, gchar *path, gpointer user_data)
|
||||
{
|
||||
GtkTreeIter treeiter;
|
||||
gboolean val;
|
||||
|
||||
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(user_data), &treeiter, path);
|
||||
gtk_tree_model_get(GTK_TREE_MODEL(user_data), &treeiter, 0, &val, -1);
|
||||
val = !val;
|
||||
gtk_list_store_set(GTK_LIST_STORE(user_data), &treeiter, 0, val, -1);
|
||||
|
||||
}
|
||||
|
||||
void OnAbout_Ok(GtkButton *button, gpointer user_data)
|
||||
{
|
||||
gtk_widget_destroy(About);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void CALLBACK GSabout()
|
||||
{
|
||||
About = create_About();
|
||||
|
||||
gtk_widget_show_all(About);
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
s32 CALLBACK GStest()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GtkWidget *MsgDlg;
|
||||
|
||||
void OnMsg_Ok()
|
||||
{
|
||||
gtk_widget_destroy(MsgDlg);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void SysMessage(const char *fmt, ...)
|
||||
{
|
||||
GtkWidget *Ok,*Txt;
|
||||
GtkWidget *Box,*Box1;
|
||||
va_list list;
|
||||
char msg[512];
|
||||
|
||||
va_start(list, fmt);
|
||||
vsprintf(msg, fmt, list);
|
||||
va_end(list);
|
||||
|
||||
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
|
||||
|
||||
MsgDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER);
|
||||
gtk_window_set_title(GTK_WINDOW(MsgDlg), "GSsoft Msg");
|
||||
gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 5);
|
||||
|
||||
Box = gtk_vbox_new(5, 0);
|
||||
gtk_container_add(GTK_CONTAINER(MsgDlg), Box);
|
||||
gtk_widget_show(Box);
|
||||
|
||||
Txt = gtk_label_new(msg);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5);
|
||||
gtk_widget_show(Txt);
|
||||
|
||||
Box1 = gtk_hbutton_box_new();
|
||||
gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0);
|
||||
gtk_widget_show(Box1);
|
||||
|
||||
Ok = gtk_button_new_with_label("Ok");
|
||||
gtk_signal_connect (GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL);
|
||||
gtk_container_add(GTK_CONTAINER(Box1), Ok);
|
||||
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
|
||||
gtk_widget_show(Ok);
|
||||
|
||||
gtk_widget_show(MsgDlg);
|
||||
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
void *SysLoadLibrary(char *lib)
|
||||
{
|
||||
return dlopen(lib, RTLD_NOW | RTLD_GLOBAL);
|
||||
}
|
||||
|
||||
void *SysLoadSym(void *lib, char *sym)
|
||||
{
|
||||
void *ret = dlsym(lib, sym);
|
||||
if (ret == NULL) printf("null: %s\n", sym);
|
||||
return dlsym(lib, sym);
|
||||
}
|
||||
|
||||
char *SysLibError()
|
||||
{
|
||||
return dlerror();
|
||||
}
|
||||
|
||||
void SysCloseLibrary(void *lib)
|
||||
{
|
||||
dlclose(lib);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2004 GSsoft Team
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_H__
|
||||
#define __LINUX_H__
|
||||
#endif
|
||||
|
||||
void OnToggle_advopts(GtkCellRendererToggle *cell, gchar *path, gpointer user_data);
|
||||
|
||||
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
|
@ -0,0 +1,531 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# Linux/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
|
||||
pkgdatadir = $(datadir)/ZZOgl-pg
|
||||
pkgincludedir = $(includedir)/ZZOgl-pg
|
||||
pkglibdir = $(libdir)/ZZOgl-pg
|
||||
pkglibexecdir = $(libexecdir)/ZZOgl-pg
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = Linux
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
libZeroGSLinux_a_AR = $(AR) $(ARFLAGS)
|
||||
libZeroGSLinux_a_LIBADD =
|
||||
am_libZeroGSLinux_a_OBJECTS = libZeroGSLinux_a-callbacks.$(OBJEXT) \
|
||||
libZeroGSLinux_a-Conf.$(OBJEXT) \
|
||||
libZeroGSLinux_a-interface.$(OBJEXT) \
|
||||
libZeroGSLinux_a-Linux.$(OBJEXT) \
|
||||
libZeroGSLinux_a-support.$(OBJEXT)
|
||||
libZeroGSLinux_a_OBJECTS = $(am_libZeroGSLinux_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
SOURCES = $(libZeroGSLinux_a_SOURCES)
|
||||
DIST_SOURCES = $(libZeroGSLinux_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run aclocal-1.11
|
||||
AMTAR = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run tar
|
||||
AUTOCONF = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run automake-1.11
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCAS = gcc
|
||||
CCASDEPMODE = depmode=gcc3
|
||||
CCASFLAGS = -g -O2
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -I/opt/cg/include -L/opt/cg/lib -Wall -Wno-format -Wno-unused -O2 -msse2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS = -I/opt/cg/include -L/opt/cg/lib -Wall -Wno-format -Wno-unused -O2 -msse2
|
||||
CXX = gcc
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -I/opt/cg/include -L/opt/cg/lib -Wall -Wno-format -Wno-unused -O2 -msse2 -fno-regmove
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DPACKAGE_NAME=\"ZZOgl-pg\" -DPACKAGE_TARNAME=\"zzogl-pg\" -DPACKAGE_VERSION=\"0.1.0\" -DPACKAGE_STRING=\"ZZOgl-pg\ 0.1.0\" -DPACKAGE_BUGREPORT=\"arcum42@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"ZZOgl-pg\" -DVERSION=\"0.1.0\" -DNDEBUG=1 -DRELEASE_TO_PUBLIC=1 -DZEROGS_SSE2=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DHAVE_GL_GLEXT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_CG_CG_H=1 -DHAVE_CG_CGGL_H=1 -DHAVE_JPEGLIB_H=1
|
||||
DEPDIR = .deps
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /bin/grep -E
|
||||
EXEEXT =
|
||||
GREP = /bin/grep
|
||||
GTK_CONFIG = pkg-config
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
LDFLAGS =
|
||||
LIBOBJS =
|
||||
LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lGL -lGLU -lGLEW -ljpeg -lpthread -lstdc++ -lz -ldl -lXxf86vm -lCg -lCgGL
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run makeinfo
|
||||
MKDIR_P = /bin/mkdir -p
|
||||
OBJEXT = o
|
||||
PACKAGE = ZZOgl-pg
|
||||
PACKAGE_BUGREPORT = arcum42@gmail.com
|
||||
PACKAGE_NAME = ZZOgl-pg
|
||||
PACKAGE_STRING = ZZOgl-pg 0.1.0
|
||||
PACKAGE_TARNAME = zzogl-pg
|
||||
PACKAGE_URL =
|
||||
PACKAGE_VERSION = 0.1.0
|
||||
PATH_SEPARATOR = :
|
||||
RANLIB = ranlib
|
||||
SET_MAKE =
|
||||
SHARED_LDFLAGS = -shared
|
||||
SHELL = /bin/sh
|
||||
STRIP =
|
||||
VERSION = 0.1.0
|
||||
ZEROGS_AGE = 0
|
||||
ZEROGS_CURRENT = 0
|
||||
ZEROGS_RELEASE = 0.1.0
|
||||
ZEROGS_REVISION = 1
|
||||
ZEROGS_SONAME = libzzoglpg.so.0.1.0
|
||||
abs_builddir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/Linux
|
||||
abs_srcdir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/Linux
|
||||
abs_top_builddir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl
|
||||
abs_top_srcdir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = gcc
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = ${AMTAR} chof - "$$tardir"
|
||||
am__untar = ${AMTAR} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build_alias =
|
||||
builddir = .
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host_alias =
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = /bin/mkdir -p
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix =
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
so_ext = .so.0.1.0
|
||||
srcdir = .
|
||||
sysconfdir = ${prefix}/etc
|
||||
target_alias =
|
||||
top_build_prefix = ../
|
||||
top_builddir = ..
|
||||
top_srcdir = ..
|
||||
noinst_LIBRARIES = libZeroGSLinux.a
|
||||
#libZeroGSLinux_a_CPPFLAGS = -fPIC
|
||||
#libZeroGSLinux_a_CXXFLAGS = -fPIC
|
||||
#libZeroGSLinux_a_CFLAGS = -fPIC
|
||||
INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I./../ -I./../../../../common/include
|
||||
libZeroGSLinux_a_SOURCES = callbacks.c Conf.cpp interface.c Linux.cpp support.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Linux/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Linux/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libZeroGSLinux.a: $(libZeroGSLinux_a_OBJECTS) $(libZeroGSLinux_a_DEPENDENCIES)
|
||||
-rm -f libZeroGSLinux.a
|
||||
$(libZeroGSLinux_a_AR) libZeroGSLinux.a $(libZeroGSLinux_a_OBJECTS) $(libZeroGSLinux_a_LIBADD)
|
||||
$(RANLIB) libZeroGSLinux.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
include ./$(DEPDIR)/libZeroGSLinux_a-Conf.Po
|
||||
include ./$(DEPDIR)/libZeroGSLinux_a-Linux.Po
|
||||
include ./$(DEPDIR)/libZeroGSLinux_a-callbacks.Po
|
||||
include ./$(DEPDIR)/libZeroGSLinux_a-interface.Po
|
||||
include ./$(DEPDIR)/libZeroGSLinux_a-support.Po
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
libZeroGSLinux_a-callbacks.o: callbacks.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-callbacks.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo -c -o libZeroGSLinux_a-callbacks.o `test -f 'callbacks.c' || echo '$(srcdir)/'`callbacks.c
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo $(DEPDIR)/libZeroGSLinux_a-callbacks.Po
|
||||
# source='callbacks.c' object='libZeroGSLinux_a-callbacks.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-callbacks.o `test -f 'callbacks.c' || echo '$(srcdir)/'`callbacks.c
|
||||
|
||||
libZeroGSLinux_a-callbacks.obj: callbacks.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-callbacks.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo -c -o libZeroGSLinux_a-callbacks.obj `if test -f 'callbacks.c'; then $(CYGPATH_W) 'callbacks.c'; else $(CYGPATH_W) '$(srcdir)/callbacks.c'; fi`
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo $(DEPDIR)/libZeroGSLinux_a-callbacks.Po
|
||||
# source='callbacks.c' object='libZeroGSLinux_a-callbacks.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-callbacks.obj `if test -f 'callbacks.c'; then $(CYGPATH_W) 'callbacks.c'; else $(CYGPATH_W) '$(srcdir)/callbacks.c'; fi`
|
||||
|
||||
libZeroGSLinux_a-interface.o: interface.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-interface.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-interface.Tpo -c -o libZeroGSLinux_a-interface.o `test -f 'interface.c' || echo '$(srcdir)/'`interface.c
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-interface.Tpo $(DEPDIR)/libZeroGSLinux_a-interface.Po
|
||||
# source='interface.c' object='libZeroGSLinux_a-interface.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-interface.o `test -f 'interface.c' || echo '$(srcdir)/'`interface.c
|
||||
|
||||
libZeroGSLinux_a-interface.obj: interface.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-interface.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-interface.Tpo -c -o libZeroGSLinux_a-interface.obj `if test -f 'interface.c'; then $(CYGPATH_W) 'interface.c'; else $(CYGPATH_W) '$(srcdir)/interface.c'; fi`
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-interface.Tpo $(DEPDIR)/libZeroGSLinux_a-interface.Po
|
||||
# source='interface.c' object='libZeroGSLinux_a-interface.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-interface.obj `if test -f 'interface.c'; then $(CYGPATH_W) 'interface.c'; else $(CYGPATH_W) '$(srcdir)/interface.c'; fi`
|
||||
|
||||
libZeroGSLinux_a-support.o: support.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-support.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-support.Tpo -c -o libZeroGSLinux_a-support.o `test -f 'support.c' || echo '$(srcdir)/'`support.c
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-support.Tpo $(DEPDIR)/libZeroGSLinux_a-support.Po
|
||||
# source='support.c' object='libZeroGSLinux_a-support.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-support.o `test -f 'support.c' || echo '$(srcdir)/'`support.c
|
||||
|
||||
libZeroGSLinux_a-support.obj: support.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-support.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-support.Tpo -c -o libZeroGSLinux_a-support.obj `if test -f 'support.c'; then $(CYGPATH_W) 'support.c'; else $(CYGPATH_W) '$(srcdir)/support.c'; fi`
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-support.Tpo $(DEPDIR)/libZeroGSLinux_a-support.Po
|
||||
# source='support.c' object='libZeroGSLinux_a-support.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-support.obj `if test -f 'support.c'; then $(CYGPATH_W) 'support.c'; else $(CYGPATH_W) '$(srcdir)/support.c'; fi`
|
||||
|
||||
.cpp.o:
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
libZeroGSLinux_a-Conf.o: Conf.cpp
|
||||
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Conf.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo -c -o libZeroGSLinux_a-Conf.o `test -f 'Conf.cpp' || echo '$(srcdir)/'`Conf.cpp
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo $(DEPDIR)/libZeroGSLinux_a-Conf.Po
|
||||
# source='Conf.cpp' object='libZeroGSLinux_a-Conf.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Conf.o `test -f 'Conf.cpp' || echo '$(srcdir)/'`Conf.cpp
|
||||
|
||||
libZeroGSLinux_a-Conf.obj: Conf.cpp
|
||||
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Conf.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo -c -o libZeroGSLinux_a-Conf.obj `if test -f 'Conf.cpp'; then $(CYGPATH_W) 'Conf.cpp'; else $(CYGPATH_W) '$(srcdir)/Conf.cpp'; fi`
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo $(DEPDIR)/libZeroGSLinux_a-Conf.Po
|
||||
# source='Conf.cpp' object='libZeroGSLinux_a-Conf.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Conf.obj `if test -f 'Conf.cpp'; then $(CYGPATH_W) 'Conf.cpp'; else $(CYGPATH_W) '$(srcdir)/Conf.cpp'; fi`
|
||||
|
||||
libZeroGSLinux_a-Linux.o: Linux.cpp
|
||||
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Linux.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo -c -o libZeroGSLinux_a-Linux.o `test -f 'Linux.cpp' || echo '$(srcdir)/'`Linux.cpp
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo $(DEPDIR)/libZeroGSLinux_a-Linux.Po
|
||||
# source='Linux.cpp' object='libZeroGSLinux_a-Linux.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Linux.o `test -f 'Linux.cpp' || echo '$(srcdir)/'`Linux.cpp
|
||||
|
||||
libZeroGSLinux_a-Linux.obj: Linux.cpp
|
||||
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Linux.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo -c -o libZeroGSLinux_a-Linux.obj `if test -f 'Linux.cpp'; then $(CYGPATH_W) 'Linux.cpp'; else $(CYGPATH_W) '$(srcdir)/Linux.cpp'; fi`
|
||||
$(am__mv) $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo $(DEPDIR)/libZeroGSLinux_a-Linux.Po
|
||||
# source='Linux.cpp' object='libZeroGSLinux_a-Linux.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Linux.obj `if test -f 'Linux.cpp'; then $(CYGPATH_W) 'Linux.cpp'; else $(CYGPATH_W) '$(srcdir)/Linux.cpp'; fi`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,10 @@
|
|||
noinst_LIBRARIES = libZeroGSLinux.a
|
||||
|
||||
if X86_64
|
||||
libZeroGSLinux_a_CPPFLAGS = -fPIC
|
||||
libZeroGSLinux_a_CXXFLAGS = -fPIC
|
||||
libZeroGSLinux_a_CFLAGS = -fPIC
|
||||
endif
|
||||
|
||||
INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../ -I@srcdir@/../../../../common/include
|
||||
libZeroGSLinux_a_SOURCES = callbacks.c Conf.cpp interface.c Linux.cpp support.c
|
|
@ -0,0 +1,531 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = Linux
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
libZeroGSLinux_a_AR = $(AR) $(ARFLAGS)
|
||||
libZeroGSLinux_a_LIBADD =
|
||||
am_libZeroGSLinux_a_OBJECTS = libZeroGSLinux_a-callbacks.$(OBJEXT) \
|
||||
libZeroGSLinux_a-Conf.$(OBJEXT) \
|
||||
libZeroGSLinux_a-interface.$(OBJEXT) \
|
||||
libZeroGSLinux_a-Linux.$(OBJEXT) \
|
||||
libZeroGSLinux_a-support.$(OBJEXT)
|
||||
libZeroGSLinux_a_OBJECTS = $(am_libZeroGSLinux_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
SOURCES = $(libZeroGSLinux_a_SOURCES)
|
||||
DIST_SOURCES = $(libZeroGSLinux_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
GTK_CONFIG = @GTK_CONFIG@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_LDFLAGS = @SHARED_LDFLAGS@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ZEROGS_AGE = @ZEROGS_AGE@
|
||||
ZEROGS_CURRENT = @ZEROGS_CURRENT@
|
||||
ZEROGS_RELEASE = @ZEROGS_RELEASE@
|
||||
ZEROGS_REVISION = @ZEROGS_REVISION@
|
||||
ZEROGS_SONAME = @ZEROGS_SONAME@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
so_ext = @so_ext@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
noinst_LIBRARIES = libZeroGSLinux.a
|
||||
@X86_64_TRUE@libZeroGSLinux_a_CPPFLAGS = -fPIC
|
||||
@X86_64_TRUE@libZeroGSLinux_a_CXXFLAGS = -fPIC
|
||||
@X86_64_TRUE@libZeroGSLinux_a_CFLAGS = -fPIC
|
||||
INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../ -I@srcdir@/../../../../common/include
|
||||
libZeroGSLinux_a_SOURCES = callbacks.c Conf.cpp interface.c Linux.cpp support.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Linux/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Linux/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libZeroGSLinux.a: $(libZeroGSLinux_a_OBJECTS) $(libZeroGSLinux_a_DEPENDENCIES)
|
||||
-rm -f libZeroGSLinux.a
|
||||
$(libZeroGSLinux_a_AR) libZeroGSLinux.a $(libZeroGSLinux_a_OBJECTS) $(libZeroGSLinux_a_LIBADD)
|
||||
$(RANLIB) libZeroGSLinux.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libZeroGSLinux_a-Conf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libZeroGSLinux_a-Linux.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libZeroGSLinux_a-callbacks.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libZeroGSLinux_a-interface.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libZeroGSLinux_a-support.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
libZeroGSLinux_a-callbacks.o: callbacks.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-callbacks.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo -c -o libZeroGSLinux_a-callbacks.o `test -f 'callbacks.c' || echo '$(srcdir)/'`callbacks.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo $(DEPDIR)/libZeroGSLinux_a-callbacks.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='callbacks.c' object='libZeroGSLinux_a-callbacks.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-callbacks.o `test -f 'callbacks.c' || echo '$(srcdir)/'`callbacks.c
|
||||
|
||||
libZeroGSLinux_a-callbacks.obj: callbacks.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-callbacks.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo -c -o libZeroGSLinux_a-callbacks.obj `if test -f 'callbacks.c'; then $(CYGPATH_W) 'callbacks.c'; else $(CYGPATH_W) '$(srcdir)/callbacks.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-callbacks.Tpo $(DEPDIR)/libZeroGSLinux_a-callbacks.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='callbacks.c' object='libZeroGSLinux_a-callbacks.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-callbacks.obj `if test -f 'callbacks.c'; then $(CYGPATH_W) 'callbacks.c'; else $(CYGPATH_W) '$(srcdir)/callbacks.c'; fi`
|
||||
|
||||
libZeroGSLinux_a-interface.o: interface.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-interface.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-interface.Tpo -c -o libZeroGSLinux_a-interface.o `test -f 'interface.c' || echo '$(srcdir)/'`interface.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-interface.Tpo $(DEPDIR)/libZeroGSLinux_a-interface.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='interface.c' object='libZeroGSLinux_a-interface.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-interface.o `test -f 'interface.c' || echo '$(srcdir)/'`interface.c
|
||||
|
||||
libZeroGSLinux_a-interface.obj: interface.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-interface.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-interface.Tpo -c -o libZeroGSLinux_a-interface.obj `if test -f 'interface.c'; then $(CYGPATH_W) 'interface.c'; else $(CYGPATH_W) '$(srcdir)/interface.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-interface.Tpo $(DEPDIR)/libZeroGSLinux_a-interface.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='interface.c' object='libZeroGSLinux_a-interface.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-interface.obj `if test -f 'interface.c'; then $(CYGPATH_W) 'interface.c'; else $(CYGPATH_W) '$(srcdir)/interface.c'; fi`
|
||||
|
||||
libZeroGSLinux_a-support.o: support.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-support.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-support.Tpo -c -o libZeroGSLinux_a-support.o `test -f 'support.c' || echo '$(srcdir)/'`support.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-support.Tpo $(DEPDIR)/libZeroGSLinux_a-support.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='support.c' object='libZeroGSLinux_a-support.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-support.o `test -f 'support.c' || echo '$(srcdir)/'`support.c
|
||||
|
||||
libZeroGSLinux_a-support.obj: support.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -MT libZeroGSLinux_a-support.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-support.Tpo -c -o libZeroGSLinux_a-support.obj `if test -f 'support.c'; then $(CYGPATH_W) 'support.c'; else $(CYGPATH_W) '$(srcdir)/support.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-support.Tpo $(DEPDIR)/libZeroGSLinux_a-support.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='support.c' object='libZeroGSLinux_a-support.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CFLAGS) $(CFLAGS) -c -o libZeroGSLinux_a-support.obj `if test -f 'support.c'; then $(CYGPATH_W) 'support.c'; else $(CYGPATH_W) '$(srcdir)/support.c'; fi`
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
libZeroGSLinux_a-Conf.o: Conf.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Conf.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo -c -o libZeroGSLinux_a-Conf.o `test -f 'Conf.cpp' || echo '$(srcdir)/'`Conf.cpp
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo $(DEPDIR)/libZeroGSLinux_a-Conf.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Conf.cpp' object='libZeroGSLinux_a-Conf.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Conf.o `test -f 'Conf.cpp' || echo '$(srcdir)/'`Conf.cpp
|
||||
|
||||
libZeroGSLinux_a-Conf.obj: Conf.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Conf.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo -c -o libZeroGSLinux_a-Conf.obj `if test -f 'Conf.cpp'; then $(CYGPATH_W) 'Conf.cpp'; else $(CYGPATH_W) '$(srcdir)/Conf.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-Conf.Tpo $(DEPDIR)/libZeroGSLinux_a-Conf.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Conf.cpp' object='libZeroGSLinux_a-Conf.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Conf.obj `if test -f 'Conf.cpp'; then $(CYGPATH_W) 'Conf.cpp'; else $(CYGPATH_W) '$(srcdir)/Conf.cpp'; fi`
|
||||
|
||||
libZeroGSLinux_a-Linux.o: Linux.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Linux.o -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo -c -o libZeroGSLinux_a-Linux.o `test -f 'Linux.cpp' || echo '$(srcdir)/'`Linux.cpp
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo $(DEPDIR)/libZeroGSLinux_a-Linux.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Linux.cpp' object='libZeroGSLinux_a-Linux.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Linux.o `test -f 'Linux.cpp' || echo '$(srcdir)/'`Linux.cpp
|
||||
|
||||
libZeroGSLinux_a-Linux.obj: Linux.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -MT libZeroGSLinux_a-Linux.obj -MD -MP -MF $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo -c -o libZeroGSLinux_a-Linux.obj `if test -f 'Linux.cpp'; then $(CYGPATH_W) 'Linux.cpp'; else $(CYGPATH_W) '$(srcdir)/Linux.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libZeroGSLinux_a-Linux.Tpo $(DEPDIR)/libZeroGSLinux_a-Linux.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Linux.cpp' object='libZeroGSLinux_a-Linux.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libZeroGSLinux_a_CPPFLAGS) $(CPPFLAGS) $(libZeroGSLinux_a_CXXFLAGS) $(CXXFLAGS) -c -o libZeroGSLinux_a-Linux.obj `if test -f 'Linux.cpp'; then $(CYGPATH_W) 'Linux.cpp'; else $(CYGPATH_W) '$(srcdir)/Linux.cpp'; fi`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,9 @@
|
|||
# builds the GUI C classes
|
||||
mkdir temp
|
||||
cp zerogs.glade temp/
|
||||
cd temp
|
||||
glade-2 --write-source zerogs.glade
|
||||
rm src/main.c
|
||||
cp src/*.h src/*.c ../
|
||||
cd ..
|
||||
/bin/rm -rf temp
|
|
@ -0,0 +1,34 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
|
||||
|
||||
void
|
||||
OnConf_Ok (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnConf_Cancel (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnAbout_Ok (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
void
|
||||
OnConf_Ok (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnConf_Cancel (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnAbout_Ok (GtkButton *button,
|
||||
gpointer user_data);
|
|
@ -0,0 +1,34 @@
|
|||
# Install script for directory: /usr/local/src/pcsx2-4/plugins/zzogl/opengl/Linux
|
||||
|
||||
# Set the install prefix
|
||||
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
IF(BUILD_TYPE)
|
||||
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
ELSE(BUILD_TYPE)
|
||||
SET(CMAKE_INSTALL_CONFIG_NAME "Release")
|
||||
ENDIF(BUILD_TYPE)
|
||||
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
|
||||
# Set the component getting installed.
|
||||
IF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
IF(COMPONENT)
|
||||
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
|
||||
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
ELSE(COMPONENT)
|
||||
SET(CMAKE_INSTALL_COMPONENT)
|
||||
ENDIF(COMPONENT)
|
||||
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
|
||||
# Install shared libraries without execute permission?
|
||||
IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
SET(CMAKE_INSTALL_SO_NO_EXE "0")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
|
|
@ -0,0 +1,392 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
|
||||
#define GLADE_HOOKUP_OBJECT(component,widget,name) \
|
||||
g_object_set_data_full (G_OBJECT (component), name, \
|
||||
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
|
||||
|
||||
#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
|
||||
g_object_set_data (G_OBJECT (component), name, widget)
|
||||
|
||||
GtkWidget*
|
||||
create_Config (void)
|
||||
{
|
||||
GtkWidget *Config;
|
||||
GtkWidget *vbox4;
|
||||
GtkWidget *frame7;
|
||||
GtkWidget *alignment4;
|
||||
GtkWidget *hbox8;
|
||||
GtkWidget *radionointerlace;
|
||||
GSList *radionointerlace_group = NULL;
|
||||
GtkWidget *radiointerlace0;
|
||||
GtkWidget *radiointerlace1;
|
||||
GtkWidget *label13;
|
||||
GtkWidget *checkBilinear;
|
||||
GtkWidget *frame4;
|
||||
GtkWidget *alignment1;
|
||||
GtkWidget *hbox6;
|
||||
GtkWidget *radioAANone;
|
||||
GSList *radioAANone_group = NULL;
|
||||
GtkWidget *radioAA2X;
|
||||
GtkWidget *radioAA4X;
|
||||
GtkWidget *radioAA8X;
|
||||
GtkWidget *radioAA16X;
|
||||
GtkWidget *label9;
|
||||
GtkWidget *checkWireframe;
|
||||
GtkWidget *checkAVI;
|
||||
GtkWidget *checkTGA;
|
||||
GtkWidget *checkfullscreen;
|
||||
GtkWidget *checkwidescreen;
|
||||
GtkWidget *frame5;
|
||||
GtkWidget *alignment2;
|
||||
GtkWidget *hbox7;
|
||||
GtkWidget *radioSize640;
|
||||
GSList *radioSize640_group = NULL;
|
||||
GtkWidget *radioSize800;
|
||||
GtkWidget *radioSize1024;
|
||||
GtkWidget *radioSize1280;
|
||||
GtkWidget *label10;
|
||||
GtkWidget *frame6;
|
||||
GtkWidget *alignment3;
|
||||
GtkWidget *scrolledwindow1;
|
||||
GtkWidget *treeview1;
|
||||
GtkWidget *label12;
|
||||
GtkWidget *label11;
|
||||
GtkWidget *hbuttonbox1;
|
||||
GtkWidget *button1;
|
||||
GtkWidget *button2;
|
||||
|
||||
Config = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (Config), 5);
|
||||
gtk_window_set_title (GTK_WINDOW (Config), _("ZeroOGS Configuration"));
|
||||
|
||||
vbox4 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vbox4);
|
||||
gtk_container_add (GTK_CONTAINER (Config), vbox4);
|
||||
|
||||
frame7 = gtk_frame_new (NULL);
|
||||
gtk_widget_show (frame7);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), frame7, FALSE, FALSE, 0);
|
||||
|
||||
alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_widget_show (alignment4);
|
||||
gtk_container_add (GTK_CONTAINER (frame7), alignment4);
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0);
|
||||
|
||||
hbox8 = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_show (hbox8);
|
||||
gtk_container_add (GTK_CONTAINER (alignment4), hbox8);
|
||||
|
||||
radionointerlace = gtk_radio_button_new_with_mnemonic (NULL, _("Interlace Off"));
|
||||
gtk_widget_show (radionointerlace);
|
||||
gtk_box_pack_start (GTK_BOX (hbox8), radionointerlace, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radionointerlace), radionointerlace_group);
|
||||
radionointerlace_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radionointerlace));
|
||||
|
||||
radiointerlace0 = gtk_radio_button_new_with_mnemonic (NULL, _("Interlace 0"));
|
||||
gtk_widget_show (radiointerlace0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox8), radiointerlace0, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiointerlace0), radionointerlace_group);
|
||||
radionointerlace_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiointerlace0));
|
||||
|
||||
radiointerlace1 = gtk_radio_button_new_with_mnemonic (NULL, _("Interlace 1"));
|
||||
gtk_widget_show (radiointerlace1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox8), radiointerlace1, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiointerlace1), radionointerlace_group);
|
||||
radionointerlace_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiointerlace1));
|
||||
|
||||
label13 = gtk_label_new (_("<b>Interlacing (F5 to toggle)</b>"));
|
||||
gtk_widget_show (label13);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame7), label13);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label13), TRUE);
|
||||
|
||||
checkBilinear = gtk_check_button_new_with_mnemonic (_("Bilinear Filtering (Shift+F5)\n Best quality is on, turn off for speed"));
|
||||
gtk_widget_show (checkBilinear);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), checkBilinear, FALSE, FALSE, 0);
|
||||
|
||||
frame4 = gtk_frame_new (NULL);
|
||||
gtk_widget_show (frame4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), frame4, FALSE, FALSE, 0);
|
||||
|
||||
alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_widget_show (alignment1);
|
||||
gtk_container_add (GTK_CONTAINER (frame4), alignment1);
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);
|
||||
|
||||
hbox6 = gtk_hbox_new (TRUE, 0);
|
||||
gtk_widget_show (hbox6);
|
||||
gtk_container_add (GTK_CONTAINER (alignment1), hbox6);
|
||||
|
||||
radioAANone = gtk_radio_button_new_with_mnemonic (NULL, _("None"));
|
||||
gtk_widget_show (radioAANone);
|
||||
gtk_box_pack_start (GTK_BOX (hbox6), radioAANone, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioAANone), radioAANone_group);
|
||||
radioAANone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioAANone));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radioAANone), TRUE);
|
||||
|
||||
radioAA2X = gtk_radio_button_new_with_mnemonic (NULL, _("2X"));
|
||||
gtk_widget_show (radioAA2X);
|
||||
gtk_box_pack_start (GTK_BOX (hbox6), radioAA2X, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioAA2X), radioAANone_group);
|
||||
radioAANone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioAA2X));
|
||||
|
||||
radioAA4X = gtk_radio_button_new_with_mnemonic (NULL, _("4X"));
|
||||
gtk_widget_show (radioAA4X);
|
||||
gtk_box_pack_start (GTK_BOX (hbox6), radioAA4X, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioAA4X), radioAANone_group);
|
||||
radioAANone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioAA4X));
|
||||
|
||||
radioAA8X = gtk_radio_button_new_with_mnemonic (NULL, _("8X"));
|
||||
gtk_widget_show (radioAA8X);
|
||||
gtk_box_pack_start (GTK_BOX (hbox6), radioAA8X, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioAA8X), radioAANone_group);
|
||||
radioAANone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioAA8X));
|
||||
|
||||
radioAA16X = gtk_radio_button_new_with_mnemonic (NULL, _("16X"));
|
||||
gtk_widget_show (radioAA16X);
|
||||
gtk_box_pack_start (GTK_BOX (hbox6), radioAA16X, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioAA16X), radioAANone_group);
|
||||
radioAANone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioAA16X));
|
||||
|
||||
label9 = gtk_label_new (_("<b>Anti-aliasing for higher quality (F6)</b>"));
|
||||
gtk_widget_show (label9);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame4), label9);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label9), TRUE);
|
||||
|
||||
checkWireframe = gtk_check_button_new_with_mnemonic (_("Wireframe rendering (Shift+F6)"));
|
||||
gtk_widget_show (checkWireframe);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), checkWireframe, FALSE, FALSE, 0);
|
||||
|
||||
checkAVI = gtk_check_button_new_with_mnemonic (_("Capture Avi (zerogs.avi)(F7)"));
|
||||
gtk_widget_show (checkAVI);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), checkAVI, FALSE, FALSE, 0);
|
||||
|
||||
checkTGA = gtk_check_button_new_with_mnemonic (_("Save Snapshots as TGAs (default is JPG)"));
|
||||
gtk_widget_show (checkTGA);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), checkTGA, FALSE, FALSE, 0);
|
||||
|
||||
checkfullscreen = gtk_check_button_new_with_mnemonic (_("Fullscreen (Alt+Enter)\n to get out press Alt+Enter again (or ESC)"));
|
||||
gtk_widget_show (checkfullscreen);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), checkfullscreen, FALSE, FALSE, 0);
|
||||
|
||||
checkwidescreen = gtk_check_button_new_with_mnemonic (_("Wide Screen"));
|
||||
gtk_widget_show (checkwidescreen);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), checkwidescreen, FALSE, FALSE, 0);
|
||||
|
||||
frame5 = gtk_frame_new (NULL);
|
||||
gtk_widget_show (frame5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), frame5, FALSE, FALSE, 0);
|
||||
|
||||
alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_widget_show (alignment2);
|
||||
gtk_container_add (GTK_CONTAINER (frame5), alignment2);
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0);
|
||||
|
||||
hbox7 = gtk_hbox_new (TRUE, 0);
|
||||
gtk_widget_show (hbox7);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbox7);
|
||||
|
||||
radioSize640 = gtk_radio_button_new_with_mnemonic (NULL, _("640x480"));
|
||||
gtk_widget_show (radioSize640);
|
||||
gtk_box_pack_start (GTK_BOX (hbox7), radioSize640, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioSize640), radioSize640_group);
|
||||
radioSize640_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioSize640));
|
||||
|
||||
radioSize800 = gtk_radio_button_new_with_mnemonic (NULL, _("800x600"));
|
||||
gtk_widget_show (radioSize800);
|
||||
gtk_box_pack_start (GTK_BOX (hbox7), radioSize800, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioSize800), radioSize640_group);
|
||||
radioSize640_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioSize800));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radioSize800), TRUE);
|
||||
|
||||
radioSize1024 = gtk_radio_button_new_with_mnemonic (NULL, _("1024x768"));
|
||||
gtk_widget_show (radioSize1024);
|
||||
gtk_box_pack_start (GTK_BOX (hbox7), radioSize1024, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioSize1024), radioSize640_group);
|
||||
radioSize640_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioSize1024));
|
||||
|
||||
radioSize1280 = gtk_radio_button_new_with_mnemonic (NULL, _("1280x960"));
|
||||
gtk_widget_show (radioSize1280);
|
||||
gtk_box_pack_start (GTK_BOX (hbox7), radioSize1280, FALSE, FALSE, 0);
|
||||
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioSize1280), radioSize640_group);
|
||||
radioSize640_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioSize1280));
|
||||
|
||||
label10 = gtk_label_new (_("<b>Default Window Size (no speed impact)</b>"));
|
||||
gtk_widget_show (label10);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame5), label10);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label10), TRUE);
|
||||
|
||||
frame6 = gtk_frame_new (NULL);
|
||||
gtk_widget_show (frame6);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), frame6, TRUE, TRUE, 0);
|
||||
|
||||
alignment3 = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_widget_show (alignment3);
|
||||
gtk_container_add (GTK_CONTAINER (frame6), alignment3);
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment3), 0, 0, 12, 0);
|
||||
|
||||
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (scrolledwindow1);
|
||||
gtk_container_add (GTK_CONTAINER (alignment3), scrolledwindow1);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN);
|
||||
|
||||
treeview1 = gtk_tree_view_new ();
|
||||
gtk_widget_show (treeview1);
|
||||
gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview1);
|
||||
|
||||
label12 = gtk_label_new (_("<b>Advanced Options</b>"));
|
||||
gtk_widget_show (label12);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame6), label12);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label12), TRUE);
|
||||
|
||||
label11 = gtk_label_new (_("Show Frames Per Second (Shift+F7)\n (value is the average over 4-16 PS2 frames)"));
|
||||
gtk_widget_show (label11);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), label11, FALSE, FALSE, 0);
|
||||
|
||||
hbuttonbox1 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox4), hbuttonbox1, FALSE, FALSE, 0);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD);
|
||||
gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
|
||||
|
||||
button1 = gtk_button_new_with_mnemonic (_("Ok"));
|
||||
gtk_widget_show (button1);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1);
|
||||
GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
|
||||
|
||||
button2 = gtk_button_new_with_mnemonic (_("Cancel"));
|
||||
gtk_widget_show (button2);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
|
||||
GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
|
||||
|
||||
g_signal_connect ((gpointer) button1, "clicked",
|
||||
G_CALLBACK (OnConf_Ok),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button2, "clicked",
|
||||
G_CALLBACK (OnConf_Cancel),
|
||||
NULL);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
|
||||
GLADE_HOOKUP_OBJECT (Config, vbox4, "vbox4");
|
||||
GLADE_HOOKUP_OBJECT (Config, frame7, "frame7");
|
||||
GLADE_HOOKUP_OBJECT (Config, alignment4, "alignment4");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox8, "hbox8");
|
||||
GLADE_HOOKUP_OBJECT (Config, radionointerlace, "radionointerlace");
|
||||
GLADE_HOOKUP_OBJECT (Config, radiointerlace0, "radiointerlace0");
|
||||
GLADE_HOOKUP_OBJECT (Config, radiointerlace1, "radiointerlace1");
|
||||
GLADE_HOOKUP_OBJECT (Config, label13, "label13");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkBilinear, "checkBilinear");
|
||||
GLADE_HOOKUP_OBJECT (Config, frame4, "frame4");
|
||||
GLADE_HOOKUP_OBJECT (Config, alignment1, "alignment1");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox6, "hbox6");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioAANone, "radioAANone");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioAA2X, "radioAA2X");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioAA4X, "radioAA4X");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioAA8X, "radioAA8X");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioAA16X, "radioAA16X");
|
||||
GLADE_HOOKUP_OBJECT (Config, label9, "label9");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkWireframe, "checkWireframe");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkAVI, "checkAVI");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkTGA, "checkTGA");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkfullscreen, "checkfullscreen");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkwidescreen, "checkwidescreen");
|
||||
GLADE_HOOKUP_OBJECT (Config, frame5, "frame5");
|
||||
GLADE_HOOKUP_OBJECT (Config, alignment2, "alignment2");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox7, "hbox7");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioSize640, "radioSize640");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioSize800, "radioSize800");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioSize1024, "radioSize1024");
|
||||
GLADE_HOOKUP_OBJECT (Config, radioSize1280, "radioSize1280");
|
||||
GLADE_HOOKUP_OBJECT (Config, label10, "label10");
|
||||
GLADE_HOOKUP_OBJECT (Config, frame6, "frame6");
|
||||
GLADE_HOOKUP_OBJECT (Config, alignment3, "alignment3");
|
||||
GLADE_HOOKUP_OBJECT (Config, scrolledwindow1, "scrolledwindow1");
|
||||
GLADE_HOOKUP_OBJECT (Config, treeview1, "treeview1");
|
||||
GLADE_HOOKUP_OBJECT (Config, label12, "label12");
|
||||
GLADE_HOOKUP_OBJECT (Config, label11, "label11");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox1, "hbuttonbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, button1, "button1");
|
||||
GLADE_HOOKUP_OBJECT (Config, button2, "button2");
|
||||
|
||||
return Config;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
create_About (void)
|
||||
{
|
||||
GtkWidget *About;
|
||||
GtkWidget *vbox2;
|
||||
GtkWidget *label2;
|
||||
GtkWidget *label3;
|
||||
GtkWidget *label4;
|
||||
GtkWidget *hbuttonbox2;
|
||||
GtkWidget *button3;
|
||||
|
||||
About = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (About), 5);
|
||||
gtk_window_set_title (GTK_WINDOW (About), _("ZZogl About"));
|
||||
|
||||
vbox2 = gtk_vbox_new (FALSE, 5);
|
||||
gtk_widget_show (vbox2);
|
||||
gtk_container_add (GTK_CONTAINER (About), vbox2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5);
|
||||
|
||||
label2 = gtk_label_new (_("OpenGL version"));
|
||||
gtk_widget_show (label2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label2, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);
|
||||
|
||||
label3 = gtk_label_new (_("Author: Zeydlitz(@gmail.com)"));
|
||||
gtk_widget_show (label3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label3, FALSE, FALSE, 0);
|
||||
|
||||
label4 = gtk_label_new (_("Many thanks to the Pcsx2 testing team"));
|
||||
gtk_widget_show (label4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label4, FALSE, FALSE, 0);
|
||||
|
||||
hbuttonbox2 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), hbuttonbox2, TRUE, TRUE, 0);
|
||||
gtk_box_set_spacing (GTK_BOX (hbuttonbox2), 30);
|
||||
|
||||
button3 = gtk_button_new_with_mnemonic (_("Ok"));
|
||||
gtk_widget_show (button3);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), button3);
|
||||
GTK_WIDGET_SET_FLAGS (button3, GTK_CAN_DEFAULT);
|
||||
|
||||
g_signal_connect ((gpointer) button3, "clicked",
|
||||
G_CALLBACK (OnAbout_Ok),
|
||||
NULL);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (About, About, "About");
|
||||
GLADE_HOOKUP_OBJECT (About, vbox2, "vbox2");
|
||||
GLADE_HOOKUP_OBJECT (About, label2, "label2");
|
||||
GLADE_HOOKUP_OBJECT (About, label3, "label3");
|
||||
GLADE_HOOKUP_OBJECT (About, label4, "label4");
|
||||
GLADE_HOOKUP_OBJECT (About, hbuttonbox2, "hbuttonbox2");
|
||||
GLADE_HOOKUP_OBJECT (About, button3, "button3");
|
||||
|
||||
return About;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
GtkWidget* create_Config (void);
|
||||
GtkWidget* create_About (void);
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "support.h"
|
||||
|
||||
GtkWidget*
|
||||
lookup_widget (GtkWidget *widget,
|
||||
const gchar *widget_name)
|
||||
{
|
||||
GtkWidget *parent, *found_widget;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (GTK_IS_MENU (widget))
|
||||
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
||||
else
|
||||
parent = widget->parent;
|
||||
if (!parent)
|
||||
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
|
||||
if (parent == NULL)
|
||||
break;
|
||||
widget = parent;
|
||||
}
|
||||
|
||||
found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
|
||||
widget_name);
|
||||
if (!found_widget)
|
||||
g_warning ("Widget not found: %s", widget_name);
|
||||
return found_widget;
|
||||
}
|
||||
|
||||
static GList *pixmaps_directories = NULL;
|
||||
|
||||
/* Use this function to set the directory containing installed pixmaps. */
|
||||
void
|
||||
add_pixmap_directory (const gchar *directory)
|
||||
{
|
||||
pixmaps_directories = g_list_prepend (pixmaps_directories,
|
||||
g_strdup (directory));
|
||||
}
|
||||
|
||||
/* This is an internally used function to find pixmap files. */
|
||||
static gchar*
|
||||
find_pixmap_file (const gchar *filename)
|
||||
{
|
||||
GList *elem;
|
||||
|
||||
/* We step through each of the pixmaps directory to find it. */
|
||||
elem = pixmaps_directories;
|
||||
while (elem)
|
||||
{
|
||||
gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
|
||||
G_DIR_SEPARATOR_S, filename);
|
||||
if (g_file_test (pathname, G_FILE_TEST_EXISTS))
|
||||
return pathname;
|
||||
g_free (pathname);
|
||||
elem = elem->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GtkWidget*
|
||||
create_pixmap (GtkWidget *widget,
|
||||
const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GtkWidget *pixmap;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return gtk_image_new ();
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return gtk_image_new ();
|
||||
}
|
||||
|
||||
pixmap = gtk_image_new_from_file (pathname);
|
||||
g_free (pathname);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GdkPixbuf*
|
||||
create_pixbuf (const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GdkPixbuf *pixbuf;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return NULL;
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
|
||||
if (!pixbuf)
|
||||
{
|
||||
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
||||
pathname, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (pathname);
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/* This is used to set ATK action descriptions. */
|
||||
void
|
||||
glade_set_atk_action_description (AtkAction *action,
|
||||
const gchar *action_name,
|
||||
const gchar *description)
|
||||
{
|
||||
gint n_actions, i;
|
||||
|
||||
n_actions = atk_action_get_n_actions (action);
|
||||
for (i = 0; i < n_actions; i++)
|
||||
{
|
||||
if (!strcmp (atk_action_get_name (action, i), action_name))
|
||||
atk_action_set_description (action, i, description);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/*
|
||||
* Standard gettext macros.
|
||||
*/
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# undef _
|
||||
# define _(String) dgettext (PACKAGE, String)
|
||||
# define Q_(String) g_strip_context ((String), gettext (String))
|
||||
# ifdef gettext_noop
|
||||
# define N_(String) gettext_noop (String)
|
||||
# else
|
||||
# define N_(String) (String)
|
||||
# endif
|
||||
#else
|
||||
# define textdomain(String) (String)
|
||||
# define gettext(String) (String)
|
||||
# define dgettext(Domain,Message) (Message)
|
||||
# define dcgettext(Domain,Message,Type) (Message)
|
||||
# define bindtextdomain(Domain,Directory) (Domain)
|
||||
# define _(String) (String)
|
||||
# define Q_(String) g_strip_context ((String), (String))
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Public Functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This function returns a widget in a component created by Glade.
|
||||
* Call it with the toplevel widget in the component (i.e. a window/dialog),
|
||||
* or alternatively any widget in the component, and the name of the widget
|
||||
* you want returned.
|
||||
*/
|
||||
GtkWidget* lookup_widget (GtkWidget *widget,
|
||||
const gchar *widget_name);
|
||||
|
||||
|
||||
/* Use this function to set the directory containing installed pixmaps. */
|
||||
void add_pixmap_directory (const gchar *directory);
|
||||
|
||||
|
||||
/*
|
||||
* Private Functions.
|
||||
*/
|
||||
|
||||
/* This is used to create the pixmaps used in the interface. */
|
||||
GtkWidget* create_pixmap (GtkWidget *widget,
|
||||
const gchar *filename);
|
||||
|
||||
/* This is used to create the pixbufs used in the interface. */
|
||||
GdkPixbuf* create_pixbuf (const gchar *filename);
|
||||
|
||||
/* This is used to set ATK action descriptions. */
|
||||
void glade_set_atk_action_description (AtkAction *action,
|
||||
const gchar *action_name,
|
||||
const gchar *description);
|
||||
|
|
@ -0,0 +1,812 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkWindow" id="Config">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">ZeroOGS Configuration</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment4">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radionointerlace">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Interlace Off</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radiointerlace0">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Interlace 0</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radionointerlace</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radiointerlace1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Interlace 1</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radionointerlace</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label13">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Interlacing (F5 to toggle)</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkBilinear">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Bilinear Filtering (Shift+F5)
|
||||
Best quality is on, turn off for speed</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox6">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioAANone">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">None</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioAA2X">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">2X</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioAANone</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioAA4X">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">4X</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioAANone</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioAA8X">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">8X</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioAANone</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioAA16X">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">16X</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioAANone</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Anti-aliasing for higher quality (F6)</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkWireframe">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Wireframe rendering (Shift+F6)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkAVI">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Capture Avi (zerogs.avi)(F7)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkTGA">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Save Snapshots as TGAs (default is JPG)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkfullscreen">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Fullscreen (Alt+Enter)
|
||||
to get out press Alt+Enter again (or ESC)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment2">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox7">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioSize640">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">640x480</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioSize800">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">800x600</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioSize640</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioSize1024">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">1024x768</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioSize640</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="radioSize1280">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">1280x960</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radioSize640</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label10">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Default Window Size (no speed impact)</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment3">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="treeview1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">True</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="fixed_height_mode">False</property>
|
||||
<property name="hover_selection">False</property>
|
||||
<property name="hover_expand">False</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label12">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Advanced Options</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label11">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Show Frames Per Second (Shift+F7)
|
||||
(value is the average over 4-16 PS2 frames)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
|
||||
<property name="spacing">30</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Ok</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="OnConf_Ok"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="OnConf_Cancel"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkWindow" id="About">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">ZeroGS KOSMOS About</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox2">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">5</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">OpenGL version</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Author: zerofrog(@gmail.com)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Many thanks to the Pcsx2 testing team</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
|
||||
<property name="spacing">30</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Ok</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="OnAbout_Ok"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
|
@ -0,0 +1,50 @@
|
|||
# Create a shared library libzzoglpg
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
noinst_LIBRARIES = libzzoglpg.a
|
||||
INCLUDES = -I@srcdir@/../../../common/include -I@srcdir@/common
|
||||
|
||||
libzzoglpg_a_CPPFLAGS = $(shell pkg-config --cflags gtk+-2.0)
|
||||
libzzoglpg_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0)
|
||||
|
||||
if X86_64
|
||||
libzzoglpg_a_CPPFLAGS += -fPIC
|
||||
libzzoglpg_a_CXXFLAGS += -fPIC
|
||||
CCASFLAGS += -fPIC
|
||||
endif
|
||||
|
||||
# Create a shared object by faking an exe (thanks to ODE makefiles)
|
||||
traplibdir=$(prefix)
|
||||
|
||||
|
||||
if RELEASE_TO_PUBLIC
|
||||
preext=r
|
||||
endif
|
||||
|
||||
EXEEXT=$(preext)@so_ext@
|
||||
|
||||
traplib_PROGRAMS=libzzoglpg
|
||||
libzzoglpg_SOURCES=
|
||||
libzzoglpg_DEPENDENCIES = libzzoglpg.a
|
||||
libzzoglpg_LDFLAGS= @SHARED_LDFLAGS@
|
||||
libzzoglpg_LDFLAGS+=-Wl,-soname,@ZEROGS_SONAME@
|
||||
libzzoglpg_LDADD=$(libzzoglpg_a_OBJECTS)
|
||||
|
||||
libzzoglpg_a_SOURCES = \
|
||||
GSmain.cpp memcpy_amd.cpp Regs.cpp x86.cpp zpipe.cpp Mem.cpp \
|
||||
rasterfont.cpp targets.cpp zerogs.cpp ZZoglVB.cpp ZZoglShoots.cpp ZZoglCreate.cpp \
|
||||
ZZoglShaders.cpp ZZoglCRTC.cpp ZZoglSave.cpp ZZoglFlush.cpp
|
||||
|
||||
if X86_64
|
||||
libzzoglpg_a_SOURCES += x86-64.S
|
||||
else
|
||||
libzzoglpg_a_SOURCES += x86-32.S
|
||||
endif
|
||||
|
||||
if SSE2
|
||||
CCASFLAGS+= -DZEROGS_SSE2
|
||||
endif
|
||||
|
||||
libzzoglpg_a_DEPENDENCIES = Linux/libZeroGSLinux.a
|
||||
libzzoglpg_LDADD += Linux/libZeroGSLinux.a
|
||||
|
||||
SUBDIRS = Linux ZeroGSShaders .
|
|
@ -0,0 +1,902 @@
|
|||
/* ZeroGS KOSMOS
|
||||
* Copyright (C) 2005-2006 zerofrog@gmail.com
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "GS.h"
|
||||
#include "Mem.h"
|
||||
#include "zerogs.h"
|
||||
#include "targets.h"
|
||||
#include "x86.h"
|
||||
|
||||
u32 g_blockTable32[4][8] = {
|
||||
{ 0, 1, 4, 5, 16, 17, 20, 21},
|
||||
{ 2, 3, 6, 7, 18, 19, 22, 23},
|
||||
{ 8, 9, 12, 13, 24, 25, 28, 29},
|
||||
{ 10, 11, 14, 15, 26, 27, 30, 31}
|
||||
};
|
||||
|
||||
u32 g_blockTable32Z[4][8] = {
|
||||
{ 24, 25, 28, 29, 8, 9, 12, 13},
|
||||
{ 26, 27, 30, 31, 10, 11, 14, 15},
|
||||
{ 16, 17, 20, 21, 0, 1, 4, 5},
|
||||
{ 18, 19, 22, 23, 2, 3, 6, 7}
|
||||
};
|
||||
|
||||
u32 g_blockTable16[8][4] = {
|
||||
{ 0, 2, 8, 10 },
|
||||
{ 1, 3, 9, 11 },
|
||||
{ 4, 6, 12, 14 },
|
||||
{ 5, 7, 13, 15 },
|
||||
{ 16, 18, 24, 26 },
|
||||
{ 17, 19, 25, 27 },
|
||||
{ 20, 22, 28, 30 },
|
||||
{ 21, 23, 29, 31 }
|
||||
};
|
||||
|
||||
u32 g_blockTable16S[8][4] = {
|
||||
{ 0, 2, 16, 18 },
|
||||
{ 1, 3, 17, 19 },
|
||||
{ 8, 10, 24, 26 },
|
||||
{ 9, 11, 25, 27 },
|
||||
{ 4, 6, 20, 22 },
|
||||
{ 5, 7, 21, 23 },
|
||||
{ 12, 14, 28, 30 },
|
||||
{ 13, 15, 29, 31 }
|
||||
};
|
||||
|
||||
u32 g_blockTable16Z[8][4] = {
|
||||
{ 24, 26, 16, 18 },
|
||||
{ 25, 27, 17, 19 },
|
||||
{ 28, 30, 20, 22 },
|
||||
{ 29, 31, 21, 23 },
|
||||
{ 8, 10, 0, 2 },
|
||||
{ 9, 11, 1, 3 },
|
||||
{ 12, 14, 4, 6 },
|
||||
{ 13, 15, 5, 7 }
|
||||
};
|
||||
|
||||
u32 g_blockTable16SZ[8][4] = {
|
||||
{ 24, 26, 8, 10 },
|
||||
{ 25, 27, 9, 11 },
|
||||
{ 16, 18, 0, 2 },
|
||||
{ 17, 19, 1, 3 },
|
||||
{ 28, 30, 12, 14 },
|
||||
{ 29, 31, 13, 15 },
|
||||
{ 20, 22, 4, 6 },
|
||||
{ 21, 23, 5, 7 }
|
||||
};
|
||||
|
||||
u32 g_blockTable8[4][8] = {
|
||||
{ 0, 1, 4, 5, 16, 17, 20, 21},
|
||||
{ 2, 3, 6, 7, 18, 19, 22, 23},
|
||||
{ 8, 9, 12, 13, 24, 25, 28, 29},
|
||||
{ 10, 11, 14, 15, 26, 27, 30, 31}
|
||||
};
|
||||
|
||||
u32 g_blockTable4[8][4] = {
|
||||
{ 0, 2, 8, 10 },
|
||||
{ 1, 3, 9, 11 },
|
||||
{ 4, 6, 12, 14 },
|
||||
{ 5, 7, 13, 15 },
|
||||
{ 16, 18, 24, 26 },
|
||||
{ 17, 19, 25, 27 },
|
||||
{ 20, 22, 28, 30 },
|
||||
{ 21, 23, 29, 31 }
|
||||
};
|
||||
|
||||
u32 g_columnTable32[8][8] = {
|
||||
{ 0, 1, 4, 5, 8, 9, 12, 13 },
|
||||
{ 2, 3, 6, 7, 10, 11, 14, 15 },
|
||||
{ 16, 17, 20, 21, 24, 25, 28, 29 },
|
||||
{ 18, 19, 22, 23, 26, 27, 30, 31 },
|
||||
{ 32, 33, 36, 37, 40, 41, 44, 45 },
|
||||
{ 34, 35, 38, 39, 42, 43, 46, 47 },
|
||||
{ 48, 49, 52, 53, 56, 57, 60, 61 },
|
||||
{ 50, 51, 54, 55, 58, 59, 62, 63 },
|
||||
};
|
||||
|
||||
u32 g_columnTable16[8][16] = {
|
||||
{ 0, 2, 8, 10, 16, 18, 24, 26,
|
||||
1, 3, 9, 11, 17, 19, 25, 27 },
|
||||
{ 4, 6, 12, 14, 20, 22, 28, 30,
|
||||
5, 7, 13, 15, 21, 23, 29, 31 },
|
||||
{ 32, 34, 40, 42, 48, 50, 56, 58,
|
||||
33, 35, 41, 43, 49, 51, 57, 59 },
|
||||
{ 36, 38, 44, 46, 52, 54, 60, 62,
|
||||
37, 39, 45, 47, 53, 55, 61, 63 },
|
||||
{ 64, 66, 72, 74, 80, 82, 88, 90,
|
||||
65, 67, 73, 75, 81, 83, 89, 91 },
|
||||
{ 68, 70, 76, 78, 84, 86, 92, 94,
|
||||
69, 71, 77, 79, 85, 87, 93, 95 },
|
||||
{ 96, 98, 104, 106, 112, 114, 120, 122,
|
||||
97, 99, 105, 107, 113, 115, 121, 123 },
|
||||
{ 100, 102, 108, 110, 116, 118, 124, 126,
|
||||
101, 103, 109, 111, 117, 119, 125, 127 },
|
||||
};
|
||||
|
||||
u32 g_columnTable8[16][16] = {
|
||||
{ 0, 4, 16, 20, 32, 36, 48, 52, // column 0
|
||||
2, 6, 18, 22, 34, 38, 50, 54 },
|
||||
{ 8, 12, 24, 28, 40, 44, 56, 60,
|
||||
10, 14, 26, 30, 42, 46, 58, 62 },
|
||||
{ 33, 37, 49, 53, 1, 5, 17, 21,
|
||||
35, 39, 51, 55, 3, 7, 19, 23 },
|
||||
{ 41, 45, 57, 61, 9, 13, 25, 29,
|
||||
43, 47, 59, 63, 11, 15, 27, 31 },
|
||||
{ 96, 100, 112, 116, 64, 68, 80, 84, // column 1
|
||||
98, 102, 114, 118, 66, 70, 82, 86 },
|
||||
{ 104, 108, 120, 124, 72, 76, 88, 92,
|
||||
106, 110, 122, 126, 74, 78, 90, 94 },
|
||||
{ 65, 69, 81, 85, 97, 101, 113, 117,
|
||||
67, 71, 83, 87, 99, 103, 115, 119 },
|
||||
{ 73, 77, 89, 93, 105, 109, 121, 125,
|
||||
75, 79, 91, 95, 107, 111, 123, 127 },
|
||||
{ 128, 132, 144, 148, 160, 164, 176, 180, // column 2
|
||||
130, 134, 146, 150, 162, 166, 178, 182 },
|
||||
{ 136, 140, 152, 156, 168, 172, 184, 188,
|
||||
138, 142, 154, 158, 170, 174, 186, 190 },
|
||||
{ 161, 165, 177, 181, 129, 133, 145, 149,
|
||||
163, 167, 179, 183, 131, 135, 147, 151 },
|
||||
{ 169, 173, 185, 189, 137, 141, 153, 157,
|
||||
171, 175, 187, 191, 139, 143, 155, 159 },
|
||||
{ 224, 228, 240, 244, 192, 196, 208, 212, // column 3
|
||||
226, 230, 242, 246, 194, 198, 210, 214 },
|
||||
{ 232, 236, 248, 252, 200, 204, 216, 220,
|
||||
234, 238, 250, 254, 202, 206, 218, 222 },
|
||||
{ 193, 197, 209, 213, 225, 229, 241, 245,
|
||||
195, 199, 211, 215, 227, 231, 243, 247 },
|
||||
{ 201, 205, 217, 221, 233, 237, 249, 253,
|
||||
203, 207, 219, 223, 235, 239, 251, 255 },
|
||||
};
|
||||
|
||||
u32 g_columnTable4[16][32] = {
|
||||
{ 0, 8, 32, 40, 64, 72, 96, 104, // column 0
|
||||
2, 10, 34, 42, 66, 74, 98, 106,
|
||||
4, 12, 36, 44, 68, 76, 100, 108,
|
||||
6, 14, 38, 46, 70, 78, 102, 110 },
|
||||
{ 16, 24, 48, 56, 80, 88, 112, 120,
|
||||
18, 26, 50, 58, 82, 90, 114, 122,
|
||||
20, 28, 52, 60, 84, 92, 116, 124,
|
||||
22, 30, 54, 62, 86, 94, 118, 126 },
|
||||
{ 65, 73, 97, 105, 1, 9, 33, 41,
|
||||
67, 75, 99, 107, 3, 11, 35, 43,
|
||||
69, 77, 101, 109, 5, 13, 37, 45,
|
||||
71, 79, 103, 111, 7, 15, 39, 47 },
|
||||
{ 81, 89, 113, 121, 17, 25, 49, 57,
|
||||
83, 91, 115, 123, 19, 27, 51, 59,
|
||||
85, 93, 117, 125, 21, 29, 53, 61,
|
||||
87, 95, 119, 127, 23, 31, 55, 63 },
|
||||
{ 192, 200, 224, 232, 128, 136, 160, 168, // column 1
|
||||
194, 202, 226, 234, 130, 138, 162, 170,
|
||||
196, 204, 228, 236, 132, 140, 164, 172,
|
||||
198, 206, 230, 238, 134, 142, 166, 174 },
|
||||
{ 208, 216, 240, 248, 144, 152, 176, 184,
|
||||
210, 218, 242, 250, 146, 154, 178, 186,
|
||||
212, 220, 244, 252, 148, 156, 180, 188,
|
||||
214, 222, 246, 254, 150, 158, 182, 190 },
|
||||
{ 129, 137, 161, 169, 193, 201, 225, 233,
|
||||
131, 139, 163, 171, 195, 203, 227, 235,
|
||||
133, 141, 165, 173, 197, 205, 229, 237,
|
||||
135, 143, 167, 175, 199, 207, 231, 239 },
|
||||
{ 145, 153, 177, 185, 209, 217, 241, 249,
|
||||
147, 155, 179, 187, 211, 219, 243, 251,
|
||||
149, 157, 181, 189, 213, 221, 245, 253,
|
||||
151, 159, 183, 191, 215, 223, 247, 255 },
|
||||
{ 256, 264, 288, 296, 320, 328, 352, 360, // column 2
|
||||
258, 266, 290, 298, 322, 330, 354, 362,
|
||||
260, 268, 292, 300, 324, 332, 356, 364,
|
||||
262, 270, 294, 302, 326, 334, 358, 366 },
|
||||
{ 272, 280, 304, 312, 336, 344, 368, 376,
|
||||
274, 282, 306, 314, 338, 346, 370, 378,
|
||||
276, 284, 308, 316, 340, 348, 372, 380,
|
||||
278, 286, 310, 318, 342, 350, 374, 382 },
|
||||
{ 321, 329, 353, 361, 257, 265, 289, 297,
|
||||
323, 331, 355, 363, 259, 267, 291, 299,
|
||||
325, 333, 357, 365, 261, 269, 293, 301,
|
||||
327, 335, 359, 367, 263, 271, 295, 303 },
|
||||
{ 337, 345, 369, 377, 273, 281, 305, 313,
|
||||
339, 347, 371, 379, 275, 283, 307, 315,
|
||||
341, 349, 373, 381, 277, 285, 309, 317,
|
||||
343, 351, 375, 383, 279, 287, 311, 319 },
|
||||
{ 448, 456, 480, 488, 384, 392, 416, 424, // column 3
|
||||
450, 458, 482, 490, 386, 394, 418, 426,
|
||||
452, 460, 484, 492, 388, 396, 420, 428,
|
||||
454, 462, 486, 494, 390, 398, 422, 430 },
|
||||
{ 464, 472, 496, 504, 400, 408, 432, 440,
|
||||
466, 474, 498, 506, 402, 410, 434, 442,
|
||||
468, 476, 500, 508, 404, 412, 436, 444,
|
||||
470, 478, 502, 510, 406, 414, 438, 446 },
|
||||
{ 385, 393, 417, 425, 449, 457, 481, 489,
|
||||
387, 395, 419, 427, 451, 459, 483, 491,
|
||||
389, 397, 421, 429, 453, 461, 485, 493,
|
||||
391, 399, 423, 431, 455, 463, 487, 495 },
|
||||
{ 401, 409, 433, 441, 465, 473, 497, 505,
|
||||
403, 411, 435, 443, 467, 475, 499, 507,
|
||||
405, 413, 437, 445, 469, 477, 501, 509,
|
||||
407, 415, 439, 447, 471, 479, 503, 511 },
|
||||
};
|
||||
|
||||
u32 g_pageTable32[32][64];
|
||||
u32 g_pageTable32Z[32][64];
|
||||
u32 g_pageTable16[64][64];
|
||||
u32 g_pageTable16S[64][64];
|
||||
u32 g_pageTable16Z[64][64];
|
||||
u32 g_pageTable16SZ[64][64];
|
||||
u32 g_pageTable8[64][128];
|
||||
u32 g_pageTable4[128][128];
|
||||
|
||||
BLOCK m_Blocks[0x40]; // do so blocks are indexable
|
||||
static PCSX2_ALIGNED16(u32 tempblock[64]);
|
||||
|
||||
#define DSTPSM gs.dstbuf.psm
|
||||
|
||||
#define START_HOSTLOCAL() \
|
||||
assert( gs.imageTransfer == 0 ); \
|
||||
u8* pstart = g_pbyGSMemory + gs.dstbuf.bp*256; \
|
||||
\
|
||||
const u8* pendbuf = (const u8*)pbyMem + nQWordSize*4; \
|
||||
int i = gs.imageY, j = gs.imageX; \
|
||||
|
||||
#define END_HOSTLOCAL() \
|
||||
End: \
|
||||
if( i >= gs.imageEndY ) { \
|
||||
assert( gs.imageTransfer == -1 || i == gs.imageEndY ); \
|
||||
gs.imageTransfer = -1; \
|
||||
/*int start, end; \
|
||||
ZeroGS::GetRectMemAddress(start, end, gs.dstbuf.psm, gs.trxpos.dx, gs.trxpos.dy, gs.imageWnew, gs.imageHnew, gs.dstbuf.bp, gs.dstbuf.bw); \
|
||||
ZeroGS::g_MemTargs.ClearRange(start, end);*/ \
|
||||
} \
|
||||
else { \
|
||||
/* update new params */ \
|
||||
gs.imageY = i; \
|
||||
gs.imageX = j; \
|
||||
} \
|
||||
|
||||
// transfers whole rows
|
||||
#define TRANSMIT_HOSTLOCAL_Y_(psm, T, widthlimit, endY) { \
|
||||
assert( (nSize%widthlimit) == 0 && widthlimit <= 4 ); \
|
||||
if( (gs.imageEndX-gs.trxpos.dx)%widthlimit ) { \
|
||||
/*GS_LOG("Bad Transmission! %d %d, psm: %d\n", gs.trxpos.dx, gs.imageEndX, DSTPSM);*/ \
|
||||
for(; i < endY; ++i) { \
|
||||
for(; j < gs.imageEndX && nSize > 0; j += 1, nSize -= 1, pbuf += 1) { \
|
||||
/* write as many pixel at one time as possible */ \
|
||||
writePixel##psm##_0(pstart, j%2048, i%2048, pbuf[0], gs.dstbuf.bw); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
for(; i < endY; ++i) { \
|
||||
for(; j < gs.imageEndX && nSize > 0; j += widthlimit, nSize -= widthlimit, pbuf += widthlimit) { \
|
||||
/* write as many pixel at one time as possible */ \
|
||||
if( nSize < widthlimit ) goto End; \
|
||||
writePixel##psm##_0(pstart, j%2048, i%2048, pbuf[0], gs.dstbuf.bw); \
|
||||
\
|
||||
if( widthlimit > 1 ) { \
|
||||
writePixel##psm##_0(pstart, (j+1)%2048, i%2048, pbuf[1], gs.dstbuf.bw); \
|
||||
\
|
||||
if( widthlimit > 2 ) { \
|
||||
writePixel##psm##_0(pstart, (j+2)%2048, i%2048, pbuf[2], gs.dstbuf.bw); \
|
||||
\
|
||||
if( widthlimit > 3 ) { \
|
||||
writePixel##psm##_0(pstart, (j+3)%2048, i%2048, pbuf[3], gs.dstbuf.bw); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if( j >= gs.imageEndX ) { assert(j == gs.imageEndX); j = gs.trxpos.dx; } \
|
||||
else { assert( gs.imageTransfer == -1 || nSize*sizeof(T)/4 == 0 ); goto End; } \
|
||||
} \
|
||||
} \
|
||||
|
||||
// transmit until endX, don't check size since it has already been prevalidated
|
||||
#define TRANSMIT_HOSTLOCAL_X_(psm, T, widthlimit, blockheight, startX) { \
|
||||
for(int tempi = 0; tempi < blockheight; ++tempi) { \
|
||||
for(j = startX; j < gs.imageEndX; j++, pbuf++) { \
|
||||
writePixel##psm##_0(pstart, j%2048, (i+tempi)%2048, pbuf[0], gs.dstbuf.bw); \
|
||||
} \
|
||||
pbuf += pitch-fracX; \
|
||||
} \
|
||||
} \
|
||||
|
||||
// transfers whole rows
|
||||
#define TRANSMIT_HOSTLOCAL_Y_24(psm, T, widthlimit, endY) { \
|
||||
if( widthlimit != 8 || ((gs.imageEndX-gs.trxpos.dx)%widthlimit) ) { \
|
||||
/*GS_LOG("Bad Transmission! %d %d, psm: %d\n", gs.trxpos.dx, gs.imageEndX, DSTPSM);*/ \
|
||||
for(; i < endY; ++i) { \
|
||||
for(; j < gs.imageEndX && nSize > 0; j += 1, nSize -= 1, pbuf += 3) { \
|
||||
writePixel##psm##_0(pstart, j%2048, i%2048, *(u32*)(pbuf), gs.dstbuf.bw); \
|
||||
} \
|
||||
\
|
||||
if( j >= gs.imageEndX ) { assert(gs.imageTransfer == -1 || j == gs.imageEndX); j = gs.trxpos.dx; } \
|
||||
else { assert( gs.imageTransfer == -1 || nSize == 0 ); goto End; } \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
assert( /*(nSize%widthlimit) == 0 &&*/ widthlimit == 8 ); \
|
||||
for(; i < endY; ++i) { \
|
||||
for(; j < gs.imageEndX && nSize > 0; j += widthlimit, nSize -= widthlimit, pbuf += 3*widthlimit) { \
|
||||
if( nSize < widthlimit ) goto End; \
|
||||
/* write as many pixel at one time as possible */ \
|
||||
writePixel##psm##_0(pstart, j%2048, i%2048, *(u32*)(pbuf+0), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+1)%2048, i%2048, *(u32*)(pbuf+3), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+2)%2048, i%2048, *(u32*)(pbuf+6), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+3)%2048, i%2048, *(u32*)(pbuf+9), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+4)%2048, i%2048, *(u32*)(pbuf+12), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+5)%2048, i%2048, *(u32*)(pbuf+15), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+6)%2048, i%2048, *(u32*)(pbuf+18), gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+7)%2048, i%2048, *(u32*)(pbuf+21), gs.dstbuf.bw); \
|
||||
} \
|
||||
\
|
||||
if( j >= gs.imageEndX ) { assert(gs.imageTransfer == -1 || j == gs.imageEndX); j = gs.trxpos.dx; } \
|
||||
else { \
|
||||
if( nSize < 0 ) { \
|
||||
/* extracted too much */ \
|
||||
assert( (nSize%3)==0 && nSize > -24 ); \
|
||||
j += nSize/3; \
|
||||
nSize = 0; \
|
||||
} \
|
||||
assert( gs.imageTransfer == -1 || nSize == 0 ); \
|
||||
goto End; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
|
||||
// transmit until endX, don't check size since it has already been prevalidated
|
||||
#define TRANSMIT_HOSTLOCAL_X_24(psm, T, widthlimit, blockheight, startX) { \
|
||||
for(int tempi = 0; tempi < blockheight; ++tempi) { \
|
||||
for(j = startX; j < gs.imageEndX; j++, pbuf += 3) { \
|
||||
writePixel##psm##_0(pstart, j%2048, (i+tempi)%2048, *(u32*)pbuf, gs.dstbuf.bw); \
|
||||
} \
|
||||
pbuf += 3*(pitch-fracX); \
|
||||
} \
|
||||
} \
|
||||
|
||||
// meant for 4bit transfers
|
||||
#define TRANSMIT_HOSTLOCAL_Y_4(psm, T, widthlimit, endY) { \
|
||||
for(; i < endY; ++i) { \
|
||||
for(; j < gs.imageEndX && nSize > 0; j += widthlimit, nSize -= widthlimit) { \
|
||||
/* write as many pixel at one time as possible */ \
|
||||
writePixel##psm##_0(pstart, j%2048, i%2048, *pbuf&0x0f, gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+1)%2048, i%2048, *pbuf>>4, gs.dstbuf.bw); \
|
||||
pbuf++; \
|
||||
if( widthlimit > 2 ) { \
|
||||
writePixel##psm##_0(pstart, (j+2)%2048, i%2048, *pbuf&0x0f, gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+3)%2048, i%2048, *pbuf>>4, gs.dstbuf.bw); \
|
||||
pbuf++; \
|
||||
\
|
||||
if( widthlimit > 4 ) { \
|
||||
writePixel##psm##_0(pstart, (j+4)%2048, i%2048, *pbuf&0x0f, gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+5)%2048, i%2048, *pbuf>>4, gs.dstbuf.bw); \
|
||||
pbuf++; \
|
||||
\
|
||||
if( widthlimit > 6 ) { \
|
||||
writePixel##psm##_0(pstart, (j+6)%2048, i%2048, *pbuf&0x0f, gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+7)%2048, i%2048, *pbuf>>4, gs.dstbuf.bw); \
|
||||
pbuf++; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if( j >= gs.imageEndX ) { j = gs.trxpos.dx; } \
|
||||
else { assert( gs.imageTransfer == -1 || (nSize/32) == 0 ); goto End; } \
|
||||
} \
|
||||
} \
|
||||
|
||||
// transmit until endX, don't check size since it has already been prevalidated
|
||||
#define TRANSMIT_HOSTLOCAL_X_4(psm, T, widthlimit, blockheight, startX) { \
|
||||
for(int tempi = 0; tempi < blockheight; ++tempi) { \
|
||||
for(j = startX; j < gs.imageEndX; j+=2, pbuf++) { \
|
||||
writePixel##psm##_0(pstart, j%2048, (i+tempi)%2048, pbuf[0]&0x0f, gs.dstbuf.bw); \
|
||||
writePixel##psm##_0(pstart, (j+1)%2048, (i+tempi)%2048, pbuf[0]>>4, gs.dstbuf.bw); \
|
||||
} \
|
||||
pbuf += (pitch-fracX)/2; \
|
||||
} \
|
||||
} \
|
||||
|
||||
// calculate pitch in source buffer
|
||||
#define TRANSMIT_PITCH_(pitch, T) (pitch*sizeof(T))
|
||||
#define TRANSMIT_PITCH_24(pitch, T) (pitch*3)
|
||||
#define TRANSMIT_PITCH_4(pitch, T) (pitch/2)
|
||||
|
||||
// special swizzle macros
|
||||
#define SwizzleBlock24(dst, src, pitch) { \
|
||||
u8* pnewsrc = src; \
|
||||
u32* pblock = tempblock; \
|
||||
\
|
||||
for(int by = 0; by < 7; ++by, pblock += 8, pnewsrc += pitch-24) { \
|
||||
for(int bx = 0; bx < 8; ++bx, pnewsrc += 3) { \
|
||||
pblock[bx] = *(u32*)pnewsrc; \
|
||||
} \
|
||||
} \
|
||||
for(int bx = 0; bx < 7; ++bx, pnewsrc += 3) { \
|
||||
/* might be 1 byte out of bounds of GS memory */ \
|
||||
pblock[bx] = *(u32*)pnewsrc; \
|
||||
} \
|
||||
/* do 3 bytes for the last copy */ \
|
||||
*((u8*)pblock+28) = pnewsrc[0]; \
|
||||
*((u8*)pblock+29) = pnewsrc[1]; \
|
||||
*((u8*)pblock+30) = pnewsrc[2]; \
|
||||
SwizzleBlock32((u8*)dst, (u8*)tempblock, 32, 0x00ffffff); \
|
||||
} \
|
||||
|
||||
#define SwizzleBlock24u SwizzleBlock24
|
||||
|
||||
#define SwizzleBlock8H(dst, src, pitch) { \
|
||||
u8* pnewsrc = src; \
|
||||
u32* pblock = tempblock; \
|
||||
\
|
||||
for(int by = 0; by < 8; ++by, pblock += 8, pnewsrc += pitch) { \
|
||||
u32 u = *(u32*)pnewsrc; \
|
||||
pblock[0] = u<<24; \
|
||||
pblock[1] = u<<16; \
|
||||
pblock[2] = u<<8; \
|
||||
pblock[3] = u; \
|
||||
u = *(u32*)(pnewsrc+4); \
|
||||
pblock[4] = u<<24; \
|
||||
pblock[5] = u<<16; \
|
||||
pblock[6] = u<<8; \
|
||||
pblock[7] = u; \
|
||||
} \
|
||||
SwizzleBlock32((u8*)dst, (u8*)tempblock, 32, 0xff000000); \
|
||||
} \
|
||||
|
||||
#define SwizzleBlock8Hu SwizzleBlock8H
|
||||
|
||||
#define SwizzleBlock4HH(dst, src, pitch) { \
|
||||
u8* pnewsrc = src; \
|
||||
u32* pblock = tempblock; \
|
||||
\
|
||||
for(int by = 0; by < 8; ++by, pblock += 8, pnewsrc += pitch) { \
|
||||
u32 u = *(u32*)pnewsrc; \
|
||||
pblock[0] = u<<28; \
|
||||
pblock[1] = u<<24; \
|
||||
pblock[2] = u<<20; \
|
||||
pblock[3] = u<<16; \
|
||||
pblock[4] = u<<12; \
|
||||
pblock[5] = u<<8; \
|
||||
pblock[6] = u<<4; \
|
||||
pblock[7] = u; \
|
||||
} \
|
||||
SwizzleBlock32((u8*)dst, (u8*)tempblock, 32, 0xf0000000); \
|
||||
} \
|
||||
|
||||
#define SwizzleBlock4HHu SwizzleBlock4HH
|
||||
|
||||
#define SwizzleBlock4HL(dst, src, pitch) { \
|
||||
u8* pnewsrc = src; \
|
||||
u32* pblock = tempblock; \
|
||||
\
|
||||
for(int by = 0; by < 8; ++by, pblock += 8, pnewsrc += pitch) { \
|
||||
u32 u = *(u32*)pnewsrc; \
|
||||
pblock[0] = u<<24; \
|
||||
pblock[1] = u<<20; \
|
||||
pblock[2] = u<<16; \
|
||||
pblock[3] = u<<12; \
|
||||
pblock[4] = u<<8; \
|
||||
pblock[5] = u<<4; \
|
||||
pblock[6] = u; \
|
||||
pblock[7] = u>>4; \
|
||||
} \
|
||||
SwizzleBlock32((u8*)dst, (u8*)tempblock, 32, 0x0f000000); \
|
||||
} \
|
||||
|
||||
#define SwizzleBlock4HLu SwizzleBlock4HL
|
||||
|
||||
// ------------------------
|
||||
// | Y |
|
||||
// ------------------------
|
||||
// | block | |
|
||||
// | aligned area | X |
|
||||
// | | |
|
||||
// ------------------------
|
||||
// | Y |
|
||||
// ------------------------
|
||||
#define DEFINE_TRANSFERLOCAL(psm, T, widthlimit, blockbits, blockwidth, blockheight, TransSfx, SwizzleBlock) \
|
||||
int TransferHostLocal##psm(const void* pbyMem, u32 nQWordSize) \
|
||||
{ \
|
||||
START_HOSTLOCAL(); \
|
||||
\
|
||||
const T* pbuf = (const T*)pbyMem; \
|
||||
int nLeftOver = (nQWordSize*4*2)%(TRANSMIT_PITCH##TransSfx(2, T)); \
|
||||
int nSize = nQWordSize*4*2/TRANSMIT_PITCH##TransSfx(2, T); \
|
||||
nSize = min(nSize, gs.imageWnew * gs.imageHnew); \
|
||||
\
|
||||
int pitch, area, fracX; \
|
||||
int endY = ROUND_UPPOW2(i, blockheight); \
|
||||
int alignedY = ROUND_DOWNPOW2(gs.imageEndY, blockheight); \
|
||||
int alignedX = ROUND_DOWNPOW2(gs.imageEndX, blockwidth); \
|
||||
bool bAligned, bCanAlign = MOD_POW2(gs.trxpos.dx, blockwidth) == 0 && (j == gs.trxpos.dx) && (alignedY > endY) && alignedX > gs.trxpos.dx; \
|
||||
\
|
||||
if( (gs.imageEndX-gs.trxpos.dx)%widthlimit ) { \
|
||||
/* hack */ \
|
||||
int testwidth = (int)nSize - (gs.imageEndY-i)*(gs.imageEndX-gs.trxpos.dx)+(j-gs.trxpos.dx); \
|
||||
if((testwidth <= widthlimit) && (testwidth >= -widthlimit)) { \
|
||||
/* don't transfer */ \
|
||||
/*DEBUG_LOG("bad texture %s: %d %d %d\n", #psm, gs.trxpos.dx, gs.imageEndX, nQWordSize);*/ \
|
||||
gs.imageTransfer = -1; \
|
||||
} \
|
||||
bCanAlign = false; \
|
||||
} \
|
||||
\
|
||||
/* first align on block boundary */ \
|
||||
if( MOD_POW2(i, blockheight) || !bCanAlign ) { \
|
||||
\
|
||||
if( !bCanAlign ) \
|
||||
endY = gs.imageEndY; /* transfer the whole image */ \
|
||||
else \
|
||||
assert( endY < gs.imageEndY); /* part of alignment condition */ \
|
||||
\
|
||||
if( ((gs.imageEndX-gs.trxpos.dx)%widthlimit) || ((gs.imageEndX-j)%widthlimit) ) { \
|
||||
/* transmit with a width of 1 */ \
|
||||
TRANSMIT_HOSTLOCAL_Y##TransSfx(psm, T, (1+(DSTPSM == 0x14)), endY); \
|
||||
} \
|
||||
else { \
|
||||
TRANSMIT_HOSTLOCAL_Y##TransSfx(psm, T, widthlimit, endY); \
|
||||
} \
|
||||
\
|
||||
if( nSize == 0 || i == gs.imageEndY ) \
|
||||
goto End; \
|
||||
} \
|
||||
\
|
||||
assert( MOD_POW2(i, blockheight) == 0 && j == gs.trxpos.dx); \
|
||||
\
|
||||
/* can align! */ \
|
||||
pitch = gs.imageEndX-gs.trxpos.dx; \
|
||||
area = pitch*blockheight; \
|
||||
fracX = gs.imageEndX-alignedX; \
|
||||
\
|
||||
/* on top of checking whether pbuf is alinged, make sure that the width is at least aligned to its limits (due to bugs in pcsx2) */ \
|
||||
bAligned = !((uptr)pbuf & 0xf) && (TRANSMIT_PITCH##TransSfx(pitch, T)&0xf) == 0; \
|
||||
\
|
||||
/* transfer aligning to blocks */ \
|
||||
for(; i < alignedY && nSize >= area; i += blockheight, nSize -= area) { \
|
||||
\
|
||||
if( bAligned || ((DSTPSM==PSMCT24) || (DSTPSM==PSMT8H) || (DSTPSM==PSMT4HH) || (DSTPSM==PSMT4HL)) ) { \
|
||||
for(int tempj = gs.trxpos.dx; tempj < alignedX; tempj += blockwidth, pbuf += TRANSMIT_PITCH##TransSfx(blockwidth, T)/sizeof(T)) { \
|
||||
SwizzleBlock(pstart + getPixelAddress##psm##_0(tempj, i, gs.dstbuf.bw)*blockbits/8, \
|
||||
(u8*)pbuf, TRANSMIT_PITCH##TransSfx(pitch, T)); \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
for(int tempj = gs.trxpos.dx; tempj < alignedX; tempj += blockwidth, pbuf += TRANSMIT_PITCH##TransSfx(blockwidth, T)/sizeof(T)) { \
|
||||
SwizzleBlock##u(pstart + getPixelAddress##psm##_0(tempj, i, gs.dstbuf.bw)*blockbits/8, \
|
||||
(u8*)pbuf, TRANSMIT_PITCH##TransSfx(pitch, T)); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
/* transfer the rest */ \
|
||||
if( alignedX < gs.imageEndX ) { \
|
||||
TRANSMIT_HOSTLOCAL_X##TransSfx(psm, T, widthlimit, blockheight, alignedX); \
|
||||
pbuf -= TRANSMIT_PITCH##TransSfx((alignedX-gs.trxpos.dx), T)/sizeof(T); \
|
||||
} \
|
||||
else pbuf += (blockheight-1)*TRANSMIT_PITCH##TransSfx(pitch, T)/sizeof(T); \
|
||||
j = gs.trxpos.dx; \
|
||||
} \
|
||||
\
|
||||
if( TRANSMIT_PITCH##TransSfx(nSize, T)/4 > 0 ) { \
|
||||
TRANSMIT_HOSTLOCAL_Y##TransSfx(psm, T, widthlimit, gs.imageEndY); \
|
||||
/* sometimes wrong sizes are sent (tekken tag) */ \
|
||||
assert( gs.imageTransfer == -1 || TRANSMIT_PITCH##TransSfx(nSize,T)/4 <= 2 ); \
|
||||
} \
|
||||
\
|
||||
END_HOSTLOCAL(); \
|
||||
return (nSize * TRANSMIT_PITCH##TransSfx(2, T) + nLeftOver)/2; \
|
||||
} \
|
||||
|
||||
DEFINE_TRANSFERLOCAL(32, u32, 2, 32, 8, 8, _, SwizzleBlock32);
|
||||
DEFINE_TRANSFERLOCAL(32Z, u32, 2, 32, 8, 8, _, SwizzleBlock32);
|
||||
DEFINE_TRANSFERLOCAL(24, u8, 8, 32, 8, 8, _24, SwizzleBlock24);
|
||||
DEFINE_TRANSFERLOCAL(24Z, u8, 8, 32, 8, 8, _24, SwizzleBlock24);
|
||||
DEFINE_TRANSFERLOCAL(16, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
DEFINE_TRANSFERLOCAL(16S, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
DEFINE_TRANSFERLOCAL(16Z, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
DEFINE_TRANSFERLOCAL(16SZ, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
DEFINE_TRANSFERLOCAL(8, u8, 4, 8, 16, 16, _, SwizzleBlock8);
|
||||
DEFINE_TRANSFERLOCAL(4, u8, 8, 4, 32, 16, _4, SwizzleBlock4);
|
||||
DEFINE_TRANSFERLOCAL(8H, u8, 4, 32, 8, 8, _, SwizzleBlock8H);
|
||||
DEFINE_TRANSFERLOCAL(4HL, u8, 8, 32, 8, 8, _4, SwizzleBlock4HL);
|
||||
DEFINE_TRANSFERLOCAL(4HH, u8, 8, 32, 8, 8, _4, SwizzleBlock4HH);
|
||||
|
||||
//#define T u8
|
||||
//#define widthlimit 8
|
||||
//#define blockbits 4
|
||||
//#define blockwidth 32
|
||||
//#define blockheight 16
|
||||
//
|
||||
//void TransferHostLocal4(const void* pbyMem, u32 nQWordSize)
|
||||
//{
|
||||
// START_HOSTLOCAL();
|
||||
//
|
||||
// const T* pbuf = (const T*)pbyMem;
|
||||
// u32 nSize = nQWordSize*16*2/TRANSMIT_PITCH_4(2, T);
|
||||
// nSize = min(nSize, gs.imageWnew * gs.imageHnew);
|
||||
//
|
||||
// int endY = ROUND_UPPOW2(i, blockheight);
|
||||
// int alignedY = ROUND_DOWNPOW2(gs.imageEndY, blockheight);
|
||||
// int alignedX = ROUND_DOWNPOW2(gs.imageEndX, blockwidth);
|
||||
// bool bCanAlign = MOD_POW2(gs.trxpos.dx, blockwidth) == 0 && (j == gs.trxpos.dx) && (alignedY > endY) && alignedX > gs.trxpos.dx;
|
||||
//
|
||||
// if( (gs.imageEndX-gs.trxpos.dx)%widthlimit ) {
|
||||
// /* hack */
|
||||
// if( abs((int)nSize - (gs.imageEndY-i)*(gs.imageEndX-gs.trxpos.dx)+(j-gs.trxpos.dx)) <= widthlimit ) {
|
||||
// /* don't transfer */
|
||||
// /*DEBUG_LOG("bad texture %s: %d %d %d\n", #psm, gs.trxpos.dx, gs.imageEndX, nQWordSize);*/
|
||||
// gs.imageTransfer = -1;
|
||||
// }
|
||||
// bCanAlign = false;
|
||||
// }
|
||||
//
|
||||
// /* first align on block boundary */
|
||||
// if( MOD_POW2(i, blockheight) || !bCanAlign ) {
|
||||
//
|
||||
// if( !bCanAlign )
|
||||
// endY = gs.imageEndY; /* transfer the whole image */
|
||||
// else
|
||||
// assert( endY < gs.imageEndY); /* part of alignment condition */
|
||||
//
|
||||
// if( (DSTPSM == 0x13 || DSTPSM == 0x14) && ((gs.imageEndX-gs.trxpos.dx)%widthlimit) ) {
|
||||
// /* transmit with a width of 1 */
|
||||
// TRANSMIT_HOSTLOCAL_Y_4(4, T, (1+(DSTPSM == 0x14)), endY);
|
||||
// }
|
||||
// else {
|
||||
// TRANSMIT_HOSTLOCAL_Y_4(4, T, widthlimit, endY);
|
||||
// }
|
||||
//
|
||||
// if( nSize == 0 || i == gs.imageEndY )
|
||||
// goto End;
|
||||
// }
|
||||
//
|
||||
// assert( MOD_POW2(i, blockheight) == 0 && j == gs.trxpos.dx);
|
||||
//
|
||||
// /* can align! */
|
||||
// int pitch = gs.imageEndX-gs.trxpos.dx;
|
||||
// u32 area = pitch*blockheight;
|
||||
// int fracX = gs.imageEndX-alignedX;
|
||||
//
|
||||
// /* on top of checking whether pbuf is alinged, make sure that the width is at least aligned to its limits (due to bugs in pcsx2) */
|
||||
// bool bAligned = !((u32)pbuf & 0xf) && (TRANSMIT_PITCH_4(pitch, T)&0xf) == 0;
|
||||
//
|
||||
// /* transfer aligning to blocks */
|
||||
// for(; i < alignedY && nSize >= area; i += blockheight, nSize -= area) {
|
||||
//
|
||||
// if( bAligned || ((DSTPSM==PSMCT24) || (DSTPSM==PSMT8H) || (DSTPSM==PSMT4HH) || (DSTPSM==PSMT4HL)) ) {
|
||||
// for(int tempj = gs.trxpos.dx; tempj < alignedX; tempj += blockwidth, pbuf += TRANSMIT_PITCH_4(blockwidth, T)/sizeof(T)) {
|
||||
// SwizzleBlock4(pstart + getPixelAddress4_0(tempj, i, gs.dstbuf.bw)*blockbits/8,
|
||||
// (u8*)pbuf, TRANSMIT_PITCH_4(pitch, T));
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// for(int tempj = gs.trxpos.dx; tempj < alignedX; tempj += blockwidth, pbuf += TRANSMIT_PITCH_4(blockwidth, T)/sizeof(T)) {
|
||||
// SwizzleBlock4u(pstart + getPixelAddress4_0(tempj, i, gs.dstbuf.bw)*blockbits/8,
|
||||
// (u8*)pbuf, TRANSMIT_PITCH_4(pitch, T));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /* transfer the rest */
|
||||
// if( alignedX < gs.imageEndX ) {
|
||||
// TRANSMIT_HOSTLOCAL_X_4(4, T, widthlimit, blockheight, alignedX);
|
||||
// pbuf -= TRANSMIT_PITCH_4((alignedX-gs.trxpos.dx), T)/sizeof(T);
|
||||
// }
|
||||
// else pbuf += (blockheight-1)*TRANSMIT_PITCH_4(pitch, T)/sizeof(T);
|
||||
// j = 0;
|
||||
// }
|
||||
//
|
||||
// if( TRANSMIT_PITCH_4(nSize, T)/4 > 0 ) {
|
||||
// TRANSMIT_HOSTLOCAL_Y_4(4, T, widthlimit, gs.imageEndY);
|
||||
// /* sometimes wrong sizes are sent (tekken tag) */
|
||||
// assert( gs.imageTransfer == -1 || TRANSMIT_PITCH_4(nSize,T)/4 <= 2 );
|
||||
// }
|
||||
//
|
||||
// END_HOSTLOCAL();
|
||||
//}
|
||||
|
||||
void TransferLocalHost32(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost24(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost16(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost16S(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost8(void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
}
|
||||
|
||||
void TransferLocalHost4(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost8H(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost4HL(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost4HH(void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
}
|
||||
|
||||
void TransferLocalHost32Z(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost24Z(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost16Z(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
void TransferLocalHost16SZ(void* pbyMem, u32 nQWordSize)
|
||||
{FUNCLOG
|
||||
}
|
||||
|
||||
#define FILL_BLOCK(bw, bh, ox, oy, mult, psm, psmcol) { \
|
||||
b.vTexDims = Vector(BLOCK_TEXWIDTH/(float)(bw), BLOCK_TEXHEIGHT/(float)bh, 0, 0); \
|
||||
b.vTexBlock = Vector((float)bw/BLOCK_TEXWIDTH, (float)bh/BLOCK_TEXHEIGHT, ((float)ox+0.2f)/BLOCK_TEXWIDTH, ((float)oy+0.05f)/BLOCK_TEXHEIGHT); \
|
||||
b.width = bw; \
|
||||
b.height = bh; \
|
||||
b.colwidth = bh / 4; \
|
||||
b.colheight = bw / 8; \
|
||||
b.bpp = 32/mult; \
|
||||
\
|
||||
b.pageTable = &g_pageTable##psm[0][0]; \
|
||||
b.blockTable = &g_blockTable##psm[0][0]; \
|
||||
b.columnTable = &g_columnTable##psmcol[0][0]; \
|
||||
assert( sizeof(g_pageTable##psm) == bw*bh*sizeof(g_pageTable##psm[0][0]) ); \
|
||||
psrcf = (float*)&vBlockData[0] + ox + oy * BLOCK_TEXWIDTH; \
|
||||
psrcw = (u16*)&vBlockData[0] + ox + oy * BLOCK_TEXWIDTH; \
|
||||
for(i = 0; i < bh; ++i) { \
|
||||
for(j = 0; j < bw; ++j) { \
|
||||
/* fill the table */ \
|
||||
u32 u = g_blockTable##psm[(i / b.colheight)][(j / b.colwidth)] * 64 * mult + g_columnTable##psmcol[i%b.colheight][j%b.colwidth]; \
|
||||
b.pageTable[i*bw+j] = u; \
|
||||
if( floatfmt ) { \
|
||||
psrcf[i*BLOCK_TEXWIDTH+j] = (float)(u) / (float)(GPU_TEXWIDTH*mult); \
|
||||
} \
|
||||
else { \
|
||||
psrcw[i*BLOCK_TEXWIDTH+j] = u; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if( floatfmt ) { \
|
||||
assert( floatfmt ); \
|
||||
psrcv = (Vector*)&vBilinearData[0] + ox + oy * BLOCK_TEXWIDTH; \
|
||||
for(i = 0; i < bh; ++i) { \
|
||||
for(j = 0; j < bw; ++j) { \
|
||||
Vector* pv = &psrcv[i*BLOCK_TEXWIDTH+j]; \
|
||||
pv->x = psrcf[i*BLOCK_TEXWIDTH+j]; \
|
||||
pv->y = psrcf[i*BLOCK_TEXWIDTH+((j+1)%bw)]; \
|
||||
pv->z = psrcf[((i+1)%bh)*BLOCK_TEXWIDTH+j]; \
|
||||
pv->w = psrcf[((i+1)%bh)*BLOCK_TEXWIDTH+((j+1)%bw)]; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
b.getPixelAddress = getPixelAddress##psm; \
|
||||
b.getPixelAddress_0 = getPixelAddress##psm##_0; \
|
||||
b.writePixel = writePixel##psm; \
|
||||
b.writePixel_0 = writePixel##psm##_0; \
|
||||
b.readPixel = readPixel##psm; \
|
||||
b.readPixel_0 = readPixel##psm##_0; \
|
||||
b.TransferHostLocal = TransferHostLocal##psm; \
|
||||
b.TransferLocalHost = TransferLocalHost##psm; \
|
||||
} \
|
||||
|
||||
void BLOCK::FillBlocks(vector<char>& vBlockData, vector<char>& vBilinearData, int floatfmt)
|
||||
{
|
||||
FUNCLOG
|
||||
vBlockData.resize(BLOCK_TEXWIDTH * BLOCK_TEXHEIGHT * (floatfmt ? 4 : 2));
|
||||
if( floatfmt )
|
||||
vBilinearData.resize(BLOCK_TEXWIDTH * BLOCK_TEXHEIGHT * sizeof(Vector));
|
||||
|
||||
int i, j;
|
||||
BLOCK b;
|
||||
float* psrcf = NULL;
|
||||
u16* psrcw = NULL;
|
||||
Vector* psrcv = NULL;
|
||||
|
||||
memset(m_Blocks, 0, sizeof(m_Blocks));
|
||||
|
||||
// 32
|
||||
FILL_BLOCK(64, 32, 0, 0, 1, 32, 32);
|
||||
m_Blocks[PSMCT32] = b;
|
||||
|
||||
// 24 (same as 32 except write/readPixel are different)
|
||||
m_Blocks[PSMCT24] = b;
|
||||
m_Blocks[PSMCT24].writePixel = writePixel24;
|
||||
m_Blocks[PSMCT24].writePixel_0 = writePixel24_0;
|
||||
m_Blocks[PSMCT24].readPixel = readPixel24;
|
||||
m_Blocks[PSMCT24].readPixel_0 = readPixel24_0;
|
||||
m_Blocks[PSMCT24].TransferHostLocal = TransferHostLocal24;
|
||||
m_Blocks[PSMCT24].TransferLocalHost = TransferLocalHost24;
|
||||
|
||||
// 8H (same as 32 except write/readPixel are different)
|
||||
m_Blocks[PSMT8H] = b;
|
||||
m_Blocks[PSMT8H].writePixel = writePixel8H;
|
||||
m_Blocks[PSMT8H].writePixel_0 = writePixel8H_0;
|
||||
m_Blocks[PSMT8H].readPixel = readPixel8H;
|
||||
m_Blocks[PSMT8H].readPixel_0 = readPixel8H_0;
|
||||
m_Blocks[PSMT8H].TransferHostLocal = TransferHostLocal8H;
|
||||
m_Blocks[PSMT8H].TransferLocalHost = TransferLocalHost8H;
|
||||
|
||||
m_Blocks[PSMT4HL] = b;
|
||||
m_Blocks[PSMT4HL].writePixel = writePixel4HL;
|
||||
m_Blocks[PSMT4HL].writePixel_0 = writePixel4HL_0;
|
||||
m_Blocks[PSMT4HL].readPixel = readPixel4HL;
|
||||
m_Blocks[PSMT4HL].readPixel_0 = readPixel4HL_0;
|
||||
m_Blocks[PSMT4HL].TransferHostLocal = TransferHostLocal4HL;
|
||||
m_Blocks[PSMT4HL].TransferLocalHost = TransferLocalHost4HL;
|
||||
|
||||
m_Blocks[PSMT4HH] = b;
|
||||
m_Blocks[PSMT4HH].writePixel = writePixel4HH;
|
||||
m_Blocks[PSMT4HH].writePixel_0 = writePixel4HH_0;
|
||||
m_Blocks[PSMT4HH].readPixel = readPixel4HH;
|
||||
m_Blocks[PSMT4HH].readPixel_0 = readPixel4HH_0;
|
||||
m_Blocks[PSMT4HH].TransferHostLocal = TransferHostLocal4HH;
|
||||
m_Blocks[PSMT4HH].TransferLocalHost = TransferLocalHost4HH;
|
||||
|
||||
// 32z
|
||||
FILL_BLOCK(64, 32, 64, 0, 1, 32Z, 32);
|
||||
m_Blocks[PSMT32Z] = b;
|
||||
|
||||
// 24Z (same as 32Z except write/readPixel are different)
|
||||
m_Blocks[PSMT24Z] = b;
|
||||
m_Blocks[PSMT24Z].writePixel = writePixel24Z;
|
||||
m_Blocks[PSMT24Z].writePixel_0 = writePixel24Z_0;
|
||||
m_Blocks[PSMT24Z].readPixel = readPixel24Z;
|
||||
m_Blocks[PSMT24Z].readPixel_0 = readPixel24Z_0;
|
||||
m_Blocks[PSMT24Z].TransferHostLocal = TransferHostLocal24Z;
|
||||
m_Blocks[PSMT24Z].TransferLocalHost = TransferLocalHost24Z;
|
||||
|
||||
// 16
|
||||
FILL_BLOCK(64, 64, 0, 32, 2, 16, 16);
|
||||
m_Blocks[PSMCT16] = b;
|
||||
|
||||
// 16s
|
||||
FILL_BLOCK(64, 64, 64, 32, 2, 16S, 16);
|
||||
m_Blocks[PSMCT16S] = b;
|
||||
|
||||
// 16z
|
||||
FILL_BLOCK(64, 64, 0, 96, 2, 16Z, 16);
|
||||
m_Blocks[PSMT16Z] = b;
|
||||
|
||||
// 16sz
|
||||
FILL_BLOCK(64, 64, 64, 96, 2, 16SZ, 16);
|
||||
m_Blocks[PSMT16SZ] = b;
|
||||
|
||||
// 8
|
||||
FILL_BLOCK(128, 64, 0, 160, 4, 8, 8);
|
||||
m_Blocks[PSMT8] = b;
|
||||
|
||||
// 4
|
||||
FILL_BLOCK(128, 128, 0, 224, 8, 4, 4);
|
||||
m_Blocks[PSMT4] = b;
|
||||
}
|
|
@ -0,0 +1,487 @@
|
|||
/* ZeroGS KOSMOS
|
||||
* Copyright (C) 2005-2006 zerofrog@gmail.com
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __MEM_H__
|
||||
#define __MEM_H__
|
||||
|
||||
#include <assert.h>
|
||||
#include <vector>
|
||||
|
||||
// works only when base is a power of 2
|
||||
#define ROUND_UPPOW2(val, base) (((val)+(base-1))&~(base-1))
|
||||
#define ROUND_DOWNPOW2(val, base) ((val)&~(base-1))
|
||||
#define MOD_POW2(val, base) ((val)&(base-1))
|
||||
|
||||
// d3d texture dims
|
||||
#define BLOCK_TEXWIDTH 128
|
||||
#define BLOCK_TEXHEIGHT 512
|
||||
|
||||
// rest not visible externally
|
||||
struct BLOCK
|
||||
{
|
||||
BLOCK() { memset(this, 0, sizeof(BLOCK)); }
|
||||
|
||||
// shader constants for this block
|
||||
Vector vTexBlock;
|
||||
Vector vTexDims;
|
||||
int width, height; // dims of one page in pixels
|
||||
int bpp;
|
||||
int colwidth, colheight;
|
||||
u32* pageTable; // offset inside each page
|
||||
u32* blockTable;
|
||||
u32* columnTable;
|
||||
|
||||
u32 (*getPixelAddress)(int x, int y, u32 bp, u32 bw);
|
||||
u32 (*getPixelAddress_0)(int x, int y, u32 bw);
|
||||
void (*writePixel)(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw);
|
||||
void (*writePixel_0)(void* pmem, int x, int y, u32 pixel, u32 bw);
|
||||
u32 (*readPixel)(const void* pmem, int x, int y, u32 bp, u32 bw);
|
||||
u32 (*readPixel_0)(const void* pmem, int x, int y, u32 bw);
|
||||
int (*TransferHostLocal)(const void* pbyMem, u32 nQWordSize);
|
||||
void (*TransferLocalHost)(void* pbyMem, u32 nQWordSize);
|
||||
|
||||
// texture must be of dims BLOCK_TEXWIDTH and BLOCK_TEXHEIGHT
|
||||
static void FillBlocks(std::vector<char>& vBlockData, std::vector<char>& vBilinearData, int floatfmt);
|
||||
};
|
||||
|
||||
extern BLOCK m_Blocks[];
|
||||
|
||||
extern u32 g_blockTable32[4][8];
|
||||
extern u32 g_blockTable32Z[4][8];
|
||||
extern u32 g_blockTable16[8][4];
|
||||
extern u32 g_blockTable16S[8][4];
|
||||
extern u32 g_blockTable16Z[8][4];
|
||||
extern u32 g_blockTable16SZ[8][4];
|
||||
extern u32 g_blockTable8[4][8];
|
||||
extern u32 g_blockTable4[8][4];
|
||||
|
||||
extern u32 g_columnTable32[8][8];
|
||||
extern u32 g_columnTable16[8][16];
|
||||
extern u32 g_columnTable8[16][16];
|
||||
extern u32 g_columnTable4[16][32];
|
||||
|
||||
extern u32 g_pageTable32[32][64];
|
||||
extern u32 g_pageTable32Z[32][64];
|
||||
extern u32 g_pageTable16[64][64];
|
||||
extern u32 g_pageTable16S[64][64];
|
||||
extern u32 g_pageTable16Z[64][64];
|
||||
extern u32 g_pageTable16SZ[64][64];
|
||||
extern u32 g_pageTable8[64][128];
|
||||
extern u32 g_pageTable4[128][128];
|
||||
|
||||
static __forceinline u32 getPixelAddress32(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
|
||||
u32 word = bp * 64 + basepage * 2048 + g_pageTable32[y&31][x&63];
|
||||
//assert (word < 0x100000);
|
||||
//word = min(word, 0xfffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress32_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
|
||||
u32 word = basepage * 2048 + g_pageTable32[y&31][x&63];
|
||||
//assert (word < 0x100000);
|
||||
//word = min(word, 0xfffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
#define getPixelAddress24 getPixelAddress32
|
||||
#define getPixelAddress24_0 getPixelAddress32_0
|
||||
#define getPixelAddress8H getPixelAddress32
|
||||
#define getPixelAddress8H_0 getPixelAddress32_0
|
||||
#define getPixelAddress4HL getPixelAddress32
|
||||
#define getPixelAddress4HL_0 getPixelAddress32_0
|
||||
#define getPixelAddress4HH getPixelAddress32
|
||||
#define getPixelAddress4HH_0 getPixelAddress32_0
|
||||
|
||||
static __forceinline u32 getPixelAddress16(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = bp * 128 + basepage * 4096 + g_pageTable16[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress16_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = basepage * 4096 + g_pageTable16[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress16S(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = bp * 128 + basepage * 4096 + g_pageTable16S[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress16S_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = basepage * 4096 + g_pageTable16S[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress8(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>6) * ((bw+127)>>7)) + (x>>7);
|
||||
u32 word = bp * 256 + basepage * 8192 + g_pageTable8[y&63][x&127];
|
||||
//assert (word < 0x400000);
|
||||
//word = min(word, 0x3fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress8_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>6) * ((bw+127)>>7)) + (x>>7);
|
||||
u32 word = basepage * 8192 + g_pageTable8[y&63][x&127];
|
||||
//assert (word < 0x400000);
|
||||
//word = min(word, 0x3fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress4(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>7) * ((bw+127)>>7)) + (x>>7);
|
||||
u32 word = bp * 512 + basepage * 16384 + g_pageTable4[y&127][x&127];
|
||||
//assert (word < 0x800000);
|
||||
//word = min(word, 0x7fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress4_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>7) * ((bw+127)>>7)) + (x>>7);
|
||||
u32 word = basepage * 16384 + g_pageTable4[y&127][x&127];
|
||||
//assert (word < 0x800000);
|
||||
//word = min(word, 0x7fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress32Z(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
|
||||
u32 word = bp * 64 + basepage * 2048 + g_pageTable32Z[y&31][x&63];
|
||||
//assert (word < 0x100000);
|
||||
//word = min(word, 0xfffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress32Z_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
|
||||
u32 word = basepage * 2048 + g_pageTable32Z[y&31][x&63];
|
||||
//assert (word < 0x100000);
|
||||
//word = min(word, 0xfffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
#define getPixelAddress24Z getPixelAddress32Z
|
||||
#define getPixelAddress24Z_0 getPixelAddress32Z_0
|
||||
|
||||
static __forceinline u32 getPixelAddress16Z(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = bp * 128 + basepage * 4096 + g_pageTable16Z[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress16Z_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = basepage * 4096 + g_pageTable16Z[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress16SZ(int x, int y, u32 bp, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = bp * 128 + basepage * 4096 + g_pageTable16SZ[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline u32 getPixelAddress16SZ_0(int x, int y, u32 bw) {
|
||||
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
|
||||
u32 word = basepage * 4096 + g_pageTable16SZ[y&63][x&63];
|
||||
//assert (word < 0x200000);
|
||||
//word = min(word, 0x1fffff);
|
||||
return word;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel32(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u32*)pmem)[getPixelAddress32(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel24(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
u8 *buf = (u8*)&((u32*)pmem)[getPixelAddress32(x, y, bp, bw)];
|
||||
u8 *pix = (u8*)&pixel;
|
||||
buf[0] = pix[0]; buf[1] = pix[1]; buf[2] = pix[2];
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16S(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16S(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel8(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u8*)pmem)[getPixelAddress8(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel8H(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u8*)pmem)[4*getPixelAddress32(x, y, bp, bw)+3] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel4(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
u32 addr = getPixelAddress4(x, y, bp, bw);
|
||||
u8 pix = ((u8*)pmem)[addr/2];
|
||||
if (addr & 0x1) ((u8*)pmem)[addr/2] = (pix & 0x0f) | (pixel << 4);
|
||||
else ((u8*)pmem)[addr/2] = (pix & 0xf0) | (pixel);
|
||||
}
|
||||
|
||||
static __forceinline void writePixel4HL(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
u8 *p = (u8*)pmem + 4*getPixelAddress4HL(x, y, bp, bw)+3;
|
||||
*p = (*p & 0xf0) | pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel4HH(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
u8 *p = (u8*)pmem + 4*getPixelAddress4HH(x, y, bp, bw)+3;
|
||||
*p = (*p & 0x0f) | (pixel<<4);
|
||||
}
|
||||
|
||||
static __forceinline void writePixel32Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u32*)pmem)[getPixelAddress32Z(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel24Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
u8 *buf = (u8*)pmem + 4*getPixelAddress32Z(x, y, bp, bw);
|
||||
u8 *pix = (u8*)&pixel;
|
||||
buf[0] = pix[0]; buf[1] = pix[1]; buf[2] = pix[2];
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16Z(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16SZ(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16SZ(x, y, bp, bw)] = pixel;
|
||||
}
|
||||
|
||||
|
||||
///////////////
|
||||
|
||||
static __forceinline u32 readPixel32(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel24(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32(x, y, bp, bw)] & 0xffffff;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16S(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16S(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel8(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u8*)pmem)[getPixelAddress8(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel8H(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u8*)pmem)[4*getPixelAddress32(x, y, bp, bw) + 3];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel4(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
u32 addr = getPixelAddress4(x, y, bp, bw);
|
||||
u8 pix = ((const u8*)pmem)[addr/2];
|
||||
if (addr & 0x1)
|
||||
return pix >> 4;
|
||||
else return pix & 0xf;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel4HL(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
const u8 *p = (const u8*)pmem+4*getPixelAddress4HL(x, y, bp, bw)+3;
|
||||
return *p & 0x0f;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel4HH(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
const u8 *p = (const u8*)pmem+4*getPixelAddress4HH(x, y, bp, bw) + 3;
|
||||
return *p >> 4;
|
||||
}
|
||||
|
||||
///////////////
|
||||
|
||||
static __forceinline u32 readPixel32Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32Z(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel24Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32Z(x, y, bp, bw)] & 0xffffff;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16Z(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16SZ(const void* pmem, int x, int y, u32 bp, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16SZ(x, y, bp, bw)];
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
// Functions that take 0 bps //
|
||||
///////////////////////////////
|
||||
|
||||
static __forceinline void writePixel32_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u32*)pmem)[getPixelAddress32_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel24_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
u8 *buf = (u8*)&((u32*)pmem)[getPixelAddress32_0(x, y, bw)];
|
||||
u8 *pix = (u8*)&pixel;
|
||||
#if defined(_MSC_VER) && defined(__x86_64__)
|
||||
memcpy(buf, pix, 3);
|
||||
#else
|
||||
buf[0] = pix[0]; buf[1] = pix[1]; buf[2] = pix[2];
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16S_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16S_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel8_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u8*)pmem)[getPixelAddress8_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel8H_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u8*)pmem)[4*getPixelAddress32_0(x, y, bw)+3] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel4_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
u32 addr = getPixelAddress4_0(x, y, bw);
|
||||
u8 pix = ((u8*)pmem)[addr/2];
|
||||
if (addr & 0x1) ((u8*)pmem)[addr/2] = (pix & 0x0f) | (pixel << 4);
|
||||
else ((u8*)pmem)[addr/2] = (pix & 0xf0) | (pixel);
|
||||
}
|
||||
|
||||
static __forceinline void writePixel4HL_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
u8 *p = (u8*)pmem + 4*getPixelAddress4HL_0(x, y, bw)+3;
|
||||
*p = (*p & 0xf0) | pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel4HH_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
u8 *p = (u8*)pmem + 4*getPixelAddress4HH_0(x, y, bw)+3;
|
||||
*p = (*p & 0x0f) | (pixel<<4);
|
||||
}
|
||||
|
||||
static __forceinline void writePixel32Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u32*)pmem)[getPixelAddress32Z_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel24Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
u8 *buf = (u8*)pmem + 4*getPixelAddress32Z_0(x, y, bw);
|
||||
u8 *pix = (u8*)&pixel;
|
||||
#if defined(_MSC_VER) && defined(__x86_64__)
|
||||
memcpy(buf, pix, 3);
|
||||
#else
|
||||
buf[0] = pix[0]; buf[1] = pix[1]; buf[2] = pix[2];
|
||||
#endif
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16Z_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
static __forceinline void writePixel16SZ_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
|
||||
((u16*)pmem)[getPixelAddress16SZ_0(x, y, bw)] = pixel;
|
||||
}
|
||||
|
||||
|
||||
///////////////
|
||||
|
||||
static __forceinline u32 readPixel32_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32_0(x, y, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel24_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32_0(x, y, bw)] & 0xffffff;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16_0(x, y, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16S_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16S_0(x, y, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel8_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u8*)pmem)[getPixelAddress8_0(x, y, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel8H_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u8*)pmem)[4*getPixelAddress32_0(x, y, bw) + 3];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel4_0(const void* pmem, int x, int y, u32 bw) {
|
||||
u32 addr = getPixelAddress4_0(x, y, bw);
|
||||
u8 pix = ((const u8*)pmem)[addr/2];
|
||||
if (addr & 0x1)
|
||||
return pix >> 4;
|
||||
else return pix & 0xf;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel4HL_0(const void* pmem, int x, int y, u32 bw) {
|
||||
const u8 *p = (const u8*)pmem+4*getPixelAddress4HL_0(x, y, bw)+3;
|
||||
return *p & 0x0f;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel4HH_0(const void* pmem, int x, int y, u32 bw) {
|
||||
const u8 *p = (const u8*)pmem+4*getPixelAddress4HH_0(x, y, bw) + 3;
|
||||
return *p >> 4;
|
||||
}
|
||||
|
||||
///////////////
|
||||
|
||||
static __forceinline u32 readPixel32Z_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32Z_0(x, y, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel24Z_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u32*)pmem)[getPixelAddress32Z_0(x, y, bw)] & 0xffffff;
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16Z_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16Z_0(x, y, bw)];
|
||||
}
|
||||
|
||||
static __forceinline u32 readPixel16SZ_0(const void* pmem, int x, int y, u32 bw) {
|
||||
return ((const u16*)pmem)[getPixelAddress16SZ_0(x, y, bw)];
|
||||
}
|
||||
|
||||
#endif /* __MEM_H__ */
|
|
@ -0,0 +1,13 @@
|
|||
ZeroGS OpenGL
|
||||
-------------
|
||||
author: zerofrog (@gmail.com)
|
||||
|
||||
ZeroGS heavily uses GPU shaders. All the shaders are written in nVidia's Cg language and can be found in ps2hw.fx.
|
||||
|
||||
'Dev' versions of ZeroGS directly read ps2hw.fx
|
||||
'Release' versions of ZeroGS read a precompiled version of ps2hw.fx from ps2hw.dat. In order to build ps2hw.dat, compile ZeroGSShaders and execute:
|
||||
|
||||
./ZeroGSShaders ps2hw.fx ps2hw.dat
|
||||
|
||||
For Windows users, once ZeroGSShaders is built, run buildshaders.bat directly. It will update all necessary resource files.
|
||||
Note that ZeroGSShaders has only been tested in Windows so far, but the Windows ps2hw.dat can be used in linux builds.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,101 @@
|
|||
/* ZeroGS KOSMOS
|
||||
* Copyright (C) 2005-2006 zerofrog@gmail.com
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __GSREGS_H__
|
||||
#define __GSREGS_H__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
typedef void (__fastcall *GIFRegHandler)(u32* data);
|
||||
#else
|
||||
|
||||
#ifdef __x86_64__
|
||||
typedef void (*GIFRegHandler)(u32* data);
|
||||
#else
|
||||
typedef void (__fastcall *GIFRegHandler)(u32* data);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void __fastcall GIFPackedRegHandlerNull(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerRGBA(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerSTQ(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerUV(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerXYZF2(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerXYZ2(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerFOG(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerA_D(u32* data);
|
||||
void __fastcall GIFPackedRegHandlerNOP(u32* data);
|
||||
|
||||
void __fastcall GIFRegHandlerNull(u32* data);
|
||||
void __fastcall GIFRegHandlerPRIM(u32* data);
|
||||
void __fastcall GIFRegHandlerRGBAQ(u32* data);
|
||||
void __fastcall GIFRegHandlerST(u32* data);
|
||||
void __fastcall GIFRegHandlerUV(u32* data);
|
||||
void __fastcall GIFRegHandlerXYZF2(u32* data);
|
||||
void __fastcall GIFRegHandlerXYZ2(u32* data);
|
||||
void __fastcall GIFRegHandlerTEX0_1(u32* data);
|
||||
void __fastcall GIFRegHandlerTEX0_2(u32* data);
|
||||
void __fastcall GIFRegHandlerCLAMP_1(u32* data);
|
||||
void __fastcall GIFRegHandlerCLAMP_2(u32* data);
|
||||
void __fastcall GIFRegHandlerFOG(u32* data);
|
||||
void __fastcall GIFRegHandlerXYZF3(u32* data);
|
||||
void __fastcall GIFRegHandlerXYZ3(u32* data);
|
||||
void __fastcall GIFRegHandlerNOP(u32* data);
|
||||
void __fastcall GIFRegHandlerTEX1_1(u32* data);
|
||||
void __fastcall GIFRegHandlerTEX1_2(u32* data);
|
||||
void __fastcall GIFRegHandlerTEX2_1(u32* data);
|
||||
void __fastcall GIFRegHandlerTEX2_2(u32* data);
|
||||
void __fastcall GIFRegHandlerXYOFFSET_1(u32* data);
|
||||
void __fastcall GIFRegHandlerXYOFFSET_2(u32* data);
|
||||
void __fastcall GIFRegHandlerPRMODECONT(u32* data);
|
||||
void __fastcall GIFRegHandlerPRMODE(u32* data);
|
||||
void __fastcall GIFRegHandlerTEXCLUT(u32* data);
|
||||
void __fastcall GIFRegHandlerSCANMSK(u32* data);
|
||||
void __fastcall GIFRegHandlerMIPTBP1_1(u32* data);
|
||||
void __fastcall GIFRegHandlerMIPTBP1_2(u32* data);
|
||||
void __fastcall GIFRegHandlerMIPTBP2_1(u32* data);
|
||||
void __fastcall GIFRegHandlerMIPTBP2_2(u32* data);
|
||||
void __fastcall GIFRegHandlerTEXA(u32* data);
|
||||
void __fastcall GIFRegHandlerFOGCOL(u32* data);
|
||||
void __fastcall GIFRegHandlerTEXFLUSH(u32* data);
|
||||
void __fastcall GIFRegHandlerSCISSOR_1(u32* data);
|
||||
void __fastcall GIFRegHandlerSCISSOR_2(u32* data);
|
||||
void __fastcall GIFRegHandlerALPHA_1(u32* data);
|
||||
void __fastcall GIFRegHandlerALPHA_2(u32* data);
|
||||
void __fastcall GIFRegHandlerDIMX(u32* data);
|
||||
void __fastcall GIFRegHandlerDTHE(u32* data);
|
||||
void __fastcall GIFRegHandlerCOLCLAMP(u32* data);
|
||||
void __fastcall GIFRegHandlerTEST_1(u32* data);
|
||||
void __fastcall GIFRegHandlerTEST_2(u32* data);
|
||||
void __fastcall GIFRegHandlerPABE(u32* data);
|
||||
void __fastcall GIFRegHandlerFBA_1(u32* data);
|
||||
void __fastcall GIFRegHandlerFBA_2(u32* data);
|
||||
void __fastcall GIFRegHandlerFRAME_1(u32* data);
|
||||
void __fastcall GIFRegHandlerFRAME_2(u32* data);
|
||||
void __fastcall GIFRegHandlerZBUF_1(u32* data);
|
||||
void __fastcall GIFRegHandlerZBUF_2(u32* data);
|
||||
void __fastcall GIFRegHandlerBITBLTBUF(u32* data);
|
||||
void __fastcall GIFRegHandlerTRXPOS(u32* data);
|
||||
void __fastcall GIFRegHandlerTRXREG(u32* data);
|
||||
void __fastcall GIFRegHandlerTRXDIR(u32* data);
|
||||
void __fastcall GIFRegHandlerHWREG(u32* data);
|
||||
void __fastcall GIFRegHandlerSIGNAL(u32* data);
|
||||
void __fastcall GIFRegHandlerFINISH(u32* data);
|
||||
void __fastcall GIFRegHandlerLABEL(u32* data);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,89 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "GS.h"
|
||||
#include "Win32.h"
|
||||
|
||||
extern HINSTANCE hInst;
|
||||
|
||||
|
||||
void SaveConfig() {
|
||||
|
||||
char szValue[256];
|
||||
const std::string iniFile( s_strIniPath + "zerogs.ini" );
|
||||
|
||||
sprintf(szValue,"%u",conf.interlace);
|
||||
WritePrivateProfileString("Settings", "Interlace",szValue,iniFile.c_str());
|
||||
sprintf(szValue,"%u",conf.aa);
|
||||
WritePrivateProfileString("Settings", "Antialiasing",szValue,iniFile.c_str());
|
||||
sprintf(szValue,"%u",conf.bilinear);
|
||||
WritePrivateProfileString("Settings", "Bilinear",szValue,iniFile.c_str());
|
||||
sprintf(szValue,"%u",conf.options);
|
||||
WritePrivateProfileString("Settings", "Options",szValue,iniFile.c_str());
|
||||
sprintf(szValue,"%u",conf.gamesettings);
|
||||
WritePrivateProfileString("Settings", "AdvancedOptions",szValue,iniFile.c_str());
|
||||
}
|
||||
|
||||
void LoadConfig() {
|
||||
char szValue[256];
|
||||
const std::string iniFile( s_strIniPath + "zerogs.ini" );
|
||||
|
||||
memset(&conf, 0, sizeof(conf));
|
||||
conf.interlace = 0; // on, mode 1
|
||||
conf.mrtdepth = 1;
|
||||
conf.options = 0;
|
||||
conf.bilinear = 1;
|
||||
conf.width = 640;
|
||||
conf.height = 480;
|
||||
|
||||
FILE *fp=fopen(iniFile.c_str(),"rt");
|
||||
if (!fp)
|
||||
{
|
||||
CreateDirectory(s_strIniPath.c_str(),NULL);
|
||||
SaveConfig();//save and return
|
||||
return ;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
GetPrivateProfileString("Settings", "Interlace", NULL, szValue, 20, iniFile.c_str());
|
||||
conf.interlace = (u8)strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Settings", "Antialiasing", NULL, szValue, 20, iniFile.c_str());
|
||||
conf.aa = (u8)strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Settings", "Options", NULL, szValue, 20, iniFile.c_str());
|
||||
conf.options = strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Settings", "AdvancedOptions", NULL, szValue, 20, iniFile.c_str());
|
||||
conf.gamesettings = strtoul(szValue, NULL, 10);
|
||||
GetPrivateProfileString("Settings", "Bilinear", NULL, szValue, 20, iniFile.c_str());
|
||||
conf.bilinear = strtoul(szValue, NULL, 10);
|
||||
|
||||
if( conf.aa < 0 || conf.aa > 4 ) conf.aa = 0;
|
||||
|
||||
conf.isWideScreen = conf.options & GSOPTION_WIDESCREEN;
|
||||
switch(conf.options & GSOPTION_WINDIMS)
|
||||
{
|
||||
case GSOPTION_WIN640:
|
||||
conf.width = 640;
|
||||
conf.height = conf.isWideScreen ? 360 : 480;
|
||||
break;
|
||||
case GSOPTION_WIN800:
|
||||
conf.width = 800;
|
||||
conf.height = conf.isWideScreen ? 450 : 600;
|
||||
break;
|
||||
case GSOPTION_WIN1024:
|
||||
conf.width = 1024;
|
||||
conf.height = conf.isWideScreen ? 576 : 768;
|
||||
break;
|
||||
case GSOPTION_WIN1280:
|
||||
conf.width = 1280;
|
||||
conf.height = conf.isWideScreen ? 720 : 960;
|
||||
break;
|
||||
}
|
||||
|
||||
// turn off all hacks by defaultof
|
||||
conf.options &= ~(GSOPTION_WIREFRAME|GSOPTION_CAPTUREAVI);
|
||||
conf.options |= GSOPTION_LOADED;
|
||||
|
||||
if( conf.width <= 0 || conf.height <= 0 ) {
|
||||
conf.width = 640;
|
||||
conf.height = 480;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,251 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "resrc1.h"
|
||||
|
||||
#include "GS.h"
|
||||
#include "Win32.h"
|
||||
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
extern int g_nPixelShaderVer;
|
||||
static int prevbilinearfilter;
|
||||
HINSTANCE hInst=NULL;
|
||||
|
||||
void CALLBACK GSkeyEvent(keyEvent *ev) {
|
||||
// switch (ev->event) {
|
||||
// case KEYPRESS:
|
||||
// switch (ev->key) {
|
||||
// case VK_PRIOR:
|
||||
// if (conf.fps) fpspos++; break;
|
||||
// case VK_NEXT:
|
||||
// if (conf.fps) fpspos--; break;
|
||||
// case VK_END:
|
||||
// if (conf.fps) fpspress = 1; break;
|
||||
// case VK_DELETE:
|
||||
// conf.fps = 1 - conf.fps;
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
#include "Win32/resource.h"
|
||||
|
||||
BOOL CALLBACK LoggingDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
switch(uMsg) {
|
||||
case WM_INITDIALOG:
|
||||
if (conf.log) CheckDlgButton(hW, IDC_LOG, TRUE);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
case IDCANCEL:
|
||||
EndDialog(hW, FALSE);
|
||||
return TRUE;
|
||||
case IDOK:
|
||||
if (IsDlgButtonChecked(hW, IDC_LOG))
|
||||
conf.log = 1;
|
||||
else conf.log = 0;
|
||||
|
||||
SaveConfig();
|
||||
EndDialog(hW, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
map<int, int> mapConfOpts;
|
||||
#define PUT_CONF(id) mapConfOpts[IDC_CONFOPT_##id] = 0x##id;
|
||||
|
||||
void OnInitDialog(HWND hW)
|
||||
{
|
||||
if( !(conf.options & GSOPTION_LOADED) )
|
||||
LoadConfig();
|
||||
|
||||
CheckDlgButton(hW, IDC_CONFIG_INTERLACE, conf.interlace);
|
||||
CheckDlgButton(hW, IDC_CONFIG_BILINEAR, conf.bilinear);
|
||||
CheckDlgButton(hW, IDC_CONFIG_DEPTHWRITE, conf.mrtdepth);
|
||||
CheckRadioButton(hW,IDC_CONFIG_AANONE,IDC_CONFIG_AA4, IDC_CONFIG_AANONE+conf.aa);
|
||||
CheckDlgButton(hW, IDC_CONFIG_WIREFRAME, (conf.options&GSOPTION_WIREFRAME)?1:0);
|
||||
CheckDlgButton(hW, IDC_CONFIG_CAPTUREAVI, (conf.options&GSOPTION_CAPTUREAVI)?1:0);
|
||||
//CheckDlgButton(hW, IDC_CONFIG_CACHEFBP, (conf.options&GSOPTION_ALPHACLAMP)?1:0);
|
||||
CheckDlgButton(hW, IDC_CONFIG_FULLSCREEN, (conf.options&GSOPTION_FULLSCREEN)?1:0);
|
||||
CheckDlgButton(hW, IDC_CONFIG_WIDESCREEN, (conf.options&GSOPTION_WIDESCREEN)?1:0);
|
||||
//CheckDlgButton(hW, IDC_CONFIG_FFX, (conf.options&GSOPTION_FFXHACK)?1:0);
|
||||
CheckDlgButton(hW, IDC_CONFIG_BMPSS, (conf.options&GSOPTION_TGASNAP)?1:0);
|
||||
CheckRadioButton(hW,IDC_CONF_WIN640, IDC_CONF_WIN1280, IDC_CONF_WIN640+((conf.options&GSOPTION_WINDIMS)>>4));
|
||||
|
||||
prevbilinearfilter = conf.bilinear;
|
||||
|
||||
mapConfOpts.clear();
|
||||
PUT_CONF(00000001);
|
||||
PUT_CONF(00000002);
|
||||
PUT_CONF(00000004);
|
||||
PUT_CONF(00000008);
|
||||
PUT_CONF(00000010);
|
||||
PUT_CONF(00000020);
|
||||
PUT_CONF(00000040);
|
||||
PUT_CONF(00000080);
|
||||
PUT_CONF(00000100);
|
||||
PUT_CONF(00000200);
|
||||
PUT_CONF(00000400);
|
||||
PUT_CONF(00000800);
|
||||
PUT_CONF(00001000);
|
||||
PUT_CONF(00002000);
|
||||
PUT_CONF(00004000);
|
||||
PUT_CONF(00008000);
|
||||
PUT_CONF(00010000);
|
||||
PUT_CONF(00020000);
|
||||
PUT_CONF(00040000);
|
||||
PUT_CONF(00080000);
|
||||
PUT_CONF(00100000);
|
||||
PUT_CONF(00200000);
|
||||
PUT_CONF(00800000);
|
||||
PUT_CONF(01000000);
|
||||
PUT_CONF(02000000);
|
||||
PUT_CONF(04000000);
|
||||
PUT_CONF(10000000);
|
||||
|
||||
for(map<int, int>::iterator it = mapConfOpts.begin(); it != mapConfOpts.end(); ++it) {
|
||||
CheckDlgButton(hW, it->first, (conf.gamesettings&it->second)?1:0);
|
||||
}
|
||||
}
|
||||
|
||||
void OnOK(HWND hW) {
|
||||
|
||||
u32 newinterlace = IsDlgButtonChecked(hW, IDC_CONFIG_INTERLACE);
|
||||
|
||||
if( !conf.interlace ) conf.interlace = newinterlace;
|
||||
else if( !newinterlace ) conf.interlace = 2; // off
|
||||
|
||||
conf.bilinear = IsDlgButtonChecked(hW, IDC_CONFIG_BILINEAR);
|
||||
// restore
|
||||
if( conf.bilinear && prevbilinearfilter )
|
||||
conf.bilinear = prevbilinearfilter;
|
||||
|
||||
//conf.mrtdepth = 1;//IsDlgButtonChecked(hW, IDC_CONFIG_DEPTHWRITE);
|
||||
|
||||
if( SendDlgItemMessage(hW,IDC_CONFIG_AANONE,BM_GETCHECK,0,0) ) {
|
||||
conf.aa = 0;
|
||||
}
|
||||
else if( SendDlgItemMessage(hW,IDC_CONFIG_AA2,BM_GETCHECK,0,0) ) {
|
||||
conf.aa = 1;
|
||||
}
|
||||
else if( SendDlgItemMessage(hW,IDC_CONFIG_AA4,BM_GETCHECK,0,0) ) {
|
||||
conf.aa = 2;
|
||||
}
|
||||
else if( SendDlgItemMessage(hW,IDC_CONFIG_AA8,BM_GETCHECK,0,0) ) {
|
||||
conf.aa = 3;
|
||||
}
|
||||
else if( SendDlgItemMessage(hW,IDC_CONFIG_AA16,BM_GETCHECK,0,0) ) {
|
||||
conf.aa = 4;
|
||||
}
|
||||
else conf.aa = 0;
|
||||
conf.negaa = 0;
|
||||
|
||||
conf.options = 0;
|
||||
conf.options |= IsDlgButtonChecked(hW, IDC_CONFIG_CAPTUREAVI) ? GSOPTION_CAPTUREAVI : 0;
|
||||
conf.options |= IsDlgButtonChecked(hW, IDC_CONFIG_WIREFRAME) ? GSOPTION_WIREFRAME : 0;
|
||||
conf.options |= IsDlgButtonChecked(hW, IDC_CONFIG_FULLSCREEN) ? GSOPTION_FULLSCREEN : 0;
|
||||
conf.options |= IsDlgButtonChecked(hW, IDC_CONFIG_WIDESCREEN) ? GSOPTION_WIDESCREEN : 0;
|
||||
//conf.options |= IsDlgButtonChecked(hW, IDC_CONFIG_FFX) ? GSOPTION_FFXHACK : 0;
|
||||
conf.options |= IsDlgButtonChecked(hW, IDC_CONFIG_BMPSS) ? GSOPTION_TGASNAP : 0;
|
||||
|
||||
conf.gamesettings = 0;
|
||||
for(map<int, int>::iterator it = mapConfOpts.begin(); it != mapConfOpts.end(); ++it) {
|
||||
if( IsDlgButtonChecked(hW, it->first) )
|
||||
conf.gamesettings |= it->second;
|
||||
}
|
||||
GSsetGameCRC(g_LastCRC, conf.gamesettings);
|
||||
|
||||
if( SendDlgItemMessage(hW,IDC_CONF_WIN640,BM_GETCHECK,0,0) ) conf.options |= GSOPTION_WIN640;
|
||||
else if( SendDlgItemMessage(hW,IDC_CONF_WIN800,BM_GETCHECK,0,0) ) conf.options |= GSOPTION_WIN800;
|
||||
else if( SendDlgItemMessage(hW,IDC_CONF_WIN1024,BM_GETCHECK,0,0) ) conf.options |= GSOPTION_WIN1024;
|
||||
else if( SendDlgItemMessage(hW,IDC_CONF_WIN1280,BM_GETCHECK,0,0) ) conf.options |= GSOPTION_WIN1280;
|
||||
|
||||
SaveConfig();
|
||||
EndDialog(hW, FALSE);
|
||||
}
|
||||
|
||||
BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
switch(uMsg) {
|
||||
case WM_INITDIALOG:
|
||||
OnInitDialog(hW);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
case IDCANCEL:
|
||||
EndDialog(hW, TRUE);
|
||||
return TRUE;
|
||||
case IDOK:
|
||||
OnOK(hW);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
switch(uMsg) {
|
||||
case WM_INITDIALOG:
|
||||
|
||||
//ZeroGS uses floating point render targets because A8R8G8B8 format is not sufficient for ps2 blending and this requires alpha blending on floating point render targets
|
||||
//There might be a problem with pixel shader precision with older geforce models (textures will look blocky).
|
||||
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
EndDialog(hW, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 CALLBACK GStest() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CALLBACK GSabout() {
|
||||
DialogBox(hInst,
|
||||
MAKEINTRESOURCE(IDD_ABOUT),
|
||||
GetActiveWindow(),
|
||||
(DLGPROC)AboutDlgProc);
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HANDLE hModule, // DLL INIT
|
||||
DWORD dwReason,
|
||||
LPVOID lpReserved) {
|
||||
hInst = (HINSTANCE)hModule;
|
||||
return TRUE; // very quick :)
|
||||
}
|
||||
|
||||
static char *err = "Error Loading Symbol";
|
||||
static int errval;
|
||||
|
||||
void *SysLoadLibrary(char *lib) {
|
||||
return LoadLibrary(lib);
|
||||
}
|
||||
|
||||
void *SysLoadSym(void *lib, char *sym) {
|
||||
void *tmp = GetProcAddress((HINSTANCE)lib, sym);
|
||||
if (tmp == NULL) errval = 1;
|
||||
else errval = 0;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
char *SysLibError() {
|
||||
if (errval) { errval = 0; return err; }
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void SysCloseLibrary(void *lib) {
|
||||
FreeLibrary((HINSTANCE)lib);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef __WIN32_H__
|
||||
#define __WIN32_H__
|
||||
|
||||
#include "resrc1.h"
|
||||
#include "Win32/resource.h"
|
||||
|
||||
BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#endif /* __WIN32_H__ */
|
|
@ -0,0 +1,488 @@
|
|||
#ifndef __AVIUTIL_H__
|
||||
#define __AVIUTIL_H__
|
||||
|
||||
#define AVIIF_KEYFRAME 0x00000010L // this frame is a key frame.
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
#include <memory.h>
|
||||
#include <mmsystem.h>
|
||||
#include <vfw.h>
|
||||
|
||||
BOOL AVI_Init()
|
||||
{
|
||||
/* first let's make sure we are running on 1.1 */
|
||||
WORD wVer = HIWORD(VideoForWindowsVersion());
|
||||
if (wVer < 0x010a){
|
||||
/* oops, we are too old, blow out of here */
|
||||
//MessageBeep(MB_ICONHAND);
|
||||
MessageBox(NULL, "Cant't init AVI File - Video for Windows version is to old", "Error", MB_OK|MB_ICONSTOP);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
AVIFileInit();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_FileOpenWrite(PAVIFILE * pfile, const char *filename)
|
||||
{
|
||||
HRESULT hr = AVIFileOpen(pfile, // returned file pointer
|
||||
filename, // file name
|
||||
OF_WRITE | OF_CREATE, // mode to open file with
|
||||
NULL); // use handler determined
|
||||
// from file extension....
|
||||
if (hr != AVIERR_OK)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD getFOURCC(const char* value)
|
||||
{
|
||||
if(_stricmp(value, "DIB") == 0)
|
||||
{
|
||||
return mmioFOURCC(value[0],value[1],value[2],' ');
|
||||
}
|
||||
else if((_stricmp(value, "CVID") == 0)
|
||||
|| (_stricmp(value, "IV32") == 0)
|
||||
|| (_stricmp(value, "MSVC") == 0)
|
||||
|| (_stricmp(value, "IV50") == 0))
|
||||
{
|
||||
return mmioFOURCC(value[0],value[1],value[2],value[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Fill in the header for the video stream....
|
||||
// The video stream will run in rate ths of a second....
|
||||
BOOL AVI_CreateStream(PAVIFILE pfile, PAVISTREAM * ps, int rate, // sample/second
|
||||
unsigned long buffersize, int rectwidth, int rectheight,
|
||||
const char* _compressor)
|
||||
{
|
||||
AVISTREAMINFO strhdr;
|
||||
memset(&strhdr, 0, sizeof(strhdr));
|
||||
strhdr.fccType = streamtypeVIDEO;// stream type
|
||||
strhdr.fccHandler = getFOURCC(_compressor);
|
||||
//strhdr.fccHandler = 0; // no compression!
|
||||
//strhdr.fccHandler = mmioFOURCC('D','I','B',' '); // Uncompressed
|
||||
//strhdr.fccHandler = mmioFOURCC('C','V','I','D'); // Cinpak
|
||||
//strhdr.fccHandler = mmioFOURCC('I','V','3','2'); // Intel video 3.2
|
||||
//strhdr.fccHandler = mmioFOURCC('M','S','V','C'); // Microsoft video 1
|
||||
//strhdr.fccHandler = mmioFOURCC('I','V','5','0'); // Intel video 5.0
|
||||
//strhdr.dwFlags = AVISTREAMINFO_DISABLED;
|
||||
//strhdr.dwCaps =
|
||||
//strhdr.wPriority =
|
||||
//strhdr.wLanguage =
|
||||
strhdr.dwScale = 1;
|
||||
strhdr.dwRate = rate; // rate fps
|
||||
//strhdr.dwStart =
|
||||
//strhdr.dwLength =
|
||||
//strhdr.dwInitialFrames =
|
||||
strhdr.dwSuggestedBufferSize = buffersize;
|
||||
strhdr.dwQuality = -1; // use the default
|
||||
//strhdr.dwSampleSize =
|
||||
SetRect(&strhdr.rcFrame, 0, 0, // rectangle for stream
|
||||
(int) rectwidth,
|
||||
(int) rectheight);
|
||||
//strhdr.dwEditCount =
|
||||
//strhdr.dwFormatChangeCount =
|
||||
//strcpy(strhdr.szName, "Full Frames (Uncompressed)");
|
||||
|
||||
// And create the stream;
|
||||
HRESULT hr = AVIFileCreateStream(pfile, // file pointer
|
||||
ps, // returned stream pointer
|
||||
&strhdr); // stream header
|
||||
if (hr != AVIERR_OK) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
string getFOURCCVAsString(DWORD value)
|
||||
{
|
||||
string returnValue = "";
|
||||
if( value == 0 )
|
||||
return returnValue;
|
||||
|
||||
DWORD ch0 = value & 0x000000FF;
|
||||
returnValue.push_back((char) ch0);
|
||||
DWORD ch1 = (value & 0x0000FF00)>>8;
|
||||
returnValue.push_back((char) ch1);
|
||||
DWORD ch2 = (value & 0x00FF0000)>>16;
|
||||
returnValue.push_back((char) ch2);
|
||||
DWORD ch3 = (value & 0xFF000000)>>24;
|
||||
returnValue.push_back((char) ch3);
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
string dumpAVICOMPRESSOPTIONS(AVICOMPRESSOPTIONS opts)
|
||||
{
|
||||
char tmp[255];
|
||||
string returnValue = "Dump of AVICOMPRESSOPTIONS\n";
|
||||
|
||||
returnValue += "DWORD fccType = streamtype("; returnValue += getFOURCCVAsString(opts.fccType); returnValue += ")\n";
|
||||
returnValue += "DWORD fccHandler = "; returnValue += getFOURCCVAsString(opts.fccHandler); returnValue += "\n";
|
||||
|
||||
_snprintf(tmp, 255, "DWORD dwKeyFrameEvery = %d\n", opts.dwKeyFrameEvery);
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "DWORD dwQuality = %d\n", opts.dwQuality);
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "DWORD dwBytesPerSecond = %d\n", opts.dwBytesPerSecond);
|
||||
returnValue += tmp;
|
||||
|
||||
if((opts.dwFlags & AVICOMPRESSF_DATARATE) == AVICOMPRESSF_DATARATE){strcpy(tmp, "DWORD fccType = AVICOMPRESSF_DATARATE\n");}
|
||||
else if((opts.dwFlags & AVICOMPRESSF_INTERLEAVE) == AVICOMPRESSF_INTERLEAVE){strcpy(tmp, "DWORD fccType = AVICOMPRESSF_INTERLEAVE\n");}
|
||||
else if((opts.dwFlags & AVICOMPRESSF_KEYFRAMES) == AVICOMPRESSF_KEYFRAMES){strcpy(tmp, "DWORD fccType = AVICOMPRESSF_KEYFRAMES\n");}
|
||||
else if((opts.dwFlags & AVICOMPRESSF_VALID) == AVICOMPRESSF_VALID){strcpy(tmp, "DWORD fccType = AVICOMPRESSF_VALID\n");}
|
||||
else {_snprintf(tmp, 255, "DWORD dwFlags = Unknown(%d)\n", opts.dwFlags);}
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "LPVOID lpFormat = %d\n", (int)opts.lpFormat);
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "DWORD cbFormat = %d\n", opts.cbFormat);
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "LPVOID lpParms = %d\n", (int)opts.lpParms);
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "DWORD cbParms = %d\n", opts.cbParms);
|
||||
returnValue += tmp;
|
||||
|
||||
_snprintf(tmp, 255, "DWORD dwInterleaveEvery = %d\n", opts.dwInterleaveEvery);
|
||||
returnValue += tmp;
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
BOOL AVI_SetOptions(PAVISTREAM * ps, PAVISTREAM * psCompressed, LPBITMAPINFOHEADER lpbi,
|
||||
const char* _compressor)
|
||||
{
|
||||
|
||||
AVICOMPRESSOPTIONS opts;
|
||||
AVICOMPRESSOPTIONS FAR * aopts[1] = {&opts};
|
||||
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.fccType = streamtypeVIDEO;
|
||||
opts.fccHandler = getFOURCC(_compressor);
|
||||
//opts.fccHandler = 0;
|
||||
//opts.fccHandler = mmioFOURCC('D','I','B',' '); // Uncompressed
|
||||
//opts.fccHandler = mmioFOURCC('C','V','I','D'); // Cinpak
|
||||
//opts.fccHandler = mmioFOURCC('I','V','3','2'); // Intel video 3.2
|
||||
//opts.fccHandler = mmioFOURCC('M','S','V','C'); // Microsoft video 1
|
||||
//opts.fccHandler = mmioFOURCC('I','V','5','0'); // Intel video 5.0
|
||||
//opts.dwKeyFrameEvery = 5;
|
||||
//opts.dwQuality
|
||||
//opts.dwBytesPerSecond
|
||||
//opts.dwFlags = AVICOMPRESSF_KEYFRAMES;
|
||||
//opts.lpFormat
|
||||
//opts.cbFormat
|
||||
//opts.lpParms
|
||||
//opts.cbParms
|
||||
//opts.dwInterleaveEvery
|
||||
|
||||
/* display the compression options dialog box if specified compressor is unknown */
|
||||
if(getFOURCC(_compressor) == NULL)
|
||||
{
|
||||
if (!AVISaveOptions(NULL, 0, 1, ps, (LPAVICOMPRESSOPTIONS FAR *) &aopts))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//printf("%s", dumpAVICOMPRESSOPTIONS(opts));
|
||||
//MessageBox(NULL, dumpAVICOMPRESSOPTIONS(opts).c_str(), "AVICOMPRESSOPTIONS", MB_OK);
|
||||
}
|
||||
|
||||
HRESULT hr = AVIMakeCompressedStream(psCompressed, *ps, &opts, NULL);
|
||||
if (hr != AVIERR_OK) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hr = AVIStreamSetFormat(*psCompressed, 0,
|
||||
lpbi, // stream format
|
||||
lpbi->biSize // format size
|
||||
+ lpbi->biClrUsed * sizeof(RGBQUAD)
|
||||
);
|
||||
if (hr != AVIERR_OK) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_SetText(PAVIFILE pfile, PAVISTREAM psText, char *szText, int width, int height, int TextHeight)
|
||||
{
|
||||
// Fill in the stream header for the text stream....
|
||||
AVISTREAMINFO strhdr;
|
||||
DWORD dwTextFormat;
|
||||
// The text stream is in 60ths of a second....
|
||||
|
||||
memset(&strhdr, 0, sizeof(strhdr));
|
||||
strhdr.fccType = streamtypeTEXT;
|
||||
strhdr.fccHandler = mmioFOURCC('D', 'R', 'A', 'W');
|
||||
strhdr.dwScale = 1;
|
||||
strhdr.dwRate = 60;
|
||||
strhdr.dwSuggestedBufferSize = sizeof(szText);
|
||||
SetRect(&strhdr.rcFrame, 0, (int) height,
|
||||
(int) width, (int) height + TextHeight); // #define TEXT_HEIGHT 20
|
||||
|
||||
// ....and create the stream.
|
||||
HRESULT hr = AVIFileCreateStream(pfile, &psText, &strhdr);
|
||||
if (hr != AVIERR_OK) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwTextFormat = sizeof(dwTextFormat);
|
||||
hr = AVIStreamSetFormat(psText, 0, &dwTextFormat, sizeof(dwTextFormat));
|
||||
if (hr != AVIERR_OK) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_AddFrame(PAVISTREAM psCompressed, int time, LPBITMAPINFOHEADER lpbi)
|
||||
{
|
||||
int ImageSize = lpbi->biSizeImage;
|
||||
if (ImageSize == 0)
|
||||
{
|
||||
if (lpbi->biBitCount == 24)
|
||||
{
|
||||
ImageSize = lpbi->biWidth * lpbi->biHeight * 3;
|
||||
}
|
||||
}
|
||||
HRESULT hr = AVIStreamWrite(psCompressed, // stream pointer
|
||||
time, // time of this frame
|
||||
1, // number to write
|
||||
(LPBYTE) lpbi + // pointer to data
|
||||
lpbi->biSize +
|
||||
lpbi->biClrUsed * sizeof(RGBQUAD),
|
||||
ImageSize, // lpbi->biSizeImage, // size of this frame
|
||||
AVIIF_KEYFRAME, // flags....
|
||||
NULL,
|
||||
NULL);
|
||||
if (hr != AVIERR_OK)
|
||||
{
|
||||
char strMsg[255];
|
||||
_snprintf(strMsg, 255, "Error: AVIStreamWrite, error %d",hr);
|
||||
MessageBox(NULL, strMsg, "", MB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_AddText(PAVISTREAM psText, int time, char *szText)
|
||||
{
|
||||
int iLen = (int)strlen(szText);
|
||||
|
||||
HRESULT hr = AVIStreamWrite(psText,
|
||||
time,
|
||||
1,
|
||||
szText,
|
||||
iLen + 1,
|
||||
AVIIF_KEYFRAME,
|
||||
NULL,
|
||||
NULL);
|
||||
if (hr != AVIERR_OK)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_CloseStream(PAVISTREAM ps, PAVISTREAM psCompressed, PAVISTREAM psText)
|
||||
{
|
||||
if (ps)
|
||||
AVIStreamClose(ps);
|
||||
|
||||
if (psCompressed)
|
||||
AVIStreamClose(psCompressed);
|
||||
|
||||
if (psText)
|
||||
AVIStreamClose(psText);
|
||||
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_CloseFile(PAVIFILE pfile)
|
||||
{
|
||||
if (pfile)
|
||||
AVIFileClose(pfile);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL AVI_Exit()
|
||||
{
|
||||
AVIFileExit();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Here are the additional functions we need! */
|
||||
|
||||
|
||||
static PAVIFILE pfile = NULL;
|
||||
static PAVISTREAM ps = NULL;
|
||||
static PAVISTREAM psCompressed = NULL;
|
||||
static int count = 0;
|
||||
|
||||
|
||||
// Initialization...
|
||||
bool START_AVI(const char* file_name)
|
||||
{
|
||||
if(! AVI_Init())
|
||||
{
|
||||
//printf("Error - AVI_Init()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(! AVI_FileOpenWrite(&pfile, file_name))
|
||||
{
|
||||
//printf("Error - AVI_FileOpenWrite()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ADD_FRAME_FROM_DIB_TO_AVI(const char* _compressor, int _frameRate, int width, int height, int bits, void* pdata)
|
||||
{
|
||||
if(count == 0)
|
||||
{
|
||||
if(! AVI_CreateStream(pfile, &ps, _frameRate,
|
||||
width*height/bits,
|
||||
width,
|
||||
height, _compressor))
|
||||
{
|
||||
//printf("Error - AVI_CreateStream()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
BITMAPINFOHEADER bi;
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
bi.biSize = sizeof(BITMAPINFOHEADER);
|
||||
bi.biWidth = width;
|
||||
bi.biHeight = height;
|
||||
bi.biPlanes = 1;
|
||||
bi.biBitCount = bits;
|
||||
bi.biCompression = BI_RGB;
|
||||
bi.biSizeImage = width * height * bits /8;
|
||||
if(! AVI_SetOptions(&ps, &psCompressed, &bi, _compressor))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT hr = AVIStreamWrite(psCompressed, // stream pointer
|
||||
count, // time of this frame
|
||||
1, // number to write
|
||||
pdata,
|
||||
width*height/8, // lpbi->biSizeImage, // size of this frame
|
||||
AVIIF_KEYFRAME, // flags....
|
||||
NULL,
|
||||
NULL);
|
||||
if (hr != AVIERR_OK)
|
||||
{
|
||||
char strMsg[255];
|
||||
_snprintf(strMsg, 255, "Error: AVIStreamWrite, error %d",hr);
|
||||
MessageBox(NULL, strMsg, "", MB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
count++;
|
||||
return true;
|
||||
}
|
||||
|
||||
//Now we can add frames
|
||||
// ie. ADD_FRAME_FROM_DIB_TO_AVI(yourDIB, "CVID", 25);
|
||||
bool ADD_FRAME_FROM_DIB_TO_AVI(HANDLE dib, const char* _compressor, int _frameRate)
|
||||
{
|
||||
LPBITMAPINFOHEADER lpbi;
|
||||
if(count == 0)
|
||||
{
|
||||
lpbi = (LPBITMAPINFOHEADER)GlobalLock(dib);
|
||||
if(! AVI_CreateStream(pfile, &ps, _frameRate,
|
||||
(unsigned long) lpbi->biSizeImage,
|
||||
(int) lpbi->biWidth,
|
||||
(int) lpbi->biHeight, _compressor))
|
||||
{
|
||||
//printf("Error - AVI_CreateStream()\n");
|
||||
GlobalUnlock(lpbi);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(! AVI_SetOptions(&ps, &psCompressed, lpbi, _compressor))
|
||||
{
|
||||
//printf("Error - AVI_SetOptions()\n");
|
||||
GlobalUnlock(lpbi);
|
||||
return false;
|
||||
}
|
||||
|
||||
GlobalUnlock(lpbi);
|
||||
}
|
||||
|
||||
lpbi = (LPBITMAPINFOHEADER)GlobalLock(dib);
|
||||
if(! AVI_AddFrame(psCompressed, count * 1, lpbi))
|
||||
{
|
||||
//printf("Error - AVI_AddFrame()\n");
|
||||
GlobalUnlock(lpbi);
|
||||
return false;
|
||||
}
|
||||
|
||||
GlobalUnlock(lpbi);
|
||||
count++;
|
||||
return true;
|
||||
}
|
||||
|
||||
// The end...
|
||||
bool STOP_AVI()
|
||||
{
|
||||
if(! AVI_CloseStream(ps, psCompressed, NULL))
|
||||
{
|
||||
//printf("Error - AVI_CloseStream()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(! AVI_CloseFile(pfile))
|
||||
{
|
||||
//printf("Error - AVI_CloseFile()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(! AVI_Exit())
|
||||
{
|
||||
//printf("Error - AVI_Exit()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
/* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
//#define NEED_FAR_POINTERS /* for small or medium memory model */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
//#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */
|
||||
|
||||
#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */
|
||||
|
||||
//#define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */
|
||||
|
||||
#define NEED_FHEAPMIN /* far heap management routines are broken */
|
||||
|
||||
#define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */
|
||||
/* Note: the above define is known to improve the code with Microsoft C 6.00A.
|
||||
* I do not know whether it is good for later compiler versions.
|
||||
* Please report any info on this point to jpeg-info@uunet.uu.net.
|
||||
*/
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE
|
||||
#define USE_SETMODE /* Microsoft has setmode() */
|
||||
#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
|
@ -0,0 +1,363 @@
|
|||
/*
|
||||
* jmorecfg.h
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains additional configuration options that customize the
|
||||
* JPEG software for special applications or support machine-dependent
|
||||
* optimizations. Most users will not need to touch this file.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of components (color channels) allowed in JPEG image.
|
||||
* To meet the letter of the JPEG spec, set this to 255. However, darn
|
||||
* few applications need more than 4 channels (maybe 5 for CMYK + alpha
|
||||
* mask). We recommend 10 as a reasonable compromise; use 4 if you are
|
||||
* really short on memory. (Each allowed component costs a hundred or so
|
||||
* bytes of storage, whether actually used in an image or not.)
|
||||
*/
|
||||
|
||||
#define MAX_COMPONENTS 10 /* maximum number of image components */
|
||||
|
||||
|
||||
/*
|
||||
* Basic data types.
|
||||
* You may need to change these if you have a machine with unusual data
|
||||
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
|
||||
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
|
||||
* but it had better be at least 16.
|
||||
*/
|
||||
|
||||
/* Representation of a single sample (pixel element value).
|
||||
* We frequently allocate large arrays of these, so it's important to keep
|
||||
* them small. But if you have memory to burn and access to char or short
|
||||
* arrays is very slow on your hardware, you might want to change these.
|
||||
*/
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
/* JSAMPLE should be the smallest type that will hold the values 0..255.
|
||||
* You can use a signed char by having GETJSAMPLE mask it with 0xFF.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
|
||||
typedef unsigned char JSAMPLE;
|
||||
#define GETJSAMPLE(value) ((int) (value))
|
||||
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
|
||||
typedef char JSAMPLE;
|
||||
#ifdef CHAR_IS_UNSIGNED
|
||||
#define GETJSAMPLE(value) ((int) (value))
|
||||
#else
|
||||
#define GETJSAMPLE(value) ((int) (value) & 0xFF)
|
||||
#endif /* CHAR_IS_UNSIGNED */
|
||||
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
#define MAXJSAMPLE 255
|
||||
#define CENTERJSAMPLE 128
|
||||
|
||||
#endif /* BITS_IN_JSAMPLE == 8 */
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 12
|
||||
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
|
||||
* On nearly all machines "short" will do nicely.
|
||||
*/
|
||||
|
||||
typedef short JSAMPLE;
|
||||
#define GETJSAMPLE(value) ((int) (value))
|
||||
|
||||
#define MAXJSAMPLE 4095
|
||||
#define CENTERJSAMPLE 2048
|
||||
|
||||
#endif /* BITS_IN_JSAMPLE == 12 */
|
||||
|
||||
|
||||
/* Representation of a DCT frequency coefficient.
|
||||
* This should be a signed value of at least 16 bits; "short" is usually OK.
|
||||
* Again, we allocate large arrays of these, but you can change to int
|
||||
* if you have memory to burn and "short" is really slow.
|
||||
*/
|
||||
|
||||
typedef short JCOEF;
|
||||
|
||||
|
||||
/* Compressed datastreams are represented as arrays of JOCTET.
|
||||
* These must be EXACTLY 8 bits wide, at least once they are written to
|
||||
* external storage. Note that when using the stdio data source/destination
|
||||
* managers, this is also the data type passed to fread/fwrite.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
|
||||
typedef unsigned char JOCTET;
|
||||
#define GETJOCTET(value) (value)
|
||||
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
|
||||
typedef char JOCTET;
|
||||
#ifdef CHAR_IS_UNSIGNED
|
||||
#define GETJOCTET(value) (value)
|
||||
#else
|
||||
#define GETJOCTET(value) ((value) & 0xFF)
|
||||
#endif /* CHAR_IS_UNSIGNED */
|
||||
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
|
||||
/* These typedefs are used for various table entries and so forth.
|
||||
* They must be at least as wide as specified; but making them too big
|
||||
* won't cost a huge amount of memory, so we don't provide special
|
||||
* extraction code like we did for JSAMPLE. (In other words, these
|
||||
* typedefs live at a different point on the speed/space tradeoff curve.)
|
||||
*/
|
||||
|
||||
/* UINT8 must hold at least the values 0..255. */
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
typedef unsigned char UINT8;
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
#ifdef CHAR_IS_UNSIGNED
|
||||
typedef char UINT8;
|
||||
#else /* not CHAR_IS_UNSIGNED */
|
||||
typedef short UINT8;
|
||||
#endif /* CHAR_IS_UNSIGNED */
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
/* UINT16 must hold at least the values 0..65535. */
|
||||
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
typedef unsigned short UINT16;
|
||||
#else /* not HAVE_UNSIGNED_SHORT */
|
||||
typedef unsigned int UINT16;
|
||||
#endif /* HAVE_UNSIGNED_SHORT */
|
||||
|
||||
/* INT16 must hold at least the values -32768..32767. */
|
||||
|
||||
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
|
||||
typedef short INT16;
|
||||
#endif
|
||||
|
||||
/* INT32 must hold at least signed 32-bit values. */
|
||||
|
||||
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
|
||||
typedef long INT32;
|
||||
#endif
|
||||
|
||||
/* Datatype used for image dimensions. The JPEG standard only supports
|
||||
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
|
||||
* "unsigned int" is sufficient on all machines. However, if you need to
|
||||
* handle larger images and you don't mind deviating from the spec, you
|
||||
* can change this datatype.
|
||||
*/
|
||||
|
||||
typedef unsigned int JDIMENSION;
|
||||
|
||||
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
|
||||
|
||||
|
||||
/* These macros are used in all function definitions and extern declarations.
|
||||
* You could modify them if you need to change function linkage conventions;
|
||||
* in particular, you'll need to do that to make the library a Windows DLL.
|
||||
* Another application is to make all functions global for use with debuggers
|
||||
* or code profilers that require it.
|
||||
*/
|
||||
|
||||
/* a function called through method pointers: */
|
||||
#define METHODDEF(type) static type
|
||||
/* a function used only in its module: */
|
||||
#define LOCAL(type) static type
|
||||
/* a function referenced thru EXTERNs: */
|
||||
#define GLOBAL(type) type
|
||||
/* a reference to a GLOBAL function: */
|
||||
#define EXTERN(type) extern type
|
||||
|
||||
|
||||
/* This macro is used to declare a "method", that is, a function pointer.
|
||||
* We want to supply prototype parameters if the compiler can cope.
|
||||
* Note that the arglist parameter must be parenthesized!
|
||||
* Again, you can customize this if you need special linkage keywords.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
|
||||
#else
|
||||
#define JMETHOD(type,methodname,arglist) type (*methodname) ()
|
||||
#endif
|
||||
|
||||
|
||||
/* Here is the pseudo-keyword for declaring pointers that must be "far"
|
||||
* on 80x86 machines. Most of the specialized coding for 80x86 is handled
|
||||
* by just saying "FAR *" where such a pointer is needed. In a few places
|
||||
* explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
|
||||
*/
|
||||
|
||||
#ifdef NEED_FAR_POINTERS
|
||||
#define FAR far
|
||||
#else
|
||||
#define FAR
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
|
||||
* in standard header files. Or you may have conflicts with application-
|
||||
* specific header files that you want to include together with these files.
|
||||
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_BOOLEAN
|
||||
typedef int boolean;
|
||||
#endif
|
||||
#ifndef FALSE /* in case these macros already exist */
|
||||
#define FALSE 0 /* values of boolean */
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* The remaining options affect code selection within the JPEG library,
|
||||
* but they don't need to be visible to most applications using the library.
|
||||
* To minimize application namespace pollution, the symbols won't be
|
||||
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
|
||||
*/
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
#define JPEG_INTERNAL_OPTIONS
|
||||
#endif
|
||||
|
||||
#ifdef JPEG_INTERNAL_OPTIONS
|
||||
|
||||
|
||||
/*
|
||||
* These defines indicate whether to include various optional functions.
|
||||
* Undefining some of these symbols will produce a smaller but less capable
|
||||
* library. Note that you can leave certain source files out of the
|
||||
* compilation/linking process if you've #undef'd the corresponding symbols.
|
||||
* (You may HAVE to do that if your compiler doesn't like null source files.)
|
||||
*/
|
||||
|
||||
/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
|
||||
|
||||
/* Capability options common to encoder and decoder: */
|
||||
|
||||
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
|
||||
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
|
||||
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
|
||||
|
||||
/* Encoder capability options: */
|
||||
|
||||
#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
|
||||
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
|
||||
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
|
||||
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
|
||||
* precision, so jchuff.c normally uses entropy optimization to compute
|
||||
* usable tables for higher precision. If you don't want to do optimization,
|
||||
* you'll have to supply different default Huffman tables.
|
||||
* The exact same statements apply for progressive JPEG: the default tables
|
||||
* don't work for progressive mode. (This may get fixed, however.)
|
||||
*/
|
||||
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
|
||||
|
||||
/* Decoder capability options: */
|
||||
|
||||
#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
|
||||
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
|
||||
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
|
||||
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
|
||||
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
|
||||
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
|
||||
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
|
||||
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
|
||||
|
||||
/* more capability options later, no doubt */
|
||||
|
||||
|
||||
/*
|
||||
* Ordering of RGB data in scanlines passed to or from the application.
|
||||
* If your application wants to deal with data in the order B,G,R, just
|
||||
* change these macros. You can also deal with formats such as R,G,B,X
|
||||
* (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
|
||||
* the offsets will also change the order in which colormap data is organized.
|
||||
* RESTRICTIONS:
|
||||
* 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
|
||||
* 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
|
||||
* useful if you are using JPEG color spaces other than YCbCr or grayscale.
|
||||
* 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
|
||||
* is not 3 (they don't understand about dummy color components!). So you
|
||||
* can't use color quantization if you change that value.
|
||||
*/
|
||||
|
||||
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
|
||||
#define RGB_GREEN 1 /* Offset of Green */
|
||||
#define RGB_BLUE 2 /* Offset of Blue */
|
||||
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
|
||||
|
||||
|
||||
/* Definitions for speed-related optimizations. */
|
||||
|
||||
|
||||
/* If your compiler supports inline functions, define INLINE
|
||||
* as the inline keyword; otherwise define it as empty.
|
||||
*/
|
||||
|
||||
#ifndef INLINE
|
||||
#ifdef __GNUC__ /* for instance, GNU C knows about inline */
|
||||
#define INLINE __inline__
|
||||
#endif
|
||||
#ifndef INLINE
|
||||
#define INLINE /* default is to define it as empty */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
|
||||
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
|
||||
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
|
||||
*/
|
||||
|
||||
#ifndef MULTIPLIER
|
||||
#define MULTIPLIER int /* type for fastest integer multiply */
|
||||
#endif
|
||||
|
||||
|
||||
/* FAST_FLOAT should be either float or double, whichever is done faster
|
||||
* by your compiler. (Note that this type is only used in the floating point
|
||||
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
|
||||
* Typically, float is faster in ANSI C compilers, while double is faster in
|
||||
* pre-ANSI compilers (because they insist on converting to double anyway).
|
||||
* The code below therefore chooses float if we have ANSI-style prototypes.
|
||||
*/
|
||||
|
||||
#ifndef FAST_FLOAT
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
#define FAST_FLOAT float
|
||||
#else
|
||||
#define FAST_FLOAT double
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* JPEG_INTERNAL_OPTIONS */
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,45 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by GSsoftdx.rc
|
||||
//
|
||||
#define IDD_CONFIG 101
|
||||
#define IDD_ABOUT 102
|
||||
#define IDD_LOGGING 106
|
||||
#define IDB_ZEROGSLOGO 108
|
||||
#define IDR_REALPS2_FX 109
|
||||
#define IDR_SHADERS 110
|
||||
#define IDC_CHECK1 1000
|
||||
#define IDC_FULLSCREEN 1000
|
||||
#define IDC_NAME 1000
|
||||
#define IDC_LOG 1000
|
||||
#define IDC_CHECK2 1001
|
||||
#define IDC_FPSCOUNT 1001
|
||||
#define IDC_CHECK5 1002
|
||||
#define IDC_FRAMESKIP 1002
|
||||
#define IDC_STRETCH 1003
|
||||
#define IDC_LOGGING 1004
|
||||
#define IDC_COMBO1 1005
|
||||
#define IDC_CACHE 1005
|
||||
#define IDC_CACHESIZE 1006
|
||||
#define IDC_CHECK3 1007
|
||||
#define IDC_RECORD 1007
|
||||
#define IDC_COMBO2 1008
|
||||
#define IDC_DSPRES 1008
|
||||
#define IDC_WRES 1008
|
||||
#define IDC_COMBO3 1009
|
||||
#define IDC_DDDRV 1009
|
||||
#define IDC_FRES 1009
|
||||
#define IDC_COMBO4 1012
|
||||
#define IDC_CODEC 1012
|
||||
#define IDC_FILTERS 1014
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 112
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1015
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,83 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by zerogs.rc
|
||||
//
|
||||
#define IDC_CONF_DEFAULT 3
|
||||
#define IDR_DATA1 112
|
||||
#define IDC_ABOUTTEXT 1015
|
||||
#define IDC_CONFIG_AA 1016
|
||||
#define IDC_CONFIG_INTERLACE 1017
|
||||
#define IDC_CONFIG_AA3 1018
|
||||
#define IDC_CONFIG_CAPTUREAVI 1018
|
||||
#define IDC_CONFIG_CAPTUREAVI2 1019
|
||||
#define IDC_CONFIG_FULLSCREEN 1019
|
||||
#define IDC_CONFIG_FULLSCREEN2 1020
|
||||
#define IDC_CONFIG_FFX 1020
|
||||
#define IDC_CONFIG_INTERLACE2 1021
|
||||
#define IDC_CONFIG_DEPTHWRITE 1021
|
||||
#define IDC_CONFIG_FFX2 1021
|
||||
#define IDC_CONFIG_BMPSS 1021
|
||||
#define IDC_CONFIG_AANONE 1022
|
||||
#define IDC_CONFIG_AA2 1023
|
||||
#define IDC_RADIO3 1024
|
||||
#define IDC_CONFIG_AA4 1024
|
||||
#define IDC_CONFIG_INTERLACE3 1025
|
||||
#define IDC_CONFIG_BILINEAR 1025
|
||||
#define IDC_CONF_WIN640 1026
|
||||
#define IDC_CONF_WIN800 1027
|
||||
#define IDC_CONF_WIN1024 1028
|
||||
#define IDC_RADIO5 1029
|
||||
#define IDC_CONF_WIN1280 1029
|
||||
#define IDC_CONFIG_CAPTUREAVI3 1030
|
||||
#define IDC_CONFIG_WIREFRAME 1030
|
||||
#define IDC_CONFIG_CAPTUREAVI4 1031
|
||||
#define IDC_CONFIG_CACHEFBP 1031
|
||||
#define IDC_CONFIG_SHOWFPS 1031
|
||||
#define IDC_CONFOPT_00100000 1031
|
||||
#define IDC_CONFOPT_00080000 1032
|
||||
#define IDC_CONFOPT_00002000 1033
|
||||
#define IDC_CONFOPT_00001000 1035
|
||||
#define IDC_CONFOPT_00000200 1037
|
||||
#define IDC_CONFOPT_00000080 1038
|
||||
#define IDC_CONFOPT_201 1039
|
||||
#define IDC_CONFOPT_00000040 1039
|
||||
#define IDC_CONFOPT_00000020 1040
|
||||
#define IDC_CONFOPT_00000001 1042
|
||||
#define IDC_CONFOPT_00000004 1044
|
||||
#define IDC_CONFOPT_IDS 1045
|
||||
#define IDC_CONFOPT_00200000 1046
|
||||
#define IDC_CONFOPT_00004000 1047
|
||||
#define IDC_BUTTON1 1048
|
||||
#define IDC_CONFOPT_COMPUTEOR 1048
|
||||
#define IDC_CONFOPT_4001 1049
|
||||
#define IDC_CONFOPT_00000010 1049
|
||||
#define IDC_CONFOPT_00008000 1050
|
||||
#define IDC_CONFOPT_00010000 1052
|
||||
#define IDC_CONFOPT_00020000 1054
|
||||
#define IDC_CONFOPT_00000002 1055
|
||||
#define IDC_CONFOPT_01000000 1056
|
||||
#define IDC_CONFOPT_00800000 1057
|
||||
#define IDC_CONFOPT_00000008 1058
|
||||
#define IDC_CONFOPT_00000400 1060
|
||||
#define IDC_CONFOPT_00000800 1061
|
||||
#define IDC_CONFOPT_NOALPHABLEND30 1062
|
||||
#define IDC_CONFOPT_00040000 1063
|
||||
#define IDC_CONFOPT_02000000 1064
|
||||
#define IDC_CONFOPT_04000000 1065
|
||||
#define IDC_CONFOPT_10000000 1068
|
||||
#define IDC_CONFOPT_20000000 1069
|
||||
#define IDC_CONFOPT_00000100 1066
|
||||
#define IDC_CONFIG_WIDESCREEN 1067
|
||||
#define IDC_CONFIG_AA8 2003
|
||||
#define IDC_CONFIG_AA16 2004
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 113
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1049
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
// svnrev_template.h --> svnrev.h
|
||||
//
|
||||
// This file acts as a template for the automatic SVN revision/version tag.
|
||||
// It is used by the utility SubWCrev.exe to create an "svnrev.h" file for
|
||||
// whichever project is being compiled (as indicated by command line options
|
||||
// passed to SubWCRev.exe during the project's pre-build step).
|
||||
//
|
||||
// The SubWCRev.exe utility is part of TortoiseSVN and requires several DLLs
|
||||
// installed by TortoiseSVN, so it will only be available if you have TortoiseSVN
|
||||
// installed on your system. If you do not have it installed, a generic template
|
||||
// is used instead (see svnrev_generic.h). Having TortoiseSVN is handy but not
|
||||
// necessary. If you do not have it installed, everything will still compile
|
||||
// fine except without the SVN revision tagged to the application/dll version.
|
||||
//
|
||||
// TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org
|
||||
|
||||
#define SVN_REV $WCREV$
|
||||
#define SVN_MODS $WCMODS?1:0$
|
|
@ -0,0 +1,23 @@
|
|||
// svnrev_genric.h --> svnrev.h
|
||||
//
|
||||
// This file acts as a placebo for people who do not have TortoiseSVN installed.
|
||||
// It provides "empty" revision information to the Pcsx2 Playground projects in
|
||||
// the absence of real revisions derived from the repository being built.
|
||||
//
|
||||
// This file does not affect application/dll builds in any significant manner,
|
||||
// other than the lack of automatic revision tags inserted into the app (which
|
||||
// is very convenient but hardly necessary).
|
||||
//
|
||||
// See svn_template.h for more information on how the process of revision
|
||||
// templating works.
|
||||
//
|
||||
// If you would like to enable automatic revisin tagging, TortoiseSVN can be
|
||||
// downloaded from http://tortoisesvn.tigris.org
|
||||
|
||||
#define SVN_REV_UNKNOWN
|
||||
|
||||
// The following defines are included so that code will still compile even if it
|
||||
// doesn't check for the SVN_REV_UNKNOWN define.
|
||||
|
||||
#define SVN_REV 0
|
||||
#define SVN_MODS ""
|
|
@ -0,0 +1,8 @@
|
|||
@echo off
|
||||
SubWCRev.exe %1 %2\svnrev_template.h %1\svnrev.h
|
||||
if not ERRORLEVEL 0 (
|
||||
echo Automatic revision update unavailable, using generic template instead.
|
||||
echo You can safely ignore this message - see svnrev.h for details.
|
||||
copy /Y %3\svnrev_unknown.h %2\svnrev.h
|
||||
)
|
||||
set ERRORLEVEL=0
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="windows-1250"?>
|
||||
<VisualStudioPropertySheet
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="plugins"
|
||||
OutputDirectory="$(ProjectDir)\bin"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
>
|
||||
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine=".\vsprops\preBuild.cmd "$(ProjectDir)\.." "$(ProjectDir)vsprops""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine=".\vsprops\postBuild.cmd "$(TargetPath)" "$(SolutionDir)" "$(TargetName)" $(TargetExt)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\;"$(ProjectDir)";..\common;..\3rdparty"
|
||||
PreprocessorDefinitions="__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
StructMemberAlignment="5"
|
||||
RuntimeTypeInfo="false"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
|
@ -0,0 +1,24 @@
|
|||
@echo off
|
||||
rem
|
||||
rem Usage: postBuild.cmd SourcePath DestDir DestFile DestExt
|
||||
rem
|
||||
rem SourcePath - $(TargetPath) - Fully qualified path of the generated target file.
|
||||
rem DestDir - $(SolutionDir) - Directory of the destination, usually the same as the solution.
|
||||
rem DestFile - Base filename of the target/dest, without extension!
|
||||
rem DestExt - Extension of the target/dest!
|
||||
|
||||
set pcsxoutdir=%2\bin\plugins
|
||||
set pcsxoutname=%pcsxoutdir%\%3%4
|
||||
set pcsxnewname=%pcsxoutdir%\%3-r$WCREV$$WCMODS?m:$%4
|
||||
|
||||
IF NOT EXIST %pcsxoutdir% (
|
||||
md %pcsxoutdir%
|
||||
)
|
||||
|
||||
copy /Y %1 %pcsxoutname%
|
||||
copy /Y %1 %pcsxnewname%
|
||||
|
||||
if ERRORLEVEL 0 (
|
||||
echo Target copied to %pcsxnewname%
|
||||
)
|
||||
exit 0
|
|
@ -0,0 +1,21 @@
|
|||
@echo off
|
||||
rem
|
||||
rem Usage: postBuild.cmd SourcePath DestDir DestFile DestExt
|
||||
rem
|
||||
rem SourcePath - $(TargetPath) - Fully qualified path of the generated target file.
|
||||
rem DestDir - $(SolutionDir) - Directory of the destination, usually the same as the solution.
|
||||
rem DestFile - Base filename of the target/dest, without extension!
|
||||
rem DestExt - Extension of the target/dest!
|
||||
|
||||
set pcsxoutdir=%2\bin\plugins
|
||||
set pcsxoutname=%pcsxoutdir%%3%4
|
||||
|
||||
IF NOT EXIST %pcsxoutdir% (
|
||||
md %pcsxoutdir%
|
||||
)
|
||||
|
||||
copy /Y %1 %pcsxoutname%
|
||||
if ERRORLEVEL 0 (
|
||||
echo Target copied to %pcsxoutname%
|
||||
)
|
||||
set ERRORLEVEL=0
|
|
@ -0,0 +1,20 @@
|
|||
@echo off
|
||||
|
||||
rem Usage: preBuild.cmd ProjectSrcDir VspropsDir
|
||||
rem
|
||||
rem ProjectSrcDir - $(ProjectDir)\.. - Directory of project source code.
|
||||
rem VspropsDir - $(PrjectDir)\vsprops - Directory of this script and its counterparts.
|
||||
|
||||
SubWCRev.exe %1 %2\svnrev_template.h %1\svnrev.h
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo Automatic revision update unavailable, using generic template instead.
|
||||
echo You can safely ignore this message - see svnrev.h for details.
|
||||
copy /Y %2\svnrev_unknown.h %1\svnrev.h
|
||||
copy /Y %2\postBuild.unknown %2\postBuild.cmd
|
||||
) else (
|
||||
SubWCRev.exe %1 %2\postBuild.tmpl %2\postBuild.cmd
|
||||
)
|
||||
|
||||
rem Always return an errorlevel of 0 -- this allows compilation to continue if SubWCRev failed.
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,18 @@
|
|||
// svnrev_template.h --> svnrev.h
|
||||
//
|
||||
// This file acts as a template for the automatic SVN revision/version tag.
|
||||
// It is used by the utility SubWCrev.exe to create an "svnrev.h" file for
|
||||
// whichever project is being compiled (as indicated by command line options
|
||||
// passed to SubWCRev.exe during the project's pre-build step).
|
||||
//
|
||||
// The SubWCRev.exe utility is part of TortoiseSVN and requires several DLLs
|
||||
// installed by TortoiseSVN, so it will only be available if you have TortoiseSVN
|
||||
// installed on your system. If you do not have it installed, a generic template
|
||||
// is used instead (see svnrev_generic.h). Having TortoiseSVN is handy but not
|
||||
// necessary. If you do not have it installed, everything will still compile
|
||||
// fine except without the SVN revision tagged to the application/dll version.
|
||||
//
|
||||
// TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org
|
||||
|
||||
#define SVN_REV $WCREV$
|
||||
#define SVN_MODS $WCMODS?1:0$
|
|
@ -0,0 +1,23 @@
|
|||
// svnrev_genric.h --> svnrev.h
|
||||
//
|
||||
// This file acts as a placebo for people who do not have TortoiseSVN installed.
|
||||
// It provides "empty" revision information to the Pcsx2 Playground projects in
|
||||
// the absence of real revisions derived from the repository being built.
|
||||
//
|
||||
// This file does not affect application/dll builds in any significant manner,
|
||||
// other than the lack of automatic revision tags inserted into the app (which
|
||||
// is very convenient but hardly necessary).
|
||||
//
|
||||
// See svn_template.h for more information on how the process of revision
|
||||
// templating works.
|
||||
//
|
||||
// If you would like to enable automatic revisin tagging, TortoiseSVN can be
|
||||
// downloaded from http://tortoisesvn.tigris.org
|
||||
|
||||
#define SVN_REV_UNKNOWN
|
||||
|
||||
// The following defines are included so that code will still compile even if it
|
||||
// doesn't check for the SVN_REV_UNKNOWN define.
|
||||
|
||||
#define SVN_REV 0
|
||||
#define SVN_MODS ""
|
|
@ -0,0 +1,813 @@
|
|||
#ifndef __wglext_h_
|
||||
#define __wglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* wglext.h last updated 2009/03/03 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define WGL_WGLEXT_VERSION 12
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_out
|
||||
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define WGL_GPU_RAM_AMD 0x21A3
|
||||
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#endif
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#endif
|
||||
#ifndef WGL_NV_present_video
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
#endif
|
||||
#ifndef WGL_NV_video_out
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
#endif
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
DECLARE_HANDLE(HPGPUNV);
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
|
||||
typedef struct _GPU_DEVICE {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD Flags;
|
||||
RECT rcVirtualScreen;
|
||||
} GPU_DEVICE, *PGPU_DEVICE;
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
|
||||
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
|
||||
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
|
||||
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
|
||||
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
|
||||
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_ARB_create_context 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC, HGLRC, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
|
||||
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
|
||||
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
|
||||
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
|
||||
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
|
||||
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSwapIntervalEXT (int);
|
||||
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
|
||||
extern void WINAPI wglFreeMemoryNV (void *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
|
||||
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
|
||||
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
|
||||
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
|
||||
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
|
||||
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
|
||||
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
|
||||
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
|
||||
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
|
||||
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
|
||||
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
|
||||
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NV_present_video 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern int WINAPI wglEnumerateVideoDevicesNV (HDC, HVIDEOOUTPUTDEVICENV *);
|
||||
extern BOOL WINAPI wglBindVideoDeviceNV (HDC, unsigned int, HVIDEOOUTPUTDEVICENV, const int *);
|
||||
extern BOOL WINAPI wglQueryCurrentContextNV (int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_out
|
||||
#define WGL_NV_video_out 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetVideoDeviceNV (HDC, int, HPVIDEODEV *);
|
||||
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV);
|
||||
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV, HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB, int, unsigned long *, BOOL);
|
||||
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV, unsigned long *, unsigned long *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#define WGL_NV_swap_group 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglJoinSwapGroupNV (HDC, GLuint);
|
||||
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint, GLuint);
|
||||
extern BOOL WINAPI wglQuerySwapGroupNV (HDC, GLuint *, GLuint *);
|
||||
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC, GLuint *, GLuint *);
|
||||
extern BOOL WINAPI wglQueryFrameCountNV (HDC, GLuint *);
|
||||
extern BOOL WINAPI wglResetFrameCountNV (HDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnumGpusNV (UINT, HGPUNV *);
|
||||
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV, UINT, PGPU_DEVICE);
|
||||
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *);
|
||||
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC, UINT, HGPUNV *);
|
||||
extern BOOL WINAPI wglDeleteDCNV (HDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_AMD_gpu_association 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern UINT WINAPI wglGetGPUIDsAMD (UINT, UINT *);
|
||||
extern INT WINAPI wglGetGPUInfoAMD (UINT, int, GLenum, UINT, void *);
|
||||
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC);
|
||||
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT);
|
||||
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT, HGLRC, const int *);
|
||||
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC);
|
||||
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC);
|
||||
extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Binary file not shown.
After Width: | Height: | Size: 900 KiB |
|
@ -0,0 +1,37 @@
|
|||
; Declares the module parameters for the DLL.
|
||||
|
||||
;LIBRARY "ZeroGS"
|
||||
;DESCRIPTION 'ZeroGS dll'
|
||||
|
||||
EXPORTS
|
||||
; Explicit exports can go here
|
||||
PS2EgetLibType @2
|
||||
PS2EgetLibName @3
|
||||
PS2EgetLibVersion2 @4
|
||||
GSinit @5
|
||||
GSshutdown @6
|
||||
GSopen @7
|
||||
GSclose @8
|
||||
GSgifTransfer1 @13
|
||||
GSgifTransfer2 @14
|
||||
GSgifTransfer3 @15
|
||||
GSreadFIFO @16
|
||||
GSvsync @17
|
||||
GSmakeSnapshot @18
|
||||
GSkeyEvent @19
|
||||
GSfreeze @20
|
||||
GSconfigure @21
|
||||
GStest @22
|
||||
GSabout @23
|
||||
GSreadFIFO2 @28
|
||||
GSirqCallback @29
|
||||
GSsetBaseMem @30
|
||||
GSwriteCSR @31
|
||||
GSchangeSaveState @32
|
||||
GSreset @33
|
||||
GSgifSoftReset @34
|
||||
GSsetFrameSkip @35
|
||||
GSsetGameCRC @36
|
||||
GSgetLastTag @37
|
||||
GSsetupRecording @38
|
||||
GSsetSettingsDir @39
|
|
@ -0,0 +1,227 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resrc1.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "resource.h"
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_ZEROGSLOGO BITMAP "zerogs.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// RCDATA
|
||||
//
|
||||
|
||||
IDR_SHADERS RCDATA "ps2hw.dat"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_CONFIG DIALOGEX 0, 0, 427, 401
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
CONTROL "Interlace Enable (toggle with F5)\n there are 2 modes + interlace off",IDC_CONFIG_INTERLACE,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,7,134,18
|
||||
CONTROL "Bilinear Filtering (Shift+F5)\n Best quality is on, turn off for speed.",IDC_CONFIG_BILINEAR,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,31,135,18
|
||||
CONTROL "None",IDC_CONFIG_AANONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,19,81,34,11
|
||||
CONTROL "2X",IDC_CONFIG_AA2,"Button",BS_AUTORADIOBUTTON,69,81,26,11
|
||||
CONTROL "4X",IDC_CONFIG_AA4,"Button",BS_AUTORADIOBUTTON,111,81,28,11
|
||||
CONTROL "8X",IDC_CONFIG_AA8,"Button",BS_AUTORADIOBUTTON,65,97,26,11
|
||||
CONTROL "16X",IDC_CONFIG_AA16,"Button",BS_AUTORADIOBUTTON,107,97,28,11
|
||||
CONTROL "Wireframe rendering (F7)",IDC_CONFIG_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,122,93,10
|
||||
CONTROL "Capture Avi (zerogs.avi) (F12)",IDC_CONFIG_CAPTUREAVI,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,140,109,10
|
||||
CONTROL "Save Snapshots as BMPs (default is JPG)",IDC_CONFIG_BMPSS,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,161,147,10
|
||||
CONTROL "Fullscreen (Alt+Enter)\n to get out press Alt+Enter again",IDC_CONFIG_FULLSCREEN,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,177,146,17
|
||||
CONTROL "Wide Screen",IDC_CONFIG_WIDESCREEN,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,194,109,10
|
||||
CONTROL "640 x 480",IDC_CONF_WIN640,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,210,59,8
|
||||
CONTROL "800 x 600",IDC_CONF_WIN800,"Button",BS_AUTORADIOBUTTON,78,210,59,8
|
||||
CONTROL "1024 x 768",IDC_CONF_WIN1024,"Button",BS_AUTORADIOBUTTON,15,223,59,8
|
||||
CONTROL "1280 x 960",IDC_CONF_WIN1280,"Button",BS_AUTORADIOBUTTON,78,223,59,8
|
||||
DEFPUSHBUTTON "OK",IDOK,7,380,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,94,380,50,14
|
||||
GROUPBOX "Anti-aliasing for sharper graphics (F6)",IDC_STATIC,7,55,132,61
|
||||
GROUPBOX "Default Window Size (no speed impact)",IDC_STATIC,7,201,141,35
|
||||
LTEXT "Show Frames Per Second (Shift+F7)",IDC_STATIC,7,244,140,10
|
||||
GROUPBOX "Advanced Options",IDC_STATIC,152,7,268,387
|
||||
LTEXT "Each option is presented with a unique ID in hex. In order to preserve options across games, go into the game's patch (.pnach) file and type\n zerogs=IDS\nwhere IDS is the OR all of the values in hex for every option you want enabled. ",IDC_STATIC,161,16,252,33
|
||||
PUSHBUTTON "Use Defaults (recommended)",IDC_CONF_DEFAULT,159,76,151,14
|
||||
CONTROL "Disable alpha testing - 00080000",IDC_CONFOPT_00080000,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,104,119,10
|
||||
CONTROL "Disable stencil buffer - 00002000\nusually safe to do for simple scenes. Harvest Moon",IDC_CONFOPT_00002000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,159,114,118,22
|
||||
CONTROL "No target CLUT - 00001000\n(use on RE4, or foggy scenes)",IDC_CONFOPT_00001000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,169,120,24
|
||||
CONTROL "Disable depth updates - 00000200",IDC_CONFOPT_00000200,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,158,161,125,10
|
||||
CONTROL "Alpha Fail hack\nFor Sonic Unleashed, Shadow the Hedgehog, Ghost in the Shell. Remove vertical stripes or other coloring artefacts. Break Persona 4 and MGS3",IDC_CONFOPT_00000100,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,190,121,17
|
||||
CONTROL "Exact color testing - 00000020\nfixes overbright or shadow/black artifacts (crash n burn)",IDC_CONFOPT_00000020,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,209,119,25
|
||||
CONTROL "Tex Target checking - 00000001\nlego racers",IDC_CONFOPT_00000001,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,233,123,22
|
||||
CONTROL "Interlace 2X - 00000004\nfixes 2x bigger screen (gradius3)",IDC_CONFOPT_00000004,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,254,119,20
|
||||
CONTROL "No depth resolve - 00008000\nmight give z buffer artifacts",IDC_CONFOPT_00008000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,164,121,19
|
||||
CONTROL "full 16 bit resolution - 00010000\nuse when half the screen is missing, etc",IDC_CONFOPT_00010000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,185,125,23
|
||||
CONTROL "Auto Reset Targs - 00000002\nshadow hearts, samurai warriors (use when game is slow and toggling AA fixes it)",IDC_CONFOPT_00000002,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,212,124,32
|
||||
EDITTEXT IDC_CONFOPT_IDS,361,380,48,14,ES_AUTOHSCROLL | ES_READONLY
|
||||
CONTROL "Resolve Hack #1 - 00000400\nspeeds some games (kingdom hearts)",IDC_CONFOPT_00000400,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,266,135,19
|
||||
CONTROL "Resolve Hack #2 - 00000800\nshadow hearts, urbz, destroy FFX",IDC_CONFOPT_00000800,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,276,117,17
|
||||
CONTROL "Resolve Hack #3 - 00020000\nneopets",IDC_CONFOPT_00020000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,287,125,17
|
||||
CONTROL "Fast Update - 00040000\nspeeds some games (okami). Sonic Unleashed",IDC_CONFOPT_00040000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,297,125,17
|
||||
PUSHBUTTON "Compute OR of IDS",IDC_CONFOPT_COMPUTEOR,283,380,73,14
|
||||
LTEXT "Important options are listed first. Note, setting option here means that they will be ADDED to whatever options are set in each pnach file.",IDC_STATIC,159,50,252,23
|
||||
CONTROL "No target resolves - 00000010\nStops all resolving of targets (try this first for really slow games). Dark Cloud 1",IDC_CONFOPT_00000010,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,104,111,33
|
||||
CONTROL "Enable Multiple RTs - 00100000",IDC_CONFOPT_00100000,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,91,119,10
|
||||
CONTROL "No color clamping - 00000040\nSpeeds games up but might be too bright or too dim",IDC_CONFOPT_00000040,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,157,137,123,22
|
||||
LTEXT "shortcuts: F6 - next, Shift+F6 - prev",IDC_STATIC,19,65,116,11
|
||||
CONTROL "No logaripmic-Z - 20000000\n decrease number of Z artefacts",IDC_CONFOPT_20000000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,138,111,28
|
||||
CONTROL "Partial Targets - 02000000\nReduces artifacts and speeds up some games (mgs3)",IDC_CONFOPT_02000000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,158,319,125,24
|
||||
CONTROL "Partial Depth - 04000000\nTries to save the depth target as much as possible (mgs3)",IDC_CONFOPT_04000000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,159,347,125,24
|
||||
CONTROL "Specular Highlights - 01000000\nMakes xenosaga and Okage graphics faster by removing highlights",IDC_CONFOPT_01000000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,313,125,25
|
||||
CONTROL "Gust fix, made gustgame more clean and fast - 10000000",IDC_CONFOPT_10000000,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,284,366,125,25
|
||||
|
||||
END
|
||||
|
||||
IDD_ABOUT DIALOGEX 0, 0, 182, 220
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "GSabout"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,65,199,50,14
|
||||
LTEXT "ZZogl\n\nauthor: Zeydlitz(@gmail.com)\n\n\nthanks to Gabest for SSE optimizations",IDC_STATIC,7,7,160,47
|
||||
LTEXT "Static",IDC_ABOUTTEXT,7,65,152,124
|
||||
END
|
||||
|
||||
IDD_LOGGING DIALOG 0, 0, 152, 55
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,40,35,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,95,35,50,14
|
||||
CONTROL "Log",IDC_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,60,15,28,10
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_CONFIG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 420
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 394
|
||||
END
|
||||
|
||||
IDD_ABOUT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 175
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 213
|
||||
END
|
||||
|
||||
IDD_LOGGING, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 145
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resrc1.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""resource.h""\r\n"
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
|
@ -0,0 +1,578 @@
|
|||
<?xml version="1.0" encoding="windows-1253"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="ZZOgl"
|
||||
ProjectGUID="{2D4E85B2-F47F-4D65-B091-701E5C031DAC}"
|
||||
RootNamespace="ZZogl"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Devel|Win32"
|
||||
InheritedPropertySheets=".\vsprops\pcsx2_plugin_common.vsprops"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="..\x86\;..\..\ZeroGSShaders\"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;__i386__;ZEROGS_DEVBUILD"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
PrecompiledHeaderFile=".\Release/GSsoftdx.pch"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="winmm.lib Vfw32.lib cg.lib cgGL.lib libjpeg.lib opengl32.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)-dev.dll"
|
||||
AdditionalLibraryDirectories="..\"
|
||||
ModuleDefinitionFile=".\zerogs.def"
|
||||
GenerateDebugInformation="true"
|
||||
LinkTimeCodeGeneration="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
InheritedPropertySheets=".\vsprops\pcsx2_plugin_common.vsprops"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\x86\;..\..\ZeroGSShaders\"
|
||||
PreprocessorDefinitions="_USRDLL;ZEROGS_DEVBUILD;_DEBUG;__i386__"
|
||||
IgnoreStandardIncludePath="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
EnableFunctionLevelLinking="true"
|
||||
RuntimeTypeInfo="true"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="winmm.lib Vfw32.lib cg.lib cgGL.lib libjpeg.lib opengl32.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)-dbg.dll"
|
||||
AdditionalLibraryDirectories="..\"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
ModuleDefinitionFile=".\zerogs.def"
|
||||
GenerateDebugInformation="true"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
InheritedPropertySheets=".\vsprops\pcsx2_plugin_common.vsprops"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="..\x86\;..\..\ZeroGSShaders\"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;__i386__;ZEROGS_SSE2;RELEASE_TO_PUBLIC"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
PrecompiledHeaderFile=""
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="winmm.lib Vfw32.lib cg.lib cgGL.lib libjpeg.lib opengl32.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName).dll"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="..\"
|
||||
ModuleDefinitionFile=".\zerogs.def"
|
||||
GenerateDebugInformation="true"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
ImportLibrary=""
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Conf.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\glprocs.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSmain.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\GSsoftdx.def"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Mem.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\memcpy_amd.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rasterfont.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Regs.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\targets.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Win32.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\x86-32.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Devel|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\x86.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\zerogs.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\zpipe.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglCreate.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglSave.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglShaders.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglVB.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglCRTC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglShoots.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ZZoglFlush.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\avcodec.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\aviUtil.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GS.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Mem.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\PS2Edefs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\PS2Etypes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rasterfont.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Regs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resrc1.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\targets.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Win32.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\x86.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\zerogs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\zerogsmath.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
<File
|
||||
RelativePath="Pcsx2.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zerogs.bmp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zerogs.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Docs"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="zlib"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\adler32.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\compress.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\crc32.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\crc32.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\deflate.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\deflate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\gzio.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\infback.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inffast.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inffast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inffixed.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inflate.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inflate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inftrees.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\inftrees.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\trees.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\trees.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\uncompr.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\zconf.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\zlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\zutil.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\3rdparty\zlib\zutil.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\ps2hw.dat"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,74 @@
|
|||
/* adler32.c -- compute the Adler-32 checksum of a data stream
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: adler32.c,v 1.1 2006/01/12 17:26:07 shadowpcsx2 Exp $ */
|
||||
|
||||
#define ZLIB_INTERNAL
|
||||
#include "zlib.h"
|
||||
|
||||
#define BASE 65521UL /* largest prime smaller than 65536 */
|
||||
#define NMAX 5552
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
|
||||
|
||||
#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
|
||||
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
|
||||
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
|
||||
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
|
||||
#define DO16(buf) DO8(buf,0); DO8(buf,8);
|
||||
|
||||
#ifdef NO_DIVIDE
|
||||
# define MOD(a) \
|
||||
do { \
|
||||
if (a >= (BASE << 16)) a -= (BASE << 16); \
|
||||
if (a >= (BASE << 15)) a -= (BASE << 15); \
|
||||
if (a >= (BASE << 14)) a -= (BASE << 14); \
|
||||
if (a >= (BASE << 13)) a -= (BASE << 13); \
|
||||
if (a >= (BASE << 12)) a -= (BASE << 12); \
|
||||
if (a >= (BASE << 11)) a -= (BASE << 11); \
|
||||
if (a >= (BASE << 10)) a -= (BASE << 10); \
|
||||
if (a >= (BASE << 9)) a -= (BASE << 9); \
|
||||
if (a >= (BASE << 8)) a -= (BASE << 8); \
|
||||
if (a >= (BASE << 7)) a -= (BASE << 7); \
|
||||
if (a >= (BASE << 6)) a -= (BASE << 6); \
|
||||
if (a >= (BASE << 5)) a -= (BASE << 5); \
|
||||
if (a >= (BASE << 4)) a -= (BASE << 4); \
|
||||
if (a >= (BASE << 3)) a -= (BASE << 3); \
|
||||
if (a >= (BASE << 2)) a -= (BASE << 2); \
|
||||
if (a >= (BASE << 1)) a -= (BASE << 1); \
|
||||
if (a >= BASE) a -= BASE; \
|
||||
} while (0)
|
||||
#else
|
||||
# define MOD(a) a %= BASE
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
uLong ZEXPORT adler32(adler, buf, len)
|
||||
uLong adler;
|
||||
const Bytef *buf;
|
||||
uInt len;
|
||||
{
|
||||
unsigned long s1 = adler & 0xffff;
|
||||
unsigned long s2 = (adler >> 16) & 0xffff;
|
||||
int k;
|
||||
|
||||
if (buf == Z_NULL) return 1L;
|
||||
|
||||
while (len > 0) {
|
||||
k = len < NMAX ? (int)len : NMAX;
|
||||
len -= k;
|
||||
while (k >= 16) {
|
||||
DO16(buf);
|
||||
buf += 16;
|
||||
k -= 16;
|
||||
}
|
||||
if (k != 0) do {
|
||||
s1 += *buf++;
|
||||
s2 += s1;
|
||||
} while (--k);
|
||||
MOD(s1);
|
||||
MOD(s2);
|
||||
}
|
||||
return (s2 << 16) | s1;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/* compress.c -- compress a memory buffer
|
||||
* Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: compress.c,v 1.1 2006/01/12 17:26:07 shadowpcsx2 Exp $ */
|
||||
|
||||
#define ZLIB_INTERNAL
|
||||
#include "zlib.h"
|
||||
|
||||
/* ===========================================================================
|
||||
Compresses the source buffer into the destination buffer. The level
|
||||
parameter has the same meaning as in deflateInit. sourceLen is the byte
|
||||
length of the source buffer. Upon entry, destLen is the total size of the
|
||||
destination buffer, which must be at least 0.1% larger than sourceLen plus
|
||||
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
|
||||
|
||||
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
|
||||
Z_STREAM_ERROR if the level parameter is invalid.
|
||||
*/
|
||||
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
int level;
|
||||
{
|
||||
z_stream stream;
|
||||
int err;
|
||||
|
||||
stream.next_in = (Bytef*)source;
|
||||
stream.avail_in = (uInt)sourceLen;
|
||||
#ifdef MAXSEG_64K
|
||||
/* Check for source > 64K on 16-bit machine: */
|
||||
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
|
||||
#endif
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = (uInt)*destLen;
|
||||
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
|
||||
|
||||
stream.zalloc = (alloc_func)0;
|
||||
stream.zfree = (free_func)0;
|
||||
stream.opaque = (voidpf)0;
|
||||
|
||||
err = deflateInit(&stream, level);
|
||||
if (err != Z_OK) return err;
|
||||
|
||||
err = deflate(&stream, Z_FINISH);
|
||||
if (err != Z_STREAM_END) {
|
||||
deflateEnd(&stream);
|
||||
return err == Z_OK ? Z_BUF_ERROR : err;
|
||||
}
|
||||
*destLen = stream.total_out;
|
||||
|
||||
err = deflateEnd(&stream);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
*/
|
||||
int ZEXPORT compress (dest, destLen, source, sourceLen)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
{
|
||||
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
If the default memLevel or windowBits for deflateInit() is changed, then
|
||||
this function needs to be updated.
|
||||
*/
|
||||
uLong ZEXPORT compressBound (sourceLen)
|
||||
uLong sourceLen;
|
||||
{
|
||||
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
|
||||
}
|
|
@ -0,0 +1,311 @@
|
|||
/* crc32.c -- compute the CRC-32 of a data stream
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*
|
||||
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
|
||||
* CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
|
||||
* tables for updating the shift register in one step with three exclusive-ors
|
||||
* instead of four steps with four exclusive-ors. This results about a factor
|
||||
* of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
|
||||
*/
|
||||
|
||||
/* @(#) $Id: crc32.c,v 1.1 2006/01/12 17:26:07 shadowpcsx2 Exp $ */
|
||||
|
||||
#ifdef MAKECRCH
|
||||
# include <stdio.h>
|
||||
# ifndef DYNAMIC_CRC_TABLE
|
||||
# define DYNAMIC_CRC_TABLE
|
||||
# endif /* !DYNAMIC_CRC_TABLE */
|
||||
#endif /* MAKECRCH */
|
||||
|
||||
#include "zutil.h" /* for STDC and FAR definitions */
|
||||
|
||||
#define local static
|
||||
|
||||
/* Find a four-byte integer type for crc32_little() and crc32_big(). */
|
||||
#ifndef NOBYFOUR
|
||||
# ifdef STDC /* need ANSI C limits.h to determine sizes */
|
||||
# include <limits.h>
|
||||
# define BYFOUR
|
||||
# if (UINT_MAX == 0xffffffffUL)
|
||||
typedef unsigned int u4;
|
||||
# else
|
||||
# if (ULONG_MAX == 0xffffffffUL)
|
||||
typedef unsigned long u4;
|
||||
# else
|
||||
# if (USHRT_MAX == 0xffffffffUL)
|
||||
typedef unsigned short u4;
|
||||
# else
|
||||
# undef BYFOUR /* can't find a four-byte integer type! */
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif /* STDC */
|
||||
#endif /* !NOBYFOUR */
|
||||
|
||||
/* Definitions for doing the crc four data bytes at a time. */
|
||||
#ifdef BYFOUR
|
||||
# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
|
||||
(((w)&0xff00)<<8)+(((w)&0xff)<<24))
|
||||
local unsigned long crc32_little OF((unsigned long,
|
||||
const unsigned char FAR *, unsigned));
|
||||
local unsigned long crc32_big OF((unsigned long,
|
||||
const unsigned char FAR *, unsigned));
|
||||
# define TBLS 8
|
||||
#else
|
||||
# define TBLS 1
|
||||
#endif /* BYFOUR */
|
||||
|
||||
#ifdef DYNAMIC_CRC_TABLE
|
||||
|
||||
local int crc_table_empty = 1;
|
||||
local unsigned long FAR crc_table[TBLS][256];
|
||||
local void make_crc_table OF((void));
|
||||
#ifdef MAKECRCH
|
||||
local void write_table OF((FILE *, const unsigned long FAR *));
|
||||
#endif /* MAKECRCH */
|
||||
|
||||
/*
|
||||
Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
|
||||
x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
|
||||
|
||||
Polynomials over GF(2) are represented in binary, one bit per coefficient,
|
||||
with the lowest powers in the most significant bit. Then adding polynomials
|
||||
is just exclusive-or, and multiplying a polynomial by x is a right shift by
|
||||
one. If we call the above polynomial p, and represent a byte as the
|
||||
polynomial q, also with the lowest power in the most significant bit (so the
|
||||
byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
|
||||
where a mod b means the remainder after dividing a by b.
|
||||
|
||||
This calculation is done using the shift-register method of multiplying and
|
||||
taking the remainder. The register is initialized to zero, and for each
|
||||
incoming bit, x^32 is added mod p to the register if the bit is a one (where
|
||||
x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
|
||||
x (which is shifting right by one and adding x^32 mod p if the bit shifted
|
||||
out is a one). We start with the highest power (least significant bit) of
|
||||
q and repeat for all eight bits of q.
|
||||
|
||||
The first table is simply the CRC of all possible eight bit values. This is
|
||||
all the information needed to generate CRCs on data a byte at a time for all
|
||||
combinations of CRC register values and incoming bytes. The remaining tables
|
||||
allow for word-at-a-time CRC calculation for both big-endian and little-
|
||||
endian machines, where a word is four bytes.
|
||||
*/
|
||||
local void make_crc_table()
|
||||
{
|
||||
unsigned long c;
|
||||
int n, k;
|
||||
unsigned long poly; /* polynomial exclusive-or pattern */
|
||||
/* terms of polynomial defining this crc (except x^32): */
|
||||
static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
|
||||
|
||||
/* make exclusive-or pattern from polynomial (0xedb88320UL) */
|
||||
poly = 0UL;
|
||||
for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
|
||||
poly |= 1UL << (31 - p[n]);
|
||||
|
||||
/* generate a crc for every 8-bit value */
|
||||
for (n = 0; n < 256; n++) {
|
||||
c = (unsigned long)n;
|
||||
for (k = 0; k < 8; k++)
|
||||
c = c & 1 ? poly ^ (c >> 1) : c >> 1;
|
||||
crc_table[0][n] = c;
|
||||
}
|
||||
|
||||
#ifdef BYFOUR
|
||||
/* generate crc for each value followed by one, two, and three zeros, and
|
||||
then the byte reversal of those as well as the first table */
|
||||
for (n = 0; n < 256; n++) {
|
||||
c = crc_table[0][n];
|
||||
crc_table[4][n] = REV(c);
|
||||
for (k = 1; k < 4; k++) {
|
||||
c = crc_table[0][c & 0xff] ^ (c >> 8);
|
||||
crc_table[k][n] = c;
|
||||
crc_table[k + 4][n] = REV(c);
|
||||
}
|
||||
}
|
||||
#endif /* BYFOUR */
|
||||
|
||||
crc_table_empty = 0;
|
||||
|
||||
#ifdef MAKECRCH
|
||||
/* write out CRC tables to crc32.h */
|
||||
{
|
||||
FILE *out;
|
||||
|
||||
out = fopen("crc32.h", "w");
|
||||
if (out == NULL) return;
|
||||
fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
|
||||
fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
|
||||
fprintf(out, "local const unsigned long FAR ");
|
||||
fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
|
||||
write_table(out, crc_table[0]);
|
||||
# ifdef BYFOUR
|
||||
fprintf(out, "#ifdef BYFOUR\n");
|
||||
for (k = 1; k < 8; k++) {
|
||||
fprintf(out, " },\n {\n");
|
||||
write_table(out, crc_table[k]);
|
||||
}
|
||||
fprintf(out, "#endif\n");
|
||||
# endif /* BYFOUR */
|
||||
fprintf(out, " }\n};\n");
|
||||
fclose(out);
|
||||
}
|
||||
#endif /* MAKECRCH */
|
||||
}
|
||||
|
||||
#ifdef MAKECRCH
|
||||
local void write_table(out, table)
|
||||
FILE *out;
|
||||
const unsigned long FAR *table;
|
||||
{
|
||||
int n;
|
||||
|
||||
for (n = 0; n < 256; n++)
|
||||
fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n],
|
||||
n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
|
||||
}
|
||||
#endif /* MAKECRCH */
|
||||
|
||||
#else /* !DYNAMIC_CRC_TABLE */
|
||||
/* ========================================================================
|
||||
* Tables of CRC-32s of all single-byte values, made by make_crc_table().
|
||||
*/
|
||||
#include "crc32.h"
|
||||
#endif /* DYNAMIC_CRC_TABLE */
|
||||
|
||||
/* =========================================================================
|
||||
* This function can be used by asm versions of crc32()
|
||||
*/
|
||||
const unsigned long FAR * ZEXPORT get_crc_table()
|
||||
{
|
||||
#ifdef DYNAMIC_CRC_TABLE
|
||||
if (crc_table_empty) make_crc_table();
|
||||
#endif /* DYNAMIC_CRC_TABLE */
|
||||
return (const unsigned long FAR *)crc_table;
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
|
||||
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
|
||||
|
||||
/* ========================================================================= */
|
||||
unsigned long ZEXPORT crc32(crc, buf, len)
|
||||
unsigned long crc;
|
||||
const unsigned char FAR *buf;
|
||||
unsigned len;
|
||||
{
|
||||
if (buf == Z_NULL) return 0UL;
|
||||
|
||||
#ifdef DYNAMIC_CRC_TABLE
|
||||
if (crc_table_empty)
|
||||
make_crc_table();
|
||||
#endif /* DYNAMIC_CRC_TABLE */
|
||||
|
||||
#ifdef BYFOUR
|
||||
if (sizeof(void *) == sizeof(ptrdiff_t)) {
|
||||
u4 endian;
|
||||
|
||||
endian = 1;
|
||||
if (*((unsigned char *)(&endian)))
|
||||
return crc32_little(crc, buf, len);
|
||||
else
|
||||
return crc32_big(crc, buf, len);
|
||||
}
|
||||
#endif /* BYFOUR */
|
||||
crc = crc ^ 0xffffffffUL;
|
||||
while (len >= 8) {
|
||||
DO8;
|
||||
len -= 8;
|
||||
}
|
||||
if (len) do {
|
||||
DO1;
|
||||
} while (--len);
|
||||
return crc ^ 0xffffffffUL;
|
||||
}
|
||||
|
||||
#ifdef BYFOUR
|
||||
|
||||
/* ========================================================================= */
|
||||
#define DOLIT4 c ^= *buf4++; \
|
||||
c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
|
||||
crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
|
||||
#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
|
||||
|
||||
/* ========================================================================= */
|
||||
local unsigned long crc32_little(crc, buf, len)
|
||||
unsigned long crc;
|
||||
const unsigned char FAR *buf;
|
||||
unsigned len;
|
||||
{
|
||||
register u4 c;
|
||||
register const u4 FAR *buf4;
|
||||
|
||||
c = (u4)crc;
|
||||
c = ~c;
|
||||
while (len && ((ptrdiff_t)buf & 3)) {
|
||||
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
|
||||
len--;
|
||||
}
|
||||
|
||||
buf4 = (const u4 FAR *)buf;
|
||||
while (len >= 32) {
|
||||
DOLIT32;
|
||||
len -= 32;
|
||||
}
|
||||
while (len >= 4) {
|
||||
DOLIT4;
|
||||
len -= 4;
|
||||
}
|
||||
buf = (const unsigned char FAR *)buf4;
|
||||
|
||||
if (len) do {
|
||||
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
|
||||
} while (--len);
|
||||
c = ~c;
|
||||
return (unsigned long)c;
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
#define DOBIG4 c ^= *++buf4; \
|
||||
c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
|
||||
crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
|
||||
#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
|
||||
|
||||
/* ========================================================================= */
|
||||
local unsigned long crc32_big(crc, buf, len)
|
||||
unsigned long crc;
|
||||
const unsigned char FAR *buf;
|
||||
unsigned len;
|
||||
{
|
||||
register u4 c;
|
||||
register const u4 FAR *buf4;
|
||||
|
||||
c = REV((u4)crc);
|
||||
c = ~c;
|
||||
while (len && ((ptrdiff_t)buf & 3)) {
|
||||
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
|
||||
len--;
|
||||
}
|
||||
|
||||
buf4 = (const u4 FAR *)buf;
|
||||
buf4--;
|
||||
while (len >= 32) {
|
||||
DOBIG32;
|
||||
len -= 32;
|
||||
}
|
||||
while (len >= 4) {
|
||||
DOBIG4;
|
||||
len -= 4;
|
||||
}
|
||||
buf4++;
|
||||
buf = (const unsigned char FAR *)buf4;
|
||||
|
||||
if (len) do {
|
||||
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
|
||||
} while (--len);
|
||||
c = ~c;
|
||||
return (unsigned long)(REV(c));
|
||||
}
|
||||
|
||||
#endif /* BYFOUR */
|
|
@ -0,0 +1,441 @@
|
|||
/* crc32.h -- tables for rapid CRC calculation
|
||||
* Generated automatically by crc32.c
|
||||
*/
|
||||
|
||||
local const unsigned long FAR crc_table[TBLS][256] =
|
||||
{
|
||||
{
|
||||
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
|
||||
0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
|
||||
0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
|
||||
0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
|
||||
0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
|
||||
0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
|
||||
0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
|
||||
0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
|
||||
0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
|
||||
0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
|
||||
0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
|
||||
0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
|
||||
0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
|
||||
0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
|
||||
0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
|
||||
0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
|
||||
0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
|
||||
0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
|
||||
0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
|
||||
0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
|
||||
0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
|
||||
0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
|
||||
0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
|
||||
0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
|
||||
0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
|
||||
0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
|
||||
0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
|
||||
0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
|
||||
0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
|
||||
0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
|
||||
0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
|
||||
0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
|
||||
0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
|
||||
0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
|
||||
0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
|
||||
0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
|
||||
0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
|
||||
0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
|
||||
0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
|
||||
0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
|
||||
0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
|
||||
0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
|
||||
0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
|
||||
0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
|
||||
0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
|
||||
0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
|
||||
0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
|
||||
0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
|
||||
0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
|
||||
0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
|
||||
0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
|
||||
0x2d02ef8dUL
|
||||
#ifdef BYFOUR
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
|
||||
0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
|
||||
0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
|
||||
0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
|
||||
0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
|
||||
0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
|
||||
0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
|
||||
0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
|
||||
0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
|
||||
0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
|
||||
0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
|
||||
0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
|
||||
0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
|
||||
0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
|
||||
0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
|
||||
0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
|
||||
0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
|
||||
0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
|
||||
0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
|
||||
0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
|
||||
0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
|
||||
0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
|
||||
0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
|
||||
0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
|
||||
0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
|
||||
0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
|
||||
0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
|
||||
0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
|
||||
0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
|
||||
0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
|
||||
0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
|
||||
0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
|
||||
0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
|
||||
0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
|
||||
0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
|
||||
0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
|
||||
0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
|
||||
0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
|
||||
0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
|
||||
0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
|
||||
0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
|
||||
0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
|
||||
0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
|
||||
0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
|
||||
0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
|
||||
0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
|
||||
0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
|
||||
0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
|
||||
0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
|
||||
0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
|
||||
0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
|
||||
0x9324fd72UL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
|
||||
0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
|
||||
0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
|
||||
0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
|
||||
0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
|
||||
0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
|
||||
0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
|
||||
0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
|
||||
0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
|
||||
0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
|
||||
0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
|
||||
0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
|
||||
0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
|
||||
0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
|
||||
0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
|
||||
0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
|
||||
0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
|
||||
0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
|
||||
0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
|
||||
0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
|
||||
0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
|
||||
0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
|
||||
0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
|
||||
0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
|
||||
0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
|
||||
0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
|
||||
0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
|
||||
0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
|
||||
0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
|
||||
0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
|
||||
0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
|
||||
0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
|
||||
0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
|
||||
0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
|
||||
0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
|
||||
0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
|
||||
0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
|
||||
0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
|
||||
0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
|
||||
0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
|
||||
0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
|
||||
0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
|
||||
0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
|
||||
0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
|
||||
0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
|
||||
0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
|
||||
0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
|
||||
0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
|
||||
0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
|
||||
0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
|
||||
0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
|
||||
0xbe9834edUL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
|
||||
0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
|
||||
0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
|
||||
0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
|
||||
0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
|
||||
0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
|
||||
0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
|
||||
0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
|
||||
0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
|
||||
0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
|
||||
0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
|
||||
0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
|
||||
0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
|
||||
0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
|
||||
0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
|
||||
0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
|
||||
0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
|
||||
0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
|
||||
0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
|
||||
0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
|
||||
0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
|
||||
0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
|
||||
0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
|
||||
0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
|
||||
0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
|
||||
0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
|
||||
0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
|
||||
0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
|
||||
0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
|
||||
0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
|
||||
0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
|
||||
0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
|
||||
0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
|
||||
0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
|
||||
0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
|
||||
0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
|
||||
0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
|
||||
0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
|
||||
0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
|
||||
0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
|
||||
0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
|
||||
0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
|
||||
0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
|
||||
0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
|
||||
0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
|
||||
0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
|
||||
0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
|
||||
0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
|
||||
0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
|
||||
0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
|
||||
0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
|
||||
0xde0506f1UL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
|
||||
0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
|
||||
0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
|
||||
0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
|
||||
0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
|
||||
0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
|
||||
0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
|
||||
0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
|
||||
0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
|
||||
0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
|
||||
0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
|
||||
0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
|
||||
0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
|
||||
0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
|
||||
0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
|
||||
0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
|
||||
0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
|
||||
0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
|
||||
0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
|
||||
0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
|
||||
0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
|
||||
0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
|
||||
0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
|
||||
0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
|
||||
0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
|
||||
0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
|
||||
0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
|
||||
0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
|
||||
0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
|
||||
0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
|
||||
0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
|
||||
0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
|
||||
0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
|
||||
0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
|
||||
0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
|
||||
0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
|
||||
0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
|
||||
0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
|
||||
0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
|
||||
0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
|
||||
0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
|
||||
0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
|
||||
0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
|
||||
0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
|
||||
0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
|
||||
0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
|
||||
0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
|
||||
0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
|
||||
0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
|
||||
0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
|
||||
0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
|
||||
0x8def022dUL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
|
||||
0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
|
||||
0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
|
||||
0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
|
||||
0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
|
||||
0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
|
||||
0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
|
||||
0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
|
||||
0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
|
||||
0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
|
||||
0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
|
||||
0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
|
||||
0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
|
||||
0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
|
||||
0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
|
||||
0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
|
||||
0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
|
||||
0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
|
||||
0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
|
||||
0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
|
||||
0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
|
||||
0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
|
||||
0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
|
||||
0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
|
||||
0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
|
||||
0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
|
||||
0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
|
||||
0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
|
||||
0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
|
||||
0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
|
||||
0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
|
||||
0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
|
||||
0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
|
||||
0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
|
||||
0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
|
||||
0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
|
||||
0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
|
||||
0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
|
||||
0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
|
||||
0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
|
||||
0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
|
||||
0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
|
||||
0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
|
||||
0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
|
||||
0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
|
||||
0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
|
||||
0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
|
||||
0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
|
||||
0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
|
||||
0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
|
||||
0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
|
||||
0x72fd2493UL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
|
||||
0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
|
||||
0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
|
||||
0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
|
||||
0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
|
||||
0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
|
||||
0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
|
||||
0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
|
||||
0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
|
||||
0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
|
||||
0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
|
||||
0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
|
||||
0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
|
||||
0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
|
||||
0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
|
||||
0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
|
||||
0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
|
||||
0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
|
||||
0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
|
||||
0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
|
||||
0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
|
||||
0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
|
||||
0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
|
||||
0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
|
||||
0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
|
||||
0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
|
||||
0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
|
||||
0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
|
||||
0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
|
||||
0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
|
||||
0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
|
||||
0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
|
||||
0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
|
||||
0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
|
||||
0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
|
||||
0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
|
||||
0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
|
||||
0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
|
||||
0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
|
||||
0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
|
||||
0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
|
||||
0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
|
||||
0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
|
||||
0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
|
||||
0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
|
||||
0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
|
||||
0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
|
||||
0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
|
||||
0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
|
||||
0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
|
||||
0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
|
||||
0xed3498beUL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
|
||||
0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
|
||||
0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
|
||||
0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
|
||||
0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
|
||||
0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
|
||||
0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
|
||||
0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
|
||||
0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
|
||||
0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
|
||||
0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
|
||||
0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
|
||||
0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
|
||||
0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
|
||||
0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
|
||||
0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
|
||||
0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
|
||||
0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
|
||||
0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
|
||||
0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
|
||||
0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
|
||||
0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
|
||||
0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
|
||||
0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
|
||||
0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
|
||||
0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
|
||||
0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
|
||||
0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
|
||||
0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
|
||||
0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
|
||||
0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
|
||||
0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
|
||||
0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
|
||||
0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
|
||||
0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
|
||||
0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
|
||||
0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
|
||||
0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
|
||||
0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
|
||||
0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
|
||||
0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
|
||||
0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
|
||||
0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
|
||||
0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
|
||||
0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
|
||||
0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
|
||||
0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
|
||||
0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
|
||||
0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
|
||||
0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
|
||||
0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
|
||||
0xf10605deUL
|
||||
#endif
|
||||
}
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,326 @@
|
|||
/* deflate.h -- internal compression state
|
||||
* Copyright (C) 1995-2002 Jean-loup Gailly
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* @(#) $Id: deflate.h,v 1.1 2006/01/12 17:26:07 shadowpcsx2 Exp $ */
|
||||
|
||||
#ifndef DEFLATE_H
|
||||
#define DEFLATE_H
|
||||
|
||||
#include "zutil.h"
|
||||
|
||||
/* define NO_GZIP when compiling if you want to disable gzip header and
|
||||
trailer creation by deflate(). NO_GZIP would be used to avoid linking in
|
||||
the crc code when it is not needed. For shared libraries, gzip encoding
|
||||
should be left enabled. */
|
||||
#ifndef NO_GZIP
|
||||
# define GZIP
|
||||
#endif
|
||||
|
||||
/* ===========================================================================
|
||||
* Internal compression state.
|
||||
*/
|
||||
|
||||
#define LENGTH_CODES 29
|
||||
/* number of length codes, not counting the special END_BLOCK code */
|
||||
|
||||
#define LITERALS 256
|
||||
/* number of literal bytes 0..255 */
|
||||
|
||||
#define L_CODES (LITERALS+1+LENGTH_CODES)
|
||||
/* number of Literal or Length codes, including the END_BLOCK code */
|
||||
|
||||
#define D_CODES 30
|
||||
/* number of distance codes */
|
||||
|
||||
#define BL_CODES 19
|
||||
/* number of codes used to transfer the bit lengths */
|
||||
|
||||
#define HEAP_SIZE (2*L_CODES+1)
|
||||
/* maximum heap size */
|
||||
|
||||
#define MAX_BITS 15
|
||||
/* All codes must not exceed MAX_BITS bits */
|
||||
|
||||
#define INIT_STATE 42
|
||||
#define BUSY_STATE 113
|
||||
#define FINISH_STATE 666
|
||||
/* Stream status */
|
||||
|
||||
|
||||
/* Data structure describing a single value and its code string. */
|
||||
typedef struct ct_data_s {
|
||||
union {
|
||||
ush freq; /* frequency count */
|
||||
ush code; /* bit string */
|
||||
} fc;
|
||||
union {
|
||||
ush dad; /* father node in Huffman tree */
|
||||
ush len; /* length of bit string */
|
||||
} dl;
|
||||
} FAR ct_data;
|
||||
|
||||
#define Freq fc.freq
|
||||
#define Code fc.code
|
||||
#define Dad dl.dad
|
||||
#define Len dl.len
|
||||
|
||||
typedef struct static_tree_desc_s static_tree_desc;
|
||||
|
||||
typedef struct tree_desc_s {
|
||||
ct_data *dyn_tree; /* the dynamic tree */
|
||||
int max_code; /* largest code with non zero frequency */
|
||||
static_tree_desc *stat_desc; /* the corresponding static tree */
|
||||
} FAR tree_desc;
|
||||
|
||||
typedef ush Pos;
|
||||
typedef Pos FAR Posf;
|
||||
typedef unsigned IPos;
|
||||
|
||||
/* A Pos is an index in the character window. We use short instead of int to
|
||||
* save space in the various tables. IPos is used only for parameter passing.
|
||||
*/
|
||||
|
||||
typedef struct internal_state {
|
||||
z_streamp strm; /* pointer back to this zlib stream */
|
||||
int status; /* as the name implies */
|
||||
Bytef *pending_buf; /* output still pending */
|
||||
ulg pending_buf_size; /* size of pending_buf */
|
||||
Bytef *pending_out; /* next pending byte to output to the stream */
|
||||
int pending; /* nb of bytes in the pending buffer */
|
||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
|
||||
Byte data_type; /* UNKNOWN, BINARY or ASCII */
|
||||
Byte method; /* STORED (for zip only) or DEFLATED */
|
||||
int last_flush; /* value of flush param for previous deflate call */
|
||||
|
||||
/* used by deflate.c: */
|
||||
|
||||
uInt w_size; /* LZ77 window size (32K by default) */
|
||||
uInt w_bits; /* log2(w_size) (8..16) */
|
||||
uInt w_mask; /* w_size - 1 */
|
||||
|
||||
Bytef *window;
|
||||
/* Sliding window. Input bytes are read into the second half of the window,
|
||||
* and move to the first half later to keep a dictionary of at least wSize
|
||||
* bytes. With this organization, matches are limited to a distance of
|
||||
* wSize-MAX_MATCH bytes, but this ensures that IO is always
|
||||
* performed with a length multiple of the block size. Also, it limits
|
||||
* the window size to 64K, which is quite useful on MSDOS.
|
||||
* To do: use the user input buffer as sliding window.
|
||||
*/
|
||||
|
||||
ulg window_size;
|
||||
/* Actual size of window: 2*wSize, except when the user input buffer
|
||||
* is directly used as sliding window.
|
||||
*/
|
||||
|
||||
Posf *prev;
|
||||
/* Link to older string with same hash index. To limit the size of this
|
||||
* array to 64K, this link is maintained only for the last 32K strings.
|
||||
* An index in this array is thus a window index modulo 32K.
|
||||
*/
|
||||
|
||||
Posf *head; /* Heads of the hash chains or NIL. */
|
||||
|
||||
uInt ins_h; /* hash index of string to be inserted */
|
||||
uInt hash_size; /* number of elements in hash table */
|
||||
uInt hash_bits; /* log2(hash_size) */
|
||||
uInt hash_mask; /* hash_size-1 */
|
||||
|
||||
uInt hash_shift;
|
||||
/* Number of bits by which ins_h must be shifted at each input
|
||||
* step. It must be such that after MIN_MATCH steps, the oldest
|
||||
* byte no longer takes part in the hash key, that is:
|
||||
* hash_shift * MIN_MATCH >= hash_bits
|
||||
*/
|
||||
|
||||
long block_start;
|
||||
/* Window position at the beginning of the current output block. Gets
|
||||
* negative when the window is moved backwards.
|
||||
*/
|
||||
|
||||
uInt match_length; /* length of best match */
|
||||
IPos prev_match; /* previous match */
|
||||
int match_available; /* set if previous match exists */
|
||||
uInt strstart; /* start of string to insert */
|
||||
uInt match_start; /* start of matching string */
|
||||
uInt lookahead; /* number of valid bytes ahead in window */
|
||||
|
||||
uInt prev_length;
|
||||
/* Length of the best match at previous step. Matches not greater than this
|
||||
* are discarded. This is used in the lazy match evaluation.
|
||||
*/
|
||||
|
||||
uInt max_chain_length;
|
||||
/* To speed up deflation, hash chains are never searched beyond this
|
||||
* length. A higher limit improves compression ratio but degrades the
|
||||
* speed.
|
||||
*/
|
||||
|
||||
uInt max_lazy_match;
|
||||
/* Attempt to find a better match only when the current match is strictly
|
||||
* smaller than this value. This mechanism is used only for compression
|
||||
* levels >= 4.
|
||||
*/
|
||||
# define max_insert_length max_lazy_match
|
||||
/* Insert new strings in the hash table only if the match length is not
|
||||
* greater than this length. This saves time but degrades compression.
|
||||
* max_insert_length is used only for compression levels <= 3.
|
||||
*/
|
||||
|
||||
int level; /* compression level (1..9) */
|
||||
int strategy; /* favor or force Huffman coding*/
|
||||
|
||||
uInt good_match;
|
||||
/* Use a faster search when the previous match is longer than this */
|
||||
|
||||
int nice_match; /* Stop searching when current match exceeds this */
|
||||
|
||||
/* used by trees.c: */
|
||||
/* Didn't use ct_data typedef below to supress compiler warning */
|
||||
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
|
||||
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
|
||||
struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
|
||||
|
||||
struct tree_desc_s l_desc; /* desc. for literal tree */
|
||||
struct tree_desc_s d_desc; /* desc. for distance tree */
|
||||
struct tree_desc_s bl_desc; /* desc. for bit length tree */
|
||||
|
||||
ush bl_count[MAX_BITS+1];
|
||||
/* number of codes at each bit length for an optimal tree */
|
||||
|
||||
int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
|
||||
int heap_len; /* number of elements in the heap */
|
||||
int heap_max; /* element of largest frequency */
|
||||
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
|
||||
* The same heap array is used to build all trees.
|
||||
*/
|
||||
|
||||
uch depth[2*L_CODES+1];
|
||||
/* Depth of each subtree used as tie breaker for trees of equal frequency
|
||||
*/
|
||||
|
||||
uchf *l_buf; /* buffer for literals or lengths */
|
||||
|
||||
uInt lit_bufsize;
|
||||
/* Size of match buffer for literals/lengths. There are 4 reasons for
|
||||
* limiting lit_bufsize to 64K:
|
||||
* - frequencies can be kept in 16 bit counters
|
||||
* - if compression is not successful for the first block, all input
|
||||
* data is still in the window so we can still emit a stored block even
|
||||
* when input comes from standard input. (This can also be done for
|
||||
* all blocks if lit_bufsize is not greater than 32K.)
|
||||
* - if compression is not successful for a file smaller than 64K, we can
|
||||
* even emit a stored file instead of a stored block (saving 5 bytes).
|
||||
* This is applicable only for zip (not gzip or zlib).
|
||||
* - creating new Huffman trees less frequently may not provide fast
|
||||
* adaptation to changes in the input data statistics. (Take for
|
||||
* example a binary file with poorly compressible code followed by
|
||||
* a highly compressible string table.) Smaller buffer sizes give
|
||||
* fast adaptation but have of course the overhead of transmitting
|
||||
* trees more frequently.
|
||||
* - I can't count above 4
|
||||
*/
|
||||
|
||||
uInt last_lit; /* running index in l_buf */
|
||||
|
||||
ushf *d_buf;
|
||||
/* Buffer for distances. To simplify the code, d_buf and l_buf have
|
||||
* the same number of elements. To use different lengths, an extra flag
|
||||
* array would be necessary.
|
||||
*/
|
||||
|
||||
ulg opt_len; /* bit length of current block with optimal trees */
|
||||
ulg static_len; /* bit length of current block with static trees */
|
||||
uInt matches; /* number of string matches in current block */
|
||||
int last_eob_len; /* bit length of EOB code for last block */
|
||||
|
||||
#ifdef DEBUG
|
||||
ulg compressed_len; /* total bit length of compressed file mod 2^32 */
|
||||
ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
|
||||
#endif
|
||||
|
||||
ush bi_buf;
|
||||
/* Output buffer. bits are inserted starting at the bottom (least
|
||||
* significant bits).
|
||||
*/
|
||||
int bi_valid;
|
||||
/* Number of valid bits in bi_buf. All bits above the last valid bit
|
||||
* are always zero.
|
||||
*/
|
||||
|
||||
} FAR deflate_state;
|
||||
|
||||
/* Output a byte on the stream.
|
||||
* IN assertion: there is enough room in pending_buf.
|
||||
*/
|
||||
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
|
||||
|
||||
|
||||
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
|
||||
/* Minimum amount of lookahead, except at the end of the input file.
|
||||
* See deflate.c for comments about the MIN_MATCH+1.
|
||||
*/
|
||||
|
||||
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
|
||||
/* In order to simplify the code, particularly on 16 bit machines, match
|
||||
* distances are limited to MAX_DIST instead of WSIZE.
|
||||
*/
|
||||
|
||||
/* in trees.c */
|
||||
void _tr_init OF((deflate_state *s));
|
||||
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
|
||||
void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
|
||||
int eof));
|
||||
void _tr_align OF((deflate_state *s));
|
||||
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
|
||||
int eof));
|
||||
|
||||
#define d_code(dist) \
|
||||
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
|
||||
/* Mapping from a distance to a distance code. dist is the distance - 1 and
|
||||
* must not have side effects. _dist_code[256] and _dist_code[257] are never
|
||||
* used.
|
||||
*/
|
||||
|
||||
#ifndef DEBUG
|
||||
/* Inline versions of _tr_tally for speed: */
|
||||
|
||||
#if defined(GEN_TREES_H) || !defined(STDC)
|
||||
extern uch _length_code[];
|
||||
extern uch _dist_code[];
|
||||
#else
|
||||
extern const uch _length_code[];
|
||||
extern const uch _dist_code[];
|
||||
#endif
|
||||
|
||||
# define _tr_tally_lit(s, c, flush) \
|
||||
{ uch cc = (c); \
|
||||
s->d_buf[s->last_lit] = 0; \
|
||||
s->l_buf[s->last_lit++] = cc; \
|
||||
s->dyn_ltree[cc].Freq++; \
|
||||
flush = (s->last_lit == s->lit_bufsize-1); \
|
||||
}
|
||||
# define _tr_tally_dist(s, distance, length, flush) \
|
||||
{ uch len = (length); \
|
||||
ush dist = (distance); \
|
||||
s->d_buf[s->last_lit] = dist; \
|
||||
s->l_buf[s->last_lit++] = len; \
|
||||
dist--; \
|
||||
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
|
||||
s->dyn_dtree[d_code(dist)].Freq++; \
|
||||
flush = (s->last_lit == s->lit_bufsize-1); \
|
||||
}
|
||||
#else
|
||||
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
|
||||
# define _tr_tally_dist(s, distance, length, flush) \
|
||||
flush = _tr_tally(s, distance, length)
|
||||
#endif
|
||||
|
||||
#endif /* DEFLATE_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,619 @@
|
|||
/* infback.c -- inflate using a call-back interface
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/*
|
||||
This code is largely copied from inflate.c. Normally either infback.o or
|
||||
inflate.o would be linked into an application--not both. The interface
|
||||
with inffast.c is retained so that optimized assembler-coded versions of
|
||||
inflate_fast() can be used with either inflate.c or infback.c.
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "inftrees.h"
|
||||
#include "inflate.h"
|
||||
#include "inffast.h"
|
||||
|
||||
/* function prototypes */
|
||||
local void fixedtables OF((struct inflate_state FAR *state));
|
||||
|
||||
/*
|
||||
strm provides memory allocation functions in zalloc and zfree, or
|
||||
Z_NULL to use the library memory allocation functions.
|
||||
|
||||
windowBits is in the range 8..15, and window is a user-supplied
|
||||
window and output buffer that is 2**windowBits bytes.
|
||||
*/
|
||||
int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
|
||||
z_stream FAR *strm;
|
||||
int windowBits;
|
||||
unsigned char FAR *window;
|
||||
const char *version;
|
||||
int stream_size;
|
||||
{
|
||||
struct inflate_state FAR *state;
|
||||
|
||||
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
|
||||
stream_size != (int)(sizeof(z_stream)))
|
||||
return Z_VERSION_ERROR;
|
||||
if (strm == Z_NULL || window == Z_NULL ||
|
||||
windowBits < 8 || windowBits > 15)
|
||||
return Z_STREAM_ERROR;
|
||||
strm->msg = Z_NULL; /* in case we return an error */
|
||||
if (strm->zalloc == (alloc_func)0) {
|
||||
strm->zalloc = zcalloc;
|
||||
strm->opaque = (voidpf)0;
|
||||
}
|
||||
if (strm->zfree == (free_func)0) strm->zfree = zcfree;
|
||||
state = (struct inflate_state FAR *)ZALLOC(strm, 1,
|
||||
sizeof(struct inflate_state));
|
||||
if (state == Z_NULL) return Z_MEM_ERROR;
|
||||
Tracev((stderr, "inflate: allocated\n"));
|
||||
strm->state = (voidpf)state;
|
||||
state->wbits = windowBits;
|
||||
state->wsize = 1U << windowBits;
|
||||
state->window = window;
|
||||
state->write = 0;
|
||||
state->whave = 0;
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
Return state with length and distance decoding tables and index sizes set to
|
||||
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
||||
If BUILDFIXED is defined, then instead this routine builds the tables the
|
||||
first time it's called, and returns those tables the first time and
|
||||
thereafter. This reduces the size of the code by about 2K bytes, in
|
||||
exchange for a little execution time. However, BUILDFIXED should not be
|
||||
used for threaded applications, since the rewriting of the tables and virgin
|
||||
may not be thread-safe.
|
||||
*/
|
||||
local void fixedtables(state)
|
||||
struct inflate_state FAR *state;
|
||||
{
|
||||
#ifdef BUILDFIXED
|
||||
static int virgin = 1;
|
||||
static code *lenfix, *distfix;
|
||||
static code fixed[544];
|
||||
|
||||
/* build fixed huffman tables if first call (may not be thread safe) */
|
||||
if (virgin) {
|
||||
unsigned sym, bits;
|
||||
static code *next;
|
||||
|
||||
/* literal/length table */
|
||||
sym = 0;
|
||||
while (sym < 144) state->lens[sym++] = 8;
|
||||
while (sym < 256) state->lens[sym++] = 9;
|
||||
while (sym < 280) state->lens[sym++] = 7;
|
||||
while (sym < 288) state->lens[sym++] = 8;
|
||||
next = fixed;
|
||||
lenfix = next;
|
||||
bits = 9;
|
||||
inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
|
||||
|
||||
/* distance table */
|
||||
sym = 0;
|
||||
while (sym < 32) state->lens[sym++] = 5;
|
||||
distfix = next;
|
||||
bits = 5;
|
||||
inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
|
||||
|
||||
/* do this just once */
|
||||
virgin = 0;
|
||||
}
|
||||
#else /* !BUILDFIXED */
|
||||
# include "inffixed.h"
|
||||
#endif /* BUILDFIXED */
|
||||
state->lencode = lenfix;
|
||||
state->lenbits = 9;
|
||||
state->distcode = distfix;
|
||||
state->distbits = 5;
|
||||
}
|
||||
|
||||
/* Macros for inflateBack(): */
|
||||
|
||||
/* Load returned state from inflate_fast() */
|
||||
#define LOAD() \
|
||||
do { \
|
||||
put = strm->next_out; \
|
||||
left = strm->avail_out; \
|
||||
next = strm->next_in; \
|
||||
have = strm->avail_in; \
|
||||
hold = state->hold; \
|
||||
bits = state->bits; \
|
||||
} while (0)
|
||||
|
||||
/* Set state from registers for inflate_fast() */
|
||||
#define RESTORE() \
|
||||
do { \
|
||||
strm->next_out = put; \
|
||||
strm->avail_out = left; \
|
||||
strm->next_in = next; \
|
||||
strm->avail_in = have; \
|
||||
state->hold = hold; \
|
||||
state->bits = bits; \
|
||||
} while (0)
|
||||
|
||||
/* Clear the input bit accumulator */
|
||||
#define INITBITS() \
|
||||
do { \
|
||||
hold = 0; \
|
||||
bits = 0; \
|
||||
} while (0)
|
||||
|
||||
/* Assure that some input is available. If input is requested, but denied,
|
||||
then return a Z_BUF_ERROR from inflateBack(). */
|
||||
#define PULL() \
|
||||
do { \
|
||||
if (have == 0) { \
|
||||
have = in(in_desc, &next); \
|
||||
if (have == 0) { \
|
||||
next = Z_NULL; \
|
||||
ret = Z_BUF_ERROR; \
|
||||
goto inf_leave; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Get a byte of input into the bit accumulator, or return from inflateBack()
|
||||
with an error if there is no input available. */
|
||||
#define PULLBYTE() \
|
||||
do { \
|
||||
PULL(); \
|
||||
have--; \
|
||||
hold += (unsigned long)(*next++) << bits; \
|
||||
bits += 8; \
|
||||
} while (0)
|
||||
|
||||
/* Assure that there are at least n bits in the bit accumulator. If there is
|
||||
not enough available input to do that, then return from inflateBack() with
|
||||
an error. */
|
||||
#define NEEDBITS(n) \
|
||||
do { \
|
||||
while (bits < (unsigned)(n)) \
|
||||
PULLBYTE(); \
|
||||
} while (0)
|
||||
|
||||
/* Return the low n bits of the bit accumulator (n < 16) */
|
||||
#define BITS(n) \
|
||||
((unsigned)hold & ((1U << (n)) - 1))
|
||||
|
||||
/* Remove n bits from the bit accumulator */
|
||||
#define DROPBITS(n) \
|
||||
do { \
|
||||
hold >>= (n); \
|
||||
bits -= (unsigned)(n); \
|
||||
} while (0)
|
||||
|
||||
/* Remove zero to seven bits as needed to go to a byte boundary */
|
||||
#define BYTEBITS() \
|
||||
do { \
|
||||
hold >>= bits & 7; \
|
||||
bits -= bits & 7; \
|
||||
} while (0)
|
||||
|
||||
/* Assure that some output space is available, by writing out the window
|
||||
if it's full. If the write fails, return from inflateBack() with a
|
||||
Z_BUF_ERROR. */
|
||||
#define ROOM() \
|
||||
do { \
|
||||
if (left == 0) { \
|
||||
put = state->window; \
|
||||
left = state->wsize; \
|
||||
state->whave = left; \
|
||||
if (out(out_desc, put, left)) { \
|
||||
ret = Z_BUF_ERROR; \
|
||||
goto inf_leave; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
strm provides the memory allocation functions and window buffer on input,
|
||||
and provides information on the unused input on return. For Z_DATA_ERROR
|
||||
returns, strm will also provide an error message.
|
||||
|
||||
in() and out() are the call-back input and output functions. When
|
||||
inflateBack() needs more input, it calls in(). When inflateBack() has
|
||||
filled the window with output, or when it completes with data in the
|
||||
window, it calls out() to write out the data. The application must not
|
||||
change the provided input until in() is called again or inflateBack()
|
||||
returns. The application must not change the window/output buffer until
|
||||
inflateBack() returns.
|
||||
|
||||
in() and out() are called with a descriptor parameter provided in the
|
||||
inflateBack() call. This parameter can be a structure that provides the
|
||||
information required to do the read or write, as well as accumulated
|
||||
information on the input and output such as totals and check values.
|
||||
|
||||
in() should return zero on failure. out() should return non-zero on
|
||||
failure. If either in() or out() fails, than inflateBack() returns a
|
||||
Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
|
||||
was in() or out() that caused in the error. Otherwise, inflateBack()
|
||||
returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
|
||||
error, or Z_MEM_ERROR if it could not allocate memory for the state.
|
||||
inflateBack() can also return Z_STREAM_ERROR if the input parameters
|
||||
are not correct, i.e. strm is Z_NULL or the state was not initialized.
|
||||
*/
|
||||
int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
|
||||
z_stream FAR *strm;
|
||||
in_func in;
|
||||
void FAR *in_desc;
|
||||
out_func out;
|
||||
void FAR *out_desc;
|
||||
{
|
||||
struct inflate_state FAR *state;
|
||||
unsigned char FAR *next; /* next input */
|
||||
unsigned char FAR *put; /* next output */
|
||||
unsigned have, left; /* available input and output */
|
||||
unsigned long hold; /* bit buffer */
|
||||
unsigned bits; /* bits in bit buffer */
|
||||
unsigned copy; /* number of stored or match bytes to copy */
|
||||
unsigned char FAR *from; /* where to copy match bytes from */
|
||||
code this; /* current decoding table entry */
|
||||
code last; /* parent table entry */
|
||||
unsigned len; /* length to copy for repeats, bits to drop */
|
||||
int ret; /* return code */
|
||||
static const unsigned short order[19] = /* permutation of code lengths */
|
||||
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
|
||||
/* Check that the strm exists and that the state was initialized */
|
||||
if (strm == Z_NULL || strm->state == Z_NULL)
|
||||
return Z_STREAM_ERROR;
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
|
||||
/* Reset the state */
|
||||
strm->msg = Z_NULL;
|
||||
state->mode = TYPE;
|
||||
state->last = 0;
|
||||
state->whave = 0;
|
||||
next = strm->next_in;
|
||||
have = next != Z_NULL ? strm->avail_in : 0;
|
||||
hold = 0;
|
||||
bits = 0;
|
||||
put = state->window;
|
||||
left = state->wsize;
|
||||
|
||||
/* Inflate until end of block marked as last */
|
||||
for (;;)
|
||||
switch (state->mode) {
|
||||
case TYPE:
|
||||
/* determine and dispatch block type */
|
||||
if (state->last) {
|
||||
BYTEBITS();
|
||||
state->mode = DONE;
|
||||
break;
|
||||
}
|
||||
NEEDBITS(3);
|
||||
state->last = BITS(1);
|
||||
DROPBITS(1);
|
||||
switch (BITS(2)) {
|
||||
case 0: /* stored block */
|
||||
Tracev((stderr, "inflate: stored block%s\n",
|
||||
state->last ? " (last)" : ""));
|
||||
state->mode = STORED;
|
||||
break;
|
||||
case 1: /* fixed block */
|
||||
fixedtables(state);
|
||||
Tracev((stderr, "inflate: fixed codes block%s\n",
|
||||
state->last ? " (last)" : ""));
|
||||
state->mode = LEN; /* decode codes */
|
||||
break;
|
||||
case 2: /* dynamic block */
|
||||
Tracev((stderr, "inflate: dynamic codes block%s\n",
|
||||
state->last ? " (last)" : ""));
|
||||
state->mode = TABLE;
|
||||
break;
|
||||
case 3:
|
||||
strm->msg = (char *)"invalid block type";
|
||||
state->mode = BAD;
|
||||
}
|
||||
DROPBITS(2);
|
||||
break;
|
||||
|
||||
case STORED:
|
||||
/* get and verify stored block length */
|
||||
BYTEBITS(); /* go to byte boundary */
|
||||
NEEDBITS(32);
|
||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||
strm->msg = (char *)"invalid stored block lengths";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
state->length = (unsigned)hold & 0xffff;
|
||||
Tracev((stderr, "inflate: stored length %u\n",
|
||||
state->length));
|
||||
INITBITS();
|
||||
|
||||
/* copy stored block from input to output */
|
||||
while (state->length != 0) {
|
||||
copy = state->length;
|
||||
PULL();
|
||||
ROOM();
|
||||
if (copy > have) copy = have;
|
||||
if (copy > left) copy = left;
|
||||
zmemcpy(put, next, copy);
|
||||
have -= copy;
|
||||
next += copy;
|
||||
left -= copy;
|
||||
put += copy;
|
||||
state->length -= copy;
|
||||
}
|
||||
Tracev((stderr, "inflate: stored end\n"));
|
||||
state->mode = TYPE;
|
||||
break;
|
||||
|
||||
case TABLE:
|
||||
/* get dynamic table entries descriptor */
|
||||
NEEDBITS(14);
|
||||
state->nlen = BITS(5) + 257;
|
||||
DROPBITS(5);
|
||||
state->ndist = BITS(5) + 1;
|
||||
DROPBITS(5);
|
||||
state->ncode = BITS(4) + 4;
|
||||
DROPBITS(4);
|
||||
#ifndef PKZIP_BUG_WORKAROUND
|
||||
if (state->nlen > 286 || state->ndist > 30) {
|
||||
strm->msg = (char *)"too many length or distance symbols";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
Tracev((stderr, "inflate: table sizes ok\n"));
|
||||
|
||||
/* get code length code lengths (not a typo) */
|
||||
state->have = 0;
|
||||
while (state->have < state->ncode) {
|
||||
NEEDBITS(3);
|
||||
state->lens[order[state->have++]] = (unsigned short)BITS(3);
|
||||
DROPBITS(3);
|
||||
}
|
||||
while (state->have < 19)
|
||||
state->lens[order[state->have++]] = 0;
|
||||
state->next = state->codes;
|
||||
state->lencode = (code const FAR *)(state->next);
|
||||
state->lenbits = 7;
|
||||
ret = inflate_table(CODES, state->lens, 19, &(state->next),
|
||||
&(state->lenbits), state->work);
|
||||
if (ret) {
|
||||
strm->msg = (char *)"invalid code lengths set";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
Tracev((stderr, "inflate: code lengths ok\n"));
|
||||
|
||||
/* get length and distance code code lengths */
|
||||
state->have = 0;
|
||||
while (state->have < state->nlen + state->ndist) {
|
||||
for (;;) {
|
||||
this = state->lencode[BITS(state->lenbits)];
|
||||
if ((unsigned)(this.bits) <= bits) break;
|
||||
PULLBYTE();
|
||||
}
|
||||
if (this.val < 16) {
|
||||
NEEDBITS(this.bits);
|
||||
DROPBITS(this.bits);
|
||||
state->lens[state->have++] = this.val;
|
||||
}
|
||||
else {
|
||||
if (this.val == 16) {
|
||||
NEEDBITS(this.bits + 2);
|
||||
DROPBITS(this.bits);
|
||||
if (state->have == 0) {
|
||||
strm->msg = (char *)"invalid bit length repeat";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
len = (unsigned)(state->lens[state->have - 1]);
|
||||
copy = 3 + BITS(2);
|
||||
DROPBITS(2);
|
||||
}
|
||||
else if (this.val == 17) {
|
||||
NEEDBITS(this.bits + 3);
|
||||
DROPBITS(this.bits);
|
||||
len = 0;
|
||||
copy = 3 + BITS(3);
|
||||
DROPBITS(3);
|
||||
}
|
||||
else {
|
||||
NEEDBITS(this.bits + 7);
|
||||
DROPBITS(this.bits);
|
||||
len = 0;
|
||||
copy = 11 + BITS(7);
|
||||
DROPBITS(7);
|
||||
}
|
||||
if (state->have + copy > state->nlen + state->ndist) {
|
||||
strm->msg = (char *)"invalid bit length repeat";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
while (copy--)
|
||||
state->lens[state->have++] = (unsigned short)len;
|
||||
}
|
||||
}
|
||||
|
||||
/* build code tables */
|
||||
state->next = state->codes;
|
||||
state->lencode = (code const FAR *)(state->next);
|
||||
state->lenbits = 9;
|
||||
ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
|
||||
&(state->lenbits), state->work);
|
||||
if (ret) {
|
||||
strm->msg = (char *)"invalid literal/lengths set";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
state->distcode = (code const FAR *)(state->next);
|
||||
state->distbits = 6;
|
||||
ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
|
||||
&(state->next), &(state->distbits), state->work);
|
||||
if (ret) {
|
||||
strm->msg = (char *)"invalid distances set";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
Tracev((stderr, "inflate: codes ok\n"));
|
||||
state->mode = LEN;
|
||||
|
||||
case LEN:
|
||||
/* use inflate_fast() if we have enough input and output */
|
||||
if (have >= 6 && left >= 258) {
|
||||
RESTORE();
|
||||
if (state->whave < state->wsize)
|
||||
state->whave = state->wsize - left;
|
||||
inflate_fast(strm, state->wsize);
|
||||
LOAD();
|
||||
break;
|
||||
}
|
||||
|
||||
/* get a literal, length, or end-of-block code */
|
||||
for (;;) {
|
||||
this = state->lencode[BITS(state->lenbits)];
|
||||
if ((unsigned)(this.bits) <= bits) break;
|
||||
PULLBYTE();
|
||||
}
|
||||
if (this.op && (this.op & 0xf0) == 0) {
|
||||
last = this;
|
||||
for (;;) {
|
||||
this = state->lencode[last.val +
|
||||
(BITS(last.bits + last.op) >> last.bits)];
|
||||
if ((unsigned)(last.bits + this.bits) <= bits) break;
|
||||
PULLBYTE();
|
||||
}
|
||||
DROPBITS(last.bits);
|
||||
}
|
||||
DROPBITS(this.bits);
|
||||
state->length = (unsigned)this.val;
|
||||
|
||||
/* process literal */
|
||||
if (this.op == 0) {
|
||||
Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
|
||||
"inflate: literal '%c'\n" :
|
||||
"inflate: literal 0x%02x\n", this.val));
|
||||
ROOM();
|
||||
*put++ = (unsigned char)(state->length);
|
||||
left--;
|
||||
state->mode = LEN;
|
||||
break;
|
||||
}
|
||||
|
||||
/* process end of block */
|
||||
if (this.op & 32) {
|
||||
Tracevv((stderr, "inflate: end of block\n"));
|
||||
state->mode = TYPE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* invalid code */
|
||||
if (this.op & 64) {
|
||||
strm->msg = (char *)"invalid literal/length code";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
|
||||
/* length code -- get extra bits, if any */
|
||||
state->extra = (unsigned)(this.op) & 15;
|
||||
if (state->extra != 0) {
|
||||
NEEDBITS(state->extra);
|
||||
state->length += BITS(state->extra);
|
||||
DROPBITS(state->extra);
|
||||
}
|
||||
Tracevv((stderr, "inflate: length %u\n", state->length));
|
||||
|
||||
/* get distance code */
|
||||
for (;;) {
|
||||
this = state->distcode[BITS(state->distbits)];
|
||||
if ((unsigned)(this.bits) <= bits) break;
|
||||
PULLBYTE();
|
||||
}
|
||||
if ((this.op & 0xf0) == 0) {
|
||||
last = this;
|
||||
for (;;) {
|
||||
this = state->distcode[last.val +
|
||||
(BITS(last.bits + last.op) >> last.bits)];
|
||||
if ((unsigned)(last.bits + this.bits) <= bits) break;
|
||||
PULLBYTE();
|
||||
}
|
||||
DROPBITS(last.bits);
|
||||
}
|
||||
DROPBITS(this.bits);
|
||||
if (this.op & 64) {
|
||||
strm->msg = (char *)"invalid distance code";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
state->offset = (unsigned)this.val;
|
||||
|
||||
/* get distance extra bits, if any */
|
||||
state->extra = (unsigned)(this.op) & 15;
|
||||
if (state->extra != 0) {
|
||||
NEEDBITS(state->extra);
|
||||
state->offset += BITS(state->extra);
|
||||
DROPBITS(state->extra);
|
||||
}
|
||||
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
||||
left : 0)) {
|
||||
strm->msg = (char *)"invalid distance too far back";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
||||
|
||||
/* copy match from window to output */
|
||||
do {
|
||||
ROOM();
|
||||
copy = state->wsize - state->offset;
|
||||
if (copy < left) {
|
||||
from = put + copy;
|
||||
copy = left - copy;
|
||||
}
|
||||
else {
|
||||
from = put - state->offset;
|
||||
copy = left;
|
||||
}
|
||||
if (copy > state->length) copy = state->length;
|
||||
state->length -= copy;
|
||||
left -= copy;
|
||||
do {
|
||||
*put++ = *from++;
|
||||
} while (--copy);
|
||||
} while (state->length != 0);
|
||||
break;
|
||||
|
||||
case DONE:
|
||||
/* inflate stream terminated properly -- write leftover output */
|
||||
ret = Z_STREAM_END;
|
||||
if (left < state->wsize) {
|
||||
if (out(out_desc, state->window, state->wsize - left))
|
||||
ret = Z_BUF_ERROR;
|
||||
}
|
||||
goto inf_leave;
|
||||
|
||||
case BAD:
|
||||
ret = Z_DATA_ERROR;
|
||||
goto inf_leave;
|
||||
|
||||
default: /* can't happen, but makes compilers happy */
|
||||
ret = Z_STREAM_ERROR;
|
||||
goto inf_leave;
|
||||
}
|
||||
|
||||
/* Return unused input */
|
||||
inf_leave:
|
||||
strm->next_in = next;
|
||||
strm->avail_in = have;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZEXPORT inflateBackEnd(strm)
|
||||
z_stream FAR *strm;
|
||||
{
|
||||
if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
|
||||
return Z_STREAM_ERROR;
|
||||
ZFREE(strm, strm->state);
|
||||
strm->state = Z_NULL;
|
||||
Tracev((stderr, "inflate: end\n"));
|
||||
return Z_OK;
|
||||
}
|
|
@ -0,0 +1,305 @@
|
|||
/* inffast.c -- fast decoding
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "inftrees.h"
|
||||
#include "inflate.h"
|
||||
#include "inffast.h"
|
||||
|
||||
#ifndef ASMINF
|
||||
|
||||
/* Allow machine dependent optimization for post-increment or pre-increment.
|
||||
Based on testing to date,
|
||||
Pre-increment preferred for:
|
||||
- PowerPC G3 (Adler)
|
||||
- MIPS R5000 (Randers-Pehrson)
|
||||
Post-increment preferred for:
|
||||
- none
|
||||
No measurable difference:
|
||||
- Pentium III (Anderson)
|
||||
- 68060 (Nikl)
|
||||
*/
|
||||
#ifdef POSTINC
|
||||
# define OFF 0
|
||||
# define PUP(a) *(a)++
|
||||
#else
|
||||
# define OFF 1
|
||||
# define PUP(a) *++(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Decode literal, length, and distance codes and write out the resulting
|
||||
literal and match bytes until either not enough input or output is
|
||||
available, an end-of-block is encountered, or a data error is encountered.
|
||||
When large enough input and output buffers are supplied to inflate(), for
|
||||
example, a 16K input buffer and a 64K output buffer, more than 95% of the
|
||||
inflate execution time is spent in this routine.
|
||||
|
||||
Entry assumptions:
|
||||
|
||||
state->mode == LEN
|
||||
strm->avail_in >= 6
|
||||
strm->avail_out >= 258
|
||||
start >= strm->avail_out
|
||||
state->bits < 8
|
||||
|
||||
On return, state->mode is one of:
|
||||
|
||||
LEN -- ran out of enough output space or enough available input
|
||||
TYPE -- reached end of block code, inflate() to interpret next block
|
||||
BAD -- error in block data
|
||||
|
||||
Notes:
|
||||
|
||||
- The maximum input bits used by a length/distance pair is 15 bits for the
|
||||
length code, 5 bits for the length extra, 15 bits for the distance code,
|
||||
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
|
||||
Therefore if strm->avail_in >= 6, then there is enough input to avoid
|
||||
checking for available input while decoding.
|
||||
|
||||
- The maximum bytes that a single length/distance pair can output is 258
|
||||
bytes, which is the maximum length that can be coded. inflate_fast()
|
||||
requires strm->avail_out >= 258 for each loop to avoid checking for
|
||||
output space.
|
||||
*/
|
||||
void inflate_fast(strm, start)
|
||||
z_streamp strm;
|
||||
unsigned start; /* inflate()'s starting value for strm->avail_out */
|
||||
{
|
||||
struct inflate_state FAR *state;
|
||||
unsigned char FAR *in; /* local strm->next_in */
|
||||
unsigned char FAR *last; /* while in < last, enough input available */
|
||||
unsigned char FAR *out; /* local strm->next_out */
|
||||
unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
|
||||
unsigned char FAR *end; /* while out < end, enough space available */
|
||||
unsigned wsize; /* window size or zero if not using window */
|
||||
unsigned whave; /* valid bytes in the window */
|
||||
unsigned write; /* window write index */
|
||||
unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
|
||||
unsigned long hold; /* local strm->hold */
|
||||
unsigned bits; /* local strm->bits */
|
||||
code const FAR *lcode; /* local strm->lencode */
|
||||
code const FAR *dcode; /* local strm->distcode */
|
||||
unsigned lmask; /* mask for first level of length codes */
|
||||
unsigned dmask; /* mask for first level of distance codes */
|
||||
code this; /* retrieved table entry */
|
||||
unsigned op; /* code bits, operation, extra bits, or */
|
||||
/* window position, window bytes to copy */
|
||||
unsigned len; /* match length, unused bytes */
|
||||
unsigned dist; /* match distance */
|
||||
unsigned char FAR *from; /* where to copy match from */
|
||||
|
||||
/* copy state to local variables */
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
in = strm->next_in - OFF;
|
||||
last = in + (strm->avail_in - 5);
|
||||
out = strm->next_out - OFF;
|
||||
beg = out - (start - strm->avail_out);
|
||||
end = out + (strm->avail_out - 257);
|
||||
wsize = state->wsize;
|
||||
whave = state->whave;
|
||||
write = state->write;
|
||||
window = state->window;
|
||||
hold = state->hold;
|
||||
bits = state->bits;
|
||||
lcode = state->lencode;
|
||||
dcode = state->distcode;
|
||||
lmask = (1U << state->lenbits) - 1;
|
||||
dmask = (1U << state->distbits) - 1;
|
||||
|
||||
/* decode literals and length/distances until end-of-block or not enough
|
||||
input data or output space */
|
||||
do {
|
||||
if (bits < 15) {
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
}
|
||||
this = lcode[hold & lmask];
|
||||
dolen:
|
||||
op = (unsigned)(this.bits);
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
op = (unsigned)(this.op);
|
||||
if (op == 0) { /* literal */
|
||||
Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
|
||||
"inflate: literal '%c'\n" :
|
||||
"inflate: literal 0x%02x\n", this.val));
|
||||
PUP(out) = (unsigned char)(this.val);
|
||||
}
|
||||
else if (op & 16) { /* length base */
|
||||
len = (unsigned)(this.val);
|
||||
op &= 15; /* number of extra bits */
|
||||
if (op) {
|
||||
if (bits < op) {
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
}
|
||||
len += (unsigned)hold & ((1U << op) - 1);
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
}
|
||||
Tracevv((stderr, "inflate: length %u\n", len));
|
||||
if (bits < 15) {
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
}
|
||||
this = dcode[hold & dmask];
|
||||
dodist:
|
||||
op = (unsigned)(this.bits);
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
op = (unsigned)(this.op);
|
||||
if (op & 16) { /* distance base */
|
||||
dist = (unsigned)(this.val);
|
||||
op &= 15; /* number of extra bits */
|
||||
if (bits < op) {
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
if (bits < op) {
|
||||
hold += (unsigned long)(PUP(in)) << bits;
|
||||
bits += 8;
|
||||
}
|
||||
}
|
||||
dist += (unsigned)hold & ((1U << op) - 1);
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
Tracevv((stderr, "inflate: distance %u\n", dist));
|
||||
op = (unsigned)(out - beg); /* max distance in output */
|
||||
if (dist > op) { /* see if copy from window */
|
||||
op = dist - op; /* distance back in window */
|
||||
if (op > whave) {
|
||||
strm->msg = (char *)"invalid distance too far back";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
from = window - OFF;
|
||||
if (write == 0) { /* very common case */
|
||||
from += wsize - op;
|
||||
if (op < len) { /* some from window */
|
||||
len -= op;
|
||||
do {
|
||||
PUP(out) = PUP(from);
|
||||
} while (--op);
|
||||
from = out - dist; /* rest from output */
|
||||
}
|
||||
}
|
||||
else if (write < op) { /* wrap around window */
|
||||
from += wsize + write - op;
|
||||
op -= write;
|
||||
if (op < len) { /* some from end of window */
|
||||
len -= op;
|
||||
do {
|
||||
PUP(out) = PUP(from);
|
||||
} while (--op);
|
||||
from = window - OFF;
|
||||
if (write < len) { /* some from start of window */
|
||||
op = write;
|
||||
len -= op;
|
||||
do {
|
||||
PUP(out) = PUP(from);
|
||||
} while (--op);
|
||||
from = out - dist; /* rest from output */
|
||||
}
|
||||
}
|
||||
}
|
||||
else { /* contiguous in window */
|
||||
from += write - op;
|
||||
if (op < len) { /* some from window */
|
||||
len -= op;
|
||||
do {
|
||||
PUP(out) = PUP(from);
|
||||
} while (--op);
|
||||
from = out - dist; /* rest from output */
|
||||
}
|
||||
}
|
||||
while (len > 2) {
|
||||
PUP(out) = PUP(from);
|
||||
PUP(out) = PUP(from);
|
||||
PUP(out) = PUP(from);
|
||||
len -= 3;
|
||||
}
|
||||
if (len) {
|
||||
PUP(out) = PUP(from);
|
||||
if (len > 1)
|
||||
PUP(out) = PUP(from);
|
||||
}
|
||||
}
|
||||
else {
|
||||
from = out - dist; /* copy direct from output */
|
||||
do { /* minimum length is three */
|
||||
PUP(out) = PUP(from);
|
||||
PUP(out) = PUP(from);
|
||||
PUP(out) = PUP(from);
|
||||
len -= 3;
|
||||
} while (len > 2);
|
||||
if (len) {
|
||||
PUP(out) = PUP(from);
|
||||
if (len > 1)
|
||||
PUP(out) = PUP(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((op & 64) == 0) { /* 2nd level distance code */
|
||||
this = dcode[this.val + (hold & ((1U << op) - 1))];
|
||||
goto dodist;
|
||||
}
|
||||
else {
|
||||
strm->msg = (char *)"invalid distance code";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((op & 64) == 0) { /* 2nd level length code */
|
||||
this = lcode[this.val + (hold & ((1U << op) - 1))];
|
||||
goto dolen;
|
||||
}
|
||||
else if (op & 32) { /* end-of-block */
|
||||
Tracevv((stderr, "inflate: end of block\n"));
|
||||
state->mode = TYPE;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
strm->msg = (char *)"invalid literal/length code";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
}
|
||||
} while (in < last && out < end);
|
||||
|
||||
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
|
||||
len = bits >> 3;
|
||||
in -= len;
|
||||
bits -= len << 3;
|
||||
hold &= (1U << bits) - 1;
|
||||
|
||||
/* update state and return */
|
||||
strm->next_in = in + OFF;
|
||||
strm->next_out = out + OFF;
|
||||
strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
|
||||
strm->avail_out = (unsigned)(out < end ?
|
||||
257 + (end - out) : 257 - (out - end));
|
||||
state->hold = hold;
|
||||
state->bits = bits;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
|
||||
- Using bit fields for code structure
|
||||
- Different op definition to avoid & for extra bits (do & for table bits)
|
||||
- Three separate decoding do-loops for direct, window, and write == 0
|
||||
- Special case for distance > 1 copies to do overlapped load and store copy
|
||||
- Explicit branch predictions (based on measured branch probabilities)
|
||||
- Deferring match copy and interspersed it with decoding subsequent codes
|
||||
- Swapping literal/length else
|
||||
- Swapping window/direct else
|
||||
- Larger unrolled copy loops (three is about right)
|
||||
- Moving len -= 3 statement into middle of loop
|
||||
*/
|
||||
|
||||
#endif /* !ASMINF */
|
|
@ -0,0 +1,11 @@
|
|||
/* inffast.h -- header to use inffast.c
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
void inflate_fast OF((z_streamp strm, unsigned start));
|
|
@ -0,0 +1,94 @@
|
|||
/* inffixed.h -- table for decoding fixed codes
|
||||
* Generated automatically by makefixed().
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It
|
||||
is part of the implementation of the compression library and
|
||||
is subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
static const code lenfix[512] = {
|
||||
{96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
|
||||
{0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
|
||||
{0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
|
||||
{0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
|
||||
{0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
|
||||
{21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
|
||||
{0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
|
||||
{0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
|
||||
{18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
|
||||
{0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
|
||||
{0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
|
||||
{0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
|
||||
{20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
|
||||
{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
|
||||
{0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
|
||||
{0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
|
||||
{16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
|
||||
{0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
|
||||
{0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
|
||||
{0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
|
||||
{0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
|
||||
{0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
|
||||
{0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
|
||||
{0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
|
||||
{17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
|
||||
{0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
|
||||
{0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
|
||||
{0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
|
||||
{19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
|
||||
{0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
|
||||
{0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
|
||||
{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
|
||||
{16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
|
||||
{0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
|
||||
{0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
|
||||
{0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
|
||||
{0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
|
||||
{20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
|
||||
{0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
|
||||
{0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
|
||||
{17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
|
||||
{0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
|
||||
{0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
|
||||
{0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
|
||||
{20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
|
||||
{0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
|
||||
{0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
|
||||
{0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
|
||||
{16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
|
||||
{0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
|
||||
{0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
|
||||
{0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
|
||||
{0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
|
||||
{0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
|
||||
{0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
|
||||
{0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
|
||||
{16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
|
||||
{0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
|
||||
{0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
|
||||
{0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
|
||||
{19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
|
||||
{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
|
||||
{0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
|
||||
{0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
|
||||
{16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
|
||||
{0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
|
||||
{0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
|
||||
{0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
|
||||
{0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
|
||||
{64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
|
||||
{0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
|
||||
{0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
|
||||
{18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
|
||||
{0,9,255}
|
||||
};
|
||||
|
||||
static const code distfix[32] = {
|
||||
{16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
|
||||
{21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
|
||||
{18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
|
||||
{19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
|
||||
{16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
|
||||
{22,5,193},{64,5,0}
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,117 @@
|
|||
/* inflate.h -- internal inflate state definition
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* define NO_GZIP when compiling if you want to disable gzip header and
|
||||
trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
|
||||
the crc code when it is not needed. For shared libraries, gzip decoding
|
||||
should be left enabled. */
|
||||
#ifndef NO_GZIP
|
||||
# define GUNZIP
|
||||
#endif
|
||||
|
||||
/* Possible inflate modes between inflate() calls */
|
||||
typedef enum {
|
||||
HEAD, /* i: waiting for magic header */
|
||||
#ifdef GUNZIP
|
||||
FLAGS, /* i: waiting for method and flags (gzip) */
|
||||
TIME, /* i: waiting for modification time (gzip) */
|
||||
OS, /* i: waiting for extra flags and operating system (gzip) */
|
||||
EXLEN, /* i: waiting for extra length (gzip) */
|
||||
EXTRA, /* i: waiting for extra bytes (gzip) */
|
||||
NAME, /* i: waiting for end of file name (gzip) */
|
||||
COMMENT, /* i: waiting for end of comment (gzip) */
|
||||
HCRC, /* i: waiting for header crc (gzip) */
|
||||
#endif
|
||||
DICTID, /* i: waiting for dictionary check value */
|
||||
DICT, /* waiting for inflateSetDictionary() call */
|
||||
TYPE, /* i: waiting for type bits, including last-flag bit */
|
||||
TYPEDO, /* i: same, but skip check to exit inflate on new block */
|
||||
STORED, /* i: waiting for stored size (length and complement) */
|
||||
COPY, /* i/o: waiting for input or output to copy stored block */
|
||||
TABLE, /* i: waiting for dynamic block table lengths */
|
||||
LENLENS, /* i: waiting for code length code lengths */
|
||||
CODELENS, /* i: waiting for length/lit and distance code lengths */
|
||||
LEN, /* i: waiting for length/lit code */
|
||||
LENEXT, /* i: waiting for length extra bits */
|
||||
DIST, /* i: waiting for distance code */
|
||||
DISTEXT, /* i: waiting for distance extra bits */
|
||||
MATCH, /* o: waiting for output space to copy string */
|
||||
LIT, /* o: waiting for output space to write literal */
|
||||
CHECK, /* i: waiting for 32-bit check value */
|
||||
#ifdef GUNZIP
|
||||
LENGTH, /* i: waiting for 32-bit length (gzip) */
|
||||
#endif
|
||||
DONE, /* finished check, done -- remain here until reset */
|
||||
BAD, /* got a data error -- remain here until reset */
|
||||
MEM, /* got an inflate() memory error -- remain here until reset */
|
||||
SYNC /* looking for synchronization bytes to restart inflate() */
|
||||
} inflate_mode;
|
||||
|
||||
/*
|
||||
State transitions between above modes -
|
||||
|
||||
(most modes can go to the BAD or MEM mode -- not shown for clarity)
|
||||
|
||||
Process header:
|
||||
HEAD -> (gzip) or (zlib)
|
||||
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
|
||||
NAME -> COMMENT -> HCRC -> TYPE
|
||||
(zlib) -> DICTID or TYPE
|
||||
DICTID -> DICT -> TYPE
|
||||
Read deflate blocks:
|
||||
TYPE -> STORED or TABLE or LEN or CHECK
|
||||
STORED -> COPY -> TYPE
|
||||
TABLE -> LENLENS -> CODELENS -> LEN
|
||||
Read deflate codes:
|
||||
LEN -> LENEXT or LIT or TYPE
|
||||
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
|
||||
LIT -> LEN
|
||||
Process trailer:
|
||||
CHECK -> LENGTH -> DONE
|
||||
*/
|
||||
|
||||
/* state maintained between inflate() calls. Approximately 7K bytes. */
|
||||
struct inflate_state {
|
||||
inflate_mode mode; /* current inflate mode */
|
||||
int last; /* true if processing last block */
|
||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
|
||||
int havedict; /* true if dictionary provided */
|
||||
int flags; /* gzip header method and flags (0 if zlib) */
|
||||
unsigned long check; /* protected copy of check value */
|
||||
unsigned long total; /* protected copy of output count */
|
||||
/* sliding window */
|
||||
unsigned wbits; /* log base 2 of requested window size */
|
||||
unsigned wsize; /* window size or zero if not using window */
|
||||
unsigned whave; /* valid bytes in the window */
|
||||
unsigned write; /* window write index */
|
||||
unsigned char FAR *window; /* allocated sliding window, if needed */
|
||||
/* bit accumulator */
|
||||
unsigned long hold; /* input bit accumulator */
|
||||
unsigned bits; /* number of bits in "in" */
|
||||
/* for string and stored block copying */
|
||||
unsigned length; /* literal or length of data to copy */
|
||||
unsigned offset; /* distance back to copy string from */
|
||||
/* for table and code decoding */
|
||||
unsigned extra; /* extra bits needed */
|
||||
/* fixed and dynamic code tables */
|
||||
code const FAR *lencode; /* starting table for length/literal codes */
|
||||
code const FAR *distcode; /* starting table for distance codes */
|
||||
unsigned lenbits; /* index bits for lencode */
|
||||
unsigned distbits; /* index bits for distcode */
|
||||
/* dynamic table building */
|
||||
unsigned ncode; /* number of code length code lengths */
|
||||
unsigned nlen; /* number of length code lengths */
|
||||
unsigned ndist; /* number of distance code lengths */
|
||||
unsigned have; /* number of code lengths in lens[] */
|
||||
code FAR *next; /* next available space in codes[] */
|
||||
unsigned short lens[320]; /* temporary storage for code lengths */
|
||||
unsigned short work[288]; /* work area for code table building */
|
||||
code codes[ENOUGH]; /* space for code tables */
|
||||
};
|
|
@ -0,0 +1,321 @@
|
|||
/* inftrees.c -- generate Huffman trees for efficient decoding
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "inftrees.h"
|
||||
|
||||
#define MAXBITS 15
|
||||
|
||||
const char inflate_copyright[] =
|
||||
" inflate 1.2.1 Copyright 1995-2003 Mark Adler ";
|
||||
/*
|
||||
If you use the zlib library in a product, an acknowledgment is welcome
|
||||
in the documentation of your product. If for some reason you cannot
|
||||
include such an acknowledgment, I would appreciate that you keep this
|
||||
copyright string in the executable of your product.
|
||||
*/
|
||||
|
||||
/*
|
||||
Build a set of tables to decode the provided canonical Huffman code.
|
||||
The code lengths are lens[0..codes-1]. The result starts at *table,
|
||||
whose indices are 0..2^bits-1. work is a writable array of at least
|
||||
lens shorts, which is used as a work area. type is the type of code
|
||||
to be generated, CODES, LENS, or DISTS. On return, zero is success,
|
||||
-1 is an invalid code, and +1 means that ENOUGH isn't enough. table
|
||||
on return points to the next available entry's address. bits is the
|
||||
requested root table index bits, and on return it is the actual root
|
||||
table index bits. It will differ if the request is greater than the
|
||||
longest code or if it is less than the shortest code.
|
||||
*/
|
||||
int inflate_table(type, lens, codes, table, bits, work)
|
||||
codetype type;
|
||||
unsigned short FAR *lens;
|
||||
unsigned codes;
|
||||
code FAR * FAR *table;
|
||||
unsigned FAR *bits;
|
||||
unsigned short FAR *work;
|
||||
{
|
||||
unsigned len; /* a code's length in bits */
|
||||
unsigned sym; /* index of code symbols */
|
||||
unsigned min, max; /* minimum and maximum code lengths */
|
||||
unsigned root; /* number of index bits for root table */
|
||||
unsigned curr; /* number of index bits for current table */
|
||||
unsigned drop; /* code bits to drop for sub-table */
|
||||
int left; /* number of prefix codes available */
|
||||
unsigned used; /* code entries in table used */
|
||||
unsigned huff; /* Huffman code */
|
||||
unsigned incr; /* for incrementing code, index */
|
||||
unsigned fill; /* index for replicating entries */
|
||||
unsigned low; /* low bits for current root entry */
|
||||
unsigned mask; /* mask for low root bits */
|
||||
code this; /* table entry for duplication */
|
||||
code FAR *next; /* next available space in table */
|
||||
const unsigned short FAR *base; /* base value table to use */
|
||||
const unsigned short FAR *extra; /* extra bits table to use */
|
||||
int end; /* use base and extra for symbol > end */
|
||||
unsigned short count[MAXBITS+1]; /* number of codes of each length */
|
||||
unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
|
||||
static const unsigned short lbase[31] = { /* Length codes 257..285 base */
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
||||
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
||||
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 76, 66};
|
||||
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||
8193, 12289, 16385, 24577, 0, 0};
|
||||
static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
|
||||
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
|
||||
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
|
||||
28, 28, 29, 29, 64, 64};
|
||||
|
||||
/*
|
||||
Process a set of code lengths to create a canonical Huffman code. The
|
||||
code lengths are lens[0..codes-1]. Each length corresponds to the
|
||||
symbols 0..codes-1. The Huffman code is generated by first sorting the
|
||||
symbols by length from short to long, and retaining the symbol order
|
||||
for codes with equal lengths. Then the code starts with all zero bits
|
||||
for the first code of the shortest length, and the codes are integer
|
||||
increments for the same length, and zeros are appended as the length
|
||||
increases. For the deflate format, these bits are stored backwards
|
||||
from their more natural integer increment ordering, and so when the
|
||||
decoding tables are built in the large loop below, the integer codes
|
||||
are incremented backwards.
|
||||
|
||||
This routine assumes, but does not check, that all of the entries in
|
||||
lens[] are in the range 0..MAXBITS. The caller must assure this.
|
||||
1..MAXBITS is interpreted as that code length. zero means that that
|
||||
symbol does not occur in this code.
|
||||
|
||||
The codes are sorted by computing a count of codes for each length,
|
||||
creating from that a table of starting indices for each length in the
|
||||
sorted table, and then entering the symbols in order in the sorted
|
||||
table. The sorted table is work[], with that space being provided by
|
||||
the caller.
|
||||
|
||||
The length counts are used for other purposes as well, i.e. finding
|
||||
the minimum and maximum length codes, determining if there are any
|
||||
codes at all, checking for a valid set of lengths, and looking ahead
|
||||
at length counts to determine sub-table sizes when building the
|
||||
decoding tables.
|
||||
*/
|
||||
|
||||
/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
|
||||
for (len = 0; len <= MAXBITS; len++)
|
||||
count[len] = 0;
|
||||
for (sym = 0; sym < codes; sym++)
|
||||
count[lens[sym]]++;
|
||||
|
||||
/* bound code lengths, force root to be within code lengths */
|
||||
root = *bits;
|
||||
for (max = MAXBITS; max >= 1; max--)
|
||||
if (count[max] != 0) break;
|
||||
if (root > max) root = max;
|
||||
if (max == 0) return -1; /* no codes! */
|
||||
for (min = 1; min <= MAXBITS; min++)
|
||||
if (count[min] != 0) break;
|
||||
if (root < min) root = min;
|
||||
|
||||
/* check for an over-subscribed or incomplete set of lengths */
|
||||
left = 1;
|
||||
for (len = 1; len <= MAXBITS; len++) {
|
||||
left <<= 1;
|
||||
left -= count[len];
|
||||
if (left < 0) return -1; /* over-subscribed */
|
||||
}
|
||||
if (left > 0 && (type == CODES || (codes - count[0] != 1)))
|
||||
return -1; /* incomplete set */
|
||||
|
||||
/* generate offsets into symbol table for each length for sorting */
|
||||
offs[1] = 0;
|
||||
for (len = 1; len < MAXBITS; len++)
|
||||
offs[len + 1] = offs[len] + count[len];
|
||||
|
||||
/* sort symbols by length, by symbol order within each length */
|
||||
for (sym = 0; sym < codes; sym++)
|
||||
if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
|
||||
|
||||
/*
|
||||
Create and fill in decoding tables. In this loop, the table being
|
||||
filled is at next and has curr index bits. The code being used is huff
|
||||
with length len. That code is converted to an index by dropping drop
|
||||
bits off of the bottom. For codes where len is less than drop + curr,
|
||||
those top drop + curr - len bits are incremented through all values to
|
||||
fill the table with replicated entries.
|
||||
|
||||
root is the number of index bits for the root table. When len exceeds
|
||||
root, sub-tables are created pointed to by the root entry with an index
|
||||
of the low root bits of huff. This is saved in low to check for when a
|
||||
new sub-table should be started. drop is zero when the root table is
|
||||
being filled, and drop is root when sub-tables are being filled.
|
||||
|
||||
When a new sub-table is needed, it is necessary to look ahead in the
|
||||
code lengths to determine what size sub-table is needed. The length
|
||||
counts are used for this, and so count[] is decremented as codes are
|
||||
entered in the tables.
|
||||
|
||||
used keeps track of how many table entries have been allocated from the
|
||||
provided *table space. It is checked when a LENS table is being made
|
||||
against the space in *table, ENOUGH, minus the maximum space needed by
|
||||
the worst case distance code, MAXD. This should never happen, but the
|
||||
sufficiency of ENOUGH has not been proven exhaustively, hence the check.
|
||||
This assumes that when type == LENS, bits == 9.
|
||||
|
||||
sym increments through all symbols, and the loop terminates when
|
||||
all codes of length max, i.e. all codes, have been processed. This
|
||||
routine permits incomplete codes, so another loop after this one fills
|
||||
in the rest of the decoding tables with invalid code markers.
|
||||
*/
|
||||
|
||||
/* set up for code type */
|
||||
switch (type) {
|
||||
case CODES:
|
||||
base = extra = work; /* dummy value--not used */
|
||||
end = 19;
|
||||
break;
|
||||
case LENS:
|
||||
base = lbase;
|
||||
base -= 257;
|
||||
extra = lext;
|
||||
extra -= 257;
|
||||
end = 256;
|
||||
break;
|
||||
default: /* DISTS */
|
||||
base = dbase;
|
||||
extra = dext;
|
||||
end = -1;
|
||||
}
|
||||
|
||||
/* initialize state for loop */
|
||||
huff = 0; /* starting code */
|
||||
sym = 0; /* starting code symbol */
|
||||
len = min; /* starting code length */
|
||||
next = *table; /* current table to fill in */
|
||||
curr = root; /* current table index bits */
|
||||
drop = 0; /* current bits to drop from code for index */
|
||||
low = (unsigned)(-1); /* trigger new sub-table when len > root */
|
||||
used = 1U << root; /* use root table entries */
|
||||
mask = used - 1; /* mask for comparing low */
|
||||
|
||||
/* check available table space */
|
||||
if (type == LENS && used >= ENOUGH - MAXD)
|
||||
return 1;
|
||||
|
||||
/* process all codes and make table entries */
|
||||
for (;;) {
|
||||
/* create table entry */
|
||||
this.bits = (unsigned char)(len - drop);
|
||||
if ((int)(work[sym]) < end) {
|
||||
this.op = (unsigned char)0;
|
||||
this.val = work[sym];
|
||||
}
|
||||
else if ((int)(work[sym]) > end) {
|
||||
this.op = (unsigned char)(extra[work[sym]]);
|
||||
this.val = base[work[sym]];
|
||||
}
|
||||
else {
|
||||
this.op = (unsigned char)(32 + 64); /* end of block */
|
||||
this.val = 0;
|
||||
}
|
||||
|
||||
/* replicate for those indices with low len bits equal to huff */
|
||||
incr = 1U << (len - drop);
|
||||
fill = 1U << curr;
|
||||
do {
|
||||
fill -= incr;
|
||||
next[(huff >> drop) + fill] = this;
|
||||
} while (fill != 0);
|
||||
|
||||
/* backwards increment the len-bit code huff */
|
||||
incr = 1U << (len - 1);
|
||||
while (huff & incr)
|
||||
incr >>= 1;
|
||||
if (incr != 0) {
|
||||
huff &= incr - 1;
|
||||
huff += incr;
|
||||
}
|
||||
else
|
||||
huff = 0;
|
||||
|
||||
/* go to next symbol, update count, len */
|
||||
sym++;
|
||||
if (--(count[len]) == 0) {
|
||||
if (len == max) break;
|
||||
len = lens[work[sym]];
|
||||
}
|
||||
|
||||
/* create new sub-table if needed */
|
||||
if (len > root && (huff & mask) != low) {
|
||||
/* if first time, transition to sub-tables */
|
||||
if (drop == 0)
|
||||
drop = root;
|
||||
|
||||
/* increment past last table */
|
||||
next += 1U << curr;
|
||||
|
||||
/* determine length of next table */
|
||||
curr = len - drop;
|
||||
left = (int)(1 << curr);
|
||||
while (curr + drop < max) {
|
||||
left -= count[curr + drop];
|
||||
if (left <= 0) break;
|
||||
curr++;
|
||||
left <<= 1;
|
||||
}
|
||||
|
||||
/* check for enough space */
|
||||
used += 1U << curr;
|
||||
if (type == LENS && used >= ENOUGH - MAXD)
|
||||
return 1;
|
||||
|
||||
/* point entry in root table to sub-table */
|
||||
low = huff & mask;
|
||||
(*table)[low].op = (unsigned char)curr;
|
||||
(*table)[low].bits = (unsigned char)root;
|
||||
(*table)[low].val = (unsigned short)(next - *table);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Fill in rest of table for incomplete codes. This loop is similar to the
|
||||
loop above in incrementing huff for table indices. It is assumed that
|
||||
len is equal to curr + drop, so there is no loop needed to increment
|
||||
through high index bits. When the current sub-table is filled, the loop
|
||||
drops back to the root table to fill in any remaining entries there.
|
||||
*/
|
||||
this.op = (unsigned char)64; /* invalid code marker */
|
||||
this.bits = (unsigned char)(len - drop);
|
||||
this.val = (unsigned short)0;
|
||||
while (huff != 0) {
|
||||
/* when done with sub-table, drop back to root table */
|
||||
if (drop != 0 && (huff & mask) != low) {
|
||||
drop = 0;
|
||||
len = root;
|
||||
next = *table;
|
||||
curr = root;
|
||||
this.bits = (unsigned char)len;
|
||||
}
|
||||
|
||||
/* put invalid code marker in table */
|
||||
next[huff >> drop] = this;
|
||||
|
||||
/* backwards increment the len-bit code huff */
|
||||
incr = 1U << (len - 1);
|
||||
while (huff & incr)
|
||||
incr >>= 1;
|
||||
if (incr != 0) {
|
||||
huff &= incr - 1;
|
||||
huff += incr;
|
||||
}
|
||||
else
|
||||
huff = 0;
|
||||
}
|
||||
|
||||
/* set return parameters */
|
||||
*table += used;
|
||||
*bits = root;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/* inftrees.h -- header to use inftrees.c
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* Structure for decoding tables. Each entry provides either the
|
||||
information needed to do the operation requested by the code that
|
||||
indexed that table entry, or it provides a pointer to another
|
||||
table that indexes more bits of the code. op indicates whether
|
||||
the entry is a pointer to another table, a literal, a length or
|
||||
distance, an end-of-block, or an invalid code. For a table
|
||||
pointer, the low four bits of op is the number of index bits of
|
||||
that table. For a length or distance, the low four bits of op
|
||||
is the number of extra bits to get after the code. bits is
|
||||
the number of bits in this code or part of the code to drop off
|
||||
of the bit buffer. val is the actual byte to output in the case
|
||||
of a literal, the base length or distance, or the offset from
|
||||
the current table to the next table. Each entry is four bytes. */
|
||||
typedef struct {
|
||||
unsigned char op; /* operation, extra bits, table bits */
|
||||
unsigned char bits; /* bits in this part of the code */
|
||||
unsigned short val; /* offset in table or code value */
|
||||
} code;
|
||||
|
||||
/* op values as set by inflate_table():
|
||||
00000000 - literal
|
||||
0000tttt - table link, tttt != 0 is the number of table index bits
|
||||
0001eeee - length or distance, eeee is the number of extra bits
|
||||
01100000 - end of block
|
||||
01000000 - invalid code
|
||||
*/
|
||||
|
||||
/* Maximum size of dynamic tree. The maximum found in a long but non-
|
||||
exhaustive search was 1004 code structures (850 for length/literals
|
||||
and 154 for distances, the latter actually the result of an
|
||||
exhaustive search). The true maximum is not known, but the value
|
||||
below is more than safe. */
|
||||
#define ENOUGH 1440
|
||||
#define MAXD 154
|
||||
|
||||
/* Type of code to build for inftable() */
|
||||
typedef enum {
|
||||
CODES,
|
||||
LENS,
|
||||
DISTS
|
||||
} codetype;
|
||||
|
||||
extern int inflate_table OF((codetype type, unsigned short FAR *lens,
|
||||
unsigned codes, code FAR * FAR *table,
|
||||
unsigned FAR *bits, unsigned short FAR *work));
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,128 @@
|
|||
/* header created automatically with -DGEN_TREES_H */
|
||||
|
||||
local const ct_data static_ltree[L_CODES+2] = {
|
||||
{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
|
||||
{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
|
||||
{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
|
||||
{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
|
||||
{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
|
||||
{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
|
||||
{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
|
||||
{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
|
||||
{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
|
||||
{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
|
||||
{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
|
||||
{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
|
||||
{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
|
||||
{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
|
||||
{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
|
||||
{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
|
||||
{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
|
||||
{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
|
||||
{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
|
||||
{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
|
||||
{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
|
||||
{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
|
||||
{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
|
||||
{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
|
||||
{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
|
||||
{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
|
||||
{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
|
||||
{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
|
||||
{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
|
||||
{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
|
||||
{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
|
||||
{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
|
||||
{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
|
||||
{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
|
||||
{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
|
||||
{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
|
||||
{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
|
||||
{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
|
||||
{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
|
||||
{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
|
||||
{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
|
||||
{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
|
||||
{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
|
||||
{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
|
||||
{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
|
||||
{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
|
||||
{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
|
||||
{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
|
||||
{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
|
||||
{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
|
||||
{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
|
||||
{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
|
||||
{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
|
||||
{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
|
||||
{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
|
||||
{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
|
||||
{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
|
||||
{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
|
||||
};
|
||||
|
||||
local const ct_data static_dtree[D_CODES] = {
|
||||
{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
|
||||
{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
|
||||
{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
|
||||
{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
|
||||
{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
|
||||
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
|
||||
};
|
||||
|
||||
const uch _dist_code[DIST_CODE_LEN] = {
|
||||
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
|
||||
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
|
||||
18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
|
||||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
|
||||
};
|
||||
|
||||
const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
|
||||
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
|
||||
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
|
||||
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
|
||||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
|
||||
};
|
||||
|
||||
local const int base_length[LENGTH_CODES] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
|
||||
64, 80, 96, 112, 128, 160, 192, 224, 0
|
||||
};
|
||||
|
||||
local const int base_dist[D_CODES] = {
|
||||
0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
|
||||
32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
|
||||
1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
|
||||
};
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/* uncompr.c -- decompress a memory buffer
|
||||
* Copyright (C) 1995-2003 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: uncompr.c,v 1.1 2006/01/12 17:26:08 shadowpcsx2 Exp $ */
|
||||
|
||||
#define ZLIB_INTERNAL
|
||||
#include "zlib.h"
|
||||
|
||||
/* ===========================================================================
|
||||
Decompresses the source buffer into the destination buffer. sourceLen is
|
||||
the byte length of the source buffer. Upon entry, destLen is the total
|
||||
size of the destination buffer, which must be large enough to hold the
|
||||
entire uncompressed data. (The size of the uncompressed data must have
|
||||
been saved previously by the compressor and transmitted to the decompressor
|
||||
by some mechanism outside the scope of this compression library.)
|
||||
Upon exit, destLen is the actual size of the compressed buffer.
|
||||
This function can be used to decompress a whole file at once if the
|
||||
input file is mmap'ed.
|
||||
|
||||
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
|
||||
enough memory, Z_BUF_ERROR if there was not enough room in the output
|
||||
buffer, or Z_DATA_ERROR if the input data was corrupted.
|
||||
*/
|
||||
int ZEXPORT uncompress (dest, destLen, source, sourceLen)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
{
|
||||
z_stream stream;
|
||||
int err;
|
||||
|
||||
stream.next_in = (Bytef*)source;
|
||||
stream.avail_in = (uInt)sourceLen;
|
||||
/* Check for source > 64K on 16-bit machine: */
|
||||
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
|
||||
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = (uInt)*destLen;
|
||||
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
|
||||
|
||||
stream.zalloc = (alloc_func)0;
|
||||
stream.zfree = (free_func)0;
|
||||
|
||||
err = inflateInit(&stream);
|
||||
if (err != Z_OK) return err;
|
||||
|
||||
err = inflate(&stream, Z_FINISH);
|
||||
if (err != Z_STREAM_END) {
|
||||
inflateEnd(&stream);
|
||||
if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
|
||||
return Z_DATA_ERROR;
|
||||
return err;
|
||||
}
|
||||
*destLen = stream.total_out;
|
||||
|
||||
err = inflateEnd(&stream);
|
||||
return err;
|
||||
}
|
|
@ -0,0 +1,323 @@
|
|||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2003 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: zconf.h,v 1.1 2006/01/12 17:26:08 shadowpcsx2 Exp $ */
|
||||
|
||||
#ifndef ZCONF_H
|
||||
#define ZCONF_H
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||
*/
|
||||
#ifdef Z_PREFIX
|
||||
# define deflateInit_ z_deflateInit_
|
||||
# define deflate z_deflate
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflate z_inflate
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateCopy z_deflateCopy
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflatePrime z_deflatePrime
|
||||
# define deflateParams z_deflateParams
|
||||
# define deflateBound z_deflateBound
|
||||
# define inflateInit2_ z_inflateInit2_
|
||||
# define inflateSetDictionary z_inflateSetDictionary
|
||||
# define inflateSync z_inflateSync
|
||||
# define inflateSyncPoint z_inflateSyncPoint
|
||||
# define inflateCopy z_inflateCopy
|
||||
# define inflateReset z_inflateReset
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define compressBound z_compressBound
|
||||
# define uncompress z_uncompress
|
||||
# define adler32 z_adler32
|
||||
# define crc32 z_crc32
|
||||
# define get_crc_table z_get_crc_table
|
||||
|
||||
# define Byte z_Byte
|
||||
# define uInt z_uInt
|
||||
# define uLong z_uLong
|
||||
# define Bytef z_Bytef
|
||||
# define charf z_charf
|
||||
# define intf z_intf
|
||||
# define uIntf z_uIntf
|
||||
# define uLongf z_uLongf
|
||||
# define voidpf z_voidpf
|
||||
# define voidp z_voidp
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||
# define MSDOS
|
||||
#endif
|
||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||
# define OS2
|
||||
#endif
|
||||
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||
# define WINDOWS
|
||||
#endif
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
# define WIN32
|
||||
#endif
|
||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||
# ifndef SYS16BIT
|
||||
# define SYS16BIT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# define MAXSEG_64K
|
||||
#endif
|
||||
#ifdef MSDOS
|
||||
# define UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
#ifdef __STDC_VERSION__
|
||||
# ifndef STDC
|
||||
# define STDC
|
||||
# endif
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# ifndef STDC99
|
||||
# define STDC99
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||
# define const /* note: need a more gentle solution here */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */
|
||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||
# define NO_DUMMY_DECL
|
||||
#endif
|
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */
|
||||
#ifndef MAX_MEM_LEVEL
|
||||
# ifdef MAXSEG_64K
|
||||
# define MAX_MEM_LEVEL 8
|
||||
# else
|
||||
# define MAX_MEM_LEVEL 9
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||
* created by gzip. (Files created by minigzip can still be extracted by
|
||||
* gzip.)
|
||||
*/
|
||||
#ifndef MAX_WBITS
|
||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||
#endif
|
||||
|
||||
/* The memory requirements for deflate are (in bytes):
|
||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||
the default memory requirements from 256K to 128K, compile with
|
||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||
Of course this will generally degrade compression (there's no free lunch).
|
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||
for small objects.
|
||||
*/
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
#ifndef OF /* function prototypes */
|
||||
# ifdef STDC
|
||||
# define OF(args) args
|
||||
# else
|
||||
# define OF(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||
* just define FAR to be empty.
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# if defined(M_I86SM) || defined(M_I86MM)
|
||||
/* MSC small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef _MSC_VER
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
/* Turbo C small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef __BORLANDC__
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(WINDOWS) || defined(WIN32)
|
||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||
* This is not mandatory, but it offers a little performance increase.
|
||||
*/
|
||||
# ifdef ZLIB_DLL
|
||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# endif /* ZLIB_DLL */
|
||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||
* define ZLIB_WINAPI.
|
||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||
*/
|
||||
# ifdef ZLIB_WINAPI
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# include <windows.h>
|
||||
/* No need for _export, use ZLIB.DEF instead. */
|
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||
# define ZEXPORT WINAPI
|
||||
# ifdef WIN32
|
||||
# define ZEXPORTVA WINAPIV
|
||||
# else
|
||||
# define ZEXPORTVA FAR CDECL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (__BEOS__)
|
||||
# ifdef ZLIB_DLL
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXPORT __declspec(dllexport)
|
||||
# define ZEXPORTVA __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXPORT __declspec(dllimport)
|
||||
# define ZEXPORTVA __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
#ifndef ZEXPORT
|
||||
# define ZEXPORT
|
||||
#endif
|
||||
#ifndef ZEXPORTVA
|
||||
# define ZEXPORTVA
|
||||
#endif
|
||||
|
||||
#ifndef FAR
|
||||
# define FAR
|
||||
#endif
|
||||
|
||||
#if !defined(__MACTYPES__)
|
||||
typedef unsigned char Byte; /* 8 bits */
|
||||
#endif
|
||||
typedef unsigned int uInt; /* 16 bits or more */
|
||||
typedef unsigned long uLong; /* 32 bits or more */
|
||||
|
||||
#ifdef SMALL_MEDIUM
|
||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||
# define Bytef Byte FAR
|
||||
#else
|
||||
typedef Byte FAR Bytef;
|
||||
#endif
|
||||
typedef char FAR charf;
|
||||
typedef int FAR intf;
|
||||
typedef uInt FAR uIntf;
|
||||
typedef uLong FAR uLongf;
|
||||
|
||||
#ifdef STDC
|
||||
typedef void const *voidpc;
|
||||
typedef void FAR *voidpf;
|
||||
typedef void *voidp;
|
||||
#else
|
||||
typedef Byte const *voidpc;
|
||||
typedef Byte FAR *voidpf;
|
||||
typedef Byte *voidp;
|
||||
#endif
|
||||
|
||||
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* for SEEK_* and off_t */
|
||||
# ifdef VMS
|
||||
# include <unixio.h> /* for off_t */
|
||||
# endif
|
||||
# define z_off_t off_t
|
||||
#endif
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
# define SEEK_CUR 1 /* Seek from current position. */
|
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||
#endif
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__)
|
||||
#define NO_vsnprintf
|
||||
#endif
|
||||
|
||||
#if defined(__MVS__)
|
||||
# define NO_vsnprintf
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
# pragma map(deflateInit_,"DEIN")
|
||||
# pragma map(deflateInit2_,"DEIN2")
|
||||
# pragma map(deflateEnd,"DEEND")
|
||||
# pragma map(deflateBound,"DEBND")
|
||||
# pragma map(inflateInit_,"ININ")
|
||||
# pragma map(inflateInit2_,"ININ2")
|
||||
# pragma map(inflateEnd,"INEND")
|
||||
# pragma map(inflateSync,"INSY")
|
||||
# pragma map(inflateSetDictionary,"INSEDI")
|
||||
# pragma map(compressBound,"CMBND")
|
||||
# pragma map(inflate_table,"INTABL")
|
||||
# pragma map(inflate_fast,"INFA")
|
||||
# pragma map(inflate_copyright,"INCOPY")
|
||||
#endif
|
||||
|
||||
#endif /* ZCONF_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,319 @@
|
|||
/* zutil.c -- target dependent utility functions for the compression library
|
||||
* Copyright (C) 1995-2003 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: zutil.c,v 1.1 2006/01/12 17:26:08 shadowpcsx2 Exp $ */
|
||||
|
||||
#include "zutil.h"
|
||||
|
||||
#ifndef NO_DUMMY_DECL
|
||||
struct internal_state {int dummy;}; /* for buggy compilers */
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
extern void exit OF((int));
|
||||
#endif
|
||||
|
||||
const char * const z_errmsg[10] = {
|
||||
"need dictionary", /* Z_NEED_DICT 2 */
|
||||
"stream end", /* Z_STREAM_END 1 */
|
||||
"", /* Z_OK 0 */
|
||||
"file error", /* Z_ERRNO (-1) */
|
||||
"stream error", /* Z_STREAM_ERROR (-2) */
|
||||
"data error", /* Z_DATA_ERROR (-3) */
|
||||
"insufficient memory", /* Z_MEM_ERROR (-4) */
|
||||
"buffer error", /* Z_BUF_ERROR (-5) */
|
||||
"incompatible version",/* Z_VERSION_ERROR (-6) */
|
||||
""};
|
||||
|
||||
|
||||
const char * ZEXPORT zlibVersion()
|
||||
{
|
||||
return ZLIB_VERSION;
|
||||
}
|
||||
|
||||
uLong ZEXPORT zlibCompileFlags()
|
||||
{
|
||||
uLong flags;
|
||||
|
||||
flags = 0;
|
||||
switch (sizeof(uInt)) {
|
||||
case 2: break;
|
||||
case 4: flags += 1; break;
|
||||
case 8: flags += 2; break;
|
||||
default: flags += 3;
|
||||
}
|
||||
switch (sizeof(uLong)) {
|
||||
case 2: break;
|
||||
case 4: flags += 1 << 2; break;
|
||||
case 8: flags += 2 << 2; break;
|
||||
default: flags += 3 << 2;
|
||||
}
|
||||
switch (sizeof(voidpf)) {
|
||||
case 2: break;
|
||||
case 4: flags += 1 << 4; break;
|
||||
case 8: flags += 2 << 4; break;
|
||||
default: flags += 3 << 4;
|
||||
}
|
||||
switch (sizeof(z_off_t)) {
|
||||
case 2: break;
|
||||
case 4: flags += 1 << 6; break;
|
||||
case 8: flags += 2 << 6; break;
|
||||
default: flags += 3 << 6;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
flags += 1 << 8;
|
||||
#endif
|
||||
#if defined(ASMV) || defined(ASMINF)
|
||||
flags += 1 << 9;
|
||||
#endif
|
||||
#ifdef ZLIB_WINAPI
|
||||
flags += 1 << 10;
|
||||
#endif
|
||||
#ifdef BUILDFIXED
|
||||
flags += 1 << 12;
|
||||
#endif
|
||||
#ifdef DYNAMIC_CRC_TABLE
|
||||
flags += 1 << 13;
|
||||
#endif
|
||||
#ifdef NO_GZCOMPRESS
|
||||
flags += 1 << 16;
|
||||
#endif
|
||||
#ifdef NO_GZIP
|
||||
flags += 1 << 17;
|
||||
#endif
|
||||
#ifdef PKZIP_BUG_WORKAROUND
|
||||
flags += 1 << 20;
|
||||
#endif
|
||||
#ifdef FASTEST
|
||||
flags += 1 << 21;
|
||||
#endif
|
||||
#ifdef STDC
|
||||
# ifdef NO_vsnprintf
|
||||
flags += 1 << 25;
|
||||
# ifdef HAS_vsprintf_void
|
||||
flags += 1 << 26;
|
||||
# endif
|
||||
# else
|
||||
# ifdef HAS_vsnprintf_void
|
||||
flags += 1 << 26;
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
flags += 1 << 24;
|
||||
# ifdef NO_snprintf
|
||||
flags += 1 << 25;
|
||||
# ifdef HAS_sprintf_void
|
||||
flags += 1 << 26;
|
||||
# endif
|
||||
# else
|
||||
# ifdef HAS_snprintf_void
|
||||
flags += 1 << 26;
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
return flags;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
# ifndef verbose
|
||||
# define verbose 0
|
||||
# endif
|
||||
int z_verbose = verbose;
|
||||
|
||||
void z_error (m)
|
||||
char *m;
|
||||
{
|
||||
fprintf(stderr, "%s\n", m);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* exported to allow conversion of error code to string for compress() and
|
||||
* uncompress()
|
||||
*/
|
||||
const char * ZEXPORT zError(err)
|
||||
int err;
|
||||
{
|
||||
return ERR_MSG(err);
|
||||
}
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
/* does not exist on WCE */
|
||||
int errno = 0;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_MEMCPY
|
||||
|
||||
void zmemcpy(dest, source, len)
|
||||
Bytef* dest;
|
||||
const Bytef* source;
|
||||
uInt len;
|
||||
{
|
||||
if (len == 0) return;
|
||||
do {
|
||||
*dest++ = *source++; /* ??? to be unrolled */
|
||||
} while (--len != 0);
|
||||
}
|
||||
|
||||
int zmemcmp(s1, s2, len)
|
||||
const Bytef* s1;
|
||||
const Bytef* s2;
|
||||
uInt len;
|
||||
{
|
||||
uInt j;
|
||||
|
||||
for (j = 0; j < len; j++) {
|
||||
if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void zmemzero(dest, len)
|
||||
Bytef* dest;
|
||||
uInt len;
|
||||
{
|
||||
if (len == 0) return;
|
||||
do {
|
||||
*dest++ = 0; /* ??? to be unrolled */
|
||||
} while (--len != 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SYS16BIT
|
||||
|
||||
#ifdef __TURBOC__
|
||||
/* Turbo C in 16-bit mode */
|
||||
|
||||
# define MY_ZCALLOC
|
||||
|
||||
/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
|
||||
* and farmalloc(64K) returns a pointer with an offset of 8, so we
|
||||
* must fix the pointer. Warning: the pointer must be put back to its
|
||||
* original form in order to free it, use zcfree().
|
||||
*/
|
||||
|
||||
#define MAX_PTR 10
|
||||
/* 10*64K = 640K */
|
||||
|
||||
local int next_ptr = 0;
|
||||
|
||||
typedef struct ptr_table_s {
|
||||
voidpf org_ptr;
|
||||
voidpf new_ptr;
|
||||
} ptr_table;
|
||||
|
||||
local ptr_table table[MAX_PTR];
|
||||
/* This table is used to remember the original form of pointers
|
||||
* to large buffers (64K). Such pointers are normalized with a zero offset.
|
||||
* Since MSDOS is not a preemptive multitasking OS, this table is not
|
||||
* protected from concurrent access. This hack doesn't work anyway on
|
||||
* a protected system like OS/2. Use Microsoft C instead.
|
||||
*/
|
||||
|
||||
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
|
||||
{
|
||||
voidpf buf = opaque; /* just to make some compilers happy */
|
||||
ulg bsize = (ulg)items*size;
|
||||
|
||||
/* If we allocate less than 65520 bytes, we assume that farmalloc
|
||||
* will return a usable pointer which doesn't have to be normalized.
|
||||
*/
|
||||
if (bsize < 65520L) {
|
||||
buf = farmalloc(bsize);
|
||||
if (*(ush*)&buf != 0) return buf;
|
||||
} else {
|
||||
buf = farmalloc(bsize + 16L);
|
||||
}
|
||||
if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
|
||||
table[next_ptr].org_ptr = buf;
|
||||
|
||||
/* Normalize the pointer to seg:0 */
|
||||
*((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
|
||||
*(ush*)&buf = 0;
|
||||
table[next_ptr++].new_ptr = buf;
|
||||
return buf;
|
||||
}
|
||||
|
||||
void zcfree (voidpf opaque, voidpf ptr)
|
||||
{
|
||||
int n;
|
||||
if (*(ush*)&ptr != 0) { /* object < 64K */
|
||||
farfree(ptr);
|
||||
return;
|
||||
}
|
||||
/* Find the original pointer */
|
||||
for (n = 0; n < next_ptr; n++) {
|
||||
if (ptr != table[n].new_ptr) continue;
|
||||
|
||||
farfree(table[n].org_ptr);
|
||||
while (++n < next_ptr) {
|
||||
table[n-1] = table[n];
|
||||
}
|
||||
next_ptr--;
|
||||
return;
|
||||
}
|
||||
ptr = opaque; /* just to make some compilers happy */
|
||||
Assert(0, "zcfree: ptr not found");
|
||||
}
|
||||
|
||||
#endif /* __TURBOC__ */
|
||||
|
||||
|
||||
#ifdef M_I86
|
||||
/* Microsoft C in 16-bit mode */
|
||||
|
||||
# define MY_ZCALLOC
|
||||
|
||||
#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
|
||||
# define _halloc halloc
|
||||
# define _hfree hfree
|
||||
#endif
|
||||
|
||||
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
|
||||
{
|
||||
if (opaque) opaque = 0; /* to make compiler happy */
|
||||
return _halloc((long)items, size);
|
||||
}
|
||||
|
||||
void zcfree (voidpf opaque, voidpf ptr)
|
||||
{
|
||||
if (opaque) opaque = 0; /* to make compiler happy */
|
||||
_hfree(ptr);
|
||||
}
|
||||
|
||||
#endif /* M_I86 */
|
||||
|
||||
#endif /* SYS16BIT */
|
||||
|
||||
|
||||
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
|
||||
|
||||
#ifndef STDC
|
||||
extern voidp malloc OF((uInt size));
|
||||
extern voidp calloc OF((uInt items, uInt size));
|
||||
extern void free OF((voidpf ptr));
|
||||
#endif
|
||||
|
||||
voidpf zcalloc (opaque, items, size)
|
||||
voidpf opaque;
|
||||
unsigned items;
|
||||
unsigned size;
|
||||
{
|
||||
if (opaque) items += size - size; /* make compiler happy */
|
||||
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
|
||||
(voidpf)calloc(items, size);
|
||||
}
|
||||
|
||||
void zcfree (opaque, ptr)
|
||||
voidpf opaque;
|
||||
voidpf ptr;
|
||||
{
|
||||
free(ptr);
|
||||
if (opaque) return; /* make compiler happy */
|
||||
}
|
||||
|
||||
#endif /* MY_ZCALLOC */
|
|
@ -0,0 +1,258 @@
|
|||
/* zutil.h -- internal interface and configuration of the compression library
|
||||
* Copyright (C) 1995-2003 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* @(#) $Id: zutil.h,v 1.1 2006/01/12 17:26:08 shadowpcsx2 Exp $ */
|
||||
|
||||
#ifndef ZUTIL_H
|
||||
#define ZUTIL_H
|
||||
|
||||
#define ZLIB_INTERNAL
|
||||
#include "zlib.h"
|
||||
|
||||
#ifdef STDC
|
||||
# include <stddef.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef NO_ERRNO_H
|
||||
extern int errno;
|
||||
#else
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef local
|
||||
# define local static
|
||||
#endif
|
||||
/* compile with -Dlocal if your debugger can't find static symbols */
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef uch FAR uchf;
|
||||
typedef unsigned short ush;
|
||||
typedef ush FAR ushf;
|
||||
typedef unsigned long ulg;
|
||||
|
||||
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
/* (size given to avoid silly warnings with Visual C++) */
|
||||
|
||||
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
|
||||
|
||||
#define ERR_RETURN(strm,err) \
|
||||
return (strm->msg = (char*)ERR_MSG(err), (err))
|
||||
/* To be used only when the state is known to be valid */
|
||||
|
||||
/* common constants */
|
||||
|
||||
#ifndef DEF_WBITS
|
||||
# define DEF_WBITS MAX_WBITS
|
||||
#endif
|
||||
/* default windowBits for decompression. MAX_WBITS is for compression only */
|
||||
|
||||
#if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
#else
|
||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
||||
#endif
|
||||
/* default memLevel */
|
||||
|
||||
#define STORED_BLOCK 0
|
||||
#define STATIC_TREES 1
|
||||
#define DYN_TREES 2
|
||||
/* The three kinds of block type */
|
||||
|
||||
#define MIN_MATCH 3
|
||||
#define MAX_MATCH 258
|
||||
/* The minimum and maximum match lengths */
|
||||
|
||||
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
|
||||
|
||||
/* target dependencies */
|
||||
|
||||
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
|
||||
# define OS_CODE 0x00
|
||||
# if defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
|
||||
/* Allow compilation with ANSI keywords only enabled */
|
||||
void _Cdecl farfree( void *block );
|
||||
void *_Cdecl farmalloc( unsigned long nbytes );
|
||||
# else
|
||||
# include <alloc.h>
|
||||
# endif
|
||||
# else /* MSC or DJGPP */
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef AMIGA
|
||||
# define OS_CODE 0x01
|
||||
#endif
|
||||
|
||||
#if defined(VAXC) || defined(VMS)
|
||||
# define OS_CODE 0x02
|
||||
# define F_OPEN(name, mode) \
|
||||
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
|
||||
#endif
|
||||
|
||||
#if defined(ATARI) || defined(atarist)
|
||||
# define OS_CODE 0x05
|
||||
#endif
|
||||
|
||||
#ifdef OS2
|
||||
# define OS_CODE 0x06
|
||||
#endif
|
||||
|
||||
#if defined(MACOS) || defined(TARGET_OS_MAC)
|
||||
# define OS_CODE 0x07
|
||||
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
|
||||
# include <unix.h> /* for fdopen */
|
||||
# else
|
||||
# ifndef fdopen
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef TOPS20
|
||||
# define OS_CODE 0x0a
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
|
||||
# define OS_CODE 0x0b
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __50SERIES /* Prime/PRIMOS */
|
||||
# define OS_CODE 0x0f
|
||||
#endif
|
||||
|
||||
#if defined(_BEOS_) || defined(RISCOS)
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER > 600))
|
||||
# if defined(_WIN32_WCE)
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# ifndef _PTRDIFF_T_DEFINED
|
||||
typedef int ptrdiff_t;
|
||||
# define _PTRDIFF_T_DEFINED
|
||||
# endif
|
||||
# else
|
||||
# define fdopen(fd,type) _fdopen(fd,type)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* common defaults */
|
||||
|
||||
#ifndef OS_CODE
|
||||
# define OS_CODE 0x03 /* assume Unix */
|
||||
#endif
|
||||
|
||||
#ifndef F_OPEN
|
||||
# define F_OPEN(name, mode) fopen((name), (mode))
|
||||
#endif
|
||||
|
||||
/* functions */
|
||||
|
||||
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
|
||||
# ifndef HAVE_VSNPRINTF
|
||||
# define HAVE_VSNPRINTF
|
||||
# endif
|
||||
#endif
|
||||
#if defined(__CYGWIN__)
|
||||
# ifndef HAVE_VSNPRINTF
|
||||
# define HAVE_VSNPRINTF
|
||||
# endif
|
||||
#endif
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
# ifdef MSDOS
|
||||
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
|
||||
but for now we just assume it doesn't. */
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef __TURBOC__
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef WIN32
|
||||
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
|
||||
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
|
||||
# define vsnprintf _vsnprintf
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __SASC
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRERROR
|
||||
extern char *strerror OF((int));
|
||||
# define zstrerror(errnum) strerror(errnum)
|
||||
#else
|
||||
# define zstrerror(errnum) ""
|
||||
#endif
|
||||
|
||||
#if defined(pyr)
|
||||
# define NO_MEMCPY
|
||||
#endif
|
||||
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
|
||||
/* Use our own functions for small and medium model with MSC <= 5.0.
|
||||
* You may have to use the same strategy for Borland C (untested).
|
||||
* The __SC__ check is for Symantec.
|
||||
*/
|
||||
# define NO_MEMCPY
|
||||
#endif
|
||||
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
|
||||
# define HAVE_MEMCPY
|
||||
#endif
|
||||
#ifdef HAVE_MEMCPY
|
||||
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
|
||||
# define zmemcpy _fmemcpy
|
||||
# define zmemcmp _fmemcmp
|
||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
||||
# else
|
||||
# define zmemcpy memcpy
|
||||
# define zmemcmp memcmp
|
||||
# define zmemzero(dest, len) memset(dest, 0, len)
|
||||
# endif
|
||||
#else
|
||||
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
|
||||
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
|
||||
extern void zmemzero OF((Bytef* dest, uInt len));
|
||||
#endif
|
||||
|
||||
/* Diagnostic functions */
|
||||
#ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
extern int z_verbose;
|
||||
extern void z_error OF((char *m));
|
||||
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
|
||||
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
|
||||
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
|
||||
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
|
||||
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
|
||||
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
|
||||
#else
|
||||
# define Assert(cond,msg)
|
||||
# define Trace(x)
|
||||
# define Tracev(x)
|
||||
# define Tracevv(x)
|
||||
# define Tracec(c,x)
|
||||
# define Tracecv(c,x)
|
||||
#endif
|
||||
|
||||
|
||||
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
|
||||
void zcfree OF((voidpf opaque, voidpf ptr));
|
||||
|
||||
#define ZALLOC(strm, items, size) \
|
||||
(*((strm)->zalloc))((strm)->opaque, (items), (size))
|
||||
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
|
||||
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
|
||||
|
||||
#endif /* ZUTIL_H */
|
|
@ -0,0 +1,821 @@
|
|||
/* ZZ Open GL graphics plugin
|
||||
* Copyright (c)2009 zeydlitz@gmail.com
|
||||
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2006
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
// Realisation of RenderCRTC function ONLY.
|
||||
// It draw picture direct on screen, so here we have interlacing and frame skipping.
|
||||
|
||||
//------------------ Includes
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "zerogs.h"
|
||||
#include "targets.h"
|
||||
|
||||
using namespace ZeroGS;
|
||||
|
||||
//------------------ Defines
|
||||
#ifdef RELEASE_TO_PUBLIC
|
||||
#define g_bSaveFrame 0
|
||||
#define g_bSaveFinalFrame 0
|
||||
#else // NOT RELEASE_TO_PUBLIC
|
||||
BOOL g_bSaveFrame = 0; // saves the current psurfTarget
|
||||
BOOL g_bSaveFinalFrame = 0; // saves the input to the CRTC
|
||||
#endif // RELEASE_TO_PUBLIC
|
||||
|
||||
#define INTERLACE_COUNT (bInterlace && interlace == (conf.interlace))
|
||||
|
||||
// ----------------- Types
|
||||
//------------------ Dummies
|
||||
|
||||
//------------------ variables
|
||||
|
||||
#ifdef _WIN32
|
||||
extern HDC hDC; // Private GDI Device Context
|
||||
extern HGLRC hRC; // Permanent Rendering Context
|
||||
#endif
|
||||
|
||||
BOOL g_bCRTCBilinear = TRUE;
|
||||
extern bool g_bIsLost;
|
||||
int g_nFrameRender = 10;
|
||||
int g_nFramesSkipped = 0;
|
||||
|
||||
extern int s_frameskipping;
|
||||
extern float fFPS;
|
||||
extern unsigned char zgsrevision, zgsbuild, zgsminor;
|
||||
|
||||
extern u32 g_SaveFrameNum;
|
||||
extern int s_nWriteDepthCount;
|
||||
extern int s_nWireframeCount;
|
||||
extern int s_nWriteDestAlphaTest;
|
||||
|
||||
extern int g_PrevBitwiseTexX, g_PrevBitwiseTexY; // textures stored in SAMP_BITWISEANDX and SAMP_BITWISEANDY
|
||||
|
||||
BOOL g_bDisplayFPS = FALSE;
|
||||
|
||||
extern bool s_bDestAlphaTest;
|
||||
extern int s_ClutResolve;
|
||||
extern int s_nLastResolveReset;
|
||||
extern int g_nDepthUpdateCount;
|
||||
extern int s_nResolveCounts[30]; // resolve counts for last 30 frames
|
||||
static int s_nCurResolveIndex = 0;
|
||||
int s_nResolved = 0; // number of targets resolved this frame
|
||||
extern int g_nDepthUsed; // ffx2 pal movies
|
||||
|
||||
extern vector<u32> s_vecTempTextures; // temporary textures, released at the end of every frame
|
||||
|
||||
//------------------ Namespace
|
||||
|
||||
namespace ZeroGS {
|
||||
extern int s_nNewWidth, s_nNewHeight;
|
||||
|
||||
extern CRangeManager s_RangeMngr; // manages overwritten memory
|
||||
extern void FlushTransferRanges(const tex0Info* ptex);
|
||||
extern void ProcessMessages();
|
||||
void AdjustTransToAspect(Vector& v);
|
||||
|
||||
// Interlace texture is lazy 1*(height) array of 1 and 0.
|
||||
// It height (it named s_nInterlaceTexWidth here) hanging we must redone
|
||||
// the texture.
|
||||
// FIXME: If this function would spammed to often, we could use
|
||||
// width < s_nInterlaceTexWidth as correct for old texture
|
||||
static int s_nInterlaceTexWidth = 0; // width of texture
|
||||
inline u32 CreateInterlaceTex(int width) {
|
||||
if (width == s_nInterlaceTexWidth && s_ptexInterlace != 0)
|
||||
return s_ptexInterlace;
|
||||
|
||||
SAFE_RELEASE_TEX(s_ptexInterlace);
|
||||
s_nInterlaceTexWidth = width;
|
||||
|
||||
vector<u32> data(width);
|
||||
for (int i = 0; i < width; ++i)
|
||||
data[i] = (i & 1) ? 0xffffffff : 0;
|
||||
|
||||
glGenTextures(1, &s_ptexInterlace);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_NV, s_ptexInterlace);
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, 4, width, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
|
||||
glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GL_REPORT_ERRORD();
|
||||
return s_ptexInterlace;
|
||||
}
|
||||
}
|
||||
//------------------ Code
|
||||
|
||||
// Adjusts vertex shader BitBltPos vector v to preserve aspect ratio. It used to emulate 4:3 or 16:9.
|
||||
void ZeroGS::AdjustTransToAspect(Vector& v)
|
||||
{
|
||||
double temp;
|
||||
float f;
|
||||
int dispwidth = 640;
|
||||
int dispheight = conf.isWideScreen ? 360 : 480;
|
||||
|
||||
if( dispwidth * nBackbufferHeight > dispheight * nBackbufferWidth) {
|
||||
// limited by width
|
||||
|
||||
// change in ratio
|
||||
f = ((float)nBackbufferWidth / (float)dispwidth) / ((float)nBackbufferHeight / (float)dispheight);
|
||||
v.y *= f;
|
||||
v.w *= f;
|
||||
|
||||
// scanlines mess up when not aligned right
|
||||
v.y += (1-(float)modf(v.y*(float)nBackbufferHeight*0.5f+0.05f, &temp))*2.0f/(float)nBackbufferHeight;
|
||||
v.w += (1-(float)modf(v.w*(float)nBackbufferHeight*0.5f+0.05f, &temp))*2.0f/(float)nBackbufferHeight;
|
||||
}
|
||||
else {
|
||||
// limited by height
|
||||
f = ((float)nBackbufferHeight / (float)dispheight) / ((float)nBackbufferWidth / (float)dispwidth);
|
||||
f -= (float)modf(f*nBackbufferWidth, &temp)/(float)nBackbufferWidth;
|
||||
v.x *= f;
|
||||
v.z *= f;
|
||||
}
|
||||
v *= 1/32767.0f;
|
||||
}
|
||||
|
||||
// Helper for skip frames.
|
||||
int TimeLastSkip=0;
|
||||
inline bool FrameSkippingHelper() {
|
||||
bool ShouldSkip = false;
|
||||
if( g_nFrameRender > 0 ) {
|
||||
if( g_nFrameRender < 8 ) {
|
||||
g_nFrameRender++;
|
||||
if( g_nFrameRender <= 3 ) {
|
||||
g_nFramesSkipped++;
|
||||
ShouldSkip = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( g_nFrameRender < -1 ) {
|
||||
g_nFramesSkipped++;
|
||||
ShouldSkip = true;
|
||||
}
|
||||
g_nFrameRender--;
|
||||
}
|
||||
|
||||
|
||||
#if defined _DEBUG
|
||||
if (timeGetTime() - TimeLastSkip > 15000 && ShouldSkip) {
|
||||
ERROR_LOG("ZZogl Skipped frames\n");
|
||||
TimeLastSkip = timeGetTime();
|
||||
}
|
||||
#endif
|
||||
return ShouldSkip;
|
||||
}
|
||||
|
||||
// helper function for save frame in picture.
|
||||
inline void FrameSavingHelper() {
|
||||
if( g_bSaveFrame ) {
|
||||
if( vb[0].prndr != NULL ) {
|
||||
SaveTexture("frame1.tga", GL_TEXTURE_RECTANGLE_NV, vb[0].prndr->ptex, RW(vb[0].prndr->fbw), RH(vb[0].prndr->fbh));
|
||||
}
|
||||
|
||||
if( vb[1].prndr != NULL && vb[0].prndr != vb[1].prndr ) {
|
||||
SaveTexture("frame2.tga", GL_TEXTURE_RECTANGLE_NV, vb[1].prndr->ptex, RW(vb[1].prndr->fbw), RH(vb[1].prndr->fbh));
|
||||
}
|
||||
#ifdef _WIN32
|
||||
else DeleteFile("frame2.tga");
|
||||
#endif
|
||||
}
|
||||
g_SaveFrameNum = 0;
|
||||
g_bSaveFlushedFrame = 1;
|
||||
}
|
||||
|
||||
// Function populated tex0Info[2] array
|
||||
inline void FrameObtainDispinfo(u32 bInterlace, tex0Info* dispinfo) {
|
||||
for(int i = 0; i < 2; ++i) {
|
||||
|
||||
if( !(*(u32*)(PMODE) & (1<<i)) ) {
|
||||
dispinfo[i].tw = 0;
|
||||
dispinfo[i].th = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
GSRegDISPFB* pfb = i ? DISPFB2 : DISPFB1;
|
||||
GSRegDISPLAY* pd = i ? DISPLAY2 : DISPLAY1;
|
||||
int magh = pd->MAGH+1;
|
||||
int magv = pd->MAGV+1;
|
||||
|
||||
dispinfo[i].tbp0 = pfb->FBP << 5;
|
||||
dispinfo[i].tbw = pfb->FBW << 6;
|
||||
dispinfo[i].tw = (pd->DW + 1) / magh;
|
||||
dispinfo[i].th = (pd->DH + 1) / magv;
|
||||
dispinfo[i].psm = pfb->PSM;
|
||||
|
||||
// hack!!
|
||||
// 2 * dispinfo[i].tw / dispinfo[i].th <= 1, metal slug 4
|
||||
if( bInterlace && 2 * dispinfo[i].tw / dispinfo[i].th <= 1 && !(g_GameSettings&GAME_INTERLACE2X) ) {
|
||||
dispinfo[i].th >>= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Something should be done before Renderer the picture.
|
||||
inline void RenderStartHelper(u32 bInterlace){
|
||||
// Crashes Final Fantasy X at startup if uncommented. --arcum42
|
||||
//#ifdef RELEASE_TO_PUBLIC
|
||||
// if(g_nRealFrame < 80 ) {
|
||||
// RenderCustom( min(1.0f, 2.0f - (float)g_nRealFrame / 40.0f) );
|
||||
//
|
||||
// if( g_nRealFrame == 79 )
|
||||
// SAFE_RELEASE_TEX(ptexLogo);
|
||||
// return;
|
||||
// }
|
||||
//#endif
|
||||
if( conf.mrtdepth && pvs[8] == NULL ) {
|
||||
conf.mrtdepth = 0;
|
||||
s_bWriteDepth = FALSE;
|
||||
#ifdef DEBUG
|
||||
ERROR_LOG("Disabling MRT depth writing\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
Flush(0);
|
||||
Flush(1);
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
FrameSavingHelper();
|
||||
|
||||
if( s_RangeMngr.ranges.size() > 0 )
|
||||
FlushTransferRanges(NULL);
|
||||
|
||||
SetShaderCaller("RenderStartHelper");
|
||||
// reset fba after every frame
|
||||
vb[0].fba.fba = 0;
|
||||
vb[1].fba.fba = 0;
|
||||
|
||||
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 ); // switch to the backbuffer
|
||||
glViewport(0, 0, nBackbufferWidth, nBackbufferHeight);
|
||||
|
||||
// if interlace, only clear every other vsync
|
||||
if(!bInterlace ) {
|
||||
u32 color = COLOR_ARGB(0, BGCOLOR->R, BGCOLOR->G, BGCOLOR->B);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
|
||||
SETVERTEXSHADER(pvsBitBlt.prog);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vboRect);
|
||||
SET_STREAM();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
if( conf.options & GSOPTION_WIREFRAME )
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
DisableAllgl() ;
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
if( bInterlace ) g_PrevBitwiseTexX = -1; // reset since will be using
|
||||
}
|
||||
|
||||
// It is setting for intrelace texture multiplied vector;
|
||||
// Idea is: (x, y) -- position on screen, than interlaced texture get F = 1 ot 0 depends
|
||||
// on image y coord. So it we write valpha.z * F + valpha.w + 0.5 it would be swicthig odd
|
||||
// and even strings at each frame
|
||||
// valpha.x and y used for image blending.
|
||||
inline Vector RenderGetForClip(u32 bInterlace, int interlace, int psm, FRAGMENTSHADER* prog){
|
||||
SetShaderCaller("RenderGetForClip");
|
||||
|
||||
Vector valpha;
|
||||
// first render the current render targets, then from ptexMem
|
||||
if( psm == 1 ) {
|
||||
valpha.x = 1;
|
||||
valpha.y = 0;
|
||||
}
|
||||
else {
|
||||
valpha.x = 0;
|
||||
valpha.y = 1;
|
||||
}
|
||||
|
||||
if (bInterlace) {
|
||||
if( interlace == (conf.interlace&1) ) {
|
||||
// pass if odd
|
||||
valpha.z = 1.0f;
|
||||
valpha.w = -0.4999f;
|
||||
}
|
||||
else {
|
||||
// pass if even
|
||||
valpha.z = -1.0f;
|
||||
valpha.w = 0.5001f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// always pass interlace test
|
||||
valpha.z = 0;
|
||||
valpha.w = 1;
|
||||
}
|
||||
|
||||
ZZcgSetParameter4fv(prog->sOneColor, valpha, "g_fOneColor");
|
||||
return valpha;
|
||||
}
|
||||
|
||||
// Put interlaced texture in use for shader prog.
|
||||
// Note: if frame interlaced it's th is halved, so we should x2 it.
|
||||
inline void RenderCreateInterlaceTex(u32 bInterlace, int th, FRAGMENTSHADER* prog) {
|
||||
if (!bInterlace)
|
||||
return;
|
||||
|
||||
int interlacetex = CreateInterlaceTex(2*th);
|
||||
cgGLSetTextureParameter(prog->sInterlace, interlacetex);
|
||||
cgGLEnableTextureParameter(prog->sInterlace);
|
||||
}
|
||||
|
||||
// Well, do blending setup prior to second pass of half-frame drawing
|
||||
inline void RenderSetupBlending() {
|
||||
// setup right blending
|
||||
glEnable(GL_BLEND);
|
||||
zgsBlendEquationSeparateEXT(GL_FUNC_ADD, GL_FUNC_ADD);
|
||||
|
||||
if (PMODE->MMOD) {
|
||||
glBlendColorEXT(PMODE->ALP*(1/255.0f), PMODE->ALP*(1/255.0f), PMODE->ALP*(1/255.0f), 0.5f);
|
||||
s_srcrgb = GL_CONSTANT_COLOR_EXT;
|
||||
s_dstrgb = GL_ONE_MINUS_CONSTANT_COLOR_EXT;
|
||||
}
|
||||
else {
|
||||
s_srcrgb = GL_SRC_ALPHA;
|
||||
s_dstrgb = GL_ONE_MINUS_SRC_ALPHA;
|
||||
}
|
||||
|
||||
s_srcalpha = PMODE->AMOD ? GL_ZERO : GL_ONE;
|
||||
s_dstalpha = PMODE->AMOD? GL_ONE : GL_ZERO;
|
||||
zgsBlendFuncSeparateEXT(s_srcrgb, s_dstrgb, s_srcalpha, s_dstalpha);
|
||||
}
|
||||
|
||||
// each frame could be drawed in two stages, so blending should be different for them
|
||||
inline void RenderSetupStencil(int i) {
|
||||
glStencilMask(1<<i);
|
||||
s_stencilmask = 1<<i;
|
||||
GL_STENCILFUNC_SET();
|
||||
}
|
||||
|
||||
// do stencil check for each found target i -- texturig stage
|
||||
inline void RenderUpdateStencil(int i, bool* bUsingStencil) {
|
||||
if( !(*bUsingStencil) ) {
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
*bUsingStencil = 1;
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
GL_STENCILFUNC(GL_NOTEQUAL, 3, 1<<i);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
glStencilMask(1<<i);
|
||||
}
|
||||
|
||||
// CRTC24 could not be rendered
|
||||
inline void RenderCRTC24helper(u32 bInterlace, int interlace, int psm) {
|
||||
ERROR_LOG("ZZogl: CRTC24!!! I trying to show something\n");
|
||||
SetShaderCaller("RenderCRTC24helper");
|
||||
// assume that data is already in ptexMem (do Resolve?)
|
||||
RenderGetForClip(bInterlace, interlace, psm, &ppsCRTC24[bInterlace]);
|
||||
SETPIXELSHADER(ppsCRTC24[bInterlace].prog);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
|
||||
// Maybe I do this function global-defined. Calculate bits per pixel for
|
||||
// each psm. It's obly place with PSMCT16 which have diffetent bpp.
|
||||
// FIXME: check PSMCT16S
|
||||
inline int RenderGetBpp(int psm) {
|
||||
if (psm == PSMCT16S) {
|
||||
return 3;
|
||||
#ifdef _DEBUG
|
||||
ERROR_LOG("ZZogl: 16S target\n");
|
||||
#endif
|
||||
}
|
||||
if (PSMT_ISHALF(psm))
|
||||
return 2;
|
||||
return 4;
|
||||
}
|
||||
|
||||
// We want to draw ptarg on screen, that could be disaligned to viewport.
|
||||
// So we do aligning it by height.
|
||||
inline int RenderGetOffsets(int* dby, int* movy, tex0Info& texframe, CRenderTarget* ptarg, int bpp) {
|
||||
*dby += (256/bpp)*(texframe.tbp0 - ptarg->fbp)/texframe.tbw;
|
||||
if( *dby < 0 ) {
|
||||
*movy = -*dby;
|
||||
*dby = 0;
|
||||
}
|
||||
return min(ptarg->fbh - *dby, texframe.th - *movy);
|
||||
}
|
||||
|
||||
// BltBit shader calculate vertex (4 coord's pixel) position at the viewport.
|
||||
inline Vector RenderSetTargetBitPos(int dh, int th, int movy, bool isInterlace) {
|
||||
SetShaderCaller("RenderSetTargetBitPos");
|
||||
Vector v;
|
||||
// dest rect
|
||||
v.x = 1;
|
||||
v.y = dh/(float)th;
|
||||
v.z = 0;
|
||||
v.w = 1-v.y;
|
||||
|
||||
if( movy > 0 )
|
||||
v.w -= movy/(float)th;
|
||||
|
||||
AdjustTransToAspect(v);
|
||||
|
||||
if (isInterlace) {
|
||||
// move down by 1 pixel
|
||||
v.w += 1.0f / (float)dh ;
|
||||
}
|
||||
|
||||
ZZcgSetParameter4fv(pvsBitBlt.sBitBltPos, v, "g_fBitBltPos");
|
||||
return v;
|
||||
}
|
||||
|
||||
// Important stuff. We could use this coordinated to change viewport position on frame
|
||||
// For example use tw / X and tw / X magnify the vieport.
|
||||
// Interlaced output is little out of VB, it could be see as evil blinking line on top
|
||||
// and bottom, so we try to remove it
|
||||
inline Vector RenderSetTargetBitTex(float th, float tw, float dh, float dw, bool isInterlace) {
|
||||
SetShaderCaller("RenderSetTargetBitTex");
|
||||
|
||||
Vector v;
|
||||
v = Vector(th, tw, dh, dw);
|
||||
|
||||
// Incorrect Asect ration on interlaced frames
|
||||
if (isInterlace) {
|
||||
v.y -= 1.0f/480 ;
|
||||
v.w += 1.0f/480 ;
|
||||
}
|
||||
|
||||
ZZcgSetParameter4fv(pvsBitBlt.sBitBltTex, v, "g_fBitBltTex");
|
||||
return v;
|
||||
}
|
||||
|
||||
// Translator for POSITION coordinats (-1.0:+1.0f at x axis, +1.0f:-1.0y at y) into target frame ones
|
||||
// We don't need x coordinate, bvecause interlacing is y-axis only.
|
||||
inline Vector RenderSetTargetBitTrans(int th) {
|
||||
SetShaderCaller("RenderSetTargetBitTrans");
|
||||
Vector v = Vector( float(th), -float(th), float(th), float(th));
|
||||
ZZcgSetParameter4fv(pvsBitBlt.fBitBltTrans, v, "g_fBitBltTrans");
|
||||
return v;
|
||||
}
|
||||
|
||||
// use g_fInvTexDims to store inverse texture dims
|
||||
// Seems, that Targ shader does not use it
|
||||
inline Vector RenderSetTargetInvTex(int bInterlace, int tw, int th, FRAGMENTSHADER* prog) {
|
||||
SetShaderCaller("RenderSetTargetInvTex");
|
||||
|
||||
Vector v = Vector(0, 0, 0, 0);
|
||||
if (prog->sInvTexDims) {
|
||||
v.x = 1.0f / (float)tw;
|
||||
v.y = 1.0f / (float)th;
|
||||
v.z = (float)0.0;
|
||||
v.w = -0.5f / (float)th;
|
||||
ZZcgSetParameter4fv(prog->sInvTexDims, v, "g_fInvTexDims");
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
// Metal Slug 5 hack (as was written). If tarhet tbp not equal to framed fbp, than we look for better possibility,
|
||||
// Note, than after true result iterator it could not be use.
|
||||
inline bool RenderLookForABetterTarget(int fbp, int tbp, list<CRenderTarget*>& listTargs, list<CRenderTarget*>::iterator& it) {
|
||||
if (fbp == tbp)
|
||||
return false;
|
||||
|
||||
// look for a better target (metal slug 5)
|
||||
list<CRenderTarget*>::iterator itbetter;
|
||||
for(itbetter = listTargs.begin(); itbetter != listTargs.end(); ++itbetter ) {
|
||||
if( (*itbetter)->fbp == tbp )
|
||||
break;
|
||||
}
|
||||
|
||||
if( itbetter != listTargs.end() ) {
|
||||
it = listTargs.erase(it);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// First try to draw frame from targets. It's
|
||||
inline bool RenderCheckForTargets(tex0Info& texframe, list<CRenderTarget*>& listTargs, int i, bool* bUsingStencil, int interlace, int bInterlace) {
|
||||
// get the start and end addresses of the buffer
|
||||
int bpp = RenderGetBpp(texframe.psm);
|
||||
GSRegDISPFB* pfb = i ? DISPFB2 : DISPFB1;
|
||||
|
||||
int start, end;
|
||||
GetRectMemAddress(start, end, texframe.psm, 0, 0, texframe.tw, texframe.th, texframe.tbp0, texframe.tbw);
|
||||
|
||||
// We need share list of targets beetween functions
|
||||
s_RTs.GetTargs(start, end, listTargs);
|
||||
|
||||
for(list<CRenderTarget*>::iterator it = listTargs.begin(); it != listTargs.end(); ) {
|
||||
|
||||
CRenderTarget* ptarg = *it;
|
||||
if( ptarg->fbw == texframe.tbw && !(ptarg->status&CRenderTarget::TS_NeedUpdate) && ((256/bpp)*(texframe.tbp0-ptarg->fbp))%texframe.tbw == 0 ) {
|
||||
|
||||
if (RenderLookForABetterTarget(ptarg->fbp, texframe.tbp0, listTargs, it))
|
||||
continue;
|
||||
|
||||
if( g_bSaveFinalFrame )
|
||||
SaveTexture("frame1.tga", GL_TEXTURE_RECTANGLE_NV, ptarg->ptex, RW(ptarg->fbw), RH(ptarg->fbh));
|
||||
|
||||
// determine the rectangle to render
|
||||
int dby = pfb->DBY;
|
||||
int movy = 0;
|
||||
int dh = RenderGetOffsets(&dby, &movy, texframe, ptarg, bpp);
|
||||
|
||||
if( dh >= 64 ) {
|
||||
|
||||
if( ptarg->fbh - dby < texframe.th - movy && !(*bUsingStencil) )
|
||||
RenderUpdateStencil(i, bUsingStencil);
|
||||
|
||||
SetShaderCaller("RenderCheckForTargets");
|
||||
// Texture
|
||||
Vector v = RenderSetTargetBitTex((float)RW(texframe.tw), (float)RH(dh), (float)RW(pfb->DBX), (float)RH(dby), INTERLACE_COUNT );
|
||||
// dest rect
|
||||
v = RenderSetTargetBitPos(dh, texframe.th, movy, INTERLACE_COUNT);
|
||||
v = RenderSetTargetBitTrans(ptarg->fbh);
|
||||
v = RenderSetTargetInvTex(bInterlace, texframe.tbw, ptarg->fbh, &ppsCRTCTarg[bInterlace]) ; // FIXME. This is no use
|
||||
|
||||
Vector valpha = RenderGetForClip(bInterlace, interlace, texframe.psm, &ppsCRTCTarg[bInterlace]);
|
||||
|
||||
// inside vb[0]'s target area, so render that region only
|
||||
cgGLSetTextureParameter(ppsCRTCTarg[bInterlace].sFinal, ptarg->ptex);
|
||||
cgGLEnableTextureParameter(ppsCRTCTarg[bInterlace].sFinal);
|
||||
|
||||
RenderCreateInterlaceTex(bInterlace, texframe.th, &ppsCRTCTarg[bInterlace]);
|
||||
|
||||
SETPIXELSHADER(ppsCRTCTarg[bInterlace].prog);
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
if( abs(dh - (int)texframe.th) <= 1 )
|
||||
return true;
|
||||
|
||||
if( abs(dh - (int)ptarg->fbh) <= 1 ) {
|
||||
it = listTargs.erase(it);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// The same of the previous, but from memory
|
||||
inline void RenderCheckForMemory(tex0Info& texframe, list<CRenderTarget*>& listTargs, int interlace, int bInterlace) {
|
||||
|
||||
for(list<CRenderTarget*>::iterator it = listTargs.begin(); it != listTargs.end(); ++it)
|
||||
(*it)->Resolve();
|
||||
|
||||
// context has to be 0
|
||||
CMemoryTarget* pmemtarg = g_MemTargs.GetMemoryTarget(texframe, 1);
|
||||
if ((pmemtarg == NULL) || (bInterlace >= 2))
|
||||
ERROR_LOG("CRCR Check for memory shader fault");
|
||||
|
||||
SetShaderCaller("RenderCheckForMemory");
|
||||
|
||||
SetTexVariablesInt(0, g_bCRTCBilinear ? 2 : 0, texframe, pmemtarg, &ppsCRTC[bInterlace], 1);
|
||||
cgGLSetTextureParameter(ppsCRTC[bInterlace].sMemory, pmemtarg->ptex->tex);
|
||||
cgGLEnableTextureParameter(ppsCRTC[bInterlace].sMemory);
|
||||
|
||||
if( g_bSaveFinalFrame )
|
||||
SaveTex(&texframe, g_bSaveFinalFrame - 1 > 0);
|
||||
|
||||
// finally render from the memory (note that the stencil buffer will keep previous regions)
|
||||
Vector v = RenderSetTargetBitPos(1, 1, 0, INTERLACE_COUNT);
|
||||
|
||||
// Fixme: Why this if here?
|
||||
if( g_bCRTCBilinear )
|
||||
ZZcgSetParameter4fv(pvsBitBlt.sBitBltTex, Vector(texframe.tw,texframe.th,-0.5f,-0.5f), "g_fBitBltTex");
|
||||
else
|
||||
ZZcgSetParameter4fv(pvsBitBlt.sBitBltTex, Vector(1,1,-0.5f/(float)texframe.tw,-0.5f/(float)texframe.th), "g_fBitBltTex");
|
||||
|
||||
v = RenderSetTargetBitTrans(texframe.th);
|
||||
v = RenderSetTargetInvTex(bInterlace, texframe.tw, texframe.th, &ppsCRTC[bInterlace]);
|
||||
|
||||
Vector valpha = RenderGetForClip(bInterlace, interlace, texframe.psm, &ppsCRTC[bInterlace]);
|
||||
RenderCreateInterlaceTex(bInterlace, texframe.th, &ppsCRTC[bInterlace]);
|
||||
|
||||
SETPIXELSHADER(ppsCRTC[bInterlace].prog);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
|
||||
// Put FPS counter on scren (not in window title)
|
||||
inline void AfterRenderDisplayFPS() {
|
||||
char str[64];
|
||||
int left = 10, top = 15;
|
||||
sprintf(str, "%.1f fps", fFPS);
|
||||
|
||||
DrawText(str, left+1, top+1, 0xff000000);
|
||||
DrawText(str, left, top, 0xffc0ffff);
|
||||
}
|
||||
|
||||
// Swaping buffers, so we could use another windows
|
||||
inline void AfterRenderSwapBuffers() {
|
||||
if (glGetError() != GL_NO_ERROR)
|
||||
DEBUG_LOG("glerror before swap!\n");
|
||||
|
||||
#ifdef _WIN32
|
||||
static u32 lastswaptime = 0;
|
||||
SwapBuffers(hDC);
|
||||
lastswaptime = timeGetTime();
|
||||
#else
|
||||
glXSwapBuffers(GLWin.dpy, GLWin.win);
|
||||
#endif
|
||||
}
|
||||
|
||||
// SnapeShoot helper
|
||||
inline void AfterRenderMadeSnapshoot() {
|
||||
char str[64];
|
||||
int left = 200, top = 15;
|
||||
sprintf(str, "ZeroGS %d.%d.%d - %.1f fps %s", zgsrevision, zgsbuild, zgsminor, fFPS, s_frameskipping?" - frameskipping":"");
|
||||
|
||||
DrawText(str, left+1, top+1, 0xff000000);
|
||||
DrawText(str, left, top, 0xffc0ffff);
|
||||
|
||||
if( SaveRenderTarget(strSnapshot != ""?strSnapshot.c_str():"temp.jpg", nBackbufferWidth, -nBackbufferHeight, 0)) {//(conf.options&GSOPTION_TGASNAP)?0:1) ) {
|
||||
char str[255];
|
||||
sprintf(str, "saved %s\n", strSnapshot.c_str());
|
||||
AddMessage(str, 500);
|
||||
}
|
||||
}
|
||||
|
||||
// If needed reset
|
||||
inline void AfterRendererResizeWindow() {
|
||||
Reset();
|
||||
ChangeDeviceSize(s_nNewWidth, s_nNewHeight);
|
||||
s_nNewWidth = s_nNewHeight = -1;
|
||||
}
|
||||
|
||||
// Put new values on statistic variable
|
||||
inline void AfterRenderCountStatistics() {
|
||||
if( s_nWriteDepthCount > 0 ) {
|
||||
assert( conf.mrtdepth );
|
||||
if( --s_nWriteDepthCount <= 0 ) {
|
||||
s_bWriteDepth = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if( s_nWriteDestAlphaTest > 0 ) {
|
||||
if( --s_nWriteDestAlphaTest <= 0 ) {
|
||||
s_bDestAlphaTest = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if( g_nDepthUsed > 0 ) --g_nDepthUsed;
|
||||
|
||||
s_ClutResolve = 0;
|
||||
g_nDepthUpdateCount = 0;
|
||||
}
|
||||
|
||||
// This all could be easily forefeit
|
||||
inline void AfterRendererUnimportantJob() {
|
||||
ProcessMessages();
|
||||
|
||||
if( g_bDisplayFPS )
|
||||
AfterRenderDisplayFPS();
|
||||
|
||||
AfterRenderSwapBuffers();
|
||||
|
||||
if( conf.options & GSOPTION_WIREFRAME ) {
|
||||
// clear all targets
|
||||
s_nWireframeCount = 1;
|
||||
}
|
||||
|
||||
if( g_bMakeSnapshot ) {
|
||||
AfterRenderMadeSnapshoot();
|
||||
g_bMakeSnapshot = 0;
|
||||
}
|
||||
|
||||
if( s_avicapturing )
|
||||
CaptureFrame();
|
||||
|
||||
AfterRenderCountStatistics();
|
||||
|
||||
if( s_nNewWidth >= 0 && s_nNewHeight >= 0 && !g_bIsLost )
|
||||
AfterRendererResizeWindow();
|
||||
|
||||
maxmin = 608;
|
||||
}
|
||||
|
||||
// Swich Frabuffers
|
||||
inline void AfterRendererSwitchBackToTextures() {
|
||||
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, s_uFramebuffer );
|
||||
|
||||
g_MemTargs.DestroyCleared();
|
||||
|
||||
if( s_vecTempTextures.size() > 0 )
|
||||
glDeleteTextures((GLsizei)s_vecTempTextures.size(), &s_vecTempTextures[0]);
|
||||
s_vecTempTextures.clear();
|
||||
|
||||
if( EXTWRITE->WRITE&1 ) {
|
||||
WARN_LOG("EXTWRITE\n");
|
||||
ExtWrite();
|
||||
EXTWRITE->WRITE = 0;
|
||||
}
|
||||
|
||||
if( conf.options & GSOPTION_WIREFRAME ) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
if( icurctx >= 0 ) {
|
||||
vb[icurctx].bVarsSetTarg = FALSE;
|
||||
vb[icurctx].bVarsTexSync = FALSE;
|
||||
vb[0].bVarsTexSync = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Targets Helper, for hack.
|
||||
inline void AfterRendererAutoresetTargets() {
|
||||
if( g_GameSettings & GAME_AUTORESET ) {
|
||||
s_nResolveCounts[s_nCurResolveIndex] = s_nResolved;
|
||||
s_nCurResolveIndex = (s_nCurResolveIndex+1)%ARRAY_SIZE(s_nResolveCounts);
|
||||
|
||||
int total = 0;
|
||||
for(int i = 0; i < ARRAY_SIZE(s_nResolveCounts); ++i) total += s_nResolveCounts[i];
|
||||
|
||||
if( total / ARRAY_SIZE(s_nResolveCounts) > 3 ) {
|
||||
if( s_nLastResolveReset > (int)(fFPS * 8) ) {
|
||||
// reset
|
||||
ERROR_LOG("video mem reset\n");
|
||||
s_nLastResolveReset = 0;
|
||||
memset(s_nResolveCounts, 0, sizeof(s_nResolveCounts));
|
||||
|
||||
s_RTs.ResolveAll();
|
||||
return;
|
||||
s_RTs.Destroy();
|
||||
s_DepthRTs.ResolveAll();
|
||||
s_DepthRTs.Destroy();
|
||||
|
||||
vb[0].prndr = NULL; vb[0].pdepth = NULL; vb[0].bNeedFrameCheck = 1; vb[0].bNeedZCheck = 1;
|
||||
vb[1].prndr = NULL; vb[1].pdepth = NULL; vb[1].bNeedFrameCheck = 1; vb[1].bNeedZCheck = 1;
|
||||
}
|
||||
}
|
||||
|
||||
s_nLastResolveReset++;
|
||||
}
|
||||
|
||||
if( s_nResolved > 8 ) s_nResolved = 2;
|
||||
else if( s_nResolved > 0 ) --s_nResolved;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
// The main renderer function
|
||||
void ZeroGS::RenderCRTC(int interlace)
|
||||
{
|
||||
if( g_bIsLost ) return;
|
||||
if (FrameSkippingHelper()) return;
|
||||
|
||||
u32 bInterlace = SMODE2->INT && SMODE2->FFMD && (conf.interlace < 2);
|
||||
RenderStartHelper(bInterlace);
|
||||
bool bUsingStencil = 0;
|
||||
|
||||
tex0Info dispinfo[2];
|
||||
FrameObtainDispinfo(bInterlace, dispinfo);
|
||||
|
||||
// start from the last circuit
|
||||
for(int i = !PMODE->SLBG; i >= 0; --i) {
|
||||
|
||||
tex0Info& texframe = dispinfo[i];
|
||||
if( texframe.th <= 1 )
|
||||
continue;
|
||||
|
||||
if (SMODE2->INT && SMODE2->FFMD)
|
||||
texframe.th >>= 1;
|
||||
|
||||
if( i == 0 )
|
||||
RenderSetupBlending();
|
||||
|
||||
if( bUsingStencil )
|
||||
RenderSetupStencil(i);
|
||||
|
||||
if( texframe.psm == 0x12 ) {
|
||||
RenderCRTC24helper(bInterlace, interlace, texframe.psm);
|
||||
continue;
|
||||
}
|
||||
|
||||
// We shader targets between two functions, so declare it here;
|
||||
list<CRenderTarget*> listTargs;
|
||||
|
||||
// if we could not draw image from target's do it from memory
|
||||
if ( !RenderCheckForTargets(texframe, listTargs, i, &bUsingStencil, interlace, bInterlace) )
|
||||
RenderCheckForMemory(texframe, listTargs, interlace, bInterlace);
|
||||
}
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
AfterRendererUnimportantJob();
|
||||
AfterRendererSwitchBackToTextures();
|
||||
AfterRendererAutoresetTargets();
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,152 @@
|
|||
/* ZZ Open GL graphics plugin
|
||||
* Copyright (c)2009 zeydlitz@gmail.com
|
||||
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2006
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
// Save and Load.
|
||||
|
||||
//------------------ Includes
|
||||
#include "zerogs.h"
|
||||
#include "targets.h"
|
||||
|
||||
//----------------------- Defines
|
||||
|
||||
#define VBSAVELIMIT ((u32)((u8*)&vb[0].nNextFrameHeight-(u8*)&vb[0]))
|
||||
#define ZEROGS_SAVEVER 0xaa000005
|
||||
|
||||
//------------------ Variables
|
||||
|
||||
// Hack for save game compatible!
|
||||
#ifdef _DEBUG
|
||||
char *libraryNameX = "ZeroGS-Pg OpenGL (Debug) ";
|
||||
#elif defined(RELEASE_TO_PUBLIC)
|
||||
char *libraryNameX = "ZeroGS Playground OpenGL ";
|
||||
#else
|
||||
char *libraryNameX = "ZeroGS-Pg OpenGL (Dev) ";
|
||||
#endif
|
||||
|
||||
//------------------ Code
|
||||
|
||||
extern char *libraryName;
|
||||
extern u32 s_uTex1Data[2][2], s_uClampData[2];
|
||||
|
||||
int ZeroGS::Save(s8* pbydata)
|
||||
{
|
||||
if( pbydata == NULL )
|
||||
return 40 + 0x00400000 + sizeof(gs) + 2*VBSAVELIMIT + 2*sizeof(frameInfo) + 4 + 256*4;
|
||||
|
||||
s_RTs.ResolveAll();
|
||||
s_DepthRTs.ResolveAll();
|
||||
|
||||
strcpy((char*)pbydata, libraryNameX);
|
||||
*(u32*)(pbydata+16) = ZEROGS_SAVEVER;
|
||||
pbydata += 32;
|
||||
|
||||
*(int*)pbydata = icurctx; pbydata += 4;
|
||||
*(int*)pbydata = VBSAVELIMIT; pbydata += 4;
|
||||
|
||||
memcpy(pbydata, g_pbyGSMemory, 0x00400000);
|
||||
pbydata += 0x00400000;
|
||||
|
||||
memcpy(pbydata, g_pbyGSClut, 256*4);
|
||||
pbydata += 256*4;
|
||||
|
||||
*(int*)pbydata = sizeof(gs);
|
||||
pbydata += 4;
|
||||
memcpy(pbydata, &gs, sizeof(gs));
|
||||
pbydata += sizeof(gs);
|
||||
|
||||
for(int i = 0; i < 2; ++i) {
|
||||
memcpy(pbydata, &vb[i], VBSAVELIMIT);
|
||||
pbydata += VBSAVELIMIT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ZeroGS::Load(s8* pbydata)
|
||||
{
|
||||
memset(s_uTex1Data, 0, sizeof(s_uTex1Data));
|
||||
memset(s_uClampData, 0, sizeof(s_uClampData));
|
||||
|
||||
g_nCurVBOIndex = 0;
|
||||
|
||||
// first 32 bytes are the id
|
||||
u32 savever = *(u32*)(pbydata+16);
|
||||
|
||||
if( strncmp((char*)pbydata, libraryNameX, 6) == 0 && (savever == ZEROGS_SAVEVER || savever == 0xaa000004) ) {
|
||||
|
||||
g_MemTargs.Destroy();
|
||||
|
||||
GSStateReset();
|
||||
pbydata += 32;
|
||||
|
||||
int context = *(int*)pbydata; pbydata += 4;
|
||||
u32 savelimit = VBSAVELIMIT;
|
||||
|
||||
savelimit = *(u32*)pbydata; pbydata += 4;
|
||||
|
||||
memcpy(g_pbyGSMemory, pbydata, 0x00400000);
|
||||
pbydata += 0x00400000;
|
||||
|
||||
memcpy(g_pbyGSClut, pbydata, 256*4);
|
||||
pbydata += 256*4;
|
||||
|
||||
memset(&gs, 0, sizeof(gs));
|
||||
|
||||
int savedgssize;
|
||||
if( savever == 0xaa000004 )
|
||||
savedgssize = 0x1d0;
|
||||
else {
|
||||
savedgssize = *(int*)pbydata;
|
||||
pbydata += 4;
|
||||
}
|
||||
|
||||
memcpy(&gs, pbydata, savedgssize);
|
||||
pbydata += savedgssize;
|
||||
prim = &gs._prim[gs.prac];
|
||||
|
||||
vb[0].Destroy();
|
||||
memcpy(&vb[0], pbydata, min(savelimit, VBSAVELIMIT));
|
||||
pbydata += savelimit;
|
||||
vb[0].pBufferData = NULL;
|
||||
|
||||
vb[1].Destroy();
|
||||
memcpy(&vb[1], pbydata, min(savelimit, VBSAVELIMIT));
|
||||
pbydata += savelimit;
|
||||
vb[1].pBufferData = NULL;
|
||||
|
||||
for(int i = 0; i < 2; ++i) {
|
||||
vb[i].Init(VB_BUFFERSIZE);
|
||||
vb[i].bNeedZCheck = vb[i].bNeedFrameCheck = 1;
|
||||
|
||||
vb[i].bSyncVars = 0; vb[i].bNeedTexCheck = 1;
|
||||
memset(vb[i].uCurTex0Data, 0, sizeof(vb[i].uCurTex0Data));
|
||||
}
|
||||
|
||||
icurctx = -1;
|
||||
|
||||
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, s_uFramebuffer ); // switch to the backbuffer
|
||||
SetFogColor(gs.fogcol);
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -0,0 +1,627 @@
|
|||
/* ZZ Open GL graphics plugin
|
||||
* Copyright (c)2009 zeydlitz@gmail.com
|
||||
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2006
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
// ZZogl Shader manipulation functions.
|
||||
|
||||
//------------------- Includes
|
||||
#include "zerogs.h"
|
||||
#include "ZeroGSShaders/zerogsshaders.h"
|
||||
#include "zpipe.h"
|
||||
|
||||
// ----------------- Defines
|
||||
|
||||
using namespace ZeroGS;
|
||||
//------------------ Constants
|
||||
|
||||
// ----------------- Global Variables
|
||||
namespace ZeroGS {
|
||||
FRAGMENTSHADER ppsBitBlt[2], ppsBitBltDepth, ppsOne;
|
||||
FRAGMENTSHADER ppsBaseTexture, ppsConvert16to32, ppsConvert32to16;
|
||||
}
|
||||
|
||||
// Debug variable, store name of the function that call the shader.
|
||||
const char* ShaderCallerName = "";
|
||||
const char* ShaderHandleName = "";
|
||||
|
||||
//------------------ Code
|
||||
|
||||
// Error handler. Setup in ZZogl_Create once.
|
||||
void HandleCgError(CGcontext ctx, CGerror err, void* appdata)
|
||||
{
|
||||
ERROR_LOG("%s->%s: %s\n", ShaderCallerName, ShaderHandleName, cgGetErrorString(err));
|
||||
const char* listing = cgGetLastListing(g_cgcontext);
|
||||
if (listing != NULL)
|
||||
DEBUG_LOG(" last listing: %s\n", listing);
|
||||
}
|
||||
|
||||
// This is helper of cgGLSetParameter4fv, made for debug purpose.
|
||||
// Name could be any string. We must use it on compilation time, because erroneus handler does not
|
||||
// return name
|
||||
void ZZcgSetParameter4fv(CGparameter param, const float* v, const char* name) {
|
||||
ShaderHandleName = name;
|
||||
cgGLSetParameter4fv(param, v);
|
||||
}
|
||||
|
||||
#define SET_UNIFORMPARAM(var, name) { \
|
||||
p = cgGetNamedParameter(pf->prog, name); \
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) \
|
||||
pf->var = p; \
|
||||
} \
|
||||
|
||||
void SetupFragmentProgramParameters(FRAGMENTSHADER* pf, int context, int type)
|
||||
{
|
||||
// uniform parameters
|
||||
CGparameter p;
|
||||
|
||||
p = cgGetNamedParameter(pf->prog, "g_fFogColor");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
cgConnectParameter(g_fparamFogColor, p);
|
||||
}
|
||||
|
||||
SET_UNIFORMPARAM(sOneColor, "g_fOneColor");
|
||||
SET_UNIFORMPARAM(sBitBltZ, "g_fBitBltZ");
|
||||
SET_UNIFORMPARAM(sInvTexDims, "g_fInvTexDims");
|
||||
SET_UNIFORMPARAM(fTexAlpha2, "fTexAlpha2");
|
||||
SET_UNIFORMPARAM(fTexOffset, "g_fTexOffset");
|
||||
SET_UNIFORMPARAM(fTexDims, "g_fTexDims");
|
||||
SET_UNIFORMPARAM(fTexBlock, "g_fTexBlock");
|
||||
SET_UNIFORMPARAM(fClampExts, "g_fClampExts");
|
||||
SET_UNIFORMPARAM(fTexWrapMode, "TexWrapMode");
|
||||
SET_UNIFORMPARAM(fRealTexDims, "g_fRealTexDims");
|
||||
SET_UNIFORMPARAM(fTestBlack, "g_fTestBlack");
|
||||
SET_UNIFORMPARAM(fPageOffset, "g_fPageOffset");
|
||||
SET_UNIFORMPARAM(fTexAlpha, "fTexAlpha");
|
||||
|
||||
// textures
|
||||
p = cgGetNamedParameter(pf->prog, "g_sBlocks");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
cgGLSetTextureParameter(p, ptexBlocks);
|
||||
cgGLEnableTextureParameter(p);
|
||||
}
|
||||
|
||||
// cg parameter usage is wrong, so do it manually
|
||||
if( type == 3 ) {
|
||||
p = cgGetNamedParameter(pf->prog, "g_sConv16to32");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
cgGLSetTextureParameter(p, ptexConv16to32);
|
||||
cgGLEnableTextureParameter(p);
|
||||
}
|
||||
}
|
||||
else if( type == 4 ) {
|
||||
p = cgGetNamedParameter(pf->prog, "g_sConv32to16");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
cgGLSetTextureParameter(p, ptexConv32to16);
|
||||
cgGLEnableTextureParameter(p);
|
||||
}
|
||||
}
|
||||
else {
|
||||
p = cgGetNamedParameter(pf->prog, "g_sBilinearBlocks");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
cgGLSetTextureParameter(p, ptexBilinearBlocks);
|
||||
cgGLEnableTextureParameter(p);
|
||||
}
|
||||
}
|
||||
|
||||
p = cgGetNamedParameter(pf->prog, "g_sMemory");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
//cgGLEnableTextureParameter(p);
|
||||
pf->sMemory = p;
|
||||
}
|
||||
p = cgGetNamedParameter(pf->prog, "g_sSrcFinal");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
//cgGLEnableTextureParameter(p);
|
||||
pf->sFinal = p;
|
||||
}
|
||||
p = cgGetNamedParameter(pf->prog, "g_sBitwiseANDX");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
//cgGLEnableTextureParameter(p);
|
||||
pf->sBitwiseANDX = p;
|
||||
}
|
||||
p = cgGetNamedParameter(pf->prog, "g_sBitwiseANDY");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
//cgGLEnableTextureParameter(p);
|
||||
pf->sBitwiseANDY = p;
|
||||
}
|
||||
p = cgGetNamedParameter(pf->prog, "g_sCLUT");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
//cgGLEnableTextureParameter(p);
|
||||
pf->sCLUT = p;
|
||||
}
|
||||
p = cgGetNamedParameter(pf->prog, "g_sInterlace");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
//cgGLEnableTextureParameter(p);
|
||||
pf->sInterlace = p;
|
||||
}
|
||||
|
||||
// set global shader constants
|
||||
p = cgGetNamedParameter(pf->prog, "g_fExactColor");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE ) {
|
||||
cgGLSetParameter4fv(p, Vector(0.5f, (g_GameSettings&GAME_EXACTCOLOR)?0.9f/256.0f:0.5f/256.0f, 0,1/255.0f));
|
||||
}
|
||||
|
||||
p = cgGetNamedParameter(pf->prog, "g_fBilinear");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(-0.2f, -0.65f, 0.9f, 1.0f / 32767.0f ));
|
||||
|
||||
p = cgGetNamedParameter(pf->prog, "g_fZBias");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(1.0f/256.0f, 1.0004f, 1, 0.5f));
|
||||
|
||||
p = cgGetNamedParameter(pf->prog, "g_fc0");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(0,1, 0.001f, 0.5f));
|
||||
|
||||
p = cgGetNamedParameter(pf->prog, "g_fMult");
|
||||
if( p != NULL && cgIsParameterUsed(p, pf->prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(1/1024.0f, 0.2f/1024.0f, 1/128.0f, 1/512.0f));
|
||||
}
|
||||
|
||||
void SetupVertexProgramParameters(CGprogram prog, int context)
|
||||
{
|
||||
CGparameter p;
|
||||
|
||||
p = cgGetNamedParameter(prog, "g_fPosXY");
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE )
|
||||
cgConnectParameter(g_vparamPosXY[context], p);
|
||||
|
||||
// Set Z-test, log or no log;
|
||||
if (g_GameSettings&GAME_NOLOGZ) {
|
||||
g_vdepth = Vector( 255.0 /256.0f, 255.0/65536.0f, 255.0f/(65535.0f*256.0f), 1.0f/(65536.0f*65536.0f));
|
||||
vlogz = Vector( 1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else {
|
||||
g_vdepth = Vector( 256.0f*65536.0f, 65536.0f, 256.0f, 65536.0f*65536.0f);
|
||||
vlogz = Vector( 0.0f, 1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
p = cgGetNamedParameter(prog, "g_fZ");
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE ) {
|
||||
cgGLSetParameter4fv(p, g_vdepth);
|
||||
|
||||
p = cgGetNamedParameter(prog, "g_fZMin"); // Switch to flat-z when needed
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE ) {
|
||||
//ERROR_LOG ("Use flat-z\n");
|
||||
cgGLSetParameter4fv(p, vlogz);
|
||||
}
|
||||
else
|
||||
ERROR_LOG ("Shader file version is outdated! Only is log-Z possible\n");
|
||||
}
|
||||
|
||||
Vector vnorm = Vector(g_filog32, 0, 0,0);
|
||||
p = cgGetNamedParameter(prog, "g_fZNorm");
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, vnorm);
|
||||
|
||||
p = cgGetNamedParameter(prog, "g_fBilinear");
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(-0.2f, -0.65f, 0.9f, 1.0f / 32767.0f ));
|
||||
|
||||
p = cgGetNamedParameter(prog, "g_fZBias");
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(1.0f/256.0f, 1.0004f, 1, 0.5f));
|
||||
|
||||
p = cgGetNamedParameter(prog, "g_fc0");
|
||||
if( p != NULL && cgIsParameterUsed(p, prog) == CG_TRUE )
|
||||
cgGLSetParameter4fv(p, Vector(0,1, 0.001f, 0.5f));
|
||||
}
|
||||
|
||||
#ifndef DEVBUILD
|
||||
|
||||
#define LOAD_VS(Index, prog) { \
|
||||
assert( mapShaderResources.find(Index) != mapShaderResources.end() ); \
|
||||
header = mapShaderResources[Index]; \
|
||||
assert( (header) != NULL && (header)->index == (Index) ); \
|
||||
prog = cgCreateProgram(g_cgcontext, CG_OBJECT, (char*)(s_lpShaderResources + (header)->offset), cgvProf, NULL, NULL); \
|
||||
if( !cgIsProgram(prog) ) { \
|
||||
ERROR_LOG("Failed to load vs %d: \n%s\n", Index, cgGetLastListing(g_cgcontext)); \
|
||||
return false; \
|
||||
} \
|
||||
cgGLLoadProgram(prog); \
|
||||
if( cgGetError() != CG_NO_ERROR ) ERROR_LOG("failed to load program %d\n", Index); \
|
||||
SetupVertexProgramParameters(prog, !!(Index&SH_CONTEXT1)); \
|
||||
} \
|
||||
|
||||
#define LOAD_PS(Index, fragment) { \
|
||||
bLoadSuccess = true; \
|
||||
assert( mapShaderResources.find(Index) != mapShaderResources.end() ); \
|
||||
header = mapShaderResources[Index]; \
|
||||
fragment.prog = cgCreateProgram(g_cgcontext, CG_OBJECT, (char*)(s_lpShaderResources + (header)->offset), cgfProf, NULL, NULL); \
|
||||
if( !cgIsProgram(fragment.prog) ) { \
|
||||
ERROR_LOG("Failed to load ps %d: \n%s\n", Index, cgGetLastListing(g_cgcontext)); \
|
||||
return false; \
|
||||
} \
|
||||
cgGLLoadProgram(fragment.prog); \
|
||||
if( cgGetError() != CG_NO_ERROR ) { \
|
||||
ERROR_LOG("failed to load program %d\n", Index); \
|
||||
bLoadSuccess = false; \
|
||||
} \
|
||||
SetupFragmentProgramParameters(&fragment, !!(Index&SH_CONTEXT1), 0); \
|
||||
} \
|
||||
|
||||
bool ZeroGS::LoadEffects()
|
||||
{
|
||||
assert( s_lpShaderResources != NULL );
|
||||
|
||||
// process the header
|
||||
u32 num = *(u32*)s_lpShaderResources;
|
||||
int compressed_size = *(int*)(s_lpShaderResources+4);
|
||||
int real_size = *(int*)(s_lpShaderResources+8);
|
||||
int out;
|
||||
|
||||
char* pbuffer = (char*)malloc(real_size);
|
||||
inf((char*)s_lpShaderResources+12, &pbuffer[0], compressed_size, real_size, &out);
|
||||
assert(out == real_size);
|
||||
|
||||
s_lpShaderResources = (u8*)pbuffer;
|
||||
SHADERHEADER* header = (SHADERHEADER*)s_lpShaderResources;
|
||||
|
||||
mapShaderResources.clear();
|
||||
while(num-- > 0 ) {
|
||||
mapShaderResources[header->index] = header;
|
||||
++header;
|
||||
}
|
||||
|
||||
// clear the textures
|
||||
for(int i = 0; i < ARRAY_SIZE(ppsTexture); ++i) {
|
||||
SAFE_RELEASE_PROG(ppsTexture[i].prog);
|
||||
ppsTexture[i].prog = NULL;
|
||||
}
|
||||
#ifndef _DEBUG
|
||||
memset(ppsTexture, 0, sizeof(ppsTexture));
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// called
|
||||
bool ZeroGS::LoadExtraEffects()
|
||||
{
|
||||
SHADERHEADER* header;
|
||||
bool bLoadSuccess = true;
|
||||
|
||||
const int vsshaders[4] = { SH_REGULARVS, SH_TEXTUREVS, SH_REGULARFOGVS, SH_TEXTUREFOGVS };
|
||||
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
LOAD_VS(vsshaders[i], pvs[2*i]);
|
||||
LOAD_VS((vsshaders[i] | SH_CONTEXT1), pvs[2*i+1]);
|
||||
//if( conf.mrtdepth ) {
|
||||
LOAD_VS((vsshaders[i] | SH_WRITEDEPTH), pvs[2*i+8]);
|
||||
LOAD_VS((vsshaders[i] | SH_WRITEDEPTH | SH_CONTEXT1), pvs[2*i+8+1]);
|
||||
// }
|
||||
// else {
|
||||
// pvs[2*i+8] = pvs[2*i+8+1] = NULL;
|
||||
// }
|
||||
}
|
||||
|
||||
LOAD_VS(SH_BITBLTVS, pvsBitBlt.prog);
|
||||
pvsBitBlt.sBitBltPos = cgGetNamedParameter(pvsBitBlt.prog, "g_fBitBltPos");
|
||||
pvsBitBlt.sBitBltTex = cgGetNamedParameter(pvsBitBlt.prog, "g_fBitBltTex");
|
||||
pvsBitBlt.fBitBltTrans = cgGetNamedParameter(pvsBitBlt.prog, "g_fBitBltTrans");
|
||||
|
||||
LOAD_PS(SH_REGULARPS, ppsRegular[0]);
|
||||
LOAD_PS(SH_REGULARFOGPS, ppsRegular[1]);
|
||||
|
||||
if( conf.mrtdepth ) {
|
||||
LOAD_PS(SH_REGULARPS, ppsRegular[2]);
|
||||
if( !bLoadSuccess )
|
||||
conf.mrtdepth = 0;
|
||||
LOAD_PS(SH_REGULARFOGPS, ppsRegular[3]);
|
||||
if( !bLoadSuccess )
|
||||
conf.mrtdepth = 0;
|
||||
}
|
||||
|
||||
LOAD_PS(SH_BITBLTPS, ppsBitBlt[0]);
|
||||
LOAD_PS(SH_BITBLTAAPS, ppsBitBlt[1]);
|
||||
if( !bLoadSuccess ) {
|
||||
ERROR_LOG("Failed to load BitBltAAPS, using BitBltPS\n");
|
||||
LOAD_PS(SH_BITBLTPS, ppsBitBlt[1]);
|
||||
}
|
||||
LOAD_PS(SH_BITBLTDEPTHPS, ppsBitBltDepth);
|
||||
LOAD_PS(SH_CRTCTARGPS, ppsCRTCTarg[0]);
|
||||
LOAD_PS(SH_CRTCTARGINTERPS, ppsCRTCTarg[1]);
|
||||
|
||||
g_bCRTCBilinear = TRUE;
|
||||
LOAD_PS(SH_CRTCPS, ppsCRTC[0]);
|
||||
if( !bLoadSuccess ) {
|
||||
// switch to simpler
|
||||
g_bCRTCBilinear = FALSE;
|
||||
LOAD_PS(SH_CRTC_NEARESTPS, ppsCRTC[0]);
|
||||
LOAD_PS(SH_CRTCINTER_NEARESTPS, ppsCRTC[0]);
|
||||
}
|
||||
else {
|
||||
LOAD_PS(SH_CRTCINTERPS, ppsCRTC[1]);
|
||||
}
|
||||
|
||||
if( !bLoadSuccess )
|
||||
ERROR_LOG("Failed to create CRTC shaders\n");
|
||||
|
||||
LOAD_PS(SH_CRTC24PS, ppsCRTC24[0]);
|
||||
LOAD_PS(SH_CRTC24INTERPS, ppsCRTC24[1]);
|
||||
LOAD_PS(SH_ZEROPS, ppsOne);
|
||||
LOAD_PS(SH_BASETEXTUREPS, ppsBaseTexture);
|
||||
LOAD_PS(SH_CONVERT16TO32PS, ppsConvert16to32);
|
||||
LOAD_PS(SH_CONVERT32TO16PS, ppsConvert32to16);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int testaem, int exactcolor, const clampInfo& clamp, int context, bool* pbFailed)
|
||||
{
|
||||
int texwrap;
|
||||
assert( texfilter < NUM_FILTERS );
|
||||
|
||||
if(g_nPixelShaderVer&SHADER_REDUCED)
|
||||
texfilter = 0;
|
||||
assert(!(g_nPixelShaderVer&SHADER_REDUCED) || !exactcolor);
|
||||
|
||||
if( clamp.wms == clamp.wmt ) {
|
||||
switch( clamp.wms ) {
|
||||
case 0: texwrap = TEXWRAP_REPEAT; break;
|
||||
case 1: texwrap = TEXWRAP_CLAMP; break;
|
||||
case 2: texwrap = TEXWRAP_CLAMP; break;
|
||||
default: texwrap = TEXWRAP_REGION_REPEAT; break;
|
||||
}
|
||||
}
|
||||
else if( clamp.wms==3||clamp.wmt==3)
|
||||
texwrap = TEXWRAP_REGION_REPEAT;
|
||||
else
|
||||
texwrap = TEXWRAP_REPEAT_CLAMP;
|
||||
|
||||
int index = GET_SHADER_INDEX(type, texfilter, texwrap, fog, s_bWriteDepth, testaem, exactcolor, context, 0);
|
||||
|
||||
assert( index < ARRAY_SIZE(ppsTexture) );
|
||||
FRAGMENTSHADER* pf = ppsTexture+index;
|
||||
|
||||
if( pbFailed != NULL ) *pbFailed = false;
|
||||
|
||||
if( pf->prog != NULL )
|
||||
return pf;
|
||||
|
||||
if( (g_nPixelShaderVer & SHADER_ACCURATE) && mapShaderResources.find(index+NUM_SHADERS*SHADER_ACCURATE) != mapShaderResources.end() )
|
||||
index += NUM_SHADERS*SHADER_ACCURATE;
|
||||
|
||||
assert( mapShaderResources.find(index) != mapShaderResources.end() );
|
||||
SHADERHEADER* header = mapShaderResources[index];
|
||||
if( header == NULL )
|
||||
ERROR_LOG("%d %d\n", index, g_nPixelShaderVer);
|
||||
assert( header != NULL );
|
||||
|
||||
//DEBUG_LOG("shader:\n%s\n", (char*)(s_lpShaderResources + (header)->offset));
|
||||
pf->prog = cgCreateProgram(g_cgcontext, CG_OBJECT, (char*)(s_lpShaderResources + (header)->offset), cgfProf, NULL, NULL);
|
||||
if( pf->prog != NULL && cgIsProgram(pf->prog) && cgGetError() == CG_NO_ERROR ) {
|
||||
SetupFragmentProgramParameters(pf, context, type);
|
||||
cgGLLoadProgram(pf->prog);
|
||||
if( cgGetError() != CG_NO_ERROR ) {
|
||||
// cgGLLoadProgram(pf->prog);
|
||||
// if( cgGetError() != CG_NO_ERROR ) {
|
||||
ERROR_LOG("Failed to load shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
|
||||
if( pbFailed != NULL ) *pbFailed = true;
|
||||
return pf;
|
||||
// }
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
ERROR_LOG("Failed to create shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
|
||||
if( pbFailed != NULL ) *pbFailed = true;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#else // not RELEASE_TO_PUBLIC
|
||||
|
||||
#define LOAD_VS(name, prog, shaderver) { \
|
||||
prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, EFFECT_NAME, shaderver, name, args); \
|
||||
if( !cgIsProgram(prog) ) { \
|
||||
ERROR_LOG("Failed to load vs %s: \n%s\n", name, cgGetLastListing(g_cgcontext)); \
|
||||
return false; \
|
||||
} \
|
||||
cgGLLoadProgram(prog); \
|
||||
if( cgGetError() != CG_NO_ERROR ) ERROR_LOG("failed to load program %s\n", name); \
|
||||
SetupVertexProgramParameters(prog, args[0]==context1); \
|
||||
} \
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define SET_PSFILENAME(frag, name) frag.filename = name
|
||||
#else
|
||||
#define SET_PSFILENAME(frag, name)
|
||||
#endif
|
||||
|
||||
#define LOAD_PS(name, fragment, shaderver) { \
|
||||
bLoadSuccess = true; \
|
||||
fragment.prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, EFFECT_NAME, shaderver, name, args); \
|
||||
if( !cgIsProgram(fragment.prog) ) { \
|
||||
ERROR_LOG("Failed to load ps %s: \n%s\n", name, cgGetLastListing(g_cgcontext)); \
|
||||
return false; \
|
||||
} \
|
||||
cgGLLoadProgram(fragment.prog); \
|
||||
if( cgGetError() != CG_NO_ERROR ) { \
|
||||
ERROR_LOG("failed to load program %s\n", name); \
|
||||
bLoadSuccess = false; \
|
||||
} \
|
||||
SetupFragmentProgramParameters(&fragment, args[0]==context1, 0); \
|
||||
SET_PSFILENAME(fragment, name); \
|
||||
} \
|
||||
|
||||
bool ZeroGS::LoadEffects()
|
||||
{
|
||||
// clear the textures
|
||||
for(int i = 0; i < ARRAY_SIZE(ppsTexture); ++i) {
|
||||
SAFE_RELEASE_PROG(ppsTexture[i].prog);
|
||||
}
|
||||
|
||||
#ifndef _DEBUG
|
||||
memset(ppsTexture, 0, sizeof(ppsTexture));
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ZeroGS::LoadExtraEffects()
|
||||
{
|
||||
const char* args[] = { NULL , NULL, NULL, NULL };
|
||||
char context0[255], context1[255];
|
||||
sprintf(context0, "-I%sctx0", EFFECT_DIR);
|
||||
sprintf(context1, "-I%sctx1", EFFECT_DIR);
|
||||
char* write_depth = "-DWRITE_DEPTH";
|
||||
bool bLoadSuccess = true;
|
||||
|
||||
const char* pvsshaders[4] = { "RegularVS", "TextureVS", "RegularFogVS", "TextureFogVS" };
|
||||
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
args[0] = context0;
|
||||
args[1] = NULL;
|
||||
LOAD_VS(pvsshaders[i], pvs[2*i], cgvProf);
|
||||
args[0] = context1;
|
||||
LOAD_VS(pvsshaders[i], pvs[2*i+1], cgvProf);
|
||||
|
||||
//if( conf.mrtdepth ) {
|
||||
args[0] = context0;
|
||||
args[1] = write_depth;
|
||||
LOAD_VS(pvsshaders[i], pvs[2*i+8], cgvProf);
|
||||
args[0] = context1;
|
||||
LOAD_VS(pvsshaders[i], pvs[2*i+8+1], cgvProf);
|
||||
// }
|
||||
// else {
|
||||
// pvs[2*i+8] = pvs[2*i+8+1] = NULL;
|
||||
// }
|
||||
}
|
||||
|
||||
args[0] = context0;
|
||||
args[1] = NULL;
|
||||
LOAD_VS("BitBltVS", pvsBitBlt.prog, cgvProf);
|
||||
pvsBitBlt.sBitBltPos = cgGetNamedParameter(pvsBitBlt.prog, "g_fBitBltPos");
|
||||
pvsBitBlt.sBitBltTex = cgGetNamedParameter(pvsBitBlt.prog, "g_fBitBltTex");
|
||||
pvsBitBlt.fBitBltTrans = cgGetNamedParameter(pvsBitBlt.prog, "g_fBitBltTrans");
|
||||
|
||||
LOAD_PS("RegularPS", ppsRegular[0], cgfProf);
|
||||
LOAD_PS("RegularFogPS", ppsRegular[1], cgfProf);
|
||||
|
||||
if( conf.mrtdepth ) {
|
||||
args[0] = context0;
|
||||
args[1] = write_depth;
|
||||
LOAD_PS("RegularPS", ppsRegular[2], cgfProf);
|
||||
if( !bLoadSuccess )
|
||||
conf.mrtdepth = 0;
|
||||
LOAD_PS("RegularFogPS", ppsRegular[3], cgfProf);
|
||||
if( !bLoadSuccess )
|
||||
conf.mrtdepth = 0;
|
||||
}
|
||||
|
||||
LOAD_PS("BitBltPS", ppsBitBlt[0], cgfProf);
|
||||
LOAD_PS("BitBltAAPS", ppsBitBlt[1], cgfProf);
|
||||
if( !bLoadSuccess ) {
|
||||
ERROR_LOG("Failed to load BitBltAAPS, using BitBltPS\n");
|
||||
LOAD_PS("BitBltPS", ppsBitBlt[1], cgfProf);
|
||||
}
|
||||
|
||||
LOAD_PS("BitBltDepthPS", ppsBitBltDepth, cgfProf);
|
||||
LOAD_PS("CRTCTargPS", ppsCRTCTarg[0], cgfProf);
|
||||
LOAD_PS("CRTCTargInterPS", ppsCRTCTarg[1], cgfProf);
|
||||
|
||||
g_bCRTCBilinear = TRUE;
|
||||
LOAD_PS("CRTCPS", ppsCRTC[0], cgfProf);
|
||||
if( !bLoadSuccess ) {
|
||||
// switch to simpler
|
||||
g_bCRTCBilinear = FALSE;
|
||||
LOAD_PS("CRTCPS_Nearest", ppsCRTC[0], cgfProf);
|
||||
LOAD_PS("CRTCInterPS_Nearest", ppsCRTC[0], cgfProf);
|
||||
}
|
||||
else {
|
||||
LOAD_PS("CRTCInterPS", ppsCRTC[1], cgfProf);
|
||||
}
|
||||
|
||||
if( !bLoadSuccess )
|
||||
ERROR_LOG("Failed to create CRTC shaders\n");
|
||||
|
||||
LOAD_PS("CRTC24PS", ppsCRTC24[0], cgfProf); LOAD_PS("CRTC24InterPS", ppsCRTC24[1], cgfProf);
|
||||
LOAD_PS("ZeroPS", ppsOne, cgfProf);
|
||||
LOAD_PS("BaseTexturePS", ppsBaseTexture, cgfProf);
|
||||
LOAD_PS("Convert16to32PS", ppsConvert16to32, cgfProf);
|
||||
LOAD_PS("Convert32to16PS", ppsConvert32to16, cgfProf);
|
||||
|
||||
// if( !conf.mrtdepth ) {
|
||||
// ERROR_LOG("Disabling MRT depth writing\n");
|
||||
// s_bWriteDepth = FALSE;
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FRAGMENTSHADER* ZeroGS::LoadShadeEffect(int type, int texfilter, int fog, int testaem, int exactcolor, const clampInfo& clamp, int context, bool* pbFailed)
|
||||
{
|
||||
int texwrap;
|
||||
|
||||
assert( texfilter < NUM_FILTERS );
|
||||
//assert( g_nPixelShaderVer == SHADER_30 );
|
||||
if( clamp.wms == clamp.wmt ) {
|
||||
switch( clamp.wms ) {
|
||||
case 0: texwrap = TEXWRAP_REPEAT; break;
|
||||
case 1: texwrap = TEXWRAP_CLAMP; break;
|
||||
case 2: texwrap = TEXWRAP_CLAMP; break;
|
||||
default:
|
||||
texwrap = TEXWRAP_REGION_REPEAT; break;
|
||||
}
|
||||
}
|
||||
else if( clamp.wms==3||clamp.wmt==3)
|
||||
texwrap = TEXWRAP_REGION_REPEAT;
|
||||
else
|
||||
texwrap = TEXWRAP_REPEAT_CLAMP;
|
||||
|
||||
int index = GET_SHADER_INDEX(type, texfilter, texwrap, fog, s_bWriteDepth, testaem, exactcolor, context, 0);
|
||||
|
||||
if( pbFailed != NULL ) *pbFailed = false;
|
||||
|
||||
FRAGMENTSHADER* pf = ppsTexture+index;
|
||||
|
||||
if( pf->prog != NULL )
|
||||
return pf;
|
||||
|
||||
pf->prog = LoadShaderFromType(EFFECT_DIR, EFFECT_NAME, type, texfilter, texwrap, fog, s_bWriteDepth, testaem, exactcolor, g_nPixelShaderVer, context);
|
||||
|
||||
if( pf->prog != NULL ) {
|
||||
#ifdef _DEBUG
|
||||
char str[255];
|
||||
sprintf(str, "Texture%s%d_%sPS", fog?"Fog":"", texfilter, g_pTexTypes[type]);
|
||||
pf->filename = str;
|
||||
#endif
|
||||
SetupFragmentProgramParameters(pf, context, type);
|
||||
cgGLLoadProgram(pf->prog);
|
||||
if( cgGetError() != CG_NO_ERROR ) {
|
||||
// try again
|
||||
// cgGLLoadProgram(pf->prog);
|
||||
// if( cgGetError() != CG_NO_ERROR ) {
|
||||
ERROR_LOG("Failed to load shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
|
||||
if( pbFailed != NULL ) *pbFailed = true;
|
||||
//assert(0);
|
||||
// NULL makes things crash
|
||||
return pf;
|
||||
// }
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
ERROR_LOG("Failed to create shader %d,%d,%d,%d\n", type, fog, texfilter, 4*clamp.wms+clamp.wmt);
|
||||
if( pbFailed != NULL ) *pbFailed = true;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // RELEASE_TO_PUBLIC
|
||||
|
|
@ -0,0 +1,552 @@
|
|||
/* ZZ Open GL graphics plugin
|
||||
* Copyright (c)2009 zeydlitz@gmail.com
|
||||
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2006
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
// Texture and avi saving to file functions
|
||||
|
||||
//------------------ Includes
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# include <aviUtil.h>
|
||||
# include "resource.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "zerogs.h"
|
||||
#include "targets.h"
|
||||
#include "Mem.h"
|
||||
|
||||
|
||||
extern "C" {
|
||||
#ifdef _WIN32
|
||||
# define XMD_H
|
||||
# undef FAR
|
||||
#define HAVE_BOOLEAN
|
||||
#endif
|
||||
|
||||
#include "jpeglib.h" // This library want to be after zerogs.h
|
||||
}
|
||||
|
||||
//------------------ Defines
|
||||
#define TGA_FILE_NAME_MAX_LENGTH 20
|
||||
#define MAX_NUMBER_SAVED_TGA 200
|
||||
|
||||
//Windows have no snprintf
|
||||
#if defined(_WIN32)
|
||||
# define snprintf sprintf_s
|
||||
#endif
|
||||
//------------------ Constants
|
||||
|
||||
//------------------ Global Variables
|
||||
int TexNumber = 0;
|
||||
int s_aviinit = 0;
|
||||
|
||||
//------------------ Code
|
||||
|
||||
// Set variables need to made a snapshoot when it's possible
|
||||
void
|
||||
ZeroGS::SaveSnapshot(const char* filename)
|
||||
{
|
||||
g_bMakeSnapshot = 1;
|
||||
strSnapshot = filename;
|
||||
}
|
||||
|
||||
// Save curent renderer in jpeg or TGA format
|
||||
bool
|
||||
ZeroGS::SaveRenderTarget(const char* filename, int width, int height, int jpeg)
|
||||
{
|
||||
bool bflip = height < 0;
|
||||
height = abs(height);
|
||||
vector<u32> data(width*height);
|
||||
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
|
||||
if (glGetError() != GL_NO_ERROR)
|
||||
return false;
|
||||
|
||||
if (bflip) {
|
||||
// swap scanlines
|
||||
vector<u32> scanline(width);
|
||||
for (int i = 0; i < height/2; ++i) {
|
||||
memcpy(&scanline[0], &data[i * width], width * 4);
|
||||
memcpy(&data[i * width], &data[(height - i - 1) * width], width * 4);
|
||||
memcpy(&data[(height - i - 1) * width], &scanline[0], width * 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (jpeg)
|
||||
return SaveJPEG(filename, width, height, &data[0], 70);
|
||||
|
||||
return SaveTGA(filename, width, height, &data[0]);
|
||||
}
|
||||
|
||||
// Save selected texture as TGA
|
||||
bool
|
||||
ZeroGS::SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height)
|
||||
{
|
||||
vector<u32> data(width*height);
|
||||
glBindTexture(textarget, tex);
|
||||
glGetTexImage(textarget, 0, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
|
||||
if (glGetError() != GL_NO_ERROR)
|
||||
return false;
|
||||
|
||||
return SaveTGA(filename, width, height, &data[0]);
|
||||
}
|
||||
|
||||
// save image as JPEG
|
||||
bool
|
||||
ZeroGS::SaveJPEG(const char* filename, int image_width, int image_height, const void* pdata, int quality)
|
||||
{
|
||||
u8* image_buffer = new u8[image_width * image_height * 3];
|
||||
u8* psrc = (u8*)pdata;
|
||||
|
||||
// input data is rgba format, so convert to rgb
|
||||
u8* p = image_buffer;
|
||||
for(int i = 0; i < image_height; ++i) {
|
||||
for(int j = 0; j < image_width; ++j) {
|
||||
p[0] = psrc[0];
|
||||
p[1] = psrc[1];
|
||||
p[2] = psrc[2];
|
||||
p += 3;
|
||||
psrc += 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* This struct contains the JPEG compression parameters and pointers to
|
||||
* working space (which is allocated as needed by the JPEG library).
|
||||
* It is possible to have several such structures, representing multiple
|
||||
* compression/decompression processes, in existence at once. We refer
|
||||
* to any one struct (and its associated working data) as a "JPEG object".
|
||||
*/
|
||||
struct jpeg_compress_struct cinfo;
|
||||
/* This struct represents a JPEG error handler. It is declared separately
|
||||
* because applications often want to supply a specialized error handler
|
||||
* (see the second half of this file for an example). But here we just
|
||||
* take the easy way out and use the standard error handler, which will
|
||||
* print a message on stderr and call exit() if compression fails.
|
||||
* Note that this struct must live as long as the main JPEG parameter
|
||||
* struct, to avoid dangling-pointer problems.
|
||||
*/
|
||||
struct jpeg_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * outfile; /* target file */
|
||||
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
|
||||
int row_stride; /* physical row width in image buffer */
|
||||
|
||||
/* Step 1: allocate and initialize JPEG compression object */
|
||||
|
||||
/* We have to set up the error handler first, in case the initialization
|
||||
* step fails. (Unlikely, but it could happen if you are out of memory.)
|
||||
* This routine fills in the contents of struct jerr, and returns jerr's
|
||||
* address which we place into the link field in cinfo.
|
||||
*/
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
/* Now we can initialize the JPEG compression object. */
|
||||
jpeg_create_compress(&cinfo);
|
||||
|
||||
/* Step 2: specify data destination (eg, a file) */
|
||||
/* Note: steps 2 and 3 can be done in either order. */
|
||||
|
||||
/* Here we use the library-supplied code to send compressed data to a
|
||||
* stdio stream. You can also write your own code to do something else.
|
||||
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
|
||||
* requires it in order to write binary files.
|
||||
*/
|
||||
if ((outfile = fopen(filename, "wb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
jpeg_stdio_dest(&cinfo, outfile);
|
||||
|
||||
/* Step 3: set parameters for compression */
|
||||
|
||||
/* First we supply a description of the input image.
|
||||
* Four fields of the cinfo struct must be filled in:
|
||||
*/
|
||||
cinfo.image_width = image_width; /* image width and height, in pixels */
|
||||
cinfo.image_height = image_height;
|
||||
cinfo.input_components = 3; /* # of color components per pixel */
|
||||
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
|
||||
/* Now use the library's routine to set default compression parameters.
|
||||
* (You must set at least cinfo.in_color_space before calling this,
|
||||
* since the defaults depend on the source color space.)
|
||||
*/
|
||||
jpeg_set_defaults(&cinfo);
|
||||
/* Now you can set any non-default parameters you wish to.
|
||||
* Here we just illustrate the use of quality (quantization table) scaling:
|
||||
*/
|
||||
jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
|
||||
|
||||
/* Step 4: Start compressor */
|
||||
|
||||
/* TRUE ensures that we will write a complete interchange-JPEG file.
|
||||
* Pass TRUE unless you are very sure of what you're doing.
|
||||
*/
|
||||
jpeg_start_compress(&cinfo, TRUE);
|
||||
|
||||
/* Step 5: while (scan lines remain to be written) */
|
||||
/* jpeg_write_scanlines(...); */
|
||||
|
||||
/* Here we use the library's state variable cinfo.next_scanline as the
|
||||
* loop counter, so that we don't have to keep track ourselves.
|
||||
* To keep things simple, we pass one scanline per call; you can pass
|
||||
* more if you wish, though.
|
||||
*/
|
||||
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
|
||||
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
/* jpeg_write_scanlines expects an array of pointers to scanlines.
|
||||
* Here the array is only one element long, but you could pass
|
||||
* more than one scanline at a time if that's more convenient.
|
||||
*/
|
||||
row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
|
||||
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
|
||||
}
|
||||
|
||||
/* Step 6: Finish compression */
|
||||
|
||||
jpeg_finish_compress(&cinfo);
|
||||
/* After finish_compress, we can close the output file. */
|
||||
fclose(outfile);
|
||||
|
||||
/* Step 7: release JPEG compression object */
|
||||
|
||||
/* This is an important step since it will release a good deal of memory. */
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
|
||||
delete image_buffer;
|
||||
/* And we're done! */
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
// This is the defenition of TGA header. We need it to function bellow
|
||||
struct TGA_HEADER
|
||||
{
|
||||
u8 identsize; // size of ID field that follows 18 u8 header (0 usually)
|
||||
u8 colourmaptype; // type of colour map 0=none, 1=has palette
|
||||
u8 imagetype; // type of image 0=none,1=indexed,2=rgb,3=grey,+8=rle packed
|
||||
|
||||
s16 colourmapstart; // first colour map entry in palette
|
||||
s16 colourmaplength; // number of colours in palette
|
||||
u8 colourmapbits; // number of bits per palette entry 15,16,24,32
|
||||
|
||||
s16 xstart; // image x origin
|
||||
s16 ystart; // image y origin
|
||||
s16 width; // image width in pixels
|
||||
s16 height; // image height in pixels
|
||||
u8 bits; // image bits per pixel 8,16,24,32
|
||||
u8 descriptor; // image descriptor bits (vh flip bits)
|
||||
|
||||
// pixel data follows header
|
||||
#if defined(_MSC_VER)
|
||||
};
|
||||
# pragma pack(pop)
|
||||
# else
|
||||
} __attribute__((packed));
|
||||
#endif
|
||||
|
||||
// Save image as TGA
|
||||
bool
|
||||
ZeroGS::SaveTGA(const char* filename, int width, int height, void* pdata)
|
||||
{
|
||||
TGA_HEADER hdr;
|
||||
FILE* f = fopen(filename, "wb");
|
||||
if (f == NULL)
|
||||
return false;
|
||||
|
||||
assert( sizeof(TGA_HEADER) == 18 && sizeof(hdr) == 18 );
|
||||
|
||||
memset(&hdr, 0, sizeof(hdr));
|
||||
hdr.imagetype = 2;
|
||||
hdr.bits = 32;
|
||||
hdr.width = width;
|
||||
hdr.height = height;
|
||||
hdr.descriptor |= 8|(1<<5); // 8bit alpha, flip vertical
|
||||
|
||||
fwrite(&hdr, sizeof(hdr), 1, f);
|
||||
fwrite(pdata, width * height * 4, 1, f);
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
// AVI capture stuff
|
||||
// AVI start -- set needed glabal variables
|
||||
void ZeroGS::StartCapture()
|
||||
{
|
||||
if( !s_aviinit ) {
|
||||
|
||||
#ifdef _WIN32
|
||||
START_AVI("zerogs.avi");
|
||||
#else // linux
|
||||
//TODO
|
||||
#endif
|
||||
s_aviinit = 1;
|
||||
}
|
||||
else {
|
||||
ERROR_LOG("Continuing from previous capture");
|
||||
}
|
||||
|
||||
s_avicapturing = 1;
|
||||
}
|
||||
|
||||
// Stop.
|
||||
void ZeroGS::StopCapture()
|
||||
{
|
||||
s_avicapturing = 0;
|
||||
}
|
||||
|
||||
// And capture frame
|
||||
// Does not work on linux
|
||||
void ZeroGS::CaptureFrame()
|
||||
{
|
||||
assert( s_avicapturing && s_aviinit );
|
||||
|
||||
vector<u32> data(nBackbufferWidth*nBackbufferHeight);
|
||||
glReadPixels(0, 0, nBackbufferWidth, nBackbufferHeight, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
|
||||
if (glGetError() != GL_NO_ERROR)
|
||||
return;
|
||||
|
||||
int fps = SMODE1->CMOD == 3 ? 50 : 60;
|
||||
|
||||
#ifdef _WIN32
|
||||
bool bSuccess = ADD_FRAME_FROM_DIB_TO_AVI("AAAA", fps, nBackbufferWidth, nBackbufferHeight, 32, &data[0]);
|
||||
|
||||
if( !bSuccess ) {
|
||||
s_avicapturing = 0;
|
||||
STOP_AVI();
|
||||
ZeroGS::AddMessage("Failed to create avi");
|
||||
return;
|
||||
}
|
||||
#else // linux
|
||||
//TODO
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
// It's nearly the same as save texture
|
||||
void
|
||||
ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||
{
|
||||
vector<u32> data(ptex->tw*ptex->th);
|
||||
vector<u8> srcdata;
|
||||
|
||||
u32* dst = &data[0];
|
||||
u8* psrc = g_pbyGSMemory;
|
||||
|
||||
CMemoryTarget* pmemtarg = NULL;
|
||||
|
||||
if (usevid) {
|
||||
|
||||
pmemtarg = g_MemTargs.GetMemoryTarget(*ptex, 0);
|
||||
assert( pmemtarg != NULL );
|
||||
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_NV, pmemtarg->ptex->tex);
|
||||
srcdata.resize(pmemtarg->realheight * GPU_TEXWIDTH * pmemtarg->widthmult * 4 * 8); // max of 8 cannels
|
||||
|
||||
glGetTexImage(GL_TEXTURE_RECTANGLE_NV, 0, GL_RGBA, pmemtarg->fmt, &srcdata[0]);
|
||||
|
||||
u32 offset = pmemtarg->realy * 4 * GPU_TEXWIDTH;
|
||||
if (ptex->psm == PSMT8)
|
||||
offset *= ptex->cpsm <= 1 ? 4 : 2;
|
||||
else if (ptex->psm == PSMT4)
|
||||
offset *= ptex->cpsm <= 1 ? 8 : 4;
|
||||
|
||||
psrc = &srcdata[0] - offset;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ptex->th; ++i) {
|
||||
for (int j = 0; j < ptex->tw; ++j) {
|
||||
u32 u = 0;
|
||||
u32 addr;
|
||||
switch (ptex->psm) {
|
||||
case PSMCT32:
|
||||
addr = getPixelAddress32(j, i, ptex->tbp0, ptex->tbw);
|
||||
if (addr * 4 < 0x00400000)
|
||||
u = readPixel32(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
else
|
||||
u = 0;
|
||||
break;
|
||||
case PSMCT24:
|
||||
addr = getPixelAddress24(j, i, ptex->tbp0, ptex->tbw);
|
||||
if (addr * 4 < 0x00400000)
|
||||
u = readPixel24(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
else
|
||||
u = 0;
|
||||
break;
|
||||
case PSMCT16:
|
||||
addr = getPixelAddress16(j, i, ptex->tbp0, ptex->tbw);
|
||||
if (addr * 2 < 0x00400000) {
|
||||
u = readPixel16(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
u = RGBA16to32(u);
|
||||
}
|
||||
else
|
||||
u = 0;
|
||||
break;
|
||||
case PSMCT16S:
|
||||
addr = getPixelAddress16(j, i, ptex->tbp0, ptex->tbw);
|
||||
if (addr * 2 < 0x00400000) {
|
||||
u = readPixel16S(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
u = RGBA16to32(u);
|
||||
}
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT8:
|
||||
addr = getPixelAddress8(j, i, ptex->tbp0, ptex->tbw);
|
||||
if (addr < 0x00400000) {
|
||||
if (usevid) {
|
||||
if (ptex->cpsm <= 1)
|
||||
u = *(u32*)(psrc+4*addr);
|
||||
else
|
||||
u = RGBA16to32(*(u16*)(psrc+2*addr));
|
||||
}
|
||||
else
|
||||
u = readPixel8(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
}
|
||||
else
|
||||
u = 0;
|
||||
break;
|
||||
|
||||
case PSMT4:
|
||||
addr = getPixelAddress4(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( addr < 2*0x00400000 ) {
|
||||
if( usevid ) {
|
||||
if( ptex->cpsm <= 1 ) u = *(u32*)(psrc+4*addr);
|
||||
else u = RGBA16to32(*(u16*)(psrc+2*addr));
|
||||
}
|
||||
else
|
||||
u = readPixel4(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
}
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT8H:
|
||||
addr = getPixelAddress8H(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 4*addr < 0x00400000 ) {
|
||||
if( usevid ) {
|
||||
if( ptex->cpsm <= 1 ) u = *(u32*)(psrc+4*addr);
|
||||
else u = RGBA16to32(*(u16*)(psrc+2*addr));
|
||||
}
|
||||
else
|
||||
u = readPixel8H(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
}
|
||||
else u = 0;
|
||||
|
||||
break;
|
||||
|
||||
case PSMT4HL:
|
||||
addr = getPixelAddress4HL(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 4*addr < 0x00400000 ) {
|
||||
if( usevid ) {
|
||||
if( ptex->cpsm <= 1 ) u = *(u32*)(psrc+4*addr);
|
||||
else u = RGBA16to32(*(u16*)(psrc+2*addr));
|
||||
}
|
||||
else
|
||||
u = readPixel4HL(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
}
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT4HH:
|
||||
addr = getPixelAddress4HH(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 4*addr < 0x00400000 ) {
|
||||
if( usevid ) {
|
||||
if( ptex->cpsm <= 1 ) u = *(u32*)(psrc+4*addr);
|
||||
else u = RGBA16to32(*(u16*)(psrc+2*addr));
|
||||
}
|
||||
else
|
||||
u = readPixel4HH(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
}
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT32Z:
|
||||
addr = getPixelAddress32Z(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 4*addr < 0x00400000 )
|
||||
u = readPixel32Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT24Z:
|
||||
addr = getPixelAddress24Z(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 4*addr < 0x00400000 )
|
||||
u = readPixel24Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT16Z:
|
||||
addr = getPixelAddress16Z(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 2*addr < 0x00400000 )
|
||||
u = readPixel16Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
case PSMT16SZ:
|
||||
addr = getPixelAddress16SZ(j, i, ptex->tbp0, ptex->tbw);
|
||||
|
||||
if( 2*addr < 0x00400000 )
|
||||
u = readPixel16SZ(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||
else u = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
*dst++ = u;
|
||||
}
|
||||
}
|
||||
|
||||
char Name[TGA_FILE_NAME_MAX_LENGTH];
|
||||
snprintf( Name, TGA_FILE_NAME_MAX_LENGTH, "Tex.%d.tga", TexNumber );
|
||||
SaveTGA(Name, ptex->tw, ptex->th, &data[0]);
|
||||
}
|
||||
|
||||
|
||||
// Do the save texture and return file name of it
|
||||
// Do not forget to call free(), other wise there would be memory leak!
|
||||
char*
|
||||
ZeroGS::NamedSaveTex(tex0Info* ptex, int usevid){
|
||||
SaveTex(ptex, usevid);
|
||||
char* Name = (char*)malloc(TGA_FILE_NAME_MAX_LENGTH);
|
||||
snprintf( Name, TGA_FILE_NAME_MAX_LENGTH, "Tex.%d.tga", TexNumber );
|
||||
|
||||
TexNumber++;
|
||||
if (TexNumber > MAX_NUMBER_SAVED_TGA)
|
||||
TexNumber = 0;
|
||||
|
||||
return Name;
|
||||
}
|
||||
|
||||
// Special function, wich is safe to call from any other file, without aviutils problems.
|
||||
void
|
||||
ZeroGS::Stop_Avi(){
|
||||
#ifdef _WIN32
|
||||
STOP_AVI();
|
||||
#else
|
||||
// Does not support yet
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,450 @@
|
|||
/* ZZ Open GL graphics plugin
|
||||
* Copyright (c)2009 zeydlitz@gmail.com
|
||||
* Based on Zerofrog's ZeroGS KOSMOS (c)2005-2006
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
// Zerogs:VB implementation.
|
||||
// VB stands for Visual Buffer, as I think
|
||||
|
||||
//------------------- Includes
|
||||
#include "zerogs.h"
|
||||
#include "targets.h"
|
||||
#include "GS.h"
|
||||
#include "Mem.h"
|
||||
|
||||
using namespace ZeroGS;
|
||||
// ----------------- Defines
|
||||
#define MINMAX_SHIFT 3
|
||||
|
||||
//------------------ Constants
|
||||
|
||||
// ----------------- Global Variables
|
||||
int maxmin = 608;
|
||||
// ----------------- Code
|
||||
|
||||
// Constructor. Set width and height to 1
|
||||
ZeroGS::VB::VB()
|
||||
{
|
||||
memset(this, 0, sizeof(ZeroGS::VB));
|
||||
tex0.tw = 1;
|
||||
tex0.th = 1;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
ZeroGS::VB::~VB()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void ZeroGS::VB::Destroy()
|
||||
{
|
||||
_aligned_free(pBufferData); pBufferData = NULL; nNumVertices = 0;
|
||||
|
||||
prndr = NULL;
|
||||
pdepth = NULL;
|
||||
}
|
||||
|
||||
int ConstraintReson;
|
||||
|
||||
// Return number of 64-pixels block, that guaranted could be hold in memory
|
||||
// from gsfb.fbp and tbp (textrure pase), zbuf.zbp (Z-buffer), frame.fbp
|
||||
// (previous frame).
|
||||
inline int
|
||||
ZeroGS::VB::FindMinimalMemoryConstrain(int tbp, int maxpos) {
|
||||
int MinConstraint = maxpos;
|
||||
|
||||
// make sure texture is far away from tbp
|
||||
{
|
||||
int Constraint = tbp - gsfb.fbp;
|
||||
if ((0 < Constraint) && (Constraint < MinConstraint)) {
|
||||
MinConstraint = Constraint;
|
||||
ConstraintReson = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// offroad uses 0x80 fbp which messes up targets
|
||||
// special case when double buffering (hamsterball)
|
||||
// Suikoden 3 require e00 have this issue too. P3 - 0x1000.
|
||||
if (prndr != NULL) {
|
||||
int Constraint = frame.fbp - gsfb.fbp;
|
||||
if ((0x0 < Constraint) && (Constraint < MinConstraint)) {
|
||||
MinConstraint = Constraint;
|
||||
ConstraintReson = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// old caching method
|
||||
// zmsk necessary for KH movie
|
||||
if (!zbuf.zmsk){
|
||||
int Constraint = zbuf.zbp - gsfb.fbp;
|
||||
if ((0 < Constraint) && (Constraint < MinConstraint)) {
|
||||
MinConstraint = Constraint;
|
||||
ConstraintReson = 3;
|
||||
}
|
||||
}
|
||||
|
||||
// In 16Bit mode in one Word freame stored 2 pixels
|
||||
if (PSMT_ISHALF(gsfb.psm))
|
||||
MinConstraint *= 2;
|
||||
|
||||
return MinConstraint ;
|
||||
}
|
||||
|
||||
// Return number of 64 pizel words that could be placed in Z-Buffer
|
||||
// If no Z-buffer present return old constraint
|
||||
inline int
|
||||
ZeroGS::VB::FindZbufferMemoryConstrain(int tbp, int maxpos) {
|
||||
int MinConstraint = maxpos;
|
||||
|
||||
// Check tbp / zbuffer constraint
|
||||
if (!zbuf.zmsk) {
|
||||
int Constraint = (tbp - zbuf.zbp) * (PSMT_ISHALF(zbuf.psm) ? 2 : 1 );
|
||||
if ((0 < Constraint) && (Constraint < MinConstraint)) {
|
||||
MinConstraint = Constraint;
|
||||
ConstraintReson = 4;
|
||||
}
|
||||
}
|
||||
|
||||
return MinConstraint;
|
||||
}
|
||||
|
||||
// Return heights limiter form scissor. .
|
||||
inline int
|
||||
GetScissorY(int y) {
|
||||
int fbh = (y >> MINMAX_SHIFT) + 1;
|
||||
if ( fbh > 2 && ( fbh & 1 ) ) fbh -= 1;
|
||||
return fbh;
|
||||
}
|
||||
|
||||
//There is several reason to limit a height of frame: maximum buffer size, calculated size
|
||||
//from fbw and fbh and scissoring.
|
||||
inline int
|
||||
ZeroGS::VB::FindMinimalHeightConstrain(int maxpos) {
|
||||
int MinConstraint = maxpos;
|
||||
|
||||
if (maxmin < MinConstraint) {
|
||||
MinConstraint = maxmin;
|
||||
ConstraintReson = 5;
|
||||
}
|
||||
|
||||
if (gsfb.fbh < MinConstraint) {
|
||||
MinConstraint = gsfb.fbh;
|
||||
ConstraintReson = 6;
|
||||
}
|
||||
|
||||
int ScissorConstraint = GetScissorY(scissor.y1) ;
|
||||
if (ScissorConstraint < MinConstraint) {
|
||||
MinConstraint = ScissorConstraint;
|
||||
ConstraintReson = 7;
|
||||
}
|
||||
|
||||
return MinConstraint;
|
||||
}
|
||||
|
||||
// 32 bit frames have additional constraints to frame
|
||||
// maxpos was maximum length of frame at normal constraints
|
||||
inline void
|
||||
ZeroGS::VB::CheckFrame32bitRes(int maxpos)
|
||||
{
|
||||
int fbh = frame.fbh;
|
||||
|
||||
if ( frame.fbh >= 512 ) {
|
||||
// neopets hack
|
||||
maxmin = min(maxmin, frame.fbh);
|
||||
frame.fbh = maxmin;
|
||||
ConstraintReson = 8;
|
||||
}
|
||||
|
||||
// ffxii hack to stop resolving
|
||||
if( frame.fbp >= 0x3000 && fbh >= 0x1a0 ) {
|
||||
int endfbp = frame.fbp + frame.fbw * fbh / (PSMT_ISHALF(gsfb.psm) ? 128 : 64);
|
||||
|
||||
// see if there is a previous render target in the way, reduce
|
||||
for (CRenderTargetMngr::MAPTARGETS::iterator itnew = s_RTs.mapTargets.begin(); itnew != s_RTs.mapTargets.end(); ++itnew) {
|
||||
if ( itnew->second->fbp > frame.fbp && endfbp > itnew->second->fbp ) {
|
||||
endfbp = itnew->second->fbp;
|
||||
}
|
||||
}
|
||||
|
||||
frame.fbh = (endfbp - frame.fbp) * ( PSMT_ISHALF(gsfb.psm) ? 128: 64 ) / frame.fbw;
|
||||
if (frame.fbh < fbh)
|
||||
ConstraintReson = 9;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// This is the main code of frame resising.
|
||||
// It's check several reasons for resize and resize if it needs.
|
||||
// 4Mb memory in 64 bit (4 bytes) words.
|
||||
// |------------------------|---------------------|----------|----------|---------------------|
|
||||
// 0 gsfb.fbp zbuff.zpb tbp frame.fbp 2^20/64
|
||||
inline int
|
||||
ZeroGS::VB::CheckFrameAddConstraints(int tbp)
|
||||
{
|
||||
if ( gsfb.fbw <= 0 ) {
|
||||
ERROR_LOG_SPAM("render target null, no constraints. Ignoring\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Memory region after fbp
|
||||
int maxmemorypos = 0x4000 - gsfb.fbp;
|
||||
ConstraintReson = 0;
|
||||
|
||||
maxmemorypos = FindMinimalMemoryConstrain(tbp, maxmemorypos);
|
||||
maxmemorypos = FindZbufferMemoryConstrain(tbp, maxmemorypos);
|
||||
|
||||
int maxpos = 64 * maxmemorypos ;
|
||||
maxpos /= gsfb.fbw;
|
||||
//? atelier iris crashes without it
|
||||
if( maxpos > 256 )
|
||||
maxpos &= ~0x1f;
|
||||
|
||||
int noscissorpos = maxpos;
|
||||
int ConstrainR1 = ConstraintReson;
|
||||
maxpos = FindMinimalHeightConstrain(maxpos);
|
||||
|
||||
frame = gsfb;
|
||||
frame.fbh = maxpos;
|
||||
|
||||
if( !PSMT_ISHALF(frame.psm) || !(g_GameSettings&GAME_FULL16BITRES) )
|
||||
CheckFrame32bitRes( maxpos ) ;
|
||||
|
||||
#ifdef DEVBUILD
|
||||
if (frame.fbh == 0xe2)
|
||||
ERROR_LOG ("Const: %x %x %d| %x %d %x %x\n", frame.fbh, frame.fbw, ConstraintReson, noscissorpos, ConstrainR1, tbp, frame.fbp);
|
||||
#endif
|
||||
|
||||
// Fixme: Reserved psm for framebuffers
|
||||
// gsfb.psm &= 0xf; // shadow tower
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
// Check if after resising new depth target is need to be used.
|
||||
// it return 2 if new deapth target used. bool Chose is used to proprely check
|
||||
// renderer target status
|
||||
inline int
|
||||
ZeroGS::VB::CheckFrameResolveDepth(int tbp)
|
||||
{
|
||||
int result = 0 ;
|
||||
CDepthTarget* pprevdepth = pdepth;
|
||||
pdepth = NULL;
|
||||
|
||||
// just z changed
|
||||
frameInfo f = CreateFrame(zbuf.zbp, prndr->fbw, prndr->fbh, zbuf.psm, (zbuf.psm == 0x31) ? 0xff000000 : 0);
|
||||
|
||||
CDepthTarget* pnewdepth = (CDepthTarget*)s_DepthRTs.GetTarg(f, CRenderTargetMngr::TO_DepthBuffer|CRenderTargetMngr::TO_StrictHeight|
|
||||
(zbuf.zmsk?CRenderTargetMngr::TO_Virtual:0), get_maxheight(zbuf.zbp, gsfb.fbw, 0));
|
||||
|
||||
assert( pnewdepth != NULL && prndr != NULL );
|
||||
assert( pnewdepth->fbh == prndr->fbh );
|
||||
|
||||
if( (pprevdepth != pnewdepth) || (pprevdepth != NULL && (pprevdepth->status & CRenderTarget::TS_NeedUpdate)) )
|
||||
result = 2;
|
||||
|
||||
pdepth = pnewdepth;
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
// Check if after resings new render target is need to be used. Also perform deptaget check
|
||||
// Return 1 if only render target is changed and 3 -- if both.
|
||||
inline int
|
||||
ZeroGS::VB::CheckFrameResolveRender(int tbp) {
|
||||
int result = 0 ;
|
||||
|
||||
CRenderTarget* pprevrndr = prndr;
|
||||
prndr = NULL;
|
||||
CDepthTarget* pprevdepth = pdepth;
|
||||
pdepth = NULL;
|
||||
// Set renderes to NULL to prevent Flushing.
|
||||
|
||||
CRenderTarget* pnewtarg = s_RTs.GetTarg(frame, 0, maxmin);
|
||||
assert( pnewtarg != NULL );
|
||||
|
||||
// pnewtarg->fbh >= 0x1c0 needed for ffx
|
||||
if( (pnewtarg->fbh >= 0x1c0) && pnewtarg->fbh > frame.fbh && zbuf.zbp < tbp && !zbuf.zmsk ) {
|
||||
// check if zbuf is in the way of the texture (suikoden5)
|
||||
int maxallowedfbh = (tbp-zbuf.zbp)*(PSMT_ISHALF(zbuf.psm)?128:64) / gsfb.fbw;
|
||||
if (PSMT_ISHALF(gsfb.psm)) maxallowedfbh *= 2;
|
||||
|
||||
if (pnewtarg->fbh > maxallowedfbh + 32) { // +32 needed for ffx2
|
||||
// destroy and recreate
|
||||
s_RTs.DestroyAllTargs(0, 0x100, pnewtarg->fbw);
|
||||
pnewtarg = s_RTs.GetTarg(frame, 0, maxmin);
|
||||
assert( pnewtarg != NULL );
|
||||
}
|
||||
}
|
||||
|
||||
PRIM_LOG("frame_%d: fbp=0x%x fbw=%d fbh=%d(%d) psm=0x%x fbm=0x%x\n", ictx, gsfb.fbp, gsfb.fbw, gsfb.fbh, pnewtarg->fbh, gsfb.psm, gsfb.fbm);
|
||||
|
||||
if( (pprevrndr != pnewtarg) || (pprevrndr != NULL && (pprevrndr->status & CRenderTarget::TS_NeedUpdate)) )
|
||||
result = 1;
|
||||
|
||||
prndr = pnewtarg;
|
||||
pdepth = pprevdepth ;
|
||||
|
||||
result |= CheckFrameResolveDepth(tbp) ;
|
||||
return result ;
|
||||
}
|
||||
|
||||
// After frame resetting it is possible that 16 to 32 or 32 to 16 (color bits) conversion should be made.
|
||||
inline void
|
||||
ZeroGS::VB::CheckFrame16vs32Convesion()
|
||||
{
|
||||
if( prndr->status & CRenderTarget::TS_NeedConvert32) {
|
||||
if( pdepth->pdepth != 0 )
|
||||
pdepth->SetDepthStencilSurface();
|
||||
prndr->fbh *= 2;
|
||||
prndr->ConvertTo32();
|
||||
prndr->status &= ~CRenderTarget::TS_NeedConvert32;
|
||||
}
|
||||
else if( prndr->status & CRenderTarget::TS_NeedConvert16 ) {
|
||||
if( pdepth->pdepth != 0 )
|
||||
pdepth->SetDepthStencilSurface();
|
||||
prndr->fbh /= 2;
|
||||
prndr->ConvertTo16();
|
||||
prndr->status &= ~CRenderTarget::TS_NeedConvert16;
|
||||
}
|
||||
}
|
||||
|
||||
// a lot of times, target is too big and overwrites the texture using,
|
||||
// if tbp != 0, use it to bound
|
||||
void ZeroGS::VB::CheckFrame(int tbp)
|
||||
{
|
||||
static int bChanged;
|
||||
if( bNeedZCheck ) {
|
||||
PRIM_LOG("zbuf_%d: zbp=0x%x psm=0x%x, zmsk=%d\n", ictx, zbuf.zbp, zbuf.psm, zbuf.zmsk);
|
||||
//zbuf = *zb;
|
||||
}
|
||||
|
||||
if( m_Blocks[gsfb.psm].bpp == 0 ) {
|
||||
ERROR_LOG("CheckFrame invalid bpp %d\n", gsfb.psm);
|
||||
return;
|
||||
}
|
||||
|
||||
bChanged = 0;
|
||||
|
||||
if( bNeedFrameCheck ) {
|
||||
|
||||
// important to set before calling GetTarg
|
||||
bNeedFrameCheck = 0;
|
||||
bNeedZCheck = 0;
|
||||
if ( CheckFrameAddConstraints(tbp) == -1 ) return ;
|
||||
|
||||
if ( ( prndr != NULL ) && ( prndr->psm != gsfb.psm ) ) {
|
||||
// behavior for dest alpha varies
|
||||
ResetAlphaVariables();
|
||||
}
|
||||
|
||||
bChanged = CheckFrameResolveRender(tbp) ;
|
||||
CheckFrame16vs32Convesion();
|
||||
}
|
||||
else if (bNeedZCheck) {
|
||||
bNeedZCheck = 0;
|
||||
if (prndr != NULL && gsfb.fbw > 0 )
|
||||
CheckFrameResolveDepth(tbp);
|
||||
}
|
||||
|
||||
if( prndr != NULL ) SetContextTarget(ictx);
|
||||
}
|
||||
|
||||
// This is the case, most easy to perform, when nothinh was changed
|
||||
inline void ZeroGS::VB::FlushTexUnchangedClutDontUpdate() {
|
||||
if (ZZOglGet_cld_TexBits(uNextTex0Data[1])) {
|
||||
ZeroGS::texClutWrite(ictx);
|
||||
// invalidate to make sure target didn't change!
|
||||
bVarsTexSync = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// The second of easy branch. We does not change storage model, so we don't need to
|
||||
// update anything except texture itself
|
||||
inline void ZeroGS::VB::FlushTexClutDontUpdate() {
|
||||
if (!ZZOglClutStorageUnchanged(uCurTex0Data, uNextTex0Data))
|
||||
ZeroGS::Flush(ictx);
|
||||
|
||||
// clut memory isn't going to be loaded so can ignore, but at least update CSA and CPSM!
|
||||
uCurTex0Data[1] = (uCurTex0Data[1] & CPSM_CSA_NOTMASK) | (uNextTex0Data[1] & CPSM_CSA_BITMASK);
|
||||
|
||||
tex0.csa = ZZOglGet_csa_TexBits(uNextTex0Data[1]);
|
||||
tex0.cpsm = ZZOglGet_cpsm_TexBits(uNextTex0Data[1]);
|
||||
|
||||
ZeroGS::texClutWrite(ictx);
|
||||
bVarsTexSync = FALSE;
|
||||
}
|
||||
|
||||
|
||||
// Set texture variables after big change
|
||||
inline void ZeroGS::VB::FlushTexSetNewVars(u32 psm) {
|
||||
tex0.tbp0 = ZZOglGet_tbp0_TexBits(uNextTex0Data[0]);
|
||||
tex0.tbw = ZZOglGet_tbw_TexBitsMult(uNextTex0Data[0]);
|
||||
tex0.psm = psm;
|
||||
tex0.tw = ZZOglGet_tw_TexBitsExp(uNextTex0Data[0]);
|
||||
tex0.th = ZZOglGet_th_TexBitsExp(uNextTex0Data[0], uNextTex0Data[1]);
|
||||
|
||||
tex0.tcc = ZZOglGet_tcc_TexBits(uNextTex0Data[1]);
|
||||
tex0.tfx = ZZOglGet_tfx_TexBits(uNextTex0Data[1]);
|
||||
|
||||
ZeroGS::fiTexWidth[ictx] = (1/16.0f)/ tex0.tw;
|
||||
ZeroGS::fiTexHeight[ictx] = (1/16.0f) / tex0.th;
|
||||
}
|
||||
|
||||
// Flush == draw on screen
|
||||
// This function made VB state consistant before real Flush.
|
||||
void ZeroGS::VB::FlushTexData()
|
||||
{
|
||||
assert( bNeedTexCheck );
|
||||
|
||||
bNeedTexCheck = 0;
|
||||
|
||||
u32 psm = ZZOglGet_psm_TexBitsFix(uNextTex0Data[0]);
|
||||
|
||||
// don't update unless necessary
|
||||
if (ZZOglAllExceptClutIsSame(uCurTex0Data, uNextTex0Data)) {
|
||||
// Don't need to do anything if there is no clutting and VB tex data was not changed
|
||||
if( !PSMT_ISCLUT(psm) )
|
||||
return ;
|
||||
|
||||
// have to write the CLUT again if only CLD was changed
|
||||
if( ZZOglClutMinusCLDunchanged(uCurTex0Data, uNextTex0Data) ) {
|
||||
FlushTexUnchangedClutDontUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
// Cld bit is 0 means that clut buffer stay unchanged
|
||||
if( ZZOglGet_cld_TexBits(uNextTex0Data[1]) == 0 ) {
|
||||
FlushTexClutDontUpdate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Made the full update
|
||||
ZeroGS::Flush(ictx);
|
||||
bVarsTexSync = FALSE;
|
||||
bTexConstsSync = FALSE;
|
||||
|
||||
uCurTex0Data[0] = uNextTex0Data[0];
|
||||
uCurTex0Data[1] = uNextTex0Data[1];
|
||||
|
||||
FlushTexSetNewVars(psm);
|
||||
|
||||
if( PSMT_ISCLUT(psm) )
|
||||
ZeroGS::CluttingForFlushedTex(&tex0, uNextTex0Data[1], ictx ) ;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,428 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# ZeroGSShaders/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
|
||||
pkgdatadir = $(datadir)/ZZOgl-pg
|
||||
pkgincludedir = $(includedir)/ZZOgl-pg
|
||||
pkglibdir = $(libdir)/ZZOgl-pg
|
||||
pkglibexecdir = $(libexecdir)/ZZOgl-pg
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
noinst_PROGRAMS = zgsbuild$(EXEEXT)
|
||||
subdir = ZeroGSShaders
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_zgsbuild_OBJECTS = zpipe.$(OBJEXT) zerogsshaders.$(OBJEXT)
|
||||
zgsbuild_OBJECTS = $(am_zgsbuild_OBJECTS)
|
||||
zgsbuild_LDADD = $(LDADD)
|
||||
DEFAULT_INCLUDES = -I.
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
SOURCES = $(zgsbuild_SOURCES)
|
||||
DIST_SOURCES = $(zgsbuild_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run aclocal-1.11
|
||||
AMTAR = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run tar
|
||||
AUTOCONF = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run automake-1.11
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCAS = gcc
|
||||
CCASDEPMODE = depmode=gcc3
|
||||
CCASFLAGS = -g -O2
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -I/opt/cg/include -L/opt/cg/lib -Wall -Wno-format -Wno-unused -O2 -msse2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS = -I/opt/cg/include -L/opt/cg/lib -Wall -Wno-format -Wno-unused -O2 -msse2
|
||||
CXX = gcc
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -I/opt/cg/include -L/opt/cg/lib -Wall -Wno-format -Wno-unused -O2 -msse2 -fno-regmove
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DPACKAGE_NAME=\"ZZOgl-pg\" -DPACKAGE_TARNAME=\"zzogl-pg\" -DPACKAGE_VERSION=\"0.1.0\" -DPACKAGE_STRING=\"ZZOgl-pg\ 0.1.0\" -DPACKAGE_BUGREPORT=\"arcum42@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"ZZOgl-pg\" -DVERSION=\"0.1.0\" -DNDEBUG=1 -DRELEASE_TO_PUBLIC=1 -DZEROGS_SSE2=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DHAVE_GL_GLEXT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_CG_CG_H=1 -DHAVE_CG_CGGL_H=1 -DHAVE_JPEGLIB_H=1
|
||||
DEPDIR = .deps
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /bin/grep -E
|
||||
EXEEXT =
|
||||
GREP = /bin/grep
|
||||
GTK_CONFIG = pkg-config
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
LDFLAGS =
|
||||
LIBOBJS =
|
||||
LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lGL -lGLU -lGLEW -ljpeg -lpthread -lstdc++ -lz -ldl -lXxf86vm -lCg -lCgGL
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/missing --run makeinfo
|
||||
MKDIR_P = /bin/mkdir -p
|
||||
OBJEXT = o
|
||||
PACKAGE = ZZOgl-pg
|
||||
PACKAGE_BUGREPORT = arcum42@gmail.com
|
||||
PACKAGE_NAME = ZZOgl-pg
|
||||
PACKAGE_STRING = ZZOgl-pg 0.1.0
|
||||
PACKAGE_TARNAME = zzogl-pg
|
||||
PACKAGE_URL =
|
||||
PACKAGE_VERSION = 0.1.0
|
||||
PATH_SEPARATOR = :
|
||||
RANLIB = ranlib
|
||||
SET_MAKE =
|
||||
SHARED_LDFLAGS = -shared
|
||||
SHELL = /bin/sh
|
||||
STRIP =
|
||||
VERSION = 0.1.0
|
||||
ZEROGS_AGE = 0
|
||||
ZEROGS_CURRENT = 0
|
||||
ZEROGS_RELEASE = 0.1.0
|
||||
ZEROGS_REVISION = 1
|
||||
ZEROGS_SONAME = libzzoglpg.so.0.1.0
|
||||
abs_builddir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/ZeroGSShaders
|
||||
abs_srcdir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/ZeroGSShaders
|
||||
abs_top_builddir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl
|
||||
abs_top_srcdir = /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = gcc
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = ${AMTAR} chof - "$$tardir"
|
||||
am__untar = ${AMTAR} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build_alias =
|
||||
builddir = .
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host_alias =
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /usr/local/src/pcsx2-2/plugins/zzogl-pg/opengl/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = /bin/mkdir -p
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix =
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
so_ext = .so.0.1.0
|
||||
srcdir = .
|
||||
sysconfdir = ${prefix}/etc
|
||||
target_alias =
|
||||
top_build_prefix = ../
|
||||
top_builddir = ..
|
||||
top_srcdir = ..
|
||||
zgsbuild_SOURCES = zpipe.cpp zerogsshaders.cpp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ZeroGSShaders/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu ZeroGSShaders/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
||||
zgsbuild$(EXEEXT): $(zgsbuild_OBJECTS) $(zgsbuild_DEPENDENCIES)
|
||||
@rm -f zgsbuild$(EXEEXT)
|
||||
$(CXXLINK) $(zgsbuild_OBJECTS) $(zgsbuild_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
include ./$(DEPDIR)/zerogsshaders.Po
|
||||
include ./$(DEPDIR)/zpipe.Po
|
||||
|
||||
.cpp.o:
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstPROGRAMS ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,2 @@
|
|||
noinst_PROGRAMS = zgsbuild
|
||||
zgsbuild_SOURCES = zpipe.cpp zerogsshaders.cpp
|
|
@ -0,0 +1,428 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
noinst_PROGRAMS = zgsbuild$(EXEEXT)
|
||||
subdir = ZeroGSShaders
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_zgsbuild_OBJECTS = zpipe.$(OBJEXT) zerogsshaders.$(OBJEXT)
|
||||
zgsbuild_OBJECTS = $(am_zgsbuild_OBJECTS)
|
||||
zgsbuild_LDADD = $(LDADD)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
SOURCES = $(zgsbuild_SOURCES)
|
||||
DIST_SOURCES = $(zgsbuild_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
GTK_CONFIG = @GTK_CONFIG@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_LDFLAGS = @SHARED_LDFLAGS@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ZEROGS_AGE = @ZEROGS_AGE@
|
||||
ZEROGS_CURRENT = @ZEROGS_CURRENT@
|
||||
ZEROGS_RELEASE = @ZEROGS_RELEASE@
|
||||
ZEROGS_REVISION = @ZEROGS_REVISION@
|
||||
ZEROGS_SONAME = @ZEROGS_SONAME@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
so_ext = @so_ext@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
zgsbuild_SOURCES = zpipe.cpp zerogsshaders.cpp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ZeroGSShaders/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu ZeroGSShaders/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
||||
zgsbuild$(EXEEXT): $(zgsbuild_OBJECTS) $(zgsbuild_DEPENDENCIES)
|
||||
@rm -f zgsbuild$(EXEEXT)
|
||||
$(CXXLINK) $(zgsbuild_OBJECTS) $(zgsbuild_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zerogsshaders.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zpipe.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstPROGRAMS ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
Binary file not shown.
|
@ -0,0 +1,191 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="ZeroGSShaders"
|
||||
ProjectGUID="{811D47CC-E5F0-456A-918E-5908005E8FC0}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cg.lib cgGL.lib zlib.lib"
|
||||
OutputFile="$(OutDir)/ZeroGSShaders.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/ZeroGSShaders.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cg.lib cgGL.lib zlib.lib"
|
||||
OutputFile="$(OutDir)/ZeroGSShaders.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copytozerogs.bat"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release (to Public)|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cg.lib cgGL.lib zlib.lib"
|
||||
OutputFile="$(OutDir)/ZeroGSShaders.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\zerogsshaders.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zpipe.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\zerogsshaders.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zpipe.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZeroGSShaders", "ZeroGSShaders_2005.vcproj", "{811D47CC-E5F0-456A-918E-5908005E8FC0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release (to Public)|Win32 = Release (to Public)|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{811D47CC-E5F0-456A-918E-5908005E8FC0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{811D47CC-E5F0-456A-918E-5908005E8FC0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{811D47CC-E5F0-456A-918E-5908005E8FC0}.Release (to Public)|Win32.ActiveCfg = Release (to Public)|Win32
|
||||
{811D47CC-E5F0-456A-918E-5908005E8FC0}.Release (to Public)|Win32.Build.0 = Release (to Public)|Win32
|
||||
{811D47CC-E5F0-456A-918E-5908005E8FC0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{811D47CC-E5F0-456A-918E-5908005E8FC0}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,335 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="ZeroGSShaders"
|
||||
ProjectGUID="{811D47CC-E5F0-456A-918E-5908005E8FC0}"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cg.lib cgGL.lib zlib.lib"
|
||||
OutputFile="$(OutDir)/ZeroGSShaders.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/ZeroGSShaders.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cg.lib cgGL.lib zlib.lib"
|
||||
OutputFile="$(OutDir)/ZeroGSShaders.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copytozerogs.bat"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release (to Public)|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cg.lib cgGL.lib zlib.lib"
|
||||
OutputFile="$(OutDir)/ZeroGSShaders.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\zerogsshaders.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zpipe.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\zlib\crc32.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\deflate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\inffast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\inffixed.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\inflate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\inftrees.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\trees.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\zconf.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\zconf.in.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zerogsshaders.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\zlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\zlib\zutil.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1 @@
|
|||
copy .\Release\ZeroGSShaders.exe ..\
|
|
@ -0,0 +1,344 @@
|
|||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
|
||||
// Builds all possible shader files from ps2hw.fx and stores them in
|
||||
// a preprocessed database
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <zlib/zlib.h>
|
||||
#else
|
||||
# include <zlib.h>
|
||||
#endif
|
||||
|
||||
#include "zpipe.h"
|
||||
|
||||
#include <Cg/cg.h>
|
||||
#include <Cg/cgGL.h>
|
||||
|
||||
#define SAFE_RELEASE(x) { if( (x) != NULL ) { (x)->Release(); x = NULL; } }
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "zerogsshaders.h"
|
||||
|
||||
char* srcfilename = "ps2hw.fx";
|
||||
char* dstfilename = "ps2hw.dat";
|
||||
|
||||
#ifndef ArraySize
|
||||
#define ArraySize(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#endif
|
||||
|
||||
struct SHADERINFO
|
||||
{
|
||||
int type;
|
||||
vector<char> buf;
|
||||
};
|
||||
|
||||
map<int, SHADERINFO> mapShaders;
|
||||
CGcontext g_cgcontext;
|
||||
|
||||
void LoadShader(int index, const char* pshader, CGprofile prof, vector<const char*>& vargs, int context)
|
||||
{
|
||||
vector<const char*> realargs;
|
||||
realargs.reserve(16);
|
||||
realargs.resize(vargs.size());
|
||||
if( vargs.size() > 0 )
|
||||
memcpy(&realargs[0], &vargs[0], realargs.size() * sizeof(realargs[0]));
|
||||
realargs.push_back(context ? "-Ictx1" : "-Ictx0");
|
||||
realargs.push_back(NULL);
|
||||
|
||||
CGprogram prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, srcfilename, prof, pshader, &realargs[0]);
|
||||
if( !cgIsProgram(prog) ) {
|
||||
printf("Failed to load shader %s: \n%s\n", pshader, cgGetLastListing(g_cgcontext));
|
||||
return;
|
||||
}
|
||||
|
||||
if( mapShaders.find(index) != mapShaders.end() ) {
|
||||
printf("error: two shaders share the same index %d\n", index);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if( !cgIsProgramCompiled(prog) )
|
||||
cgCompileProgram(prog);
|
||||
|
||||
const char* pstr = cgGetProgramString(prog, CG_COMPILED_PROGRAM);
|
||||
|
||||
const char* pprog = strstr(pstr, "#program");
|
||||
if( pprog == NULL ) {
|
||||
printf("program field not found!\n");
|
||||
return;
|
||||
}
|
||||
pprog += 9;
|
||||
const char* progend = strchr(pprog, '\r');
|
||||
if( progend == NULL ) progend = strchr(pprog, '\n');
|
||||
|
||||
if( progend == NULL ) {
|
||||
printf("prog end not found!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
const char* defname = "main";
|
||||
|
||||
SHADERINFO info;
|
||||
info.type = 0;
|
||||
info.buf.resize(strlen(pstr)+1);
|
||||
|
||||
// change the program name to main
|
||||
memset(&info.buf[0], 0, info.buf.size());
|
||||
memcpy(&info.buf[0], pstr, pprog-pstr);
|
||||
memcpy(&info.buf[pprog-pstr], defname, 4);
|
||||
memcpy(&info.buf[pprog-pstr+4], progend, strlen(pstr)-(progend-pstr));
|
||||
|
||||
if( mapShaders.find(index) != mapShaders.end() )
|
||||
printf("same shader\n");
|
||||
assert( mapShaders.find(index) == mapShaders.end() );
|
||||
mapShaders[index] = info;
|
||||
|
||||
cgDestroyProgram(prog);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
printf("usage: [src] [dst] [opts]\n");
|
||||
|
||||
if( argc >= 2 ) srcfilename = argv[1];
|
||||
if( argc >= 3 ) dstfilename = argv[2];
|
||||
|
||||
FILE* fsrc = fopen(srcfilename, "r");
|
||||
if( fsrc == NULL ) {
|
||||
printf("cannot open %s\n", srcfilename);
|
||||
return 0;
|
||||
}
|
||||
fclose(fsrc);
|
||||
|
||||
g_cgcontext = cgCreateContext();
|
||||
if( !cgIsContext(g_cgcontext) ) {
|
||||
printf("failed to create cg context\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CGprofile cgvProf = CG_PROFILE_ARBVP1;
|
||||
CGprofile cgfProf = CG_PROFILE_ARBFP1;
|
||||
if( !cgGLIsProfileSupported(cgvProf) != CG_TRUE ) {
|
||||
printf("arbvp1 not supported\n");
|
||||
return 0;
|
||||
}
|
||||
if( !cgGLIsProfileSupported(cgfProf) != CG_TRUE ) {
|
||||
printf("arbfp1 not supported\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
cgGLEnableProfile(cgvProf);
|
||||
cgGLEnableProfile(cgfProf);
|
||||
cgGLSetOptimalOptions(cgvProf);
|
||||
cgGLSetOptimalOptions(cgfProf);
|
||||
|
||||
vector<const char*> vmacros;
|
||||
|
||||
LoadShader(SH_BITBLTVS, "BitBltVS", cgvProf, vmacros, 0);
|
||||
LoadShader(SH_BITBLTPS, "BitBltPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_BITBLTDEPTHPS, "BitBltDepthPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_BITBLTDEPTHMRTPS, "BitBltDepthMRTPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTCTARGPS, "CRTCTargPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTCPS, "CRTCPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTC_NEARESTPS, "CRTCPS_Nearest", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTC24PS, "CRTC24PS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_ZEROPS, "ZeroPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_BASETEXTUREPS, "BaseTexturePS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_BITBLTAAPS, "BitBltPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTCTARGINTERPS, "CRTCTargInterPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTCINTERPS, "CRTCInterPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTCINTER_NEARESTPS, "CRTCInterPS_Nearest", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CRTC24INTERPS, "CRTC24InterPS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CONVERT16TO32PS, "Convert16to32PS", cgfProf, vmacros, 0);
|
||||
LoadShader(SH_CONVERT32TO16PS, "Convert32to16PS", cgfProf, vmacros, 0);
|
||||
|
||||
const int vsshaders[4] = { SH_REGULARVS, SH_TEXTUREVS, SH_REGULARFOGVS, SH_TEXTUREFOGVS };
|
||||
const char* pvsshaders[4] = { "RegularVS", "TextureVS", "RegularFogVS", "TextureFogVS" };
|
||||
|
||||
// load the texture shaders
|
||||
char str[255], strdir[255];
|
||||
|
||||
strcpy(strdir, srcfilename);
|
||||
int i = (int)strlen(strdir);
|
||||
while(i > 0) {
|
||||
if( strdir[i-1] == '/' || strdir[i-1] == '\\' )
|
||||
break;
|
||||
--i;
|
||||
}
|
||||
|
||||
strdir[i] = 0;
|
||||
|
||||
for(i = 0; i < ArraySize(vsshaders); ++i) {
|
||||
for(int writedepth = 0; writedepth < 2; ++writedepth ) {
|
||||
|
||||
if( writedepth ) vmacros.push_back("-DWRITE_DEPTH");
|
||||
LoadShader(vsshaders[i]|(writedepth?SH_WRITEDEPTH:0), pvsshaders[i], cgvProf, vmacros, 0);
|
||||
LoadShader(vsshaders[i]|(writedepth?SH_WRITEDEPTH:0)|SH_CONTEXT1, pvsshaders[i], cgvProf, vmacros, 1);
|
||||
if( writedepth ) vmacros.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
const int psshaders[2] = { SH_REGULARPS, SH_REGULARFOGPS };
|
||||
const char* ppsshaders[2] = { "RegularPS", "RegularFogPS" };
|
||||
|
||||
for(i = 0; i < ArraySize(psshaders); ++i) {
|
||||
for(int writedepth = 0; writedepth < 2; ++writedepth ) {
|
||||
if( writedepth ) vmacros.push_back("-DWRITE_DEPTH");
|
||||
LoadShader(psshaders[i]|(writedepth?SH_WRITEDEPTH:0), ppsshaders[i], cgfProf, vmacros, 0);
|
||||
if( writedepth ) vmacros.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
printf("creating shaders, note that ctx0/ps2hw_ctx.fx, and ctx1/ps2hw_ctx.fx are required\n");
|
||||
vmacros.resize(0);
|
||||
|
||||
for(int texwrap = 0; texwrap < NUM_TEXWRAPS; ++texwrap ) {
|
||||
|
||||
if( g_pPsTexWrap[texwrap] != NULL )
|
||||
vmacros.push_back(g_pPsTexWrap[texwrap]);
|
||||
|
||||
for(int context = 0; context < 2; ++context) {
|
||||
|
||||
for(int texfilter = 0; texfilter < NUM_FILTERS; ++texfilter) {
|
||||
for(int fog = 0; fog < 2; ++fog ) {
|
||||
for(int writedepth = 0; writedepth < 2; ++writedepth ) {
|
||||
|
||||
if( writedepth )
|
||||
vmacros.push_back("-DWRITE_DEPTH");
|
||||
|
||||
for(int testaem = 0; testaem < 2; ++testaem ) {
|
||||
|
||||
if( testaem )
|
||||
vmacros.push_back("-DTEST_AEM");
|
||||
|
||||
for(int exactcolor = 0; exactcolor < 2; ++exactcolor ) {
|
||||
|
||||
if( exactcolor )
|
||||
vmacros.push_back("-DEXACT_COLOR");
|
||||
|
||||
// 32
|
||||
sprintf(str, "Texture%s%d_32PS", fog?"Fog":"", texfilter);
|
||||
|
||||
vmacros.push_back("-DACCURATE_DECOMPRESSION");
|
||||
LoadShader(GET_SHADER_INDEX(0, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, SHADER_ACCURATE), str, cgfProf, vmacros, context);
|
||||
vmacros.pop_back();
|
||||
|
||||
LoadShader(GET_SHADER_INDEX(0, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, 0), str, cgfProf, vmacros, context);
|
||||
|
||||
if( texfilter == 0 ) {
|
||||
// tex32
|
||||
sprintf(str, "Texture%s%d_tex32PS", fog?"Fog":"", texfilter);
|
||||
|
||||
// vmacros.push_back("-DACCURATE_DECOMPRESSION");
|
||||
// LoadShader(GET_SHADER_INDEX(1, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, SHADER_ACCURATE), str, cgfProf, vmacros, context);
|
||||
// vmacros.pop_back();
|
||||
|
||||
LoadShader(GET_SHADER_INDEX(1, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, 0), str, cgfProf, vmacros, context);
|
||||
|
||||
// clut32
|
||||
sprintf(str, "Texture%s%d_clut32PS", fog?"Fog":"", texfilter);
|
||||
|
||||
// vmacros.push_back("-DACCURATE_DECOMPRESSION");
|
||||
// LoadShader(GET_SHADER_INDEX(2, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, SHADER_ACCURATE), str, cgfProf, vmacros, context);
|
||||
// vmacros.pop_back();
|
||||
|
||||
LoadShader(GET_SHADER_INDEX(2, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, 0), str, cgfProf, vmacros, context);
|
||||
|
||||
// tex32to16
|
||||
sprintf(str, "Texture%s%d_tex32to16PS", fog?"Fog":"", texfilter);
|
||||
|
||||
// vmacros.push_back("-DACCURATE_DECOMPRESSION");
|
||||
// LoadShader(GET_SHADER_INDEX(3, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, SHADER_ACCURATE), str, cgfProf, vmacros, context);
|
||||
// vmacros.pop_back();
|
||||
|
||||
LoadShader(GET_SHADER_INDEX(3, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, 0), str, cgfProf, vmacros, context);
|
||||
|
||||
// tex16to8h
|
||||
sprintf(str, "Texture%s%d_tex16to8hPS", fog?"Fog":"", texfilter);
|
||||
|
||||
// vmacros.push_back("-DACCURATE_DECOMPRESSION");
|
||||
// LoadShader(GET_SHADER_INDEX(4, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, SHADER_ACCURATE), str, cgfProf, vmacros, context);
|
||||
// vmacros.pop_back();
|
||||
|
||||
LoadShader(GET_SHADER_INDEX(4, texfilter, texwrap, fog, writedepth, testaem, exactcolor, context, 0), str, cgfProf, vmacros, context);
|
||||
}
|
||||
|
||||
if( exactcolor )
|
||||
vmacros.pop_back();
|
||||
}
|
||||
|
||||
if( testaem )
|
||||
vmacros.pop_back();
|
||||
}
|
||||
|
||||
if( writedepth )
|
||||
vmacros.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( g_pPsTexWrap[texwrap] != NULL )
|
||||
vmacros.pop_back();
|
||||
}
|
||||
|
||||
if( vmacros.size() != 0 )
|
||||
printf("error with macros!\n");
|
||||
|
||||
// create the database
|
||||
|
||||
int num = (int)mapShaders.size();
|
||||
|
||||
// first compress
|
||||
vector<char> buffer;
|
||||
buffer.reserve(10000000); // 10mb
|
||||
buffer.resize(sizeof(SHADERHEADER)*num);
|
||||
|
||||
i = 0;
|
||||
for(map<int, SHADERINFO>::iterator it = mapShaders.begin(); it != mapShaders.end(); ++it, ++i) {
|
||||
SHADERHEADER h;
|
||||
h.index = it->first | it->second.type;
|
||||
h.offset = (int)buffer.size();
|
||||
h.size = (int)it->second.buf.size();
|
||||
|
||||
memcpy(&buffer[0] + i*sizeof(SHADERHEADER), &h, sizeof(SHADERHEADER));
|
||||
|
||||
size_t cur = buffer.size();
|
||||
buffer.resize(cur + it->second.buf.size());
|
||||
memcpy(&buffer[cur], &it->second.buf[0], it->second.buf.size());
|
||||
}
|
||||
|
||||
int compressed_size;
|
||||
int real_size = (int)buffer.size();
|
||||
vector<char> dst;
|
||||
dst.resize(buffer.size());
|
||||
def(&buffer[0], &dst[0], (int)buffer.size(), &compressed_size);
|
||||
|
||||
// write to file
|
||||
// fmt: num shaders, size of compressed, compressed data
|
||||
FILE* fdst = fopen(dstfilename, "wb");
|
||||
if( fdst == NULL ) {
|
||||
printf("failed to open %s\n", dstfilename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fwrite(&num, 4, 1, fdst);
|
||||
fwrite(&compressed_size, 4, 1, fdst);
|
||||
fwrite(&real_size, 4, 1, fdst);
|
||||
fwrite(&dst[0], compressed_size, 1, fdst);
|
||||
|
||||
fclose(fdst);
|
||||
|
||||
printf("wrote %s\n", dstfilename);
|
||||
|
||||
cgDestroyContext(g_cgcontext);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
#ifndef __ZEROGS_SHADERS_H__
|
||||
#define __ZEROGS_SHADERS_H__
|
||||
|
||||
#include <Cg/cg.h>
|
||||
#include <Cg/cgGL.h>
|
||||
|
||||
#define NUM_FILTERS 2 // texture filtering
|
||||
#define NUM_TYPES 5 // types of texture read modes
|
||||
#define NUM_TEXWRAPS 4 // texture wrapping
|
||||
|
||||
#define SHADER_REDUCED 1 // equivalent to ps2.0
|
||||
#define SHADER_ACCURATE 2 // for older cards with less accurate math (ps2.x+)
|
||||
|
||||
#define NUM_SHADERS (NUM_FILTERS*NUM_TYPES*NUM_TEXWRAPS*32) // # shaders for a given ps
|
||||
|
||||
const static char* g_pShaders[] = { "full", "reduced", "accurate", "accurate-reduced" };
|
||||
const static char* g_pPsTexWrap[] = { "-DREPEAT", "-DCLAMP", "-DREGION_REPEAT", NULL };
|
||||
const static char* g_pTexTypes[] = { "32", "tex32", "clut32", "tex32to16", "tex16to8h" };
|
||||
|
||||
#define TEXWRAP_REPEAT 0
|
||||
#define TEXWRAP_CLAMP 1
|
||||
#define TEXWRAP_REGION_REPEAT 2
|
||||
#define TEXWRAP_REPEAT_CLAMP 3
|
||||
|
||||
inline int GET_SHADER_INDEX(int type, int texfilter, int texwrap, int fog, int writedepth, int testaem, int exactcolor, int context, int ps)
|
||||
{
|
||||
return type + texfilter*NUM_TYPES + NUM_FILTERS*NUM_TYPES*texwrap + NUM_TEXWRAPS*NUM_FILTERS*NUM_TYPES*(fog+2*writedepth+4*testaem+8*exactcolor+16*context+32*ps);
|
||||
}
|
||||
|
||||
extern CGcontext g_cgcontext;
|
||||
|
||||
static CGprogram LoadShaderFromType(const char* srcdir, const char* srcfile, int type, int texfilter, int texwrap, int fog, int writedepth, int testaem, int exactcolor, int ps, int context)
|
||||
{
|
||||
assert( texwrap < NUM_TEXWRAPS);
|
||||
assert( type < NUM_TYPES );
|
||||
|
||||
char str[255], strctx[255];
|
||||
sprintf(str, "Texture%s%d_%sPS", fog?"Fog":"", texfilter, g_pTexTypes[type]);
|
||||
sprintf(strctx, "-I%s%s", srcdir, context?"ctx1":"ctx0");
|
||||
|
||||
vector<const char*> macros;
|
||||
macros.push_back(strctx);
|
||||
#ifdef _DEBUG
|
||||
macros.push_back("-bestprecision");
|
||||
#endif
|
||||
if( g_pPsTexWrap[texwrap] != NULL ) macros.push_back(g_pPsTexWrap[texwrap]);
|
||||
if( writedepth ) macros.push_back("-DWRITE_DEPTH");
|
||||
if( testaem ) macros.push_back("-DTEST_AEM");
|
||||
if( exactcolor ) macros.push_back("-DEXACT_COLOR");
|
||||
if( ps & SHADER_ACCURATE ) macros.push_back("-DACCURATE_DECOMPRESSION");
|
||||
macros.push_back(NULL);
|
||||
|
||||
CGprogram prog = cgCreateProgramFromFile(g_cgcontext, CG_SOURCE, srcfile, CG_PROFILE_ARBFP1, str, ¯os[0]);
|
||||
if( !cgIsProgram(prog) ) {
|
||||
printf("Failed to load shader %s: \n%s\n", str, cgGetLastListing(g_cgcontext));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return prog;
|
||||
}
|
||||
|
||||
struct SHADERHEADER
|
||||
{
|
||||
unsigned int index, offset, size; // if highest bit of index is set, pixel shader
|
||||
};
|
||||
|
||||
#define SH_WRITEDEPTH 0x2000 // depth is written
|
||||
#define SH_CONTEXT1 0x1000 // context1 is used
|
||||
|
||||
#define SH_REGULARVS 0x8000
|
||||
#define SH_TEXTUREVS 0x8001
|
||||
#define SH_REGULARFOGVS 0x8002
|
||||
#define SH_TEXTUREFOGVS 0x8003
|
||||
#define SH_REGULARPS 0x8004
|
||||
#define SH_REGULARFOGPS 0x8005
|
||||
#define SH_BITBLTVS 0x8006
|
||||
#define SH_BITBLTPS 0x8007
|
||||
#define SH_BITBLTDEPTHPS 0x8009
|
||||
#define SH_CRTCTARGPS 0x800a
|
||||
#define SH_CRTCPS 0x800b
|
||||
#define SH_CRTC24PS 0x800c
|
||||
#define SH_ZEROPS 0x800e
|
||||
#define SH_BASETEXTUREPS 0x800f
|
||||
#define SH_BITBLTAAPS 0x8010
|
||||
#define SH_CRTCTARGINTERPS 0x8012
|
||||
#define SH_CRTCINTERPS 0x8013
|
||||
#define SH_CRTC24INTERPS 0x8014
|
||||
#define SH_BITBLTDEPTHMRTPS 0x8016
|
||||
#define SH_CONVERT16TO32PS 0x8020
|
||||
#define SH_CONVERT32TO16PS 0x8021
|
||||
#define SH_CRTC_NEARESTPS 0x8022
|
||||
#define SH_CRTCINTER_NEARESTPS 0x8023
|
||||
|
||||
#endif
|
|
@ -0,0 +1,441 @@
|
|||
/* crc32.h -- tables for rapid CRC calculation
|
||||
* Generated automatically by crc32.c
|
||||
*/
|
||||
|
||||
local const unsigned long FAR crc_table[TBLS][256] =
|
||||
{
|
||||
{
|
||||
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
|
||||
0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
|
||||
0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
|
||||
0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
|
||||
0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
|
||||
0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
|
||||
0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
|
||||
0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
|
||||
0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
|
||||
0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
|
||||
0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
|
||||
0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
|
||||
0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
|
||||
0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
|
||||
0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
|
||||
0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
|
||||
0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
|
||||
0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
|
||||
0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
|
||||
0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
|
||||
0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
|
||||
0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
|
||||
0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
|
||||
0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
|
||||
0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
|
||||
0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
|
||||
0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
|
||||
0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
|
||||
0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
|
||||
0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
|
||||
0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
|
||||
0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
|
||||
0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
|
||||
0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
|
||||
0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
|
||||
0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
|
||||
0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
|
||||
0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
|
||||
0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
|
||||
0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
|
||||
0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
|
||||
0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
|
||||
0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
|
||||
0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
|
||||
0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
|
||||
0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
|
||||
0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
|
||||
0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
|
||||
0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
|
||||
0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
|
||||
0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
|
||||
0x2d02ef8dUL
|
||||
#ifdef BYFOUR
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
|
||||
0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
|
||||
0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
|
||||
0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
|
||||
0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
|
||||
0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
|
||||
0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
|
||||
0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
|
||||
0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
|
||||
0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
|
||||
0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
|
||||
0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
|
||||
0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
|
||||
0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
|
||||
0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
|
||||
0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
|
||||
0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
|
||||
0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
|
||||
0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
|
||||
0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
|
||||
0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
|
||||
0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
|
||||
0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
|
||||
0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
|
||||
0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
|
||||
0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
|
||||
0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
|
||||
0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
|
||||
0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
|
||||
0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
|
||||
0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
|
||||
0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
|
||||
0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
|
||||
0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
|
||||
0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
|
||||
0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
|
||||
0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
|
||||
0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
|
||||
0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
|
||||
0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
|
||||
0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
|
||||
0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
|
||||
0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
|
||||
0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
|
||||
0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
|
||||
0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
|
||||
0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
|
||||
0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
|
||||
0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
|
||||
0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
|
||||
0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
|
||||
0x9324fd72UL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
|
||||
0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
|
||||
0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
|
||||
0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
|
||||
0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
|
||||
0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
|
||||
0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
|
||||
0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
|
||||
0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
|
||||
0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
|
||||
0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
|
||||
0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
|
||||
0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
|
||||
0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
|
||||
0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
|
||||
0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
|
||||
0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
|
||||
0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
|
||||
0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
|
||||
0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
|
||||
0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
|
||||
0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
|
||||
0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
|
||||
0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
|
||||
0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
|
||||
0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
|
||||
0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
|
||||
0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
|
||||
0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
|
||||
0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
|
||||
0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
|
||||
0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
|
||||
0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
|
||||
0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
|
||||
0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
|
||||
0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
|
||||
0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
|
||||
0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
|
||||
0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
|
||||
0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
|
||||
0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
|
||||
0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
|
||||
0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
|
||||
0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
|
||||
0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
|
||||
0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
|
||||
0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
|
||||
0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
|
||||
0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
|
||||
0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
|
||||
0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
|
||||
0xbe9834edUL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
|
||||
0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
|
||||
0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
|
||||
0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
|
||||
0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
|
||||
0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
|
||||
0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
|
||||
0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
|
||||
0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
|
||||
0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
|
||||
0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
|
||||
0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
|
||||
0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
|
||||
0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
|
||||
0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
|
||||
0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
|
||||
0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
|
||||
0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
|
||||
0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
|
||||
0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
|
||||
0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
|
||||
0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
|
||||
0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
|
||||
0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
|
||||
0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
|
||||
0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
|
||||
0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
|
||||
0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
|
||||
0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
|
||||
0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
|
||||
0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
|
||||
0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
|
||||
0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
|
||||
0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
|
||||
0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
|
||||
0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
|
||||
0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
|
||||
0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
|
||||
0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
|
||||
0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
|
||||
0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
|
||||
0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
|
||||
0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
|
||||
0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
|
||||
0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
|
||||
0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
|
||||
0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
|
||||
0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
|
||||
0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
|
||||
0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
|
||||
0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
|
||||
0xde0506f1UL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
|
||||
0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
|
||||
0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
|
||||
0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
|
||||
0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
|
||||
0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
|
||||
0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
|
||||
0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
|
||||
0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
|
||||
0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
|
||||
0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
|
||||
0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
|
||||
0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
|
||||
0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
|
||||
0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
|
||||
0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
|
||||
0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
|
||||
0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
|
||||
0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
|
||||
0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
|
||||
0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
|
||||
0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
|
||||
0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
|
||||
0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
|
||||
0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
|
||||
0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
|
||||
0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
|
||||
0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
|
||||
0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
|
||||
0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
|
||||
0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
|
||||
0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
|
||||
0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
|
||||
0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
|
||||
0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
|
||||
0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
|
||||
0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
|
||||
0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
|
||||
0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
|
||||
0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
|
||||
0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
|
||||
0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
|
||||
0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
|
||||
0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
|
||||
0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
|
||||
0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
|
||||
0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
|
||||
0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
|
||||
0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
|
||||
0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
|
||||
0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
|
||||
0x8def022dUL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
|
||||
0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
|
||||
0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
|
||||
0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
|
||||
0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
|
||||
0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
|
||||
0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
|
||||
0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
|
||||
0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
|
||||
0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
|
||||
0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
|
||||
0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
|
||||
0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
|
||||
0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
|
||||
0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
|
||||
0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
|
||||
0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
|
||||
0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
|
||||
0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
|
||||
0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
|
||||
0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
|
||||
0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
|
||||
0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
|
||||
0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
|
||||
0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
|
||||
0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
|
||||
0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
|
||||
0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
|
||||
0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
|
||||
0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
|
||||
0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
|
||||
0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
|
||||
0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
|
||||
0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
|
||||
0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
|
||||
0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
|
||||
0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
|
||||
0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
|
||||
0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
|
||||
0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
|
||||
0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
|
||||
0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
|
||||
0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
|
||||
0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
|
||||
0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
|
||||
0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
|
||||
0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
|
||||
0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
|
||||
0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
|
||||
0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
|
||||
0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
|
||||
0x72fd2493UL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
|
||||
0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
|
||||
0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
|
||||
0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
|
||||
0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
|
||||
0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
|
||||
0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
|
||||
0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
|
||||
0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
|
||||
0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
|
||||
0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
|
||||
0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
|
||||
0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
|
||||
0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
|
||||
0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
|
||||
0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
|
||||
0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
|
||||
0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
|
||||
0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
|
||||
0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
|
||||
0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
|
||||
0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
|
||||
0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
|
||||
0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
|
||||
0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
|
||||
0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
|
||||
0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
|
||||
0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
|
||||
0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
|
||||
0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
|
||||
0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
|
||||
0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
|
||||
0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
|
||||
0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
|
||||
0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
|
||||
0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
|
||||
0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
|
||||
0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
|
||||
0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
|
||||
0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
|
||||
0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
|
||||
0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
|
||||
0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
|
||||
0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
|
||||
0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
|
||||
0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
|
||||
0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
|
||||
0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
|
||||
0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
|
||||
0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
|
||||
0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
|
||||
0xed3498beUL
|
||||
},
|
||||
{
|
||||
0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
|
||||
0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
|
||||
0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
|
||||
0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
|
||||
0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
|
||||
0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
|
||||
0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
|
||||
0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
|
||||
0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
|
||||
0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
|
||||
0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
|
||||
0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
|
||||
0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
|
||||
0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
|
||||
0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
|
||||
0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
|
||||
0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
|
||||
0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
|
||||
0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
|
||||
0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
|
||||
0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
|
||||
0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
|
||||
0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
|
||||
0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
|
||||
0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
|
||||
0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
|
||||
0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
|
||||
0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
|
||||
0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
|
||||
0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
|
||||
0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
|
||||
0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
|
||||
0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
|
||||
0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
|
||||
0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
|
||||
0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
|
||||
0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
|
||||
0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
|
||||
0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
|
||||
0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
|
||||
0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
|
||||
0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
|
||||
0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
|
||||
0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
|
||||
0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
|
||||
0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
|
||||
0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
|
||||
0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
|
||||
0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
|
||||
0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
|
||||
0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
|
||||
0xf10605deUL
|
||||
#endif
|
||||
}
|
||||
};
|
|
@ -0,0 +1,331 @@
|
|||
/* deflate.h -- internal compression state
|
||||
* Copyright (C) 1995-2004 Jean-loup Gailly
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* @(#) $Id: deflate.h,v 1.2 2006/03/02 00:10:34 zerocool Exp $ */
|
||||
|
||||
#ifndef DEFLATE_H
|
||||
#define DEFLATE_H
|
||||
|
||||
#include "zutil.h"
|
||||
|
||||
/* define NO_GZIP when compiling if you want to disable gzip header and
|
||||
trailer creation by deflate(). NO_GZIP would be used to avoid linking in
|
||||
the crc code when it is not needed. For shared libraries, gzip encoding
|
||||
should be left enabled. */
|
||||
#ifndef NO_GZIP
|
||||
# define GZIP
|
||||
#endif
|
||||
|
||||
/* ===========================================================================
|
||||
* Internal compression state.
|
||||
*/
|
||||
|
||||
#define LENGTH_CODES 29
|
||||
/* number of length codes, not counting the special END_BLOCK code */
|
||||
|
||||
#define LITERALS 256
|
||||
/* number of literal bytes 0..255 */
|
||||
|
||||
#define L_CODES (LITERALS+1+LENGTH_CODES)
|
||||
/* number of Literal or Length codes, including the END_BLOCK code */
|
||||
|
||||
#define D_CODES 30
|
||||
/* number of distance codes */
|
||||
|
||||
#define BL_CODES 19
|
||||
/* number of codes used to transfer the bit lengths */
|
||||
|
||||
#define HEAP_SIZE (2*L_CODES+1)
|
||||
/* maximum heap size */
|
||||
|
||||
#define MAX_BITS 15
|
||||
/* All codes must not exceed MAX_BITS bits */
|
||||
|
||||
#define INIT_STATE 42
|
||||
#define EXTRA_STATE 69
|
||||
#define NAME_STATE 73
|
||||
#define COMMENT_STATE 91
|
||||
#define HCRC_STATE 103
|
||||
#define BUSY_STATE 113
|
||||
#define FINISH_STATE 666
|
||||
/* Stream status */
|
||||
|
||||
|
||||
/* Data structure describing a single value and its code string. */
|
||||
typedef struct ct_data_s {
|
||||
union {
|
||||
ush freq; /* frequency count */
|
||||
ush code; /* bit string */
|
||||
} fc;
|
||||
union {
|
||||
ush dad; /* father node in Huffman tree */
|
||||
ush len; /* length of bit string */
|
||||
} dl;
|
||||
} FAR ct_data;
|
||||
|
||||
#define Freq fc.freq
|
||||
#define Code fc.code
|
||||
#define Dad dl.dad
|
||||
#define Len dl.len
|
||||
|
||||
typedef struct static_tree_desc_s static_tree_desc;
|
||||
|
||||
typedef struct tree_desc_s {
|
||||
ct_data *dyn_tree; /* the dynamic tree */
|
||||
int max_code; /* largest code with non zero frequency */
|
||||
static_tree_desc *stat_desc; /* the corresponding static tree */
|
||||
} FAR tree_desc;
|
||||
|
||||
typedef ush Pos;
|
||||
typedef Pos FAR Posf;
|
||||
typedef unsigned IPos;
|
||||
|
||||
/* A Pos is an index in the character window. We use short instead of int to
|
||||
* save space in the various tables. IPos is used only for parameter passing.
|
||||
*/
|
||||
|
||||
typedef struct internal_state {
|
||||
z_streamp strm; /* pointer back to this zlib stream */
|
||||
int status; /* as the name implies */
|
||||
Bytef *pending_buf; /* output still pending */
|
||||
ulg pending_buf_size; /* size of pending_buf */
|
||||
Bytef *pending_out; /* next pending byte to output to the stream */
|
||||
uInt pending; /* nb of bytes in the pending buffer */
|
||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
|
||||
gz_headerp gzhead; /* gzip header information to write */
|
||||
uInt gzindex; /* where in extra, name, or comment */
|
||||
Byte method; /* STORED (for zip only) or DEFLATED */
|
||||
int last_flush; /* value of flush param for previous deflate call */
|
||||
|
||||
/* used by deflate.c: */
|
||||
|
||||
uInt w_size; /* LZ77 window size (32K by default) */
|
||||
uInt w_bits; /* log2(w_size) (8..16) */
|
||||
uInt w_mask; /* w_size - 1 */
|
||||
|
||||
Bytef *window;
|
||||
/* Sliding window. Input bytes are read into the second half of the window,
|
||||
* and move to the first half later to keep a dictionary of at least wSize
|
||||
* bytes. With this organization, matches are limited to a distance of
|
||||
* wSize-MAX_MATCH bytes, but this ensures that IO is always
|
||||
* performed with a length multiple of the block size. Also, it limits
|
||||
* the window size to 64K, which is quite useful on MSDOS.
|
||||
* To do: use the user input buffer as sliding window.
|
||||
*/
|
||||
|
||||
ulg window_size;
|
||||
/* Actual size of window: 2*wSize, except when the user input buffer
|
||||
* is directly used as sliding window.
|
||||
*/
|
||||
|
||||
Posf *prev;
|
||||
/* Link to older string with same hash index. To limit the size of this
|
||||
* array to 64K, this link is maintained only for the last 32K strings.
|
||||
* An index in this array is thus a window index modulo 32K.
|
||||
*/
|
||||
|
||||
Posf *head; /* Heads of the hash chains or NIL. */
|
||||
|
||||
uInt ins_h; /* hash index of string to be inserted */
|
||||
uInt hash_size; /* number of elements in hash table */
|
||||
uInt hash_bits; /* log2(hash_size) */
|
||||
uInt hash_mask; /* hash_size-1 */
|
||||
|
||||
uInt hash_shift;
|
||||
/* Number of bits by which ins_h must be shifted at each input
|
||||
* step. It must be such that after MIN_MATCH steps, the oldest
|
||||
* byte no longer takes part in the hash key, that is:
|
||||
* hash_shift * MIN_MATCH >= hash_bits
|
||||
*/
|
||||
|
||||
long block_start;
|
||||
/* Window position at the beginning of the current output block. Gets
|
||||
* negative when the window is moved backwards.
|
||||
*/
|
||||
|
||||
uInt match_length; /* length of best match */
|
||||
IPos prev_match; /* previous match */
|
||||
int match_available; /* set if previous match exists */
|
||||
uInt strstart; /* start of string to insert */
|
||||
uInt match_start; /* start of matching string */
|
||||
uInt lookahead; /* number of valid bytes ahead in window */
|
||||
|
||||
uInt prev_length;
|
||||
/* Length of the best match at previous step. Matches not greater than this
|
||||
* are discarded. This is used in the lazy match evaluation.
|
||||
*/
|
||||
|
||||
uInt max_chain_length;
|
||||
/* To speed up deflation, hash chains are never searched beyond this
|
||||
* length. A higher limit improves compression ratio but degrades the
|
||||
* speed.
|
||||
*/
|
||||
|
||||
uInt max_lazy_match;
|
||||
/* Attempt to find a better match only when the current match is strictly
|
||||
* smaller than this value. This mechanism is used only for compression
|
||||
* levels >= 4.
|
||||
*/
|
||||
# define max_insert_length max_lazy_match
|
||||
/* Insert new strings in the hash table only if the match length is not
|
||||
* greater than this length. This saves time but degrades compression.
|
||||
* max_insert_length is used only for compression levels <= 3.
|
||||
*/
|
||||
|
||||
int level; /* compression level (1..9) */
|
||||
int strategy; /* favor or force Huffman coding*/
|
||||
|
||||
uInt good_match;
|
||||
/* Use a faster search when the previous match is longer than this */
|
||||
|
||||
int nice_match; /* Stop searching when current match exceeds this */
|
||||
|
||||
/* used by trees.c: */
|
||||
/* Didn't use ct_data typedef below to supress compiler warning */
|
||||
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
|
||||
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
|
||||
struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
|
||||
|
||||
struct tree_desc_s l_desc; /* desc. for literal tree */
|
||||
struct tree_desc_s d_desc; /* desc. for distance tree */
|
||||
struct tree_desc_s bl_desc; /* desc. for bit length tree */
|
||||
|
||||
ush bl_count[MAX_BITS+1];
|
||||
/* number of codes at each bit length for an optimal tree */
|
||||
|
||||
int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
|
||||
int heap_len; /* number of elements in the heap */
|
||||
int heap_max; /* element of largest frequency */
|
||||
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
|
||||
* The same heap array is used to build all trees.
|
||||
*/
|
||||
|
||||
uch depth[2*L_CODES+1];
|
||||
/* Depth of each subtree used as tie breaker for trees of equal frequency
|
||||
*/
|
||||
|
||||
uchf *l_buf; /* buffer for literals or lengths */
|
||||
|
||||
uInt lit_bufsize;
|
||||
/* Size of match buffer for literals/lengths. There are 4 reasons for
|
||||
* limiting lit_bufsize to 64K:
|
||||
* - frequencies can be kept in 16 bit counters
|
||||
* - if compression is not successful for the first block, all input
|
||||
* data is still in the window so we can still emit a stored block even
|
||||
* when input comes from standard input. (This can also be done for
|
||||
* all blocks if lit_bufsize is not greater than 32K.)
|
||||
* - if compression is not successful for a file smaller than 64K, we can
|
||||
* even emit a stored file instead of a stored block (saving 5 bytes).
|
||||
* This is applicable only for zip (not gzip or zlib).
|
||||
* - creating new Huffman trees less frequently may not provide fast
|
||||
* adaptation to changes in the input data statistics. (Take for
|
||||
* example a binary file with poorly compressible code followed by
|
||||
* a highly compressible string table.) Smaller buffer sizes give
|
||||
* fast adaptation but have of course the overhead of transmitting
|
||||
* trees more frequently.
|
||||
* - I can't count above 4
|
||||
*/
|
||||
|
||||
uInt last_lit; /* running index in l_buf */
|
||||
|
||||
ushf *d_buf;
|
||||
/* Buffer for distances. To simplify the code, d_buf and l_buf have
|
||||
* the same number of elements. To use different lengths, an extra flag
|
||||
* array would be necessary.
|
||||
*/
|
||||
|
||||
ulg opt_len; /* bit length of current block with optimal trees */
|
||||
ulg static_len; /* bit length of current block with static trees */
|
||||
uInt matches; /* number of string matches in current block */
|
||||
int last_eob_len; /* bit length of EOB code for last block */
|
||||
|
||||
#ifdef DEBUG
|
||||
ulg compressed_len; /* total bit length of compressed file mod 2^32 */
|
||||
ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
|
||||
#endif
|
||||
|
||||
ush bi_buf;
|
||||
/* Output buffer. bits are inserted starting at the bottom (least
|
||||
* significant bits).
|
||||
*/
|
||||
int bi_valid;
|
||||
/* Number of valid bits in bi_buf. All bits above the last valid bit
|
||||
* are always zero.
|
||||
*/
|
||||
|
||||
} FAR deflate_state;
|
||||
|
||||
/* Output a byte on the stream.
|
||||
* IN assertion: there is enough room in pending_buf.
|
||||
*/
|
||||
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
|
||||
|
||||
|
||||
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
|
||||
/* Minimum amount of lookahead, except at the end of the input file.
|
||||
* See deflate.c for comments about the MIN_MATCH+1.
|
||||
*/
|
||||
|
||||
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
|
||||
/* In order to simplify the code, particularly on 16 bit machines, match
|
||||
* distances are limited to MAX_DIST instead of WSIZE.
|
||||
*/
|
||||
|
||||
/* in trees.c */
|
||||
void _tr_init OF((deflate_state *s));
|
||||
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
|
||||
void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
|
||||
int eof));
|
||||
void _tr_align OF((deflate_state *s));
|
||||
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
|
||||
int eof));
|
||||
|
||||
#define d_code(dist) \
|
||||
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
|
||||
/* Mapping from a distance to a distance code. dist is the distance - 1 and
|
||||
* must not have side effects. _dist_code[256] and _dist_code[257] are never
|
||||
* used.
|
||||
*/
|
||||
|
||||
#ifndef DEBUG
|
||||
/* Inline versions of _tr_tally for speed: */
|
||||
|
||||
#if defined(GEN_TREES_H) || !defined(STDC)
|
||||
extern uch _length_code[];
|
||||
extern uch _dist_code[];
|
||||
#else
|
||||
extern const uch _length_code[];
|
||||
extern const uch _dist_code[];
|
||||
#endif
|
||||
|
||||
# define _tr_tally_lit(s, c, flush) \
|
||||
{ uch cc = (c); \
|
||||
s->d_buf[s->last_lit] = 0; \
|
||||
s->l_buf[s->last_lit++] = cc; \
|
||||
s->dyn_ltree[cc].Freq++; \
|
||||
flush = (s->last_lit == s->lit_bufsize-1); \
|
||||
}
|
||||
# define _tr_tally_dist(s, distance, length, flush) \
|
||||
{ uch len = (length); \
|
||||
ush dist = (distance); \
|
||||
s->d_buf[s->last_lit] = dist; \
|
||||
s->l_buf[s->last_lit++] = len; \
|
||||
dist--; \
|
||||
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
|
||||
s->dyn_dtree[d_code(dist)].Freq++; \
|
||||
flush = (s->last_lit == s->lit_bufsize-1); \
|
||||
}
|
||||
#else
|
||||
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
|
||||
# define _tr_tally_dist(s, distance, length, flush) \
|
||||
flush = _tr_tally(s, distance, length)
|
||||
#endif
|
||||
|
||||
#endif /* DEFLATE_H */
|
|
@ -0,0 +1,11 @@
|
|||
/* inffast.h -- header to use inffast.c
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
void inflate_fast OF((z_streamp strm, unsigned start));
|
|
@ -0,0 +1,94 @@
|
|||
/* inffixed.h -- table for decoding fixed codes
|
||||
* Generated automatically by makefixed().
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It
|
||||
is part of the implementation of the compression library and
|
||||
is subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
static const code lenfix[512] = {
|
||||
{96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
|
||||
{0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
|
||||
{0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
|
||||
{0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
|
||||
{0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
|
||||
{21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
|
||||
{0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
|
||||
{0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
|
||||
{18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
|
||||
{0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
|
||||
{0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
|
||||
{0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
|
||||
{20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
|
||||
{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
|
||||
{0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
|
||||
{0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
|
||||
{16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
|
||||
{0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
|
||||
{0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
|
||||
{0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
|
||||
{0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
|
||||
{0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
|
||||
{0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
|
||||
{0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
|
||||
{17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
|
||||
{0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
|
||||
{0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
|
||||
{0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
|
||||
{19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
|
||||
{0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
|
||||
{0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
|
||||
{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
|
||||
{16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
|
||||
{0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
|
||||
{0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
|
||||
{0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
|
||||
{0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
|
||||
{20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
|
||||
{0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
|
||||
{0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
|
||||
{17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
|
||||
{0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
|
||||
{0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
|
||||
{0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
|
||||
{20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
|
||||
{0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
|
||||
{0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
|
||||
{0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
|
||||
{16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
|
||||
{0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
|
||||
{0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
|
||||
{0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
|
||||
{0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
|
||||
{0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
|
||||
{0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
|
||||
{0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
|
||||
{16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
|
||||
{0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
|
||||
{0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
|
||||
{0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
|
||||
{19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
|
||||
{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
|
||||
{0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
|
||||
{0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
|
||||
{16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
|
||||
{0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
|
||||
{0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
|
||||
{0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
|
||||
{0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
|
||||
{64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
|
||||
{0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
|
||||
{0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
|
||||
{18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
|
||||
{0,9,255}
|
||||
};
|
||||
|
||||
static const code distfix[32] = {
|
||||
{16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
|
||||
{21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
|
||||
{18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
|
||||
{19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
|
||||
{16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
|
||||
{22,5,193},{64,5,0}
|
||||
};
|
|
@ -0,0 +1,115 @@
|
|||
/* inflate.h -- internal inflate state definition
|
||||
* Copyright (C) 1995-2004 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* define NO_GZIP when compiling if you want to disable gzip header and
|
||||
trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
|
||||
the crc code when it is not needed. For shared libraries, gzip decoding
|
||||
should be left enabled. */
|
||||
#ifndef NO_GZIP
|
||||
# define GUNZIP
|
||||
#endif
|
||||
|
||||
/* Possible inflate modes between inflate() calls */
|
||||
typedef enum {
|
||||
HEAD, /* i: waiting for magic header */
|
||||
FLAGS, /* i: waiting for method and flags (gzip) */
|
||||
TIME, /* i: waiting for modification time (gzip) */
|
||||
OS, /* i: waiting for extra flags and operating system (gzip) */
|
||||
EXLEN, /* i: waiting for extra length (gzip) */
|
||||
EXTRA, /* i: waiting for extra bytes (gzip) */
|
||||
NAME, /* i: waiting for end of file name (gzip) */
|
||||
COMMENT, /* i: waiting for end of comment (gzip) */
|
||||
HCRC, /* i: waiting for header crc (gzip) */
|
||||
DICTID, /* i: waiting for dictionary check value */
|
||||
DICT, /* waiting for inflateSetDictionary() call */
|
||||
TYPE, /* i: waiting for type bits, including last-flag bit */
|
||||
TYPEDO, /* i: same, but skip check to exit inflate on new block */
|
||||
STORED, /* i: waiting for stored size (length and complement) */
|
||||
COPY, /* i/o: waiting for input or output to copy stored block */
|
||||
TABLE, /* i: waiting for dynamic block table lengths */
|
||||
LENLENS, /* i: waiting for code length code lengths */
|
||||
CODELENS, /* i: waiting for length/lit and distance code lengths */
|
||||
LEN, /* i: waiting for length/lit code */
|
||||
LENEXT, /* i: waiting for length extra bits */
|
||||
DIST, /* i: waiting for distance code */
|
||||
DISTEXT, /* i: waiting for distance extra bits */
|
||||
MATCH, /* o: waiting for output space to copy string */
|
||||
LIT, /* o: waiting for output space to write literal */
|
||||
CHECK, /* i: waiting for 32-bit check value */
|
||||
LENGTH, /* i: waiting for 32-bit length (gzip) */
|
||||
DONE, /* finished check, done -- remain here until reset */
|
||||
BAD, /* got a data error -- remain here until reset */
|
||||
MEM, /* got an inflate() memory error -- remain here until reset */
|
||||
SYNC /* looking for synchronization bytes to restart inflate() */
|
||||
} inflate_mode;
|
||||
|
||||
/*
|
||||
State transitions between above modes -
|
||||
|
||||
(most modes can go to the BAD or MEM mode -- not shown for clarity)
|
||||
|
||||
Process header:
|
||||
HEAD -> (gzip) or (zlib)
|
||||
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
|
||||
NAME -> COMMENT -> HCRC -> TYPE
|
||||
(zlib) -> DICTID or TYPE
|
||||
DICTID -> DICT -> TYPE
|
||||
Read deflate blocks:
|
||||
TYPE -> STORED or TABLE or LEN or CHECK
|
||||
STORED -> COPY -> TYPE
|
||||
TABLE -> LENLENS -> CODELENS -> LEN
|
||||
Read deflate codes:
|
||||
LEN -> LENEXT or LIT or TYPE
|
||||
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
|
||||
LIT -> LEN
|
||||
Process trailer:
|
||||
CHECK -> LENGTH -> DONE
|
||||
*/
|
||||
|
||||
/* state maintained between inflate() calls. Approximately 7K bytes. */
|
||||
struct inflate_state {
|
||||
inflate_mode mode; /* current inflate mode */
|
||||
int last; /* true if processing last block */
|
||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
|
||||
int havedict; /* true if dictionary provided */
|
||||
int flags; /* gzip header method and flags (0 if zlib) */
|
||||
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
|
||||
unsigned long check; /* protected copy of check value */
|
||||
unsigned long total; /* protected copy of output count */
|
||||
gz_headerp head; /* where to save gzip header information */
|
||||
/* sliding window */
|
||||
unsigned wbits; /* log base 2 of requested window size */
|
||||
unsigned wsize; /* window size or zero if not using window */
|
||||
unsigned whave; /* valid bytes in the window */
|
||||
unsigned write; /* window write index */
|
||||
unsigned char FAR *window; /* allocated sliding window, if needed */
|
||||
/* bit accumulator */
|
||||
unsigned long hold; /* input bit accumulator */
|
||||
unsigned bits; /* number of bits in "in" */
|
||||
/* for string and stored block copying */
|
||||
unsigned length; /* literal or length of data to copy */
|
||||
unsigned offset; /* distance back to copy string from */
|
||||
/* for table and code decoding */
|
||||
unsigned extra; /* extra bits needed */
|
||||
/* fixed and dynamic code tables */
|
||||
code const FAR *lencode; /* starting table for length/literal codes */
|
||||
code const FAR *distcode; /* starting table for distance codes */
|
||||
unsigned lenbits; /* index bits for lencode */
|
||||
unsigned distbits; /* index bits for distcode */
|
||||
/* dynamic table building */
|
||||
unsigned ncode; /* number of code length code lengths */
|
||||
unsigned nlen; /* number of length code lengths */
|
||||
unsigned ndist; /* number of distance code lengths */
|
||||
unsigned have; /* number of code lengths in lens[] */
|
||||
code FAR *next; /* next available space in codes[] */
|
||||
unsigned short lens[320]; /* temporary storage for code lengths */
|
||||
unsigned short work[288]; /* work area for code table building */
|
||||
code codes[ENOUGH]; /* space for code tables */
|
||||
};
|
|
@ -0,0 +1,55 @@
|
|||
/* inftrees.h -- header to use inftrees.c
|
||||
* Copyright (C) 1995-2005 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* Structure for decoding tables. Each entry provides either the
|
||||
information needed to do the operation requested by the code that
|
||||
indexed that table entry, or it provides a pointer to another
|
||||
table that indexes more bits of the code. op indicates whether
|
||||
the entry is a pointer to another table, a literal, a length or
|
||||
distance, an end-of-block, or an invalid code. For a table
|
||||
pointer, the low four bits of op is the number of index bits of
|
||||
that table. For a length or distance, the low four bits of op
|
||||
is the number of extra bits to get after the code. bits is
|
||||
the number of bits in this code or part of the code to drop off
|
||||
of the bit buffer. val is the actual byte to output in the case
|
||||
of a literal, the base length or distance, or the offset from
|
||||
the current table to the next table. Each entry is four bytes. */
|
||||
typedef struct {
|
||||
unsigned char op; /* operation, extra bits, table bits */
|
||||
unsigned char bits; /* bits in this part of the code */
|
||||
unsigned short val; /* offset in table or code value */
|
||||
} code;
|
||||
|
||||
/* op values as set by inflate_table():
|
||||
00000000 - literal
|
||||
0000tttt - table link, tttt != 0 is the number of table index bits
|
||||
0001eeee - length or distance, eeee is the number of extra bits
|
||||
01100000 - end of block
|
||||
01000000 - invalid code
|
||||
*/
|
||||
|
||||
/* Maximum size of dynamic tree. The maximum found in a long but non-
|
||||
exhaustive search was 1444 code structures (852 for length/literals
|
||||
and 592 for distances, the latter actually the result of an
|
||||
exhaustive search). The true maximum is not known, but the value
|
||||
below is more than safe. */
|
||||
#define ENOUGH 2048
|
||||
#define MAXD 592
|
||||
|
||||
/* Type of code to build for inftable() */
|
||||
typedef enum {
|
||||
CODES,
|
||||
LENS,
|
||||
DISTS
|
||||
} codetype;
|
||||
|
||||
extern int inflate_table OF((codetype type, unsigned short FAR *lens,
|
||||
unsigned codes, code FAR * FAR *table,
|
||||
unsigned FAR *bits, unsigned short FAR *work));
|
|
@ -0,0 +1,128 @@
|
|||
/* header created automatically with -DGEN_TREES_H */
|
||||
|
||||
local const ct_data static_ltree[L_CODES+2] = {
|
||||
{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
|
||||
{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
|
||||
{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
|
||||
{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
|
||||
{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
|
||||
{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
|
||||
{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
|
||||
{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
|
||||
{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
|
||||
{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
|
||||
{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
|
||||
{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
|
||||
{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
|
||||
{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
|
||||
{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
|
||||
{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
|
||||
{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
|
||||
{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
|
||||
{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
|
||||
{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
|
||||
{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
|
||||
{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
|
||||
{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
|
||||
{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
|
||||
{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
|
||||
{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
|
||||
{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
|
||||
{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
|
||||
{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
|
||||
{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
|
||||
{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
|
||||
{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
|
||||
{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
|
||||
{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
|
||||
{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
|
||||
{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
|
||||
{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
|
||||
{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
|
||||
{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
|
||||
{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
|
||||
{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
|
||||
{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
|
||||
{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
|
||||
{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
|
||||
{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
|
||||
{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
|
||||
{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
|
||||
{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
|
||||
{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
|
||||
{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
|
||||
{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
|
||||
{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
|
||||
{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
|
||||
{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
|
||||
{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
|
||||
{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
|
||||
{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
|
||||
{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
|
||||
};
|
||||
|
||||
local const ct_data static_dtree[D_CODES] = {
|
||||
{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
|
||||
{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
|
||||
{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
|
||||
{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
|
||||
{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
|
||||
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
|
||||
};
|
||||
|
||||
const uch _dist_code[DIST_CODE_LEN] = {
|
||||
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
|
||||
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
|
||||
18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
|
||||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
|
||||
};
|
||||
|
||||
const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
|
||||
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
|
||||
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
|
||||
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
|
||||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
|
||||
};
|
||||
|
||||
local const int base_length[LENGTH_CODES] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
|
||||
64, 80, 96, 112, 128, 160, 192, 224, 0
|
||||
};
|
||||
|
||||
local const int base_dist[D_CODES] = {
|
||||
0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
|
||||
32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
|
||||
1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
|
||||
};
|
||||
|
|
@ -0,0 +1,332 @@
|
|||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2005 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: zconf.h,v 1.2 2006/03/02 00:10:34 zerocool Exp $ */
|
||||
|
||||
#ifndef ZCONF_H
|
||||
#define ZCONF_H
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||
*/
|
||||
#ifdef Z_PREFIX
|
||||
# define deflateInit_ z_deflateInit_
|
||||
# define deflate z_deflate
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflate z_inflate
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateCopy z_deflateCopy
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflateParams z_deflateParams
|
||||
# define deflateBound z_deflateBound
|
||||
# define deflatePrime z_deflatePrime
|
||||
# define inflateInit2_ z_inflateInit2_
|
||||
# define inflateSetDictionary z_inflateSetDictionary
|
||||
# define inflateSync z_inflateSync
|
||||
# define inflateSyncPoint z_inflateSyncPoint
|
||||
# define inflateCopy z_inflateCopy
|
||||
# define inflateReset z_inflateReset
|
||||
# define inflateBack z_inflateBack
|
||||
# define inflateBackEnd z_inflateBackEnd
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define compressBound z_compressBound
|
||||
# define uncompress z_uncompress
|
||||
# define adler32 z_adler32
|
||||
# define crc32 z_crc32
|
||||
# define get_crc_table z_get_crc_table
|
||||
# define zError z_zError
|
||||
|
||||
# define alloc_func z_alloc_func
|
||||
# define free_func z_free_func
|
||||
# define in_func z_in_func
|
||||
# define out_func z_out_func
|
||||
# define Byte z_Byte
|
||||
# define uInt z_uInt
|
||||
# define uLong z_uLong
|
||||
# define Bytef z_Bytef
|
||||
# define charf z_charf
|
||||
# define intf z_intf
|
||||
# define uIntf z_uIntf
|
||||
# define uLongf z_uLongf
|
||||
# define voidpf z_voidpf
|
||||
# define voidp z_voidp
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||
# define MSDOS
|
||||
#endif
|
||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||
# define OS2
|
||||
#endif
|
||||
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||
# define WINDOWS
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||
# ifndef SYS16BIT
|
||||
# define SYS16BIT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# define MAXSEG_64K
|
||||
#endif
|
||||
#ifdef MSDOS
|
||||
# define UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
#ifdef __STDC_VERSION__
|
||||
# ifndef STDC
|
||||
# define STDC
|
||||
# endif
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# ifndef STDC99
|
||||
# define STDC99
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||
# define const /* note: need a more gentle solution here */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */
|
||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||
# define NO_DUMMY_DECL
|
||||
#endif
|
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */
|
||||
#ifndef MAX_MEM_LEVEL
|
||||
# ifdef MAXSEG_64K
|
||||
# define MAX_MEM_LEVEL 8
|
||||
# else
|
||||
# define MAX_MEM_LEVEL 9
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||
* created by gzip. (Files created by minigzip can still be extracted by
|
||||
* gzip.)
|
||||
*/
|
||||
#ifndef MAX_WBITS
|
||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||
#endif
|
||||
|
||||
/* The memory requirements for deflate are (in bytes):
|
||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||
the default memory requirements from 256K to 128K, compile with
|
||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||
Of course this will generally degrade compression (there's no free lunch).
|
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||
for small objects.
|
||||
*/
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
#ifndef OF /* function prototypes */
|
||||
# ifdef STDC
|
||||
# define OF(args) args
|
||||
# else
|
||||
# define OF(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||
* just define FAR to be empty.
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# if defined(M_I86SM) || defined(M_I86MM)
|
||||
/* MSC small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef _MSC_VER
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
/* Turbo C small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef __BORLANDC__
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(WINDOWS) || defined(WIN32)
|
||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||
* This is not mandatory, but it offers a little performance increase.
|
||||
*/
|
||||
# ifdef ZLIB_DLL
|
||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# endif /* ZLIB_DLL */
|
||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||
* define ZLIB_WINAPI.
|
||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||
*/
|
||||
# ifdef ZLIB_WINAPI
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# include <windows.h>
|
||||
/* No need for _export, use ZLIB.DEF instead. */
|
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||
# define ZEXPORT WINAPI
|
||||
# ifdef WIN32
|
||||
# define ZEXPORTVA WINAPIV
|
||||
# else
|
||||
# define ZEXPORTVA FAR CDECL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (__BEOS__)
|
||||
# ifdef ZLIB_DLL
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXPORT __declspec(dllexport)
|
||||
# define ZEXPORTVA __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXPORT __declspec(dllimport)
|
||||
# define ZEXPORTVA __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
#ifndef ZEXPORT
|
||||
# define ZEXPORT
|
||||
#endif
|
||||
#ifndef ZEXPORTVA
|
||||
# define ZEXPORTVA
|
||||
#endif
|
||||
|
||||
#ifndef FAR
|
||||
# define FAR
|
||||
#endif
|
||||
|
||||
#if !defined(__MACTYPES__)
|
||||
typedef unsigned char Byte; /* 8 bits */
|
||||
#endif
|
||||
typedef unsigned int uInt; /* 16 bits or more */
|
||||
typedef unsigned long uLong; /* 32 bits or more */
|
||||
|
||||
#ifdef SMALL_MEDIUM
|
||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||
# define Bytef Byte FAR
|
||||
#else
|
||||
typedef Byte FAR Bytef;
|
||||
#endif
|
||||
typedef char FAR charf;
|
||||
typedef int FAR intf;
|
||||
typedef uInt FAR uIntf;
|
||||
typedef uLong FAR uLongf;
|
||||
|
||||
#ifdef STDC
|
||||
typedef void const *voidpc;
|
||||
typedef void FAR *voidpf;
|
||||
typedef void *voidp;
|
||||
#else
|
||||
typedef Byte const *voidpc;
|
||||
typedef Byte FAR *voidpf;
|
||||
typedef Byte *voidp;
|
||||
#endif
|
||||
|
||||
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* for SEEK_* and off_t */
|
||||
# ifdef VMS
|
||||
# include <unixio.h> /* for off_t */
|
||||
# endif
|
||||
# define z_off_t off_t
|
||||
#endif
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
# define SEEK_CUR 1 /* Seek from current position. */
|
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||
#endif
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__)
|
||||
# define NO_vsnprintf
|
||||
#endif
|
||||
|
||||
#if defined(__MVS__)
|
||||
# define NO_vsnprintf
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
# pragma map(deflateInit_,"DEIN")
|
||||
# pragma map(deflateInit2_,"DEIN2")
|
||||
# pragma map(deflateEnd,"DEEND")
|
||||
# pragma map(deflateBound,"DEBND")
|
||||
# pragma map(inflateInit_,"ININ")
|
||||
# pragma map(inflateInit2_,"ININ2")
|
||||
# pragma map(inflateEnd,"INEND")
|
||||
# pragma map(inflateSync,"INSY")
|
||||
# pragma map(inflateSetDictionary,"INSEDI")
|
||||
# pragma map(compressBound,"CMBND")
|
||||
# pragma map(inflate_table,"INTABL")
|
||||
# pragma map(inflate_fast,"INFA")
|
||||
# pragma map(inflate_copyright,"INCOPY")
|
||||
#endif
|
||||
|
||||
#endif /* ZCONF_H */
|
|
@ -0,0 +1,332 @@
|
|||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2005 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id: zconf.in.h,v 1.2 2006/03/02 00:10:34 zerocool Exp $ */
|
||||
|
||||
#ifndef ZCONF_H
|
||||
#define ZCONF_H
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||
*/
|
||||
#ifdef Z_PREFIX
|
||||
# define deflateInit_ z_deflateInit_
|
||||
# define deflate z_deflate
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflate z_inflate
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateCopy z_deflateCopy
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflateParams z_deflateParams
|
||||
# define deflateBound z_deflateBound
|
||||
# define deflatePrime z_deflatePrime
|
||||
# define inflateInit2_ z_inflateInit2_
|
||||
# define inflateSetDictionary z_inflateSetDictionary
|
||||
# define inflateSync z_inflateSync
|
||||
# define inflateSyncPoint z_inflateSyncPoint
|
||||
# define inflateCopy z_inflateCopy
|
||||
# define inflateReset z_inflateReset
|
||||
# define inflateBack z_inflateBack
|
||||
# define inflateBackEnd z_inflateBackEnd
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define compressBound z_compressBound
|
||||
# define uncompress z_uncompress
|
||||
# define adler32 z_adler32
|
||||
# define crc32 z_crc32
|
||||
# define get_crc_table z_get_crc_table
|
||||
# define zError z_zError
|
||||
|
||||
# define alloc_func z_alloc_func
|
||||
# define free_func z_free_func
|
||||
# define in_func z_in_func
|
||||
# define out_func z_out_func
|
||||
# define Byte z_Byte
|
||||
# define uInt z_uInt
|
||||
# define uLong z_uLong
|
||||
# define Bytef z_Bytef
|
||||
# define charf z_charf
|
||||
# define intf z_intf
|
||||
# define uIntf z_uIntf
|
||||
# define uLongf z_uLongf
|
||||
# define voidpf z_voidpf
|
||||
# define voidp z_voidp
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||
# define MSDOS
|
||||
#endif
|
||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||
# define OS2
|
||||
#endif
|
||||
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||
# define WINDOWS
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||
# ifndef SYS16BIT
|
||||
# define SYS16BIT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# define MAXSEG_64K
|
||||
#endif
|
||||
#ifdef MSDOS
|
||||
# define UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
#ifdef __STDC_VERSION__
|
||||
# ifndef STDC
|
||||
# define STDC
|
||||
# endif
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# ifndef STDC99
|
||||
# define STDC99
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||
# define const /* note: need a more gentle solution here */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */
|
||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||
# define NO_DUMMY_DECL
|
||||
#endif
|
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */
|
||||
#ifndef MAX_MEM_LEVEL
|
||||
# ifdef MAXSEG_64K
|
||||
# define MAX_MEM_LEVEL 8
|
||||
# else
|
||||
# define MAX_MEM_LEVEL 9
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||
* created by gzip. (Files created by minigzip can still be extracted by
|
||||
* gzip.)
|
||||
*/
|
||||
#ifndef MAX_WBITS
|
||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||
#endif
|
||||
|
||||
/* The memory requirements for deflate are (in bytes):
|
||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||
the default memory requirements from 256K to 128K, compile with
|
||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||
Of course this will generally degrade compression (there's no free lunch).
|
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||
for small objects.
|
||||
*/
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
#ifndef OF /* function prototypes */
|
||||
# ifdef STDC
|
||||
# define OF(args) args
|
||||
# else
|
||||
# define OF(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||
* just define FAR to be empty.
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# if defined(M_I86SM) || defined(M_I86MM)
|
||||
/* MSC small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef _MSC_VER
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
/* Turbo C small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef __BORLANDC__
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(WINDOWS) || defined(WIN32)
|
||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||
* This is not mandatory, but it offers a little performance increase.
|
||||
*/
|
||||
# ifdef ZLIB_DLL
|
||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# endif /* ZLIB_DLL */
|
||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||
* define ZLIB_WINAPI.
|
||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||
*/
|
||||
# ifdef ZLIB_WINAPI
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# include <windows.h>
|
||||
/* No need for _export, use ZLIB.DEF instead. */
|
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||
# define ZEXPORT WINAPI
|
||||
# ifdef WIN32
|
||||
# define ZEXPORTVA WINAPIV
|
||||
# else
|
||||
# define ZEXPORTVA FAR CDECL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (__BEOS__)
|
||||
# ifdef ZLIB_DLL
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXPORT __declspec(dllexport)
|
||||
# define ZEXPORTVA __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXPORT __declspec(dllimport)
|
||||
# define ZEXPORTVA __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
#ifndef ZEXPORT
|
||||
# define ZEXPORT
|
||||
#endif
|
||||
#ifndef ZEXPORTVA
|
||||
# define ZEXPORTVA
|
||||
#endif
|
||||
|
||||
#ifndef FAR
|
||||
# define FAR
|
||||
#endif
|
||||
|
||||
#if !defined(__MACTYPES__)
|
||||
typedef unsigned char Byte; /* 8 bits */
|
||||
#endif
|
||||
typedef unsigned int uInt; /* 16 bits or more */
|
||||
typedef unsigned long uLong; /* 32 bits or more */
|
||||
|
||||
#ifdef SMALL_MEDIUM
|
||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||
# define Bytef Byte FAR
|
||||
#else
|
||||
typedef Byte FAR Bytef;
|
||||
#endif
|
||||
typedef char FAR charf;
|
||||
typedef int FAR intf;
|
||||
typedef uInt FAR uIntf;
|
||||
typedef uLong FAR uLongf;
|
||||
|
||||
#ifdef STDC
|
||||
typedef void const *voidpc;
|
||||
typedef void FAR *voidpf;
|
||||
typedef void *voidp;
|
||||
#else
|
||||
typedef Byte const *voidpc;
|
||||
typedef Byte FAR *voidpf;
|
||||
typedef Byte *voidp;
|
||||
#endif
|
||||
|
||||
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* for SEEK_* and off_t */
|
||||
# ifdef VMS
|
||||
# include <unixio.h> /* for off_t */
|
||||
# endif
|
||||
# define z_off_t off_t
|
||||
#endif
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
# define SEEK_CUR 1 /* Seek from current position. */
|
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||
#endif
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__)
|
||||
# define NO_vsnprintf
|
||||
#endif
|
||||
|
||||
#if defined(__MVS__)
|
||||
# define NO_vsnprintf
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
# pragma map(deflateInit_,"DEIN")
|
||||
# pragma map(deflateInit2_,"DEIN2")
|
||||
# pragma map(deflateEnd,"DEEND")
|
||||
# pragma map(deflateBound,"DEBND")
|
||||
# pragma map(inflateInit_,"ININ")
|
||||
# pragma map(inflateInit2_,"ININ2")
|
||||
# pragma map(inflateEnd,"INEND")
|
||||
# pragma map(inflateSync,"INSY")
|
||||
# pragma map(inflateSetDictionary,"INSEDI")
|
||||
# pragma map(compressBound,"CMBND")
|
||||
# pragma map(inflate_table,"INTABL")
|
||||
# pragma map(inflate_fast,"INFA")
|
||||
# pragma map(inflate_copyright,"INCOPY")
|
||||
#endif
|
||||
|
||||
#endif /* ZCONF_H */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue