cleanup + some eolz

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5842 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
luisr142004
2010-07-06 13:14:51 +00:00
parent 5133793c6c
commit e9e12ff100
19 changed files with 1117 additions and 1141 deletions
+5 -5
View File
@@ -66,7 +66,7 @@ bool Initialize()
return false;
}
if (0 < numPlatforms)
if (0 < numPlatforms)
{
cl_platform_id* platforms = new cl_platform_id[numPlatforms];
err = clGetPlatformIDs(numPlatforms, platforms, NULL);
@@ -106,7 +106,7 @@ bool Initialize()
return false;
}
// Create a compute context
// Create a compute context
g_context = clCreateContext(cprops, 1, &device_id, NULL, NULL, &err);
if (!g_context)
{
@@ -176,8 +176,8 @@ cl_kernel CompileKernel(cl_program program, const char *Function)
cl_kernel kernel = clCreateKernel(program, Function, &err);
if (!kernel || err != CL_SUCCESS)
{
char buffer[1024];
sprintf(buffer, "Failed to create compute kernel '%s' !", Function);
char buffer[1024];
sprintf(buffer, "Failed to create compute kernel '%s' !", Function);
HandleCLError(err, buffer);
return NULL;
}
@@ -191,7 +191,7 @@ void Destroy()
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if(!g_context)
return;
clReleaseCommandQueue(g_cmdq);
clReleaseCommandQueue(g_cmdq);
clReleaseContext(g_context);
g_context = NULL;
g_cmdq = NULL;
+20 -20
View File
@@ -72,8 +72,8 @@ UDPWiimote::UDPWiimote(const char *_port) :
#ifdef _WIN32
u_long iMode = 1;
#endif
struct addrinfo hints, *servinfo, *p;
int rv;
struct addrinfo hints, *servinfo, *p;
int rv;
d->thread=NULL;
#ifdef _WIN32
@@ -89,41 +89,41 @@ UDPWiimote::UDPWiimote(const char *_port) :
noinst++;
//PanicAlert("UDPWii instantiated");
memset(&hints, 0, sizeof hints);
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE; // use my IP
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE; // use my IP
if ((rv = getaddrinfo(NULL, _port, &hints, &servinfo)) != 0) {
if ((rv = getaddrinfo(NULL, _port, &hints, &servinfo)) != 0) {
cleanup;
err=-1;
err=-1;
return;
}
}
// loop through all the results and bind to everything we can
for(p = servinfo; p != NULL; p = p->ai_next) {
// loop through all the results and bind to everything we can
for(p = servinfo; p != NULL; p = p->ai_next) {
sock_t sock;
if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == BAD_SOCK) {
if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == BAD_SOCK) {
continue;
}
}
if (bind(sock, p->ai_addr, p->ai_addrlen) == -1) {
close(sock);
if (bind(sock, p->ai_addr, p->ai_addrlen) == -1) {
close(sock);
continue;
}
}
//NOTICE_LOG(WIIMOTE,"UDPWii new listening sock");
d->sockfds.push_back(sock);
}
}
if (d->sockfds.empty()) {
if (d->sockfds.empty()) {
cleanup;
err=-2;
return;
}
return;
}
freeaddrinfo(servinfo);
freeaddrinfo(servinfo);
err=0;
d->exit=false;
// NOTICE_LOG(WIIMOTE,"UDPWii thread starting");
+1 -1
View File
@@ -103,7 +103,7 @@ public:
UDPConfigDiag::UDPConfigDiag(wxWindow * const parent, UDPWrapper * _wrp) :
wxDialog(parent, -1, wxT("UDP Wiimote"), wxDefaultPosition, wxDefaultSize),
wrp(_wrp)
wrp(_wrp)
{
wxBoxSizer * outer_sizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer * sizer1 = new wxBoxSizer(wxVERTICAL);
+11 -11
View File
@@ -204,7 +204,7 @@ void ControlDialog::UpdateListContents()
{
// for inputs
std::vector<ControllerInterface::Device::Input*>::const_iterator
i = dev->Inputs().begin(),
i = dev->Inputs().begin(),
e = dev->Inputs().end();
for (; i!=e; ++i)
control_lbox->Append(WXSTR_FROM_STR((*i)->GetName()));
@@ -213,7 +213,7 @@ void ControlDialog::UpdateListContents()
{
// for outputs
std::vector<ControllerInterface::Device::Output*>::const_iterator
i = dev->Outputs().begin(),
i = dev->Outputs().begin(),
e = dev->Outputs().end();
for (; i!=e; ++i)
control_lbox->Append(WXSTR_FROM_STR((*i)->GetName()));
@@ -702,10 +702,10 @@ ControlGroupBox::ControlGroupBox( ControllerEmu::ControlGroup* const group, wxWi
switch ( group->type )
{
case GROUP_TYPE_STICK :
case GROUP_TYPE_TILT :
case GROUP_TYPE_CURSOR :
case GROUP_TYPE_FORCE :
case GROUP_TYPE_STICK:
case GROUP_TYPE_TILT:
case GROUP_TYPE_CURSOR:
case GROUP_TYPE_FORCE:
{
wxBitmap bitmap(64, 64);
dc.SelectObject(bitmap);
@@ -733,7 +733,7 @@ ControlGroupBox::ControlGroupBox( ControllerEmu::ControlGroup* const group, wxWi
Add( h_szr, 0, wxEXPAND|wxLEFT|wxCENTER|wxTOP, 3 );
}
break;
case GROUP_TYPE_BUTTONS :
case GROUP_TYPE_BUTTONS:
{
wxBitmap bitmap(int(12*group->controls.size()+1), 12);
dc.SelectObject(bitmap);
@@ -755,8 +755,8 @@ ControlGroupBox::ControlGroupBox( ControllerEmu::ControlGroup* const group, wxWi
Add(static_bitmap, 0, wxALL|wxCENTER, 3);
}
break;
case GROUP_TYPE_MIXED_TRIGGERS :
case GROUP_TYPE_TRIGGERS :
case GROUP_TYPE_MIXED_TRIGGERS:
case GROUP_TYPE_TRIGGERS:
{
int height = (int)(6 * group->controls.size());
int width = 64+12+1;
@@ -787,7 +787,7 @@ ControlGroupBox::ControlGroupBox( ControllerEmu::ControlGroup* const group, wxWi
Add( static_bitmap, 0, wxALL|wxCENTER, 3 );
}
break;
case GROUP_TYPE_EXTENSION :
case GROUP_TYPE_EXTENSION:
{
PadSettingExtension* const attachments = new PadSettingExtension( parent, (ControllerEmu::Extension*)group );
wxButton* const configure_btn = new ExtensionButton( parent, (ControllerEmu::Extension*)group );
@@ -808,7 +808,7 @@ ControlGroupBox::ControlGroupBox( ControllerEmu::ControlGroup* const group, wxWi
Add(btn, 0, wxALL|wxEXPAND, 3);
}
break;
default :
default:
{
//options
+4 -4
View File
@@ -357,8 +357,8 @@ void BPWritten(const BPCmd& bp)
// Bounding Box Control
// -------------------------
case BPMEM_CLEARBBOX1:
case BPMEM_CLEARBBOX2: {
case BPMEM_CLEARBBOX2:
{
#ifdef BBOX_SUPPORT
// which is which? these are GUESSES!
if (bp.address == BPMEM_CLEARBBOX1) {
@@ -381,8 +381,8 @@ void BPWritten(const BPCmd& bp)
// WARN_LOG(VIDEO, "ClearBBox TB: %i, %08x - %i, %i", bp.address, bp.newvalue, top, bottom);
}
#endif
}
break;
}
case BPMEM_TEXINVALIDATE: // Used, if game has manual control the Texture Cache, which we don't allow
DEBUG_LOG(VIDEO, "BP Texture Invalid: %08x", bp.newvalue);
case BPMEM_ZCOMPARE: // Set the Z-Compare and EFB pixel format
@@ -583,7 +583,7 @@ void BPWritten(const BPCmd& bp)
default:
WARN_LOG(VIDEO, "Unknown BP opcode: address = 0x%08x value = 0x%08x", bp.address, bp.newvalue);
break;
}
}
}
// FIXME: Hangs load-state, but should fix graphic-heavy games state loading
@@ -35,55 +35,56 @@ cl_program g_program;
struct sDecoderParameter
{
const char *name;
cl_kernel kernel;
float sizeOfSrc;
const char *name;
cl_kernel kernel;
float sizeOfSrc;
float sizeOfDst;
int xSkip;
int ySkip;
int xSkip;
int ySkip;
PC_TexFormat format;
};
sDecoderParameter g_DecodeParametersNative[] = {
/* GX_TF_I4 */ { "DecodeI4", NULL, 0.5f, 1, 8, 8, PC_TEX_FMT_I4_AS_I8 },
/* GX_TF_I8 */ { "DecodeI8", NULL, 1, 1, 8, 4, PC_TEX_FMT_I8 },
/* GX_TF_IA4 */ { "DecodeIA4", NULL, 1, 2, 8, 4, PC_TEX_FMT_IA4_AS_IA8 },
/* GX_TF_IA8 */ { "DecodeIA8", NULL, 2, 2, 4, 4, PC_TEX_FMT_IA8 },
/* GX_TF_RGB565 */ { "DecodeRGB565", NULL, 2, 2, 4, 4, PC_TEX_FMT_RGB565 },
/* GX_TF_RGB5A3 */ { "DecodeRGB5A3", NULL, 2, 4, 4, 4, PC_TEX_FMT_BGRA32 },
/* GX_TF_RGBA8 */ { "DecodeRGBA8", NULL, 4, 4, 4, 4, PC_TEX_FMT_BGRA32 },
/* 7 */ { NULL },
/* GX_TF_C4 */ { NULL },
/* GX_TF_C8 */ { NULL },
/* GX_TF_C14X2 */ { NULL },
/* B */ { NULL },
/* C */ { NULL },
/* D */ { NULL },
/* GX_TF_CMPR */ { "DecodeCMPR", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_BGRA32 },
/* GX_TF_I4 */ { "DecodeI4", NULL, 0.5f, 1, 8, 8, PC_TEX_FMT_I4_AS_I8 },
/* GX_TF_I8 */ { "DecodeI8", NULL, 1, 1, 8, 4, PC_TEX_FMT_I8 },
/* GX_TF_IA4 */ { "DecodeIA4", NULL, 1, 2, 8, 4, PC_TEX_FMT_IA4_AS_IA8 },
/* GX_TF_IA8 */ { "DecodeIA8", NULL, 2, 2, 4, 4, PC_TEX_FMT_IA8 },
/* GX_TF_RGB565 */ { "DecodeRGB565", NULL, 2, 2, 4, 4, PC_TEX_FMT_RGB565 },
/* GX_TF_RGB5A3 */ { "DecodeRGB5A3", NULL, 2, 4, 4, 4, PC_TEX_FMT_BGRA32 },
/* GX_TF_RGBA8 */ { "DecodeRGBA8", NULL, 4, 4, 4, 4, PC_TEX_FMT_BGRA32 },
/* 7 */ { NULL },
/* GX_TF_C4 */ { NULL },
/* GX_TF_C8 */ { NULL },
/* GX_TF_C14X2 */ { NULL },
/* B */ { NULL },
/* C */ { NULL },
/* D */ { NULL },
/* GX_TF_CMPR */ { "DecodeCMPR", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_BGRA32 },
};
sDecoderParameter g_DecodeParametersRGBA[] = {
/* GX_TF_I4 */ { "DecodeI4_RGBA", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_RGBA32 },
/* GX_TF_I8 */ { "DecodeI8_RGBA", NULL, 1, 4, 8, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_IA4 */ { "DecodeIA4_RGBA", NULL, 1, 4, 8, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_IA8 */ { "DecodeIA8_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_RGB565 */ { "DecodeRGB565_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_RGB5A3 */ { "DecodeRGB5A3_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_RGBA8 */ { "DecodeRGBA8_RGBA", NULL, 4, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* 7 */ { NULL },
/* GX_TF_C4 */ { NULL },
/* GX_TF_C8 */ { NULL },
/* GX_TF_C14X2 */ { NULL },
/* B */ { NULL },
/* C */ { NULL },
/* D */ { NULL },
/* GX_TF_CMPR */ { "DecodeCMPR_RGBA", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_RGBA32 },
/* GX_TF_I4 */ { "DecodeI4_RGBA", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_RGBA32 },
/* GX_TF_I8 */ { "DecodeI8_RGBA", NULL, 1, 4, 8, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_IA4 */ { "DecodeIA4_RGBA", NULL, 1, 4, 8, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_IA8 */ { "DecodeIA8_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_RGB565 */ { "DecodeRGB565_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_RGB5A3 */ { "DecodeRGB5A3_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* GX_TF_RGBA8 */ { "DecodeRGBA8_RGBA", NULL, 4, 4, 4, 4, PC_TEX_FMT_RGBA32 },
/* 7 */ { NULL },
/* GX_TF_C4 */ { NULL },
/* GX_TF_C8 */ { NULL },
/* GX_TF_C14X2 */ { NULL },
/* B */ { NULL },
/* C */ { NULL },
/* D */ { NULL },
/* GX_TF_CMPR */ { "DecodeCMPR_RGBA", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_RGBA32 },
};
bool g_Inited = false;
cl_mem g_clsrc, g_cldst; // texture buffer memory objects
void TexDecoder_OpenCL_Initialize() {
void TexDecoder_OpenCL_Initialize()
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL
if(!g_Inited)
{
@@ -124,7 +125,8 @@ void TexDecoder_OpenCL_Initialize() {
#endif
}
void TexDecoder_OpenCL_Shutdown() {
void TexDecoder_OpenCL_Shutdown()
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL && !defined(DEBUG_OPENCL)
clReleaseProgram(g_program);
@@ -151,9 +153,9 @@ PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int hei
{
#if defined(HAVE_OPENCL) && HAVE_OPENCL
cl_int err;
sDecoderParameter& decoder = rgba ? g_DecodeParametersRGBA[texformat] : g_DecodeParametersNative[texformat];
if(!g_Inited || !decoder.name || !decoder.kernel || decoder.format == PC_TEX_FMT_NONE)
return PC_TEX_FMT_NONE;
sDecoderParameter& decoder = rgba ? g_DecodeParametersRGBA[texformat] : g_DecodeParametersNative[texformat];
if(!g_Inited || !decoder.name || !decoder.kernel || decoder.format == PC_TEX_FMT_NONE)
return PC_TEX_FMT_NONE;
#ifdef DEBUG_OPENCL
g_clsrc = clCreateBuffer(OpenCL::GetContext(), CL_MEM_READ_ONLY , 1024 * 1024 * sizeof(u32), NULL, NULL);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -284,7 +284,7 @@ int CD3DFont::DrawTextScaled(float x, float y, float size, float spacing, u32 dw
float sizeratio = size / (float)m_LineHeight;
// translate starting positions
float sx = x * scalex - 1.f;
float sx = x * scalex - 1.f;
float sy = 1.f - y * scaley;
char c;
@@ -355,7 +355,7 @@ int CD3DFont::DrawTextScaled(float x, float y, float size, float spacing, u32 dw
v[4] = v[2];
v[5] = v[1];
memcpy(pVertices, v, 6*sizeof(FONT2DVERTEX));
memcpy(pVertices, v, 6*sizeof(FONT2DVERTEX));
pVertices+=6;
dwNumTriangles += 2;
@@ -416,7 +416,7 @@ ID3D11Buffer* clearvb = NULL;
typedef struct { float x,y,z,u,v; } STQVertex;
typedef struct { float x,y,z,u,v; } STSQVertex;
typedef struct { float x,y,z; u32 col;} ClearVertex;
typedef struct { float x,y,z; u32 col; } ClearVertex;
void InitUtils()
{
@@ -496,7 +496,7 @@ void drawShadedTexQuad(ID3D11ShaderResourceView* texture,
D3D::context->IASetInputLayout(layout);
D3D::context->IASetVertexBuffers(0, 1, &stqvb, &stride, &offset);
D3D::context->PSSetSamplers(0, 1, &stqsamplerstate);
D3D::context->PSSetShader(PShader, NULL, 0);
D3D::context->PSSetShader(PShader, NULL, 0);
D3D::context->PSSetShaderResources(0, 1, &texture);
D3D::context->VSSetShader(Vshader, NULL, 0);
D3D::stateman->Apply();
@@ -361,4 +361,4 @@ void StateManager::Apply()
else ERROR_LOG(VIDEO, "Tried to apply without rasterizer state!");
}
} // namespace
} // namespace
@@ -140,13 +140,13 @@ bool Init()
CreateDeviceObjects();
IndexGenerator::Start(TIBuffer,LIBuffer,PIBuffer);
IndexGenerator::Start(TIBuffer,LIBuffer,PIBuffer);
return true;
}
void ResetBuffer()
{
s_pCurBufferPointer = LocalVBuffer;
s_pCurBufferPointer = LocalVBuffer;
}
void Shutdown()
@@ -163,12 +163,12 @@ void AddIndices(int _primitive, int _numVertices)
{
switch (_primitive)
{
case GX_DRAW_QUADS: IndexGenerator::AddQuads(_numVertices); break;
case GX_DRAW_QUADS: IndexGenerator::AddQuads(_numVertices); break;
case GX_DRAW_TRIANGLES: IndexGenerator::AddList(_numVertices); break;
case GX_DRAW_TRIANGLE_STRIP: IndexGenerator::AddStrip(_numVertices); break;
case GX_DRAW_TRIANGLE_FAN: IndexGenerator::AddFan(_numVertices); break;
case GX_DRAW_LINE_STRIP: IndexGenerator::AddLineStrip(_numVertices); break;
case GX_DRAW_LINES: IndexGenerator::AddLineList(_numVertices); break;
case GX_DRAW_LINES: IndexGenerator::AddLineList(_numVertices); break;
case GX_DRAW_POINTS: IndexGenerator::AddPoints(_numVertices); break;
}
}
@@ -225,7 +225,7 @@ void AddVertices(int _primitive, int _numVertices)
IndexGenerator::Start(TIBuffer,LIBuffer,PIBuffer);
Flushed=false;
}
lastPrimitive = _primitive;
lastPrimitive = _primitive;
ADDSTAT(stats.thisFrame.numPrims, _numVertices);
INCSTAT(stats.thisFrame.numPrimitiveJoins);
AddIndices(_primitive, _numVertices);
@@ -244,7 +244,7 @@ inline void Draw(unsigned int stride, bool alphapass)
}
UINT bufoffset = 0;
UINT bufstride = (UINT)stride;
UINT bufstride = stride;
if (!alphapass) gfxstate->ApplyState();
else gfxstate->AlphaPass();
@@ -361,7 +361,7 @@ void Flush()
Draw(stride, false);
if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate)
if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate)
{
DWORD write = 0;
if (!PixelShaderCache::SetShader(true))
+17 -32
View File
@@ -92,16 +92,6 @@ bool IsD3D()
return true;
}
bool IsD3D9()
{
return false;
}
bool IsD3D11()
{
return true;
}
// This is used for the functions right below here which use wxwidgets
#if defined(HAVE_WX) && HAVE_WX
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
@@ -128,7 +118,7 @@ void DllDebugger(HWND _hParent, bool Show)
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
#endif
@@ -173,7 +163,7 @@ void UpdateFPSDisplay(const char* text)
{
char temp[512];
sprintf_s(temp, 512, "SVN R%i: DX11: %s", SVN_REV, text);
SetWindowTextA(EmuWindow::GetWnd(), temp);
SetWindowTextA(EmuWindow::GetWnd(), temp);
}
void GetDllInfo(PLUGIN_INFO* _PluginInfo)
@@ -220,9 +210,9 @@ void Initialize(void* init)
g_VideoInitialize.pPeekMessages = &Callback_PeekMessages;
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
OSD::AddMessage("Dolphin Direct3D 11 Video Plugin.", 5000);
s_PluginInitialized = true;
@@ -244,8 +234,8 @@ void Video_Prepare()
VertexShaderManager::Init();
PixelShaderCache::Init();
PixelShaderManager::Init();
CommandProcessor::Init();
PixelEngine::Init();
CommandProcessor::Init();
PixelEngine::Init();
D3D::InitUtils();
// tell the host that the window is ready
@@ -339,14 +329,14 @@ void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
if (addrRangesOverlap(aLower, aUpper, bLower, bUpper))
VideoFifo_CheckSwapRequest();
}
}
}
}
// Run from the CPU thread (from VideoInterface.cpp)
void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
{
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
{
{
if (g_VideoInitialize.bOnThread)
{
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
@@ -354,7 +344,7 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
Common::YieldCPU();
}
else
VideoFifo_CheckSwapRequest();
VideoFifo_CheckSwapRequest();
s_beginFieldArgs.xfbAddr = xfbAddr;
s_beginFieldArgs.field = field;
s_beginFieldArgs.fbWidth = fbWidth;
@@ -373,11 +363,6 @@ void Video_AddMessage(const char* pstr, u32 milliseconds)
OSD::AddMessage(pstr, milliseconds);
}
HRESULT ScreenShot(const char* filename)
{
return S_OK;
}
void Video_Screenshot(const char* _szFilename)
{
Renderer::SetScreenshot(_szFilename);
@@ -430,37 +415,37 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
{
CommandProcessor::Read16(_rReturnValue, _Address);
CommandProcessor::Read16(_rReturnValue, _Address);
}
void Video_CommandProcessorWrite16(const u16 _Data, const u32 _Address)
{
CommandProcessor::Write16(_Data, _Address);
CommandProcessor::Write16(_Data, _Address);
}
void Video_PixelEngineRead16(u16& _rReturnValue, const u32 _Address)
{
PixelEngine::Read16(_rReturnValue, _Address);
PixelEngine::Read16(_rReturnValue, _Address);
}
void Video_PixelEngineWrite16(const u16 _Data, const u32 _Address)
{
PixelEngine::Write16(_Data, _Address);
PixelEngine::Write16(_Data, _Address);
}
void Video_PixelEngineWrite32(const u32 _Data, const u32 _Address)
{
PixelEngine::Write32(_Data, _Address);
PixelEngine::Write32(_Data, _Address);
}
inline void Video_GatherPipeBursted(void)
{
CommandProcessor::GatherPipeBursted();
CommandProcessor::GatherPipeBursted();
}
void Video_WaitForFrameFinish(void)
{
CommandProcessor::WaitForFrameFinish();
CommandProcessor::WaitForFrameFinish();
}
bool Video_IsFifoBusy(void)
@@ -33,10 +33,10 @@
#include "TextureCache.h"
BEGIN_EVENT_TABLE(GFXConfigDialogDX,wxDialog)
EVT_CLOSE(GFXConfigDialogDX::OnClose)
EVT_BUTTON(ID_CLOSE, GFXConfigDialogDX::CloseClick)
//Direct3D Tab
EVT_CHECKBOX(ID_VSYNC, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_CHECKBOX(ID_WIDESCREEN_HACK, GFXConfigDialogDX::DirectXSettingsChanged)
@@ -48,13 +48,13 @@ BEGIN_EVENT_TABLE(GFXConfigDialogDX,wxDialog)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_SAFE, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_NORMAL, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_FAST, GFXConfigDialogDX::DirectXSettingsChanged)
//Enhancements tab
EVT_CHECKBOX(ID_FORCEFILTERING, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_FORCEANISOTROPY, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_LOADHIRESTEXTURES, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_EFBSCALEDCOPY, GFXConfigDialogDX::EnhancementsSettingsChanged)
//Advanced Tab
EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_OVERLAYFPS, GFXConfigDialogDX::AdvancedSettingsChanged)
@@ -71,11 +71,11 @@ BEGIN_EVENT_TABLE(GFXConfigDialogDX,wxDialog)
EVT_CHECKBOX(ID_OVERLAYSTATS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_PROJSTATS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SHADERERRORS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_TEXFMT_OVERLAY, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_TEXFMT_OVERLAY, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_TEXFMT_CENTER, GFXConfigDialogDX::AdvancedSettingsChanged)
END_EVENT_TABLE()
GFXConfigDialogDX::GFXConfigDialogDX(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
@@ -86,16 +86,19 @@ GFXConfigDialogDX::~GFXConfigDialogDX()
{
INFO_LOG(CONSOLE, "GFXConfigDialogDX Closed");
}
void GFXConfigDialogDX::OnClose(wxCloseEvent& event)
{
//INFO_LOG(CONSOLE, "OnClose");
CloseWindow();
}
void GFXConfigDialogDX::CloseClick(wxCommandEvent& WXUNUSED (event))
{
//INFO_LOG(CONSOLE, "CloseClick");
CloseWindow();
}
void GFXConfigDialogDX::InitializeGUIValues()
{
// General Display Settings
@@ -115,7 +118,7 @@ void GFXConfigDialogDX::InitializeGUIValues()
m_Radio_SafeTextureCache_Normal->SetValue(true);
else
m_Radio_SafeTextureCache_Fast->SetValue(true);
// Enhancements
if(g_Config.iMaxAnisotropy == 1)
m_MaxAnisotropy->SetValue(false);
@@ -128,11 +131,11 @@ void GFXConfigDialogDX::InitializeGUIValues()
m_HiresTextures->SetValue(g_Config.bHiresTextures);
m_MSAAModeCB->SetSelection(g_Config.iMultisampleMode);
m_EFBScaledCopy->SetValue(g_Config.bCopyEFBScaled);
//Advance
m_DisableFog->SetValue(g_Config.bDisableFog);
m_OverlayFPS->SetValue(g_Config.bShowFPS);
m_CopyEFB->SetValue(!g_Config.bEFBCopyDisable);
g_Config.bCopyEFBToTexture ? m_Radio_CopyEFBToGL->SetValue(true) : m_Radio_CopyEFBToRAM->SetValue(true);
@@ -151,8 +154,9 @@ void GFXConfigDialogDX::InitializeGUIValues()
m_TexfmtCenter->SetValue(g_Config.bTexFmtOverlayCenter);
m_TexfmtCenter->Enable(m_TexfmtOverlay->IsChecked());
}
void GFXConfigDialogDX::CreateGUIControls()
{
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
@@ -163,19 +167,19 @@ void GFXConfigDialogDX::CreateGUIControls()
m_PageDirect3D = new wxPanel( m_Notebook, ID_DIRERCT3D, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_PageEnhancements = new wxPanel( m_Notebook, ID_PAGEENHANCEMENTS, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_PageAdvanced = new wxPanel( m_Notebook, ID_PAGEADVANCED, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
//D3D Tab
//D3D Tab
wxStaticBoxSizer* sbBasic;
sbBasic = new wxStaticBoxSizer( new wxStaticBox( m_PageDirect3D, wxID_ANY, wxT("Basic") ), wxVERTICAL );
m_AdapterText = new wxStaticText( m_PageDirect3D, wxID_ANY, wxT("Adapter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_AdapterText->Wrap( -1 );
wxArrayString arrayStringFor_AdapterCB;
wxArrayString arrayStringFor_AdapterCB;
for (int i = 0; i < D3D::GetNumAdapters(); ++i)
{
const D3D::Adapter &adapter = D3D::GetAdapter(i);
arrayStringFor_AdapterCB.Add(wxString::FromAscii(adapter.ident.Description));
}
}
const D3D::Adapter &adapter = D3D::GetAdapter(g_Config.iAdapter);
m_AdapterCB = new wxChoice( m_PageDirect3D, ID_ADAPTER, wxDefaultPosition, wxDefaultSize, arrayStringFor_AdapterCB, 0);
@@ -201,21 +205,21 @@ void GFXConfigDialogDX::CreateGUIControls()
m_EFBScaleText->Wrap( -1 );
wxString m_EFBScaleModeChoices[] = { wxT("Auto (Fractional)"), wxT("Auto (Integral)"), wxT("1x"), wxT("2x"), wxT("3x") };
int m_EFBScaleModeNChoices = sizeof( m_EFBScaleModeChoices ) / sizeof( wxString );
m_EFBScaleMode = new wxChoice( m_PageDirect3D, ID_EFBSCALEMODE, wxDefaultPosition, wxDefaultSize, m_EFBScaleModeNChoices, m_EFBScaleModeChoices, 0 );
m_EFBScaleMode = new wxChoice( m_PageDirect3D, ID_EFBSCALEMODE, wxDefaultPosition, wxDefaultSize, m_EFBScaleModeNChoices, m_EFBScaleModeChoices, 0 );
m_EnableEFBAccess = new wxCheckBox( m_PageDirect3D, ID_EFB_ACCESS_ENABLE, wxT("Enable CPU->EFB access"), wxDefaultPosition, wxDefaultSize, 0 );
wxStaticBoxSizer* sbSTC;
sbSTC = new wxStaticBoxSizer( new wxStaticBox( m_PageDirect3D, wxID_ANY, wxT("Safe Texture Cache") ), wxVERTICAL );
m_SafeTextureCache = new wxCheckBox( m_PageDirect3D, ID_SAFETEXTURECACHE, wxT("Use Safe Texture Cache"), wxDefaultPosition, wxDefaultSize, 0 );
m_Radio_SafeTextureCache_Safe = new wxRadioButton( m_PageDirect3D, ID_RADIO_SAFETEXTURECACHE_SAFE, wxT("Safe"), wxDefaultPosition, wxDefaultSize, 0 );
m_Radio_SafeTextureCache_Normal = new wxRadioButton( m_PageDirect3D, ID_RADIO_SAFETEXTURECACHE_NORMAL, wxT("Normal"), wxDefaultPosition, wxDefaultSize, 0 );
m_Radio_SafeTextureCache_Fast = new wxRadioButton( m_PageDirect3D, ID_RADIO_SAFETEXTURECACHE_FAST, wxT("Fast"), wxDefaultPosition, wxDefaultSize, 0 );
// Sizers
wxGridBagSizer* sBasic;
wxBoxSizer* sGeneral;
sGeneral = new wxBoxSizer( wxVERTICAL );
sBasic = new wxGridBagSizer( 0, 0 );
sBasic->SetFlexibleDirection( wxBOTH );
@@ -257,7 +261,7 @@ void GFXConfigDialogDX::CreateGUIControls()
m_ForceFiltering = new wxCheckBox( m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trilinear filtering (Breaks video in several Wii games )"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaxAnisotropy = new wxCheckBox( m_PageEnhancements, ID_FORCEANISOTROPY, wxT("Enable 16x Anisotropy filtering"), wxDefaultPosition, wxDefaultSize, 0 );
m_HiresTextures = new wxCheckBox( m_PageEnhancements, ID_LOADHIRESTEXTURES, wxT("Enable hires Texture loading"), wxDefaultPosition, wxDefaultSize, 0 );
wxStaticBoxSizer* sbEFBHacks;
sbEFBHacks = new wxStaticBoxSizer( new wxStaticBox( m_PageEnhancements, wxID_ANY, wxT("EFB Hacks") ), wxVERTICAL );
m_EFBScaledCopy = new wxCheckBox( m_PageEnhancements, ID_EFBSCALEDCOPY, wxT("EFB Scaled Copy"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -348,10 +352,10 @@ void GFXConfigDialogDX::CreateGUIControls()
wxGridBagSizer* sDebuggingTools;
sDebuggingTools = new wxGridBagSizer( 0, 0 );
sDebuggingTools->SetFlexibleDirection( wxBOTH );
sDebuggingTools->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
sDebuggingTools->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
sDebuggingTools->Add( m_OverlayStats, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sDebuggingTools->Add( m_ShaderErrors, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sDebuggingTools->Add( m_TexfmtOverlay, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sDebuggingTools->Add( m_TexfmtOverlay, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sDebuggingTools->Add( m_TexfmtCenter, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sDebuggingTools->Add( m_ProjStats, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sbDebuggingTools->Add( sDebuggingTools, 0, wxEXPAND, 5 );
@@ -380,6 +384,7 @@ void GFXConfigDialogDX::CreateGUIControls()
Center();
UpdateGUI();
}
void GFXConfigDialogDX::DirectXSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
@@ -162,8 +162,6 @@ class GFXConfigDialogDX : public wxDialog
ID_SHADERERRORS,
ID_TEXFMT_OVERLAY,
ID_TEXFMT_CENTER,
ID_CHECK1,
ID_LIST1,
ID_DEBUGSTEP,
ID_REGISTERS,
ID_ENABLEDEBUGGING,
File diff suppressed because it is too large Load Diff
@@ -53,9 +53,9 @@ public:
private:
DECLARE_EVENT_TABLE();
wxPanel *m_MainPanel;
wxPanel* m_MainPanel;
wxCheckBox *m_Check[6];
wxCheckBox* m_Check[6];
// WARNING: Make sure these are not also elsewhere
enum
@@ -70,7 +70,7 @@ private:
NUM_OPTIONS
};
void OnClose(wxCloseEvent& event);
void OnClose(wxCloseEvent& event);
void CreateGUIControls();
void GeneralSettings(wxCommandEvent& event);
@@ -1,29 +1,29 @@
#include "UDPNunchuk.h"
#include "UDPWrapper.h"
#include "UDPWiimote.h"
#include "UDPNunchuk.h"
#include "UDPWrapper.h"
#include "UDPWiimote.h"
#define NUNCHUK_C 0x02
#define NUNCHUK_Z 0x01
#define NUNCHUK_Z 0x01
namespace WiimoteEmu
{
void UDPNunchuk::GetState( u8* const data, const bool focus )
{
Nunchuk::GetState(data,focus);
if (!(wrp->inst)) return;
wm_extension* const ncdata = (wm_extension*)data;
u8 mask;
float x,y;
wrp->inst->getNunchuck(x,y,mask);
if (mask&UDPWM_NC) ncdata->bt&=~NUNCHUK_C;
if (mask&UDPWM_NZ) ncdata->bt&=~NUNCHUK_Z;
if ((ncdata->jx==0x80)&&(ncdata->jy==0x80))
{
ncdata->jx=u8(0x80+x*127);
ncdata->jy=u8(0x80+y*127);
}
}
{
void UDPNunchuk::GetState( u8* const data, const bool focus )
{
Nunchuk::GetState(data, focus);
if (!(wrp->inst)) return;
wm_extension* const ncdata = (wm_extension*)data;
u8 mask;
float x, y;
wrp->inst->getNunchuck(x, y, mask);
if (mask&UDPWM_NC) ncdata->bt&=~NUNCHUK_C;
if (mask&UDPWM_NZ) ncdata->bt&=~NUNCHUK_Z;
if ((ncdata->jx==0x80)&&(ncdata->jy==0x80))
{
ncdata->jx=u8(0x80+x*127);
ncdata->jy=u8(0x80+y*127);
}
}
}
@@ -1,7 +1,7 @@
#ifndef UDPNUNCHUCK_H
#define UDPNUNCHUCK_H
#include "Nunchuk.h"
#ifndef UDPNUNCHUCK_H
#define UDPNUNCHUCK_H
#include "Nunchuk.h"
class UDPWrapper;
@@ -11,11 +11,11 @@ namespace WiimoteEmu
class UDPNunchuk : public Nunchuk
{
public:
UDPNunchuk(UDPWrapper * _wrp) : wrp(_wrp ) {name="UDP Nunchuk";}; //sorry for this :p I just dont' feel like rewriting the whole class for a name :p
virtual void GetState( u8* const data, const bool focus );
private:
UDPWrapper * wrp;
};
}
#endif
UDPNunchuk(UDPWrapper * _wrp) : wrp(_wrp) {name="UDP Nunchuk";}; //sorry for this :p I just dont' feel like rewriting the whole class for a name :p
virtual void GetState( u8* const data, const bool focus );
private:
UDPWrapper * wrp;
};
}
#endif
@@ -1,53 +1,53 @@
//UDP Wiimote Translation Layer
#ifndef UDPTLAYER_H
#define UDPTLAYER_H
#include "UDPWiimote.h"
namespace UDPTLayer
{
void GetButtons(UDPWrapper * m , wm_core * butt)
{
if (!(m->inst)) return;
if (!(m->updButt)) return;
u32 mask=m->inst->getButtons();
*butt|=(mask&UDPWM_BA)?WIIMOTE_A:0;
*butt|=(mask&UDPWM_BB)?WIIMOTE_B:0;
*butt|=(mask&UDPWM_B1)?WIIMOTE_ONE:0;
*butt|=(mask&UDPWM_B2)?WIIMOTE_TWO:0;
*butt|=(mask&UDPWM_BP)?WIIMOTE_PLUS:0;
*butt|=(mask&UDPWM_BM)?WIIMOTE_MINUS:0;
*butt|=(mask&UDPWM_BH)?WIIMOTE_HOME:0;
*butt|=(mask&UDPWM_BU)?WIIMOTE_PAD_UP:0;
*butt|=(mask&UDPWM_BD)?WIIMOTE_PAD_DOWN:0;
*butt|=(mask&UDPWM_BL)?WIIMOTE_PAD_LEFT:0;
*butt|=(mask&UDPWM_BR)?WIIMOTE_PAD_RIGHT:0;
}
void GetAcceleration(UDPWrapper * m , wm_accel * data, accel_cal * calib)
{
if (!(m->inst)) return;
if (!(m->updAccel)) return;
float x,y,z;
m->inst->getAccel(x,y,z);
data->x=u8(x*(calib->one_g.x-calib->zero_g.x)+calib->zero_g.x);
data->y=u8(y*(calib->one_g.y-calib->zero_g.y)+calib->zero_g.y);
data->z=u8(z*(calib->one_g.z-calib->zero_g.z)+calib->zero_g.z);
}
void GetIR( UDPWrapper * m, float * x, float * y, float * z)
{
if (!(m->inst)) return;
if (!(m->updIR)) return;
if ((*x>-1)&&(*x<1)&&(*y>-1)&&(*y<1)) return; //the recieved values are used ONLY when the normal pointer is offscreen
float _x,_y;
m->inst->getIR(_x,_y);
*x=_x*2-1;
*y=-(_y*2-1);
*z=0;
}
}
#endif
//UDP Wiimote Translation Layer
#ifndef UDPTLAYER_H
#define UDPTLAYER_H
#include "UDPWiimote.h"
namespace UDPTLayer
{
void GetButtons(UDPWrapper * m , wm_core * butt)
{
if (!(m->inst)) return;
if (!(m->updButt)) return;
u32 mask=m->inst->getButtons();
*butt|=(mask&UDPWM_BA)?WIIMOTE_A:0;
*butt|=(mask&UDPWM_BB)?WIIMOTE_B:0;
*butt|=(mask&UDPWM_B1)?WIIMOTE_ONE:0;
*butt|=(mask&UDPWM_B2)?WIIMOTE_TWO:0;
*butt|=(mask&UDPWM_BP)?WIIMOTE_PLUS:0;
*butt|=(mask&UDPWM_BM)?WIIMOTE_MINUS:0;
*butt|=(mask&UDPWM_BH)?WIIMOTE_HOME:0;
*butt|=(mask&UDPWM_BU)?WIIMOTE_PAD_UP:0;
*butt|=(mask&UDPWM_BD)?WIIMOTE_PAD_DOWN:0;
*butt|=(mask&UDPWM_BL)?WIIMOTE_PAD_LEFT:0;
*butt|=(mask&UDPWM_BR)?WIIMOTE_PAD_RIGHT:0;
}
void GetAcceleration(UDPWrapper * m , wm_accel * data, accel_cal * calib)
{
if (!(m->inst)) return;
if (!(m->updAccel)) return;
float x,y,z;
m->inst->getAccel(x,y,z);
data->x=u8(x*(calib->one_g.x-calib->zero_g.x)+calib->zero_g.x);
data->y=u8(y*(calib->one_g.y-calib->zero_g.y)+calib->zero_g.y);
data->z=u8(z*(calib->one_g.z-calib->zero_g.z)+calib->zero_g.z);
}
void GetIR( UDPWrapper * m, float * x, float * y, float * z)
{
if (!(m->inst)) return;
if (!(m->updIR)) return;
if ((*x>-1)&&(*x<1)&&(*y>-1)&&(*y<1)) return; //the recieved values are used ONLY when the normal pointer is offscreen
float _x,_y;
m->inst->getIR(_x,_y);
*x=_x*2-1;
*y=-(_y*2-1);
*z=0;
}
}
#endif