From df666957da5f2cbdb762b77cc12ec6dd57c1f5b6 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 27 May 2009 06:46:58 +0000 Subject: [PATCH] assorted housekeeping: gocha's spu streaming patch for all platforms, driver system, copyrights, credits, wav writer in, sndfile spu core out (wav writer is better, it will need to be added to ports) --- desmume/AUTHORS | 18 +- desmume/src/NDSSystem.cpp | 15 +- desmume/src/NDSSystem.h | 24 +- desmume/src/SPU.cpp | 169 ++++++------ desmume/src/SPU.h | 27 +- desmume/src/cflash.cpp | 2 +- desmume/src/cli/main.cpp | 6 +- desmume/src/gfx3d.cpp | 6 +- desmume/src/gtk-glade/desmume.cpp | 3 +- desmume/src/gtk-glade/main.cpp | 2 +- desmume/src/gtk/desmume.cpp | 4 +- desmume/src/gtk/main.cpp | 2 +- desmume/src/mc.cpp | 1 + desmume/src/readwrite.cpp | 40 +-- desmume/src/utils/guid.cpp | 38 +-- desmume/src/windows/AboutBox.cpp | 79 +++--- desmume/src/windows/DeSmuME_2005.vcproj | 18 +- desmume/src/windows/DeSmuME_2008.vcproj | 12 +- desmume/src/windows/aviout.cpp | 58 ++-- desmume/src/windows/aviout.h | 30 ++- desmume/src/windows/hotkey.cpp | 6 +- desmume/src/windows/main.cpp | 94 +++---- desmume/src/windows/ogl.cpp | 38 +-- desmume/src/windows/resources.rc | 9 +- desmume/src/windows/snddx.cpp | 335 ++++++++++++------------ desmume/src/windows/wavout.cpp | 202 -------------- desmume/src/windows/wavout.h | 4 - desmume/src/windows/windriver.h | 21 ++ 28 files changed, 549 insertions(+), 714 deletions(-) delete mode 100644 desmume/src/windows/wavout.cpp delete mode 100644 desmume/src/windows/wavout.h diff --git a/desmume/AUTHORS b/desmume/AUTHORS index 5e85bd77a..576e8392b 100644 --- a/desmume/AUTHORS +++ b/desmume/AUTHORS @@ -7,11 +7,6 @@ Current team Guillaume Duhamel Normmatt Bernat Muņoz (shash) -thoduv -Tim Seidel (Mighty Max) -Pascal Giard (evilynux) -Ben Jaques (masscat) -Jeff Bland Riccardo Magliocchetti Max Tabachenko (CrazyMax) zeromus @@ -19,6 +14,7 @@ Luigi__ adelikat matusz pa__ +gocha Contributors ------------ @@ -31,3 +27,15 @@ delfare Romain Vallet snkmad Theo Berkau +thoduv +Tim Seidel (Mighty Max) +Pascal Giard (evilynux) +Ben Jaques (masscat) +Jeff Bland + +Thanks to our super testers for this release +------------ +nash679 +pokefan999 +dottorleo +lbalbalba \ No newline at end of file diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index b1d20f30d..6554e694f 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -1596,16 +1596,15 @@ void NDS_SkipNextFrame() { SkipNext2DFrame = true; SkipCur3DFrame = true; } template -u32 NDS_exec(s32 nb) +void NDS_exec(s32 nb) { int i, j; - nb = 560190<<1; - LagFrameFlag=1; //increase this to execute more instructions in each batch (reducing overhead) //the value of 4 seems to optimize speed.. do lower values increase precision? + //answer: YES, MAYBE. and after 0.9.3 we need to study it (spider-man) const int INSTRUCTIONS_PER_BATCH = 4; //decreasing this should increase precision at the cost of speed @@ -1733,7 +1732,9 @@ u32 NDS_exec(s32 nb) T1WriteWord(MMU.ARM7_REG, 4, T1ReadWord(MMU.ARM7_REG, 4) | 2); NDS_ARM9HBlankInt(); NDS_ARM7HBlankInt(); - + SPU_Emulate_core(); + driver->AVI_SoundUpdate(SPU_core->outbuf,spu_core_samples); + WAV_WavSoundUpdate(SPU_core->outbuf,spu_core_samples); if(nds.VCount<192) { if(!SkipCur2DFrame) @@ -2421,8 +2422,6 @@ u32 NDS_exec(s32 nb) lastLag = lagframecounter; lagframecounter = 0; } - - return nds.cycles; } static std::string MakeInputDisplayString(u16 pad, const std::string* Buttons, int count) { @@ -2640,5 +2639,5 @@ void emu_halt() { } //these templates needed to be instantiated manually -template u32 NDS_exec(s32 nb); -template u32 NDS_exec(s32 nb); +template void NDS_exec(s32 nb); +template void NDS_exec(s32 nb); diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index c85a18ef7..c087c47f4 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -2,6 +2,8 @@ yopyop156@ifrance.com yopyop156.ifrance.com + Copyright (C) 2008-2009 DeSmuME team + This file is part of DeSmuME DeSmuME is free software; you can redistribute it and/or modify @@ -16,7 +18,7 @@ You should have received a copy of the GNU General Public License along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef NDSSYSTEM_H @@ -25,10 +27,9 @@ #include #include "armcpu.h" #include "MMU.h" - +#include "driver.h" #include "GPU.h" #include "SPU.h" - #include "mem.h" #include "wifi.h" @@ -290,13 +291,10 @@ void NDS_Sleep(); void NDS_SkipNextFrame(); #define NDS_SkipFrame(s) if(s) NDS_SkipNext2DFrame(); -template -u32 NDS_exec(s32 nb); +template void NDS_exec(s32 nb = 560190<<1); extern int lagframecounter; -inline u32 NDS_exec(s32 nb) { return NDS_exec(nb); } - static INLINE void NDS_ARM9HBlankInt(void) { if(T1ReadWord(ARM9Mem.ARM9_REG, 4) & 0x10) @@ -388,17 +386,7 @@ extern struct TCommonSettings { extern char ROMserial[20]; -//this should be moved to a driver.h later, but for now, here they are. -//each platform needs to implement this, although it doesnt need to implement any functions -class Driver { -public: - virtual BOOL WIFI_Host_InitSystem() { return FALSE; } - virtual void WIFI_Host_ShutdownSystem() {} - virtual BOOL AVI_IsRecording() { return FALSE; } - virtual BOOL WAV_IsRecording() { return FALSE; } - virtual void USR_InfoMessage(const char *message) { printf("%s\n", message); } -}; -extern Driver* driver; + extern std::string InputDisplayString; extern int LagFrameFlag; diff --git a/desmume/src/SPU.cpp b/desmume/src/SPU.cpp index 883b53333..fb69d36da 100644 --- a/desmume/src/SPU.cpp +++ b/desmume/src/SPU.cpp @@ -1,22 +1,26 @@ -/* Copyright (C) 2006 Theo Berkau +/* Copyright (C) 2006 yopyop + yopyop156@ifrance.com + yopyop156.ifrance.com + Copyright (C) 2006 Theo Berkau + Copyright (C) 2008-2009 DeSmuME team -Ideas borrowed from Stephane Dallongeville's SCSP core + Ideas borrowed from Stephane Dallongeville's SCSP core -This file is part of DeSmuME + This file is part of DeSmuME -DeSmuME 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. + DeSmuME 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. -DeSmuME 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. + DeSmuME 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 DeSmuME; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU General Public License + along with DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -24,6 +28,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define _USE_MATH_DEFINES #include +#ifndef M_PI +#define M_PI 3.1415926535897932386 +#endif #include "debug.h" #include "ARM9.h" @@ -93,7 +100,7 @@ static const s16 wavedutytbl[8][8] = { static s32 precalcdifftbl[89][16]; static u8 precalcindextbl[89][8]; -static FILE *spufp=NULL; +static const double ARM7_CLOCK = 33513982; ////////////////////////////////////////////////////////////////////////////// @@ -454,8 +461,7 @@ void SPU_struct::ShutUp() static FORCEINLINE void adjust_channel_timer(channel_struct *chan) { - //chan->sampinc = (((double)33512000) / (44100 * 2)) / (double)(0x10000 - chan->timer); - chan->sampinc = (16777216 / (0x10000 - (double)chan->timer)) / 44100; + chan->sampinc = (((double)ARM7_CLOCK) / (44100 * 2)) / (double)(0x10000 - chan->timer); } void SPU_struct::KeyOn(int channel) @@ -669,7 +675,7 @@ template static FORCEINLINE s32 Interpola { //why did we change it away from the lookup table? somebody should research that ratio = ratio - (int)ratio; - double ratio2 = ((1.0 - cos(ratio * 3.14)) * 0.5); + double ratio2 = ((1.0 - cos(ratio * M_PI)) * 0.5); //double ratio2 = (1.0f - cos_lut[((int)(ratio*256.0))&0xFF]) / 2.0f; return (((1-ratio2)*a) + (ratio2*b)); } @@ -823,7 +829,9 @@ template static FORCEINLINE void TestForLoop(SPU_struct *SPU, channe // Do we loop? Or are we done? if (chan->repeat == 1) { - chan->sampcnt = (double)(chan->loopstart << shift); // Is this correct? + while (chan->sampcnt > chan->double_totlength_shifted) + chan->sampcnt -= chan->double_totlength_shifted - (double)(chan->loopstart << shift); + //chan->sampcnt = (double)(chan->loopstart << shift); } else { @@ -845,7 +853,9 @@ static FORCEINLINE void TestForLoop2(SPU_struct *SPU, channel_struct *chan) // Do we loop? Or are we done? if (chan->repeat == 1) { - chan->sampcnt = (double)(chan->loopstart << 3); // Is this correct? + while (chan->sampcnt > chan->double_totlength_shifted) + chan->sampcnt -= chan->double_totlength_shifted - (double)(chan->loopstart << 3); + //chan->sampcnt = (double)(chan->loopstart << 3); chan->pcm16b = (s16)((chan->buf8[1] << 8) | chan->buf8[0]); chan->index = chan->buf8[2] & 0x7F; chan->lastsampcnt = 7; @@ -999,9 +1009,9 @@ static void SPU_MixAudio(SPU_struct *SPU, int length) //emulates one frame of the cpu core. //this will produce a variable number of samples, calculated to keep a 44100hz output //in sync with the emulator framerate -static float samples = 0; -static const float time_per_frame = 1.0f/59.8261f; -static const float samples_per_frame = time_per_frame * 44100; +static double samples = 0; +static const double time_per_frame = (double)1.0/((double)ARM7_CLOCK/6/355); //(double)1.0/(double)59.8261; // ((double)ARM7_CLOCK/6/355/263) +static const double samples_per_frame = time_per_frame * 44100; int spu_core_samples = 0; void SPU_Emulate_core() { @@ -1103,30 +1113,6 @@ void SNDDummySetVolume(int volume) { } -////////////////////////////////////////////////////////////////////////////// -// WAV Write Interface -////////////////////////////////////////////////////////////////////////////// - -int SNDFileInit(int buffersize); -void SNDFileDeInit(); -void SNDFileUpdateAudio(s16 *buffer, u32 num_samples); -u32 SNDFileGetAudioSpace(); -void SNDFileMuteAudio(); -void SNDFileUnMuteAudio(); -void SNDFileSetVolume(int volume); - -SoundInterface_struct SNDFile = { - SNDCORE_FILEWRITE, - "WAV Write Sound Interface", - SNDFileInit, - SNDFileDeInit, - SNDFileUpdateAudio, - SNDFileGetAudioSpace, - SNDFileMuteAudio, - SNDFileUnMuteAudio, - SNDFileSetVolume -}; - ////////////////////////////////////////////////////////////////////////////// typedef struct { @@ -1149,17 +1135,19 @@ typedef struct { u16 bitspersample; } fmt_struct; -////////////////////////////////////////////////////////////////////////////// - -int SNDFileInit(int buffersize) +WavWriter::WavWriter() +: spufp(NULL) +{ +} +bool WavWriter::open(const std::string & fname) { waveheader_struct waveheader; fmt_struct fmt; chunk_struct data; size_t elems_written = 0; - if ((spufp = fopen("ndsaudio.wav", "wb")) == NULL) - return -1; + if ((spufp = fopen(fname.c_str(), "wb")) == NULL) + return false; // Do wave header memcpy(waveheader.riff.id, "RIFF", 4); @@ -1183,66 +1171,71 @@ int SNDFileInit(int buffersize) data.size = 0; // we'll fix this at the end elems_written += fwrite((void *)&data, 1, sizeof(chunk_struct), spufp); - return 0; + return true; } -////////////////////////////////////////////////////////////////////////////// - -void SNDFileDeInit() +void WavWriter::close() { + if(!spufp) return; size_t elems_written = 0; - if (spufp) - { - long length = ftell(spufp); + long length = ftell(spufp); - // Let's fix the riff chunk size and the data chunk size - fseek(spufp, sizeof(waveheader_struct)-0x8, SEEK_SET); - length -= 0x8; - elems_written += fwrite((void *)&length, 1, 4, spufp); + // Let's fix the riff chunk size and the data chunk size + fseek(spufp, sizeof(waveheader_struct)-0x8, SEEK_SET); + length -= 0x8; + elems_written += fwrite((void *)&length, 1, 4, spufp); - fseek(spufp, sizeof(waveheader_struct)+sizeof(fmt_struct)+0x4, SEEK_SET); - length -= sizeof(waveheader_struct)+sizeof(fmt_struct); - elems_written += fwrite((void *)&length, 1, 4, spufp); - fclose(spufp); - } + fseek(spufp, sizeof(waveheader_struct)+sizeof(fmt_struct)+0x4, SEEK_SET); + length -= sizeof(waveheader_struct)+sizeof(fmt_struct); + elems_written += fwrite((void *)&length, 1, 4, spufp); + fclose(spufp); + spufp = NULL; } -////////////////////////////////////////////////////////////////////////////// - -void SNDFileUpdateAudio(s16 *buffer, u32 num_samples) +void WavWriter::update(void* soundData, int numSamples) { - size_t elems_written; - if (spufp) { - elems_written = fwrite((void *)buffer, num_samples*2, 2, spufp); - //INFO("%i written\n", elems_written); - } + if(!spufp) return; + //TODO - big endian for the s16 samples?? + size_t elems_written = fwrite(soundData, numSamples*2, 2, spufp); } -////////////////////////////////////////////////////////////////////////////// - -u32 SNDFileGetAudioSpace() +bool WavWriter::isRecording() const { - return 740; + return spufp != NULL; } -////////////////////////////////////////////////////////////////////////////// -void SNDFileMuteAudio() +static WavWriter wavWriter; + +void WAV_End() { + wavWriter.close(); } -////////////////////////////////////////////////////////////////////////////// - -void SNDFileUnMuteAudio() +bool WAV_Begin(const char* fname) { + WAV_End(); + + if(!wavWriter.open(fname)) + return false; + + driver->USR_InfoMessage("WAV recording started."); + + return true; } -////////////////////////////////////////////////////////////////////////////// - -void SNDFileSetVolume(int volume) +bool WAV_IsRecording() { + return wavWriter.isRecording(); } +void WAV_WavSoundUpdate(void* soundData, int numSamples) +{ + wavWriter.update(soundData, numSamples); +} + + + ////////////////////////////////////////////////////////////////////////////// void spu_savestate(std::ostream* os) diff --git a/desmume/src/SPU.h b/desmume/src/SPU.h index ef8d7cb3d..f7d4b2b32 100644 --- a/desmume/src/SPU.h +++ b/desmume/src/SPU.h @@ -1,4 +1,7 @@ -/* Copyright (C) 2006 Theo Berkau +/* SPU.h + + Copyright 2006 Theo Berkau + Copyright (C) 2006-2009 DeSmuME team This file is part of DeSmuME @@ -14,7 +17,7 @@ You should have received a copy of the GNU General Public License along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SPU_H @@ -22,10 +25,10 @@ #include "types.h" #include +#include #define SNDCORE_DEFAULT -1 #define SNDCORE_DUMMY 0 -#define SNDCORE_FILEWRITE 1 enum SPUInterpolationMode { @@ -132,4 +135,22 @@ extern int spu_core_samples; void spu_savestate(std::ostream* os); bool spu_loadstate(std::istream* is, int size); +class WavWriter +{ +public: + WavWriter(); + bool open(const std::string & fname); + void close(); + void update(void* soundData, int numSamples); + bool isRecording() const; +private: + FILE *spufp; +}; + + +void WAV_End(); +bool WAV_Begin(const char* fname); +bool WAV_IsRecording(); +void WAV_WavSoundUpdate(void* soundData, int numSamples); + #endif diff --git a/desmume/src/cflash.cpp b/desmume/src/cflash.cpp index 0ea8c5d7d..a5bb8697f 100644 --- a/desmume/src/cflash.cpp +++ b/desmume/src/cflash.cpp @@ -877,4 +877,4 @@ cflash_close( void) { } } -#endif \ No newline at end of file +#endif diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp index d24381e31..b92429208 100644 --- a/desmume/src/cli/main.cpp +++ b/desmume/src/cli/main.cpp @@ -81,7 +81,7 @@ static int sdl_videoFlags = 0; SoundInterface_struct *SNDCoreList[] = { &SNDDummy, - &SNDFile, + &SNDDummy, &SNDSDL, NULL }; @@ -618,7 +618,6 @@ Draw( void) { int main(int argc, char ** argv) { static unsigned short keypad = 0; struct my_config my_config; - u32 last_cycle = 0; #ifdef GDB_STUB gdbstub_handle_t arm9_gdb_stub; gdbstub_handle_t arm7_gdb_stub; @@ -852,9 +851,8 @@ int main(int argc, char ** argv) { } update_keypad(keypad); /* Update keypad */ - last_cycle = NDS_exec((560190 << 1) - last_cycle); + NDS_exec(); SPU_Emulate_user(); - SPU_Emulate_core(); #ifdef INCLUDE_OPENGL_2D if ( my_config.opengl_2d) { diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index 90f060140..bc81d45cc 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -1,8 +1,8 @@ /* Copyright (C) 2006 yopyop yopyop156@ifrance.com - yopyop156.ifrance.com + yopyop156.ifrance.com - Copyright (C) 2008-2009 DeSmuME team + Copyright (C) 2008-2009 DeSmuME team This file is part of DeSmuME @@ -23,7 +23,7 @@ //This file implements the geometry engine hardware component. //This handles almost all of the work of 3d rendering, leaving the renderer -// plugin responsible only for drawing primitives. +//plugin responsible only for drawing primitives. #include #include diff --git a/desmume/src/gtk-glade/desmume.cpp b/desmume/src/gtk-glade/desmume.cpp index 545fd8263..355561187 100755 --- a/desmume/src/gtk-glade/desmume.cpp +++ b/desmume/src/gtk-glade/desmume.cpp @@ -116,9 +116,8 @@ INLINE void desmume_cycle() /* Update keypad value */ update_keypad(keypad); - desmume_last_cycle = NDS_exec((560190 << 1) - desmume_last_cycle); + NDS_exec(); SPU_Emulate_user(); - SPU_Emulate_core(); } diff --git a/desmume/src/gtk-glade/main.cpp b/desmume/src/gtk-glade/main.cpp index 485529e8a..732b9feee 100755 --- a/desmume/src/gtk-glade/main.cpp +++ b/desmume/src/gtk-glade/main.cpp @@ -64,7 +64,7 @@ const u16 gtk_kb_cfg[NB_KEYS] = SoundInterface_struct *SNDCoreList[] = { &SNDDummy, -&SNDFile, +&SNDDummy, &SNDSDL, NULL }; diff --git a/desmume/src/gtk/desmume.cpp b/desmume/src/gtk/desmume.cpp index 5a527b3b3..2802de056 100644 --- a/desmume/src/gtk/desmume.cpp +++ b/desmume/src/gtk/desmume.cpp @@ -74,7 +74,6 @@ BOOL desmume_running( void) void desmume_cycle( void) { - static u32 desmume_last_cycle; u16 keypad; /* Joystick events */ @@ -85,8 +84,7 @@ void desmume_cycle( void) /* Update keypad value */ update_keypad(keypad); - desmume_last_cycle = NDS_exec((560190 << 1) - desmume_last_cycle); + NDS_exec(); SPU_Emulate_user(); - SPU_Emulate_core(); } diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index a92e32e5f..d620f5999 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -302,7 +302,7 @@ static const GtkRadioActionEntry savet_entries[] = { SoundInterface_struct *SNDCoreList[] = { &SNDDummy, -&SNDFile, +&SNDDummy, &SNDSDL, NULL }; diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index 9ce8df003..0477db04a 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2006 thoduv Copyright (C) 2006-2007 Theo Berkau + Copyright (C) 2008-2009 DeSmuME team This file is part of DeSmuME diff --git a/desmume/src/readwrite.cpp b/desmume/src/readwrite.cpp index 5099648ba..78dfcab43 100644 --- a/desmume/src/readwrite.cpp +++ b/desmume/src/readwrite.cpp @@ -1,22 +1,22 @@ -/* readwrite.cpp - * - * Copyright (C) 2006-2008 Zeromus - * - * This file is part of DeSmuME - * - * DeSmuME 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. - * - * DeSmuME 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 DeSmuME; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +/* readwrite.cpp + + Copyright (C) 2006-2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "readwrite.h" @@ -170,4 +170,4 @@ int writebuffer(std::vector& vec, std::ostream* os) write32le(size,os); if(size>0) os->write((char*)&vec[0],size); return 1; -} \ No newline at end of file +} diff --git a/desmume/src/utils/guid.cpp b/desmume/src/utils/guid.cpp index 900519643..6d4206c63 100644 --- a/desmume/src/utils/guid.cpp +++ b/desmume/src/utils/guid.cpp @@ -1,22 +1,22 @@ -/* guid.cpp - * - * Copyright (C) 2008 Zeromus - * - * This file is part of DeSmuME - * - * DeSmuME 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. - * - * DeSmuME 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 DeSmuME; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +/* guid.cpp + + Copyright (C) 2008-2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/desmume/src/windows/AboutBox.cpp b/desmume/src/windows/AboutBox.cpp index be0641cfc..3d2e23f83 100644 --- a/desmume/src/windows/AboutBox.cpp +++ b/desmume/src/windows/AboutBox.cpp @@ -1,5 +1,6 @@ -/* - Copyright (C) 2008 shash +/* AboutBox.cpp + + Copyright (C) 2008-2009 shash This file is part of DeSmuME @@ -15,7 +16,7 @@ You should have received a copy of the GNU General Public License along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -26,36 +27,52 @@ #define ABOUT_TIMER_ID 110222 #define PER_PAGE_TEAM 23 -#define TEAM 27 #define SIZE_SCROLL_BUFFER PER_PAGE_TEAM + TEAM -const char *team[TEAM] = { "Guillaume Duhamel", - "Normmatt", - "Bernat Muņoz (shash)", - "thoduv", - "Tim Seidel (Mighty Max)", - "Pascal Giard (evilynux)", - "Ben Jaques (masscat)", - "Jeff Bland", - "Riccardo Magliocchetti", - "Max Tabachenko (CrazyMax)", - "zeromus", - "Luigi__", - "adelikat", - "matusz", - "pa__", - "", - "Contributors", - "------------", - "Allustar", - "amponzi", - "Anthony Molinaro", - "ape", - "Damien Nozay (damdoum)", - "delfare", - "Romain Vallet", - "snkmad", - "Theo Berkau"}; +const char *team[] = { + "Current Team", + "------------", + "Guillaume Duhamel", + "Normmatt", + "Bernat Muņoz (shash)", + "Riccardo Magliocchetti", + "Max Tabachenko (CrazyMax)", + "zeromus", + "Luigi__", + "adelikat", + "matusz", + "pa__", + "gocha", + "", + "Contributors", + "------------", + "Allustar", + "amponzi", + "Anthony Molinaro", + "ape", + "Damien Nozay (damdoum)", + "delfare", + "Romain Vallet", + "snkmad", + "Theo Berkau", + "thoduv", + "Tim Seidel (Mighty Max)", + "Pascal Giard (evilynux)", + "Ben Jaques (masscat)", + "Jeff Bland", + "", + "Honorary Nagmasters", + "(Thanks to our super testers for this release!)", + "------------", + "nash679", + "pokefan999", + "dottorleo", + "lbalbalba", + "", + "average time from bug checkin to bugreport:", + "23 seconds", +}; +const int TEAM = ARRAY_SIZE(team); u8 scroll_start; u8 scroll_buffer[SIZE_SCROLL_BUFFER][255]; diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index 9396bbd3d..bad5744e6 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -321,6 +321,10 @@ RelativePath=".\aviout.cpp" > + + @@ -550,11 +554,7 @@ > - - - - @@ -825,6 +821,10 @@ RelativePath="..\Disassembler.h" > + + diff --git a/desmume/src/windows/DeSmuME_2008.vcproj b/desmume/src/windows/DeSmuME_2008.vcproj index f6a4b6126..ebc0a4650 100644 --- a/desmume/src/windows/DeSmuME_2008.vcproj +++ b/desmume/src/windows/DeSmuME_2008.vcproj @@ -772,10 +772,6 @@ RelativePath=".\tileView.cpp" > - - - - @@ -974,6 +966,10 @@ RelativePath="..\Disassembler.h" > + + diff --git a/desmume/src/windows/aviout.cpp b/desmume/src/windows/aviout.cpp index 641bfc7d0..6deffb784 100644 --- a/desmume/src/windows/aviout.cpp +++ b/desmume/src/windows/aviout.cpp @@ -1,28 +1,30 @@ -/* aviout.cpp - * - * Copyright (C) 2006-2008 Zeromus - * - * This file is part of DeSmuME - * - * DeSmuME 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. - * - * DeSmuME 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 DeSmuME; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +/* aviout.cpp + + Copyright (C) 2006-2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "main.h" //I added this so that this file could gain access to SetMessageToDisplay. + +#include "main.h" #include "types.h" #include "windriver.h" #include "console.h" #include "gfx3d.h" +#include "aviout.h" #include #include @@ -38,12 +40,6 @@ static void EMU_PrintMessage(const char* msg) { LOG(msg); } -bool DRV_AviBegin(const char* fname); -void DRV_AviEnd(); -void DRV_AviSoundUpdate(void* soundData, int soundLen); -bool DRV_AviIsRecording(); -void DRV_AviVideoUpdate(const u16* buffer); - //extern PALETTEENTRY *color_palette; //extern WAVEFORMATEX wf; //extern int soundo; @@ -414,7 +410,7 @@ void DRV_AviVideoUpdate(const u16* buffer) AviNextSegment(); } -BOOL AVI_IsRecording() +bool AVI_IsRecording() { return avi_file && avi_file->valid; } @@ -451,11 +447,3 @@ void DRV_AviEnd() avi_destroy(&avi_file); } - -bool DRV_AviIsRecording() -{ - if(avi_file) - return true; - - return false; -} diff --git a/desmume/src/windows/aviout.h b/desmume/src/windows/aviout.h index f55c031f6..4f6d8a2be 100644 --- a/desmume/src/windows/aviout.h +++ b/desmume/src/windows/aviout.h @@ -1,5 +1,31 @@ +/* aviout.h + + Copyright (C) 2006-2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _AVIOUT_H_ +#define _AVIOUT_H_ + bool DRV_AviBegin(const char* fname); void DRV_AviEnd(); void DRV_AviSoundUpdate(void* soundData, int soundLen); -bool DRV_AviIsRecording(); -void DRV_AviVideoUpdate(const u16* buffer); \ No newline at end of file +bool AVI_IsRecording(); +void DRV_AviVideoUpdate(const u16* buffer); + +#endif diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index b99935c76..5b5bac350 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -32,7 +32,7 @@ #include "ram_search.h" //In order to call UpdateRamSearch (for loadstate functions) #include "replay.h" #include "aviout.h" -#include "wavout.h" +#include "spu.h" extern LRESULT OpenFile(); //adelikat: Made this an extern here instead of main.h Seemed icky not to limit the scope of this function @@ -178,8 +178,8 @@ void HK_AutoHoldClearKeyDown(int) { void HK_Reset(int) {ResetGame();} -void HK_RecordAVI(int) { if (DRV_AviIsRecording()) AviEnd(); else AviRecordTo(); } -void HK_RecordWAV(int) { if (DRV_WavIsRecording()) WavEnd(); else WavRecordTo(); } +void HK_RecordAVI(int) { if (AVI_IsRecording()) AviEnd(); else AviRecordTo(); } +void HK_RecordWAV(int) { if (WAV_IsRecording()) WavEnd(); else WavRecordTo(); } void HK_ToggleFrame(int) {frameCounterDisplay ^= true;} void HK_ToggleFPS(int) {FpsDisplay ^= true;} diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index d38d1b09e..2bb4c0c79 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1,25 +1,25 @@ -/* Copyright (C) 2006 yopyop -yopyop156@ifrance.com -yopyop156.ifrance.com +/* aviout.cpp -Copyright 2006 Theo Berkau + Copyright 2006 Theo Berkau + Copyright (C) 2006-2009 DeSmuME team -This file is part of DeSmuME + This file is part of DeSmuME -DeSmuME 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. + DeSmuME 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. -DeSmuME 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. + DeSmuME 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 DeSmuME; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU General Public License + along with DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + #include "windriver.h" #include #include @@ -80,7 +80,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "ramwatch.h" #include "ram_search.h" #include "aviout.h" -#include "wavout.h" #include "soundView.h" #include "directx/ddraw.h" @@ -242,7 +241,6 @@ int sndvolume=100; SoundInterface_struct *SNDCoreList[] = { &SNDDummy, - &SNDFile, &SNDDIRECTX, NULL }; @@ -1159,25 +1157,10 @@ DWORD WINAPI run() { Lock lock; - NDS_exec(0); + NDS_exec(); win_sound_samplecounter = 735; } - - SPU_Emulate_core(); - - //we are driving the dsound output from another thread - //but there is no thread for the filewriter. so we need to do it here - if(sndcoretype == SNDCORE_FILEWRITE) - SPU_Emulate_user(); - - //avi writing - DRV_AviSoundUpdate(SPU_core->outbuf,spu_core_samples); DRV_AviVideoUpdate((u16*)GPU_screen); - //wav writing - DRV_WavSoundUpdate(SPU_core->outbuf,spu_core_samples); - - // if (!skipnextframe) - // { static int fps3d = 0; @@ -1192,7 +1175,7 @@ DWORD WINAPI run() osd->addFixed(Hud.FrameCounter.x, Hud.FrameCounter.y, "%d (no movie)",currFrameCounter); } - if(!DRV_AviIsRecording()) osd->update(); + if(!AVI_IsRecording()) osd->update(); Display(); osd->clear(); @@ -1572,11 +1555,9 @@ static void ExitRunLoop() emu_halt(); } -BOOL AVI_IsRecording(); -BOOL WAV_IsRecording(); class WinDriver : public Driver { - virtual BOOL WIFI_Host_InitSystem() { + virtual bool WIFI_Host_InitSystem() { #ifdef EXPERIMENTAL_WIFI //require winsock initialization WSADATA wsaData ; @@ -1584,18 +1565,18 @@ class WinDriver : public Driver if (WSAStartup(version,&wsaData)) { printf("Failed initializing WSAStartup - softAP support disabled\n"); - return FALSE ; + return false ; } //require wpcap.dll HMODULE temp = LoadLibrary("wpcap.dll"); if(temp == NULL) { printf("Failed initializing wpcap.dll - softAP support disabled\n"); - return FALSE; + return false; } FreeLibrary(temp); - return TRUE; + return true; #else - return FALSE ; + return false ; #endif } virtual void WIFI_Host_ShutdownSystem() { @@ -1604,20 +1585,25 @@ class WinDriver : public Driver #endif } - virtual BOOL AVI_IsRecording() + virtual bool AVI_IsRecording() { return ::AVI_IsRecording(); } - virtual BOOL WAV_IsRecording() + virtual bool WAV_IsRecording() { return ::WAV_IsRecording(); } virtual void USR_InfoMessage(const char *message) { + LOG("%s\n", message); SetMessageToDisplay(message); } + + virtual void AVI_SoundUpdate(void* soundData, int soundLen) { + ::DRV_AviSoundUpdate(soundData, soundLen); + } }; int WINAPI WinMain (HINSTANCE hThisInstance, @@ -1887,7 +1873,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, EnableMenuItem (mainMenu, IDM_SUBMITBUGREPORT, MF_GRAYED); #endif LOG("Init sound core\n"); - sndcoretype = GetPrivateProfileInt("Sound","SoundCore", SNDCORE_DIRECTX, IniName); + sndcoretype = GetPrivateProfileInt("Sound","SoundCore2", SNDCORE_DIRECTX, IniName); sndbuffersize = GetPrivateProfileInt("Sound","SoundBufferSize", 735 * 4, IniName); CommonSettings.spuInterpolationMode = (SPUInterpolationMode)GetPrivateProfileInt("Sound","SPUInterpolation", 1, IniName); CommonSettings.spuAdpcmCache = GetPrivateProfileInt("Sound","SPUAdpcmCache",0,IniName)!=0; @@ -1973,7 +1959,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, SaveRecentRoms(); NDS_DeInit(); DRV_AviEnd(); - DRV_WavEnd(); + WAV_End(); //------SHUTDOWN @@ -2333,7 +2319,7 @@ void AviRecordTo() void WavEnd() { NDS_Pause(); - DRV_WavEnd(); + WAV_End(); NDS_UnPause(); } @@ -2380,7 +2366,7 @@ void WavRecordTo() if(GetSaveFileName(&ofn)) { - DRV_WavBegin(szChoice); + WAV_Begin(szChoice); } NDS_UnPause(); @@ -2641,11 +2627,11 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM //Check if AVI is recording mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_STRING; - LoadString(hAppInst, !DRV_AviIsRecording() ? IDM_FILE_RECORDAVI : IDM_FILE_STOPAVI, menuItemString, 256); + LoadString(hAppInst, !AVI_IsRecording() ? IDM_FILE_RECORDAVI : IDM_FILE_STOPAVI, menuItemString, 256); mii.dwTypeData = menuItemString; SetMenuItemInfo(mainMenu, IDM_FILE_RECORDAVI, FALSE, &mii); //Check if WAV is recording - LoadString(hAppInst, !DRV_WavIsRecording() ? IDM_FILE_RECORDWAV : IDM_FILE_STOPWAV, menuItemString, 256); + LoadString(hAppInst, !AVI_IsRecording() ? IDM_FILE_RECORDWAV : IDM_FILE_STOPWAV, menuItemString, 256); SetMenuItemInfo(mainMenu, IDM_FILE_RECORDWAV, FALSE, &mii); //Menu items dependent on a ROM loaded @@ -2987,14 +2973,14 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM } return 0; case IDM_FILE_RECORDAVI: - if (DRV_AviIsRecording()) + if (AVI_IsRecording()) AviEnd(); else AviRecordTo(); break; case IDM_FILE_RECORDWAV: - if (DRV_WavIsRecording()) - WavEnd(); + if (WAV_IsRecording()) + WAV_End(); else WavRecordTo(); break; @@ -4105,7 +4091,7 @@ LRESULT CALLBACK SoundSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARA // Write Sound core type sndcoretype = SNDCoreList[SendDlgItemMessage(hDlg, IDC_SOUNDCORECB, CB_GETCURSEL, 0, 0)]->id; sprintf(tempstr, "%d", sndcoretype); - WritePrivateProfileString("Sound", "SoundCore", tempstr, IniName); + WritePrivateProfileString("Sound", "SoundCore2", tempstr, IniName); // Write Sound Buffer size GetDlgItemText(hDlg, IDC_SOUNDBUFFERET, tempstr, 6); diff --git a/desmume/src/windows/ogl.cpp b/desmume/src/windows/ogl.cpp index 49bf1fff6..0449997f0 100644 --- a/desmume/src/windows/ogl.cpp +++ b/desmume/src/windows/ogl.cpp @@ -1,22 +1,22 @@ -/* ogl.cpp - * - * Copyright (C) 2006-2008 Zeromus - * - * This file is part of DeSmuME - * - * DeSmuME 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. - * - * DeSmuME 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 DeSmuME; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +/* ogl.cpp + + Copyright (C) 2006-2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define WIN32_LEAN_AND_MEAN diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 78db3e201..3813d3769 100644 --- a/desmume/src/windows/resources.rc +++ b/desmume/src/windows/resources.rc @@ -677,19 +677,18 @@ FONT 8, "MS Sans Serif" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -IDD_ABOUT_BOX DIALOGEX 0, 0, 212, 298 +IDD_ABOUT_BOX DIALOGEX 0, 0, 212, 288 STYLE DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP CAPTION "About DeSmuME..." FONT 8, "MS Shell Dlg", 400, 0, 1 { - CTEXT "", IDC_AUTHORS_LIST, 7, 75, 198, 188, SS_CENTER, WS_EX_CLIENTEDGE - DEFPUSHBUTTON "Close", IDC_FERMER, 86, 277, 50, 14, BS_DEFPUSHBUTTON + CTEXT "", IDC_AUTHORS_LIST, 7, 60, 198, 188, SS_CENTER, WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Close", IDC_FERMER, 86, 267, 50, 14, BS_DEFPUSHBUTTON CTEXT "DeSmuME", IDC_STATIC, 7, 7, 198, 10, SS_CENTER CTEXT "version", IDC_TXT_VERSION, 7, 18, 198, 8, SS_CENTER - RTEXT "compiled", IDC_TXT_COMPILED, 7, 265, 198, 8, SS_RIGHT + RTEXT "compiled", IDC_TXT_COMPILED, 7, 255, 198, 8, SS_RIGHT CTEXT "Original author", IDC_STATIC, 7, 36, 198, 10, SS_CENTER CTEXT "yopyop", IDC_STATIC, 9, 45, 196, 10, SS_CENTER - CTEXT "current team", IDC_STATIC, 8, 63, 198, 10, SS_CENTER } diff --git a/desmume/src/windows/snddx.cpp b/desmume/src/windows/snddx.cpp index eb56310a2..adcae11b8 100755 --- a/desmume/src/windows/snddx.cpp +++ b/desmume/src/windows/snddx.cpp @@ -1,4 +1,7 @@ -/* Copyright (C) 2005-2007 Theo Berkau +/* snddx.cpp + + Copyright (C) 2005-2007 Theo Berkau + Copyright (C) 2008-2009 DeSmuME team This file is part of DeSmuME @@ -14,7 +17,7 @@ You should have received a copy of the GNU General Public License along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -43,15 +46,15 @@ void SNDDXUnMuteAudio(); void SNDDXSetVolume(int volume); SoundInterface_struct SNDDIRECTX = { -SNDCORE_DIRECTX, -"Direct Sound Interface", -SNDDXInit, -SNDDXDeInit, -SNDDXUpdateAudio, -SNDDXGetAudioSpace, -SNDDXMuteAudio, -SNDDXUnMuteAudio, -SNDDXSetVolume + SNDCORE_DIRECTX, + "Direct Sound Interface", + SNDDXInit, + SNDDXDeInit, + SNDDXUpdateAudio, + SNDDXGetAudioSpace, + SNDDXMuteAudio, + SNDDXUnMuteAudio, + SNDDXSetVolume }; LPDIRECTSOUND8 lpDS8; @@ -67,7 +70,7 @@ static int issoundmuted; ////////////////////////////////////////////////////////////////////////////// -static volatile bool terminate; +static volatile bool doterminate; static volatile bool terminated; extern CRITICAL_SECTION win_sync; @@ -76,7 +79,7 @@ extern volatile int win_sound_samplecounter; DWORD WINAPI SNDDXThread( LPVOID ) { for(;;) { - if(terminate) break; + if(doterminate) break; { Lock lock; SPU_Emulate_user(); @@ -89,229 +92,229 @@ DWORD WINAPI SNDDXThread( LPVOID ) int SNDDXInit(int buffersize) { - DSBUFFERDESC dsbdesc; - WAVEFORMATEX wfx; - HRESULT ret; - char tempstr[512]; + DSBUFFERDESC dsbdesc; + WAVEFORMATEX wfx; + HRESULT ret; + char tempstr[512]; - if ((ret = DirectSoundCreate8(NULL, &lpDS8, NULL)) != DS_OK) - { - sprintf(tempstr, "DirectSound8Create error: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); - MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); - return -1; - } + if ((ret = DirectSoundCreate8(NULL, &lpDS8, NULL)) != DS_OK) + { + sprintf(tempstr, "DirectSound8Create error: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); + MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); + return -1; + } - if ((ret = IDirectSound8_SetCooperativeLevel(lpDS8, MainWindow->getHWnd(), DSSCL_PRIORITY)) != DS_OK) - { - sprintf(tempstr, "IDirectSound8_SetCooperativeLevel error: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); - MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); - return -1; - } + if ((ret = IDirectSound8_SetCooperativeLevel(lpDS8, MainWindow->getHWnd(), DSSCL_PRIORITY)) != DS_OK) + { + sprintf(tempstr, "IDirectSound8_SetCooperativeLevel error: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); + MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); + return -1; + } - memset(&dsbdesc, 0, sizeof(dsbdesc)); - dsbdesc.dwSize = sizeof(DSBUFFERDESC); - dsbdesc.dwFlags = DSBCAPS_PRIMARYBUFFER; - dsbdesc.dwBufferBytes = 0; - dsbdesc.lpwfxFormat = NULL; + memset(&dsbdesc, 0, sizeof(dsbdesc)); + dsbdesc.dwSize = sizeof(DSBUFFERDESC); + dsbdesc.dwFlags = DSBCAPS_PRIMARYBUFFER; + dsbdesc.dwBufferBytes = 0; + dsbdesc.lpwfxFormat = NULL; - if ((ret = IDirectSound8_CreateSoundBuffer(lpDS8, &dsbdesc, &lpDSB, NULL)) != DS_OK) - { - sprintf(tempstr, "Error when creating primary sound buffer: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); - MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); - return -1; - } + if ((ret = IDirectSound8_CreateSoundBuffer(lpDS8, &dsbdesc, &lpDSB, NULL)) != DS_OK) + { + sprintf(tempstr, "Error when creating primary sound buffer: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); + MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); + return -1; + } - soundbufsize = buffersize * 2 * 2; + soundbufsize = buffersize * 2 * 2; - memset(&wfx, 0, sizeof(wfx)); - wfx.wFormatTag = WAVE_FORMAT_PCM; - wfx.nChannels = 2; - wfx.nSamplesPerSec = 44100; - wfx.wBitsPerSample = 16; - wfx.nBlockAlign = (wfx.wBitsPerSample / 8) * wfx.nChannels; - wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + memset(&wfx, 0, sizeof(wfx)); + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = (wfx.wBitsPerSample / 8) * wfx.nChannels; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; - if ((ret = IDirectSoundBuffer8_SetFormat(lpDSB, &wfx)) != DS_OK) - { - sprintf(tempstr, "IDirectSoundBuffer8_SetFormat error: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); - MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); - return -1; - } + if ((ret = IDirectSoundBuffer8_SetFormat(lpDSB, &wfx)) != DS_OK) + { + sprintf(tempstr, "IDirectSoundBuffer8_SetFormat error: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); + MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); + return -1; + } - memset(&dsbdesc, 0, sizeof(dsbdesc)); - dsbdesc.dwSize = sizeof(DSBUFFERDESC); - dsbdesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_STICKYFOCUS | - DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2 | - DSBCAPS_LOCHARDWARE; - dsbdesc.dwBufferBytes = soundbufsize; - dsbdesc.lpwfxFormat = &wfx; + memset(&dsbdesc, 0, sizeof(dsbdesc)); + dsbdesc.dwSize = sizeof(DSBUFFERDESC); + dsbdesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_STICKYFOCUS | + DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2 | + DSBCAPS_LOCHARDWARE; + dsbdesc.dwBufferBytes = soundbufsize; + dsbdesc.lpwfxFormat = &wfx; - if ((ret = IDirectSound8_CreateSoundBuffer(lpDS8, &dsbdesc, &lpDSB2, NULL)) != DS_OK) - { - if (ret == DSERR_CONTROLUNAVAIL || - ret == DSERR_INVALIDCALL || - ret == E_FAIL || - ret == E_NOTIMPL) - { - // Try using a software buffer instead - dsbdesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_STICKYFOCUS | - DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2 | - DSBCAPS_LOCSOFTWARE; + if ((ret = IDirectSound8_CreateSoundBuffer(lpDS8, &dsbdesc, &lpDSB2, NULL)) != DS_OK) + { + if (ret == DSERR_CONTROLUNAVAIL || + ret == DSERR_INVALIDCALL || + ret == E_FAIL || + ret == E_NOTIMPL) + { + // Try using a software buffer instead + dsbdesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_STICKYFOCUS | + DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2 | + DSBCAPS_LOCSOFTWARE; - if ((ret = IDirectSound8_CreateSoundBuffer(lpDS8, &dsbdesc, &lpDSB2, NULL)) != DS_OK) - { - sprintf(tempstr, "Error when creating secondary sound buffer: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); - MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); - return -1; - } - } - else - { - sprintf(tempstr, "Error when creating secondary sound buffer: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); - MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); - return -1; - } - } + if ((ret = IDirectSound8_CreateSoundBuffer(lpDS8, &dsbdesc, &lpDSB2, NULL)) != DS_OK) + { + sprintf(tempstr, "Error when creating secondary sound buffer: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); + MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); + return -1; + } + } + else + { + sprintf(tempstr, "Error when creating secondary sound buffer: %s - %s", DXGetErrorString8(ret), DXGetErrorDescription8(ret)); + MessageBox (NULL, tempstr, "Error", MB_OK | MB_ICONINFORMATION); + return -1; + } + } - IDirectSoundBuffer8_Play(lpDSB2, 0, 0, DSBPLAY_LOOPING); + IDirectSoundBuffer8_Play(lpDSB2, 0, 0, DSBPLAY_LOOPING); - if ((stereodata16 = (s16 *)malloc(soundbufsize)) == NULL) - return -1; + if ((stereodata16 = (s16 *)malloc(soundbufsize)) == NULL) + return -1; - memset(stereodata16, 0, soundbufsize); + memset(stereodata16, 0, soundbufsize); - soundvolume = DSBVOLUME_MAX; - issoundmuted = 0; + soundvolume = DSBVOLUME_MAX; + issoundmuted = 0; - terminate = false; + doterminate = false; terminated = false; - CreateThread(0,0,SNDDXThread,0,0,0); + CreateThread(0,0,SNDDXThread,0,0,0); - return 0; + return 0; } ////////////////////////////////////////////////////////////////////////////// void SNDDXDeInit() { - DWORD status=0; - - terminate = true; - while(!terminated) { - Sleep(1); - } + DWORD status=0; - if (lpDSB2) - { - IDirectSoundBuffer8_GetStatus(lpDSB2, &status); + doterminate = true; + while(!terminated) { + Sleep(1); + } - if(status == DSBSTATUS_PLAYING) - IDirectSoundBuffer8_Stop(lpDSB2); + if (lpDSB2) + { + IDirectSoundBuffer8_GetStatus(lpDSB2, &status); - IDirectSoundBuffer8_Release(lpDSB2); - lpDSB2 = NULL; - } + if(status == DSBSTATUS_PLAYING) + IDirectSoundBuffer8_Stop(lpDSB2); - if (lpDSB) - { - IDirectSoundBuffer8_Release(lpDSB); - lpDSB = NULL; - } + IDirectSoundBuffer8_Release(lpDSB2); + lpDSB2 = NULL; + } - if (lpDS8) - { - IDirectSound8_Release(lpDS8); - lpDS8 = NULL; - } + if (lpDSB) + { + IDirectSoundBuffer8_Release(lpDSB); + lpDSB = NULL; + } + + if (lpDS8) + { + IDirectSound8_Release(lpDS8); + lpDS8 = NULL; + } } ////////////////////////////////////////////////////////////////////////////// void SNDDXUpdateAudio(s16 *buffer, u32 num_samples) { - LPVOID buffer1; - LPVOID buffer2; - DWORD buffer1_size, buffer2_size; - DWORD status; + LPVOID buffer1; + LPVOID buffer2; + DWORD buffer1_size, buffer2_size; + DWORD status; - int samplecounter; - { + int samplecounter; + { Lock lock; - samplecounter = win_sound_samplecounter -= num_samples; - } - - bool silence = (samplecounter<-44100*15/60); //behind by more than a quarter second -> silence + samplecounter = win_sound_samplecounter -= num_samples; + } - IDirectSoundBuffer8_GetStatus(lpDSB2, &status); + bool silence = (samplecounter<-44100*15/60); //behind by more than a quarter second -> silence - if (status & DSBSTATUS_BUFFERLOST) - return; // fix me + IDirectSoundBuffer8_GetStatus(lpDSB2, &status); - IDirectSoundBuffer8_Lock(lpDSB2, soundoffset, num_samples * sizeof(s16) * 2, &buffer1, &buffer1_size, &buffer2, &buffer2_size, 0); + if (status & DSBSTATUS_BUFFERLOST) + return; // fix me - if(silence) { - memset(buffer1, 0, buffer1_size); - if(buffer2) - memset(buffer2, 0, buffer2_size); - } - else - { - memcpy(buffer1, buffer, buffer1_size); + IDirectSoundBuffer8_Lock(lpDSB2, soundoffset, num_samples * sizeof(s16) * 2, &buffer1, &buffer1_size, &buffer2, &buffer2_size, 0); + + if(silence) { + memset(buffer1, 0, buffer1_size); + if(buffer2) + memset(buffer2, 0, buffer2_size); + } + else + { + memcpy(buffer1, buffer, buffer1_size); if (buffer2) - memcpy(buffer2, ((u8 *)buffer)+buffer1_size, buffer2_size); - } + memcpy(buffer2, ((u8 *)buffer)+buffer1_size, buffer2_size); + } - soundoffset += buffer1_size + buffer2_size; - soundoffset %= soundbufsize; + soundoffset += buffer1_size + buffer2_size; + soundoffset %= soundbufsize; - IDirectSoundBuffer8_Unlock(lpDSB2, buffer1, buffer1_size, buffer2, buffer2_size); + IDirectSoundBuffer8_Unlock(lpDSB2, buffer1, buffer1_size, buffer2, buffer2_size); } ////////////////////////////////////////////////////////////////////////////// u32 SNDDXGetAudioSpace() { - DWORD playcursor, writecursor; - u32 freespace=0; + DWORD playcursor, writecursor; + u32 freespace=0; - if (IDirectSoundBuffer8_GetCurrentPosition (lpDSB2, &playcursor, &writecursor) != DS_OK) - return 0; + if (IDirectSoundBuffer8_GetCurrentPosition (lpDSB2, &playcursor, &writecursor) != DS_OK) + return 0; - if (soundoffset > playcursor) - freespace = soundbufsize - soundoffset + playcursor; - else - freespace = playcursor - soundoffset; + if (soundoffset > playcursor) + freespace = soundbufsize - soundoffset + playcursor; + else + freespace = playcursor - soundoffset; -// if (freespace > 512) - return (freespace / 2 / 2); -// else -// return 0; + // if (freespace > 512) + return (freespace / 2 / 2); + // else + // return 0; } ////////////////////////////////////////////////////////////////////////////// void SNDDXMuteAudio() { - issoundmuted = 1; - IDirectSoundBuffer8_SetVolume (lpDSB2, DSBVOLUME_MIN); + issoundmuted = 1; + IDirectSoundBuffer8_SetVolume (lpDSB2, DSBVOLUME_MIN); } ////////////////////////////////////////////////////////////////////////////// void SNDDXUnMuteAudio() { - issoundmuted = 0; - IDirectSoundBuffer8_SetVolume (lpDSB2, soundvolume); + issoundmuted = 0; + IDirectSoundBuffer8_SetVolume (lpDSB2, soundvolume); } ////////////////////////////////////////////////////////////////////////////// void SNDDXSetVolume(int volume) { - if (!lpDSB2) return ; /* might happen when changing sounddevice on the fly, caused a gpf */ - soundvolume = (((LONG)volume) - 100) * 100; - if (!issoundmuted) - IDirectSoundBuffer8_SetVolume (lpDSB2, soundvolume); + if (!lpDSB2) return ; /* might happen when changing sounddevice on the fly, caused a gpf */ + soundvolume = (((LONG)volume) - 100) * 100; + if (!issoundmuted) + IDirectSoundBuffer8_SetVolume (lpDSB2, soundvolume); } ////////////////////////////////////////////////////////////////////////////// diff --git a/desmume/src/windows/wavout.cpp b/desmume/src/windows/wavout.cpp deleted file mode 100644 index 22e49661d..000000000 --- a/desmume/src/windows/wavout.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* wavout.cpp - * - * Copyright (C) 2006-2008 Zeromus - * - * This file is part of DeSmuME - * - * DeSmuME 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. - * - * DeSmuME 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 DeSmuME; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "main.h" //I added this so that this file could gain access to SetMessageToDisplay. -#include "types.h" -#include "windriver.h" -#include "console.h" -#include "gfx3d.h" - -#include -#include -#include - -#include "debug.h" - -static void EMU_PrintError(const char* msg) { - LOG(msg); -} - -static void EMU_PrintMessage(const char* msg) { - LOG(msg); -} - -bool DRV_WavBegin(const char* fname); -void DRV_WavEnd(); -void DRV_WavSoundUpdate(void* soundData, int soundLen); -bool DRV_WavIsRecording(); - -static struct WAVFile -{ - bool valid; - - WAVEFORMATEX wav_format_master; - WAVEFORMATEX wav_format; - HMMIO wav_file; - - MMCKINFO waveChunk; - MMCKINFO fmtChunk; - MMCKINFO dataChunk; -} *wav_file = NULL; - -static void wav_create(struct WAVFile** wav_out) -{ - *wav_out = (struct WAVFile*)malloc(sizeof(struct WAVFile)); - memset(*wav_out, 0, sizeof(struct WAVFile)); -} - -static void wav_destroy(struct WAVFile** wav_out) -{ - if(!(*wav_out)) - return; - - if((*wav_out)->wav_file) - { - mmioAscend((*wav_out)->wav_file, &(*wav_out)->dataChunk, 0); - mmioAscend((*wav_out)->wav_file, &(*wav_out)->waveChunk, 0); -// mmioFlush((*wav_out)->wav_file, 0); - mmioClose((*wav_out)->wav_file, 0); - (*wav_out)->wav_file = NULL; - } - - free(*wav_out); - *wav_out = NULL; -} - -static void set_sound_format(const WAVEFORMATEX* wave_format, struct WAVFile* wav_out) -{ - memcpy(&((*wav_out).wav_format_master), wave_format, sizeof(WAVEFORMATEX)); -} - -static int wav_open(const char* filename, const WAVEFORMATEX* pwfex) -{ - int error = 1; - int result = 0; - - do - { - // close existing first - DRV_WavEnd(); - - // create the object - wav_create(&wav_file); - if(!wav_file) - break; - - // add audio format - set_sound_format(pwfex, wav_file); - - // open the file - if(!(wav_file->wav_file = mmioOpen((LPSTR)filename, NULL, MMIO_CREATE|MMIO_WRITE))) - break; - - // create WAVE chunk - wav_file->waveChunk.fccType = mmioFOURCC('W', 'A', 'V', 'E'); - mmioCreateChunk(wav_file->wav_file, &wav_file->waveChunk, MMIO_CREATERIFF); - - // create Format chunk - wav_file->fmtChunk.ckid = mmioFOURCC('f', 'm', 't', ' '); - mmioCreateChunk(wav_file->wav_file, &wav_file->fmtChunk, 0); - // then write header - memcpy(&wav_file->wav_format, &wav_file->wav_format_master, sizeof(WAVEFORMATEX)); - wav_file->wav_format.cbSize = 0; - mmioWrite(wav_file->wav_file, (HPSTR) &wav_file->wav_format, sizeof(WAVEFORMATEX)); - mmioAscend(wav_file->wav_file, &wav_file->fmtChunk, 0); - - // create Data chunk - wav_file->dataChunk.ckid = mmioFOURCC('d', 'a', 't', 'a'); - mmioCreateChunk(wav_file->wav_file, &wav_file->dataChunk, 0); - - // success - error = 0; - result = 1; - wav_file->valid = true; - - } while(false); - - if(!result) - { - wav_destroy(&wav_file); - if(error) - EMU_PrintError("Error writing WAV file"); - } - - return result; -} - - -bool DRV_WavBegin(const char* fname) -{ - DRV_WavEnd(); - - WAVEFORMATEX wf; - wf.cbSize = sizeof(WAVEFORMATEX); - wf.nAvgBytesPerSec = 44100 * 4; - wf.nBlockAlign = 4; - wf.nChannels = 2; - wf.nSamplesPerSec = 44100; - wf.wBitsPerSample = 16; - wf.wFormatTag = WAVE_FORMAT_PCM; - WAVEFORMATEX* pwf = &wf; - - if(!wav_open(fname, pwf)) - return 0; - - EMU_PrintMessage("WAV recording started."); - SetMessageToDisplay("WAV recording started."); - - return 1; -} - -BOOL WAV_IsRecording() -{ - return wav_file && wav_file->valid; -} -void DRV_WavSoundUpdate(void* soundData, int soundLen) -{ - int nBytes; - - if(!WAV_IsRecording()) - return; - - nBytes = soundLen * wav_file->wav_format.nBlockAlign; - // assumes mmio system has been opened data chunk - mmioWrite(wav_file->wav_file, (HPSTR) soundData, nBytes); -// mmioFlush(wav_file->wav_file, 0); -} - -void DRV_WavEnd() -{ - if(!wav_file) - return; - - EMU_PrintMessage("WAV recording ended."); - SetMessageToDisplay("WAV recording ended."); - - wav_destroy(&wav_file); -} - -bool DRV_WavIsRecording() -{ - if(wav_file) - return true; - - return false; -} diff --git a/desmume/src/windows/wavout.h b/desmume/src/windows/wavout.h deleted file mode 100644 index 5d8565cb5..000000000 --- a/desmume/src/windows/wavout.h +++ /dev/null @@ -1,4 +0,0 @@ -bool DRV_WavBegin(const char* fname); -void DRV_WavEnd(); -void DRV_WavSoundUpdate(void* soundData, int soundLen); -bool DRV_WavIsRecording(); \ No newline at end of file diff --git a/desmume/src/windows/windriver.h b/desmume/src/windows/windriver.h index a8d99ee8f..5f12daad0 100644 --- a/desmume/src/windows/windriver.h +++ b/desmume/src/windows/windriver.h @@ -1,3 +1,24 @@ +/* windriver.h + + Copyright (C) 2008-2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + #ifndef _WINDRIVER_H_ #define _WINDRIVER_H_