From b6dc717e8fb8788a2b083a4a18f4c267d9330da0 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 16 Mar 2013 15:43:58 +0200 Subject: [PATCH] 2600b11 --- akiko.cpp | 2 +- cfgfile.cpp | 2 + custom.cpp | 2 + debug.cpp | 37 +++++++++-- drawing.cpp | 13 ++++ filesys.cpp | 2 +- gayle.cpp | 10 ++- gencpu.cpp | 7 ++- include/custom.h | 6 +- include/inputdevice.h | 6 +- include/options.h | 1 + inputdevice.cpp | 67 +++++++++++++++++--- main.cpp | 7 ++- memory.cpp | 2 +- newcpu.cpp | 4 +- od-win32/dinput.cpp | 6 +- od-win32/resources/resource.h | 3 +- od-win32/resources/winuae.rc | 22 ++++--- od-win32/rp.cpp | 14 +++-- od-win32/win32.h | 4 +- od-win32/win32gfx.cpp | 2 + od-win32/win32gui.cpp | 115 +++++++++++++++++++++++++++------- od-win32/winuaechangelog.txt | 17 +++++ 23 files changed, 275 insertions(+), 76 deletions(-) diff --git a/akiko.cpp b/akiko.cpp index f404a0be..dc4f644c 100644 --- a/akiko.cpp +++ b/akiko.cpp @@ -1292,7 +1292,7 @@ static void akiko_handler (bool framesync) } /* one toc entry / frame */ - if (cdrom_toc_counter >= 0 && !cdrom_command_active) { + if (cdrom_toc_counter >= 0 && !cdrom_command_active && framesync) { if (cdrom_start_return_data (-1)) { cdrom_start_return_data (cdrom_return_toc_entry ()); } diff --git a/cfgfile.cpp b/cfgfile.cpp index 0fbfd02c..1d445e30 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -901,6 +901,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write_str (f, _T("gfx_center_vertical"), centermode1[p->gfx_ycenter]); cfgfile_write_str (f, _T("gfx_colour_mode"), colormode1[p->color_mode]); cfgfile_write_bool (f, _T("gfx_blacker_than_black"), p->gfx_blackerthanblack); + cfgfile_dwrite_bool (f, _T("gfx_black_frame_insertion"), p->lightboost_strobo); cfgfile_write_str (f, _T("gfx_api"), filterapi[p->gfx_api]); cfgfile_dwrite (f, _T("gfx_horizontal_tweak"), _T("%d"), p->gfx_extrawidth); @@ -1658,6 +1659,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) || cfgfile_yesno (option, value, _T("log_illegal_mem"), &p->illegal_mem) || cfgfile_yesno (option, value, _T("filesys_no_fsdb"), &p->filesys_no_uaefsdb) || cfgfile_yesno (option, value, _T("gfx_blacker_than_black"), &p->gfx_blackerthanblack) + || cfgfile_yesno (option, value, _T("gfx_black_frame_insertion"), &p->lightboost_strobo) || cfgfile_yesno (option, value, _T("gfx_flickerfixer"), &p->gfx_scandoubler) || cfgfile_yesno (option, value, _T("magic_mouse"), &p->input_magic_mouse) || cfgfile_yesno (option, value, _T("warp"), &p->turbo_emulation) diff --git a/custom.cpp b/custom.cpp index 0881558d..11cfdb8f 100644 --- a/custom.cpp +++ b/custom.cpp @@ -2862,6 +2862,7 @@ static void dumpsync (void) write_log (_T(" HSSTOP=%04X HBSTRT=%04X HBSTOP=%04X\n"), hsstop, hbstrt, hbstop); write_log (_T(" VSSTOP=%04X VBSTRT=%04X VBSTOP=%04X\n"), vsstop, vbstrt, vbstop); write_log (_T(" HSSTRT=%04X VSSTRT=%04X HCENTER=%04X\n"), hsstrt, vsstrt, hcenter); + write_log (_T(" HSYNCSTART=%04X HSYNCEND=%04X\n"), hsyncstartpos, hsyncendpos); } int current_maxvpos (void) @@ -3249,6 +3250,7 @@ static void calcdiw (void) diwfirstword = coord_diw_to_window_x (hstrt); diwlastword = coord_diw_to_window_x (hstop); + if (diwfirstword >= diwlastword) { diwfirstword = min_diwlastword; diwlastword = max_diwlastword; diff --git a/debug.cpp b/debug.cpp index e34e55b8..8452cf28 100644 --- a/debug.cpp +++ b/debug.cpp @@ -133,7 +133,7 @@ static TCHAR help[] = { _T(" s \"\"/ [] []\n") _T(" Search for string/bytes.\n") _T(" T or Tt Show exec tasks and their PCs.\n") - _T(" Td,Tl,Tr Show devices, libraries or resources.\n") + _T(" Td,Tl,Tr,Ts,Ti,TO Show devices, libraries, resources, residents, interrupts, doslist.\n") _T(" b Step to previous state capture position.\n") _T(" M Enable or disable audio channels, bitplanes or sprites.\n") _T(" sp [] Dump sprite information.\n") @@ -2784,8 +2784,9 @@ static void show_exec_lists (TCHAR t) { uaecptr execbase = get_long_debug (4); uaecptr list = 0, node; + TCHAR c = _totupper (t); - if (_totupper (t) == 'O') { // doslist + if (c == 'O') { // doslist uaecptr dosbase = get_base ("dos.library"); if (dosbase) { uaecptr rootnode = get_long_debug (dosbase + 34); @@ -2810,7 +2811,7 @@ static void show_exec_lists (TCHAR t) console_out_f (_T("can't find dos.library\n")); } return; - } else if (_totupper (t) == 'I') { // interrupts + } else if (c == 'I') { // interrupts static const int it[] = { 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 }; static const int it2[] = { 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7 }; list = execbase + 84; @@ -2861,9 +2862,37 @@ static void show_exec_lists (TCHAR t) list += 12; } return; + } else if (c == 'S') { // residents + list = get_long (execbase + 300); + while (list) { + uaecptr resident = get_long_debug (list); + if (!resident) + break; + if (resident & 0x80000000) { + write_log (_T("-> %08X\n"), resident & ~0x7fffffff); + list = resident & ~0x7fffffff; + continue; + } + uae_u8 *addr; + addr = get_real_address (get_long_debug (resident + 14)); + TCHAR *name1 = addr ? au ((char*)addr) : au(""); + my_trim (name1); + addr = get_real_address (get_long_debug (resident + 18)); + TCHAR *name2 = addr ? au ((char*)addr) : au(""); + my_trim (name2); + console_out_f (_T("%08X %08X: %02X %3d %02X %+3.3d '%s' ('%s')\n"), + list, resident, + get_byte_debug (resident + 10), get_byte_debug (resident + 11), + get_byte_debug (resident + 12), (uae_s8)get_byte_debug (resident + 13), + name1, name2); + xfree (name2); + xfree (name1); + list += 4; + } + return; } - switch (_totupper (t)) + switch (c) { case 'R': list = execbase + 336; diff --git a/drawing.cpp b/drawing.cpp index 499f42c9..85db2425 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -719,6 +719,13 @@ static void pfield_init_linetoscr (void) playfield_start = linetoscr_diw_start; playfield_end = linetoscr_diw_end; + if (beamcon0 & 0x80) { + if (playfield_start < coord_hw_to_window_x (hsyncendpos * 2 + DIW_DDF_OFFSET)) + playfield_start = coord_hw_to_window_x (hsyncendpos * 2 + DIW_DDF_OFFSET); + if (playfield_end > coord_hw_to_window_x (hsyncstartpos * 2 + DIW_DDF_OFFSET)) + playfield_end = coord_hw_to_window_x (hsyncstartpos * 2 + DIW_DDF_OFFSET); + } + unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start; ham_src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left); unpainted = res_shift_from_window (unpainted); @@ -748,6 +755,12 @@ static void pfield_init_linetoscr (void) } min = coord_hw_to_window_x (min >> sprite_buffer_res) + (DIW_DDF_OFFSET << lores_shift); max = coord_hw_to_window_x (max >> sprite_buffer_res) + (DIW_DDF_OFFSET << lores_shift); + if (beamcon0 & 0x80) { + if (min < coord_hw_to_window_x (hsyncendpos * 2 + DIW_DDF_OFFSET)) + min = coord_hw_to_window_x (hsyncendpos * 2 + DIW_DDF_OFFSET); + if (min > coord_hw_to_window_x (hsyncstartpos * 2 + DIW_DDF_OFFSET)) + min = coord_hw_to_window_x (hsyncstartpos * 2 + DIW_DDF_OFFSET); + } if (min < playfield_start) playfield_start = min; if (playfield_start < visible_left_border) diff --git a/filesys.cpp b/filesys.cpp index c1816945..180fb0c6 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -7985,7 +7985,7 @@ uae_u8 *restore_filesys (uae_u8 *src) } _tcscpy (ci->rootdir, rootdir); _tcscpy (ci->devname, devname); - _tcscpy (ci->volname, volname); + _tcscpy (ci->volname, volname ? volname : _T("")); _tcscpy (ci->filesys, filesysdir); if (set_filesys_unit (devno, ci) < 0) { diff --git a/gayle.cpp b/gayle.cpp index cabe1234..a4c00a91 100644 --- a/gayle.cpp +++ b/gayle.cpp @@ -603,9 +603,15 @@ static void ide_initialize_drive_parameters (void) if (ide->hdhfd.size) { ide->hdhfd.secspertrack = ide->regs.ide_nsector == 0 ? 256 : ide->regs.ide_nsector; ide->hdhfd.heads = (ide->regs.ide_select & 15) + 1; - ide->hdhfd.cyls = (ide->hdhfd.size / ide->blocksize) / (ide->hdhfd.secspertrack * ide->hdhfd.heads); + if (ide->hdhfd.hfd.ci.pcyls) + ide->hdhfd.cyls = ide->hdhfd.hfd.ci.pcyls; + else + ide->hdhfd.cyls = (ide->hdhfd.size / ide->blocksize) / (ide->hdhfd.secspertrack * ide->hdhfd.heads); if (ide->hdhfd.heads * ide->hdhfd.cyls * ide->hdhfd.secspertrack > 16515072 || ide->lba48) { - ide->hdhfd.cyls = ide->hdhfd.cyls_def; + if (ide->hdhfd.hfd.ci.pcyls) + ide->hdhfd.cyls = ide->hdhfd.hfd.ci.pcyls; + else + ide->hdhfd.cyls = ide->hdhfd.cyls_def; ide->hdhfd.heads = ide->hdhfd.heads_def; ide->hdhfd.secspertrack = ide->hdhfd.secspertrack_def; } diff --git a/gencpu.cpp b/gencpu.cpp index b59b1947..86751bc7 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -2967,9 +2967,10 @@ static void gen_opcode (unsigned long int opcode) printf ("\tCLEAR_CZNV ();\n"); printf ("\tif (src == 0) {\n"); if (cpu_level > 0) { - /* 68020 sets V when dividing by zero. Z is also set. - * 68000 clears both - */ + /* 68000 Set Z. Clear N, V, C. + * 68020 Set V, Z. Clear C and N. Keep X. + * 68060 Clear C, everything else is kept. + */ printf("\t\tSET_VFLG (1);\n"); printf("\t\tSET_ZFLG (1);\n"); } diff --git a/include/custom.h b/include/custom.h index 27b5f876..2563371e 100644 --- a/include/custom.h +++ b/include/custom.h @@ -119,7 +119,7 @@ extern uae_u16 INTREQR (void); extern int maxhpos, maxhpos_short; extern int maxvpos, maxvpos_nom; -extern int hsyncstartpos; +extern int hsyncstartpos, hsyncendpos; extern int minfirstline, vblank_endline, numscrlines; extern double vblank_hz, fake_vblank_hz; extern int vblank_skip, doublescan; @@ -192,13 +192,13 @@ STATIC_INLINE int GET_RES_DENISE (uae_u16 con0) { if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE)) con0 &= ~0x40; // SUPERHIRES - return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES; + return ((con0) & 0x40) ? RES_SUPERHIRES : ((con0) & 0x8000) ? RES_HIRES : RES_LORES; } STATIC_INLINE int GET_RES_AGNUS (uae_u16 con0) { if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS)) con0 &= ~0x40; // SUPERHIRES - return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES; + return ((con0) & 0x40) ? RES_SUPERHIRES : ((con0) & 0x8000) ? RES_HIRES : RES_LORES; } /* get sprite width from FMODE */ #define GET_SPRITEWIDTH(FMODE) ((((FMODE) >> 2) & 3) == 3 ? 64 : (((FMODE) >> 2) & 3) == 0 ? 16 : 32) diff --git a/include/inputdevice.h b/include/inputdevice.h index 8f34daa7..6daa730e 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -134,6 +134,8 @@ struct inputevent { #define ID_AXIS_OFFSET 32 #define ID_AXIS_TOTAL 32 +#define MAX_COMPA_INPUTLIST 30 + extern int inputdevice_iterate (int devnum, int num, TCHAR *name, int *af); extern bool inputdevice_set_gameports_mapping (struct uae_prefs *prefs, int devnum, int num, int evtnum, uae_u64 flags, int port); extern int inputdevice_set_mapping (int devnum, int num, const TCHAR *name, TCHAR *custom, uae_u64 flags, int port, int sub); @@ -208,12 +210,12 @@ extern void inputdevice_do_keyboard (int code, int state); extern int inputdevice_iskeymapped (int keyboard, int scancode); extern int inputdevice_synccapslock (int, int*); extern void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state, int max); -extern int inputdevice_get_compatibility_input (struct uae_prefs*, int, int*, int**, int**); +extern int inputdevice_get_compatibility_input (struct uae_prefs*, int index, int *typelist, int *inputlist, const int **at); extern struct inputevent *inputdevice_get_eventinfo (int evt); extern bool inputdevice_get_eventname (const struct inputevent *ie, TCHAR *out); extern void inputdevice_compa_prepare_custom (struct uae_prefs *prefs, int index, int mode, bool removeold); extern void inputdevice_compa_clear (struct uae_prefs *prefs, int index); -extern int intputdevice_compa_get_eventtype (int evt, int **axistable); +extern int intputdevice_compa_get_eventtype (int evt, const int **axistable); extern void inputdevice_sparecopy (struct uae_input_device *uid, int num, int sub); extern uae_u16 potgo_value; diff --git a/include/options.h b/include/options.h index dfd7035c..89955fcb 100644 --- a/include/options.h +++ b/include/options.h @@ -317,6 +317,7 @@ struct uae_prefs { int gfx_api; int color_mode; int gfx_extrawidth; + bool lightboost_strobo; int gfx_filter; TCHAR gfx_filtershader[2 * MAX_FILTERSHADERS][MAX_DPATH]; diff --git a/inputdevice.cpp b/inputdevice.cpp index c0a2b2ba..932b7a20 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -4004,7 +4004,7 @@ static void scanevents (struct uae_prefs *p) } } -static int axistable[] = { +static const int axistable[] = { INPUTEVENT_MOUSE1_HORIZ, INPUTEVENT_MOUSE1_LEFT, INPUTEVENT_MOUSE1_RIGHT, INPUTEVENT_MOUSE1_VERT, INPUTEVENT_MOUSE1_UP, INPUTEVENT_MOUSE1_DOWN, INPUTEVENT_MOUSE2_HORIZ, INPUTEVENT_MOUSE2_LEFT, INPUTEVENT_MOUSE2_RIGHT, @@ -4024,7 +4024,7 @@ static int axistable[] = { -1 }; -int intputdevice_compa_get_eventtype (int evt, int **axistablep) +int intputdevice_compa_get_eventtype (int evt, const int **axistablep) { for (int i = 0; axistable[i] >= 0; i += 3) { *axistablep = &axistable[i]; @@ -4336,16 +4336,59 @@ static void setcompakb (int *kb, int *srcmap, int index, int af) } } -int inputdevice_get_compatibility_input (struct uae_prefs *prefs, int index, int *typelist, int **inputlist, int **at) +int inputdevice_get_compatibility_input (struct uae_prefs *prefs, int index, int *typelist, int *inputlist, const int **at) { if (index >= MAX_JPORTS || joymodes[index] < 0) return -1; - *typelist = joymodes[index]; - *inputlist = joyinputs[index]; - *at = axistable; + if (typelist != NULL) + *typelist = joymodes[index]; + if (at != NULL) + *at = axistable; + if (inputlist == NULL) + return -1; + //write_log (_T("%d %p %p\n"), *typelist, *inputlist, *at); - int cnt = 0; - for (int i = 0; joyinputs[index] && joyinputs[index][i] >= 0; i++, cnt++); + int cnt; + for (cnt = 0; joyinputs[index] && joyinputs[index][cnt] >= 0; cnt++) { + inputlist[cnt] = joyinputs[index][cnt]; + } + inputlist[cnt] = -1; + + // find custom events (custom event = event that is mapped to same port but not included in joyinputs[] + int devnum = 0; + while (inputdevice_get_device_status (devnum) >= 0) { + for (int j = 0; j < inputdevice_get_widget_num (devnum); j++) { + for (int sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) { + int port, k; + uae_u64 flags; + int evtnum2 = inputdevice_get_mapping (devnum, j, &flags, &port, NULL, NULL, sub); + if (port - 1 != index) + continue; + for (k = 0; axistable[k] >= 0; k++) { + if (evtnum2 == axistable[k]) + break; + } + if (axistable[k] < 0) { + for (k = 0; inputlist[k] >= 0; k++) { + if (evtnum2 == inputlist[k]) + break; + } + if (inputlist[k] < 0) { + inputlist[k] = evtnum2; + inputlist[k + 1] = -1; + cnt++; + } + } + } + } + devnum++; + } +#if 0 + for (int i = 0; inputlist[i] >= 0; i++) { + struct inputevent *evt = inputdevice_get_eventinfo (inputlist[i]); + write_log (_T("%d: %d %d %s\n"), i, index, inputlist[i], evt->name); + } +#endif //write_log (_T("%d\n"), cnt); return cnt; } @@ -4407,9 +4450,11 @@ static void resetjport (struct uae_prefs *prefs, int index) static void remove_compa_config (struct uae_prefs *prefs, int index) { - int typelist, *inputlist, *atp; + int typelist; + const int *atp; + int inputlist[MAX_COMPA_INPUTLIST]; - if (inputdevice_get_compatibility_input (prefs, index, &typelist, &inputlist, &atp) <= 0) + if (inputdevice_get_compatibility_input (prefs, index, &typelist, inputlist, &atp) <= 0) return; for (int i = 0; inputlist[i] >= 0; i++) { int evtnum = inputlist[i]; @@ -5818,6 +5863,8 @@ static struct inputdevice_functions *getidf (int devnum) struct inputevent *inputdevice_get_eventinfo (int evt) { + if (evt > 0 && !events[evt].name) + return NULL; return &events[evt]; } diff --git a/main.cpp b/main.cpp index 0a32f126..942e1373 100644 --- a/main.cpp +++ b/main.cpp @@ -173,15 +173,16 @@ void fixup_prefs_dimensions (struct uae_prefs *prefs) ap->gfx_vflip = 1; if (!i && ap->gfx_backbuffers == 2) ap->gfx_vflip = 1; - if (ap->gfx_vflip) - ap->gfx_strobo = true; + if (ap->gfx_vflip) { + ap->gfx_strobo = prefs->lightboost_strobo; + } } else { // legacy vsync: always wait for flip ap->gfx_vflip = -1; if (prefs->gfx_api && ap->gfx_backbuffers < 1) ap->gfx_backbuffers = 1; if (ap->gfx_vflip) - ap->gfx_strobo = true; + ap->gfx_strobo = prefs->lightboost_strobo;; } } else { // no vsync: wait if triple bufferirng diff --git a/memory.cpp b/memory.cpp index 093cd314..c3a690e0 100644 --- a/memory.cpp +++ b/memory.cpp @@ -2443,6 +2443,7 @@ void memory_reset (void) bool gayleorfatgary; need_hardreset = false; + rom_write_enabled = true; /* Use changed_prefs, as m68k_reset is called later. */ if (last_address_space_24 != changed_prefs.address_space_24) need_hardreset = true; @@ -2487,7 +2488,6 @@ void memory_reset (void) memcpy (currprefs.romfile, changed_prefs.romfile, sizeof currprefs.romfile); memcpy (currprefs.romextfile, changed_prefs.romextfile, sizeof currprefs.romextfile); need_hardreset = true; - rom_write_enabled = true; mapped_free (extendedkickmemory); extendedkickmemory = 0; extendedkickmem_size = 0; diff --git a/newcpu.cpp b/newcpu.cpp index e11f52eb..dd352a25 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -9,7 +9,7 @@ #define MOVEC_DEBUG 0 #define MMUOP_DEBUG 2 #define DEBUG_CD32CDTVIO 0 -#define EXCEPTION3_DEBUG 1 +#define EXCEPTION3_DEBUGGER 0 #define CPUTRACE_DEBUG 0 #include "sysconfig.h" @@ -5862,7 +5862,7 @@ static void exception3f (uae_u32 opcode, uaecptr addr, int writeaccess, int inst last_writeaccess_for_exception_3 = writeaccess; last_instructionaccess_for_exception_3 = instructionaccess; Exception (3); -#if EXCEPTION3_DEBUG +#if EXCEPTION3_DEBUGGER activate_debugger(); #endif } diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index ec16b9b2..c9617842 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -1954,8 +1954,10 @@ static void handle_rawinput_2 (RAWINPUT *raw) PCHAR rawdata; if (rawinput_log & 4) { uae_u8 *r = hid->bRawData; - write_log (_T("%d %d %02x%02x%02x%02x%02x%02x%02x\n"), hid->dwCount, hid->dwSizeHid, - r[0], r[1], r[2], r[3], r[4], r[5], r[6]); + write_log (_T("%d %d "), hid->dwCount, hid->dwSizeHid); + for (int i = 0; i < hid->dwSizeHid; i++) + write_log (_T("%02X"), r[i]); + write_log (_T("\n")); } for (num = 0; num < num_joystick; num++) { did = &di_joystick[num]; diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index a94600a7..4c2b485b 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -1126,6 +1126,7 @@ #define IDC_INPUTMAP_TEST 1822 #define IDC_INPUTMAP_DELETEALL 1823 #define IDC_INPUTMAP_EXIT 1824 +#define IDC_INPUTMAPADD 1825 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 #define ID_ST_CONFIGURATION 40010 @@ -1176,7 +1177,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 388 #define _APS_NEXT_COMMAND_VALUE 40050 -#define _APS_NEXT_CONTROL_VALUE 1820 +#define _APS_NEXT_CONTROL_VALUE 1826 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index a4441f7b..ee08fe0c 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1073,21 +1073,22 @@ BEGIN CONTROL "Always center",IDC_RTG_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,93,212,10 END -IDD_INPUTMAP DIALOGEX 0, 0, 420, 318 +IDD_INPUTMAP DIALOGEX 0, 0, 421, 341 STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Input Remap" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,147,51,58,14,NOT WS_VISIBLE - CONTROL "",IDC_INPUTMAPLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,1,1,418,248 - EDITTEXT IDC_INPUTMAPOUT,1,253,418,14,ES_AUTOHSCROLL | ES_READONLY | WS_DISABLED - EDITTEXT IDC_INPUTMAPOUTM,1,269,418,29,ES_MULTILINE | ES_READONLY | WS_DISABLED - PUSHBUTTON "Remap",IDC_INPUTMAP_CAPTURE,72,300,66,14 - PUSHBUTTON "Add special",IDC_INPUTMAP_CUSTOM,142,300,66,14 - PUSHBUTTON "Delete",IDC_INPUTMAP_DELETE,212,300,66,14 - PUSHBUTTON "Delete all",IDC_INPUTMAP_DELETEALL,282,300,66,14 - PUSHBUTTON "Test",IDC_INPUTMAP_TEST,2,300,66,14 - PUSHBUTTON "Exit",IDC_INPUTMAP_EXIT,351,300,66,14 + CONTROL "",IDC_INPUTMAPLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,1,1,418,257 + EDITTEXT IDC_INPUTMAPOUT,1,261,418,14,ES_AUTOHSCROLL | ES_READONLY | WS_DISABLED + EDITTEXT IDC_INPUTMAPOUTM,1,277,418,29,ES_MULTILINE | ES_READONLY | WS_DISABLED + PUSHBUTTON "Remap",IDC_INPUTMAP_CAPTURE,86,324,80,14 + PUSHBUTTON "Add",IDC_INPUTMAP_CUSTOM,351,308,66,14 + PUSHBUTTON "Delete",IDC_INPUTMAP_DELETE,170,324,80,14 + PUSHBUTTON "Delete all",IDC_INPUTMAP_DELETEALL,254,324,80,14 + PUSHBUTTON "Test",IDC_INPUTMAP_TEST,2,324,80,14 + PUSHBUTTON "Exit",IDC_INPUTMAP_EXIT,338,324,80,14 + COMBOBOX IDC_INPUTMAPADD,2,309,345,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP END IDD_INFOBOX DIALOGEX 0, 0, 420, 68 @@ -1412,6 +1413,7 @@ BEGIN IDD_INPUTMAP, DIALOG BEGIN + RIGHTMARGIN, 420 END IDD_INFOBOX, DIALOG diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index a2e29808..acbd6d32 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -212,11 +212,13 @@ bool port_get_custom (int inputmap_port, TCHAR *out) int kb; bool first = true; TCHAR *p = out; - int mode, *events, *axistable; + int mode; + const int *axistable; + int events[MAX_COMPA_INPUTLIST]; int max; const TCHAR **eventorder; - max = inputdevice_get_compatibility_input (&currprefs, inputmap_port, &mode, &events, &axistable); + max = inputdevice_get_compatibility_input (&currprefs, inputmap_port, &mode, events, &axistable); if (max <= 0) return false; @@ -269,12 +271,14 @@ bool port_get_custom (int inputmap_port, TCHAR *out) int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TCHAR *custom) { const TCHAR *p = custom; - int mode, *events, *axistable; + int mode; + const int *axistable; + int events[MAX_COMPA_INPUTLIST]; int max, evtnum; int kb; const TCHAR **eventorder; - max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable); + max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, events, &axistable); eventorder = getcustomeventorder (&devicetype); if (!eventorder) @@ -285,7 +289,7 @@ int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TC inputdevice_copyconfig (&currprefs, &changed_prefs); inputdevice_compa_prepare_custom (&changed_prefs, inputmap_port, devicetype, true); inputdevice_updateconfig (NULL, &changed_prefs); - max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable); + max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, events, &axistable); write_log (_T("custom='%s' max=%d port=%d dt=%d kb=%d kbnum=%d\n"), custom, max, inputmap_port, devicetype, kb, inputdevice_get_device_total (IDTYPE_KEYBOARD)); if (max <= 0) return FALSE; diff --git a/od-win32/win32.h b/od-win32/win32.h index 3077391e..1dff30be 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,11 +19,11 @@ #define LANG_DLL 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("10") +#define WINUAEBETA _T("11") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2013, 3, 9) +#define WINUAEDATE MAKEBD(2013, 3, 16) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") #define WINUAEREV _T("") diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 532b3dbb..2bcbaa6e 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1727,6 +1727,7 @@ int check_prefs_changed_gfx (void) #endif c |= currprefs.gfx_autoresolution != changed_prefs.gfx_autoresolution ? (2|8|16) : 0; c |= currprefs.gfx_api != changed_prefs.gfx_api ? (1|8|32) : 0; + c |= currprefs.lightboost_strobo != changed_prefs.lightboost_strobo ? (2|16) : 0; for (int i = 0; i < 2 * MAX_FILTERSHADERS; i++) { c |= _tcscmp (currprefs.gfx_filtershader[i], changed_prefs.gfx_filtershader[i]) ? (2|8) : 0; @@ -1798,6 +1799,7 @@ int check_prefs_changed_gfx (void) currprefs.gfx_autoresolution = changed_prefs.gfx_autoresolution; currprefs.color_mode = changed_prefs.color_mode; currprefs.gfx_api = changed_prefs.gfx_api; + currprefs.lightboost_strobo = changed_prefs.lightboost_strobo; if (changed_prefs.gfx_apmode[0].gfx_fullscreen == GFX_FULLSCREEN) { if (currprefs.gfx_api != changed_prefs.gfx_api) diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index fbdcb691..1814c791 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -3447,11 +3447,12 @@ static void update_listview_input (HWND hDlg) } static int inputmap_port = -1, inputmap_port_remap = -1; -static int inputmap_groupindex[32]; +static int inputmap_groupindex[MAX_COMPA_INPUTLIST + 1]; static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, int *inputmap_portp, int *inputmap_indexp, int state, int *inputmap_itemindexp, int deleteindex) { int cntitem, cntgroup, portnum; - int mode, *events, *axistable; + int mode; + const int *axistable; bool found2 = false; for (portnum = 0; portnum < 4; portnum++) { @@ -3459,22 +3460,23 @@ static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, portnum = inputmap_port; cntitem = 1; cntgroup = 1; - if (inputdevice_get_compatibility_input (&workprefs, portnum, &mode, &events, &axistable) > 0) { + int events[MAX_COMPA_INPUTLIST]; + if (inputdevice_get_compatibility_input (&workprefs, portnum, &mode, events, &axistable) > 0) { int evtnum; for (int i = 0; (evtnum = events[i]) >= 0; i++) { struct inputevent *evt = inputdevice_get_eventinfo (evtnum); - LV_ITEM lvstruct; + LV_ITEM lvstruct = { 0 }; int devnum; int status; TCHAR name[256]; - int *atp = axistable; + const int *atp = axistable; int atpidx; int item; bool found = false; uae_u64 flags; if (list) { - LVGROUP group; + LVGROUP group = { 0 }; group.cbSize = sizeof (LVGROUP); group.mask = LVGF_HEADER | LVGF_GROUPID; group.pszHeader = (TCHAR*)evt->name; @@ -3485,9 +3487,10 @@ static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, lvstruct.lParam = 0; lvstruct.iSubItem = 0; lvstruct.iGroupId = cntgroup; - if (inputmap_itemindexp) + if (inputmap_itemindexp) { inputmap_itemindexp[cntgroup - 1] = -1; - inputmap_itemindexp[cntgroup + 1 - 1] = -1; + inputmap_itemindexp[cntgroup - 1 + 1] = -1; + } } atpidx = 0; @@ -3510,16 +3513,17 @@ static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, for (int j = 0; j < inputdevice_get_widget_num (devnum); j++) { for (int sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) { int port; - if (inputdevice_get_mapping (devnum, j, &flags, &port, NULL, NULL, sub) == evtnum) { - if (!port) + int evtnum2 = inputdevice_get_mapping (devnum, j, &flags, &port, NULL, NULL, sub); + if (evtnum2 == evtnum) { + if (port - 1 != portnum) continue; if (cntitem - 1 == deleteindex) { inputdevice_set_mapping (devnum, j, NULL, NULL, 0, 0, sub); deleteindex = -1; continue; } - inputdevice_get_widget_type (devnum, j, name); if (list) { + inputdevice_get_widget_type (devnum, j, name); TCHAR target[MAX_DPATH]; _tcscpy (target, name); _tcscat (target, _T(", ")); @@ -3637,7 +3641,7 @@ static struct miscentry misclist[] = { { 0, 0, _T("Start mouse uncaptured"), &workprefs.win32_start_uncaptured }, { 0, 0, _T("Start minimized"), &workprefs.win32_start_minimized }, { 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive }, - + { 0, 1, _T("100/120Hz VSync black frame insertion"), &workprefs.lightboost_strobo }, { 0, NULL } }; @@ -3741,6 +3745,7 @@ void InitializeListView (HWND hDlg) if (lv_type != LV_MISC1) flags |= LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT | LVS_EX_FULLROWSELECT; ListView_SetExtendedListViewStyleEx (list, flags , flags); + ListView_RemoveAllGroups (list); ListView_DeleteAllItems (list); cachedlist = list; @@ -12362,15 +12367,16 @@ static void doinputcustom (HWND hDlg, int newcustom) { TCHAR custom1[MAX_DPATH]; uae_u64 flags; + int port; custom1[0] = 0; inputdevice_get_mapping (input_selected_device, input_selected_widget, - &flags, NULL, NULL, custom1, input_selected_sub_num); + &flags, &port, NULL, custom1, input_selected_sub_num); if (_tcslen (custom1) > 0 || newcustom) { if (askinputcustom (hDlg, custom1, sizeof custom1 / sizeof (TCHAR), IDS_SB_CUSTOMEVENT)) { if (custom1[0]) inputdevice_set_mapping (input_selected_device, input_selected_widget, - NULL, custom1, flags, -1, input_selected_sub_num); + NULL, custom1, flags, port, input_selected_sub_num); } } } @@ -12529,6 +12535,7 @@ static void showextramap (HWND hDlg) static void input_find (HWND hDlg, HWND mainDlg, int mode, int set, bool oneshot); static int rawmode; static int inputmap_remap_counter, inputmap_view_offset; +static int inputmap_remap_event; static int inputmap_mode_cnt; static bool inputmap_oneshot; @@ -12573,7 +12580,7 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw return; if (pages[INPUTMAP_ID]) { - inputmap = inputmap_remap_counter >= 0 ? 1 : 2; + inputmap = inputmap_remap_counter >= 0 ? 1 : (inputmap_remap_counter == -1 ? 2 : 3); setfocus (hDlg, IDC_INPUTMAPLIST); myDlg = hDlg; } else { @@ -12612,16 +12619,33 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw input_selected_widget = wtype; int type = inputdevice_get_widget_type (input_selected_device, input_selected_widget, NULL); - if (inputmap == 1) { // ports panel / remap + if (inputmap == 3) { // ports panel / add custom + int mode; + const int *axistable; + int events[MAX_COMPA_INPUTLIST]; + + int max = inputdevice_get_compatibility_input (&workprefs, inputmap_port, &mode, events, &axistable); + if (max < MAX_COMPA_INPUTLIST - 1) { + if (inputmap_remap_event > 0) + inputdevice_set_gameports_mapping (&workprefs, input_selected_device, input_selected_widget, inputmap_remap_event, 0, inputmap_port); + } + inputmap_remap_event = 0; + InitializeListView (myDlg); + input_find (hDlg, myDlg, 0, FALSE, false); + return; + + } else if (inputmap == 1) { // ports panel / remap static int skipbuttonaxis; static int prevtype2, prevtype, prevwidget, prevevtnum, prevaxisevent, prevaxisstate; int widgets[10], widgetstate[10]; int wcnt, found, axisevent, axisstate; HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST); - int mode, *events, *axistable, *axistable2; + int mode; + const int *axistable, *axistable2; + int events[MAX_COMPA_INPUTLIST]; - int max = inputdevice_get_compatibility_input (&workprefs, inputmap_port, &mode, &events, &axistable); + int max = inputdevice_get_compatibility_input (&workprefs, inputmap_port, &mode, events, &axistable); int evtnum = events[inputmap_remap_counter]; int type2 = intputdevice_compa_get_eventtype (evtnum, &axistable2); @@ -12822,6 +12846,9 @@ static int rawdisable[] = { IDC_INPUTCOPY, 0, 0, IDC_INPUTCOPYFROM, 0, 0, IDC_INPUTSWAP, 0, 0, IDC_INPUTDEADZONE, 0, 0, IDC_INPUTSPEEDD, 0, 0, IDC_INPUTAUTOFIRERATE, 0, 0, IDC_INPUTSPEEDA, 0, 0, IDC_PANELTREE, 1, 0, IDC_RESETAMIGA, 1, 0, IDC_QUITEMU, 1, 0, IDC_RESTARTEMU, 1, 0, IDOK, 1, 0, IDCANCEL, 1, 0, IDHELP, 1, 0, + -1 +}; +static int rawdisable2[] = { IDC_INPUTMAP_DELETE, 0, 0, IDC_INPUTMAP_CAPTURE, 0, 0, IDC_INPUTMAP_CUSTOM, 0, 0, IDC_INPUTMAP_TEST, 0, 0, IDC_INPUTMAP_DELETEALL, 0, 0, IDC_INPUTMAP_EXIT, 0, 0, -1 @@ -12829,14 +12856,15 @@ static int rawdisable[] = { static void inputmap_disable (HWND hDlg, bool disable) { - for (int i = 0; rawdisable[i] >= 0; i += 3) { - HWND w = GetDlgItem (rawdisable[i + 1] ? guiDlg : hDlg, rawdisable[i]); + int *p = pages[INPUTMAP_ID] ? rawdisable2 : rawdisable; + for (int i = 0; p[i] >= 0; i += 3) { + HWND w = GetDlgItem (p[i + 1] ? guiDlg : hDlg, p[i]); if (w) { if (disable) { - rawdisable[i + 2] = IsWindowEnabled (w); + p[i + 2] = IsWindowEnabled (w); EnableWindow (w, FALSE); } else { - EnableWindow (w, rawdisable[i + 2]); + EnableWindow (w, p[i + 2]); } } } @@ -12975,6 +13003,8 @@ static INT_PTR CALLBACK InputMapDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA static int recursive; static int inputmap_selected; HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST); + TCHAR tmp[256]; + int i; switch (msg) { @@ -12983,10 +13013,30 @@ static INT_PTR CALLBACK InputMapDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA return TRUE; case WM_INITDIALOG: { + const int *axislist; inputmap_port_remap = -1; inputmap_remap_counter = -1; inputmap_view_offset = 0; pages[INPUTMAP_ID] = hDlg; + + inputdevice_get_compatibility_input (&workprefs, inputmap_port, NULL, NULL, &axislist); + SendDlgItemMessage (hDlg, IDC_INPUTMAPADD, CB_RESETCONTENT, 0, 0L); + SendDlgItemMessage (hDlg, IDC_INPUTMAPADD, CB_ADDSTRING, 0, (LPARAM)szNone.c_str()); + i = 1; + for (;;) { + int j; + struct inputevent *ie = inputdevice_get_eventinfo (i); + if (!ie) + break; + for (j = 0; axislist[j] >= 0; j++) { + if (axislist[j] == i) + break; + } + if (axislist[j] < 0 && _tcslen (ie->name) > 0) + SendDlgItemMessage (hDlg, IDC_INPUTMAPADD, CB_ADDSTRING, 0, (LPARAM)ie->name); + i++; + } + inputdevice_updateconfig (NULL, &workprefs); InitializeListView (hDlg); if (workprefs.jports[inputmap_port].id != JPORT_CUSTOM) { @@ -13041,7 +13091,6 @@ static INT_PTR CALLBACK InputMapDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA case IDC_INPUTMAP_EXIT: pages[INPUTMAP_ID] = NULL; DestroyWindow (hDlg); - //EndDialog (hDlg, 0); break; case IDC_INPUTMAP_TEST: inputmap_port_remap = -1; @@ -13064,6 +13113,24 @@ static INT_PTR CALLBACK InputMapDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA input_find (hDlg, hDlg, 1, true, false); break; case IDC_INPUTMAP_CUSTOM: + if (workprefs.jports[inputmap_port].id == JPORT_CUSTOM) { + tmp[0] = 0; + SendDlgItemMessage (hDlg, IDC_INPUTMAPADD, WM_GETTEXT, (WPARAM)sizeof tmp / sizeof (TCHAR), (LPARAM)tmp); + i = 1; + for (;;) { + struct inputevent *ie = inputdevice_get_eventinfo (i); + if (!ie) + break; + if (_tcslen (ie->name) > 0 && !_tcsicmp (tmp, ie->name)) { + inputmap_remap_counter = -2; + inputmap_remap_event = i; + inputmap_port_remap = inputmap_port; + input_find (hDlg, hDlg, 1, true, false); + break; + } + i++; + } + } break; case IDC_INPUTMAP_DELETE: if (workprefs.jports[inputmap_port].id == JPORT_CUSTOM) { @@ -13102,7 +13169,7 @@ static void ports_remap (HWND hDlg, int port) return; MSG msg; for (;;) { - DWORD ret = GetMessage (&msg, dlg, 0, 0); + DWORD ret = GetMessage (&msg, NULL, 0, 0); if (ret == -1 || ret == 0) break; if (rawmode) { diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index a8a892cb..6b23ca33 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,6 +1,23 @@ - restore only single input target to default. +Beta 11: + +- Blank left and right border if programmed mode and part of original borders would be outside of programmed hsync start and end period. +- Address error exception always started debugger, forgotten debug option disabled. +- Added Ts debugger command, list all exec residents. +- Restoring state file with harddrives crashed in some situations. (broke with previous filesystem updates) +- CD32 TOC entries were transmitted too quickly due to missing check, correct speed would have been one entry per CD frame (75/sec), + not one entry per scanline. CD command buffer overflowed and driver detected CD as broken if CD had enough tracks. + Old bug, was mostly invisible until 2.5.0 Universe TOC fix. (Super Street Fighter II Turbo and others CDs with lots of tracks) +- IDE emulation ignored optional forced physical cylinder number setting in config file. +- Both hires and superhires bits in BPLCON0 set: superhires mode active. +- 100Hz+ black frame insertion is now optional, setting in Misc panel. (Still D3D/low latency vsync only) +- GamePorts panel test/remap improved + - Implemented custom event add option. Select event from select box and click "Add", then press any button/key/etc to map it. + - Added event will be automatically removed if it does not have any mapped events (Works differently than normal events) + - Loading config file that has GamePorts panel custom added events using older version is not supported. + Beta 10: - SCSI CD MODE SENSE emulation fixes. -- 2.47.3