diff --git a/Assets/dll/SDL.dll b/Assets/dll/SDL.dll deleted file mode 100644 index dee47e810f..0000000000 Binary files a/Assets/dll/SDL.dll and /dev/null differ diff --git a/Assets/dll/freetype.dll b/Assets/dll/freetype.dll new file mode 100644 index 0000000000..a415cf3205 Binary files /dev/null and b/Assets/dll/freetype.dll differ diff --git a/Assets/dll/freetype26.dll b/Assets/dll/freetype26.dll deleted file mode 100644 index a867777df9..0000000000 Binary files a/Assets/dll/freetype26.dll and /dev/null differ diff --git a/Assets/dll/libpng16.dll b/Assets/dll/libpng16.dll index 48df548628..9311d7e6ea 100644 Binary files a/Assets/dll/libpng16.dll and b/Assets/dll/libpng16.dll differ diff --git a/Assets/dll/mupen64plus-audio-bkm.dll b/Assets/dll/mupen64plus-audio-bkm.dll index 00d1cd6c13..7fa0173907 100644 Binary files a/Assets/dll/mupen64plus-audio-bkm.dll and b/Assets/dll/mupen64plus-audio-bkm.dll differ diff --git a/Assets/dll/mupen64plus-input-bkm.dll b/Assets/dll/mupen64plus-input-bkm.dll index f3d8a91c19..780222ab22 100644 Binary files a/Assets/dll/mupen64plus-input-bkm.dll and b/Assets/dll/mupen64plus-input-bkm.dll differ diff --git a/Assets/dll/mupen64plus-rsp-hle.dll b/Assets/dll/mupen64plus-rsp-hle.dll index 28c52b7b43..abf7539791 100644 Binary files a/Assets/dll/mupen64plus-rsp-hle.dll and b/Assets/dll/mupen64plus-rsp-hle.dll differ diff --git a/Assets/dll/mupen64plus-video-glide64.dll b/Assets/dll/mupen64plus-video-glide64.dll index 3ba5d4438a..2a33988a47 100644 Binary files a/Assets/dll/mupen64plus-video-glide64.dll and b/Assets/dll/mupen64plus-video-glide64.dll differ diff --git a/Assets/dll/mupen64plus-video-glide64mk2.dll b/Assets/dll/mupen64plus-video-glide64mk2.dll index 36989cb4d3..3a3e7acaf5 100644 Binary files a/Assets/dll/mupen64plus-video-glide64mk2.dll and b/Assets/dll/mupen64plus-video-glide64mk2.dll differ diff --git a/Assets/dll/mupen64plus-video-rice.dll b/Assets/dll/mupen64plus-video-rice.dll index 6db618f9f2..b00251d6b0 100644 Binary files a/Assets/dll/mupen64plus-video-rice.dll and b/Assets/dll/mupen64plus-video-rice.dll differ diff --git a/Assets/dll/mupen64plus.dll b/Assets/dll/mupen64plus.dll index ba06e09c3c..5ecc047b97 100644 Binary files a/Assets/dll/mupen64plus.dll and b/Assets/dll/mupen64plus.dll differ diff --git a/Assets/dll/zlib.dll b/Assets/dll/zlib.dll index 1fa744bb6b..06cbb48385 100644 Binary files a/Assets/dll/zlib.dll and b/Assets/dll/zlib.dll differ diff --git a/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8.h b/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8.h deleted file mode 100644 index 2600282c16..0000000000 --- a/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8.h +++ /dev/null @@ -1,1279 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d8.h - * Content: Direct3D include file - * - ****************************************************************************/ - -#ifndef _D3D8_H_ -#define _D3D8_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX8 interfaces -#if(DIRECT3D_VERSION >= 0x0800) - - -/* This identifier is passed to Direct3DCreate8 in order to ensure that an - * application was built against the correct header files. This number is - * incremented whenever a header (or other) change would require applications - * to be rebuilt. If the version doesn't match, Direct3DCreate8 will fail. - * (The number itself has no meaning.)*/ - -#define D3D_SDK_VERSION 220 - - -#include - -#define COM_NO_WINDOWS_H -#include - -#include - -#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) - #define HMONITOR_DECLARED - DECLARE_HANDLE(HMONITOR); -#endif - -#define D3DAPI WINAPI - -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) - -/* IID_IDirect3D8 */ -/* {1DD9E8DA-1C77-4d40-B0CF-98FEFDFF9512} */ -DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12); - -/* IID_IDirect3DDevice8 */ -/* {7385E5DF-8FE8-41D5-86B6-D7B48547B6CF} */ -DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf); - -/* IID_IDirect3DResource8 */ -/* {1B36BB7B-09B7-410a-B445-7D1430D7B33F} */ -DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f); - -/* IID_IDirect3DBaseTexture8 */ -/* {B4211CFA-51B9-4a9f-AB78-DB99B2BB678E} */ -DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e); - -/* IID_IDirect3DTexture8 */ -/* {E4CDD575-2866-4f01-B12E-7EECE1EC9358} */ -DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58); - -/* IID_IDirect3DCubeTexture8 */ -/* {3EE5B968-2ACA-4c34-8BB5-7E0C3D19B750} */ -DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50); - -/* IID_IDirect3DVolumeTexture8 */ -/* {4B8AAAFA-140F-42ba-9131-597EAFAA2EAD} */ -DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad); - -/* IID_IDirect3DVertexBuffer8 */ -/* {8AEEEAC7-05F9-44d4-B591-000B0DF1CB95} */ -DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95); - -/* IID_IDirect3DIndexBuffer8 */ -/* {0E689C9A-053D-44a0-9D92-DB0E3D750F86} */ -DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86); - -/* IID_IDirect3DSurface8 */ -/* {B96EEBCA-B326-4ea5-882F-2FF5BAE021DD} */ -DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd); - -/* IID_IDirect3DVolume8 */ -/* {BD7349F5-14F1-42e4-9C79-972380DB40C0} */ -DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0); - -/* IID_IDirect3DSwapChain8 */ -/* {928C088B-76B9-4C6B-A536-A590853876CD} */ -DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd); - -#endif - -#ifdef __cplusplus - -interface IDirect3D8; -interface IDirect3DDevice8; - -interface IDirect3DResource8; -interface IDirect3DBaseTexture8; -interface IDirect3DTexture8; -interface IDirect3DVolumeTexture8; -interface IDirect3DCubeTexture8; - -interface IDirect3DVertexBuffer8; -interface IDirect3DIndexBuffer8; - -interface IDirect3DSurface8; -interface IDirect3DVolume8; - -interface IDirect3DSwapChain8; - -#endif - - -typedef interface IDirect3D8 IDirect3D8; -typedef interface IDirect3DDevice8 IDirect3DDevice8; -typedef interface IDirect3DResource8 IDirect3DResource8; -typedef interface IDirect3DBaseTexture8 IDirect3DBaseTexture8; -typedef interface IDirect3DTexture8 IDirect3DTexture8; -typedef interface IDirect3DVolumeTexture8 IDirect3DVolumeTexture8; -typedef interface IDirect3DCubeTexture8 IDirect3DCubeTexture8; -typedef interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8; -typedef interface IDirect3DIndexBuffer8 IDirect3DIndexBuffer8; -typedef interface IDirect3DSurface8 IDirect3DSurface8; -typedef interface IDirect3DVolume8 IDirect3DVolume8; -typedef interface IDirect3DSwapChain8 IDirect3DSwapChain8; - -#include "d3d8types.h" -#include "d3d8caps.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * DLL Function for creating a Direct3D8 object. This object supports - * enumeration and allows the creation of Direct3DDevice8 objects. - * Pass the value of the constant D3D_SDK_VERSION to this function, so - * that the run-time can validate that your application was compiled - * against the right headers. - */ - -IDirect3D8 * WINAPI Direct3DCreate8(UINT SDKVersion); - - -/* - * Direct3D interfaces - */ - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3D8 - -DECLARE_INTERFACE_(IDirect3D8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D8 methods ***/ - STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; - STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; - STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER8* pIdentifier) PURE; - STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter) PURE; - STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,UINT Mode,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE CheckType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL Windowed) PURE; - STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; - STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType) PURE; - STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS8* pCaps) PURE; - STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; - STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice8** ppReturnedDeviceInterface) PURE; -}; - -typedef struct IDirect3D8 *LPDIRECT3D8, *PDIRECT3D8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) -#define IDirect3D8_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) -#define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) -#define IDirect3D8_GetAdapterModeCount(p,a) (p)->lpVtbl->GetAdapterModeCount(p,a) -#define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->lpVtbl->EnumAdapterModes(p,a,b,c) -#define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) -#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) -#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) -#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e) -#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) -#define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) -#define IDirect3D8_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) -#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) -#else -#define IDirect3D8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D8_AddRef(p) (p)->AddRef() -#define IDirect3D8_Release(p) (p)->Release() -#define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) -#define IDirect3D8_GetAdapterCount(p) (p)->GetAdapterCount() -#define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) -#define IDirect3D8_GetAdapterModeCount(p,a) (p)->GetAdapterModeCount(a) -#define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->EnumAdapterModes(a,b,c) -#define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) -#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) -#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) -#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->CheckDeviceMultiSampleType(a,b,c,d,e) -#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) -#define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) -#define IDirect3D8_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) -#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) -#endif - - - - - - - - - - - - - - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DDevice8 - -DECLARE_INTERFACE_(IDirect3DDevice8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice8 methods ***/ - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; - STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes) PURE; - STDMETHOD(GetDirect3D)(THIS_ IDirect3D8** ppD3D8) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS8* pCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; - STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface8* pCursorBitmap) PURE; - STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; - STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; - STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain8** pSwapChain) PURE; - STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; - STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; - STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; - STDMETHOD_(void, GetGammaRamp)(THIS_ D3DGAMMARAMP* pRamp) PURE; - STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture8** ppTexture) PURE; - STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture8** ppVolumeTexture) PURE; - STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture8** ppCubeTexture) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer8** ppVertexBuffer) PURE; - STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer8** ppIndexBuffer) PURE; - STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,IDirect3DSurface8** ppSurface) PURE; - STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,IDirect3DSurface8** ppSurface) PURE; - STDMETHOD(CreateImageSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,IDirect3DSurface8** ppSurface) PURE; - STDMETHOD(CopyRects)(THIS_ IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) PURE; - STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture8* pSourceTexture,IDirect3DBaseTexture8* pDestinationTexture) PURE; - STDMETHOD(GetFrontBuffer)(THIS_ IDirect3DSurface8* pDestSurface) PURE; - STDMETHOD(SetRenderTarget)(THIS_ IDirect3DSurface8* pRenderTarget,IDirect3DSurface8* pNewZStencil) PURE; - STDMETHOD(GetRenderTarget)(THIS_ IDirect3DSurface8** ppRenderTarget) PURE; - STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface8** ppZStencilSurface) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; - STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT8* pViewport) PURE; - STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT8* pViewport) PURE; - STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL8* pMaterial) PURE; - STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL8* pMaterial) PURE; - STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT8*) PURE; - STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT8*) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; - STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; - STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; - STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; - STDMETHOD(BeginStateBlock)(THIS) PURE; - STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken) PURE; - STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token) PURE; - STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token) PURE; - STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token) PURE; - STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,DWORD* pToken) PURE; - STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS8* pClipStatus) PURE; - STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS8* pClipStatus) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8** ppTexture) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8* pTexture) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; - STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; - STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) PURE; - STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; - STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; - STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; - STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; - STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) PURE; - STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) PURE; - STDMETHOD(SetVertexShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle) PURE; - STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride) PURE; - STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) PURE; - STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) PURE; - STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) PURE; - STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,DWORD* pHandle) PURE; - STDMETHOD(SetPixelShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle) PURE; - STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; - STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; - STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; -}; - -typedef struct IDirect3DDevice8 *LPDIRECT3DDEVICE8, *PDIRECT3DDEVICE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice8_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) -#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->lpVtbl->ResourceManagerDiscardBytes(p,a) -#define IDirect3DDevice8_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) -#define IDirect3DDevice8_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) -#define IDirect3DDevice8_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) -#define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) -#define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) -#define IDirect3DDevice8_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) -#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) -#define IDirect3DDevice8_Reset(p,a) (p)->lpVtbl->Reset(p,a) -#define IDirect3DDevice8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) -#define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#define IDirect3DDevice8_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) -#define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b) -#define IDirect3DDevice8_GetGammaRamp(p,a) (p)->lpVtbl->GetGammaRamp(p,a) -#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g) -#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f) -#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f) -#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->lpVtbl->CreateImageSurface(p,a,b,c,d) -#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->lpVtbl->CopyRects(p,a,b,c,d,e) -#define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) -#define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->lpVtbl->GetFrontBuffer(p,a) -#define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice8_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) -#define IDirect3DDevice8_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice8_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) -#define IDirect3DDevice8_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice8_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice8_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DDevice8_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DDevice8_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DDevice8_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DDevice8_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) -#define IDirect3DDevice8_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) -#define IDirect3DDevice8_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) -#define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) -#define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) -#define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) -#define IDirect3DDevice8_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice8_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice8_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) -#define IDirect3DDevice8_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) -#define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) -#define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) -#define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) -#define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) -#define IDirect3DDevice8_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice8_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice8_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice8_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice8_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) -#define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) -#define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) -#define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) -#define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) -#define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) -#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) -#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d) -#define IDirect3DDevice8_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) -#define IDirect3DDevice8_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) -#define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->lpVtbl->DeleteVertexShader(p,a) -#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->lpVtbl->GetVertexShaderDeclaration(p,a,b,c) -#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->lpVtbl->GetVertexShaderFunction(p,a,b,c) -#define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->lpVtbl->SetStreamSource(p,a,b,c) -#define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->lpVtbl->GetStreamSource(p,a,b,c) -#define IDirect3DDevice8_SetIndices(p,a,b) (p)->lpVtbl->SetIndices(p,a,b) -#define IDirect3DDevice8_GetIndices(p,a,b) (p)->lpVtbl->GetIndices(p,a,b) -#define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) -#define IDirect3DDevice8_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) -#define IDirect3DDevice8_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) -#define IDirect3DDevice8_DeletePixelShader(p,a) (p)->lpVtbl->DeletePixelShader(p,a) -#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->lpVtbl->GetPixelShaderFunction(p,a,b,c) -#define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) -#define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) -#define IDirect3DDevice8_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) -#else -#define IDirect3DDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice8_AddRef(p) (p)->AddRef() -#define IDirect3DDevice8_Release(p) (p)->Release() -#define IDirect3DDevice8_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() -#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->ResourceManagerDiscardBytes(a) -#define IDirect3DDevice8_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) -#define IDirect3DDevice8_GetDisplayMode(p,a) (p)->GetDisplayMode(a) -#define IDirect3DDevice8_GetCreationParameters(p,a) (p)->GetCreationParameters(a) -#define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) -#define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) -#define IDirect3DDevice8_ShowCursor(p,a) (p)->ShowCursor(a) -#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) -#define IDirect3DDevice8_Reset(p,a) (p)->Reset(a) -#define IDirect3DDevice8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) -#define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) -#define IDirect3DDevice8_GetRasterStatus(p,a) (p)->GetRasterStatus(a) -#define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->SetGammaRamp(a,b) -#define IDirect3DDevice8_GetGammaRamp(p,a) (p)->GetGammaRamp(a) -#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->CreateTexture(a,b,c,d,e,f,g) -#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->CreateCubeTexture(a,b,c,d,e,f) -#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->CreateVertexBuffer(a,b,c,d,e) -#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->CreateIndexBuffer(a,b,c,d,e) -#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->CreateRenderTarget(a,b,c,d,e,f) -#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->CreateDepthStencilSurface(a,b,c,d,e) -#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->CreateImageSurface(a,b,c,d) -#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->CopyRects(a,b,c,d,e) -#define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) -#define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->GetFrontBuffer(a) -#define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice8_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) -#define IDirect3DDevice8_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice8_EndScene(p) (p)->EndScene() -#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) -#define IDirect3DDevice8_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice8_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice8_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DDevice8_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DDevice8_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DDevice8_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DDevice8_SetLight(p,a,b) (p)->SetLight(a,b) -#define IDirect3DDevice8_GetLight(p,a,b) (p)->GetLight(a,b) -#define IDirect3DDevice8_LightEnable(p,a,b) (p)->LightEnable(a,b) -#define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) -#define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) -#define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) -#define IDirect3DDevice8_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice8_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice8_BeginStateBlock(p) (p)->BeginStateBlock() -#define IDirect3DDevice8_EndStateBlock(p,a) (p)->EndStateBlock(a) -#define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) -#define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) -#define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) -#define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) -#define IDirect3DDevice8_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice8_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice8_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice8_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice8_ValidateDevice(p,a) (p)->ValidateDevice(a) -#define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) -#define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) -#define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) -#define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) -#define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) -#define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) -#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->DrawIndexedPrimitive(a,b,c,d,e) -#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) -#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->ProcessVertices(a,b,c,d,e) -#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->CreateVertexShader(a,b,c,d) -#define IDirect3DDevice8_SetVertexShader(p,a) (p)->SetVertexShader(a) -#define IDirect3DDevice8_GetVertexShader(p,a) (p)->GetVertexShader(a) -#define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->DeleteVertexShader(a) -#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->SetVertexShaderConstant(a,b,c) -#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->GetVertexShaderConstant(a,b,c) -#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->GetVertexShaderDeclaration(a,b,c) -#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->GetVertexShaderFunction(a,b,c) -#define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->SetStreamSource(a,b,c) -#define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->GetStreamSource(a,b,c) -#define IDirect3DDevice8_SetIndices(p,a,b) (p)->SetIndices(a,b) -#define IDirect3DDevice8_GetIndices(p,a,b) (p)->GetIndices(a,b) -#define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) -#define IDirect3DDevice8_SetPixelShader(p,a) (p)->SetPixelShader(a) -#define IDirect3DDevice8_GetPixelShader(p,a) (p)->GetPixelShader(a) -#define IDirect3DDevice8_DeletePixelShader(p,a) (p)->DeletePixelShader(a) -#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->SetPixelShaderConstant(a,b,c) -#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->GetPixelShaderConstant(a,b,c) -#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->GetPixelShaderFunction(a,b,c) -#define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) -#define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) -#define IDirect3DDevice8_DeletePatch(p,a) (p)->DeletePatch(a) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DSwapChain8 - -DECLARE_INTERFACE_(IDirect3DSwapChain8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DSwapChain8 methods ***/ - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; -}; - -typedef struct IDirect3DSwapChain8 *LPDIRECT3DSWAPCHAIN8, *PDIRECT3DSWAPCHAIN8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSwapChain8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSwapChain8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) -#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#else -#define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSwapChain8_AddRef(p) (p)->AddRef() -#define IDirect3DSwapChain8_Release(p) (p)->Release() -#define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) -#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DResource8 - -DECLARE_INTERFACE_(IDirect3DResource8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; -}; - -typedef struct IDirect3DResource8 *LPDIRECT3DRESOURCE8, *PDIRECT3DRESOURCE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DResource8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DResource8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DResource8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DResource8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DResource8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DResource8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DResource8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DResource8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DResource8_GetType(p) (p)->lpVtbl->GetType(p) -#else -#define IDirect3DResource8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DResource8_AddRef(p) (p)->AddRef() -#define IDirect3DResource8_Release(p) (p)->Release() -#define IDirect3DResource8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DResource8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DResource8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DResource8_GetPriority(p) (p)->GetPriority() -#define IDirect3DResource8_PreLoad(p) (p)->PreLoad() -#define IDirect3DResource8_GetType(p) (p)->GetType() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DBaseTexture8 - -DECLARE_INTERFACE_(IDirect3DBaseTexture8, IDirect3DResource8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; -}; - -typedef struct IDirect3DBaseTexture8 *LPDIRECT3DBASETEXTURE8, *PDIRECT3DBASETEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DBaseTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DBaseTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DBaseTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DBaseTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DBaseTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DBaseTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DBaseTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DBaseTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DBaseTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DBaseTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#else -#define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DBaseTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DBaseTexture8_Release(p) (p)->Release() -#define IDirect3DBaseTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DBaseTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DBaseTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DBaseTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DBaseTexture8_GetType(p) (p)->GetType() -#define IDirect3DBaseTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DBaseTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DBaseTexture8_GetLevelCount(p) (p)->GetLevelCount() -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DTexture8 - -DECLARE_INTERFACE_(IDirect3DTexture8, IDirect3DBaseTexture8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface8** ppSurfaceLevel) PURE; - STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; - STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; -}; - -typedef struct IDirect3DTexture8 *LPDIRECT3DTEXTURE8, *PDIRECT3DTEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) -#define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) -#define IDirect3DTexture8_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) -#define IDirect3DTexture8_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) -#else -#define IDirect3DTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DTexture8_Release(p) (p)->Release() -#define IDirect3DTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DTexture8_GetType(p) (p)->GetType() -#define IDirect3DTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DTexture8_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) -#define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) -#define IDirect3DTexture8_UnlockRect(p,a) (p)->UnlockRect(a) -#define IDirect3DTexture8_AddDirtyRect(p,a) (p)->AddDirtyRect(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVolumeTexture8 - -DECLARE_INTERFACE_(IDirect3DVolumeTexture8, IDirect3DBaseTexture8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; - STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume8** ppVolumeLevel) PURE; - STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; - STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; - STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; -}; - -typedef struct IDirect3DVolumeTexture8 *LPDIRECT3DVOLUMETEXTURE8, *PDIRECT3DVOLUMETEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVolumeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVolumeTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DVolumeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DVolumeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DVolumeTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DVolumeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) -#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) -#define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) -#define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) -#else -#define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVolumeTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DVolumeTexture8_Release(p) (p)->Release() -#define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DVolumeTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DVolumeTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DVolumeTexture8_GetType(p) (p)->GetType() -#define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DVolumeTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) -#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) -#define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->UnlockBox(a) -#define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->AddDirtyBox(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DCubeTexture8 - -DECLARE_INTERFACE_(IDirect3DCubeTexture8, IDirect3DBaseTexture8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface) PURE; - STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; - STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; -}; - -typedef struct IDirect3DCubeTexture8 *LPDIRECT3DCUBETEXTURE8, *PDIRECT3DCUBETEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DCubeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DCubeTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DCubeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DCubeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DCubeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DCubeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DCubeTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DCubeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DCubeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DCubeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) -#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) -#define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) -#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) -#else -#define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DCubeTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DCubeTexture8_Release(p) (p)->Release() -#define IDirect3DCubeTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DCubeTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DCubeTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DCubeTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DCubeTexture8_GetType(p) (p)->GetType() -#define IDirect3DCubeTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DCubeTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DCubeTexture8_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) -#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) -#define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->UnlockRect(a,b) -#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer8 - -DECLARE_INTERFACE_(IDirect3DVertexBuffer8, IDirect3DResource8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; -}; - -typedef struct IDirect3DVertexBuffer8 *LPDIRECT3DVERTEXBUFFER8, *PDIRECT3DVERTEXBUFFER8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DVertexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DVertexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DVertexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirect3DVertexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#else -#define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer8_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer8_Release(p) (p)->Release() -#define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DVertexBuffer8_GetPriority(p) (p)->GetPriority() -#define IDirect3DVertexBuffer8_PreLoad(p) (p)->PreLoad() -#define IDirect3DVertexBuffer8_GetType(p) (p)->GetType() -#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirect3DVertexBuffer8_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->GetDesc(a) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DIndexBuffer8 - -DECLARE_INTERFACE_(IDirect3DIndexBuffer8, IDirect3DResource8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; -}; - -typedef struct IDirect3DIndexBuffer8 *LPDIRECT3DINDEXBUFFER8, *PDIRECT3DINDEXBUFFER8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DIndexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DIndexBuffer8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DIndexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DIndexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DIndexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirect3DIndexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#else -#define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DIndexBuffer8_AddRef(p) (p)->AddRef() -#define IDirect3DIndexBuffer8_Release(p) (p)->Release() -#define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DIndexBuffer8_GetPriority(p) (p)->GetPriority() -#define IDirect3DIndexBuffer8_PreLoad(p) (p)->PreLoad() -#define IDirect3DIndexBuffer8_GetType(p) (p)->GetType() -#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirect3DIndexBuffer8_Unlock(p) (p)->Unlock() -#define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->GetDesc(a) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DSurface8 - -DECLARE_INTERFACE_(IDirect3DSurface8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DSurface8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; - STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS) PURE; -}; - -typedef struct IDirect3DSurface8 *LPDIRECT3DSURFACE8, *PDIRECT3DSURFACE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSurface8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSurface8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSurface8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSurface8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DSurface8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DSurface8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) -#define IDirect3DSurface8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#define IDirect3DSurface8_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) -#define IDirect3DSurface8_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) -#else -#define IDirect3DSurface8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSurface8_AddRef(p) (p)->AddRef() -#define IDirect3DSurface8_Release(p) (p)->Release() -#define IDirect3DSurface8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DSurface8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DSurface8_GetContainer(p,a,b) (p)->GetContainer(a,b) -#define IDirect3DSurface8_GetDesc(p,a) (p)->GetDesc(a) -#define IDirect3DSurface8_LockRect(p,a,b,c) (p)->LockRect(a,b,c) -#define IDirect3DSurface8_UnlockRect(p) (p)->UnlockRect() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVolume8 - -DECLARE_INTERFACE_(IDirect3DVolume8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVolume8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; - STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; - STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; - STDMETHOD(UnlockBox)(THIS) PURE; -}; - -typedef struct IDirect3DVolume8 *LPDIRECT3DVOLUME8, *PDIRECT3DVOLUME8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVolume8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVolume8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVolume8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVolume8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVolume8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVolume8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) -#define IDirect3DVolume8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#define IDirect3DVolume8_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) -#define IDirect3DVolume8_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) -#else -#define IDirect3DVolume8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVolume8_AddRef(p) (p)->AddRef() -#define IDirect3DVolume8_Release(p) (p)->Release() -#define IDirect3DVolume8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVolume8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVolume8_GetContainer(p,a,b) (p)->GetContainer(a,b) -#define IDirect3DVolume8_GetDesc(p,a) (p)->GetDesc(a) -#define IDirect3DVolume8_LockBox(p,a,b,c) (p)->LockBox(a,b,c) -#define IDirect3DVolume8_UnlockBox(p) (p)->UnlockBox() -#endif - -/**************************************************************************** - * Flags for SetPrivateData method on all D3D8 interfaces - * - * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData - * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this - * pointer and Release when the private data is destroyed. The data will be - * destroyed when another SetPrivateData with the same GUID is set, when - * FreePrivateData is called, or when the D3D8 object is freed. - ****************************************************************************/ -#define D3DSPD_IUNKNOWN 0x00000001L - -/**************************************************************************** - * - * Parameter for IDirect3D8 Enum and GetCaps8 functions to get the info for - * the current mode only. - * - ****************************************************************************/ - -#define D3DCURRENT_DISPLAY_MODE 0x00EFFFFFL - -/**************************************************************************** - * - * Flags for IDirect3D8::CreateDevice's BehaviorFlags - * - ****************************************************************************/ - -#define D3DCREATE_FPU_PRESERVE 0x00000002L -#define D3DCREATE_MULTITHREADED 0x00000004L - -#define D3DCREATE_PUREDEVICE 0x00000010L -#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L -#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L -#define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L - -#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L - - -/**************************************************************************** - * - * Parameter for IDirect3D8::CreateDevice's iAdapter - * - ****************************************************************************/ - -#define D3DADAPTER_DEFAULT 0 - -/**************************************************************************** - * - * Flags for IDirect3D8::EnumAdapters - * - ****************************************************************************/ - -#define D3DENUM_NO_WHQL_LEVEL 0x00000002L - -/**************************************************************************** - * - * Maximum number of back-buffers supported in DX8 - * - ****************************************************************************/ - -#define D3DPRESENT_BACK_BUFFERS_MAX 3L - -/**************************************************************************** - * - * Flags for IDirect3DDevice8::SetGammaRamp - * - ****************************************************************************/ - -#define D3DSGR_NO_CALIBRATION 0x00000000L -#define D3DSGR_CALIBRATE 0x00000001L - -/**************************************************************************** - * - * Flags for IDirect3DDevice8::SetCursorPosition - * - ****************************************************************************/ - -#define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L - -/**************************************************************************** - * - * Flags for DrawPrimitive/DrawIndexedPrimitive - * Also valid for Begin/BeginIndexed - * Also valid for VertexBuffer::CreateVertexBuffer - ****************************************************************************/ - - -/* - * DirectDraw error codes - */ -#define _FACD3D 0x876 -#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) - -/* - * Direct3D Errors - */ -#define D3D_OK S_OK - -#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) -#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) -#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) -#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) -#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) -#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) -#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) -#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) -#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) -#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) -#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) -#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) - -#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) -#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) -#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) -#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) -#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) -#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) -#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) -#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) -#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) - -#ifdef __cplusplus -}; -#endif - -#endif /* (DIRECT3D_VERSION >= 0x0800) */ -#endif /* _D3D_H_ */ - diff --git a/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8caps.h b/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8caps.h deleted file mode 100644 index 6a7dc115bf..0000000000 --- a/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8caps.h +++ /dev/null @@ -1,364 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d8caps.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3D8CAPS_H -#define _D3D8CAPS_H - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX8 interfaces -#if(DIRECT3D_VERSION >= 0x0800) - -#if defined(_X86_) || defined(_IA64_) -#pragma pack(4) -#endif - -typedef struct _D3DCAPS8 -{ - /* Device Info */ - D3DDEVTYPE DeviceType; - UINT AdapterOrdinal; - - /* Caps from DX7 Draw */ - DWORD Caps; - DWORD Caps2; - DWORD Caps3; - DWORD PresentationIntervals; - - /* Cursor Caps */ - DWORD CursorCaps; - - /* 3D Device Caps */ - DWORD DevCaps; - - DWORD PrimitiveMiscCaps; - DWORD RasterCaps; - DWORD ZCmpCaps; - DWORD SrcBlendCaps; - DWORD DestBlendCaps; - DWORD AlphaCmpCaps; - DWORD ShadeCaps; - DWORD TextureCaps; - DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's - DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's - DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's - DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's - DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's - - DWORD LineCaps; // D3DLINECAPS - - DWORD MaxTextureWidth, MaxTextureHeight; - DWORD MaxVolumeExtent; - - DWORD MaxTextureRepeat; - DWORD MaxTextureAspectRatio; - DWORD MaxAnisotropy; - float MaxVertexW; - - float GuardBandLeft; - float GuardBandTop; - float GuardBandRight; - float GuardBandBottom; - - float ExtentsAdjust; - DWORD StencilCaps; - - DWORD FVFCaps; - DWORD TextureOpCaps; - DWORD MaxTextureBlendStages; - DWORD MaxSimultaneousTextures; - - DWORD VertexProcessingCaps; - DWORD MaxActiveLights; - DWORD MaxUserClipPlanes; - DWORD MaxVertexBlendMatrices; - DWORD MaxVertexBlendMatrixIndex; - - float MaxPointSize; - - DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call - DWORD MaxVertexIndex; - DWORD MaxStreams; - DWORD MaxStreamStride; // max stride for SetStreamSource - - DWORD VertexShaderVersion; - DWORD MaxVertexShaderConst; // number of vertex shader constant registers - - DWORD PixelShaderVersion; - float MaxPixelShaderValue; // max value of pixel shader arithmetic component - -} D3DCAPS8; - -// -// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS -// - -// -// Caps -// -#define D3DCAPS_READ_SCANLINE 0x00020000L - -// -// Caps2 -// -#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L -#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L -#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L -#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L -#define D3DCAPS2_RESERVED 0x02000000L -#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L -#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L - -// -// Caps3 -// -#define D3DCAPS3_RESERVED 0x8000001fL - -// Indicates that the device can respect the ALPHABLENDENABLE render state -// when fullscreen while using the FLIP or DISCARD swap effect. -// COPY and COPYVSYNC swap effects work whether or not this flag is set. -#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L - -// -// PresentationIntervals -// -#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L -#define D3DPRESENT_INTERVAL_ONE 0x00000001L -#define D3DPRESENT_INTERVAL_TWO 0x00000002L -#define D3DPRESENT_INTERVAL_THREE 0x00000004L -#define D3DPRESENT_INTERVAL_FOUR 0x00000008L -#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L - -// -// CursorCaps -// -// Driver supports HW color cursor in at least hi-res modes(height >=400) -#define D3DCURSORCAPS_COLOR 0x00000001L -// Driver supports HW cursor also in low-res modes(height < 400) -#define D3DCURSORCAPS_LOWRES 0x00000002L - -// -// DevCaps -// -#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ -#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ -#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ -#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ -#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ -#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ -#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ -#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ -#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ -#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ -#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ -#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ -#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ -#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ -#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ -#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ -#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ -#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */ -#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ -#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ - -// -// PrimitiveMiscCaps -// -#define D3DPMISCCAPS_MASKZ 0x00000002L -#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L -#define D3DPMISCCAPS_CULLNONE 0x00000010L -#define D3DPMISCCAPS_CULLCW 0x00000020L -#define D3DPMISCCAPS_CULLCCW 0x00000040L -#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L -#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ -#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ -#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ -#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ -#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ - -// -// LineCaps -// -#define D3DLINECAPS_TEXTURE 0x00000001L -#define D3DLINECAPS_ZTEST 0x00000002L -#define D3DLINECAPS_BLEND 0x00000004L -#define D3DLINECAPS_ALPHACMP 0x00000008L -#define D3DLINECAPS_FOG 0x00000010L - -// -// RasterCaps -// -#define D3DPRASTERCAPS_DITHER 0x00000001L -#define D3DPRASTERCAPS_PAT 0x00000008L -#define D3DPRASTERCAPS_ZTEST 0x00000010L -#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L -#define D3DPRASTERCAPS_FOGTABLE 0x00000100L -#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L -#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L -#define D3DPRASTERCAPS_ZBIAS 0x00004000L -#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L -#define D3DPRASTERCAPS_FOGRANGE 0x00010000L -#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L -#define D3DPRASTERCAPS_WBUFFER 0x00040000L -#define D3DPRASTERCAPS_WFOG 0x00100000L -#define D3DPRASTERCAPS_ZFOG 0x00200000L -#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ -#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L - -// -// ZCmpCaps, AlphaCmpCaps -// -#define D3DPCMPCAPS_NEVER 0x00000001L -#define D3DPCMPCAPS_LESS 0x00000002L -#define D3DPCMPCAPS_EQUAL 0x00000004L -#define D3DPCMPCAPS_LESSEQUAL 0x00000008L -#define D3DPCMPCAPS_GREATER 0x00000010L -#define D3DPCMPCAPS_NOTEQUAL 0x00000020L -#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L -#define D3DPCMPCAPS_ALWAYS 0x00000080L - -// -// SourceBlendCaps, DestBlendCaps -// -#define D3DPBLENDCAPS_ZERO 0x00000001L -#define D3DPBLENDCAPS_ONE 0x00000002L -#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L -#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L -#define D3DPBLENDCAPS_SRCALPHA 0x00000010L -#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L -#define D3DPBLENDCAPS_DESTALPHA 0x00000040L -#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L -#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L -#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L -#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L -#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L -#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L - -// -// ShadeCaps -// -#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L -#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L -#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L -#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L - -// -// TextureCaps -// -#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ -#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ -#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ -#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ -#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ -#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ -// Device can use non-POW2 textures if: -// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage -// 2) D3DRS_WRAP(N) is zero for this texture's coordinates -// 3) mip mapping is not enabled (use magnification filter only) -#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L -#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ -#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ -#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */ -#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */ -#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */ -#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ -#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ -#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ - -// -// TextureFilterCaps -// -#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ -#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L -#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L -#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ -#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L -#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ -#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L -#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L -#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L -#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L - -// -// TextureAddressCaps -// -#define D3DPTADDRESSCAPS_WRAP 0x00000001L -#define D3DPTADDRESSCAPS_MIRROR 0x00000002L -#define D3DPTADDRESSCAPS_CLAMP 0x00000004L -#define D3DPTADDRESSCAPS_BORDER 0x00000008L -#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L -#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L - -// -// StencilCaps -// -#define D3DSTENCILCAPS_KEEP 0x00000001L -#define D3DSTENCILCAPS_ZERO 0x00000002L -#define D3DSTENCILCAPS_REPLACE 0x00000004L -#define D3DSTENCILCAPS_INCRSAT 0x00000008L -#define D3DSTENCILCAPS_DECRSAT 0x00000010L -#define D3DSTENCILCAPS_INVERT 0x00000020L -#define D3DSTENCILCAPS_INCR 0x00000040L -#define D3DSTENCILCAPS_DECR 0x00000080L - -// -// TextureOpCaps -// -#define D3DTEXOPCAPS_DISABLE 0x00000001L -#define D3DTEXOPCAPS_SELECTARG1 0x00000002L -#define D3DTEXOPCAPS_SELECTARG2 0x00000004L -#define D3DTEXOPCAPS_MODULATE 0x00000008L -#define D3DTEXOPCAPS_MODULATE2X 0x00000010L -#define D3DTEXOPCAPS_MODULATE4X 0x00000020L -#define D3DTEXOPCAPS_ADD 0x00000040L -#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L -#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L -#define D3DTEXOPCAPS_SUBTRACT 0x00000200L -#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L -#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L -#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L -#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L -#define D3DTEXOPCAPS_PREMODULATE 0x00010000L -#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L -#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L -#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L -#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L -#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L -#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L -#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L -#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L -#define D3DTEXOPCAPS_LERP 0x02000000L - -// -// FVFCaps -// -#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ -#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ -#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ - -// -// VertexProcessingCaps -// -#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ -#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ -#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ -#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */ -#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */ -#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */ -#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */ - -#pragma pack() - -#endif /* (DIRECT3D_VERSION >= 0x0800) */ -#endif /* _D3D8CAPS_H_ */ - diff --git a/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8types.h b/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8types.h deleted file mode 100644 index 0303762ccf..0000000000 --- a/libmupen64plus/D3D8Interceptor/D3D8Base/d3d8types.h +++ /dev/null @@ -1,1684 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d8types.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3D8TYPES_H_ -#define _D3D8TYPES_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX8 interfaces -#if(DIRECT3D_VERSION >= 0x0800) - -#include - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // anonymous unions warning -#if defined(_X86_) || defined(_IA64_) -#pragma pack(4) -#endif - -// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif - -// maps unsigned 8 bits/channel to D3DCOLOR -#define D3DCOLOR_ARGB(a,r,g,b) \ - ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) -#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) -#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) - -// maps floating point channels (0.f to 1.f range) to D3DCOLOR -#define D3DCOLOR_COLORVALUE(r,g,b,a) \ - D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) - - -#ifndef D3DVECTOR_DEFINED -typedef struct _D3DVECTOR { - float x; - float y; - float z; -} D3DVECTOR; -#define D3DVECTOR_DEFINED -#endif - -#ifndef D3DCOLORVALUE_DEFINED -typedef struct _D3DCOLORVALUE { - float r; - float g; - float b; - float a; -} D3DCOLORVALUE; -#define D3DCOLORVALUE_DEFINED -#endif - -#ifndef D3DRECT_DEFINED -typedef struct _D3DRECT { - LONG x1; - LONG y1; - LONG x2; - LONG y2; -} D3DRECT; -#define D3DRECT_DEFINED -#endif - -#ifndef D3DMATRIX_DEFINED -typedef struct _D3DMATRIX { - union { - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - float _41, _42, _43, _44; - - }; - float m[4][4]; - }; -} D3DMATRIX; -#define D3DMATRIX_DEFINED -#endif - -typedef struct _D3DVIEWPORT8 { - DWORD X; - DWORD Y; /* Viewport Top left */ - DWORD Width; - DWORD Height; /* Viewport Dimensions */ - float MinZ; /* Min/max of clip Volume */ - float MaxZ; -} D3DVIEWPORT8; - -/* - * Values for clip fields. - */ - -// Max number of user clipping planes, supported in D3D. -#define D3DMAXUSERCLIPPLANES 32 - -// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE -// -#define D3DCLIPPLANE0 (1 << 0) -#define D3DCLIPPLANE1 (1 << 1) -#define D3DCLIPPLANE2 (1 << 2) -#define D3DCLIPPLANE3 (1 << 3) -#define D3DCLIPPLANE4 (1 << 4) -#define D3DCLIPPLANE5 (1 << 5) - -// The following bits are used in the ClipUnion and ClipIntersection -// members of the D3DCLIPSTATUS8 -// - -#define D3DCS_LEFT 0x00000001L -#define D3DCS_RIGHT 0x00000002L -#define D3DCS_TOP 0x00000004L -#define D3DCS_BOTTOM 0x00000008L -#define D3DCS_FRONT 0x00000010L -#define D3DCS_BACK 0x00000020L -#define D3DCS_PLANE0 0x00000040L -#define D3DCS_PLANE1 0x00000080L -#define D3DCS_PLANE2 0x00000100L -#define D3DCS_PLANE3 0x00000200L -#define D3DCS_PLANE4 0x00000400L -#define D3DCS_PLANE5 0x00000800L - -#define D3DCS_ALL (D3DCS_LEFT | \ - D3DCS_RIGHT | \ - D3DCS_TOP | \ - D3DCS_BOTTOM | \ - D3DCS_FRONT | \ - D3DCS_BACK | \ - D3DCS_PLANE0 | \ - D3DCS_PLANE1 | \ - D3DCS_PLANE2 | \ - D3DCS_PLANE3 | \ - D3DCS_PLANE4 | \ - D3DCS_PLANE5) - -typedef struct _D3DCLIPSTATUS8 { - DWORD ClipUnion; - DWORD ClipIntersection; -} D3DCLIPSTATUS8; - -typedef struct _D3DMATERIAL8 { - D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE Ambient; /* Ambient color RGB */ - D3DCOLORVALUE Specular; /* Specular 'shininess' */ - D3DCOLORVALUE Emissive; /* Emissive color RGB */ - float Power; /* Sharpness if specular highlight */ -} D3DMATERIAL8; - -typedef enum _D3DLIGHTTYPE { - D3DLIGHT_POINT = 1, - D3DLIGHT_SPOT = 2, - D3DLIGHT_DIRECTIONAL = 3, - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTTYPE; - -typedef struct _D3DLIGHT8 { - D3DLIGHTTYPE Type; /* Type of light source */ - D3DCOLORVALUE Diffuse; /* Diffuse color of light */ - D3DCOLORVALUE Specular; /* Specular color of light */ - D3DCOLORVALUE Ambient; /* Ambient color of light */ - D3DVECTOR Position; /* Position in world space */ - D3DVECTOR Direction; /* Direction in world space */ - float Range; /* Cutoff range */ - float Falloff; /* Falloff */ - float Attenuation0; /* Constant attenuation */ - float Attenuation1; /* Linear attenuation */ - float Attenuation2; /* Quadratic attenuation */ - float Theta; /* Inner angle of spotlight cone */ - float Phi; /* Outer angle of spotlight cone */ -} D3DLIGHT8; - -/* - * Options for clearing - */ -#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ -#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ -#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ - -/* - * The following defines the rendering states - */ - -typedef enum _D3DSHADEMODE { - D3DSHADE_FLAT = 1, - D3DSHADE_GOURAUD = 2, - D3DSHADE_PHONG = 3, - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSHADEMODE; - -typedef enum _D3DFILLMODE { - D3DFILL_POINT = 1, - D3DFILL_WIREFRAME = 2, - D3DFILL_SOLID = 3, - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFILLMODE; - -typedef struct _D3DLINEPATTERN { - WORD wRepeatFactor; - WORD wLinePattern; -} D3DLINEPATTERN; - -typedef enum _D3DBLEND { - D3DBLEND_ZERO = 1, - D3DBLEND_ONE = 2, - D3DBLEND_SRCCOLOR = 3, - D3DBLEND_INVSRCCOLOR = 4, - D3DBLEND_SRCALPHA = 5, - D3DBLEND_INVSRCALPHA = 6, - D3DBLEND_DESTALPHA = 7, - D3DBLEND_INVDESTALPHA = 8, - D3DBLEND_DESTCOLOR = 9, - D3DBLEND_INVDESTCOLOR = 10, - D3DBLEND_SRCALPHASAT = 11, - D3DBLEND_BOTHSRCALPHA = 12, - D3DBLEND_BOTHINVSRCALPHA = 13, - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLEND; - -typedef enum _D3DBLENDOP { - D3DBLENDOP_ADD = 1, - D3DBLENDOP_SUBTRACT = 2, - D3DBLENDOP_REVSUBTRACT = 3, - D3DBLENDOP_MIN = 4, - D3DBLENDOP_MAX = 5, - D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLENDOP; - -typedef enum _D3DTEXTUREADDRESS { - D3DTADDRESS_WRAP = 1, - D3DTADDRESS_MIRROR = 2, - D3DTADDRESS_CLAMP = 3, - D3DTADDRESS_BORDER = 4, - D3DTADDRESS_MIRRORONCE = 5, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTUREADDRESS; - -typedef enum _D3DCULL { - D3DCULL_NONE = 1, - D3DCULL_CW = 2, - D3DCULL_CCW = 3, - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCULL; - -typedef enum _D3DCMPFUNC { - D3DCMP_NEVER = 1, - D3DCMP_LESS = 2, - D3DCMP_EQUAL = 3, - D3DCMP_LESSEQUAL = 4, - D3DCMP_GREATER = 5, - D3DCMP_NOTEQUAL = 6, - D3DCMP_GREATEREQUAL = 7, - D3DCMP_ALWAYS = 8, - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCMPFUNC; - -typedef enum _D3DSTENCILOP { - D3DSTENCILOP_KEEP = 1, - D3DSTENCILOP_ZERO = 2, - D3DSTENCILOP_REPLACE = 3, - D3DSTENCILOP_INCRSAT = 4, - D3DSTENCILOP_DECRSAT = 5, - D3DSTENCILOP_INVERT = 6, - D3DSTENCILOP_INCR = 7, - D3DSTENCILOP_DECR = 8, - D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSTENCILOP; - -typedef enum _D3DFOGMODE { - D3DFOG_NONE = 0, - D3DFOG_EXP = 1, - D3DFOG_EXP2 = 2, - D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFOGMODE; - -typedef enum _D3DZBUFFERTYPE { - D3DZB_FALSE = 0, - D3DZB_TRUE = 1, // Z buffering - D3DZB_USEW = 2, // W buffering - D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DZBUFFERTYPE; - -// Primitives supported by draw-primitive API -typedef enum _D3DPRIMITIVETYPE { - D3DPT_POINTLIST = 1, - D3DPT_LINELIST = 2, - D3DPT_LINESTRIP = 3, - D3DPT_TRIANGLELIST = 4, - D3DPT_TRIANGLESTRIP = 5, - D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DPRIMITIVETYPE; - -typedef enum _D3DTRANSFORMSTATETYPE { - D3DTS_VIEW = 2, - D3DTS_PROJECTION = 3, - D3DTS_TEXTURE0 = 16, - D3DTS_TEXTURE1 = 17, - D3DTS_TEXTURE2 = 18, - D3DTS_TEXTURE3 = 19, - D3DTS_TEXTURE4 = 20, - D3DTS_TEXTURE5 = 21, - D3DTS_TEXTURE6 = 22, - D3DTS_TEXTURE7 = 23, - D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTRANSFORMSTATETYPE; - -#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) -#define D3DTS_WORLD D3DTS_WORLDMATRIX(0) -#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) -#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) -#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) - -typedef enum _D3DRENDERSTATETYPE { - D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ - D3DRS_FILLMODE = 8, /* D3DFILLMODE */ - D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */ - D3DRS_LINEPATTERN = 10, /* D3DLINEPATTERN */ - D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */ - D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ - D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ - D3DRS_SRCBLEND = 19, /* D3DBLEND */ - D3DRS_DESTBLEND = 20, /* D3DBLEND */ - D3DRS_CULLMODE = 22, /* D3DCULL */ - D3DRS_ZFUNC = 23, /* D3DCMPFUNC */ - D3DRS_ALPHAREF = 24, /* D3DFIXED */ - D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */ - D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */ - D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ - D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */ - D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */ - D3DRS_ZVISIBLE = 30, /* TRUE to enable z checking */ - D3DRS_FOGCOLOR = 34, /* D3DCOLOR */ - D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */ - D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ - D3DRS_FOGEND = 37, /* Fog end */ - D3DRS_FOGDENSITY = 38, /* Fog density */ - D3DRS_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ - D3DRS_ZBIAS = 47, /* LONG Z bias */ - D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */ - D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ - D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ - D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ - D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ - D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ - D3DRS_STENCILREF = 57, /* Reference value used in stencil test */ - D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */ - D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ - D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ - D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */ - D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */ - D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */ - D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */ - D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */ - D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */ - D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */ - D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */ - D3DRS_CLIPPING = 136, - D3DRS_LIGHTING = 137, - D3DRS_AMBIENT = 139, - D3DRS_FOGVERTEXMODE = 140, - D3DRS_COLORVERTEX = 141, - D3DRS_LOCALVIEWER = 142, - D3DRS_NORMALIZENORMALS = 143, - D3DRS_DIFFUSEMATERIALSOURCE = 145, - D3DRS_SPECULARMATERIALSOURCE = 146, - D3DRS_AMBIENTMATERIALSOURCE = 147, - D3DRS_EMISSIVEMATERIALSOURCE = 148, - D3DRS_VERTEXBLEND = 151, - D3DRS_CLIPPLANEENABLE = 152, - D3DRS_SOFTWAREVERTEXPROCESSING = 153, - D3DRS_POINTSIZE = 154, /* float point size */ - D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */ - D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */ - D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */ - D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ - D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ - D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ - D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer - D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable - D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation - D3DRS_PATCHSEGMENTS = 164, // Number of segments per edge when drawing patches - D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor - D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ - D3DRS_INDEXEDVERTEXBLENDENABLE = 167, - D3DRS_COLORWRITEENABLE = 168, // per-channel write enable - D3DRS_TWEENFACTOR = 170, // float tween factor - D3DRS_BLENDOP = 171, // D3DBLENDOP setting - D3DRS_POSITIONORDER = 172, // NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default) - D3DRS_NORMALORDER = 173, // NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC - - D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DRENDERSTATETYPE; - -// Values for material source -typedef enum _D3DMATERIALCOLORSOURCE -{ - D3DMCS_MATERIAL = 0, // Color from material is used - D3DMCS_COLOR1 = 1, // Diffuse vertex color is used - D3DMCS_COLOR2 = 2, // Specular vertex color is used - D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DMATERIALCOLORSOURCE; - -// Bias to apply to the texture coordinate set to apply a wrap to. -#define D3DRENDERSTATE_WRAPBIAS 128UL - -/* Flags to construct the WRAP render states */ -#define D3DWRAP_U 0x00000001L -#define D3DWRAP_V 0x00000002L -#define D3DWRAP_W 0x00000004L - -/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ -#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U -#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V -#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W -#define D3DWRAPCOORD_3 0x00000008L - -/* Flags to construct D3DRS_COLORWRITEENABLE */ -#define D3DCOLORWRITEENABLE_RED (1L<<0) -#define D3DCOLORWRITEENABLE_GREEN (1L<<1) -#define D3DCOLORWRITEENABLE_BLUE (1L<<2) -#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) - -/* - * State enumerants for per-stage texture processing. - */ -typedef enum _D3DTEXTURESTAGESTATETYPE -{ - D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ - D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ - D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ - D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ - D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ - D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ - D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ - D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ - D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ - D3DTSS_MAGFILTER = 16, /* D3DTEXTUREFILTER filter to use for magnification */ - D3DTSS_MINFILTER = 17, /* D3DTEXTUREFILTER filter to use for minification */ - D3DTSS_MIPFILTER = 18, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */ - D3DTSS_MIPMAPLODBIAS = 19, /* float Mipmap LOD bias */ - D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ - D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ - D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */ - D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ - D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ - D3DTSS_ADDRESSW = 25, /* D3DTEXTUREADDRESS for W coordinate */ - D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ - D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */ - D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ - D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTURESTAGESTATETYPE; - -// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position -// and normal in the camera space) should be taken as texture coordinates -// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from -// -#define D3DTSS_TCI_PASSTHRU 0x00000000 -#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 -#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 -#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 - -/* - * Enumerations for COLOROP and ALPHAOP texture blending operations set in - * texture processing stage controls in D3DTSS. - */ -typedef enum _D3DTEXTUREOP -{ - // Control - D3DTOP_DISABLE = 1, // disables stage - D3DTOP_SELECTARG1 = 2, // the default - D3DTOP_SELECTARG2 = 3, - - // Modulate - D3DTOP_MODULATE = 4, // multiply args together - D3DTOP_MODULATE2X = 5, // multiply and 1 bit - D3DTOP_MODULATE4X = 6, // multiply and 2 bits - - // Add - D3DTOP_ADD = 7, // add arguments together - D3DTOP_ADDSIGNED = 8, // add with -0.5 bias - D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit - D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation - D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product - // Arg1 + Arg2 - Arg1*Arg2 - // = Arg1 + (1-Arg1)*Arg2 - - // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) - D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha - D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha - D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR - - // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) - D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha - D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color - - // Specular mapping - D3DTOP_PREMODULATE = 17, // modulate with next texture before use - D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB - // COLOROP only - D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A - // COLOROP only - D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB - // COLOROP only - D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A - // COLOROP only - - // Bump mapping - D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation - D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel - - // This can do either diffuse or specular bump mapping with correct input. - // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) - // where each component has been scaled and offset to make it signed. - // The result is replicated into all four (including alpha) channels. - // This is a valid COLOROP only. - D3DTOP_DOTPRODUCT3 = 24, - - // Triadic ops - D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 - D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 - - D3DTOP_FORCE_DWORD = 0x7fffffff, -} D3DTEXTUREOP; - -/* - * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending - * operations set in texture processing stage controls in D3DRENDERSTATE. - */ -#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector -#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) -#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) -#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) -#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) -#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) -#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) -#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) -#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) - -// -// Values for D3DTSS_***FILTER texture stage states -// -typedef enum _D3DTEXTUREFILTERTYPE -{ - D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) - D3DTEXF_POINT = 1, // nearest - D3DTEXF_LINEAR = 2, // linear interpolation - D3DTEXF_ANISOTROPIC = 3, // anisotropic - D3DTEXF_FLATCUBIC = 4, // cubic - D3DTEXF_GAUSSIANCUBIC = 5, // different cubic kernel - D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREFILTERTYPE; - -/* Bits for Flags in ProcessVertices call */ - -#define D3DPV_DONOTCOPYDATA (1 << 0) - -//------------------------------------------------------------------- - -// Flexible vertex format bits -// -#define D3DFVF_RESERVED0 0x001 -#define D3DFVF_POSITION_MASK 0x00E -#define D3DFVF_XYZ 0x002 -#define D3DFVF_XYZRHW 0x004 -#define D3DFVF_XYZB1 0x006 -#define D3DFVF_XYZB2 0x008 -#define D3DFVF_XYZB3 0x00a -#define D3DFVF_XYZB4 0x00c -#define D3DFVF_XYZB5 0x00e - -#define D3DFVF_NORMAL 0x010 -#define D3DFVF_PSIZE 0x020 -#define D3DFVF_DIFFUSE 0x040 -#define D3DFVF_SPECULAR 0x080 - -#define D3DFVF_TEXCOUNT_MASK 0xf00 -#define D3DFVF_TEXCOUNT_SHIFT 8 -#define D3DFVF_TEX0 0x000 -#define D3DFVF_TEX1 0x100 -#define D3DFVF_TEX2 0x200 -#define D3DFVF_TEX3 0x300 -#define D3DFVF_TEX4 0x400 -#define D3DFVF_TEX5 0x500 -#define D3DFVF_TEX6 0x600 -#define D3DFVF_TEX7 0x700 -#define D3DFVF_TEX8 0x800 - -#define D3DFVF_LASTBETA_UBYTE4 0x1000 - -#define D3DFVF_RESERVED2 0xE000 // 4 reserved bits - -//--------------------------------------------------------------------- -// Vertex Shaders -// - -/* - -Vertex Shader Declaration - -The declaration portion of a vertex shader defines the static external -interface of the shader. The information in the declaration includes: - -- Assignments of vertex shader input registers to data streams. These -assignments bind a specific vertex register to a single component within a -vertex stream. A vertex stream element is identified by a byte offset -within the stream and a type. The type specifies the arithmetic data type -plus the dimensionality (1, 2, 3, or 4 values). Stream data which is -less than 4 values are always expanded out to 4 values with zero or more -0.F values and one 1.F value. - -- Assignment of vertex shader input registers to implicit data from the -primitive tessellator. This controls the loading of vertex data which is -not loaded from a stream, but rather is generated during primitive -tessellation prior to the vertex shader. - -- Loading data into the constant memory at the time a shader is set as the -current shader. Each token specifies values for one or more contiguous 4 -DWORD constant registers. This allows the shader to update an arbitrary -subset of the constant memory, overwriting the device state (which -contains the current values of the constant memory). Note that these -values can be subsequently overwritten (between DrawPrimitive calls) -during the time a shader is bound to a device via the -SetVertexShaderConstant method. - - -Declaration arrays are single-dimensional arrays of DWORDs composed of -multiple tokens each of which is one or more DWORDs. The single-DWORD -token value 0xFFFFFFFF is a special token used to indicate the end of the -declaration array. The single DWORD token value 0x00000000 is a NOP token -with is ignored during the declaration parsing. Note that 0x00000000 is a -valid value for DWORDs following the first DWORD for multiple word tokens. - -[31:29] TokenType - 0x0 - NOP (requires all DWORD bits to be zero) - 0x1 - stream selector - 0x2 - stream data definition (map to vertex input memory) - 0x3 - vertex input memory from tessellator - 0x4 - constant memory from shader - 0x5 - extension - 0x6 - reserved - 0x7 - end-of-array (requires all DWORD bits to be 1) - -NOP Token (single DWORD token) - [31:29] 0x0 - [28:00] 0x0 - -Stream Selector (single DWORD token) - [31:29] 0x1 - [28] indicates whether this is a tessellator stream - [27:04] 0x0 - [03:00] stream selector (0..15) - -Stream Data Definition (single DWORD token) - Vertex Input Register Load - [31:29] 0x2 - [28] 0x0 - [27:20] 0x0 - [19:16] type (dimensionality and data type) - [15:04] 0x0 - [03:00] vertex register address (0..15) - Data Skip (no register load) - [31:29] 0x2 - [28] 0x1 - [27:20] 0x0 - [19:16] count of DWORDS to skip over (0..15) - [15:00] 0x0 - Vertex Input Memory from Tessellator Data (single DWORD token) - [31:29] 0x3 - [28] indicates whether data is normals or u/v - [27:24] 0x0 - [23:20] vertex register address (0..15) - [19:16] type (dimensionality) - [15:04] 0x0 - [03:00] vertex register address (0..15) - -Constant Memory from Shader (multiple DWORD token) - [31:29] 0x4 - [28:25] count of 4*DWORD constants to load (0..15) - [24:07] 0x0 - [06:00] constant memory address (0..95) - -Extension Token (single or multiple DWORD token) - [31:29] 0x5 - [28:24] count of additional DWORDs in token (0..31) - [23:00] extension-specific information - -End-of-array token (single DWORD token) - [31:29] 0x7 - [28:00] 0x1fffffff - -The stream selector token must be immediately followed by a contiguous set of stream data definition tokens. This token sequence fully defines that stream, including the set of elements within the stream, the order in which the elements appear, the type of each element, and the vertex register into which to load an element. -Streams are allowed to include data which is not loaded into a vertex register, thus allowing data which is not used for this shader to exist in the vertex stream. This skipped data is defined only by a count of DWORDs to skip over, since the type information is irrelevant. -The token sequence: -Stream Select: stream=0 -Stream Data Definition (Load): type=FLOAT3; register=3 -Stream Data Definition (Load): type=FLOAT3; register=4 -Stream Data Definition (Skip): count=2 -Stream Data Definition (Load): type=FLOAT2; register=7 - -defines stream zero to consist of 4 elements, 3 of which are loaded into registers and the fourth skipped over. Register 3 is loaded with the first three DWORDs in each vertex interpreted as FLOAT data. Register 4 is loaded with the 4th, 5th, and 6th DWORDs interpreted as FLOAT data. The next two DWORDs (7th and 8th) are skipped over and not loaded into any vertex input register. Register 7 is loaded with the 9th and 10th DWORDS interpreted as FLOAT data. -Placing of tokens other than NOPs between the Stream Selector and Stream Data Definition tokens is disallowed. - -*/ - -typedef enum _D3DVSD_TOKENTYPE -{ - D3DVSD_TOKEN_NOP = 0, // NOP or extension - D3DVSD_TOKEN_STREAM, // stream selector - D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory) - D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator - D3DVSD_TOKEN_CONSTMEM, // constant memory from shader - D3DVSD_TOKEN_EXT, // extension - D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1) - D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum -} D3DVSD_TOKENTYPE; - -#define D3DVSD_TOKENTYPESHIFT 29 -#define D3DVSD_TOKENTYPEMASK (7 << D3DVSD_TOKENTYPESHIFT) - -#define D3DVSD_STREAMNUMBERSHIFT 0 -#define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT) - -#define D3DVSD_DATALOADTYPESHIFT 28 -#define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT) - -#define D3DVSD_DATATYPESHIFT 16 -#define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT) - -#define D3DVSD_SKIPCOUNTSHIFT 16 -#define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT) - -#define D3DVSD_VERTEXREGSHIFT 0 -#define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT) - -#define D3DVSD_VERTEXREGINSHIFT 20 -#define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT) - -#define D3DVSD_CONSTCOUNTSHIFT 25 -#define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT) - -#define D3DVSD_CONSTADDRESSSHIFT 0 -#define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT) - -#define D3DVSD_CONSTRSSHIFT 16 -#define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT) - -#define D3DVSD_EXTCOUNTSHIFT 24 -#define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT) - -#define D3DVSD_EXTINFOSHIFT 0 -#define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT) - -#define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) - -// macros for generation of CreateVertexShader Declaration token array - -// Set current stream -// _StreamNumber [0..(MaxStreams-1)] stream to get data from -// -#define D3DVSD_STREAM( _StreamNumber ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber)) - -// Set tessellator stream -// -#define D3DVSD_STREAMTESSSHIFT 28 -#define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT) -#define D3DVSD_STREAM_TESS( ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK)) - -// bind single vertex register to vertex element from vertex stream -// -// _VertexRegister [0..15] address of the vertex register -// _Type [D3DVSDT_*] dimensionality and arithmetic data type - -#define D3DVSD_REG( _VertexRegister, _Type ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \ - ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) - -// Skip _DWORDCount DWORDs in vertex -// -#define D3DVSD_SKIP( _DWORDCount ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \ - ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT)) - -// load data into vertex shader constant memory -// -// _ConstantAddress [0..95] - address of constant array to begin filling data -// _Count [0..15] - number of constant vectors to load (4 DWORDs each) -// followed by 4*_Count DWORDS of data -// -#define D3DVSD_CONST( _ConstantAddress, _Count ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ - ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress)) - -// enable tessellator generated normals -// -// _VertexRegisterIn [0..15] address of vertex register whose input stream -// will be used in normal computation -// _VertexRegisterOut [0..15] address of vertex register to output the normal to -// -#define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \ - ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \ - ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut)) - -// enable tessellator generated surface parameters -// -// _VertexRegister [0..15] address of vertex register to output parameters -// -#define D3DVSD_TESSUV( _VertexRegister ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \ - ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) - -// Generates END token -// -#define D3DVSD_END() 0xFFFFFFFF - -// Generates NOP token -#define D3DVSD_NOP() 0x00000000 - -// bit declarations for _Type fields -#define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.) -#define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.) -#define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.) -#define D3DVSDT_FLOAT4 0x03 // 4D float -#define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range - // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) -#define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte -#define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.) -#define D3DVSDT_SHORT4 0x07 // 4D signed short - -// assignments of vertex input registers for fixed function vertex shader -// -#define D3DVSDE_POSITION 0 -#define D3DVSDE_BLENDWEIGHT 1 -#define D3DVSDE_BLENDINDICES 2 -#define D3DVSDE_NORMAL 3 -#define D3DVSDE_PSIZE 4 -#define D3DVSDE_DIFFUSE 5 -#define D3DVSDE_SPECULAR 6 -#define D3DVSDE_TEXCOORD0 7 -#define D3DVSDE_TEXCOORD1 8 -#define D3DVSDE_TEXCOORD2 9 -#define D3DVSDE_TEXCOORD3 10 -#define D3DVSDE_TEXCOORD4 11 -#define D3DVSDE_TEXCOORD5 12 -#define D3DVSDE_TEXCOORD6 13 -#define D3DVSDE_TEXCOORD7 14 -#define D3DVSDE_POSITION2 15 -#define D3DVSDE_NORMAL2 16 - -// Maximum supported number of texture coordinate sets -#define D3DDP_MAXTEXCOORD 8 - - -// -// Instruction Token Bit Definitions -// -#define D3DSI_OPCODE_MASK 0x0000FFFF - -typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE -{ - D3DSIO_NOP = 0, // PS/VS - D3DSIO_MOV , // PS/VS - D3DSIO_ADD , // PS/VS - D3DSIO_SUB , // PS - D3DSIO_MAD , // PS/VS - D3DSIO_MUL , // PS/VS - D3DSIO_RCP , // VS - D3DSIO_RSQ , // VS - D3DSIO_DP3 , // PS/VS - D3DSIO_DP4 , // PS/VS - D3DSIO_MIN , // VS - D3DSIO_MAX , // VS - D3DSIO_SLT , // VS - D3DSIO_SGE , // VS - D3DSIO_EXP , // VS - D3DSIO_LOG , // VS - D3DSIO_LIT , // VS - D3DSIO_DST , // VS - D3DSIO_LRP , // PS - D3DSIO_FRC , // VS - D3DSIO_M4x4 , // VS - D3DSIO_M4x3 , // VS - D3DSIO_M3x4 , // VS - D3DSIO_M3x3 , // VS - D3DSIO_M3x2 , // VS - - D3DSIO_TEXCOORD = 64, // PS - D3DSIO_TEXKILL , // PS - D3DSIO_TEX , // PS - D3DSIO_TEXBEM , // PS - D3DSIO_TEXBEML , // PS - D3DSIO_TEXREG2AR , // PS - D3DSIO_TEXREG2GB , // PS - D3DSIO_TEXM3x2PAD , // PS - D3DSIO_TEXM3x2TEX , // PS - D3DSIO_TEXM3x3PAD , // PS - D3DSIO_TEXM3x3TEX , // PS - D3DSIO_TEXM3x3DIFF , // PS - D3DSIO_TEXM3x3SPEC , // PS - D3DSIO_TEXM3x3VSPEC , // PS - D3DSIO_EXPP , // VS - D3DSIO_LOGP , // VS - D3DSIO_CND , // PS - D3DSIO_DEF , // PS - D3DSIO_TEXREG2RGB , // PS - D3DSIO_TEXDP3TEX , // PS - D3DSIO_TEXM3x2DEPTH , // PS - D3DSIO_TEXDP3 , // PS - D3DSIO_TEXM3x3 , // PS - D3DSIO_TEXDEPTH , // PS - D3DSIO_CMP , // PS - D3DSIO_BEM , // PS - - D3DSIO_PHASE = 0xFFFD, - D3DSIO_COMMENT = 0xFFFE, - D3DSIO_END = 0xFFFF, - - D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DSHADER_INSTRUCTION_OPCODE_TYPE; - -// -// Co-Issue Instruction Modifier - if set then this instruction is to be -// issued in parallel with the previous instruction(s) for which this bit -// is not set. -// -#define D3DSI_COISSUE 0x40000000 - -// -// Parameter Token Bit Definitions -// -#define D3DSP_REGNUM_MASK 0x00001FFF - -// destination parameter write mask -#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red) -#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green) -#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue) -#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha) -#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components - -// destination parameter modifiers -#define D3DSP_DSTMOD_SHIFT 20 -#define D3DSP_DSTMOD_MASK 0x00F00000 - -typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE -{ - D3DSPDM_NONE = 0<>8)&0xFF) -#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) - -// destination/source parameter register type -#define D3DSI_COMMENTSIZE_SHIFT 16 -#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 -#define D3DSHADER_COMMENT(_DWordSize) \ - ((((_DWordSize)<= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif - -#endif /* (DIRECT3D_VERSION >= 0x0800) */ -#endif /* _D3D8TYPES(P)_H_ */ - diff --git a/libmupen64plus/D3D8Interceptor/D3D8Interceptor/D3D8Interceptor.vcxproj b/libmupen64plus/D3D8Interceptor/D3D8Interceptor/D3D8Interceptor.vcxproj deleted file mode 100644 index e33754fe05..0000000000 --- a/libmupen64plus/D3D8Interceptor/D3D8Interceptor/D3D8Interceptor.vcxproj +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4CC85A3A-8E85-45DB-8941-2E2E18FC9A53} - Win32Proj - d3d8 - - - - DynamicLibrary - true - v142 - MultiByte - - - DynamicLibrary - true - v142 - MultiByte - - - DynamicLibrary - false - v142 - true - MultiByte - Dynamic - - - DynamicLibrary - false - v142 - true - MultiByte - Dynamic - - - - - - - - - - - - - - - - - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - true - d3d8 - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - true - d3d8 - - - $(SolutionDir)..\..\..\..\Assets\dll\ - true - d3d8 - - - $(SolutionDir)..\..\..\..\Assets\dll\ - true - d3d8 - - - - Level3 - Disabled - true - false - %(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - Windows - true - - - - - - - - - Level3 - Disabled - true - false - %(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - Windows - true - - - - - - - - - Level3 - MaxSpeed - - - false - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - true - - - true - true - true - %(AdditionalDependencies) - Windows - - - - - - - - - Level3 - MaxSpeed - - - false - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - true - - - true - true - true - %(AdditionalDependencies) - Windows - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp deleted file mode 100644 index 9fc7339635..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - ThreadSafePointerSet IDirect3D8::m_List; - - D3D8Wrapper::IDirect3D8::IDirect3D8(D3D8Base::IDirect3D8* real) : D3D8Wrapper::IDirect3DUnknown((IUnknown*) real) - { - LOG("IDirect3D8::IDirect3D8( " << real << " )\n"); - m_pD3D = real; - } - - // Tries to find the real object in the pointer set, or creates a new wrapped object - D3D8Wrapper::IDirect3D8* D3D8Wrapper::IDirect3D8::GetDirect3D(D3D8Base::IDirect3D8* pD3D) - { - LOG("IDirect3D8::GetDirect3D( " << pD3D << " )\n"); - D3D8Wrapper::IDirect3D8* p = (D3D8Wrapper::IDirect3D8*) m_List.GetDataPtr(pD3D); - if( p == NULL ) - { - p = new D3D8Wrapper::IDirect3D8(pD3D); - m_List.AddMember(pD3D,p); - return p; - } - - p->m_ulRef++; - return p; - } - - STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3D8::Release(THIS) - { - LOG("IDirect3D8::Release() [ " << this << " ]\n"); - m_pUnk->Release(); - - ULONG ulRef = --m_ulRef; - - if(ulRef == 0) - { - m_List.DeleteMember(GetDirect3D8()); - delete this; - return 0L; - } - return ulRef; - } - - - /*** IDirect3D8 methods ***/ - - STDMETHODIMP D3D8Wrapper::IDirect3D8::GetAdapterDisplayMode(THIS_ UINT Adapter,D3D8Base::D3DDISPLAYMODE* pMode) - { - LOG("IDirect3D8::GetAdapterDisplayMode( " << Adapter << " , " << pMode << " ) [ " << this << " ]\n"); - return m_pD3D->GetAdapterDisplayMode(Adapter, pMode); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::RegisterSoftwareDevice(void* pInitializeFunction) - { - LOG("IDirect3D8::RegisterSoftwareDevice( " << pInitializeFunction << " ) [ " << this << " ]\n"); - return m_pD3D->RegisterSoftwareDevice(pInitializeFunction); - } - - STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3D8::GetAdapterCount(THIS) - { - LOG("IDirect3D8::GetAdapterCount() [ " << this << " ]\n"); - return m_pD3D->GetAdapterCount(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3D8Base::D3DADAPTER_IDENTIFIER8* pIdentifier) - { - LOG("IDirect3D8::GetAdapterIdentifier( " << Adapter << " , " << Flags << " , " << pIdentifier << " ) [ " << this << " ]\n"); - return m_pD3D->GetAdapterIdentifier(Adapter,Flags,pIdentifier); - } - - STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3D8::GetAdapterModeCount(UINT Adapter) - { - LOG("IDirect3D8::GetAdapterModeCount( " << Adapter << " ) [ " << this << " ]\n"); - return m_pD3D->GetAdapterModeCount(Adapter); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::EnumAdapterModes(UINT Adapter,UINT Mode,D3D8Base::D3DDISPLAYMODE* pMode) - { - LOG("IDirect3D8::EnumAdapterModes( " << Adapter << " , " << Mode << " , " << pMode << " ) [ " << this << " ]\n"); - return m_pD3D->EnumAdapterModes(Adapter,Mode,pMode); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceType(UINT Adapter,D3D8Base::D3DDEVTYPE CheckType,D3D8Base::D3DFORMAT DisplayFormat,D3D8Base::D3DFORMAT BackBufferFormat,BOOL Windowed) - { - LOG("IDirect3D8::CheckDeviceType( " << Adapter << " , " << CheckType << " , " << DisplayFormat << " , " << BackBufferFormat << " , " << Windowed << " ) [ " << this << " ]\n"); - return m_pD3D->CheckDeviceType(Adapter,CheckType,DisplayFormat,BackBufferFormat,Windowed); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceFormat(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,DWORD Usage,D3D8Base::D3DRESOURCETYPE RType,D3D8Base::D3DFORMAT CheckFormat) - { - LOG("IDirect3D8::CheckDeviceFormat( " << Adapter << " , " << DeviceType << " , " << AdapterFormat << " , " << Usage << " , " << RType << " , " << CheckFormat << " ) [ " << this << " ]\n"); - return m_pD3D->CheckDeviceFormat(Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceMultiSampleType(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT SurfaceFormat,BOOL Windowed,D3D8Base::D3DMULTISAMPLE_TYPE MultiSampleType) - { - LOG("IDirect3D8::CheckDeviceMultiSampleType( " << Adapter << " , " << DeviceType << " , " << SurfaceFormat << " , " << Windowed << " , " << MultiSampleType << " ) [ " << this << " ]\n"); - return m_pD3D->CheckDeviceMultiSampleType(Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDepthStencilMatch(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,D3D8Base::D3DFORMAT RenderTargetFormat,D3D8Base::D3DFORMAT DepthStencilFormat) - { - LOG("IDirect3D8::CheckDepthStencilMatch( " << Adapter << " , " << DeviceType << " , " << AdapterFormat << " , " << RenderTargetFormat << " , " << DepthStencilFormat << " ) [ " << this << " ]\n"); - return m_pD3D->CheckDepthStencilMatch(Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::GetDeviceCaps(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DCAPS8* pCaps) - { - LOG("IDirect3D8::GetDeviceCaps( " << Adapter << " , " << DeviceType << " , " << pCaps << " ) [ " << this << " ]\n"); - return m_pD3D->GetDeviceCaps(Adapter,DeviceType,pCaps); - } - - STDMETHODIMP_(HMONITOR) D3D8Wrapper::IDirect3D8::GetAdapterMonitor(UINT Adapter) - { - LOG("IDirect3D8::GetAdapterMonitor( " << Adapter << " ) [ " << this << " ]\n"); - return m_pD3D->GetAdapterMonitor(Adapter); - } - - STDMETHODIMP D3D8Wrapper::IDirect3D8::CreateDevice(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DDevice8** ppReturnedDeviceInterface) - { - //sometimes, Intel drivers will clear the dll path. So let's save and restore it (do their job for them) - //it doesn't seem like this happens any time besides creating the D3D8 object and a device. - //If it does, then this solution isn't scalable at all. - //This is a good place to note that it appears possible that on the affected drivers, the D3D9 interface will only SetDllDirectory the first time a D3D9 object is created - char oldDllDirectory[MAX_PATH]; - GetDllDirectory(MAX_PATH, oldDllDirectory); - - LOG("IDirect3D8::CreateDevice( " << Adapter << " , " << DeviceType << " , " << hFocusWindow << " , " << BehaviorFlags << " , " << pPresentationParameters << " , " << ppReturnedDeviceInterface << " ) [ " << this << " ]\n"); - D3D8Base::IDirect3DDevice8* realDevice = NULL; - - HRESULT hr = m_pD3D->CreateDevice(Adapter,DeviceType,hFocusWindow,BehaviorFlags,pPresentationParameters,&realDevice); - - //restore old DLL directory - SetDllDirectory(oldDllDirectory); - - if(FAILED(hr)) - { - return hr; - } - - // Wrap the real object - D3D8Wrapper::IDirect3DDevice8* wrappedDevice = D3D8Wrapper::IDirect3DDevice8::GetDirect3DDevice(realDevice); - - // Store this wrapped pointer for grabbing the screen later - last_device = wrappedDevice; - - // Create a new render target - D3D8Base::IDirect3DSurface8 *realSurface = NULL; - HRESULT hr2 = realDevice->CreateRenderTarget(pPresentationParameters->BackBufferWidth,pPresentationParameters->BackBufferHeight,D3D8Base::D3DFMT_X8R8G8B8,pPresentationParameters->MultiSampleType,FALSE,&realSurface); - - // Store a wrapped pointer to it for grabbing the screen - render_surface = D3D8Wrapper::IDirect3DSurface8::GetSurface(realSurface); - - // Return our wrapped object - *ppReturnedDeviceInterface = wrappedDevice; - - return hr; - } - - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp deleted file mode 100644 index dcea15c830..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DBaseTexture8::IDirect3DBaseTexture8(D3D8Base::IDirect3DBaseTexture8* realBaseTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) realBaseTexture) - { - LOG("IDirect3DBaseTexture8::IDirect3DBaseTexture8( " << realBaseTexture << " )\n"); - m_pD3D = realBaseTexture; - } - - STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::SetLOD(DWORD LODNew) - { - LOG("IDirect3DBaseTexture8::SetLOD( " << LODNew << " ) [ " << this << " ]\n"); - return m_pD3D->SetLOD(LODNew); - } - - STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::GetLOD() - { - LOG("IDirect3DBaseTexture8::GetLOD() [ " << this << " ]\n"); - return m_pD3D->GetLOD(); - } - - STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::GetLevelCount() - { - LOG("IDirect3DBaseTexture8::GetLevelCount() [ " << this << " ]\n"); - return m_pD3D->GetLevelCount(); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp deleted file mode 100644 index 739d995f56..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DCubeTexture8::IDirect3DCubeTexture8(D3D8Base::IDirect3DCubeTexture8* realCubeTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) realCubeTexture) - { - LOG("IDirect3DCubeTexture8( " << realCubeTexture << " )\n"); - m_pD3D = realCubeTexture; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) - { - LOG("IDirect3DCubeTexture8::GetLevelDesc( " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetLevelDesc(Level,pDesc); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::GetCubeMapSurface(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Wrapper::IDirect3DSurface8** ppCubeMapSurface) - { - LOG("IDirect3DCubeTexture8::GetCubeMapSurface( " << FaceType << " , " << Level << " , " << ppCubeMapSurface << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetCubeMapSurface(FaceType,Level,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppCubeMapSurface = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::LockRect(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) - { - LOG("IDirect3DCubeTexture8::LockRect( " << FaceType << " , " << Level << " , " << pLockedRect << " , " << pRect << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->LockRect(FaceType,Level,pLockedRect,pRect,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::UnlockRect(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level) - { - LOG("IDirect3DCubeTexture8::UnlockRect( " << FaceType << " , " << Level << " ) [ " << this << " ]\n"); - return m_pD3D->UnlockRect(FaceType,Level); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::AddDirtyRect(D3D8Base::D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) - { - LOG("IDirect3DCubeTexture8::AddDirtyRect( " << FaceType << " , " << pDirtyRect << " ) [ " << this << " ]\n"); - return m_pD3D->AddDirtyRect(FaceType,pDirtyRect); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp deleted file mode 100644 index 5c1c820e84..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp +++ /dev/null @@ -1,891 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - ThreadSafePointerSet IDirect3DDevice8::m_List; - - D3D8Wrapper::IDirect3DDevice8::IDirect3DDevice8(D3D8Base::IDirect3DDevice8* realDevice) : IDirect3DUnknown((IUnknown*) realDevice) - { - LOG("IDirect3DDevice8::IDirect3DDevice8( " << realDevice << " )\n"); - m_pDevice = realDevice; - } - - D3D8Wrapper::IDirect3DDevice8* D3D8Wrapper::IDirect3DDevice8::GetDirect3DDevice(D3D8Base::IDirect3DDevice8* realDevice) - { - LOG("IDirect3DDevice8::GetDirect3DDevice( " << realDevice << " )\n"); - D3D8Wrapper::IDirect3DDevice8* wrappedDevice = (D3D8Wrapper::IDirect3DDevice8*) m_List.GetDataPtr(realDevice); - if(wrappedDevice == NULL) - { - wrappedDevice = new D3D8Wrapper::IDirect3DDevice8(realDevice); - m_List.AddMember(realDevice, wrappedDevice); - return wrappedDevice; - } - - wrappedDevice->m_ulRef++; - return wrappedDevice; - } - - STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DDevice8::Release(THIS) - { - LOG("IDirect3DDevice8::Release() [ " << this << " ]\n"); - m_pUnk->Release(); - - ULONG ulRef = --m_ulRef; - - if(ulRef == 0) - { - m_List.DeleteMember(GetD3D8Device()); - delete this; - return NULL; - } - return ulRef; - } - - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::TestCooperativeLevel() - { - LOG("IDirect3DDevice8::TestCooperativeLevel() [ " << this << " ]\n"); - return m_pDevice->TestCooperativeLevel(); - } - - STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3DDevice8::GetAvailableTextureMem() - { - LOG("IDirect3DDevice8::GetAvailableTextureMem() [ " << this << " ]\n"); - return m_pDevice->GetAvailableTextureMem(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ResourceManagerDiscardBytes(DWORD Bytes) - { - LOG("IDirect3DDevice8::ResourceManagerDiscardBytes( " << Bytes << " ) [ " << this << " ]\n"); - return m_pDevice->ResourceManagerDiscardBytes(Bytes); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDirect3D(D3D8Wrapper::IDirect3D8** ppD3D8) - { - LOG("IDirect3DDevice8::GetDirect3D( " << ppD3D8 << " ) [ " << this << " ]\n"); - - // Run the function and wrap the result before returning it - D3D8Base::IDirect3D8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetDirect3D(&realD3D); - - D3D8Wrapper::IDirect3D8* wrappedD3D = D3D8Wrapper::IDirect3D8::GetDirect3D(realD3D); - - *ppD3D8 = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDeviceCaps(D3D8Base::D3DCAPS8* pCaps) - { - LOG("IDirect3DDevice8::GetDeviceCaps( " << pCaps << " ) [ " << this << " ]\n"); - return m_pDevice->GetDeviceCaps(pCaps); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDisplayMode(D3D8Base::D3DDISPLAYMODE* pMode) - { - LOG("IDirect3DDevice8::GetDisplayMode( " << pMode << " ) [ " << this << " ]\n"); - return m_pDevice->GetDisplayMode(pMode); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetCreationParameters(D3D8Base::D3DDEVICE_CREATION_PARAMETERS *pParameters) - { - LOG("IDirect3DDevice8::GetCreationParameters( " << pParameters << " ) [ " << this << " ]\n"); - return m_pDevice->GetCreationParameters(pParameters); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetCursorProperties(UINT XHotSpot,UINT YHotSpot,D3D8Wrapper::IDirect3DSurface8* pCursorBitmap) - { - LOG("IDirect3DDevice8::SetCursorProperties( " << XHotSpot << " , " << YHotSpot << " , " << pCursorBitmap << " ) [ " << this << " ]\n"); - if (pCursorBitmap == NULL) - { - return m_pDevice->SetCursorProperties(XHotSpot,YHotSpot,NULL); - } - else - { - return m_pDevice->SetCursorProperties(XHotSpot,YHotSpot,pCursorBitmap->GetSurface()); - } - } - - STDMETHODIMP_(void) D3D8Wrapper::IDirect3DDevice8::SetCursorPosition(int X,int Y,DWORD Flags) - { - LOG("IDirect3DDevice8::SetCursorPosition( " << X << " , " << Y << " , " << Flags << " ) [ " << this << " ]\n"); - m_pDevice->SetCursorPosition(X,Y,Flags); - } - - STDMETHODIMP_(BOOL) D3D8Wrapper::IDirect3DDevice8::ShowCursor(BOOL bShow) - { - LOG("IDirect3DDevice8::ShowCursor( " << bShow << " ) [ " << this << " ]\n"); - return m_pDevice->ShowCursor(bShow); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateAdditionalSwapChain(D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DSwapChain8** pSwapChain) - { - LOG("IDirect3DDevice8::CreateAdditionalSwapChain( " << pPresentationParameters << " , " << pSwapChain << " ) [ " << this << " ]\n"); - D3D8Base::IDirect3DSwapChain8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateAdditionalSwapChain(pPresentationParameters,&realD3D); - - D3D8Wrapper::IDirect3DSwapChain8* wrappedD3D = new D3D8Wrapper::IDirect3DSwapChain8(realD3D); - - *pSwapChain = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::Reset(D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters) - { - LOG("IDirect3DDevice8::Reset( " << pPresentationParameters << " ) [ " << this << " ]\n"); - return m_pDevice->Reset(pPresentationParameters); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) - { -#ifdef LOGGING - LOG("IDirect3DDevice8::Present( " << pSourceRect); - if (pSourceRect != NULL) - { - LOG("{ " << pSourceRect->left << " , " << pSourceRect->top << " , " << pSourceRect->right << " , " << pSourceRect->bottom << " }"); - } - LOG(" , " << pDestRect); - if (pSourceRect != NULL) - { - LOG("{ " << pDestRect->left << " , " << pDestRect->top << " , " << pDestRect->right << " , " << pDestRect->bottom << " }"); - } - LOG(" , " << hDestWindowOverride << " , " << pDirtyRegion << " ) [ " << this << " ]\n"); -#endif - // Force the result to OK - HRESULT hr = D3D_OK; - - // Don't call the real present - //hr = m_pDevice->Present(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion); - - // Let bizhawk know the frame is ready - rendering_callback(0); - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetBackBuffer(UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer) - { - LOG("IDirect3DDevice8::GetBackBuffer( " << BackBuffer << " , " << Type << " , " << ppBackBuffer << " ) [ " << this << " ]\n"); - - /* - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetBackBuffer(BackBuffer,Type,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - */ - - // Return a pointer to our render surface, not the back buffer - *ppBackBuffer = render_surface;// wrappedD3D; - render_surface->m_ulRef++; - - return S_OK; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetRasterStatus(D3D8Base::D3DRASTER_STATUS* pRasterStatus) - { - LOG("IDirect3DDevice8::GetRasterStatus( " << pRasterStatus << " ) [ " << this << " ]\n"); - return m_pDevice->GetRasterStatus(pRasterStatus); - } - - STDMETHODIMP_(void) D3D8Wrapper::IDirect3DDevice8::SetGammaRamp(DWORD Flags,CONST D3D8Base::D3DGAMMARAMP* pRamp) - { - LOG("IDirect3DDevice8::SetGammaRamp( " << Flags << " , " << pRamp << " ) [ " << this << " ]\n"); - m_pDevice->SetGammaRamp(Flags,pRamp); - } - - STDMETHODIMP_(void) D3D8Wrapper::IDirect3DDevice8::GetGammaRamp(D3D8Base::D3DGAMMARAMP* pRamp) - { - LOG("IDirect3DDevice8::GetGammaRamp( " << pRamp << " ) [ " << this << " ]\n"); - m_pDevice->GetGammaRamp(pRamp); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DTexture8** ppTexture) - { - LOG("IDirect3DDevice8::CreateTexture( " << Width << " , " << Height << " , " << Levels << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppTexture << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DTexture8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateTexture(Width,Height,Levels,Usage,Format,Pool,&realD3D); - - D3D8Wrapper::IDirect3DTexture8* wrappedD3D = D3D8Wrapper::IDirect3DTexture8::GetTexture(realD3D); - - *ppTexture = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DVolumeTexture8** ppVolumeTexture) - { - LOG("IDirect3DDevice8::CreateVolumeTexture( " << Width << " , " << Height << " , " << Levels << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppVolumeTexture << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DVolumeTexture8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateVolumeTexture(Width,Height,Depth,Levels,Usage,Format,Pool,&realD3D); - - D3D8Wrapper::IDirect3DVolumeTexture8* wrappedD3D = new D3D8Wrapper::IDirect3DVolumeTexture8(realD3D); - - *ppVolumeTexture = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DCubeTexture8** ppCubeTexture) - { - LOG("IDirect3DDevice8::CreateCubeTexture( " << EdgeLength << " , " << Levels << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppCubeTexture << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DCubeTexture8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateCubeTexture(EdgeLength,Levels, Usage,Format,Pool,&realD3D); - - D3D8Wrapper::IDirect3DCubeTexture8* wrappedD3D = new D3D8Wrapper::IDirect3DCubeTexture8(realD3D); - - *ppCubeTexture = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DVertexBuffer8** ppVertexBuffer) - { - LOG("IDirect3DDevice8::CreateVertexBuffer( " << Length << " , " << Usage << " , " << FVF << " , " << Pool << " , " << ppVertexBuffer << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DVertexBuffer8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateVertexBuffer(Length,Usage,FVF,Pool,&realD3D); - - D3D8Wrapper::IDirect3DVertexBuffer8* wrappedD3D = new D3D8Wrapper::IDirect3DVertexBuffer8(realD3D); - - *ppVertexBuffer = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateIndexBuffer(UINT Length,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DIndexBuffer8** ppIndexBuffer) - { - LOG("IDirect3DDevice8::CreateIndexBuffer( " << Length << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppIndexBuffer << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DIndexBuffer8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateIndexBuffer(Length,Usage,Format,Pool,&realD3D); - - D3D8Wrapper::IDirect3DIndexBuffer8* wrappedD3D = new D3D8Wrapper::IDirect3DIndexBuffer8(realD3D); - - *ppIndexBuffer = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateRenderTarget(UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,D3D8Wrapper::IDirect3DSurface8** ppSurface) - { - LOG("IDirect3DDevice8::CreateRenderTarget( " << Width << " , " << Height << " , " << Format << " , " << MultiSample << " , " << Lockable << " , " << ppSurface << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateRenderTarget(Width,Height,Format,MultiSample,Lockable,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppSurface = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateDepthStencilSurface(UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,D3D8Wrapper::IDirect3DSurface8** ppSurface) - { - LOG("IDirect3DDevice8::CreateDepthStencilSurface( " << Width << " , " << Height << " , " << Format << " , " << MultiSample << " , " << ppSurface << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateDepthStencilSurface(Width,Height,Format,MultiSample,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppSurface = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateImageSurface(UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Wrapper::IDirect3DSurface8** ppSurface) - { - LOG("IDirect3DDevice8::CreateImageSurface( " << Width << " , " << Height << " , " << Format << " , " << ppSurface << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pDevice->CreateImageSurface(Width,Height,Format,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppSurface = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CopyRects(D3D8Wrapper::IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,D3D8Wrapper::IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) - { - LOG("IDirect3DDevice8::CopyRects( " << pSourceSurface << " , " << pSourceRectsArray << " , " << cRects << " , " << pDestinationSurface << " , " << pDestPointsArray << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* source; - if (pSourceSurface == NULL) - { - source = NULL; - } - else - { - source = pSourceSurface->GetSurface(); - } - - D3D8Base::IDirect3DSurface8* destination; - if (pDestinationSurface == NULL) - { - destination = NULL; - } - else - { - destination = pDestinationSurface->GetSurface(); - } - - if (pSourceSurface->m_ulRef == 0 || source == destination) - { - return D3DERR_INVALIDCALL; - } - - return m_pDevice->CopyRects(source,pSourceRectsArray,cRects,destination,pDestPointsArray); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::UpdateTexture(D3D8Wrapper::IDirect3DBaseTexture8* pSourceTexture,D3D8Wrapper::IDirect3DBaseTexture8* pDestinationTexture) - { - LOG("IDirect3DDevice8::UpdateTexture( " << pSourceTexture << " , " << pDestinationTexture << " ) [ " << this << " ]\n"); - D3D8Base::IDirect3DBaseTexture8* source; - if (pSourceTexture == NULL) - { - source = NULL; - } - else - { - source = pSourceTexture->GetBaseTexture(); - } - - D3D8Base::IDirect3DBaseTexture8* destination; - if (pDestinationTexture == NULL) - { - destination = NULL; - } - else - { - destination = pDestinationTexture->GetBaseTexture(); - } - - return m_pDevice->UpdateTexture(source,destination); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetFrontBuffer(D3D8Wrapper::IDirect3DSurface8* pDestSurface) - { - LOG("IDirect3DDevice8::GetFrontBuffer( " << pDestSurface << " ) [ " << this << " ]\n"); - if (pDestSurface == NULL) - { - return m_pDevice->GetFrontBuffer(NULL); - } - else - { - return m_pDevice->GetFrontBuffer(pDestSurface->GetSurface()); - } - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetRenderTarget(D3D8Wrapper::IDirect3DSurface8* pRenderTarget,D3D8Wrapper::IDirect3DSurface8* pNewZStencil) - { - LOG("IDirect3DDevice8::SetRenderTarget( " << pRenderTarget << " , " << pNewZStencil << " ) [ " << this << " ]\n"); - - //HRESULT hr = m_pDevice->SetRenderTarget(pRenderTarget->GetSurface(),pNewZStencil->GetSurface()); - HRESULT hr = m_pDevice->SetRenderTarget(render_surface->GetSurface(),pNewZStencil->GetSurface()); - - pRenderTarget->m_ulRef++; - pNewZStencil->m_ulRef++; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetRenderTarget(D3D8Wrapper::IDirect3DSurface8** ppRenderTarget) - { - LOG("IDirect3DDevice8::GetRenderTarget( " << ppRenderTarget << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetRenderTarget(&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppRenderTarget = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDepthStencilSurface(D3D8Wrapper::IDirect3DSurface8** ppZStencilSurface) - { - LOG("IDirect3DDevice8::GetDepthStencilSurface( " << ppZStencilSurface << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetDepthStencilSurface(&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppZStencilSurface = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::BeginScene() - { - LOG("IDirect3DDevice8::BeginScene() [ " << this << " ]\n"); - return m_pDevice->BeginScene(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::EndScene() - { - LOG("IDirect3DDevice8::EndScene() [ " << this << " ]\n"); - return m_pDevice->EndScene(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::Clear(DWORD Count,CONST D3D8Base::D3DRECT* pRects,DWORD Flags,D3D8Base::D3DCOLOR Color,float Z,DWORD Stencil) - { -#ifdef LOGGING - LOG("IDirect3DDevice8::Clear( " << Count << " , " << pRects); - if (pRects != NULL) - { - LOG("{ " << pRects->x1 << " , " << pRects->y1 << " , " << pRects->x2 << " , " << pRects->y2 << " }") - } - LOG(" , " << Flags << " , " << Color << " , " << Z << " , " << Stencil << " ) [ " << this << " ]\n"); -#endif - - return m_pDevice->Clear(Count,pRects,Flags,Color,Z,Stencil); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetTransform(D3D8Base::D3DTRANSFORMSTATETYPE State,CONST D3D8Base::D3DMATRIX* pMatrix) - { - LOG("IDirect3DDevice8::SetTransform( " << State << " , " << pMatrix << " ) [ " << this << " ]\n"); - return m_pDevice->SetTransform(State,pMatrix); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetTransform(D3D8Base::D3DTRANSFORMSTATETYPE State,D3D8Base::D3DMATRIX* pMatrix) - { - LOG("IDirect3DDevice8::GetTransform( " << State << " , " << pMatrix << " ) [ " << this << " ]\n"); - return m_pDevice->GetTransform(State,pMatrix); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::MultiplyTransform(D3D8Base::D3DTRANSFORMSTATETYPE foo,CONST D3D8Base::D3DMATRIX* bar) - { - LOG("IDirect3DDevice8::MultiplyTransform( " << foo << " , " << bar << " ) [ " << this << " ]\n"); - return m_pDevice->MultiplyTransform(foo, bar); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetViewport(CONST D3D8Base::D3DVIEWPORT8* pViewport) - { - LOG("IDirect3DDevice8::SetViewport( " << pViewport << " ) [ " << this << " ]\n"); - return m_pDevice->SetViewport(pViewport); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetViewport(D3D8Base::D3DVIEWPORT8* pViewport) - { -#ifdef LOGGING - LOG("IDirect3DDevice8::GetViewport( " << pViewport); - if (pViewport != NULL) - { - LOG("{ " << pViewport->X << " , " << pViewport->Y << " , " << pViewport->Width << " , " << pViewport->Height << " , " << pViewport->MinZ << " , " << pViewport->MaxZ << " }"); - } - LOG(" ) [ " << this << " ]\n"); -#endif - return m_pDevice->GetViewport(pViewport); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetMaterial(CONST D3D8Base::D3DMATERIAL8* pMaterial) - { - LOG("IDirect3DDevice8::SetMaterial( " << pMaterial << " ) [ " << this << " ]\n"); - return m_pDevice->SetMaterial(pMaterial); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetMaterial(D3D8Base::D3DMATERIAL8* pMaterial) - { - LOG("IDirect3DDevice8::GetMaterial( " << pMaterial << " ) [ " << this << " ]\n"); - return m_pDevice->GetMaterial(pMaterial); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetLight(DWORD Index,CONST D3D8Base::D3DLIGHT8* foo) - { - LOG("IDirect3DDevice8::SetLight( " << Index << " , " << foo << " ) [ " << this << " ]\n"); - return m_pDevice->SetLight(Index,foo); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetLight(DWORD Index,D3D8Base::D3DLIGHT8* foo) - { - LOG("IDirect3DDevice8::GetLight( " << Index << " , " << foo << " ) [ " << this << " ]\n"); - return m_pDevice->GetLight(Index,foo); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::LightEnable(DWORD Index,BOOL Enable) - { - LOG("IDirect3DDevice8::LightEnable( " << Index << " , " << Enable << " ) [ " << this << " ]\n"); - return m_pDevice->LightEnable(Index,Enable); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetLightEnable(DWORD Index,BOOL* pEnable) - { - LOG("IDirect3DDevice8::GetLightEnable( " << Index << " , " << pEnable << " ) [ " << this << " ]\n"); - return m_pDevice->GetLightEnable(Index,pEnable); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetClipPlane(DWORD Index,CONST float* pPlane) - { - LOG("IDirect3DDevice8::SetClipPlane( " << Index << " , " << pPlane << " ) [ " << this << " ]\n"); - return m_pDevice->SetClipPlane(Index,pPlane); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetClipPlane(DWORD Index,float* pPlane) - { - LOG("IDirect3DDevice8::GetClipPlane( " << Index << " , " << pPlane << " ) [ " << this << " ]\n"); - return m_pDevice->GetClipPlane(Index,pPlane); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetRenderState(D3D8Base::D3DRENDERSTATETYPE State,DWORD Value) - { - LOG("IDirect3DDevice8::SetRenderState( " << State << " , " << Value << " ) [ " << this << " ]\n"); - return m_pDevice->SetRenderState(State,Value); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetRenderState(D3D8Base::D3DRENDERSTATETYPE State,DWORD* pValue) - { - LOG("IDirect3DDevice8::GetRenderState( " << State << " , " << pValue << " ) [ " << this << " ]\n"); - return m_pDevice->GetRenderState(State,pValue); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::BeginStateBlock() - { - LOG("IDirect3DDevice8::BeginStateBlock() [ " << this << " ]\n"); - return m_pDevice->BeginStateBlock(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::EndStateBlock(DWORD* pToken) - { - LOG("IDirect3DDevice8::EndStateBlock( " << pToken << " ) [ " << this << " ]\n"); - return m_pDevice->EndStateBlock(pToken); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ApplyStateBlock(DWORD Token) - { - LOG("IDirect3DDevice8::ApplyStateBlock( " << Token << " ) [ " << this << " ]\n"); - return m_pDevice->ApplyStateBlock(Token); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CaptureStateBlock(DWORD Token) - { - LOG("IDirect3DDevice8::CaptureStateBlock( " << Token << " ) [ " << this << " ]\n"); - return m_pDevice->CaptureStateBlock(Token); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeleteStateBlock(DWORD Token) - { - LOG("IDirect3DDevice8::DeleteStateBlock( " << Token << " ) [ " << this << " ]\n"); - return m_pDevice->DeleteStateBlock(Token); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateStateBlock(D3D8Base::D3DSTATEBLOCKTYPE Type,DWORD* pToken) - { - LOG("IDirect3DDevice8::CreateStateBlock( " << Type << " , " << pToken << " ) [ " << this << " ]\n"); - return m_pDevice->CreateStateBlock(Type,pToken); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetClipStatus(CONST D3D8Base::D3DCLIPSTATUS8* pClipStatus) - { - LOG("IDirect3DDevice8::SetClipStatus( " << pClipStatus << " ) [ " << this << " ]\n"); - return m_pDevice->SetClipStatus(pClipStatus); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetClipStatus(D3D8Base::D3DCLIPSTATUS8* pClipStatus) - { - LOG("IDirect3DDevice8::GetClipStatus( " << pClipStatus << " ) [ " << this << " ]\n"); - return m_pDevice->GetClipStatus(pClipStatus); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetTexture(DWORD Stage,D3D8Wrapper::IDirect3DBaseTexture8** ppTexture) - { - LOG("IDirect3DDevice8::GetTexture( " << Stage << " , " << ppTexture << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DBaseTexture8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetTexture(Stage,&realD3D);//ppTexture); - - D3D8Wrapper::IDirect3DBaseTexture8* wrappedD3D = new D3D8Wrapper::IDirect3DBaseTexture8(realD3D); - - *ppTexture = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetTexture(DWORD Stage,D3D8Wrapper::IDirect3DBaseTexture8* pTexture) - { - LOG("IDirect3DDevice8::SetTexture( " << Stage << " , " << pTexture << " ) [ " << this << " ]\n"); - - if (pTexture == NULL) - { - return m_pDevice->SetTexture(Stage,NULL); - } - else - { - return m_pDevice->SetTexture(Stage,pTexture->GetBaseTexture()); - } - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetTextureStageState(DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) - { - LOG("IDirect3DDevice8::GetTextureStageState( " << Stage << " , " << Type << " , " << pValue << " ) [ " << this << " ]\n"); - return m_pDevice->GetTextureStageState(Stage,Type,pValue); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetTextureStageState(DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD Value) - { - LOG("IDirect3DDevice8::SetTextureStageState( " << Stage << " , " << Type << " , " << Value << " ) [ " << this << " ]\n"); - return m_pDevice->SetTextureStageState(Stage,Type,Value); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ValidateDevice(DWORD* pNumPasses) - { - LOG("IDirect3DDevice8::ValidateDevice( " << pNumPasses << " ) [ " << this << " ]\n"); - return m_pDevice->ValidateDevice(pNumPasses); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetInfo(DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) - { - LOG("IDirect3DDevice8::GetInfo( " << DevInfoID << " , " << pDevInfoStruct << " , " << DevInfoStructSize << " ) [ " << this << " ]\n"); - return m_pDevice->GetInfo(DevInfoID,pDevInfoStruct,DevInfoStructSize); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries) - { - LOG("IDirect3DDevice8::SetPaletteEntries( " << PaletteNumber << " , " << pEntries << " ) [ " << this << " ]\n"); - return m_pDevice->SetPaletteEntries(PaletteNumber,pEntries); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries) - { - LOG("IDirect3DDevice8::GetPaletteEntries( " << PaletteNumber << " , " << pEntries << " ) [ " << this << " ]\n"); - return m_pDevice->GetPaletteEntries(PaletteNumber,pEntries); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetCurrentTexturePalette(UINT PaletteNumber) - { - LOG("IDirect3DDevice8::SetCurrentTexturePalette( " << PaletteNumber << " ) [ " << this << " ]\n"); - return m_pDevice->SetCurrentTexturePalette(PaletteNumber); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetCurrentTexturePalette(UINT *PaletteNumber) - { - LOG("IDirect3DDevice8::GetCurrentTexturePalette( " << PaletteNumber << " ) [ " << this << " ]\n"); - return m_pDevice->GetCurrentTexturePalette(PaletteNumber); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawPrimitive(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) - { - LOG("IDirect3DDevice8::DrawPrimitive( " << PrimitiveType << " , " << StartVertex << " , " << PrimitiveCount << " ) [ " << this << " ]\n"); - return m_pDevice->DrawPrimitive(PrimitiveType,StartVertex,PrimitiveCount); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawIndexedPrimitive(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) - { - LOG("IDirect3DDevice8::DrawIndexedPrimitive( " << PrimitiveType << " , " << minIndex << " , " << NumVertices << " , " << startIndex << " , " << primCount << " ) [ " << this << " ]\n"); - return m_pDevice->DrawIndexedPrimitive(PrimitiveType,minIndex,NumVertices,startIndex,primCount); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawPrimitiveUP(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) - { - LOG("IDirect3DDevice8::DrawPrimitiveUP( " << PrimitiveType << " , " << PrimitiveCount << " , " << pVertexStreamZeroData << " , " << VertexStreamZeroStride << " ) [ " << this << " ]\n"); - return m_pDevice->DrawPrimitiveUP(PrimitiveType,PrimitiveCount,pVertexStreamZeroData,VertexStreamZeroStride); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawIndexedPrimitiveUP(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3D8Base::D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) - { - LOG("IDirect3DDevice8::DrawIndexedPrimitiveUP( " << PrimitiveType << " , " << MinVertexIndex << " , " << NumVertexIndices << " , " << PrimitiveCount << " , " << pIndexData << " , " << IndexDataFormat << " , " << pVertexStreamZeroData << " , " << VertexStreamZeroStride << " ) [ " << this << " ]\n"); - return m_pDevice->DrawIndexedPrimitiveUP(PrimitiveType,MinVertexIndex,NumVertexIndices,PrimitiveCount,pIndexData,IndexDataFormat,pVertexStreamZeroData,VertexStreamZeroStride); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,D3D8Wrapper::IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) - { - LOG("IDirect3DDevice8::ProcessVertices( " << SrcStartIndex << " , " << DestIndex << " , " << VertexCount << " , " << pDestBuffer << " , " << Flags << " ) [ " << this << " ]\n"); - if (pDestBuffer == NULL) - { - return m_pDevice->ProcessVertices(SrcStartIndex,DestIndex,VertexCount,NULL,Flags); - } - else - { - return m_pDevice->ProcessVertices(SrcStartIndex,DestIndex,VertexCount,pDestBuffer->GetVertexBuffer(),Flags); - } - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateVertexShader(CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) - { - LOG("IDirect3DDevice8::CreateVertexShader( " << pDeclaration << " , " << pFunction << " , " << pHandle << " , " << Usage << " ) [ " << this << " ]\n"); - return m_pDevice->CreateVertexShader(pDeclaration,pFunction,pHandle,Usage); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetVertexShader(DWORD Handle) - { - LOG("IDirect3DDevice8::SetVertexShader( " << Handle << " ) [ " << this << " ]\n"); - return m_pDevice->SetVertexShader(Handle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShader(DWORD* pHandle) - { - LOG("IDirect3DDevice8::GetVertexShader( " << pHandle << " ) [ " << this << " ]\n"); - return m_pDevice->GetVertexShader(pHandle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeleteVertexShader(DWORD Handle) - { - LOG("IDirect3DDevice8::DeleteVertexShader( " << Handle << " ) [ " << this << " ]\n"); - return m_pDevice->DeleteVertexShader(Handle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetVertexShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount) - { - LOG("IDirect3DDevice8::SetVertexShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " ) [ " << this << " ]\n"); - return m_pDevice->SetVertexShaderConstant(Register,pConstantData,ConstantCount); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShaderConstant(DWORD Register,void* pConstantData,DWORD ConstantCount) - { - LOG("IDirect3DDevice8::GetVertexShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " ) [ " << this << " ]\n"); - return m_pDevice->GetVertexShaderConstant(Register,pConstantData,ConstantCount); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShaderDeclaration(DWORD Handle,void* pData,DWORD* pSizeOfData) - { - LOG("IDirect3DDevice8::GetVertexShaderDeclaration( " << Handle << " , " << pData << " , " << pSizeOfData << " ) [ " << this << " ]\n"); - return m_pDevice->GetVertexShaderDeclaration(Handle,pData,pSizeOfData); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShaderFunction(DWORD Handle,void* pData,DWORD* pSizeOfData) - { - LOG("IDirect3DDevice8::GetVertexShaderFunction( " << Handle << " , " << pData << " , " << pSizeOfData << " ) [ " << this << " ]\n"); - return m_pDevice->GetVertexShaderFunction(Handle,pData,pSizeOfData); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetStreamSource(UINT StreamNumber,D3D8Wrapper::IDirect3DVertexBuffer8* pStreamData,UINT Stride) - { - LOG("IDirect3DDevice8::SetStreamSource( " << StreamNumber << " , " << pStreamData << " , " << Stride << " ) [ " << this << " ]\n"); - if (pStreamData == NULL) - { - return m_pDevice->SetStreamSource(StreamNumber,NULL,Stride); - } - else - { - return m_pDevice->SetStreamSource(StreamNumber,pStreamData->GetVertexBuffer(),Stride); - } - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetStreamSource(UINT StreamNumber,D3D8Wrapper::IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) - { - LOG("IDirect3DDevice8::GetStreamSource( " << StreamNumber << " , " << ppStreamData << " , " << pStride << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DVertexBuffer8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetStreamSource(StreamNumber,&realD3D,pStride); - - D3D8Wrapper::IDirect3DVertexBuffer8* wrappedD3D = new D3D8Wrapper::IDirect3DVertexBuffer8(realD3D); - - *ppStreamData = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetIndices(D3D8Wrapper::IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) - { - LOG("IDirect3DDevice8::SetIndices( " << pIndexData << " , " << BaseVertexIndex << " ) [ " << this << " ]\n"); - if (pIndexData == NULL) - { - return m_pDevice->SetIndices(NULL,BaseVertexIndex); - } - else - { - return m_pDevice->SetIndices(pIndexData->GetIndexBuffer(),BaseVertexIndex); - } - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetIndices(D3D8Wrapper::IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) - { - LOG("IDirect3DDevice8::GetIndices( " << ppIndexData << " , " << pBaseVertexIndex << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DIndexBuffer8* realD3D = NULL; - - HRESULT hr = m_pDevice->GetIndices(&realD3D,pBaseVertexIndex);// ppIndexData,pBaseVertexIndex); - - D3D8Wrapper::IDirect3DIndexBuffer8* wrappedD3D = new D3D8Wrapper::IDirect3DIndexBuffer8(realD3D); - - *ppIndexData = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreatePixelShader(CONST DWORD* pFunction,DWORD* pHandle) - { - LOG("IDirect3DDevice8::CreatePixelShader( " << pFunction << " , " << pHandle << " ) [ " << this << " ]\n"); - return m_pDevice->CreatePixelShader(pFunction,pHandle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetPixelShader(DWORD Handle) - { - LOG("IDirect3DDevice8::SetPixelShader( " << Handle << " ) [ " << this << " ]\n"); - return m_pDevice->SetPixelShader(Handle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPixelShader(DWORD* pHandle) - { - LOG("IDirect3DDevice8::GetPixelShader( " << pHandle << " ) [ " << this << " ]\n"); - return m_pDevice->GetPixelShader(pHandle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeletePixelShader(DWORD Handle) - { - LOG("IDirect3DDevice8::DeletePixelShader( " << Handle << " ) [ " << this << " ]\n"); - return m_pDevice->DeletePixelShader(Handle); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetPixelShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount) - { - LOG("IDirect3DDevice8::SetPixelShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " ) [ " << this << " ]\n"); - return m_pDevice->SetPixelShaderConstant(Register,pConstantData,ConstantCount); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPixelShaderConstant(DWORD Register,void* pConstantData,DWORD ConstantCount) - { - LOG("IDirect3DDevice8::GetPixelShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " ) [ " << this << " ]\n"); - return m_pDevice->GetPixelShaderConstant(Register,pConstantData,ConstantCount); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPixelShaderFunction(DWORD Handle,void* pData,DWORD* pSizeOfData) - { - LOG("IDirect3DDevice8::GetPixelShaderFunction( " << Handle << " , " << pData << " , " << pSizeOfData << " ) [ " << this << " ]\n"); - return m_pDevice->GetPixelShaderFunction(Handle,pData,pSizeOfData); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DRECTPATCH_INFO* pRectPatchInfo) - { - LOG("IDirect3DDevice8::DrawRectPatch( " << Handle << " , " << pNumSegs << " , " << pRectPatchInfo << " ) [ " << this << " ]\n"); - return m_pDevice->DrawRectPatch(Handle,pNumSegs,pRectPatchInfo); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DTRIPATCH_INFO* pTriPatchInfo) - { - LOG("IDirect3DDevice8::DrawTriPatch( " << Handle << " , " << pNumSegs << " , " << pTriPatchInfo << " ) [ " << this << " ]\n"); - return m_pDevice->DrawTriPatch(Handle,pNumSegs,pTriPatchInfo); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeletePatch(UINT Handle) - { - LOG("IDirect3DDevice8::DeletePatch( " << Handle << " ) [ " << this << " ]\n"); - return m_pDevice->DeletePatch(Handle); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp deleted file mode 100644 index c8de947e5d..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DIndexBuffer8::IDirect3DIndexBuffer8(D3D8Base::IDirect3DIndexBuffer8* realIndexBuffer) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) realIndexBuffer) - { - LOG("IDirect3DIndexBuffer8( " << realIndexBuffer << " )\n"); - m_pD3D = realIndexBuffer; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::Lock(UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) - { - LOG("IDirect3DIndexBuffer8::Lock( " << OffsetToLock << " , " << SizeToLock << " , " << ppbData << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->Lock(OffsetToLock,SizeToLock,ppbData,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::Unlock() - { - LOG("IDirect3DIndexBuffer8::Unlock() [ " << this << " ]\n"); - return m_pD3D->Unlock(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::GetDesc(D3D8Base::D3DINDEXBUFFER_DESC *pDesc) - { - LOG("IDirect3DIndexBuffer8::GetDesc( " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetDesc(pDesc); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp deleted file mode 100644 index 86805a554b..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - ThreadSafePointerSet D3D8Wrapper::IDirect3DResource8::m_List; - - D3D8Wrapper::IDirect3DResource8::IDirect3DResource8(D3D8Base::IDirect3DResource8* realResource) : IDirect3DUnknown((IUnknown*) realResource) - { - LOG("IDirect3DResource8::IDirect3DResource8( " << realResource << " )\n"); - m_pD3D = realResource; - } - - D3D8Wrapper::IDirect3DResource8* D3D8Wrapper::IDirect3DResource8::GetResource(D3D8Base::IDirect3DResource8* realResource) - { - LOG("IDirect3DResource8::GetResource( " << realResource << " )\n"); - D3D8Wrapper::IDirect3DResource8* wrappedResource = (D3D8Wrapper::IDirect3DResource8*) m_List.GetDataPtr(realResource); - if( wrappedResource == NULL ) - { - wrappedResource = new D3D8Wrapper::IDirect3DResource8(realResource); - m_List.AddMember(realResource, wrappedResource); - return wrappedResource; - } - - wrappedResource->m_ulRef++; - return wrappedResource; - } - - STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DResource8::Release(THIS) - { - LOG("IDirect3DResource8::Release() [ " << this << " ]\n"); - m_pUnk->Release(); - - ULONG ulRef = --m_ulRef; - if(ulRef == 0) - { - m_List.DeleteMember(GetResource()); - delete this; - return 0; - } - return ulRef; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DResource8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice) - { - LOG("IDirect3DResource8::GetDevice( " << ppDevice << " ) [ " << this << " ]\n"); - D3D8Base::IDirect3DDevice8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetDevice(&realD3D); - - D3D8Wrapper::IDirect3DDevice8* wrappedD3D = new D3D8Wrapper::IDirect3DDevice8(realD3D); - - *ppDevice = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DResource8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) - { - LOG("IDirect3DResource8::SetPrivateData( " << &refguid << " , " << pData << " , " << SizeOfData << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DResource8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) - { - LOG("IDirect3DResource8::GetPrivateData( " << &refguid << " , " << pData << " , " << pSizeOfData << " ) [ " << this << " ]\n"); - return m_pD3D->GetPrivateData(refguid,pData,pSizeOfData); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DResource8::FreePrivateData(REFGUID refguid) - { - LOG("IDirect3DResource8::FreePrivateData( " << &refguid << " ) [ " << this << " ]\n"); - return m_pD3D->FreePrivateData(refguid); - } - - STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DResource8::SetPriority(DWORD PriorityNew) - { - LOG("IDirect3DResource8::SetPriority( " << PriorityNew << " ) [ " << this << " ]\n"); - return m_pD3D->SetPriority(PriorityNew); - } - - STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DResource8::GetPriority() - { - LOG("IDirect3DResource8::GetPriority() [ " << this << " ]\n"); - return m_pD3D->GetPriority(); - } - - STDMETHODIMP_(void) D3D8Wrapper::IDirect3DResource8::PreLoad() - { - LOG("IDirect3DResource8::PreLoad() [ " << this << " ]\n"); - return m_pD3D->PreLoad(); - } - - STDMETHODIMP_(D3D8Base::D3DRESOURCETYPE) D3D8Wrapper::IDirect3DResource8::GetType() - { - LOG("IDirect3DResource8::GetType() [ " << this << " ]\n"); - return m_pD3D->GetType(); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp deleted file mode 100644 index efd90344d9..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - ThreadSafePointerSet IDirect3DSurface8::m_List; - - D3D8Wrapper::IDirect3DSurface8::IDirect3DSurface8(D3D8Base::IDirect3DSurface8* realSurface) : IDirect3DUnknown((IUnknown*) realSurface) - { - LOG("IDirect3DSurface8::IDirect3DSurface8( " << realSurface << " )\n"); - m_pD3D = realSurface; - } - - D3D8Wrapper::IDirect3DSurface8* D3D8Wrapper::IDirect3DSurface8::GetSurface(D3D8Base::IDirect3DSurface8* realSurface) - { - LOG("IDirect3DSurface8::GetSurface( " << realSurface << " )\n"); - D3D8Wrapper::IDirect3DSurface8* wrappedSurface = (D3D8Wrapper::IDirect3DSurface8*) m_List.GetDataPtr(realSurface); - if(wrappedSurface == NULL) - { - wrappedSurface = new IDirect3DSurface8(realSurface); - m_List.AddMember(realSurface, wrappedSurface); - return wrappedSurface; - } - - wrappedSurface->m_ulRef++; - return wrappedSurface; - } - - STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DSurface8::Release(THIS) - { - LOG("IDirect3DSurface8::Release() [ " << this << " ]\n"); - m_pUnk->Release(); - - ULONG ulRef = --m_ulRef; - if(ulRef == 0) - { - m_List.DeleteMember(GetSurface()); - delete this; - return 0; - } - return ulRef; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice) - { - LOG("IDirect3DSurface8::GetDevice( " << ppDevice << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DDevice8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetDevice(&realD3D); - - D3D8Wrapper::IDirect3DDevice8* wrappedD3D = new D3D8Wrapper::IDirect3DDevice8(realD3D); - - *ppDevice = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) - { - LOG("IDirect3DSurface8::SetPrivateData( " << &refguid << " , " << pData << " , " << SizeOfData << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) - { - LOG("IDirect3DSurface8::GetPrivateData( " << &refguid << " , " << pData << " , " << pSizeOfData << " ) [ " << this << " ]\n"); - return m_pD3D->GetPrivateData(refguid,pData,pSizeOfData); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::FreePrivateData(REFGUID refguid) - { - LOG("IDirect3DSurface8::FreePrivateData( " << &refguid << " ) [ " << this << " ]\n"); - return m_pD3D->FreePrivateData(refguid); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetContainer(REFIID riid,void** ppContainer) - { - LOG("IDirect3DSurface8::GetContainer( " << &riid << " , " << ppContainer << " ) [ " << this << " ]\n"); - return m_pD3D->GetContainer(riid,ppContainer); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetDesc(D3D8Base::D3DSURFACE_DESC *pDesc) - { - LOG("IDirect3DSurface8::GetDesc( " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetDesc(pDesc); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::LockRect(D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) - { -#ifdef LOGGING - LOG("IDirect3DSurface8::LockRect( " << pLockedRect << " , " << pRect); - if (pRect != NULL) - { - LOG("{ " << pRect->left << " , " << pRect->top << " , " << pRect->right << " , " << pRect->bottom << " }"); - } - LOG(" , " << Flags << " ) [ " << this << " ]\n"); -#endif - return m_pD3D->LockRect(pLockedRect,pRect,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::UnlockRect() - { - LOG("IDirect3DSurface8::UnlockRect() [ " << this << " ]\n"); - return m_pD3D->UnlockRect(); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp deleted file mode 100644 index cbe4b13bb9..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - ThreadSafePointerSet IDirect3DSwapChain8::m_List; - - D3D8Wrapper::IDirect3DSwapChain8::IDirect3DSwapChain8(D3D8Base::IDirect3DSwapChain8* realSwapChain) : IDirect3DUnknown((IUnknown*) realSwapChain) - { - LOG("IDirect3DSwapChain8::IDirect3DSwapChain8( " << realSwapChain << " )\n"); - m_pD3D = realSwapChain; - } - - D3D8Wrapper::IDirect3DSwapChain8* D3D8Wrapper::IDirect3DSwapChain8::GetSwapChain(D3D8Base::IDirect3DSwapChain8* realSwapChain) - { - LOG("IDirect3DSwapChain8::GetSwapChain( " << realSwapChain << " )\n"); - D3D8Wrapper::IDirect3DSwapChain8* wrappedSwapChain = (D3D8Wrapper::IDirect3DSwapChain8*) m_List.GetDataPtr(realSwapChain); - if( wrappedSwapChain == NULL ) - { - wrappedSwapChain = new D3D8Wrapper::IDirect3DSwapChain8(realSwapChain); - m_List.AddMember(realSwapChain, wrappedSwapChain); - return wrappedSwapChain; - } - - wrappedSwapChain->m_ulRef++; - return wrappedSwapChain; - } - - STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DSwapChain8::Release(THIS) - { - LOG("IDirect3DSwapChain8::Release()n[ " << this << " ]\n"); - m_pUnk->Release(); - - ULONG ulRef = --m_ulRef; - if(ulRef == 0) - { - m_List.DeleteMember(GetSwapChain8()); - delete this; - return 0; - } - return ulRef; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSwapChain8::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) - { - LOG("IDirect3DSwapChain8::Present( " << pSourceRect << " , " << pDestRect << " , " << hDestWindowOverride << " , " << pDirtyRegion << " ) [ " << this << " ]\n"); - return m_pD3D->Present(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DSwapChain8::GetBackBuffer(UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer) - { - LOG("IDirect3DSwapChain8::GetBackBuffer( " << BackBuffer << " , " << Type << " , " << ppBackBuffer << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetBackBuffer(BackBuffer,Type,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppBackBuffer = wrappedD3D; - - return hr; - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp deleted file mode 100644 index bcf062a721..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DTexture8::IDirect3DTexture8(D3D8Base::IDirect3DTexture8* realTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) realTexture) - { - LOG("IDirect3DTexture8::IDirect3DTexture8( " << realTexture << " )\n"); - m_pD3D = realTexture; - } - - D3D8Wrapper::IDirect3DTexture8* D3D8Wrapper::IDirect3DTexture8::GetTexture(D3D8Base::IDirect3DTexture8* realTexture) - { - LOG("IDirect3DTexture8::GetTexture( " << realTexture << " )\n"); - D3D8Wrapper::IDirect3DTexture8* wrappedTexture = (D3D8Wrapper::IDirect3DTexture8*) D3D8Wrapper::IDirect3DResource8::m_List.GetDataPtr(realTexture); - if( wrappedTexture == NULL ) - { - wrappedTexture = new D3D8Wrapper::IDirect3DTexture8(realTexture); - D3D8Wrapper::IDirect3DResource8::m_List.AddMember(realTexture, wrappedTexture); - return wrappedTexture; - } - - wrappedTexture->m_ulRef++; - return wrappedTexture; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) - { - LOG("IDirect3DTexture8::GetLevelDesc( " << Level << " , " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetLevelDesc(Level,pDesc); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetSurfaceLevel(UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel) - { - LOG("IDirect3DTexture8::GetSurfaceLevel( " << Level << " , " << ppSurfaceLevel << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DSurface8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetSurfaceLevel(Level,&realD3D); - - D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - - *ppSurfaceLevel = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::LockRect(UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) - { - LOG("IDirect3DTexture8::LockRect( " << Level << " , " << pLockedRect << " , " << pRect << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->LockRect(Level,pLockedRect,pRect,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::UnlockRect(UINT Level) - { - LOG("IDirect3DTexture8::UnlockRect() [ " << this << " ]\n"); - return m_pD3D->UnlockRect(Level); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::AddDirtyRect(CONST RECT* pDirtyRect) - { - LOG("IDirect3DTexture8::AddDirtyRect( " << pDirtyRect << " ) [ " << this << " ]\n"); - return m_pD3D->AddDirtyRect(pDirtyRect); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp deleted file mode 100644 index 1466d9bfab..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DVertexBuffer8::IDirect3DVertexBuffer8(D3D8Base::IDirect3DVertexBuffer8* realVertexBuffer) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) realVertexBuffer) - { - LOG("IDirect3DVertexBuffer8::IDirect3DVertexBuffer8( " << realVertexBuffer << " )\n"); - m_pD3D = realVertexBuffer; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::Lock(UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) - { - LOG("IDirect3DVertexBuffer8::Lock( " << OffsetToLock << " , " << SizeToLock << " , " << ppbData << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->Lock(OffsetToLock,SizeToLock,ppbData,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::Unlock() - { - LOG("IDirect3DVertexBuffer8::Unlock() [ " << this << " ]\n"); - return m_pD3D->Unlock(); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::GetDesc(D3D8Base::D3DVERTEXBUFFER_DESC *pDesc) - { - LOG("IDirect3DVertexBuffer8::GetDesc( " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetDesc(pDesc); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp deleted file mode 100644 index 21cadda922..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DVolume8::IDirect3DVolume8(D3D8Base::IDirect3DVolume8* realVolume) : IDirect3DUnknown((IUnknown*) realVolume) - { - LOG("IDirect3DVolume8::IDirect3DVolume8( " << realVolume << " )\n"); - m_pD3D = realVolume; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice) - { - LOG("IDirect3DVolume8::GetDevice( " << ppDevice << " )\n"); - - D3D8Base::IDirect3DDevice8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetDevice(&realD3D);//ppDevice); - - D3D8Wrapper::IDirect3DDevice8* wrappedD3D = new D3D8Wrapper::IDirect3DDevice8(realD3D); - - *ppDevice = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) - { - LOG("IDirect3DVolume8::SetPrivateData( " << &refguid << " , " << pData << " , " << SizeOfData << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) - { - LOG("IDirect3DVolume8::GetPrivateData( " << &refguid << " , " << pData << " , " << pSizeOfData << " ) [ " << this << " ]\n"); - return m_pD3D->GetPrivateData(refguid,pData,pSizeOfData); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::FreePrivateData(REFGUID refguid) - { - LOG("IDirect3DVolume8::FreePrivateData( " << &refguid << " ) [ " << this << " ]\n"); - return m_pD3D->FreePrivateData(refguid); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetContainer(REFIID riid,void** ppContainer) - { - LOG("IDirect3DVolume8::GetContainer( " << &riid << " , " << ppContainer << " ) [ " << this << " ]\n"); - return m_pD3D->GetContainer(riid,ppContainer); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetDesc(D3D8Base::D3DVOLUME_DESC *pDesc) - { - LOG("IDirect3DVolume8::GetDesc( " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetDesc(pDesc); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::LockBox(D3D8Base::D3DLOCKED_BOX * pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) - { - LOG("IDirect3DVolume8::LockBox( " << pLockedVolume << " , " << pBox << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->LockBox(pLockedVolume,pBox,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::UnlockBox() - { - LOG("IDirect3DVolume8::UnlockBox() [ " << this << " ]\n"); - return m_pD3D->UnlockBox(); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp deleted file mode 100644 index 3d9c765835..0000000000 --- a/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "d3d8Wrapper.h" - -extern "C" -{ - namespace D3D8Wrapper - { - D3D8Wrapper::IDirect3DVolumeTexture8::IDirect3DVolumeTexture8(D3D8Base::IDirect3DVolumeTexture8* realVolumeTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) realVolumeTexture) - { - LOG("IDirect3DVolumeTexture8( " << realVolumeTexture << " )\n"); - m_pD3D = realVolumeTexture; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DVOLUME_DESC *pDesc) - { - LOG("IDirect3DVolumeTexture8::GetLevelDesc( " << Level << " , " << pDesc << " ) [ " << this << " ]\n"); - return m_pD3D->GetLevelDesc(Level,pDesc); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::GetVolumeLevel(UINT Level,D3D8Wrapper::IDirect3DVolume8** ppVolumeLevel) - { - LOG("IDirect3DVolumeTexture8::GetVolumeLevel( " << Level << " , " << ppVolumeLevel << " ) [ " << this << " ]\n"); - - D3D8Base::IDirect3DVolume8* realD3D = NULL; - - HRESULT hr = m_pD3D->GetVolumeLevel(Level,&realD3D); - - D3D8Wrapper::IDirect3DVolume8* wrappedD3D = new D3D8Wrapper::IDirect3DVolume8(realD3D); - - *ppVolumeLevel = wrappedD3D; - - return hr; - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::LockBox(UINT Level,D3D8Base::D3DLOCKED_BOX* pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) - { - LOG("IDirect3DVolumeTexture8::LockBox( " << Level << " , " << pLockedVolume << " , " << pBox << " , " << Flags << " ) [ " << this << " ]\n"); - return m_pD3D->LockBox(Level,pLockedVolume,pBox,Flags); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::UnlockBox(UINT Level) - { - LOG("IDirect3DVolumeTexture8::UnlockBox( " << Level << " ) [ " << this << " ]\n"); - return m_pD3D->UnlockBox(Level); - } - - STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::AddDirtyBox(CONST D3D8Base::D3DBOX* pDirtyBox) - { - LOG("IDirect3DVolumeTexture8::AddDirtyBox( " << pDirtyBox << " ) [ " << this << " ]\n"); - return m_pD3D->AddDirtyBox(pDirtyBox); - } - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/PointerSet.h b/libmupen64plus/D3D8Interceptor/PointerSet.h deleted file mode 100644 index bbcb064a0f..0000000000 --- a/libmupen64plus/D3D8Interceptor/PointerSet.h +++ /dev/null @@ -1,130 +0,0 @@ -#pragma once - -#include - -const UINT PointerSetHashSize = 128; - -struct PointerLinkedList -{ - PVOID pKey; - PVOID pData; - PointerLinkedList* pNext; -}; - -class PointerSet -{ -public: - PointerSet() - { - for(UINT i = 0; i < PointerSetHashSize; i++) - { - m_pHead[i] = NULL; - } - } - - PVOID GetDataPtr(PVOID pKey) - { - PointerLinkedList* pThis = m_pHead[GetHash(pKey)]; - while(pThis) - { - if(pThis->pKey == pKey) - { - return pThis->pData; - } - pThis = pThis->pNext; - } - return NULL; - } - bool AddMember(PVOID pKey, PVOID pData) - { - UINT Hash = GetHash(pKey); - PointerLinkedList* pThis = new PointerLinkedList; - if(pThis == NULL) - { - return false; - } - - pThis->pNext = m_pHead[Hash]; - pThis->pKey = pKey; - pThis->pData = pData; - m_pHead[Hash] = pThis; - return true; - } - bool DeleteMember(PVOID pKey) - { - UINT Hash = GetHash(pKey); - PointerLinkedList* pThis = m_pHead[Hash]; - PointerLinkedList* pLast = 0L; - - if( m_pHead[Hash]->pKey == pKey ) - { - m_pHead[Hash] = pThis->pNext; - delete pThis; - return true; - } - else - { - pLast = pThis; - pThis = pThis->pNext; - } - - while( pThis ) - { - if( pThis->pKey == pKey ) - { - pLast->pNext = pThis->pNext; - delete pThis; - return true; - } - pLast = pThis; - pThis = pThis->pNext; - } - return false; - } - __forceinline UINT GetHash(PVOID pKey) - { - DWORD Key = (DWORD)pKey; - return (( Key >> 3 ^ Key >> 7 ^ Key >> 11 ^ Key >> 17 ) & (PointerSetHashSize - 1)); - } - -private: - PointerLinkedList* m_pHead[PointerSetHashSize]; -}; - - -class ThreadSafePointerSet : public PointerSet -{ -public: - ThreadSafePointerSet() - { - InitializeCriticalSection(&m_CritSec); - } - ~ThreadSafePointerSet() - { - DeleteCriticalSection(&m_CritSec); - } - PVOID GetDataPtr(PVOID pKey) - { - EnterCriticalSection(&m_CritSec); - PVOID p = PointerSet::GetDataPtr(pKey); - LeaveCriticalSection(&m_CritSec); - return p; - } - bool AddMember(PVOID pKey, PVOID pData) - { - EnterCriticalSection(&m_CritSec); - bool Result = PointerSet::AddMember(pKey, pData); - LeaveCriticalSection(&m_CritSec); - return Result; - } - bool DeleteMember(PVOID pKey) - { - EnterCriticalSection(&m_CritSec); - bool Result = PointerSet::DeleteMember(pKey); - LeaveCriticalSection(&m_CritSec); - return Result; - } - -private: - CRITICAL_SECTION m_CritSec; -}; diff --git a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp b/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp deleted file mode 100644 index 905fdaad0f..0000000000 --- a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "d3d8Wrapper.h" - -D3D8Base::LPDIRECT3D8 g_D3D=NULL; - -HMODULE realDLL; - -extern "C" -{ - namespace D3D8Wrapper - { - IDirect3DDevice8 *last_device = NULL; - IDirect3DSurface8 *render_surface = NULL; - void (*rendering_callback)( int ); - - D3D8Wrapper::IDirect3D8* WINAPI Direct3DCreate8(UINT Version) - { - //sometimes, Intel drivers will clear the dll path. So let's save and restore it (do their job for them) - char oldDllDirectory[MAX_PATH]; - GetDllDirectory(MAX_PATH, oldDllDirectory); - - // Get the real DLL path from the system directory, needs to be specific to avoid binding to the d3d8.dll we're in now! - // Might be unsafe - CHAR dll_path[1024]; - GetSystemDirectory(dll_path,1024); - strcat(dll_path,"\\d3d8.dll"); - - realDLL = LoadLibrary(dll_path); - - D3D8Wrapper::D3DCREATE realDirect3DCreate8 = (D3D8Wrapper::D3DCREATE)GetProcAddress(realDLL, "Direct3DCreate8"); - - // Use the real Direct3DCreate8 to make the base object - D3D8Base::IDirect3D8* realD3D = realDirect3DCreate8(D3D_SDK_VERSION); - - // Wrap the object - D3D8Wrapper::IDirect3D8* wrappedD3D = D3D8Wrapper::IDirect3D8::GetDirect3D(realD3D); - - //restore old DLL directory - SetDllDirectory(oldDllDirectory); - - return wrappedD3D; - } - } - - - __declspec(dllexport) void __cdecl CloseDLL() - { - FreeLibrary(realDLL); - } - - __declspec(dllexport) void __cdecl SetRenderingCallback(void (*callback)(int)) - { - D3D8Wrapper::rendering_callback = callback; - } - - __declspec(dllexport) void __cdecl ReadScreen(void *dest, int *width, int *height) - { - if (D3D8Wrapper::last_device == NULL) - { - *width = 0; - *height = 0; - return; - } - - // surface... - // make a D3DSURFACE_DESC, pass to GetDesc - D3D8Base::D3DSURFACE_DESC desc; - D3D8Wrapper::render_surface->GetDesc(&desc); - - // get out height/width - *width = desc.Width; - *height = desc.Height; - - // if dest isn't null - if (dest != NULL) - { - // make a RECT with size of buffer - RECT entire_buffer; - entire_buffer.left = 0; - entire_buffer.top = 0; - entire_buffer.right = desc.Width; - entire_buffer.bottom = desc.Height; - - //resolve rendertarget to a system memory texture, for locking - //TODO! UNACCEPTABLE CODE! THIS IS HORRIBLE! - //X8R8G8B8 or fail -- A8R8G8B8 will malfunction (is it because the source surface format isnt matching? I think so) - static D3D8Wrapper::IDirect3DTexture8* tex = NULL; - static RECT texRect; - if(!tex || (texRect.right != entire_buffer.right) || (texRect.bottom != entire_buffer.bottom)) - { - if(tex) - tex->Release(); - texRect = entire_buffer; - D3D8Wrapper::last_device->CreateTexture(desc.Width, desc.Height, 1, 0, D3D8Base::D3DFMT_X8R8G8B8, D3D8Base::D3DPOOL_SYSTEMMEM, &tex); - } - - D3D8Wrapper::IDirect3DSurface8* surf; - tex->GetSurfaceLevel(0,&surf); - HRESULT hr = D3D8Wrapper::last_device->CopyRects(D3D8Wrapper::render_surface,NULL,0,surf,NULL); - - // make a D3DLOCKED_RECT, pass to LockRect - D3D8Base::D3DLOCKED_RECT locked; - hr = surf->LockRect(&locked,&entire_buffer,D3DLOCK_READONLY); - - //this loop was reversed from the original. - //it should be faster anyway if anything since the reading can be prefetched forwardly. - //TODO - allow bizhawk to handle flipped images.... nonetheless, it might not handle images with unusual pitches, although maybe we should consider that. - //so this code will probably remain for quite some time - int dest_row = desc.Height - 1; - for (UINT from_row = 0; from_row < desc.Height; from_row++) - { - memcpy((char*)dest + (dest_row * desc.Width*4),(char*)locked.pBits + from_row * locked.Pitch, desc.Width*4); - dest_row--; - } - - // unlock rect - surf->UnlockRect(); - surf->Release(); - } - - // release the surface - //backbuffer->Release(); - - // we're done, maybe? - } -} \ No newline at end of file diff --git a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h b/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h deleted file mode 100644 index 78fe41bdf1..0000000000 --- a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h +++ /dev/null @@ -1,436 +0,0 @@ -#pragma once - -#include -#include -#include "PointerSet.h" - -#pragma comment(linker, "/EXPORT:Direct3DCreate8=_Direct3DCreate8@4") - -//#define LOGGING 1 - -#ifdef LOGGING -#define LOG(x) { std::ofstream myfile; myfile.open ("d3d8_wrapper_log.txt", std::ios::app); myfile << x; myfile.close(); } -#else -#define LOG(x) -#endif - -namespace D3D8Base -{ - #include "d3d8base/d3d8.h" -} -extern "C" -{ - namespace D3D8Wrapper - { - class IDirect3DUnknown - { - - public: - IUnknown* m_pUnk; - ULONG m_ulRef; - - public: - IDirect3DUnknown(IUnknown* pUnk) - { - m_pUnk = pUnk; - m_ulRef = 1; - } - - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) - { - return E_FAIL; - } - - STDMETHOD_(ULONG,AddRef)(THIS) - { - m_pUnk->AddRef(); - return ++m_ulRef; - } - - STDMETHOD_(ULONG,Release)(THIS) - { - m_pUnk->Release(); - - ULONG ulRef = --m_ulRef; - if( 0 == ulRef ) - { - delete this; - return 0; - } - return ulRef; - } - }; - - class IDirect3D8; - class IDirect3DDevice8; - - class IDirect3DResource8; - class IDirect3DBaseTexture8; - class IDirect3DTexture8; - class IDirect3DVolumeTexture8; - class IDirect3DCubeTexture8; - - class IDirect3DVertexBuffer8; - class IDirect3DIndexBuffer8; - - class IDirect3DSurface8; - class IDirect3DVolume8; - - class IDirect3DSwapChain8; - - class IDirect3D8 : public IDirect3DUnknown - { - protected: - D3D8Base::IDirect3D8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - IDirect3D8(D3D8Base::IDirect3D8*); - - inline D3D8Base::IDirect3D8* GetDirect3D8() { return m_pD3D; } - static IDirect3D8* GetDirect3D(D3D8Base::IDirect3D8* pD3D); - - /*** IDirect3DUnknown methods ***/ - STDMETHOD_(ULONG,Release)(THIS); - - /*** IDirect3D8 methods ***/ - STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction); - STDMETHOD_(UINT, GetAdapterCount)(THIS); - STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3D8Base::D3DADAPTER_IDENTIFIER8* pIdentifier); - STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter); - STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,UINT Mode,D3D8Base::D3DDISPLAYMODE* pMode); - STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3D8Base::D3DDISPLAYMODE* pMode); - STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3D8Base::D3DDEVTYPE CheckType,D3D8Base::D3DFORMAT DisplayFormat,D3D8Base::D3DFORMAT BackBufferFormat,BOOL Windowed); - STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,DWORD Usage,D3D8Base::D3DRESOURCETYPE RType,D3D8Base::D3DFORMAT CheckFormat); - STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT SurfaceFormat,BOOL Windowed,D3D8Base::D3DMULTISAMPLE_TYPE MultiSampleType); - STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,D3D8Base::D3DFORMAT RenderTargetFormat,D3D8Base::D3DFORMAT DepthStencilFormat); - STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DCAPS8* pCaps); - STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter); - STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DDevice8** ppReturnedDeviceInterface); - }; - - class IDirect3DDevice8 : public IDirect3DUnknown - { - protected: - D3D8Base::IDirect3DDevice8* m_pDevice; - static ThreadSafePointerSet m_List; - public: - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) - { - - return E_FAIL; - } - - static IDirect3DDevice8* GetDirect3DDevice(D3D8Base::IDirect3DDevice8* pDevice); - __forceinline D3D8Base::IDirect3DDevice8* GetD3D8Device() { return m_pDevice; } - - /*** IDirect3DUnknown methods ***/ - STDMETHOD_(ULONG,Release)(THIS); - - IDirect3DDevice8(D3D8Base::IDirect3DDevice8*); - - /*** IDirect3DDevice8 methods ***/ - STDMETHOD(TestCooperativeLevel)(THIS); - STDMETHOD_(UINT, GetAvailableTextureMem)(THIS); - STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes); - STDMETHOD(GetDirect3D)(THIS_ D3D8Wrapper::IDirect3D8** ppD3D8); - STDMETHOD(GetDeviceCaps)(THIS_ D3D8Base::D3DCAPS8* pCaps); - STDMETHOD(GetDisplayMode)(THIS_ D3D8Base::D3DDISPLAYMODE* pMode); - STDMETHOD(GetCreationParameters)(THIS_ D3D8Base::D3DDEVICE_CREATION_PARAMETERS *pParameters); - STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,D3D8Wrapper::IDirect3DSurface8* pCursorBitmap); - STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags); - STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow); - STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DSwapChain8** pSwapChain); - STDMETHOD(Reset)(THIS_ D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters); - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion); - STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer); - STDMETHOD(GetRasterStatus)(THIS_ D3D8Base::D3DRASTER_STATUS* pRasterStatus); - STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags,CONST D3D8Base::D3DGAMMARAMP* pRamp); - STDMETHOD_(void, GetGammaRamp)(THIS_ D3D8Base::D3DGAMMARAMP* pRamp); - STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DTexture8** ppTexture); - STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DVolumeTexture8** ppVolumeTexture); - STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DCubeTexture8** ppCubeTexture); - STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DVertexBuffer8** ppVertexBuffer); - STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DIndexBuffer8** ppIndexBuffer); - STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,D3D8Wrapper::IDirect3DSurface8** ppSurface); - STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,D3D8Wrapper::IDirect3DSurface8** ppSurface); - STDMETHOD(CreateImageSurface)(THIS_ UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Wrapper::IDirect3DSurface8** ppSurface); - STDMETHOD(CopyRects)(THIS_ D3D8Wrapper::IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,D3D8Wrapper::IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray); - STDMETHOD(UpdateTexture)(THIS_ D3D8Wrapper::IDirect3DBaseTexture8* pSourceTexture,D3D8Wrapper::IDirect3DBaseTexture8* pDestinationTexture); - STDMETHOD(GetFrontBuffer)(THIS_ D3D8Wrapper::IDirect3DSurface8* pDestSurface); - STDMETHOD(SetRenderTarget)(THIS_ D3D8Wrapper::IDirect3DSurface8* pRenderTarget,D3D8Wrapper::IDirect3DSurface8* pNewZStencil); - STDMETHOD(GetRenderTarget)(THIS_ D3D8Wrapper::IDirect3DSurface8** ppRenderTarget); - STDMETHOD(GetDepthStencilSurface)(THIS_ D3D8Wrapper::IDirect3DSurface8** ppZStencilSurface); - STDMETHOD(BeginScene)(THIS); - STDMETHOD(EndScene)(THIS); - STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3D8Base::D3DRECT* pRects,DWORD Flags,D3D8Base::D3DCOLOR Color,float Z,DWORD Stencil); - STDMETHOD(SetTransform)(THIS_ D3D8Base::D3DTRANSFORMSTATETYPE State,CONST D3D8Base::D3DMATRIX* pMatrix); - STDMETHOD(GetTransform)(THIS_ D3D8Base::D3DTRANSFORMSTATETYPE State,D3D8Base::D3DMATRIX* pMatrix); - STDMETHOD(MultiplyTransform)(THIS_ D3D8Base::D3DTRANSFORMSTATETYPE,CONST D3D8Base::D3DMATRIX*); - STDMETHOD(SetViewport)(THIS_ CONST D3D8Base::D3DVIEWPORT8* pViewport); - STDMETHOD(GetViewport)(THIS_ D3D8Base::D3DVIEWPORT8* pViewport); - STDMETHOD(SetMaterial)(THIS_ CONST D3D8Base::D3DMATERIAL8* pMaterial); - STDMETHOD(GetMaterial)(THIS_ D3D8Base::D3DMATERIAL8* pMaterial); - STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3D8Base::D3DLIGHT8*); - STDMETHOD(GetLight)(THIS_ DWORD Index,D3D8Base::D3DLIGHT8*); - STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable); - STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable); - STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane); - STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane); - STDMETHOD(SetRenderState)(THIS_ D3D8Base::D3DRENDERSTATETYPE State,DWORD Value); - STDMETHOD(GetRenderState)(THIS_ D3D8Base::D3DRENDERSTATETYPE State,DWORD* pValue); - STDMETHOD(BeginStateBlock)(THIS); - STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken); - STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token); - STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token); - STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token); - STDMETHOD(CreateStateBlock)(THIS_ D3D8Base::D3DSTATEBLOCKTYPE Type,DWORD* pToken); - STDMETHOD(SetClipStatus)(THIS_ CONST D3D8Base::D3DCLIPSTATUS8* pClipStatus); - STDMETHOD(GetClipStatus)(THIS_ D3D8Base::D3DCLIPSTATUS8* pClipStatus); - STDMETHOD(GetTexture)(THIS_ DWORD Stage,D3D8Wrapper::IDirect3DBaseTexture8** ppTexture); - STDMETHOD(SetTexture)(THIS_ DWORD Stage,D3D8Wrapper::IDirect3DBaseTexture8* pTexture); - STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue); - STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD Value); - STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses); - STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize); - STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries); - STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries); - STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber); - STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber); - STDMETHOD(DrawPrimitive)(THIS_ D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount); - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3D8Base::D3DPRIMITIVETYPE,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount); - STDMETHOD(DrawPrimitiveUP)(THIS_ D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride); - STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3D8Base::D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride); - STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,D3D8Wrapper::IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags); - STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage); - STDMETHOD(SetVertexShader)(THIS_ DWORD Handle); - STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle); - STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle); - STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount); - STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount); - STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData); - STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData); - STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,D3D8Wrapper::IDirect3DVertexBuffer8* pStreamData,UINT Stride); - STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,D3D8Wrapper::IDirect3DVertexBuffer8** ppStreamData,UINT* pStride); - STDMETHOD(SetIndices)(THIS_ D3D8Wrapper::IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex); - STDMETHOD(GetIndices)(THIS_ D3D8Wrapper::IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex); - STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,DWORD* pHandle); - STDMETHOD(SetPixelShader)(THIS_ DWORD Handle); - STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle); - STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle); - STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount); - STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount); - STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData); - STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DRECTPATCH_INFO* pRectPatchInfo); - STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DTRIPATCH_INFO* pTriPatchInfo); - STDMETHOD(DeletePatch)(THIS_ UINT Handle); - }; - - class IDirect3DSwapChain8 : public IDirect3DUnknown - { - protected: - D3D8Base::IDirect3DSwapChain8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - /*** IUnknown methods ***/ - STDMETHOD_(ULONG,Release)(THIS); - - static IDirect3DSwapChain8* GetSwapChain(D3D8Base::IDirect3DSwapChain8* pSwapChain); - inline D3D8Base::IDirect3DSwapChain8* GetSwapChain8() { return m_pD3D; } - - IDirect3DSwapChain8(D3D8Base::IDirect3DSwapChain8*); - - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion); - STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer); - }; - - class IDirect3DResource8 : public IDirect3DUnknown - { - protected: - D3D8Base::IDirect3DResource8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - /*** IUnknown methods ***/ - STDMETHOD_(ULONG,Release)(THIS); - - static IDirect3DResource8* GetResource(D3D8Base::IDirect3DResource8* pSwapChain); - inline D3D8Base::IDirect3DResource8* GetResource() { return m_pD3D; } - - IDirect3DResource8(D3D8Base::IDirect3DResource8*); - - STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice); - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags); - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData); - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid); - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew); - STDMETHOD_(DWORD, GetPriority)(THIS); - STDMETHOD_(void, PreLoad)(THIS); - STDMETHOD_(D3D8Base::D3DRESOURCETYPE, GetType)(THIS); - }; - - - - class IDirect3DBaseTexture8 : public IDirect3DResource8 - { - protected: - D3D8Base::IDirect3DBaseTexture8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DBaseTexture8(D3D8Base::IDirect3DBaseTexture8*); - - inline D3D8Base::IDirect3DBaseTexture8* GetBaseTexture() { return m_pD3D; } - - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew); - STDMETHOD_(DWORD, GetLOD)(THIS); - STDMETHOD_(DWORD, GetLevelCount)(THIS); - }; - - - class IDirect3DTexture8 : public IDirect3DBaseTexture8 - { - protected: - D3D8Base::IDirect3DTexture8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DTexture8(D3D8Base::IDirect3DTexture8*); - - static D3D8Wrapper::IDirect3DTexture8* GetTexture(D3D8Base::IDirect3DTexture8*); - - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc); - STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel); - STDMETHOD(LockRect)(THIS_ UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags); - STDMETHOD(UnlockRect)(THIS_ UINT Level); - STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect); - }; - - - - class IDirect3DVolumeTexture8 : public IDirect3DBaseTexture8 - { - protected: - D3D8Base::IDirect3DVolumeTexture8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DVolumeTexture8(D3D8Base::IDirect3DVolumeTexture8*); - - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DVOLUME_DESC *pDesc); - STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,D3D8Wrapper::IDirect3DVolume8** ppVolumeLevel); - STDMETHOD(LockBox)(THIS_ UINT Level,D3D8Base::D3DLOCKED_BOX* pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags); - STDMETHOD(UnlockBox)(THIS_ UINT Level); - STDMETHOD(AddDirtyBox)(THIS_ CONST D3D8Base::D3DBOX* pDirtyBox); - }; - - - - class IDirect3DCubeTexture8 : public IDirect3DBaseTexture8 - { - protected: - D3D8Base::IDirect3DCubeTexture8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DCubeTexture8(D3D8Base::IDirect3DCubeTexture8*); - - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc); - STDMETHOD(GetCubeMapSurface)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Wrapper::IDirect3DSurface8** ppCubeMapSurface); - STDMETHOD(LockRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags); - STDMETHOD(UnlockRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level); - STDMETHOD(AddDirtyRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect); - }; - - - class IDirect3DVertexBuffer8 : public IDirect3DResource8 - { - protected: - D3D8Base::IDirect3DVertexBuffer8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DVertexBuffer8(D3D8Base::IDirect3DVertexBuffer8*); - - inline D3D8Base::IDirect3DVertexBuffer8* GetVertexBuffer() { return m_pD3D; } - - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags); - STDMETHOD(Unlock)(THIS); - STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DVERTEXBUFFER_DESC *pDesc); - }; - - - - class IDirect3DIndexBuffer8 : public IDirect3DResource8 - { - protected: - D3D8Base::IDirect3DIndexBuffer8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DIndexBuffer8(D3D8Base::IDirect3DIndexBuffer8*); - - inline D3D8Base::IDirect3DIndexBuffer8* GetIndexBuffer() { return m_pD3D; } - - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags); - STDMETHOD(Unlock)(THIS); - STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DINDEXBUFFER_DESC *pDesc); - }; - - - - - class IDirect3DSurface8 : public IDirect3DUnknown - { - protected: - D3D8Base::IDirect3DSurface8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DSurface8(D3D8Base::IDirect3DSurface8*); - static IDirect3DSurface8* GetSurface(D3D8Base::IDirect3DSurface8* pSurface); - inline D3D8Base::IDirect3DSurface8* GetSurface() { return m_pD3D; } - - /*** IDirect3DUnknown methods ***/ - STDMETHOD_(ULONG, Release)(THIS); - - STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice); - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags); - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData); - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid); - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer); - STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DSURFACE_DESC *pDesc); - STDMETHOD(LockRect)(THIS_ D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags); - STDMETHOD(UnlockRect)(THIS); - }; - - - - - class IDirect3DVolume8 : public IDirect3DUnknown - { - protected: - D3D8Base::IDirect3DVolume8* m_pD3D; - static ThreadSafePointerSet m_List; - public: - - IDirect3DVolume8(D3D8Base::IDirect3DVolume8*); - - - STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice); - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags); - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData); - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid); - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer); - STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DVOLUME_DESC *pDesc); - STDMETHOD(LockBox)(THIS_ D3D8Base::D3DLOCKED_BOX * pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags); - STDMETHOD(UnlockBox)(THIS); - }; - - - typedef D3D8Base::IDirect3D8* (WINAPI *D3DCREATE)(UINT); - IDirect3D8* WINAPI Direct3DCreate8(UINT Version); - extern IDirect3DDevice8 *last_device; - extern IDirect3DSurface8 *render_surface; - extern void (*rendering_callback)( int ); - } -} \ No newline at end of file diff --git a/libmupen64plus/deps/libs/libboost_filesystem-vc100-mt-1_57.lib b/libmupen64plus/deps/libs/libboost_filesystem-vc100-mt-1_57.lib deleted file mode 100644 index f1c859e89f..0000000000 Binary files a/libmupen64plus/deps/libs/libboost_filesystem-vc100-mt-1_57.lib and /dev/null differ diff --git a/libmupen64plus/deps/libs/libboost_filesystem-vc100-mt-gd-1_57.lib b/libmupen64plus/deps/libs/libboost_filesystem-vc100-mt-gd-1_57.lib deleted file mode 100644 index 049c070fd4..0000000000 Binary files a/libmupen64plus/deps/libs/libboost_filesystem-vc100-mt-gd-1_57.lib and /dev/null differ diff --git a/libmupen64plus/deps/libs/libboost_filesystem-vc140-mt-gd-1_57.lib b/libmupen64plus/deps/libs/libboost_filesystem-vc140-mt-gd-1_57.lib deleted file mode 100644 index fd7796d3c7..0000000000 Binary files a/libmupen64plus/deps/libs/libboost_filesystem-vc140-mt-gd-1_57.lib and /dev/null differ diff --git a/libmupen64plus/deps/libs/libboost_system-vc100-mt-1_57.lib b/libmupen64plus/deps/libs/libboost_system-vc100-mt-1_57.lib deleted file mode 100644 index 4c2b31210c..0000000000 Binary files a/libmupen64plus/deps/libs/libboost_system-vc100-mt-1_57.lib and /dev/null differ diff --git a/libmupen64plus/deps/libs/libboost_system-vc100-mt-gd-1_57.lib b/libmupen64plus/deps/libs/libboost_system-vc100-mt-gd-1_57.lib deleted file mode 100644 index bff439d6e6..0000000000 Binary files a/libmupen64plus/deps/libs/libboost_system-vc100-mt-gd-1_57.lib and /dev/null differ diff --git a/libmupen64plus/deps/libs/libboost_system-vc140-mt-gd-1_57.lib b/libmupen64plus/deps/libs/libboost_system-vc140-mt-gd-1_57.lib deleted file mode 100644 index 2be153511a..0000000000 Binary files a/libmupen64plus/deps/libs/libboost_system-vc140-mt-gd-1_57.lib and /dev/null differ diff --git a/libmupen64plus/mupen64plus-audio-bkm/mupen64plus-audio-bkm/mupen64plus-audio-bkm.vcxproj b/libmupen64plus/mupen64plus-audio-bkm/mupen64plus-audio-bkm/mupen64plus-audio-bkm.vcxproj index 0ed36af40a..e471fa7c61 100644 --- a/libmupen64plus/mupen64plus-audio-bkm/mupen64plus-audio-bkm/mupen64plus-audio-bkm.vcxproj +++ b/libmupen64plus/mupen64plus-audio-bkm/mupen64plus-audio-bkm/mupen64plus-audio-bkm.vcxproj @@ -1,18 +1,10 @@  - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -23,77 +15,35 @@ mupen64plusaudiobkm - - DynamicLibrary - true - MultiByte - v142 - DynamicLibrary true MultiByte - v142 - - - DynamicLibrary - false - true - MultiByte - v142 + v143 DynamicLibrary false true MultiByte - v142 + v143 - - - - - - - - $(SolutionDir)..\..\..\..\Assets\dll\ - - $(SolutionDir)..\..\..\..\Assets\dll\ - - - $(SolutionDir)..\..\..\..\Assets\dll\ + $(SolutionDir)..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ + $(SolutionDir)..\..\..\Assets\dll\ - - - Level3 - Disabled - ..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - false - - - true - - - - - - Level3 @@ -111,28 +61,6 @@ - - - Level3 - MaxSpeed - - - false - ..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - true - - - true - true - true - - - - - - Level3 diff --git a/libmupen64plus/mupen64plus-core/projects/msvc11/mupen64plus-core.vcxproj b/libmupen64plus/mupen64plus-core/projects/msvc/mupen64plus-core.vcxproj similarity index 60% rename from libmupen64plus/mupen64plus-core/projects/msvc11/mupen64plus-core.vcxproj rename to libmupen64plus/mupen64plus-core/projects/msvc/mupen64plus-core.vcxproj index b08b1a6a3b..a8b2f2571a 100644 --- a/libmupen64plus/mupen64plus-core/projects/msvc11/mupen64plus-core.vcxproj +++ b/libmupen64plus/mupen64plus-core/projects/msvc/mupen64plus-core.vcxproj @@ -1,18 +1,10 @@  - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -24,114 +16,52 @@ Win32Proj - - DynamicLibrary - MultiByte - true - v142 - DynamicLibrary MultiByte true - v142 - - - DynamicLibrary - MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\..\Assets\dll\ $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ $(Configuration)\ - true true - $(SolutionDir)..\..\..\..\Assets\dll\ $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ $(Configuration)\ - false false - AllRules.ruleset AllRules.ruleset - - - AllRules.ruleset AllRules.ruleset - - - - mupen64plus - mupen64plus - - mupen64plus - mupen64plus - - - Disabled - ..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\freetype-2.6\include;%(AdditionalIncludeDirectories) - DBG;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Default - true - - - winmm.lib;shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\libpng.lib;..\..\..\mupen64plus-win32-deps\freetype-2.6\lib\freetype.lib;%(AdditionalDependencies) - $(OutDir)mupen64plus.dll - true - Windows - MachineX86 - - - - - - Disabled - ..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\freetype-2.6\include;%(AdditionalIncludeDirectories) + ..\..\src;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\freetype-2.13.0\include;%(AdditionalIncludeDirectories) DBG;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions) false EnableFastChecks @@ -144,7 +74,7 @@ true - winmm.lib;shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\x64\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\freetype-2.6\lib\x64\freetype26.lib;%(AdditionalDependencies) + winmm.lib;shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x64\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\x64\freetype.lib;%(AdditionalDependencies) $(OutDir)mupen64plus.dll true Windows @@ -154,35 +84,9 @@ - - - ..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\freetype-2.6\include;%(AdditionalIncludeDirectories) - DBG;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - Default - true - - - winmm.lib;shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\libpng.lib;..\..\..\mupen64plus-win32-deps\freetype-2.6\lib\freetype.lib;%(AdditionalDependencies) - $(OutDir)mupen64plus.dll - true - Windows - true - true - MachineX86 - /PDBALTPATH:%_PDB%.%_EXT% %(AdditionalOptions) - - - - - - - ..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\freetype-2.6\include;%(AdditionalIncludeDirectories) + ..\..\src;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\freetype-2.13.0\include;%(AdditionalIncludeDirectories) DBG;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions) MultiThreadedDLL @@ -192,7 +96,7 @@ true - winmm.lib;shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\x64\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\freetype-2.6\lib\x64\freetype26.lib;%(AdditionalDependencies) + winmm.lib;shell32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x64\zlib.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\x64\freetype.lib;%(AdditionalDependencies) $(OutDir)mupen64plus.dll true Windows @@ -215,13 +119,9 @@ - $(IntDir)%(Filename)1.obj $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc $(IntDir)%(Filename)1.xdc diff --git a/libmupen64plus/mupen64plus-core/projects/msvc8/mupen64plus-core.vcproj b/libmupen64plus/mupen64plus-core/projects/msvc8/mupen64plus-core.vcproj deleted file mode 100644 index e59527d6b2..0000000000 --- a/libmupen64plus/mupen64plus-core/projects/msvc8/mupen64plus-core.vcproj +++ /dev/null @@ -1,693 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libmupen64plus/mupen64plus-core/projects/unix/Makefile b/libmupen64plus/mupen64plus-core/projects/unix/Makefile deleted file mode 100644 index d548ab9c6b..0000000000 --- a/libmupen64plus/mupen64plus-core/projects/unix/Makefile +++ /dev/null @@ -1,583 +0,0 @@ -#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -# * Mupen64plus - Makefile * -# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * -# * Copyright (C) 2008-2009 Richard Goedeken * -# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation; either version 2 of the License, or * -# * (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program; if not, write to the * -# * Free Software Foundation, Inc., * -# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -# Makefile for Mupen64Plus Core - -# detect operating system -UNAME ?= $(shell uname -s) -OS := NONE -ifeq ("$(UNAME)","Linux") - OS = LINUX -endif -ifeq ("$(UNAME)","linux") - OS = LINUX -endif -ifneq ("$(filter GNU hurd,$(UNAME))","") - OS = LINUX -endif -ifeq ("$(UNAME)","Darwin") - OS = OSX -endif -ifeq ("$(UNAME)","FreeBSD") - OS = FREEBSD -endif -ifeq ("$(UNAME)","OpenBSD") - OS = FREEBSD - CFLAGS += -DIOAPI_NO_64 - $(warning OS type "$(UNAME)" not officially supported.') -endif -ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") - OS = LINUX -endif -ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") - OS = MINGW - PIC = 0 -endif -ifeq ("$(OS)","NONE") - $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# detect system architecture -HOST_CPU ?= $(shell uname -m) -CPU := NONE -ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") - CPU := X86 - ifeq ("$(BITS)", "32") - ARCH_DETECTED := 64BITS_32 - PIC ?= 0 - else - ARCH_DETECTED := 64BITS - PIC ?= 1 - endif -endif -ifneq ("$(filter pentium i%86,$(HOST_CPU))","") - CPU := X86 - ARCH_DETECTED := 32BITS - PIC ?= 0 -endif -ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 32BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 64BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter arm%,$(HOST_CPU))","") - ifeq ("$(filter arm%b,$(HOST_CPU))","") - CPU := ARM - ARCH_DETECTED := 32BITS - PIC ?= 1 - NEW_DYNAREC := 1 - CFLAGS += -mfpu=vfp -mfloat-abi=softfp - $(warning Architecture "$(HOST_CPU)" not officially supported.') - endif -endif -ifeq ("$(CPU)","NONE") - $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# base CFLAGS, LDLIBS, and LDFLAGS -OPTFLAGS ?= -O3 -flto -WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -DM64P_PARALLEL -CXXFLAGS += -fvisibility-inlines-hidden -LDLIBS += -lm - -# Since we are building a shared library, we must compile with -fPIC on some architectures -# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch -ifeq ($(PIC), 1) - CFLAGS += -fPIC -else - CFLAGS += -fno-PIC -endif - -ifeq ($(BIG_ENDIAN), 1) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# tweak flags for 32-bit build on 64-bit system -ifeq ($(ARCH_DETECTED), 64BITS_32) - ifeq ($(OS), FREEBSD) - $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) - endif - CFLAGS += -m32 - LDFLAGS += -Wl,-m,elf_i386 -endif - -# set special flags per-system -ifeq ($(OS), FREEBSD) - TARGET = libmupen64plus$(POSTFIX).so.2.0.0 - SONAME = libmupen64plus$(POSTFIX).so.2 - LDFLAGS += -Wl,-Bsymbolic -shared -Wl,-export-dynamic -Wl,-soname,$(SONAME) - LDLIBS += -L${LOCALBASE}/lib -lc -endif -ifeq ($(OS), LINUX) - TARGET = libmupen64plus$(POSTFIX).so.2.0.0 - SONAME = libmupen64plus$(POSTFIX).so.2 - LDFLAGS += -Wl,-Bsymbolic -shared -Wl,-export-dynamic -Wl,-soname,$(SONAME) - LDLIBS += -ldl - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/api/api_export.ver -endif -ifeq ($(OS), OSX) - #xcode-select has been around since XCode 3.0, i.e. OS X 10.5 - OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs - OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1) - - TARGET = libmupen64plus$(POSTFIX).dylib - LDFLAGS += -bundle -read_only_relocs suppress - LDLIBS += -ldl - ifeq ($(CPU), X86) - ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) - else - CFLAGS += -pipe -mmmx -msse -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) - ifneq ($(PROFILE), 1) - CFLAGS += -fomit-frame-pointer - endif - endif - endif -endif -ifeq ($(OS), MINGW) - TARGET = mupen64plus$(POSTFIX).dll - LDFLAGS += -Wl,-Bsymbolic -shared -Wl,-export-all-symbols - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/api/api_export.ver - LDLIBS += -lpthread -endif - -ifeq ($(CPU_ENDIANNESS), BIG) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# disable verbose output -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - Q_CC = @echo ' CC '$@; - Q_CXX = @echo ' CXX '$@; - Q_LD = @echo ' LD '$@; -endif -endif - -# test for essential build dependencies -ifeq ($(origin PKG_CONFIG), undefined) - PKG_CONFIG = $(CROSS_COMPILE)pkg-config - ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) - $(error $(PKG_CONFIG) not found) - endif -endif - -ifeq ($(OS), OSX) # use system zlib on OSX - ZLIB_LDLIBS += -lz -endif - -ifeq ($(origin ZLIB_CFLAGS) $(origin ZLIB_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion zlib 2>/dev/null),) - $(error No zlib development libraries found!) - endif - ZLIB_CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib) - ZLIB_LDLIBS += $(shell $(PKG_CONFIG) --libs zlib) -endif -CFLAGS += $(ZLIB_CFLAGS) -LDLIBS += $(ZLIB_LDLIBS) - -ifeq ($(origin LIBPNG_CFLAGS) $(origin LIBPNG_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),) - $(error No libpng development libraries found!) - endif - LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) - LIBPNG_LDLIBS += $(shell $(PKG_CONFIG) --libs libpng) -endif -CFLAGS += $(LIBPNG_CFLAGS) -LDLIBS += $(LIBPNG_LDLIBS) - -# test for presence of SDL -ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) - SDL_CONFIG = $(CROSS_COMPILE)sdl-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - $(error No SDL development libraries found!) - endif - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs) -endif -CFLAGS += $(SDL_CFLAGS) -LDLIBS += $(SDL_LDLIBS) - -OSD ?= 1 -ifeq ($(OSD), 1) - CFLAGS += -DM64P_OSD - - ifeq ($(origin FREETYPE2_CFLAGS) $(origin FREETYPE2_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion freetype2 2>/dev/null),) - $(error No freetype2 development libraries found!) - endif - FREETYPE2_CFLAGS += $(shell $(PKG_CONFIG) --cflags freetype2) - FREETYPE2_LDLIBS += $(shell $(PKG_CONFIG) --libs freetype2) - endif - CFLAGS += $(FREETYPE2_CFLAGS) - LDLIBS += $(FREETYPE2_LDLIBS) - - # search for OpenGL libraries - ifeq ($(OS), OSX) - GL_LDLIBS = -framework OpenGL - GLU_LDLIBS = -framework OpenGL - endif - ifeq ($(OS), MINGW) - GL_LDLIBS = -lopengl32 - GLU_LDLIBS = -lglu32 - endif - - ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) - $(error No OpenGL development libraries found!) - endif - GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) - GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl) - endif - CFLAGS += $(GL_CFLAGS) - LDLIBS += $(GL_LDLIBS) - - ifeq ($(origin GLU_CFLAGS) $(origin GLU_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion glu 2>/dev/null),) - $(error No OpenGL utility development libraries found!) - endif - GLU_CFLAGS += $(shell $(PKG_CONFIG) --cflags glu) - GLU_LDLIBS += $(shell $(PKG_CONFIG) --libs glu) - endif - CFLAGS += $(GLU_CFLAGS) - LDLIBS += $(GLU_LDLIBS) -endif - -# set base program pointers and flags -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -RM ?= rm -f -INSTALL ?= install -MKDIR ?= mkdir -p -COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -ifeq ($(OS),OSX) - LDCONFIG ?= true # no 'ldconfig' under OSX -else - ifeq ($(OS),LINUX) - LDCONFIG ?= PATH="$$PATH:/sbin" ldconfig -n - endif - ifeq ($(OS),FREEBSD) - LDCONFIG ?= PATH="$$PATH:/sbin" ldconfig -m - endif -endif - -# compiler/linker flags for various compile-time options. -# 1. macro for no assembly language -ifeq ($(NO_ASM), 1) - CFLAGS += -DNO_ASM -endif -# 2. variables for profiling and adding debugging symbols -ifeq ($(PROFILE), 1) - CFLAGS += -pg -g - INSTALL_STRIP_FLAG ?= -else - ifeq ($(DEBUG), 1) - CFLAGS += -g - INSTALL_STRIP_FLAG ?= - else - ifneq ($(OS),OSX) - INSTALL_STRIP_FLAG ?= -s - endif - endif -endif -# 3. other options given to the makefile on the command line -ifeq ($(LIRC), 1) - CFLAGS += -DWITH_LIRC -endif -ifeq ($(DEBUGGER), 1) - CFLAGS += -DDBG -endif -ifeq ($(DBG_COMPARE), 1) - CFLAGS += -DCOMPARE_CORE -endif -ifeq ($(DBG_CORE), 1) - CFLAGS += -DCORE_DBG -endif -ifeq ($(DBG_COUNT), 1) - CFLAGS += -DCOUNT_INSTR -endif -ifeq ($(DBG_TIMING), 1) - CFLAGS += -DPROFILE - LDFLAGS += -lrt -endif -ifeq ($(DBG_PROFILE), 1) - CFLAGS += -DPROFILE_R4300 -endif -# 4. compile-time directory paths for building into the library -ifneq ($(SHAREDIR),) - CFLAGS += -DSHAREDIR="$(SHAREDIR)" -endif - -# set installation options -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif -ifeq ($(SHAREDIR),) - SHAREDIR := $(PREFIX)/share/mupen64plus -endif -ifeq ($(LIBDIR),) - LIBDIR := $(PREFIX)/lib -endif -ifeq ($(INCDIR),) - INCDIR := $(PREFIX)/include/mupen64plus -endif - -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - -# list of required source files for compilation -SOURCE = \ - $(SRCDIR)/api/callbacks.c \ - $(SRCDIR)/api/common.c \ - $(SRCDIR)/api/config.c \ - $(SRCDIR)/api/debugger.c \ - $(SRCDIR)/api/frontend.c \ - $(SRCDIR)/api/vidext.c \ - $(SRCDIR)/main/main.c \ - $(SRCDIR)/main/util.c \ - $(SRCDIR)/main/cheat.c \ - $(SRCDIR)/main/eventloop.c \ - $(SRCDIR)/main/md5.c \ - $(SRCDIR)/main/rom.c \ - $(SRCDIR)/main/savestates.c \ - $(SRCDIR)/main/sdl_key_converter.c \ - $(SRCDIR)/main/workqueue.c \ - $(SRCDIR)/memory/dma.c \ - $(SRCDIR)/memory/flashram.c \ - $(SRCDIR)/memory/memory.c \ - $(SRCDIR)/memory/n64_cic_nus_6105.c \ - $(SRCDIR)/memory/pif.c \ - $(SRCDIR)/memory/tlb.c \ - $(SRCDIR)/plugin/plugin.c \ - $(SRCDIR)/plugin/dummy_video.c \ - $(SRCDIR)/plugin/dummy_audio.c \ - $(SRCDIR)/plugin/dummy_input.c \ - $(SRCDIR)/plugin/dummy_rsp.c \ - $(SRCDIR)/r4300/r4300.c \ - $(SRCDIR)/r4300/exception.c \ - $(SRCDIR)/r4300/interupt.c \ - $(SRCDIR)/r4300/profile.c \ - $(SRCDIR)/r4300/pure_interp.c \ - $(SRCDIR)/r4300/recomp.c \ - $(SRCDIR)/r4300/reset.c \ - $(SRCDIR)/osd/screenshot.cpp -ifeq ("$(OS)","MINGW") -SOURCE += \ - $(SRCDIR)/osal/dynamiclib_win32.c \ - $(SRCDIR)/osal/files_win32.c -else -SOURCE += \ - $(SRCDIR)/osal/dynamiclib_unix.c \ - $(SRCDIR)/osal/files_unix.c -endif - -ifeq ($(OSD), 1) -SOURCE += \ - $(SRCDIR)/osd/OGLFT.cpp \ - $(SRCDIR)/osd/osd.cpp -endif - -# source files for optional features -ifneq ($(NO_ASM), 1) - ifeq ($(CPU), X86) - ifeq ($(ARCH_DETECTED), 64BITS) - DYNAREC = x86_64 - else - DYNAREC = x86 - endif - endif - ifeq ($(CPU), ARM) - ifeq ($(ARCH_DETECTED), 32BITS) - DYNAREC = arm - endif - endif -endif -ifneq ($(DYNAREC), ) - CFLAGS += -DDYNAREC - - ifeq ($(NEW_DYNAREC), 1) - ifeq ($(DYNAREC), x86) - CFLAGS += -DNEW_DYNAREC=1 - else - ifeq ($(DYNAREC), arm) - CFLAGS += -DNEW_DYNAREC=3 - else - $(error NEW_DYNAREC is only supported on 32 bit x86 and 32 bit armel) - endif - endif - - SOURCE += \ - $(SRCDIR)/r4300/empty_dynarec.c \ - $(SRCDIR)/r4300/new_dynarec/linkage_$(DYNAREC).S \ - $(SRCDIR)/r4300/new_dynarec/new_dynarec.c - else - SOURCE += \ - $(SRCDIR)/r4300/$(DYNAREC)/assemble.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gbc.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gcop0.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gcop1.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gcop1_d.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gcop1_l.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gcop1_s.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gcop1_w.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gr4300.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gregimm.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gspecial.c \ - $(SRCDIR)/r4300/$(DYNAREC)/gtlb.c \ - $(SRCDIR)/r4300/$(DYNAREC)/regcache.c \ - $(SRCDIR)/r4300/$(DYNAREC)/rjump.c - endif -else - SOURCE += $(SRCDIR)/r4300/empty_dynarec.c -endif - -ifeq ($(LIRC), 1) - SOURCE += $(SRCDIR)/main/lirc.c - LDLIBS += -llirc_client -endif - -ifeq ($(shell $(PKG_CONFIG) --modversion minizip 2>/dev/null),) - SOURCE += \ - $(SRCDIR)/main/zip/ioapi.c \ - $(SRCDIR)/main/zip/zip.c \ - $(SRCDIR)/main/zip/unzip.c - - CFLAGS += -DNOCRYPT -DNOUNCRYPT -else - CFLAGS += $(shell $(PKG_CONFIG) --cflags minizip) -DLIBMINIZIP - LDLIBS += $(shell $(PKG_CONFIG) --libs minizip) -endif - - -ifeq ($(DEBUGGER), 1) - SOURCE += \ - $(SRCDIR)/debugger/debugger.c \ - $(SRCDIR)/debugger/dbg_decoder.c \ - $(SRCDIR)/debugger/dbg_memory.c \ - $(SRCDIR)/debugger/dbg_breakpoints.c - LDLIBS += -lopcodes -lbfd -endif - -# generate a list of object files to build, make a temporary directory for them -OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) -OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) -OBJECTS += $(patsubst $(SRCDIR)/%.S, $(OBJDIR)/%.o, $(filter %.S, $(SOURCE))) -OBJDIRS = $(dir $(OBJECTS)) -$(shell $(MKDIR) $(OBJDIRS)) - -# build targets -targets: - @echo "Mupen64Plus-core makefile. " - @echo " Targets:" - @echo " all == Build Mupen64Plus core library" - @echo " clean == remove object files" - @echo " install == Install Mupen64Plus core library" - @echo " uninstall == Uninstall Mupen64Plus core library" - @echo " Build Options:" - @echo " BITS=32 == build 32-bit binaries on 64-bit machine" - @echo " LIRC=1 == enable LIRC support" - @echo " NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code)" - @echo " SHAREDIR=path == extra path to search for shared data files" - @echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)" - @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" - @echo " PIC=(1|0) == Force enable/disable of position independent code" - @echo " OSD=(1|0) == Enable/disable build of OpenGL On-screen display" - @echo " NEW_DYNAREC=1 == Replace dynamic recompiler with Ari64's experimental dynarec" - @echo " POSTFIX=name == String added to the name of the the build (default: '')" - @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local/)" - @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" - @echo " LIBDIR=path == path to install core library (default: PREFIX/lib)" - @echo " INCDIR=path == path to install core header files (default: PREFIX/include/mupen64plus)" - @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" - @echo " Debugging Options:" - @echo " PROFILE=1 == build gprof instrumentation into binaries for profiling" - @echo " DEBUG=1 == add debugging symbols to binaries" - @echo " DEBUGGER=1 == build debugger API into core for front-ends. runs slower." - @echo " DBG_CORE=1 == print debugging info in r4300 core" - @echo " DBG_COUNT=1 == print R4300 instruction count totals (64-bit dynarec only)" - @echo " DBG_COMPARE=1 == enable core-synchronized r4300 debugging" - @echo " DBG_TIMING=1 == print timing data" - @echo " DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file" - @echo " V=1 == show verbose compiler output" - -all: $(TARGET) - -install: $(TARGET) - $(INSTALL) -d "$(DESTDIR)$(LIBDIR)" - $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(LIBDIR)" - $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" - $(INSTALL) -m 0644 ../../data/* "$(DESTDIR)$(SHAREDIR)" - $(INSTALL) -d "$(DESTDIR)$(INCDIR)" - $(INSTALL) -m 0644 ../../src/api/m64p_*.h "$(DESTDIR)$(INCDIR)" - -$(LDCONFIG) "$(DESTDIR)$(LIBDIR)" - if [ ! -e "$(DESTDIR)$(LIBDIR)/$(SONAME)" ]; then ln -sf "$(TARGET)" "$(DESTDIR)$(LIBDIR)/$(SONAME)"; fi - -uninstall: - $(RM) "$(DESTDIR)$(LIBDIR)/$(TARGET)" - if [ "$(SONAME)" != "" ]; then $(RM) "$(DESTDIR)$(LIBDIR)/$(SONAME)"; fi - $(RM) $(DESTDIR)$(INCDIR)/m64p_*.h - $(RM) "$(DESTDIR)$(SHAREDIR)/mupen64plus.cht" - $(RM) "$(DESTDIR)$(SHAREDIR)/mupen64plus.ini" - $(RM) "$(DESTDIR)$(SHAREDIR)/font.ttf" - $(RM) "$(DESTDIR)$(SHAREDIR)/mupencheat.txt" - -clean: - $(RM) -r $(TARGET) $(SONAME) $(OBJDIR) - -# build dependency files -CFLAGS += -MD --include $(OBJECTS:.o=.d) - -CXXFLAGS += $(CFLAGS) - -# standard build rules -$(OBJDIR)/%.o: $(SRCDIR)/%.S - $(COMPILE.c) -o $@ $< - -$(OBJDIR)/%.o: $(SRCDIR)/%.c - $(COMPILE.c) -o $@ $< - -$(OBJDIR)/%.o: $(SRCDIR)/%.cpp - $(COMPILE.cc) -o $@ $< - -$(TARGET): $(OBJECTS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - if [ "$(SONAME)" != "" ]; then ln -sf $@ $(SONAME); fi - -.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-core/src/api/callbacks.c b/libmupen64plus/mupen64plus-core/src/api/callbacks.c index b889e0080d..4c903a3328 100644 --- a/libmupen64plus/mupen64plus-core/src/api/callbacks.c +++ b/libmupen64plus/mupen64plus-core/src/api/callbacks.c @@ -53,31 +53,33 @@ m64p_error SetStateCallback(ptr_StateCallback pFunc, void *Context) void DebugMessage(int level, const char *message, ...) { - char msgbuf[256]; - va_list args; - extern HANDLE rompausesem; - int new_vi(); + char msgbuf[256]; + va_list args; + extern HANDLE rompausesem; + int new_vi(); - if(level == M64MSG_ERROR) - { - //trigger a vsync just to get out of frame advance - new_vi(); - WaitForSingleObject(rompausesem, INFINITE); - } + if(level == M64MSG_ERROR) + { + //trigger a vsync just to get out of frame advance + new_vi(); + WaitForSingleObject(rompausesem, INFINITE); + } - if (pDebugFunc == NULL) - { - va_start(args, message); - vprintf(message, args); - return; - } + if (pDebugFunc == NULL) + { + va_start(args, message); + vprintf(message, args); + printf("\n"); + va_end(args); + return; + } - va_start(args, message); - vsprintf(msgbuf, message, args); + va_start(args, message); + vsprintf(msgbuf, message, args); - (*pDebugFunc)(DebugContext, level, msgbuf); + (*pDebugFunc)(DebugContext, level, msgbuf); - va_end(args); + va_end(args); } void StateChanged(m64p_core_param param_type, int new_value) diff --git a/libmupen64plus/mupen64plus-core/src/api/frontend.c b/libmupen64plus/mupen64plus-core/src/api/frontend.c index 6e53023940..153f5d9345 100644 --- a/libmupen64plus/mupen64plus-core/src/api/frontend.c +++ b/libmupen64plus/mupen64plus-core/src/api/frontend.c @@ -112,7 +112,9 @@ EXPORT m64p_error CALL CoreShutdown(void) savestates_deinit(); /* tell SDL to shut down */ - SDL_Quit(); + extern int initialized_video; + if (initialized_video) + SDL_QuitSubSystem(SDL_INIT_VIDEO); l_CoreInit = 0; return M64ERR_SUCCESS; diff --git a/libmupen64plus/mupen64plus-core/src/api/vidext.c b/libmupen64plus/mupen64plus-core/src/api/vidext.c index 0e23594588..54ddee6b02 100644 --- a/libmupen64plus/mupen64plus-core/src/api/vidext.c +++ b/libmupen64plus/mupen64plus-core/src/api/vidext.c @@ -22,7 +22,7 @@ /* This file contains the Core video extension functions which will be exported * outside of the core library. */ - +#include #include #include #include @@ -40,7 +40,7 @@ #endif /* local variables */ -static m64p_video_extension_functions l_ExternalVideoFuncTable = {10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; +static m64p_video_extension_functions l_ExternalVideoFuncTable = {11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; static int l_VideoExtensionActive = 0; static int l_VideoOutputActive = 0; static int l_Fullscreen = 0; @@ -90,6 +90,8 @@ int VidExt_VideoRunning(void) return l_VideoOutputActive; } +size_t vidext_init = 0; + /* video extension functions to be called by the video plugin */ EXPORT m64p_error CALL VidExt_Init(void) { @@ -103,6 +105,7 @@ EXPORT m64p_error CALL VidExt_Init(void) return M64ERR_SYSTEM_FAIL; } + vidext_init = 1; return M64ERR_SUCCESS; } @@ -120,7 +123,7 @@ EXPORT m64p_error CALL VidExt_Quit(void) return rval; } - if (!SDL_WasInit(SDL_INIT_VIDEO)) + if (vidext_init == 0) return M64ERR_NOT_INIT; SDL_ShowCursor(SDL_ENABLE); @@ -128,6 +131,7 @@ EXPORT m64p_error CALL VidExt_Quit(void) l_pScreen = NULL; l_VideoOutputActive = 0; StateChanged(M64CORE_VIDEO_MODE, M64VIDEO_NONE); + vidext_init = 0; return M64ERR_SUCCESS; } @@ -186,7 +190,6 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix { const SDL_VideoInfo *videoInfo; int videoFlags = 0; - SDL_SysWMinfo SysInfo; /* call video extension override if necessary */ if (l_VideoExtensionActive) @@ -246,13 +249,6 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix return M64ERR_SYSTEM_FAIL; } - SDL_VERSION(&SysInfo.version); - if (SDL_GetWMInfo(&SysInfo)) - { - // Hide the SDL window - ShowWindow(SysInfo.window,0); - } - SDL_ShowCursor(SDL_DISABLE); l_Fullscreen = (ScreenMode == M64VIDEO_FULLSCREEN); diff --git a/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h b/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h index 7c6ad8b4d7..53da2bf49b 100644 --- a/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h +++ b/libmupen64plus/mupen64plus-core/src/api/vidext_sdl2_compat.h @@ -516,93 +516,6 @@ SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags) return 0; } -static int -SDL_CompatEventFilter(void *userdata, SDL_Event * event) -{ - SDL_Event fake; - - switch (event->type) { - case SDL_WINDOWEVENT: - switch (event->window.event) { - case SDL_WINDOWEVENT_CLOSE: - fake.type = SDL_QUIT; - SDL_PushEvent(&fake); - break; - } - case SDL_KEYDOWN: - case SDL_KEYUP: - { - Uint32 unicode = 0; - if (event->key.type == SDL_KEYDOWN && event->key.keysym.sym < 256) { - unicode = event->key.keysym.sym; - if (unicode >= 'a' && unicode <= 'z') { - int shifted = !!(event->key.keysym.mod & KMOD_SHIFT); - int capslock = !!(event->key.keysym.mod & KMOD_CAPS); - if ((shifted ^ capslock) != 0) { - unicode = SDL_toupper(unicode); - } - } - } - if (unicode) { - event->key.keysym.unicode = unicode; - } - break; - } - case SDL_TEXTINPUT: - { - /* FIXME: Generate an old style key repeat event if needed */ - //printf("TEXTINPUT: '%s'\n", event->text.text); - break; - } - case SDL_MOUSEMOTION: - { - event->motion.x -= SDL_VideoViewport.x; - event->motion.y -= SDL_VideoViewport.y; - break; - } - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - { - event->button.x -= SDL_VideoViewport.x; - event->button.y -= SDL_VideoViewport.y; - break; - } - case SDL_MOUSEWHEEL: - { - Uint8 button; - int x, y; - - if (event->wheel.y == 0) { - break; - } - - SDL_GetMouseState(&x, &y); - - if (event->wheel.y > 0) { - button = SDL_BUTTON_WHEELUP; - } else { - button = SDL_BUTTON_WHEELDOWN; - } - - fake.button.button = button; - fake.button.x = x; - fake.button.y = y; - fake.button.windowID = event->wheel.windowID; - - fake.type = SDL_MOUSEBUTTONDOWN; - fake.button.state = SDL_PRESSED; - SDL_PushEvent(&fake); - - fake.type = SDL_MOUSEBUTTONUP; - fake.button.state = SDL_RELEASED; - SDL_PushEvent(&fake); - break; - } - - } - return 1; -} - static void GetEnvironmentWindowPosition(int w, int h, int *x, int *y) { @@ -636,7 +549,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) Uint32 surface_flags; if (!initialized_video) { - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { + if (SDL_Init(SDL_INIT_VIDEO) < 0) { return NULL; } initialized_video = 1; @@ -681,13 +594,8 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) SDL_DestroyWindow(SDL_VideoWindow); } - /* Set up the event filter */ - if (!SDL_GetEventFilter(NULL, NULL)) { - SDL_SetEventFilter(SDL_CompatEventFilter, NULL); - } - /* Create a new window */ - window_flags = SDL_WINDOW_SHOWN; + window_flags = SDL_WINDOW_HIDDEN; if (flags & SDL_FULLSCREEN) { window_flags |= SDL_WINDOW_FULLSCREEN; } diff --git a/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c b/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c index d6eb725d99..74be08e20b 100644 --- a/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c +++ b/libmupen64plus/mupen64plus-core/src/debugger/dbg_breakpoints.c @@ -19,6 +19,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include + #include #include diff --git a/libmupen64plus/mupen64plus-core/src/main/eventloop.c b/libmupen64plus/mupen64plus-core/src/main/eventloop.c index f562cedb00..07101d275c 100644 --- a/libmupen64plus/mupen64plus-core/src/main/eventloop.c +++ b/libmupen64plus/mupen64plus-core/src/main/eventloop.c @@ -20,6 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include #include #include #if ! SDL_VERSION_ATLEAST(1,3,0) @@ -52,9 +53,6 @@ #define SDL_SCANCODE_9 SDLK_9 #define SDL_SCANCODE_UNKNOWN SDLK_UNKNOWN -#define SDL_SetEventFilter(func, data) SDL_SetEventFilter(func) -#define event_sdl_filter(userdata, event) event_sdl_filter(const event) - #endif #define M64P_CORE_PROTOTYPES 1 @@ -240,84 +238,16 @@ static int MatchJoyCommand(const SDL_Event *event, eJoyCommand cmd) return 0; } -/********************************************************************************************************* -* sdl event filter -*/ -static int SDLCALL event_sdl_filter(void *userdata, SDL_Event *event) -{ - switch(event->type) - { -#if SDL_VERSION_ATLEAST(2,0,0) - case SDL_WINDOWEVENT: - switch (event->window.event) { - case SDL_WINDOWEVENT_RESIZED: - // call the video plugin. if the video plugin supports resizing, it will resize its viewport and call - // VidExt_ResizeWindow to update the window manager handling our opengl output window - gfx.resizeVideoOutput(event->window.data1, event->window.data2); - return 0; // consumed the event - break; - } - break; -#else - case SDL_VIDEORESIZE: - // call the video plugin. if the video plugin supports resizing, it will resize its viewport and call - // VidExt_ResizeWindow to update the window manager handling our opengl output window - gfx.resizeVideoOutput(event->resize.w, event->resize.h); - return 0; // consumed the event - break; -#endif - - // Ignore key events - case SDL_JOYAXISMOTION: - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - case SDL_JOYHATMOTION: - case SDL_KEYDOWN: - case SDL_KEYUP: - - return 0; - break; - } - - return 1; -} - /********************************************************************************************************* * global functions */ void event_initialize(void) { - const char *event_str = NULL; int i; - /* set initial state of all joystick commands to 'off' */ for (i = 0; i < NumJoyCommands; i++) JoyCmdActive[i] = 0; - - /* activate any joysticks which are referenced in the joystick event command strings */ - for (i = 0; i < NumJoyCommands; i++) - { - event_str = ConfigGetParamString(l_CoreEventsConfig, JoyCmdName[i]); - if (event_str != NULL && strlen(event_str) >= 4 && event_str[0] == 'J' && event_str[1] >= '0' && event_str[1] <= '9') - { - int device = event_str[1] - '0'; - if (!SDL_WasInit(SDL_INIT_JOYSTICK)) - SDL_InitSubSystem(SDL_INIT_JOYSTICK); -#if SDL_VERSION_ATLEAST(2,0,0) - SDL_JoystickOpen(device); -#else - if (!SDL_JoystickOpened(device)) - SDL_JoystickOpen(device); -#endif - } - } - - /* set up SDL event filter and disable key repeat */ -#if !SDL_VERSION_ATLEAST(2,0,0) - SDL_EnableKeyRepeat(0, 0); -#endif - SDL_SetEventFilter(event_sdl_filter, NULL); } int event_set_core_defaults(void) diff --git a/libmupen64plus/mupen64plus-core/src/main/main.c b/libmupen64plus/mupen64plus-core/src/main/main.c index da87c34bc5..bda4aa1308 100644 --- a/libmupen64plus/mupen64plus-core/src/main/main.c +++ b/libmupen64plus/mupen64plus-core/src/main/main.c @@ -28,6 +28,7 @@ * if you want to implement an interface, you should look here */ +#include #include #include @@ -842,7 +843,7 @@ void main_stop(void) if (!g_EmulatorRunning) return; - DebugMessage(M64MSG_STATUS, "Stopping emulation."); + //DebugMessage(M64MSG_STATUS, "Stopping emulation."); if(l_msgPause) { osd_delete_message(l_msgPause); diff --git a/libmupen64plus/mupen64plus-core/src/osal/preproc.h b/libmupen64plus/mupen64plus-core/src/osal/preproc.h index 46415ae2e1..75fb528e5d 100644 --- a/libmupen64plus/mupen64plus-core/src/osal/preproc.h +++ b/libmupen64plus/mupen64plus-core/src/osal/preproc.h @@ -37,8 +37,8 @@ #define strdup _strdup // for isnan() - #include - #define isnan _isnan + //#include + //#define isnan _isnan #else /* Not WIN32 */ diff --git a/libmupen64plus/mupen64plus-core/src/r4300/fpu.h b/libmupen64plus/mupen64plus-core/src/r4300/fpu.h index 8f4ddce8fd..a050ee5e9a 100644 --- a/libmupen64plus/mupen64plus-core/src/r4300/fpu.h +++ b/libmupen64plus/mupen64plus-core/src/r4300/fpu.h @@ -25,20 +25,21 @@ #ifdef _MSC_VER #define M64P_FPU_INLINE static __inline - #include - typedef enum { FE_TONEAREST = 0, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD } eRoundType; - static void fesetround(eRoundType RoundType) - { - static const unsigned int msRound[4] = { _RC_NEAR, _RC_CHOP, _RC_UP, _RC_DOWN }; - unsigned int oldX87, oldSSE2; + #include + //#include + //typedef enum { FE_TONEAREST = 0, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD } eRoundType; + //static void fesetround(eRoundType RoundType) + //{ + //static const unsigned int msRound[4] = { _RC_NEAR, _RC_CHOP, _RC_UP, _RC_DOWN }; + //unsigned int oldX87, oldSSE2; //__control87_2(msRound[RoundType], _MCW_RC, &oldX87, &oldSSE2); //? ? ? ? - _control87(msRound[RoundType], _MCW_RC); - } - static __inline double round(double x) { return floor(x + 0.5); } - static __inline float roundf(float x) { return (float) floor(x + 0.5); } - static __inline double trunc(double x) { return (double) (int) x; } - static __inline float truncf(float x) { return (float) (int) x; } - #define isnan _isnan + //_control87(msRound[RoundType], _MCW_RC); + //} + //static __inline double round(double x) { return floor(x + 0.5); } + //static __inline float roundf(float x) { return (float) floor(x + 0.5); } + //static __inline double trunc(double x) { return (double) (int) x; } + //static __inline float truncf(float x) { return (float) (int) x; } + //#define isnan _isnan #else #define M64P_FPU_INLINE static inline #include diff --git a/libmupen64plus/mupen64plus-input-bkm/mupen64plus-input-bkm/mupen64plus-input-bkm.vcxproj b/libmupen64plus/mupen64plus-input-bkm/mupen64plus-input-bkm/mupen64plus-input-bkm.vcxproj index deb25ec98c..0ed22d8cb4 100644 --- a/libmupen64plus/mupen64plus-input-bkm/mupen64plus-input-bkm/mupen64plus-input-bkm.vcxproj +++ b/libmupen64plus/mupen64plus-input-bkm/mupen64plus-input-bkm/mupen64plus-input-bkm.vcxproj @@ -1,18 +1,10 @@  - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -24,83 +16,38 @@ 10.0 - - DynamicLibrary - true - v142 - MultiByte - DynamicLibrary true - v142 - MultiByte - - - DynamicLibrary - false - v142 - true + v143 MultiByte DynamicLibrary false - v142 + v143 true MultiByte - - - - - - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - true - false - $(SolutionDir)..\..\..\..\Assets\dll\ - true - - - $(SolutionDir)..\..\..\..\Assets\dll\ + $(SolutionDir)..\..\..\Assets\dll\ true - $(SolutionDir)..\..\..\..\Assets\dll\ + $(SolutionDir)..\..\..\Assets\dll\ true - - - Level3 - Disabled - true - false - ..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - true - - - - - - Level3 @@ -118,30 +65,6 @@ - - - Level3 - MaxSpeed - - - false - ..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - true - - - true - true - true - %(AdditionalDependencies) - Windows - - - - - - Level3 diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/VisualStudio2013/mupen64plus-rsp-hle.vcxproj b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc/mupen64plus-rsp-hle.vcxproj similarity index 56% rename from libmupen64plus/mupen64plus-rsp-hle/projects/VisualStudio2013/mupen64plus-rsp-hle.vcxproj rename to libmupen64plus/mupen64plus-rsp-hle/projects/msvc/mupen64plus-rsp-hle.vcxproj index e91f059405..a62a6c229c 100644 --- a/libmupen64plus/mupen64plus-rsp-hle/projects/VisualStudio2013/mupen64plus-rsp-hle.vcxproj +++ b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc/mupen64plus-rsp-hle.vcxproj @@ -1,18 +1,10 @@  - + - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -24,40 +16,23 @@ Win32Proj - - DynamicLibrary - MultiByte - true - v120_xp - DynamicLibrary MultiByte true - v142 - - - DynamicLibrary - MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 - - - - - - @@ -65,51 +40,24 @@ <_ProjectFileVersion>10.0.40219.1 $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - true + $(Configuration)\ true $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - false + $(Configuration)\ false - AllRules.ruleset AllRules.ruleset - - - AllRules.ruleset AllRules.ruleset - - - - - Disabled - ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Default - - - true - Windows - MachineX86 - - Disabled ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) + false EnableFastChecks MultiThreadedDebugDLL @@ -117,30 +65,16 @@ Level3 ProgramDatabase Default + true true Windows - - - - ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - Default - - - true - Windows - true - true - MachineX86 - + + + + @@ -152,6 +86,7 @@ Level3 ProgramDatabase Default + true true @@ -159,6 +94,10 @@ true true + + + + diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/msvc11/mupen64plus-rsp-hle.vcxproj b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc11/mupen64plus-rsp-hle.vcxproj deleted file mode 100644 index 3f6b3f25b6..0000000000 --- a/libmupen64plus/mupen64plus-rsp-hle/projects/msvc11/mupen64plus-rsp-hle.vcxproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A} - mupen64plusrsphle - Win32Proj - - - - DynamicLibrary - MultiByte - true - v100 - - - DynamicLibrary - MultiByte - true - v100 - - - DynamicLibrary - MultiByte - v100 - - - DynamicLibrary - MultiByte - v100 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - $(Configuration)\ - true - true - $(SolutionDir)..\..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - $(Configuration)\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Default - true - - - true - Windows - MachineX86 - - - - - - - - - Disabled - ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - Default - true - - - true - Windows - - - - - - - - - ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - Default - true - - - true - Windows - true - true - MachineX86 - - - - - - - - - ..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - Default - true - - - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/msvc8/mupen64plus-rsp-hle.vcproj b/libmupen64plus/mupen64plus-rsp-hle/projects/msvc8/mupen64plus-rsp-hle.vcproj deleted file mode 100644 index 6ee59896c7..0000000000 --- a/libmupen64plus/mupen64plus-rsp-hle/projects/msvc8/mupen64plus-rsp-hle.vcproj +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libmupen64plus/mupen64plus-rsp-hle/projects/unix/Makefile b/libmupen64plus/mupen64plus-rsp-hle/projects/unix/Makefile deleted file mode 100644 index f9162a2bde..0000000000 --- a/libmupen64plus/mupen64plus-rsp-hle/projects/unix/Makefile +++ /dev/null @@ -1,320 +0,0 @@ -#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -# * mupen64plus-rsp-hle - Makefile * -# * Mupen64Plus homepage: https://mupen64plus.org/ * -# * Copyright (C) 2008-2009 Richard Goedeken * -# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation; either version 2 of the License, or * -# * (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program; if not, write to the * -# * Free Software Foundation, Inc., * -# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -# Makefile for Mupen64 HLE RSP plugin in Mupen64plus. - -# detect operating system -UNAME ?= $(shell uname -s) -OS := NONE -ifeq ("$(UNAME)","Linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifneq ("$(filter GNU hurd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","Darwin") - OS = OSX - SO_EXTENSION = dylib - SHARED = -bundle -endif -ifeq ("$(UNAME)","FreeBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","OpenBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared -endif -ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") - OS = MINGW - SO_EXTENSION = dll - SHARED = -shared - PIC = 0 -endif -ifeq ("$(OS)","NONE") - $(error OS type "$(UNAME)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues') -endif - -# detect system architecture -HOST_CPU ?= $(shell uname -m) -NO_ASM ?= 1 -CPU := NONE -ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") - CPU := X86 - ifeq ("$(BITS)", "32") - ARCH_DETECTED := 64BITS_32 - PIC ?= 0 - else - ARCH_DETECTED := 64BITS - PIC ?= 1 - endif -endif -ifneq ("$(filter pentium i%86,$(HOST_CPU))","") - CPU := X86 - ARCH_DETECTED := 32BITS - PIC ?= 0 -endif -ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 32BITS - BIG_ENDIAN := 1 - PIC ?= 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 64BITS - BIG_ENDIAN := 1 - PIC ?= 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter arm%,$(HOST_CPU))","") - ifeq ("$(filter arm%b,$(HOST_CPU))","") - CPU := ARM - ARCH_DETECTED := 32BITS - PIC ?= 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') - endif -endif -ifneq ("$(filter mips,$(HOST_CPU))","") - CPU := MIPS - ARCH_DETECTED := 32BITS - PIC ?= 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifeq ("$(CPU)","NONE") - $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues') -endif - -# base CFLAGS, LDLIBS, and LDFLAGS -OPTFLAGS ?= -O3 -flto -WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -LDFLAGS += $(SHARED) - -# Since we are building a shared library, we must compile with -fPIC on some architectures -# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch -ifeq ($(PIC), 1) - CFLAGS += -fPIC -else - CFLAGS += -fno-PIC -endif - -ifeq ($(BIG_ENDIAN), 1) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# tweak flags for 32-bit build on 64-bit system -ifeq ($(ARCH_DETECTED), 64BITS_32) - ifeq ($(OS), FREEBSD) - $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) - endif - CFLAGS += -m32 - LDFLAGS += -Wl,-m,elf_i386 -endif - -# set special flags per-system -ifeq ($(OS), LINUX) - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/rsp_api_export.ver - LDLIBS += -ldl -endif -ifeq ($(OS), OSX) - OSX_SDK_PATH = $(shell xcrun --sdk macosx --show-sdk-path) - - ifeq ($(CPU), X86) - ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) - else - CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) - LDFLAGS += -read_only_relocs suppress - endif - endif -endif - -# set mupen64plus core API header path -ifneq ("$(APIDIR)","") - CFLAGS += "-I$(APIDIR)" -else - TRYDIR = ../../../mupen64plus-core/src/api - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/local/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) - endif - endif - endif -endif - -# reduced compile output when running make without V=1 -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - Q_CC = @echo ' CC '$@; - Q_LD = @echo ' LD '$@; -endif -endif - -# set base program pointers and flags -CC = $(CROSS_COMPILE)gcc -RM ?= rm -f -INSTALL ?= install -MKDIR ?= mkdir -p -COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -# set special flags for given Makefile parameters -ifeq ($(DEBUG),1) - CFLAGS += -g - INSTALL_STRIP_FLAG ?= -else - CFLAGS += -DNDEBUG - ifneq ($(OS),OSX) - INSTALL_STRIP_FLAG ?= -s - endif -endif - -# set installation options -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif -ifeq ($(LIBDIR),) - LIBDIR := $(PREFIX)/lib -endif -ifeq ($(PLUGINDIR),) - PLUGINDIR := $(LIBDIR)/mupen64plus -endif - -# enable/disable task dumping support -ifeq ($(DUMP), 1) - CFLAGS += -DENABLE_TASK_DUMP -endif - - -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - -# list of source files to compile -SOURCE = \ - $(SRCDIR)/alist.c \ - $(SRCDIR)/alist_audio.c \ - $(SRCDIR)/alist_naudio.c \ - $(SRCDIR)/alist_nead.c \ - $(SRCDIR)/audio.c \ - $(SRCDIR)/cicx105.c \ - $(SRCDIR)/hle.c \ - $(SRCDIR)/jpeg.c \ - $(SRCDIR)/memory.c \ - $(SRCDIR)/mp3.c \ - $(SRCDIR)/musyx.c \ - $(SRCDIR)/re2.c \ - $(SRCDIR)/plugin.c - -ifeq ($(OS), MINGW) -SOURCE += \ - $(SRCDIR)/osal_dynamiclib_win32.c -else -SOURCE += \ - $(SRCDIR)/osal_dynamiclib_unix.c -endif - -# generate a list of object files build, make a temporary directory for them -OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) -OBJDIRS = $(dir $(OBJECTS)) -$(shell $(MKDIR) $(OBJDIRS)) - -# build targets -TARGET = mupen64plus-rsp-hle$(POSTFIX).$(SO_EXTENSION) - -targets: - @echo "Mupen64Plus-rsp-hle makefile. " - @echo " Targets:" - @echo " all == Build Mupen64Plus rsp-hle plugin" - @echo " clean == remove object files" - @echo " rebuild == clean and re-build all" - @echo " install == Install Mupen64Plus rsp-hle plugin" - @echo " uninstall == Uninstall Mupen64Plus rsp-hle plugin" - @echo " Options:" - @echo " BITS=32 == build 32-bit binaries on 64-bit machine" - @echo " APIDIR=path == path to find Mupen64Plus Core headers" - @echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)" - @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" - @echo " PIC=(1|0) == Force enable/disable of position independent code" - @echo " POSTFIX=name == String added to the name of the the build (default: '')" - @echo " DUMP=(1|0) == Enable/Disable unknown task dumping (default: 0)" - @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" - @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" - @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" - @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" - @echo " Debugging Options:" - @echo " DEBUG=1 == add debugging symbols" - @echo " V=1 == show verbose compiler output" - -all: $(TARGET) - -install: $(TARGET) - $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" - -uninstall: - $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" - -clean: - $(RM) -r $(OBJDIR) $(TARGET) - -rebuild: clean all - -# build dependency files -CFLAGS += -MD -MP --include $(OBJECTS:.o=.d) - -# standard build rules -$(OBJDIR)/%.o: $(SRCDIR)/%.c - $(COMPILE.c) -o $@ $< - -$(TARGET): $(OBJECTS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-sln/LICENSES b/libmupen64plus/mupen64plus-sln/LICENSES deleted file mode 100644 index 346a1815db..0000000000 --- a/libmupen64plus/mupen64plus-sln/LICENSES +++ /dev/null @@ -1,358 +0,0 @@ -Mupen64Plus-ui-console LICENSE ------------------------------- - -Mupen64Plus-ui-console is licensed under the GNU General Public License version 2. - -The authors of Mupen64Plus-ui-console are: - * Richard Goedeken (Richard42) - -Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by: - * Hacktarux - * Dave2001 - * Zilmar - * Gregor Anich (Blight) - * Juha Luotio (JttL) - * and others. - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - diff --git a/libmupen64plus/mupen64plus-sln/projects/msvc11/mupen64plus.sln b/libmupen64plus/mupen64plus-sln/projects/msvc11/mupen64plus.sln deleted file mode 100644 index f635a91b31..0000000000 --- a/libmupen64plus/mupen64plus-sln/projects/msvc11/mupen64plus.sln +++ /dev/null @@ -1,78 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30413.136 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-core", "..\..\..\mupen64plus-core\projects\msvc11\mupen64plus-core.vcxproj", "{92D3FEB9-2129-41C5-8577-BCD7D961EF41}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-rice", "..\..\..\mupen64plus-video-rice\projects\msvc11\mupen64plus-video-rice.vcxproj", "{7D4AFF6A-B7D9-4C25-975A-038B8079098E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64mk2", "..\..\..\mupen64plus-video-glide64mk2\projects\msvc11\mupen64plus-video-glide64mk2.vcxproj", "{A4D13408-A794-4199-8FC7-4A9A32505005}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-audio-bkm", "..\..\..\mupen64plus-audio-bkm\mupen64plus-audio-bkm\mupen64plus-audio-bkm.vcxproj", "{B6F20769-1385-4C0F-91A9-26F47AD1E78F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-input-bkm", "..\..\..\mupen64plus-input-bkm\mupen64plus-input-bkm\mupen64plus-input-bkm.vcxproj", "{3D8BD211-6002-4698-B5C1-A0F3146B6ACF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-z64", "..\..\..\mupen64plus-video-z64\projects\msvc11\mupen64plus-video-z64.vcxproj", "{7708C1D2-3303-4F90-BCE8-3BCE4046BFD7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-jabo", "..\..\..\mupen64plus-video-jabo\mupen64plus-video-jabo\mupen64plus-video-jabo.vcxproj", "{0C220B26-3D4D-431D-B829-CADE6508A771}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64", "..\..\..\mupen64plus-video-glide64\projects\msvc10\mupen64plus-video-glide64.vcxproj", "{F3E6138A-C318-4020-B408-A9A24D8B3DE7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D8Interceptor", "..\..\..\D3D8Interceptor\D3D8Interceptor\D3D8Interceptor.vcxproj", "{4CC85A3A-8E85-45DB-8941-2E2E18FC9A53}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-rsp-hle", "..\..\..\mupen64plus-rsp-hle\projects\VisualStudio2013\mupen64plus-rsp-hle.vcxproj", "{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|x64.ActiveCfg = Debug|x64 - {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|x64.Build.0 = Debug|x64 - {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|x64.ActiveCfg = Release|x64 - {92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|x64.Build.0 = Release|x64 - {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|x64.ActiveCfg = Debug|x64 - {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|x64.Build.0 = Debug|x64 - {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|x64.ActiveCfg = Release|x64 - {7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|x64.Build.0 = Release|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|x64.ActiveCfg = Debug|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|x64.Build.0 = Debug|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|x64.ActiveCfg = Release|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|x64.Build.0 = Release|x64 - {B6F20769-1385-4C0F-91A9-26F47AD1E78F}.Debug|x64.ActiveCfg = Debug|x64 - {B6F20769-1385-4C0F-91A9-26F47AD1E78F}.Debug|x64.Build.0 = Debug|x64 - {B6F20769-1385-4C0F-91A9-26F47AD1E78F}.Release|x64.ActiveCfg = Release|x64 - {B6F20769-1385-4C0F-91A9-26F47AD1E78F}.Release|x64.Build.0 = Release|x64 - {3D8BD211-6002-4698-B5C1-A0F3146B6ACF}.Debug|x64.ActiveCfg = Debug|x64 - {3D8BD211-6002-4698-B5C1-A0F3146B6ACF}.Debug|x64.Build.0 = Debug|x64 - {3D8BD211-6002-4698-B5C1-A0F3146B6ACF}.Release|x64.ActiveCfg = Release|x64 - {3D8BD211-6002-4698-B5C1-A0F3146B6ACF}.Release|x64.Build.0 = Release|x64 - {7708C1D2-3303-4F90-BCE8-3BCE4046BFD7}.Debug|x64.ActiveCfg = Debug|x64 - {7708C1D2-3303-4F90-BCE8-3BCE4046BFD7}.Debug|x64.Build.0 = Debug|x64 - {7708C1D2-3303-4F90-BCE8-3BCE4046BFD7}.Release|x64.ActiveCfg = Release|x64 - {7708C1D2-3303-4F90-BCE8-3BCE4046BFD7}.Release|x64.Build.0 = Release|x64 - {0C220B26-3D4D-431D-B829-CADE6508A771}.Debug|x64.ActiveCfg = Debug|x64 - {0C220B26-3D4D-431D-B829-CADE6508A771}.Debug|x64.Build.0 = Debug|x64 - {0C220B26-3D4D-431D-B829-CADE6508A771}.Release|x64.ActiveCfg = Release|x64 - {0C220B26-3D4D-431D-B829-CADE6508A771}.Release|x64.Build.0 = Release|x64 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Debug|x64.ActiveCfg = Debug|x64 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Debug|x64.Build.0 = Debug|x64 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Release|x64.ActiveCfg = Release|x64 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Release|x64.Build.0 = Release|x64 - {4CC85A3A-8E85-45DB-8941-2E2E18FC9A53}.Debug|x64.ActiveCfg = Debug|Win32 - {4CC85A3A-8E85-45DB-8941-2E2E18FC9A53}.Debug|x64.Build.0 = Debug|Win32 - {4CC85A3A-8E85-45DB-8941-2E2E18FC9A53}.Release|x64.ActiveCfg = Release|x64 - {4CC85A3A-8E85-45DB-8941-2E2E18FC9A53}.Release|x64.Build.0 = Release|x64 - {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|x64.ActiveCfg = Debug|x64 - {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|x64.Build.0 = Debug|x64 - {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|x64.ActiveCfg = Release|x64 - {2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {03A2A321-BAEF-449F-AAF6-82110842EDB9} - EndGlobalSection -EndGlobal diff --git a/libmupen64plus/mupen64plus-video-glide64/projects/msvc10/mupen64plus-video-glide64.vcxproj b/libmupen64plus/mupen64plus-video-glide64/projects/msvc/mupen64plus-video-glide64.vcxproj similarity index 54% rename from libmupen64plus/mupen64plus-video-glide64/projects/msvc10/mupen64plus-video-glide64.vcxproj rename to libmupen64plus/mupen64plus-video-glide64/projects/msvc/mupen64plus-video-glide64.vcxproj index 86295a7851..c2277dacf7 100644 --- a/libmupen64plus/mupen64plus-video-glide64/projects/msvc10/mupen64plus-video-glide64.vcxproj +++ b/libmupen64plus/mupen64plus-video-glide64/projects/msvc/mupen64plus-video-glide64.vcxproj @@ -1,18 +1,10 @@  - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -23,83 +15,38 @@ mupen64plusvideoglide64 - - DynamicLibrary - MultiByte - true - v142 - DynamicLibrary MultiByte true - v142 - - - DynamicLibrary - MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\..\Assets\dll\ $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ $(Configuration)\ - $(SolutionDir)..\..\..\..\Assets\dll\ $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ $(Configuration)\ - - - Disabled - ../../src;../../src/wrapper;../../../mupen64plus-core/src/api;../../../mupen64plus-win32-deps/SDL-1.2.15/include;%(AdditionalIncludeDirectories) - _WIN32_WINNT=0x0400;NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - Level3 - EditAndContinue - Cdecl - true - - - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;%(AdditionalDependencies) - true - Windows - MachineX86 - - - - - - Disabled - ../../src;../../src/wrapper;../../../mupen64plus-core/src/api;../../../mupen64plus-win32-deps/SDL-1.2.15/include;%(AdditionalIncludeDirectories) + ../../src;../../src/wrapper;../../../mupen64plus-core/src/api;../../../mupen64plus-win32-deps/SDL2-2.26.3/include;%(AdditionalIncludeDirectories) NO_ASM;_WIN32_WINNT=0x0400;NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false EnableFastChecks @@ -110,7 +57,7 @@ true - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;%(AdditionalDependencies) + opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;%(AdditionalDependencies) true Windows @@ -119,35 +66,11 @@ - - - MaxSpeed - true - ../../src;../../src/wrapper;../../../mupen64plus-core/src/api;../../../mupen64plus-win32-deps/SDL-1.2.15/include;%(AdditionalIncludeDirectories) - NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - Level3 - ProgramDatabase - - - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;%(AdditionalDependencies) - true - Windows - true - true - MachineX86 - - - - - - MaxSpeed true - ../../src;../../src/wrapper;../../../mupen64plus-core/src/api;../../../mupen64plus-win32-deps/SDL-1.2.15/include;%(AdditionalIncludeDirectories) + ../../src;../../src/wrapper;../../../mupen64plus-core/src/api;../../../mupen64plus-win32-deps/SDL2-2.26.3/include;%(AdditionalIncludeDirectories) NO_ASM;NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL true @@ -155,7 +78,7 @@ ProgramDatabase - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;%(AdditionalDependencies) + opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;%(AdditionalDependencies) true Windows true @@ -181,57 +104,39 @@ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ - $(IntDir)wrapper\ $(IntDir)wrapper\ diff --git a/libmupen64plus/mupen64plus-video-glide64/projects/msvc10/mupen64plus-video-glide64.sln b/libmupen64plus/mupen64plus-video-glide64/projects/msvc10/mupen64plus-video-glide64.sln deleted file mode 100644 index 66dffa7505..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64/projects/msvc10/mupen64plus-video-glide64.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64", "mupen64plus-video-glide64.vcxproj", "{F3E6138A-C318-4020-B408-A9A24D8B3DE7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Debug|Win32.ActiveCfg = Debug|Win32 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Debug|Win32.Build.0 = Debug|Win32 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Release|Win32.ActiveCfg = Release|Win32 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libmupen64plus/mupen64plus-video-glide64/projects/msvc9/mupen64plus-video-glide64.sln b/libmupen64plus/mupen64plus-video-glide64/projects/msvc9/mupen64plus-video-glide64.sln deleted file mode 100644 index 67e577b050..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64/projects/msvc9/mupen64plus-video-glide64.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64", "mupen64plus-video-glide64.vcproj", "{F3E6138A-C318-4020-B408-A9A24D8B3DE7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Debug|Win32.ActiveCfg = Debug|Win32 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Debug|Win32.Build.0 = Debug|Win32 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Release|Win32.ActiveCfg = Release|Win32 - {F3E6138A-C318-4020-B408-A9A24D8B3DE7}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libmupen64plus/mupen64plus-video-glide64/projects/msvc9/mupen64plus-video-glide64.vcproj b/libmupen64plus/mupen64plus-video-glide64/projects/msvc9/mupen64plus-video-glide64.vcproj deleted file mode 100644 index 0eac54f238..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64/projects/msvc9/mupen64plus-video-glide64.vcproj +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libmupen64plus/mupen64plus-video-glide64/projects/unix/Makefile b/libmupen64plus/mupen64plus-video-glide64/projects/unix/Makefile deleted file mode 100644 index 2780c1b65f..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64/projects/unix/Makefile +++ /dev/null @@ -1,400 +0,0 @@ -#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -# * Mupen64plus-video-glide64 - Makefile * -# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * -# * Copyright (C) 2010 Jon Ring * -# * Copyright (C) 2007-2009 Richard Goedeken * -# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation; either version 2 of the License, or * -# * (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program; if not, write to the * -# * Free Software Foundation, Inc., * -# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -# Makefile for Glide64 plugin in Mupen64Plus - -# detect operating system -UNAME ?= $(shell uname -s) -OS := NONE -ifeq ("$(UNAME)","Linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifneq ("$(filter GNU hurd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","Darwin") - OS = OSX - SO_EXTENSION = dylib - SHARED = -bundle -endif -ifeq ("$(UNAME)","FreeBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","OpenBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared - $(warning OS type "$(UNAME)" not officially supported.') -endif -ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") - OS = MINGW - SO_EXTENSION = dll - SHARED = -shared - PIC = 0 -endif -ifeq ("$(OS)","NONE") - $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# detect system architecture -HOST_CPU ?= $(shell uname -m) -CPU := NONE -ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") - CPU := X86 - ifeq ("$(BITS)", "32") - ARCH_DETECTED := 64BITS_32 - PIC ?= 0 - else - ARCH_DETECTED := 64BITS - PIC ?= 1 - endif -endif -ifneq ("$(filter pentium i%86,$(HOST_CPU))","") - CPU := X86 - ARCH_DETECTED := 32BITS - PIC ?= 0 -endif -ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 32BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 64BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter arm%,$(HOST_CPU))","") - ifeq ("$(filter arm%b,$(HOST_CPU))","") - CPU := ARM - ARCH_DETECTED := 32BITS - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') - endif -endif -ifeq ("$(CPU)","NONE") - $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# base CFLAGS, LDLIBS, and LDFLAGS -OPTFLAGS ?= -O3 -flto -WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -I../../src/wrapper -DGCC -CXXFLAGS += -fvisibility-inlines-hidden -LDFLAGS += $(SHARED) - -ifeq ($(CPU), X86) - CFLAGS += -msse -endif - -# Since we are building a shared library, we must compile with -fPIC on some architectures -# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch -ifeq ($(PIC), 1) - CFLAGS += -fPIC -else - CFLAGS += -fno-PIC -endif - -ifeq ($(BIG_ENDIAN), 1) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# tweak flags for 32-bit build on 64-bit system -ifeq ($(ARCH_DETECTED), 64BITS_32) - ifeq ($(OS), FREEBSD) - $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) - endif - CFLAGS += -m32 - LDFLAGS += -Wl,-m,elf_i386 -endif - -# set special flags per-system -ifeq ($(OS), LINUX) - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver - LDLIBS += -ldl -endif -ifeq ($(OS), OSX) - # Select the proper SDK - # Also, SDKs are stored in a different location since XCode 4.3 - OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) - OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) - OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) - OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") - ifeq ($(OSX_XCODEGE43), 11) - OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs - else - OSX_SYSROOT := /Developer/SDKs - endif - - ifeq ($(CPU), X86) - ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk - LDFLAGS += -bundle - LDLIBS += -ldl - else - CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk - LDFLAGS += -bundle - LDLIBS += -ldl - endif - endif -endif -ifeq ($(OS), FREEBSD) - LDLIBS += -lc -endif - -# search for OpenGL libraries -ifeq ($(OS), OSX) - GL_LDLIBS = -framework OpenGL -endif -ifeq ($(OS), MINGW) - GL_LDLIBS = -lopengl32 -endif -ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined) - ifeq ($(origin PKG_CONFIG), undefined) - PKG_CONFIG = $(CROSS_COMPILE)pkg-config - ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) - $(error $(PKG_CONFIG) not found) - endif - endif - - ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) - $(error No OpenGL development libraries found!) - endif - GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) - GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl) -endif -CFLAGS += $(GL_CFLAGS) -LDLIBS += $(GL_LDLIBS) - -# test for presence of SDL -ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) - SDL_CONFIG = $(CROSS_COMPILE)sdl-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - $(error No SDL development libraries found!) - endif - ifeq ($(OS),OSX) - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - # sdl-config on mac screws up when we're trying to build a library and not an executable - # SDL 1.3 is supposed to fix that, if it's ever released - SDL_LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa - else - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs) - endif -endif -CFLAGS += $(SDL_CFLAGS) -LDLIBS += $(SDL_LDLIBS) - -# set mupen64plus core API header path -ifneq ("$(APIDIR)","") - CFLAGS += "-I$(APIDIR)" -else - TRYDIR = ../../../mupen64plus-core/src/api - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/local/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) - endif - endif - endif -endif - -# reduced compile output when running make without V=1 -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - Q_CC = @echo ' CC '$@; - Q_CXX = @echo ' CXX '$@; - Q_LD = @echo ' LD '$@; -endif -endif - -# set base program pointers and flags -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -RM ?= rm -f -INSTALL ?= install -MKDIR ?= mkdir -p -COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -# set special flags for given Makefile parameters -ifeq ($(DEBUG),1) - CFLAGS += -g - INSTALL_STRIP_FLAG ?= -else - INSTALL_STRIP_FLAG ?= -s -endif -ifeq ($(NO_ASM), 1) - CFLAGS += -DNO_ASM -endif - -# set installation options -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif -ifeq ($(SHAREDIR),) - SHAREDIR := $(PREFIX)/share/mupen64plus -endif -ifeq ($(LIBDIR),) - LIBDIR := $(PREFIX)/lib -endif -ifeq ($(PLUGINDIR),) - PLUGINDIR := $(LIBDIR)/mupen64plus -endif - -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - -# list of source files to compile -SOURCE = \ - $(SRCDIR)/3dmath.cpp \ - $(SRCDIR)/CRC.cpp \ - $(SRCDIR)/Combine.cpp \ - $(SRCDIR)/Config.cpp \ - $(SRCDIR)/Debugger.cpp \ - $(SRCDIR)/DepthBufferRender.cpp \ - $(SRCDIR)/Ini.cpp \ - $(SRCDIR)/Main.cpp \ - $(SRCDIR)/TexBuffer.cpp \ - $(SRCDIR)/TexCache.cpp \ - $(SRCDIR)/Util.cpp \ - $(SRCDIR)/rdp.cpp \ - $(SRCDIR)/wrapper/2xsai.cpp \ - $(SRCDIR)/wrapper/combiner.cpp \ - $(SRCDIR)/wrapper/config.cpp \ - $(SRCDIR)/wrapper/filter.cpp \ - $(SRCDIR)/wrapper/geometry.cpp \ - $(SRCDIR)/wrapper/hq2x.cpp \ - $(SRCDIR)/wrapper/hq4x.cpp \ - $(SRCDIR)/wrapper/main.cpp \ - $(SRCDIR)/wrapper/textures.cpp - -ifeq ($(OS),MINGW) -SOURCE += $(SRCDIR)/osal_dynamiclib_win32.c -else -SOURCE += $(SRCDIR)/osal_dynamiclib_unix.c -endif - - - -# generate a list of object files build, make a temporary directory for them -OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) -OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) -OBJDIRS = $(dir $(OBJECTS)) -$(shell $(MKDIR) $(OBJDIRS)) - -# build targets -TARGET = mupen64plus-video-glide64$(POSTFIX).$(SO_EXTENSION) - -targets: - @echo "Mupen64plus-video-glide64 N64 Graphics plugin makefile. " - @echo " Targets:" - @echo " all == Build Mupen64plus-video-glide64 plugin" - @echo " clean == remove object files" - @echo " rebuild == clean and re-build all" - @echo " install == Install Mupen64Plus-video-glide64 plugin" - @echo " uninstall == Uninstall Mupen64Plus-video-glide64 plugin" - @echo " Options:" - @echo " BITS=32 == build 32-bit binaries on 64-bit machine" - @echo " NO_ASM=1 == build without inline assembly code (x86 MMX/SSE)" - @echo " APIDIR=path == path to find Mupen64Plus Core headers" - @echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)" - @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" - @echo " PIC=(1|0) == Force enable/disable of position independent code" - @echo " POSTFIX=name == String added to the name of the the build (default: '')" - @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" - @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" - @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" - @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" - @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" - @echo " Debugging Options:" - @echo " DEBUG=1 == add debugging symbols" - @echo " V=1 == show verbose compiler output" - -all: $(TARGET) - -install: $(TARGET) - $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" - $(INSTALL) -m 0644 "../../data/Glide64.ini" "$(DESTDIR)$(SHAREDIR)" - -uninstall: - $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" - $(RM) "$(DESTDIR)$(SHAREDIR)/Glide64.ini" - -clean: - $(RM) -r $(OBJDIR) $(TARGET) - -rebuild: clean all - -# build dependency files -CFLAGS += -MD --include $(OBJECTS:.o=.d) - -CXXFLAGS += $(CFLAGS) - -# standard build rules -$(OBJDIR)/%.o: $(SRCDIR)/%.c - $(COMPILE.c) -o $@ $< - -$(OBJDIR)/%.o: $(SRCDIR)/%.cpp - $(COMPILE.cc) -o $@ $< - -$(TARGET): $(OBJECTS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-video-glide64/src/wrapper/main.h b/libmupen64plus/mupen64plus-video-glide64/src/wrapper/main.h index a5333f2716..06c22bdd0e 100644 --- a/libmupen64plus/mupen64plus-video-glide64/src/wrapper/main.h +++ b/libmupen64plus/mupen64plus-video-glide64/src/wrapper/main.h @@ -26,6 +26,7 @@ #ifdef WIN32 #include + #define glActiveTextureARB _glActiveTextureARB extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB; extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT; @@ -46,6 +47,7 @@ extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB; + #define glMultiTexCoord2fARB _glMultiTexCoord2fARB extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB; extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT; extern PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f; diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc/mupen64plus-video-glide64mk2.vcxproj b/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc/mupen64plus-video-glide64mk2.vcxproj new file mode 100644 index 0000000000..29c98b562e --- /dev/null +++ b/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc/mupen64plus-video-glide64mk2.vcxproj @@ -0,0 +1,208 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {A4D13408-A794-4199-8FC7-4A9A32505005} + n64Glide + mupen64plus-video-glide64mk2 + + + + DynamicLibrary + false + MultiByte + true + v143 + + + DynamicLibrary + false + MultiByte + v143 + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)..\..\..\..\Assets\dll\ + $(Configuration)\ + true + $(SolutionDir)..\..\..\..\Assets\dll\ + $(Configuration)\ + false + true + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/n64Glide.tlb + + + + + Disabled + ..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\boost-1.81.0\;..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;%(AdditionalIncludeDirectories) + NO_ASM;_GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;%(PreprocessorDefinitions) + Async + EnableFastChecks + MultiThreadedDebugDLL + .\Debug/n64Glide.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + ProgramDatabase + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x64\zlib.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + ..\..\..\mupen64plus-win32-deps\boost-1.81.0\lib64-msvc;%(AdditionalLibraryDirectories) + false + true + .\Debug/Glide64.pdb + .\Debug/Glide64.lib + + + true + .\Debug/n64Glide.bsc + + + + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/n64Glide.tlb + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + false + ..\..\..\mupen64plus-win32-deps\boost-1.81.0\;..\..\..\mupen64plus-core\src\api;..\..\src\Glide64;..\..\src\Glide64\inc;..\..\src\GlideHQ;..\..\src\GlideHQ\tc-1.1+;..\..\src\Glitch64;..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;%(AdditionalIncludeDirectories) + NO_ASM;_GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;__VISUALC__;%(PreprocessorDefinitions) + true + Async + MultiThreadedDLL + true + NotSet + .\Release/n64Glide.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x64\zlib.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + ..\..\..\mupen64plus-win32-deps\boost-1.81.0\lib64-msvc;%(AdditionalLibraryDirectories) + $(TargetDir)$(TargetName).pdb + + + Windows + true + false + + + true + .\Release/n64Glide.bsc + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .\Release/%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc10/mupen64plus-video-glide64mk2.sln b/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc10/mupen64plus-video-glide64mk2.sln deleted file mode 100644 index ba5b475069..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc10/mupen64plus-video-glide64mk2.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64mk2", "mupen64plus-video-glide64mk2.vcxproj", "{A4D13408-A794-4199-8FC7-4A9A32505005}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|Win32.ActiveCfg = Debug|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|Win32.Build.0 = Debug|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|x64.ActiveCfg = Debug|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|x64.Build.0 = Debug|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|Win32.ActiveCfg = Release|Win32 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|Win32.Build.0 = Release|Win32 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|x64.ActiveCfg = Release|x64 - {A4D13408-A794-4199-8FC7-4A9A32505005}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc10/mupen64plus-video-glide64mk2.vcxproj b/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc10/mupen64plus-video-glide64mk2.vcxproj deleted file mode 100644 index 64488a4fd1..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc10/mupen64plus-video-glide64mk2.vcxproj +++ /dev/null @@ -1,460 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {A4D13408-A794-4199-8FC7-4A9A32505005} - n64Glide - mupen64plus-video-glide64mk2 - - - - DynamicLibrary - false - MultiByte - true - v100 - - - DynamicLibrary - false - MultiByte - true - v100 - - - DynamicLibrary - false - MultiByte - v100 - - - DynamicLibrary - false - MultiByte - v100 - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - $(Configuration)\ - true - true - $(SolutionDir)..\..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - $(Configuration)\ - false - false - true - true - F:\Code\Third Party\boost;$(IncludePath) - F:\Code\Third Party\boost;$(IncludePath) - F:\Code\Third Party\boost\stage\lib;$(LibraryPath) - F:\Code\Third Party\boost\stage\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/n64Glide.tlb - - - - - Disabled - ..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\boost-1.53.0\;..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;%(AdditionalIncludeDirectories) - _GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;%(PreprocessorDefinitions) - Async - EnableFastChecks - MultiThreadedDebugDLL - .\Debug/n64Glide.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - EditAndContinue - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\libpng.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\zlib.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;msvcrtd.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\lib;..\..\..\mupen64plus-win32-deps\boost-1.53.0\boost\libs;%(AdditionalLibraryDirectories) - false - true - $(TargetDir)$(TargetName).pdb - .\Debug/Glide64.lib - MachineX86 - - - true - .\Debug/n64Glide.bsc - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/n64Glide.tlb - - - - - Disabled - ..\..\..\mupen64plus-win32-deps\boost-1.57.0\;..\..\..\mupen64plus-core\src\api;..\..\src\Glide64;..\..\src\Glide64\inc;..\..\src\GlideHQ;..\..\src\GlideHQ\tc-1.1+;..\..\src\Glitch64;..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;%(AdditionalIncludeDirectories) - _DEBUG;NO_ASM;_GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;%(PreprocessorDefinitions) - Async - EnableFastChecks - MultiThreadedDebugDLL - .\Debug/n64Glide.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - ProgramDatabase - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;zlib.lib;libpng16.lib;opengl32.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\..\..\deps\libs;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\x64;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64;%(AdditionalLibraryDirectories) - false - true - $(TargetDir)$(TargetName).pdb - .\Debug/Glide64.lib - - - true - .\Debug/n64Glide.bsc - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/n64Glide.tlb - - - - - MaxSpeed - OnlyExplicitInline - true - Speed - false - ..\..\..\mupen64plus-win32-deps\boost-1.53.0\;..\..\..\mupen64plus-core\src\api;..\..\src\Glide64;..\..\src\Glide64\inc;..\..\src\GlideHQ;..\..\src\GlideHQ\tc-1.1+;..\..\src\Glitch64;..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;%(AdditionalIncludeDirectories) - _GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;__VISUALC__;%(PreprocessorDefinitions) - true - Async - MultiThreaded - true - NotSet - .\Release/n64Glide.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;zlib.lib;libpng.lib;opengl32.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;msvcrt.lib;LIBCMT.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\..\..\mupen64plus-win32-deps\boost-1.53.0\boost\libs;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).pdb - - - MachineX86 - Windows - true - - - true - .\Release/n64Glide.bsc - - - true - - - Copying shared data and libraries to build directory... - copy ..\..\data\* "$(OutDir)" - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/n64Glide.tlb - - - - - MaxSpeed - OnlyExplicitInline - true - Speed - false - ..\..\..\mupen64plus-win32-deps\boost-1.57.0\;..\..\..\mupen64plus-core\src\api;..\..\src\Glide64;..\..\src\Glide64\inc;..\..\src\GlideHQ;..\..\src\GlideHQ\tc-1.1+;..\..\src\Glitch64;..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;%(AdditionalIncludeDirectories) - NO_ASM;_GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;__VISUALC__;%(PreprocessorDefinitions) - true - Async - MultiThreadedDLL - true - NotSet - .\Release/n64Glide.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;zlib.lib;libpng16.lib;opengl32.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\..\..\deps\libs;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\x64;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).pdb - - - Windows - true - /pdbaltpath:%_PDB% %(AdditionalOptions) - - - true - .\Release/n64Glide.bsc - - - true - - - Copying shared data and libraries to build directory... - copy ..\..\data\* "$(OutDir)" - - - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - .\Release/%(Filename)1.obj - .\Release/%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.xdc - false - false - - - false - false - - - - - \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc11/mupen64plus-video-glide64mk2.vcxproj b/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc11/mupen64plus-video-glide64mk2.vcxproj deleted file mode 100644 index 4fca39c354..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64mk2/projects/msvc11/mupen64plus-video-glide64mk2.vcxproj +++ /dev/null @@ -1,363 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {A4D13408-A794-4199-8FC7-4A9A32505005} - n64Glide - mupen64plus-video-glide64mk2 - - - - DynamicLibrary - false - MultiByte - true - v142 - - - DynamicLibrary - false - MultiByte - true - v142 - - - DynamicLibrary - false - MultiByte - v142 - - - DynamicLibrary - false - MultiByte - v142 - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - $(Configuration)\ - true - true - $(SolutionDir)..\..\..\..\Assets\dll\ - $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ - $(Configuration)\ - false - false - true - true - F:\Code\Third Party\boost;$(IncludePath) - F:\Code\Third Party\boost;$(IncludePath) - F:\Code\Third Party\boost\stage\lib;$(LibraryPath) - F:\Code\Third Party\boost\stage\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/n64Glide.tlb - - - - - Disabled - ..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\boost-1.57.0\;..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;%(AdditionalIncludeDirectories) - _GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;%(PreprocessorDefinitions) - Async - EnableFastChecks - MultiThreadedDebugDLL - .\Debug/n64Glide.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - EditAndContinue - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\libpng.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\zlib.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;msvcrtd.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\lib;..\..\..\mupen64plus-win32-deps\boost-1.57.0\boost\libs;%(AdditionalLibraryDirectories) - false - true - .\Debug/Glide64.pdb - .\Debug/Glide64.lib - MachineX86 - - - true - .\Debug/n64Glide.bsc - - - - - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/n64Glide.tlb - - - - - Disabled - ..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\boost-1.57.0\;..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;%(AdditionalIncludeDirectories) - NO_ASM;_GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;%(PreprocessorDefinitions) - Async - EnableFastChecks - MultiThreadedDebugDLL - .\Debug/n64Glide.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - ProgramDatabase - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\x64\zlib.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;msvcrtd.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\lib;..\..\..\deps\libs;%(AdditionalLibraryDirectories) - false - true - .\Debug/Glide64.pdb - .\Debug/Glide64.lib - - - true - .\Debug/n64Glide.bsc - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/n64Glide.tlb - - - - - MaxSpeed - OnlyExplicitInline - true - Speed - false - ..\..\..\mupen64plus-win32-deps\boost-1.57.0\;..\..\..\mupen64plus-core\src\api;..\..\src\Glide64;..\..\src\Glide64\inc;..\..\src\GlideHQ;..\..\src\GlideHQ\tc-1.1+;..\..\src\Glitch64;..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;%(AdditionalIncludeDirectories) - _GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;__VISUALC__;%(PreprocessorDefinitions) - true - Async - MultiThreaded - true - NotSet - .\Release/n64Glide.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;zlib.lib;libpng.lib;opengl32.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;msvcrt.lib;LIBCMT.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\..\..\mupen64plus-win32-deps\boost-1.57.0\boost\libs;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).pdb - - - MachineX86 - Windows - true - - - true - .\Release/n64Glide.bsc - - - true - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/n64Glide.tlb - - - - - MaxSpeed - OnlyExplicitInline - true - Speed - false - ..\..\..\mupen64plus-win32-deps\boost-1.57.0\;..\..\..\mupen64plus-core\src\api;..\..\src\Glide64;..\..\src\Glide64\inc;..\..\src\GlideHQ;..\..\src\GlideHQ\tc-1.1+;..\..\src\Glitch64;..\..\src\Glitch64\inc;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;%(AdditionalIncludeDirectories) - NO_ASM;_GLIBCXX_HAVE_BROKEN_VSWPRINTF;NO_FILTER_THREAD;_VARIADIC_MAX=10;_CRT_SECURE_NO_WARNINGS;__MSC__;WIN32;__VISUALC__;%(PreprocessorDefinitions) - true - Async - MultiThreadedDLL - true - NotSet - .\Release/n64Glide.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64\libpng16.lib;..\..\..\mupen64plus-win32-deps\zlib-1.2.8\lib\x64\zlib.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;msvcrtd.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - ..\lib;..\..\..\deps\libs;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).pdb - - - Windows - true - false - - - true - .\Release/n64Glide.bsc - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\Release/%(Filename)1.obj - .\Release/%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.xdc - - - - - - \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/projects/unix/Makefile b/libmupen64plus/mupen64plus-video-glide64mk2/projects/unix/Makefile deleted file mode 100644 index fe15b08198..0000000000 --- a/libmupen64plus/mupen64plus-video-glide64mk2/projects/unix/Makefile +++ /dev/null @@ -1,458 +0,0 @@ -#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -# * Mupen64plus-video-glide64mk2 - Makefile * -# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * -# * Copyright (C) 2010 Jon Ring * -# * Copyright (C) 2007-2009 Richard Goedeken * -# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation; either version 2 of the License, or * -# * (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program; if not, write to the * -# * Free Software Foundation, Inc., * -# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -# Makefile for Glide64mk2 plugin in Mupen64Plus - -# detect operating system -UNAME ?= $(shell uname -s) -OS := NONE -ifeq ("$(UNAME)","Linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifneq ("$(filter GNU hurd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","Darwin") - OS = OSX - SO_EXTENSION = dylib - SHARED = -bundle - BOOST_SUFFIX = -mt -endif -ifeq ("$(UNAME)","FreeBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","OpenBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared - $(warning OS type "$(UNAME)" not officially supported.') -endif -ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") - OS = MINGW - SO_EXTENSION = dll - SHARED = -shared - PIC = 0 - BOOST_SUFFIX = -mt - CPPFLAGS += -DNO_FILTER_THREAD -endif -ifeq ("$(OS)","NONE") - $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# detect system architecture -HOST_CPU ?= $(shell uname -m) -CPU := NONE -ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") - CPU := X86 - ifeq ("$(BITS)", "32") - ARCH_DETECTED := 64BITS_32 - PIC ?= 0 - else - ARCH_DETECTED := 64BITS - PIC ?= 1 - endif -endif -ifneq ("$(filter pentium i%86,$(HOST_CPU))","") - CPU := X86 - ARCH_DETECTED := 32BITS - PIC ?= 0 -endif -ifneq ("$(filter ppc powerpc,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 32BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 64BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter arm%,$(HOST_CPU))","") - ifeq ("$(filter arm%b,$(HOST_CPU))","") - CPU := ARM - ARCH_DETECTED := 32BITS - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') - endif -endif -ifeq ("$(CPU)","NONE") - $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# base CFLAGS, LDLIBS, and LDFLAGS -OPTFLAGS ?= -O3 -flto -WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -I../../src/Glitch64/inc -DGCC -CXXFLAGS += -fvisibility-inlines-hidden -std=gnu++0x -LDFLAGS += $(SHARED) -BOOST_SUFFIX ?= - -ifeq ($(CPU), X86) - CFLAGS += -mmmx -msse -endif - -# Since we are building a shared library, we must compile with -fPIC on some architectures -# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch -ifeq ($(PIC), 1) - CFLAGS += -fPIC -else - CFLAGS += -fno-PIC -endif - -ifeq ($(BIG_ENDIAN), 1) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# tweak flags for 32-bit build on 64-bit system -ifeq ($(ARCH_DETECTED), 64BITS_32) - ifeq ($(OS), FREEBSD) - $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) - endif - CFLAGS += -m32 - LDFLAGS += -Wl,-m,elf_i386 -endif - -# set special flags per-system -ifeq ($(OS), LINUX) - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver - LDLIBS += -ldl -endif -ifeq ($(OS), OSX) - # Select the proper SDK - # Also, SDKs are stored in a different location since XCode 4.3 - OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) - OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) - OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) - OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") - ifeq ($(OSX_XCODEGE43), 11) - OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs - else - OSX_SYSROOT := /Developer/SDKs - endif - - CXXFLAGS += -std=c++11 -stdlib=libc++ - ifeq ($(CPU), X86) - LDFLAGS += -bundle -L/opt/local/lib - LDLIBS += -ldl - ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk - else - CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk - endif - endif -endif -ifeq ($(OS), FREEBSD) - LDLIBS += -lc -endif - -ifeq ($(origin PKG_CONFIG), undefined) - PKG_CONFIG = $(CROSS_COMPILE)pkg-config - ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) - $(error $(PKG_CONFIG) not found) - endif -endif - -ifeq ($(OS), OSX) # use system zlib on OSX - ZLIB_LDLIBS += -lz -endif - -ifeq ($(origin ZLIB_CFLAGS) $(origin ZLIB_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion zlib 2>/dev/null),) - $(error No zlib development libraries found!) - endif - ZLIB_CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib) - ZLIB_LDLIBS += $(shell $(PKG_CONFIG) --libs zlib) -endif -CFLAGS += $(ZLIB_CFLAGS) -LDLIBS += $(ZLIB_LDLIBS) - -ifeq ($(origin LIBPNG_CFLAGS) $(origin LIBPNG_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),) - $(error No libpng development libraries found!) - endif - LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) - LIBPNG_LDLIBS += $(shell $(PKG_CONFIG) --libs libpng) -endif -CFLAGS += $(LIBPNG_CFLAGS) -LDLIBS += $(LIBPNG_LDLIBS) - - -# search for OpenGL libraries -ifeq ($(OS), OSX) - GL_LDLIBS = -framework OpenGL -endif -ifeq ($(OS), MINGW) - GL_LDLIBS = -lopengl32 -endif -ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) - $(error No OpenGL development libraries found!) - endif - GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) - GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl) -endif -CFLAGS += $(GL_CFLAGS) -LDLIBS += $(GL_LDLIBS) - -# test for presence of SDL -ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) - SDL_CONFIG = $(CROSS_COMPILE)sdl-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - $(error No SDL development libraries found!) - endif - ifeq ($(OS),OSX) - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - # sdl-config on mac screws up when we're trying to build a library and not an executable - # SDL 1.3 is supposed to fix that, if it's ever released - SDL_LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa - else - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs) - endif -endif -CFLAGS += $(SDL_CFLAGS) -LDLIBS += $(SDL_LDLIBS) - -ifneq ($(OS), MINGW) - CPPFLAGS += -D__unix__ -endif - -# set mupen64plus core API header path -ifneq ("$(APIDIR)","") - CFLAGS += "-I$(APIDIR)" -else - TRYDIR = ../../../mupen64plus-core/src/api - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/local/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) - endif - endif - endif -endif - -# reduced compile output when running make without V=1 -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - Q_CC = @echo ' CC '$@; - Q_CXX = @echo ' CXX '$@; - Q_LD = @echo ' LD '$@; -endif -endif - -# set base program pointers and flags -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -RM ?= rm -f -INSTALL ?= install -MKDIR ?= mkdir -p -COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -# set special flags for given Makefile parameters -ifeq ($(DEBUG),1) - CFLAGS += -g - INSTALL_STRIP_FLAG ?= -else - ifneq ($(OS),OSX) - INSTALL_STRIP_FLAG ?= -s - endif -endif -ifeq ($(NO_ASM), 1) - CFLAGS += -DNO_ASM -endif - -# set installation options -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif -ifeq ($(SHAREDIR),) - SHAREDIR := $(PREFIX)/share/mupen64plus -endif -ifeq ($(LIBDIR),) - LIBDIR := $(PREFIX)/lib -endif -ifeq ($(PLUGINDIR),) - PLUGINDIR := $(LIBDIR)/mupen64plus -endif - -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - -# list of source files to compile -SOURCE = \ - $(SRCDIR)/Glitch64/combiner.cpp \ - $(SRCDIR)/Glitch64/geometry.cpp \ - $(SRCDIR)/Glitch64/glitchmain.cpp \ - $(SRCDIR)/Glitch64/textures.cpp \ - $(SRCDIR)/Glide64/3dmath.cpp \ - $(SRCDIR)/Glide64/Combine.cpp \ - $(SRCDIR)/Glide64/Config.cpp \ - $(SRCDIR)/Glide64/CRC.cpp \ - $(SRCDIR)/Glide64/Debugger.cpp \ - $(SRCDIR)/Glide64/DepthBufferRender.cpp \ - $(SRCDIR)/Glide64/FBtoScreen.cpp \ - $(SRCDIR)/Glide64/Ini.cpp \ - $(SRCDIR)/Glide64/Keys.cpp \ - $(SRCDIR)/Glide64/Main.cpp \ - $(SRCDIR)/Glide64/rdp.cpp \ - $(SRCDIR)/Glide64/TexBuffer.cpp \ - $(SRCDIR)/Glide64/TexCache.cpp \ - $(SRCDIR)/Glide64/Util.cpp - -ifneq ($(HIRES), 0) -SOURCE += \ - $(SRCDIR)/GlideHQ/Ext_TxFilter.cpp \ - $(SRCDIR)/GlideHQ/TxFilterExport.cpp \ - $(SRCDIR)/GlideHQ/TxFilter.cpp \ - $(SRCDIR)/GlideHQ/TxCache.cpp \ - $(SRCDIR)/GlideHQ/TxTexCache.cpp \ - $(SRCDIR)/GlideHQ/TxHiResCache.cpp \ - $(SRCDIR)/GlideHQ/TxQuantize.cpp \ - $(SRCDIR)/GlideHQ/TxUtil.cpp \ - $(SRCDIR)/GlideHQ/TextureFilters.cpp \ - $(SRCDIR)/GlideHQ/TextureFilters_2xsai.cpp \ - $(SRCDIR)/GlideHQ/TextureFilters_hq2x.cpp \ - $(SRCDIR)/GlideHQ/TextureFilters_hq4x.cpp \ - $(SRCDIR)/GlideHQ/TxImage.cpp \ - $(SRCDIR)/GlideHQ/TxReSample.cpp \ - $(SRCDIR)/GlideHQ/TxDbg.cpp \ - $(SRCDIR)/GlideHQ/tc-1.1+/fxt1.c \ - $(SRCDIR)/GlideHQ/tc-1.1+/dxtn.c \ - $(SRCDIR)/GlideHQ/tc-1.1+/wrapper.c \ - $(SRCDIR)/GlideHQ/tc-1.1+/texstore.c - -CPPFLAGS += -DTEXTURE_FILTER # -DDUMP_CACHE -LDLIBS += -lboost_filesystem$(BOOST_SUFFIX) -lboost_system$(BOOST_SUFFIX) -endif - -ifeq ($(OS),MINGW) -SOURCE += $(SRCDIR)/Glide64/osal_dynamiclib_win32.c -else -SOURCE += $(SRCDIR)/Glide64/osal_dynamiclib_unix.c -endif - - - -# generate a list of object files build, make a temporary directory for them -OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) -OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) -OBJDIRS = $(dir $(OBJECTS)) -$(shell $(MKDIR) $(OBJDIRS)) - -# build targets -TARGET = mupen64plus-video-glide64mk2$(POSTFIX).$(SO_EXTENSION) - -targets: - @echo "Mupen64plus-video-glide64mk2 N64 Graphics plugin makefile. " - @echo " Targets:" - @echo " all == Build Mupen64plus-video-glide64mk2 plugin" - @echo " clean == remove object files" - @echo " rebuild == clean and re-build all" - @echo " install == Install Mupen64Plus-video-glide64mk2 plugin" - @echo " uninstall == Uninstall Mupen64Plus-video-glide64mk2 plugin" - @echo " Options:" - @echo " BITS=32 == build 32-bit binaries on 64-bit machine" - @echo " NO_ASM=1 == build without inline assembly code (x86 MMX/SSE)" - @echo " APIDIR=path == path to find Mupen64Plus Core headers" - @echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)" - @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" - @echo " PIC=(1|0) == Force enable/disable of position independent code" - @echo " POSTFIX=name == String added to the name of the the build (default: '')" - @echo " HIRES=(1|0) == Enables/Disables support for hires textures and texture filters (default: 1)" - @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" - @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" - @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" - @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" - @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" - @echo " Debugging Options:" - @echo " DEBUG=1 == add debugging symbols" - @echo " V=1 == show verbose compiler output" - -all: $(TARGET) - -install: $(TARGET) - $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" - $(INSTALL) -m 0644 "../../data/Glide64mk2.ini" "$(DESTDIR)$(SHAREDIR)" - -uninstall: - $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" - $(RM) "$(DESTDIR)$(SHAREDIR)/Glide64mk2.ini" - -clean: - $(RM) -r $(OBJDIR) $(TARGET) - -rebuild: clean all - -# build dependency files -CFLAGS += -MD --include $(OBJECTS:.o=.d) - -CXXFLAGS += $(CFLAGS) - -# standard build rules -$(OBJDIR)/%.o: $(SRCDIR)/%.c - $(COMPILE.c) -o $@ $< - -$(OBJDIR)/%.o: $(SRCDIR)/%.cpp - $(COMPILE.cc) -o $@ $< - -$(TARGET): $(OBJECTS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/Main.cpp b/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/Main.cpp index a688b34f98..f9cfdf9976 100644 --- a/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/Main.cpp +++ b/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/Main.cpp @@ -160,16 +160,6 @@ enum { ZELDA }; -#ifdef __WINDOWS__ -#define WINPROC_OVERRIDE -#endif - -#ifdef WINPROC_OVERRIDE -LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -WNDPROC oldWndProc = NULL; -WNDPROC myWndProc = NULL; -#endif - #ifdef ALTTAB_FIX HHOOK hhkLowLevelKybd = NULL; LRESULT CALLBACK LowLevelKeyboardProc(int nCode, @@ -1585,11 +1575,6 @@ void CALL CloseDLL (void) { VLOG ("CloseDLL ()\n"); - // re-set the old window proc -#ifdef WINPROC_OVERRIDE - SetWindowLong (gfx.hWnd, GWL_WNDPROC, (long)oldWndProc); -#endif - #ifdef ALTTAB_FIX if (hhkLowLevelKybd) { @@ -1723,15 +1708,6 @@ EXPORT int CALL InitiateGFX (GFX_INFO Gfx_Info) gfx = Gfx_Info; -#ifdef WINPROC_OVERRIDE - // [H.Morii] inject our own winproc so that "alt-enter to fullscreen" - // message is shown when the emulator window is activated. - WNDPROC curWndProc = (WNDPROC)GetWindowLong(gfx.hWnd, GWL_WNDPROC); - if (curWndProc && curWndProc != (WNDPROC)WndProc) { - oldWndProc = (WNDPROC)SetWindowLong (gfx.hWnd, GWL_WNDPROC, (long)WndProc); - } -#endif - util_init (); math_init (); TexCacheInit (); @@ -1961,14 +1937,8 @@ void drawViRegBG() } -void drawNoFullscreenMessage(); - void DrawFrameBuffer () { - if (!fullscreen) - { - drawNoFullscreenMessage(); - } if (to_fullscreen) GoToFullScreen(); @@ -2505,40 +2475,10 @@ EXPORT void CALL ViWidthChanged (void) { } -#ifdef WINPROC_OVERRIDE -LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - case WM_ACTIVATEAPP: - if (wParam == TRUE && !fullscreen) rdp.window_changed = TRUE; - break; - case WM_PAINT: - if (!fullscreen) rdp.window_changed = TRUE; - break; - - /* case WM_DESTROY: - SetWindowLong (gfx.hWnd, GWL_WNDPROC, (long)oldWndProc); - break;*/ - } - - return CallWindowProc(oldWndProc, hwnd, msg, wParam, lParam); -} -#endif - } int CheckKeyPressed(int key, int mask) { -static Glide64Keys g64Keys; - if (settings.use_hotkeys == 0) - return 0; -#ifdef __WINDOWS__ - return (GetAsyncKeyState(g64Keys[key]) & mask); -#else - if (grKeyPressed) - return grKeyPressed(g64Keys[key]); -#endif return 0; } diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/rdp.cpp b/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/rdp.cpp index c8746f289b..3790a69952 100644 --- a/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/rdp.cpp +++ b/libmupen64plus/mupen64plus-video-glide64mk2/src/Glide64/rdp.cpp @@ -523,62 +523,6 @@ void microcheck () } } -#ifdef __WINDOWS__ -static void GetClientSize(int * width, int * height) -{ -#ifdef __WINDOWS__ - RECT win_rect; - GetClientRect (gfx.hWnd, &win_rect); - *width = win_rect.right; - *height = win_rect.bottom; -#else - GFXWindow->GetClientSize(width, height); -#endif -} -#endif - -void drawNoFullscreenMessage() -{ -//need to find, how to do it on non-windows OS -//the code below will compile on any OS -//but it works only on windows, because -//I don't know, how to initialize GFXWindow on other OS -#ifdef __WINDOWS__ - LOG ("drawNoFullscreenMessage ()\n"); - if (rdp.window_changed) - { - rdp.window_changed = FALSE; - int width, height; - GetClientSize(&width, &height); - - wxClientDC dc(GFXWindow); - dc.SetBrush(*wxMEDIUM_GREY_BRUSH); - dc.SetTextForeground(*wxWHITE); - dc.SetBackgroundMode(wxTRANSPARENT); - dc.DrawRectangle(0, 0, width, height); - - wxCoord w, h; - wxString text = wxT("Glide64mk2"); - dc.GetTextExtent(text, &w, &h); - wxCoord x = (width - w)/2; - wxCoord y = height/2 - h*4; - dc.DrawText(text, x, y); - - text = wxT("Gfx cannot be drawn in windowed mode"); - dc.GetTextExtent(text, &w, &h); - x = (width - w)/2; - y = height/2 - h; - dc.DrawText(text, x, y); - - text = wxT("Press Alt+Enter to switch to fullscreen"); - dc.GetTextExtent(text, &w, &h); - x = (width - w)/2; - y = (height - h)/2 + h*2; - dc.DrawText(text, x, y); - } -#endif -} - static wxUint32 d_ul_x, d_ul_y, d_lr_x, d_lr_y; static void DrawPartFrameBufferToScreen() @@ -794,8 +738,6 @@ EXPORT void CALL ProcessDList(void) SoftLocker lock(mutexProcessDList); if (!lock.IsOk()) //mutex is busy { - if (!fullscreen) - drawNoFullscreenMessage(); // Set an interrupt to allow the game to continue *gfx.MI_INTR_REG |= 0x20; gfx.CheckInterrupts(); @@ -818,7 +760,6 @@ EXPORT void CALL ProcessDList(void) if (!fullscreen) { - drawNoFullscreenMessage(); // Set an interrupt to allow the game to continue *gfx.MI_INTR_REG |= 0x20; gfx.CheckInterrupts(); @@ -4397,8 +4338,6 @@ EXPORT void CALL ProcessRDPList(void) SoftLocker lock(mutexProcessDList); if (!lock.IsOk()) //mutex is busy { - if (!fullscreen) - drawNoFullscreenMessage(); // Set an interrupt to allow the game to continue *gfx.MI_INTR_REG |= 0x20; gfx.CheckInterrupts(); diff --git a/libmupen64plus/mupen64plus-video-glide64mk2/src/Glitch64/main.h b/libmupen64plus/mupen64plus-video-glide64mk2/src/Glitch64/main.h index 5b203ed220..d6d6dbfb22 100644 --- a/libmupen64plus/mupen64plus-video-glide64mk2/src/Glitch64/main.h +++ b/libmupen64plus/mupen64plus-video-glide64mk2/src/Glitch64/main.h @@ -68,6 +68,7 @@ extern int buffer_cleared; // mark that the buffer has been cleared, used to che #include extern "C" { #include + #define glActiveTextureARB _glActiveTextureARB extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB; extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT; @@ -88,6 +89,7 @@ extern "C" { extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB; + #define glMultiTexCoord2fARB _glMultiTexCoord2fARB extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB; extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT; extern PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f; diff --git a/libmupen64plus/mupen64plus-video-jabo/Config.h b/libmupen64plus/mupen64plus-video-jabo/Config.h deleted file mode 100644 index cd4f988e32..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/Config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "m64p.h" - -BOOL Config_Open(); -int Config_ReadInt(const char *itemname, const char *desc, int def_value, BOOL create=TRUE, BOOL isBoolean=TRUE); -void Config_ReadScreenResolution(int * width, int * height); - - -#endif /* CONFIG_H */ \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-jabo/config.cpp b/libmupen64plus/mupen64plus-video-jabo/config.cpp deleted file mode 100644 index 962b890f22..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/config.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "Config.h" -#include "m64p.h" - -static m64p_handle video_general_section; -static m64p_handle video_jabo_section; - - -BOOL Config_Open() -{ - if (ConfigOpenSection("Video-General", &video_general_section) != M64ERR_SUCCESS || - ConfigOpenSection("Video-Jabo", &video_jabo_section) != M64ERR_SUCCESS) - { - //ERRLOG("Could not open configuration"); - return FALSE; - } - ConfigSetDefaultBool(video_general_section, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False"); - ConfigSetDefaultInt(video_general_section, "ScreenWidth", 640, "Width of output window or fullscreen width"); - ConfigSetDefaultInt(video_general_section, "ScreenHeight", 480, "Height of output window or fullscreen height"); - - return TRUE; -} - -int Config_ReadScreenInt(const char *itemname) -{ - return ConfigGetParamInt(video_general_section, itemname); -} - -void Config_ReadScreenResolution(int * width, int * height) -{ - *width = ConfigGetParamInt(video_general_section, "ScreenWidth"); - *height = ConfigGetParamInt(video_general_section, "ScreenHeight"); -} - -BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create, int isBoolean) -{ - //VLOG("Getting value %s", itemname); - if (isBoolean) - { - ConfigSetDefaultBool(video_jabo_section, itemname, def_value, desc); - return ConfigGetParamBool(video_jabo_section, itemname); - } - else - { - ConfigSetDefaultInt(video_jabo_section, itemname, def_value, desc); - return ConfigGetParamInt(video_jabo_section, itemname); - } - -} \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-jabo/jabo_api.h b/libmupen64plus/mupen64plus-video-jabo/jabo_api.h deleted file mode 100644 index d8655e9f29..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/jabo_api.h +++ /dev/null @@ -1,301 +0,0 @@ -/********************************************************************************** -Common gfx plugin spec, version #1.3 maintained by zilmar (zilmar@emulation64.com) -MODIFIED: Turned function prototypes into function pointer typedefs - -All questions or suggestions should go through the mailing list. -http://www.egroups.com/group/Plugin64-Dev -*********************************************************************************** - -Notes: ------- - -Setting the approprate bits in the MI_INTR_REG and calling CheckInterrupts which -are both passed to the DLL in InitiateGFX will generate an Interrupt from with in -the plugin. - -The Setting of the RSP flags and generating an SP interrupt should not be done in -the plugin - -**********************************************************************************/ -#ifndef _GFX_H_INCLUDED__ -#define _GFX_H_INCLUDED__ - -#if defined(__cplusplus) -extern "C" { -#endif - -/* Plugin types */ -#define PLUGIN_TYPE_GFX 2 - -//#define EXPORT __declspec(dllexport) -//#define CALL _cdecl - -/***** Structures *****/ -typedef struct { - WORD Version; /* Set to 0x0103 */ - WORD Type; /* Set to PLUGIN_TYPE_GFX */ - char Name[100]; /* Name of the DLL */ - - /* If DLL supports memory these memory options then set them to TRUE or FALSE - if it does not support it */ - BOOL NormalMemory; /* a normal BYTE array */ - BOOL MemoryBswaped; /* a normal BYTE array where the memory has been pre - bswap on a dword (32 bits) boundry */ -} PLUGIN_INFO; - -typedef struct { - HWND hWnd; /* Render window */ - HWND hStatusBar; /* if render window does not have a status bar then this is NULL */ - - BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre - // bswap on a dword (32 bits) boundry - // eg. the first 8 bytes are stored like this: - // 4 3 2 1 8 7 6 5 - - BYTE * HEADER; // This is the rom header (first 40h bytes of the rom - // This will be in the same memory format as the rest of the memory. - BYTE * RDRAM; - BYTE * DMEM; - BYTE * IMEM; - - DWORD * MI_INTR_REG; - - DWORD * DPC_START_REG; - DWORD * DPC_END_REG; - DWORD * DPC_CURRENT_REG; - DWORD * DPC_STATUS_REG; - DWORD * DPC_CLOCK_REG; - DWORD * DPC_BUFBUSY_REG; - DWORD * DPC_PIPEBUSY_REG; - DWORD * DPC_TMEM_REG; - - DWORD * VI_STATUS_REG; - DWORD * VI_ORIGIN_REG; - DWORD * VI_WIDTH_REG; - DWORD * VI_INTR_REG; - DWORD * VI_V_CURRENT_LINE_REG; - DWORD * VI_TIMING_REG; - DWORD * VI_V_SYNC_REG; - DWORD * VI_H_SYNC_REG; - DWORD * VI_LEAP_REG; - DWORD * VI_H_START_REG; - DWORD * VI_V_START_REG; - DWORD * VI_V_BURST_REG; - DWORD * VI_X_SCALE_REG; - DWORD * VI_Y_SCALE_REG; - - void (*CheckInterrupts)( void ); -} GFX_INFO; - -/****************************************************************** - Function: CaptureScreen - Purpose: This function dumps the current frame to a file - input: pointer to the directory to save the file to - output: none -*******************************************************************/ -//EXPORT void CALL CaptureScreen ( char * Directory ); -typedef void (*ptr_CaptureScreen)(char *); - -/****************************************************************** - Function: ChangeWindow - Purpose: to change the window between fullscreen and window - mode. If the window was in fullscreen this should - change the screen to window mode and vice vesa. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL ChangeWindow (void); -typedef void (*ptr_ChangeWindow)(void); - -/****************************************************************** - Function: CloseDLL - Purpose: This function is called when the emulator is closing - down allowing the dll to de-initialise. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL CloseDLL (void); -typedef void (*ptr_CloseDLL)(void); - -/****************************************************************** - Function: DllAbout - Purpose: This function is optional function that is provided - to give further information about the DLL. - input: a handle to the window that calls this function - output: none -*******************************************************************/ -//EXPORT void CALL DllAbout ( HWND hParent ); -typedef void (*ptr_DllAbout)(HWND hParent); - -/****************************************************************** - Function: DllConfig - Purpose: This function is optional function that is provided - to allow the user to configure the dll - input: a handle to the window that calls this function - output: none -*******************************************************************/ -//EXPORT void CALL DllConfig ( HWND hParent ); -typedef void (*ptr_DllConfig)(HWND hParent); - -/****************************************************************** - Function: DllTest - Purpose: This function is optional function that is provided - to allow the user to test the dll - input: a handle to the window that calls this function - output: none -*******************************************************************/ -// IGNORE -//EXPORT void CALL DllTest ( HWND hParent ); - -/****************************************************************** - Function: DrawScreen - Purpose: This function is called when the emulator receives a - WM_PAINT message. This allows the gfx to fit in when - it is being used in the desktop. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL DrawScreen (void); -typedef void (*ptr_DrawScreen)(void); - -/****************************************************************** - Function: GetDllInfo - Purpose: This function allows the emulator to gather information - about the dll by filling in the PluginInfo structure. - input: a pointer to a PLUGIN_INFO stucture that needs to be - filled by the function. (see def above) - output: none -*******************************************************************/ -//EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo ); -typedef void (*ptr_GetDllInfo)(PLUGIN_INFO * PluginInfo); - -/****************************************************************** - Function: InitiateGFX - Purpose: This function is called when the DLL is started to give - information from the emulator that the n64 graphics - uses. This is not called from the emulation thread. - Input: Gfx_Info is passed to this function which is defined - above. - Output: TRUE on success - FALSE on failure to initialise - - ** note on interrupts **: - To generate an interrupt set the appropriate bit in MI_INTR_REG - and then call the function CheckInterrupts to tell the emulator - that there is a waiting interrupt. -*******************************************************************/ -//EXPORT BOOL CALL InitiateGFX (GFX_INFO Gfx_Info); -typedef void (*ptr_InitiateGFX)(GFX_INFO Gfx_Info); - -/****************************************************************** - Function: MoveScreen - Purpose: This function is called in response to the emulator - receiving a WM_MOVE passing the xpos and ypos passed - from that message. - input: xpos - the x-coordinate of the upper-left corner of the - client area of the window. - ypos - y-coordinate of the upper-left corner of the - client area of the window. - output: none -*******************************************************************/ -// INGORE -//EXPORT void CALL MoveScreen (int xpos, int ypos); -typedef void (*ptr_MoveScreen)(int xpos, int ypos); - -/****************************************************************** - Function: ProcessDList - Purpose: This function is called when there is a Dlist to be - processed. (High level GFX list) - input: none - output: none -*******************************************************************/ -//EXPORT void CALL ProcessDList(void); -typedef void (*ptr_ProcessDList)(void); - -/****************************************************************** - Function: ProcessRDPList - Purpose: This function is called when there is a Dlist to be - processed. (Low level GFX list) - input: none - output: none -*******************************************************************/ -//EXPORT void CALL ProcessRDPList(void); -typedef void (*ptr_ProcessRDPList)(void); - -/****************************************************************** - Function: RomClosed - Purpose: This function is called when a rom is closed. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL RomClosed (void); -typedef void (*ptr_RomClosed)(void); - -/****************************************************************** - Function: RomOpen - Purpose: This function is called when a rom is open. (from the - emulation thread) - input: none - output: none -*******************************************************************/ -//EXPORT void CALL RomOpen (void); -typedef void (*ptr_RomOpen)(void); - -/****************************************************************** - Function: ShowCFB - Purpose: Useally once Dlists are started being displayed, cfb is - ignored. This function tells the dll to start displaying - them again. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL ShowCFB (void); -typedef void (*ptr_ShowCFB)(void); - -/****************************************************************** - Function: UpdateScreen - Purpose: This function is called in response to a vsync of the - screen were the VI bit in MI_INTR_REG has already been - set - input: none - output: none -*******************************************************************/ -//EXPORT void CALL UpdateScreen (void); -typedef void (*ptr_UpdateScreen)(void); - -/****************************************************************** - Function: ViStatusChanged - Purpose: This function is called to notify the dll that the - ViStatus registers value has been changed. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL ViStatusChanged (void); -typedef void (*ptr_ViStatusChanged)(void); - -/****************************************************************** - Function: ViWidthChanged - Purpose: This function is called to notify the dll that the - ViWidth registers value has been changed. - input: none - output: none -*******************************************************************/ -//EXPORT void CALL ViWidthChanged (void); -typedef void (*ptr_ViWidthChanged)(void); - -/****************************************************************** - Function: ReadScreen - Purpose: Capture the current screen - Input: none - Output: dest - 24-bit RGB data - width - width of image - height - height of image - ******************************************************************/ -//EXPORT void CALL ReadScreen (void **dest, long *width, long *height); -typedef void (*ptr_ReadScreen)(void **dest, long *width, long *height); - -#if defined(__cplusplus) -} - -#endif -#endif diff --git a/libmupen64plus/mupen64plus-video-jabo/m64p.h b/libmupen64plus/mupen64plus-video-jabo/m64p.h deleted file mode 100644 index dd073ddfaa..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/m64p.h +++ /dev/null @@ -1,14 +0,0 @@ -#include "m64p_config.h" - -extern ptr_ConfigOpenSection ConfigOpenSection; -extern ptr_ConfigSetParameter ConfigSetParameter; -extern ptr_ConfigGetParameter ConfigGetParameter; -extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp; -extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt; -extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat; -extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool; -extern ptr_ConfigSetDefaultString ConfigSetDefaultString; -extern ptr_ConfigGetParamInt ConfigGetParamInt; -extern ptr_ConfigGetParamFloat ConfigGetParamFloat; -extern ptr_ConfigGetParamBool ConfigGetParamBool; -extern ptr_ConfigGetParamString ConfigGetParamString; \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-jabo/main.cpp b/libmupen64plus/mupen64plus-video-jabo/main.cpp deleted file mode 100644 index 2ef8cf0f99..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/main.cpp +++ /dev/null @@ -1,548 +0,0 @@ -/* Mupen64plus-video-jabo */ - -#include -#include -#include -#include -#include -#include - -#define M64P_PLUGIN_PROTOTYPES 1 -#include "m64p_types.h" -#include "m64p_plugin.h" -#include "m64p_common.h" -#include "m64p_config.h" - -#include "main.h" -#include "typedefs.h" -#include "Config.h" - -//#define LOG(x) { std::ofstream myfile; myfile.open ("jabo_wrapper_log.txt", std::ios::app); myfile << x << "\n"; myfile.close(); } -#define LOG(x) - -namespace OldAPI -{ - #include "jabo_api.h" - ptr_InitiateGFX InitiateGFX = NULL; - ptr_ProcessDList ProcessDList = NULL; - ptr_ProcessRDPList ProcessRDPList = NULL; - ptr_ShowCFB ShowCFB = NULL; - ptr_ViStatusChanged ViStatusChanged = NULL; - ptr_ViWidthChanged ViWidthChanged = NULL; - ptr_RomOpen RomOpen = NULL; - ptr_RomClosed RomClosed = NULL; - ptr_CloseDLL CloseDLL = NULL; - - ptr_DrawScreen DrawScreen = NULL; - ptr_MoveScreen MoveScreen = NULL; - ptr_UpdateScreen UpdateScreen = NULL; - ptr_DllConfig DllConfig = NULL; - ptr_GetDllInfo GetDllInfo = NULL; -} - -ptr_ConfigOpenSection ConfigOpenSection = NULL; -ptr_ConfigSetParameter ConfigSetParameter = NULL; -ptr_ConfigGetParameter ConfigGetParameter = NULL; -ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL; -ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; -ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; -ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; -ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; -ptr_ConfigGetParamInt ConfigGetParamInt = NULL; -ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; -ptr_ConfigGetParamBool ConfigGetParamBool = NULL; -ptr_ConfigGetParamString ConfigGetParamString = NULL; - -/* local variables */ -static void (*l_DebugCallback)(void *, int, const char *) = NULL; -static void *l_DebugCallContext = NULL; -static int l_PluginInit = 0; - -HMODULE JaboDLL; - -HMODULE D3D8Dll; - -typedef void (*ptr_D3D8_SetRenderingCallback)(void (*callback)(int)); -ptr_D3D8_SetRenderingCallback D3D8_SetRenderingCallback = NULL; -typedef void (*ptr_D3D8_ReadScreen)(void *dest, int *width, int *height); -ptr_D3D8_ReadScreen D3D8_ReadScreen = NULL; -typedef void (*ptr_D3D8_CloseDLL)(); -ptr_D3D8_CloseDLL D3D8_CloseDLL = NULL; - -DWORD old_options; -DWORD old_initflags; - -void setup_jabo_functions() -{ - JaboDLL = LoadLibrary("Jabo_Direct3D8_patched.dll"); - - if (JaboDLL != NULL) - { - OldAPI::InitiateGFX = (OldAPI::ptr_InitiateGFX)GetProcAddress(JaboDLL,"InitiateGFX"); - OldAPI::ProcessDList = (OldAPI::ptr_ProcessDList)GetProcAddress(JaboDLL,"ProcessDList"); - OldAPI::ProcessRDPList = (OldAPI::ptr_ProcessRDPList)GetProcAddress(JaboDLL,"ProcessRDPList"); - OldAPI::ShowCFB = (OldAPI::ptr_ShowCFB)GetProcAddress(JaboDLL,"ShowCFB"); - OldAPI::ViStatusChanged = (OldAPI::ptr_ViStatusChanged)GetProcAddress(JaboDLL,"ViStatusChanged"); - OldAPI::ViWidthChanged = (OldAPI::ptr_ViWidthChanged)GetProcAddress(JaboDLL,"ViWidthChanged"); - OldAPI::RomOpen = (OldAPI::ptr_RomOpen)GetProcAddress(JaboDLL,"RomOpen"); - OldAPI::RomClosed = (OldAPI::ptr_RomClosed)GetProcAddress(JaboDLL,"RomClosed"); - OldAPI::CloseDLL = (OldAPI::ptr_CloseDLL)GetProcAddress(JaboDLL,"CloseDLL"); - - OldAPI::DrawScreen = (OldAPI::ptr_DrawScreen)GetProcAddress(JaboDLL,"DrawScreen"); - OldAPI::MoveScreen = (OldAPI::ptr_MoveScreen)GetProcAddress(JaboDLL,"MoveScreen"); - OldAPI::UpdateScreen = (OldAPI::ptr_UpdateScreen)GetProcAddress(JaboDLL,"UpdateScreen"); - OldAPI::DllConfig = (OldAPI::ptr_DllConfig)GetProcAddress(JaboDLL,"DllConfig"); - OldAPI::GetDllInfo = (OldAPI::ptr_GetDllInfo)GetProcAddress(JaboDLL,"GetDllInfo"); - } - - D3D8Dll = LoadLibrary("D3D8.dll"); - if (D3D8Dll != NULL) - { - D3D8_SetRenderingCallback = (ptr_D3D8_SetRenderingCallback)GetProcAddress(D3D8Dll,"SetRenderingCallback"); - D3D8_ReadScreen = (ptr_D3D8_ReadScreen)GetProcAddress(D3D8Dll,"ReadScreen"); - D3D8_CloseDLL = (ptr_D3D8_CloseDLL)GetProcAddress(D3D8Dll,"CloseDLL"); - } -} - -BOOL readOptionsInitflags (DWORD* options_val, DWORD* initflags_val) -{ - HKEY mainkey; - if (RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\Direct3D8 1.6.1",0,KEY_READ,&mainkey) != ERROR_SUCCESS) - { - // key doesn't exist, so we need to create it first - if (RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\Direct3D8 1.6.1",NULL,NULL,NULL,KEY_READ,NULL,&mainkey,NULL) != ERROR_SUCCESS) - { - // Couldn't create the key - printf("readOptionsInitflags: Couldn't create the key\n"); - return (FALSE); - } - } - - // Key exists, try to find the Options Value - DWORD type; - DWORD cbData; - int options_value; - LSTATUS result = RegQueryValueEx(mainkey, "Options", NULL, &type, (LPBYTE)&options_value, &cbData); - if (result != ERROR_SUCCESS) - { - options_value = 0; - printf("readOptionsInitflags: fail A\n"); - } - *options_val = options_value; - - // Try to find the Direct3D init flags subkey Value - int initflags_value; - result = RegQueryValueEx(mainkey, "Direct3D8.InitFlags", NULL, &type, (LPBYTE)&initflags_value, &cbData); - if (result != ERROR_SUCCESS) - { - printf("readOptionsInitflags: fail B\n"); - initflags_value = 0x00e00000; - } - *initflags_val = initflags_value; - - RegCloseKey(mainkey); - return(TRUE); -} - -BOOL writeOptionsInitflags(DWORD options_val, DWORD initflags_val) -{ - // Open the key for writing - HKEY mainkey; - if (RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\Direct3D8 1.6.1",0,KEY_WRITE,&mainkey) != ERROR_SUCCESS) - { - printf("writeOptionsInitflags: Failure to open key for write\n"); - return (FALSE); - } - - // Store our options value - DWORD new_val = options_val; - if (RegSetValueEx(mainkey, "Options", NULL, REG_DWORD, (BYTE *)&new_val, 4) != ERROR_SUCCESS) - { - printf("writeOptionsInitflags: Couldn't write options value\n"); - } - - // Store our init flags value - new_val = initflags_val; - if (RegSetValueEx(mainkey, "Direct3D8.InitFlags", NULL, REG_DWORD, (BYTE *)&new_val, 4) != ERROR_SUCCESS) - { - LOG("writeOptionsInitflags: Couldn't write init flags value"); - } - - RegCloseKey(mainkey); - return(TRUE); -} - -void createRDBFile(unsigned char * header, int resolution_width, int resolution_height, int clear_mode) -{ - std::ofstream rdbFile; - rdbFile.open("Project64.rdb", std::ios::trunc | std::ios::out); - - // File can't seem to have data on the first line. It has to be a comment or blank - rdbFile << "\n"; - - rdbFile << "["; - - rdbFile << std::hex << std::setfill('0') << std::setw(2) << std::uppercase; - rdbFile << (int)header[16] << (int)header[17] << (int)header[18] << (int)header[19]; - rdbFile << "-"; - rdbFile << (int)header[20] << (int)header[21] << (int)header[22] << (int)header[23]; - rdbFile << "-C:"; - rdbFile << (int)header[62] << "]\n"; - - rdbFile << std::dec << std::nouppercase; - rdbFile << "Clear Frame=" << clear_mode << "\n"; - rdbFile << "Resolution Width=" << resolution_width << "\n"; - rdbFile << "Resolution Height=" << resolution_height << "\n"; - rdbFile.close(); -} - -/* Global functions */ -static void DebugMessage(int level, const char *message, ...) -{ - char msgbuf[1024]; - va_list args; - - if (l_DebugCallback == NULL) - return; - - va_start(args, message); - vsprintf(msgbuf, message, args); - - (*l_DebugCallback)(l_DebugCallContext, level, msgbuf); - - va_end(args); -} - -#pragma region (De-)Initialization - -/* Mupen64Plus plugin functions */ -EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, - void (*DebugCallback)(void *, int, const char *)) -{ - LOG("API WRAPPER:\t PluginStartup") - setup_jabo_functions(); - - ptr_CoreGetAPIVersions CoreAPIVersionFunc; - - int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion; - - if (l_PluginInit) - return M64ERR_ALREADY_INIT; - - /* first thing is to set the callback function for debug info */ - l_DebugCallback = DebugCallback; - l_DebugCallContext = Context; - - /* attach and call the CoreGetAPIVersions function, check Config API version for compatibility */ - CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) GetProcAddress(CoreLibHandle, "CoreGetAPIVersions"); - - if (CoreAPIVersionFunc == NULL) - { - DebugMessage(M64MSG_ERROR, "Core emulator broken; no CoreAPIVersionFunc() function found."); - return M64ERR_INCOMPATIBLE; - } - - (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); - if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) - { - DebugMessage(M64MSG_ERROR, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", - VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); - return M64ERR_INCOMPATIBLE; - } - - ConfigOpenSection = (ptr_ConfigOpenSection) GetProcAddress(CoreLibHandle, "ConfigOpenSection"); - ConfigSetParameter = (ptr_ConfigSetParameter) GetProcAddress(CoreLibHandle, "ConfigSetParameter"); - ConfigGetParameter = (ptr_ConfigGetParameter) GetProcAddress(CoreLibHandle, "ConfigGetParameter"); - ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) GetProcAddress(CoreLibHandle, "ConfigSetDefaultInt"); - ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) GetProcAddress(CoreLibHandle, "ConfigSetDefaultFloat"); - ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) GetProcAddress(CoreLibHandle, "ConfigSetDefaultBool"); - ConfigSetDefaultString = (ptr_ConfigSetDefaultString) GetProcAddress(CoreLibHandle, "ConfigSetDefaultString"); - ConfigGetParamInt = (ptr_ConfigGetParamInt) GetProcAddress(CoreLibHandle, "ConfigGetParamInt"); - ConfigGetParamFloat = (ptr_ConfigGetParamFloat) GetProcAddress(CoreLibHandle, "ConfigGetParamFloat"); - ConfigGetParamBool = (ptr_ConfigGetParamBool) GetProcAddress(CoreLibHandle, "ConfigGetParamBool"); - ConfigGetParamString = (ptr_ConfigGetParamString) GetProcAddress(CoreLibHandle, "ConfigGetParamString"); - - l_PluginInit = 1; - return M64ERR_SUCCESS; -} - -EXPORT m64p_error CALL PluginShutdown(void) -{ - LOG("API WRAPPER:\t PluginShutdown") - OldAPI::CloseDLL(); - - D3D8_CloseDLL(); - FreeLibrary(D3D8Dll); - FreeLibrary(JaboDLL); - - writeOptionsInitflags(old_options,old_initflags); - - if (!l_PluginInit) - return M64ERR_NOT_INIT; - - /* reset some local variables */ - l_DebugCallback = NULL; - l_DebugCallContext = NULL; - - l_PluginInit = 0; - return M64ERR_SUCCESS; -} - -EXPORT int CALL RomOpen(void) -{ - LOG("API WRAPPER:\t RomOpen") - OldAPI::RomOpen(); - - remove("Project64.rdb"); - - if (!l_PluginInit) - return 0; - - return 1; -} - -EXPORT void CALL RomClosed( void ) -{ - LOG("API WRAPPER:\t RomClosed") - OldAPI::RomClosed(); - - if (!l_PluginInit) - return; -} - -#pragma endregion - -#pragma region Pluginversion -EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) -{ - LOG("API WRAPPER:\t PluginGetVersion") - - OldAPI::PLUGIN_INFO info; - OldAPI::GetDllInfo(&info); - - /* set version info */ - if (PluginType != NULL) - *PluginType = M64PLUGIN_GFX; - - if (PluginVersion != NULL) - *PluginVersion = PLUGIN_VERSION; - - if (APIVersion != NULL) - *APIVersion = VIDEO_PLUGIN_API_VERSION; - - if (PluginNamePtr != NULL) - *PluginNamePtr = PLUGIN_NAME; - - if (Capabilities != NULL) - { - *Capabilities = 0; - } - - return M64ERR_SUCCESS; -} -#pragma endregion - -// IGNORE -EXPORT void CALL ChangeWindow (void) -{ - LOG("API WRAPPER:\t ChangeWindow") -} - -// NOTE: NEW GFX_INFO vs old -EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info) -{ - LOG("API WRAPPER:\t InitiateGFX") - - Config_Open(); - - SETTINGS settings; - settings.anisotropic_level = (int)Config_ReadInt("anisotropic_level","ANISOTROPIC_FILTERING_LEVEL",0,TRUE,FALSE); - settings.brightness = (int)Config_ReadInt("brightness","Brightness level",0,TRUE,FALSE); - settings.antialiasing_level = (int)Config_ReadInt("antialiasing_level","Antialiasing level",0,TRUE,FALSE); - settings.super2xsal = (BOOL)Config_ReadInt("super2xsal","Enables Super2xSal textures",FALSE); - settings.texture_filter = (BOOL)Config_ReadInt("texture_filter","Always use texture filter",FALSE); - settings.adjust_aspect_ratio = (BOOL)Config_ReadInt("adjust_aspect_ratio","Adjust game aspect ratio to match yours",FALSE); - settings.legacy_pixel_pipeline = (BOOL)Config_ReadInt("legacy_pixel_pipeline","Use legacy pixel pipeline",FALSE); - settings.alpha_blending = (BOOL)Config_ReadInt("alpha_blending","Force alpha blending",FALSE); - - // As far as I can tell there is no way to apply this setting without opening the dll config window - //settings.wireframe = (BOOL)Config_ReadInt("wireframe","Wireframe rendering",FALSE); - - settings.direct3d_transformation_pipeline = (BOOL)Config_ReadInt("direct3d_transformation_pipeline","Use Direct3D transformation pipeline",FALSE); - settings.z_compare = (BOOL)Config_ReadInt("z_compare","Force Z Compare",FALSE); - settings.copy_framebuffer = (BOOL)Config_ReadInt("copy_framebuffer","Copy framebuffer to RDRAM",FALSE); - settings.resolution_width = (int)Config_ReadInt("resolution_width","Emulated Width",-1,TRUE,FALSE); - settings.resolution_height = (int)Config_ReadInt("resolution_height","Emulated Height",-1,TRUE,FALSE); - settings.clear_mode = (int)Config_ReadInt("clear_mode","Direct3D Clear Mode Height",0,TRUE,FALSE); - - DWORD new_options_val = 0; - if (settings.copy_framebuffer == TRUE) { new_options_val |= 0x20000000; } - if (settings.z_compare == TRUE) { new_options_val |= 0x10000000; } - if (settings.legacy_pixel_pipeline == TRUE) { new_options_val |= 0x08000000; } - if (settings.alpha_blending == TRUE) { new_options_val |= 0x04000000; } - if (settings.adjust_aspect_ratio == TRUE) { new_options_val |= 0x02000000; } - if (settings.texture_filter == TRUE) { new_options_val |= 0x01000000; } - if (settings.super2xsal == TRUE) { new_options_val |= 0x00001000; } - new_options_val |= (((settings.brightness - 100) / 3) & 0x1F) << 19; - switch (settings.antialiasing_level) - { - case 1: new_options_val |= 0x00004000; break; - case 2: new_options_val |= 0x00008000; break; - case 3: new_options_val |= 0x00010000; break; - } - switch (settings.anisotropic_level) - { - case 1: new_options_val |= 0x00000020; break; - case 2: new_options_val |= 0x00000040; break; - case 3: new_options_val |= 0x00000080; break; - case 4: new_options_val |= 0x00000100; break; - } - - int width, height; - Config_ReadScreenResolution(&width,&height); - if (width == 320 && height == 240) { new_options_val |= 0x00000000; } - else if (width == 400 && height == 300) { new_options_val |= 0x00000001; } - else if (width == 512 && height == 384) { new_options_val |= 0x00000002; } - else if (width == 640 && height == 480) { new_options_val |= 0x00000003; } - else if (width == 800 && height == 600) { new_options_val |= 0x00000004; } - else if (width == 1024 && height == 768) { new_options_val |= 0x00000005; } - else if (width == 1152 && height == 864) { new_options_val |= 0x00000006; } - else if (width == 1280 && height == 960) { new_options_val |= 0x00000007; } - else if (width == 1600 && height == 1200) { new_options_val |= 0x00000008; } - else if (width == 848 && height == 480) { new_options_val |= 0x00000009; } - else if (width == 1024 && height == 576) { new_options_val |= 0x0000000a; } - else if (width == 1380 && height == 768) { new_options_val |= 0x0000000b; } - else { /* will pick 320x240 */ } - - DWORD new_initflags_val = 0x00e00000; - if (settings.direct3d_transformation_pipeline == TRUE) { new_initflags_val = 0x00a00000; } - - readOptionsInitflags(&old_options,&old_initflags); - - writeOptionsInitflags(new_options_val,new_initflags_val); - - createRDBFile(Gfx_Info.HEADER, settings.resolution_height, settings.resolution_width, settings.clear_mode); - - OldAPI::GFX_INFO blah; - - blah.hWnd = GetDesktopWindow(); - blah.hStatusBar = NULL; - blah.MemoryBswaped = true; - - blah.HEADER = Gfx_Info.HEADER; - - blah.RDRAM = Gfx_Info.RDRAM; - blah.DMEM = Gfx_Info.DMEM; - blah.IMEM = Gfx_Info.IMEM; - - blah.MI_INTR_REG = (DWORD *)Gfx_Info.MI_INTR_REG; - - blah.DPC_START_REG = (DWORD *)Gfx_Info.DPC_START_REG; - blah.DPC_END_REG = (DWORD *)Gfx_Info.DPC_END_REG; - blah.DPC_CURRENT_REG = (DWORD *)Gfx_Info.DPC_CURRENT_REG; - blah.DPC_STATUS_REG = (DWORD *)Gfx_Info.DPC_STATUS_REG; - blah.DPC_CLOCK_REG = (DWORD *)Gfx_Info.DPC_CLOCK_REG; - blah.DPC_BUFBUSY_REG = (DWORD *)Gfx_Info.DPC_BUFBUSY_REG; - blah.DPC_PIPEBUSY_REG = (DWORD *)Gfx_Info.DPC_PIPEBUSY_REG; - blah.DPC_TMEM_REG = (DWORD *)Gfx_Info.DPC_TMEM_REG; - - blah.VI_STATUS_REG = (DWORD *)Gfx_Info.VI_STATUS_REG; - blah.VI_ORIGIN_REG = (DWORD *)Gfx_Info.VI_ORIGIN_REG; - blah.VI_WIDTH_REG = (DWORD *)Gfx_Info.VI_WIDTH_REG; - blah.VI_INTR_REG = (DWORD *)Gfx_Info.VI_INTR_REG; - blah.VI_V_CURRENT_LINE_REG = (DWORD *)Gfx_Info.VI_V_CURRENT_LINE_REG; - blah.VI_TIMING_REG = (DWORD *)Gfx_Info.VI_TIMING_REG; - blah.VI_V_SYNC_REG = (DWORD *)Gfx_Info.VI_V_SYNC_REG; - blah.VI_H_SYNC_REG = (DWORD *)Gfx_Info.VI_H_SYNC_REG; - blah.VI_LEAP_REG = (DWORD *)Gfx_Info.VI_LEAP_REG; - blah.VI_H_START_REG = (DWORD *)Gfx_Info.VI_H_START_REG; - blah.VI_V_START_REG = (DWORD *)Gfx_Info.VI_V_START_REG; - blah.VI_V_BURST_REG = (DWORD *)Gfx_Info.VI_V_BURST_REG; - blah.VI_X_SCALE_REG = (DWORD *)Gfx_Info.VI_X_SCALE_REG; - blah.VI_Y_SCALE_REG = (DWORD *)Gfx_Info.VI_Y_SCALE_REG; - - blah.CheckInterrupts = Gfx_Info.CheckInterrupts; - - OldAPI::InitiateGFX(blah); - - return(TRUE); -} - -EXPORT void CALL MoveScreen (int xpos, int ypos) -{ - LOG("API WRAPPER:\t MoveScreen") - OldAPI::MoveScreen(xpos, ypos); -} - -EXPORT void CALL ProcessDList(void) -{ - LOG("API WRAPPER:\t ProcessDList") - OldAPI::ProcessDList(); -} - -EXPORT void CALL ProcessRDPList(void) -{ - LOG("API WRAPPER:\t ProcessRDPList") - OldAPI::ProcessRDPList(); -} - -EXPORT void CALL ShowCFB(void) -{ - LOG("API WRAPPER:\t ShowCFB") - OldAPI::ShowCFB(); -} - -EXPORT void CALL UpdateScreen(void) -{ - LOG("API WRAPPER:\t UpdateScreen") - OldAPI::UpdateScreen(); -} - -EXPORT void CALL ViStatusChanged(void) -{ - LOG("API WRAPPER:\t ViStatusChanged") - OldAPI::ViStatusChanged(); -} - -EXPORT void CALL ViWidthChanged(void) -{ - LOG("API WRAPPER:\t ViWidthChanged") - OldAPI::ViWidthChanged(); -} - -EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int bFront) -{ - LOG("API WRAPPER:\t ReadScreen2") - if (D3D8_ReadScreen != NULL) - { - D3D8_ReadScreen(dest, width, height); - } -} - -EXPORT void CALL SetRenderingCallback(void (*callback)(int)) -{ - LOG("API WRAPPER:\t SetRenderingCallback") - if (D3D8_SetRenderingCallback != NULL) - { - D3D8_SetRenderingCallback(callback); - } -} - -// IMPLEMENT LATER? -EXPORT void CALL FBRead(uint32 addr) -{ - LOG("API WRAPPER:\t FBRead") -} - -// IMPLEMENT LATER? -EXPORT void CALL FBWrite(uint32 addr, uint32 size) -{ - LOG("API WRAPPER:\t FBWrite") -} - -// ??? -EXPORT void CALL FBGetFrameBufferInfo(void *p) -{ - LOG("API WRAPPER:\t FBGetFrameBufferInfo") - //FrameBufferInfo * pinfo = (FrameBufferInfo *)p; -} diff --git a/libmupen64plus/mupen64plus-video-jabo/main.h b/libmupen64plus/mupen64plus-video-jabo/main.h deleted file mode 100644 index 525bb4112d..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/main.h +++ /dev/null @@ -1,27 +0,0 @@ -/* version info */ -#define PLUGIN_NAME "Jabo Direct3D8 wrapper for Mupen64Plus" -#define PLUGIN_VERSION 0x020000 -#define VIDEO_PLUGIN_API_VERSION 0x020200 -#define CONFIG_API_VERSION 0x020000 -#define VIDEXT_API_VERSION 0x030000 -#define CONFIG_PARAM_VERSION 1.00 - -#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) - -typedef struct { - int anisotropic_level; - int brightness; - int antialiasing_level; - BOOL super2xsal; - BOOL texture_filter; - BOOL adjust_aspect_ratio; - BOOL legacy_pixel_pipeline; - BOOL alpha_blending; -// BOOL wireframe; - BOOL direct3d_transformation_pipeline; - BOOL z_compare; - BOOL copy_framebuffer; - int resolution_width; - int resolution_height; - int clear_mode; -} SETTINGS; \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-jabo/mupen64plus-video-jabo/mupen64plus-video-jabo.vcxproj b/libmupen64plus/mupen64plus-video-jabo/mupen64plus-video-jabo/mupen64plus-video-jabo.vcxproj deleted file mode 100644 index a2c1ab17c3..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/mupen64plus-video-jabo/mupen64plus-video-jabo.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {0C220B26-3D4D-431D-B829-CADE6508A771} - Win32Proj - mupen64plusvideojabo - - - - DynamicLibrary - true - v142 - MultiByte - - - DynamicLibrary - true - v142 - MultiByte - - - DynamicLibrary - false - v142 - true - MultiByte - - - DynamicLibrary - false - v142 - true - MultiByte - - - - - - - - - - - - - - - - - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - true - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - true - - - $(SolutionDir)..\..\..\..\Assets\dll\ - true - - - $(SolutionDir)..\..\..\..\Assets\dll\ - true - - - - Level3 - Disabled - true - false - ..\..\mupen64plus-core\src\api;..\..\mupen64plus-win32-deps\SDL-1.2.15\include;%(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - true - - - - - - - - - Level3 - Disabled - true - false - ..\..\mupen64plus-core\src\api;..\..\mupen64plus-win32-deps\SDL-1.2.15\include;%(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - true - - - - - - - - - Level3 - MaxSpeed - - - false - ..\..\mupen64plus-core\src\api;..\..\mupen64plus-win32-deps\SDL-1.2.15\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - true - - - true - true - true - ..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;%(AdditionalDependencies) - Windows - - - - - - - - - Level3 - MaxSpeed - - - false - ..\..\mupen64plus-core\src\api;..\..\mupen64plus-win32-deps\SDL-1.2.15\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - true - - - true - true - true - ..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;%(AdditionalDependencies) - Windows - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-jabo/typedefs.h b/libmupen64plus/mupen64plus-video-jabo/typedefs.h deleted file mode 100644 index c099a71055..0000000000 --- a/libmupen64plus/mupen64plus-video-jabo/typedefs.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _TYPEDEFS_H_ -#define _TYPEDEFS_H_ - -#define uchar unsigned char -#define uint16 unsigned short -#define uint32 unsigned int -#define uint64 unsigned long long - -typedef unsigned char uint8; - -typedef signed char s8; -typedef int s32; -typedef unsigned int u32; -typedef unsigned char u8; - -#endif - diff --git a/libmupen64plus/mupen64plus-video-rice/projects/msvc11/mupen64plus-video-rice.vcxproj b/libmupen64plus/mupen64plus-video-rice/projects/msvc/mupen64plus-video-rice.vcxproj similarity index 62% rename from libmupen64plus/mupen64plus-video-rice/projects/msvc11/mupen64plus-video-rice.vcxproj rename to libmupen64plus/mupen64plus-video-rice/projects/msvc/mupen64plus-video-rice.vcxproj index 8786207f59..479d20fadb 100644 --- a/libmupen64plus/mupen64plus-video-rice/projects/msvc11/mupen64plus-video-rice.vcxproj +++ b/libmupen64plus/mupen64plus-video-rice/projects/msvc/mupen64plus-video-rice.vcxproj @@ -1,18 +1,10 @@  - - Debug - Win32 - Debug x64 - - Release - Win32 - Release x64 @@ -24,100 +16,46 @@ Win32Proj - - DynamicLibrary - MultiByte - true - v142 - DynamicLibrary MultiByte true - v142 - - - DynamicLibrary - MultiByte - v142 + v143 DynamicLibrary MultiByte - v142 + v143 - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\..\Assets\dll\ $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ $(Configuration)\ - true true - $(SolutionDir)..\..\..\..\Assets\dll\ $(SolutionDir)..\..\..\..\Assets\dll\ - $(Configuration)\ $(Configuration)\ - false false - AllRules.ruleset AllRules.ruleset - - - AllRules.ruleset AllRules.ruleset - - - - - Disabled - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - true - - - user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\libpng.lib;%(AdditionalDependencies) - true - Windows - MachineX86 - - - - - - Disabled - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;%(AdditionalIncludeDirectories) NO_ASM;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) false EnableFastChecks @@ -129,7 +67,7 @@ true - user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64\libpng16.lib;%(AdditionalDependencies) + user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\libpng16.lib;%(AdditionalDependencies) true Windows @@ -138,34 +76,9 @@ - - - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - Default - true - - - user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\libpng.lib;%(AdditionalDependencies) - true - Windows - true - true - MachineX86 - - - - - - - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;%(AdditionalIncludeDirectories) NO_ASM;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreadedDLL @@ -176,7 +89,7 @@ true - user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\x64\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\lib\x64\libpng16.lib;%(AdditionalDependencies) + user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\libpng16.lib;%(AdditionalDependencies) true Windows true diff --git a/libmupen64plus/mupen64plus-video-rice/projects/msvc8/mupen64plus-video-rice.vcproj b/libmupen64plus/mupen64plus-video-rice/projects/msvc8/mupen64plus-video-rice.vcproj deleted file mode 100644 index 34cc0b8679..0000000000 --- a/libmupen64plus/mupen64plus-video-rice/projects/msvc8/mupen64plus-video-rice.vcproj +++ /dev/null @@ -1,652 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libmupen64plus/mupen64plus-video-rice/projects/unix/Makefile b/libmupen64plus/mupen64plus-video-rice/projects/unix/Makefile deleted file mode 100644 index da4849c7c6..0000000000 --- a/libmupen64plus/mupen64plus-video-rice/projects/unix/Makefile +++ /dev/null @@ -1,420 +0,0 @@ -#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -# * Mupen64plus-video-rice - Makefile * -# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * -# * Copyright (C) 2007-2009 Richard Goedeken * -# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation; either version 2 of the License, or * -# * (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program; if not, write to the * -# * Free Software Foundation, Inc., * -# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -# Makefile for RiceVideo plugin in Mupen64Plus - -# detect operating system -UNAME ?= $(shell uname -s) -OS := NONE -ifeq ("$(UNAME)","Linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifneq ("$(filter GNU hurd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","Darwin") - OS = OSX - SO_EXTENSION = dylib - SHARED = -bundle - PIC = 1 # force PIC under OSX -endif -ifeq ("$(UNAME)","FreeBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","OpenBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared - $(warning OS type "$(UNAME)" not officially supported.') -endif -ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") - OS = MINGW - SO_EXTENSION = dll - SHARED = -shared - PIC = 0 -endif -ifeq ("$(OS)","NONE") - $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# detect system architecture -HOST_CPU ?= $(shell uname -m) -CPU := NONE -ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") - CPU := X86 - ifeq ("$(BITS)", "32") - ARCH_DETECTED := 64BITS_32 - PIC ?= 0 - else - ARCH_DETECTED := 64BITS - PIC ?= 1 - endif -endif -ifneq ("$(filter pentium i%86,$(HOST_CPU))","") - CPU := X86 - ARCH_DETECTED := 32BITS - PIC ?= 0 -endif -ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 32BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 64BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter arm%,$(HOST_CPU))","") - ifeq ("$(filter arm%b,$(HOST_CPU))","") - CPU := ARM - ARCH_DETECTED := 32BITS - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') - endif -endif -ifeq ("$(CPU)","NONE") - $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# base CFLAGS, LDLIBS, and LDFLAGS -OPTFLAGS ?= -O3 -flto -WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -CXXFLAGS += -fvisibility-inlines-hidden -LDFLAGS += $(SHARED) - -ifeq ($(CPU), X86) - CFLAGS += -msse -endif - -# Since we are building a shared library, we must compile with -fPIC on some architectures -# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch -ifeq ($(PIC), 1) - CFLAGS += -fPIC -else - CFLAGS += -fno-PIC -endif - -ifeq ($(BIG_ENDIAN), 1) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# tweak flags for 32-bit build on 64-bit system -ifeq ($(ARCH_DETECTED), 64BITS_32) - ifeq ($(OS), FREEBSD) - $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) - endif - CFLAGS += -m32 - LDFLAGS += -Wl,-m,elf_i386 -endif - -# set special flags per-system -ifeq ($(OS), LINUX) - LDLIBS += -ldl - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver -endif -ifeq ($(OS), OSX) - #xcode-select has been around since XCode 3.0, i.e. OS X 10.5 - OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs - OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1) - - ifeq ($(CPU), X86) - ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) - LDFLAGS += -bundle - LDLIBS += -ldl - else - CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) - LDFLAGS += -bundle - LDLIBS += -ldl - endif - endif -endif - -# test for essential build dependencies -ifeq ($(origin PKG_CONFIG), undefined) - PKG_CONFIG = $(CROSS_COMPILE)pkg-config - ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) - $(error $(PKG_CONFIG) not found) - endif -endif - -ifeq ($(origin LIBPNG_CFLAGS) $(origin LIBPNG_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),) - $(error No libpng development libraries found!) - endif - LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng) - LIBPNG_LDLIBS += $(shell $(PKG_CONFIG) --libs libpng) -endif -CFLAGS += $(LIBPNG_CFLAGS) -LDLIBS += $(LIBPNG_LDLIBS) - -# search for OpenGL libraries -ifeq ($(OS), OSX) - GL_LDLIBS = -framework OpenGL -endif -ifeq ($(OS), MINGW) - GL_LDLIBS = -lopengl32 -endif -ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) - $(error No OpenGL development libraries found!) - endif - GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) - GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl) -endif -CFLAGS += $(GL_CFLAGS) -LDLIBS += $(GL_LDLIBS) - -# test for presence of SDL -ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) - SDL_CONFIG = $(CROSS_COMPILE)sdl-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - $(error No SDL development libraries found!) - endif - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs) -endif -CFLAGS += $(SDL_CFLAGS) -LDLIBS += $(SDL_LDLIBS) - -# set mupen64plus core API header path -ifneq ("$(APIDIR)","") - CFLAGS += "-I$(APIDIR)" -else - TRYDIR = ../../../mupen64plus-core/src/api - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/local/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) - endif - endif - endif -endif - -# reduced compile output when running make without V=1 -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - Q_CC = @echo ' CC '$@; - Q_CXX = @echo ' CXX '$@; - Q_LD = @echo ' LD '$@; -endif -endif - -# set base program pointers and flags -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -RM ?= rm -f -INSTALL ?= install -MKDIR ?= mkdir -p -COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -# set special flags for given Makefile parameters -ifeq ($(DEBUG),1) - CFLAGS += -g - INSTALL_STRIP_FLAG ?= -else - ifneq ($(OS),OSX) - INSTALL_STRIP_FLAG ?= -s - endif -endif -ifeq ($(NO_ASM), 1) - CFLAGS += -DNO_ASM -endif - -# set installation options -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif -ifeq ($(SHAREDIR),) - SHAREDIR := $(PREFIX)/share/mupen64plus -endif -ifeq ($(LIBDIR),) - LIBDIR := $(PREFIX)/lib -endif -ifeq ($(PLUGINDIR),) - PLUGINDIR := $(LIBDIR)/mupen64plus -endif - -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - -# list of source files to compile -SOURCE = \ - $(SRCDIR)/liblinux/BMGImage.c \ - $(SRCDIR)/liblinux/BMGUtils.cpp \ - $(SRCDIR)/liblinux/bmp.c \ - $(SRCDIR)/liblinux/pngrw.c \ - $(SRCDIR)/Blender.cpp \ - $(SRCDIR)/Combiner.cpp \ - $(SRCDIR)/CombinerTable.cpp \ - $(SRCDIR)/Config.cpp \ - $(SRCDIR)/ConvertImage.cpp \ - $(SRCDIR)/ConvertImage16.cpp \ - $(SRCDIR)/CNvTNTCombiner.cpp \ - $(SRCDIR)/Debugger.cpp \ - $(SRCDIR)/DecodedMux.cpp \ - $(SRCDIR)/DirectXDecodedMux.cpp \ - $(SRCDIR)/DeviceBuilder.cpp \ - $(SRCDIR)/FrameBuffer.cpp \ - $(SRCDIR)/GeneralCombiner.cpp \ - $(SRCDIR)/GraphicsContext.cpp \ - $(SRCDIR)/OGLCombiner.cpp \ - $(SRCDIR)/OGLCombinerNV.cpp \ - $(SRCDIR)/OGLCombinerTNT2.cpp \ - $(SRCDIR)/OGLDecodedMux.cpp \ - $(SRCDIR)/OGLExtCombiner.cpp \ - $(SRCDIR)/OGLExtensions.cpp \ - $(SRCDIR)/OGLExtRender.cpp \ - $(SRCDIR)/OGLFragmentShaders.cpp \ - $(SRCDIR)/OGLGraphicsContext.cpp \ - $(SRCDIR)/OGLRender.cpp \ - $(SRCDIR)/OGLRenderExt.cpp \ - $(SRCDIR)/OGLTexture.cpp \ - $(SRCDIR)/Render.cpp \ - $(SRCDIR)/RenderBase.cpp \ - $(SRCDIR)/RenderExt.cpp \ - $(SRCDIR)/RenderTexture.cpp \ - $(SRCDIR)/RSP_Parser.cpp \ - $(SRCDIR)/RSP_S2DEX.cpp \ - $(SRCDIR)/Texture.cpp \ - $(SRCDIR)/TextureFilters.cpp \ - $(SRCDIR)/TextureFilters_2xsai.cpp \ - $(SRCDIR)/TextureFilters_hq2x.cpp \ - $(SRCDIR)/TextureFilters_hq4x.cpp \ - $(SRCDIR)/TextureManager.cpp \ - $(SRCDIR)/VectorMath.cpp \ - $(SRCDIR)/Video.cpp - -ifeq ($(OS),MINGW) -SOURCE += \ - $(SRCDIR)/osal_dynamiclib_win32.c \ - $(SRCDIR)/osal_files_win32.c -else -SOURCE += \ - $(SRCDIR)/osal_dynamiclib_unix.c \ - $(SRCDIR)/osal_files_unix.c -endif - -# generate a list of object files build, make a temporary directory for them -OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) -OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) -OBJDIRS = $(dir $(OBJECTS)) -$(shell $(MKDIR) $(OBJDIRS)) - -# build targets -TARGET = mupen64plus-video-rice$(POSTFIX).$(SO_EXTENSION) - -targets: - @echo "Mupen64plus-video-rice N64 Graphics plugin makefile. " - @echo " Targets:" - @echo " all == Build Mupen64plus-video-rice plugin" - @echo " clean == remove object files" - @echo " rebuild == clean and re-build all" - @echo " install == Install Mupen64Plus-video-rice plugin" - @echo " uninstall == Uninstall Mupen64Plus-video-rice plugin" - @echo " Options:" - @echo " BITS=32 == build 32-bit binaries on 64-bit machine" - @echo " NO_ASM=1 == build without inline assembly code (x86 MMX/SSE)" - @echo " APIDIR=path == path to find Mupen64Plus Core headers" - @echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)" - @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" - @echo " PIC=(1|0) == Force enable/disable of position independent code" - @echo " POSTFIX=name == String added to the name of the the build (default: '')" - @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" - @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" - @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" - @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" - @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" - @echo " Debugging Options:" - @echo " DEBUG=1 == add debugging symbols" - @echo " V=1 == show verbose compiler output" - -all: $(TARGET) - -install: $(TARGET) - $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" - $(INSTALL) -m 0644 "../../data/RiceVideoLinux.ini" "$(DESTDIR)$(SHAREDIR)" - -uninstall: - $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" - $(RM) "$(DESTDIR)$(SHAREDIR)/RiceVideoLinux.ini" - -clean: - $(RM) -r $(OBJDIR) $(TARGET) - -rebuild: clean all - -# build dependency files -CFLAGS += -MD --include $(OBJECTS:.o=.d) - -CXXFLAGS += $(CFLAGS) - -# standard build rules -$(OBJDIR)/%.o: $(SRCDIR)/%.c - $(COMPILE.c) -o $@ $< - -$(OBJDIR)/%.o: $(SRCDIR)/%.cpp - $(COMPILE.cc) -o $@ $< - -$(TARGET): $(OBJECTS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-video-z64/COPYING b/libmupen64plus/mupen64plus-video-z64/COPYING deleted file mode 100644 index d511905c16..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/libmupen64plus/mupen64plus-video-z64/projects/msvc11/mupen64plus-video-z64.vcxproj b/libmupen64plus/mupen64plus-video-z64/projects/msvc11/mupen64plus-video-z64.vcxproj deleted file mode 100644 index 184b84b16a..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/projects/msvc11/mupen64plus-video-z64.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7708C1D2-3303-4F90-BCE8-3BCE4046BFD7} - Win32Proj - mupen64plusvideoz64 - - - - DynamicLibrary - true - Unicode - v142 - - - DynamicLibrary - true - Unicode - v142 - - - DynamicLibrary - false - true - Unicode - v142 - - - DynamicLibrary - false - true - Unicode - v142 - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)..\..\..\..\Assets\dll\ - - - true - $(SolutionDir)..\..\..\..\Assets\dll\ - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - - - false - $(SolutionDir)..\..\..\..\Assets\dll\ - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;MUPEN64PLUSVIDEOZ64_EXPORTS;%(PreprocessorDefinitions) - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\glew-1.10.0\include\GL - 4996;4005;4244 - - - Windows - true - - - opengl32.lib;..\..\..\mupen64plus-win32-deps\glew-1.10.0\lib\Release\Win32\glew32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib - - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;MUPEN64PLUSVIDEOZ64_EXPORTS;%(PreprocessorDefinitions) - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\glew-1.10.0\include\GL - 4996;4005;4244 - - - Windows - true - - - opengl32.lib;..\..\..\mupen64plus-win32-deps\glew-1.10.0\lib\Release\Win32\glew32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib - - - - - Level3 - NotUsing - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;MUPEN64PLUSVIDEOZ64_EXPORTS;%(PreprocessorDefinitions) - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\glew-1.10.0\include\GL - 4996;4005;4244 - - - Windows - true - true - true - opengl32.lib;..\..\..\mupen64plus-win32-deps\glew-1.10.0\lib\Release\Win32\glew32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib - - - - - - - Level3 - NotUsing - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;MUPEN64PLUSVIDEOZ64_EXPORTS;%(PreprocessorDefinitions) - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.18\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\glew-1.10.0\include\GL - 4996;4005;4244 - - - Windows - true - true - true - opengl32.lib;..\..\..\mupen64plus-win32-deps\glew-1.10.0\lib\Release\Win32\glew32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.15\lib\SDL.lib - - - - - - - - \ No newline at end of file diff --git a/libmupen64plus/mupen64plus-video-z64/projects/unix/Makefile b/libmupen64plus/mupen64plus-video-z64/projects/unix/Makefile deleted file mode 100644 index 1f622274fa..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/projects/unix/Makefile +++ /dev/null @@ -1,391 +0,0 @@ -#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -# * Mupen64plus-video-z64 - Makefile * -# * https://github.com/mupen64plus/mupen64plus-video-z64/ * -# * Copyright (C) 2010 Jon Ring * -# * Copyright (C) 2007-2009 Richard Goedeken * -# * Copyright (C) 2007-2008 DarkJeztr Tillin9 * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU General Public License as published by * -# * the Free Software Foundation; either version 2 of the License, or * -# * (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details. * -# * * -# * You should have received a copy of the GNU General Public License * -# * along with this program; if not, write to the * -# * Free Software Foundation, Inc., * -# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -# Makefile for Z64 Video plugin in Mupen64Plus - -# detect operating system -UNAME ?= $(shell uname -s) -OS := NONE -ifeq ("$(UNAME)","Linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","linux") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifneq ("$(filter GNU hurd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","Darwin") - OS = OSX - SO_EXTENSION = dylib - SHARED = -bundle -endif -ifeq ("$(UNAME)","FreeBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(UNAME)","OpenBSD") - OS = FREEBSD - SO_EXTENSION = so - SHARED = -shared - $(warning OS type "$(UNAME)" not officially supported.') -endif -ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","") - OS = LINUX - SO_EXTENSION = so - SHARED = -shared -endif -ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW") - OS = MINGW - SO_EXTENSION = dll - SHARED = -shared - PIC = 0 -endif -ifeq ("$(OS)","NONE") - $(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# detect system architecture -HOST_CPU ?= $(shell uname -m) -CPU := NONE -ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","") - CPU := X86 - ifeq ("$(BITS)", "32") - ARCH_DETECTED := 64BITS_32 - PIC ?= 0 - else - ARCH_DETECTED := 64BITS - PIC ?= 1 - endif -endif -ifneq ("$(filter pentium i%86,$(HOST_CPU))","") - CPU := X86 - ARCH_DETECTED := 32BITS - PIC ?= 0 -endif -ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 32BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","") - CPU := PPC - ARCH_DETECTED := 64BITS - BIG_ENDIAN := 1 - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') -endif -ifneq ("$(filter arm%,$(HOST_CPU))","") - ifeq ("$(filter arm%b,$(HOST_CPU))","") - CPU := ARM - ARCH_DETECTED := 32BITS - PIC ?= 1 - NO_ASM := 1 - $(warning Architecture "$(HOST_CPU)" not officially supported.') - endif -endif -ifeq ("$(CPU)","NONE") - $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') -endif - -# base CFLAGS, LDLIBS, and LDFLAGS -OPTFLAGS ?= -O3 -flto -WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -CXXFLAGS += -fvisibility-inlines-hidden -LDFLAGS += $(SHARED) - -# Since we are building a shared library, we must compile with -fPIC on some architectures -# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch -ifeq ($(PIC), 1) - CFLAGS += -fPIC -else - CFLAGS += -fno-PIC -endif - -ifeq ($(BIG_ENDIAN), 1) - CFLAGS += -DM64P_BIG_ENDIAN -endif - -# tweak flags for 32-bit build on 64-bit system -ifeq ($(ARCH_DETECTED), 64BITS_32) - ifeq ($(OS), FREEBSD) - $(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386) - endif - CFLAGS += -m32 - LDFLAGS += -Wl,-m,elf_i386 -endif - -# set special flags per-system -ifeq ($(OS), LINUX) - # only export api symbols - LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver -endif -ifeq ($(OS), OSX) - # Select the proper SDK - # Also, SDKs are stored in a different location since XCode 4.3 - OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .) - OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .) - OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .) - OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`") - ifeq ($(OSX_XCODEGE43), 11) - OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs - else - OSX_SYSROOT := /Developer/SDKs - endif - - ifeq ($(CPU), X86) - ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk - LDFLAGS += -bundle - LDLIBS += -ldl - else - CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk - LDFLAGS += -bundle - LDLIBS += -ldl - endif - endif -endif -ifeq ($(OS), LINUX) - LDLIBS += -ldl -endif -ifeq ($(OS), FREEBSD) - LDLIBS += -lc -endif - -# test for essential build dependencies -ifeq ($(origin PKG_CONFIG), undefined) - PKG_CONFIG = $(CROSS_COMPILE)pkg-config - ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) - $(error $(PKG_CONFIG) not found) - endif -endif - -ifeq ($(origin GLEW_CFLAGS) $(origin GLEW_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion glew 2>/dev/null),) - $(error No GLEW development libraries found!) - endif - GLEW_CFLAGS += $(shell $(PKG_CONFIG) --cflags glew) - GLEW_LDLIBS += $(shell $(PKG_CONFIG) --libs glew) -endif -CFLAGS += $(GLEW_CFLAGS) -LDLIBS += $(GLEW_LDLIBS) - -# search for OpenGL libraries -ifeq ($(OS), OSX) - GL_LDLIBS = -framework OpenGL -endif -ifeq ($(OS), MINGW) - GL_LDLIBS = -lopengl32 -endif -ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined) - ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),) - $(error No OpenGL development libraries found!) - endif - GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl) - GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl) -endif -CFLAGS += $(GL_CFLAGS) -LDLIBS += $(GL_LDLIBS) - -# test for presence of SDL -ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) - SDL_CONFIG = $(CROSS_COMPILE)sdl-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - $(error No SDL development libraries found!) - endif - ifeq ($(OS),OSX) - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - # sdl-config on mac screws up when we're trying to build a library and not an executable - # SDL 1.3 is supposed to fix that, if it's ever released - SDL_LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa - else - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs) - endif -endif -CFLAGS += $(SDL_CFLAGS) -LDLIBS += $(SDL_LDLIBS) - -# set mupen64plus core API header path -ifneq ("$(APIDIR)","") - CFLAGS += "-I$(APIDIR)" -else - TRYDIR = ../../../mupen64plus-core/src/api - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/local/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - TRYDIR = /usr/include/mupen64plus - ifneq ("$(wildcard $(TRYDIR)/m64p_types.h)","") - CFLAGS += -I$(TRYDIR) - else - $(error Mupen64Plus API header files not found! Use makefile parameter APIDIR to force a location.) - endif - endif - endif -endif - -# reduced compile output when running make without V=1 -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - Q_CC = @echo ' CC '$@; - Q_CXX = @echo ' CXX '$@; - Q_LD = @echo ' LD '$@; -endif -endif - -# set base program pointers and flags -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -RM ?= rm -f -INSTALL ?= install -MKDIR ?= mkdir -p -COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -# set special flags for given Makefile parameters -ifeq ($(DEBUG),1) - CFLAGS += -g - INSTALL_STRIP_FLAG ?= -else - INSTALL_STRIP_FLAG ?= -s -endif - -# set installation options -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif -ifeq ($(SHAREDIR),) - SHAREDIR := $(PREFIX)/share/mupen64plus -endif -ifeq ($(LIBDIR),) - LIBDIR := $(PREFIX)/lib -endif -ifeq ($(PLUGINDIR),) - PLUGINDIR := $(LIBDIR)/mupen64plus -endif - -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - -# list of source files to compile -SOURCE = \ - $(SRCDIR)/rgl.cpp \ - $(SRCDIR)/rgl_settings.cpp \ - $(SRCDIR)/rgl_tiles.cpp \ - $(SRCDIR)/rgl_rendermode.cpp \ - $(SRCDIR)/rgl_geometry.cpp \ - $(SRCDIR)/rgl_debugger.cpp \ - $(SRCDIR)/rgl_osdep.cpp \ - $(SRCDIR)/rdp.cpp \ - $(SRCDIR)/glshader.cpp \ - $(SRCDIR)/disasm.cpp \ - $(SRCDIR)/maingl.cpp - -ifeq ($(OS),MINGW) -SOURCE += $(SRCDIR)/osal_dynamiclib_win32.c -else -SOURCE += $(SRCDIR)/osal_dynamiclib_unix.c -endif - -# generate a list of object files build, make a temporary directory for them -OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE))) -OBJECTS += $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE))) -OBJDIRS = $(dir $(OBJECTS)) -$(shell $(MKDIR) $(OBJDIRS)) - -# build targets -TARGET = mupen64plus-video-z64$(POSTFIX).$(SO_EXTENSION) - -targets: - @echo "Mupen64plus-video-z64 N64 Graphics plugin makefile. " - @echo " Targets:" - @echo " all == Build Mupen64plus-video-z64 plugin" - @echo " clean == remove object files" - @echo " rebuild == clean and re-build all" - @echo " install == Install Mupen64Plus-video-z64 plugin" - @echo " uninstall == Uninstall Mupen64Plus-video-z64 plugin" - @echo " Options:" - @echo " BITS=32 == build 32-bit binaries on 64-bit machine" - @echo " APIDIR=path == path to find Mupen64Plus Core headers" - @echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)" - @echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)" - @echo " PIC=(1|0) == Force enable/disable of position independent code" - @echo " POSTFIX=name == String added to the name of the the build (default: '')" - @echo " Install Options:" - @echo " PREFIX=path == install/uninstall prefix (default: /usr/local)" - @echo " SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)" - @echo " LIBDIR=path == library prefix (default: PREFIX/lib)" - @echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)" - @echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)" - @echo " Debugging Options:" - @echo " DEBUG=1 == add debugging symbols" - @echo " V=1 == show verbose compiler output" - -all: $(TARGET) - -install: $(TARGET) - $(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)" - $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" - -uninstall: - $(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)" - -clean: - $(RM) -r $(OBJDIR) $(TARGET) - -rebuild: clean all - -# build dependency files -CFLAGS += -MD -MP --include $(OBJECTS:.o=.d) - -CXXFLAGS += $(CFLAGS) - -# standard build rules -$(OBJDIR)/%.o: $(SRCDIR)/%.c - $(COMPILE.c) -o $@ $< - -$(OBJDIR)/%.o: $(SRCDIR)/%.cpp - $(COMPILE.cc) -o $@ $< - -$(TARGET): $(OBJECTS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -.PHONY: all clean install uninstall targets diff --git a/libmupen64plus/mupen64plus-video-z64/src/disasm.cpp b/libmupen64plus/mupen64plus-video-z64/src/disasm.cpp deleted file mode 100644 index 98515c5dc0..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/disasm.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "z64.h" -#include - -static const char *image_format[] = { "RGBA", "YUV", "CI", "IA", "I", "???", "???", "???" }; -static const char *image_size[] = { "4-bit", "8-bit", "16-bit", "32-bit" }; - -static const int rdp_command_length[64] = -{ - 8, // 0x00, No Op - 8, // 0x01, ??? - 8, // 0x02, ??? - 8, // 0x03, ??? - 8, // 0x04, ??? - 8, // 0x05, ??? - 8, // 0x06, ??? - 8, // 0x07, ??? - 32, // 0x08, Non-Shaded Triangle - 32+16, // 0x09, Non-Shaded, Z-Buffered Triangle - 32+64, // 0x0a, Textured Triangle - 32+64+16, // 0x0b, Textured, Z-Buffered Triangle - 32+64, // 0x0c, Shaded Triangle - 32+64+16, // 0x0d, Shaded, Z-Buffered Triangle - 32+64+64, // 0x0e, Shaded+Textured Triangle - 32+64+64+16,// 0x0f, Shaded+Textured, Z-Buffered Triangle - 8, // 0x10, ??? - 8, // 0x11, ??? - 8, // 0x12, ??? - 8, // 0x13, ??? - 8, // 0x14, ??? - 8, // 0x15, ??? - 8, // 0x16, ??? - 8, // 0x17, ??? - 8, // 0x18, ??? - 8, // 0x19, ??? - 8, // 0x1a, ??? - 8, // 0x1b, ??? - 8, // 0x1c, ??? - 8, // 0x1d, ??? - 8, // 0x1e, ??? - 8, // 0x1f, ??? - 8, // 0x20, ??? - 8, // 0x21, ??? - 8, // 0x22, ??? - 8, // 0x23, ??? - 16, // 0x24, Texture_Rectangle - 16, // 0x25, Texture_Rectangle_Flip - 8, // 0x26, Sync_Load - 8, // 0x27, Sync_Pipe - 8, // 0x28, Sync_Tile - 8, // 0x29, Sync_Full - 8, // 0x2a, Set_Key_GB - 8, // 0x2b, Set_Key_R - 8, // 0x2c, Set_Convert - 8, // 0x2d, Set_Scissor - 8, // 0x2e, Set_Prim_Depth - 8, // 0x2f, Set_Other_Modes - 8, // 0x30, Load_TLUT - 8, // 0x31, ??? - 8, // 0x32, Set_Tile_Size - 8, // 0x33, Load_Block - 8, // 0x34, Load_Tile - 8, // 0x35, Set_Tile - 8, // 0x36, Fill_Rectangle - 8, // 0x37, Set_Fill_Color - 8, // 0x38, Set_Fog_Color - 8, // 0x39, Set_Blend_Color - 8, // 0x3a, Set_Prim_Color - 8, // 0x3b, Set_Env_Color - 8, // 0x3c, Set_Combine - 8, // 0x3d, Set_Texture_Image - 8, // 0x3e, Set_Mask_Image - 8 // 0x3f, Set_Color_Image -}; - -int rdp_dasm(UINT32 * rdp_cmd_data, int rdp_cmd_cur, int length, char *buffer) -{ - //int i; - int tile; - const char *format, *size; - char sl[32], tl[32], sh[32], th[32]; - char s[32], t[32];//, w[32]; - char dsdx[32], dtdy[32]; -#if 0 - char dsdx[32], dtdx[32], dwdx[32]; - char dsdy[32], dtdy[32], dwdy[32]; - char dsde[32], dtde[32], dwde[32]; - char yl[32], yh[32], ym[32], xl[32], xh[32], xm[32]; - char dxldy[32], dxhdy[32], dxmdy[32]; - char rt[32], gt[32], bt[32], at[32]; - char drdx[32], dgdx[32], dbdx[32], dadx[32]; - char drdy[32], dgdy[32], dbdy[32], dady[32]; - char drde[32], dgde[32], dbde[32], dade[32]; -#endif - UINT32 r,g,b,a; - - UINT32 cmd[64]; - UINT32 command; - - if (length < 8) - { - sprintf(buffer, "ERROR: length = %d\n", length); - return 0; - } - - cmd[0] = rdp_cmd_data[rdp_cmd_cur+0]; - cmd[1] = rdp_cmd_data[rdp_cmd_cur+1]; - - tile = (cmd[1] >> 24) & 0x7; - sprintf(sl, "%4.2f", (float)((cmd[0] >> 12) & 0xfff) / 4.0f); - sprintf(tl, "%4.2f", (float)((cmd[0] >> 0) & 0xfff) / 4.0f); - sprintf(sh, "%4.2f", (float)((cmd[1] >> 12) & 0xfff) / 4.0f); - sprintf(th, "%4.2f", (float)((cmd[1] >> 0) & 0xfff) / 4.0f); - - format = image_format[(cmd[0] >> 21) & 0x7]; - size = image_size[(cmd[0] >> 19) & 0x3]; - - r = (cmd[1] >> 24) & 0xff; - g = (cmd[1] >> 16) & 0xff; - b = (cmd[1] >> 8) & 0xff; - a = (cmd[1] >> 0) & 0xff; - - command = (cmd[0] >> 24) & 0x3f; - //printf("command %x\n", command); - switch (command) - { - case 0x00: sprintf(buffer, "No Op"); break; - case 0x08: - sprintf(buffer, "Tri_NoShade (%08X %08X)", cmd[0], cmd[1]); break; - case 0x0a: - sprintf(buffer, "Tri_Tex (%08X %08X)", cmd[0], cmd[1]); break; - case 0x0c: - sprintf(buffer, "Tri_Shade (%08X %08X)", cmd[0], cmd[1]); break; - case 0x0e: - sprintf(buffer, "Tri_TexShade (%08X %08X)", cmd[0], cmd[1]); break; - case 0x09: - sprintf(buffer, "TriZ_NoShade (%08X %08X)", cmd[0], cmd[1]); break; - case 0x0b: - sprintf(buffer, "TriZ_Tex (%08X %08X)", cmd[0], cmd[1]); break; - case 0x0d: - sprintf(buffer, "TriZ_Shade (%08X %08X)", cmd[0], cmd[1]); break; - case 0x0f: - sprintf(buffer, "TriZ_TexShade (%08X %08X)", cmd[0], cmd[1]); break; - -#if 0 - case 0x08: // Tri_NoShade - { - int lft = (command >> 23) & 0x1; - - if (length < rdp_command_length[command]) - { - sprintf(buffer, "ERROR: Tri_NoShade length = %d\n", length); - return 0; - } - - cmd[2] = rdp_cmd_data[rdp_cmd_cur+2]; - cmd[3] = rdp_cmd_data[rdp_cmd_cur+3]; - cmd[4] = rdp_cmd_data[rdp_cmd_cur+4]; - cmd[5] = rdp_cmd_data[rdp_cmd_cur+5]; - cmd[6] = rdp_cmd_data[rdp_cmd_cur+6]; - cmd[7] = rdp_cmd_data[rdp_cmd_cur+7]; - - sprintf(yl, "%4.4f", (float)((cmd[0] >> 0) & 0x1fff) / 4.0f); - sprintf(ym, "%4.4f", (float)((cmd[1] >> 16) & 0x1fff) / 4.0f); - sprintf(yh, "%4.4f", (float)((cmd[1] >> 0) & 0x1fff) / 4.0f); - sprintf(xl, "%4.4f", (float)(cmd[2] / 65536.0f)); - sprintf(dxldy, "%4.4f", (float)(cmd[3] / 65536.0f)); - sprintf(xh, "%4.4f", (float)(cmd[4] / 65536.0f)); - sprintf(dxhdy, "%4.4f", (float)(cmd[5] / 65536.0f)); - sprintf(xm, "%4.4f", (float)(cmd[6] / 65536.0f)); - sprintf(dxmdy, "%4.4f", (float)(cmd[7] / 65536.0f)); - - sprintf(buffer, "Tri_NoShade %d, XL: %s, XM: %s, XH: %s, YL: %s, YM: %s, YH: %s\n", lft, xl,xm,xh,yl,ym,yh); - break; - } - case 0x0a: // Tri_Tex - { - int lft = (command >> 23) & 0x1; - - if (length < rdp_command_length[command]) - { - sprintf(buffer, "ERROR: Tri_Tex length = %d\n", length); - return 0; - } - - for (i=2; i < 24; i++) - { - cmd[i] = rdp_cmd_data[rdp_cmd_cur+i]; - } - - sprintf(yl, "%4.4f", (float)((cmd[0] >> 0) & 0x1fff) / 4.0f); - sprintf(ym, "%4.4f", (float)((cmd[1] >> 16) & 0x1fff) / 4.0f); - sprintf(yh, "%4.4f", (float)((cmd[1] >> 0) & 0x1fff) / 4.0f); - sprintf(xl, "%4.4f", (float)((INT32)cmd[2] / 65536.0f)); - sprintf(dxldy, "%4.4f", (float)((INT32)cmd[3] / 65536.0f)); - sprintf(xh, "%4.4f", (float)((INT32)cmd[4] / 65536.0f)); - sprintf(dxhdy, "%4.4f", (float)((INT32)cmd[5] / 65536.0f)); - sprintf(xm, "%4.4f", (float)((INT32)cmd[6] / 65536.0f)); - sprintf(dxmdy, "%4.4f", (float)((INT32)cmd[7] / 65536.0f)); - - sprintf(s, "%4.4f", (float)(INT32)((cmd[ 8] & 0xffff0000) | ((cmd[12] >> 16) & 0xffff)) / 65536.0f); - sprintf(t, "%4.4f", (float)(INT32)(((cmd[ 8] & 0xffff) << 16) | (cmd[12] & 0xffff)) / 65536.0f); - sprintf(w, "%4.4f", (float)(INT32)((cmd[ 9] & 0xffff0000) | ((cmd[13] >> 16) & 0xffff)) / 65536.0f); - sprintf(dsdx, "%4.4f", (float)(INT32)((cmd[10] & 0xffff0000) | ((cmd[14] >> 16) & 0xffff)) / 65536.0f); - sprintf(dtdx, "%4.4f", (float)(INT32)(((cmd[10] & 0xffff) << 16) | (cmd[14] & 0xffff)) / 65536.0f); - sprintf(dwdx, "%4.4f", (float)(INT32)((cmd[11] & 0xffff0000) | ((cmd[15] >> 16) & 0xffff)) / 65536.0f); - sprintf(dsde, "%4.4f", (float)(INT32)((cmd[16] & 0xffff0000) | ((cmd[20] >> 16) & 0xffff)) / 65536.0f); - sprintf(dtde, "%4.4f", (float)(INT32)(((cmd[16] & 0xffff) << 16) | (cmd[20] & 0xffff)) / 65536.0f); - sprintf(dwde, "%4.4f", (float)(INT32)((cmd[17] & 0xffff0000) | ((cmd[21] >> 16) & 0xffff)) / 65536.0f); - sprintf(dsdy, "%4.4f", (float)(INT32)((cmd[18] & 0xffff0000) | ((cmd[22] >> 16) & 0xffff)) / 65536.0f); - sprintf(dtdy, "%4.4f", (float)(INT32)(((cmd[18] & 0xffff) << 16) | (cmd[22] & 0xffff)) / 65536.0f); - sprintf(dwdy, "%4.4f", (float)(INT32)((cmd[19] & 0xffff0000) | ((cmd[23] >> 16) & 0xffff)) / 65536.0f); - - - buffer+=sprintf(buffer, "Tri_Tex %d, XL: %s, XM: %s, XH: %s, YL: %s, YM: %s, YH: %s\n", lft, xl,xm,xh,yl,ym,yh); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " S: %s, T: %s, W: %s\n", s, t, w); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DSDX: %s, DTDX: %s, DWDX: %s\n", dsdx, dtdx, dwdx); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DSDE: %s, DTDE: %s, DWDE: %s\n", dsde, dtde, dwde); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DSDY: %s, DTDY: %s, DWDY: %s\n", dsdy, dtdy, dwdy); - break; - } - case 0x0c: // Tri_Shade - { - int lft = (command >> 23) & 0x1; - - if (length < rdp_command_length[command]) - { - sprintf(buffer, "ERROR: Tri_Shade length = %d\n", length); - return 0; - } - - for (i=2; i < 24; i++) - { - cmd[i] = rdp_cmd_data[i]; - } - - sprintf(yl, "%4.4f", (float)((cmd[0] >> 0) & 0x1fff) / 4.0f); - sprintf(ym, "%4.4f", (float)((cmd[1] >> 16) & 0x1fff) / 4.0f); - sprintf(yh, "%4.4f", (float)((cmd[1] >> 0) & 0x1fff) / 4.0f); - sprintf(xl, "%4.4f", (float)((INT32)cmd[2] / 65536.0f)); - sprintf(dxldy, "%4.4f", (float)((INT32)cmd[3] / 65536.0f)); - sprintf(xh, "%4.4f", (float)((INT32)cmd[4] / 65536.0f)); - sprintf(dxhdy, "%4.4f", (float)((INT32)cmd[5] / 65536.0f)); - sprintf(xm, "%4.4f", (float)((INT32)cmd[6] / 65536.0f)); - sprintf(dxmdy, "%4.4f", (float)((INT32)cmd[7] / 65536.0f)); - sprintf(rt, "%4.4f", (float)(INT32)((cmd[8] & 0xffff0000) | ((cmd[12] >> 16) & 0xffff)) / 65536.0f); - sprintf(gt, "%4.4f", (float)(INT32)(((cmd[8] & 0xffff) << 16) | (cmd[12] & 0xffff)) / 65536.0f); - sprintf(bt, "%4.4f", (float)(INT32)((cmd[9] & 0xffff0000) | ((cmd[13] >> 16) & 0xffff)) / 65536.0f); - sprintf(at, "%4.4f", (float)(INT32)(((cmd[9] & 0xffff) << 16) | (cmd[13] & 0xffff)) / 65536.0f); - sprintf(drdx, "%4.4f", (float)(INT32)((cmd[10] & 0xffff0000) | ((cmd[14] >> 16) & 0xffff)) / 65536.0f); - sprintf(dgdx, "%4.4f", (float)(INT32)(((cmd[10] & 0xffff) << 16) | (cmd[14] & 0xffff)) / 65536.0f); - sprintf(dbdx, "%4.4f", (float)(INT32)((cmd[11] & 0xffff0000) | ((cmd[15] >> 16) & 0xffff)) / 65536.0f); - sprintf(dadx, "%4.4f", (float)(INT32)(((cmd[11] & 0xffff) << 16) | (cmd[15] & 0xffff)) / 65536.0f); - sprintf(drde, "%4.4f", (float)(INT32)((cmd[16] & 0xffff0000) | ((cmd[20] >> 16) & 0xffff)) / 65536.0f); - sprintf(dgde, "%4.4f", (float)(INT32)(((cmd[16] & 0xffff) << 16) | (cmd[20] & 0xffff)) / 65536.0f); - sprintf(dbde, "%4.4f", (float)(INT32)((cmd[17] & 0xffff0000) | ((cmd[21] >> 16) & 0xffff)) / 65536.0f); - sprintf(dade, "%4.4f", (float)(INT32)(((cmd[17] & 0xffff) << 16) | (cmd[21] & 0xffff)) / 65536.0f); - sprintf(drdy, "%4.4f", (float)(INT32)((cmd[18] & 0xffff0000) | ((cmd[22] >> 16) & 0xffff)) / 65536.0f); - sprintf(dgdy, "%4.4f", (float)(INT32)(((cmd[18] & 0xffff) << 16) | (cmd[22] & 0xffff)) / 65536.0f); - sprintf(dbdy, "%4.4f", (float)(INT32)((cmd[19] & 0xffff0000) | ((cmd[23] >> 16) & 0xffff)) / 65536.0f); - sprintf(dady, "%4.4f", (float)(INT32)(((cmd[19] & 0xffff) << 16) | (cmd[23] & 0xffff)) / 65536.0f); - - buffer+=sprintf(buffer, "Tri_Shade %d, XL: %s, XM: %s, XH: %s, YL: %s, YM: %s, YH: %s\n", lft, xl,xm,xh,yl,ym,yh); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " R: %s, G: %s, B: %s, A: %s\n", rt, gt, bt, at); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DRDX: %s, DGDX: %s, DBDX: %s, DADX: %s\n", drdx, dgdx, dbdx, dadx); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DRDE: %s, DGDE: %s, DBDE: %s, DADE: %s\n", drde, dgde, dbde, dade); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DRDY: %s, DGDY: %s, DBDY: %s, DADY: %s\n", drdy, dgdy, dbdy, dady); - break; - } - case 0x0e: // Tri_TexShade - { - int lft = (command >> 23) & 0x1; - - if (length < rdp_command_length[command]) - { - sprintf(buffer, "ERROR: Tri_TexShade length = %d\n", length); - return 0; - } - - for (i=2; i < 40; i++) - { - cmd[i] = rdp_cmd_data[rdp_cmd_cur+i]; - } - - sprintf(yl, "%4.4f", (float)((cmd[0] >> 0) & 0x1fff) / 4.0f); - sprintf(ym, "%4.4f", (float)((cmd[1] >> 16) & 0x1fff) / 4.0f); - sprintf(yh, "%4.4f", (float)((cmd[1] >> 0) & 0x1fff) / 4.0f); - sprintf(xl, "%4.4f", (float)((INT32)cmd[2] / 65536.0f)); - sprintf(dxldy, "%4.4f", (float)((INT32)cmd[3] / 65536.0f)); - sprintf(xh, "%4.4f", (float)((INT32)cmd[4] / 65536.0f)); - sprintf(dxhdy, "%4.4f", (float)((INT32)cmd[5] / 65536.0f)); - sprintf(xm, "%4.4f", (float)((INT32)cmd[6] / 65536.0f)); - sprintf(dxmdy, "%4.4f", (float)((INT32)cmd[7] / 65536.0f)); - sprintf(rt, "%4.4f", (float)(INT32)((cmd[8] & 0xffff0000) | ((cmd[12] >> 16) & 0xffff)) / 65536.0f); - sprintf(gt, "%4.4f", (float)(INT32)(((cmd[8] & 0xffff) << 16) | (cmd[12] & 0xffff)) / 65536.0f); - sprintf(bt, "%4.4f", (float)(INT32)((cmd[9] & 0xffff0000) | ((cmd[13] >> 16) & 0xffff)) / 65536.0f); - sprintf(at, "%4.4f", (float)(INT32)(((cmd[9] & 0xffff) << 16) | (cmd[13] & 0xffff)) / 65536.0f); - sprintf(drdx, "%4.4f", (float)(INT32)((cmd[10] & 0xffff0000) | ((cmd[14] >> 16) & 0xffff)) / 65536.0f); - sprintf(dgdx, "%4.4f", (float)(INT32)(((cmd[10] & 0xffff) << 16) | (cmd[14] & 0xffff)) / 65536.0f); - sprintf(dbdx, "%4.4f", (float)(INT32)((cmd[11] & 0xffff0000) | ((cmd[15] >> 16) & 0xffff)) / 65536.0f); - sprintf(dadx, "%4.4f", (float)(INT32)(((cmd[11] & 0xffff) << 16) | (cmd[15] & 0xffff)) / 65536.0f); - sprintf(drde, "%4.4f", (float)(INT32)((cmd[16] & 0xffff0000) | ((cmd[20] >> 16) & 0xffff)) / 65536.0f); - sprintf(dgde, "%4.4f", (float)(INT32)(((cmd[16] & 0xffff) << 16) | (cmd[20] & 0xffff)) / 65536.0f); - sprintf(dbde, "%4.4f", (float)(INT32)((cmd[17] & 0xffff0000) | ((cmd[21] >> 16) & 0xffff)) / 65536.0f); - sprintf(dade, "%4.4f", (float)(INT32)(((cmd[17] & 0xffff) << 16) | (cmd[21] & 0xffff)) / 65536.0f); - sprintf(drdy, "%4.4f", (float)(INT32)((cmd[18] & 0xffff0000) | ((cmd[22] >> 16) & 0xffff)) / 65536.0f); - sprintf(dgdy, "%4.4f", (float)(INT32)(((cmd[18] & 0xffff) << 16) | (cmd[22] & 0xffff)) / 65536.0f); - sprintf(dbdy, "%4.4f", (float)(INT32)((cmd[19] & 0xffff0000) | ((cmd[23] >> 16) & 0xffff)) / 65536.0f); - sprintf(dady, "%4.4f", (float)(INT32)(((cmd[19] & 0xffff) << 16) | (cmd[23] & 0xffff)) / 65536.0f); - - sprintf(s, "%4.4f", (float)(INT32)((cmd[24] & 0xffff0000) | ((cmd[28] >> 16) & 0xffff)) / 65536.0f); - sprintf(t, "%4.4f", (float)(INT32)(((cmd[24] & 0xffff) << 16) | (cmd[28] & 0xffff)) / 65536.0f); - sprintf(w, "%4.4f", (float)(INT32)((cmd[25] & 0xffff0000) | ((cmd[29] >> 16) & 0xffff)) / 65536.0f); - sprintf(dsdx, "%4.4f", (float)(INT32)((cmd[26] & 0xffff0000) | ((cmd[30] >> 16) & 0xffff)) / 65536.0f); - sprintf(dtdx, "%4.4f", (float)(INT32)(((cmd[26] & 0xffff) << 16) | (cmd[30] & 0xffff)) / 65536.0f); - sprintf(dwdx, "%4.4f", (float)(INT32)((cmd[27] & 0xffff0000) | ((cmd[31] >> 16) & 0xffff)) / 65536.0f); - sprintf(dsde, "%4.4f", (float)(INT32)((cmd[32] & 0xffff0000) | ((cmd[36] >> 16) & 0xffff)) / 65536.0f); - sprintf(dtde, "%4.4f", (float)(INT32)(((cmd[32] & 0xffff) << 16) | (cmd[36] & 0xffff)) / 65536.0f); - sprintf(dwde, "%4.4f", (float)(INT32)((cmd[33] & 0xffff0000) | ((cmd[37] >> 16) & 0xffff)) / 65536.0f); - sprintf(dsdy, "%4.4f", (float)(INT32)((cmd[34] & 0xffff0000) | ((cmd[38] >> 16) & 0xffff)) / 65536.0f); - sprintf(dtdy, "%4.4f", (float)(INT32)(((cmd[34] & 0xffff) << 16) | (cmd[38] & 0xffff)) / 65536.0f); - sprintf(dwdy, "%4.4f", (float)(INT32)((cmd[35] & 0xffff0000) | ((cmd[39] >> 16) & 0xffff)) / 65536.0f); - - - buffer+=sprintf(buffer, "Tri_TexShade %d, XL: %s, XM: %s, XH: %s, YL: %s, YM: %s, YH: %s\n", lft, xl,xm,xh,yl,ym,yh); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " R: %s, G: %s, B: %s, A: %s\n", rt, gt, bt, at); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DRDX: %s, DGDX: %s, DBDX: %s, DADX: %s\n", drdx, dgdx, dbdx, dadx); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DRDE: %s, DGDE: %s, DBDE: %s, DADE: %s\n", drde, dgde, dbde, dade); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DRDY: %s, DGDY: %s, DBDY: %s, DADY: %s\n", drdy, dgdy, dbdy, dady); - - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " S: %s, T: %s, W: %s\n", s, t, w); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DSDX: %s, DTDX: %s, DWDX: %s\n", dsdx, dtdx, dwdx); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DSDE: %s, DTDE: %s, DWDE: %s\n", dsde, dtde, dwde); - buffer+=sprintf(buffer, " "); - buffer+=sprintf(buffer, " DSDY: %s, DTDY: %s, DWDY: %s\n", dsdy, dtdy, dwdy); - break; - } -#endif - case 0x24: - case 0x25: - { - if (length < 16) - { - sprintf(buffer, "ERROR: Texture_Rectangle length = %d\n", length); - return 0; - } - cmd[2] = rdp_cmd_data[rdp_cmd_cur+2]; - cmd[3] = rdp_cmd_data[rdp_cmd_cur+3]; - sprintf(s, "%4.4f", (float)(INT16)((cmd[2] >> 16) & 0xffff) / 32.0f); - sprintf(t, "%4.4f", (float)(INT16)((cmd[2] >> 0) & 0xffff) / 32.0f); - sprintf(dsdx, "%4.4f", (float)(INT16)((cmd[3] >> 16) & 0xffff) / 1024.0f); - sprintf(dtdy, "%4.4f", (float)(INT16)((cmd[3] >> 16) & 0xffff) / 1024.0f); - - if (command == 0x24) - sprintf(buffer, "Texture_Rectangle %d, %s, %s, %s, %s, %s, %s, %s, %s", tile, sh, th, sl, tl, s, t, dsdx, dtdy); - else - sprintf(buffer, "Texture_Rectangle_Flip %d, %s, %s, %s, %s, %s, %s, %s, %s", tile, sh, th, sl, tl, s, t, dsdx, dtdy); - - break; - } - case 0x26: sprintf(buffer, "Sync_Load"); break; - case 0x27: sprintf(buffer, "Sync_Pipe"); break; - case 0x28: sprintf(buffer, "Sync_Tile"); break; - case 0x29: sprintf(buffer, "Sync_Full"); break; - case 0x2d: sprintf(buffer, "Set_Scissor %s, %s, %s, %s", sl, tl, sh, th); break; - case 0x2e: sprintf(buffer, "Set_Prim_Depth %04X, %04X", (cmd[1] >> 16) & 0xffff, cmd[1] & 0xffff); break; - case 0x2f: sprintf(buffer, "Set_Other_Modes %08X %08X", cmd[0], cmd[1]); break; - case 0x30: sprintf(buffer, "Load_TLUT %d, %s, %s, %s, %s", tile, sl, tl, sh, th); break; - case 0x32: sprintf(buffer, "Set_Tile_Size %d, %s, %s, %s, %s", tile, sl, tl, sh, th); break; - case 0x33: sprintf(buffer, "Load_Block %d, %03X, %03X, %03X, %03X", tile, (cmd[0] >> 12) & 0xfff, cmd[0] & 0xfff, (cmd[1] >> 12) & 0xfff, cmd[1] & 0xfff); break; - case 0x34: sprintf(buffer, "Load_Tile %d, %s, %s, %s, %s", tile, sl, tl, sh, th); break; - case 0x35: sprintf(buffer, "Set_Tile %d, %s, %s, %d, %04X", tile, format, size, ((cmd[0] >> 9) & 0x1ff) * 8, (cmd[0] & 0x1ff) * 8); break; - case 0x36: sprintf(buffer, "Fill_Rectangle %s, %s, %s, %s", sh, th, sl, tl); break; - case 0x37: sprintf(buffer, "Set_Fill_Color R: %d, G: %d, B: %d, A: %d", r, g, b, a); break; - case 0x38: sprintf(buffer, "Set_Fog_Color R: %d, G: %d, B: %d, A: %d", r, g, b, a); break; - case 0x39: sprintf(buffer, "Set_Blend_Color R: %d, G: %d, B: %d, A: %d", r, g, b, a); break; - case 0x3a: sprintf(buffer, "Set_Prim_Color %d, %d, R: %d, G: %d, B: %d, A: %d", (cmd[0] >> 8) & 0x1f, cmd[0] & 0xff, r, g, b, a); break; - case 0x3b: sprintf(buffer, "Set_Env_Color R: %d, G: %d, B: %d, A: %d", r, g, b, a); break; - case 0x3c: sprintf(buffer, "Set_Combine %08X %08X", cmd[0], cmd[1]); break; - case 0x3d: sprintf(buffer, "Set_Texture_Image %s, %s, %d, %08X", format, size, (cmd[0] & 0x1ff)+1, cmd[1]); break; - case 0x3e: sprintf(buffer, "Set_Mask_Image %08X", cmd[1]); break; - case 0x3f: sprintf(buffer, "Set_Color_Image %s, %s, %d, %08X", format, size, (cmd[0] & 0x1ff)+1, cmd[1]); break; - default: sprintf(buffer, "??? (%08X %08X)", cmd[0], cmd[1]); break; - } - - return rdp_command_length[command]; -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/glshader.cpp b/libmupen64plus/mupen64plus-video-z64/src/glshader.cpp deleted file mode 100644 index 47299451ed..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/glshader.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include -#include -#include -#include "rgl_assert.h" -#include -#if defined(__MACOSX__) -#include -#include -#elif defined(__MACOS__) -#include -#include -#else -#include -#ifndef WIN32 - #include -#endif -#endif -#include "glshader.h" - -static void printInfoLog(GLhandleARB obj, const char * src) -{ - int infologLength = 0; - int charsWritten = 0; - char *infoLog; - - glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, - &infologLength); - - if (infologLength > 0) - { - infoLog = (char *)malloc(infologLength); - glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog); - if (*infoLog) - rdp_log(M64MSG_INFO, "%s\n%s", src, infoLog); - free(infoLog); - } -} - -//#define rglAssert(...) -rglShader_t * rglCreateShader(const char * vsrc, const char * fsrc) -{ - GLhandleARB vs, fs, prog; - - //printf("Compiling shader :\n%s", fsrc); - - vs = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); - rglAssert(glGetError() == GL_NO_ERROR); - fs = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); - rglAssert(glGetError() == GL_NO_ERROR); - - glShaderSourceARB(vs, 1, &vsrc,NULL); - rglAssert(glGetError() == GL_NO_ERROR); - glShaderSourceARB(fs, 1, &fsrc,NULL); - rglAssert(glGetError() == GL_NO_ERROR); - glCompileShaderARB(vs); - rglAssert(glGetError() == GL_NO_ERROR); - glCompileShaderARB(fs); - rglAssert(glGetError() == GL_NO_ERROR); - printInfoLog(vs, vsrc); - printInfoLog(fs, fsrc); - prog = glCreateProgramObjectARB(); - glAttachObjectARB(prog, fs); - rglAssert(glGetError() == GL_NO_ERROR); - glAttachObjectARB(prog, vs); - rglAssert(glGetError() == GL_NO_ERROR); - - glLinkProgramARB(prog); - rglAssert(glGetError() == GL_NO_ERROR); - - rglShader_t * s = (rglShader_t *) malloc(sizeof(rglShader_t)); - s->vs = vs; - s->fs = fs; - s->prog = prog; - //LOG("Creating shader %d %d %d\n", s->vs, s->fs, s->prog); -#ifdef RDP_DEBUG - s->vsrc = strdup(vsrc); - s->fsrc = strdup(fsrc); -#endif - return s; -} - -void rglUseShader(rglShader_t * shader) -{ - if (!shader) - glUseProgramObjectARB(0); - else - glUseProgramObjectARB(shader->prog); -} - -void rglDeleteShader(rglShader_t * shader) -{ - //LOG("Deleting shader %d %d %d\n", shader->vs, shader->fs, shader->prog); - glDeleteObjectARB(shader->prog); - rglAssert(glGetError() == GL_NO_ERROR); - glDeleteObjectARB(shader->vs); - rglAssert(glGetError() == GL_NO_ERROR); - glDeleteObjectARB(shader->fs); - rglAssert(glGetError() == GL_NO_ERROR); - free(shader); -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/glshader.h b/libmupen64plus/mupen64plus-video-z64/src/glshader.h deleted file mode 100644 index e445657471..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/glshader.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#ifndef _GLSHADER_H_ -#define _GLSHADER_H_ - -#include "rdp.h" - -typedef struct { - GLhandleARB vs, fs, prog; -#ifdef RDP_DEBUG - const char * vsrc, * fsrc; -#endif -} rglShader_t; - -rglShader_t * rglCreateShader(const char * vsrc, const char * fsrc); -void rglUseShader(rglShader_t * shader); -void rglDeleteShader(rglShader_t * shader); - -#endif diff --git a/libmupen64plus/mupen64plus-video-z64/src/maingl.cpp b/libmupen64plus/mupen64plus-video-z64/src/maingl.cpp deleted file mode 100644 index fcec523bcf..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/maingl.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" -#include "osal_dynamiclib.h" -#include - -#define THREADED - -#define PLUGIN_VERSION 0x020000 -#define VIDEO_PLUGIN_API_VERSION 0x020200 -#define CONFIG_API_VERSION 0x020000 -#define VIDEXT_API_VERSION 0x030000 - -#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff) - -GFX_INFO gfx; - -void (*render_callback)(int) = NULL; -static void (*l_DebugCallback)(void *, int, const char *) = NULL; -static void *l_DebugCallContext = NULL; - - -/* definitions of pointers to Core video extension functions */ -ptr_VidExt_Init CoreVideo_Init = NULL; -ptr_VidExt_Quit CoreVideo_Quit = NULL; -ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL; -ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL; -ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL; -ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL; -ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL; -ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL; -ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL; -ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL; - -/* definitions of pointers to Core config functions */ -ptr_ConfigOpenSection ConfigOpenSection = NULL; -ptr_ConfigSetParameter ConfigSetParameter = NULL; -ptr_ConfigGetParameter ConfigGetParameter = NULL; -ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL; -ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL; -ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL; -ptr_ConfigSetDefaultBool ConfigSetDefaultBool = NULL; -ptr_ConfigSetDefaultString ConfigSetDefaultString = NULL; -ptr_ConfigGetParamInt ConfigGetParamInt = NULL; -ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL; -ptr_ConfigGetParamBool ConfigGetParamBool = NULL; -ptr_ConfigGetParamString ConfigGetParamString = NULL; - -#ifdef THREADED -volatile static int waiting; -SDL_sem * rdpCommandSema; -SDL_sem * rdpCommandCompleteSema; -SDL_Thread * rdpThread; -int rdpThreadFunc(void * dummy) -{ - while (1) { - SDL_SemWait(rdpCommandSema); - waiting = 1; - if (rglNextStatus == RGL_STATUS_CLOSED) - rglUpdateStatus(); - else - rdp_process_list(); - if (!rglSettings.async) - SDL_SemPost(rdpCommandCompleteSema); - - if (rglStatus == RGL_STATUS_CLOSED) { - rdpThread = NULL; - return 0; - } - } - return 0; -} - -void rdpSignalFullSync() -{ - SDL_SemPost(rdpCommandCompleteSema); -} -void rdpWaitFullSync() -{ - SDL_SemWait(rdpCommandCompleteSema); -} - -void rdpPostCommand() -{ - int sync = rdp_store_list(); - SDL_SemPost(rdpCommandSema); - if (!rglSettings.async) - SDL_SemWait(rdpCommandCompleteSema); - else if (sync) { - rdpWaitFullSync(); - *gfx.MI_INTR_REG |= 0x20; - gfx.CheckInterrupts(); - } - - waiting = 0; -} - -void rdpCreateThread() -{ - if (!rdpCommandSema) { - rdpCommandSema = SDL_CreateSemaphore(0); - rdpCommandCompleteSema = SDL_CreateSemaphore(0); - } - if (!rdpThread) { - LOG("Creating rdp thread\n"); -#if SDL_VERSION_ATLEAST(2,0,0) - rdpThread = SDL_CreateThread(rdpThreadFunc, "z64rdp", 0); -#else - rdpThread = SDL_CreateThread(rdpThreadFunc, 0); -#endif - } -} -#endif - -void rdp_log(m64p_msg_level level, const char *msg, ...) -{ - char buf[1024]; - va_list args; - va_start(args, msg); - vsnprintf(buf, 1023, msg, args); - buf[1023]='\0'; - va_end(args); - if (l_DebugCallback) - { - l_DebugCallback(l_DebugCallContext, level, buf); - } -} - -#ifdef __cplusplus -extern "C" { -#endif - - EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, - void (*DebugCallback)(void *, int, const char *)) - { - ///* first thing is to set the callback function for debug info */ - l_DebugCallback = DebugCallback; - l_DebugCallContext = Context; - - /* Get the core Video Extension function pointers from the library handle */ - CoreVideo_Init = (ptr_VidExt_Init) osal_dynlib_getproc(CoreLibHandle, "VidExt_Init"); - CoreVideo_Quit = (ptr_VidExt_Quit) osal_dynlib_getproc(CoreLibHandle, "VidExt_Quit"); - CoreVideo_ListFullscreenModes = (ptr_VidExt_ListFullscreenModes) osal_dynlib_getproc(CoreLibHandle, "VidExt_ListFullscreenModes"); - CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetVideoMode"); - CoreVideo_SetCaption = (ptr_VidExt_SetCaption) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetCaption"); - CoreVideo_ToggleFullScreen = (ptr_VidExt_ToggleFullScreen) osal_dynlib_getproc(CoreLibHandle, "VidExt_ToggleFullScreen"); - CoreVideo_ResizeWindow = (ptr_VidExt_ResizeWindow) osal_dynlib_getproc(CoreLibHandle, "VidExt_ResizeWindow"); - CoreVideo_GL_GetProcAddress = (ptr_VidExt_GL_GetProcAddress) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetProcAddress"); - CoreVideo_GL_SetAttribute = (ptr_VidExt_GL_SetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SetAttribute"); - CoreVideo_GL_SwapBuffers = (ptr_VidExt_GL_SwapBuffers) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SwapBuffers"); - - if (!CoreVideo_Init || !CoreVideo_Quit || !CoreVideo_ListFullscreenModes || !CoreVideo_SetVideoMode || - !CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress || - !CoreVideo_GL_SetAttribute || !CoreVideo_GL_SwapBuffers || !CoreVideo_ResizeWindow) - { - rdp_log(M64MSG_ERROR, "Couldn't connect to Core video functions"); - return M64ERR_INCOMPATIBLE; - } - - /* attach and call the CoreGetAPIVersions function, check Config and Video Extension API versions for compatibility */ - ptr_CoreGetAPIVersions CoreAPIVersionFunc; - CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreLibHandle, "CoreGetAPIVersions"); - if (CoreAPIVersionFunc == NULL) - { - rdp_log(M64MSG_ERROR, "Core emulator broken; no CoreAPIVersionFunc() function found."); - return M64ERR_INCOMPATIBLE; - } - int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion; - (*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL); - if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000)) - { - rdp_log(M64MSG_ERROR, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", - VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION)); - return M64ERR_INCOMPATIBLE; - } - if ((VidextAPIVersion & 0xffff0000) != (VIDEXT_API_VERSION & 0xffff0000)) - { - rdp_log(M64MSG_ERROR, "Emulator core Video Extension API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)", - VERSION_PRINTF_SPLIT(VidextAPIVersion), VERSION_PRINTF_SPLIT(VIDEXT_API_VERSION)); - return M64ERR_INCOMPATIBLE; - } - - /* Get the core config function pointers from the library handle */ - ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection"); - ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter"); - ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParameter"); - ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultInt"); - ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultFloat"); - ConfigSetDefaultBool = (ptr_ConfigSetDefaultBool) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultBool"); - ConfigSetDefaultString = (ptr_ConfigSetDefaultString) osal_dynlib_getproc(CoreLibHandle, "ConfigSetDefaultString"); - ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamInt"); - ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamFloat"); - ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamBool"); - ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParamString"); - if (!ConfigOpenSection || !ConfigSetParameter || !ConfigGetParameter || - !ConfigSetDefaultInt || !ConfigSetDefaultFloat || !ConfigSetDefaultBool || !ConfigSetDefaultString || - !ConfigGetParamInt || !ConfigGetParamFloat || !ConfigGetParamBool || !ConfigGetParamString) - { - rdp_log(M64MSG_ERROR, "Couldn't connect to Core configuration functions"); - return M64ERR_INCOMPATIBLE; - } - - rglReadSettings(); - - return M64ERR_SUCCESS; - } - - EXPORT m64p_error CALL PluginShutdown(void) - { - return M64ERR_SUCCESS; - } - - EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities) - { - /* set version info */ - if (PluginType != NULL) - *PluginType = M64PLUGIN_GFX; - - if (PluginVersion != NULL) - *PluginVersion = PLUGIN_VERSION; - - if (APIVersion != NULL) - *APIVersion = VIDEO_PLUGIN_API_VERSION; - - if (PluginNamePtr != NULL) - *PluginNamePtr = "Z64gl"; - - if (Capabilities != NULL) - { - *Capabilities = 0; - } - - return M64ERR_SUCCESS; - } - - EXPORT void CALL SetRenderingCallback(void (*callback)(int)) - { - render_callback = callback; - } - - EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front) - { - LOG("ReadScreen\n"); - *width = rglSettings.resX; - *height = rglSettings.resY; - if (dest) - { - GLint oldMode; - glGetIntegerv( GL_READ_BUFFER, &oldMode ); - if (front) - glReadBuffer( GL_FRONT ); - else - glReadBuffer( GL_BACK ); - glReadPixels( 0, 0, rglSettings.resX, rglSettings.resY, - GL_BGRA, GL_UNSIGNED_BYTE, dest ); - glReadBuffer( oldMode ); - } - } - - EXPORT int CALL InitiateGFX (GFX_INFO Gfx_Info) - { - LOG("InitiateGFX\n"); - gfx = Gfx_Info; - memset(rdpTiles, 0, sizeof(rdpTiles)); - memset(rdpTmem, 0, 0x1000); - memset(&rdpState, 0, sizeof(rdpState)); -#ifdef THREADED - if (rglSettings.threaded) - rdpCreateThread(); -#endif - return true; - } - - EXPORT void CALL MoveScreen (int xpos, int ypos) - { - } - - EXPORT void CALL ChangeWindow() - { - } - - EXPORT void CALL ProcessDList(void) - { - } - - - EXPORT void CALL ProcessRDPList(void) - { -#ifdef THREADED - if (rglSettings.threaded) { - rdpCreateThread(); - rdpPostCommand(); - } else -#endif - { - rdp_process_list(); - } - - return; - } - - EXPORT void CALL ResizeVideoOutput(int Width, int Height) - { - } - - EXPORT void CALL RomClosed (void) - { -#ifdef THREADED - if (rglSettings.threaded) { - rglNextStatus = RGL_STATUS_CLOSED; - do - rdpPostCommand(); - while (rglStatus != RGL_STATUS_CLOSED); - } else -#endif - { - rglNextStatus = rglStatus = RGL_STATUS_CLOSED; - rglCloseScreen(); - } - } - - EXPORT int CALL RomOpen() - { - int success = 1; -#ifdef THREADED - if (rglSettings.threaded) { - rdpCreateThread(); - //while (rglStatus != RGL_STATUS_CLOSED); - rglNextStatus = RGL_STATUS_WINDOWED; - } - else -#endif - { - rglNextStatus = rglStatus = RGL_STATUS_WINDOWED; - success = rglOpenScreen(); - } - return success; - } - - EXPORT void CALL ShowCFB (void) - { - } - - EXPORT void CALL UpdateScreen (void) - { -#ifdef THREADED - if (rglSettings.threaded) { - rdpPostCommand(); - } else -#endif - { - rglUpdate(); - } - } - - EXPORT void CALL ViStatusChanged (void) - { - } - - EXPORT void CALL ViWidthChanged (void) - { - } - -#ifdef __cplusplus -} -#endif - diff --git a/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib.h b/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib.h deleted file mode 100644 index c24377b178..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib.h +++ /dev/null @@ -1,38 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Mupen64plus-core - osal/dynamiclib.h * - * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * - * Copyright (C) 2009 Richard Goedeken * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#if !defined(OSAL_DYNAMICLIB_H) -#define OSAL_DYNAMICLIB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "m64p_types.h" - -void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName); - -#ifdef __cplusplus -} -#endif - -#endif /* #define OSAL_DYNAMICLIB_H */ - diff --git a/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib_unix.c b/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib_unix.c deleted file mode 100644 index b3b7ba52dc..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib_unix.c +++ /dev/null @@ -1,37 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Mupen64plus-core - osal/dynamiclib_unix.c * - * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * - * Copyright (C) 2009 Richard Goedeken * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include - -#include "m64p_types.h" -#include "osal_dynamiclib.h" - -void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) -{ - if (pccProcedureName == NULL) - return NULL; - - return dlsym(LibHandle, pccProcedureName); -} - - diff --git a/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib_win32.c b/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib_win32.c deleted file mode 100644 index 685d717c99..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/osal_dynamiclib_win32.c +++ /dev/null @@ -1,74 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Mupen64plus-ui-console - osal_dynamiclib_win32.c * - * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * - * Copyright (C) 2009 Richard Goedeken * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include - -#include "m64p_types.h" -#include "osal_dynamiclib.h" - -m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) -{ - if (pLibHandle == NULL || pccLibraryPath == NULL) - return M64ERR_INPUT_ASSERT; - - *pLibHandle = LoadLibrary(pccLibraryPath); - - if (*pLibHandle == NULL) - { - char *pchErrMsg; - DWORD dwErr = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); - fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg); - LocalFree(pchErrMsg); - return M64ERR_INPUT_NOT_FOUND; - } - - return M64ERR_SUCCESS; -} - -void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) -{ - if (pccProcedureName == NULL) - return NULL; - - return GetProcAddress(LibHandle, pccProcedureName); -} - -m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) -{ - int rval = FreeLibrary(LibHandle); - - if (rval == 0) - { - char *pchErrMsg; - DWORD dwErr = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); - fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg); - LocalFree(pchErrMsg); - return M64ERR_INTERNAL; - } - - return M64ERR_SUCCESS; -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/queue.h b/libmupen64plus/mupen64plus-video-z64/src/queue.h deleted file mode 100644 index d3956c894a..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/queue.h +++ /dev/null @@ -1,557 +0,0 @@ -/* - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - */ - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -/* - * This file defines five types of data structures: singly-linked lists, - * lists, simple queues, tail queues, and circular queues. - * - * A singly-linked list is headed by a single forward pointer. The - * elements are singly linked for minimum space and pointer manipulation - * overhead at the expense of O(n) removal for arbitrary elements. New - * elements can be added to the list after an existing element or at the - * head of the list. Elements being removed from the head of the list - * should use the explicit macro for this purpose for optimum - * efficiency. A singly-linked list may only be traversed in the forward - * direction. Singly-linked lists are ideal for applications with large - * datasets and few or no removals or for implementing a LIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may only be traversed in the forward direction. - * - * A simple queue is headed by a pair of pointers, one the head of the - * list and the other to the tail of the list. The elements are singly - * linked to save space, so elements can only be removed from the - * head of the list. New elements can be added to the list after - * an existing element, at the head of the list, or at the end of the - * list. A simple queue may only be traversed in the forward direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * A circle queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or after - * an existing element, at the head of the list, or at the end of the list. - * A circle queue may be traversed in either direction, but has a more - * complex end of list detection. - * - * For details on the use of these macros, see the queue(3) manual page. - */ - -/* - * List definitions. - */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ -#define LIST_INIT(head) do { \ - (head)->lh_first = NULL; \ -} while (/*CONSTCOND*/0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ - (listelm)->field.le_next->field.le_prev = \ - &(elm)->field.le_next; \ - (listelm)->field.le_next = (elm); \ - (elm)->field.le_prev = &(listelm)->field.le_next; \ -} while (/*CONSTCOND*/0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - (elm)->field.le_next = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &(elm)->field.le_next; \ -} while (/*CONSTCOND*/0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.le_next = (head)->lh_first) != NULL) \ - (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ - (head)->lh_first = (elm); \ - (elm)->field.le_prev = &(head)->lh_first; \ -} while (/*CONSTCOND*/0) - -#define LIST_REMOVE(elm, field) do { \ - if ((elm)->field.le_next != NULL) \ - (elm)->field.le_next->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = (elm)->field.le_next; \ -} while (/*CONSTCOND*/0) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = ((head)->lh_first); \ - (var); \ - (var) = ((var)->field.le_next)) - -/* - * List access methods. - */ -#define LIST_EMPTY(head) ((head)->lh_first == NULL) -#define LIST_FIRST(head) ((head)->lh_first) -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - - -/* - * Singly-linked List definitions. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_INIT(head) do { \ - (head)->slh_first = NULL; \ -} while (/*CONSTCOND*/0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - (elm)->field.sle_next = (slistelm)->field.sle_next; \ - (slistelm)->field.sle_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - (elm)->field.sle_next = (head)->slh_first; \ - (head)->slh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - (head)->slh_first = (head)->slh_first->field.sle_next; \ -} while (/*CONSTCOND*/0) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - if ((head)->slh_first == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = (head)->slh_first; \ - while(curelm->field.sle_next != (elm)) \ - curelm = curelm->field.sle_next; \ - curelm->field.sle_next = \ - curelm->field.sle_next->field.sle_next; \ - } \ -} while (/*CONSTCOND*/0) - -#define SLIST_FOREACH(var, head, field) \ - for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) - -/* - * Singly-linked List access methods. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) -#define SLIST_FIRST(head) ((head)->slh_first) -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first; /* first element */ \ - struct type **stqh_last; /* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_INIT(head) do { \ - (head)->stqh_first = NULL; \ - (head)->stqh_last = &(head)->stqh_first; \ -} while (/*CONSTCOND*/0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ - (head)->stqh_last = &(elm)->field.stqe_next; \ - (head)->stqh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.stqe_next = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &(elm)->field.stqe_next; \ -} while (/*CONSTCOND*/0) - -#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ - (head)->stqh_last = &(elm)->field.stqe_next; \ - (listelm)->field.stqe_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ - (head)->stqh_last = &(head)->stqh_first; \ -} while (/*CONSTCOND*/0) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - if ((head)->stqh_first == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } else { \ - struct type *curelm = (head)->stqh_first; \ - while (curelm->field.stqe_next != (elm)) \ - curelm = curelm->field.stqe_next; \ - if ((curelm->field.stqe_next = \ - curelm->field.stqe_next->field.stqe_next) == NULL) \ - (head)->stqh_last = &(curelm)->field.stqe_next; \ - } \ -} while (/*CONSTCOND*/0) - -#define STAILQ_FOREACH(var, head, field) \ - for ((var) = ((head)->stqh_first); \ - (var); \ - (var) = ((var)->field.stqe_next)) - -/* - * Singly-linked Tail queue access methods. - */ -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) -#define STAILQ_FIRST(head) ((head)->stqh_first) -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - - -/* - * Simple queue definitions. - */ -#define SIMPLEQ_HEAD(name, type) \ -struct name { \ - struct type *sqh_first; /* first element */ \ - struct type **sqh_last; /* addr of last next element */ \ -} - -#define SIMPLEQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).sqh_first } - -#define SIMPLEQ_ENTRY(type) \ -struct { \ - struct type *sqe_next; /* next element */ \ -} - -/* - * Simple queue functions. - */ -#define SIMPLEQ_INIT(head) do { \ - (head)->sqh_first = NULL; \ - (head)->sqh_last = &(head)->sqh_first; \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ - (head)->sqh_last = &(elm)->field.sqe_next; \ - (head)->sqh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.sqe_next = NULL; \ - *(head)->sqh_last = (elm); \ - (head)->sqh_last = &(elm)->field.sqe_next; \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ - (head)->sqh_last = &(elm)->field.sqe_next; \ - (listelm)->field.sqe_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ - if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ - (head)->sqh_last = &(head)->sqh_first; \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ - if ((head)->sqh_first == (elm)) { \ - SIMPLEQ_REMOVE_HEAD((head), field); \ - } else { \ - struct type *curelm = (head)->sqh_first; \ - while (curelm->field.sqe_next != (elm)) \ - curelm = curelm->field.sqe_next; \ - if ((curelm->field.sqe_next = \ - curelm->field.sqe_next->field.sqe_next) == NULL) \ - (head)->sqh_last = &(curelm)->field.sqe_next; \ - } \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_FOREACH(var, head, field) \ - for ((var) = ((head)->sqh_first); \ - (var); \ - (var) = ((var)->field.sqe_next)) - -/* - * Simple queue access methods. - */ -#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) -#define SIMPLEQ_FIRST(head) ((head)->sqh_first) -#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) - - -/* - * Tail queue definitions. - */ -#define _TAILQ_HEAD(name, type, qual) \ -struct name { \ - qual type *tqh_first; /* first element */ \ - qual type *qual *tqh_last; /* addr of last next element */ \ -} -#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } - -#define _TAILQ_ENTRY(type, qual) \ -struct { \ - qual type *tqe_next; /* next element */ \ - qual type *qual *tqe_prev; /* address of previous next element */\ -} -#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) - -/* - * Tail queue functions. - */ -#define TAILQ_INIT(head) do { \ - (head)->tqh_first = NULL; \ - (head)->tqh_last = &(head)->tqh_first; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ - (head)->tqh_first->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (head)->tqh_first = (elm); \ - (elm)->field.tqe_prev = &(head)->tqh_first; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.tqe_next = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &(elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ - (elm)->field.tqe_next->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (listelm)->field.tqe_next = (elm); \ - (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - (elm)->field.tqe_next = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_REMOVE(head, elm, field) do { \ - if (((elm)->field.tqe_next) != NULL) \ - (elm)->field.tqe_next->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = ((head)->tqh_first); \ - (var); \ - (var) = ((var)->field.tqe_next)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ - (var); \ - (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) - -/* - * Tail queue access methods. - */ -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) -#define TAILQ_FIRST(head) ((head)->tqh_first) -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - - -/* - * Circular queue definitions. - */ -#define CIRCLEQ_HEAD(name, type) \ -struct name { \ - struct type *cqh_first; /* first element */ \ - struct type *cqh_last; /* last element */ \ -} - -#define CIRCLEQ_HEAD_INITIALIZER(type, head) \ - { (type *)&head, (type *)&head } - -#define CIRCLEQ_ENTRY(type) \ -struct { \ - struct type *cqe_next; /* next element */ \ - struct type *cqe_prev; /* previous element */ \ -} - -/* - * Circular queue functions. - */ -#define CIRCLEQ_INIT(type, head) do { \ - (head)->cqh_first = (type *)(head); \ - (head)->cqh_last = (type *)(head); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_AFTER(type, head, listelm, elm, field) do { \ - (elm)->field.cqe_next = (listelm)->field.cqe_next; \ - (elm)->field.cqe_prev = (listelm); \ - if ((listelm)->field.cqe_next == (type *)(head)) \ - (head)->cqh_last = (elm); \ - else \ - (listelm)->field.cqe_next->field.cqe_prev = (elm); \ - (listelm)->field.cqe_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_BEFORE(type, head, listelm, elm, field) do { \ - (elm)->field.cqe_next = (listelm); \ - (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ - if ((listelm)->field.cqe_prev == (type *)(head)) \ - (head)->cqh_first = (elm); \ - else \ - (listelm)->field.cqe_prev->field.cqe_next = (elm); \ - (listelm)->field.cqe_prev = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_HEAD(type, head, elm, field) do { \ - (elm)->field.cqe_next = (head)->cqh_first; \ - (elm)->field.cqe_prev = (type *)(head); \ - if ((head)->cqh_last == (type *)(head)) \ - (head)->cqh_last = (elm); \ - else \ - (head)->cqh_first->field.cqe_prev = (elm); \ - (head)->cqh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_TAIL(type, head, elm, field) do { \ - (elm)->field.cqe_next = (type *)(head); \ - (elm)->field.cqe_prev = (head)->cqh_last; \ - if ((head)->cqh_first == (type *)(head)) \ - (head)->cqh_first = (elm); \ - else \ - (head)->cqh_last->field.cqe_next = (elm); \ - (head)->cqh_last = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_REMOVE(head, elm, field) do { \ - if ((elm)->field.cqe_next == (void *)(head)) \ - (head)->cqh_last = (elm)->field.cqe_prev; \ - else \ - (elm)->field.cqe_next->field.cqe_prev = \ - (elm)->field.cqe_prev; \ - if ((elm)->field.cqe_prev == (void *)(head)) \ - (head)->cqh_first = (elm)->field.cqe_next; \ - else \ - (elm)->field.cqe_prev->field.cqe_next = \ - (elm)->field.cqe_next; \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_FOREACH(type, var, head, field) \ - for ((var) = ((head)->cqh_first); \ - (var) != (const type *)(head); \ - (var) = ((var)->field.cqe_next)) - -#define CIRCLEQ_FOREACH_REVERSE(type, var, head, field) \ - for ((var) = ((head)->cqh_last); \ - (var) != (const type *)(head); \ - (var) = ((var)->field.cqe_prev)) - -/* - * Circular queue access methods. - */ -#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) -#define CIRCLEQ_FIRST(head) ((head)->cqh_first) -#define CIRCLEQ_LAST(head) ((head)->cqh_last) -#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) -#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) - -#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ - (((elm)->field.cqe_next == (void *)(head)) \ - ? ((head)->cqh_first) \ - : (elm->field.cqe_next)) -#define CIRCLEQ_LOOP_PREV(head, elm, field) \ - (((elm)->field.cqe_prev == (void *)(head)) \ - ? ((head)->cqh_last) \ - : (elm->field.cqe_prev)) - -#endif /* sys/queue.h */ diff --git a/libmupen64plus/mupen64plus-video-z64/src/rdp.cpp b/libmupen64plus/mupen64plus-video-z64/src/rdp.cpp deleted file mode 100644 index 673522b78e..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rdp.cpp +++ /dev/null @@ -1,858 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -#include - -const char *rdpImageFormats[] = -{ "RGBA", "YUV", "CI", "IA", "I", "???", "???", "???" }; - -rdpState_t rdpState; -uint32_t rdpChanged; -//rdpColor_t rdpTlut[1024]; -uint8_t rdpTmem[4*0x1000]; -int rdpFbFormat; -int rdpFbSize; -int rdpFbWidth; -uint32_t rdpFbAddress; -uint32_t rdpZbAddress; -int rdpTiFormat; -int rdpTiSize; -int rdpTiWidth; -uint32_t rdpTiAddress; -rdpTile_t rdpTiles[8]; -int rdpTileSet; - -struct area_t { - int start, stop; - uint32_t from; - int fromLine, fromFormat, fromSize; -}; - -#define MAX_TMEM_AREAS 16 -static area_t tmemAreas[MAX_TMEM_AREAS]; -static int nbTmemAreas; - -#ifdef RDP_DEBUG -int rdp_dump; -#endif - -#define MAXCMD 0x100000 -static uint32_t rdp_cmd_data[MAXCMD+44]; -static volatile int rdp_cmd_ptr = 0; -static volatile int rdp_cmd_cur = 0; -static int rdp_cmd_left = 0; - -#ifdef RDP_DEBUG -uint32_t rdpTraceBuf[0x100000]; -int rdpTracePos; -#endif - - -static void MarkTmemArea(int start, int stop, uint32_t from, uint32_t fromLine, - int fromFormat, int fromSize) -{ - int i; - - // remove areas that intersect - for (i=0; istart) { - memmove(tmemAreas+i, tmemAreas+i+1, nbTmemAreas-i-1); - nbTmemAreas--; - } - - DUMP("marking tmem %x --> %x rdram %x\n", start, stop, from); - - // add new area - //rglAssert(nbTmemAreas < MAX_TMEM_AREAS); - if (nbTmemAreas == MAX_TMEM_AREAS) { - LOG("tmem areas buffer full, clearing\n"); - nbTmemAreas = 0; - } - tmemAreas[nbTmemAreas].start = start; - tmemAreas[nbTmemAreas].stop = stop; - tmemAreas[nbTmemAreas].from = from; - tmemAreas[nbTmemAreas].fromLine = fromLine; - tmemAreas[nbTmemAreas].fromFormat = fromFormat; - tmemAreas[nbTmemAreas].fromSize = fromSize; - nbTmemAreas++; -} - -uint32_t rdpGetTmemOrigin(int tmem, int * line, int * stop, int * format, int * size) -{ - int i; - for (i=0; i> 24) & 0x3f, w1, w2); -} - -static void rdp_noop(uint32_t w1, uint32_t w2) -{ - -} - -static void triangle(uint32_t w1, uint32_t w2, int shade, int texture, int zbuffer) -{ - rglTriangle(w1, w2, shade, texture, zbuffer, rdp_cmd_data + rdp_cmd_cur); -} - -static void rdp_tri_noshade(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 0, 0, 0); -} - -static void rdp_tri_noshade_z(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 0, 0, 1); -} - -static void rdp_tri_tex(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 0, 1, 0); -} - -static void rdp_tri_tex_z(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 0, 1, 1); -} - -static void rdp_tri_shade(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 1, 0, 0); -} - -static void rdp_tri_shade_z(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 1, 0, 1); -} - -static void rdp_tri_texshade(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 1, 1, 0); -} - -static void rdp_tri_texshade_z(uint32_t w1, uint32_t w2) -{ - triangle(w1, w2, 1, 1, 1); -} - -static void rdp_tex_rect(uint32_t w1, uint32_t w2) -{ - uint32_t w3, w4; - rdpTexRect_t rect; - - w3 = rdp_cmd_data[rdp_cmd_cur+2]; - w4 = rdp_cmd_data[rdp_cmd_cur+3]; - - rect.tilenum = (w2 >> 24) & 0x7; - rect.xl = (w1 >> 12) & 0xfff; - rect.yl = (w1 >> 0) & 0xfff; - rect.xh = (w2 >> 12) & 0xfff; - rect.yh = (w2 >> 0) & 0xfff; - rect.s = (w3 >> 16) & 0xffff; - rect.t = (w3 >> 0) & 0xffff; - rect.dsdx = (w4 >> 16) & 0xffff; - rect.dtdy = (w4 >> 0) & 0xffff; - - rglTextureRectangle(&rect, 0); -} - -static void rdp_tex_rect_flip(uint32_t w1, uint32_t w2) -{ - uint32_t w3, w4; - rdpTexRect_t rect; - - w3 = rdp_cmd_data[rdp_cmd_cur+2]; - w4 = rdp_cmd_data[rdp_cmd_cur+3]; - - rect.tilenum = (w2 >> 24) & 0x7; - rect.xl = (w1 >> 12) & 0xfff; - rect.yl = (w1 >> 0) & 0xfff; - rect.xh = (w2 >> 12) & 0xfff; - rect.yh = (w2 >> 0) & 0xfff; - rect.t = (w3 >> 16) & 0xffff; - rect.s = (w3 >> 0) & 0xffff; - rect.dtdy = (w4 >> 16) & 0xffff; - rect.dsdx = (w4 >> 0) & 0xffff; - - rglTextureRectangle(&rect, 1); -} - -static void rdp_sync_load(uint32_t w1, uint32_t w2) -{ - // Nothing to do? -} - -static void rdp_sync_pipe(uint32_t w1, uint32_t w2) -{ - // Nothing to do? -} - -static void rdp_sync_tile(uint32_t w1, uint32_t w2) -{ - // Nothing to do? -} - -void rdpSignalFullSync(); -void rdpWaitFullSync(); -#ifdef RDP_DEBUG -int nbFullSync; -#endif -static void rdp_sync_full(uint32_t w1, uint32_t w2) -{ - //printf("full sync\n"); - rglFullSync(); - rglUpdate(); - - if (rglSettings.async) - rdpSignalFullSync(); - else { - *gfx.MI_INTR_REG |= 0x20; - gfx.CheckInterrupts(); - } -#ifdef RDP_DEBUG - nbFullSync++; -#endif -} - -static void rdp_set_key_gb(uint32_t w1, uint32_t w2) -{ - //osd_die("RDP: unhandled command set_key_gb, %08X %08X\n", w1, w2); -} - -static void rdp_set_key_r(uint32_t w1, uint32_t w2) -{ - //osd_die("RDP: unhandled command set_key_r, %08X %08X\n", w1, w2); -} - -static void rdp_set_convert(uint32_t w1, uint32_t w2) -{ - rdpState.k5 = w2&0xff; - //osd_die("RDP: unhandled command set_convert, %08X %08X\n", w1, w2); -} - -static void rdp_set_scissor(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_CLIP; - rdpState.clipMode = (w2 >> 24) & 3; - rdpState.clip.xh = (w1 >> 12) & 0xfff; - rdpState.clip.yh = (w1 >> 0) & 0xfff; - rdpState.clip.xl = (w2 >> 12) & 0xfff; - rdpState.clip.yl = (w2 >> 0) & 0xfff; - // TODO: handle f & o? -} - -static void rdp_set_prim_depth(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_MISC; - rdpState.primitiveZ = (uint16_t)(w2 >> 16); - rdpState.primitiveDeltaZ = (uint16_t)(w1); -} - -static void rdp_set_other_modes(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_OTHER_MODES; - rdpState.otherModes.w1 = w1; - rdpState.otherModes.w2 = w2; -} - -static void rdp_load_tlut(uint32_t w1, uint32_t w2) -{ - int tilenum = (w2 >> 24) & 0x7; - - rdpChanged |= RDP_BITS_TILE_SETTINGS; - -#define tile rdpTiles[tilenum] - //rdpTile_t tile; - tile.sl = (w1 >> 12) & 0xfff; - tile.tl = (w1 >> 0) & 0xfff; - tile.sh = (w2 >> 12) & 0xfff; - tile.th = (w2 >> 0) & 0xfff; - - int i; - - rdpChanged |= RDP_BITS_TLUT; - - int count = ((tile.sh - tile.sl + 4) >>2) * ((tile.th - tile.tl + 4) >>2); - - switch (rdpTiSize) - { - case RDP_PIXEL_SIZE_16BIT: - { - uint16_t *src = (uint16_t *)&rdram[(rdpTiAddress + (tile.tl >>2) * rdpTiWidth * 2 + ((tile.sl >>2) << rdpTiSize >> 1))/4]; - uint16_t *dst = (uint16_t *)(rdpTmem + rdpTiles[tilenum].tmem); - - // printf("loading TLUT from %x --> %x\n", - // tile.th * rdpTiWidth / 2 + (tile.sh << rdpTiSize >> 1)/4 - - for (i=0; i < count; i++) - { - dst[i*4] = src[i^1]; - } - break; - } - default: LOGERROR("RDP: load_tlut: size = %d\n", rdpTiSize); - } -#undef tile -} - -static void rdp_set_tile_size(uint32_t w1, uint32_t w2) -{ - int tilenum = (w2 >> 24) & 0x7; - - rdpChanged |= RDP_BITS_TILE_SETTINGS; - -#define tile rdpTiles[tilenum] - tile.sl = (w1 >> 12) & 0xfff; - tile.tl = (w1 >> 0) & 0xfff; - tile.sh = (w2 >> 12) & 0xfff; - tile.th = (w2 >> 0) & 0xfff; -#undef tile -} - -static void rdp_load_block(uint32_t w1, uint32_t w2) -{ - int i, width; - uint16_t sl, sh, tl, dxt; - int tilenum = (w2 >> 24) & 0x7; - uint32_t *src, *tc; - int tb; - - rdpChanged |= RDP_BITS_TMEM; - - sl = ((w1 >> 12) & 0xfff); - tl = ((w1 >> 0) & 0xfff) << 11; - sh = ((w2 >> 12) & 0xfff); - dxt = ((w2 >> 0) & 0xfff); - - width = (sh - sl + 1) << rdpTiSize >> 1; - - src = (uint32_t*)&rdram[0]; - tc = (uint32_t*)rdpTmem; - tb = rdpTiles[tilenum].tmem/4; - - //printf("Load block to %x width %x\n", rdpTiles[tilenum].tmem, width); - - MarkTmemArea(rdpTiles[tilenum].tmem, rdpTiles[tilenum].tmem + width, - tl * rdpTiWidth*4 + rdpTiAddress + sl*4, 0, ~0, ~0); - - if (tb+width/4 > 0x1000/4) { - LOG("load_block : fixup too large width\n"); - width = 0x1000-tb*4; - } - - if (dxt != 0) - { - int j=0; - - //rglAssert(tb+width/4 <= 0x1000/4); - - int swap = rdpTiles[tilenum].size == 3? 2 : 1; - - for (i=0; i < width / 4; i+=2) - { - int t = j >> 11; - - tc[(((tb+i) + 0) ^ ((t & 1) ? swap : 0))&0x3ff] = - src[rdpTiAddress / 4 + ((tl * rdpTiWidth) / 4) + sl + i + 0]; - tc[(((tb+i) + 1) ^ ((t & 1) ? swap : 0))&0x3ff] = - src[rdpTiAddress / 4 + ((tl * rdpTiWidth) / 4) + sl + i + 1]; - - j += dxt; - } - } - else - { - //rglAssert(tb+width/4 <= 0x1000/4); - for (i=0; i < width / 4; i++) - { - tc[(tb+i)&0x3ff] = src[((tl * rdpTiWidth) / 4) + rdpTiAddress / 4 + sl + i]; - } - } -} - -static void rdp_load_tile(uint32_t w1, uint32_t w2) -{ - int i, j; - uint16_t sl, sh, tl, th; - int width, height; - int tilenum = (w2 >> 24) & 0x7; - int line; - - rdpChanged |= RDP_BITS_TMEM; - - sl = ((w1 >> 12) & 0xfff) / 4; - tl = ((w1 >> 0) & 0xfff) / 4; - sh = ((w2 >> 12) & 0xfff) / 4; - th = ((w2 >> 0) & 0xfff) / 4; - - width = (sh - sl) + 1; - height = (th - tl) + 1; - - // printf("Load tile to %x line %x height %d\n", - // rdpTiles[tilenum].tmem, - // rdpTiles[tilenum].line, - // height); - - rdpTiles[tilenum].size = rdpTiSize; // CHECK THIS - line = rdpTiles[tilenum].line; - switch (rdpTiles[tilenum].size /*rdpTiSize*/) - { - case RDP_PIXEL_SIZE_8BIT: - { - uint8_t *src = (uint8_t*)&rdram[0]; - uint8_t *tc = (uint8_t*)rdpTmem; - int tb = rdpTiles[tilenum].tmem; - - MarkTmemArea(tb, tb + height*line, rdpTiAddress + tl * rdpTiWidth + sl, - rdpTiWidth, rdpTiFormat, rdpTiSize); - - if (tb + (line * (height-1) + width) > 4096) - { - LOGERROR("rdp_load_tile 8-bit: tmem %04X, width %d, height %d = %d\n", rdpTiles[tilenum].tmem, width, height, width*height); - height = (4096-tb)/line; - } - - for (j=0; j < height; j++) - { - int tline = tb + (rdpTiles[tilenum].line * j); - int s = ((j + tl) * rdpTiWidth) + sl; - - for (i=0; i < width; i++) - { - tc[(((tline+i) ^ BYTE_ADDR_XOR) ^ ((j & 1) ? 4 : 0))&0xfff] = src[(rdpTiAddress + s++) ^ BYTE_ADDR_XOR]; - } - } - break; - } - case RDP_PIXEL_SIZE_16BIT: - { - uint16_t *src = (uint16_t*)&rdram[0]; - uint16_t *tc = (uint16_t*)rdpTmem; - int tb = (rdpTiles[tilenum].tmem / 2); - - if (tb + (line/2 * (height-1) + width) > 2048) - { - LOGERROR("rdp_load_tile 16-bit: tmem %04X, width %d, height %d = %d\n", rdpTiles[tilenum].tmem, width, height, width*height); - height = (2048 - tb) / (line/2); - } - - MarkTmemArea(tb*2, tb*2 + height*line, - rdpTiAddress + (tl * rdpTiWidth + sl)*2, - rdpTiWidth*2, rdpTiFormat, rdpTiSize); - - for (j=0; j < height; j++) - { - int tline = tb + ((rdpTiles[tilenum].line / 2) * j); - int s = ((j + tl) * rdpTiWidth) + sl; - - for (i=0; i < width; i++) - { - tc[(((tline+i) ^ WORD_ADDR_XOR) ^ ((j & 1) ? 2 : 0))&0x7ff] = src[(rdpTiAddress / 2 + s++) ^ WORD_ADDR_XOR]; - } - } - break; - } - case RDP_PIXEL_SIZE_32BIT: - { - uint32_t *src = (uint32_t*)&rdram[0]; - uint32_t *tc = (uint32_t*)rdpTmem; - int tb = (rdpTiles[tilenum].tmem / 4); - - MarkTmemArea(tb*4, tb*4 + height*line*2, - rdpTiAddress + (tl * rdpTiWidth + sl)*4, - rdpTiWidth*4, rdpTiFormat, rdpTiSize); - - if (tb + (line/2 * (height-1) + width) > 1024) - { - rdp_log(M64MSG_ERROR, "rdp_load_tile 32-bit: tmem %04X, width %d, height %d = %d\n", rdpTiles[tilenum].tmem, width, height, width*height); - } - - for (j=0; j < height; j++) - { - int tline = tb + ((rdpTiles[tilenum].line / 2) * j); - int s = ((j + tl) * rdpTiWidth) + sl; - - for (i=0; i < width; i++) - { - tc[((tline+i) ^ ((j & 1) ? 2 : 0))&0x3ff] = src[(rdpTiAddress / 4 + s++)]; - } - } - break; - } - - default: - rdp_log(M64MSG_ERROR, "RDP: load_tile: size = %d\n", rdpTiSize); - } -} - -static void rdp_set_tile(uint32_t w1, uint32_t w2) -{ - int tilenum = (w2 >> 24) & 0x7; - //int i; - - rdpChanged |= RDP_BITS_TILE_SETTINGS; - rdpTileSet |= 1<> 21) & 0x7; - tile.size = (w1 >> 19) & 0x3; - tile.line = ((w1 >> 9) & 0x1ff) * 8; - tile.tmem = ((w1 >> 0) & 0x1ff) * 8; - tile.palette= (w2 >> 20) & 0xf; - tile.ct = (w2 >> 19) & 0x1; - tile.mt = (w2 >> 18) & 0x1; - tile.mask_t = (w2 >> 14) & 0xf; - tile.shift_t= (w2 >> 10) & 0xf; - if (tile.shift_t >= 12) tile.shift_t -= 16; - tile.cs = (w2 >> 9) & 0x1; - tile.ms = (w2 >> 8) & 0x1; - tile.mask_s = (w2 >> 4) & 0xf; - tile.shift_s= (w2 >> 0) & 0xf; - if (tile.shift_s >= 12) tile.shift_s -= 16; -#undef tile -} - -static void rdp_fill_rect(uint32_t w1, uint32_t w2) -{ - rdpRect_t rect; - rect.xl = (w1 >> 12) & 0xfff; - rect.yl = (w1 >> 0) & 0xfff; - rect.xh = (w2 >> 12) & 0xfff; - rect.yh = (w2 >> 0) & 0xfff; - - rglFillRectangle(&rect); -} - -static void rdp_set_fill_color(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_FILL_COLOR; - rdpState.fillColor = w2; -} - -static void rdp_set_fog_color(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_FOG_COLOR; - rdpState.fogColor = w2; -} - -static void rdp_set_blend_color(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_BLEND_COLOR; - rdpState.blendColor = w2; -} - -static void rdp_set_prim_color(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_PRIM_COLOR; - // TODO: prim min level, prim_level - rdpState.primColor = w2; -} - -static void rdp_set_env_color(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_ENV_COLOR; - rdpState.envColor = w2; -} - -static void rdp_set_combine(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_COMBINE_MODES; - - rdpState.combineModes.w1 = w1; - rdpState.combineModes.w2 = w2; -} - -static void rdp_set_texture_image(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_TI_SETTINGS; - - rdpTiFormat = (w1 >> 21) & 0x7; - rdpTiSize = (w1 >> 19) & 0x3; - rdpTiWidth = (w1 & 0x3ff) + 1; - rdpTiAddress = w2 & 0x01ffffff; -} - -static void rdp_set_mask_image(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_ZB_SETTINGS; - rdpZbAddress = w2 & 0x01ffffff; -} - -static void rdp_set_color_image(uint32_t w1, uint32_t w2) -{ - rdpChanged |= RDP_BITS_FB_SETTINGS; - rdpFbFormat = (w1 >> 21) & 0x7; - rdpFbSize = (w1 >> 19) & 0x3; - rdpFbWidth = (w1 & 0x3ff) + 1; - rdpFbAddress = w2 & 0x01ffffff; -} - -/*****************************************************************************/ - -static void (* rdp_command_table[64])(uint32_t w1, uint32_t w2) = -{ - /* 0x00 */ - rdp_noop, rdp_invalid, rdp_invalid, rdp_invalid, - rdp_invalid, rdp_invalid, rdp_invalid, rdp_invalid, - rdp_tri_noshade, rdp_tri_noshade_z, rdp_tri_tex, rdp_tri_tex_z, - rdp_tri_shade, rdp_tri_shade_z, rdp_tri_texshade, rdp_tri_texshade_z, - /* 0x10 */ - rdp_invalid, rdp_invalid, rdp_invalid, rdp_invalid, - rdp_invalid, rdp_invalid, rdp_invalid, rdp_invalid, - rdp_invalid, rdp_invalid, rdp_invalid, rdp_invalid, - rdp_invalid, rdp_invalid, rdp_invalid, rdp_invalid, - /* 0x20 */ - rdp_invalid, rdp_invalid, rdp_invalid, rdp_invalid, - rdp_tex_rect, rdp_tex_rect_flip, rdp_sync_load, rdp_sync_pipe, - rdp_sync_tile, rdp_sync_full, rdp_set_key_gb, rdp_set_key_r, - rdp_set_convert, rdp_set_scissor, rdp_set_prim_depth, rdp_set_other_modes, - /* 0x30 */ - rdp_load_tlut, rdp_invalid, rdp_set_tile_size, rdp_load_block, - rdp_load_tile, rdp_set_tile, rdp_fill_rect, rdp_set_fill_color, - rdp_set_fog_color, rdp_set_blend_color, rdp_set_prim_color, rdp_set_env_color, - rdp_set_combine, rdp_set_texture_image, rdp_set_mask_image, rdp_set_color_image -}; - -void rdp_process_list(void) -{ - //int i; - uint32_t cmd;//, length, cmd_length; - - rglUpdateStatus(); - if (!rglSettings.threaded) - rdp_store_list(); - - if (rglStatus == RGL_STATUS_CLOSED) - return; - - // this causes problem with depth writeback in zelda mm - // but is necessary for in fisherman - rglUpdate(); - - while (rdp_cmd_cur != rdp_cmd_ptr) - { - cmd = (rdp_cmd_data[rdp_cmd_cur] >> 24) & 0x3f; - // if (((rdp_cmd_data[rdp_cmd_cur] >> 24) & 0xc0) != 0xc0) - // { - // LOGERROR("rdp_process_list: invalid rdp command %08X at %08X\n", rdp_cmd_data[rdp_cmd_cur], dp_start+(rdp_cmd_cur * 4)); - // } - - if ((((rdp_cmd_ptr-rdp_cmd_cur)&(MAXCMD-1)) * 4) < rdp_command_length[cmd]) - { - // LOGERROR("rdp_process_list: not enough rdp command data: cur = %d, ptr = %d, expected = %d\n", rdp_cmd_cur, rdp_cmd_ptr, rdp_command_length[cmd]); - // return; - break; - } - -#ifdef RDP_DEBUG - if (rdp_dump) - { - char string[4000]; - int rdp_dasm(uint32_t * rdp_cmd_data, int rdp_cmd_cur, int length, char *buffer); - rdp_dasm(rdp_cmd_data, rdp_cmd_cur, rdp_command_length[cmd], string); - - fprintf(stderr, "%08X: %08X %08X %s\n", dp_start+(rdp_cmd_cur * 4), rdp_cmd_data[rdp_cmd_cur+0], rdp_cmd_data[rdp_cmd_cur+1], string); - } -#endif - -#ifdef RDP_DEBUG - memcpy(rdpTraceBuf+rdpTracePos, rdp_cmd_data+rdp_cmd_cur, rdp_command_length[cmd]); -#endif - - if (rdp_cmd_cur + rdp_command_length[cmd]/4 > MAXCMD) - memcpy(rdp_cmd_data + MAXCMD, rdp_cmd_data, rdp_command_length[cmd] - (MAXCMD - rdp_cmd_cur)*4); - - // execute the command - rdp_command_table[cmd](rdp_cmd_data[rdp_cmd_cur+0], rdp_cmd_data[rdp_cmd_cur+1]); - -#ifdef RDP_DEBUG - rdpTracePos += rdp_command_length[cmd] / 4; - rglAssert(rdpTracePos < sizeof(rdpTraceBuf)/sizeof(rdpTraceBuf[0])); -#endif - - rdp_cmd_cur = (rdp_cmd_cur + rdp_command_length[cmd] / 4) & (MAXCMD-1); - } - - // dp_current = dp_end; - // dp_start = dp_end; - dp_start = dp_current; - - dp_status &= ~0x0002; -} - -int rdp_store_list(void) -{ - uint32_t i; - uint32_t data, cmd, length; - int sync = 0; - - // while (dp_current < dp_end) { - - // } - // dp_status &= ~0x0002; - - length = dp_end - dp_current; - - // LOG("rdp start %x cur %x end %x length %d dp_status %x\n", - // dp_start, dp_current, dp_end, - // length, dp_status); - - if (dp_end <= dp_current) { - return 0; - } - - // load command data - for (i=0; i < length; i += 4) - { - data = READ_RDP_DATA(dp_current + i); - if (rglSettings.async) { - if (rdp_cmd_left) { - rdp_cmd_left--; - } else { - cmd = (data >> 24) & 0x3f; - rdp_cmd_left = rdp_command_length[cmd]/4-1; - if (cmd == 0x29) // full_sync - sync = 1; - } - } - rdp_cmd_data[rdp_cmd_ptr] = data; - rdp_cmd_ptr = (rdp_cmd_ptr + 1) & (MAXCMD-1); - } - - dp_current += length; - - return sync; -} - - -int rdp_init() -{ - rdp_cmd_cur = rdp_cmd_ptr = 0; - rdp_cmd_left = 0; -#ifdef RDP_DEBUG - rdpTracePos = 0; -#endif - nbTmemAreas = 0; - return rglInit(); -} - diff --git a/libmupen64plus/mupen64plus-video-z64/src/rdp.h b/libmupen64plus/mupen64plus-video-z64/src/rdp.h deleted file mode 100644 index 606ffd0d37..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rdp.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#ifndef _RDP_H_ -#define _RDP_H_ - -#include -#include -#include -#include - -#define M64P_PLUGIN_PROTOTYPES 1 -#include "m64p_types.h" -#include "m64p_common.h" -#include "m64p_plugin.h" -#include "m64p_vidext.h" -#include "m64p_config.h" - -#define LSB_FIRST 1 // TODO : check for platform -#ifdef LSB_FIRST -#define BYTE_ADDR_XOR 3 -#define WORD_ADDR_XOR 1 -#define BYTE4_XOR_BE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */ -#else -#define BYTE_ADDR_XOR 0 -#define WORD_ADDR_XOR 0 -#define BYTE4_XOR_BE(a) (a) -#endif - - - -#define RDP_PIXEL_SIZE_4BIT 0 -#define RDP_PIXEL_SIZE_8BIT 1 -#define RDP_PIXEL_SIZE_16BIT 2 -#define RDP_PIXEL_SIZE_32BIT 3 - -#define RDP_FORMAT_RGBA 0 -#define RDP_FORMAT_YUV 1 -#define RDP_FORMAT_CI 2 -#define RDP_FORMAT_IA 3 -#define RDP_FORMAT_I 4 - -#define RDP_CYCLE_TYPE_1 0 -#define RDP_CYCLE_TYPE_2 1 -#define RDP_CYCLE_TYPE_COPY 2 -#define RDP_CYCLE_TYPE_FILL 3 - -typedef uint32_t rdpColor_t; - -#define RDP_GETC32_R(c) ( ((c)>>24) & 0xff ) -#define RDP_GETC32_G(c) ( ((c)>>16) & 0xff ) -#define RDP_GETC32_B(c) ( ((c)>> 8) & 0xff ) -#define RDP_GETC32_A(c) ( ((c)>> 0) & 0xff ) - -#define RDP_GETC16_R(c) ( ((c)>>11) & 0x1f ) -#define RDP_GETC16_G(c) ( ((c)>> 6) & 0x1f ) -#define RDP_GETC16_B(c) ( ((c)>> 1) & 0x1f ) -#define RDP_GETC16_A(c) ( ((c)>> 0) & 0x1 ) - -struct rdpRect_t { - uint16_t xl, yl, xh, yh; // 10.2 fixed-point -}; - -struct rdpTexRect_t { - int tilenum; - uint16_t xl, yl, xh, yh; // 10.2 fixed-point - int16_t s, t; // 10.5 fixed-point - int16_t dsdx, dtdy; // 5.10 fixed-point -}; - -extern const char *rdpImageFormats[]; - -// TODO put ct ... palette in a bitfield -struct rdpTile_t { - uint16_t line; - uint16_t tmem; - uint16_t sl, tl, sh, th; // 10.2 fixed-point - uint16_t w, h; - int8_t format, size; - int8_t mask_t, shift_t, mask_s, shift_s; - int8_t ct, mt, cs, ms; - int8_t palette; -}; - -struct rdpCombineModes_t { - uint32_t w1, w2; -}; - -#define RDP_GETCM_SUB_A_RGB0(cm) (((cm).w1 >> 20) & 0xf) -#define RDP_GETCM_MUL_RGB0(cm) (((cm).w1 >> 15) & 0x1f) -#define RDP_GETCM_SUB_A_A0(cm) (((cm).w1 >> 12) & 0x7) -#define RDP_GETCM_MUL_A0(cm) (((cm).w1 >> 9) & 0x7) -#define RDP_GETCM_SUB_A_RGB1(cm) (((cm).w1 >> 5) & 0xf) -#define RDP_GETCM_MUL_RGB1(cm) (((cm).w1 >> 0) & 0x1f) - -#define RDP_GETCM_SUB_B_RGB0(cm) (((cm).w2 >> 28) & 0xf) -#define RDP_GETCM_SUB_B_RGB1(cm) (((cm).w2 >> 24) & 0xf) -#define RDP_GETCM_SUB_A_A1(cm) (((cm).w2 >> 21) & 0x7) -#define RDP_GETCM_MUL_A1(cm) (((cm).w2 >> 18) & 0x7) -#define RDP_GETCM_ADD_RGB0(cm) (((cm).w2 >> 15) & 0x7) -#define RDP_GETCM_SUB_B_A0(cm) (((cm).w2 >> 12) & 0x7) -#define RDP_GETCM_ADD_A0(cm) (((cm).w2 >> 9) & 0x7) -#define RDP_GETCM_ADD_RGB1(cm) (((cm).w2 >> 6) & 0x7) -#define RDP_GETCM_SUB_B_A1(cm) (((cm).w2 >> 3) & 0x7) -#define RDP_GETCM_ADD_A1(cm) (((cm).w2 >> 0) & 0x7) - -#define RDP_COMBINE_MASK11 ((0xfu<<20)|(0x1fu<<15)|(0x7u<<12)|(0x7u<<9)) -#define RDP_COMBINE_MASK12 ((0xfu<<28)|(0x7u<<15)|(0x7u<<12)|(0x7u<<9)) -#define RDP_COMBINE_MASK21 ((0xfu<<5)|(0x1fu<<0)) -#define RDP_COMBINE_MASK22 ((0xfu<<24)|(0x7u<<21)|(0x7u<<18)|(0x7u<<6)|(0x7u<<3)|(0x7u<<0)) - -static const rdpCombineModes_t rdpCombineMasks[4] = { - { ~RDP_COMBINE_MASK21, ~RDP_COMBINE_MASK22 }, - { ~0u, ~0u }, - { ~(RDP_COMBINE_MASK11|RDP_COMBINE_MASK21), ~(RDP_COMBINE_MASK12|RDP_COMBINE_MASK22) }, - { ~(RDP_COMBINE_MASK11|RDP_COMBINE_MASK21), ~(RDP_COMBINE_MASK12|RDP_COMBINE_MASK22) }, -}; - -struct rdpOtherModes_t { - uint32_t w1, w2; -}; - -#define RDP_OM_MISSING1 (~((3<<20)|0x80000|0x40000|0x20000|0x10000|0x08000| \ - 0x04000|0x02000|0x01000|0x00800|0x00400|0x00200| \ - 0x00100|(3<<6)|(3<<4))) -#define RDP_OM_MISSING2 (~(0xffff0000|0x4000|0x2000|0x1000|(3<<10)|(3<<8)| \ - 0x80|0x40|0x20|0x10|0x08|0x04|0x02|0x01)) - -#define RDP_GETOM_CYCLE_TYPE(om) (((om).w1 >> 20) & 0x3) -#define RDP_GETOM_PERSP_TEX_EN(om) (((om).w1 & 0x80000) ? 1 : 0) -#define RDP_GETOM_DETAIL_TEX_EN(om) (((om).w1 & 0x40000) ? 1 : 0) -#define RDP_GETOM_SHARPEN_TEX_EN(om) (((om).w1 & 0x20000) ? 1 : 0) -#define RDP_GETOM_TEX_LOD_EN(om) (((om).w1 & 0x10000) ? 1 : 0) -#define RDP_GETOM_EN_TLUT(om) (((om).w1 & 0x08000) ? 1 : 0) -#define RDP_GETOM_TLUT_TYPE(om) (((om).w1 & 0x04000) ? 1 : 0) -#define RDP_GETOM_SAMPLE_TYPE(om) (((om).w1 & 0x02000) ? 1 : 0) -#define RDP_GETOM_MID_TEXEL(om) (((om).w1 & 0x01000) ? 1 : 0) -#define RDP_GETOM_BI_LERP0(om) (((om).w1 & 0x00800) ? 1 : 0) -#define RDP_GETOM_BI_LERP1(om) (((om).w1 & 0x00400) ? 1 : 0) -#define RDP_GETOM_CONVERT_ONE(om) (((om).w1 & 0x00200) ? 1 : 0) -#define RDP_GETOM_KEY_EN(om) (((om).w1 & 0x00100) ? 1 : 0) -#define RDP_GETOM_RGB_DITHER_SEL(om) (((om).w1 >> 6) & 0x3) -#define RDP_GETOM_ALPHA_DITHER_SEL(om) (((om).w1 >> 4) & 0x3) -#define RDP_GETOM_BLEND_M1A_0(om) (((om).w2 >> 30) & 0x3) -#define RDP_GETOM_BLEND_M1A_1(om) (((om).w2 >> 28) & 0x3) -#define RDP_GETOM_BLEND_M1B_0(om) (((om).w2 >> 26) & 0x3) -#define RDP_GETOM_BLEND_M1B_1(om) (((om).w2 >> 24) & 0x3) -#define RDP_GETOM_BLEND_M2A_0(om) (((om).w2 >> 22) & 0x3) -#define RDP_GETOM_BLEND_M2A_1(om) (((om).w2 >> 20) & 0x3) -#define RDP_GETOM_BLEND_M2B_0(om) (((om).w2 >> 18) & 0x3) -#define RDP_GETOM_BLEND_M2B_1(om) (((om).w2 >> 16) & 0x3) -#define RDP_GETOM_FORCE_BLEND(om) (((om).w2 & 0x4000) ? 1 : 0) -#define RDP_GETOM_ALPHA_CVG_SELECT(om) (((om).w2 & 0x2000) ? 1 : 0) -#define RDP_GETOM_CVG_TIMES_ALPHA(om) (((om).w2 & 0x1000) ? 1 : 0) -#define RDP_GETOM_Z_MODE(om) (((om).w2 >> 10) & 0x3) -#define RDP_GETOM_CVG_DEST(om) (((om).w2 >> 8) & 0x3) -#define RDP_GETOM_COLOR_ON_CVG(om) (((om).w2 & 0x80) ? 1 : 0) -#define RDP_GETOM_IMAGE_READ_EN(om) (((om).w2 & 0x40) ? 1 : 0) -#define RDP_GETOM_Z_UPDATE_EN(om) (((om).w2 & 0x20) ? 1 : 0) -#define RDP_GETOM_Z_COMPARE_EN(om) (((om).w2 & 0x10) ? 1 : 0) -#define RDP_GETOM_ANTIALIAS_EN(om) (((om).w2 & 0x08) ? 1 : 0) -#define RDP_GETOM_Z_SOURCE_SEL(om) (((om).w2 & 0x04) ? 1 : 0) -#define RDP_GETOM_DITHER_ALPHA_EN(om) (((om).w2 & 0x02) ? 1 : 0) -#define RDP_GETOM_ALPHA_COMPARE_EN(om) (((om).w2 & 0x01) ? 1 : 0) - -#define RDP_BLEND_MASK1 ((3u<<30)|(3u<<26)|(3u<<22)|(3u<<18)) -#define RDP_BLEND_MASK2 ((3u<<28)|(3u<<24)|(3u<<20)|(3u<<16)) - -static const rdpOtherModes_t rdpBlendMasks[4] = { - { ~0u, ~RDP_BLEND_MASK2 }, - { ~0u, ~0u }, - { ~0u, ~(RDP_BLEND_MASK1|RDP_BLEND_MASK2) }, - { ~0u, ~(RDP_BLEND_MASK1|RDP_BLEND_MASK2) }, -}; - -struct rdpState_t { - rdpCombineModes_t combineModes; - rdpOtherModes_t otherModes; - rdpColor_t blendColor; - rdpColor_t primColor; - rdpColor_t envColor; - rdpColor_t fogColor; - rdpColor_t fillColor; - int primitiveZ; - int primitiveDeltaZ; - rdpRect_t clip; - uint8_t k5, clipMode; -}; - -extern rdpState_t rdpState; -extern uint32_t rdpChanged; -//extern rdpColor_t rdpTlut[]; -#define rdpTlut ((uint16_t *) (rdpTmem + 0x800)) -extern uint8_t rdpTmem[]; -extern int rdpFbFormat; -extern int rdpFbSize; -extern int rdpFbWidth; -extern uint32_t rdpFbAddress; -extern uint32_t rdpZbAddress; -extern int rdpTiFormat; -extern int rdpTiSize; -extern int rdpTiWidth; -extern uint32_t rdpTiAddress; -extern rdpTile_t rdpTiles[8]; -extern int rdpTileSet; - -#define RDP_BITS_COMBINE_MODES (1<<0) -#define RDP_BITS_OTHER_MODES (1<<1) -#define RDP_BITS_CLIP (1<<2) -#define RDP_BITS_BLEND_COLOR (1<<3) -#define RDP_BITS_PRIM_COLOR (1<<4) -#define RDP_BITS_ENV_COLOR (1<<5) -#define RDP_BITS_FOG_COLOR (1<<6) -#define RDP_BITS_FB_SETTINGS (1<<7) -#define RDP_BITS_ZB_SETTINGS (1<<8) -#define RDP_BITS_TI_SETTINGS (1<<9) -#define RDP_BITS_TMEM (1<<10) -#define RDP_BITS_TLUT (1<<11) -#define RDP_BITS_TILE_SETTINGS (1<<12) -#define RDP_BITS_FILL_COLOR (1<<13) -#define RDP_BITS_MISC (1<<14) - -// return where the data in rdram came from at this address in tmem -uint32_t rdpGetTmemOrigin(int tmem, int * line, int * stop, int * fromFormat, int * size); - - -int rdp_init(); -int rdp_dasm(uint32_t * rdp_cmd_data, int rdp_cmd_cur, int length, char *buffer); -void rdp_process_list(void); -int rdp_store_list(void); - -void rdp_log(m64p_msg_level level, const char *msg, ...); - -#ifdef RDP_DEBUG - -extern uint32_t rdpTraceBuf[]; -extern int rdpTracePos; - -extern int rdp_dump; - -#define DUMP if (!rdp_dump) ; else LOG - -static void LOG(const char * s, ...) -{ - va_list ap; - va_start(ap, s); - vfprintf(stderr, s, ap); - va_end(ap); -} -#define LOGERROR LOG - -#else // RDP_DEBUG - -#define DUMP(...) rdp_log(M64MSG_VERBOSE, __VA_ARGS__) -#define LOG(...) rdp_log(M64MSG_VERBOSE, __VA_ARGS__) -#define LOGERROR(...) rdp_log(M64MSG_WARNING, __VA_ARGS__) - -#endif // RDP_DEBUG - - -#endif // _RDP_H_ diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl.cpp deleted file mode 100644 index 83842c1046..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl.cpp +++ /dev/null @@ -1,1682 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -/* - * - * TODO - * - * - hires framebuffer : scale them accordingly to the GL screen resolution - * - * - multitexturing avec tilenum == 7, ca marche comment ? - * --> tilenum=7 should be translated to tilenum=0 for triangle and texrec primitives - * - * - CvgXAlpha mode not really correct, effect probably depends on the texture format - * --> apparently fixed, Intensity textures shouldn't be affected by this effect - * --> correction : it had nothing to do with the texture format, but with - * the alpha_cvg_select flag - * - * - fix fbo depth clear in LEGO racer (also affects beetle and reflection in rally 99) - * (also affects Zelda OOT subscreen) - * --> DONE - * - * - frame buffer ordering (LEGO racer) - * --> DONE but required also less conservative framebuffer check - * - * - format conversion for hires framebuffers when required (CBFD , Banjo) - * --> DONE (quick hack) - * - * - some texture (4 ? 8 bits ?) problems - * --> either they're fixed, either I forgot which problem it was - * - * - mirrored textures - * --> done but rely on a GL extension, do we care ? - * - * - better blend - * --> mostly done slow way, now need to implement the quick way - * --> done faster way, seems to work reasonably well - * - * - need to sort out combiner clamp modes - * --> started but not complete - * --> the problem is much more complicated, it's not combiner clamping - * but coverage calculation modes. - * - * - fog !! - * --> done - * - * PROBLEMS - * - * - this list needs to be updated :) - * - links not always rendered in the subscreen - * --> depth clear problem, anything else ? FIXED - * - texture problems in beetle - * --> mostly fixed, it was multitexturing, the sky still has a weird problem though - * --> completely fixed at last (the sky uses tex2 in the second combiner cycle, - * which should be interpreted as tex1 (apparently tex2 isn't available in the - * second cycle) - * UPDATE : in fact tex1 and tex2 need to be swapped in the second step of - * the combiner, weird but it fixes a few other problems as well - * -**/ - -#include "rdp.h" -#include "rgl.h" - -#include - -//#define NOFBO -#define ZTEX -#define FBORGBA - -rglTexCache_t rglTexCache[0x1000]; -uint8_t rglTmpTex[1024*1024*4]; -uint8_t rglTmpTex2[1024*1024*4]; - -volatile int rglStatus, rglNextStatus; - -static int wireframe; - -static uint32_t old_vi_origin; - -int rglFrameCounter; - -extern int viewportOffset; -rglSettings_t rglSettings; - -rglDepthBuffer_t zBuffers[MAX_DEPTH_BUFFERS]; -int nbZBuffers; - -rglRenderBuffer_t rBuffers[MAX_RENDER_BUFFERS]; -int nbRBuffers; -rglRenderBuffer_t * curRBuffer; -rglRenderBuffer_t * curZBuffer; -rglRenderBufferHead_t rBufferHead; - -int rglTexCacheCounter = 1; - -rglTexture_t rglTextures[RGL_TEX_CACHE_SIZE]; - -rglRenderChunk_t chunks[MAX_RENDER_CHUNKS]; -rglRenderChunk_t * curChunk; -int nbChunks, renderedChunks; - -rglStrip_t strips[MAX_STRIPS]; -rglVertex_t vtxs[6*MAX_STRIPS]; -int nbStrips, nbVtxs; - -rglRenderMode_t renderModesDb[MAX_RENDER_MODES]; -int nbRenderModes; - -rglShader_t * rglCopyShader; -rglShader_t * rglCopyDepthShader; - -int rglScreenWidth = 320, rglScreenHeight = 240; - -#define CHECK_FRAMEBUFFER_STATUS() \ -{\ - GLenum status; \ - status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); \ - /*LOGERROR("%x\n", status);*/\ - switch(status) { \ - case GL_FRAMEBUFFER_COMPLETE_EXT: \ - /*LOGERROR("framebuffer complete!\n");*/\ - break; \ - case GL_FRAMEBUFFER_UNSUPPORTED_EXT: \ - LOGERROR("framebuffer GL_FRAMEBUFFER_UNSUPPORTED_EXT\n");\ - /* you gotta choose different formats */ \ - /*rglAssert(0);*/ \ - break; \ - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: \ - LOGERROR("framebuffer INCOMPLETE_ATTACHMENT\n");\ - break; \ - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: \ - LOGERROR("framebuffer FRAMEBUFFER_MISSING_ATTACHMENT\n");\ - break; \ - case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: \ - LOGERROR("framebuffer FRAMEBUFFER_DIMENSIONS\n");\ - break; \ - case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: \ - LOGERROR("framebuffer INCOMPLETE_FORMATS\n");\ - break; \ - case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: \ - LOGERROR("framebuffer INCOMPLETE_DRAW_BUFFER\n");\ - break; \ - case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: \ - LOGERROR("framebuffer INCOMPLETE_READ_BUFFER\n");\ - break; \ - case GL_FRAMEBUFFER_BINDING_EXT: \ - LOGERROR("framebuffer BINDING_EXT\n");\ - break; \ - default: \ - LOGERROR("framebuffer generic error\n");\ - break; \ - /* programming error; will fail on all hardware */ \ - /*rglAssert(0);*/ \ -}\ -} -/* - case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT: \ - LOGERROR("framebuffer INCOMPLETE_DUPLICATE_ATTACHMENT\n");\ - break; \ -*/ - -rglDepthBuffer_t * rglFindDepthBuffer(uint32_t address, int width, int height) -{ - int i; - rglDepthBuffer_t * buffer; - for (i=0; iaddress = address; - buffer->width = width; - buffer->height = height; - - // glGenRenderbuffersEXT(1, &buffer->zbid); - // glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, buffer->zbid); - // rglAssert(glGetError() == GL_NO_ERROR); - // glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, - // buffer->width, buffer->height); - // rglAssert(glGetError() == GL_NO_ERROR); - -#ifdef ZTEX - glGenTextures(1, &buffer->zbid); - rglAssert(glGetError() == GL_NO_ERROR); - glBindTexture(GL_TEXTURE_2D, buffer->zbid); - rglAssert(glGetError() == GL_NO_ERROR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, - buffer->width, buffer->height, 0, - GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL); - rglAssert(glGetError() == GL_NO_ERROR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glBindTexture(GL_TEXTURE_2D, 0); -#else - glGenRenderbuffersEXT(1, &buffer->zbid); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, buffer->zbid); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, - buffer->width, buffer->height); - -#endif - - return buffer; -} - -void rglDeleteRenderBuffer(rglRenderBuffer_t & buffer) -{ - buffer.mod.xl = buffer.mod.yl = 0; - buffer.mod.xh = buffer.mod.yh = 8192; - buffer.depthBuffer = 0; -#ifndef NOFBO - if (buffer.fbid) { - glDeleteFramebuffersEXT(1, &buffer.fbid); - buffer.fbid = 0; - } - if (buffer.texid) { - glDeleteTextures(1, &buffer.texid); - buffer.texid = 0; - } - buffer.nbDepthSections = 0; -#ifdef RGL_EXACT_BLEND - glDeleteFramebuffersEXT(1, &buffer.fbid2); - buffer.fbid2 = 0; - glDeleteTextures(1, &buffer.texid2); - buffer.texid2 = 0; -#endif -#endif -} - -void rglFullSync() -{ - if (rglSettings.forceSwap) - // hack for starwars, perfect dark subscreen to prevent filling up our chunk table - old_vi_origin = ~0; -} - -// note : if "same" is 1 then both tiles use the same texture, in this -// case we can't safely modify the clamping mode -void rglFixupMapping(rglStrip_t & strip, rglTile_t & tile, - float ds, float dt, float ss, float st, - float & dsm, float & dtm, int same) -{ - float mins = strip.vtxs[0].s; - float mint = strip.vtxs[0].t; - int i; - if ( (tile.mask_s && !tile.cs) || (tile.mask_t && !tile.ct) ) - for (i=1; i>4)); - else - dsm = 0; - if (tile.mask_t && !tile.ct) - dtm = -((int(mint+0.5f - tile.tl*float(1<<(tile.shift_t+4))/64.0f) + (tile.mt<>4)); - else - dtm = 0; - - if (rglSettings.hiresFb && tile.hiresBuffer) - return; - else { - GLuint wws = tile.ws, wwt = tile.wt; - - if (same || wws != GL_REPEAT) - goto skips; - for (i=0; i 1 || (a+0.5f)/ss < 0) { - goto skips; - } - } - //LOG("fixing S clamp\n"); - wws = GL_CLAMP_TO_EDGE; -skips: - if (tile.tex->ws != wws) { - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wws); - tile.tex->ws = wws; - } - - if (same || wwt != GL_REPEAT) - goto skipt; - for (i=0; i 1 || (a+0.5f)/st < 0) - goto skipt; - } - //LOG("fixing T clamp\n"); - wwt = GL_CLAMP_TO_EDGE; -skipt: - if (tile.tex->wt != wwt) { - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wwt); - tile.tex->wt = wwt; - } - } -} - -int rglUseTile(rglTile_t & tile, float & ds, float & dt, float & ss, float & st) -{ - int res = 0; - ds = -tile.sl*float(1<<(tile.shift_s+4))/64.0f; - dt = -tile.tl*float(1<<(tile.shift_t+4))/64.0f; - if (rglSettings.hiresFb && tile.hiresBuffer) { - rglRenderBuffer_t & hbuf = *tile.hiresBuffer; - // if (hbuf.flags & RGL_RB_DEPTH) { - // glBindTexture(GL_TEXTURE_2D, hbuf.depthBuffer->zbid); - // res = RGL_COMB_IN0_DEPTH; - // } else - glBindTexture(GL_TEXTURE_2D, hbuf.texid); - rglAssert(glGetError() == GL_NO_ERROR); - ss = -(hbuf.width<<(tile.shift_s+4)>>4); - st = -(hbuf.height<<(tile.shift_t+4)>>4); - ds = -ds - (((int32_t(tile.hiresAddress) - int32_t(hbuf.addressStart)) % hbuf.line) >> hbuf.size << 1); - dt = -dt - (int32_t(tile.hiresAddress) - int32_t(hbuf.addressStart)) / hbuf.line; - ss /= float(hbuf.realWidth)/hbuf.fboWidth; - st /= float(hbuf.realHeight)/hbuf.fboHeight; - ds = ss - ds; - dt = st - dt; - - DUMP("texture fb %p shift %g x %g (scale %g x %g) tile %d x %d (sl %d tl %d)\n", - &hbuf, ds, dt, ss, st, tile.w, tile.h, - tile.sl, tile.tl); - } else { - glBindTexture(GL_TEXTURE_2D, tile.tex->id); - rglAssert(glGetError() == GL_NO_ERROR); - ss = tile.w<<(tile.shift_s+4)>>4; st = tile.h<<(tile.shift_t+4)>>4; - - if (tile.tex->filter != tile.filter) { - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, tile.filter); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, tile.filter); - rglAssert(glGetError() == GL_NO_ERROR); - tile.tex->filter = tile.filter; - } - } - return res; -} - -void rglPrepareFramebuffer(rglRenderBuffer_t & buffer) -{ - //int olderased = buffer.flags & RGL_RB_ERASED; - - if (buffer.area.xh == 8192) - return; - - GLuint restoreId = 0, restoreFbid = 0; - float d2 = -1; - float d = 0; - float restoreW = buffer.width+d2, restoreH = buffer.height+d2; - int w, h; - restoreW *= float(buffer.fboWidth+d) / (buffer.realWidth+d); - restoreH *= float(buffer.fboHeight+d) / (buffer.realHeight+d); - - buffer.flags &= ~RGL_RB_ERASED; - - // buffer.width = ((buffer.area.xl - buffer.area.xh >>2) + 15)&~15; - // buffer.height = ((buffer.area.yl - buffer.area.yh >>2) + 15)&~15; - // buffer.width = ((buffer.area.xl >>2) + 3)&~3; - // buffer.height = ((buffer.area.yl >>2) + 3)&~3; - //buffer.width = ((buffer.area.xl >>2))&~7; - buffer.width = buffer.fbWidth; - //buffer.height = ((buffer.area.yl >>2))&~7; - buffer.height = ((buffer.area.yl >>2)); - if (!buffer.width) buffer.width = 1; - if (!buffer.height) buffer.height = 1; - - buffer.addressStop = buffer.addressStart + buffer.line * ((buffer.area.yl >>2)+1); - - if (rglSettings.lowres) { - buffer.realWidth = buffer.width; - buffer.realHeight = buffer.height; - } else { - if (buffer.width <= 128 || buffer.height <= 128) { - buffer.realWidth = buffer.width*4; - buffer.realHeight = buffer.height*4; - buffer.flags &= ~RGL_RB_FULL; - } else { - buffer.realWidth = screen_width * buffer.width / rglScreenWidth; - buffer.realHeight = screen_height * buffer.height / rglScreenHeight; - // buffer.realWidth = screen_width * buffer.width / vi_width; - // if (buffer.height > 250) - // buffer.realHeight = screen_height * buffer.height / 480; - // else - // buffer.realHeight = screen_height * buffer.height / 240; - buffer.flags |= RGL_RB_FULL; - } - } - - if (rglSettings.noNpotFbos) { - w = 1; h = 1; - while (w < buffer.realWidth) w <<= 1; - while (h < buffer.realHeight) h <<= 1; - } else { - w = buffer.realWidth; - h = buffer.realHeight; - } - -#ifndef NOFBO - if (buffer.fboWidth == w && buffer.fboHeight == h) - buffer.redimensionStamp = rglFrameCounter; - - if (buffer.fbid && - (//buffer.fboWidth < w || buffer.fboHeight < h || - (rglFrameCounter - buffer.redimensionStamp > 4))) { - LOG("Redimensionning buffer\n"); - restoreId = buffer.texid; - restoreFbid = buffer.fbid; - buffer.texid = buffer.fbid = 0; - rglDeleteRenderBuffer(buffer); - } - - DUMP("Render buffer %p at %x --> %x\n", &buffer, - buffer.addressStart, buffer.addressStop); - - if (!buffer.fbid) { - int glfmt; - switch (buffer.format) { - // case RDP_FORMAT_I: - // case RDP_FORMAT_CI: - // glfmt = GL_LUMINANCE; - // break; - default: -#ifdef FBORGBA - glfmt = GL_RGBA; -#else - glfmt = GL_RGB; -#endif - } - - LOG("creating fbo %x %dx%d (%dx%d) fmt %x\n", buffer.addressStart, buffer.width, buffer.height, w, h, buffer.format); - - buffer.fboWidth = w; - buffer.fboHeight = h; - -#ifdef RGL_EXACT_BLEND - glGenFramebuffersEXT(1, &buffer.fbid2); - rglAssert(glGetError() == GL_NO_ERROR); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, buffer.fbid2); - - // FIXME we should not need to allocate a color texture for depth only rendering - if (1||!(buffer.flags & RGL_RB_DEPTH)) { - glGenTextures(1, &buffer.texid2); - rglAssert(glGetError() == GL_NO_ERROR); - glBindTexture(GL_TEXTURE_2D, buffer.texid2); - rglAssert(glGetError() == GL_NO_ERROR); - glTexImage2D(GL_TEXTURE_2D, 0, glfmt, w, h, 0, - glfmt, GL_UNSIGNED_BYTE, NULL); - rglAssert(glGetError() == GL_NO_ERROR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - - // glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - // glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - - rglAssert(glGetError() == GL_NO_ERROR); - glBindTexture(GL_TEXTURE_2D, 0); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, - buffer.texid2, 0); - } -#endif - - if (restoreId) { - buffer.fbid = restoreFbid; - } else { - glGenFramebuffersEXT(1, &buffer.fbid); - rglAssert(glGetError() == GL_NO_ERROR); - } - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, buffer.fbid); - - // FIXME we should not need to allocate a color texture for depth only rendering - if (1||!(buffer.flags & RGL_RB_DEPTH)) { - glGenTextures(1, &buffer.texid); - rglAssert(glGetError() == GL_NO_ERROR); - glBindTexture(GL_TEXTURE_2D, buffer.texid); - rglAssert(glGetError() == GL_NO_ERROR); - glTexImage2D(GL_TEXTURE_2D, 0, glfmt, w, h, 0, - glfmt, GL_UNSIGNED_BYTE, NULL); - rglAssert(glGetError() == GL_NO_ERROR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - - // glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - // glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - - rglAssert(glGetError() == GL_NO_ERROR); - glBindTexture(GL_TEXTURE_2D, 0); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, - buffer.texid, 0); - - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0 ); - - if (!restoreId) { - glClearColor(0, 0, 0, 1); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glClear(GL_COLOR_BUFFER_BIT); - } else { - glViewport(0, 0, buffer.realWidth, buffer.realHeight); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glDisable(GL_DEPTH_TEST); - glBindTexture(GL_TEXTURE_2D, restoreId); - rglUseShader(rglCopyShader); - glBegin(GL_TRIANGLE_STRIP); - glTexCoord2f((buffer.width+d2)/restoreW, 0); glVertex2f(1, 0); - glTexCoord2f(0, 0); glVertex2f(0, 0); - glTexCoord2f((buffer.width+d2)/restoreW, (buffer.height+d2)/restoreH); glVertex2f(1, 1); - glTexCoord2f(0, (buffer.height+d2)/restoreH); glVertex2f(0, 1); - glEnd(); - glDeleteTextures(1, &restoreId); - } - } - } else - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, buffer.fbid); -#endif - - rglAssert(glGetError() == GL_NO_ERROR); - - // hack for LEGO racer, real fix coming soon - // if (olderased) - // { - // glDepthMask(GL_TRUE); - // glClearDepth(1); - // glClear(GL_DEPTH_BUFFER_BIT); - // } -} - -void rglRenderChunks(rglRenderBuffer_t * upto) -{ - if (upto->area.xh != 8192 && renderedChunks < upto->chunkId) - rglRenderChunks(upto->chunkId); -} - -void rglRenderChunks(int upto) -{ - int i; - //printf("vi_origin %x nbChunks %d\n", vi_origin, nbChunks); - rglRenderBuffer_t * lastBuffer = 0; - uint32_t lastDepthAddress = ~0; - float zb = 0.0f; - - DUMP("rendering chunks upto %d / %d\n", upto, nbChunks); - - glEnable(GL_SCISSOR_TEST); - for (i=renderedChunks; inbDepthSections) { - // reselect the renderbuffer with correct width (needed by LEGO racer, - // because they clear a 320x240 depth buffer to render in small 64x64 framebuffer) - // and adjust the area to the associated color buffer - // no need to optimize this search because it's rare (i.e. mainly depth clear, - // so once per frame) - for (j=chunk.renderBuffer->nbDepthSections-1; j>=0; j--) { - // LOG("j %d %d %d %d\n", j, i, chunk.renderBuffer->depthSections[j].chunkId, - // chunk.renderBuffer->depthSections[j].buffer - rBuffers); - if (i >= chunk.renderBuffer->depthSections[j].chunkId) - break; - } - //rglAssert(j < chunk.renderBuffer->nbDepthSections-1); - if (j < chunk.renderBuffer->nbDepthSections-1) { - rglRenderBuffer_t * cbuffer = chunk.renderBuffer->depthSections[j+1].buffer; - chunk.renderBuffer = rglSelectRenderBuffer(chunk.renderBuffer->addressStart, cbuffer->fbWidth, chunk.renderBuffer->size, chunk.renderBuffer->format); - chunk.renderBuffer->area = cbuffer->area; - chunk.renderBuffer->flags |= RGL_RB_DEPTH; - } - } - - rglRenderBuffer_t & buffer = *chunk.renderBuffer; - int oldFlags = ~0; - int oldTilenum = ~0; - int combFormat = 0; - - rglAssert(buffer.area.xh != 8192); - - if (lastBuffer != &buffer) - rglPrepareFramebuffer(buffer); - - DUMP("Buffer %p at %x area %d -> %d x %d -> %d\n", - &buffer, buffer.addressStart, - buffer.area.xh>>2, buffer.area.xl>>2, - buffer.area.yh>>2, buffer.area.yl>>2); - // if (buffer.addressStart != vi_origin) - // continue; - - if (buffer.flags & RGL_RB_DEPTH) - chunk.depthAddress = buffer.addressStart; - - if (lastBuffer != &buffer || - lastDepthAddress != chunk.depthAddress) { - lastBuffer = &buffer; - lastDepthAddress = chunk.depthAddress; - int j; - for (j=0; j %x with %x --> %x overlap %x\n", - // j, - // rBuffers[j].addressStart, rBuffers[j].addressStop, - // buffer.addressStart, buffer.addressStop, - // overlap); - // check if more than 10% of the buffer was erased - if (rBuffers+j != &buffer && - overlap > int(rBuffers[j].addressStop - rBuffers[j].addressStart)/10 - // rBuffers[j].addressStop > buffer.addressStart && - // rBuffers[j].addressStart < buffer.addressStop - ) { - rBuffers[j].flags |= RGL_RB_ERASED; - DUMP("erasing fb #%d\n", j); - } - } - -#ifndef NOFBO - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, buffer.fbid); - - rglDepthBuffer_t * zbuf = rglFindDepthBuffer(chunk.depthAddress, - buffer.fboWidth, buffer.fboHeight); - if (zbuf != buffer.depthBuffer) { - buffer.depthBuffer = zbuf; -#ifdef ZTEX - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, - GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, - buffer.depthBuffer->zbid, 0); -#else - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, buffer.depthBuffer->zbid ); -#endif - // glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - // GL_RENDERBUFFER_EXT, depthBuffer->zbid ); - - CHECK_FRAMEBUFFER_STATUS(); - } -#endif - - glViewport(0, 0, buffer.realWidth, buffer.realHeight); - } - - if (chunk.rdpState.clip.yl < chunk.rdpState.clip.yh || - chunk.rdpState.clip.xl < chunk.rdpState.clip.xh) - continue; - - glScissor((chunk.rdpState.clip.xh >>2)*buffer.realWidth/buffer.width, - (chunk.rdpState.clip.yh >>2)*buffer.realHeight/buffer.height, - ((chunk.rdpState.clip.xl-chunk.rdpState.clip.xh) >>2)*buffer.realWidth/buffer.width, - ((chunk.rdpState.clip.yl-chunk.rdpState.clip.yh) >>2)*buffer.realHeight/buffer.height); - rglAssert(glGetError() == GL_NO_ERROR); - -#ifndef NOFBO -#ifdef RGL_EXACT_BLEND - glPushAttrib(GL_ALL_ATTRIB_BITS); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, buffer.fbid2); - glBindTexture(GL_TEXTURE_2D, buffer.texid); - glEnable(GL_TEXTURE_2D); - rglUseShader(rglCopyShader); - glColor4ub(255,255,255,255); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glDisable(GL_DEPTH_TEST); - - for (j=0; jrdpState.otherModes) < 2) - // glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); - // else - // glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - - - if (strip.flags & RGL_STRIP_TEX1) - rglFixupMapping(strip, tile, - ds[0], dt[0], ss[0], st[0], dsm[0], dtm[0], - (strip.flags & RGL_STRIP_TEX2) && tile.tex == tile2.tex); - if (strip.flags & RGL_STRIP_TEX2) { - glActiveTextureARB(GL_TEXTURE2_ARB); - rglFixupMapping(strip, tile2, - ds[1], dt[1], ss[1], st[1], dsm[1], dtm[1], - (strip.flags & RGL_STRIP_TEX1) && tile.tex == tile2.tex); - glActiveTextureARB(GL_TEXTURE0_ARB); - } - - glBegin(GL_TRIANGLE_STRIP); - for (k=0; k but it seems less precise ! - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, - buffer.realWidth/2048.f, - buffer.realHeight/2048.f); -#endif - // if (ds || dt || ss!=1 || st!=1) { - // printf("%g x %g --> %g x %g\n", - // strip.vtxs[k].s*tile.w, - // strip.vtxs[k].t*tile.h, - // (strip.vtxs[k].s + ds) * ss, - // (strip.vtxs[k].t + dt) * st); - // } - - float - x = strip.vtxs[k].x*strip.vtxs[k].w, - y = strip.vtxs[k].y*strip.vtxs[k].w; - - if (buffer.flags & RGL_RB_DEPTH) - glVertex3f((strip.vtxs[k].x/(buffer.width)), - (strip.vtxs[k].y/(buffer.height)), - //rglZscale(chunk.rdpState.fillColor&0xffff)); - float(chunk.rdpState.fillColor&0xffff)/0xffff); - // glVertex4f((strip.vtxs[k].x/(buffer.width))*strip.vtxs[k].w, - // (strip.vtxs[k].y/(buffer.height))*strip.vtxs[k].w, - // float(chunk.rdpState.fillColor&0xffff)/0xffff*strip.vtxs[k].w, - // strip.vtxs[k].w); - else { - // glVertex4f(x/buffer.width, y/buffer.height, - // (strip.vtxs[k].z - 1.5f*zb)*(strip.vtxs[k].w), - // strip.vtxs[k].w); - - float iw = strip.vtxs[k].w; - if (iw > 1000) { - glVertex4f(x/buffer.width, y/buffer.height, - (strip.vtxs[k].z - 1.5f*zb)*strip.vtxs[k].w, - strip.vtxs[k].w); - } else { - iw = 1.0f/iw; - glVertex4f(x/buffer.width, y/buffer.height, - (strip.vtxs[k].z) / (iw + zb*0.35f), - strip.vtxs[k].w); - } - // glVertex4f(x/buffer.width, y/buffer.height, - // (strip.vtxs[k].z)*strip.vtxs[k].w, - // strip.vtxs[k].w); - } - - if (x < chunk.rdpState.clip.xh/4) - x = chunk.rdpState.clip.xh/4; - if (x > chunk.rdpState.clip.xl/4) - x = chunk.rdpState.clip.xl/4; - if (y < chunk.rdpState.clip.yh/4) - y = chunk.rdpState.clip.yh/4; - if (y > chunk.rdpState.clip.yl/4) - y = chunk.rdpState.clip.yl/4; - if (buffer.mod.xh > x) - buffer.mod.xh = x; - if (buffer.mod.xl < x) - buffer.mod.xl = x; - if (buffer.mod.yh > y) - buffer.mod.yh = y; - if (buffer.mod.yl < y) - buffer.mod.yl = y; - - } - glEnd(); - - // FIXME - // glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - - } - - buffer.flags |= RGL_RB_FBMOD; - -#ifdef RGL_EXACT_BLEND - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTextureARB(GL_TEXTURE0_ARB); -#endif - } - - glActiveTextureARB(GL_TEXTURE2_ARB); - glDisable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTextureARB(GL_TEXTURE0_ARB); - - renderedChunks = i; -} - -void rglDisplayFramebuffers() -{ - if (!(vi_control & 3)) - return; - -#ifdef RDP_DEBUG - extern int nbFullSync; - LOG("nbFyllSync %d\n", nbFullSync); - nbFullSync = 0; -#endif - - int height = (vi_control & 0x40) ? 480 : 240; - int width = vi_width; - - // from glide64 - DWORD scale_x = *gfx.VI_X_SCALE_REG & 0xFFF; - if (!scale_x) return; - DWORD scale_y = *gfx.VI_Y_SCALE_REG & 0xFFF; - if (!scale_y) return; - - float fscale_x = (float)scale_x / 1024.0f; - float fscale_y = (float)scale_y / 1024.0f; - - DWORD dwHStartReg = *gfx.VI_H_START_REG; - DWORD dwVStartReg = *gfx.VI_V_START_REG; - - DWORD hstart = dwHStartReg >> 16; - DWORD hend = dwHStartReg & 0xFFFF; - - // dunno... but sometimes this happens - if (hend == hstart) { - LOG("fix hend\n"); - hend = (int)(*gfx.VI_WIDTH_REG / fscale_x); - } - - if (hstart > hend) { - DWORD tmp=hstart; hstart=hend; hend=tmp; - LOG("swap hstart hend\n"); - } - - DWORD vstart = dwVStartReg >> 16; - DWORD vend = dwVStartReg & 0xFFFF; - - if (vstart > vend) { - DWORD tmp=vstart; vstart=vend; vend=tmp; - LOG("swap vstart vend\n"); - } - - //if (*gfx.VI_WIDTH_REG != 0x500) - if (*gfx.VI_WIDTH_REG < 0x400) - fscale_y /= 2.0f; - - // fscale_x *= screen_width / float(vi_width); - // fscale_y *= screen_height / height; - //glViewport(0*hstart*fscale_x, 0*vstart*fscale_y, (hend-hstart)*fscale_x, (vend-vstart)*fscale_y); - width = (hend-hstart)*fscale_x; - height = (vend-vstart)*fscale_y; - if (!width || !height) return; - static int oldw, oldh; - if (width == oldw && width > 200) - rglScreenWidth = width; - if (height == oldh && height > 200) - rglScreenHeight = height; - oldw = width; - oldh = height; - int vi_line = vi_width * 2; // TODO take in account the format - int vi_start = *gfx.VI_ORIGIN_REG;// - vi_line; - int vi_stop = vi_start + height * vi_line; - - - if (*gfx.VI_WIDTH_REG >= 0x400) - vi_line /= 2; - - DUMP("%x screen %x --> %x %d --> %d x %d --> %d scale %g x %g clip %g --> %g x %g --> %g %dx%d\n", - vi_line, - vi_start, vi_stop, - hstart, hend, vstart, vend, - fscale_x, fscale_y, - hstart*fscale_x, hend*fscale_x, vstart*fscale_y, vend*fscale_y, - width, height - ); - - -#ifdef NOFBO - return; -#endif - - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - glDrawBuffer(GL_BACK); - glViewport(0, viewportOffset, screen_width, screen_height); - glDisable(GL_SCISSOR_TEST); - // wine seems to catch scissor test disabling so need to define an area nevertheless - glScissor(0, viewportOffset, screen_width, screen_height); - glClearColor(0, 0, 0, 0); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glClear(GL_COLOR_BUFFER_BIT); // TODO clear a minimal area - - rglRenderBuffer_t * buffer; - CIRCLEQ_FOREACH(rglRenderBuffer_t, buffer, &rBufferHead, link) - if (!(buffer->flags & RGL_RB_ERASED) && - (uint32_t)vi_stop > buffer->addressStart && - (uint32_t)vi_start < buffer->addressStop) { - - if (buffer->size != 2 || buffer->format != RDP_FORMAT_RGBA) - continue; // FIXME - - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - glDrawBuffer(GL_BACK); - glViewport(0, viewportOffset, screen_width, screen_height); - - glDisable(GL_SCISSOR_TEST); - // wine seems to catch scissor test disabling so need to define an area nevertheless - glScissor(0, viewportOffset, screen_width, screen_height); - - glDisable(GL_ALPHA_TEST); - glDisable(GL_BLEND); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0_ARB); - - - - float x = (int32_t(buffer->addressStart - vi_start) % int(vi_line)) / 2; - float y = height - buffer->height - (int32_t(buffer->addressStart - vi_start) / int(vi_line)); - //x=y=0; - DUMP("displaying fb %x %d x %d (%d x %d) at %g x %g\n", buffer->addressStart, - buffer->width, buffer->height, - buffer->realWidth, buffer->realHeight, - x, y); - y -= *gfx.VI_V_CURRENT_LINE_REG & 1; // prevent interlaced modes flickering - x = x / width; - y = y / height; - rglUseShader(rglCopyShader); - glBindTexture(GL_TEXTURE_2D, buffer->texid); - glEnable(GL_TEXTURE_2D); - glDisable(GL_DEPTH_TEST); - glDisable(GL_BLEND); - glColor4ub(255, 255, 255, 255); - glBegin(GL_TRIANGLE_STRIP); - glTexCoord2f(float(buffer->realWidth)/buffer->fboWidth, float(buffer->realHeight)/buffer->fboHeight); glVertex2f(x+float(buffer->width-1)/(width-1), y+0); - glTexCoord2f(0, float(buffer->realHeight)/buffer->fboHeight); glVertex2f(x+0, y+0); - glTexCoord2f(float(buffer->realWidth)/buffer->fboWidth, 0); glVertex2f(x+float(buffer->width-1)/(width-1), y+float(buffer->height-1)/(height-1)); - glTexCoord2f(0, 0); glVertex2f(x+0, y+float(buffer->height-1)/(height-1)); - glEnd(); - } -} - -void rglUpdate() -{ - int i; - - if (old_vi_origin == vi_origin) { - //printf("same\n"); - return; - } - old_vi_origin = vi_origin; - - DUMP("updating vi_origin %x vi_hstart %d vi_vstart %d\n", - vi_origin, *gfx.VI_H_START_REG, *gfx.VI_V_START_REG); - - glPolygonMode(GL_FRONT_AND_BACK, wireframe? GL_LINE : GL_FILL); - - rglRenderChunks(nbChunks); - - rglDisplayFramebuffers(); - -#ifndef NOFBO - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#endif - rglUseShader(0); - glDrawBuffer(GL_BACK); - rglSwapBuffers(); - - rglFrameCounter++; - - // for (i=0; i=0; i--) - if (rBuffers[i].addressStart == addr && - rBuffers[i].fbWidth == width && - rBuffers[i].size == size) - break; - - if (i >= 0) { - return rBuffers + i; - // TODO need to take care of framebuffer format possible change (?) - } - - rglAssert(nbRBuffers < MAX_RENDER_BUFFERS); - // if (nbRBuffers == MAX_RENDER_BUFFERS) - // rglClearRenderBuffers(); - - i = nbRBuffers++; - rglRenderBuffer_t * cur = rBuffers + i; - - cur->addressStart = addr; - cur->format = format; - cur->size = size; - cur->fbWidth = width; - cur->area = rdpState.clip; - cur->line = (width << size >> 1); - cur->flags = 0; - CIRCLEQ_INSERT_HEAD(rglRenderBuffer_t, &rBufferHead, cur, link); - return cur; -} - -void rglPrepareRendering(int texturing, int tilenum, int recth, int depth) -{ - if (!rdpChanged) - goto ok; - - //rglUpdate(); - - depth = /*depth && */(RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) < 2) && - (RDP_GETOM_Z_UPDATE_EN(rdpState.otherModes) || - RDP_GETOM_Z_COMPARE_EN(rdpState.otherModes)); - - if (curRBuffer) - curRBuffer->chunkId = nbChunks; - - if (!curZBuffer || - (rdpChanged & (RDP_BITS_ZB_SETTINGS | RDP_BITS_FB_SETTINGS)) || - curZBuffer->addressStart != rdpZbAddress) { - // first search the most recent without considering the width of the buffer - rglRenderBuffer_t * buf; - curZBuffer = 0; - CIRCLEQ_FOREACH(rglRenderBuffer_t, buf, &rBufferHead, link) - if (buf->addressStart == rdpZbAddress) { - curZBuffer = buf; - break; - } - if (!curZBuffer) { - curZBuffer = rglSelectRenderBuffer(rdpZbAddress, rdpFbWidth, 2, RDP_FORMAT_RGBA); - CIRCLEQ_REMOVE(&rBufferHead, curZBuffer, link); - CIRCLEQ_INSERT_HEAD(rglRenderBuffer_t, &rBufferHead, curZBuffer, link); - } - } - - if (rdpChanged & (RDP_BITS_ZB_SETTINGS | RDP_BITS_FB_SETTINGS)) { - curRBuffer = rglSelectRenderBuffer(rdpFbAddress, rdpFbWidth, rdpFbSize, rdpFbFormat); - CIRCLEQ_REMOVE(&rBufferHead, curRBuffer, link); - CIRCLEQ_INSERT_HEAD(rglRenderBuffer_t, &rBufferHead, curRBuffer, link); - } - - if (rdpChanged & (RDP_BITS_TMEM | RDP_BITS_TLUT | RDP_BITS_TILE_SETTINGS)) - rglTouchTMEM(); - - if (rdpChanged & (RDP_BITS_CLIP | RDP_BITS_ZB_SETTINGS | RDP_BITS_FB_SETTINGS) && - rdpState.clip.xh <= rdpState.clip.xl && rdpState.clip.yh <= rdpState.clip.yl) - { - if (curRBuffer->area.xh == 8192) - curRBuffer->flags &= ~RGL_RB_HASTRIANGLES; - - if (curRBuffer->area.xh > rdpState.clip.xh) - curRBuffer->area.xh = rdpState.clip.xh; - if (curRBuffer->area.xl < rdpState.clip.xl) - curRBuffer->area.xl = rdpState.clip.xl; - if (curRBuffer->area.yh > rdpState.clip.yh) - curRBuffer->area.yh = rdpState.clip.yh; - if (curRBuffer->area.yl < rdpState.clip.yl) - curRBuffer->area.yl = rdpState.clip.yl; - } - - curRBuffer->chunkId = nbChunks; // don't include THIS chunk yet in case of feedback rendering (cf CBFD) - // if (curZBuffer) - // curZBuffer->chunkId = nbChunks; - - curChunk = chunks + nbChunks++; - rglAssert(nbChunks < MAX_RENDER_CHUNKS); - - curChunk->strips = strips + nbStrips; - curChunk->nbStrips = 0; - curChunk->renderBuffer = curRBuffer; - curChunk->flags = 0; - curChunk->rdpState = rdpState; - curChunk->depthAddress = rdpZbAddress; - -#ifdef RDP_DEBUG - curChunk->tracePos = rdpTracePos; -#endif - - if (depth) { - curZBuffer->flags |= RGL_RB_DEPTH; - //rglRenderChunks(curZBuffer); - - if (rdpFbAddress != rdpZbAddress) { - if (!curZBuffer->nbDepthSections || - curZBuffer->depthSections[curZBuffer->nbDepthSections-1].buffer != curRBuffer) { - rglAssert(curZBuffer->nbDepthSections < RGL_MAX_DEPTH_SECTIONS); - curZBuffer->depthSections[curZBuffer->nbDepthSections].buffer = curRBuffer; - curZBuffer->nbDepthSections++; - } - curZBuffer->depthSections[curZBuffer->nbDepthSections-1].chunkId = nbChunks; - } - } - - { - // eliminate useless bits - int cycle = RDP_GETOM_CYCLE_TYPE(curChunk->rdpState.otherModes); - curChunk->rdpState.otherModes.w2 &= rdpBlendMasks[cycle].w2; - curChunk->rdpState.combineModes.w1 &= rdpCombineMasks[cycle].w1; - curChunk->rdpState.combineModes.w2 &= rdpCombineMasks[cycle].w2; - } - - rdpChanged = 0; - -ok: - if (texturing && !(curChunk->flags & (1<flags |= (1<tiles[tilenum], recth); - } -} - - -void rglClose() -{ - -#ifdef RDP_DEBUG - rglCloseDebugger(); -#endif - - rglClearRenderBuffers(); - - rglResetTextureCache(); - - nbChunks = 0; - nbStrips = 0; - nbVtxs = 0; - - if (rglCopyShader) rglDeleteShader(rglCopyShader); - rglCopyShader = 0; - if (rglCopyDepthShader) rglDeleteShader(rglCopyDepthShader); - rglCopyDepthShader = 0; - rglClearCombiners(); -} - - -int rglInit() -{ - static int init; - if (!init) { - init = 1; - glewInit(); - } - - glViewport(0, 0, screen_width, screen_height); - - glLoadIdentity(); -#ifdef NOFBO - glScalef(2, -2, 1); -#else - glScalef(2, 2, 1); -#endif - glTranslatef(-0.5, -0.5, 0); - - glEnable(GL_DEPTH_TEST); - - rglClose(); - - rglCopyShader = rglCreateShader( - "void main() \n" - "{ \n" - " gl_Position = ftransform(); \n" - " gl_FrontColor = gl_Color; \n" - " gl_TexCoord[0] = gl_MultiTexCoord0; \n" - "} \n" - , - "uniform sampler2D texture0; \n" - " \n" - "void main() \n" - "{ \n" - " gl_FragColor = gl_Color * texture2D(texture0, vec2(gl_TexCoord[0])); \n" - "} \n" - ); - - rglCopyDepthShader = rglCreateShader( - "void main() \n" - "{ \n" - " gl_Position = ftransform(); \n" - " gl_FrontColor = gl_Color; \n" - " gl_TexCoord[0] = gl_MultiTexCoord0; \n" - "} \n" - , - "uniform sampler2D texture0; \n" - " \n" - "void main() \n" - "{ \n" - " gl_FragDepth = texture2D(texture0, vec2(gl_TexCoord[0]))[0]; \n" - "} \n" - ); - - rdpChanged = ~0; - return 1; -} - - -#ifdef __cplusplus -extern "C" { -#endif - - EXPORT void CALL FBWrite(DWORD addr, DWORD size) - { - if (!rglSettings.fbInfo || rglSettings.async) - return; - //LOG("FBWrite %x\n", addr); - rglRenderBuffer_t * buffer; - addr &= 0x7fffff; - CIRCLEQ_FOREACH(rglRenderBuffer_t, buffer, &rBufferHead, link) { - if (addr >= buffer->addressStart && addr+size <= buffer->addressStop) { - //LOG("FBWrite in fb #%d\n", buffer - rBuffers); - buffer->flags &= ~RGL_RB_FBMOD; - buffer->mod.xl = buffer->mod.yl = 0; - buffer->mod.xh = buffer->mod.yh = 8192; - //break; - } - } - //LOG("FBWrite %x %d\n", addr, size); - } - - //EXPORT void CALL FBWList(FrameBufferModifyEntry *plist, DWORD size) - //{ - // LOG("FBWList size %d\n", size); - //} - - EXPORT void CALL FBRead(DWORD addr) - { - if (!rglSettings.fbInfo || rglSettings.async) - return; - //LOG("FBRead %x\n", addr); - rglRenderBuffer_t * buffer; - addr &= 0x7fffff; - CIRCLEQ_FOREACH(rglRenderBuffer_t, buffer, &rBufferHead, link) { - if (addr >= buffer->addressStart && addr < buffer->addressStop) { - // LOG("writing to rdram buffer %x --> %x\n", - // buffer->addressStart, buffer->addressStop); - rglFramebuffer2Rdram(*buffer, buffer->addressStart, buffer->addressStop); - break; - } - } - } - - EXPORT void CALL FBGetFrameBufferInfo(void *p) - { - typedef struct - { - DWORD addr; - DWORD size; - DWORD width; - DWORD height; - } FrameBufferInfo; - - FrameBufferInfo * pinfo = (FrameBufferInfo *)p; - int i; - - if (!rglSettings.fbInfo) - return; - //LOG("GetFbInfo\n"); - - rglRenderBuffer_t * buffer; - i=0; - CIRCLEQ_FOREACH(rglRenderBuffer_t, buffer, &rBufferHead, link) { - // printf("#%d (%dx%d) %x --> %x\n", i, - // buffer->width, buffer->height, - // buffer->addressStart, - // buffer->addressStart + buffer->width*buffer->height*2); - pinfo[i].addr = buffer->addressStart; - pinfo[i].size = 2; // FIXME - pinfo[i].width = buffer->width; - pinfo[i].height = buffer->height; - i++; if (i>=6) break; - } - for ( ; i<6; i++) { - pinfo[i].addr = 0; - pinfo[i].size = 0; - pinfo[i].width = 4; - pinfo[i].height = 4; - } - } - - -#ifdef __cplusplus -} -#endif - -static char exptable[256]; - -static void build_exptable() -{ - LOG("Building depth exp table\n"); - int i; - for (i=0; i<256; i++) { - int s; - for (s=0; s<7; s++) - if (!(i&(1<<(6-s)))) - break; - exptable[i] = s; - } -} - -void rglFramebuffer2Rdram(rglRenderBuffer_t & buffer, uint32_t start, uint32_t stop) -{ - int depth; - - rglRenderChunks(&buffer); - - if (!(buffer.flags & RGL_RB_FBMOD)) - return; - - // if (buffer.area.xh == 8192) - // return; - // rglAssert (buffer.area.xh != 8192); - - depth = buffer.flags & RGL_RB_DEPTH; - //depth = 1; - - int glfmt, packed; - int x, y; - int rw, rh; - int rx, ry; - uint8_t * ram = gfx.RDRAM + buffer.addressStart; - static uint8_t * fb = rglTmpTex; - if (depth) { - glfmt = GL_DEPTH_COMPONENT; - //packed = GL_UNSIGNED_SHORT; - packed = GL_FLOAT; - } else { - glfmt = GL_RGBA; - packed = GL_UNSIGNED_BYTE; - } - - rx = buffer.mod.xh; - ry = buffer.mod.yh; - rw = (int(buffer.mod.xl) - int(buffer.mod.xh)); - rh = (int(buffer.mod.yl) - int(buffer.mod.yh)); - - if (rw > buffer.fbWidth) - rw = buffer.fbWidth; - - LOG("writing to rdram %x %s-%d %d %dx%d %dx%d %dx%d\n", - buffer.addressStart, depth? "depth":rdpImageFormats[buffer.format], buffer.size, - buffer.fbWidth, - buffer.width, buffer.height, - rx, ry, - rw, rh); - fflush(stderr); - - if (rw <= 0 || rh <= 0) - return; - - // rx=ry=0; - // rw = buffer.width; - // rh = buffer.height; - - glPushAttrib(GL_ALL_ATTRIB_BITS); -#ifndef NOFBO - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#endif - glDrawBuffer(GL_BACK); - glReadBuffer(GL_BACK); - glDisable(GL_SCISSOR_TEST); - glViewport(0, 0, buffer.width, buffer.height); // FIXME why +1 ? - // wine seems to catch scissor test disabling so need to define an area nevertheless - glScissor(0, 0, buffer.width+1, buffer.height+1); - glEnable(GL_TEXTURE_2D); - glDisable( GL_ALPHA_TEST ); - if (depth) { - glBindTexture(GL_TEXTURE_2D, buffer.depthBuffer->zbid); - rglUseShader(rglCopyDepthShader); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_ALWAYS); - glDepthMask(GL_TRUE); - glDisable( GL_POLYGON_OFFSET_FILL ); - } else { - glBindTexture(GL_TEXTURE_2D, buffer.texid); - rglUseShader(rglCopyShader); - glDisable(GL_DEPTH_TEST); - glDisable(GL_BLEND); - glColor4ub(255, 255, 255, 255); - } - glBegin(GL_TRIANGLE_STRIP); - glTexCoord2f(1, 1); glVertex2f(1, 1); - glTexCoord2f(0, 1); glVertex2f(0, 1); - glTexCoord2f(1, 0); glVertex2f(1, 0); - glTexCoord2f(0, 0); glVertex2f(0, 0); - glEnd(); - - glReadPixels(rx, ry, rw, rh, - glfmt, packed, - fb); - - - if (depth) { - if (!exptable[255]) - build_exptable(); - for (x=rx; x>(18-8)]; - - a = ( ( (e>=6? a : (a>>(6-e))) & ((1<<11)-1) ) << 2 ) | (e<<(16-3)); - - *(uint16_t *)&ram[(x*2 + y*buffer.line) ^ 2] = - a; - //int(*(uint16_t *)&fb[(x-rx)*2 + (y-ry)*rw*2])-2; - //(*(uint16_t *)&fb[(x-rx)*2 + (y-ry)*rw*2] - int(0x8000))*2; - //(*(float *)&fb[(x-rx)*4 + (y-ry)*rw*4]-0.5)*0x1ffff; - } - } else { - switch (buffer.size) { - case 1: - for (x=rx; x>2) | - ((a&0x80)>>7); - } - break; - } - } - - buffer.mod.xl = buffer.mod.yl = 0; - buffer.mod.xh = buffer.mod.yh = 8192; - - //if (start <= buffer.addressStart && stop >= buffer.addressStop) - buffer.flags &= ~RGL_RB_FBMOD; - - glPopAttrib(); -} - -void rglUpdateStatus() -{ - if (rglNextStatus != rglStatus) { - const char * status[] = { "closed", "windowed", "fullscreen" }; - LOG("Status %s --> %s\n", status[rglStatus], status[rglNextStatus]); - rglCloseScreen(); - rglStatus = rglNextStatus; - if (rglNextStatus != RGL_STATUS_CLOSED) - rglOpenScreen(); - } -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl.h b/libmupen64plus/mupen64plus-video-z64/src/rgl.h deleted file mode 100644 index c15f93fb1b..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#ifndef _RGL_H_ -#define _RGL_H_ - -#include "queue.h" -#include "rgl_assert.h" -#include "rdp.h" - -#include -#if defined(__MACOSX__) -#include -#elif defined(__MACOS__) -#include -#else -#include -#endif - -#ifdef RDP_DEBUG -//#include -#endif - -#include "glshader.h" - -#include //for PATH_MAX - -#define DWORD unsigned int -extern GFX_INFO gfx; -#define rdram ((uint32_t*)gfx.RDRAM) -#define rsp_imem ((uint32_t*)gfx.IMEM) -#define rsp_dmem ((uint32_t*)gfx.DMEM) -#define vi_origin (*(uint32_t*)gfx.VI_ORIGIN_REG) -#define vi_width (*(uint32_t*)gfx.VI_WIDTH_REG) -#define vi_control (*(uint32_t*)gfx.VI_STATUS_REG) - -#define dp_start (*(uint32_t*)gfx.DPC_START_REG) -#define dp_end (*(uint32_t*)gfx.DPC_END_REG) -#define dp_current (*(uint32_t*)gfx.DPC_CURRENT_REG) -#define dp_status (*(uint32_t*)gfx.DPC_STATUS_REG) - -// highly experimental AND slow -//#define RGL_EXACT_BLEND - -struct rglSettings_t { - int hiresFb; - int resX, resY; - int fsResX, fsResY; - int fbInfo; - int forceSwap; - int threaded; - int async; - int noNpotFbos; - int lowres; - int fullscreen; -}; - -extern rglSettings_t rglSettings; -extern void (*render_callback)(int); - -struct rglDepthBuffer_t { - uint32_t address; - int width, height; - GLuint zbid; -}; -#define MAX_DEPTH_BUFFERS 16 -extern rglDepthBuffer_t zBuffers[MAX_DEPTH_BUFFERS]; -extern int nbZBuffers; - -struct rglRenderBuffer_t; -struct rglDepthSection_t { - rglRenderBuffer_t * buffer; - int chunkId; -}; -#define RGL_MAX_DEPTH_SECTIONS 16 - -struct rglRenderBuffer_t { - CIRCLEQ_ENTRY(rglRenderBuffer_t) link; - uint32_t addressStart, addressStop; - int format, size, fbWidth, line; - int width, height; - int flags; - GLuint texid, fbid; -#ifdef RGL_EXACT_BLEND - GLuint texid2, fbid2; -#endif - int realWidth, realHeight; - int fboWidth, fboHeight; - int redimensionStamp; - rdpRect_t area; - rdpRect_t mod; - rglDepthBuffer_t * depthBuffer; - int chunkId; - rglDepthSection_t depthSections[16]; - int nbDepthSections; -}; -#define RGL_RB_DEPTH 1 -#define RGL_RB_FULL 2 -#define RGL_RB_ERASED 4 -#define RGL_RB_FBMOD 8 // the GL framebuffer was modified -#define RGL_RB_RAMMOD 16 // the framebuffer was modified in rdram -#define RGL_RB_HASTRIANGLES 32 // we assume it's not a depth buffer in this case - -CIRCLEQ_HEAD(rglRenderBufferHead_t, rglRenderBuffer_t); - -#define MAX_RENDER_BUFFERS 64 -extern rglRenderBuffer_t rBuffers[MAX_RENDER_BUFFERS]; -extern int nbRBuffers; -extern rglRenderBuffer_t * curRBuffer; -extern rglRenderBuffer_t * curZBuffer; -extern rglRenderBufferHead_t rBufferHead; - -extern int rglTexCacheCounter; -struct rglTexture_t { - CIRCLEQ_ENTRY(rglTexture_t) byCrc, byUsage; - GLuint id, zid; - uint32_t crc; - int w, h, fmt; - int clipw, cliph; - GLuint ws, wt, filter; // current settings -}; -CIRCLEQ_HEAD(rglTextureHead_t, rglTexture_t); -#define RGL_TEX_CACHE_SIZE 1024 -extern rglTexture_t rglTextures[RGL_TEX_CACHE_SIZE]; -struct rglTexCache_t { - int counter; - rglTexture_t * tex; -}; -extern rglTexCache_t rglTexCache[0x1000]; -extern uint8_t rglTmpTex[]; -extern uint8_t rglTmpTex2[]; - -struct rglTile_t : public rdpTile_t { - rglTexture_t * tex; - rglRenderBuffer_t * hiresBuffer; - uint32_t hiresAddress; - GLuint ws, wt; // GL clamping modes - GLuint filter; // GL filter mode -}; - -struct rglVertex_t { - float x, y, z, w; - float s, t; - uint8_t r, g, b, a; -}; - -struct rglStrip_t { - int tilenum; - int nbVtxs; - int flags; - rglVertex_t * vtxs; -}; - -#define RGL_STRIP_TEX1 1 -#define RGL_STRIP_TEX2 2 -#define RGL_STRIP_SHADE 4 -#define RGL_STRIP_ZBUFFER 8 - -struct rglRenderChunk_t { - rdpState_t rdpState; - rglTile_t tiles[8]; - rglRenderBuffer_t * renderBuffer; - uint32_t depthAddress; - int flags; - int nbStrips; - rglStrip_t * strips; -#ifdef RDP_DEBUG - rglShader_t * shader; - int tracePos; -#endif -}; - -// first 8 bits used for tile usage -#define RGL_CHUNK_CLEAR (1<<8) - -#define MAX_RENDER_CHUNKS 40000 -extern rglRenderChunk_t chunks[MAX_RENDER_CHUNKS]; -extern rglRenderChunk_t * curChunk; -extern int nbChunks; - -#define MAX_STRIPS 80000 -extern rglStrip_t strips[MAX_STRIPS]; -extern rglVertex_t vtxs[6*MAX_STRIPS]; -extern int nbStrips, nbVtxs; - -struct rglRenderMode_t { - rdpOtherModes_t otherModes; - rdpCombineModes_t combineModes; - uint32_t flags; -}; - -#define RGL_RM_DEPTH 1 - -// TODO use a hash table -#define MAX_RENDER_MODES 1024 -extern rglRenderMode_t renderModesDb[MAX_RENDER_MODES]; -extern int nbRenderModes; - -extern rglShader_t * rglCopyShader; -extern rglShader_t * rglCopyDepthShader; - - -#define RGL_COMB_FMT_RGBA 0 -#define RGL_COMB_FMT_I 1 -#define RGL_COMB_FMT_DEPTH 2 -#define RGL_COMB_FMT 3 -#define RGL_COMB_IN0_DEPTH 4 -#define RGL_COMB_IN0 4 -#define RGL_COMB_IN1_DEPTH 8 -#define RGL_COMB_IN1 8 -#define RGL_COMB_TILE7 16 - -extern volatile int rglStatus, rglNextStatus; -#define RGL_STATUS_CLOSED 0 -#define RGL_STATUS_WINDOWED 1 -#define RGL_STATUS_FULLSCREEN 2 - - -void rglUpdateStatus(); -void rglTouchTMEM(); -void rglResetTextureCache(); -void rglTile(rdpTile_t & tile, rglTile_t & rtile, int recth); -void rglRenderMode(rglRenderChunk_t & chunk); -void rglBlender(rglRenderChunk_t & chunk); -void rglClearCombiners(); -void rglSetCombiner(rglRenderChunk_t & chunk, int format); -void rglPrepareRendering(int texturing, int tilenum, int recth, int depth); -rglRenderBuffer_t * rglSelectRenderBuffer(uint32_t addr, int width, int size, int format); -char * rglCombiner2String(rdpState_t & state); - - -int rglInit(); -void rglClose(); -int rglOpenScreen(); -void rglCloseScreen(); -int rglReadSettings(); -void rglUpdate(); -void rglFullSync(); -void rglTextureRectangle(rdpTexRect_t * rect, int flip); -void rglFillRectangle(rdpRect_t * rect); -void rglTriangle(uint32_t w1, uint32_t w2, int shade, int texture, int zbuffer, - uint32_t * rdp_cmd); -void rglRenderChunks(); -void rglDisplayFramebuffers(); -int rglT1Usage(rdpState_t & state); -int rglT2Usage(rdpState_t & state); -void rglDebugger(); -void rglCloseDebugger(); -void rglFramebuffer2Rdram(rglRenderBuffer_t & buffer, uint32_t start, uint32_t stop); -void rglRdram2Framebuffer(rglRenderBuffer_t & buffer, uint32_t start, uint32_t stop); -void rglRenderChunks(rglRenderBuffer_t * upto); -void rglRenderChunks(int upto); -float rglZscale(uint16_t z); - -void rglSwapBuffers(); - -extern int screen_width, screen_height; - -extern void check(); - -#endif diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_assert.h b/libmupen64plus/mupen64plus-video-z64/src/rgl_assert.h deleted file mode 100644 index c2e406dadf..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_assert.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#ifndef _RGL_ASSERT_H_ -#define _RGL_ASSERT_H_ - -#include - -#ifdef RGL_ASSERT -inline void _rglAssert(int test, const char * s, int line, const char * file) { - if (!test) { - fprintf(stderr, "z64 assert failed (%s : %d) : %s\n", file, line, s); - fflush(stdout); - fflush(stderr); - *(unsigned int *)0 = 0xdeadbeef; // hopefully will generate a segfault - exit(-1); - } -} -#define rglAssert(test) _rglAssert((test), #test, __LINE__, __FILE__) -#else -#define rglAssert(test) -#endif - -#endif diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_debugger.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_debugger.cpp deleted file mode 100644 index 740be9e0c3..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_debugger.cpp +++ /dev/null @@ -1,861 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -static const char *saRGBText[] = -{ - "PREV", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "NOISE", "1", - "0", "0", "0", "0", - "0", "0", "0", "0" -}; - -static const char *mRGBText[] = -{ - "PREV", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "SCALE", "PREV_ALPHA", - "TEXEL0_ALPHA", "TEXEL1_ALPHA", "PRIM_ALPHA", "SHADE_ALPHA", - "ENV_ALPHA", "LOD_FRACTION", "PRIM_LOD_FRAC", "K5", - "0", "0", "0", "0", - "0", "0", "0", "0", - "0", "0", "0", "0", - "0", "0", "0", "0" -}; - -static const char *aRGBText[] = -{ - "PREV", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "1", "0", -}; - -static const char *saAText[] = -{ - "PREV", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "1", "0", -}; - -static const char *sbAText[] = -{ - "PREV", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "1", "0", -}; - -static const char *mAText[] = -{ - "LOD_FRACTION", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "PRIM_LOD_FRAC", "0", -}; - -static const char *aAText[] = -{ - "PREV", "TEXEL0", "TEXEL1", "PRIM", - "SHADE", "ENV", "1", "0", -}; - -const static char * bRGBText[] = { "PREV", "FRAG", "BLEND", "FOG" }; -const static char * bAText[2][4] = { {"PREVA", "FOGA", "SHADEA", "0"}, -{"(1.0-ALPHA)", "FRAGA", "1", "0"}}; - -char * rglCombiner2String(rdpState_t & state) -{ - rdpOtherModes_t om = state.otherModes; - int cycle = RDP_GETOM_CYCLE_TYPE(om); - static char res[256]; - char * p = res; - if (cycle < 2) { - p += sprintf( - p, - "c = [ (%s - %s) * %s + %s | (%s - %s) * %s + %s ]\n", - saRGBText[RDP_GETCM_SUB_A_RGB0(state.combineModes)], - saRGBText[RDP_GETCM_SUB_B_RGB0(state.combineModes)], - mRGBText[RDP_GETCM_MUL_RGB0(state.combineModes)], - aRGBText[RDP_GETCM_ADD_RGB0(state.combineModes)], - saAText[RDP_GETCM_SUB_A_A0(state.combineModes)], - sbAText[RDP_GETCM_SUB_B_A0(state.combineModes)], - mAText[RDP_GETCM_MUL_A0(state.combineModes)], - aAText[RDP_GETCM_ADD_A0(state.combineModes)]); - } - if (cycle == 1) { - p += sprintf( - p, - "c = [ (%s - %s) * %s + %s | (%s - %s) * %s + %s ]\n", - saRGBText[RDP_GETCM_SUB_A_RGB1(state.combineModes)], - saRGBText[RDP_GETCM_SUB_B_RGB1(state.combineModes)], - mRGBText[RDP_GETCM_MUL_RGB1(state.combineModes)], - aRGBText[RDP_GETCM_ADD_RGB1(state.combineModes)], - saAText[RDP_GETCM_SUB_A_A1(state.combineModes)], - sbAText[RDP_GETCM_SUB_B_A1(state.combineModes)], - mAText[RDP_GETCM_MUL_A1(state.combineModes)], - aAText[RDP_GETCM_ADD_A1(state.combineModes)]); - } - if (cycle < 2) { - p += sprintf( - p, - "%s*%s + %s*%s\n" - ,bAText[0][RDP_GETOM_BLEND_M1B_0(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M1A_0(state.otherModes)], - bAText[1][RDP_GETOM_BLEND_M2B_0(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M2A_0(state.otherModes)] - ); - } - if (cycle == 1) { - p += sprintf( - p, - "%s*%s + %s*%s\n" - ,bAText[0][RDP_GETOM_BLEND_M1B_1(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M1A_1(state.otherModes)], - bAText[1][RDP_GETOM_BLEND_M2B_1(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M2A_1(state.otherModes)] - ); - } - return res; -} - -#ifdef RDP_DEBUG - -#include -//#include -#include - -#include - -#define FONT "LucidaTypewriterRegular.ttf" -#define SMALLFONT "LucidaTypewriterRegular.ttf" -//#define SMALLFONT "/usr/share/fonts/corefonts/arial.ttf" -#define FS 12 -#define SMALLFS 12 - -static FTFont * font; -static FTFont * smallfont; -static FTFont * curfont; - -static int fbindex; -static int chunkindex, stripindex; -static int mx, my; -static float scalex, scaley; -static rglShader_t * alphaShader; - -static int lines[0x10000], nblines; -static char dasm[512]; - -void gglPrint(int x, int y, const char * text) -{ - glPushAttrib(GL_ALL_ATTRIB_BITS); - glPushMatrix(); - glTranslatef(x, y, 0); - - glEnable( GL_TEXTURE_2D); - glDisable( GL_DEPTH_TEST); - //glRasterPos2i( x , y); - curfont->Render(text); - - glPopMatrix(); - glPopAttrib(); - - //printf("%s\n", text); -} - -void gglPrintf(int x, int y, const char * s, ...) -{ - char buf[1024]; - va_list ap; - va_start(ap, s); - vsprintf(buf, s, ap); - va_end(ap); - gglPrint(x, y, buf); -} - -void rglDisplayTrace(int x, int y, int start, int lines) -{ - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - rglUseShader(0); - curfont = smallfont; - start = ::lines[start]; - while (lines-->0 && start <= rdpTracePos) { - glColor4f(0,0,0, 0.5); - glEnable(GL_BLEND); - glDisable(GL_TEXTURE_2D); - glBegin(GL_TRIANGLE_STRIP); - glVertex2f(x, y); - glVertex2f(x+2*screen_width*3/4, y); - glVertex2f(x, y-(SMALLFS+2)); - glVertex2f(x+2*screen_width*3/4, y-(SMALLFS+2)); - glEnd(); - - glColor4f(1,1,0.5,1); - glDisable(GL_BLEND); - start += rdp_dasm(rdpTraceBuf, start, start+256, dasm)/4; - gglPrintf(x, y-(SMALLFS), "%4x %s", start, dasm); - y -= (SMALLFS+2); - } - curfont = font; - // glDisable(GL_BLEND); -} - -void rglDisplayColor(uint32_t color, int x , int y, const char * name, int sixteen = 0) -{ - float r, g, b, a; - if (sixteen) { - r = RDP_GETC16_R(color)/ 31.0f; - g = RDP_GETC16_G(color)/ 31.0f; - b = RDP_GETC16_B(color)/ 31.0f; - a = RDP_GETC16_A(color)/ 1.0f; - } else { - r = RDP_GETC32_R(color)/255.0f; - g = RDP_GETC32_G(color)/255.0f; - b = RDP_GETC32_B(color)/255.0f; - a = RDP_GETC32_A(color)/255.0f; - } - y -= FS+2; - glColor4f(r, g, b, 1); - glDisable(GL_TEXTURE_2D); - glBegin(GL_TRIANGLE_STRIP); - glVertex2f(x, y); - glVertex2f(x+128, y); - glVertex2f(x, y-16); - glVertex2f(x+128, y-16); - glEnd(); - - glEnable(GL_TEXTURE_2D); - glColor4f(1,1,1,1); - gglPrintf(x, y+2, "%5s %08x", name, color); - -} - -void rglDisplayChunkInfo(rglRenderChunk_t & chunk) -{ - int x = 0, y = screen_height; - int i; - rdpState_t & state = chunk.rdpState; - rdpOtherModes_t om = state.otherModes; - rdpCombineModes_t cm = state.combineModes; - int cycle = RDP_GETOM_CYCLE_TYPE(om); - - rglDisplayColor(chunk.rdpState.primColor, x, y, "prim"); - y -= 16+FS+10; - rglDisplayColor(chunk.rdpState.blendColor, x, y, "blend"); - y -= 16+FS+10; - rglDisplayColor(chunk.rdpState.envColor, x, y, "env"); - y -= 16+FS+10; - rglDisplayColor(chunk.rdpState.fogColor, x, y, "fog"); - y -= 16+FS+10; - rglDisplayColor(chunk.rdpState.fillColor, x, y, "fill", 1); - y -= 16+FS+10; - - y += 5*(16+FS+10); - x += 128+20; - - glColor4f(1,1,1,1); - int oldy = y; - for (i=0; i<8; i++) { - int j; - int oldx = x; - if (!(chunk.flags & (1< 64) w = 64; - if (h > 64) h = 64; - gglPrintf(x, y-h-FS, "#%d %dx%d %x", i, tile.w, tile.h, tile.hiresBuffer? 0 : tile.tex->crc); - gglPrintf(x, y-h-2*FS, "fmt %s-%d %d %d", rdpImageFormats[tile.format], tile.size, tile.line, tile.hiresBuffer? tile.hiresBuffer-rBuffers : -1); - gglPrintf(x, y-h-3*FS, "clip %dx%d %dx%d", tile.sl, tile.tl, tile.sh, tile.th); - gglPrintf(x, y-h-4*FS, "mask %dx%d shift %dx%d", tile.mask_s, tile.mask_t, tile.shift_s, tile.shift_t); - gglPrintf(x, y-h-5*FS, "%d %d %d %d pal %d", tile.cs, tile.ms, tile.ct, tile.ms, tile.palette); - glEnable(GL_TEXTURE_2D); - if (tile.hiresBuffer) - glBindTexture(GL_TEXTURE_2D, tile.hiresBuffer->texid); - else - glBindTexture(GL_TEXTURE_2D, tile.tex->id); - for (j=0; j<2; j++) { - glBegin(GL_TRIANGLE_STRIP); - glTexCoord2f(0, 0); glVertex2f(x, y); - glTexCoord2f(0, 1); glVertex2f(x, y-h); - glTexCoord2f(1, 0); glVertex2f(x+w, y); - glTexCoord2f(1, 1); glVertex2f(x+w, y-h); - glEnd(); - rglUseShader(alphaShader); - x += w+2; - } - rglUseShader(0); - // if ((tile.w+2)*2 < 256) - // x += 256 - (tile.w+2)*2; - x = oldx; - y -= h + 5*FS + 5; - } - - y = oldy; - x = 128+210; - - y -= FS; - gglPrintf(x, y, "cycle %d persp %d detail %d sharpen %d tex_lod %d en_tlut %d tlut_type %d clipm %d", - RDP_GETOM_CYCLE_TYPE(om), - RDP_GETOM_PERSP_TEX_EN(om), - RDP_GETOM_DETAIL_TEX_EN(om), - RDP_GETOM_SHARPEN_TEX_EN(om), - RDP_GETOM_TEX_LOD_EN(om), - RDP_GETOM_EN_TLUT(om), - RDP_GETOM_TLUT_TYPE(om), - chunk.rdpState.clipMode); - - y -= FS; - gglPrintf(x, y, "sample_type %d mid %d lerp0 %d lerp1 %d convert1 %d key_en %d rgb_dith_sel %d", - RDP_GETOM_SAMPLE_TYPE(om), - RDP_GETOM_MID_TEXEL(om), - RDP_GETOM_BI_LERP0(om), - RDP_GETOM_BI_LERP1(om), - RDP_GETOM_CONVERT_ONE(om), - RDP_GETOM_KEY_EN(om), - RDP_GETOM_RGB_DITHER_SEL(om)); - - y -= FS; - gglPrintf(x, y, "A_dith_sel %d force_blend %d A_cvg_sel %d cvgXA %d Zmode %d cvg_dest %d col_on %d", - RDP_GETOM_ALPHA_DITHER_SEL(om), - RDP_GETOM_FORCE_BLEND(om), - RDP_GETOM_ALPHA_CVG_SELECT(om), - RDP_GETOM_CVG_TIMES_ALPHA(om), - RDP_GETOM_Z_MODE(om), - RDP_GETOM_CVG_DEST(om), - RDP_GETOM_COLOR_ON_CVG(om)); - - y -= FS; - gglPrintf(x, y, "img_read %d Zupdate %d Zcmp_sel %d antialias %d Zsource %d dith_A_en %d A_cmp %d", - RDP_GETOM_IMAGE_READ_EN(om), - RDP_GETOM_Z_UPDATE_EN(om), - RDP_GETOM_Z_COMPARE_EN(om), - RDP_GETOM_ANTIALIAS_EN(om), - RDP_GETOM_Z_SOURCE_SEL(om), - RDP_GETOM_DITHER_ALPHA_EN(om), - RDP_GETOM_ALPHA_COMPARE_EN(om)); - - y -= 2*FS; - - if (cycle < 2) { - gglPrintf(x, y, - "c = [ (%s - %s) * %s + %s | (%s - %s) * %s + %s ];", - saRGBText[RDP_GETCM_SUB_A_RGB0(state.combineModes)], - saRGBText[RDP_GETCM_SUB_B_RGB0(state.combineModes)], - mRGBText[RDP_GETCM_MUL_RGB0(state.combineModes)], - aRGBText[RDP_GETCM_ADD_RGB0(state.combineModes)], - saAText[RDP_GETCM_SUB_A_A0(state.combineModes)], - sbAText[RDP_GETCM_SUB_B_A0(state.combineModes)], - mAText[RDP_GETCM_MUL_A0(state.combineModes)], - aAText[RDP_GETCM_ADD_A0(state.combineModes)]); - - y -= FS; - } - if (cycle == 1) { - //if (cycle < 2) { - gglPrintf(x, y, - "c = [ (%s - %s) * %s + %s | (%s - %s) * %s + %s ];", - saRGBText[RDP_GETCM_SUB_A_RGB1(state.combineModes)], - saRGBText[RDP_GETCM_SUB_B_RGB1(state.combineModes)], - mRGBText[RDP_GETCM_MUL_RGB1(state.combineModes)], - aRGBText[RDP_GETCM_ADD_RGB1(state.combineModes)], - saAText[RDP_GETCM_SUB_A_A1(state.combineModes)], - sbAText[RDP_GETCM_SUB_B_A1(state.combineModes)], - mAText[RDP_GETCM_MUL_A1(state.combineModes)], - aAText[RDP_GETCM_ADD_A1(state.combineModes)]); - - y -= FS; - } - if (cycle < 2) { - gglPrintf(x, y, - "%s*%s + %s*%s" - ,bAText[0][RDP_GETOM_BLEND_M1B_0(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M1A_0(state.otherModes)], - bAText[1][RDP_GETOM_BLEND_M2B_0(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M2A_0(state.otherModes)] - ); - - y -= FS; - } - if (cycle == 1) { - //if (cycle < 2) { - gglPrintf(x, y, - "%s*%s + %s*%s" - ,bAText[0][RDP_GETOM_BLEND_M1B_1(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M1A_1(state.otherModes)], - bAText[1][RDP_GETOM_BLEND_M2B_1(state.otherModes)], - bRGBText[RDP_GETOM_BLEND_M2A_1(state.otherModes)] - ); - - y -= FS; - } - - if (chunk.nbStrips) { - y -= FS; - rglStrip_t & strip = chunk.strips[chunkindex >= 0? stripindex:0]; - - int i; - for (i=0; i>2)*buffer.realWidth/buffer.width, - // (chunk.rdpState.clip.yh >>2)*buffer.realHeight/buffer.height, - // (chunk.rdpState.clip.xl-chunk.rdpState.clip.xh >>2)*buffer.realWidth/buffer.width, - // (chunk.rdpState.clip.yl-chunk.rdpState.clip.yh >>2)*buffer.realHeight/buffer.height); - - - for (j=0; j= 0 && j == stripindex) { - glPushAttrib(GL_ALL_ATTRIB_BITS); - glColor4ub(255, 255, 128, 255); - } - glBegin(GL_TRIANGLE_STRIP); - for (k=0; k= 0 && j == stripindex) - glPopAttrib(); - } - - glPopAttrib(); -} - -int rglFindStrip(rglRenderChunk_t & chunk, float mx, float my) -{ - int j; - rglRenderBuffer_t & buffer = *chunk.renderBuffer; - for (j=chunk.nbStrips-1; j>=0; j--) { - rglStrip_t & strip = chunk.strips[j]; - int k; - struct { float x, y; } s[3]; - - for (k=0; k= 2) { - float last = 0; - int i; - for (i=0; i<3; i++) { - float dx1 = s[(i+1)%3].x - s[i].x; - float dy1 = s[(i+1)%3].y - s[i].y; - float dx2 = mx - s[i].x; - float dy2 = my - s[i].y; - dx1 = dx1*dy2-dx2*dy1; - if (dx1 == 0) goto next; - if (last*dx1 < 0) - goto next; - last = dx1; - } - stripindex = j; - return j; -next:; - } - } - } - return -1; -} - -void rglDisplayFlat(rglRenderBuffer_t & buffer) -{ - int i; - for (i=0; i=0; i--) { - rglRenderChunk_t & chunk = chunks[i]; - if (chunk.renderBuffer != &buffer) continue; - if (rglFindStrip(chunk, mx, my) >= 0) - return i; - } - return -1; -} - -void rglShowCursor(int state) -{ -#ifdef WIN32 -#else - SDL_ShowCursor(state); -#endif -} - -#ifndef WIN32 -static int keys[512]; -#define MOUSEBUT 511 -#else -# define MOUSEBUT VK_LBUTTON -# define SDLK_ESCAPE VK_ESCAPE -# define SDLK_KP_PLUS VK_ADD -# define SDLK_KP_MINUS VK_SUBTRACT -# define SDLK_TAB VK_TAB -# define SDLK_UP VK_UP -# define SDLK_DOWN VK_DOWN -# define SDLK_PAGEUP VK_PRIOR -# define SDLK_PAGEDOWN VK_NEXT -#endif - -int rglCheckKey(int key) -{ -#ifdef WIN32 - return GetAsyncKeyState (key) & 1; -#else - if (key >= 'A' && key <= 'Z') key += 'a' - 'A'; - int res = keys[key]; - keys[key] = 0; - return res; -#endif -} - -void rglDebugger() -{ - SDL_Event event; - int paused = 1; - int i, j; - int traceX = 1; - int tracepos = 0; - int tracepage = (screen_height*3/4)/(SMALLFS+2); - int oldchunkindex = -1; - - fbindex = 0; - chunkindex = -1; - - void rglInitDebugger(); - rglInitDebugger(); - - rglShowCursor(SDL_ENABLE); - - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE2_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0_ARB); - glDrawBuffer(GL_BACK); - - for (i=nblines=0; i<=rdpTracePos; i += rdp_dasm(rdpTraceBuf, i, i+256, dasm)/4, nblines++) - lines[nblines] = i; - - if (nbChunks > 1) - // skip chunk 0 as it's usually depth clear - fbindex = chunks[1].renderBuffer - rBuffers; - - while (paused) { -#ifndef WIN32 - int res = SDL_WaitEvent(&event); - while (res) { - switch (event.type) { - case SDL_MOUSEBUTTONDOWN: - keys[MOUSEBUT] = 1; - break; - case SDL_MOUSEBUTTONUP: - keys[MOUSEBUT] = 0; - break; - case SDL_KEYDOWN: - if (event.key.keysym.sym < MOUSEBUT) - keys[event.key.keysym.sym] = 1; - break; - case SDL_KEYUP: - if (event.key.keysym.sym < MOUSEBUT) - keys[event.key.keysym.sym] = 0; - break; - } - res = SDL_PollEvent(&event); - } -#endif - rglRenderBuffer_t & buffer = rBuffers[fbindex]; - scalex = buffer.realWidth; scaley = buffer.realHeight; - - if (rBuffers[fbindex].fbid) { - if (buffer.realWidth > scalex*3/4 || - buffer.realHeight > scaley*3/4) { - scalex = scalex*3/4; - scaley = scaley*3/4; - } - } - - if (rglCheckKey(MOUSEBUT)) { - if (buffer.fbid) { -#ifdef WIN32 - POINT pt; - GetCursorPos(&pt); - mx = pt.x; - my = pt.y; -#else - SDL_GetMouseState(&mx, &my); -#endif - int old = chunkindex; - if (old >= 0) - chunkindex++; - chunkindex = rglFindChunk(buffer, float(mx)/scalex, float(screen_height - my)/scaley); - if (old >= 0 && chunkindex == old) { - } else { - chunkindex = -1; - } - chunkindex = rglFindChunk(buffer, float(mx)/scalex, float(screen_height - my)/scaley); - if (chunkindex >= 0 && nbChunks) - printf("%s\n", chunks[chunkindex].shader->fsrc); - } - } - if (rglCheckKey('P') || rglCheckKey(SDLK_ESCAPE)) - paused = 0; - if (rglCheckKey(SDLK_KP_PLUS)) { - if (fbindex < MAX_RENDER_BUFFERS-1/* && - rBuffers[fbindex+1].fbid*/) - fbindex++; - chunkindex = -1; - } - if (rglCheckKey(SDLK_KP_MINUS)) { - if (fbindex > 0/* && - rBuffers[fbindex-1].fbid*/) - fbindex--; - chunkindex = -1; - } - if (rglCheckKey(SDLK_TAB)) - traceX = !traceX; - if (rglCheckKey(SDLK_UP)) - tracepos--; - if (rglCheckKey(SDLK_DOWN)) - tracepos++; - if (rglCheckKey(SDLK_PAGEUP)) - tracepos -= tracepage/2; - if (rglCheckKey(SDLK_PAGEDOWN)) - tracepos += tracepage/2; - if (tracepos < 0) - tracepos = 0; - if (tracepos > nblines-tracepage/2) - tracepos = nblines-tracepage/2; - - //rglRenderChunks(); - - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - glDrawBuffer(GL_BACK); - glDisable(GL_SCISSOR_TEST); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0_ARB); - glDisable(GL_ALPHA_TEST); - - glClearColor(0, 0, 0, 0); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glClear(GL_COLOR_BUFFER_BIT); - - if (buffer.fbid) { - //glViewport(0, 0, scalex*screen_width/buffer.realWidth, scaley*screen_height/buffer.realHeight); - glViewport(0, 0, scalex, scaley); - rglDisplayFramebuffer(buffer, 0); - glViewport(scalex, 0, scalex, scaley); - rglDisplayFramebuffer(buffer, 1); - - glViewport(0, 0, scalex, scaley); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glEnable(GL_BLEND); - //glBlendFunc( GL_ONE, GL_ONE ); - glBlendFunc(GL_SRC_COLOR, GL_ONE_MINUS_DST_COLOR); - if (chunkindex < 0) { - //glColor4f(0.1, 0, 0.1, 0.5); - glColor4f(0.6, 0, 0.6, 0.5); - rglDisplayFlat(buffer); - } else { - glColor4f(0.6, 0, 0.6, 0.5); - rglDisplayFlat(chunks[chunkindex]); - } - } - - { - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glDisable(GL_BLEND); - - - glMatrixMode( GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - gluOrtho2D(0, screen_width, 0, screen_height); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glViewport(0, 0, screen_width, screen_height); - rglUseShader(0); - - glColor3f(1,0.5,0.5); - gglPrintf(0, 0, "Fb #%d at $%x --> %x (%dx%d fmt %s-%d) upto %d %s", fbindex, - buffer.addressStart, buffer.addressStop, - buffer.width, buffer.height, - (buffer.flags & RGL_RB_DEPTH)? "Z":rdpImageFormats[buffer.format], buffer.size, - buffer.chunkId, - (buffer.flags & RGL_RB_ERASED)? "ERASED":""); - - if (chunkindex >= 0) { - gglPrintf(0, FS, "Chunk #%d", chunkindex); - - rglDisplayChunkInfo(chunks[chunkindex]); - } - - if (oldchunkindex != chunkindex) { - oldchunkindex = chunkindex; - if (chunkindex >= 0) - for (i=0; iFaceSize(FS); - smallfont->FaceSize(SMALLFS); - } - - if (!alphaShader) { - alphaShader = rglCreateShader( - "void main() \n" - "{ \n" - " gl_Position = ftransform(); \n" - " gl_FrontColor = gl_Color; \n" - " gl_TexCoord[0] = gl_MultiTexCoord0; \n" - "} \n" - , - "uniform sampler2D texture0; \n" - " \n" - "void main() \n" - "{ \n" - " gl_FragColor = gl_Color * texture2D(texture0, vec2(gl_TexCoord[0])).a; \n" - "} \n" - ); - } -} - -void rdpBacktrace() -{ - int i=0; - while (i <= rdpTracePos) { - i += rdp_dasm(rdpTraceBuf, i, i+256, dasm)/4; - printf("%4x %s\n", i, dasm); - } -} - -#endif diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_geometry.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_geometry.cpp deleted file mode 100644 index 3d77856f8b..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_geometry.cpp +++ /dev/null @@ -1,576 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -#include - -inline float _zscale(uint16_t z) -{ - uint32_t res; - int e = z>>(16-3); - int m = (z>>2)&((1<<11)-1); - - static struct { - int shift; - long add; - } z_format[8] = { - {6, 0x00000}, - {5, 0x20000}, - {4, 0x30000}, - {3, 0x38000}, - {2, 0x3c000}, - {1, 0x3e000}, - {0, 0x3f000}, - {0, 0x3f800}, - }; - - res = (m << z_format[e].shift) + - z_format[e].add; - return float(res)/0x3ffff; -} - -inline float zscale(uint16_t z) -{ - return float(z)/0xffff; -} -//#define zscale _zscale - -float rglZscale(uint16_t z) -{ - return _zscale(z); -} - -void rglTextureRectangle(rdpTexRect_t * rect, int flip) -{ - int tilenum = rect->tilenum; - int x1,x2,y1,y2,z; - int s, t; - int dx, dy; - - // if (tilenum == 7) { - // LOG("Fixing tilenum from 7 to 0\n"); - // tilenum = 0; - // } - - x1 = (rect->xh); - x2 = (rect->xl); - y1 = (rect->yh); - y2 = (rect->yl); - s = int(rect->s)<<5; - t = int(rect->t)<<5; - - DUMP("texrect %d x %d --> %d x %d s %d t %d flip %d\n", - x1, y1, x2, y2, s, t, flip); - - if (RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) == RDP_CYCLE_TYPE_FILL || - RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) == RDP_CYCLE_TYPE_COPY) - { - rect->dsdx /= 4; - //s /= 4; - x2 += 4; - y2 += 4; - } else { - x2 += 1; - y2 += 1; - } - - x1 /= 4; - x2 /= 4; - y1 /= 4; - y2 /= 4; - - if (x2 < x1) x2 = x1+1; // black gauge in SCARS (E) - - int t1 = rglT1Usage(rdpState)? RGL_STRIP_TEX1:0; - int t2 = (rect->tilenum < 7 && rglT2Usage(rdpState))? RGL_STRIP_TEX2:0; - if (t1) - rglPrepareRendering(1, (tilenum==7 && RDP_GETOM_CYCLE_TYPE(rdpState.otherModes)==1)? 0:tilenum, y2-y1, 1); - if (t2) - rglPrepareRendering(1, tilenum+1, y2-y1, 1); - else if (!t1) - rglPrepareRendering(0, 0, 0, 1); - - // TO BE REMOVED when we implement depth texture writing - curRBuffer->flags |= RGL_RB_HASTRIANGLES; - - // TO CHECK should this before or after the rescaling above ? - // s -= (rdpTiles[tilenum].sl << 8); - // t -= (rdpTiles[tilenum].tl << 8); - // if (/*!tile.ms && */tile.mask_s) - // s &= (1<nbStrips++; - rglVertex_t * vtx = vtxs + nbVtxs; - - strip->flags = t1 | t2 | RGL_STRIP_ZBUFFER; - strip->vtxs = vtx; - strip->tilenum = tilenum; - - float s2, tr; - s2 = s+int(rect->dsdx)*dx; - tr = t+int(rect->dtdy)*dy; - //LOG("%d %d\n", rect->dsdx, rect->dtdy); - if (0 && RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) < 2) - { - //if (rect->dsdx == (1<<10)) - { - s += 1<<9; - s2 -= 1<<9; - } - //if (rect->dtdy == (1<<10)) - { - t += 1<<9; - tr -= 1<<9; - } - } - - if (flip) { vtx->t = SSCALE(s2); vtx->s = TSCALE(t); - } else { vtx->s = SSCALE(s2); vtx->t = TSCALE(t); } - vtx->x = XSCALE(x2); vtx->y = YSCALE(y1); vtx->z = ZSCALE(z); vtx++->w = 1; - if (flip) { vtx->t = SSCALE(s); vtx->s = TSCALE(t); - } else { vtx->s = SSCALE(s); vtx->t = TSCALE(t); } - vtx->x = XSCALE(x1); vtx->y = YSCALE(y1); vtx->z = ZSCALE(z); vtx++->w = 1; - if (flip) { vtx->t = SSCALE(s2); vtx->s = TSCALE(tr); - } else { vtx->s = SSCALE(s2); vtx->t = TSCALE(tr); } - vtx->x = XSCALE(x2); vtx->y = YSCALE(y2); vtx->z = ZSCALE(z); vtx++->w = 1; - if (flip) { vtx->t = SSCALE(s); vtx->s = TSCALE(tr); - } else { vtx->s = SSCALE(s); vtx->t = TSCALE(tr); } - vtx->x = XSCALE(x1); vtx->y = YSCALE(y2); vtx->z = ZSCALE(z); vtx++->w = 1; - - strip->nbVtxs = vtx - strip->vtxs; - nbVtxs = vtx - vtxs; -} - -void rglFillRectangle(rdpRect_t * rect) -{ - int x1,x2,y1,y2,z; - //int s, t; - //int dx, dy; - - rglPrepareRendering(0, 0, 0, 1); - DUMP("fillrect curRBuffer->flags %x %x %x\n", curRBuffer->flags, curRBuffer->addressStart, rdpZbAddress); - // if (/*(curRBuffer->flags & RGL_RB_DEPTH) &&*/ - // RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) == RDP_CYCLE_TYPE_FILL && - // rect->xh-4 <= rdpState.clip.xh && rect->xl+8 >= rdpState.clip.xl && - // rect->yh-4 <= rdpState.clip.yh && rect->yl+8 >= rdpState.clip.yl - // ) { - // curChunk->flags |= RGL_CHUNK_CLEAR; - // return; - // } - - x1 = (rect->xh / 4); - x2 = (rect->xl / 4); - y1 = (rect->yh / 4); - y2 = (rect->yl / 4); - - if (RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) == RDP_CYCLE_TYPE_FILL || - RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) == RDP_CYCLE_TYPE_COPY) - { - x2 += 1; - y2 += 1; - } else { - //rglAssert(!(curRBuffer->flags & RGL_RB_DEPTH)); - // x2 -= 1; - // y2 -= 1; - } - - if (x2 < x1) x2 = x1+1; // black gauge in SCARS (E) - -#define XSCALE(x) (float(x)) -#define YSCALE(y) (float(y)) -#define ZSCALE(z) (zscale(z)) - - if (RDP_GETOM_Z_SOURCE_SEL(rdpState.otherModes)) - z = rdpState.primitiveZ; - else - z = 0xffff; - // if (dump) - // fprintf(stderr, "fillrect cycle %d\n", other_modes.cycle_type); - - rglStrip_t * strip = strips + nbStrips++; - rglAssert(nbStrips < MAX_STRIPS); - curChunk->nbStrips++; - rglVertex_t * vtx = vtxs + nbVtxs; - - strip->flags = RGL_STRIP_ZBUFFER; - strip->vtxs = vtx; - - vtx->x = XSCALE(x2); vtx->y = YSCALE(y1); vtx->z = ZSCALE(z); vtx++->w = 1; - vtx->x = XSCALE(x1); vtx->y = YSCALE(y1); vtx->z = ZSCALE(z); vtx++->w = 1; - vtx->x = XSCALE(x2); vtx->y = YSCALE(y2); vtx->z = ZSCALE(z); vtx++->w = 1; - vtx->x = XSCALE(x1); vtx->y = YSCALE(y2); vtx->z = ZSCALE(z); vtx++->w = 1; - - strip->nbVtxs = vtx - strip->vtxs; - nbVtxs = vtx - vtxs; -} - -void rglTriangle(uint32_t w1, uint32_t w2, int shade, int texture, int zbuffer, - uint32_t * rdp_cmd) -{ - int tilenum = (w1 >> 16) & 0x7; - // if (tilenum == 7) { - // LOG("Fixing tilenum from 7 to 0\n"); - // tilenum = 0; - // } - int j; - int xleft, xright, xleft_inc, xright_inc; - //int xstart, xend; - int r, g, b, a, z, s, t, w; - int drdx = 0, dgdx = 0, dbdx = 0, dadx = 0, dzdx = 0, dsdx = 0, dtdx = 0, dwdx = 0; - int drde = 0, dgde = 0, dbde = 0, dade = 0, dzde = 0, dsde = 0, dtde = 0, dwde = 0; - int flip = (w1 & 0x800000) ? 1 : 0; - - int32_t yl, ym, yh; - int32_t xl, xm, xh; - int64_t dxldy, dxhdy, dxmdy; - uint32_t w3, w4, w5, w6, w7, w8; - - uint32_t * shade_base = rdp_cmd + 8; - uint32_t * texture_base = rdp_cmd + 8; - uint32_t * zbuffer_base = rdp_cmd + 8; - - int t1 = (texture && rglT1Usage(rdpState))? RGL_STRIP_TEX1:0; - int t2 = (texture && tilenum < 7 && rglT2Usage(rdpState))? RGL_STRIP_TEX2:0; - if (t1) - rglPrepareRendering(1, (tilenum==7 && RDP_GETOM_CYCLE_TYPE(rdpState.otherModes)==1)? 0:tilenum, 0, zbuffer); - if (t2) - rglPrepareRendering(1, tilenum+1, 0, zbuffer); - else if (!t1) - rglPrepareRendering(0, 0, 0, zbuffer); - - curRBuffer->flags |= RGL_RB_HASTRIANGLES; - - if (shade) - { - texture_base += 16; - zbuffer_base += 16; - } - if (texture) - { - zbuffer_base += 16; - } - - w3 = rdp_cmd[2]; - w4 = rdp_cmd[3]; - w5 = rdp_cmd[4]; - w6 = rdp_cmd[5]; - w7 = rdp_cmd[6]; - w8 = rdp_cmd[7]; - - yl = (w1 & 0x3fff); - ym = ((w2 >> 16) & 0x3fff); - yh = ((w2 >> 0) & 0x3fff); - xl = (int32_t)(w3); - xh = (int32_t)(w5); - xm = (int32_t)(w7); - dxldy = (int32_t)(w4); - dxhdy = (int32_t)(w6); - dxmdy = (int32_t)(w8); - - if (yl & (0x800<<2)) yl |= 0xfffff000<<2; - if (ym & (0x800<<2)) ym |= 0xfffff000<<2; - if (yh & (0x800<<2)) yh |= 0xfffff000<<2; - - yh &= ~3; - - r = 0xff; g = 0xff; b = 0xff; a = 0xff; z = 0xffff0000; s = 0; t = 0; w = 0x30000; - - if (shade) - { - r = (shade_base[0] & 0xffff0000) | ((shade_base[+4 ] >> 16) & 0x0000ffff); - g = ((shade_base[0 ] << 16) & 0xffff0000) | (shade_base[4 ] & 0x0000ffff); - b = (shade_base[1 ] & 0xffff0000) | ((shade_base[5 ] >> 16) & 0x0000ffff); - a = ((shade_base[1 ] << 16) & 0xffff0000) | (shade_base[5 ] & 0x0000ffff); - drdx = (shade_base[2 ] & 0xffff0000) | ((shade_base[6 ] >> 16) & 0x0000ffff); - dgdx = ((shade_base[2 ] << 16) & 0xffff0000) | (shade_base[6 ] & 0x0000ffff); - dbdx = (shade_base[3 ] & 0xffff0000) | ((shade_base[7 ] >> 16) & 0x0000ffff); - dadx = ((shade_base[3 ] << 16) & 0xffff0000) | (shade_base[7 ] & 0x0000ffff); - drde = (shade_base[8 ] & 0xffff0000) | ((shade_base[12] >> 16) & 0x0000ffff); - dgde = ((shade_base[8 ] << 16) & 0xffff0000) | (shade_base[12] & 0x0000ffff); - dbde = (shade_base[9 ] & 0xffff0000) | ((shade_base[13] >> 16) & 0x0000ffff); - dade = ((shade_base[9 ] << 16) & 0xffff0000) | (shade_base[13] & 0x0000ffff); - } - if (texture) - { - s = (texture_base[0 ] & 0xffff0000) | ((texture_base[4 ] >> 16) & 0x0000ffff); - t = ((texture_base[0 ] << 16) & 0xffff0000) | (texture_base[4 ] & 0x0000ffff); - w = (texture_base[1 ] & 0xffff0000) | ((texture_base[5 ] >> 16) & 0x0000ffff); - dsdx = (texture_base[2 ] & 0xffff0000) | ((texture_base[6 ] >> 16) & 0x0000ffff); - dtdx = ((texture_base[2 ] << 16) & 0xffff0000) | (texture_base[6 ] & 0x0000ffff); - dwdx = (texture_base[3 ] & 0xffff0000) | ((texture_base[7 ] >> 16) & 0x0000ffff); - dsde = (texture_base[8 ] & 0xffff0000) | ((texture_base[12] >> 16) & 0x0000ffff); - dtde = ((texture_base[8 ] << 16) & 0xffff0000) | (texture_base[12] & 0x0000ffff); - dwde = (texture_base[9 ] & 0xffff0000) | ((texture_base[13] >> 16) & 0x0000ffff); - } - if (zbuffer) - { - //rglAssert(!(curRBuffer->flags & RGL_RB_DEPTH)); - - z = zbuffer_base[0]; - dzdx = zbuffer_base[1]; - dzde = zbuffer_base[2]; - } - - xh <<= 2; xm <<= 2; xl <<= 2; - r <<= 2; g <<= 2; b <<= 2; a <<= 2; - dsde >>= 2; dtde >>= 2; dsdx >>= 2; dtdx >>= 2; - dzdx >>= 2; dzde >>= 2; - dwdx >>= 2; dwde >>= 2; - - - // #define tile rdpTiles[tilenum] - // s -= (rdpTiles[tilenum].sl << 8); - // t -= (rdpTiles[tilenum].tl << 8); - // if (/*!tile.ms && */tile.mask_s) - // s &= (1< xright-0x10000))) { - xleft += xleft_inc; xright += xright_inc; - s += dsde; t += dtde; w += dwde; - r += drde; g += dgde; b += dbde; a += dade; - z += dzde; - yh++; - } - - j = ym-yh; - //rglAssert(j >= 0); -#undef XSCALE -#undef YSCALE -#undef ZSCALE -#undef SSCALE -#undef TSCALE -#define XSCALE(x) (float(x)/(1<<18)) -#define YSCALE(y) (float(y)/(1<<2)) -#define ZSCALE(z) (RDP_GETOM_Z_SOURCE_SEL(rdpState.otherModes)? zscale(rdpState.primitiveZ) : zscale((z)>>16)) -#define WSCALE(z) 1.0f/(RDP_GETOM_PERSP_TEX_EN(rdpState.otherModes)? (float(uint32_t(z) + 0x10000)/0xffff0000) : 1.0f) - //#define WSCALE(w) (RDP_GETOM_PERSP_TEX_EN(rdpState.otherModes)? 65536.0f*65536.0f/float((w+ 0x10000)) : 1.0f) -#define CSCALE(c) (((c)>0x3ff0000? 0x3ff0000:((c)<0? 0 : (c)))>>18) -#define _PERSP(w) ( w ) -#define PERSP(s, w) ( ((int64_t)(s) << 20) / (_PERSP(w)? _PERSP(w):1) ) -#define SSCALE(s, _w) (RDP_GETOM_PERSP_TEX_EN(rdpState.otherModes)? float(PERSP(s, _w))/(1 << 10) : float(s)/(1<<21)) -#define TSCALE(s, w) (RDP_GETOM_PERSP_TEX_EN(rdpState.otherModes)? float(PERSP(s, w))/(1 << 10) : float(s)/(1<<21)) - - rglStrip_t * strip = strips + nbStrips++; - rglAssert(nbStrips < MAX_STRIPS); - curChunk->nbStrips++; - rglVertex_t * vtx = vtxs + nbVtxs; - - strip->flags = (shade? RGL_STRIP_SHADE : 0) | t1 | t2 - | RGL_STRIP_ZBUFFER; - //| (zbuffer? RGL_STRIP_ZBUFFER : 0); - strip->vtxs = vtx; - strip->tilenum = tilenum; - - //int sw; - if (j > 0) - { - int dx = ((xleft-xright)>>16); - if ((!flip && xleft < xright) || - (flip/* && xleft > xright*/)) - { - if (shade) { - vtx->r = CSCALE(r+drdx*dx); - vtx->g = CSCALE(g+dgdx*dx); - vtx->b = CSCALE(b+dbdx*dx); - vtx->a = CSCALE(a+dadx*dx); - } - if (texture) { - vtx->s = SSCALE(s+dsdx*dx, w+dwdx*dx); - vtx->t = TSCALE(t+dtdx*dx, w+dwdx*dx); - } - vtx->x = XSCALE(xleft); - vtx->y = YSCALE(yh); - vtx->z = ZSCALE(z+dzdx*dx); - vtx->w = WSCALE(w+dwdx*dx); - vtx++; - } - if ((!flip/* && xleft < xright*/) || - (flip && xleft > xright)) - { - if (shade) { - vtx->r = CSCALE(r); - vtx->g = CSCALE(g); - vtx->b = CSCALE(b); - vtx->a = CSCALE(a); - } - if (texture) { - vtx->s = SSCALE(s, w); - vtx->t = TSCALE(t, w); - } - vtx->x = XSCALE(xright); - vtx->y = YSCALE(yh); - vtx->z = ZSCALE(z); - vtx->w = WSCALE(w); - vtx++; - } - } - xleft += xleft_inc*j; xright += xright_inc*j; - s += dsde*j; t += dtde*j; w += dwde*j; - r += drde*j; g += dgde*j; b += dbde*j; a += dade*j; - z += dzde*j; - // render ... - - xleft = xl; - - //if (yl-ym > 0) - { - int dx = ((xleft-xright)>>16); - if ((!flip && xleft <= xright) || - (flip/* && xleft >= xright*/)) - { - if (shade) { - vtx->r = CSCALE(r+drdx*dx); - vtx->g = CSCALE(g+dgdx*dx); - vtx->b = CSCALE(b+dbdx*dx); - vtx->a = CSCALE(a+dadx*dx); - } - if (texture) { - vtx->s = SSCALE(s+dsdx*dx, w+dwdx*dx); - vtx->t = TSCALE(t+dtdx*dx, w+dwdx*dx); - } - vtx->x = XSCALE(xleft); - vtx->y = YSCALE(ym); - vtx->z = ZSCALE(z+dzdx*dx); - vtx->w = WSCALE(w+dwdx*dx); - vtx++; - } - if ((!flip/* && xleft <= xright*/) || - (flip && xleft >= xright)) - { - if (shade) { - vtx->r = CSCALE(r); - vtx->g = CSCALE(g); - vtx->b = CSCALE(b); - vtx->a = CSCALE(a); - } - if (texture) { - vtx->s = SSCALE(s, w); - vtx->t = TSCALE(t, w); - } - vtx->x = XSCALE(xright); - vtx->y = YSCALE(ym); - vtx->z = ZSCALE(z); - vtx->w = WSCALE(w); - vtx++; - } - } - xleft_inc = dxldy; - xright_inc = dxhdy; - - j = yl-ym; - //rglAssert(j >= 0); - //j--; // ? - xleft += xleft_inc*j; xright += xright_inc*j; - s += dsde*j; t += dtde*j; w += dwde*j; - r += drde*j; g += dgde*j; b += dbde*j; a += dade*j; - z += dzde*j; - - while (yl>ym && - !((!flip && xleft < xright+0x10000) || - (flip && xleft > xright-0x10000))) { - xleft -= xleft_inc; xright -= xright_inc; - s -= dsde; t -= dtde; w -= dwde; - r -= drde; g -= dgde; b -= dbde; a -= dade; - z -= dzde; - j--; - yl--; - } - - // render ... - if (j >= 0) { - int dx = ((xleft-xright)>>16); - if ((!flip && xleft <= xright) || - (flip/* && xleft >= xright*/)) - { - if (shade) { - vtx->r = CSCALE(r+drdx*dx); - vtx->g = CSCALE(g+dgdx*dx); - vtx->b = CSCALE(b+dbdx*dx); - vtx->a = CSCALE(a+dadx*dx); - } - if (texture) { - vtx->s = SSCALE(s+dsdx*dx, w+dwdx*dx); - vtx->t = TSCALE(t+dtdx*dx, w+dwdx*dx); - } - vtx->x = XSCALE(xleft); - vtx->y = YSCALE(yl); - vtx->z = ZSCALE(z+dzdx*dx); - vtx->w = WSCALE(w+dwdx*dx); - vtx++; - } - if ((!flip/* && xleft <= xright*/) || - (flip && xleft >= xright)) - { - if (shade) { - vtx->r = CSCALE(r); - vtx->g = CSCALE(g); - vtx->b = CSCALE(b); - vtx->a = CSCALE(a); - } - if (texture) { - vtx->s = SSCALE(s, w); - vtx->t = TSCALE(t, w); - } - vtx->x = XSCALE(xright); - vtx->y = YSCALE(yl); - vtx->z = ZSCALE(z); - vtx->w = WSCALE(w); - vtx++; - } - } - - strip->nbVtxs = vtx - strip->vtxs; - nbVtxs = vtx - vtxs; -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_glut.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_glut.cpp deleted file mode 100644 index 0bee4fad8c..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_glut.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include - -#include - -#include "rgl_glut.h" - -#ifdef RGL_USE_GLUT -#include - -extern int screen_width, screen_height; - -/** These are the live variables passed into GLUI ***/ -int wireframe = 0; -int segments = 8; -int main_window; - -static GLUI *glui; - -static SDL_sem * commandSem; -static SDL_cond * commandCond; -static SDL_mutex * commandMutex; -static SDL_sem * commandFinishedSem; -static rglGlutCommand_f command, nextCommand; - -/***************************************** myGlutIdle() ***********/ - -void myGlutIdle( ) -{ -// SDL_LockMutex(commandMutex); -// if (!SDL_CondWaitTimeout(commandCond, commandMutex, 1)) { - if (!SDL_SemWaitTimeout(commandSem, 1)) { - //if (!SDL_SemWait(commandSem)) { - //printf("receive a command\n"); - if ( glutGetWindow() && glutGetWindow() != main_window ) - glutSetWindow(main_window); - nextCommand = command; - command = 0; - glutPostRedisplay(); - } -// SDL_UnlockMutex(commandMutex); -} - -void myGlutTimer( int dummy ) -{ - - /* According to the GLUT specification, the current window is - undefined during an idle callback. So we need to explicitly change - it if necessary */ - if ( glutGetWindow() != main_window ) - glutSetWindow(main_window); - - glutPostRedisplay(); -} - - -/**************************************** myGlutReshape() *************/ - -void myGlutReshape( int x, int y ) -{ - float xy_aspect; - - xy_aspect = (float)x / (float)y; - glViewport( 0, 0, x, y ); - -// glMatrixMode( GL_PROJECTION ); -// glLoadIdentity(); -// glFrustum( -xy_aspect*.08, xy_aspect*.08, -.08, .08, .1, 15.0 ); - - glutPostRedisplay(); -} - -/***************************************** myGlutDisplay() *****************/ - -void myGlutDisplay( void ) -{ - if (nextCommand) { - nextCommand(); - nextCommand = 0; - SDL_SemPost(commandFinishedSem); - } - - //glutSwapBuffers(); - - //glutTimerFunc(1, myGlutTimer, 0); -} - - -/**************************************** main() ********************/ - -static int glutmain(int argc, char* argv[]) -{ - /****************************************/ - /* Initialize GLUT and create window */ - /****************************************/ - - glutInit(&argc, argv); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - //glutInitWindowPosition( 50, 50 ); - glutInitWindowSize( screen_width, screen_height ); - - main_window = glutCreateWindow( "z64gl" ); - glutDisplayFunc( myGlutDisplay ); - glutReshapeFunc( myGlutReshape ); - - /****************************************/ - /* Here's the GLUI code */ - /****************************************/ - - glui = GLUI_Master.create_glui( "GLUI" ); - new GLUI_Checkbox( glui, "Wireframe", &wireframe ); - (new GLUI_Spinner( glui, "Segments:", &segments )) - ->set_int_limits( 3, 60 ); - - glui->set_main_gfx_window( main_window ); - - /* We register the idle callback with GLUI, *not* with GLUT */ - GLUI_Master.set_glutIdleFunc( myGlutIdle ); - //glutTimerFunc(1, myGlutTimer, 0); - - glutMainLoop(); - - return EXIT_SUCCESS; -} - - - - - -static SDL_Thread * thread; - -int rglGlutThread(void * dummy) -{ - int argc = 1; - char * argv[2] = { "z64gl", 0 }; - - glutmain(argc, argv); - - thread = 0; - - // in case of, but glutMainLoop never exits anyway - exit(0); -} - -void rglGlutMinimizeWindow() -{ - //glutDestroyWindow(main_window); - myGlutReshape(64, 64); -} - -void rglGlutRecreateWindow() -{ - int oldmain = main_window; - - glutInitWindowSize( screen_width, screen_height ); - main_window = glutCreateWindow( "z64gl" ); - glutDisplayFunc( myGlutDisplay ); - glutReshapeFunc( myGlutReshape ); - - glui->set_main_gfx_window( main_window ); - /* We register the idle callback with GLUI, *not* with GLUT */ - GLUI_Master.set_glutIdleFunc( myGlutIdle ); - //glutTimerFunc(1, myGlutTimer, 0); - - glutSetWindow(main_window); - - glutDestroyWindow(oldmain); -} - -void rglGlutCreateThread(int recreate) -{ - if (!thread) { - commandSem = SDL_CreateSemaphore(0); - commandCond = SDL_CreateCond(); - commandMutex = SDL_CreateMutex(); - commandFinishedSem = SDL_CreateSemaphore(0); - - thread = SDL_CreateThread(rglGlutThread, 0); - } else if (recreate) - rglGlutPostCommand(rglGlutRecreateWindow); -} - -void rglGlutPostCommand(rglGlutCommand_f c) -{ - command = c; - SDL_SemPost(commandSem); -// SDL_LockMutex(commandMutex); -// SDL_CondSignal(commandCond); -// SDL_UnlockMutex(commandMutex); - SDL_SemWait(commandFinishedSem); -} - -void rglSwapBuffers() -{ - glutSwapBuffers(); -} - -#endif diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_glut.h b/libmupen64plus/mupen64plus-video-z64/src/rgl_glut.h deleted file mode 100644 index be858496ac..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_glut.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -typedef void (* rglGlutCommand_f)(); - -void rglGlutCreateThread(int recreatewindows); - -void rglGlutPostCommand(rglGlutCommand_f c); - -void rglSwapBuffers(); - -void rglGlutMinimizeWindow(); diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_osdep.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_osdep.cpp deleted file mode 100644 index 2f6d1202e0..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_osdep.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -#include - -SDL_Surface *sdl_Screen; -int viewportOffset; - -/* definitions of pointers to Core video extension functions */ -extern ptr_VidExt_Init CoreVideo_Init; -extern ptr_VidExt_Quit CoreVideo_Quit; -extern ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes; -extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode; -extern ptr_VidExt_SetCaption CoreVideo_SetCaption; -extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen; -extern ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow; -extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress; -extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute; -extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers; - -//int screen_width = 640, screen_height = 480; -int screen_width = 1024, screen_height = 768; -//int screen_width = 320, screen_height = 240; - -int viewport_offset; - -void rglSwapBuffers() -{ - //TODO: if screenshot capabilities are ever implemented, replace the - //hard-coded 1 with a value indicating whether the screen has been redrawn - if (render_callback != NULL) - render_callback(1); - CoreVideo_GL_SwapBuffers(); - return; -} - -int rglOpenScreen() -{ - if (CoreVideo_Init() != M64ERR_SUCCESS) { - rdp_log(M64MSG_ERROR, "Could not initialize video."); - return 0; - } - if (rglStatus == RGL_STATUS_WINDOWED) { - screen_width = rglSettings.resX; - screen_height = rglSettings.resY; - } else { - screen_width = rglSettings.fsResX; - screen_height = rglSettings.fsResY; - } - - m64p_video_mode screen_mode = M64VIDEO_WINDOWED; - if (rglSettings.fullscreen) - screen_mode = M64VIDEO_FULLSCREEN; - - viewportOffset = 0; - - if (CoreVideo_GL_SetAttribute(M64P_GL_DOUBLEBUFFER, 1) != M64ERR_SUCCESS || - CoreVideo_GL_SetAttribute(M64P_GL_BUFFER_SIZE, 32) != M64ERR_SUCCESS || - CoreVideo_GL_SetAttribute(M64P_GL_DEPTH_SIZE, 24) != M64ERR_SUCCESS) - { - rdp_log(M64MSG_ERROR, "Could not set video attributes."); - return 0; - } - - if (CoreVideo_SetVideoMode(screen_width, screen_height, 32, screen_mode, (m64p_video_flags) 0) != M64ERR_SUCCESS) - { - rdp_log(M64MSG_ERROR, "Could not set video mode."); - return 0; - } - - CoreVideo_SetCaption("Z64gl"); - - rdp_init(); - return 1; -} - -void rglCloseScreen() -{ - rglClose(); - CoreVideo_Quit(); -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_rendermode.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_rendermode.cpp deleted file mode 100644 index c85a63cc59..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_rendermode.cpp +++ /dev/null @@ -1,722 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -#include - -void rglRenderMode(rglRenderChunk_t & chunk) -{ - //int i; - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - if (RDP_GETOM_CYCLE_TYPE(chunk.rdpState.otherModes) < 2) { - glDepthMask(RDP_GETOM_Z_UPDATE_EN(chunk.rdpState.otherModes)? GL_TRUE:GL_FALSE); - if (RDP_GETOM_Z_COMPARE_EN(chunk.rdpState.otherModes)) - glDepthFunc(GL_LESS); - else - glDepthFunc(GL_ALWAYS); - } else { - glDepthMask(GL_FALSE); - glDepthFunc(GL_ALWAYS); - } - - - // if (RDP_GETOM_Z_MODE(chunk.rdpState.otherModes) & 1) { - // glEnable( GL_POLYGON_OFFSET_FILL ); - // switch(RDP_GETOM_Z_MODE(chunk.rdpState.otherModes)) { - // case 3: - // glPolygonOffset( -3, -300 ); - // break; - // default: - // // FIXME tune this value - // //glPolygonOffset( -3.0f, -3.0f ); - // glPolygonOffset( -3, -40 ); - // break; - // } - // //glDepthMask(GL_FALSE); - // } else { - // glDisable( GL_POLYGON_OFFSET_FILL ); - // } -} - - - -struct rglCombiner_t { - rdpCombineModes_t combineModes; - rdpOtherModes_t otherModes; - rglShader_t * shader; -#ifndef RGL_EXACT_BLEND - GLuint srcBlend, dstBlend; -#endif - int format; -}; -#define RGL_MAX_COMBINERS 128 -static int rglNbCombiners; -static rglCombiner_t rglCombiners[RGL_MAX_COMBINERS]; - -void rglClearCombiners() -{ - int i; - for (i=0; i= 2) return 0; - if (cycle == 1 && ( - RDP_GETCM_SUB_A_RGB1(state.combineModes)==2 || - RDP_GETCM_SUB_B_RGB1(state.combineModes)==2 || - RDP_GETCM_MUL_RGB1(state.combineModes)==2 || - RDP_GETCM_MUL_RGB1(state.combineModes)==9 || - RDP_GETCM_ADD_RGB1(state.combineModes)==2 || - RDP_GETCM_SUB_A_A1(state.combineModes)==2 || - RDP_GETCM_SUB_B_A1(state.combineModes)==2 || - RDP_GETCM_MUL_A1(state.combineModes)==2 || - RDP_GETCM_ADD_A1(state.combineModes)==2)) - return 1; - if ( - (RDP_GETOM_CVG_TIMES_ALPHA(state.otherModes) && - !RDP_GETOM_ALPHA_CVG_SELECT(state.otherModes)) || - - RDP_GETCM_SUB_A_RGB0(state.combineModes)==1 || - RDP_GETCM_SUB_B_RGB0(state.combineModes)==1 || - RDP_GETCM_MUL_RGB0(state.combineModes)==1 || - RDP_GETCM_MUL_RGB0(state.combineModes)==8 || - RDP_GETCM_ADD_RGB0(state.combineModes)==1 || - RDP_GETCM_SUB_A_A0(state.combineModes)==1 || - RDP_GETCM_SUB_B_A0(state.combineModes)==1 || - RDP_GETCM_MUL_A0(state.combineModes)==1 || - RDP_GETCM_ADD_A0(state.combineModes)==1) - - return 1; - - return 0; -} -int rglT2Usage(rdpState_t & state) -{ - //return 1; - int cycle = RDP_GETOM_CYCLE_TYPE(state.otherModes); - if (cycle >= 2) return 0; - if (cycle == 1 && ( - RDP_GETCM_SUB_A_RGB1(state.combineModes)==1 || - RDP_GETCM_SUB_B_RGB1(state.combineModes)==1 || - RDP_GETCM_MUL_RGB1(state.combineModes)==1 || - RDP_GETCM_MUL_RGB1(state.combineModes)==8 || - RDP_GETCM_ADD_RGB1(state.combineModes)==1 || - RDP_GETCM_SUB_A_A1(state.combineModes)==1 || - RDP_GETCM_SUB_B_A1(state.combineModes)==1 || - RDP_GETCM_MUL_A1(state.combineModes)==1 || - RDP_GETCM_ADD_A1(state.combineModes)==1)) - return 1; - - if ( - RDP_GETCM_SUB_A_RGB0(state.combineModes)==2 || - RDP_GETCM_SUB_B_RGB0(state.combineModes)==2 || - RDP_GETCM_MUL_RGB0(state.combineModes)==2 || - RDP_GETCM_MUL_RGB0(state.combineModes)==9 || - RDP_GETCM_ADD_RGB0(state.combineModes)==2 || - RDP_GETCM_SUB_A_A0(state.combineModes)==2 || - RDP_GETCM_SUB_B_A0(state.combineModes)==2 || - RDP_GETCM_MUL_A0(state.combineModes)==2 || - RDP_GETCM_ADD_A0(state.combineModes)==2) - - return 1; - - return 0; -} - - -void rglSetCombiner(rglRenderChunk_t & chunk, int format) -{ - static char _1ma[64]; - static char t1[64]; - static char t1a[64]; - static char t2[64]; - static char t2a[64]; - static char prim_lod_frac[64]; - - static const char *saRGB[] = { - "c", t1, t2, "p/*PRIM*/", - "gl_Color", "e", "1.0/*NOISE*/", "1.0", - "0.0", "0.0", "0.0", "0.0", - "0.0", "0.0", "0.0", "0.0" - }; - - static const char *mRGB[] = { - "c", t1, t2, "p/*PRIM*/", - "gl_Color/*SHADE*/","e", "0.0/*SCALE*/", "c.a/*COMBINED_A*/", - "t1.a/*TEXEL0_A*/", "t2.a/*TEXEL1_A*/", "p.a/*PRIM_A*/", "gl_Color.a/*SHADEA*/", - "e.a/*ENV_ALPHA*/", "0.5/*LOD_FRACTION*/","0.5/*PRIM_LOD_FRAC*/","k5/*K5*/", - "0.0", "0.0", "0.0", "0.0", - "0.0", "0.0", "0.0", "0.0", - "0.0", "0.0", "0.0", "0.0", - "0.0", "0.0", "0.0", "0.0" - }; - - static const char *aRGB[] = { - "c", t1, t2, "p/*PRIM*/", - "gl_Color/*SHADE*/","e/*ENV*/", "1.0", "0.0", - }; - - static const char *saA[] = { - "c.a", t1a, t2a, "p.a/*PRIM*/", - "gl_Color.a", "e.a", "1.0", "0.0", - }; - - static const char *sbA[] = { - "c.a", t1a, t2a, "p.a/*PRIM*/", - "gl_Color.a", "e.a", "1.0", "0.0", - }; - - static const char *mA[] = { - "0.5/*LOD_FRACTION*/", t1a, t2a, "p.a/*PRIM*/", - "gl_Color.a/*SHADE*/", "e.a", prim_lod_frac, "0.0", - }; - - static const char *aA[] = { - "c.a", t1a, t2a, "p.a/*PRIM*/", - "gl_Color.a/*SHADE*/", "e.a", "1.0", "0.0", - }; - - const static char * bRGB[] = - { "c/*PREV*/", "f", "b", "fog/*FOG*/" }; - const static char * bA[2][4] = - { {"c.a/*PREVA*/", "fog.a/*FOGA*/", "gl_Color.a/*SHADEA*/", "0.0/*ZERO*/"}, - {_1ma/*"(1.0-c.a/ *PREVA)"*/, "0.0/*f.a*//*FRAGA*/", "1.0", "0.0"}}; // need clamping on 1-alpha ? - - - rdpState_t & state = chunk.rdpState; - static rglCombiner_t * c; - uint32_t cycle = RDP_GETOM_CYCLE_TYPE(state.otherModes); - int i; //, fmt, size; - char * p; - const char * alphaTest; - const char * alphaTest2; - const char * write; - static char src[4*4096]; - - float env[4]; - env[0] = RDP_GETC32_R(state.envColor)/255.0f; - env[1] = RDP_GETC32_G(state.envColor)/255.0f; - env[2] = RDP_GETC32_B(state.envColor)/255.0f; - env[3] = RDP_GETC32_A(state.envColor)/255.0f; - glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env); - - env[0] = RDP_GETC32_R(state.blendColor)/255.0f; - env[1] = RDP_GETC32_G(state.blendColor)/255.0f; - env[2] = RDP_GETC32_B(state.blendColor)/255.0f; - env[3] = RDP_GETC32_A(state.blendColor)/255.0f; - glLightfv(GL_LIGHT0, GL_AMBIENT, env); - - env[0] = RDP_GETC32_R(state.fogColor)/255.0f; - env[1] = RDP_GETC32_G(state.fogColor)/255.0f; - env[2] = RDP_GETC32_B(state.fogColor)/255.0f; - env[3] = RDP_GETC32_A(state.fogColor)/255.0f; - glLightfv(GL_LIGHT0, GL_DIFFUSE, env); - - glActiveTextureARB(GL_TEXTURE1_ARB); - env[0] = state.k5/255.0f; - glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env); - if (cycle == RDP_CYCLE_TYPE_FILL) { - if (0/*fb_size == 3*/) { // FIXME - env[0] = RDP_GETC32_R(state.fillColor)/255.0f; - env[1] = RDP_GETC32_G(state.fillColor)/255.0f; - env[2] = RDP_GETC32_B(state.fillColor)/255.0f; - env[3] = RDP_GETC32_A(state.fillColor)/255.0f; - } else { - env[0] = RDP_GETC16_R(state.fillColor)/31.0f; - env[1] = RDP_GETC16_G(state.fillColor)/31.0f; - env[2] = RDP_GETC16_B(state.fillColor)/31.0f; - env[3] = RDP_GETC16_A(state.fillColor); - } - } else { - env[0] = RDP_GETC32_R(state.primColor)/255.0f; - env[1] = RDP_GETC32_G(state.primColor)/255.0f; - env[2] = RDP_GETC32_B(state.primColor)/255.0f; - env[3] = RDP_GETC32_A(state.primColor)/255.0f; - } - glLightfv(GL_LIGHT0, GL_SPECULAR, env); - glActiveTextureARB(GL_TEXTURE0_ARB); - rglAssert(glGetError() == GL_NO_ERROR); - - // if (c && rglNbCombiners && - // RDP_GETOM_CYCLE_TYPE(c->otherModes) == cycle && - // (RDP_GETOM_CYCLE_TYPE(c->otherModes) >= 2 || - // (!memcmp(&c->combineModes, &state.combineModes, sizeof(rdpCombineModes_t)) && - // !memcmp(&c->otherModes, &state.otherModes, sizeof(rdpOtherModes_t))))) { - // return; - // } - - for (i=0; iformat == format && - RDP_GETOM_CYCLE_TYPE(c->otherModes) == cycle && - (RDP_GETOM_CYCLE_TYPE(c->otherModes) >= 2 || - (!memcmp(&c->combineModes, &state.combineModes, sizeof(rdpCombineModes_t)) - && !memcmp(&c->otherModes, &state.otherModes, sizeof(rdpOtherModes_t)) - ))) { -#ifdef RDP_DEBUG - chunk.shader = c->shader; -#endif - rglUseShader(c->shader); - goto ok; - } - } - - if (rglNbCombiners == RGL_MAX_COMBINERS) - rglClearCombiners(); - - c = rglCombiners + rglNbCombiners++; - c->otherModes = state.otherModes; - c->combineModes = state.combineModes; - c->format = format; -#ifndef RGL_EXACT_BLEND - c->srcBlend = GL_ONE; - c->dstBlend = GL_ZERO; -#endif - - switch (format & RGL_COMB_FMT) { -case RGL_COMB_FMT_RGBA: - write = "gl_FragColor = c;"; - break; -case RGL_COMB_FMT_I: - write = "gl_FragColor = vec4(c[0]);"; - break; -case RGL_COMB_FMT_DEPTH: - write = "gl_FragDepth = c[0];"; - break; - } - - if (cycle == RDP_CYCLE_TYPE_FILL) { - sprintf( - src, - "void main() \n" - "{ \n" - //" c = gl_TextureEnvColor[1];\n" - " vec4 c = gl_LightSource[0].specular;\n" - " %s\n" - "} \n", - write); - c->shader = rglCreateShader( - "void main() \n" - "{ \n" - " gl_Position = ftransform(); \n" - " gl_FrontColor = gl_Color; \n" - " gl_BackColor = gl_Color; \n" - " gl_TexCoord[0] = gl_MultiTexCoord0; \n" - "} \n" - , - src - ); -#ifdef RDP_DEBUG - chunk.shader = c->shader; -#endif - rglUseShader(c->shader); - goto ok; - } - - alphaTest = ""; - alphaTest2 = ""; - - if (//cycle < 2 && // CHECK THIS - RDP_GETOM_CVG_TIMES_ALPHA(chunk.rdpState.otherModes) - //&& rglT1Usage(chunk.rdpState) - ) { - if (RDP_GETOM_ALPHA_CVG_SELECT(chunk.rdpState.otherModes)) - alphaTest = "if (c.a < 0.5) discard; \n"; - else - alphaTest = "if (t1.a < 0.5) discard; \n"; - alphaTest2 = "if (c.a < 0.5) discard; \n"; - } - else if (RDP_GETOM_ALPHA_COMPARE_EN(chunk.rdpState.otherModes) && - !RDP_GETOM_ALPHA_CVG_SELECT(chunk.rdpState.otherModes)) { - if (RDP_GETC32_A(chunk.rdpState.blendColor) > 0) { - alphaTest = "if (c.a < b.a) discard; \n"; - alphaTest2 = - " vec4 b = gl_LightSource[0].ambient; \n" - " if (c.a < b.a) discard; \n"; - //alphaTest2 = "if (c.a < 0.5) discard; \n"; - } else { - alphaTest = "if (c.a == 0.0) discard; \n"; - alphaTest2 = "if (c.a == 0.0) discard; \n"; - } - } - - if (cycle == RDP_CYCLE_TYPE_COPY) { - sprintf( - src, - "uniform sampler2D texture0; \n" - " \n" - "void main() \n" - "{ \n" - " vec4 c = texture2D(texture0, vec2(gl_TexCoord[0])); \n" - " %s" - " %s\n" - "} \n", - alphaTest2, - write - ); - c->shader = rglCreateShader( - "void main() \n" - "{ \n" - " gl_Position = ftransform(); \n" - " gl_FrontColor = gl_Color; \n" - " gl_BackColor = gl_Color; \n" - " gl_TexCoord[0] = gl_MultiTexCoord0; \n" - "} \n" - , - src - ); -#ifdef RDP_DEBUG - chunk.shader = c->shader; -#endif - rglUseShader(c->shader); - goto ok; - } - - - p = src; - p += - sprintf(p, - "uniform sampler2D texture0; \n" - "uniform sampler2D texture2; \n" -#ifdef RGL_EXACT_BLEND - "uniform sampler2D texture1; \n" -#endif - " \n" - "void main() \n" - "{ \n" - "vec4 c = vec4(0,0,0,0);\n" - "vec4 e = gl_TextureEnvColor[0];\n" - "float k5 = gl_TextureEnvColor[1][0];\n" - "vec4 p = gl_LightSource[0].specular;\n" -#ifdef RGL_EXACT_BLEND - "vec4 f = texture2D(texture1, vec2(gl_FragCoord.x/(2048.0*gl_TexCoord[1].x), gl_FragCoord.y/(2048.0*gl_TexCoord[1].y))); \n" -#endif - "vec4 fog = gl_LightSource[0].diffuse; \n" - "vec4 b = gl_LightSource[0].ambient; \n"); - - switch (format & RGL_COMB_IN0) { -case 0: - p += - sprintf(p, - "vec4 t1 = texture2D(texture0, vec2(gl_TexCoord[0]));\n"); - break; -case RGL_COMB_IN0_DEPTH: - p += - sprintf(p, - "vec4 t1 = vec4(texture2D(texture0, vec2(gl_TexCoord[0]))[0]);\n"); - break; - } - switch (format & RGL_COMB_IN1) { -case 0: - p += - sprintf(p, - "vec4 t2 = texture2D(texture2, vec2(gl_TexCoord[2]));\n"); - break; -case RGL_COMB_IN1_DEPTH: - p += - sprintf(p, - "vec4 t2 = vec4(texture2D(texture2, vec2(gl_TexCoord[2]))[0]);\n"); - break; - } - - const char * comb, * comb2; - comb2 = 0; - // switch (RDP_GETOM_CVG_DEST(state.otherModes)) - // { - // case 3: - // comb = "c = clamp(vec4((vec3(%s) - vec3(%s)) * vec3(%s) + vec3(%s), (%s - %s) * %s + %s), 0.0, 1.0);\n"; - // break; - // case 2: - // comb = "c = vec4((vec3(%s) - vec3(%s)) * vec3(%s) + vec3(%s), (%s - %s) * %s + %s);\n"; - // //comb = "c = vec4((vec3(%s) - vec3(%s)) * vec3(%s) + vec3(%s), t1.a*((%s - %s) * %s + %s));\n"; - // break; - // case 0: - // //comb2 = "c = vec4((vec3(%s) - vec3(%s)) * vec3(%s) + vec3(%s), t1.a);\n"; - // case 1: - // comb = "c = vec4((vec3(%s) - vec3(%s)) * vec3(%s) + vec3(%s), (%s - %s) * %s + %s);\n"; - // break; - // } - comb = "c = clamp(vec4((vec3(%s) - vec3(%s)) * vec3(%s) + vec3(%s), (%s - %s) * %s + %s), 0.0, 1.0);\n"; - strcpy(prim_lod_frac, "0.5/*PRIM_LOD_FRAC*/"); - strcpy(t1, "t1"); - strcpy(t1a, "t1.a"); - if (format & RGL_COMB_TILE7) { - strcpy(t2, "t1"); - strcpy(t2a, "t1.a"); - } else { - strcpy(t2, "t2"); - strcpy(t2a, "t2.a"); - } - p += - sprintf(p, - comb - , - saRGB[RDP_GETCM_SUB_A_RGB0(state.combineModes)], - saRGB[RDP_GETCM_SUB_B_RGB0(state.combineModes)], - mRGB[RDP_GETCM_MUL_RGB0(state.combineModes)], - aRGB[RDP_GETCM_ADD_RGB0(state.combineModes)], - saA[RDP_GETCM_SUB_A_A0(state.combineModes)], - sbA[RDP_GETCM_SUB_B_A0(state.combineModes)], - mA[RDP_GETCM_MUL_A0(state.combineModes)], - aA[RDP_GETCM_ADD_A0(state.combineModes)] - ); - - if (cycle == RDP_CYCLE_TYPE_2) { - if (!(format & RGL_COMB_TILE7)) { - strcpy(t1, "t2"); - strcpy(t1a, "t2.a"); - strcpy(t2, "t1"); - strcpy(t2a, "t1.a"); - } - //strcpy(prim_lod_frac, "0.0/*PRIM_LOD_FRAC*/"); - // if (!RDP_GETOM_ALPHA_CVG_SELECT(chunk.rdpState.otherModes)) - // p += - // sprintf(p, " c.a = t1.a; \n"); - - p += - sprintf(p, - comb2? comb2 : comb - , - saRGB[RDP_GETCM_SUB_A_RGB1(state.combineModes)], - saRGB[RDP_GETCM_SUB_B_RGB1(state.combineModes)], - mRGB[RDP_GETCM_MUL_RGB1(state.combineModes)], - aRGB[RDP_GETCM_ADD_RGB1(state.combineModes)], - saA[RDP_GETCM_SUB_A_A1(state.combineModes)], - sbA[RDP_GETCM_SUB_B_A1(state.combineModes)], - mA[RDP_GETCM_MUL_A1(state.combineModes)], - aA[RDP_GETCM_ADD_A1(state.combineModes)] - ); - } - - // if (!RDP_GETOM_CVG_TIMES_ALPHA(state.otherModes)) - // p += sprintf(p, "c.a = t1.a; \n"); - - p += sprintf(p, "%s", alphaTest); - - - const char * blender; - blender = "c = vec4(float(%s)*vec3(%s) + float(%s)*vec3(%s), 1.0); \n"; -#ifdef RGL_EXACT_BLEND - const char * noblender = "c.a = 1.0;\n"; -#endif - - int m1b, m1a, m2b, m2a; - - //LOG("New combiner / blender :\n%s", rglCombiner2String(state)); - - if (cycle == RDP_CYCLE_TYPE_2) { - if (RDP_GETOM_FORCE_BLEND(state.otherModes)) { -#ifndef RGL_EXACT_BLEND - if (RDP_GETOM_BLEND_M1A_0(state.otherModes) != 1 && - RDP_GETOM_BLEND_M2A_0(state.otherModes) != 1) { -#endif - sprintf(_1ma, "(1.0 - %s)", bA[0][RDP_GETOM_BLEND_M1B_0(state.otherModes)]); - p += - sprintf( - p, - "c = vec4(float(%s)*vec3(%s) + float(%s)*vec3(%s), c.a); \n" - ,bA[0][RDP_GETOM_BLEND_M1B_0(state.otherModes)], - bRGB[RDP_GETOM_BLEND_M1A_0(state.otherModes)], - bA[1][RDP_GETOM_BLEND_M2B_0(state.otherModes)], - bRGB[RDP_GETOM_BLEND_M2A_0(state.otherModes)] - ); -#ifndef RGL_EXACT_BLEND - } else { - LOG("Blender error : fragment in cycle 1\n%s", rglCombiner2String(state)); - } -#endif - - m1b = RDP_GETOM_BLEND_M1B_1(state.otherModes); - m1a = RDP_GETOM_BLEND_M1A_1(state.otherModes); - m2b = RDP_GETOM_BLEND_M2B_1(state.otherModes); - m2a = RDP_GETOM_BLEND_M2A_1(state.otherModes); - } else { - m1b = RDP_GETOM_BLEND_M1B_0(state.otherModes); - m1a = RDP_GETOM_BLEND_M1A_0(state.otherModes); - m2b = RDP_GETOM_BLEND_M2B_0(state.otherModes); - m2a = RDP_GETOM_BLEND_M2A_0(state.otherModes); - } - } else { - m1b = RDP_GETOM_BLEND_M1B_0(state.otherModes); - m1a = RDP_GETOM_BLEND_M1A_0(state.otherModes); - m2b = RDP_GETOM_BLEND_M2B_0(state.otherModes); - m2a = RDP_GETOM_BLEND_M2A_0(state.otherModes); - } - - if (RDP_GETOM_FORCE_BLEND(state.otherModes) || cycle == RDP_CYCLE_TYPE_2) { -#ifndef RGL_EXACT_BLEND - if (m1a == 1 || m2a == 1) { - if (/*(m1a != 1 || m1b == 3) &&*/ (m2a == 1 || m2b == 3)) { - int src = GL_ZERO, dst = GL_ONE; - const char * alpha = "c.a"; - switch (m1b) { -case 0: // c.a - src = GL_SRC_ALPHA; - break; -case 1: // fog.a - src = GL_SRC_ALPHA; - alpha = "fog.a"; - // LOGERROR("Unsupported src alpha : FOG\n"); - // LOGERROR(rglCombiner2String(state)); - break; -case 2: // shade.a - src = GL_SRC_ALPHA; - alpha = "gl_Color.a"; - // LOGERROR("Unsupported src alpha : SHADE\n"); - // LOGERROR(rglCombiner2String(state)); - break; -case 3: // 0 - src = GL_ZERO; - break; - } - switch (m1a) { -case 0: // c - if (m1b != 0 /* c.a */) - p += sprintf( - p, "c.a = %s; \n", alpha); - break; -case 1: // f - LOGERROR("Unsupported src color : FRAG\n"); - LOGERROR("%s", rglCombiner2String(state)); - break; -case 2: // b - p += sprintf( - p, "c = vec4(vec3(b), %s); \n", alpha); - break; -case 3: // fog - p += sprintf( - p, "c = vec4(vec3(fog), %s); \n", alpha); - break; - } - switch (m2b) { -case 0: - switch (m1b) { -case 3: - dst = GL_ONE; - break; -default: - dst = GL_ONE_MINUS_SRC_ALPHA; - break; - } - break; -case 1: - dst = GL_DST_ALPHA; - break; -case 2: - dst = GL_ONE; - break; -case 3: - dst = GL_ZERO; - break; - } - - c->srcBlend = src; - c->dstBlend = dst; - } else { - LOGERROR("Unsuported blender :\n"); - LOGERROR("%s", rglCombiner2String(state)); - } - } - else -#endif - { - sprintf(_1ma, "(1.0 - %s)", bA[0][m1b]); - p += - sprintf(p, blender, bA[0][m1b], bRGB[m1a], bA[1][m2b], bRGB[m2a]); - } - } else { -#ifdef RGL_EXACT_BLEND - p += - sprintf(p, - noblender - ); -#endif - } - - p += - sprintf( - p, - "%s \n" - "} \n" - ,write - ); - - rglAssert(p < src+sizeof(src)); - -#ifdef RGL_EXACT_BLEND - //printf("Creating combiner : \n%s", src); -#endif - - c->shader = rglCreateShader( - "void main() \n" - "{ \n" - " gl_Position = ftransform(); \n" - " gl_FrontColor = gl_Color; \n" - " gl_BackColor = gl_FrontColor; \n" - " gl_TexCoord[0] = gl_MultiTexCoord0; \n" -#ifdef RGL_EXACT_BLEND - " gl_TexCoord[1] = gl_MultiTexCoord1; \n" -#endif - " gl_TexCoord[2] = gl_MultiTexCoord2; \n" - "} \n" - , - src); - -#ifdef RDP_DEBUG - chunk.shader = c->shader; -#endif - rglUseShader(c->shader); - rglAssert(glGetError() == GL_NO_ERROR); - - int location; - location = glGetUniformLocationARB(c->shader->prog, "texture0"); - glUniform1iARB(location, 0); -#ifdef RGL_EXACT_BLEND - location = glGetUniformLocationARB(c->shader->prog, "texture1"); - glUniform1iARB(location, 1); -#endif - location = glGetUniformLocationARB(c->shader->prog, "texture2"); - glUniform1iARB(location, 2); - rglAssert(glGetError() == GL_NO_ERROR); - -ok:; -#ifndef RGL_EXACT_BLEND - if ((format & RGL_COMB_FMT) == RGL_COMB_FMT_DEPTH || - (c->srcBlend == GL_ONE && c->dstBlend == GL_ZERO)) - glDisable(GL_BLEND); - else { - glEnable(GL_BLEND); - if ((format & RGL_COMB_FMT) == RGL_COMB_FMT_RGBA) - glBlendFuncSeparate(c->srcBlend, c->dstBlend, GL_ZERO, GL_ONE); - else - glBlendFunc(c->srcBlend, c->dstBlend); - } -#endif -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_settings.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_settings.cpp deleted file mode 100644 index 65d9ea49db..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_settings.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -extern ptr_ConfigOpenSection ConfigOpenSection; -extern ptr_ConfigSetParameter ConfigSetParameter; -extern ptr_ConfigGetParameter ConfigGetParameter; -extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp; -extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt; -extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat; -extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool; -extern ptr_ConfigSetDefaultString ConfigSetDefaultString; -extern ptr_ConfigGetParamInt ConfigGetParamInt; -extern ptr_ConfigGetParamFloat ConfigGetParamFloat; -extern ptr_ConfigGetParamBool ConfigGetParamBool; -extern ptr_ConfigGetParamString ConfigGetParamString; - -char rgl_cwd[512]; - -int rglReadSettings() -{ - - m64p_handle videoGeneralSection; - m64p_handle videoZ64Section; - if (ConfigOpenSection("Video-General", &videoGeneralSection) != M64ERR_SUCCESS || - ConfigOpenSection("Video-Z64", &videoZ64Section) != M64ERR_SUCCESS) - { - rdp_log(M64MSG_ERROR, "Could not open configuration"); - return false; - } - - ConfigSetDefaultBool(videoGeneralSection, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False"); - ConfigSetDefaultBool(videoZ64Section, "HiResFB", true, "High resolution framebuffer"); - ConfigSetDefaultBool(videoZ64Section, "FBInfo", true, "Use framebuffer info"); - ConfigSetDefaultBool(videoZ64Section, "Threaded", false, "Run RDP on thread"); - ConfigSetDefaultBool(videoZ64Section, "Async", false, "Run RDP asynchronously"); - ConfigSetDefaultBool(videoZ64Section, "NoNpotFbos", false, "Don't use NPOT FBOs (may be needed for older graphics cards)"); - - rglSettings.resX = ConfigGetParamInt(videoGeneralSection, "ScreenWidth"); - rglSettings.resY = ConfigGetParamInt(videoGeneralSection, "ScreenHeight"); - rglSettings.fsResX = ConfigGetParamInt(videoGeneralSection, "ScreenWidth"); - rglSettings.fsResY = ConfigGetParamInt(videoGeneralSection, "ScreenHeight"); - rglSettings.fullscreen = ConfigGetParamBool(videoGeneralSection, "Fullscreen"); - rglSettings.hiresFb = ConfigGetParamBool(videoZ64Section, "HiResFB"); - rglSettings.fbInfo = ConfigGetParamBool(videoZ64Section, "FBInfo"); - rglSettings.threaded = ConfigGetParamBool(videoZ64Section, "Threaded"); - rglSettings.async = ConfigGetParamBool(videoZ64Section, "Async"); - rglSettings.noNpotFbos = ConfigGetParamBool(videoZ64Section, "NoNpotFbos"); - - return true; -} diff --git a/libmupen64plus/mupen64plus-video-z64/src/rgl_tiles.cpp b/libmupen64plus/mupen64plus-video-z64/src/rgl_tiles.cpp deleted file mode 100644 index bca1554c2c..0000000000 --- a/libmupen64plus/mupen64plus-video-z64/src/rgl_tiles.cpp +++ /dev/null @@ -1,676 +0,0 @@ -/* - * z64 - * - * Copyright (C) 2007 ziggy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -#include "rdp.h" -#include "rgl.h" - -#include - -rglTextureHead_t freeTextures; -rglTextureHead_t texturesByCrc[256]; -rglTextureHead_t texturesByUsage; - -void rglTouchTMEM() -{ - rglTexCacheCounter++; - if (!rglTexCacheCounter) { - // shouldn't happen too often but let's do things correctly for the hell of it ;) - rglResetTextureCache(); - } -} - -inline int crc8(uint32_t crc) -{ - uint8_t res; - res = crc^(crc>>8)^(crc>>16)^(crc>>24); - return res; -} - -void rglDeleteTexture(rglTexture_t * tex) -{ - //LOG("deleting texture %x\n", tex); - glDeleteTextures(1, &tex->id); - if (tex->zid) - glDeleteTextures(1, &tex->zid); - rglAssert(glGetError() == GL_NO_ERROR); - tex->id = tex->zid = 0; - CIRCLEQ_REMOVE(&texturesByUsage, tex, byUsage); - CIRCLEQ_REMOVE(&texturesByCrc[crc8(tex->crc)], tex, byCrc); - CIRCLEQ_INSERT_TAIL(rglTexture_t, &freeTextures, tex, byUsage); -} - -rglTexture_t * rglNewTexture(uint32_t crc) -{ - rglTexture_t * res; - - if (CIRCLEQ_EMPTY(&freeTextures)) - rglDeleteTexture(CIRCLEQ_FIRST(&texturesByUsage)); - - res = CIRCLEQ_FIRST(&freeTextures); - //LOG("new texture %x %x crc %x\n", res, crc, crc8(crc)); - CIRCLEQ_REMOVE(&freeTextures, res, byUsage); - CIRCLEQ_INSERT_TAIL(rglTexture_t, &texturesByUsage, res, byUsage); - CIRCLEQ_INSERT_TAIL(rglTexture_t, &texturesByCrc[crc8(crc)], res, byCrc); - - res->wt = res->ws = res->filter = 0; - - return res; -} - -void rglInitTextureCache() -{ - int i; - // initialize textures lists - CIRCLEQ_INIT(rglTexture_t, &freeTextures); - CIRCLEQ_INIT(rglTexture_t, &texturesByUsage); - for (i=0; i<256; i++) - CIRCLEQ_INIT(rglTexture_t, &texturesByCrc[i]); - for (i=0; i>2)+1; - int cliph = ((tile.th - tile.tl) >>2)+1; - int indirect = 1; - uint8_t * from = rdpTmem; - int ow, oh; - - // if (recth && cliph == recth+1) // hack for Mario Party (not necessary if we handle filter for texrect) - // cliph = recth; - - // if (tile.ms && tile.mask_s && (2<> tile.size; - //if (tile.mask_s && (1<>2)+1; // FIXME why not cliph ??? - //tile.h = (tile.th >>2)+1; - // if (tile.h <= 0) - // tile.h = (tile.th >>2)+1; - // FIXME remove test on mt ? - if (tile.mask_t && ((1<>2)) tile.h <<= 1; - // } - } - - // if (!tile.mask_t && !tile.ct/* && !tile.mt*/) - // tile.h = (0x1000-tile.tmem)/line; - - // if (tile.sl && !tile.mask_s) { - // printf("shifting sl %d\n", tile.sl); - // tile.tmem += tile.sl << tile.format >> 1; - // tile.tmem &= 0xfff; - // tile.sl = 0; - // } - // if (tile.tl && !tile.mask_t) { - // printf("shifting tl %d\n", tile.tl); - // tile.tmem += tile.tl * line; - // tile.tmem &= 0xfff; - // tile.tl = 0; - // } - - if (recth && tile.h == 1) - // +1 for yoshi - tile.h = recth+1; - - if (/*tile.h == 1 || */tile.w*tile.h << tile.size >> 1 > 0x1000-tile.tmem) { - DUMP("fixing tile size from %dx%d to ", tile.w, tile.h); - //tile.w = (line << 3) >> tile.size + 2; - //tile.h = 1; while (tile.h<(tile.th>>2)) tile.h <<= 1; - tile.h = (0x1000-tile.tmem)/line; - DUMP("%dx%d\n", tile.w, tile.h); - } - - // this is a warkaround for a bug in pj64 rsp plugin - // now fixed - if (0&&recth && /*tile.line == 8 && */tile.h == 1) { - //LOG("direct\n"); - tile.w = rdpTiWidth << rdpTiSize >> tile.size; - tile.h = recth; - from = gfx.RDRAM + rdpTiAddress; - if (recth > 1 || rdpTiWidth > 1) - line = rdpTiWidth << rdpTiSize >> 1; - indirect = 0; - } - - { - int fromLine, stop, fromFormat, fromSize; - uint32_t address = rdpGetTmemOrigin(tile.tmem, &fromLine, &stop, &fromFormat, &fromSize); - DUMP("tmem %x rdram %x\n", tile.tmem, address); - if (address != (uint32_t)~0) { - rglRenderBuffer_t * buffer; - if (!fromLine) fromLine = line; - if (!tile.mask_t) - tile.h = (stop-tile.tmem)/line; - rtile.hiresBuffer = 0; - //while (0) { - CIRCLEQ_FOREACH(rglRenderBuffer_t, buffer, &rBufferHead, link) { - //if (buffer->flags & RGL_RB_DEPTH) continue; - if (buffer->area.xh != 8192) - buffer->addressStop = buffer->addressStart + buffer->line * ((buffer->area.yl >>2)+1); - - // conservative - // if (address + tile.h * line > buffer->addressStart && - // address < buffer->addressStop) - if (address >= buffer->addressStart/* + buffer->line * ((buffer->area.yh >>2)+1)*/ && // oops cannot use yh, might not be initialized - address + tile.h * line <= buffer->addressStop) - DUMP("check %x --> %x with %x --> %x (%x %x %d %x)\n", - address, address + tile.h * line, - buffer->addressStart, buffer->addressStop, - fromLine, buffer->line, tile.h, line); - - // TODO store real address stop, it's not necessarily the same as - // address + tile.h * line - // conservative - // if (address + tile.h * line > buffer->addressStart && - // address < buffer->addressStop && - // more strict (better for LEGO racer) - // general solution would be : find all candidates, pick the one that covers - // the biggest area - if ((!rtile.hiresBuffer || buffer->addressStart > rtile.hiresBuffer->addressStart) && - address >= buffer->addressStart/* + buffer->line * ((buffer->area.yh >>2)+1)*/ && // oops cannot use yh, might not be initialized - address + tile.h * line <= buffer->addressStop && - (tile.h <= 1 || fromLine == buffer->line)) { - DUMP("texture buffer at %x %d x %d %d %d fmt %d fromfmt %d\n", - buffer->addressStart, tile.w, tile.h, - fromLine, buffer->line, tile.format, fromFormat); - - rtile.hiresBuffer = buffer; - rtile.hiresAddress = address; - - break; - } - } - - if (rtile.hiresBuffer) { - // FIXME current buffer could be a depth buffer, in this case - // we want the texture rendered as depth too - rtile.hiresBuffer->flags &= ~RGL_RB_DEPTH; - //rglRenderChunks(rtile.hiresBuffer); - } - - if (rglSettings.hiresFb && rtile.hiresBuffer) { - memcpy(&rtile, &tile, sizeof(tile)); - return; - } - - if (rtile.hiresBuffer) { - LOG("updating rdram %x\n", address); - rglFramebuffer2Rdram(*rtile.hiresBuffer, address, address + tile.h * line); - line = fromLine; - from = gfx.RDRAM + address; - indirect = 0; - } - - } - } - rtile.hiresBuffer = 0; - - if (tile.w > 1024) tile.w = 1024; - if (tile.h > 1024) tile.h = 1024; - - ow = tile.w; oh = tile.h; // save w/h before making it a power of 2 - { - int w=1, h=1; - while (w < tile.w) w*=2; - while (h < tile.h) h*=2; - tile.w = rtile.w = w; - tile.h = rtile.h = h; - } - - memcpy(&rtile, &tile, sizeof(tile)); - rtile.line = line; - - // NOTE more general solutions would involve subdividing the geometry - // or writing clamping/mirroring in glsl - int badmirror_s = - tile.mask_s && tile.cs && tile.ms && (clipw/2) < (1< (1< (1<>2) << tile.size >> 1; - // tile.sh -= tile.sl; - // tile.sl = 0; - ws = GL_CLAMP_TO_EDGE; - } - if (tile.ms && !badmirror_s) - ws = ((!tile.mask_s || tile.cs) && !badclamp_s)? -GL_MIRROR_CLAMP_TO_EDGE_EXT : GL_MIRRORED_REPEAT; - - wt = GL_REPEAT; - //wt = GL_CLAMP_TO_EDGE; - if ((!tile.mask_t || tile.ct) && !badclamp_t) { - // tile.tmem += (tile.tl>>2) * line; - // tile.th -= tile.tl; - // tile.tl = 0; - wt = GL_CLAMP_TO_EDGE; - } - if (tile.mt && !badmirror_t) - wt = ((!tile.mask_t || tile.ct) && !badclamp_t)? -GL_MIRROR_CLAMP_TO_EDGE_EXT : GL_MIRRORED_REPEAT; - -#if 1 - if ((npot_s||npot_t) && ws != GL_CLAMP_TO_EDGE) { - //LOG("Fixup npot clamp s\n"); - ws = GL_CLAMP_TO_EDGE; - } - if ((npot_t||npot_s) && wt != GL_CLAMP_TO_EDGE) { - //LOG("Fixup npot clamp t\n"); - wt = GL_CLAMP_TO_EDGE; - } -#else - // ws = GL_CLAMP_TO_EDGE; - // wt = GL_CLAMP_TO_EDGE; -#endif - - rtile.ws = ws; - rtile.wt = wt; - - rglAssert(!(tile.tmem & ~ 0xfff)); - if (rglTexCache[tile.tmem].counter == rglTexCacheCounter && - rglTexCache[tile.tmem].tex->fmt == tile.format && - rglTexCache[tile.tmem].tex->w == tile.w - && - rglTexCache[tile.tmem].tex->h == tile.h - // rglTexCache[tile.tmem].tex->h > (tile.th>>2) - ) { - tex = rglTexCache[tile.tmem].tex; - goto ok; - } - - // printf("tile #%d fmt %s sz %d w %d mask %d %dx%d (%d %d)\n", &tile-rdpTiles, rdpImageFormats[tile.format], tile.size, line, tile.mask_s, (tile.sh - tile.sl >>2)+1, (tile.th - tile.tl >>2)+1, tile.sl>>2, tile.tl>>2); - - //rglAssert(tile.w == (tile.sh - tile.sl >>2)+1); - - { - int h, i, j, x, y; - int palette = 0; - uint32_t crc = 0; - rglTextureHead_t * list; - -#if 1 - if (tile.format == RDP_FORMAT_CI || - (tile.size <= 1 && RDP_GETOM_EN_TLUT(rdpState.otherModes))) { - // tlut crc - h = tile.size? 256:16; - if (tile.size == 0) palette = (tile.palette<<4)&0xff; - for (i=0; i>3)|(crc<<(32-3)))+(rdpTlut[(i+palette)*4]); - } - - for (y=0; y>2); x++) - crc = ((crc>>3)|(crc<<(32-3)))+(*p++); - } - - list = texturesByCrc + crc8(crc); - CIRCLEQ_FOREACH(rglTexture_t, tex, list, byCrc) { - //LOG("comparing %x with %x\n", tex->crc, crc); - if (tex->crc == crc && - tex->fmt == tile.format && - tex->clipw >= clipw && - tex->cliph >= cliph && - tex->w == tile.w && - tex->h >= tile.h) { - CIRCLEQ_REMOVE(&texturesByUsage, tex, byUsage); - CIRCLEQ_INSERT_TAIL(rglTexture_t, &texturesByUsage, tex, byUsage); - goto ok2; - } - // if (tex->crc == crc) - // LOG("Same CRC %x !\n", crc); - } -#endif - - tex = rglNewTexture(crc); - tex->fmt = tile.format; - tex->w = tile.w; - tex->h = tile.h; - tex->clipw = clipw; - tex->cliph = cliph; - tex->crc = crc; - glGenTextures(1, &tex->id); - rglAssert(glGetError() == GL_NO_ERROR); - - - glBindTexture(GL_TEXTURE_2D, tex->id); - rglAssert(glGetError() == GL_NO_ERROR); - uint8_t * ptr; - GLuint packed = 0; - GLuint glfmt = 0, glpixfmt = 0; - - ptr = rglTmpTex2; - -#define XOR_SWAP_BYTE 3 -#define XOR_SWAP_WORD 2 -#define XOR_SWAP_DWORD 2 - // ugly but it works ... - if (tile.cs || !tile.mask_s) ow = tile.w; - if (tile.ct || !tile.mask_t) oh = tile.h; -#define CLAMP \ - int ci = i; \ - int cj = j; \ - if ((tile.cs || !tile.mask_s) && ci >= clipw) ci = clipw-1; \ - if ((tile.ct || !tile.mask_t) && cj >= cliph) cj = cliph-1; \ - - switch (tile.size) { - case 3: - for (j=0; j>4)|(a<<4); - } - break; - } - from = ptr; - - i = tile.format; - - // in Tom Clancy, they do this, using I texture with TLUT enabled - if (i != RDP_FORMAT_CI && tile.size <= 1 && RDP_GETOM_EN_TLUT(rdpState.otherModes)) { - LOG("fixing %s-%d tile to CI\n", rdpImageFormats[i], tile.size); - i = RDP_FORMAT_CI; - } - - if (tile.size <= 1 && i == RDP_FORMAT_RGBA) { - LOG("fixing RGBA tile to I\n"); - i = RDP_FORMAT_I; - } - - switch (i) { - case RDP_FORMAT_CI: { - if (!RDP_GETOM_TLUT_TYPE(rdpState.otherModes)) { - glfmt = GL_RGBA; - packed = GL_UNSIGNED_SHORT_5_5_5_1; - } else { - glfmt = GL_RGBA; - glpixfmt = GL_LUMINANCE_ALPHA; - //glfmt = GL_LUMINANCE_ALPHA; - packed = GL_UNSIGNED_BYTE; - } - switch (tile.size) { - case 0: - ptr = rglTmpTex; - for (i=0; i>4) + palette/* ^ WORD_ADDR_XOR*/)*4]; - if (RDP_GETOM_TLUT_TYPE(rdpState.otherModes)) { - a = (a>>8)|(a<<8); - b = (b>>8)|(b<<8); - } - *(uint16_t *)&ptr[i*4] = a; - *(uint16_t *)&ptr[i*4+2] = b; - } - break; - case 1: - ptr = rglTmpTex; - //rdpTlut[palette] = 0; - for (i=0; i>8)|(a<<8); - *(uint16_t *)&ptr[i*2] = a; - } - break; - } - break; - } - case RDP_FORMAT_RGBA: { - glfmt = GL_RGBA; - switch (tile.size) { - case 2: - //packed = GL_UNSIGNED_SHORT_4_4_4_4_REV; - packed = GL_UNSIGNED_SHORT_5_5_5_1; - break; - case 3: - packed = GL_UNSIGNED_INT_8_8_8_8; - break; - } - break; - } - case RDP_FORMAT_IA: { - glfmt = GL_RGBA; - glpixfmt = GL_LUMINANCE_ALPHA; - //if (tile.size == 0) line *= 2; - switch (tile.size) { - case 0: { - packed = GL_UNSIGNED_BYTE; - ptr = rglTmpTex; - for (i=0; i> 5; - int8_t b = (from[i]&0x10) >> 4; - ptr[i*4+2] = (a<<5) | (a<<2) | (a>>1); - ptr[i*4+3] = -b; - a = (from[i]&0xe) >> 1; - b = (from[i]&0x1); - ptr[i*4+0] = (a<<5) | (a<<2) | (a>>1); - ptr[i*4+1] = -b; - } - break; - } - case 1: { - packed = GL_UNSIGNED_BYTE; - ptr = rglTmpTex; - for (i=0; i>4); - ptr[i*2] = a | (a>>4); - a = from[i]&0x0F; - a = a | (a<<4); - ptr[i*2+1] = a; - } - break; - } - case 2: - packed = GL_UNSIGNED_BYTE; - ptr = rglTmpTex; - for (i=0; i>4); - a = from[i]&0x0F; - ptr[i*2] = a | (a<<4); - } - break; - } - case 1: { - packed = GL_UNSIGNED_BYTE; - break; - } - } - break; - } - } - - if (packed) { - DUMP("loading texture %dx%d fmt %s size %x (%x %x %x %p)\n", tile.w, tile.h, rdpImageFormats[tile.format], tile.size, glfmt, glpixfmt, packed, ptr); - // printf("cycle type = %d\n", chunk.rdpState.otherModes.cycle_type); - if (!glpixfmt) - glpixfmt = glfmt; - rglAssert(glGetError() == GL_NO_ERROR); - glTexImage2D(GL_TEXTURE_2D, 0, glfmt, tile.w, tile.h, 0, glpixfmt, packed, - ptr); - rglAssert(glGetError() == GL_NO_ERROR); - - -#if 0 - if (1||RDP_GETOM_CYCLE_TYPE(rdpState.otherModes) == RDP_CYCLE_TYPE_COPY) { - uint32_t * pixels = (uint32_t *) malloc(tile.w*tile.h*4); - // 0x1902 is another constant meaning GL_DEPTH_COMPONENT - // (but isn't defined in gl's headers !!) - if (1/*fmt != GL_DEPTH_COMPONENT && fmt != 0x1902*/) { - glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels); - ilTexImage(tile.w, tile.h, 1, 4, IL_RGBA, IL_UNSIGNED_BYTE, pixels); - } else { - glGetTexImage(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, pixels); - int i; - for (i=0; i - -#define DACRATE_NTSC (48681812) -#define DACRATE_PAL (49656530) -#define DACRATE_MPAL (48628316) - -#define SP_INTERRUPT 0x1 -#define SI_INTERRUPT 0x2 -#define AI_INTERRUPT 0x4 -#define VI_INTERRUPT 0x8 -#define PI_INTERRUPT 0x10 -#define DP_INTERRUPT 0x20 - -#define SP_STATUS_HALT 0x0001 -#define SP_STATUS_BROKE 0x0002 -#define SP_STATUS_DMABUSY 0x0004 -#define SP_STATUS_DMAFULL 0x0008 -#define SP_STATUS_IOFULL 0x0010 -#define SP_STATUS_SSTEP 0x0020 -#define SP_STATUS_INTR_BREAK 0x0040 -#define SP_STATUS_SIGNAL0 0x0080 -#define SP_STATUS_SIGNAL1 0x0100 -#define SP_STATUS_SIGNAL2 0x0200 -#define SP_STATUS_SIGNAL3 0x0400 -#define SP_STATUS_SIGNAL4 0x0800 -#define SP_STATUS_SIGNAL5 0x1000 -#define SP_STATUS_SIGNAL6 0x2000 -#define SP_STATUS_SIGNAL7 0x4000 - -#define DP_STATUS_XBUS_DMA 0x01 -#define DP_STATUS_FREEZE 0x02 -#define DP_STATUS_FLUSH 0x04 -#define DP_STATUS_START_GCLK 0x008 -#define DP_STATUS_TMEM_BUSY 0x010 -#define DP_STATUS_PIPE_BUSY 0x020 -#define DP_STATUS_CMD_BUSY 0x040 -#define DP_STATUS_CBUF_READY 0x080 -#define DP_STATUS_DMA_BUSY 0x100 -#define DP_STATUS_END_VALID 0x200 -#define DP_STATUS_START_VALID 0x400 - -#define R4300i_SP_Intr 1 - - -#define LSB_FIRST 1 // TODO : check for platform -#ifdef LSB_FIRST - #define BYTE_ADDR_XOR 3 - #define WORD_ADDR_XOR 1 - #define BYTE4_XOR_BE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */ -#else - #define BYTE_ADDR_XOR 0 - #define WORD_ADDR_XOR 0 - #define BYTE4_XOR_BE(a) (a) -#endif - - -typedef uint64_t UINT64; -typedef int64_t INT64; -typedef uint32_t UINT32; -typedef int32_t INT32; -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint8_t UINT8; -typedef int8_t INT8; -typedef unsigned int offs_t; -#endif - diff --git a/libmupen64plus/mupen64plus-win32-deps b/libmupen64plus/mupen64plus-win32-deps index b38635b746..de8111fdcb 160000 --- a/libmupen64plus/mupen64plus-win32-deps +++ b/libmupen64plus/mupen64plus-win32-deps @@ -1 +1 @@ -Subproject commit b38635b74648dc7b84c774186fc63c75afc22d58 +Subproject commit de8111fdcb89144abc16c85650ce4e21e028bfb5