]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2300b18
authorToni Wilen <twilen@winuae.net>
Sat, 18 Sep 2010 13:10:48 +0000 (16:10 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 18 Sep 2010 13:10:48 +0000 (16:10 +0300)
cpummu.cpp
disk.cpp
newcpu.cpp
od-win32/dinput.cpp
od-win32/keyboard_win32.cpp
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt
savestate.cpp

index d152f334b46a27f973ae5e8d2660dcff00e62456..603bf0e8f1a3844e34088a04ed01895e5b5497f8 100644 (file)
@@ -320,8 +320,7 @@ static void mmu_bus_error(uaecptr addr, int fc, bool write, int size)
 /*
  * Update the atc line for a given address by doing a mmu lookup.
  */
-static uaecptr mmu_fill_atc_l2(uaecptr addr, bool super, bool data, bool write,
-                                                          struct mmu_atc_line *l)
+static uaecptr mmu_fill_atc_l2(uaecptr addr, bool super, bool data, bool write, struct mmu_atc_line *l)
 {
        int res;
        uae_u32 desc;
index 1692a035477b708b55dc6ad9cb4290c8ac04aebf..d4c2830a1540febad82099038d2716153bf87ded 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -100,7 +100,6 @@ static int fifo_inuse[3];
 static int dma_enable, bitoffset, syncoffset;
 static uae_u16 word, dsksync;
 static unsigned long dsksync_cycles;
-static int cemode = 1;
 #define WORDSYNC_TIME 11
 /* Always carried through to the next line.  */
 static int disk_hpos;
@@ -3626,14 +3625,17 @@ uae_u8 *save_disk (int num, int *len, uae_u8 *dstptr)
 
 uae_u8 *restore_floppy (uae_u8 *src)
 {
-       word = restore_u16();
-       bitoffset = restore_u8();
-       dma_enable = restore_u8();
-       disk_hpos = restore_u8() << 8;
-       dskdmaen = restore_u8();
-       restore_u16 ();
-       //word |= restore_u16() << 16;
-
+       word = restore_u16 ();
+       bitoffset = restore_u8 ();
+       dma_enable = restore_u8 ();
+       disk_hpos = restore_u8 () << 8;
+       dskdmaen = restore_u8 ();
+       for (int i = 0; i < 3; i++) {
+               fifo[i] = restore_u16 ();
+               fifo_inuse[i] = restore_u8 () != 0;
+               if (dskdmaen == 0)
+                       fifo_inuse[i] = false;
+       }
        return src;
 }
 
@@ -3648,13 +3650,16 @@ uae_u8 *save_floppy(int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (uae_u8, 2 + 1 + 1 + 1 + 1 + 2);
-       save_u16 (word);                /* current fifo (low word) */
-       save_u8 (bitoffset);    /* dma bit offset */
-       save_u8 (dma_enable);   /* disk sync found */
+               dstbak = dst = xmalloc (uae_u8, 100);
+       save_u16 (word);                        /* shift register */
+       save_u8 (bitoffset);            /* dma bit offset */
+       save_u8 (dma_enable);           /* disk sync found */
        save_u8 (disk_hpos >> 8);       /* next bit read position */
-       save_u8 (dskdmaen);             /* dma status */
-       save_u16 (0);           /* was current fifo (high word), but it was wrong???? */
+       save_u8 (dskdmaen);                     /* dma status */
+       for (int i = 0; i < 3; i++) {
+               save_u16 (fifo[i]);
+               save_u8 (fifo_inuse[i] ? 1 : 0);
+       }
 
        *len = dst - dstbak;
        return dstbak;
index bb2e23b2f21a1f60345e3e65bfb6812781637fd4..dbd9e03f092fa5be0da950ab8be777997e3c15ed 100644 (file)
@@ -3053,18 +3053,20 @@ retry:
 #if 0
                        static int done;
                        if (pc == 0x16AF94) {
-                               write_log (L"D0=%d A7=%08x\n", regs.regs[0], regs.regs[15]);
+//                             write_log (L"D0=%d A7=%08x\n", regs.regs[0], regs.regs[15]);
                                if (regs.regs[0] == 360) {
                                        done = 1;
                                        activate_debugger ();
                                }
                        }
+/*
                        if (pc == 0x16B01A) {
                                write_log (L"-> ERR\n");
                        }
                        if (pc == 0x16B018) {
                                write_log (L"->\n");
                        }
+*/
                        if (pc == 0x17967C || pc == 0x13b5e2 - 4) {
                                if (done) {
                                        write_log (L"*\n");
index aa2e3d60385f933a0adc2cf034e3963f6afb648b..cc070da858db1d90e98fc6351f0a2693d370b9f0 100644 (file)
@@ -306,6 +306,25 @@ static void fixthings_mouse (struct didata *did)
 
 static int rawinput_available, rawinput_registered_mouse, rawinput_registered_kb;
 
+static bool test_rawinput (int usage)
+{
+       RAWINPUTDEVICE rid = { 0 };
+
+       rid.usUsagePage = 1;
+       rid.usUsage = usage;
+       if (RegisterRawInputDevices (&rid, 1, sizeof (RAWINPUTDEVICE)) == FALSE) {
+               write_log (L"RAWINPUT test failed, usage=%d ERR=%d\n", usage, GetLastError ());
+               return false;
+       }
+       rid.dwFlags |= RIDEV_REMOVE;
+       if (RegisterRawInputDevices (&rid, 1, sizeof (RAWINPUTDEVICE)) == FALSE) {
+               write_log (L"RAWINPUT test failed (release), usage=%d, ERR=%d\n", usage, GetLastError ());
+               return false;
+       }
+       write_log (L"RAWINPUT test ok, usage=%d\n", usage);
+       return true;
+}
+
 static int register_rawinput (int flags)
 {
        int num, rm, rkb;
@@ -862,7 +881,7 @@ static void rawinputfriendlynames (void)
        }
 }
 
-static TCHAR *rawkeyboardlabels[256] =
+static const 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",
@@ -877,12 +896,11 @@ static TCHAR *rawkeyboardlabels[256] =
        L"NUMLOCK",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",
-       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,NULL,
+       L"F13",L"F14",L"F15",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,NULL,NULL,NULL,NULL,
        L"NUMPADEQUALS",NULL,NULL,
        L"PREVTRACK",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
        L"NEXTTRACK",NULL,NULL,L"NUMPADENTER",L"RCONTROL",NULL,NULL,
@@ -1747,6 +1765,10 @@ static int di_do_init (void)
        }
 
        if (!rawinput_decided) {
+               if (num_mouse > 0 && !test_rawinput (2))
+                       num_mouse = 0;
+               if (num_keyboard > 0 && !test_rawinput (6))
+                       num_keyboard = 0;
                rawinput_enabled_keyboard = num_keyboard > 0;
                rawinput_enabled_mouse = num_mouse > 0;
                rawinput_decided = true;
index f5bdf92653e618c3d95fa71a2e39a2ed71e17723..24672cf3117137b44ed0f7b26e5deb8bf0cd9878 100644 (file)
@@ -155,16 +155,16 @@ static struct uae_input_device_kbr_default keytrans[] = {
        { DIK_SLASH, INPUTEVENT_KEY_DIV },
        { DIK_OEM_102, INPUTEVENT_KEY_30 },
 
-       { DIK_VOLUMEDOWN, INPUTEVENT_SPC_MASTER_VOLUME_DOWN },
-       { DIK_VOLUMEUP, INPUTEVENT_SPC_MASTER_VOLUME_UP },
-       { DIK_MUTE, INPUTEVENT_SPC_MASTER_VOLUME_MUTE },
+//     { DIK_VOLUMEDOWN, INPUTEVENT_SPC_MASTER_VOLUME_DOWN },
+//     { DIK_VOLUMEUP, INPUTEVENT_SPC_MASTER_VOLUME_UP },
+//     { DIK_MUTE, INPUTEVENT_SPC_MASTER_VOLUME_MUTE },
 
        { DIK_HOME, INPUTEVENT_KEY_70 },
        { DIK_END, INPUTEVENT_KEY_71 },
-       //    { DIK_SYSRQ, INPUTEVENT_KEY_6E },
-       //    { DIK_F12, INPUTEVENT_KEY_6F },
+//    { DIK_SYSRQ, INPUTEVENT_KEY_6E },
+//    { DIK_F12, INPUTEVENT_KEY_6F },
        { DIK_INSERT, INPUTEVENT_KEY_47 },
-       //    { DIK_PRIOR, INPUTEVENT_KEY_48 },
+//    { DIK_PRIOR, INPUTEVENT_KEY_48 },
        { DIK_PRIOR, INPUTEVENT_SPC_FREEZEBUTTON },
        { DIK_NEXT, INPUTEVENT_KEY_49 },
        { DIK_F11, INPUTEVENT_KEY_4B },
index af7598c740415abd05062043193c65de1ff12a86..0ca474ed2697b3ebb03e8b9fd21d650dc74bdb93 100644 (file)
@@ -617,6 +617,8 @@ void setmouseactive (int active)
 #endif
 }
 
+static int hotkeys[] = { VK_VOLUME_UP, VK_VOLUME_DOWN, VK_VOLUME_MUTE, -1 };
+
 static void winuae_active (HWND hWnd, int minimized)
 {
        struct threadpriorities *pri;
@@ -648,6 +650,11 @@ static void winuae_active (HWND hWnd, int minimized)
                }
                sound_closed = 0;
        }
+#if 0
+       RegisterHotKey (hAmigaWnd, IDHOT_SNAPDESKTOP, 0, VK_SNAPSHOT);
+       for (int i = 0; hotkeys[i] >= 0; i++)
+               RegisterHotKey (hAmigaWnd, hotkeys[i], 0, hotkeys[i]);
+#endif
        if (WIN32GFX_IsPicassoScreen ())
                WIN32GFX_EnablePicasso ();
        getcapslock ();
@@ -685,6 +692,11 @@ static void winuae_inactive (HWND hWnd, int minimized)
                SetThreadExecutionState (ES_CONTINUOUS);
        if (minimized)
                exit_gui (0);
+#if 0
+       for (int i = 0; hotkeys[i] >= 0; i++)
+               UnregisterHotKey (hAmigaWnd, hotkeys[i]);
+       UnregisterHotKey (hAmigaWnd, IDHOT_SNAPDESKTOP);
+#endif
        focus = 0;
        wait_keyrelease ();
        setmouseactive (0);
index 404b18a965d0788242b8e3b13ea725d7a5f42410..6b19f823f39c277b3e4f213e6b62a2c0710040c2 100644 (file)
@@ -18,9 +18,9 @@
 #define WINUAEPUBLICBETA 1
 #define LANG_DLL 1
 
-#define WINUAEBETA L"17"
-#define WINUAEDATE MAKEBD(2010, 9, 12)
-#define WINUAEEXTRA L""
+#define WINUAEBETA L"18"
+#define WINUAEDATE MAKEBD(2010, 9, 18)
+#define WINUAEEXTRA L"RC1"
 #define WINUAEREV L""
 
 #define IHF_WINDOWHIDDEN 6
index 9ad4a43c5fd76147a8b49b7e1ff04b2292d0023f..8ffd895cbd29b86d092485ec71b146298fb48f21 100644 (file)
@@ -7655,8 +7655,7 @@ static void enable_for_cpudlg (HWND hDlg)
        ew (hDlg, IDC_CPU5, FALSE);
 #endif
 
-       cpu_based_enable = workprefs.cpu_model >= 68020 &&
-               workprefs.address_space_24 == 0;
+       cpu_based_enable = workprefs.cpu_model >= 68020 && workprefs.address_space_24 == 0;
 
        jitenable = cpu_based_enable;
 #ifndef JIT
index 1ed3fe6fa31ba562438ae5a9a88a304cb6dc3991..77eb5d842f359824f11794c7deba5b4ebe3e1507 100644 (file)
@@ -1,4 +1,15 @@
 
+Beta 18 (RC1):
+
+- F13/F14/F15 rawinput keycodes fixed (at least available on some apple usb keyboards)
+- removed default volume and mute keyboard mappings because in rawinput mode they
+  are always handled by Windows (which is annoying, I haven't found any simple way to
+  disable them, "disable hotkeys" flag only seems to disable Windows keys)
+- fall back to directinput if rawinput enumeration worked but RegisterRawInputDevices() returns error
+- Paula disk fifo statefile support
+
+Beta 17:
+
 - removed duplicate "none" in filter list
 - RTD also missed address error check
 - MMU emulation bus error handler uses C++ exceptions again (like in original Aranym version),
index c2dc005e9199d54f0ccbf6a08fad29772df38a80..c25c82f99647e64391ffddad48bbe8d01dd09f4f 100644 (file)
@@ -330,8 +330,8 @@ static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t
                && _tcscmp (name, L"A3K1") != 0
                && _tcscmp (name, L"A3K2") != 0)
        {
-               /* without zeros at the end old state files may not work */
-               mem = xcalloc (uae_u8, *totallen + 32);
+               /* extra bytes at the end needed to handle old statefiles that now have new fields */
+               mem = xcalloc (uae_u8, *totallen + 100);
                if (!mem)
                        return NULL;
                if (flags & 1) {