]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1510rc4.zip
authorToni Wilen <twilen@winuae.net>
Sat, 9 Aug 2008 16:16:18 +0000 (19:16 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:42:28 +0000 (21:42 +0200)
12 files changed:
cfgfile.c
custom.c
include/custom.h
include/drawing.h
include/inputdevice.h
inputdevice.c
od-win32/dinput.c
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuaechangelog.txt

index 414eb91a20f5964a434a1bf9465363a2c9572d57..2e7258f83a23b56f5d85db634250503196e11bd6 100755 (executable)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -3390,8 +3390,8 @@ static int bip_a1200 (struct uae_prefs *p, int config, int compa, int romcheck)
 
     buildin_default_prefs_68020 (p);
     roms[0] = 11;
-    roms[1] = 31;
-    roms[2] = 15;
+    roms[1] = 15;
+    roms[2] = 31;
     roms[3] = -1;
     p->cs_rtc = 0;
     if (config == 1) {
index 3a1715cc7ed4416cab22ebb86df8ce9fd9f07e8e..04bf01f3d7e454a48bacf9128ad794342ee9432a 100755 (executable)
--- a/custom.c
+++ b/custom.c
@@ -8,17 +8,6 @@
   * Copyright 2000-2008 Toni Wilen
   */
 
-//#define CUSTOM_DEBUG
-#define SPRITE_DEBUG 0
-#define SPRITE_DEBUG_MINY 0xb0
-#define SPRITE_DEBUG_MAXY 0xf8
-#define SPR0_HPOS 0x15
-#define MAX_SPRITES 8
-#define SPRITE_COLLISIONS
-#define SPEEDUP
-
-#define SPRBORDER 0
-
 #include "sysconfig.h"
 #include "sysdeps.h"
 
 #include "a2091.h"
 #include "ncr_scsi.h"
 
+//#define CUSTOM_DEBUG
+#define SPRITE_DEBUG 0
+#define SPRITE_DEBUG_MINY 0xb0
+#define SPRITE_DEBUG_MAXY 0xf8
+#ifdef NEWHSYNC
+#define SPR0_HPOS 0x19
+#else
+#define SPR0_HPOS 0x15
+#endif
+#define MAX_SPRITES 8
+#define SPRITE_COLLISIONS
+#define SPEEDUP
+
+#define SPRBORDER 0
+
 void magic_centering (uae_u16, uae_u16, int);
 
 STATIC_INLINE int nocustom(void)
@@ -571,9 +575,14 @@ STATIC_INLINE int GET_PLANES_LIMIT (uae_u16 bc0)
     return real_bitplane_number[fetchmode][res][planes];
 }
 
+#ifdef NEWHSYNC
+#define HARD_DDF_STOP 0xd8
+#define HARD_DDF_START 0x14
+#else
 /* The HRM says 0xD8, but that can't work... */
 #define HARD_DDF_STOP 0xd4
 #define HARD_DDF_START 0x18
+#endif
 
 static void add_modulos (void)
 {
@@ -654,12 +663,12 @@ static int cycle_diagram_total_cycles[3][3][9];
 static int *curr_diagram;
 static const int cycle_sequences[3 * 8] = { 2,1,2,1,2,1,2,1, 4,2,3,1,4,2,3,1, 8,4,6,2,7,3,5,1 };
 
-static void debug_cycle_diagram(void)
+static void debug_cycle_diagram (void)
 {
     int fm, res, planes, cycle, v;
     char aa;
 
-    for (fm = 0; fm < 3; fm++) {
+    for (fm = 0; fm <= 2; fm++) {
        write_log ("FMODE %d\n=======\n", fm);
        for (res = 0; res <= 2; res++) {
            for (planes = 0; planes <= 8; planes++) {
@@ -678,7 +687,7 @@ static void debug_cycle_diagram(void)
     fm=0;
 }
 
-static void create_cycle_diagram_table(void)
+static void create_cycle_diagram_table (void)
 {
     int fm, res, cycle, planes, rplanes, v;
     int fetch_start, max_planes, freecycles;
@@ -2493,6 +2502,10 @@ static void calcdiw (void)
 
     plfstrt = ddfstrt;
     plfstop = ddfstop;
+#ifdef NEWHSYNC
+    plfstrt += 4;
+    plfstop += 4;
+#endif
     /* probably not the correct place.. */
     if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) {
        /* ECS/AGA and ddfstop > maxhpos == always-on display */
@@ -3641,8 +3654,13 @@ static void COLOR_WRITE (int hpos, uae_u16 v, int num)
 
 STATIC_INLINE int copper_cant_read (int hpos)
 {
+#ifdef NEWHSYNC
+    if (hpos == 0)
+       return 1;
+#else
     if (hpos + 1 >= maxhpos)
        return 1;
+#endif
     return is_bitplane_dma_inline (hpos);
 }
 
@@ -4557,10 +4575,17 @@ static void hsync_handler (void)
     if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) {
        decide_blitter (hpos);
        memset (cycle_line, 0, sizeof cycle_line);
+#ifdef NEWHSYNC
+       alloc_cycle (5, CYCLE_REFRESH); /* strobe */
+       alloc_cycle (7, CYCLE_REFRESH);
+       alloc_cycle (9, CYCLE_REFRESH);
+       alloc_cycle (11, CYCLE_REFRESH);
+#else
        alloc_cycle (1, CYCLE_REFRESH); /* strobe */
        alloc_cycle (3, CYCLE_REFRESH);
        alloc_cycle (5, CYCLE_REFRESH);
        alloc_cycle (7, CYCLE_REFRESH);
+#endif
     }
 #endif
 
@@ -4594,11 +4619,11 @@ static void hsync_handler (void)
        audio_hsync (1);
 
     if (!nocustom()) {
-       if (!currprefs.blitter_cycle_exact && bltstate != BLT_done && dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop)
+       if (!currprefs.blitter_cycle_exact && bltstate != BLT_done && dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop) {
            blitter_slowdown (thisline_decision.plfleft, thisline_decision.plfright - (16 << fetchmode),
-               cycle_diagram_total_cycles[fmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)],
-               cycle_diagram_free_cycles[fmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)]);
-
+               cycle_diagram_total_cycles[fetchmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)],
+               cycle_diagram_free_cycles[fetchmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)]);
+       }
        hardware_line_completed (next_lineno);
     }
 
index f6cbc25c8fc1f6bf4a55ee546fbc4f07028e57b4..d43d5c2ac3ee5a5753cb41aa26f38297a23b10a8 100755 (executable)
@@ -14,7 +14,7 @@
 #define CSMASK_ECS_DENISE 2
 #define CSMASK_AGA 4
 
-uae_u32 get_copper_address(int copno);
+uae_u32 get_copper_address (int copno);
 
 extern int custom_init (void);
 extern void customreset (int hardreset);
@@ -105,7 +105,7 @@ extern uae_u16 INTREQR (void);
 extern int maxhpos, maxvpos, maxvpos_max, minfirstline, vblank_endline, numscrlines;
 extern int vblank_hz, fake_vblank_hz, vblank_skip, doublescan;
 extern frame_time_t syncbase;
-#define NUMSCRLINES (maxvpos+1-minfirstline+1)
+#define NUMSCRLINES (maxvpos + 1 - minfirstline + 1)
 
 #define DMA_AUD0      0x0001
 #define DMA_AUD1      0x0002
index ea49b459d4e014f46d87db019954c51b2774c196..836612bf0a45c938a1615cda155ad1bae00208dc 100755 (executable)
 #define MAX_PLANES 6
 #endif
 
+//#define NEWHSYNC
+
+#ifdef NEWHSYNC
+#define DIW_DDF_OFFSET 9
+/* this many cycles starting from hpos=0 are visible on right border */
+#define HBLANK_OFFSET 13
+#define DISPLAY_LEFT_SHIFT 0x40
+#else
 /* According to the HRM, pixel data spends a couple of cycles somewhere in the chips
    before it appears on-screen.  */
 #define DIW_DDF_OFFSET 9
 /* this many cycles starting from hpos=0 are visible on right border */
 #define HBLANK_OFFSET 9
-
 /* We ignore that many lores pixels at the start of the display. These are
  * invisible anyway due to hardware DDF limits. */
 #define DISPLAY_LEFT_SHIFT 0x40
+#endif
+
 #define PIXEL_XPOS(HPOS) (((HPOS)*2 - DISPLAY_LEFT_SHIFT + DIW_DDF_OFFSET - 1) << lores_shift)
 
 #define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1))
index df61d2cdf14fb3a743082ffaa85ae1e2f1fae385..65d3de867d702a74afb8d6c957001238ccb8f512 100755 (executable)
@@ -127,6 +127,7 @@ extern void write_inputdevice_config (struct uae_prefs *p, struct zfile *f);
 extern void read_inputdevice_config (struct uae_prefs *p, char *option, char *value);
 extern void reset_inputdevice_config (struct uae_prefs *pr);
 extern int inputdevice_joyport_config (struct uae_prefs *p, char *value, int portnum, int type);
+extern int inputdevice_getjoyportdevice (int jport);
 
 extern void inputdevice_init (void);
 extern void inputdevice_close (void);
index 16560e37fa6c040472faba797b090986b12de787..23c2130e93d0d73994503256d349c620b9c86f1a 100755 (executable)
@@ -3,7 +3,7 @@
   *
   * joystick/mouse emulation
   *
-  * Copyright 2001-2007 Toni Wilen
+  * Copyright 2001-2008 Toni Wilen
   *
   * new fetures:
   * - very configurable (and very complex to configure :)
@@ -1770,7 +1770,6 @@ int handle_custom_event (char *custom)
            while (*nextp == ' ')
                nextp++;
        }
-       write_log ("'%s'\n", p);
        cfgfile_parse_line (&changed_prefs, p, 0);
        p = nextp;
     }
@@ -2423,6 +2422,8 @@ static void matchdevices (struct inputdevice_functions *inf, struct uae_input_de
                            match = j;
                    }
                }
+               if (match == -2)
+                   break;
            }
        }
        // multiple matches -> use complete local-only id string for comparisons
@@ -2539,6 +2540,18 @@ void inputdevice_updateconfig (struct uae_prefs *prefs)
 void inputdevice_devicechange (struct uae_prefs *prefs)
 {
     int acc = input_acquired;
+    int i, idx;
+    char *jports[2];
+
+    for (i = 0; i < 2; i++) {
+       jports[i] = 0;
+       idx = inputdevice_getjoyportdevice (prefs->jports[i].id) - JSEM_LASTKBD;
+       if (idx >= 0) {
+           struct inputdevice_functions *idf = getidf (idx);
+           int devidx = inputdevice_get_device_index (idx);
+           jports[i] = my_strdup (idf->get_uniquename (devidx));
+       }
+    }
 
     inputdevice_unacquire ();
     idev[IDTYPE_JOYSTICK].close ();
@@ -2547,15 +2560,21 @@ void inputdevice_devicechange (struct uae_prefs *prefs)
     idev[IDTYPE_JOYSTICK].init ();
     idev[IDTYPE_MOUSE].init ();
     idev[IDTYPE_KEYBOARD].init ();
-    if (prefs == &currprefs) {
-       inputdevice_copyconfig (&changed_prefs, &currprefs);
-       if (acc)
-           inputdevice_acquire (TRUE);
-    } else {
-       matchdevices (&idev[IDTYPE_MOUSE], mice);
-       matchdevices (&idev[IDTYPE_JOYSTICK], joysticks);
-       matchdevices (&idev[IDTYPE_KEYBOARD], keyboards);
+    matchdevices (&idev[IDTYPE_MOUSE], mice);
+    matchdevices (&idev[IDTYPE_JOYSTICK], joysticks);
+    matchdevices (&idev[IDTYPE_KEYBOARD], keyboards);
+
+    for (i = 0; i < 2; i++) {
+       freejport (prefs, i);
+       if (jports[i])
+           inputdevice_joyport_config (prefs, jports[i], i, 2);
+       xfree (jports[i]);
     }
+
+    if (prefs == &changed_prefs)
+       inputdevice_copyconfig (&changed_prefs, &currprefs);
+    if (acc)
+        inputdevice_acquire (TRUE);
 }
 
 static void set_kbr_default (struct uae_prefs *p, int index, int num)
@@ -3481,4 +3500,27 @@ int inputdevice_joyport_config (struct uae_prefs *p, char *value, int portnum, i
        break;
     }
     return 0;
-}
\ No newline at end of file
+}
+
+int inputdevice_getjoyportdevice (int jport)
+{
+    int idx;
+    if (jport < 0) {
+       idx = -1;
+    } else if (jport >= JSEM_MICE) {
+        idx = jport - JSEM_MICE;
+        if (idx >= inputdevice_get_device_total (IDTYPE_MOUSE))
+           idx = 0;
+       else
+           idx += inputdevice_get_device_total (IDTYPE_JOYSTICK);
+       idx += JSEM_LASTKBD;
+    } else if (jport >= JSEM_JOYS) {
+        idx = jport - JSEM_JOYS;
+        if (idx >= inputdevice_get_device_total (IDTYPE_JOYSTICK))
+           idx = 0;
+       idx += JSEM_LASTKBD;
+    } else {
+        idx = jport - JSEM_KBDLAYOUT;
+    }
+    return idx;
+}
index 0faf77b1261bc01be79a733ac4743c3cf20b207a..f0e29e944c956f725c25328025de7cc0ecf05158 100755 (executable)
@@ -57,7 +57,6 @@
 
 struct didata {
     int type;
-    int disabled;
     int acquired;
     int priority;
     int superdevice;
@@ -800,7 +799,7 @@ static void handle_rawinput_2 (RAWINPUT *raw)
 
        for (num = 0; num < num_mouse; num++) {
            did = &di_mouse[num];
-           if (!did->disabled && did->rawinput == raw->header.hDevice)
+           if (did->rawinput == raw->header.hDevice)
                break;
        }
 #ifdef DI_DEBUG_RAWINPUT
@@ -874,7 +873,7 @@ static void handle_rawinput_2 (RAWINPUT *raw)
 #if 0
        for (num = 0; num < num_keyboard; num++) {
            did = &di_keyboard[num];
-           if (!did->disabled && (did->acquired || rawkeyboard > 0) && did->rawinput == raw->header.hDevice)
+           if ((did->acquired || rawkeyboard > 0) && did->rawinput == raw->header.hDevice)
                break;
        }
        if (num == num_keyboard) {
@@ -1216,7 +1215,7 @@ static BOOL CALLBACK di_enumcallback (LPCDIDEVICEINSTANCE lpddi, LPVOID *dd)
        sprintf(did->name, "[no name]");
     }
     trimws (did->name);
-    sprintf (tmp, "%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02",
+    sprintf (tmp, "%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X",
        lpddi->guidProduct.Data1, lpddi->guidProduct.Data2, lpddi->guidProduct.Data3,
        lpddi->guidProduct.Data4[0], lpddi->guidProduct.Data4[1], lpddi->guidProduct.Data4[2], lpddi->guidProduct.Data4[3],
        lpddi->guidProduct.Data4[4], lpddi->guidProduct.Data4[5], lpddi->guidProduct.Data4[6], lpddi->guidProduct.Data4[7],
@@ -1241,15 +1240,29 @@ static BOOL CALLBACK di_enumcallback (LPCDIDEVICEINSTANCE lpddi, LPVOID *dd)
 extern HINSTANCE hInst;
 static LPDIRECTINPUT8 g_lpdi;
 
+
+static void di_dev_free (struct didata *did)
+{
+    if (did->lpdi)
+       IDirectInputDevice8_Release (did->lpdi);
+    xfree (did->name);
+    xfree (did->sortname);
+    xfree (did->configname);
+    memset (did, 0, sizeof (struct didata));
+}
+
 static int di_do_init (void)
 {
     HRESULT hr;
+    int i;
 
     num_mouse = num_joystick = num_keyboard = 0;
-    memset (&di_mouse, 0, sizeof (di_mouse));
-    memset (&di_joystick, 0, sizeof (di_joystick));
-    memset (&di_keyboard, 0, sizeof (di_keyboard));
 
+    for (i = 0; i < MAX_INPUT_DEVICES; i++) {
+       di_dev_free (&di_joystick[i]);
+       di_dev_free (&di_mouse[i]);
+       di_dev_free (&di_keyboard[i]);
+    }
     hr = DirectInput8Create (hInst, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (LPVOID *)&g_lpdi, NULL);
     if (FAILED(hr)) {
        write_log ("DirectInput8Create failed, %s\n", DXError (hr));
@@ -1284,14 +1297,6 @@ static int di_do_init (void)
     return 1;
 }
 
-static void di_dev_free (struct didata *did)
-{
-    xfree (did->name);
-    xfree (did->sortname);
-    xfree (did->configname);
-    memset (did, 0, sizeof (*did));
-}
-
 static int di_init (void)
 {
     if (dd_inited++ > 0)
@@ -1303,6 +1308,7 @@ static int di_init (void)
 
 static void di_free (void)
 {
+    int i;
     if (dd_inited == 0)
        return;
     dd_inited--;
@@ -1311,9 +1317,11 @@ static void di_free (void)
     if (g_lpdi)
        IDirectInput8_Release (g_lpdi);
     g_lpdi = 0;
-    di_dev_free (di_mouse);
-    di_dev_free (di_joystick);
-    di_dev_free (di_keyboard);
+    for (i = 0; i < MAX_INPUT_DEVICES; i++) {
+       di_dev_free (&di_joystick[i]);
+       di_dev_free (&di_mouse[i]);
+       di_dev_free (&di_keyboard[i]);
+    }
 }
 
 static int get_mouse_num (void)
@@ -1379,7 +1387,7 @@ static int init_mouse (void)
     mouse_inited = 1;
     for (i = 0; i < num_mouse; i++) {
        did = &di_mouse[i];
-       if (!did->disabled && did->connection == DIDC_DX) {
+       if (did->connection == DIDC_DX) {
            hr = IDirectInput8_CreateDevice (g_lpdi, &did->iguid, &lpdi, NULL);
            if (SUCCEEDED (hr)) {
                hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIMouse2);
@@ -1404,11 +1412,8 @@ static void close_mouse (void)
     if (!mouse_inited)
        return;
     mouse_inited = 0;
-    for (i = 0; i < num_mouse; i++) {
-       if (di_mouse[i].lpdi)
-           IDirectInputDevice8_Release (di_mouse[i].lpdi);
-       di_mouse[i].lpdi = 0;
-    }
+    for (i = 0; i < num_mouse; i++)
+       di_dev_free (&di_mouse[i]);
     supermouse = normalmouse = rawmouse = winmouse = 0;
     di_free ();
 }
@@ -1739,7 +1744,7 @@ static int init_kb (void)
     keyboard_inited = 1;
     for (i = 0; i < num_keyboard; i++) {
        struct didata *did = &di_keyboard[i];
-       if (!did->disabled && did->connection == DIDC_DX) {
+       if (did->connection == DIDC_DX) {
            hr = IDirectInput8_CreateDevice (g_lpdi, &did->iguid, &lpdi, NULL);
            if (SUCCEEDED (hr)) {
                hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIKeyboard);
@@ -1776,11 +1781,8 @@ static void close_kb (void)
        return;
     keyboard_inited = 0;
 
-    for (i = 0; i < num_keyboard; i++) {
-       if (di_keyboard[i].lpdi)
-           IDirectInputDevice8_Release (di_keyboard[i].lpdi);
-       di_keyboard[i].lpdi = 0;
-    }
+    for (i = 0; i < num_keyboard; i++)
+       di_dev_free (&di_keyboard[i]);
     superkb = normalkb = rawkb = 0;
     di_free ();
 }
@@ -2216,7 +2218,7 @@ static int init_joystick (void)
     joystick_inited = 1;
     for (i = 0; i < num_joystick; i++) {
        did = &di_joystick[i];
-       if (!did->disabled && did->connection == DIDC_DX) {
+       if (did->connection == DIDC_DX) {
            hr = IDirectInput8_CreateDevice (g_lpdi, &did->iguid, &lpdi, NULL);
            if (SUCCEEDED (hr)) {
                hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIJoystick);
@@ -2243,11 +2245,8 @@ static void close_joystick (void)
     if (!joystick_inited)
        return;
     joystick_inited = 0;
-    for (i = 0; i < num_joystick; i++) {
-       if (di_joystick[i].lpdi)
-           IDirectInputDevice8_Release (di_joystick[i].lpdi);
-       di_joystick[i].lpdi = 0;
-    }
+    for (i = 0; i < num_joystick; i++)
+       di_dev_free (&di_joystick[i]);
     di_free ();
 }
 
index 394372742e9291d57aefa5bd8769afc2c1053745..b9ddd752efd9c15916de8d186c9fd0c59f9ddf49 100755 (executable)
@@ -322,10 +322,14 @@ static void setcursor (int oldx, int oldy)
     mouseposy = oldy - y;
     if (abs (mouseposx) < 50 && abs (mouseposy) < 50)
        return;
-    if (oldx < amigawin_rect.left || oldy < amigawin_rect.top || oldx > amigawin_rect.right || oldy > amigawin_rect.top)
-       return;
     mouseposx = 0;
     mouseposy = 0;
+//    if (oldx < amigawin_rect.left || oldy < amigawin_rect.top || oldx > amigawin_rect.right || oldy > amigawin_rect.bottom) {
+    if (oldx < 0 || oldy < 0 || oldx > amigawin_rect.right - amigawin_rect.left || oldy > amigawin_rect.bottom - amigawin_rect.top) {
+       write_log ("Mouse out of range: %dx%d (%dx%d %dx%d)\n", oldx, oldy,
+           amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom);
+       return;
+    }
     SetCursorPos (amigawin_rect.left + x, amigawin_rect.top + y);
 }
 
@@ -559,7 +563,7 @@ static void winuae_active (HWND hWnd, int minimized)
     getcapslock ();
     inputdevice_acquire (FALSE);
     wait_keyrelease ();
-    inputdevice_acquire (FALSE);
+    inputdevice_acquire (TRUE);
     if (isfullscreen() > 0 && !gui_active)
        setmouseactive (1);
     manual_palette_refresh_needed = 1;
@@ -843,7 +847,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     {
        WINDOWPOS *wp = (WINDOWPOS*)lParam;
        if (isfullscreen () <= 0) {
-           if (!IsIconic (hWnd)) {
+           if (!IsIconic (hWnd) && hWnd == hAmigaWnd) {
                GetWindowRect (hWnd, &amigawin_rect);
                if (isfullscreen () == 0) {
                    changed_prefs.gfx_size_win.x = amigawin_rect.left;
@@ -948,12 +952,12 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
 
        if (wParam == DBT_DEVNODES_CHANGED && lParam == 0) {
            if (waitfornext)
-               inputdevice_devicechange (&currprefs);
+               inputdevice_devicechange (&changed_prefs);
            waitfornext = 0;
        } else if (pBHdr && pBHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) {
            DEV_BROADCAST_DEVICEINTERFACE *dbd = (DEV_BROADCAST_DEVICEINTERFACE*)lParam;
            if (wParam == DBT_DEVICEREMOVECOMPLETE)
-               inputdevice_devicechange (&currprefs);
+               inputdevice_devicechange (&changed_prefs);
            else if (wParam == DBT_DEVICEARRIVAL)
                waitfornext = 1;
        } else if (pBHdr && pBHdr->dbch_devicetype == DBT_DEVTYP_VOLUME) {
index 5937211850fee6685c2e1fe886bf970693157d4b..8fc263d5329ab21c9175f43d147b6c33bda271b4 100755 (executable)
@@ -17,9 +17,9 @@
 
 #define WINUAEBETA 0
 #define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 8, 4)
-#define WINUAEEXTRA "RC3"
-#define WINUAEREV ""
+#define WINUAEDATE MAKEBD(2008, 8, 9)
+#define WINUAEEXTRA ""
+#define WINUAEREV "RC4"
 
 #define IHF_WINDOWHIDDEN 6
 #define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX)
index f5911bef925af8e85e9db27fb4de9b5767b1c024..e1c4c5e3ee942bd5054de79c815d386490fa8f06 100755 (executable)
@@ -987,7 +987,7 @@ static int open_windows (int full)
     for (i = 0; i < NUM_LEDS; i++)
        gui_led (i, 0);
     gui_fps (0, 0);
-    inputdevice_acquire (FALSE);
+    inputdevice_acquire (TRUE);
 
     return ret;
 }
@@ -1840,8 +1840,7 @@ static int create_windows_2 (void)
            else
                ny = rc.top + (rc.bottom - rc.top - nh);
        }
-
-       if ((w != nw || h != nh || x != nx || y != ny)) {
+       if (w != nw || h != nh || x != nx || y != ny) {
            w = nw;
            h = nh;
            x = nx;
@@ -1862,6 +1861,7 @@ static int create_windows_2 (void)
                createstatuswindow ();
            in_sizemove--;
        }
+       GetWindowRect (hAmigaWnd, &amigawin_rect);
        write_log ("window already open\n");
        return 1;
     }
@@ -1952,7 +1952,8 @@ static int create_windows_2 (void)
        h = currentmode->native_height;
 
     } else {
-        RECT rc;
+
+       RECT rc;
        getbestmode (0);
        w = currentmode->native_width;
        h = currentmode->native_height;
@@ -1967,11 +1968,6 @@ static int create_windows_2 (void)
            y = rc.top + (rc.bottom - rc.top - h);
     }
 
-    amigawin_rect.left = x;
-    amigawin_rect.top = y;
-    amigawin_rect.right = x + w;
-    amigawin_rect.bottom = y + h;
-
     if (rp_isactive () && !dxfs && !d3dfs && !fsw) {
        HWND parent = rp_getparent ();
        hAmigaWnd = CreateWindowEx (dxfs || d3dfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0),
@@ -1993,6 +1989,7 @@ static int create_windows_2 (void)
        close_hwnds();
        return 0;
     }
+    GetWindowRect (hAmigaWnd, &amigawin_rect);
     addnotifications (hAmigaWnd, FALSE);
     if (hMainWnd != hAmigaWnd) {
        ShowWindow (hMainWnd, SW_SHOWNORMAL);
index e6890bf0cd247a351fbdffb72ddcc887e669c13a..b0a9d917b320c041a74d90f00cc975497f347b14 100755 (executable)
@@ -741,10 +741,15 @@ static struct romdata *scan_single_rom_2 (struct zfile *f)
        }
     }
     if (!rd) {
-       ;write_log ("Unknown: Size=%d, Name='%s'\nCRC32=%08X SHA1=%s\n",
-          size, zfile_getname(f), get_crc32(rombuf, size), get_sha1_txt(rombuf, size));
+       write_log ("!: Name='%s':%d\nCRC32=%08X SHA1=%s\n",
+          zfile_getname(f), size, get_crc32(rombuf, size), get_sha1_txt(rombuf, size));
+    } else {
+       char tmp[MAX_DPATH];
+       getromname (rd, tmp);
+       write_log ("*: %s:%d = %s\nCRC32=%08X SHA1=%s\n",
+          zfile_getname(f), size, tmp, get_crc32(rombuf, size), get_sha1_txt(rombuf, size));
     }
-    free (rombuf);
+    xfree (rombuf);
     return rd;
 }
 
@@ -8692,24 +8697,11 @@ static void updatejoyport (HWND hDlg)
            SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_JOYSTICK, j));
        for (j = 0; j < inputdevice_get_device_total (IDTYPE_MOUSE); j++, total++)
            SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_MOUSE, j));
-       if (v < 0) {
-           idx = -1;
-       } else if (v >= JSEM_MICE) {
-           idx = v - JSEM_MICE;
-           if (idx >= inputdevice_get_device_total (IDTYPE_MOUSE))
-               idx = 0;
-           else
-               idx += inputdevice_get_device_total (IDTYPE_JOYSTICK);
-           idx += JSEM_LASTKBD;
-       } else if (v >= JSEM_JOYS) {
-           idx = v - JSEM_JOYS;
-           if (idx >= inputdevice_get_device_total (IDTYPE_JOYSTICK))
-               idx = 0;
-           idx += JSEM_LASTKBD;
-       } else {
-           idx = v - JSEM_KBDLAYOUT;
-       }
-       idx+=2;
+       idx = inputdevice_getjoyportdevice (v);
+       if (idx >= 0)
+           idx += 2;
+       else
+           idx = 0;
        if (idx >= total)
            idx = 0;
        SendDlgItemMessage (hDlg, id, CB_SETCURSEL, idx, 0);
@@ -9026,6 +9018,7 @@ static INT_PTR CALLBACK PortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
        pages[PORTS_ID] = hDlg;
        currentpage = PORTS_ID;
        init_portsdlg (hDlg);
+       inputdevice_updateconfig (&workprefs);
        enable_for_portsdlg (hDlg);
        values_to_portsdlg (hDlg);
        updatejoyport (hDlg);
@@ -9051,6 +9044,8 @@ static INT_PTR CALLBACK PortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
            joy0previous = joy1previous;
            joy1previous = temp;
            updatejoyport (hDlg);
+           inputdevice_updateconfig (&workprefs);
+           inputdevice_config_change ();
        } else if (wParam == IDC_FLUSHPRINTER) {
            if (isprinter ()) {
                closeprinter ();
@@ -9063,13 +9058,20 @@ static INT_PTR CALLBACK PortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
            workprefs.parallel_postscript_detection = IsDlgButtonChecked (hDlg, IDC_PSPRINTERDETECT) ? 1 : 0;
            if (!workprefs.parallel_postscript_detection)
                CheckDlgButton (hDlg, IDC_PSPRINTER, 0);
-       } else   {
-           values_from_portsdlg (hDlg);
-           if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS)
-               updatejoyport (hDlg);
+       } else {
+           if (HIWORD (wParam) == CBN_SELCHANGE) {
+               switch (LOWORD (wParam))
+               {
+                   case IDC_PORT0_JOYS:
+                   case IDC_PORT1_JOYS:
+                       values_from_portsdlg (hDlg);
+                       updatejoyport (hDlg);
+                       inputdevice_updateconfig (&workprefs);
+                       inputdevice_config_change ();
+                   break;
+               }
+           }
        }
-       inputdevice_updateconfig (&workprefs);
-       inputdevice_config_change ();
        recursive--;
        break;
     }
@@ -9283,7 +9285,7 @@ static void doinputcustom (HWND hDlg, int newcustom)
     }
 }
 
-static void values_from_inputdlg (HWND hDlg)
+static void values_from_inputdlg (HWND hDlg, int inputchange)
 {
     int doselect = 0, v;
     BOOL success;
@@ -9349,7 +9351,7 @@ static void values_from_inputdlg (HWND hDlg)
        doselect = 1;
     }
 
-    if (doselect && input_selected_device >= 0 && input_selected_event >= 0) {
+    if (inputchange && doselect && input_selected_device >= 0 && input_selected_event >= 0) {
        int flags;
        char custom[MAX_DPATH];
        custom[0] = 0;
@@ -9455,7 +9457,19 @@ static INT_PTR CALLBACK InputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
            inputdevice_set_device_status (input_selected_device, IsDlgButtonChecked( hDlg, IDC_INPUTDEVICEDISABLE) ? 1 : 0);
            break;
            default:
-           values_from_inputdlg (hDlg);
+           if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS)  {
+               switch (LOWORD (wParam))
+               {
+                   case IDC_INPUTAMIGA:
+                   values_from_inputdlg (hDlg, 1);
+                   break;
+                   case IDC_INPUTAMIGACNT:
+                   case IDC_INPUTTYPE:
+                   case IDC_INPUTDEVICE:
+                   values_from_inputdlg (hDlg, 0);
+                   break;
+               }
+           }
            break;
        }
        enable_for_portsdlg (hDlg);
@@ -11501,6 +11515,7 @@ int gui_init (void)
     int ret;
 
     read_rom_list ();
+    inputdevice_updateconfig (&workprefs);
     for (;;) {
        ret = GetSettings (1, currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL);
        if (!restart_requested)
index 44cfae2f55e954bf9ec660c42fbd8f2ca245f8a7..b287216604c0788619f5f7e22e76f6f62d3456af 100755 (executable)
@@ -1,11 +1,25 @@
 
+RC4: (still waiting for fixed winuae.net..)
+
+- quickstart A1200: increase A1200 KS 3.1 priority over
+  Cloanto A4000 KS 3.1 (AF2008 finally includes real A1200 3.1 ROM)
+- multiple identical USB game controllers fix really works now
+- non-ce/non-immediate blitter timing calculation returned totally
+  bogus values if AGA fmode=3, wide sprites or sprite doublescan was
+  enabled (tiny blit could take few seconds to finish in worst case..)
+  Ancient bug.
+- input device re-enumeration cleanup after usb device insert/remove
+- crash when inserting or removing USB devices before emulation has
+  been started
+- inserting/removing USB devices does not anymore change currently
+  selected mouse or joystick device in ports panel
+
 RC3:
 
 - bsdsocket broke in rc2
 - D3D filter does not crash if texture creation fails
   (=non D3D9 compatible display card/driver)
 - shader filters renamed to "D3D: <name of filter>" in GUI
-- removed useless/broken filters (MCxxxx, point, bilinear)
 
 RC2: