currprefs.dfxtype[i] = changed_prefs.dfxtype[i];
reset_drive (i);
}
- if (strcmp (currprefs.df[i], changed_prefs.df[i]))
+ if (drv->dskchange_time == 0 && strcmp (currprefs.df[i], changed_prefs.df[i]))
disk_insert (i, changed_prefs.df[i]);
gui_unlock ();
if (drv->dskready_down_time > 0)
static int ievent_alive = 0;
static int lastmx, lastmy;
+static uae_u32 magicmouse_ibase = 0;
static uaecptr get_intuitionbase(void)
{
uaecptr v = get_long(4);
addrbank *b = &get_mem_bank(v);
- if (!b || !b->check(v, 128) || b->flags != ABFLAG_RAM)
+ if (!b || !b->check(v, 400) || b->flags != ABFLAG_RAM)
return 0;
v += 378; // liblist
- while ((v = get_long(v))) {
- uae_u32 v2 = get_long(v + 10); // name
+ while (v = get_long(v)) {
+ uae_u32 v2;
uae_u8 *p;
+ b = &get_mem_bank(v);
+ if (!b || !b->check (v, 32) || b->flags != ABFLAG_RAM) {
+ magicmouse_ibase = 0xffffffff;
+ return 0;
+ }
+ v2 = get_long(v + 10); // name
b = &get_mem_bank(v2);
- if (!b || !b->check (v2, 20))
- continue;
+ if (!b || !b->check (v2, 20)) {
+ magicmouse_ibase = 0xffffffff;
+ return 0;
+ }
+ if (b->flags != ABFLAG_ROM)
+ return 0;
p = b->xlateaddr(v2);
if (!strcmp(p, "intuition.library"))
return v;
extern void setmouseactivexy(int,int,int);
extern void drawing_adjust_mousepos(int*,int*);
+
static void mouseedge(void)
{
int x, y, dir;
static int melast_x, melast_y;
static int isnonzero;
- if (!currprefs.win32_outsidemouse)
+ if (!currprefs.win32_outsidemouse || magicmouse_ibase == 0xffffffff)
return;
dir = 0;
if (!mouseedge_time) {
isnonzero = 0;
goto end;
}
- ib = get_intuitionbase();
+ if (magicmouse_ibase == 0)
+ ib = get_intuitionbase();
+ else
+ ib = magicmouse_ibase;
if (!ib)
return;
x = get_word(ib + 70);
void inputdevice_reset (void)
{
ievent_alive = 0;
+ magicmouse_ibase = 0;
}
static int switchdevice(struct uae_input_device *id, int num)
static int hWndSelector = 0; /* Set this to zero to get hSockWnd */
+struct threadargs {
+ struct socketbase *sb;
+ uae_u32 args1;
+ uae_u32 args2;
+ int args3;
+ long args4;
+ char *args5;
+};
+
+struct threadargsw {
+ struct socketbase *sb;
+ uae_u32 nfds;
+ uae_u32 readfds;
+ uae_u32 writefds;
+ uae_u32 exceptfds;
+ uae_u32 timeout;
+};
+
#define MAX_SELECT_THREADS 64
#define MAX_GET_THREADS 64
static int PASCAL WSAEventSelect(SOCKET,HANDLE,long);
-struct threadargs {
- struct socketbase *sb;
- uae_u32 args1;
- uae_u32 args2;
- int args3;
- long args4;
- char *args5;
-};
-
-struct threadargsw {
- struct socketbase *sb;
- uae_u32 nfds;
- uae_u32 readfds;
- uae_u32 writefds;
- uae_u32 exceptfds;
- uae_u32 timeout;
-};
-
#define PREPARE_THREAD EnterCriticalSection(&bsd->SockThreadCS)
#define TRIGGER_THREAD { SetEvent(bsd->hSockReq); WaitForSingleObject(bsd->hSockReqHandled, INFINITE); LeaveCriticalSection(&bsd->SockThreadCS); }
static unsigned int allocasyncmsg(SB,uae_u32 sd,SOCKET s)
{
int i;
+
locksigqueue();
-
for (i = bsd->asyncindex + 1; i != bsd->asyncindex; i++) {
if (i >= MAXPENDINGASYNC)
i = 0;
-static unsigned int __stdcall sock_thread(void *blah)
+static unsigned int sock_thread2(void *blah)
{
unsigned int result = 0;
HANDLE WaitHandle;
if(bsd->hSockReq) {
DWORD wait;
WaitHandle = bsd->hSockReq;
- wait = MsgWaitForMultipleObjects (1, &WaitHandle, FALSE,INFINITE, QS_POSTMESSAGE);
+ wait = MsgWaitForMultipleObjects (1, &WaitHandle, FALSE, INFINITE, QS_POSTMESSAGE);
if (wait == WAIT_OBJECT_0) {
if(HandleStuff()) // See if its time to quit...
break;
return result;
}
+static unsigned int __stdcall sock_thread(void *p)
+{
+ __try {
+ return sock_thread2 (p);
+ } __except(WIN32_ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
+ }
+ return 0;
+}
void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 namelen)
{
TRIGGER_THREAD;
if (sb->resultval == -1) {
- if (sb->sb_errno == WSAEWOULDBLOCK-WSABASEERR && sb->ftable[sd-1] & SF_BLOCKING)
+ if (sb->sb_errno == WSAEWOULDBLOCK - WSABASEERR && sb->ftable[sd-1] & SF_BLOCKING)
{
if (sb->mtable[sd-1] || (wMsg = allocasyncmsg(sb,sd,s)) != 0) {
if (sb->mtable[sd-1] == 0) {
}
// This seems to be the only way of implementing a cancelable WinSock2 select() call... sigh.
-static unsigned int __stdcall thread_WaitSelect(void *indexp)
+static unsigned int thread_WaitSelect2(void *indexp)
{
- uae_u32 index = *((uae_u32*)indexp);
+ int index = *((int*)indexp);
unsigned int result = 0;
long nfds;
uae_u32 readfds, writefds, exceptfds;
WaitForSingleObject(bsd->hEvents[index], INFINITE);
if ((args = bsd->threadargsw[index]) != NULL) {
- sb = args->sb;
+ sb = args->sb;
nfds = args->nfds;
readfds = args->readfds;
writefds = args->writefds;
timeout = args->timeout;
// construct descriptor tables
- makesocktable(sb,readfds,&readsocks,nfds,sb->sockAbort);
+ makesocktable(sb, readfds, &readsocks, nfds, sb->sockAbort);
if (writefds)
- makesocktable(sb,writefds,&writesocks,nfds,INVALID_SOCKET);
+ makesocktable(sb, writefds, &writesocks, nfds, INVALID_SOCKET);
if (exceptfds)
- makesocktable(sb,exceptfds,&exceptsocks,nfds,INVALID_SOCKET);
+ makesocktable(sb, exceptfds, &exceptsocks, nfds, INVALID_SOCKET);
if (timeout) {
tv.tv_sec = get_long(timeout);
TRACE(("-> "));
- sb->resultval = select(nfds+1,&readsocks,writefds ? &writesocks : NULL,
- exceptfds ? &exceptsocks : NULL,timeout ? &tv : 0);
+ sb->resultval = select(nfds+1, &readsocks, writefds ? &writesocks : NULL,
+ exceptfds ? &exceptsocks : NULL, timeout ? &tv : 0);
if (sb->resultval == SOCKET_ERROR) {
// select was stopped by sb->sockAbort
if (readsocks.fd_count > 1) {
- makesocktable(sb,readfds,&readsocks,nfds,INVALID_SOCKET);
+ makesocktable(sb, readfds, &readsocks, nfds, INVALID_SOCKET);
tv.tv_sec = 0;
tv.tv_usec = 10000;
// Check for 10ms if data is available
- sb->resultval = select(nfds+1,&readsocks,writefds ? &writesocks : NULL,exceptfds ? &exceptsocks : NULL,&tv);
+ sb->resultval = select(nfds+1, &readsocks, writefds ? &writesocks : NULL,exceptfds ? &exceptsocks : NULL,&tv);
if (sb->resultval == 0) { // Now timeout -> really no data available
if (GetLastError() != 0) {
sb->resultval = SOCKET_ERROR;
return result;
}
+static unsigned int __stdcall thread_WaitSelect(void *p)
+{
+ __try {
+ return thread_WaitSelect2 (p);
+ } __except(WIN32_ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
+ }
+ return 0;
+}
+
void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, uae_u32 writefds, uae_u32 exceptfds, uae_u32 timeout, uae_u32 sigmp)
{
uae_u32 sigs, wssigs;
for (i = 0; i < MAX_SELECT_THREADS; i++) {
if (!bsd->hThreads[i]) {
bsd->hEvents[i] = CreateEvent(NULL,FALSE,FALSE,NULL);
- bsd->hThreads[i] = THREAD(thread_WaitSelect, &i);
+ bsd->hThreads[i] = THREAD(thread_WaitSelect, &threadindextable[i]);
if (bsd->hEvents[i] == NULL || bsd->hThreads[i] == NULL) {
bsd->hThreads[i] = 0;
write_log("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n",
return;
}
// this should improve responsiveness
- SetThreadPriority(bsd->hThreads[i], THREAD_PRIORITY_TIME_CRITICAL);
+ SetThreadPriority(bsd->hThreads[i], THREAD_PRIORITY_ABOVE_NORMAL);
break;
}
}
return bReturn;
}
-static unsigned int __stdcall thread_get(void *indexp)
+static unsigned int thread_get2(void *indexp)
{
int index = *((int*)indexp);
unsigned int result = 0;
buf = args->args5;
name_rp = get_real_address(name);
- if (strchr(name_rp,'.') == 0 || CheckOnline(sb) == TRUE) {
+ if (strchr(name_rp, '.') == 0 || CheckOnline(sb) == TRUE) {
// Local Address or Internet Online ?
if (addrtype == -1) {
host = gethostbyname(name_rp);
return result;
}
+static unsigned int __stdcall thread_get(void *p)
+{
+ __try {
+ return thread_get2 (p);
+ } __except(WIN32_ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
+ }
+ return 0;
+}
+
void host_gethostbynameaddr(TrapContext *context, SB, uae_u32 name, uae_u32 namelen, long addrtype)
{
HOSTENT *h;
for (i = 0; i < MAX_GET_THREADS; i++) {
if (!bsd->hGetThreads[i]) {
bsd->hEvents[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
- bsd->hGetThreads[i] = THREAD(thread_get, &i);
+ bsd->hGetThreads[i] = THREAD(thread_get, &threadindextable[i]);
if (bsd->hGetEvents[i] == NULL || bsd->hGetThreads[i] == NULL) {
bsd->hGetThreads[i] = 0;
write_log("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", GetLastError());
for (i = 0; i < MAX_GET_THREADS; i++) {
if (!bsd->hGetThreads[i]) {
bsd->hGetEvents[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
- bsd->hGetThreads[i] = THREAD(thread_get, &i);
+ bsd->hGetThreads[i] = THREAD(thread_get, &threadindextable[i]);
if (bsd->hGetEvents[i] == NULL || bsd->hGetThreads[i] == NULL) {
bsd->hGetThreads[i] = 0;
write_log("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", GetLastError());
static int normalmouse, supermouse, rawmouse, winmouse, winmousenumber, winmousemode;
static int normalkb, superkb, rawkb;
-int no_rawinput;
+int no_rawinput, dinput_enum_all;
int dinput_winmouse (void)
{
gui_message ("Failed to initialize DirectInput!");
return 0;
}
- write_log("DirectInput enumeration..\n");
- IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_ALL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+ if (dinput_enum_all) {
+ write_log("DirectInput enumeration..\n");
+ IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_ALL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+ } else {
+ write_log("DirectInput enumeration.. Keyboards..\n");
+ IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_KEYBOARD, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+ write_log("DirectInput enumeration.. Pointing devices..\n");
+ IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_POINTER, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+ write_log("DirectInput enumeration.. Game controllers..\n");
+ IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_GAMECTRL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+ }
write_log("RawInput enumeration..\n");
initialize_rawinput();
write_log("Windowsmouse initialization..\n");
ti2d_type = -1;
if (depth == 15 || depth == 16) {
if (!packed_pixels) {
- gui_message(
- "OPENGL: can't use 15/16 bit screen depths because EXT_packed_pixels\n"
- "extension was not found. Falling back to 32-bit mode");
+ sprintf(errmsg, "OPENGL: can't use 15/16 bit screen depths because\n"
+ "EXT_packed_pixels extension was not found.");
OGL_free();
- return OGL_init(ahwnd, w_w, w_h, t_w, t_h, 32);
+ return errmsg;
}
ti2d_internalformat = GL_RGB5_A1;
ti2d_format = GL_RGBA;
}
if (ti2d_type < 0) {
sprintf (errmsg, "OPENGL: Only 15, 16 or 32 bit screen depths supported (was %d)", depth);
+ OGL_free();
return errmsg;
}
2048,1536, 155,
2560,1600, 156,
2560,2048, 157,
+ 400, 300, 158,
+ 512, 384, 159,
+ 1360, 768, 160,
+ 1360,1024, 161,
+ 1400,1050, 162,
+ 1792,1344, 163,
+ 1800,1440, 164,
+ 1856,1392, 165,
+ 1920,1440, 166,
-1,-1,0
};
return 0;
if (!dxdetect())
return 0;
+ if (!os_winnt && max_allowed_mman > 256)
+ max_allowed_mman = 256;
hInst = hInstance;
hMutex = CreateMutex( NULL, FALSE, "WinUAE Instantiated" ); // To tell the installer we're running
AVIOutput_Initialize();
#endif
+ argv = xcalloc (sizeof (char*), __argc);
+ argc = process_arg(argv);
+
getstartpaths(start_data);
makeverstr(VersionStr);
SetCurrentDirectory (start_path_data);
- if (!os_winnt && max_allowed_mman > 256)
- max_allowed_mman = 256;
-
- argv = xcalloc (sizeof (char*), __argc);
- argc = process_arg(argv);
-
logging_init ();
if(WIN32_RegisterClasses() && WIN32_InitLibraries() && DirectDraw_Start(NULL)) {
#if defined(WIN64)
-static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec)
+static LONG WINAPI WIN32_ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec)
{
write_log("EVALEXCEPTION!\n");
return EXCEPTION_EXECUTE_HANDLER;
}
}
-static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec)
+LONG WINAPI WIN32_ExceptionFilter(struct _EXCEPTION_POINTERS *pExceptionPointers, DWORD ec)
{
static uae_u8 *prevpc;
LONG lRet = EXCEPTION_CONTINUE_SEARCH;
#endif
__try {
WinMain2 (hInstance, hPrevInstance, lpCmdLine, nCmdShow);
- } __except(ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
+ } __except(WIN32_ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
}
SetThreadAffinityMask(thread, original_affinity);
return FALSE;
extern void logging_open(int,int);
extern void logging_cleanup(void);
+extern LONG WINAPI WIN32_ExceptionFilter(struct _EXCEPTION_POINTERS *pExceptionPointers, DWORD ec);
#endif
\ No newline at end of file
sptr = gfxvidinfo.bufmem;
endsptr = gfxvidinfo.realbufmem + (amiga_height - 1) * 3 * gfxvidinfo.rowbytes;
- v = currprefs.gfx_filter_horiz_offset / 10;
+ v = currprefs.gfx_filter_horiz_offset;
v += (dst_width / scale - amiga_width) / 8;
- sptr += -v * (amiga_depth / 8) * 4;
- aw -= -v * 4;
+ sptr += (int)(-v * 4.0 / 10.0) * (amiga_depth / 8);
+ aw -= (int)(-v * 4.0 / 10);
- v = currprefs.gfx_filter_vert_offset / 10;
+ v = currprefs.gfx_filter_vert_offset;
v += (dst_height / scale - amiga_height) / 8;
- sptr += -v * gfxvidinfo.rowbytes * 4;
- ah -= -v * 4;
+ sptr += (int)(-v * 4.0 / 10.0) * gfxvidinfo.rowbytes;
+ ah -= (int)(-v * 4.0 / 10);
if (aw * scale > dst_width)
- aw = (dst_width / scale) & ~3;
+ aw = dst_width / scale;
if (ah * scale > dst_height)
- ah = (dst_height / scale) & ~3;
+ ah = dst_height / scale;
if (ah < 16)
return;
HKEY fkey;
SendDlgItemMessage(hDlg, IDC_FILTERHZ, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
- SendDlgItemMessage(hDlg, IDC_FILTERHZ, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERHZ, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage(hDlg, IDC_FILTERVZ, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
- SendDlgItemMessage(hDlg, IDC_FILTERVZ, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERVZ, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage(hDlg, IDC_FILTERHO, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
- SendDlgItemMessage(hDlg, IDC_FILTERHO, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERHO, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage(hDlg, IDC_FILTERVO, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
- SendDlgItemMessage(hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage(hDlg, IDC_FILTERSL, TBM_SETRANGE, TRUE, MAKELONG ( 0, +1000));
- SendDlgItemMessage(hDlg, IDC_FILTERSL, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERSL, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage(hDlg, IDC_FILTERSL2, TBM_SETRANGE, TRUE, MAKELONG ( 0, +1000));
- SendDlgItemMessage(hDlg, IDC_FILTERSL2, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERSL2, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_RESETCONTENT, 0, 0L);
uf = &uaefilters[0];
}
}
} else {
- DISK_history_add (file, -1);
strcpy (workprefs.df[drv], file);
disk_insert (drv, workprefs.df[drv]);
drv++;
void gui_message (const char *format,...)
{
char msg[2048];
- char szTitle[ MAX_DPATH ];
+ char szTitle[MAX_DPATH];
va_list parms;
int flipflop = 0;
int fullscreen = 0;
HWND hwnd;
va_start (parms, format);
- vsprintf( msg, format, parms );
+ vsprintf(msg, format, parms);
va_end (parms);
if (full_property_sheet) {
pre_gui_message (msg);
if (flipflop)
ShowWindow (hAmigaWnd, SW_MINIMIZE);
- write_log( msg );
+ write_log(msg);
if (msg[strlen(msg)-1]!='\n')
write_log("\n");
va_list parms;
va_start (parms, format);
- vsprintf( msg, format, parms );
+ vsprintf (msg, format, parms);
va_end (parms);
- write_log( msg );
+ write_log (msg);
if (msg[strlen(msg)-1]!='\n')
write_log("\n");
WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH);
strcat (szTitle, BetaStr);
- MessageBox (guiDlg, msg, szTitle, MB_OK | MB_TASKMODAL | MB_SETFOREGROUND );
+ MessageBox (guiDlg, msg, szTitle, MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
}
+Beta 2:
+
+- filter zoom and position is not restricted to coordinates divisible
+ by 4 pixels anymore
+- datapath command line parameter fixed (broke in 1.3.4b9)
+- enumerate only known DirectInput devices types (keyboards, pointers
+ and game controllers), apparently there are some broken DI compatible
+ "unknown" devices that crash DirectInput's internal enumeration code..
+- "magic mouse" related freezes fixed
+- dragndrop disk insert fixed (again..)
+- added more Picasso96 modes to "unique" mode list
+
Beta 1: Lots of scary options. Do not touch!
- added new misc configuration options "(handled in previous versions)"