Trying to untangle the horrible web of file dependencies

This commit is contained in:
rheiny 2007-02-11 12:04:24 +00:00
parent 49b05ff178
commit 7b75fb1448
9 changed files with 151 additions and 92 deletions

View File

@ -50,26 +50,11 @@
#include "tracer.h"
#include "cdlogger.h"
#include "main.h"
#include "basicbot.h"
#include "args.h"
#include "config.h"
// #defines
#define VNSCLIP ((eoptions&EO_CLIPSIDES)?8:0)
#define VNSWID ((eoptions&EO_CLIPSIDES)?240:256)
#define SO_FORCE8BIT 1
#define SO_SECONDARY 2
#define SO_GFOCUS 4
#define SO_D16VOL 8
#define SO_MUTEFA 16
#define SO_OLDUP 32
#define GOO_DISABLESS 1 /* Disable screen saver when game is loaded. */
#define GOO_CONFIRMEXIT 2 /* Confirmation before exiting. */
#define GOO_POWERRESET 4 /* Confirm on power/reset. */
//---------------------------
//mbg merge 6/29/06 - new aboutbox
@ -106,6 +91,8 @@ void ApplyDefaultCommandMapping(void);
uint8 *xbsave = NULL;
int eoptions = EO_BGRUN | EO_FORCEISCALE;
int soundoptions = SO_SECONDARY | SO_GFOCUS;
/**
* Handle of the main window.
**/
@ -118,20 +105,6 @@ HINSTANCE fceu_hInstance;
HRESULT ddrval;
/**
* Contains the names of the overridden standard directories
* in the order cheats, misc, nonvol, states, snaps, ..., base
**/
static char *directory_names[6] = {0, 0, 0, 0, 0, 0};
/**
* Contains the names of the default directories.
**/
static const char *default_directory_names[5] = {"cheats", "sav", "fcs", "snaps", "movie"};
#define NUMBER_OF_DIRECTORIES sizeof(directory_names) / sizeof(*directory_names)
#define NUMBER_OF_DEFAULT_DIRECTORIES sizeof(default_directory_names) / sizeof(*default_directory_names)
static char TempArray[2048];
/**
@ -142,49 +115,18 @@ static char BaseDirectory[2048];
static int exiting = 0;
static volatile int moocow = 0;
/* Some timing-related variables (now ignored). */
static int maxconbskip = 32; /* Maximum consecutive blit skips. */
static int ffbskip = 32; /* Blit skips per blit when FF-ing */
static int moviereadonly = 1;
static int fullscreen = 0;
static int soundflush = 0;
// Flag that indicates whether Game Genie is enabled or not.
static int genie = 0;
// Flag that indicates whether PAL Emulation is enabled or not.
static int pal_emulation = 0;
static int status_icon = 1;
static int windowedfailed;
static double saspectw = 1, saspecth = 1;
static double winsizemulx = 1, winsizemuly = 1;
static int winwidth, winheight;
static int ismaximized = 0;
static volatile int nofocus = 0;
static volatile int _userpause = 0; //mbg merge 7/18/06 changed tasbuild was using this only in a couple of places
static uint32 goptions = GOO_DISABLESS;
static int soundrate = 44100;
static int soundbuftime = 50;
/*static*/ int soundoptions = SO_SECONDARY | SO_GFOCUS;
static int soundvolume = 100;
static int soundquality = 0;
extern int autoHoldKey, autoHoldClearKey;
extern int frame_display, input_display;
//mbg merge 7/17/06 did these have to be unsigned?
static int srendline, erendline;
static int srendlinen = 8;
static int erendlinen = 231;
static int srendlinep = 0;
static int erendlinep = 239;
static int totallines;
static uint8 cpalette[192];
static int vmod = 0;
int soundo = 1;
static int ntsccol = 0, ntsctint, ntschue;
@ -291,7 +233,6 @@ void CreateDirs(void)
DefaultDirectoryWalker(DirectoryCreator);
}
static char *gfsdir=0;
/**
* Fills the BaseDirectory string
@ -440,7 +381,7 @@ void DoPriority(void)
// TODO: HORRIBLE
#include "sound.cpp"
//#include "sound.cpp"
#include "video.cpp"
#include "window.cpp"

View File

@ -1,29 +1,74 @@
#ifndef WIN_MAIN_H
#define WIN_MAIN_H
#include "../../types.h"
static int genie;
static int pal_emulation;
static int status_icon;
static int fullscreen;
static int vmod;
static char *gfsdir;
static char *directory_names[6];
static double winsizemulx, winsizemuly;
static double saspectw, saspecth;
static int soundrate;
static int soundbuftime;
static int soundvolume;
static int soundquality;
static uint32 goptions;
// #defines
#define VNSCLIP ((eoptions&EO_CLIPSIDES)?8:0)
#define VNSWID ((eoptions&EO_CLIPSIDES)?240:256)
#define SO_FORCE8BIT 1
#define SO_SECONDARY 2
#define SO_GFOCUS 4
#define SO_D16VOL 8
#define SO_MUTEFA 16
#define SO_OLDUP 32
#define GOO_DISABLESS 1 /* Disable screen saver when game is loaded. */
#define GOO_CONFIRMEXIT 2 /* Confirmation before exiting. */
#define GOO_POWERRESET 4 /* Confirm on power/reset. */
/* Some timing-related variables (now ignored). */
static int maxconbskip = 32; /* Maximum consecutive blit skips. */
static int ffbskip = 32; /* Blit skips per blit when FF-ing */
static int moviereadonly = 1;
static int fullscreen = 0;
static int soundflush = 0;
// Flag that indicates whether Game Genie is enabled or not.
static int genie = 0;
// Flag that indicates whether PAL Emulation is enabled or not.
static int pal_emulation = 0;
static int status_icon = 1;
static int vmod = 0;
static char *gfsdir=0;
/**
* Contains the names of the overridden standard directories
* in the order cheats, misc, nonvol, states, snaps, ..., base
**/
static char *directory_names[6] = {0, 0, 0, 0, 0, 0};
/**
* Contains the names of the default directories.
**/
static const char *default_directory_names[5] = {"cheats", "sav", "fcs", "snaps", "movie"};
#define NUMBER_OF_DIRECTORIES sizeof(directory_names) / sizeof(*directory_names)
#define NUMBER_OF_DEFAULT_DIRECTORIES sizeof(default_directory_names) / sizeof(*default_directory_names)
static double saspectw = 1, saspecth = 1;
static double winsizemulx = 1, winsizemuly = 1;
static int winwidth, winheight;
static int ismaximized = 0;
static uint32 goptions = GOO_DISABLESS;
static int soundrate = 44100;
static int soundbuftime = 50;
static int soundvolume = 100;
static int soundquality = 0;
static uint8 cpalette[192];
static int srendlinen;
static int erendlinen;
static int srendlinep;
static int erendlinep;
static int ismaximized;
static int maxconbskip;
static int ffbskip;
static int moviereadonly;
static int srendlinen = 8;
static int erendlinen = 231;
static int srendlinep = 0;
static int erendlinep = 239;
extern int soundo;
extern int eoptions;
extern int soundoptions;
#endif

View File

@ -19,6 +19,8 @@
*/
#include <list>
#include "common.h"
#include "main.h"
/// controls whether playback is muted
static bool mute = false;
@ -502,7 +504,7 @@ BOOL CALLBACK SoundConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
/**
* Shows the sounds configuration dialog.
**/
void ConfigSound(void)
void ConfigSound()
{
if(!uug)
{
@ -551,7 +553,7 @@ static int32 fps_scale_table[]=
{ 3, 3, 4, 8, 16, 32, 64, 128, 192, 256, 384, 512, 768, 1024, 2048, 4096, 8192, 16384, 16384};
int32 fps_scale = 256;
static void RefreshThrottleFPS(void)
void RefreshThrottleFPS()
{
printf("WTF\n");
fflush(stdout);
@ -597,4 +599,4 @@ void FCEUD_SetEmulationSpeed(int cmd)
}
#include "wave.cpp"
//#include "wave.cpp"

9
src/drivers/win/sound.h Normal file
View File

@ -0,0 +1,9 @@
extern int32 fps_scale;
void RefreshThrottleFPS();
void ConfigSound();
int InitSound();
void TrashSound();
void win_SoundSetScale(int scale);
void win_SoundWriteData(int32 *buffer, int count);
void win_Throttle();

View File

@ -18,7 +18,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
int CloseWave(void)
#include "common.h"
#include "../../wave.h"
int CloseWave()
{
return(FCEUI_EndWaveRecord());
@ -29,7 +33,7 @@ int CloseWave(void)
*
* @return Flag that indicates failure (0) or success (1).
**/
int CreateSoundSave(void)
int CreateSoundSave()
{
const char filter[]="MS WAVE(*.wav)\0*.wav\0";
char nameo[2048];

View File

@ -20,6 +20,9 @@
#include "state.cpp" /* Save/Load state AS */
#include "sound.h"
#include "wave.h"
// #defines
#define MAX(x,y) ((x)<(y)?(y):(x))
@ -382,7 +385,7 @@ void UpdateRecentArray(const char* addString, char** bufferArray, unsigned int a
}
// Move the other items down.
for(x = arrayLen - 1; x; x--)
for(unsigned int x = arrayLen - 1; x; x--)
{
bufferArray[x] = bufferArray[x - 1];
}

View File

@ -53,7 +53,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count)
#endif
}
int FCEUI_EndWaveRecord(void)
int FCEUI_EndWaveRecord()
{
long s;

View File

@ -1 +1,4 @@
#include "types.h"
void FCEU_WriteWaveData(int32 *Buffer, int Count);
int FCEUI_EndWaveRecord();

View File

@ -1010,6 +1010,32 @@
RelativePath="..\src\drivers\win\resource.h"
>
</File>
<File
RelativePath="..\src\drivers\win\sound.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\drivers\win\sound.h"
>
</File>
<File
RelativePath="..\src\drivers\win\tracer.cpp"
>
@ -1022,6 +1048,32 @@
RelativePath="..\src\drivers\win\video.h"
>
</File>
<File
RelativePath="..\src\drivers\win\wave.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\drivers\win\wave.h"
>
</File>
<File
RelativePath="..\src\drivers\win\window.h"
>