diff --git a/desmume/src/GPU_osd.cpp b/desmume/src/GPU_osd.cpp index dfef00ffd..49a7b8e88 100644 --- a/desmume/src/GPU_osd.cpp +++ b/desmume/src/GPU_osd.cpp @@ -550,7 +550,7 @@ void DrawHUD() drawPad(Hud.GraphicalInputDisplay.x, Hud.GraphicalInputDisplay.y, 2.5); } - #ifdef WIN32 + #if defined(WIN32) && !defined(WXPORT) if (CommonSettings.hud.ShowMicrophone) { osd->addFixed(Hud.Microphone.x, Hud.Microphone.y, "%03d [%07d]",MicDisplay, Hud.cpuloopIterationCount); diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index 9b62e9124..afcfe1e1e 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -33,7 +33,7 @@ #include -#ifdef WIN32 +#if defined(WIN32) && !defined(WXPORT) #include "pathsettings.h" #endif diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 6df113e5f..d1bd178a2 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -44,7 +44,7 @@ static void ENDGL() { oglrender_endOpenGL(); } -#ifdef _WIN32 +#ifdef _WIN32 && !defined(WXPORT) #define WIN32_LEAN_AND_MEAN #include #include diff --git a/desmume/src/lua-engine.cpp b/desmume/src/lua-engine.cpp index 3833f021c..901c13966 100644 --- a/desmume/src/lua-engine.cpp +++ b/desmume/src/lua-engine.cpp @@ -11,12 +11,14 @@ #include "GPU_osd.h" #include "saves.h" #include "emufile.h" -#ifdef WIN32 +#if defined(WIN32) && !defined(WXPORT) #include "main.h" #include "windows.h" #include "video.h" #endif +using namespace std; + // functions that maybe aren't part of the Lua engine // but didn't make sense to add to BaseDriver (at least not yet) @@ -424,7 +426,7 @@ static int doPopup(lua_State* L, const char* deftype, const char* deficon) static const char * const titles [] = {"Notice", "Question", "Warning", "Error"}; const char* answer = "ok"; -#ifdef _WIN32 +#if defined(_WIN32) && !defined(WXPORT) static const int etypes [] = {MB_OK, MB_YESNO, MB_YESNOCANCEL, MB_OKCANCEL, MB_ABORTRETRYIGNORE}; static const int eicons [] = {MB_ICONINFORMATION, MB_ICONQUESTION, MB_ICONWARNING, MB_ICONERROR}; // DialogsOpen++; @@ -1274,7 +1276,7 @@ bool luabitop_validate(lua_State *L) // originally named as luaopen_bit if (b != (UBits)1437217655L || BAD_SAR) { /* Perform a simple self-test. */ const char *msg = "compiled with incompatible luaconf.h"; #ifdef LUA_NUMBER_DOUBLE -#ifdef _WIN32 +#if defined(_WIN32) && !defined(WXPORT) if (b == (UBits)1610612736L) msg = "use D3DCREATE_FPU_PRESERVE with DirectX"; #endif @@ -1346,7 +1348,7 @@ void indicateBusy(lua_State* L, bool busy) lua_pop(L, 1); } */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(WXPORT) int uid = luaStateToUIDMap[L->l_G->mainthread]; HWND hDlg = (HWND)uid; char str [1024]; @@ -1400,7 +1402,7 @@ void LuaRescueHook(lua_State* L, lua_Debug *dbg) if(!info.panic) { SPU_ClearOutputBuffer(); -#if defined(ASK_USER_ON_FREEZE) && defined(_WIN32) +#if defined(ASK_USER_ON_FREEZE) && defined(_WIN32) && !defined(WXPORT) DialogsOpen++; int answer = MessageBox(HWnd, "A Lua script has been running for quite a while. Maybe it is in an infinite loop.\n\nWould you like to stop the script?\n\n(Yes to stop it now,\n No to keep running and not ask again,\n Cancel to keep running but ask again later)", "Lua Alert", MB_YESNOCANCEL | MB_DEFBUTTON3 | MB_ICONASTERISK); DialogsOpen--; @@ -2508,7 +2510,7 @@ static void prepare_reading() } else { -#ifdef WIN32 +#if defined(WIN32) && !defined(WXPORT) extern VideoInfo video; curGuiData.data = video.buffer; curGuiData.stridePix = 256; @@ -3356,7 +3358,7 @@ static void GetCurrentScriptDir(char* buffer, int bufLen) DEFINE_LUA_FUNCTION(emu_openscript, "filename") { -#ifdef WIN32 +#if defined(WIN32) && !defined(WXPORT) char curScriptDir[1024]; GetCurrentScriptDir(curScriptDir, 1024); // make sure we can always find scripts that are in the same directory as the current script const char* filename = lua_isstring(L,1) ? lua_tostring(L,1) : NULL; extern const char* OpenLuaScript(const char* filename, const char* extraDirToCheck, bool makeSubservient); @@ -3536,7 +3538,7 @@ DEFINE_LUA_FUNCTION(sound_clear, "") return 0; } -#ifdef _WIN32 +#if defined(_WIN32) && !defined(WXPORT) const char* s_keyToName[256] = { NULL, @@ -3650,7 +3652,7 @@ DEFINE_LUA_FUNCTION(input_getcurrentinputstatus, "") { lua_newtable(L); -#ifdef _WIN32 +#if defined(_WIN32) && !defined(WXPORT) // keyboard and mouse button status { int BackgroundInput = 0;//TODO diff --git a/desmume/src/path.h b/desmume/src/path.h index 58bfbac82..f87c45782 100644 --- a/desmume/src/path.h +++ b/desmume/src/path.h @@ -1,6 +1,6 @@ #include -#ifdef WIN32 +#if defined(WIN32) && !defined(WXPORT) #include "resource.h" #else #include @@ -312,7 +312,7 @@ public: enum ImageFormat { -#ifdef WIN32 +#if defined(WIN32) && !defined(WXPORT) PNG = IDC_PNG, BMP = IDC_BMP #else diff --git a/desmume/src/version.cpp b/desmume/src/version.cpp index e55413073..83280c3a9 100644 --- a/desmume/src/version.cpp +++ b/desmume/src/version.cpp @@ -21,7 +21,7 @@ #include "version.h" //todo - everyone will want to support this eventually, i suppose -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(WXPORT) #include "svnrev.h" #else #ifdef SVN_REV diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp index de2655a1a..e53f70e23 100644 --- a/desmume/src/wifi.cpp +++ b/desmume/src/wifi.cpp @@ -32,7 +32,9 @@ #include #define socket_t SOCKET #define sockaddr_t SOCKADDR - #include "windriver.h" + #ifndef WXPORT + #include "windriver.h" + #endif #else #include #include diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index f9c26048b..44623d37c 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -48,6 +48,7 @@ /> + + + + + +DeSmuME + + + + + + diff --git a/desmume/src/wx/DeSmuME_x86.manifest b/desmume/src/wx/DeSmuME_x86.manifest new file mode 100644 index 000000000..4e25cd13f --- /dev/null +++ b/desmume/src/wx/DeSmuME_x86.manifest @@ -0,0 +1,23 @@ + + + +DeSmuME + + + + + + diff --git a/desmume/src/wx/IniFile.cpp b/desmume/src/wx/IniFile.cpp index 0a6e54f9e..1e70fb362 100644 --- a/desmume/src/wx/IniFile.cpp +++ b/desmume/src/wx/IniFile.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/desmume/src/wx/InputCommon/DirectInputBase.h b/desmume/src/wx/InputCommon/DirectInputBase.h index 770fa258d..8c89c7385 100644 --- a/desmume/src/wx/InputCommon/DirectInputBase.h +++ b/desmume/src/wx/InputCommon/DirectInputBase.h @@ -26,7 +26,7 @@ #include #define DIRECTINPUT_VERSION 0x0800 // DirectInput -#include +#include //#include "ConsoleWindow.h" // Common diff --git a/desmume/src/wx/InputCommon/EventHandler.cpp b/desmume/src/wx/InputCommon/EventHandler.cpp index f2b210322..47adce6c4 100644 --- a/desmume/src/wx/InputCommon/EventHandler.cpp +++ b/desmume/src/wx/InputCommon/EventHandler.cpp @@ -2,7 +2,7 @@ #include #include -#if defined HAVE_WX && HAVE_WX +#if defined(HAVE_WX) #include #endif @@ -98,7 +98,7 @@ bool EventHandler::TestEvent (Keys k, sf::Event e) return (false); } -#if defined HAVE_WX && HAVE_WX +#if defined(HAVE_WX) // Taken from wxw source code sf::Key::Code EventHandler::wxCharCodeToSF(int id) { diff --git a/desmume/src/wx/InputCommon/EventHandler.h b/desmume/src/wx/InputCommon/EventHandler.h index 1529a58b5..03a4afb17 100644 --- a/desmume/src/wx/InputCommon/EventHandler.h +++ b/desmume/src/wx/InputCommon/EventHandler.h @@ -54,7 +54,7 @@ public: static void Destroy(); bool addEvent(sf::Event *e); static bool TestEvent (Keys k, sf::Event e); -#if defined HAVE_WX && HAVE_WX +#if defined(HAVE_WX) static sf::Key::Code wxCharCodeToSF(int id); #endif static void SFKeyToString(sf::Key::Code keycode, char *keyStr); diff --git a/desmume/src/wx/PadSimple/PadSimple.cpp b/desmume/src/wx/PadSimple/PadSimple.cpp index 16ac781ab..ae15a9562 100644 --- a/desmume/src/wx/PadSimple/PadSimple.cpp +++ b/desmume/src/wx/PadSimple/PadSimple.cpp @@ -30,7 +30,7 @@ //#include "FileUtil.h" //#include "ChunkFile.h" -#if defined(HAVE_WX) && HAVE_WX +#if defined(HAVE_WX) #include "GUI/ConfigDlg.h" PADConfigDialogSimple* m_ConfigFrame = NULL; #endif @@ -68,7 +68,7 @@ SPADInitialize g_PADInitialize; #ifdef _WIN32 //HINSTANCE g_hInstance; -#if defined(HAVE_WX) && HAVE_WX +#if defined(HAVE_WX) class wxDLLApp : public wxApp { bool OnInit() @@ -88,7 +88,7 @@ BOOL APIENTRY aMain(HINSTANCE hinstDLL, // DLL module handle { case DLL_PROCESS_ATTACH: { -#if defined(HAVE_WX) && HAVE_WX +#if defined(HAVE_WX) wxSetInstance((HINSTANCE)hinstDLL); int argc = 0; char **argv = NULL; @@ -100,7 +100,7 @@ BOOL APIENTRY aMain(HINSTANCE hinstDLL, // DLL module handle break; case DLL_PROCESS_DETACH: -#if defined(HAVE_WX) && HAVE_WX +#if defined(HAVE_WX) wxEntryCleanup(); #endif break; @@ -113,7 +113,7 @@ BOOL APIENTRY aMain(HINSTANCE hinstDLL, // DLL module handle } #endif -#if defined(HAVE_WX) && HAVE_WX +#if defined(HAVE_WX) wxWindow* GetParentedWxWindow(HWND Parent) { #ifdef _WIN32 diff --git a/desmume/src/wx/touch.exe b/desmume/src/wx/touch.exe new file mode 100644 index 000000000..0666a1f62 Binary files /dev/null and b/desmume/src/wx/touch.exe differ diff --git a/desmume/src/wx/un7z_and_touch.bat b/desmume/src/wx/un7z_and_touch.bat new file mode 100644 index 000000000..11920212d --- /dev/null +++ b/desmume/src/wx/un7z_and_touch.bat @@ -0,0 +1,2 @@ +7z x -bd -y -o.libs %1 +touch %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/desmume/src/wx/wxDeSmuME_2008.sln b/desmume/src/wx/wxDeSmuME_2008.sln new file mode 100644 index 000000000..86dc02afa --- /dev/null +++ b/desmume/src/wx/wxDeSmuME_2008.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxDeSmuME_VS2008", "wxDeSmuME_2008.vcproj", "{9F5F72A1-D3A5-4918-B460-E076B16D10A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Dev+|Win32 = Dev+|Win32 + Dev+|x64 = Dev+|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Debug|Win32.ActiveCfg = Debug|Win32 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Debug|Win32.Build.0 = Debug|Win32 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Debug|x64.ActiveCfg = Debug|x64 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Debug|x64.Build.0 = Debug|x64 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Dev+|Win32.ActiveCfg = Dev+|Win32 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Dev+|Win32.Build.0 = Dev+|Win32 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Dev+|x64.ActiveCfg = Dev+|x64 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Dev+|x64.Build.0 = Dev+|x64 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Release|Win32.ActiveCfg = Release|Win32 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Release|Win32.Build.0 = Release|Win32 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Release|x64.ActiveCfg = Release|x64 + {9F5F72A1-D3A5-4918-B460-E076B16D10A9}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/desmume/src/wx/wxDeSmuME_2008.vcproj b/desmume/src/wx/wxDeSmuME_2008.vcproj new file mode 100644 index 000000000..16a4efbaa --- /dev/null +++ b/desmume/src/wx/wxDeSmuME_2008.vcproj @@ -0,0 +1,1660 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/desmume/src/wx/wxMain.cpp b/desmume/src/wx/wxMain.cpp index e4ebbd0be..2ffb3f6d3 100644 --- a/desmume/src/wx/wxMain.cpp +++ b/desmume/src/wx/wxMain.cpp @@ -18,6 +18,10 @@ #include "rasterize.h" #include "OGLRender.h" +#ifdef WIN32 +#include "snddx.h" +#endif + #include #include "LuaWindow.h" @@ -31,7 +35,7 @@ SoundInterface_struct *SNDCoreList[] = { &SNDDummy, #ifdef WIN32 - &SNDDIRECTX, +// &SNDDIRECTX, #else &SNDSDL, #endif @@ -39,10 +43,12 @@ SoundInterface_struct *SNDCoreList[] = { }; GPU3DInterface *core3DList[] = { - &gpu3DNull, - &gpu3Dgl, &gpu3DRasterize, - NULL +#ifndef WIN32 + &gpu3Dgl, +#endif + &gpu3DNull, + NULL }; /* lua stuff stubs */ @@ -93,7 +99,11 @@ public: SPADStatus s; memset(&s,0,sizeof(s)); + + //TODO !!!!!!!!!!!!!!!!!!!!!! FIXME!!!!!!!!!!1 +#ifndef _MSC_VER PAD_GetStatus(0, &s); +#endif if(s.button & PAD_BUTTON_LEFT) left = true; @@ -309,7 +319,9 @@ public: void OnOpenControllerConfiguration(wxCommandEvent& WXUNUSED (event)) { +#ifndef _MSC_VER new PADConfigDialogSimple(this); +#endif } wxMenu* MakeStatesSubMenu( int baseid ) const @@ -438,6 +450,7 @@ bool Desmume::OnInit() Desmume_InitOnce(); aggDraw.hud->attach((u8*)GPU_screen, 256, 384, 1024);//TODO + NDS_3D_ChangeCore(0); #ifdef __WIN32__ extern void OpenConsole(); @@ -459,7 +472,9 @@ bool Desmume::OnInit() SPADInitialize PADInitialize; PADInitialize.padNumber = 1; extern void Initialize(void *init); +#ifndef _WIN32 Initialize(&PADInitialize); +#endif //TODO addon_type = NDS_ADDON_NONE; @@ -561,3 +576,22 @@ DesmumeFrame::DesmumeFrame(const wxString& title) // CreateStatusBar(2); // SetStatusText("Welcome to Desmume!"); } + +#ifdef _WIN32 +/* +* The thread handling functions needed by the GDB stub code. +*/ +void * +createThread_gdb( void (APIENTRY *thread_function)( void *data), + void *thread_data) { + void *new_thread = CreateThread( NULL, 0, + (LPTHREAD_START_ROUTINE)thread_function, thread_data, + 0, NULL); + + return new_thread; +} + +void +joinThread_gdb( void *thread_handle) { +} +#endif \ No newline at end of file