static int filterd3didx;
static bool showoverlay = true;
+static int slicecnt;
+static int clearcnt;
+static bool debugcolors;
+static bool noclear;
+static bool cannoclear;
+
int fakemodewaitms;
static int leds[LED_MAX];
int ddraw_fs;
int ddraw_fs_attempt;
LPDIRECTDRAW7 ddraw;
-
- int slicecnt;
- int clearcnt;
- bool debugcolors;
- bool noclear;
- bool cannoclear;
};
static struct d3dstruct d3ddata[MAX_AMIGAMONITORS];
}
d3d->variablerefresh = false;
- d3d->cannoclear = ap.gfx_vsyncmode != 0;
+ cannoclear = ap.gfx_vsyncmode != 0;
memset (&d3d->dpp, 0, sizeof (d3d->dpp));
d3d->dpp.Windowed = isfullscreen () <= 0;
static int xD3D_debug(int monid, int mode)
{
struct d3dstruct *d3d = &d3ddata[monid];
- int old = d3d->debugcolors ? 1 : 0;
- d3d->debugcolors = (mode & 1) != 0;
- d3d->noclear = d3d->debugcolors ? false : true;
- d3d->clearcnt = 0;
+ int old = debugcolors ? 1 : 0;
+ debugcolors = (mode & 1) != 0;
+ noclear = debugcolors ? false : true;
+ clearcnt = 0;
return old;
}
HRESULT hr;
uae_u8 color[4] = { 0, 0, 0, 0 };
- if (d3d->noclear && d3d->cannoclear) {
- if (d3d->clearcnt > 3)
+ if (noclear && cannoclear) {
+ if (clearcnt > 3)
return;
- d3d->clearcnt++;
+ clearcnt++;
}
- if (!d3d->noclear && d3d->debugcolors && d3d->slicecnt > 0) {
- int cnt = d3d->slicecnt - 1;
+ if (!noclear && debugcolors && slicecnt > 0) {
+ int cnt = slicecnt - 1;
int v = cnt % 3;
if (cnt / 3 == 1)
color[(v + 1) % 3] = 80;
bool normalrender = mode < 0 || (mode & 1);
if (mode > 0 && (mode & 2))
- d3d->slicecnt = 0;
+ slicecnt = 0;
else if (mode < 0)
- d3d->slicecnt = d3d->slicecnt == 2 ? 0 : d3d->slicecnt;
+ slicecnt = slicecnt == 2 ? 0 : slicecnt;
clearrt(d3d);
- d3d->slicecnt++;
+ slicecnt++;
if (FAILED (hr = d3d->d3ddev->BeginScene ())) {
write_log (_T("%s: BeginScene: %s\n"), D3DHEAD, D3D_ErrorString (hr));
static struct gfx_filterdata *filterd3d;
static int filterd3didx;
static int leds[LED_MAX];
+static int debugcolors;
+static bool cannoclear;
+static bool noclear;
+static int clearcnt;
+static int slicecnt;
static const TCHAR *overlayleds[] = {
_T("power"),
ID3DX11EffectTechnique *technique;
ID3DX11EffectPass *effectpass;
- bool debugcolors;
- bool cannoclear;
- bool noclear;
- int clearcnt;
- int slicecnt;
-
#ifndef NDEBUG
ID3D11InfoQueue *m_debugInfoQueue;
ID3D11Debug *m_debug;
}
write_log(_T("D3D11 Present %08x\n"), hr);
}
- d3d->slicecnt++;
+ slicecnt++;
}
static float xD3D_getrefreshrate(int monid)
}
d3d->vblankintervals = 1;
- d3d->debugcolors = false;
- d3d->cannoclear = false;
+ cannoclear = false;
if (apm->gfx_vsyncmode) {
- d3d->cannoclear = true;
+ cannoclear = true;
d3d->vblankintervals = 0;
}
d3d->invalidmode = false;
d3d->fsmode = 0;
- d3d->clearcnt = 0;
+ clearcnt = 0;
write_log(_T("D3D11 %d %08x %08x\n"), d3d->swapChainDesc.BufferCount, d3d->swapChainDesc.Flags, d3d->swapChainDesc.Format);
static int xD3D11_debug(int monid, int mode)
{
struct d3d11struct *d3d = &d3d11data[monid];
- int old = d3d->debugcolors ? 1 : 0;
- d3d->debugcolors = (mode & 1) != 0;
- d3d->noclear = d3d->debugcolors ? false : true;
- d3d->clearcnt = 0;
+ int old = debugcolors ? 1 : 0;
+ debugcolors = (mode & 1) != 0;
+ noclear = debugcolors ? false : true;
+ clearcnt = 0;
return old;
}
color[2] = 0;
color[3] = 0;
- if (d3d->noclear && d3d->cannoclear) {
- if (d3d->clearcnt > 3)
+ if (noclear && cannoclear) {
+ if (clearcnt > 3)
return;
- d3d->clearcnt++;
+ clearcnt++;
}
- if (!d3d->noclear && d3d->debugcolors && d3d->slicecnt > 0) {
- int cnt = d3d->slicecnt - 1;
+ if (!noclear && debugcolors && slicecnt > 0) {
+ int cnt = slicecnt - 1;
int v = cnt % 3;
if (cnt / 3 == 1)
color[(v + 1) % 3] = 0.3;
d3d->frames_since_init++;
if (mode > 0 && (mode & 2))
- d3d->slicecnt = 0;
+ slicecnt = 0;
else if (mode < 0)
- d3d->slicecnt = d3d->slicecnt == 2 ? 0 : d3d->slicecnt;
+ slicecnt = slicecnt == 2 ? 0 : slicecnt;
if (!d3d->m_swapChain)
return false;
// Clear the back buffer.
d3d->m_deviceContext->ClearRenderTargetView(d3d->m_renderTargetView, color);
d3d->m_deviceContext->Flush();
- d3d->clearcnt = 0;
+ clearcnt = 0;
}
if (xD3D11_renderframe(monid, true, true)) {
xD3D11_showframe(monid);
}
- d3d->clearcnt = 0;
+ clearcnt = 0;
}
static void xD3D11_change(int monid, int temp)
{
struct d3d11struct *d3d = &d3d11data[monid];
- d3d->clearcnt = 0;
+ clearcnt = 0;
}
static void resizemode(struct d3d11struct *d3d)