From: Toni Wilen Date: Sat, 25 Feb 2017 16:10:19 +0000 (+0200) Subject: 3410b2 X-Git-Tag: 3500~93 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=18f8414e53a76ab5a9fb3f70bca9cf31614c29f0;p=francis%2Fwinuae.git 3410b2 --- diff --git a/cfgfile.cpp b/cfgfile.cpp index e4d9aa7e..764d175b 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -2198,6 +2198,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite_bool (f, _T("cpu_no_unimplemented"), p->int_no_unimplemented); cfgfile_write_bool (f, _T("fpu_strict"), p->fpu_strict); cfgfile_dwrite_bool (f, _T("fpu_softfloat"), p->fpu_softfloat); + cfgfile_dwrite_bool (f, _T("fpu_arithmetic_exceptions"), p->fpu_exceptions); cfgfile_write_bool (f, _T("rtg_nocustom"), p->picasso96_nocustom); cfgfile_write (f, _T("rtg_modes"), _T("0x%x"), p->picasso96_modeflags); @@ -2951,7 +2952,10 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; if (cfgfile_yesno(option, value, _T("magic_mouse"), &vb)) { - p->input_mouse_untrap |= MOUSEUNTRAP_MAGIC; + if (vb) + p->input_mouse_untrap |= MOUSEUNTRAP_MAGIC; + else + p->input_mouse_untrap &= ~MOUSEUNTRAP_MAGIC; return 1; } @@ -4775,6 +4779,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_yesno (option, value, _T("serial_direct"), &p->serial_direct) || cfgfile_yesno (option, value, _T("fpu_strict"), &p->fpu_strict) || cfgfile_yesno (option, value, _T("fpu_softfloat"), &p->fpu_softfloat) + || cfgfile_yesno (option, value, _T("fpu_arithmetic_exceptions"), &p->fpu_exceptions) || cfgfile_yesno (option, value, _T("comp_nf"), &p->compnf) || cfgfile_yesno (option, value, _T("comp_constjump"), &p->comp_constjump) #ifdef USE_JIT_FPU @@ -6928,6 +6933,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type) p->int_no_unimplemented = false; p->fpu_strict = 0; p->fpu_softfloat = 0; + p->fpu_exceptions = 0; p->m68k_speed = 0; p->cpu_compatible = 1; p->address_space_24 = 1; @@ -6987,7 +6993,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type) p->input_tablet = TABLET_OFF; p->tablet_library = false; - p->input_mouse_untrap = MOUSEUNTRAP_NONE; + p->input_mouse_untrap = MOUSEUNTRAP_MIDDLEBUTTON; p->input_magic_mouse_cursor = 0; inputdevice_default_prefs (p); diff --git a/custom.cpp b/custom.cpp index 8066d232..a6cec001 100644 --- a/custom.cpp +++ b/custom.cpp @@ -1041,9 +1041,10 @@ STATIC_INLINE void compute_delay_offset (void) static void record_color_change2 (int hpos, int regno, unsigned long value) { - int pos = hpos * 2; - if (regno == 0x1000 + 0x10c) - pos++; // BPLCON4 change needs 1 lores pixel delay + int pos = (hpos * 2) * 4; + if (regno == 0x1000 + 0x10c) { + pos += 4; // BPLCON4 change needs 1 lores pixel delay + } curr_color_changes[next_color_change].linepos = pos; curr_color_changes[next_color_change].regno = regno; curr_color_changes[next_color_change].value = value; @@ -3035,11 +3036,11 @@ static void record_color_change (int hpos, int regno, unsigned long value) } pdip->last_color_change++; pdip->nr_color_changes++; - curr_color_changes[idx].linepos = (hpos + maxhpos) * 2 + extrahpos; + curr_color_changes[idx].linepos = ((hpos + maxhpos) * 2 + extrahpos) * 4; curr_color_changes[idx].regno = regno; curr_color_changes[idx].value = value; if (lastsync) { - curr_color_changes[idx + 1].linepos = hsyncstartpos * 2; + curr_color_changes[idx + 1].linepos = (hsyncstartpos * 2) * 4; curr_color_changes[idx + 1].regno = 0xffff; curr_color_changes[idx + 2].regno = -1; } else { @@ -7921,13 +7922,13 @@ static void hsync_scandoubler (void) for (idx1 = dip1->first_color_change; idx1 < dip1->last_color_change; idx1++) { struct color_change *cs2 = &curr_color_changes[idx1]; int regno = cs2->regno; - int hpos = cs2->linepos; + int hpos = cs2->linepos / 4; if (regno < 0x1000 && hpos < HBLANK_OFFSET && !(beamcon0 & 0x80) && prev_lineno >= 0) { struct draw_info *pdip = curr_drawinfo + next_lineno - 1; int idx = pdip->last_color_change; pdip->last_color_change++; pdip->nr_color_changes++; - curr_color_changes[idx].linepos = hpos + maxhpos + 1; + curr_color_changes[idx].linepos = (hpos + maxhpos + 1) * 4; curr_color_changes[idx].regno = regno; curr_color_changes[idx].value = cs2->value; curr_color_changes[idx + 1].regno = -1; diff --git a/devices.cpp b/devices.cpp index 7d452ca6..6b8ccb8a 100644 --- a/devices.cpp +++ b/devices.cpp @@ -465,7 +465,7 @@ void devices_pause(void) #endif blkdev_entergui(); #ifdef RETROPLATFORM - rp_pause(pause_emulation); + rp_pause(1); #endif pausevideograb(1); ethernet_pause(1); @@ -475,7 +475,7 @@ void devices_unpause(void) { blkdev_exitgui(); #ifdef RETROPLATFORM - rp_pause(pause_emulation); + rp_pause(0); #endif #ifdef WITH_PPC uae_ppc_pause(0); diff --git a/gencpu.cpp b/gencpu.cpp index 68475877..faf7b504 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -979,8 +979,9 @@ static void addopcycles_ce20 (int h, int t, int c, int subhead) if (h < 0) h = 0; - - c = 0; // HACK + + if (c < 8) // HACK + c = 0; // c = internal cycles needed after head cycles and before tail cycles. Not total cycles. addcycles_ce020 ("op", h, t, c - h - t, -subhead); @@ -1001,22 +1002,25 @@ static void addopcycles_ce20 (int h, int t, int c, int subhead) static void addop_ce020 (instr *curi, int subhead) { - if (!isce020()) - return; - int h = curi->head; - int t = curi->tail; - int c = curi->clocks; -#if 0 - if ((((curi->sduse & 2) && !isreg (curi->smode)) || (((curi->sduse >> 4) & 2) && !isreg (curi->dmode))) && using_waitstates) { - t += using_waitstates; - c += using_waitstates; + if (isce020()) { + int h = curi->head; + int t = curi->tail; + int c = curi->clocks; + #if 0 + if ((((curi->sduse & 2) && !isreg (curi->smode)) || (((curi->sduse >> 4) & 2) && !isreg (curi->dmode))) && using_waitstates) { + t += using_waitstates; + c += using_waitstates; + } + #endif + addopcycles_ce20 (h, t, c, -subhead); } -#endif - addopcycles_ce20 (h, t, c, -subhead); } static void addcycles_ea_ce020 (const char *ea, int h, int t, int c, int oph) { + if (!isce020()) + return; + head_cycs (h + oph); // if (!h && !h && !c && !oph) @@ -1754,7 +1758,7 @@ static void genamode (instr *curi, amodes mode, const char *reg, wordsizes size, // we have fixup already active = this genamode call is destination mode and we can now clear previous source fixup. clearmmufixup (0); } - if (isce020() && curi) + if (curi) addop_ce020 (curi, subhead); } @@ -3866,7 +3870,10 @@ static void gen_opcode (unsigned int opcode) printf ("\t\tif (frame == 0x0) { m68k_areg (regs, 7) += offset; break; }\n"); printf ("\t\telse if (frame == 0x1) { m68k_areg (regs, 7) += offset; }\n"); printf ("\t\telse if (frame == 0x2) { m68k_areg (regs, 7) += offset + 4; break; }\n"); - if (using_mmu == 68060) { + if (cpu_level >= 4) { + printf ("\t\telse if (frame == 0x3) { m68k_areg (regs, 7) += offset + 4; break; }\n"); + } + if (using_mmu == 68060) { printf ("\t\telse if (frame == 0x4) { m68k_do_rte_mmu060 (a); m68k_areg (regs, 7) += offset + 8; break; }\n"); } else if (cpu_level >= 4) { printf ("\t\telse if (frame == 0x4) { m68k_areg (regs, 7) += offset + 8; break; }\n"); @@ -5450,6 +5457,9 @@ end: sync_m68k_pc (); did_prefetch = 0; ipl_fetched = 0; + if (cpu_level >= 2 && !using_ce && !using_ce020) { + count_cycles = insn_n_cycles = curi->clocks; + } } static void generate_includes (FILE * f, int id) diff --git a/include/cpu_prefetch.h b/include/cpu_prefetch.h index 7699bc21..4db7b148 100644 --- a/include/cpu_prefetch.h +++ b/include/cpu_prefetch.h @@ -34,16 +34,20 @@ STATIC_INLINE uae_u32 get_long_020_prefetch (int o) STATIC_INLINE void limit_cycles_ce020(int clocks) { +#if 0 int cycs = clocks * cpucycleunit; int diff = regs.ce020endcycle - regs.ce020startcycle; if (diff <= cycs) return; regs.ce020startcycle = regs.ce020endcycle - cycs; +#endif } STATIC_INLINE void limit_all_cycles_ce020(void) { +#if 0 regs.ce020startcycle = regs.ce020endcycle; +#endif } // only for CPU internal cycles diff --git a/include/drawing.h b/include/drawing.h index d01d33d2..19d0f03c 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -53,6 +53,14 @@ extern bool aga_mode, direct_rgb; extern int visible_left_border, visible_right_border; extern int detected_screen_resolution; +STATIC_INLINE int shres_coord_hw_to_window_x (int x) +{ + x -= DISPLAY_LEFT_SHIFT << 2; + x <<= lores_shift; + x >>= 2; + return x; +} + STATIC_INLINE int coord_hw_to_window_x (int x) { x -= DISPLAY_LEFT_SHIFT; diff --git a/include/options.h b/include/options.h index 29863b78..fafed97e 100644 --- a/include/options.h +++ b/include/options.h @@ -472,6 +472,7 @@ struct uae_prefs { bool fpu_strict; bool fpu_softfloat; + bool fpu_exceptions; int gfx_framerate, gfx_autoframerate; struct wh gfx_size_win; diff --git a/main.cpp b/main.cpp index 9cebae5e..eba0d006 100644 --- a/main.cpp +++ b/main.cpp @@ -296,9 +296,10 @@ void fixup_cpu (struct uae_prefs *p) error_log (_T("JIT is not compatible with unimplemented CPU/FPU instruction emulation.")); p->fpu_no_unimplemented = p->int_no_unimplemented = false; } - if (p->cachesize && p->compfpu && p->fpu_softfloat) { + if (p->cachesize && p->compfpu && (p->fpu_softfloat || p->fpu_exceptions)) { error_log (_T("JIT FPU emulation is not compatible with softfloat FPU emulation.")); p->fpu_softfloat = false; + p->fpu_exceptions = false; } #if 0 diff --git a/newcpu.cpp b/newcpu.cpp index e6ceee1c..8efec75d 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -1561,7 +1561,8 @@ static int check_prefs_changed_cpu2(void) || currprefs.cpu_compatible != changed_prefs.cpu_compatible || currprefs.cpu_cycle_exact != changed_prefs.cpu_cycle_exact || currprefs.cpu_memory_cycle_exact != changed_prefs.cpu_memory_cycle_exact - || currprefs.fpu_softfloat != changed_prefs.fpu_softfloat) { + || currprefs.fpu_softfloat != changed_prefs.fpu_softfloat + || currprefs.fpu_exceptions != changed_prefs.fpu_exceptions) { cpu_prefs_changed_flag |= 1; } if (changed diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 5c0e594f..3eb50800 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -550,6 +550,7 @@ #define IDC_22KHZ 1233 #define IDC_SPEED_x86 1233 #define IDC_44KHZ 1234 +#define IDC_FPU_EXCEPTIONS 1234 #define IDC_48KHZ 1235 #define IDC_SOUNDSIZE 1236 #define IDC_FREQUENCY 1237 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 37435b69..dc018559 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -310,6 +310,7 @@ BEGIN CONTROL "Indirect",IDC_TRUST1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,221,299,72,10 CONTROL "No flags",IDC_NOFLAGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,299,299,68,11 CONTROL "Softfloat FPU emulation",IDC_FPU_SOFTFLOAT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,285,115,10 + CONTROL "Arithmetic exceptions",IDC_FPU_EXCEPTIONS,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,298,115,10 END IDD_FLOPPY DIALOGEX 0, 0, 396, 261 diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index bca67af2..254e1fef 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1137,7 +1137,6 @@ static void touch_release(struct touch_store *ts, const RECT *rcontrol) inputdevice_uaelib(_T("JOY2_2ND_BUTTON"), 0, 1, false); } if (ts->axis >= 0) { - const RECT *r = &rcontrol[ts->port]; if (ts->port == 0) { inputdevice_uaelib(_T("MOUSE1_HORIZ"), 0, -1, false); inputdevice_uaelib(_T("MOUSE1_VERT"), 0, -1, false); @@ -1294,6 +1293,10 @@ static void processtouch(HWND hwnd, WPARAM wParam, LPARAM lParam) { RECT rgui, rcontrol[2]; int bottom; + + if (currprefs.input_tablet) + return; + if (isfullscreen()) { rgui.left = amigawin_rect.left; rgui.top = amigawin_rect.top; @@ -3635,7 +3638,7 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) { struct midiportinfo *midp; - cfgfile_target_dwrite_bool (f, _T("middle_mouse"), (p->input_mouse_untrap & MOUSEUNTRAP_MIDDLEBUTTON) != 0); + cfgfile_target_write_bool (f, _T("middle_mouse"), (p->input_mouse_untrap & MOUSEUNTRAP_MIDDLEBUTTON) != 0); cfgfile_target_dwrite_bool (f, _T("logfile"), p->win32_logfile); cfgfile_target_dwrite_bool (f, _T("map_drives"), p->win32_automount_drives); cfgfile_target_dwrite_bool (f, _T("map_drives_auto"), p->win32_automount_removable); @@ -3804,6 +3807,8 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * if (cfgfile_yesno(option, value, _T("middle_mouse"), &tbool)) { if (tbool) p->input_mouse_untrap |= MOUSEUNTRAP_MIDDLEBUTTON; + else + p->input_mouse_untrap &= ~MOUSEUNTRAP_MIDDLEBUTTON; return 1; } diff --git a/od-win32/win32.h b/od-win32/win32.h index c3a8e5a1..4bc41381 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,12 +20,12 @@ #define LANG_DLL_FULL_VERSION_MATCH 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("1") +#define WINUAEBETA _T("2") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2017, 2, 11) +#define WINUAEDATE MAKEBD(2017, 2, 25) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 0f05e7f1..e4b0e96a 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -11313,6 +11313,7 @@ static void enable_for_cpudlg (HWND hDlg) ew (hDlg, IDC_COMPATIBLE_FPU, workprefs.fpu_model > 0); ew (hDlg, IDC_FPU_UNIMPLEMENTED, workprefs.fpu_model && !workprefs.cachesize); ew (hDlg, IDC_FPU_SOFTFLOAT, workprefs.fpu_model && (!workprefs.compfpu || !workprefs.cachesize)); + ew (hDlg, IDC_FPU_EXCEPTIONS, workprefs.fpu_model && (!workprefs.compfpu || !workprefs.cachesize) && workprefs.fpu_softfloat); ew (hDlg, IDC_CPU_UNIMPLEMENTED, workprefs.cpu_model == 68060 && !workprefs.cachesize); #if 0 ew (hDlg, IDC_CPU_MULTIPLIER, workprefs.cpu_cycle_exact); @@ -11360,6 +11361,7 @@ static void values_to_cpudlg (HWND hDlg) CheckDlgButton (hDlg, IDC_COMPATIBLE_FPU, workprefs.fpu_strict); CheckDlgButton (hDlg, IDC_FPU_UNIMPLEMENTED, !workprefs.fpu_no_unimplemented || workprefs.cachesize); CheckDlgButton (hDlg, IDC_FPU_SOFTFLOAT, workprefs.fpu_softfloat); + CheckDlgButton (hDlg, IDC_FPU_EXCEPTIONS, workprefs.fpu_exceptions); CheckDlgButton (hDlg, IDC_CPU_UNIMPLEMENTED, !workprefs.int_no_unimplemented || workprefs.cachesize); SendDlgItemMessage (hDlg, IDC_CPUIDLE, TBM_SETPOS, TRUE, workprefs.cpu_idle == 0 ? 0 : 12 - workprefs.cpu_idle / 15); SendDlgItemMessage (hDlg, IDC_PPC_CPUIDLE, TBM_SETPOS, TRUE, workprefs.ppc_cpu_idle); @@ -11420,6 +11422,7 @@ static void values_from_cpudlg (HWND hDlg) workprefs.fpu_strict = ischecked (hDlg, IDC_COMPATIBLE_FPU) ? 1 : 0; workprefs.fpu_no_unimplemented = ischecked (hDlg, IDC_FPU_UNIMPLEMENTED) ? 0 : 1; workprefs.fpu_softfloat = ischecked (hDlg, IDC_FPU_SOFTFLOAT) ? 1 : 0; + workprefs.fpu_exceptions = (ischecked (hDlg, IDC_FPU_EXCEPTIONS) ? 1 : 0) && workprefs.fpu_softfloat; workprefs.int_no_unimplemented = ischecked (hDlg, IDC_CPU_UNIMPLEMENTED) ? 0 : 1; workprefs.address_space_24 = ischecked (hDlg, IDC_COMPATIBLE24) ? 1 : 0; workprefs.m68k_speed = ischecked (hDlg, IDC_CS_HOST) ? -1 : 0; @@ -11520,6 +11523,7 @@ static void values_from_cpudlg (HWND hDlg) } if (workprefs.cachesize && workprefs.compfpu && workprefs.fpu_softfloat) { workprefs.fpu_softfloat = false; + workprefs.fpu_exceptions = false; setchecked(hDlg, IDC_FPU_SOFTFLOAT, false); } if (oldcache == 0 && workprefs.cachesize > 0) { diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 88f6e438..dec88b51 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -4,6 +4,21 @@ JIT Direct current rules are less complex now. It automatically switches off onl - RTG VRAM is outside of reserved natmem space. Workaround: Move RTG in earlier position using Hardware info GUI panel. Note that in 64-bit version RTG VRAM must be inside of reserved natmem space. (Outside = error message and return back to GUI) + +- FM801 16-bit audio corruption fixed. +- Some 68020 CE mode cycle-counting is back. +- Clear button state mask when mouse capture state changes. If mouse or joystick button was kept pressed when mouse was + uncaptured, button was kept pressed when capture state was restored even if real button was already pressed. +- G-REX and Cirrus Logic graphics board state was reset if autoconfig board info was re-scanned (entering RAM or HW Info panels) + and emulation was already running (3.4.0) +- Middle mouse button default is back to enabled. (was changed in b1) +- Magic mouse on the fly on change didn't work. +- FPU exception handling rewrite, arithmetic exceptions partially implemented (Andreas Grabher), 68040 unimplemented FSAVE + exception frame compatibility improved. Arithmetic exceptions are not that useful in Amiga emulation, programs that use FPU + arithmetic exceptions are very rare. I don't know any, report if you find one :) +- FPU arithmetic exceptions checkbox added to GUI for easier testing. Will be removed when exceptions are fully implemented. + Even when exceptions are disabled, they are still logged. Softfloat FPU only only. + Beta 1: - Quickstart Blizzard modes (except if JIT enabled) enabled 24-bit addressing which caused new autoconfig/fallback mode @@ -14,8 +29,10 @@ Beta 1: - Added Lock drive option to real harddrive mount dialog. If checked, all partitions in selected drive will be locked and unmounted when emulation is running, enabling full read/write access even if drive has Windows mounted FAT partition(s). Lock will be ignored if drive has one or more NTFS partitions. +- Add harddrive didn't accept magneto-optical devices. - Lots of softfloat FPU mode and normal FPU mode fixes and updates. (Andreas Grabher and me) - Softfloat FPU mode added to GUI, supports on the fly switching. +- Untrap middle mouse button option was stuck. - Implemented accurate 68020+ T0 trace mode emulation. (Original one has not been changed for ages..) - Fixed crash when sound card audio play started and mono sound channel mode and "Include CD and FMV audio" was ticked. - 271b3 "Blitter final D write don't increase "nasty" count" That is not true, I think this was only added to fix demo diff --git a/slirp/slirp.cpp b/slirp/slirp.cpp index b8e3cc01..cfc69fbe 100644 --- a/slirp/slirp.cpp +++ b/slirp/slirp.cpp @@ -85,7 +85,7 @@ static int get_dns_addr(struct in_addr *pdns_addr) static int get_dns_addr(struct in_addr *pdns_addr) { char buff[512]; - char buff2[256]; + char buff2[256+1]; FILE *f; int found = 0; struct in_addr tmp_addr;