int required_sl_texture_w, required_sl_texture_h;
int vsync2, guimode, maxscanline, variablerefresh;
int resetcount;
- double cursor_x, cursor_y;
+ float cursor_x, cursor_y;
+ float cursor_mx, cursor_my;
bool cursor_v, cursor_scale;
int statusbar_vx, statusbar_hx;
d3d->sprite->Begin(D3DXSPRITE_ALPHABLEND);
if (d3d->cursorsurfaced3d && d3d->cursor_v) {
D3DXMATRIXA16 t;
-
+ int bl = d3d->filterd3d->gfx_filter_bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT;
+ d3d->d3ddev->SetSamplerState(0, D3DSAMP_MAGFILTER, bl);
+ d3d->d3ddev->SetSamplerState(0, D3DSAMP_MINFILTER, bl);
+ d3d->d3ddev->SetSamplerState(0, D3DSAMP_MIPFILTER, bl);
if (d3d->cursor_scale)
- MatrixScaling(&t, ((float)(d3d->window_w) / (d3d->tout_w + 2 * d3d->cursor_offset2_x)), ((float)(d3d->window_h) / (d3d->tout_h + 2 * d3d->cursor_offset2_y)), 0);
+ MatrixScaling(&t, ((float)(d3d->window_w) / (d3d->tout_w + 2 * d3d->cursor_offset2_x)) * d3d->cursor_mx, ((float)(d3d->window_h) / (d3d->tout_h + 2 * d3d->cursor_offset2_y)) * d3d->cursor_my, 0);
else
- MatrixScaling(&t, 1.0f, 1.0f, 0);
- v.x = (float)d3d->cursor_x + d3d->cursor_offset2_x;
- v.y = (float)d3d->cursor_y + d3d->cursor_offset2_y;
+ MatrixScaling(&t, d3d->cursor_mx, d3d->cursor_my, 0);
+ v.x = (float)d3d->cursor_x / d3d->cursor_mx + d3d->cursor_offset2_x;
+ v.y = (float)d3d->cursor_y / d3d->cursor_my + d3d->cursor_offset2_y;
v.z = 0.0f;
d3d->sprite->SetTransform(&t);
d3d->sprite->Draw(d3d->cursorsurfaced3d, NULL, NULL, &v, 0xffffffff);
write_log (_T("%s: EndScene() %s\n"), D3DHEAD, D3D_ErrorString (hr));
}
-static bool xD3D_setcursor(int monid, int x, int y, int width, int height, bool visible, bool noscale)
+static bool xD3D_setcursor(int monid, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale)
{
struct d3dstruct *d3d = &d3ddata[monid];
if (width && height) {
d3d->cursor_offset2_x = d3d->cursor_offset_x * d3d->window_w / width;
d3d->cursor_offset2_y = d3d->cursor_offset_y * d3d->window_h / height;
- d3d->cursor_x = x * d3d->window_w / width;
- d3d->cursor_y = y * d3d->window_h / height;
+ d3d->cursor_x = (float)x * d3d->window_w / width;
+ d3d->cursor_y = (float)y * d3d->window_h / height;
+ d3d->cursor_mx = mx;
+ d3d->cursor_my = my;
} else {
d3d->cursor_x = d3d->cursor_y = 0;
d3d->cursor_offset2_x = d3d->cursor_offset2_y = 0;
extern void(*D3D_clear)(int);
extern int(*D3D_canshaders)(void);
extern int(*D3D_goodenough)(void);
-extern bool(*D3D_setcursor)(int, int x, int y, int width, int height, bool visible, bool noscale);
+extern bool(*D3D_setcursor)(int, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale);
extern uae_u8* (*D3D_setcursorsurface)(int, int *pitch);
extern float(*D3D_getrefreshrate)(int);
extern void(*D3D_restore)(int, bool);
void (*D3D_clear)(int);
int (*D3D_canshaders)(void);
int (*D3D_goodenough)(void);
-bool (*D3D_setcursor)(int, int x, int y, int width, int height, bool visible, bool noscale);
+bool (*D3D_setcursor)(int, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale);
uae_u8* (*D3D_setcursorsurface)(int, int *pitch);
float (*D3D_getrefreshrate)(int);
void(*D3D_restore)(int, bool);
return false;
}
-static bool xD3D_setcursor(int monid, int x, int y, int width, int height, bool visible, bool noscale)
+static bool xD3D_setcursor(int monid, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale)
{
struct d3d11struct *d3d = &d3d11data[monid];
multx = ((float)(d3d->m_screenWidth) / ((d3d->m_bitmapWidth * d3d->dmult) + 2 * d3d->cursor_offset2_x));
multy = ((float)(d3d->m_screenHeight) / ((d3d->m_bitmapHeight * d3d->dmult) + 2 * d3d->cursor_offset2_y));
}
- setspritescaling(&d3d->hwsprite, 1.0f / multx, 1.0f / multy);
+
+ setspritescaling(&d3d->hwsprite, mx / multx, my / multy);
d3d->hwsprite.x = d3d->cursor_x * multx + d3d->cursor_offset2_x * multx;
d3d->hwsprite.y = d3d->cursor_y * multy + d3d->cursor_offset2_y * multy;
d3d->cursor_scale = !noscale;
d3d->cursor_v = visible;
d3d->hwsprite.enabled = visible;
+ d3d->hwsprite.bilinear = d3d->filterd3d->gfx_filter_bilinear;
return true;
}
return;
if (!currprefs.gfx_api)
return;
- D3D_setcursor(0, 0, 0, 0, 0, false, true);
+ D3D_setcursor(0, 0, 0, 0, 0, 0, 0, false, true);
}
static void mouseupdate(struct AmigaMonitor *mon)
struct picasso96_state_struct *state = &picasso96_state[mon->monitor_id];
int x = newcursor_x;
int y = newcursor_y;
+ float mx = currprefs.gf[1].gfx_filter_horiz_zoom_mult;
+ float my = currprefs.gf[1].gfx_filter_vert_zoom_mult;
int forced = 0;
if (!hwsprite)
if (!currprefs.gfx_api)
return;
if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) {
- D3D_setcursor(mon->monitor_id, x, y, WIN32GFX_GetWidth(mon), WIN32GFX_GetHeight(mon), cursorvisible, mon->scalepicasso == 2);
+ D3D_setcursor(mon->monitor_id, x, y, WIN32GFX_GetWidth(mon), WIN32GFX_GetHeight(mon), mx, my, cursorvisible, mon->scalepicasso == 2);
} else {
- D3D_setcursor(mon->monitor_id, x, y, state->Width, state->Height, cursorvisible, false);
+ D3D_setcursor(mon->monitor_id, x, y, state->Width, state->Height, mx, my, cursorvisible, false);
}
}
flags |= BIF_NOMEMORYMODEMIX;
flags |= BIF_GRANTDIRECTACCESS;
flags &= ~BIF_HARDWARESPRITE;
- if (currprefs.gfx_api && D3D_goodenough () > 0 && D3D_setcursor(0, -1, -1, -1, -1, false, false) && USE_HARDWARESPRITE && currprefs.rtg_hardwaresprite) {
+ if (currprefs.gfx_api && D3D_goodenough () > 0 && D3D_setcursor && D3D_setcursor(0, -1, -1, -1, -1, 0, 0, false, false) && USE_HARDWARESPRITE && currprefs.rtg_hardwaresprite) {
hwsprite = 1;
flags |= BIF_HARDWARESPRITE;
write_log (_T("P96: Hardware sprite support enabled\n"));
}
}
-static void DX_Blit96(struct AmigaMonitor *mon, int x, int y, int w, int h)
-{
- struct picasso96_state_struct *state = &picasso96_state[mon->monitor_id];
- RECT dr, sr;
-
- picasso_offset_x = 0;
- picasso_offset_y = 0;
- picasso_offset_mx = 1.0;
- picasso_offset_my = 1.0;
- if (mon->scalepicasso) {
- int srcratio, dstratio;
- int srcwidth, srcheight;
-
- if (mon->scalepicasso < 0 || mon->scalepicasso > 1) {
- srcwidth = state->Width;
- srcheight = state->Height;
- } else {
- srcwidth = mon->currentmode.native_width;
- srcheight = mon->currentmode.native_height;
- }
-
- SetRect (&sr, 0, 0, state->Width, state->Height);
- if (currprefs.win32_rtgscaleaspectratio < 0) {
- // automatic
- srcratio = state->Width * ASPECTMULT / state->Height;
- dstratio = srcwidth * ASPECTMULT / srcheight;
- } else if (currprefs.win32_rtgscaleaspectratio == 0) {
- // none
- srcratio = dstratio = 0;
- } else {
- // manual
- srcratio = currprefs.win32_rtgscaleaspectratio;
- dstratio = srcwidth * ASPECTMULT / srcheight;
- }
- if (srcratio == dstratio) {
- SetRect (&dr, 0, 0, srcwidth, srcheight);
- } else if (srcratio > dstratio) {
- int yy = srcheight - srcheight * dstratio / srcratio;
- SetRect (&dr, 0, yy / 2, srcwidth, srcheight - yy / 2);
- picasso_offset_y = yy / 2;
- } else {
- int xx = srcwidth - srcwidth * srcratio / dstratio;
- SetRect (&dr, xx / 2, 0,srcwidth - xx / 2, srcheight);
- picasso_offset_x = xx / 2;
- }
- picasso_offset_mx = (float)state->Width / (dr.right - dr.left);
- picasso_offset_my = (float)state->Height / (dr.bottom - dr.top);
- } else {
- SetRect (&sr, x, y, x + w, y + h);
- }
-}
-
void getrtgfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height)
{
struct AmigaMonitor *mon = &AMonitors[monid];
if (!ad->picasso_on)
return;
+
+ if (currprefs.gf[1].gfx_filter_horiz_zoom_mult > 0) {
+ picasso_offset_mx *= currprefs.gf[1].gfx_filter_horiz_zoom_mult * currprefs.gf[1].gfx_filter_horiz_zoom / 1000.0f;
+ }
+ if (currprefs.gf[1].gfx_filter_vert_zoom_mult > 0) {
+ picasso_offset_my *= currprefs.gf[1].gfx_filter_vert_zoom_mult * currprefs.gf[1].gfx_filter_vert_zoom / 1000.0f;
+ }
+
if (!mon->scalepicasso)
return;
#ifdef PICASSO96
mon->currentmode.vsync = 0;
if (mon->screen_is_picasso) {
- mon->currentmode.current_width = (int)(state->Width * currprefs.rtg_horiz_zoom_mult);
- mon->currentmode.current_height = (int)(state->Height * currprefs.rtg_vert_zoom_mult);
+ float mx = 1.0;
+ float my = 1.0;
+ if (currprefs.gf[1].gfx_filter_horiz_zoom_mult > 0) {
+ mx *= currprefs.gf[1].gfx_filter_horiz_zoom_mult;
+ }
+ if (currprefs.gf[1].gfx_filter_vert_zoom_mult > 0) {
+ my *= currprefs.gf[1].gfx_filter_vert_zoom_mult;
+ }
+ mx = mx + mx * currprefs.gf[1].gfx_filter_horiz_zoom / 1000.0f;
+ my = my + my * currprefs.gf[1].gfx_filter_vert_zoom / 1000.0f;
+ mon->currentmode.current_width = (int)(state->Width * currprefs.rtg_horiz_zoom_mult * mx);
+ mon->currentmode.current_height = (int)(state->Height * currprefs.rtg_vert_zoom_mult * my);
currprefs.gfx_apmode[1].gfx_interlaced = false;
if (currprefs.win32_rtgvblankrate == 0) {
currprefs.gfx_apmode[1].gfx_refreshrate = currprefs.gfx_apmode[0].gfx_refreshrate;
}
}
-void WIN32GFX_DisplayChangeRequested (int mode)
+void WIN32GFX_DisplayChangeRequested(int mode)
{
display_change_requested = mode;
}
-int check_prefs_changed_gfx (void)
+int check_prefs_changed_gfx(void)
{
int c = 0;
bool monitors[MAX_AMIGAMONITORS];
c |= c2;
monitors[i] = true;
}
+ if (WIN32GFX_IsPicassoScreen(&AMonitors[i])) {
+ struct gfx_filterdata *gfc = &changed_prefs.gf[1];
+ if (gfc->changed) {
+ gfc->changed = false;
+ c |= 16;
+ }
+ }
}
monitors[0] = true;
{
int v = workprefs.gf[filter_nativertg].gfx_filter ? TRUE : FALSE;
int scalemode = workprefs.gf[filter_nativertg].gfx_filter_autoscale;
- int vv = FALSE, vv2 = FALSE, vv3 = FALSE;
+ int vv = FALSE, vv2 = FALSE, vv3 = FALSE, vv4 = FALSE;
int as = FALSE;
struct uae_filter *uf;
int i, isfilter;
}
i++;
}
- if (v && uf->intmul)
+ if (v && uf->intmul) {
vv = TRUE;
- if (v && uf->yuv)
+ }
+ if (v && uf->yuv) {
vv2 = TRUE;
- if (workprefs.gfx_api)
- v = vv = vv2 = vv3 = TRUE;
- if (filter_nativertg)
- v = FALSE;
+ }
+ if (workprefs.gfx_api) {
+ v = vv = vv2 = vv3 = vv4 = TRUE;
+ }
+ if (filter_nativertg) {
+ vv4 = FALSE;
+ }
if (scalemode == AUTOSCALE_STATIC_AUTO || scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_STATIC_MAX)
as = TRUE;
ew(hDlg, IDC_FILTERVZMULT, v && !as);
ew(hDlg, IDC_FILTERHZ, v);
ew(hDlg, IDC_FILTERVZ, v);
- ew(hDlg, IDC_FILTERHO, v);
- ew(hDlg, IDC_FILTERVO, v);
+ ew(hDlg, IDC_FILTERHO, v && vv4);
+ ew(hDlg, IDC_FILTERVO, v && vv4);
ew(hDlg, IDC_FILTERSLR, vv3);
ew(hDlg, IDC_FILTERXL, vv2);
ew(hDlg, IDC_FILTERXLV, vv2);
break;
case IDC_FILTERHZMULT:
currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult = getfiltermult (hDlg, IDC_FILTERHZMULT);
+ workprefs.gf[filter_nativertg].changed = true;
updatedisplayarea(-1);
break;
case IDC_FILTERVZMULT:
currprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult = getfiltermult (hDlg, IDC_FILTERVZMULT);
+ workprefs.gf[filter_nativertg].changed = true;
updatedisplayarea(-1);
break;
case IDC_FILTERASPECT:
}
} else {
if (h == hz) {
- fd->gfx_filter_horiz_zoom = fdwp->gfx_filter_horiz_zoom = (float)SendMessage (hz, TBM_GETPOS, 0, 0);
+ fd->gfx_filter_horiz_zoom = (float)SendMessage (hz, TBM_GETPOS, 0, 0);
if (fdwp->gfx_filter_keep_aspect) {
- fd->gfx_filter_vert_zoom = fdwp->gfx_filter_vert_zoom = currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom;
+ fd->gfx_filter_vert_zoom = currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom;
xSendDlgItemMessage (hDlg, IDC_FILTERVZ, TBM_SETPOS, TRUE, (int)fdwp->gfx_filter_vert_zoom);
}
} else if (h == vz) {
- fd->gfx_filter_vert_zoom = fdwp->gfx_filter_vert_zoom = (float)SendMessage (vz, TBM_GETPOS, 0, 0);
+ fd->gfx_filter_vert_zoom = (float)SendMessage (vz, TBM_GETPOS, 0, 0);
if (fdwp->gfx_filter_keep_aspect) {
- fd->gfx_filter_horiz_zoom = fdwp->gfx_filter_horiz_zoom = currprefs.gf[filter_nativertg].gfx_filter_vert_zoom;
+ fd->gfx_filter_horiz_zoom = currprefs.gf[filter_nativertg].gfx_filter_vert_zoom;
xSendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, (int)fdwp->gfx_filter_horiz_zoom);
}
}
- fd->gfx_filter_horiz_offset = fdwp->gfx_filter_horiz_offset = (float)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
- fd->gfx_filter_vert_offset = fdwp->gfx_filter_vert_offset = (float)SendMessage (GetDlgItem (hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0);
+ if (fd->gfx_filter_horiz_zoom != fdwp->gfx_filter_horiz_zoom) {
+ fdwp->gfx_filter_horiz_zoom = fd->gfx_filter_horiz_zoom;
+ fdwp->changed = true;
+ }
+ if (fd->gfx_filter_vert_zoom != fdwp->gfx_filter_vert_zoom) {
+ fdwp->gfx_filter_vert_zoom = fd->gfx_filter_vert_zoom;
+ fdwp->changed = true;
+ }
+ fdwp->gfx_filter_horiz_offset = (float)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
+ fdwp->gfx_filter_vert_offset = (float)SendMessage(GetDlgItem(hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0);
+ fd->gfx_filter_horiz_offset = fdwp->gfx_filter_horiz_offset;
+ fd->gfx_filter_vert_offset = fdwp->gfx_filter_vert_offset;
SetDlgItemInt (hDlg, IDC_FILTERHOV, (int)workprefs.gf[filter_nativertg].gfx_filter_horiz_offset, TRUE);
SetDlgItemInt (hDlg, IDC_FILTERVOV, (int)workprefs.gf[filter_nativertg].gfx_filter_vert_offset, TRUE);
SetDlgItemInt (hDlg, IDC_FILTERHZV, (int)workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom, TRUE);