if (real) {
cfgfile_parse_separated_line (p, line1b, line2b, askedtype);
} else {
- cfgfile_string (line1b, line2b, "config_description", p->description, 128);
- cfgfile_string (line1b, line2b, "config_hardware_path", p->config_hardware_path, 128);
- cfgfile_string (line1b, line2b, "config_host_path", p->config_host_path, 128);
+ cfgfile_string (line1b, line2b, "config_description", p->description, sizeof p->description);
+ cfgfile_string (line1b, line2b, "config_hardware_path", p->config_hardware_path, sizeof p->config_hardware_path);
+ cfgfile_string (line1b, line2b, "config_host_path", p->config_host_path, sizeof p->config_host_path);
}
}
}
{
int result = 0;
struct uae_prefs *p = xmalloc (sizeof (struct uae_prefs));
+
p->description[0] = 0;
p->config_host_path[0] = 0;
p->config_hardware_path[0] = 0;
if (hardwarelink)
strcpy (hardwarelink, p->config_hardware_path);
}
- free (p);
+ xfree (p);
return result;
}
return src;
}
-uae_u8 *save_configuration(int *len)
+uae_u8 *save_configuration (int *len)
{
int tmpsize = 30000;
uae_u8 *dstbak, *dst;
ret = cfgfile_modify (index, "*", 1, tmpout, sizeof (tmpout));
index++;
if (strlen(tmpout) > 0) {
- if (!memcmp(tmpout, "input.", 6))
+ if (!memcmp (tmpout, "input.", 6))
continue;
strcpy (p, tmpout);
strcat (p, "\n");
- p += strlen(p);
- if (p - dstbak >= tmpsize - sizeof(tmpout))
+ p += strlen (p);
+ if (p - dstbak >= tmpsize - sizeof (tmpout))
break;
}
if (ret >= 0)
zfile_fclose (default_file);
default_file = NULL;
- f = zfile_fopen_empty ("configstore", 50000);
+ f = zfile_fopen_empty ("configstore", 100000);
if (f) {
uaeconfig++;
cfgfile_save_options (f, p, 0);
vsynctime = vsynctime_orig = 1;
else
vsynctime = vsynctime_orig = syncbase / fake_vblank_hz;
+ if (!picasso_on) {
#ifdef OPENGL
- OGL_refresh ();
+ OGL_refresh ();
#endif
#ifdef D3D
- D3D_refresh ();
+ D3D_refresh ();
#endif
+ }
if (currprefs.produce_sound > 1)
update_sound (fake_vblank_hz);
}
int i;
char tmp[100];
+#if 0
+ if (pdidoi->dwOfs != DIDFT_GETINSTANCE (pdidoi->dwType))
+ write_log ("%x-%s: %x <> %x\n", pdidoi->dwType & 0xff, pdidoi->tszName,
+ pdidoi->dwOfs, DIDFT_GETINSTANCE (pdidoi->dwType));
+#endif
if (pdidoi->dwType & DIDFT_AXIS) {
int sort = 0;
if (did->axles >= MAX_MAPPINGS)
return DIENUM_CONTINUE;
- did->axismappings[did->axles] = pdidoi->dwOfs;
+ did->axismappings[did->axles] = DIDFT_GETINSTANCE (pdidoi->dwType);
did->axisname[did->axles] = my_strdup (pdidoi->tszName);
if (did->type == DID_JOYSTICK)
sort = makesort_joy (&pdidoi->guidType, &did->axismappings[did->axles]);
return DIENUM_CONTINUE;
did->buttonname[did->buttons] = my_strdup (pdidoi->tszName);
if (did->type == DID_JOYSTICK) {
- did->buttonmappings[did->buttons] = DIJOFS_BUTTON(did->buttons); // pdidoi->dwOfs returns garbage!!
+ //did->buttonmappings[did->buttons] = DIJOFS_BUTTON(DIDFT_GETINSTANCE (pdidoi->dwType));
+ did->buttonmappings[did->buttons] = DIJOFS_BUTTON(did->buttons);
did->buttonsort[did->buttons] = makesort_joy (&pdidoi->guidType, &did->buttonmappings[did->buttons]);
} else if (did->type == DID_MOUSE) {
- did->buttonmappings[did->buttons] = FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + did->buttons;
+ //did->buttonmappings[did->buttons] = FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + DIDFT_GETINSTANCE (pdidoi->dwType);
+ did->buttonmappings[did->buttons] = FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + did->buttons;
did->buttonsort[did->buttons] = makesort_mouse (&pdidoi->guidType, &did->buttonmappings[did->buttons]);
} else {
- did->buttonmappings[did->buttons] = pdidoi->dwOfs;
+ //did->buttonmappings[did->buttons] = pdidoi->dwOfs;
+ did->buttonmappings[did->buttons] = DIDFT_GETINSTANCE (pdidoi->dwType);
}
did->buttons++;
}
if (!did->disabled && did->connection == DIDC_DX) {
hr = IDirectInput8_CreateDevice (g_lpdi, &did->guid, &lpdi, NULL);
if (SUCCEEDED (hr)) {
- hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIMouse);
+ hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIMouse2);
IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
fixbuttons (did);
fixthings_mouse (did);
hr = IDirectInputDevice8_SetProperty (lpdi, DIPROP_BUFFERSIZE, &dipdw.diph);
if (FAILED (hr))
write_log ("keyboard setpropertry failed, %s\n", DXError (hr));
- IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
+ IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, did, DIDFT_ALL);
sortobjects (did, did->axismappings, did->axissort, did->axisname, did->axistype, did->axles);
sortobjects (did, did->buttonmappings, did->buttonsort, did->buttonname, 0, did->buttons);
did->lpdi = lpdi;
return 0;
}
+void D3D_clear (void)
+{
+ HRESULT hr;
+ hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
+ if (FAILED (hr))
+ return;
+ IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
+ hr = IDirect3DDevice9_BeginScene (d3ddev);
+ if (FAILED (hr))
+ return;
+ IDirect3DDevice9_EndScene (d3ddev);
+ IDirect3DDevice9_Present (d3ddev, 0, 0, 0 ,0);
+}
+
int D3D_locktexture (void)
{
D3DLOCKED_RECT locked;
extern HDC D3D_getDC(HDC hdc);
extern int D3D_isenabled (void);
extern int D3D_needreset (void);
+extern void D3D_clear (void);
releaser (dxdata.secondary, IDirectDrawSurface7_Release);
releaser (dxdata.cursorsurface1, IDirectDrawSurface7_Release);
releaser (dxdata.cursorsurface2, IDirectDrawSurface7_Release);
- releaser (dxdata.statussurface, IDirectDrawSurface7_Release);
+// releaser (dxdata.statussurface, IDirectDrawSurface7_Release);
dxdata.backbuffers = 0;
}
{
releaser (dxdata.cursorsurface1, IDirectDrawSurface7_Release);
releaser (dxdata.cursorsurface2, IDirectDrawSurface7_Release);
- releaser (dxdata.statussurface, IDirectDrawSurface7_Release);
+// releaser (dxdata.statussurface, IDirectDrawSurface7_Release);
dxdata.cursorsurface1 = allocsurface_2 (dxdata.cursorwidth, dxdata.cursorheight, TRUE);
dxdata.cursorsurface2 = allocsurface_2 (dxdata.cursorwidth, dxdata.cursorheight, FALSE);
- dxdata.statussurface = allocsurface_2 (dxdata.statuswidth, dxdata.statusheight, FALSE);
+// dxdata.statussurface = allocsurface_2 (dxdata.statuswidth, dxdata.statusheight, FALSE);
if (dxdata.cursorsurface1)
clearsurf (dxdata.cursorsurface1);
if (dxdata.cursorsurface2)
clearsurf (dxdata.cursorsurface2);
- if (dxdata.statussurface)
- clearsurf (dxdata.statussurface);
+// if (dxdata.statussurface)
+// clearsurf (dxdata.statussurface);
}
HRESULT DirectDraw_CreateMainSurface (int width, int height)
DirectDraw_Blt (dst, dstrect, src, scrrect);
}
-void DirectDraw_Fill (RECT *rect, uae_u32 color)
+static void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color)
{
HRESULT ddrval;
DDBLTFX ddbltfx;
- LPDIRECTDRAWSURFACE7 dst;
+ if (!dst)
+ return;
memset (&ddbltfx, 0, sizeof (ddbltfx));
ddbltfx.dwFillColor = color;
ddbltfx.dwSize = sizeof (ddbltfx);
- dst = getlocksurface ();
while (FAILED (ddrval = IDirectDrawSurface7_Blt (dst, rect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx))) {
if (ddrval == DDERR_SURFACELOST) {
ddrval = restoresurface (dst);
}
-void DirectDraw_FillPrimary (void)
+void DirectDraw_Fill (RECT *rect, uae_u32 color)
{
- HRESULT ddrval;
- DDBLTFX ddbltfx;
- LPDIRECTDRAWSURFACE7 dst;
- DWORD color = 0;
- RECT *rect = NULL;
+ DirectDraw_FillSurface (getlocksurface (), rect, color);
+}
- memset (&ddbltfx, 0, sizeof (ddbltfx));
- ddbltfx.dwFillColor = color;
- ddbltfx.dwSize = sizeof (ddbltfx);
- dst = dxdata.primary;
- if (dst == NULL)
- return;
- while (FAILED (ddrval = IDirectDrawSurface7_Blt (dst, rect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx))) {
- if (ddrval == DDERR_SURFACELOST) {
- ddrval = restoresurface (dst);
- if (FAILED (ddrval))
- break;
- } else if (ddrval != DDERR_SURFACEBUSY) {
- write_log ("DirectDraw_FillPrimary: %s\n", DXError (ddrval));
- break;
- }
- }
+void DirectDraw_FillPrimary (void)
+{
+ DirectDraw_FillSurface (dxdata.primary, NULL, 0);
}
extern int vblank_skip;
int DirectDraw_Start (GUID *guid)
{
+ static int d3ddone;
HRESULT ddrval;
LPDIRECT3D9 d3d;
D3DCAPS9 d3dCaps;
}
#endif
- dxdata.statuswidth = 800;
- dxdata.statusheight = TD_TOTAL_HEIGHT;
+// dxdata.statuswidth = 800;
+// dxdata.statusheight = TD_TOTAL_HEIGHT;
dxdata.cursorwidth = 48;
dxdata.cursorheight = 48;
dxdata.maxwidth = 16384;
dxdata.maxheight = 16384;
- d3dDLL = LoadLibrary ("D3D9.DLL");
- if (d3dDLL) {
- d3d = Direct3DCreate9 (D3D9b_SDK_VERSION);
- if (d3d) {
- if (SUCCEEDED (IDirect3D9_GetDeviceCaps (d3d, 0, D3DDEVTYPE_HAL, &d3dCaps))) {
- dxdata.maxwidth = d3dCaps.MaxTextureWidth;
- dxdata.maxheight = d3dCaps.MaxTextureHeight;
- write_log ("Max hardware surface size: %dx%d\n", dxdata.maxwidth, dxdata.maxheight);
+ if (!d3ddone) {
+ d3dDLL = LoadLibrary ("D3D9.DLL");
+ if (d3dDLL) {
+ d3d = Direct3DCreate9 (D3D9b_SDK_VERSION);
+ if (d3d) {
+ if (SUCCEEDED (IDirect3D9_GetDeviceCaps (d3d, 0, D3DDEVTYPE_HAL, &d3dCaps))) {
+ dxdata.maxwidth = d3dCaps.MaxTextureWidth;
+ dxdata.maxheight = d3dCaps.MaxTextureHeight;
+ write_log ("Max hardware surface size: %dx%d\n", dxdata.maxwidth, dxdata.maxheight);
+ }
+ IDirect3D9_Release (d3d);
}
- IDirect3D9_Release (d3d);
+ FreeLibrary (d3dDLL);
}
- FreeLibrary (d3dDLL);
+ d3ddone = 1;
}
if (dxdata.maxwidth < 2048)
dxdata.maxwidth = 2048;
uaecptr bmeptr = get_long (bi + PSSO_BoardInfo_BitMapExtra); /* Get our BoardInfo ptr's BitMapExtra ptr */
uae_u16 bme_width, bme_height;
int changed = 0;
+ RGBFTYPE rgbf;
if (oldscr == 0) {
oldscr = start_of_screen;
bme_width = get_word (bmeptr + PSSO_BitMapExtra_Width);
bme_height = get_word (bmeptr + PSSO_BitMapExtra_Height);
+ rgbf = picasso96_state.RGBFormat;
picasso96_state.Address = start_of_screen; /* Amiga-side address */
picasso96_state.XOffset = (uae_s16)(m68k_dreg (regs, 1) & 0xFFFF);
picasso96_state.BytesPerRow = picasso96_state.VirtualWidth * picasso96_state.BytesPerPixel;
picasso_SetPanningInit();
+ if (rgbf != picasso96_state.RGBFormat)
+ gfx_set_picasso_colors (picasso96_state.RGBFormat);
+
full_refresh = 1;
set_panning_called = 1;
P96TRACE(("SetPanning(%d, %d, %d) Start 0x%x, BPR %d Bpp %d RGBF %d\n",
extern struct picasso_vidbuf_description picasso_vidinfo;
extern void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 d, RGBFTYPE rgbfmt);
+extern void gfx_set_picasso_colors (RGBFTYPE rgbfmt);
extern void gfx_set_picasso_baseaddr (uaecptr);
extern void gfx_set_picasso_state (int on);
extern uae_u8 *gfx_lock_picasso (void);
return dst;
}
+static void strip_slashes (char *p)
+{
+ while (strlen (p) > 0 && (p[strlen (p) - 1] == '\\' || p[strlen (p) - 1] == '/'))
+ p[strlen (p) - 1] = 0;
+}
+static void fixtrailing(char *p)
+{
+ if (strlen(p) == 0)
+ return;
+ if (p[strlen(p) - 1] == '/' || p[strlen(p) - 1] == '\\')
+ return;
+ strcat(p, "\\");
+}
+
typedef DWORD (STDAPICALLTYPE *PFN_GetKey)(LPVOID lpvBuffer, DWORD dwSize);
uae_u8 *target_load_keyfile (struct uae_prefs *p, char *path, int *sizep, char *name)
{
char path[MAX_DPATH];
sprintf (path, "%s..\\Player\\%s", start_path_exe, libname);
h = LoadLibrary (path);
- if (!h)
- return NULL;
+ if (!h) {
+ char *afr = getenv ("AMIGAFOREVERROOT");
+ if (afr) {
+ char tmp[MAX_DPATH];
+ strcpy (tmp, afr);
+ fixtrailing (tmp);
+ sprintf (path, "%sPlayer\\%s", tmp, libname);
+ h = LoadLibrary (path);
+ if (!h)
+ return NULL;
+ }
+ }
}
GetModuleFileName (h, name, MAX_DPATH);
pfnGetKey = (PFN_GetKey)GetProcAddress (h, "GetKey");
fetch_path (NULL, out, size);
}
-static void strip_slashes (char *p)
-{
- while (strlen (p) > 0 && (p[strlen (p) - 1] == '\\' || p[strlen (p) - 1] == '/'))
- p[strlen (p) - 1] = 0;
-}
-static void fixtrailing(char *p)
-{
- if (strlen(p) == 0)
- return;
- if (p[strlen(p) - 1] == '/' || p[strlen(p) - 1] == '\\')
- return;
- strcat(p, "\\");
-}
-
static int isfilesindir(char *p)
{
WIN32_FIND_DATA fd;
if (dump) {
HANDLE f = CreateFile (path2, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (f != INVALID_HANDLE_VALUE) {
+ flush_log ();
savedump (dump, f, pExceptionPointers);
CloseHandle (f);
- flush_log ();
if (isfullscreen () <= 0) {
sprintf (msg, "Crash detected. MiniDump saved as:\n%s\n", path2);
MessageBox (NULL, msg, "Crash", MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND);
#define GETBDD(x) ((x) % 100)
#define WINUAEBETA 1
-#define WINUAEPUBLICBETA 2
-#define WINUAEDATE MAKEBD(2008, 6, 24)
+#define WINUAEPUBLICBETA 3
+#define WINUAEDATE MAKEBD(2008, 6, 28)
#define WINUAEEXTRA ""
#define WINUAEREV ""
return hMainWnd ? 1 : 0;
}
-int isfullscreen (void)
+static int isfullscreen_2 (struct uae_prefs *p)
{
if (screen_is_picasso)
- return currprefs.gfx_pfullscreen == 1 ? 1 : (currprefs.gfx_pfullscreen == 2 ? -1 : 0);
+ return p->gfx_pfullscreen == 1 ? 1 : (p->gfx_pfullscreen == 2 ? -1 : 0);
else
- return currprefs.gfx_afullscreen == 1 ? 1 : (currprefs.gfx_afullscreen == 2 ? -1 : 0);
+ return p->gfx_afullscreen == 1 ? 1 : (p->gfx_afullscreen == 2 ? -1 : 0);
+}
+int isfullscreen (void)
+{
+ return isfullscreen_2 (&currprefs);
}
int is3dmode (void)
RECT dr, sr;
if (scalepicasso) {
+ int srcratio, dstratio;
SetRect (&sr, 0, 0, picasso96_state.Width, picasso96_state.Height);
- SetRect (&dr, 0, 0, currentmode->native_width, currentmode->native_height);
+ srcratio = picasso96_state.Width * 256 / picasso96_state.Height;
+ dstratio = currentmode->native_width * 256 / currentmode->native_height;
+ if (srcratio == dstratio) {
+ SetRect (&dr, 0, 0, currentmode->native_width, currentmode->native_height);
+ } else if (srcratio > dstratio) {
+ int yy = currentmode->native_height - currentmode->native_height * dstratio / srcratio;
+ SetRect (&dr, 0, yy / 2, currentmode->native_width, currentmode->native_height - yy / 2);
+ } else {
+ int xx = currentmode->native_width - currentmode->native_width * srcratio / dstratio;
+ SetRect (&dr, xx / 2, 0, currentmode->native_width - xx / 2, currentmode->native_height);
+ }
DirectDraw_BlitToPrimaryScale (&dr, &sr);
} else {
SetRect (&sr, x, y, x + w, y + h);
if (p96_double_buffer_needs_flushing) {
if (scalepicasso) {
p96_double_buffer_firstx = 0;
- p96_double_buffer_lastx = picasso_vidinfo.width;
+ p96_double_buffer_lastx = picasso96_state.Width;
p96_double_buffer_first = 0;
- p96_double_buffer_last = picasso_vidinfo.height;
+ p96_double_buffer_last = picasso96_state.Height;
}
picasso_putcursor (p96_double_buffer_firstx, p96_double_buffer_first,
p96_double_buffer_lastx - p96_double_buffer_firstx + 1, p96_double_buffer_last - p96_double_buffer_first + 1);
if ((currprefs.win32_rtgscaleifsmall || currprefs.win32_rtgallowscaling) && (picasso96_state.Width != currentmode->native_width || picasso96_state.Height != currentmode->native_height))
scalepicasso = -1;
} else if (isfullscreen () > 0) {
- if (currprefs.gfx_size.width > picasso96_state.Width && currprefs.gfx_size.width > picasso96_state.Height) {
- if (currprefs.win32_rtgscaleifsmall)
+ if (currprefs.gfx_size.width > picasso96_state.Width && currprefs.gfx_size.height > picasso96_state.Height) {
+ if (currprefs.win32_rtgscaleifsmall && !currprefs.win32_rtgmatchdepth)
scalepicasso = 1;
}
} else if (isfullscreen () == 0) {
- if (currprefs.gfx_size.width != picasso96_state.Width && currprefs.gfx_size.width != picasso96_state.Height && currprefs.win32_rtgallowscaling)
+ if ((currprefs.gfx_size.width != picasso96_state.Width || currprefs.gfx_size.height != picasso96_state.Height) && currprefs.win32_rtgallowscaling)
scalepicasso = 1;
- if ((currprefs.gfx_size.width > picasso96_state.Width || currprefs.gfx_size.width > picasso96_state.Height) && currprefs.win32_rtgscaleifsmall)
+ if ((currprefs.gfx_size.width > picasso96_state.Width || currprefs.gfx_size.height > picasso96_state.Height) && currprefs.win32_rtgscaleifsmall)
scalepicasso = 1;
}
- if (scalepicasso > 0 && currprefs.gfx_size.width != picasso96_state.Width && currprefs.gfx_size.width != picasso96_state.Height) {
+ if (scalepicasso > 0 && (currprefs.gfx_size.width != picasso96_state.Width || currprefs.gfx_size.height != picasso96_state.Height)) {
currentmode->current_width = currprefs.gfx_size.width;
currentmode->current_height = currprefs.gfx_size.height;
}
if (display_change_requested || c)
{
- int staywindowed =
- currprefs.gfx_afullscreen == changed_prefs.gfx_afullscreen && currprefs.gfx_afullscreen != 1 &&
- currprefs.gfx_pfullscreen == changed_prefs.gfx_pfullscreen && currprefs.gfx_pfullscreen != 1;
+ int keepfsmode =
+ currprefs.gfx_afullscreen == changed_prefs.gfx_afullscreen &&
+ currprefs.gfx_pfullscreen == changed_prefs.gfx_pfullscreen;
cfgfile_configuration_change (1);
if (display_change_requested)
c |= 2;
currprefs.gfx_autoresolution = changed_prefs.gfx_autoresolution;
currprefs.color_mode = changed_prefs.color_mode;
+ if (changed_prefs.gfx_afullscreen == 1) {
+ if (currprefs.gfx_filter == UAE_FILTER_DIRECT3D && changed_prefs.gfx_filter != UAE_FILTER_DIRECT3D)
+ keepfsmode = 0;
+ if (currprefs.gfx_filter == UAE_FILTER_OPENGL && changed_prefs.gfx_filter != UAE_FILTER_OPENGL)
+ keepfsmode = 0;
+ if (changed_prefs.gfx_filter == UAE_FILTER_DIRECT3D && currprefs.gfx_filter != UAE_FILTER_DIRECT3D)
+ keepfsmode = 0;
+ if (changed_prefs.gfx_filter == UAE_FILTER_OPENGL && currprefs.gfx_filter != UAE_FILTER_OPENGL)
+ keepfsmode = 0;
+ }
+
currprefs.gfx_filter = changed_prefs.gfx_filter;
currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode;
currprefs.gfx_filter_horiz_zoom_mult = changed_prefs.gfx_filter_horiz_zoom_mult;
currprefs.win32_rtgallowscaling = changed_prefs.win32_rtgallowscaling;
inputdevice_unacquire ();
- if ((c & 16) || ((c & 8) && staywindowed)) {
+ if ((c & 16) || ((c & 8) && keepfsmode)) {
extern int reopen (int);
if (reopen (c & 2))
c |= 2;
}
- if ((c & 2) && !staywindowed) {
+ if ((c & 2) && !keepfsmode) {
close_windows ();
graphics_init ();
}
full = 1;
if (changed_prefs.gfx_pfullscreen != currprefs.gfx_pfullscreen && screen_is_picasso)
full = 1;
+
/* fullscreen to fullscreen? */
- if (!screen_is_picasso && changed_prefs.gfx_afullscreen && currprefs.gfx_afullscreen == changed_prefs.gfx_afullscreen) {
- if (currprefs.gfx_size_fs.width != changed_prefs.gfx_size_fs.width ||
- currprefs.gfx_size_fs.height != changed_prefs.gfx_size_fs.height) {
- quick = 1;
- }
+ if (isfullscreen () > 0 && currprefs.gfx_afullscreen == changed_prefs.gfx_afullscreen &&
+ currprefs.gfx_pfullscreen == changed_prefs.gfx_pfullscreen && currprefs.gfx_afullscreen == 1) {
+ quick = 1;
}
/* windowed to windowed */
- if (isfullscreen () <= 0 && currprefs.gfx_afullscreen == changed_prefs.gfx_afullscreen && currprefs.gfx_pfullscreen == changed_prefs.gfx_pfullscreen) {
+ if (isfullscreen () <= 0 && currprefs.gfx_afullscreen == changed_prefs.gfx_afullscreen &&
+ currprefs.gfx_pfullscreen == changed_prefs.gfx_pfullscreen) {
quick = 1;
}
currprefs.gfx_pvsync = changed_prefs.gfx_pvsync;
currprefs.gfx_refreshrate = changed_prefs.gfx_refreshrate;
+
+
if (!quick)
return 1;
open_windows (0);
- if (isfullscreen () < 0)
+ if (isfullscreen () <= 0)
DirectDraw_FillPrimary ();
return 0;
if (picasso96_state.BytesPerPixel * 8 != wc->current_depth && currprefs.win32_rtgmatchdepth)
return -1;
if (picasso96_state.Width < wc->current_width && picasso96_state.Height < wc->current_height) {
- if (currprefs.win32_rtgscaleifsmall) {
- // scalepicasso = 1
+ if (currprefs.win32_rtgscaleifsmall && !currprefs.win32_rtgmatchdepth)
return 0;
- }
}
if (picasso96_state.Width != wc->current_width ||
picasso96_state.Height != wc->current_height)
return 0;
}
+static void clearscreen (void)
+{
+ DirectDraw_FillPrimary ();
+}
+
void gfx_set_picasso_state (int on)
{
struct winuae_currentmode wc;
memcpy (&wc, currentmode, sizeof (wc));
updatemodes ();
- DirectDraw_FillPrimary ();
+ update_gfxparams ();
+ clearscreen ();
if (currprefs.gfx_afullscreen != currprefs.gfx_pfullscreen ||
(currprefs.gfx_afullscreen == 1 && (currprefs.gfx_filter == UAE_FILTER_DIRECT3D || currprefs.gfx_filter == UAE_FILTER_OPENGL))) {
mode = 1;
if (!mode)
goto end;
}
- update_gfxparams ();
if (mode < 0) {
open_windows (0);
} else {
open_screen (); // reopen everything
}
end:
- update_gfxparams ();
#ifdef RETROPLATFORM
rp_set_hwnd (hAmigaWnd);
#endif
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
{
int need;
- alloc_colors_picasso (x_red_bits, x_green_bits, x_blue_bits, x_red_shift, x_green_shift, x_blue_shift, rgbfmt);
if (!screen_is_picasso)
return;
+ gfx_set_picasso_colors (rgbfmt);
updatemodes ();
need = modeswitchneeded (currentmode);
update_gfxparams ();
}
#endif
+void gfx_set_picasso_colors (RGBFTYPE rgbfmt)
+{
+ alloc_colors_picasso (x_red_bits, x_green_bits, x_blue_bits, x_red_shift, x_green_shift, x_blue_shift, rgbfmt);
+}
+
static void gfxmode_reset (void)
{
#ifdef GFXFILTER
if (hAmigaWnd) {
RECT r;
int w, h, x, y;
- int nw, nh;
+ int nw, nh, nx, ny;
GetWindowRect (hAmigaWnd, &r);
x = r.left;
y = r.top;
- w = r.bottom - r.top;
- h = r.right - r.left;
+ w = r.right - r.left;
+ h = r.bottom - r.top;
+ nx = x;
+ ny = y;
if (screen_is_picasso) {
nw = currentmode->current_width;
nh = currentmode->current_height;
nw = currprefs.gfx_size_win.width;
nh = currprefs.gfx_size_win.height;
}
- if (isfullscreen () == 0 && (w != nw || h != nh)) {
+ if (fsw || dxfs) {
+ RECT rc = getdisplay (&currprefs)->rect;
+ nx = rc.left;
+ ny = rc.top;
+ nw = rc.right - rc.left;
+ nh = rc.bottom - rc.top;
+ }
+ if (w != nw || h != nh || x != nx || y != ny) {
w = nw;
h = nh;
+ x = nx;
+ y = ny;
in_sizemove++;
- if (hMainWnd) {
+ if (hMainWnd && !fsw && !dxfs) {
GetWindowRect (hMainWnd, &r);
x = r.left;
y = r.top;
struct MultiDisplay *md;
fixup_prefs_dimensions (p);
- if (p->gfx_afullscreen) {
+ if (isfullscreen_2 (p) != 0) {
p->gfx_size = p->gfx_size_fs;
} else {
p->gfx_size = p->gfx_size_win;
void WIN32GUI_LoadUIString(DWORD id, char *string, DWORD dwStringLen)
{
- if(LoadString(hUIDLL ? hUIDLL : hInst, id, string, dwStringLen) == 0)
+ if (LoadString(hUIDLL ? hUIDLL : hInst, id, string, dwStringLen) == 0)
LoadString(hInst, id, string, dwStringLen);
}
static void ew (HWND hDlg, DWORD id, int enable)
{
- HWND w = GetDlgItem(hDlg, id);
+ HWND w = GetDlgItem (hDlg, id);
if (!w)
return;
- if (!enable && w == GetFocus())
- SendMessage(hDlg, WM_NEXTDLGCTL, 0, FALSE);
- EnableWindow(w, !!enable);
+ if (!enable && w == GetFocus ())
+ SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
+ EnableWindow (w, !!enable);
}
void write_disk_history (void)
return;
j = 1;
for (i = 0; i <= MAX_PREVIOUS_FLOPPIES; i++) {
- char *s = DISK_history_get(i);
+ char *s = DISK_history_get (i);
if (s == 0 || strlen(s) == 0)
continue;
sprintf (tmp, "Image%02d", j);
for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++)
DISK_history_add (NULL, i);
- write_disk_history();
+ write_disk_history ();
}
UAEREG *read_disk_history (void)
break;
case IDC_DF3:
SetDlgItemText (hDlg, IDC_DF3TEXT, full_path);
- strcpy(prefs->df[3], full_path);
+ strcpy (prefs->df[3], full_path);
DISK_history_add (full_path, -1);
break;
case IDC_DOSAVESTATE:
{
char disk_name[32];
disk_name[0] = 0; disk_name[31] = 0;
- GetDlgItemText(hDlg, IDC_CREATE_NAME, disk_name, 30);
- disk_creatediskfile(full_path, 0, SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), disk_name);
+ GetDlgItemText (hDlg, IDC_CREATE_NAME, disk_name, 30);
+ disk_creatediskfile (full_path, 0, SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), disk_name);
}
break;
case IDC_CREATE_RAW:
- disk_creatediskfile(full_path, 1, SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), NULL);
+ disk_creatediskfile (full_path, 1, SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), NULL);
break;
case IDC_LOAD:
- if (target_cfgfile_load(&workprefs, full_path, 0, 0) == 0) {
+ if (target_cfgfile_load (&workprefs, full_path, 0, 0) == 0) {
char szMessage[MAX_DPATH];
WIN32GUI_LoadUIString (IDS_COULDNOTLOADCONFIG, szMessage, MAX_DPATH);
pre_gui_message (szMessage);
strcpy (workprefs.cartfile, full_path);
break;
case IDC_INPREC_PLAY:
- inprec_open(full_path, IsDlgButtonChecked (hDlg, IDC_INPREC_PLAYMODE) == BST_CHECKED ? -1 : -2);
+ inprec_open (full_path, IsDlgButtonChecked (hDlg, IDC_INPREC_PLAYMODE) == BST_CHECKED ? -1 : -2);
break;
case IDC_INPREC_RECORD:
- inprec_open(full_path, 1);
+ inprec_open (full_path, 1);
break;
}
if (!nosavepath) {
}
return result;
}
-int DiskSelection(HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out)
+int DiskSelection (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out)
{
return DiskSelection_2 (hDlg, wParam, flag, prefs, path_out, NULL);
}
-int MultiDiskSelection(HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out)
+int MultiDiskSelection (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out)
{
int multi = 0;
return DiskSelection_2 (hDlg, wParam, flag, prefs, path_out, &multi);
static void GetConfigPath (char *path, struct ConfigStruct *parent, int noroot)
{
- if (parent == 0) {
+ if (parent == NULL) {
path[0] = 0;
if (!noroot) {
fetch_path ("ConfigurationPath", path, MAX_DPATH);
void FreeConfigStruct (struct ConfigStruct *config)
{
- free (config);
+ xfree (config);
}
struct ConfigStruct *AllocConfigStruct (void)
{
int i;
for (i = 0; i < configstoresize; i++)
FreeConfigStruct (configstore[i]);
- free (configstore);
+ xfree (configstore);
configstore = 0;
configstoresize = configstoreallocated = 0;
}
HANDLE h;
WIN32_FIND_DATA ffd;
+#if CONFIGCACHE == 0
+ return NULL;
+#endif
err = 0;
first = NULL;
getconfigcache (cachepath, path);
if (*level == 0)
FreeConfigStore ();
+
first = NULL;
GetConfigPath (path, configparent, FALSE);
GetConfigPath (shortpath, configparent, TRUE);
break;
}
}
- if (*level == 0)
+ if (*level == 0 && CONFIGCACHE)
writeconfigcache (path);
return first;
}
static struct ConfigStruct *CreateConfigStore (struct ConfigStruct *oldconfig, int flushcache)
{
- int level = 0, i;
+ int level, i;
char path[MAX_DPATH], name[MAX_DPATH];
struct ConfigStruct *cs;
strcpy (path, oldconfig->Path);
strcpy (name, oldconfig->Name);
}
+ level = 0;
GetConfigs (NULL, 1, &level, flushcache);
if (oldconfig) {
for (i = 0; i < configstoresize; i++) {
static char full_path[MAX_DPATH];
full_path[0] = 0;
+ name[0] = 0;
+ desc[0] = 0;
GetDlgItemText (hDlg, IDC_EDITNAME, name, MAX_DPATH);
strcpy (config_filename, name);
if (flag == CONFIG_SAVE_FULL || flag == CONFIG_SAVE) {
case CONFIG_LOAD:
if (strlen (name) == 0) {
char szMessage[MAX_DPATH];
- WIN32GUI_LoadUIString(IDS_MUSTSELECTCONFIG, szMessage, MAX_DPATH);
+ WIN32GUI_LoadUIString (IDS_MUSTSELECTCONFIG, szMessage, MAX_DPATH);
pre_gui_message (szMessage);
} else {
if (target_cfgfile_load (&workprefs, path, configtypepanel, 0) == 0) {
SendDlgItemMessage (hDlg, IDC_CONFIGLINK, CB_SETCURSEL, idx2, 0);
}
+static void DeleteConfigTree (HWND hDlg)
+{
+ int i;
+ HWND TVhDlg = GetDlgItem(hDlg, IDC_CONFIGTREE);
+ for (i = 0; i < configstoresize; i++)
+ configstore[i]->item = NULL;
+ TreeView_DeleteAllItems (TVhDlg);
+}
+
static HTREEITEM InitializeConfigTreeView (HWND hDlg)
{
HIMAGELIST himl = ImageList_Create (16, 16, ILC_COLOR8 | ILC_MASK, 3, 0);
HWND TVhDlg = GetDlgItem(hDlg, IDC_CONFIGTREE);
HTREEITEM parent;
char path[MAX_DPATH];
- int i;
if (himl) {
HICON icon;
ImageList_AddIcon (himl, icon);
TreeView_SetImageList (TVhDlg, himl, TVSIL_NORMAL);
}
- for (i = 0; i < configstoresize; i++)
- configstore[i]->item = NULL;
- TreeView_DeleteAllItems (TVhDlg);
+ DeleteConfigTree (hDlg);
GetConfigPath (path, NULL, FALSE);
parent = AddConfigNode (hDlg, NULL, path, NULL, NULL, 0, 1, NULL);
LoadConfigTreeView (hDlg, -1, parent);
return config;
}
-static void loadsavecommands (HWND hDlg, WPARAM wParam, struct ConfigStruct *config, char **pcfgfile, char *newpath)
+static void loadsavecommands (HWND hDlg, WPARAM wParam, struct ConfigStruct **configp, char **pcfgfile, char *newpath)
{
+ struct ConfigStruct *config = *configp;
switch (LOWORD (wParam))
{
case IDC_SAVE:
HandleConfiguration (hDlg, CONFIG_SAVE_FULL, config, newpath);
+ DeleteConfigTree (hDlg);
config = CreateConfigStore (config, TRUE);
config = fixloadconfig (hDlg, config);
ConfigToRegistry (config, configtypepanel);
break;
case IDC_QUICKSAVE:
HandleConfiguration (hDlg, CONFIG_SAVE, config, NULL);
+ DeleteConfigTree (hDlg);
config = CreateConfigStore (config, TRUE);
config = fixloadconfig (hDlg, config);
ConfigToRegistry (config, configtypepanel);
break;
case IDC_DELETE:
HandleConfiguration (hDlg, CONFIG_DELETE, config, NULL);
+ DeleteConfigTree (hDlg);
config = CreateConfigStore (config, TRUE);
config = fixloadconfig (hDlg, config);
InitializeConfigTreeView (hDlg);
}
break;
}
+ *configp = config;
}
static INT_PTR CALLBACK LoadSaveDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG:
recursive++;
if (!configstore) {
+ DeleteConfigTree (hDlg);
CreateConfigStore (NULL, FALSE);
config = NULL;
}
if (id == IDC_SAVE || id == IDC_LOAD) {
char *s = favoritepopup (hDlg);
if (s) {
- loadsavecommands (hDlg, id, config, &cfgfile, s);
+ loadsavecommands (hDlg, id, &config, &cfgfile, s);
xfree (s);
}
}
case WM_COMMAND:
{
recursive++;
- loadsavecommands (hDlg, wParam, config, &cfgfile, NULL);
+ loadsavecommands (hDlg, wParam, &config, &cfgfile, NULL);
recursive++;
break;
}
CharFormat.yHeight = 10 * 20; /* height in twips, where a twip is 1/20th of a point - for a pt.size of 18 */
CharFormat.crTextColor = GetSysColor(COLOR_ACTIVECAPTION);
- strcpy(CharFormat.szFaceName, "Tahoma" );
+ strcpy (CharFormat.szFaceName, os_vista ? "Segoe UI" : "Tahoma");
SendDlgItemMessage(hDlg, url->id, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&CharFormat);
SendDlgItemMessage(hDlg, url->id, EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_3DFACE));
}
}
static void setautocomplete (HWND hDlg, int id)
{
- HWND item = FindWindowEx(GetDlgItem (hDlg, id), NULL, "Edit", NULL);
+ HWND item = FindWindowEx (GetDlgItem (hDlg, id), NULL, "Edit", NULL);
if (item)
SHAutoComplete (item, SHACF_FILESYSTEM | SHACF_AUTOAPPEND_FORCE_ON | SHACF_AUTOSUGGEST_FORCE_ON | SHACF_USETAB);
}
numtypes = 0;
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_RESETCONTENT, 0, 0L);
if (af_path_2005 & 1) {
- WIN32GUI_LoadUIString(IDS_DEFAULT_AF2005, tmp, sizeof tmp);
+ WIN32GUI_LoadUIString (IDS_DEFAULT_AF2005, tmp, sizeof tmp);
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
if (path_type == PATH_TYPE_NEWAF)
selpath = numtypes;
ptypes[numtypes++] = PATH_TYPE_NEWAF;
}
if (start_path_new1[0]) {
- WIN32GUI_LoadUIString(IDS_DEFAULT_NEWWINUAE, tmp, sizeof tmp);
+ WIN32GUI_LoadUIString (IDS_DEFAULT_NEWWINUAE, tmp, sizeof tmp);
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
if (path_type == PATH_TYPE_NEWWINUAE)
selpath = numtypes;
ptypes[numtypes++] = PATH_TYPE_AMIGAFOREVERDATA;
}
if (af_path_old) {
- WIN32GUI_LoadUIString(IDS_DEFAULT_AF, tmp, sizeof tmp);
+ WIN32GUI_LoadUIString (IDS_DEFAULT_AF, tmp, sizeof tmp);
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
if (path_type == PATH_TYPE_OLDAF)
selpath = numtypes;
ptypes[numtypes++] = PATH_TYPE_OLDAF;
}
- WIN32GUI_LoadUIString(IDS_DEFAULT_WINUAE, tmp, sizeof tmp);
+ WIN32GUI_LoadUIString (IDS_DEFAULT_WINUAE, tmp, sizeof tmp);
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
if (path_type == 0)
selpath = numtypes;
ptypes[numtypes++] = 0;
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_SETCURSEL, selpath, 0);
- EnableWindow(GetDlgItem (hDlg, IDC_PATHS_DEFAULTTYPE), numtypes > 0 ? TRUE : FALSE);
+ EnableWindow (GetDlgItem (hDlg, IDC_PATHS_DEFAULTTYPE), numtypes > 0 ? TRUE : FALSE);
values_to_pathsdialog (hDlg);
recursive--;
return TRUE;
case IDC_PATHS_ROMS:
fetch_path ("KickstartPath", tmp, sizeof (tmp));
if (DirectorySelection (hDlg, 0, tmp)) {
- load_keyring(&workprefs, NULL);
+ load_keyring (&workprefs, NULL);
set_path ("KickstartPath", tmp);
if (!scan_roms (1))
gui_message_id (IDS_ROMSCANNOROMS);
+Beta 3:
+
+- corrected directinput keyboard enumeration, possible fix for
+ wrong keycodes (=non-working key) on some keyboard/driver
+ combinations. (bug since the beginning, I blame really bad keyboard
+ directinput documentation)
+- Picasso96 color space conversion color errors (b2)
+- Picasso96 now always keeps aspect ratio in scaled modes
+ (both windowed and full-window)
+- window resize worked strangely in some cases
+- full-window on the fly monitor change fixed
+- disappearing mouse cursor if scaled window was smaller than original
+ Picasso96 resolution
+- detect Amiga Forever 2008 Value Edition rom key when winuae is
+ located outside of AF install directory
+- fullscreen to fullscreen non resolution/depth changes won't
+ reopen the display anymore (except D3D/OGL<>other filter change)
+- fullscreen to fullscreen resolution/depth change speed improved
+- Windowed Picasso96 scaling fixed when native mode was set to
+ fullscreen or fullwindow
+- nasty memory corruption fixed in configuration handling introduced
+ in 1.5 betas. Causes random crash or memory corruption sooner or
+ later when saving configuration few times.
Beta 2:
- "Kickstart replacement" is compatible with new KS loader
- interlace should work again in "normal" mode (no doubling or
scanlines) (broken since 1.3b2..)
+- interlace<>nonlace switching graphics problem fixed (1.5.0)
- window is now reopened only when switching to fullscreen. Every
on the fly windowed configuration change should never reopen the
window anymore.
- fixed possible crashes when switching Windows desktop resolution or
when using quick user switching (post message if there are still
problems, I rarely use these features)
-- some directdraw and direct3d handle leaks fixed
+- some directdraw and direct3d memory leaks fixed
Beta 1: (1.5.1 in few weeks)