From: Toni Wilen Date: Mon, 8 May 2023 17:27:46 +0000 (+0300) Subject: 5000b9 X-Git-Tag: 5.0.0~48 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=b1d3367d72c9d7ec42bd745597c450e225411de3;p=francis%2Fwinuae.git 5000b9 --- diff --git a/include/inputdevice.h b/include/inputdevice.h index 044d10d4..8171c209 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -372,6 +372,11 @@ extern int inputdevice_testread_count (void); extern bool target_can_autoswitchdevice(void); +bool key_specialpressed(void); +bool key_shiftpressed(void); +bool key_altpressed(void); +bool key_ctrlpressed(void); + extern int key_swap_hack, key_swap_hack2; #endif /* UAE_INPUTDEVICE_H */ diff --git a/inputdevice.cpp b/inputdevice.cpp index d3b6d79f..c19268e1 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -6022,6 +6022,24 @@ uae_u64 input_getqualifiers (void) return qualifiers; } +bool key_specialpressed(void) +{ + return (input_getqualifiers() & ID_FLAG_QUALIFIER_SPECIAL) != 0; +} +bool key_shiftpressed(void) +{ + return (input_getqualifiers() & ID_FLAG_QUALIFIER_SHIFT) != 0; +} +bool key_altpressed(void) +{ + return (input_getqualifiers() & ID_FLAG_QUALIFIER_ALT) != 0; +} +bool key_ctrlpressed(void) +{ + return (input_getqualifiers() & ID_FLAG_QUALIFIER_CONTROL) != 0; +} + + static bool checkqualifiers (int evt, uae_u64 flags, uae_u64 *qualmask, uae_s16 events[MAX_INPUT_SUB_EVENT_ALL]) { int i, j; @@ -9230,10 +9248,47 @@ void inputdevice_unacquire(void) inputdevice_unacquire(0); } -void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state, int max) +static void inputdevice_testrecord_info(int type, int num, int wtype, int wnum, int state, int max) { - //write_log (_T("%d %d %d %d %d/%d\n"), type, num, wtype, wnum, state, max); +#if 0 + TCHAR name[256]; + if (type == IDTYPE_KEYBOARD) { + if (wnum >= 0x100) { + wnum = 0x100 - wnum; + } else { + struct uae_input_device *na = &keyboards[num]; + int j = 0; + while (j < MAX_INPUT_DEVICE_EVENTS && na->extra[j] >= 0) { + if (na->extra[j] == wnum) { + wnum = j; + break; + } + j++; + } + if (j >= MAX_INPUT_DEVICE_EVENTS || na->extra[j] < 0) + return; + } + } + int devnum2 = getdevnum(type, num); + int type2; + if (wnum >= 0 && wnum < MAX_INPUT_DEVICE_EVENTS) + type2 = idev[type].get_widget_first(num, wtype) + wnum; + else + type2 = wnum; + int state2 = state; + + name[0] = 0; + int type3 = inputdevice_get_widget_type(devnum2, type2, name, false); + if (name[0]) { + const struct inputdevice_functions *idf = getidf(devnum2); + write_log(_T("%s %s\n"), idf->get_friendlyname(inputdevice_get_device_index(devnum2)), name); + } +#endif +} + +static void inputdevice_testrecord_test(int type, int num, int wtype, int wnum, int state, int max) +{ if (wnum < 0) { testmode = -1; return; @@ -9292,6 +9347,16 @@ void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state, testmode_count++; } +void inputdevice_testrecord(int type, int num, int wtype, int wnum, int state, int max) +{ + //write_log (_T("%d %d %d %d %d/%d\n"), type, num, wtype, wnum, state, max); + if (testmode) { + inputdevice_testrecord_test(type, num, wtype, wnum, state, max); + } else if (key_specialpressed()) { + inputdevice_testrecord_info(type, num, wtype, wnum, state, max); + } +} + int inputdevice_istest (void) { return testmode; diff --git a/od-win32/keyboard_win32.cpp b/od-win32/keyboard_win32.cpp index 72181b58..4e6a2acd 100644 --- a/od-win32/keyboard_win32.cpp +++ b/od-win32/keyboard_win32.cpp @@ -335,23 +335,6 @@ static int *kbmaps[] = { kb_arcadia, kb_cdtv }; -static bool specialpressed (void) -{ - return (input_getqualifiers () & ID_FLAG_QUALIFIER_SPECIAL) != 0; -} -static bool shiftpressed (void) -{ - return (input_getqualifiers () & ID_FLAG_QUALIFIER_SHIFT) != 0; -} -static bool altpressed (void) -{ - return (input_getqualifiers () & ID_FLAG_QUALIFIER_ALT) != 0; -} -static bool ctrlpressed (void) -{ - return (input_getqualifiers () & ID_FLAG_QUALIFIER_CONTROL) != 0; -} - static int capslockstate; static int host_capslockstate, host_numlockstate, host_scrolllockstate; @@ -426,14 +409,14 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas } #endif - if (amode && scancode == DIK_F11 && currprefs.win32_ctrl_F11_is_quit && ctrlpressed()) { + if (amode && scancode == DIK_F11 && currprefs.win32_ctrl_F11_is_quit && key_ctrlpressed()) { if (!quit_ok()) return true; uae_quit(); return true; } - if (scancode == DIK_F9 && specialpressed ()) { + if (scancode == DIK_F9 && key_specialpressed ()) { extern bool toggle_3d_debug(void); if (newstate) { if (toggle_3d_debug()) { @@ -443,7 +426,7 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas } scancode_new = scancode; - if (!specialpressed () && inputdevice_iskeymapped (keyboard, scancode)) + if (!key_specialpressed () && inputdevice_iskeymapped (keyboard, scancode)) scancode = 0; if (newstate) { @@ -454,13 +437,13 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas } else if (currprefs.win32_guikey > 0) { if (scancode_new == defaultguikey && currprefs.win32_guikey != scancode_new) { scancode = 0; - if (specialpressed () && ctrlpressed() && shiftpressed() && altpressed ()) + if (key_specialpressed () && key_ctrlpressed() && key_shiftpressed() && key_altpressed ()) inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); } else if (scancode_new == currprefs.win32_guikey ) { inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); scancode = 0; } - } else if (currprefs.win32_guikey != 0 && !specialpressed () && !ctrlpressed() && !shiftpressed() && !altpressed () && scancode_new == defaultguikey) { + } else if (currprefs.win32_guikey != 0 && !key_specialpressed () && !key_ctrlpressed() && !key_shiftpressed() && !key_altpressed () && scancode_new == defaultguikey) { inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); scancode = 0; } @@ -517,11 +500,11 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas case DIK_8: case DIK_9: case DIK_0: - if (specialpressed ()) { + if (key_specialpressed ()) { int num = scancode - DIK_1; - if (shiftpressed ()) + if (key_shiftpressed ()) num += 10; - if (ctrlpressed ()) { + if (key_ctrlpressed ()) { swapperdrive = num; if (swapperdrive > 3) swapperdrive = 0; @@ -548,7 +531,7 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas case DIK_NUMPAD8: case DIK_NUMPAD9: case DIK_NUMPADPERIOD: - if (specialpressed ()) { + if (key_specialpressed ()) { int i = 0, v = -1; while (np[i] >= 0) { v = np[i + 1]; @@ -557,64 +540,10 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas i += 2; } if (v >= 0) - code = AKS_STATESAVEQUICK + v * 2 + ((shiftpressed () || ctrlpressed ()) ? 0 : 1); + code = AKS_STATESAVEQUICK + v * 2 + ((key_shiftpressed () || key_ctrlpressed ()) ? 0 : 1); special = true; } break; -#if 0 - case DIK_PAUSE: - if (specialpressed ()) { - if (shiftpressed ()) - code = AKS_IRQ7; - else - code = AKS_WARP; - } else { - code = AKS_PAUSE; - } - special = true; - break; -#if 0 - case DIK_SCROLL: - code = AKS_INHIBITSCREEN; - break; -#endif - case DIK_NUMPADMINUS: - if (specialpressed ()) { - if (shiftpressed ()) - code = AKS_DECREASEREFRESHRATE; - else if (ctrlpressed ()) - code = AKS_MVOLDOWN; - else - code = AKS_VOLDOWN; - } - special = true; - break; - case DIK_NUMPADPLUS: - if (specialpressed ()) { - if (shiftpressed ()) - code = AKS_INCREASEREFRESHRATE; - else if (ctrlpressed ()) - code = AKS_MVOLUP; - else - code = AKS_VOLUP; - } - special = true; - break; - case DIK_NUMPADSTAR: - if (specialpressed ()) { - if (ctrlpressed ()) - code = AKS_MVOLMUTE; - else - code = AKS_VOLMUTE; - } - special = true; - break; - case DIK_NUMPADSLASH: - if (specialpressed ()) - code = AKS_STATEREWIND; - special = true; - break; -#endif } } @@ -625,7 +554,7 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas scancode = scancode_new; - if (!specialpressed () && newstate) { + if (!key_specialpressed () && newstate) { if (scancode == DIK_CAPITAL) { host_capslockstate = host_capslockstate ? 0 : 1; capslockstate = host_capslockstate; diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 50488b03..f3846ec8 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -416,6 +416,10 @@ #define IDS_READONLYCONFIRMATION 421 #define IDS_SCREEN_NATIVELACE 422 #define IDS_PORT_AUTOFIRE_TOGGLENOAF 423 +#define IDS_DEFAULT_WINUAECUSTOM 424 +#define IDS_SYNCMODE_COMBINED 425 +#define IDS_SYNCMODE_CSYNC 426 +#define IDS_SYNCMODE_HVSYNC 427 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index e2962e0f..7074f3b3 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -2197,6 +2197,10 @@ BEGIN "Selected configuration file is write protected.\nDo you want to overwrite it?\n%s\n" IDS_SCREEN_NATIVELACE "Native (Interlaced)" IDS_PORT_AUTOFIRE_TOGGLENOAF "No autofire (toggle)" + IDS_DEFAULT_WINUAECUSTOM "Custom" + IDS_SYNCMODE_COMBINED "Combined" + IDS_SYNCMODE_CSYNC "Composite Sync" + IDS_SYNCMODE_HVSYNC "H/V Sync" END STRINGTABLE diff --git a/od-win32/win32.h b/od-win32/win32.h index b56534fa..ae8f9f87 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,18 +20,18 @@ #define LANG_DLL_FULL_VERSION_MATCH 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("8") +#define WINUAEBETA _T("9") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2023, 5, 1) +#define WINUAEDATE MAKEBD(2023, 5, 8) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") #ifndef WINUAEEXTRA -#define WINUAEEXTRA _T("") +#define WINUAEEXTRA _T("RC1") #endif #ifndef WINUAEREV #define WINUAEREV _T("") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 8a400b33..27ecfa34 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -6906,7 +6906,8 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (path_type == PATH_TYPE_WINUAE || path_type == PATH_TYPE_DEFAULT) selpath = numtypes; ptypes[numtypes++] = PATH_TYPE_WINUAE; - xSendDlgItemMessage(hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)_T("Custom")); + WIN32GUI_LoadUIString(IDS_DEFAULT_WINUAECUSTOM, tmp, sizeof tmp / sizeof(TCHAR)); + xSendDlgItemMessage(hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp); if (path_type == PATH_TYPE_CUSTOM) selpath = numtypes; ptypes[numtypes++] = PATH_TYPE_CUSTOM; @@ -7340,7 +7341,7 @@ static void init_quickstartdlg (HWND hDlg) total = 0; xSendDlgItemMessage (hDlg, IDC_QUICKSTART_CONFIGURATION, CB_RESETCONTENT, 0, 0L); if (amodels[quickstart_model].id == IDS_QS_MODEL_ARCADIA) { - struct romlist** rl = getarcadiaroms(0); + struct romlist **rl = getarcadiaroms(0); for (i = 0; rl[i]; i++) { xSendDlgItemMessage(hDlg, IDC_QUICKSTART_CONFIGURATION, CB_ADDSTRING, 0, (LPARAM)rl[i]->rd->name); total++; @@ -9246,9 +9247,12 @@ static INT_PTR CALLBACK ChipsetDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR } xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_RESETCONTENT, 0, 0); - xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_ADDSTRING, 0, (LPARAM)_T("Combined")); - xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_ADDSTRING, 0, (LPARAM)_T("Composite Sync")); - xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_ADDSTRING, 0, (LPARAM)_T("H/V Sync")); + WIN32GUI_LoadUIString(IDS_SYNCMODE_COMBINED, buffer, sizeof buffer / sizeof(TCHAR)); + xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_ADDSTRING, 0, (LPARAM)buffer); + WIN32GUI_LoadUIString(IDS_SYNCMODE_CSYNC, buffer, sizeof buffer / sizeof(TCHAR)); + xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_ADDSTRING, 0, (LPARAM)buffer); + WIN32GUI_LoadUIString(IDS_SYNCMODE_HVSYNC, buffer, sizeof buffer / sizeof(TCHAR)); + xSendDlgItemMessage(hDlg, IDC_CS_HVCSYNC, CB_ADDSTRING, 0, (LPARAM)buffer); #ifndef AGA ew(hDlg, IDC_AGA, FALSE); @@ -13860,9 +13864,6 @@ static void values_to_sounddlg (HWND hDlg) workprefs.sound_maxbsiz = 0; xSendDlgItemMessage (hDlg, IDC_SOUNDBUFFERRAM, TBM_SETPOS, TRUE, getsoundbufsizeindex (workprefs.sound_maxbsiz)); - xSendDlgItemMessage (hDlg, IDC_SOUNDVOLUME, TBM_SETPOS, TRUE, 0); - xSendDlgItemMessage (hDlg, IDC_SOUNDVOLUMEEXT, TBM_SETPOS, TRUE, 0); - xSendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_SETCURSEL, workprefs.win32_soundcard, 0); sounddrivesel = xSendDlgItemMessage (hDlg, IDC_SOUNDDRIVE, CB_GETCURSEL, 0, 0); @@ -14112,8 +14113,13 @@ static INT_PTR CALLBACK SoundDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (recursive > 0) break; recursive++; - if(LOWORD (wParam) == IDC_SOUNDDRIVE) { - values_to_sounddlg (hDlg); + if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_KILLFOCUS) { + switch (LOWORD(wParam)) + { + case IDC_SOUNDDRIVE: + values_to_sounddlg(hDlg); + break; + } } values_from_sounddlg (hDlg); enable_for_sounddlg (hDlg); @@ -17767,7 +17773,7 @@ static void init_portsdlg (HWND hDlg) xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Leader Board")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("B.A.T. II")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Italy '90 Soccer")); - xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Dames Grand-Maître")); + xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Dames Grand-Maitre")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Rugby Coach")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Cricket Captain")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Leviathan")); diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index dd4759a8..6d982701 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,12 @@ +Beta 9: (RC1) + +- Debugger calculator (also used by custom input events) >> and << shift operators added. Negative hex and binary value support (?-$xx now works as expected). Ternary operator support ("condition_formula ? formula_calculated_if_true : formula_calculated_if false"). String parameters and string comparisons supported. Can be useful in custom input events. (for example "gfx_resolution=[\'gfx_linemode\'=='double2'?'hires':'lores']") +- Serial port GUI now have separate options to enable handshake/status pin emulation (RTS/CTS/DTR/DTE/CD) and Ring Indicator. RI is off by default because it is shared with printer port SEL which broke parallel port joystick if serial port was also enabled after RI update. "RTS/CTS" renamed to more correct "Host RTS/CTS" (Host serial port hardware handles RTS/CTS automatically, Amiga side does not need to care) +- Sound GUI panel slider flickering fixed when modifying (almost) any other sound configuration setting. +- Added v2.01 ICD AdSCSI 2000 ROM (v32.1 icddisk.device). Renamed v2.x (v33.0) to v2.1 because now it is almost certain it is v2.1. +- Only disk insert cleared forced floppy drive turbo mode (enabled when executable is inserted in disk drive). Now it is also cleared when "disk" is ejected, allowing floppy sounds (if enabled) to play normally. Floppy sounds are not played in turbo mode. + Beta 8: - input.advancedmultiinput=true now also enables GUI "multiple input devices connected to same joystick port" Game Ports panel support. It is hidden because it is not complete yet and it is too late to do any possible breaking changes.