/***************************************************************************
                          cfg.c  -  description
                             -------------------
    begin                : Sun Oct 28 2001
    copyright            : (C) 2001 by Pete Bernert
    email                : BlackDove@addcom.de
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   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. See also the license.txt file for *
 *   additional informations.                                              *
 *                                                                         *
 ***************************************************************************/

#define _IN_CFG

#include <sys/stat.h>
#include <stdlib.h>

#undef FALSE
#undef TRUE
//#define MAKELONG(low,high)     ((unsigned long)(((unsigned short)(low)) | (((unsigned long)((unsigned short)(high))) << 16)))

#include "externals.h"
#include "cfg.h"
#include "gpu.h"

// CONFIG FILE helpers....
// some helper macros:

#define FF7_FIX 0x00001				// Adjust framebuffer access ONLY for FF7 battle cursor/battle swirl
#define DFB_UPDATES 0x00002			// Direct framebuffer updates
#define DISABLE_COORD_CHECK 0x00010	// Disable coord check
#define BLUE_GLITCHES 0x00020		// Remove blue glitches
#define MIXED_FB 0x00040			// Mixed software FB access
#define PC_FPS 0x00080				// Use PC fps calculation
#define OLD_FRAMESKIP 0x00100		// Use old frame skipping
#define COMPAT 0x01000				// Odd/even bit hack
#define SHOW_FULL_SCREEN 0x02000	// Expand screen width
#define FAKE 0x20000				// Fake 'gpu busy' states

#define CC_FIX FF7_FIX|DFB_UPDATES

void ReadConfigFile()
{
	
}

void ExecCfg(char *arg) {
	
}

void SoftDlgProc(void)
{
	ExecCfg("CFG");
}

void AboutDlgProc(void)
{
	char args[256];

	sprintf(args, "ABOUT");
	ExecCfg(args);
}

void ReadConfig(void)
{
	// defaults
	iResX=640;
	iResY=480;
	iWinSize=MAKELONG(iResX,iResY);
	iColDepth=32;
	iWindowMode=1;
	iMaintainAspect=0;
	UseFrameLimit=1;
	UseFrameSkip=1;
	iFrameLimit=2;
	fFrameRate=200.0f;
	dwCfgFixes=CC_FIX;//ff7
	iUseFixes=1;
	iUseNoStretchBlt=1;
	iUseDither=0;
	iShowFPS=0;

	// read sets
	ReadConfigFile();

	// additional checks
	if(!iColDepth)       
		iColDepth=32;

	if(iUseFixes)        
		dwActFixes=dwCfgFixes;

	SetFixes();
}

void WriteConfig(void) {

	
}
