From cf81f8cc3bd9488b2acac96794af216ebeabcc16 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sat, 19 Mar 2011 19:28:57 -0500 Subject: [PATCH] remove xbox support; it doesn't work, and it'd take too much effort to get it working again --- src/BannerCache.cpp | 12 +- src/LuaManager.cpp | 6 +- src/RageDisplay_D3D.cpp | 118 +- src/RageFileDriverDeflate.cpp | 4 +- src/RageFileDriverDirect.cpp | 2 - src/RageFileDriverDirectHelpers.cpp | 81 +- src/RageFileDriverDirectHelpers.h | 10 - src/RageFileManager.cpp | 9 +- src/RageLog.cpp | 2 +- src/RageMath.cpp | 2 +- src/RageSoundReader_MP3.cpp | 12 +- src/RageSurface_Load_JPEG.cpp | 11 +- src/RageSurface_Load_PNG.cpp | 23 +- src/RageSurface_Save_JPEG.cpp | 11 +- src/RageSurface_Save_PNG.cpp | 8 +- src/RageUtil.cpp | 4 - src/ScreenEdit.cpp | 41 +- src/ScreenMapControllers.cpp | 28 - src/ScreenServiceAction.h | 5 - src/ScreenTestFonts.h | 4 - src/SongCacheIndex.cpp | 5 - src/StepMania.cpp | 34 +- src/StepManiaXbox-2003.vcproj | 2783 ----------------- src/Texture Font Generator/Utils.cpp | 14 +- src/arch/ArchHooks/ArchHooks_Xbox.cpp | 227 -- src/arch/ArchHooks/ArchHooks_Xbox.h | 78 - src/arch/InputHandler/InputHandler_Xbox.cpp | 232 -- src/arch/InputHandler/InputHandler_Xbox.h | 52 - src/arch/LoadingWindow/LoadingWindow.cpp | 5 +- src/arch/LoadingWindow/LoadingWindow_Xbox.cpp | 179 -- src/arch/LoadingWindow/LoadingWindow_Xbox.h | 51 - .../MemoryCardDriverThreaded_Xbox.cpp | 150 - .../MemoryCardDriverThreaded_Xbox.h | 51 - src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 23 +- .../MovieTexture/MovieTexture_Generic.cpp | 2 +- src/arch/Threads/Threads_Win32.cpp | 2 - src/arch/arch.cpp | 21 +- src/arch/arch.h | 2 - src/arch/arch_default.h | 10 - src/archutils/Win32/AppInstance.h | 4 +- src/archutils/Win32/DirectXHelpers.cpp | 18 +- src/archutils/Win32/ErrorStrings.cpp | 4 - src/archutils/Win32/arch_setup.h | 18 +- src/archutils/Xbox/GraphicsWindow.cpp | 151 - src/archutils/Xbox/GraphicsWindow.h | 47 - src/archutils/Xbox/VirtualMemory.cpp | 644 ---- src/archutils/Xbox/VirtualMemory.h | 87 - src/archutils/Xbox/arch_setup.cpp | 58 - src/archutils/Xbox/arch_setup.h | 25 - src/archutils/Xbox/custom_launch_params.cpp | 66 - src/archutils/Xbox/custom_launch_params.h | 36 - src/archutils/Xbox/saveblue.XBX | Bin 18432 -> 0 bytes src/archutils/Xbox/savered.XBX | Bin 18432 -> 0 bytes src/archutils/Xbox/smicon.XBX | Bin 18432 -> 0 bytes src/crypto/CryptNoise.cpp | 11 +- src/ezsockets.cpp | 47 +- src/ezsockets.h | 14 +- src/global.cpp | 1 - src/libjpeg/jmorecfg.h | 2 +- src/lua-5.1/src/luaconf.h | 3 +- src/sm-ssc_Xbox-net2003.sln | 53 - 61 files changed, 75 insertions(+), 5528 deletions(-) delete mode 100644 src/StepManiaXbox-2003.vcproj delete mode 100644 src/arch/ArchHooks/ArchHooks_Xbox.cpp delete mode 100644 src/arch/ArchHooks/ArchHooks_Xbox.h delete mode 100644 src/arch/InputHandler/InputHandler_Xbox.cpp delete mode 100644 src/arch/InputHandler/InputHandler_Xbox.h delete mode 100644 src/arch/LoadingWindow/LoadingWindow_Xbox.cpp delete mode 100644 src/arch/LoadingWindow/LoadingWindow_Xbox.h delete mode 100644 src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.cpp delete mode 100644 src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.h delete mode 100644 src/archutils/Xbox/GraphicsWindow.cpp delete mode 100644 src/archutils/Xbox/GraphicsWindow.h delete mode 100644 src/archutils/Xbox/VirtualMemory.cpp delete mode 100644 src/archutils/Xbox/VirtualMemory.h delete mode 100644 src/archutils/Xbox/arch_setup.cpp delete mode 100644 src/archutils/Xbox/arch_setup.h delete mode 100644 src/archutils/Xbox/custom_launch_params.cpp delete mode 100644 src/archutils/Xbox/custom_launch_params.h delete mode 100644 src/archutils/Xbox/saveblue.XBX delete mode 100644 src/archutils/Xbox/savered.XBX delete mode 100644 src/archutils/Xbox/smicon.XBX delete mode 100644 src/sm-ssc_Xbox-net2003.sln diff --git a/src/BannerCache.cpp b/src/BannerCache.cpp index 8e60a2e2a8..ffcc4a3e6f 100644 --- a/src/BannerCache.cpp +++ b/src/BannerCache.cpp @@ -230,17 +230,13 @@ struct BannerTexture: public RageTexture m_iTextureWidth = m_iImageWidth = m_pImage->w; m_iTextureHeight = m_iImageHeight = m_pImage->h; - /* Find a supported texture format. If it happens to match the stored - * file, we won't have to do any conversion here, and that'll happen often - * with paletted images. */ -#if !defined(XBOX) + /* Find a supported texture format. If it happens to match the stored + * file, we won't have to do any conversion here, and that'll happen + * often with paletted images. */ PixelFormat pf = m_pImage->format->BitsPerPixel == 8? PixelFormat_PAL: PixelFormat_RGB5A1; if( !DISPLAY->SupportsTextureFormat(pf) ) pf = PixelFormat_RGBA4; -#else - // xbox display currently supports only rgba8 - PixelFormat pf = PixelFormat_RGBA8; -#endif + ASSERT( DISPLAY->SupportsTextureFormat(pf) ); ASSERT(m_pImage); diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index 70b4d84eeb..65796fcbac 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -27,7 +27,7 @@ struct Impl }; static Impl *pImpl = NULL; -#if defined(_MSC_VER) || defined (_XBOX) +#if defined(_MSC_VER) /* "interaction between '_setjmp' and C++ object destruction is non-portable" * We don't care; we'll throw a fatal exception immediately anyway. */ #pragma warning (disable : 4611) @@ -973,9 +973,7 @@ LuaFunction( VersionTime, (RString) version_time ); static RString GetOSName() { RString system; - #if defined(XBOX) - system = "Xbox"; - #elif defined(WIN32) && !defined(XBOX) + #if defined(WIN32) system = "Windows"; #elif defined(LINUX) system = "Linux"; diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index b977eb03b1..8dfb6974fd 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -17,16 +17,11 @@ #include #include -#if !defined(XBOX) #include "archutils/Win32/GraphicsWindow.h" -#else -#include "archutils/Xbox/GraphicsWindow.h" -#include "archutils/Xbox/VirtualMemory.h" -#endif // Static libraries // load Windows D3D8 dynamically -#if defined(_MSC_VER) && !defined(_XBOX) +#if defined(_MSC_VER) #pragma comment(lib, "D3dx8.lib") #pragma comment(lib, "Dxerr8.lib") #endif @@ -42,9 +37,7 @@ RString GetErrorString( HRESULT hr ) } // Globals -#if !defined(XBOX) HMODULE g_D3D8_Module = NULL; -#endif LPDIRECT3D8 g_pd3d = NULL; LPDIRECT3DDEVICE8 g_pd3dDevice = NULL; D3DCAPS8 g_DeviceCaps; @@ -84,12 +77,8 @@ static void SetPalette( unsigned TexResource ) } // Load it. -#if !defined(XBOX) TexturePalette& pal = g_TexResourceToTexturePalette[TexResource]; g_pd3dDevice->SetPaletteEntries( iPalIndex, pal.p ); -#else - ASSERT(0); -#endif g_TexResourceToPaletteIndex[TexResource] = iPalIndex; } @@ -106,11 +95,7 @@ static void SetPalette( unsigned TexResource ) break; } -#if !defined(XBOX) g_pd3dDevice->SetCurrentTexturePalette( iPalIndex ); -#else - ASSERT(0); -#endif } #define D3DFVF_RageSpriteVertex (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE|D3DFVF_TEX1) @@ -178,11 +163,7 @@ static D3DFORMAT D3DFORMATS[NUM_PixelFormat] = D3DFMT_A4R4G4B4, D3DFMT_A1R5G5B5, D3DFMT_X1R5G5B5, -#if defined(XBOX) - D3DFMT_UNKNOWN, // no RGB -#else D3DFMT_R8G8B8, -#endif D3DFMT_P8, D3DFMT_UNKNOWN, // no BGR D3DFMT_UNKNOWN, // no ABGR @@ -214,9 +195,7 @@ RString RageDisplay_D3D::Init( const VideoModeParams &p, bool bAllowUnaccelerate typedef IDirect3D8 * (WINAPI * Direct3DCreate8_t) (UINT SDKVersion); Direct3DCreate8_t pDirect3DCreate8; -#if defined(XBOX) - pDirect3DCreate8 = Direct3DCreate8; -#else + g_D3D8_Module = LoadLibrary("D3D8.dll"); if(!g_D3D8_Module) return D3D_NOT_INSTALLED.GetValue() + "\n" + D3D_URL; @@ -227,7 +206,6 @@ RString RageDisplay_D3D::Init( const VideoModeParams &p, bool bAllowUnaccelerate LOG->Trace( "Direct3DCreate8 not found" ); return D3D_NOT_INSTALLED.GetValue(); } -#endif g_pd3d = pDirect3DCreate8( D3D_SDK_VERSION ); if(!g_pd3d) @@ -294,13 +272,11 @@ RageDisplay_D3D::~RageDisplay_D3D() /* Even after we call Release(), D3D may still affect our window. It seems * to subclass the window, and never release it. Free the DLL after * destroying the window. */ -#if !defined(XBOX) if( g_D3D8_Module ) { FreeLibrary( g_D3D8_Module ); g_D3D8_Module = NULL; } -#endif } void RageDisplay_D3D::GetDisplayResolutions( DisplayResolutions &out ) const @@ -334,9 +310,7 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP) } if( iBPP == 32 || bWindowed ) { -#if !defined(XBOX) vBackBufferFormats.push_back( D3DFMT_R8G8B8 ); -#endif vBackBufferFormats.push_back( D3DFMT_X8R8G8B8 ); vBackBufferFormats.push_back( D3DFMT_A8R8G8B8 ); } @@ -383,13 +357,8 @@ RString SetD3DParams( bool &bNewDeviceOut ) HRESULT hr = g_pd3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, -#if !defined(XBOX) GraphicsWindow::GetHwnd(), D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, -#else - NULL, - D3DCREATE_HARDWARE_VERTEXPROCESSING, -#endif &g_d3dpp, &g_pd3dDevice ); if( FAILED(hr) ) @@ -506,11 +475,7 @@ static void SetPresentParametersFromVideoModeParams( const VideoModeParams &p, D pD3Dpp->BackBufferCount = 1; pD3Dpp->MultiSampleType = D3DMULTISAMPLE_NONE; pD3Dpp->SwapEffect = D3DSWAPEFFECT_DISCARD; -#if !defined(XBOX) pD3Dpp->hDeviceWindow = GraphicsWindow::GetHwnd(); -#else - pD3Dpp->hDeviceWindow = NULL; -#endif pD3Dpp->Windowed = p.windowed; pD3Dpp->EnableAutoDepthStencil = TRUE; pD3Dpp->AutoDepthStencilFormat = D3DFMT_D16; @@ -520,25 +485,9 @@ static void SetPresentParametersFromVideoModeParams( const VideoModeParams &p, D else pD3Dpp->FullScreen_PresentationInterval = p.vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; -#if !defined(XBOX) pD3Dpp->FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; if( !p.windowed && p.rate != REFRESH_DEFAULT ) pD3Dpp->FullScreen_RefreshRateInHz = p.rate; -#else - if( XGetVideoStandard() == XC_VIDEO_STANDARD_PAL_I ) - { - // Get supported video flags. - DWORD VideoFlags = XGetVideoFlags(); - - // Set pal60 if available. - if( VideoFlags & XC_VIDEO_FLAGS_PAL_60Hz ) - pD3Dpp->FullScreen_RefreshRateInHz = 60; - else - pD3Dpp->FullScreen_RefreshRateInHz = 50; - } - else - pD3Dpp->FullScreen_RefreshRateInHz = 60; -#endif pD3Dpp->Flags = 0; @@ -556,9 +505,6 @@ static void SetPresentParametersFromVideoModeParams( const VideoModeParams &p, D RString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDeviceOut ) { VideoModeParams p = _p; -#if defined(XBOX) - p.windowed = false; -#endif LOG->Warn( "RageDisplay_D3D::TryVideoMode( %d, %d, %d, %d, %d, %d )", p.windowed, p.width, p.height, p.bpp, p.rate, p.vsync ); if( FindBackBufferType( p.windowed, p.bpp ) == D3DFMT_UNKNOWN ) // no possible back buffer formats @@ -571,11 +517,6 @@ RString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDevi SetPresentParametersFromVideoModeParams( p, &g_d3dpp ); -#if defined(XBOX) - if( D3D__pDevice ) - g_pd3dDevice = D3D__pDevice; -#endif - // Display the window immediately, so we don't display the desktop ... while( 1 ) { @@ -612,14 +553,6 @@ void RageDisplay_D3D::ResolutionChanged() { //LOG->Warn( "RageDisplay_D3D::ResolutionChanged" ); -#if defined(XBOX) - VideoModeParams p = GetActualVideoModeParams(); - D3DVIEWPORT8 viewData = { 0, 0, p.width, p.height, 0.f, 1.f }; - g_pd3dDevice->SetViewport( &viewData ); - g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, - D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 ); -#endif - RageDisplay::ResolutionChanged(); } @@ -632,7 +565,6 @@ bool RageDisplay_D3D::BeginFrame() { GraphicsWindow::Update(); -#if !defined(XBOX) switch( g_pd3dDevice->TestCooperativeLevel() ) { case D3DERR_DEVICELOST: @@ -647,7 +579,6 @@ bool RageDisplay_D3D::BeginFrame() break; } } -#endif g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 ); @@ -670,16 +601,6 @@ void RageDisplay_D3D::EndFrame() bool RageDisplay_D3D::SupportsTextureFormat( PixelFormat pixfmt, bool realtime ) { -#if defined(XBOX) - /* Lazy... Xbox handles paletted textures completely differently than - * regular D3D. It's not worth writing a bunch of code to handle it. - * Paletted textures result in worse cache efficiency anyway (see "Xbox - * Palettized Texture Performance" in XDK). So, just force 32bit ARGB textures. - * -Chris - * This is also needed for XGSwizzleRect(). */ - return pixfmt == PixelFormat_RGBA8; -#endif - // Some cards (Savage) don't support alpha in palettes. // Don't allow paletted textures if this is the case. if( pixfmt == PixelFormat_PAL && !(g_DeviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) ) @@ -707,9 +628,6 @@ bool RageDisplay_D3D::SupportsThreadedRendering() RageSurface* RageDisplay_D3D::CreateScreenshot() { -#if defined(XBOX) - return NULL; -#else // Get the back buffer. IDirect3DSurface8* pSurface; g_pd3dDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pSurface ); @@ -756,7 +674,6 @@ RageSurface* RageDisplay_D3D::CreateScreenshot() pCopy->Release(); return SurfaceCopy; -#endif } VideoModeParams RageDisplay_D3D::GetActualVideoModeParams() const @@ -1429,15 +1346,6 @@ unsigned RageDisplay_D3D::CreateTexture( IDirect3DTexture8* pTex; hr = g_pd3dDevice->CreateTexture( power_of_two(img->w), power_of_two(img->h), 1, 0, D3DFORMATS[pixfmt], D3DPOOL_MANAGED, &pTex ); -#if defined(XBOX) - while(hr == E_OUTOFMEMORY) - { - if(!vmem_Manager.DecommitLRU()) - break; - hr = g_pd3dDevice->CreateTexture( power_of_two(img->w), power_of_two(img->h), 1, 0, D3DFORMATS[pixfmt], D3DPOOL_MANAGED, &pTex ); - } -#endif - if( FAILED(hr) ) RageException::Throw( "CreateTexture(%i,%i,%s) failed: %s", img->w, img->h, PixelFormatToString(pixfmt).c_str(), GetErrorString(hr).c_str() ); @@ -1490,27 +1398,6 @@ void RageDisplay_D3D::UpdateTexture( ASSERT( yoffset+height <= int(desc.Height) ); // Copy bits -#if defined(XBOX) - RageSurface *Texture = CreateSurface( width, height, 32, - Swap32BE( 0x0000FF00 ), - Swap32BE( 0x00FF0000 ), - Swap32BE( 0xFF000000 ), - Swap32BE( 0x000000FF ) ); - - RageSurfaceUtils::Blit( img, Texture, width, height ); - - // Xbox textures need to be swizzled - XGSwizzleRect( - Texture->pixels, // pSource, - Texture->pitch, // Pitch, - NULL, // pRect, - lr.pBits, // pDest, - Texture->w, // Width, - Texture->h, // Height, - NULL, // pPoint, - Texture->format->BytesPerPixel ); //BytesPerPixel - delete Texture; -#else int texpixfmt; for(texpixfmt = 0; texpixfmt < NUM_PixelFormat; ++texpixfmt) if(D3DFORMATS[texpixfmt] == desc.Format) break; @@ -1521,7 +1408,6 @@ void RageDisplay_D3D::UpdateTexture( RageSurfaceUtils::Blit( img, Texture, width, height ); delete Texture; -#endif pTex->UnlockRect( 0 ); } diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index 45fff020bb..dbb839c1ab 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -6,9 +6,9 @@ #include "RageUtil.h" #include -#if defined(_WINDOWS) || defined(_XBOX) +#if defined(_WINDOWS) #include "zlib/zlib.h" -#if defined(_MSC_VER) && !defined(_XBOX) +#if defined(_MSC_VER) #pragma comment(lib, "zlib/zdll.lib") #endif #elif defined(MACOSX) diff --git a/src/RageFileDriverDirect.cpp b/src/RageFileDriverDirect.cpp index cfab22525f..d6de2ebdc3 100644 --- a/src/RageFileDriverDirect.cpp +++ b/src/RageFileDriverDirect.cpp @@ -16,9 +16,7 @@ #include #else #include "archutils/Win32/ErrorStrings.h" -#if !defined(_XBOX) #include -#endif // !defined(_XBOX) #include #endif // !defined(WIN32) diff --git a/src/RageFileDriverDirectHelpers.cpp b/src/RageFileDriverDirectHelpers.cpp index dd7a65631c..fd8aa8d048 100644 --- a/src/RageFileDriverDirectHelpers.cpp +++ b/src/RageFileDriverDirectHelpers.cpp @@ -12,57 +12,13 @@ #include #include #else -#if !defined(_XBOX) #include -#endif #include #endif -#if defined(_XBOX) -/* Wrappers for low-level file functions, to work around Xbox issues: */ -int DoMkdir( const RString &sPath, int perm ) -{ - return mkdir( DoPathReplace(sPath), perm ); -} - -int DoOpen( const RString &sPath, int flags, int perm ) -{ - return open( DoPathReplace(sPath), flags, perm ); -} - -int DoStat( const RString &sPath, struct stat *st ) -{ - return stat( DoPathReplace(sPath), st ); -} - -int DoRename( const RString &sOldPath, const RString &sNewPath ) -{ - return rename( DoPathReplace(sOldPath), DoPathReplace(sNewPath) ); -} - -int DoRemove( const RString &sPath ) -{ - return remove( DoPathReplace(sPath) ); -} - -int DoRmdir( const RString &sPath ) -{ - return rmdir( DoPathReplace(sPath) ); -} - -HANDLE DoFindFirstFile( const RString &sPath, WIN32_FIND_DATA *fd ) -{ - return FindFirstFile( DoPathReplace(sPath), fd ); -} - -#endif RString DoPathReplace(const RString &sPath) { RString TempPath = sPath; -#if defined(XBOX) - TempPath.Replace( "//", "\\" ); - TempPath.Replace( "/", "\\" ); -#endif return TempPath; } @@ -72,9 +28,9 @@ static bool WinMoveFileInternal( const RString &sOldPath, const RString &sNewPat { static bool Win9x = false; - /* Windows botches rename: it returns error if the file exists. In NT, + /* Windows botches rename: it returns error if the file exists. In NT, * we can use MoveFileEx( new, old, MOVEFILE_REPLACE_EXISTING ) (though I - * don't know if it has similar atomicity guarantees to rename). In + * don't know if it has similar atomicity guarantees to rename). In * 9x, we're screwed, so just delete any existing file (we aren't going * to be robust on 9x anyway). */ if( !Win9x ) @@ -92,7 +48,7 @@ static bool WinMoveFileInternal( const RString &sOldPath, const RString &sNewPat if( MoveFile( sOldPath, sNewPath ) ) return true; - + if( GetLastError() != ERROR_ALREADY_EXISTS ) return false; @@ -118,15 +74,15 @@ bool WinMoveFile( RString sOldPath, RString sNewPath ) /* mkdir -p. Doesn't fail if Path already exists and is a directory. */ bool CreateDirectories( RString Path ) { - /* XXX: handle "//foo/bar" paths in Windows */ + // XXX: handle "//foo/bar" paths in Windows vector parts; RString curpath; - /* If Path is absolute, add the initial slash ("ignore empty" will remove it). */ + // If Path is absolute, add the initial slash ("ignore empty" will remove it). if( Path.Left(1) == "/" ) curpath = "/"; - /* Ignore empty, so eg. "/foo/bar//baz" doesn't try to create "/foo/bar" twice. */ + // Ignore empty, so eg. "/foo/bar//baz" doesn't try to create "/foo/bar" twice. split( Path, "/", parts, true ); for(unsigned i = 0; i < parts.size(); ++i) @@ -174,7 +130,7 @@ bool CreateDirectories( RString Path ) WARN( ssprintf("Couldn't create %s: %s", curpath.c_str(), strerror(errno)) ); return false; } - + return true; } @@ -189,10 +145,10 @@ void DirectFilenameDB::SetRoot( RString root_ ) { root = root_; - /* "\abcd\" -> "/abcd/": */ + // "\abcd\" -> "/abcd/": root.Replace( "\\", "/" ); - /* "/abcd/" -> "/abcd": */ + // "/abcd/" -> "/abcd": if( root.Right(1) == "/" ) root.erase( root.size()-1, 1 ); } @@ -210,7 +166,7 @@ void DirectFilenameDB::CacheFile( const RString &sPath ) } while( !pFileSet->m_bFilled ) m_Mutex.Wait(); - + #if defined(WIN32) // There is almost surely a better way to do this WIN32_FIND_DATA fd; @@ -224,12 +180,12 @@ void DirectFilenameDB::CacheFile( const RString &sPath ) f.dir = !!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); f.size = fd.nFileSizeLow; f.hash = fd.ftLastWriteTime.dwLowDateTime; - + pFileSet->files.insert( f ); FindClose( hFind ); #else File f( Basename(sPath) ); - + struct stat st; if( DoStat(root+sPath, &st) == -1 ) { @@ -237,7 +193,7 @@ void DirectFilenameDB::CacheFile( const RString &sPath ) // If it's a broken symlink, ignore it. Otherwise, warn. // Huh? WARN( ssprintf("File '%s' is gone! (%s)", - sPath.c_str(), strerror(iError)) ); + sPath.c_str(), strerror(iError)) ); } else { @@ -255,17 +211,10 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path ) { RString sPath = path; -#if defined(XBOX) - /* Xbox doesn't handle path names which end with ".", which are used when using an - * alternative song directory */ - if( sPath.size() > 0 && sPath.Right(1) == "." ) - sPath.erase( sPath.size() - 1 ); -#endif - - /* Resolve path cases (path/Path -> PATH/path). */ + // Resolve path cases (path/Path -> PATH/path). ResolvePath( sPath ); - fs.age.GetDeltaTime(); /* reset */ + fs.age.GetDeltaTime(); // reset fs.files.clear(); #if defined(WIN32) diff --git a/src/RageFileDriverDirectHelpers.h b/src/RageFileDriverDirectHelpers.h index 0a3dae233d..91b2f0d9d4 100644 --- a/src/RageFileDriverDirectHelpers.h +++ b/src/RageFileDriverDirectHelpers.h @@ -5,15 +5,6 @@ #include -#if defined(_XBOX) -int DoMkdir( const RString &sPath, int perm ); -int DoOpen( const RString &sPath, int flags, int perm ); -int DoStat( const RString &sPath, struct stat *st ); -int DoRename( const RString &sOldPath, const RString &sNewPath ); -int DoRemove( const RString &sPath ); -int DoRmdir( const RString &sPath ); -HANDLE DoFindFirstFile( const RString &sPath, WIN32_FIND_DATA *fd ); -#else #define DoOpen open #define DoStat stat #define DoMkdir mkdir @@ -21,7 +12,6 @@ HANDLE DoFindFirstFile( const RString &sPath, WIN32_FIND_DATA *fd ); #define DoRename rename #define DoRemove remove #define DoRmdir rmdir -#endif RString DoPathReplace( const RString &sPath ); #if defined(WIN32) diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 49740eccbe..6219b6288c 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -12,7 +12,7 @@ #include -#if defined(WIN32) && !defined(XBOX) +#if defined(WIN32) #include #elif defined(UNIX) || defined(MACOSX) #include @@ -174,11 +174,7 @@ static RageFileDriverMountpoints *g_Mountpoints = NULL; static RString GetDirOfExecutable( RString argv0 ) { -#ifdef _XBOX - // ???: what if it's not running from D:\? - return "D:\\"; -#else - /* argv[0] can be wrong in most OS's; try to avoid using it. */ + // argv[0] can be wrong in most OS's; try to avoid using it. RString sPath; #if defined(WIN32) @@ -241,7 +237,6 @@ static RString GetDirOfExecutable( RString argv0 ) #endif } return sPath; -#endif } static void ChangeToDirOfExecutable( const RString &argv0 ) diff --git a/src/RageLog.cpp b/src/RageLog.cpp index 8684fc6502..5c517f209e 100644 --- a/src/RageLog.cpp +++ b/src/RageLog.cpp @@ -175,7 +175,7 @@ void RageLog::SetShowLogOutput( bool show ) { m_bShowLogOutput = show; -#if defined(WIN32) && !defined(_XBOX) +#if defined(WIN32) if( m_bShowLogOutput ) { // create a new console window and attach standard handles diff --git a/src/RageMath.cpp b/src/RageMath.cpp index 6edff8df4c..dd209974cc 100644 --- a/src/RageMath.cpp +++ b/src/RageMath.cpp @@ -112,7 +112,7 @@ RageMatrix RageMatrix::GetTranspose() const void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatrix* pB ) { -//#if defined(_WINDOWS) || defined(_XBOX) +//#if defined(_WINDOWS) // // <30 cycles for theirs versus >100 for ours. // D3DXMatrixMultiply( (D3DMATRIX*)pOut, (D3DMATRIX*)pA, (D3DMATRIX*)pB ); //#else diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 281da9d38a..0cb9e5940e 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -9,24 +9,16 @@ #include #include -#if defined(_WINDOWS) || defined(_XBOX) || defined(MACOSX) +#if defined(_WINDOWS) || defined(MACOSX) #include "mad-0.15.1b/mad.h" #ifdef _MSC_VER -#ifdef _XBOX -#ifdef DEBUG -#pragma comment(lib, "mad-0.15.1b/xboxmad/debug/xboxmad.lib") -#else -#pragma comment(lib, "mad-0.15.1b/xboxmad/Release/xboxmad.lib") -#endif // DEBUG -#else #pragma comment(lib, "mad-0.15.1b/msvc++/Release/libmad.lib") -#endif // _XBOX #endif //_MSC_VER #else #include #endif // _WINDOWS -/* ID3 code from libid3: */ +// ID3 code from libid3: enum tagtype { TAGTYPE_NONE = 0, TAGTYPE_ID3V1, diff --git a/src/RageSurface_Load_JPEG.cpp b/src/RageSurface_Load_JPEG.cpp index 353921e740..3db75aa0e4 100644 --- a/src/RageSurface_Load_JPEG.cpp +++ b/src/RageSurface_Load_JPEG.cpp @@ -7,24 +7,15 @@ #include -// Don't let jpeglib.h define the boolean type on Xbox. -#if defined(_XBOX) -# define HAVE_BOOLEAN -#endif - #if defined(WIN32) -/* work around namespace bugs in win32/libjpeg: */ +// work around namespace bugs in win32/libjpeg: #define XMD_H #undef FAR #include "libjpeg/jpeglib.h" #include "libjpeg/jerror.h" #if defined(_MSC_VER) -#if !defined(XBOX) #pragma comment(lib, "libjpeg/jpeg.lib") -#else -#pragma comment(lib, "libjpeg/xboxjpeg.lib") -#endif #endif #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ diff --git a/src/RageSurface_Load_PNG.cpp b/src/RageSurface_Load_PNG.cpp index dd7014bf15..4572fc63ae 100644 --- a/src/RageSurface_Load_PNG.cpp +++ b/src/RageSurface_Load_PNG.cpp @@ -6,25 +6,16 @@ #include "RageSurface.h" -#if defined(_WINDOWS) || defined(_XBOX) +#if defined(_WINDOWS) # include "libpng/include/png.h" # if defined(_MSC_VER) -# if defined(_XBOX) -# pragma comment(lib, "libpng/lib/xboxlibpng.lib") -# else -# pragma comment(lib, "libpng/lib/libpng.lib") -# endif +# pragma comment(lib, "libpng/lib/libpng.lib") # pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ # endif // _MSC_VER #else # include #endif -#if defined(_XBOX) -# include // for alloca -# include "archutils/Xbox/VirtualMemory.h" -#endif - namespace { void RageFile_png_read( png_struct *png, png_byte *p, png_size_t size ) @@ -80,16 +71,6 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro png_struct *png = png_create_read_struct( PNG_LIBPNG_VER_STRING, &error, PNG_Error, PNG_Warning ); -#if defined(XBOX) - while(png == NULL) - { - if(!vmem_Manager.DecommitLRU()) - break; - - png = png_create_read_struct( PNG_LIBPNG_VER_STRING, &error, PNG_Error, PNG_Warning ); - } -#endif - if( png == NULL ) { sprintf( errorbuf, "creating png_create_read_struct failed"); diff --git a/src/RageSurface_Save_JPEG.cpp b/src/RageSurface_Save_JPEG.cpp index 1ea4c34178..0348d620eb 100644 --- a/src/RageSurface_Save_JPEG.cpp +++ b/src/RageSurface_Save_JPEG.cpp @@ -6,7 +6,7 @@ #include "RageUtil.h" #include "RageFile.h" -#undef FAR /* fix for VC */ +#undef FAR // fix for VC /** @brief A helper to get the jpeg lib. */ namespace jpeg { @@ -16,16 +16,11 @@ namespace jpeg } } -/* Pull in JPEG library here. */ -#ifdef _XBOX -#pragma comment(lib, "libjpeg/xboxjpeg.lib") -#elif defined _MSC_VER +// Pull in JPEG library here. +#if defined _MSC_VER #pragma comment(lib, "libjpeg/jpeg.lib") #endif - - - #define OUTPUT_BUFFER_SIZE 4096 typedef struct { diff --git a/src/RageSurface_Save_PNG.cpp b/src/RageSurface_Save_PNG.cpp index f971760fbd..797bfec8eb 100644 --- a/src/RageSurface_Save_PNG.cpp +++ b/src/RageSurface_Save_PNG.cpp @@ -6,14 +6,10 @@ #include "RageLog.h" #include "RageUtil.h" -#if defined(WINDOWS) || defined(_XBOX) +#if defined(WINDOWS) #include "libpng/include/png.h" #if defined(_MSC_VER) -# if defined(_XBOX) -# pragma comment(lib, "libpng/lib/xboxlibpng.lib") -# else -# pragma comment(lib, "libpng/lib/libpng.lib") -# endif +# pragma comment(lib, "libpng/lib/libpng.lib") #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ #endif #else diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 15257851ff..a6428a7f6b 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -967,14 +967,10 @@ bool GetCommandlineArgument( const RString &option, RString *argument, int iInde RString GetCwd() { -#ifdef _XBOX - return SYS_BASE_PATH; -#else char buf[PATH_MAX]; bool ret = getcwd(buf, PATH_MAX) != NULL; ASSERT(ret); return buf; -#endif } /* diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 8a17a27059..213cc01028 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -94,35 +94,6 @@ static const char *EditStateNames[] = { XToString( EditState ); LuaXType( EditState ); -#if defined(XBOX) -void ScreenEdit::InitEditMappings() -{ - /* XXX: fill this in */ - m_EditMappingsDeviceInput.Clear(); - - switch( EDIT_MODE.GetValue() ) - { - case EditMode_Practice: - m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_PREV_MEASURE][0] = DeviceInput(DEVICE_JOY1, JOY_HAT_UP); - m_EditMappingsMenuButton.button[EDIT_BUTTON_SCROLL_PREV_MEASURE][0] = GAME_BUTTON_UP; - m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_NEXT_MEASURE][0] = DeviceInput(DEVICE_JOY1, JOY_HAT_DOWN); - m_EditMappingsMenuButton.button[EDIT_BUTTON_SCROLL_NEXT_MEASURE][0] = GAME_BUTTON_DOWN; - break; - default: - m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_UP_LINE][0] = DeviceInput(DEVICE_JOY1, JOY_HAT_UP); - m_EditMappingsMenuButton.button[EDIT_BUTTON_SCROLL_UP_LINE][0] = GAME_BUTTON_UP; - m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_DOWN_LINE][0] = DeviceInput(DEVICE_JOY1, JOY_HAT_DOWN); - m_EditMappingsMenuButton.button[EDIT_BUTTON_SCROLL_DOWN_LINE][0] = GAME_BUTTON_DOWN; - break; - } - - // Map these to the triggers: L goes up, R goes down. - m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_UP_PAGE][0] = DeviceInput(DEVICE_JOY1, JOY_BUTTON_7); - //m_EditMappingsMenuButton.button[EDIT_BUTTON_SCROLL_UP_PAGE][0] = GAME_BUTTON_UPLEFT; - m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_DOWN_PAGE][0] = DeviceInput(DEVICE_JOY1, JOY_BUTTON_8); - //m_EditMappingsMenuButton.button[EDIT_BUTTON_SCROLL_DOWN_PAGE][0] = GAME_BUTTON_UPRIGHT; -} -#else void ScreenEdit::InitEditMappings() { m_EditMappingsDeviceInput.Clear(); @@ -268,7 +239,7 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); // m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); - + m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_LEFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cn); m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_RIGHT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm); @@ -291,7 +262,7 @@ void ScreenEdit::InitEditMappings() m_EditMappingsMenuButton.button[EDIT_BUTTON_OPEN_EDIT_MENU][1] = GAME_BUTTON_BACK; m_EditMappingsDeviceInput.button[EDIT_BUTTON_OPEN_AREA_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ENTER); m_EditMappingsDeviceInput.button[EDIT_BUTTON_OPEN_INPUT_HELP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_F1); - + m_EditMappingsDeviceInput.button[EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cb); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); @@ -309,7 +280,7 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_ADJUST_FINE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_ADJUST_FINE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); - + m_EditMappingsDeviceInput.button[EDIT_BUTTON_SAVE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_Cs); #if defined(MACOSX) /* use cmd */ @@ -322,10 +293,10 @@ void ScreenEdit::InitEditMappings() #endif m_EditMappingsDeviceInput.button[EDIT_BUTTON_UNDO][1] = DeviceInput(DEVICE_KEYBOARD, KEY_Cu); - + // Switch players, if it makes sense to do so. m_EditMappingsDeviceInput.button[EDIT_BUTTON_SWITCH_PLAYERS][0] = DeviceInput(DEVICE_KEYBOARD, KEY_SLASH); - + m_PlayMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); m_PlayMappingsMenuButton.button[EDIT_BUTTON_RETURN_TO_EDIT][1] = GAME_BUTTON_BACK; @@ -346,8 +317,6 @@ void ScreenEdit::InitEditMappings() m_RecordPausedMappingsDeviceInput.button[EDIT_BUTTON_UNDO][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cu); } -#endif - /* Given a DeviceInput that was just depressed, return an active edit function. */ EditButton ScreenEdit::DeviceToEdit( const DeviceInput &DeviceI ) const { diff --git a/src/ScreenMapControllers.cpp b/src/ScreenMapControllers.cpp index ed6b3dcacd..d2ed7b085e 100644 --- a/src/ScreenMapControllers.cpp +++ b/src/ScreenMapControllers.cpp @@ -240,28 +240,6 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) int button = input.DeviceI.button; -#ifdef _XBOX - if( m_WaitingForPress.IsZero() && input.DeviceI.device == DEVICE_JOY1 ) - { - // map the xbox controller buttons to the keyboard equivalents - if( input.DeviceI.button == JOY_HAT_LEFT ) - button = KEY_LEFT; - else if( input.DeviceI.button == JOY_HAT_RIGHT ) - button = KEY_RIGHT; - else if( input.DeviceI.button == JOY_HAT_UP ) - button = KEY_UP; - else if( input.DeviceI.button == JOY_HAT_DOWN ) - button = KEY_DOWN; - else if( input.DeviceI.button == JOY_AUX_1 ) - button = KEY_ENTER; - else if( input.DeviceI.button == JOY_AUX_2 ) - button = KEY_ESC; - else if( input.DeviceI.button == JOY_BUTTON_1 || input.DeviceI.button == JOY_BUTTON_2 || - input.DeviceI.button == JOY_BUTTON_3 || input.DeviceI.button == JOY_BUTTON_4 ) - button = KEY_DEL; - } -#endif - /* TRICKY: Some adapters map the PlayStation digital d-pad to both axes and * buttons. We want buttons to be used for any mappings where possible * because presses of buttons aren't mutually exclusive and presses of axes @@ -293,11 +271,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) m_DeviceIToMap = input.DeviceI; } } -#ifdef _XBOX - else if( input.DeviceI.device == DEVICE_JOY1 ) -#else else if( input.DeviceI.device == DEVICE_KEYBOARD ) -#endif { switch( button ) { @@ -310,10 +284,8 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) * pressed up on the joypad. */ case KEY_DEL: -#ifndef _XBOX case KEY_SPACE: case KEY_BACK: // Clear the selected input mapping. -#endif if( m_iCurButton == (int) m_KeysToMap.size() ) break; // on exit diff --git a/src/ScreenServiceAction.h b/src/ScreenServiceAction.h index 0a19dc3e0c..35011f0106 100644 --- a/src/ScreenServiceAction.h +++ b/src/ScreenServiceAction.h @@ -3,11 +3,6 @@ #ifndef ScreenServiceAction_H #define ScreenServiceAction_H -//There's a FAILED macro somewhere in winerror.h, which gets included with Xbox. -#if defined(_XBOX) -#undef FAILED -#endif - #include "ScreenPrompt.h" class ScreenServiceAction : public ScreenPrompt diff --git a/src/ScreenTestFonts.h b/src/ScreenTestFonts.h index d966f85f36..16c9e2fd19 100644 --- a/src/ScreenTestFonts.h +++ b/src/ScreenTestFonts.h @@ -3,10 +3,6 @@ #ifndef SCREEN_TEST_FONTS_H #define SCREEN_TEST_FONTS_H -#if defined(_XBOX) -#undef TEXT -#endif - #include "Screen.h" #include "BitmapText.h" #include "Quad.h" diff --git a/src/SongCacheIndex.cpp b/src/SongCacheIndex.cpp index 482ed06ed6..fb0d588adc 100644 --- a/src/SongCacheIndex.cpp +++ b/src/SongCacheIndex.cpp @@ -50,12 +50,7 @@ RString SongCacheIndex::GetCacheFilePath( const RString &sGroup, const RString & for( size_t pos = s.find_first_of(invalid); pos != RString::npos; pos = s.find_first_of(invalid, pos) ) s[pos] = '_'; // CACHE_DIR ends with a /. -#if defined(XBOX) - // Use CRC32 to make fatx compatible filenames. - return ssprintf( "%s%s/%X", SpecialFiles::CACHE_DIR.c_str(), sGroup.c_str(), GetHashForString(s)); -#else return ssprintf( "%s%s/%s", SpecialFiles::CACHE_DIR.c_str(), sGroup.c_str(), s.c_str() ); -#endif } SongCacheIndex::SongCacheIndex() diff --git a/src/StepMania.cpp b/src/StepMania.cpp index c0449cc0ae..0f032907f8 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -68,27 +68,12 @@ #include "SpecialFiles.h" #include "Profile.h" -#if defined(XBOX) -#include "Archutils/Xbox/VirtualMemory.h" -#endif - -#if defined(WIN32) && !defined(XBOX) +#if defined(WIN32) #include #endif -// since the XBOX SDK only works with VS.Net 2003, this doesn't exist yet. -// see http://old.nabble.com/Linking-Error-with-MSVC%2B%2B-6.0-td21608559.html -// for more information. -aj -#if defined(XBOX) - extern "C" - { - int _get_output_format( void ){ return 0; } - } -#endif - static Preference g_bAllowMultipleInstances( "AllowMultipleInstances", false ); - void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut ) { /* We can't rely on there being full-screen video modes that give us square @@ -469,14 +454,6 @@ struct VideoCardDefaults } } const g_VideoCardDefaults[] = { - VideoCardDefaults( - "Xbox", - "d3d", - 600,400, - 32,32,32, - 2048, - true - ), VideoCardDefaults( "Voodoo *5", "d3d,opengl", // received 3 reports of opengl crashing. -Chris @@ -636,8 +613,6 @@ static RString GetVideoDriverName() { #if defined(_WINDOWS) return GetPrimaryVideoDriverName(); -#elif defined(_XBOX) - return "Xbox"; #else return "OpenGL"; #endif @@ -879,11 +854,8 @@ static void MountTreeOfZips( const RString &dir ) RString path = dirs.back(); dirs.pop_back(); -#if !defined(XBOX) - // Xbox doesn't detect directories properly, so we'll ignore this if( !IsADirectory(path) ) continue; -#endif vector zips; GetDirListing( path + "/*.zip", zips, false, true ); @@ -997,10 +969,6 @@ int main(int argc, char* argv[]) ApplyLogPreferences(); -#if defined(XBOX) - vmem_Manager.Init(); -#endif - WriteLogHeader(); // Set up alternative filesystem trees. diff --git a/src/StepManiaXbox-2003.vcproj b/src/StepManiaXbox-2003.vcproj deleted file mode 100644 index e3cdae7552..0000000000 --- a/src/StepManiaXbox-2003.vcproj +++ /dev/null @@ -1,2783 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Texture Font Generator/Utils.cpp b/src/Texture Font Generator/Utils.cpp index 125334c2e3..338badef2d 100644 --- a/src/Texture Font Generator/Utils.cpp +++ b/src/Texture Font Generator/Utils.cpp @@ -100,22 +100,10 @@ void GetBounds( const Surface *pSurf, RECT *out ) } - - - - - - - - #pragma include_alias( "zlib/zlib.h", "../zlib/zlib.h" ) #include "../libpng/include/png.h" #if defined(_MSC_VER) -# if defined(_XBOX) -# pragma comment(lib, "../libpng/lib/xboxlibpng.lib") -# else -# pragma comment(lib, "../libpng/lib/libpng.lib") -# endif +# pragma comment(lib, "../libpng/lib/libpng.lib") #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ #endif diff --git a/src/arch/ArchHooks/ArchHooks_Xbox.cpp b/src/arch/ArchHooks/ArchHooks_Xbox.cpp deleted file mode 100644 index ff4c37400b..0000000000 --- a/src/arch/ArchHooks/ArchHooks_Xbox.cpp +++ /dev/null @@ -1,227 +0,0 @@ -#include "global.h" -#include "ArchHooks_Xbox.h" -#include "dsound.h" // for timeGetTime -#include "archutils/Xbox/custom_launch_params.h" // for XGetCustomLaunchData -#include "archutils/Xbox/VirtualMemory.h" - -#include // for XNetStartup -#include // for _set_new_handler and _set_new_mode - -typedef struct _UNICODE_STRING {unsigned short Length; unsigned short MaximumLength; PSTR Buffer;} UNICODE_STRING,*PUNICODE_STRING; -extern "C" XBOXAPI DWORD WINAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,IN PUNICODE_STRING DeviceName); - -static bool g_bTimerInitialized; -static DWORD g_iStartTime; - -static void InitTimer() -{ - if( g_bTimerInitialized ) - return; - g_bTimerInitialized = true; - - g_iStartTime = timeGetTime(); -} - -int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate ) -{ - if( !g_bTimerInitialized ) - InitTimer(); - - int64_t ret = (timeGetTime() - g_iStartTime) * int64_t(1000); - if( bAccurate ) - { - ret = FixupTimeIfLooped( ret ); - ret = FixupTimeIfBackwards( ret ); - } - - return ret; -} - -void MountDriveLetter(char drive, char* szDevice, char* szDir) -{ - char szSourceDevice[256]; - char szDestinationDrive[16]; - sprintf(szDestinationDrive, "\\??\\%c:", drive); - sprintf(szSourceDevice,"\\Device\\%s",szDevice); - if (*szDir != 0x00 && *szDir != '\\') - { - strcat(szSourceDevice, "\\"); - strcat(szSourceDevice, szDir); - } - - UNICODE_STRING LinkName = - { - strlen(szDestinationDrive), - strlen(szDestinationDrive) + 1, - szDestinationDrive - }; - UNICODE_STRING DeviceName = - { - strlen(szSourceDevice), - strlen(szSourceDevice) + 1, - szSourceDevice - }; - - IoCreateSymbolicLink(&LinkName, &DeviceName); -} - -void MountDrives() -{ - MountDriveLetter('A', "Cdrom0", "\\"); - MountDriveLetter('E', "Harddisk0\\Partition1", "\\"); - MountDriveLetter('C', "Harddisk0\\Partition2", "\\"); - MountDriveLetter('X', "Harddisk0\\Partition3", "\\"); - MountDriveLetter('Y', "Harddisk0\\Partition4", "\\"); - MountDriveLetter('F', "Harddisk0\\Partition6", "\\"); - MountDriveLetter('G', "Harddisk0\\Partition7", "\\"); -} - -bool SetupNetwork() -{ -#if !defined(WITHOUT_NETWORKING) - XNetStartupParams xnsp; - memset(&xnsp, 0, sizeof(xnsp)); - xnsp.cfgSizeOfStruct = sizeof(XNetStartupParams); - xnsp.cfgFlags = XNET_STARTUP_BYPASS_SECURITY; - - INT err = XNetStartup(&xnsp); - - return err == 0; -#else - return true; -#endif -} - -// if Xbox has 128 meg RAM make sure its used -void EnableExtraRAM() -{ - LARGE_INTEGER regVal; - - // Verify that we have 128 megs available - MEMORYSTATUS memStatus; - GlobalMemoryStatus( &memStatus ); - if( memStatus.dwTotalPhys < (100 * 1024 * 1024) ) - return; - - // Grab the existing default type (0x02FF) - READMSRREG( 0x02FF, ®Val ); - - // Set the default to WriteBack (0x06) - regVal.LowPart = (regVal.LowPart & ~0xFF) | 0x06; - WRITEMSRREG( 0x02FF, regVal ); -} - -void InitDevices() -{ - XDEVICE_PREALLOC_TYPE xdpt[] = {{XDEVICE_TYPE_GAMEPAD, 4}, {XDEVICE_TYPE_MEMORY_UNIT, 2}}; - XInitDevices( sizeof(xdpt) / sizeof(XDEVICE_PREALLOC_TYPE), xdpt ); -} - -ArchHooks_Xbox::ArchHooks_Xbox() -{ - _set_new_handler(NoMemory); - _set_new_mode(1); - SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER) CheckPageFault); - - XGetCustomLaunchData(); - - // mount A to DVD, C, E, F, G, X, and Y to the harddisk - MountDrives(); - - SetupNetwork(); - - EnableExtraRAM(); - - InitDevices(); -} - -static RString XLangID( DWORD Lang ) -{ - switch(Lang) - { - case XC_LANGUAGE_JAPANESE:return "JA"; - case XC_LANGUAGE_GERMAN:return "DE"; - case XC_LANGUAGE_FRENCH:return "FR"; - case XC_LANGUAGE_SPANISH:return "ES"; - case XC_LANGUAGE_ITALIAN:return "IT"; - case XC_LANGUAGE_KOREAN:return "KO"; - case XC_LANGUAGE_TCHINESE:return "ZH"; - case XC_LANGUAGE_PORTUGUESE:return "PT"; - default: - case XC_LANGUAGE_ENGLISH: return "EN"; - } -} - -RString ArchHooks::GetPreferredLanguage() -{ - return XLangID( XGetLanguage() ); -} - -ArchHooks_Xbox::~ArchHooks_Xbox() -{ - // We only want to reboot the Xbox in a software manner. - XLaunchNewImage( NULL, NULL ); -} - -void ArchHooks_Xbox::DumpDebugInfo() -{ - -} - -float ArchHooks_Xbox::GetDisplayAspectRatio() -{ - // xxx: does this take into account system settings? -aj - float fDisplayAspectRatio = 4.0 / 3.0; - IDirect3DSurface8 *pBackBuffer = NULL; - if( D3D__pDevice->GetBackBuffer( -1, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer) == D3D_OK ) - { - D3DSURFACE_DESC Desc; - if( pBackBuffer->GetDesc(&Desc) == D3D_OK ) - { - fDisplayAspectRatio = (float)Desc.Width / (float)Desc.Height; - } - pBackBuffer->Release(); - } - return fDisplayAspectRatio; -} - -#include "RageFileManager.h" - -void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable ) -{ - FILEMAN->Mount( "dir", "D:\\", "/" ); -} - -void ArchHooks::MountUserFilesystems( const RString &sDirOfExecutable ) -{ - // Mount everything game-writable (not counting the editor) to the game title persistent data region ( /E/TDATA/33342530/ ) - FILEMAN->Mount( "dir", "T:/Cache", "/Cache" ); - FILEMAN->Mount( "dir", "T:/Logs", "/Logs" ); - FILEMAN->Mount( "dir", "T:/Save", "/Save" ); - FILEMAN->Mount( "dir", "T:/Screenshots", "/Screenshots" ); -} - -/* - * (c) 2003-2004 Glenn Maynard, Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/ArchHooks/ArchHooks_Xbox.h b/src/arch/ArchHooks/ArchHooks_Xbox.h deleted file mode 100644 index a1e349db8d..0000000000 --- a/src/arch/ArchHooks/ArchHooks_Xbox.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef ARCH_HOOKS_XBOX_H -#define ARCH_HOOKS_XBOX_H - -#include "ArchHooks.h" -class RageMutex; - -class ArchHooks_Xbox: public ArchHooks -{ -public: - ArchHooks_Xbox(); - ~ArchHooks_Xbox(); - RString GetArchName() { return "Xbox"; } - void DumpDebugInfo(); - float GetDisplayAspectRatio(); - - //void MountInitialFilesystems( const RString &sDirOfExecutable ); -}; - -// XXX: This stuff doesn't belong here. Hide it in ArchHooks. - -// Read a 64 bit MSR register -inline void READMSRREG( UINT32 reg, LARGE_INTEGER *val ) -{ -UINT32 lowPart, highPart; - __asm - { - mov ecx, reg - rdmsr - mov lowPart, eax - mov highPart, edx - }; - - val->LowPart = lowPart; - val->HighPart = highPart; -} - -// Write a 64 bit MSR register -inline void WRITEMSRREG( UINT32 reg, LARGE_INTEGER val ) -{ - __asm - { - mov ecx, reg - mov eax, val.LowPart - mov edx, val.HighPart - wrmsr - }; -} - -#ifdef ARCH_HOOKS -#error "More than one ArchHooks selected!" -#endif -#define ARCH_HOOKS ArchHooks_Xbox - -#endif -/* - * (c) 2002-2004 Glenn Maynard, Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/InputHandler/InputHandler_Xbox.cpp b/src/arch/InputHandler/InputHandler_Xbox.cpp deleted file mode 100644 index 1c2f870456..0000000000 --- a/src/arch/InputHandler/InputHandler_Xbox.cpp +++ /dev/null @@ -1,232 +0,0 @@ -#include "global.h" -#include "InputHandler_Xbox.h" -#include "RageUtil.h" -#include "RageLog.h" -#include "RageDisplay.h" - - -#include - -struct DEVICE_STATE { - XPP_DEVICE_TYPE *pxdt; - DWORD dwState; -}; - -byte buttonMasks[] = { XINPUT_GAMEPAD_DPAD_LEFT, - XINPUT_GAMEPAD_DPAD_RIGHT, - XINPUT_GAMEPAD_DPAD_UP, - XINPUT_GAMEPAD_DPAD_DOWN, - XINPUT_GAMEPAD_START, - XINPUT_GAMEPAD_BACK, - XINPUT_GAMEPAD_LEFT_THUMB, - XINPUT_GAMEPAD_RIGHT_THUMB}; - - -/** - * XBOX controller maps to the following RageInputDevice constants: - * DPAD -> JOY_HAT_... - * START -> JOY_AUX_1 - * BACK -> JOY_AUX_2 - * Left thumb button -> JOY_AUX_3 - * Right thumb button -> JOY_AUX_4 - * Following buttons are JOY_(index): - * A, B, X, Y, BLACK, WHITE, Left trigger, right trigger - */ - -InputHandler_Xbox::InputHandler_Xbox() -{ - // - // Init joysticks - // - ZeroMemory( joysticks, sizeof(joysticks) ); - - getHandles(); -} - -InputHandler_Xbox::~InputHandler_Xbox() -{ - for(unsigned i = 0; i < NUM_JOYSTICKS; i++) - { - if(joysticks[i] != 0) - XInputClose(joysticks[i]); - } -} - -void InputHandler_Xbox::Update() -{ - // check insertions and removals - DWORD dwInsert, dwRemove; - DEVICE_STATE devices = {XDEVICE_TYPE_GAMEPAD, 0}; - - bool changes = false; - // Check each device type to see if any changes have occurred. - if( XGetDeviceChanges( devices.pxdt, &dwInsert, &dwRemove ) ) - { - for(int j = 0; j < 4; j++) - { - if(1 << j & dwRemove) - { - changes = true; - LOG->Trace("A joystick was removed"); - } - if(1 << j & dwInsert) - { - changes = true; - LOG->Trace("A joystick was inserted"); - } - } - } - - if(changes) - { - getHandles(); - return; - } - - for(unsigned i = 0; i < NUM_JOYSTICKS; i++) - { - if(joysticks[i] == 0) - continue; - - InputDevice inputDevice = InputDevice(DEVICE_JOY1 + i); - XINPUT_STATE xis; - // Query latest state. - XInputGetState( joysticks[i], &xis ); - - // check buttons - for(int j = 0; j < ARRAYLEN(buttonMasks); j++) - { - DWORD nowPressed = xis.Gamepad.wButtons & buttonMasks[j]; - DWORD wasPressed = lastState[i].wButtons & buttonMasks[j]; - - if(nowPressed != wasPressed) - { - DeviceButton Button = DeviceButton(JOY_HAT_LEFT + j); - if(Button >= JOY_BUTTON_32) - { - LOG->Warn("Ignored joystick event (button too high)"); - continue; - } - DeviceInput di(inputDevice, Button, nowPressed != 0); - ButtonPressed(di); - continue; - } - } - - // check analog buttons - for(int j = 0; j < ARRAYLEN(xis.Gamepad.bAnalogButtons); j++) - { - bool nowPressed = xis.Gamepad.bAnalogButtons[j] > XINPUT_GAMEPAD_MAX_CROSSTALK; - bool wasPressed = lastState[i].bAnalogButtons[j] > XINPUT_GAMEPAD_MAX_CROSSTALK; - - if(nowPressed != wasPressed) - { - DeviceButton Button = DeviceButton(JOY_BUTTON_1 + j); - if(Button >= JOY_BUTTON_32) - { - LOG->Warn("Ignored joystick event (button too high)"); - continue; - } - DeviceInput di(inputDevice, Button, nowPressed); - ButtonPressed(di); - continue; - } - } - - // check thumbsticks - SHORT axes[] = { xis.Gamepad.sThumbLX, xis.Gamepad.sThumbLY, xis.Gamepad.sThumbRX, xis.Gamepad.sThumbRY}; - - for(int j = 0; j < ARRAYLEN(axes); j++) - { - if(axes[j] != 0) - { - // Reverse y axis (negative values are down, not up) - if(j == 1 || j == 3) - axes[j] = -axes[j]; - - DeviceButton neg = (DeviceButton)(JOY_LEFT + (2 * j)); - DeviceButton pos = (DeviceButton)(JOY_RIGHT + (2 * j)); - float l = SCALE( axes[j], 0.0f, 32768.0f, 0.0f, 1.0f ); - ButtonPressed(DeviceInput(inputDevice, neg,max(-l,0),RageZeroTimer)); - ButtonPressed(DeviceInput(inputDevice, pos,max(+l,0),RageZeroTimer)); - continue; - } - } - - memcpy(&lastState[i], &xis.Gamepad, sizeof(XINPUT_GAMEPAD)); - } - - InputHandler::UpdateTimer(); -} - -void InputHandler_Xbox::GetDevicesAndDescriptions( vector& vDevicesOut ) -{ - for( int i=0; iInfo( "Found %d connected joysticks for %d players", joysFound, playersAllocated ); -} - -/* - * (c) 2004 Ryan Dortmans - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/InputHandler/InputHandler_Xbox.h b/src/arch/InputHandler/InputHandler_Xbox.h deleted file mode 100644 index 14a8cc2292..0000000000 --- a/src/arch/InputHandler/InputHandler_Xbox.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef INPUT_HANDLER_XBOX_H -#define INPUT_HANDLER_XBOX_H - -#include "InputHandler.h" - -#include - -#define NUM_PORTS 4 - -class InputHandler_Xbox: public InputHandler -{ - HANDLE joysticks[NUM_JOYSTICKS]; - XINPUT_GAMEPAD lastState[NUM_JOYSTICKS]; - -public: - void Update(); - InputHandler_Xbox(); - ~InputHandler_Xbox(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); - -private: - void getHandles(); -}; -#define USE_INPUT_HANDLER_XBOX -REGISTER_INPUT_HANDLER_CLASS( Xbox ); - -#endif - -/* - * (c) 2004 Ryan Dortmans - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/LoadingWindow/LoadingWindow.cpp b/src/arch/LoadingWindow/LoadingWindow.cpp index 8fa1d0ae01..2002e81f45 100644 --- a/src/arch/LoadingWindow/LoadingWindow.cpp +++ b/src/arch/LoadingWindow/LoadingWindow.cpp @@ -12,7 +12,7 @@ LoadingWindow *LoadingWindow::Create() return new LoadingWindow_Null; #endif // Don't load NULL by default. - const RString drivers = "xbox,win32,macosx,gtk"; + const RString drivers = "win32,macosx,gtk"; vector DriversToTry; split( drivers, ",", DriversToTry, true ); @@ -33,9 +33,6 @@ LoadingWindow *LoadingWindow::Create() #endif #ifdef USE_LOADING_WINDOW_WIN32 if( !DriversToTry[i].CompareNoCase("Win32") ) ret = new LoadingWindow_Win32; -#endif -#ifdef USE_LOADING_WINDOW_XBOX - if( !DriversToTry[i].CompareNoCase("Xbox") ) ret = new LoadingWindow_Xbox; #endif if( !DriversToTry[i].CompareNoCase("Null") ) ret = new LoadingWindow_Null; diff --git a/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp b/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp deleted file mode 100644 index 1e6b7edf73..0000000000 --- a/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp +++ /dev/null @@ -1,179 +0,0 @@ -#include "global.h" -#include "LoadingWindow_Xbox.h" -#include "RageLog.h" - -#include "ProductInfo.h" - -LPDIRECT3D8 g_pD3D = NULL; // DirectX Object -LPDIRECT3DDEVICE8 g_pD3DDevice = NULL; // Screen Object -LPDIRECT3DTEXTURE8 splash = NULL; // splash texture -LPD3DXSPRITE g_sprite = NULL; // sprite object - -LoadingWindow_Xbox::LoadingWindow_Xbox() -{ - // Initialise Direct3D - g_pD3D = Direct3DCreate8(D3D_SDK_VERSION); - - // Create a structure to hold the settings for our device - D3DPRESENT_PARAMETERS d3dpp; - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Fill the structure. - // Set fullscreen 640x480x32 mode - d3dpp.BackBufferWidth = 640; - d3dpp.BackBufferHeight = 480; - d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; - - // Create one backbuffer and a zbuffer - d3dpp.BackBufferCount = 1; - - // Set up how the backbuffer is "presented" to the frontbuffer each time - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - //Create a Direct3D device. - g_pD3D->CreateDevice(0, D3DDEVTYPE_HAL, NULL, - D3DCREATE_HARDWARE_VERTEXPROCESSING, - &d3dpp, &g_pD3DDevice); - g_pD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - - // Create the sprite object (for painting the image) - D3DXCreateSprite(g_pD3DDevice, &g_sprite); - - // Load the default font - XFONT_OpenDefaultFont(&font); - font->SetTextColor(D3DCOLOR_XRGB(255,255,255)); - font->SetTextAlignment(XFONT_CENTER); - - // Load the splash.png - - HRESULT result = D3DXCreateTextureFromFileA(g_pD3DDevice, "D:\\Data\\splash.png", &splash); - useImage = (result == D3D_OK); - - if(!useImage) - LOG->Trace("Error loading splash.png - %i", result); - - SetText(RString("Loading songs")); -} - -LoadingWindow_Xbox::~LoadingWindow_Xbox() -{ - g_pD3DDevice->Release(); - g_pD3D->Release(); - font->Release(); -} - -void LoadingWindow_Xbox::Paint() -{ - LPDIRECT3DSURFACE8 g_pFrontBuffer; - - if(text == "") - return; - - g_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); - - g_pD3DDevice->BeginScene(); - g_pD3DDevice->GetBackBuffer(0,D3DBACKBUFFER_TYPE_MONO,&g_pFrontBuffer); - - if(useImage) - { - // Draw the splash image - // Only draw if the splash texture is successfully loaded - D3DXVECTOR2 pos; - pos.x = 70.0f; - pos.y = 30.0f; - - g_sprite->Begin(); - g_sprite->Draw(splash, NULL, NULL, NULL, NULL, &pos, 0xFFFFFFFF); - g_sprite->End(); - } - else - { - // Lo-fi version: print the product name and version at the top of the screen - font->SetTextColor(D3DCOLOR_XRGB(255, 0, 0)); - RString title = "Version "; - title = title + PRODUCT_VER; - WCHAR wc_title[200] = {0}; - swprintf(wc_title, L"%S", title.c_str()); - - font->TextOut(g_pFrontBuffer, L"StepMania", -1, 320, 30); - font->SetTextColor(D3DCOLOR_XRGB(255, 255, 0)); - font->TextOut(g_pFrontBuffer, wc_title, -1, 320, 40 + font->GetTextHeight()); - } - - // Draw the text on the screen - font->SetTextColor(D3DCOLOR_XRGB(255, 255, 255)); - basic_string ::size_type newLineIndex = text.find("\n", 0); - int y = 240; - - if(newLineIndex == RString.npos) - { - WCHAR wc_text[200] = {0}; - swprintf(wc_text, L"%S", text.c_str()); - - font->TextOut(g_pFrontBuffer, wc_text, wcslen(wc_text), 320, y); - } - else - { - int start = 0; - - while(start != RString.npos) - { - RString toPrint; - if(newLineIndex != RString.npos) - toPrint = text.substr(start, newLineIndex - start); - else - toPrint = text.substr(start); - - if(toPrint != "") - { - WCHAR wc_text[200] = {0}; - swprintf(wc_text, L"%S", toPrint.c_str()); - - font->TextOut(g_pFrontBuffer, wc_text, wcslen(wc_text), 320, y); - } - y = y + font->GetTextHeight() + 10; - - if(newLineIndex != RString.npos) - start = newLineIndex + 1; - else - start = RString.npos; - - newLineIndex = text.find("\n", start); - } - } - - g_pFrontBuffer->Release(); - - g_pD3DDevice->EndScene(); - g_pD3DDevice->Present(NULL, NULL, NULL, NULL); -} - -void LoadingWindow_Xbox::SetText(RString str) -{ - text = str ; -} - -/* - * (c) 2004 Ryan Dortmans - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ \ No newline at end of file diff --git a/src/arch/LoadingWindow/LoadingWindow_Xbox.h b/src/arch/LoadingWindow/LoadingWindow_Xbox.h deleted file mode 100644 index 956bef0157..0000000000 --- a/src/arch/LoadingWindow/LoadingWindow_Xbox.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef LOADING_WINDOW_XBOX_H -#define LOADING_WINDOW_XBOX_H - -#include "LoadingWindow.h" - -#include -#include -#define XFONT_TRUETYPE - -class LoadingWindow_Xbox: public LoadingWindow -{ -public: - LoadingWindow_Xbox(); - ~LoadingWindow_Xbox(); - - void Paint(); - void SetText(RString str); - -protected: - RString text ; - XFONT* font; - bool useImage; -}; -#define USE_LOADING_WINDOW_XBOX - -#endif - -/* - * (c) 2004 Ryan Dortmans - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.cpp deleted file mode 100644 index 0523f27de3..0000000000 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#include "global.h" -#include "MemoryCardDriverThreaded_Xbox.h" -#include "RageUtil.h" -#include "RageLog.h" - -MemoryCardDriverThreaded_Xbox::MemoryCardDriverThreaded_Xbox() -{ -} - -MemoryCardDriverThreaded_Xbox::~MemoryCardDriverThreaded_Xbox() -{ -} - -static bool TestReady( const RString &sDrive, RString &sVolumeLabelOut ) -{ - TCHAR szVolumeNameBuffer[MAX_PATH]; - DWORD dwVolumeSerialNumber; - DWORD dwMaximumComponentLength; - DWORD lpFileSystemFlags; - TCHAR szFileSystemNameBuffer[MAX_PATH]; - - if( !GetVolumeInformation( - sDrive, - szVolumeNameBuffer, - sizeof(szVolumeNameBuffer), - &dwVolumeSerialNumber, - &dwMaximumComponentLength, - &lpFileSystemFlags, - szFileSystemNameBuffer, - sizeof(szFileSystemNameBuffer)) ){ - LOG->Trace("GetVolumeInformation failed %u", GetLastError()); - return false; - } - - sVolumeLabelOut = szVolumeNameBuffer; - return true; -} - -bool MemoryCardDriverThreaded_Xbox::TestWrite( UsbStorageDevice* pDevice ) -{ - /* Try to write a file, to check if the device is writable and that we have write permission.*/ - for( int i = 0; i < 10; ++i ) - { - HANDLE hFile = CreateFile( - ssprintf( "%s\\tmp%i", pDevice->sOsMountDir.c_str(), RandomInt(100000)), - GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - CREATE_NEW, - FILE_FLAG_DELETE_ON_CLOSE, - NULL ); - - if( hFile == INVALID_HANDLE_VALUE ) - { - DWORD iError = GetLastError(); - LOG->Warn( "Couldn't write to %s (%u)", pDevice->sOsMountDir.c_str(), iError); - - if( iError == ERROR_FILE_EXISTS ) - continue; - break; - } - - CloseHandle( hFile ); - return true; - } - - pDevice->SetError( "TestFailed" ); - return false; -} - -void MemoryCardDriverThreaded_Xbox::GetUSBStorageDevices( vector& vDevicesOut ) -{ - DWORD devices=XGetDevices(XDEVICE_TYPE_MEMORY_UNIT); - - for(int port=0;port<4;port++){ - //top slot - if(devices&(1<Trace( "%s", __FUNCTION__); - CHAR drive; - DWORD MountRetval=XMountMU(pDevice->iPort, pDevice->iLevel, &drive); - if(MountRetval==ERROR_SUCCESS){ - LOG->Trace("Mounted memory card from port %u slot %u to %c:", pDevice->iPort, pDevice->iLevel, drive); - pDevice->SetOsMountDir(ssprintf("%c:", drive)); - RString sVolumeLabel; - if( !TestReady(pDevice->sOsMountDir + "\\", sVolumeLabel) ) - { - LOG->Trace( "not TestReady" ); - } - pDevice->sVolumeLabel = sVolumeLabel; - return true; - }else{ - LOG->Trace("Could not mount memory card %u", MountRetval); - return false; - } -} - -void MemoryCardDriverThreaded_Xbox::Unmount( UsbStorageDevice* pDevice ) -{ - XUnmountMU(pDevice->iPort, pDevice->iLevel); -} - -/* - * (c) 2003-2004 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.h b/src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.h deleted file mode 100644 index af3c47d1dd..0000000000 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Xbox.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef MemoryCardDriverThreaded_Xbox_H -#define MemoryCardDriverThreaded_Xbox_H - -#include "MemoryCardDriver.h" - -class MemoryCardDriverThreaded_Xbox: public MemoryCardDriver -{ -public: - MemoryCardDriverThreaded_Xbox(); - virtual ~MemoryCardDriverThreaded_Xbox(); - - virtual bool Mount( UsbStorageDevice* pDevice ); - virtual void Unmount( UsbStorageDevice* pDevice ); - -private: - void GetUSBStorageDevices( vector& vDevicesOut ); - bool USBStorageDevicesChanged(); - bool TestWrite( UsbStorageDevice* pDevice ); -}; - -#ifdef ARCH_MEMORY_CARD_DRIVER -#error "More than one MemoryCardDriver included!" -#endif -#define ARCH_MEMORY_CARD_DRIVER MemoryCardDriverThreaded_Xbox - -#endif - -/* - * (c) 2003-2004 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index fd27ba5d3a..ed70a0acbf 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -29,34 +29,15 @@ namespace avcodec }; /* -#if defined(_MSC_VER) && !defined(XBOX) +#if defined(_MSC_VER) #pragma comment(lib, "ffmpeg/lib/avcodec.lib") #pragma comment(lib, "ffmpeg/lib/avformat.lib") #if defined(USE_MODERN_FFMPEG) #pragma comment(lib, "ffmpeg/lib/swscale.lib") #endif -#endif // _MSC_VER && !XBOX +#endif // _MSC_VER */ -#if defined(XBOX) - /* NOTES: ffmpeg static libraries arent included in SVN. You have to build - *them yourself or remove this file to produce the xbox build. - * - * build ffmpeg with mingw32 ( howto http://ffmpeg.arrozcru.org/wiki/index.php?title=Main_Page ) - * ./configure --enable-memalign-hack --enable-static --disable-mmx --target-os=mingw32 --arch=x86 - * you can use various switches to enable/disable codecs/muxers/etc. - * - * libgcc.a and libmingwex.a comes from mingw installation - * msys\mingw\lib\gcc\mingw32\3.4.5\libgcc.a */ - #pragma comment(lib, "ffmpeg/lib/libavcodec.a") - #pragma comment(lib, "ffmpeg/lib/libavformat.a") - #pragma comment(lib, "ffmpeg/lib/libavutil.a") - #pragma comment(lib, "ffmpeg/lib/libswscale.a") - #pragma comment(lib, "ffmpeg/lib/libgcc.a") - #pragma comment(lib, "ffmpeg/lib/libmingwex.a") - #pragma comment(lib, "ffmpeg/lib/libcoldname.a") -#endif - #if !defined(MACOSX) static const int sws_flags = SWS_BICUBIC; // XXX: Reasonable default? #endif diff --git a/src/arch/MovieTexture/MovieTexture_Generic.cpp b/src/arch/MovieTexture/MovieTexture_Generic.cpp index ae14237fc9..e3f1ea0aee 100644 --- a/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -9,7 +9,7 @@ #include "RageUtil.h" #include "Sprite.h" -#if defined(WIN32) && !defined(XBOX) +#if defined(WIN32) #include "archutils/Win32/ErrorStrings.h" #include #endif diff --git a/src/arch/Threads/Threads_Win32.cpp b/src/arch/Threads/Threads_Win32.cpp index 027c11f573..3fd4a72795 100644 --- a/src/arch/Threads/Threads_Win32.cpp +++ b/src/arch/Threads/Threads_Win32.cpp @@ -31,11 +31,9 @@ HANDLE Win32ThreadIdToHandle( uint64_t iID ) void ThreadImpl_Win32::Halt( bool Kill ) { -#ifndef _XBOX if( Kill ) TerminateThread( ThreadHandle, 0 ); else -#endif SuspendThread( ThreadHandle ); } diff --git a/src/arch/arch.cpp b/src/arch/arch.cpp index cafa822ef6..5cbdcdcd02 100644 --- a/src/arch/arch.cpp +++ b/src/arch/arch.cpp @@ -52,9 +52,6 @@ void MakeInputHandlers( const RString &drivers, vector &Add ) #ifdef USE_INPUT_HANDLER_X11 if( !s->CompareNoCase("X11") ) ret = new InputHandler_X11; #endif -#ifdef USE_INPUT_HANDLER_XBOX - if( !s->CompareNoCase("Xbox") ) ret = new InputHandler_Xbox; -#endif #ifdef USE_INPUT_HANDLER_MACOSX_HID if( !s->CompareNoCase("MacOSX") ) ret = new InputHandler_MacOSX_HID; #endif @@ -104,7 +101,7 @@ LoadingWindow *MakeLoadingWindow() return new LoadingWindow_Null; #endif // Don't load NULL by default. - const RString drivers = "xbox,win32,cocoa,gtk"; + const RString drivers = "win32,cocoa,gtk"; vector DriversToTry; split( drivers, ",", DriversToTry, true ); @@ -129,11 +126,7 @@ LoadingWindow *MakeLoadingWindow() #ifdef USE_LOADING_WINDOW_WIN32 if( !DriversToTry[i].CompareNoCase("Win32") ) ret = new LoadingWindow_Win32; #endif -#ifdef USE_LOADING_WINDOW_XBOX - if( !DriversToTry[i].CompareNoCase("Xbox") ) ret = new LoadingWindow_Xbox; -#endif - if( ret == NULL ) continue; @@ -144,10 +137,10 @@ LoadingWindow *MakeLoadingWindow() SAFE_DELETE( ret ); } } - + if(ret) LOG->Info( "Loading window: %s", Driver.c_str() ); - + return ret; } @@ -191,7 +184,7 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ) vector DriversToTry; split( sDrivers, ",", DriversToTry, true ); - + if( DriversToTry.empty() ) RageException::Throw( MOVIE_DRIVERS_EMPTY.GetValue() ); @@ -231,7 +224,7 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ) RageException::Throw( COULDNT_CREATE_MOVIE_DRIVER.GetValue() ); LOG->Trace( "Created movie texture \"%s\" with driver \"%s\"", - ID.filename.c_str(), Driver.c_str() ); + ID.filename.c_str(), Driver.c_str() ); return ret; } @@ -291,10 +284,10 @@ RageSoundDriver *MakeRageSoundDriver( const RString &drivers ) SAFE_DELETE( ret ); } } - + if( ret ) LOG->Info( "Sound driver: %s", Driver.c_str() ); - + return ret; } diff --git a/src/arch/arch.h b/src/arch/arch.h index 29e3a29f60..eaa457ca5a 100644 --- a/src/arch/arch.h +++ b/src/arch/arch.h @@ -7,8 +7,6 @@ #if defined(_WINDOWS) #define SUPPORT_OPENGL #define SUPPORT_D3D -#elif defined(_XBOX) -#define SUPPORT_D3D #else #define SUPPORT_OPENGL #endif diff --git a/src/arch/arch_default.h b/src/arch/arch_default.h index 5752dacadc..4dcbe1a5f2 100644 --- a/src/arch/arch_default.h +++ b/src/arch/arch_default.h @@ -22,16 +22,6 @@ #define DEFAULT_SOUND_DRIVER_LIST "AudioUnit,Null" -#elif defined(_XBOX) -#include "ArchHooks/ArchHooks_Xbox.h" -#include "LoadingWindow/LoadingWindow_Xbox.h" -#include "LowLevelWindow/LowLevelWindow_Win32.h" -#include "MemoryCard/MemoryCardDriverThreaded_Xbox.h" -#define DEFAULT_INPUT_DRIVER_LIST "Xbox" -#define DEFAULT_MOVIE_DRIVER_LIST "Theora,FFMpeg,DShow,Null" -#define DEFAULT_SOUND_DRIVER_LIST "DirectSound,DirectSound-sw,Null" - - #elif defined(UNIX) #include "ArchHooks/ArchHooks_Unix.h" #include "LowLevelWindow/LowLevelWindow_X11.h" diff --git a/src/archutils/Win32/AppInstance.h b/src/archutils/Win32/AppInstance.h index 59386febe5..3a0358094e 100644 --- a/src/archutils/Win32/AppInstance.h +++ b/src/archutils/Win32/AppInstance.h @@ -1,9 +1,7 @@ #ifndef APP_INSTANCE_H #define APP_INSTANCE_H -#if !defined(_XBOX) -# include "windows.h" -#endif +#include "windows.h" /** @brief get an HINSTANCE for starting dialog boxes. */ class AppInstance diff --git a/src/archutils/Win32/DirectXHelpers.cpp b/src/archutils/Win32/DirectXHelpers.cpp index 430bb32666..3b28626926 100644 --- a/src/archutils/Win32/DirectXHelpers.cpp +++ b/src/archutils/Win32/DirectXHelpers.cpp @@ -2,14 +2,10 @@ #include "DirectXHelpers.h" #include "RageUtil.h" -#ifdef _XBOX -# include -#else -# include -# include -# if defined(_MSC_VER) -# pragma comment(lib, "dxerr8.lib") -# endif +#include +#include +#if defined(_MSC_VER) +# pragma comment(lib, "dxerr8.lib") #endif RString hr_ssprintf( int hr, const char *fmt, ... ) @@ -19,13 +15,7 @@ RString hr_ssprintf( int hr, const char *fmt, ... ) RString s = vssprintf( fmt, va ); va_end(va); -#ifdef _XBOX - char szError[1024] = ""; - D3DXGetErrorString( hr, szError, sizeof(szError) ); -#else const char *szError = DXGetErrorString8( hr ); -#endif - return s + ssprintf( " (%s)", szError ); } diff --git a/src/archutils/Win32/ErrorStrings.cpp b/src/archutils/Win32/ErrorStrings.cpp index de53870c66..7f5b40b3c8 100644 --- a/src/archutils/Win32/ErrorStrings.cpp +++ b/src/archutils/Win32/ErrorStrings.cpp @@ -2,17 +2,13 @@ #include "ErrorStrings.h" #include "RageUtil.h" -#if !defined(XBOX) #include -#endif RString werr_ssprintf( int err, const char *fmt, ... ) { char buf[1024] = ""; -#ifndef _XBOX FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, buf, sizeof(buf), NULL); -#endif // Why is FormatMessage returning text ending with \r\n? (who? -aj) // Perhaps it's because you're on Windows, where newlines are \r\n. -aj diff --git a/src/archutils/Win32/arch_setup.h b/src/archutils/Win32/arch_setup.h index 9ad85a8a37..faa6ee057d 100644 --- a/src/archutils/Win32/arch_setup.h +++ b/src/archutils/Win32/arch_setup.h @@ -1,14 +1,10 @@ #ifndef ARCH_SETUP_WINDOWS_H #define ARCH_SETUP_WINDOWS_H -#if !defined(XBOX) #define HAVE_FFMPEG #define HAVE_THEORA -#endif -#if !defined(XBOX) #define SUPPORT_OPENGL -#endif #define SUPPORT_D3D #if defined(__MINGW32__) @@ -143,25 +139,13 @@ inline long int lrintf( float f ) /* We implement the crash handler interface (though that interface isn't * completely uniform across platforms yet). */ -#if !defined(_XBOX) && !defined(SMPACKAGE) +#if !defined(SMPACKAGE) #define CRASH_HANDLER #endif #define ENDIAN_LITTLE -#if defined(_XBOX) -#if defined(_DEBUG) -#define OGG_LIB_DIR "vorbis/xbox/debug/" -#else -#define OGG_LIB_DIR "vorbis/xbox/release/" -#endif -#else #define OGG_LIB_DIR "vorbis/win32/" -#endif - -#if defined(XBOX) -#include "ArchUtils/Xbox/arch_setup.h" -#endif #if defined(__GNUC__) // It might be MinGW or Cygwin(?) #include "archutils/Common/gcc_byte_swaps.h" diff --git a/src/archutils/Xbox/GraphicsWindow.cpp b/src/archutils/Xbox/GraphicsWindow.cpp deleted file mode 100644 index 42ad602abd..0000000000 --- a/src/archutils/Xbox/GraphicsWindow.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include "global.h" -#include "archutils/Xbox/GraphicsWindow.h" -#include "ProductInfo.h" -#include "RageLog.h" -#include "RageUtil.h" -#include "RageDisplay.h" - -static const RString g_sClassName = RString(PRODUCT_ID) + " LowLevelWindow_Win32"; - -static VideoModeParams g_CurrentParams; -static bool g_bResolutionChanged = false; -static bool g_bHasFocus = true; -static bool g_bLastHasFocus = true; -static bool m_bWideWindowClass; -bool isPALSystem(); -void setScreenResolutionValues(); - -void GraphicsWindow::SetVideoModeParams( const VideoModeParams ¶ms ) -{ - g_CurrentParams = params; -} - -const VideoModeParams &GraphicsWindow::GetParams() -{ - return g_CurrentParams; -} - -void GraphicsWindow::Update() -{ - if( g_bResolutionChanged ) - { - /* Let DISPLAY know that our resolution has changed. */ - DISPLAY->ResolutionChanged(); - g_bResolutionChanged = false; - } -} - -void GraphicsWindow::Initialize( bool bD3D ) -{ - /* We do the parameters initialisation here. No need to use the INI, - because if we changed resolutions, it wouldn't keep up. */ - - g_CurrentParams.bpp = 32; - g_CurrentParams.windowed=false; - - isPALSystem(); - setScreenResolutionValues(); -} - -bool isPALSystem() -{ - if(XGetVideoStandard() == XC_VIDEO_STANDARD_PAL_I) - { - g_CurrentParams.interlaced=true; - - /* Get supported video flags. */ - DWORD VideoFlags = XGetVideoFlags(); - - /* Set pal60 if available. */ - if( VideoFlags & XC_VIDEO_FLAGS_PAL_60Hz ) - g_CurrentParams.rate = 60; - else - g_CurrentParams.rate = 50; - - g_CurrentParams.PAL = true; - return true; - } - g_CurrentParams.rate = 60; - g_CurrentParams.PAL = false; - return false; -} -void setScreenResolutionValues() -{ - DWORD CurrentVideoFlags = XGetVideoFlags(); - int heightStandards; - - // Preventive definition. Changed only if needed. - g_CurrentParams.interlaced=false; - - switch(isPALSystem()){ - case true: - heightStandards = 576; - break; - case false: - heightStandards = 480; - g_CurrentParams.interlaced=false; - break; - } - - switch (CurrentVideoFlags){ - - case XC_VIDEO_FLAGS_HDTV_480p: - g_CurrentParams.width=720; - g_CurrentParams.height=480; - break; - - case XC_VIDEO_FLAGS_HDTV_720p: - g_CurrentParams.width=1280; - g_CurrentParams.height=720; - break; - - case XC_VIDEO_FLAGS_HDTV_1080i: - g_CurrentParams.width=1920; - g_CurrentParams.height=1080; - g_CurrentParams.interlaced=true; - break; - - case XC_VIDEO_FLAGS_WIDESCREEN: - g_CurrentParams.width=720; - g_CurrentParams.height=heightStandards; - break; - - case XC_VIDEO_FLAGS_LETTERBOX: - default: - g_CurrentParams.width=640; - g_CurrentParams.height=heightStandards; - break; - } -} - -void GraphicsWindow::Shutdown() { } -RString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) { return ""; } -void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p ) { } -void GraphicsWindow::RecreateGraphicsWindow( const VideoModeParams &p ) { } -void GraphicsWindow::DestroyGraphicsWindow() { } -void GraphicsWindow::ConfigureGraphicsWindow( const VideoModeParams &p ) { } - -/* - * (c) 2004 Glenn Maynard, Renaud Lepage - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/archutils/Xbox/GraphicsWindow.h b/src/archutils/Xbox/GraphicsWindow.h deleted file mode 100644 index fa1ada8ba0..0000000000 --- a/src/archutils/Xbox/GraphicsWindow.h +++ /dev/null @@ -1,47 +0,0 @@ -#if !defined(GRAPHICS_WINDOW_H) -#define GRAPHICS_WINDOW_H - -#pragma once - -class VideoModeParams; - -namespace GraphicsWindow -{ - void Initialize( bool bD3D ); - void Shutdown(); - void SetVideoModeParams( const VideoModeParams &p ); - RString SetScreenMode( const VideoModeParams &p ); - void CreateGraphicsWindow( const VideoModeParams &p ); - void RecreateGraphicsWindow( const VideoModeParams &p ); - void DestroyGraphicsWindow(); - void ConfigureGraphicsWindow( const VideoModeParams &p ); - const VideoModeParams &GetParams(); - void Update(); -}; - -#endif - -/* - * (c) 2004 Glenn Maynard - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/archutils/Xbox/VirtualMemory.cpp b/src/archutils/Xbox/VirtualMemory.cpp deleted file mode 100644 index f302989e91..0000000000 --- a/src/archutils/Xbox/VirtualMemory.cpp +++ /dev/null @@ -1,644 +0,0 @@ -/* This handles manual paging. It's primarily intended for the Xbox, but works - * in Windows as well; it can be enabled for debugging. */ - -#include "global.h" -#include "VirtualMemory.h" -#include "RageLog.h" -#include "Preference.h" -#include - -#if defined(WINDOWS) -#define PAGE_FILE_PATH "StepMania pagefile.dat" -#else -#define PAGE_FILE_PATH "Z:\\xxpagefile.sys" -#endif - -VirtualMemoryManager vmem_Manager; - -static Preference g_bEnableVirtualMemory( "EnableVirtualMemory", true ); -// page file size in megabytes -static Preference g_iPageFileSize( "PageFileSize", 384 ); -// page size in kilobytes -static Preference g_iPageSize( "PageSize", 16 ); -// threshold in kilobytes where virtual memory will be used -static Preference g_iPageThreshold( "PageThreshold", 8 ); -// (under debug) log the virtual memory allocation, etc. -static Preference g_bLogVirtualMemory( "LogVirtualMemory", false ); - -struct vm_page -{ - DWORD startAddress; // start address for this page - unsigned long headPage; // 0 if not allocated. Otherwise, the index of the first page - // of this segment. - bool committed; // true if this page is committed to RAM (is otherwise in the page file) - bool locked; // true if this page should not be decommitted - int pageFaults; // number of times this page has been accessed when it wasn't committed - unsigned long sizeInPages; // size of the data segment in pages. - size_t sizeInBytes; // size of the data segment in bytes. -}; - -VirtualMemoryManager::VirtualMemoryManager(): - vmemMutex("VirtualMemory") -{ - pages = 0; - pageLRU = -1; - inited = false; -} - -VirtualMemoryManager::~VirtualMemoryManager() -{ - Destroy(); -} - -bool VirtualMemoryManager::Init() -{ - if( !g_bEnableVirtualMemory ) - return true; - unsigned long totalPageSize = 1024 * 1024 * g_iPageFileSize; - unsigned long sizePerPage = 1024 * g_iPageSize; - unsigned long thold = 1024 * g_iPageThreshold; - - threshold = thold; - - totalPages = totalPageSize / sizePerPage; - pageSize = sizePerPage; - - if(totalPageSize % sizePerPage != 0) - totalPageSize = sizePerPage * totalPages; - - // initialise the pages array - // bypass the overridden new by using HeapAlloc - pages = (vm_page*)HeapAlloc(GetProcessHeap(), 0, totalPages * sizeof(vm_page)); - - if(pages == NULL) - return false; - - // create the page file on Z drive - vmemFile = CreateFile( PAGE_FILE_PATH, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); - - if(vmemFile == INVALID_HANDLE_VALUE) - return false; - - // set the file size - // find the current file size - unsigned long fileSize = SetFilePointer(vmemFile, 0, 0, FILE_END); - if(fileSize == INVALID_SET_FILE_POINTER) - return false; - - if(fileSize < totalPageSize) - { - fileSize = SetFilePointer(vmemFile, totalPageSize, 0, FILE_BEGIN); - if(fileSize == INVALID_SET_FILE_POINTER) - return false; - } - - // Reserve the virtual memory and get the base address - baseAddress = (DWORD)VirtualAlloc(NULL, totalPageSize, MEM_RESERVE, PAGE_NOACCESS); - - if(baseAddress == NULL) - return false; - - // initialise the page array - for(unsigned long i = 0; i < totalPages; i++) - { - pages[i].startAddress = baseAddress + (i * pageSize); - pages[i].headPage = -1; - pages[i].committed = false; - pages[i].sizeInPages = 0; - pages[i].sizeInBytes = 0; - pages[i].pageFaults = 0; - pages[i].locked = false; - } - - SetLogging( g_bLogVirtualMemory ); - - inited = true; - return true; -} - -void VirtualMemoryManager::Destroy() -{ - if(pages != 0) - { - VirtualFree((LPVOID)baseAddress, 0, MEM_RELEASE); - HeapFree(GetProcessHeap(), 0, pages); - CloseHandle(vmemFile); - } -} - -void* VirtualMemoryManager::Allocate(size_t size) -{ - if(!inited) - return NULL; - - LockMut(vmemMutex); - - unsigned long startPage = -1; - unsigned long freeSegments = 0; - unsigned long sizeInPages = (size / pageSize) + 1; - - if(size % pageSize == 0) - sizeInPages--; - - // find a contiguous group of pages that will fit the data - for(unsigned long i = 0; i < totalPages; i++) - { - if(pages[i].sizeInPages != 0) - { - startPage = -1; - freeSegments = 0; - i += pages[i].sizeInPages - 1; // go to next page segment - } - else - { - if(startPage == -1) - { - startPage = i; - freeSegments = 1; - } - else - freeSegments++; - - if(sizeInPages == freeSegments) - { - if(LOG && logging) - LOG->Trace("Allocating pages %u to %u", startPage, startPage + freeSegments - 1); - - // commit this to memory - DWORD ret = (DWORD)VirtualAlloc((LPVOID)pages[startPage].startAddress, size, MEM_COMMIT, PAGE_READWRITE); - while(ret == NULL) - { - bool swappedOut = DecommitLRU(); - - if(!swappedOut) - { - if(LOG) - LOG->Trace("VMem error: out of memory with no pages to swap out left"); - return NULL; - } - - ret = (DWORD)VirtualAlloc((LPVOID)pages[startPage].startAddress, size, MEM_COMMIT, PAGE_READWRITE); - } - - pageLRU = (startPage + sizeInPages) % totalPages; - for(unsigned long j = startPage; j < startPage + freeSegments; j++) - { - pages[j].headPage = startPage; - pages[j].pageFaults = 0; - pages[j].sizeInPages = freeSegments; - pages[j].sizeInBytes = size; - pages[j].committed = true; - pages[i].locked = false; - } - - return (void*) ret; - } - } - } - - if(LOG) - LOG->Trace("VMem error: Couldn't find contiguous group of pages to allocate"); - - return NULL; -} - -bool VirtualMemoryManager::Free(void *ptr) -{ - if(!inited) - return false; - - LockMut(vmemMutex); - - // check that the address is within the virtual address bounds - if((DWORD)ptr < baseAddress || (DWORD)ptr >= baseAddress + (totalPages * pageSize)) - { - return false; - } - - // find the page(s) to free - DWORD offset = (DWORD)ptr - baseAddress; - unsigned long pageIndex = offset / pageSize; - - if(pages[pageIndex].headPage == -1) - { - return false; - } - - pageIndex = pages[pageIndex].headPage; - ptr = (void *)pages[pageIndex].startAddress; - - unsigned long endPage = pageIndex + pages[pageIndex].sizeInPages; - unsigned long size = pages[pageIndex].sizeInBytes; - - if(size == 0) - { - return false; // trying to free unallocated memory - } - - if(LOG && logging) - LOG->Trace("Freeing pages %u to %u", pageIndex, endPage - 1); - - if(pages[pageIndex].committed) - VirtualFree(ptr, size, MEM_DECOMMIT); - - for(unsigned long i = pageIndex; i < endPage; i++) - { - pages[i].headPage = -1; - pages[i].committed = false; - pages[i].pageFaults = 0; - pages[i].sizeInBytes = 0; - pages[i].sizeInPages = 0; - pages[i].locked = false; - } - - return true; -} - -bool VirtualMemoryManager::PageFault(void *ptr) -{ - if(!inited) - return false; - - LockMut(vmemMutex); - - // check that the address is within the virtual address bounds - if((DWORD)ptr < baseAddress || (DWORD)ptr >= baseAddress + (totalPages * pageSize)) - { - if(LOG) - { - LOG->Trace("Vmem error: Page fault outside virtual memory bounds"); - LOG->Trace("Address: %u, bounds: %u to %u", (DWORD)ptr, baseAddress, baseAddress + (totalPages * pageSize)); - } - return false; - } - - // find the page segment that the fault occurred - unsigned long offset = (DWORD)ptr - baseAddress; - unsigned long pageIndex = offset / pageSize; - - - unsigned long startPage = pages[pageIndex].headPage; - if(startPage == -1) - { - if(LOG) - LOG->Trace("VMem error: Trying to access memory that wasn't allocated"); - // trying to access memory that wasn't allocated - return false; - } - - if(pages[startPage].committed) - { - if(LOG && logging) - LOG->Trace("Pages appear to be committed already. Doing nothing..."); - return true; - } - - pageLRU = (startPage + pages[startPage].sizeInPages) % totalPages; - - if(LOG && logging) - LOG->Trace("Reallocating pages %u to %u", startPage, startPage + pages[startPage].sizeInPages - 1); - - DWORD ret = (DWORD)VirtualAlloc((LPVOID)pages[startPage].startAddress, pages[startPage].sizeInBytes, MEM_COMMIT, PAGE_READWRITE); - - while(ret == NULL) - { - bool swappedOut = DecommitLRU(); - if(!swappedOut) - { - if(LOG) - LOG->Trace("VMem error: no pages left to swap out while reallocating"); - - return false; - } - - ret = (DWORD)VirtualAlloc((LPVOID)pages[startPage].startAddress, pages[startPage].sizeInBytes, MEM_COMMIT, PAGE_READWRITE); - } - - for(unsigned long i = startPage; i < startPage + pages[startPage].sizeInPages; i++) - { - pages[i].committed = true; - pages[i].pageFaults++; - } - - DWORD numRead; - - SetFilePointer(vmemFile, pages[startPage].startAddress - baseAddress, 0, FILE_BEGIN); - ReadFile(vmemFile, (void *)pages[startPage].startAddress, pages[startPage].sizeInBytes, &numRead, NULL); - - return true; -} - -bool VirtualMemoryManager::DecommitLRU() -{ - if(!inited) - return false; - - LockMut(vmemMutex); - - // choose random LRU - pageLRU = rand() % totalPages; - - for(unsigned long i = 0; i < totalPages; i++) - { - unsigned long index = (pageLRU + i) % totalPages; - - if(index == 0) - index++; - - if(pages[index].headPage == index && pages[index].committed && !pages[index].locked) // this is a head page - { - DWORD addr = pages[index].startAddress; - unsigned long size = pages[index].sizeInPages; - - // decommit this page - // write to the page file - if(SetFilePointer(vmemFile, addr - baseAddress, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) - { - if(LOG) - LOG->Trace("Vmem error: could not write to page file"); - return false; - } - - DWORD written; - - WriteFile(vmemFile, (LPCVOID)addr, pages[index].sizeInBytes, &written, NULL); - - // reset the page data - if(LOG && logging) - LOG->Trace("Swapping out pages %i to %i", index, index + size - 1); - - for(unsigned long j = index; j < index + size; j++) - { - pages[j].committed = false; - } - - if(VirtualFree((LPVOID)addr, pages[index].sizeInBytes, MEM_DECOMMIT) == 0) - { - return false; - } - - pageLRU = (pageLRU + pages[index].sizeInPages) % totalPages; - - return true; - } - } - - return false; -} - -bool VirtualMemoryManager::EnsureFreeMemory(size_t size) -{ - if(!inited) - return false; - - LockMut(vmemMutex); - - MEMORYSTATUS ms; - GlobalMemoryStatus(&ms); - - while(ms.dwAvailPhys < size) - { - if(LOG && logging) - LOG->Trace("Freeing memory: need %i, have %i", size, ms.dwAvailPhys); - - if(!DecommitLRU()) - { - if(LOG) - LOG->Trace("VMem error: No pages left to free while reserving memory"); - return false; - } - } - - return true; -} - -void VirtualMemoryManager::Lock(void *ptr) -{ - if(!inited) - return; - - LockMut(vmemMutex); - - // check that the address is within the virtual address bounds - if((DWORD)ptr < baseAddress || (DWORD)ptr >= baseAddress + (totalPages * pageSize)) - { - return; - } - - // find the page(s) to free - DWORD offset = (DWORD)ptr - baseAddress; - unsigned long pageIndex = offset / pageSize; - - if(pages[pageIndex].headPage == -1) - { - return; - } - - pageIndex = pages[pageIndex].headPage; - - unsigned long endPage = pageIndex + pages[pageIndex].sizeInPages; - - if(!pages[pageIndex].committed) - { - if(!PageFault(ptr)) - return; - } - - for(unsigned long i = pageIndex; i < endPage; i++) - { - pages[i].locked = true; - } -} -void VirtualMemoryManager::Unlock(void *ptr) -{ - if(!inited) - return; - - LockMut(vmemMutex); - - // check that the address is within the virtual address bounds - if((DWORD)ptr < baseAddress || (DWORD)ptr >= baseAddress + (totalPages * pageSize)) - { - return; - } - - // find the page(s) to free - DWORD offset = (DWORD)ptr - baseAddress; - unsigned long pageIndex = offset / pageSize; - - if(pages[pageIndex].headPage == -1) - { - return; - } - - pageIndex = pages[pageIndex].headPage; - - unsigned long endPage = pageIndex + pages[pageIndex].sizeInPages; - - for(unsigned long i = pageIndex; i < endPage; i++) - { - pages[i].locked = false; - } -} - -void* operator new (size_t size) -{ - if(!vmem_Manager.IsValid()) - return HeapAlloc(GetProcessHeap(), 0, size); - - if(size > vmem_Manager.GetThreshold()) - return vmem_Manager.Allocate(size); - else - { - void *ret = HeapAlloc(GetProcessHeap(), 0, size); - while(ret == NULL) - { - if(!vmem_Manager.DecommitLRU()) - return NULL; - - ret = HeapAlloc(GetProcessHeap(), 0, size); - } - return ret; - } -} - -void* operator new[] (size_t size) -{ - if(!vmem_Manager.IsValid()) - return HeapAlloc(GetProcessHeap(), 0, size); - - if(size > vmem_Manager.GetThreshold()) - return vmem_Manager.Allocate(size); - else - { - void *ret = HeapAlloc(GetProcessHeap(), 0, size); - while(ret == NULL) - { - if(!vmem_Manager.DecommitLRU()) - return NULL; - - ret = HeapAlloc(GetProcessHeap(), 0, size); - } - return ret; - } -} - -void operator delete (void *p) -{ - if(vmem_Manager.IsValid()) - { - if(vmem_Manager.Free(p)) - return; - } - - HeapFree(GetProcessHeap(), 0, p); -} - -void operator delete[] (void *p) -{ - if(vmem_Manager.IsValid()) - { - if(vmem_Manager.Free(p)) - return; - } - - HeapFree(GetProcessHeap(), 0, p); -} - -void *valloc(size_t size) -{ - if(!vmem_Manager.IsValid()) - return HeapAlloc(GetProcessHeap(), 0, size); - - if(size > vmem_Manager.GetThreshold()) - return vmem_Manager.Allocate(size); - else - { - void *ret = HeapAlloc(GetProcessHeap(), 0, size); - while(ret == NULL) - { - if(!vmem_Manager.DecommitLRU()) - return NULL; - - ret = HeapAlloc(GetProcessHeap(), 0, size); - } - return ret; - } -} - -void vfree(void *ptr) -{ - if(vmem_Manager.IsValid()) - { - if(vmem_Manager.Free(ptr)) - return; - } - - HeapFree(GetProcessHeap(), 0, ptr); -} - -LONG _stdcall CheckPageFault(LPEXCEPTION_POINTERS e) -{ - if(LOG && e->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) - LOG->Trace("Exception: %u", e->ExceptionRecord->ExceptionCode); - - if (e->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) - return EXCEPTION_CONTINUE_SEARCH; - - DWORD addr = (DWORD)e->ExceptionRecord->ExceptionInformation[1]; - - if(vmem_Manager.IsValid()) - { - if(LOG && vmem_Manager.IsLogging()) - LOG->Trace("Page fault"); - - if(vmem_Manager.PageFault((void *)addr)) - return EXCEPTION_CONTINUE_EXECUTION; - } - - return EXCEPTION_CONTINUE_SEARCH; -} - -int NoMemory(size_t size) -{ - if(LOG && vmem_Manager.IsLogging()) - LOG->Trace("Out of memory, freeing up some..."); - - if(vmem_Manager.DecommitLRU()) - { - if(LOG && vmem_Manager.IsLogging()) - LOG->Trace("Freed some memory, trying again"); - return 1; - } - else - { - if(LOG) - LOG->Trace("No memory left to free. Failed"); - return 0; - } -} - -/* - * (c) 2004 Ryan Dortmans - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ \ No newline at end of file diff --git a/src/archutils/Xbox/VirtualMemory.h b/src/archutils/Xbox/VirtualMemory.h deleted file mode 100644 index 3d27a84b95..0000000000 --- a/src/archutils/Xbox/VirtualMemory.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef VIRTUAL_MEMORY_H -#define VIRTUAL_MEMORY_H - -#if defined(XBOX) -#include -#else -#include -#endif - -#include "RageThreads.h" - -struct vm_page; - -class VirtualMemoryManager -{ -public: - VirtualMemoryManager(); - ~VirtualMemoryManager(); - - bool Init(); - void Destroy(); - void* Allocate(size_t size); - bool Free(void *ptr); - bool PageFault(void *ptr); - bool DecommitLRU(); - bool EnsureFreeMemory(size_t size); - void Lock(void *ptr); - void Unlock(void *ptr); - void SetLogging(bool l) { logging = l; } - - bool IsValid() { return inited; } - bool IsLogging() { return logging; } - unsigned long GetThreshold() { return threshold; } - -protected: - vm_page *pages; - HANDLE vmemFile; - DWORD baseAddress; - unsigned long totalPages; - unsigned long pageSize; - unsigned long threshold; - unsigned long pageLRU; - - bool inited; - bool logging; - - // mutex to make sure pages aren't allocated/deallocated concurrently - RageMutex vmemMutex; -}; - -void *valloc(size_t size); -void vfree(void *ptr); - -//#define malloc(size) valloc(size) -//#define free(memblock) vfree(memblock) - -extern VirtualMemoryManager vmem_Manager; - -LONG _stdcall CheckPageFault(LPEXCEPTION_POINTERS e); -int NoMemory(size_t size); - -#endif - -/* - * (c) 2004 Ryan Dortmans - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ \ No newline at end of file diff --git a/src/archutils/Xbox/arch_setup.cpp b/src/archutils/Xbox/arch_setup.cpp deleted file mode 100644 index 017e1909b5..0000000000 --- a/src/archutils/Xbox/arch_setup.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "global.h" - -#undef main -void __cdecl main() -{ - int argc = 1; - char def[] = "default.xbe"; - char *argv[] = { def }; - int ret=SM_main( argc, argv ); -} - -#ifndef _DEBUG -//release xbox libs doesnt have these functions -FILE * __cdecl _popen(const char *, const char *) -{ - return NULL; -} - -int __cdecl _pclose(FILE *) -{ - return -1; -} - -char *getenv(const char *) -{ - return NULL; -} - -int __cdecl system(const char *) -{ - return -1; -} -#endif - -/* - * (c) 2006 Chris - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS 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 OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/archutils/Xbox/arch_setup.h b/src/archutils/Xbox/arch_setup.h deleted file mode 100644 index 4fc285b866..0000000000 --- a/src/archutils/Xbox/arch_setup.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ARCH_SETUP_XBOX_H -#define ARCH_SETUP_XBOX_H - -#include -#include -#include - -#if defined(_XDBG) -#include -#define IsDebuggerPresent() DmIsDebuggerPresent() -#endif - -// Xbox base path -#define SYS_BASE_PATH "D:\\" - -#define SUPPORT_D3D - -/* Stubs: */ -inline HRESULT CoInitialize( LPVOID pvReserved ) { return S_OK; } -inline void CoUninitialize() { } - -extern "C" int SM_main( int argc, char *argv[] ); -#define main(x,y) SM_main(x,y) - -#endif diff --git a/src/archutils/Xbox/custom_launch_params.cpp b/src/archutils/Xbox/custom_launch_params.cpp deleted file mode 100644 index 47716d2ca0..0000000000 --- a/src/archutils/Xbox/custom_launch_params.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include -#include "custom_launch_params.h" - -CUSTOM_LAUNCH_DATA g_launchData ; -int g_autoLaunchGame ; -int g_launchReturnXBE ; - -//XGetCustomLaunchData -// -//If there is a valid filename to load, then g_autoLaunchGame will be set to 1 -//If there is a valid return XBE, then g_launchReturnXBE will be set to 1 -int XGetCustomLaunchData() -{ - DWORD launchType; - - g_autoLaunchGame = 0 ; - g_launchReturnXBE = 0 ; - - memset( &g_launchData, 0, sizeof( CUSTOM_LAUNCH_DATA ) ) ; - - - if ( ( XGetLaunchInfo( &launchType,(PLAUNCH_DATA)&g_launchData) == ERROR_SUCCESS ) ) - { - if ( ( launchType == LDT_TITLE ) && ( g_launchData.magic == CUSTOM_LAUNCH_MAGIC ) ) - { - if ( g_launchData.szFilename[0] ) - g_autoLaunchGame = 1 ; - - if ( g_launchData.szLaunchXBEOnExit[0] ) - g_launchReturnXBE = 1 ; - - return 1 ; - } - } - - return 0 ; -} - -void XReturnToLaunchingXBE( ) -{ - if ( g_launchReturnXBE ) - { - LD_LAUNCH_DASHBOARD LaunchData = { XLD_LAUNCH_DASHBOARD_MAIN_MENU }; - } - else - { - LD_LAUNCH_DASHBOARD LaunchData = { XLD_LAUNCH_DASHBOARD_MAIN_MENU }; - - XLaunchNewImage( NULL, (LAUNCH_DATA*)&LaunchData ); - } -} - -#ifdef __cplusplus -extern "C" { -#endif - -void doReturn() -{ - XGetCustomLaunchData(); - XReturnToLaunchingXBE( ); -} - -#ifdef __cplusplus -} -#endif diff --git a/src/archutils/Xbox/custom_launch_params.h b/src/archutils/Xbox/custom_launch_params.h deleted file mode 100644 index 196c9ea6df..0000000000 --- a/src/archutils/Xbox/custom_launch_params.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef CUSTOM_LAUNCH_PARAMS_H -#define CUSTOM_LAUNCH_PARAMS_H - -#include - - -#define CUSTOM_LAUNCH_MAGIC 0xEE456777 - -#define COUNTRY_TYPE_AUTODETECT 0 -#define COUNTRY_TYPE_USA 1 -#define COUNTRY_TYPE_JAPAN 2 -#define COUNTRY_TYPE_EUROPE 3 -#define COUNTRY_TYPE_OTHER 4 - -typedef struct _CUSTOM_LAUNCH_DATA -{ - DWORD magic ; //populate this with CUSTOM_LAUNCH_MAGIC so we know we are using this special structure - char szFilename[300] ; //this is the path to the game to load upon startup - char szLaunchXBEOnExit[100] ; //this is the XBE name that should be launched when exiting the emu ( "FILE.XBE" ) - char szRemap_D_As[350] ; //this is what D drive should be mapped to in order to launch the XBE specified in szLaunchXBEOnExit ( "\\Device\\Harddisk0\\Partition1\\GAMES" ) - BYTE country ; //country code to use - BYTE launchInsertedMedia ; //should we auto-run the inserted CD/DVD ? - BYTE executionType ; //generic variable that determines how the emulator is run - for example, if you wish to run FMSXBOX as MSX1 or MSX2 or MSX2+ - char reserved[MAX_LAUNCH_DATA_SIZE-757] ; //MAX_LAUNCH_DATA_SIZE is 3KB - -} CUSTOM_LAUNCH_DATA, *PCUSTOM_LAUNCH_DATA; - -extern CUSTOM_LAUNCH_DATA g_launchData ; -extern int g_autoLaunchGame ; -extern int g_launchReturnXBE ; - - -int XGetCustomLaunchData() ; -void XReturnToLaunchingXBE( ); - -#endif diff --git a/src/archutils/Xbox/saveblue.XBX b/src/archutils/Xbox/saveblue.XBX deleted file mode 100644 index 3756c0c380f6412e889d152fb519008c2067f343..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18432 zcmeI336xgFvBxoSH=Aa0H!ewxMx%LdxUnw-vIiU^AVg6XNkkMy5i{UJW%U6%Aj2Yv z@Q{EYiYy5rC?LqN4v2sWvIssE6cqub^84Sp{pC{J;bUBqcXH@+YO1Tcx^8!U)qSh$ z_S{gf!Np~A%9JT{beS@Tl{uVBaXIhE-yf-(QN|rAhb(Z&0*5Sc$O4BfaL5AxQ5N9! zu6O*u1qd%Te3fU@zbM&X;Yw*C**{rFPw!Y)iv#IYA4*cD0D8=U`W$TA8E2dk&F9D? zkF;~oJ=flN;|&`+bSRIE%ig_F`^hJtY~#m|kC<0pd8JjVR4GUlKK|J3op*}y zhaZ})Txs^&Yii%;w`XkEC&!m;hkrq`t)%){XPp&|>*beUj&P7W{P4r=$tRyI9+Unu zehSTH#>99ZdG!nYfP=0iu3Wit)GseDPx5Blw-@8(%On1KAKuIsOCv~#D~=FMiSR+&whP)sjgY_?*B*)z|WJ@u4X{ra}IVME*Y;~$$97AinC zyZdf4#$mmBncZ`b?fK;|?X%NQw~tRb#oj;qXnW_|-?mMM9cJ%>w|?tewvo9BZ0uOG zcJ0ji^s(L5s@e84&$Nx$>7DO<$Nq-Ab?9I_F2308=9_IBKCm8NSVOGegTyjZf zx~b!rUuwRZLl}QdtFQWmB3mZ)MLwOFZ`5D5z3@V#h5)){9}$eCc>&m zh4)e7Jr?PO@AXIT)WA<-^zZ`PPd<9a2`8Lj8#iu@>NR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?;qIWiW zJAq$L(ccmNEchM3GgI12^Q<&kf8O3-Htw{lAAl1%7khbuXo~m*!btRdz7(%~OE%s9uu3u)pg5PMXX}-e=YNN2o$RdRHqcgvFjN=UiEaEe&xnf_ys9EZNFB?do|!eykBo;UsXP!b^LxS95W_r zFXGNeU;ba9CGW`Y+(Eq!tn-e}Kp|fc)uBT^pe}xXrpI?bln=O# zbIf1)Up3_esuG*4Xza>YC?7B&ju&?C+GP!hqmuaopAWd6_jg_17Xu%9D9RToA5fJT zCdvnJ-th6Nr}gLqf#fx|I96`qZS4EfzE3{DxBshYKi=?vDdIOL@9x_@&3J7-XQvGt zbZyJ*KK@^%B4C(uD} zHk=}_e83p*ub%e)>glAsasavbdvkoO5&0>ai z&*!W5%Ll~ys%rF6zN#{LfhzPZPhI%{*Bh6kv7Pc#>Z_vtav^6J@w4a)?a6PKftSIkL`|^|{f6H_ z`KqbpXqB(Jh&`bJxz1O()3-(c2OF2%+}tQ%6=;1gQ@&zw|Ni^s3zW-HK0tTnp67pT z%a<>odG? diff --git a/src/archutils/Xbox/savered.XBX b/src/archutils/Xbox/savered.XBX deleted file mode 100644 index 77d5f92e09680fbe8e20d30e44870bd8b74d2a07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18432 zcmeI(4b0!wRR{35aq?v(iWH*nG=_6F-z3F zIF~_v*>q%TvN0pUfea>WVhb&8R|@Sq#*j!1I<43+D8aSeX zBN{lOfg>6?qJi%#4Se~*&$pC!{pOpWR!=+d>Z{(>)WOt;W8sEvw8{mqe|^D|PCB`5 zyXCs}j*AmqU#}Eooqu~*8jZ8m$ZxL?rvcC z28L(G8xtL6{2P{irfq0@+s5g=HOFT^@%6Ul{aDRX&DA`{EHVD zWxZ)14vy)^?L&>9o?g)Bp=i>F@9fN6vwoj89gM%yRqrdht`mDiN7|W>UhRYZ7|T0u zhky1qZTvzD<_j+EA)KA=2T!KWU3v3C3Sf>pvb+g>(x-0GJto|mlO*mO^s`%@3J^V^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BJItbj6eYGXJPUj2k^OWN>r9PN12%o34g98T+^X-T0Tbd8J{`!tG zb?QG%J|HC}#f(AcqxlNW2R!qP8y6fueu8g=Tj0y5^96Q3pjx#DcwRJ>7hV`^@&%d? zC{-%OHXn_60@v2SJdD59c<#lXctQ?Eaef!&O;hS@=^0jQ&|4-BYIDPE@FGcBg z?ev+N*vEZ7EqnLsRD}PFJk1%h4*zjENzA!{v+HI2zhgp7j}hWW&q{aQb(ivu z&0rZj`+C7&Y1!uov9|H)fPAcvM7#v@nh)TAs`h!`ro;Z~=CYLM=d(`BYYxD1qU@{f z$VX{Rsj){RV&8j-gBx(ZZ%qEF1!wtId?VeIcu(^Obqx6VDmx!=I$zbm zXAZG%OTJlq3p0uI>(|fV{{8#2?=~U+p36IpKX9&aW8!Yzx|w=?kC({S1>j8|K0HHo z9Unc)hsoYmtXMJ8yp-zEOZUsQe5|bebJQJtcNy0Pm8fxj=<2Kg&E%`*&Rt;gRTV1S zNUpO5-}HURzVx~2Uw@*}sL5CP41Hgw`HE4aCdB0nG?$_I0R2|(9sXonyLRokF`VN( zg6+I~Rct-#f7RmloBZ@LZhw7+@&P~PeBt+@I=!;)X__=KeG~-yy1;1#Y4>x<{x@o6 B?;-#I diff --git a/src/crypto/CryptNoise.cpp b/src/crypto/CryptNoise.cpp index 4db065d162..f65cbe1810 100644 --- a/src/crypto/CryptNoise.cpp +++ b/src/crypto/CryptNoise.cpp @@ -5,16 +5,7 @@ #include "global.h" -#if defined(_XBOX) -void noise_get_heavy(void (*func) (void *, int)) -{ -} - -void noise_get_light(void (*func) (void *, int)) -{ -} - -#elif defined(_WINDOWS) +#if defined(_WINDOWS) #define _WIN32_WINNT 0x0400 // VC6 header needs this defined. #include #include diff --git a/src/ezsockets.cpp b/src/ezsockets.cpp index 188074b6fd..5b3bc56423 100644 --- a/src/ezsockets.cpp +++ b/src/ezsockets.cpp @@ -10,9 +10,9 @@ #include "ezsockets.h" -#if defined(_MSC_VER) && !defined(_XBOX) // We need the WinSock32 Library on Windows +#if defined(_MSC_VER) // We need the WinSock32 Library on Windows #pragma comment(lib,"wsock32.lib") -#elif !defined(__MINGW32__) && !defined(_XBOX) +#elif !defined(__MINGW32__) #include #include #include @@ -38,7 +38,7 @@ EzSockets::EzSockets() MAXCON = 5; memset (&addr,0,sizeof(addr)); //Clear the sockaddr_in structure -#if defined(_WINDOWS) || defined(_XBOX) // Windows REQUIRES WinSock Startup +#if defined(_WINDOWS) // Windows REQUIRES WinSock Startup WSAStartup( MAKEWORD(1,1), &wsda ); #endif @@ -61,11 +61,7 @@ EzSockets::~EzSockets() //Check to see if the socket has been created bool EzSockets::check() { -#if !defined(XBOX) return sock > SOCKET_NONE; -#else - return sock != INVALID_SOCKET; -#endif } bool EzSockets::create() @@ -82,13 +78,7 @@ bool EzSockets::create(int Protocol) case IPPROTO_UDP: return create(IPPROTO_UDP, SOCK_DGRAM); default: - /* XBOX does not support raw sockets. So, since there's no need, - we aren't going to allow it on the XBOX. */ -#if defined(_XBOX) - return false; -#else return create(Protocol, SOCK_RAW); -#endif } } @@ -97,14 +87,9 @@ bool EzSockets::create(int Protocol, int Type) state = skDISCONNECTED; sock = socket(AF_INET, Type, Protocol); lastCode = sock; -#if !defined(XBOX) - return sock > SOCKET_NONE; //Socket must be Greater than 0 -#else - return sock != INVALID_SOCKET; -#endif + return sock > SOCKET_NONE; // Socket must be Greater than 0 } - bool EzSockets::bind(unsigned short port) { if(!check()) @@ -184,32 +169,12 @@ bool EzSockets::connect(const std::string& host, unsigned short port) if(!check()) return false; -#if defined(_XBOX) - if(!isdigit(host[0])) // don't do a DNS lookup for an IP address - { - XNDNS *pxndns = NULL; - XNetDnsLookup(host.c_str(), NULL, &pxndns); - while (pxndns->iStatus == WSAEINPROGRESS) - { - // Do something else while lookup is in progress - } - - if (pxndns->iStatus == 0) - memcpy(&addr.sin_addr, &pxndns->aina[0], sizeof(struct in_addr)); - else - return false; - - XNetDnsRelease(pxndns); - } - else - addr.sin_addr.s_addr = inet_addr(host.c_str()); -#else struct hostent* phe; phe = gethostbyname(host.c_str()); if (phe == NULL) return false; memcpy(&addr.sin_addr, phe->h_addr, sizeof(struct in_addr)); -#endif + addr.sin_family = AF_INET; addr.sin_port = htons(port); @@ -266,7 +231,7 @@ void EzSockets::update() unsigned long EzSockets::LongFromAddrIn( const sockaddr_in & s ) { -#if defined(_XBOX) || defined(_WINDOWS) +#if defined(_WINDOWS) return ntohl(s.sin_addr.S_un.S_addr); #else return ntohl(s.sin_addr.s_addr); diff --git a/src/ezsockets.h b/src/ezsockets.h index 7c8893b84b..6e90313d67 100644 --- a/src/ezsockets.h +++ b/src/ezsockets.h @@ -19,15 +19,7 @@ #include #include -#if defined(_XBOX) -/* - * Summary : WinsockX is bad, XTL is good. - * Explained : WinsockX may rely on some declares that are present in XTL. - * Also, using XTL includes some files maybe needed for other operations - * on Xbox. - */ -#include -#elif defined(_WINDOWS) +#if defined(_WINDOWS) #include #else #include @@ -132,8 +124,8 @@ public: private: - // Only necessary for Windows and Xbox -#if defined(_WINDOWS) || defined(_XBOX) + // Only necessary for Windows +#if defined(_WINDOWS) WSADATA wsda; #endif diff --git a/src/global.cpp b/src/global.cpp index 946261b850..be38a84929 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -10,7 +10,6 @@ # include "archutils/Darwin/Crash.h" using CrashHandler::IsDebuggerPresent; using CrashHandler::DebugBreak; -#elif defined(XBOX) #else # include #endif diff --git a/src/libjpeg/jmorecfg.h b/src/libjpeg/jmorecfg.h index 93ccd1f84f..68a250c624 100644 --- a/src/libjpeg/jmorecfg.h +++ b/src/libjpeg/jmorecfg.h @@ -187,7 +187,7 @@ typedef unsigned int JDIMENSION; /* a function referenced thru EXTERNs: */ #define GLOBAL(type) type /* a reference to a GLOBAL function: */ -#if defined(WIN32) && !defined(XBOX) +#if defined(WIN32) # ifdef BUILDING_JPEG_DLL # define DLLIMPORT __declspec (dllexport) # else diff --git a/src/lua-5.1/src/luaconf.h b/src/lua-5.1/src/luaconf.h index 0ca4825551..732ac082de 100644 --- a/src/lua-5.1/src/luaconf.h +++ b/src/lua-5.1/src/luaconf.h @@ -700,11 +700,10 @@ union luai_Cast { double l_d; long l_l; }; #define LUA_DL_DLOPEN #endif -#if defined(LUA_WIN) && !defined(XBOX) +#if defined(LUA_WIN) #define LUA_DL_DLL #endif - /* @@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State @* (the data goes just *before* the lua_State pointer). diff --git a/src/sm-ssc_Xbox-net2003.sln b/src/sm-ssc_Xbox-net2003.sln deleted file mode 100644 index 60286bddd7..0000000000 --- a/src/sm-ssc_Xbox-net2003.sln +++ /dev/null @@ -1,53 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepManiaXbox-2003.vcproj", "{670745A6-106B-420D-A2A9-D4F89A23986E}" - ProjectSection(ProjectDependencies) = postProject - {15A6313B-3206-4847-87A2-62255F0B3837} = {15A6313B-3206-4847-87A2-62255F0B3837} - {00C33C79-1140-47B0-838B-109A61950513} = {00C33C79-1140-47B0-838B-109A61950513} - {CA22B79A-E8A9-4BFB-A297-42231F2213F2} = {CA22B79A-E8A9-4BFB-A297-42231F2213F2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xboxmad", "mad-0.15.1b\xboxmad\xboxmad-2003.vcproj", "{CA22B79A-E8A9-4BFB-A297-42231F2213F2}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtomcrypt", "libtomcrypt\libtomcryptXbox-net2003.vcproj", "{15A6313B-3206-4847-87A2-62255F0B3837}" - ProjectSection(ProjectDependencies) = postProject - {00C33C79-1140-47B0-838B-109A61950513} = {00C33C79-1140-47B0-838B-109A61950513} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath\libtommathXbox-net2003.vcproj", "{00C33C79-1140-47B0-838B-109A61950513}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(DPCodeReviewSolutionGUID) = preSolution - DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} - EndGlobalSection - GlobalSection(SolutionConfiguration) = preSolution - Debug Xbox = Debug Xbox - Release Xbox = Release Xbox - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug Xbox.ActiveCfg = Debug|Xbox - {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug Xbox.Build.0 = Debug|Xbox - {670745A6-106B-420D-A2A9-D4F89A23986E}.Release Xbox.ActiveCfg = Release|Xbox - {670745A6-106B-420D-A2A9-D4F89A23986E}.Release Xbox.Build.0 = Release|Xbox - {CA22B79A-E8A9-4BFB-A297-42231F2213F2}.Debug Xbox.ActiveCfg = Debug|Xbox - {CA22B79A-E8A9-4BFB-A297-42231F2213F2}.Debug Xbox.Build.0 = Debug|Xbox - {CA22B79A-E8A9-4BFB-A297-42231F2213F2}.Release Xbox.ActiveCfg = Release|Xbox - {CA22B79A-E8A9-4BFB-A297-42231F2213F2}.Release Xbox.Build.0 = Release|Xbox - {15A6313B-3206-4847-87A2-62255F0B3837}.Debug Xbox.ActiveCfg = Debug|Xbox - {15A6313B-3206-4847-87A2-62255F0B3837}.Debug Xbox.Build.0 = Debug|Xbox - {15A6313B-3206-4847-87A2-62255F0B3837}.Release Xbox.ActiveCfg = Release|Xbox - {15A6313B-3206-4847-87A2-62255F0B3837}.Release Xbox.Build.0 = Release|Xbox - {00C33C79-1140-47B0-838B-109A61950513}.Debug Xbox.ActiveCfg = Debug|Xbox - {00C33C79-1140-47B0-838B-109A61950513}.Debug Xbox.Build.0 = Debug|Xbox - {00C33C79-1140-47B0-838B-109A61950513}.Release Xbox.ActiveCfg = Release|Xbox - {00C33C79-1140-47B0-838B-109A61950513}.Release Xbox.Build.0 = Release|Xbox - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - DPBuild = 5 - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal