From: Toni Wilen Date: Sat, 18 Sep 2010 13:10:48 +0000 (+0300) Subject: 2300b18 X-Git-Tag: 2300~3 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=84e87a7bf4bfe35ea8adbf825cd8321fe6f25f43;p=francis%2Fwinuae.git 2300b18 --- diff --git a/cpummu.cpp b/cpummu.cpp index d152f334..603bf0e8 100644 --- a/cpummu.cpp +++ b/cpummu.cpp @@ -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; diff --git a/disk.cpp b/disk.cpp index 1692a035..d4c2830a 100644 --- 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; diff --git a/newcpu.cpp b/newcpu.cpp index bb2e23b2..dbd9e03f 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -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"); diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index aa2e3d60..cc070da8 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -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; diff --git a/od-win32/keyboard_win32.cpp b/od-win32/keyboard_win32.cpp index f5bdf926..24672cf3 100644 --- a/od-win32/keyboard_win32.cpp +++ b/od-win32/keyboard_win32.cpp @@ -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 }, diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index af7598c7..0ca474ed 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -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); diff --git a/od-win32/win32.h b/od-win32/win32.h index 404b18a9..6b19f823 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -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 diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 9ad4a43c..8ffd895c 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -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 diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 1ed3fe6f..77eb5d84 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -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), diff --git a/savestate.cpp b/savestate.cpp index c2dc005e..c25c82f9 100644 --- a/savestate.cpp +++ b/savestate.cpp @@ -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) {