return 0;
if (doublescan <= 0) {
- if ((w >> currprefs.gfx_resolution) < MIN_DISPLAY_W)
+ if ((w >> currprefs.gfx_resolution) < MIN_DISPLAY_W) {
+ dx += (w - (MIN_DISPLAY_W << currprefs.gfx_resolution)) / 2;
w = MIN_DISPLAY_W << currprefs.gfx_resolution;
+ }
if ((h >> dbl1) < MIN_DISPLAY_H) {
- if (gcloh > MIN_DISPLAY_H)
+ if (gcloh > MIN_DISPLAY_H) {
h = gcloh;
- else
+ } else {
+ dy += (h - (MIN_DISPLAY_H << dbl1)) / 2;
h = MIN_DISPLAY_H << dbl1;
+ }
}
if ((w >> currprefs.gfx_resolution) > MAX_DISPLAY_W) {
dx += (w - (MAX_DISPLAY_W << currprefs.gfx_resolution)) / 2;
/* ticks past minute @ 50Hz */
t -= diff;
+ if (t < 0)
+ t = 0;
*days = t / secs_per_day;
t -= *days * secs_per_day;
*mins = t / 60;
put_time (long days, long mins, long ticks)
{
time_t t;
+
+ if (days < 0)
+ days = 0;
+ if (days > 9900 * 365)
+ days = 9900 * 365; // in future far enough?
+ if (mins < 0 || mins >= 24 * 60)
+ mins = 0;
+ if (ticks < 0 || ticks >= 60 * 50)
+ ticks = 0;
+
t = ticks / 50;
t += mins * 60;
- t += days * secs_per_day;
+ t += ((uae_u64)days) * secs_per_day;
t += diff;
return t;
if (fsdb_cando (unit)) {
commented = bstr (unit, comment);
+ if (_tcslen (commented) > 80) {
+ PUT_PCK_RES1 (packet, DOS_FALSE);
+ PUT_PCK_RES2 (packet, ERROR_COMMENT_TOO_BIG);
+ return;
+ }
if (_tcslen (commented) > 0) {
TCHAR *p = commented;
commented = xmalloc (81 * sizeof (TCHAR));
return;
}
- ut.actime = ut.modtime = put_time(get_long (date), get_long (date + 4),
+ ut.actime = ut.modtime = put_time (get_long (date), get_long (date + 4),
get_long (date + 8));
a = find_aino (unit, lock, bstr (unit, name), &err);
if (err == 0 && utime (a->nname, &ut) == -1)
static void filesys_prepare_reset2 (void)
{
UnitInfo *uip;
- Unit *u;
+// Unit *u;
int i;
uip = mountinfo.ui;
#define ERROR_DIRECTORY_NOT_EMPTY 216
#define ERROR_DEVICE_NOT_MOUNTED 218
#define ERROR_SEEK_ERROR 219
+#define ERROR_COMMENT_TOO_BIG 220
#define ERROR_DISK_IS_FULL 221
#define ERROR_DELETE_PROTECTED 222
#define ERROR_WRITE_PROTECTED 223
TCHAR d_name[1];
};
#include <sys/utime.h>
-#define utimbuf _utimbuf
+#define utimbuf __utimbuf64
#define USE_ZFILE
#undef S_ISDIR
extern void uae_restart (int, TCHAR*);
extern void reset_all_systems (void);
extern void target_reset (void);
+extern void target_addtorecent (const TCHAR*, int);
extern int quit_program;
extern void fetch_screenshotpath (TCHAR *out, int size);
extern void fetch_ripperpath (TCHAR *out, int size);
extern void fetch_datapath (TCHAR *out, int size);
-extern int uaerand(void);
\ No newline at end of file
+extern int uaerand(void);
int quit_program = 0;
static int restart_program;
-static TCHAR restart_config[256];
+static TCHAR restart_config[MAX_DPATH];
void uae_reset (int hardreset)
{
static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HANDLE hdata;
- LPTSTR lptstr;
+ LPWSTR lptstr;
TCHAR allowed[] = L"1234567890abcdefABCDEF";
int ok = 1;
TCHAR addrstr[12];
case WM_PASTE:
if (!OpenClipboard(NULL))
return TRUE;
- hdata = GetClipboardData(CF_TEXT);
+ hdata = GetClipboardData(CF_UNICODETEXT);
if (hdata) {
lptstr = GlobalLock(hdata);
if (lptstr) {
{
TCHAR addrstr[11] = { '0', 'x', '\0' };
- SendMessage(GetDlgItem(hDlg, IDC_DBG_MEMINPUT2), WM_GETTEXT, 9, (LPARAM)addrstr + 2);
+ SendMessage(GetDlgItem(hDlg, IDC_DBG_MEMINPUT2), WM_GETTEXT, 9, (LPARAM)(addrstr + 2));
if (addrstr[2] != 0) {
uae_u32 addr = _tcstoul(addrstr, NULL, 0);
if (dbgpage[currpage].selection == IDC_DBG_MEM || dbgpage[currpage].selection == IDC_DBG_MEM2) {
static void CopyListboxText(HWND hwnd, BOOL all)
{
HANDLE hdata;
- LPTSTR lptstr;
+ LPWSTR lptstr;
int i, count, start, end, size = 0;
if (!OpenClipboard(hwnd))
for (i = start; i < end; i++)
size += (SendMessage(hwnd, LB_GETTEXTLEN, i, 0) + 2);
size++;
- hdata = GlobalAlloc(GMEM_MOVEABLE, size);
+ hdata = GlobalAlloc(GMEM_MOVEABLE, size * sizeof (TCHAR));
if (hdata) {
int pos = 0;
lptstr = GlobalLock(hdata);
lptstr += (len + 2);
}
GlobalUnlock(hdata);
- SetClipboardData(CF_TEXT, hdata);
+ SetClipboardData(CF_UNICODETEXT, hdata);
}
CloseClipboard();
}
static LRESULT CALLBACK ListboxEditProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HANDLE hdata;
- LPTSTR lptstr;
+ LPWSTR lptstr;
TCHAR allowed[] = L"1234567890abcdefABCDEF ";
int ok = 1, id;
WNDPROC oldproc;
case WM_PASTE:
if (!OpenClipboard(NULL))
return TRUE;
- hdata = GetClipboardData(CF_TEXT);
+ hdata = GetClipboardData(CF_UNICODETEXT);
if (hdata) {
lptstr = GlobalLock(hdata);
if (lptstr) {
}
}
-static TCHAR *rawkeyboardlabels[] =
+static TCHAR *rawkeyboardlabels[256] =
{
L"ESCAPE",
L"1",L"2",L"3",L"4",L"5",L"6",L"7",L"8",L"9",L"0",
L"NULOCK",L"SCROLL",L"NUMPAD7",L"NUMPAD8",L"NUMPAD9",L"SUBTRACT",
L"NUMPAD4",L"NUMPAD5",L"NUMPAD6",L"ADD",L"NUMPAD1",L"NUMPAD2",L"NUMPAD3",L"NUMPAD0",
L"DECIMAL",NULL,NULL,L"OEM_102",L"F11",L"F12",
- NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ L"F13",L"F14",L"F15",L"F16",NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
-
#include <windows.h>
#include "sysconfig.h"
#include "sysdeps.h"
static int t_depth;
static int required_sl_texture_w, required_sl_texture_h;
static int vsync2, guimode;
+static int needclear;
#define D3DFVF_TLVERTEX D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1
struct TLVERTEX {
RECT sr, dr, zr;
float w, h;
float dw, dh;
+ static RECT sro, dro, zro;
// write_log (L"%dx%d %dx%d %dx%d\n", twidth, theight, tin_w, tin_h, window_w, window_h);
dw * tin_w / window_w,
dh * tin_h / window_h,
1.0f);
+
+ if (memcmp (&sr, &sro, sizeof (RECT)) || memcmp (&dr, &dro, sizeof (RECT)) || memcmp (&zr, &zro, sizeof (RECT))) {
+ needclear = 1;
+ sro = sr;
+ dro = dr;
+ zro = zr;
+ }
}
static void createvertex (void)
setupscenecoords ();
settransform ();
hr = IDirect3DDevice9_BeginScene (d3ddev);
- if (clear)
- hr = IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
+ if (clear || needclear) {
+ hr = IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0L );
+ if (FAILED (hr))
+ write_log (L"IDirect3DDevice9_Clear() failed: %s\n", D3D_ErrorString (hr));
+ needclear = 0;
+ }
if (psActive) {
UINT uPasses, uPass;
LPDIRECT3DSURFACE9 lpRenderTarget;
RECT r;
hr = IDirect3DTexture9_UnlockRect (texture, 0);
- r.left = 0; r.right = twidth;
- r.top = 0; r.bottom = theight;
+ r.left = 0; r.right = window_w;
+ r.top = 0; r.bottom = window_h;
hr = IDirect3DTexture9_AddDirtyRect (texture, &r);
D3D_render2 (0);
case ERROR_FILE_NOT_FOUND:
case ERROR_INVALID_DRIVE:
case ERROR_INVALID_NAME:
+ case ERROR_PATH_NOT_FOUND:
return ERROR_OBJECT_NOT_AROUND;
case ERROR_HANDLE_DISK_FULL:
default:
{
- uae_u8 *p = 0;
- *p = 0;
gui_message (L"Unimplemented error %d\nContact author!", e);
}
return ERROR_NOT_IMPLEMENTED;
{
FILETIME LocalFileTime, FileTime;
HANDLE hFile;
- int success;
+
if ((hFile = CreateFile (name, GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL)) == INVALID_HANDLE_VALUE)
return 0;
- *(__int64 *)&LocalFileTime = (((__int64)(377*365+91+days)*(__int64)1440+(__int64)minute)*(__int64)(60*50)+(__int64)tick)*(__int64)200000;
+ for (;;) {
+ ULARGE_INTEGER lft;
- if (tolocal) {
- if (!LocalFileTimeToFileTime (&LocalFileTime,&FileTime))
+ lft.QuadPart = (((uae_u64)(377*365+91+days)*(uae_u64)1440+(uae_u64)minute)*(uae_u64)(60*50)+(uae_u64)tick)*(uae_u64)200000;
+ LocalFileTime.dwHighDateTime = lft.HighPart;
+ LocalFileTime.dwLowDateTime = lft.LowPart;
+ if (tolocal) {
+ if (!LocalFileTimeToFileTime (&LocalFileTime, &FileTime))
+ FileTime = LocalFileTime;
+ } else {
FileTime = LocalFileTime;
- } else {
- FileTime = LocalFileTime;
+ }
+ if (!SetFileTime (hFile, &FileTime, &FileTime, &FileTime)) {
+ if (days > 47846) { // > 2108-12-31 (fat limit)
+ days = 47846;
+ continue;
+ }
+ if (days < 730) { // < 1980-01-01 (fat limit)
+ days = 730;
+ continue;
+ }
+ }
+ break;
}
- success = SetFileTime (hFile,&FileTime,&FileTime,&FileTime);
CloseHandle (hFile);
- return success;
+ return 1;
}
int posixemu_utime (const TCHAR *name, struct utimbuf *ttime)
if (setfiletime (name, days, mins, ticks, tolocal))
result = 0;
- return result;
+ return result;
}
void uae_sem_init (uae_sem_t * event, int manual_reset, int initial_state)
struct sound_device *sd;
int num;
int i, j;
- TCHAR tmp[MAX_DPATH];
+ TCHAR tmp[MAX_DPATH], *s1, *s2;
num = Pa_GetDeviceCount ();
for (j = 0; j < num; j++) {
}
if (i >= MAX_SOUND_DEVICES)
return;
- _stprintf (tmp, L"[%s] %s", hai->name, di->name);
+ s1 = au (hai->name);
+ s2 = au (di->name);
+ _stprintf (tmp, L"[%s] %s", s1, s2);
+ xfree (s2);
+ xfree (s1);
sd->type = SOUND_DEVICE_PA;
sd->name = my_strdup (tmp);
sd->cfgname = my_strdup (tmp);
{
HMODULE hm = WIN32_LoadLibrary (L"portaudio_x86.dll");
if (hm) {
+ TCHAR *s;
PaError err;
write_log (L"Enumerating PortAudio devices..\n");
- write_log (L"%s (%d)\n", Pa_GetVersionText (), Pa_GetVersion ());
- err = Pa_Initialize ();
- if (err == paNoError) {
- PortAudioEnumerate (sound_devices);
+ s = au (Pa_GetVersionText ());
+ write_log (L"%s (%d)\n", s, Pa_GetVersion ());
+ xfree (s);
+ if (Pa_GetVersion () >= 1899) {
+ err = Pa_Initialize ();
+ if (err == paNoError) {
+ PortAudioEnumerate (sound_devices);
+ } else {
+ s = au (Pa_GetErrorText (err));
+ write_log (L"Portaudio initializiation failed: %d (%s)\n",
+ err, s);
+ xfree (s);
+ FreeLibrary (hm);
+ }
} else {
- write_log (L"Portaudio initializiation failed: %d (%s)\n",
- err, Pa_GetErrorText (err));
- FreeLibrary (hm);
+ write_log (L"Too old PortAudio library\n");
+ FreeLibrary (hm);
}
}
}
#include "sysconfig.h"
-#define _WIN32_WINNT 0x600 /* XButtons + MOUSEHWHEEL */
+#define _WIN32_WINNT 0x700 /* XButtons + MOUSEHWHEEL=XP, Jump List=Win7 */
#include <windows.h>
#include <commctrl.h>
pSetCurrentProcessExplicitAppUserModelID = (SETCURRENTPROCESSEXPLICITAPPUSERMODEIDD)GetProcAddress (
GetModuleHandle (L"shell32.dll"), "SetCurrentProcessExplicitAppUserModelID");
if (pSetCurrentProcessExplicitAppUserModelID)
- pSetCurrentProcessExplicitAppUserModelID (L"Arabuusimiehet.WinUAE");
+ pSetCurrentProcessExplicitAppUserModelID (WINUAEAPPNAME);
hRichEdit = LoadLibrary (L"RICHED32.DLL");
return 1;
const TCHAR *description, const TCHAR *ext2)
{
TCHAR rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH];
- HKEY rkey, key1;
+ HKEY rkey, key1, key2;
DWORD disposition;
const TCHAR *progid = L"WinUAE";
int def = !_tcscmp (extension, L".uae");
+ TCHAR *defprogid;
UAEREG *fkey;
_tcscpy (progid2, progid);
rkey = HKEY_LOCAL_MACHINE;
else
rkey = HKEY_CURRENT_USER;
+ defprogid = def ? progid : progid2;
_tcscpy (rpath1, L"Software\\Classes\\");
_tcscpy (rpath2, rpath1);
_tcscat (rpath2, extension);
if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
- RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)(def ? progid : progid2), (_tcslen (def ? progid : progid2) + 1) * sizeof (TCHAR));
+ RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR));
if (perceivedtype)
RegSetValueEx (key1, L"PerceivedType", 0, REG_SZ, (CONST BYTE *)perceivedtype, (_tcslen (perceivedtype) + 1) * sizeof (TCHAR));
RegCloseKey (key1);
if (!def)
_tcscat (rpath2, ext2 ? ext2 : extension);
if (description) {
- if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
+ if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
+ TCHAR tmp[MAX_DPATH];
RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)description, (_tcslen (description) + 1) * sizeof (TCHAR));
+ RegSetValueEx (key1, L"AppUserModelID", 0, REG_SZ, (CONST BYTE *)WINUAEAPPNAME, (_tcslen (WINUAEAPPNAME) + 1) * sizeof (TCHAR));
+ _tcscpy (tmp, rpath2);
+ _tcscat (tmp, L"\\CurVer");
+ if (RegCreateKeyEx (rkey, tmp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key2, &disposition) == ERROR_SUCCESS) {
+ RegSetValueEx (key2, L"", 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR));
+ RegCloseKey (key2);
+ }
+ _tcscpy (tmp, rpath2);
+ _tcscat (tmp, L"\\DefaultIcon");
+ if (RegCreateKeyEx (rkey, tmp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key2, &disposition) == ERROR_SUCCESS) {
+ _stprintf (tmp, L"%s,-1", _wpgmptr);
+ RegSetValueEx (key2, L"", 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR));
+ RegCloseKey (key2);
+ }
RegCloseKey (key1);
}
}
TCHAR tmp[MAX_DPATH];
int fd, ok, added;
+ *xargv3 = NULL;
argv = parseargstring (cmdline);
if (argv == NULL)
return 0;
#endif
argv = xcalloc (sizeof (TCHAR*), 32);
+ argv3 = NULL;
argc = process_arg (lpCmdLine, argv, &argv3);
argv2 = WIN32_InitRegistry (argv);
logging_init ();
if (_tcslen (lpCmdLine) > 0)
write_log (L"'%s'\n", lpCmdLine);
- if (argv3[0]) {
+ if (argv3 && argv3[0]) {
write_log (L"params:\n");
for (i = 0; argv3[i]; i++)
write_log (L"%d: '%s'\n", i + 1, argv3[i]);
return 1;
}
+typedef HRESULT (CALLBACK* SHCREATEITEMFROMPARSINGNAME)
+ (PCWSTR,IBindCtx*,REFIID,void**); // Vista+ only
+
+
+void target_addtorecent (const TCHAR *name, int t)
+{
+ if (os_win7) {
+ SHCREATEITEMFROMPARSINGNAME pSHCreateItemFromParsingName;
+ SHARDAPPIDINFO shard;
+ pSHCreateItemFromParsingName = (SHCREATEITEMFROMPARSINGNAME)GetProcAddress (
+ GetModuleHandle (L"shell32.dll"), "SHCreateItemFromParsingName");
+ if (!pSHCreateItemFromParsingName)
+ return;
+ shard.pszAppID = WINUAEAPPNAME;
+ if (SUCCEEDED (pSHCreateItemFromParsingName (name, NULL, &IID_IShellItem, &shard.psi))) {
+ SHAddToRecentDocs (SHARD_APPIDINFO, &shard);
+ IShellItem_Release (shard.psi);
+ }
+ } else {
+ SHAddToRecentDocs (SHARD_PATH, name);
+ }
+}
+
+
void target_reset (void)
{
clipboard_reset ();
#define WINUAEPUBLICBETA 1
-#define WINUAEBETA L"18"
-#define WINUAEDATE MAKEBD(2009, 3, 25)
+#define WINUAEBETA L"19"
+#define WINUAEDATE MAKEBD(2009, 3, 28)
#define WINUAEEXTRA L""
#define WINUAEREV L""
#define IHF_WINDOWHIDDEN 6
#define NORMAL_WINDOW_STYLE (WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX)
+#define WINUAEAPPNAME L"Arabuusimiehet.WinUAE"
extern HMODULE hUIDLL;
extern HWND hAmigaWnd, hMainWnd, hHiddenWnd, hGUIWnd;
extern RECT amigawin_rect;
<Paths> can be path to a configuration file, any supported floppy
disk image file or statefile, multiple paths supported, path
parsing stops when first parameter beginning with '-' or '/' is
- detected. Now manually created Windows file extension mappings work
- as expected. Automatically disables "show gui on startup".
+ detected. Automatically disables "show gui on startup".
- improved configuration parsing, now for example something="path"
and command line -something="path" works, previously " (or ')
- were not accepted
-- clear dsound buffer when sound autodeactivates, there could have
- been some old sound data left if buffer size is really big
+ was not parsed properly
+- clear dsound buffer when sound autodeactivates, it was possible to
+ have some old sound data left in buffer if buffer size is really big
+- gui debugger clipboard and enter address option fixed (b15)
+- autoscaled screen was off center if display size was too small
+- directory filesystem "unimplemented error 3" fix
+- directory filesystem "unimplemented error 87" when setting file/dir
+ datestamp and drive is in FAT partition (FAT date range is not as
+ large as Amiga supported date range, AmigaDOS minimum date is
+ 1978-01-01, FAT minimum is 1980-01-01)
+- directory filesystem date underflow fixed, host-side date earlier
+ than 1978-01-01 caused underflow, result usually was date in
+ far future.. (bug since the beginning most likely)
+- updated directory filesystem date calculations to 64-bit
+- directory filesystem ERROR_COMMENT_TOO_BIG implemented
+- PortAudio works again, also accept only v1899 or newer library
+- clear D3D filter screen when autoscale settings change
+- added F13-F16 to rawkeyboard keycode array
Beta 18:
restore_blitter_finish ();
restore_akiko_finish ();
restore_p96_finish ();
+ target_addtorecent (filename, 0);
return;
error: